"use strict"; (function() { var $goVersion = "go1.17.1"; 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 $linknames = {} // Collection of functions referenced by a go:linkname directive. 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 $externalize(fn(this, new ($sliceType($jsObjectPtr))($global.Array.prototype.slice.call(arguments, []))), $emptyInterface); }; }; var $unused = function(v) {}; var $print = console.log; // Under Node we can emulate print() more closely by avoiding a newline. if (($global.process !== undefined) && $global.require) { try { var util = $global.require('util'); $print = function() { $global.process.stderr.write(util.format.apply(this, arguments)); }; } catch (e) { // Failed to require util module, keep using console.log(). } } var $println = console.log var $initAllLinknames = function() { var names = $keys($packages); for (var i = 0; i < names.length; i++) { var f = $packages[names[i]]["$initLinknames"]; if (typeof f == 'function') { f(); } } } 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 (high === undefined) { high = slice.$length; } if (max === undefined) { max = slice.$capacity; } if (low < 0 || high < low || max < high || high > slice.$capacity || max > slice.$capacity) { $throwRuntimeError("slice bounds out of range"); } if (slice === slice.constructor.nil) { return slice; } var s = new slice.constructor(slice.$array); s.$offset = slice.$offset + low; s.$length = high - low; s.$capacity = max - low; return s; }; var $substring = function(str, low, high) { if (low < 0 || high < low || high > str.length) { $throwRuntimeError("slice bounds out of range"); } return str.substring(low, high); }; // Convert Go slice to an equivalent JS array type. var $sliceToNativeArray = function(slice) { 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); }; // Convert Go slice to a pointer to an underlying Go array. // // Note that an array pointer can be represented by an "unwrapped" native array // type, and it will be wrapped back into its Go type when necessary. var $sliceToGoArray = function(slice, arrayPtrType) { var arrayType = arrayPtrType.elem; if (arrayType !== undefined && slice.$length < arrayType.len) { $throwRuntimeError("cannot convert slice with length " + slice.$length + " to pointer to array with length " + arrayType.len); } if (slice == slice.constructor.nil) { return arrayPtrType.nil; // Nil slice converts to nil array pointer. } if (slice.$array.constructor !== Array) { return slice.$array.subarray(slice.$offset, slice.$offset + slice.$length); } if (slice.$offset == 0 && slice.$length == slice.$capacity && slice.$length == arrayType.len) { return slice.$array; } if (arrayType.len == 0) { return new arrayType([]); } // Array.slice (unlike TypedArray.subarray) returns a copy of an array range, // which is not sharing memory with the original one, which violates the spec // for slice to array conversion. This is incompatible with the Go spec, in // particular that the assignments to the array elements would be visible in // the slice. Prefer to fail explicitly instead of creating subtle bugs. $throwRuntimeError("gopherjs: non-numeric slice to underlying array conversion is not supported for subslices"); }; // Convert between compatible slice types (e.g. native and names). var $convertSliceType = function(slice, desiredType) { if (slice == slice.constructor.nil) { return desiredType.nil; // Preserve nil value. } return $subslice(new desiredType(slice.$array), 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 x48 = x.$high >>> 16; var x32 = x.$high & 0xFFFF; var x16 = x.$low >>> 16; var x00 = x.$low & 0xFFFF; var y48 = y.$high >>> 16; var y32 = y.$high & 0xFFFF; var y16 = y.$low >>> 16; var y00 = y.$low & 0xFFFF; var z48 = 0, z32 = 0, z16 = 0, z00 = 0; z00 += x00 * y00; z16 += z00 >>> 16; z00 &= 0xFFFF; z16 += x16 * y00; z32 += z16 >>> 16; z16 &= 0xFFFF; z16 += x00 * y16; z32 += z16 >>> 16; z16 &= 0xFFFF; z32 += x32 * y00; z48 += z32 >>> 16; z32 &= 0xFFFF; z32 += x16 * y16; z48 += z32 >>> 16; z32 &= 0xFFFF; z32 += x00 * y32; z48 += z32 >>> 16; z32 &= 0xFFFF; z48 += x48 * y00 + x32 * y16 + x16 * y32 + x00 * y48; z48 &= 0xFFFF; var hi = ((z48 << 16) | z32) >>> 0; var lo = ((z16 << 16) | z00) >>> 0; var r = new x.constructor(hi, lo); return r; }; var $div64 = function(x, y, returnRemainder) { if (y.$high === 0 && y.$low === 0) { $throwRuntimeError("integer divide by zero"); } var s = 1; var rs = 1; var xHigh = x.$high; var xLow = x.$low; if (xHigh < 0) { s = -1; rs = -1; xHigh = -xHigh; if (xLow !== 0) { xHigh--; xLow = 4294967296 - xLow; } } var yHigh = y.$high; var yLow = y.$low; if (y.$high < 0) { s *= -1; yHigh = -yHigh; if (yLow !== 0) { yHigh--; yLow = 4294967296 - yLow; } } var high = 0, low = 0, n = 0; while (yHigh < 2147483648 && ((xHigh > 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); }; // Creates constructor functions for array pointer types. Returns a new function // instace each time to make sure each type is independent of the other. var $arrayPtrCtor = function() { return function(array) { this.$get = function() { return array; }; this.$set = function(v) { typ.copy(this, v); }; this.$val = array; } } var $newType = function(size, kind, string, named, pkg, exported, 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, false, "", false, $arrayPtrCtor()); 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, false, pkg, exported, 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(pkgPath, fields) { typ.pkgPath = pkgPath; 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.embedded) { $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.named = named; typ.pkg = pkg; typ.exported = exported; 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.named) { 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.embedded) { 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", true, "", false, null); var $Int = $newType( 4, $kindInt, "int", true, "", false, null); var $Int8 = $newType( 1, $kindInt8, "int8", true, "", false, null); var $Int16 = $newType( 2, $kindInt16, "int16", true, "", false, null); var $Int32 = $newType( 4, $kindInt32, "int32", true, "", false, null); var $Int64 = $newType( 8, $kindInt64, "int64", true, "", false, null); var $Uint = $newType( 4, $kindUint, "uint", true, "", false, null); var $Uint8 = $newType( 1, $kindUint8, "uint8", true, "", false, null); var $Uint16 = $newType( 2, $kindUint16, "uint16", true, "", false, null); var $Uint32 = $newType( 4, $kindUint32, "uint32", true, "", false, null); var $Uint64 = $newType( 8, $kindUint64, "uint64", true, "", false, null); var $Uintptr = $newType( 4, $kindUintptr, "uintptr", true, "", false, null); var $Float32 = $newType( 4, $kindFloat32, "float32", true, "", false, null); var $Float64 = $newType( 8, $kindFloat64, "float64", true, "", false, null); var $Complex64 = $newType( 8, $kindComplex64, "complex64", true, "", false, null); var $Complex128 = $newType(16, $kindComplex128, "complex128", true, "", false, null); var $String = $newType( 8, $kindString, "string", true, "", false, null); var $UnsafePointer = $newType( 4, $kindUnsafePointer, "unsafe.Pointer", true, "unsafe", false, 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, false, "", false, null); $arrayTypes[typeKey] = typ; typ.init(elem, len); } return typ; }; var $chanType = function(elem, sendOnly, recvOnly) { var string = (recvOnly ? "<-" : "") + "chan" + (sendOnly ? "<- " : " "); if (!sendOnly && !recvOnly && (elem.string[0] == "<")) { string += "(" + elem.string + ")"; } else { string += elem.string; } var field = sendOnly ? "SendChan" : (recvOnly ? "RecvChan" : "Chan"); var typ = elem[field]; if (typ === undefined) { typ = $newType(4, $kindChan, string, false, "", false, 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, false, "", false, 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, false, "", false, null); $interfaceTypes[typeKey] = typ; typ.init(methods); } return typ; }; var $emptyInterface = $interfaceType([]); var $ifaceNil = {}; var $error = $newType(8, $kindInterface, "error", true, "", false, 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, false, "", false, 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, false, "", elem.exported, 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) { if (array.buffer) { // Pointers to the same underlying ArrayBuffer share cache. var cache = array.buffer.$ptr = array.buffer.$ptr || {}; // Pointers of different primitive types are non-comparable and stored in different caches. var typeCache = cache[array.name] = cache[array.name] || {}; var cacheIdx = array.BYTES_PER_ELEMENT * index + array.byteOffset; return typeCache[cacheIdx] || (typeCache[cacheIdx] = new constructor(function() { return array[index]; }, function(v) { array[index] = v; })); } else { 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, false, "", false, 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(pkgPath, 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) { var str = f.typ.string + (f.tag !== "" ? (" \"" + f.tag.replace(/\\/g, "\\\\").replace(/"/g, "\\\"") + "\"") : ""); if (f.embedded) { return str; } return f.name + " " + str; }).join("; ") + " }"; if (fields.length === 0) { string = "struct {}"; } typ = $newType(0, $kindStruct, string, false, "", false, function() { this.$val = this; for (var i = 0; i < fields.length; i++) { var f = fields[i]; if (f.name == '_') { continue; } var arg = arguments[i]; this[f.prop] = arg !== undefined ? arg : f.typ.zero(); } }); $structTypes[typeKey] = typ; typ.init(pkgPath, 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( $packages["runtime"]._type.ptr.nil, (value === $ifaceNil ? $packages["runtime"]._type.ptr.nil : new $packages["runtime"]._type.ptr(value.constructor.string)), new $packages["runtime"]._type.ptr(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 && $curGoroutine.deferStack.indexOf(deferred) == -1) { throw jsErr; } if (jsErr !== null) { var newErr = null; try { $panic(new $jsErrorPtr(jsErr)); } catch (err) { newErr = err; } $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) { /* error was recovered */ if (fromPanic) { throw null; } return; } } } catch(e) { // Deferred function threw a JavaScript exception or tries to unwind stack // to the point where a panic was handled. if (fromPanic) { // Re-throw the exception to reach deferral execution call at the end // of the function. throw e; } // We are at the end of the function, handle the error or re-throw to // continue unwinding if necessary, or simply stop unwinding if we got far // enough. $callDeferred(deferred, e, fromPanic); } 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 $noGoroutine = { asleep: false, exit: false, deferStack: [], panicStack: [] }; var $curGoroutine = $noGoroutine, $totalGoroutines = 0, $awakeGoroutines = 0, $checkForDeadlock = true, $exportedFunctions = 0; var $mainFinished = false; var $go = function(fun, args) { $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 = $noGoroutine; if ($goroutine.exit) { /* also set by runtime.Goexit() */ $totalGoroutines--; $goroutine.asleep = true; } if ($goroutine.asleep) { $awakeGoroutines--; if (!$mainFinished && $awakeGoroutines === 0 && $checkForDeadlock && $exportedFunctions === 0) { 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 = []; $schedule($goroutine); }; var $scheduled = []; var $runScheduled = function() { // For nested setTimeout calls browsers enforce 4ms minimum delay. We minimize // the effect of this penalty by queueing the timer preemptively before we run // the goroutines, and later cancelling it if it turns out unneeded. See: // https://developer.mozilla.org/en-US/docs/Web/API/setTimeout#nested_timeouts var nextRun = setTimeout($runScheduled); try { var start = Date.now(); var r; while ((r = $scheduled.shift()) !== undefined) { r(); // We need to interrupt this loop in order to allow the event loop to // process timers, IO, etc. However, invoking scheduling through // setTimeout is ~1000 times more expensive, so we amortize this cost by // looping until the 4ms minimal delay has elapsed (assuming there are // scheduled goroutines to run), and then yield to the event loop. var elapsed = Date.now() - start; if (elapsed > 4 || elapsed < 0) { break; } } } finally { if ($scheduled.length == 0) { // Cancel scheduling pass if there's nothing to run. clearTimeout(nextRun); } } }; var $schedule = function(goroutine) { if (goroutine.asleep) { goroutine.asleep = false; $awakeGoroutines++; } $scheduled.push(goroutine); if ($curGoroutine === $noGoroutine) { $runScheduled(); } }; var $setTimeout = function(f, t) { $awakeGoroutines++; return setTimeout(function() { $awakeGoroutines--; f(); }, t); }; var $block = function() { if ($curGoroutine === $noGoroutine) { $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; var closedDuringSend; chan.$sendQueue.push(function(closed) { closedDuringSend = closed; $schedule(thisGoroutine); return value; }); $block(); return { $blk: function() { if (closedDuringSend) { $throwRuntimeError("send on closed channel"); } } }; }; var $recv = function(chan) { var queuedSend = chan.$sendQueue.shift(); if (queuedSend !== undefined) { chan.$buffer.push(queuedSend(false)); } 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(true); /* will panic */ } 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, makeWrapper) { 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, makeWrapper); }); } return v; case $kindFunc: return $externalizeFunction(v, t, false, makeWrapper); case $kindInterface: if (v === $ifaceNil) { return null; } if (v.constructor === $jsObjectPtr) { return v.$val.object; } return $externalize(v.$val, v.constructor, makeWrapper); 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, makeWrapper)] = $externalize(entry.v, t.elem, makeWrapper); } return m; case $kindPtr: if (v === t.nil) { return null; } return $externalize(v.$get(), t.elem, makeWrapper); case $kindSlice: if ($needsExternalization(t.elem)) { return $mapArray($sliceToNativeArray(v), function(e) { return $externalize(e, t.elem, makeWrapper); }); } return $sliceToNativeArray(v); case $kindString: if ($isASCII(v)) { 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; } if (makeWrapper !== undefined) { return makeWrapper(v); } o = {}; for (var i = 0; i < t.fields.length; i++) { var f = t.fields[i]; if (!f.exported) { continue; } o[f.name] = $externalize(v[f.prop], f.typ, makeWrapper); } return o; } $throwRuntimeError("cannot externalize " + t.string); }; var $externalizeFunction = function(v, t, passThis, makeWrapper) { 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, makeWrapper)); } args.push(new (t.params[i])(varargs)); break; } args.push($internalize(arguments[i], t.params[i], makeWrapper)); } var result = v.apply(passThis ? this : undefined, args); switch (t.results.length) { case 0: return; case 1: return $externalize($copyIfRequired(result, t.results[0]), t.results[0], makeWrapper); default: for (var i = 0; i < t.results.length; i++) { result[i] = $externalize($copyIfRequired(result[i], t.results[i]), t.results[i], makeWrapper); } return result; } }; } return v.$externalizeWrapper; }; var $internalize = function(v, t, recv, seen, makeWrapper) { 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)); } // Cache for values we've already internalized in order to deal with circular // references. if (seen === undefined) { seen = new Map(); } if (!seen.has(t)) { seen.set(t, new Map()); } if (seen.get(t).has(v)) { return seen.get(t).get(v); } 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, makeWrapper); }); 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, makeWrapper)); } break; } args.push($externalize(arguments[i], t.params[i], makeWrapper)); } var result = v.apply(recv, args); switch (t.results.length) { case 0: return; case 1: return $internalize(result, t.results[0], makeWrapper); default: for (var i = 0; i < t.results.length; i++) { result[i] = $internalize(result[i], t.results[i], makeWrapper); } 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), makeWrapper); 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, makeWrapper)); case (function () { }).constructor: // is usually Function, but in Chrome extensions it is something else var funcType = $funcType([$sliceType($emptyInterface)], [$jsObjectPtr], true); return new funcType($internalize(v, funcType, makeWrapper)); case Number: return new $Float64(parseFloat(v)); case String: return new $String($internalize(v, $String, makeWrapper)); default: if ($global.Node && v instanceof $global.Node) { return new $jsObjectPtr(v); } var mapType = $mapType($String, $emptyInterface); return new mapType($internalize(v, mapType, recv, seen, makeWrapper)); } case $kindMap: var m = {}; seen.get(t).set(v, m); var keys = $keys(v); for (var i = 0; i < keys.length; i++) { var k = $internalize(keys[i], t.key, recv, seen, makeWrapper); m[t.key.keyFor(k)] = { k: k, v: $internalize(v[keys[i]], t.elem, recv, seen, makeWrapper) }; } return m; case $kindPtr: if (t.elem.kind === $kindStruct) { return $internalize(v, t.elem, makeWrapper); } case $kindSlice: return new t($mapArray(v, function(e) { return $internalize(e, t.elem, makeWrapper); })); case $kindString: v = String(v); if ($isASCII(v)) { 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); }; var $copyIfRequired = function(v, typ) { // interface values if (v && v.constructor && v.constructor.copy) { return new v.constructor($clone(v.$val, v.constructor)) } // array and struct values if (typ.copy) { var clone = typ.zero(); typ.copy(clone, v); return clone; } return v; } /* $isASCII reports whether string s contains only ASCII characters. */ var $isASCII = function(s) { for (var i = 0; i < s.length; i++) { if (s.charCodeAt(i) >= 128) { return false; } } return true; }; $packages["github.com/gopherjs/gopherjs/js"] = (function() { var $pkg = {}, $init, Object, Error, sliceType, ptrType, ptrType$1, MakeFunc, init; Object = $pkg.Object = $newType(0, $kindStruct, "js.Object", true, "github.com/gopherjs/gopherjs/js", true, function(object_) { this.$val = this; if (arguments.length === 0) { this.object = null; return; } this.object = object_; }); Error = $pkg.Error = $newType(0, $kindStruct, "js.Error", true, "github.com/gopherjs/gopherjs/js", true, 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 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 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 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 o; o = this; return $parseInt(o.object.length); }; Object.prototype.Length = function() { return this.$val.Length(); }; Object.ptr.prototype.Index = function(i) { var 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 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 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 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 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 o; o = this; return !!(o.object); }; Object.prototype.Bool = function() { return this.$val.Bool(); }; Object.ptr.prototype.String = function() { var o; o = this; return $internalize(o.object, $String); }; Object.prototype.String = function() { return this.$val.String(); }; Object.ptr.prototype.Int = function() { var o; o = this; return $parseInt(o.object) >> 0; }; Object.prototype.Int = function() { return this.$val.Int(); }; Object.ptr.prototype.Int64 = function() { var o; o = this; return $internalize(o.object, $Int64); }; Object.prototype.Int64 = function() { return this.$val.Int64(); }; Object.ptr.prototype.Uint64 = function() { var o; o = this; return $internalize(o.object, $Uint64); }; Object.prototype.Uint64 = function() { return this.$val.Uint64(); }; Object.ptr.prototype.Float = function() { var o; o = this; return $parseFloat(o.object); }; Object.prototype.Float = function() { return this.$val.Float(); }; Object.ptr.prototype.Interface = function() { var o; o = this; return $internalize(o.object, $emptyInterface); }; Object.prototype.Interface = function() { return this.$val.Interface(); }; Object.ptr.prototype.Unsafe = function() { var o; o = this; return o.object; }; Object.prototype.Unsafe = function() { return this.$val.Unsafe(); }; Error.ptr.prototype.Error = function() { var 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 err; err = this; return $internalize(err.Object.stack, $String); }; Error.prototype.Stack = function() { return this.$val.Stack(); }; MakeFunc = function(fn) { var fn; return $makeFunc(fn); }; $pkg.MakeFunc = MakeFunc; init = function() { var e; e = new Error.ptr(null); $unused(e); }; 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("github.com/gopherjs/gopherjs/js", [{prop: "object", name: "object", embedded: false, exported: false, typ: ptrType, tag: ""}]); Error.init("", [{prop: "Object", name: "Object", embedded: true, exported: true, 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, _type, TypeAssertionError, basicFrame, Frames, Frame, Func, errorString, ptrType, sliceType, ptrType$1, structType, sliceType$1, sliceType$2, ptrType$2, ptrType$3, knownPositions, positionCounters, buildVersion, init, GOROOT, registerPosition, itoa, callstack, parseCallstack, ParseCallFrame, Caller, Callers, CallersFrames, Goexit, SetFinalizer, FuncForPC, Stack, KeepAlive, throw$1, nanotime, fastrand; js = $packages["github.com/gopherjs/gopherjs/js"]; sys = $packages["runtime/internal/sys"]; _type = $pkg._type = $newType(0, $kindStruct, "runtime._type", true, "runtime", false, function(str_) { this.$val = this; if (arguments.length === 0) { this.str = ""; return; } this.str = str_; }); TypeAssertionError = $pkg.TypeAssertionError = $newType(0, $kindStruct, "runtime.TypeAssertionError", true, "runtime", true, function(_interface_, concrete_, asserted_, missingMethod_) { this.$val = this; if (arguments.length === 0) { this._interface = ptrType$1.nil; this.concrete = ptrType$1.nil; this.asserted = ptrType$1.nil; this.missingMethod = ""; return; } this._interface = _interface_; this.concrete = concrete_; this.asserted = asserted_; this.missingMethod = missingMethod_; }); basicFrame = $pkg.basicFrame = $newType(0, $kindStruct, "runtime.basicFrame", true, "runtime", false, function(FuncName_, File_, Line_) { this.$val = this; if (arguments.length === 0) { this.FuncName = ""; this.File = ""; this.Line = 0; return; } this.FuncName = FuncName_; this.File = File_; this.Line = Line_; }); Frames = $pkg.Frames = $newType(0, $kindStruct, "runtime.Frames", true, "runtime", true, function(frames_, current_) { this.$val = this; if (arguments.length === 0) { this.frames = sliceType$2.nil; this.current = 0; return; } this.frames = frames_; this.current = current_; }); Frame = $pkg.Frame = $newType(0, $kindStruct, "runtime.Frame", true, "runtime", true, function(PC_, Func_, Function_, File_, Line_, Entry_) { this.$val = this; if (arguments.length === 0) { this.PC = 0; this.Func = ptrType.nil; this.Function = ""; this.File = ""; this.Line = 0; this.Entry = 0; return; } this.PC = PC_; this.Func = Func_; this.Function = Function_; this.File = File_; this.Line = Line_; this.Entry = Entry_; }); Func = $pkg.Func = $newType(0, $kindStruct, "runtime.Func", true, "runtime", true, function(name_, file_, line_, opaque_) { this.$val = this; if (arguments.length === 0) { this.name = ""; this.file = ""; this.line = 0; this.opaque = new structType.ptr(); return; } this.name = name_; this.file = file_; this.line = line_; this.opaque = opaque_; }); errorString = $pkg.errorString = $newType(8, $kindString, "runtime.errorString", true, "runtime", false, null); ptrType = $ptrType(Func); sliceType = $sliceType(ptrType); ptrType$1 = $ptrType(_type); structType = $structType("", []); sliceType$1 = $sliceType(basicFrame); sliceType$2 = $sliceType(Frame); ptrType$2 = $ptrType(TypeAssertionError); ptrType$3 = $ptrType(Frames); _type.ptr.prototype.string = function() { var t; t = this; return t.str; }; _type.prototype.string = function() { return this.$val.string(); }; _type.ptr.prototype.pkgpath = function() { var t; t = this; return ""; }; _type.prototype.pkgpath = function() { return this.$val.pkgpath(); }; TypeAssertionError.ptr.prototype.RuntimeError = function() { }; TypeAssertionError.prototype.RuntimeError = function() { return this.$val.RuntimeError(); }; TypeAssertionError.ptr.prototype.Error = function() { var as, cs, e, inter, msg; e = this; inter = "interface"; if (!(e._interface === ptrType$1.nil)) { inter = e._interface.string(); } as = e.asserted.string(); if (e.concrete === ptrType$1.nil) { return "interface conversion: " + inter + " is nil, not " + as; } cs = e.concrete.string(); if (e.missingMethod === "") { msg = "interface conversion: " + inter + " is " + cs + ", not " + as; if (cs === as) { if (!(e.concrete.pkgpath() === e.asserted.pkgpath())) { msg = msg + (" (types from different packages)"); } else { msg = msg + (" (types from different scopes)"); } } return msg; } return "interface conversion: " + cs + " is not " + as + ": missing method " + e.missingMethod; }; TypeAssertionError.prototype.Error = function() { return this.$val.Error(); }; init = function() { var e, jsPkg; jsPkg = $packages[$externalize("github.com/gopherjs/gopherjs/js", $String)]; $jsObjectPtr = jsPkg.Object.ptr; $jsErrorPtr = jsPkg.Error.ptr; $throwRuntimeError = throw$1; buildVersion = $internalize($goVersion, $String); e = $ifaceNil; e = new TypeAssertionError.ptr(ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, ""); $unused(e); }; GOROOT = function() { var process, v, v$1; process = $global.process; if (process === undefined) { return "/"; } v = process.env.GOPHERJS_GOROOT; if (!(v === undefined) && !($internalize(v, $String) === "")) { return $internalize(v, $String); } else { v$1 = process.env.GOROOT; if (!(v$1 === undefined) && !($internalize(v$1, $String) === "")) { return $internalize(v$1, $String); } } return "/usr/local/go"; }; $pkg.GOROOT = GOROOT; registerPosition = function(funcName, file, line) { var _entry, _key, _tuple, f, file, found, funcName, key, line, pc, pc$1; key = file + ":" + itoa(line); _tuple = (_entry = knownPositions[$String.keyFor(key)], _entry !== undefined ? [_entry.v, true] : [0, false]); pc = _tuple[0]; found = _tuple[1]; if (found) { return pc; } f = new Func.ptr(funcName, file, line, new structType.ptr()); pc$1 = ((positionCounters.$length >>> 0)); positionCounters = $append(positionCounters, f); _key = key; (knownPositions || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: pc$1 }; return pc$1; }; itoa = function(i) { var i; return $internalize(new ($global.String)(i), $String); }; callstack = function(skip, limit) { var limit, lines, skip; skip = (skip + 1 >> 0) + 1 >> 0; lines = new ($global.Error)().stack.split($externalize("\n", $String)).slice(skip, skip + limit >> 0); return parseCallstack(lines); }; parseCallstack = function(lines) { var frames, i, l, lines; frames = new sliceType$1([]); l = $parseInt(lines.length); i = 0; while (true) { if (!(i < l)) { break; } frames = $append(frames, ParseCallFrame(lines[i])); i = i + (1) >> 0; } return frames; }; ParseCallFrame = function(info) { var _tmp, _tmp$1, file, fn, funcName, idx, info, line, openIdx, parts, parts$1, parts$2, pos, split; if (($parseInt(info.indexOf($externalize("@", $String))) >> 0) >= 0) { split = new ($global.RegExp)($externalize("[@:]", $String)); parts = info.split(split); return new basicFrame.ptr($internalize(parts[0], $String), $internalize(parts.slice(1, $parseInt(parts.length) - 2 >> 0).join($externalize(":", $String)), $String), $parseInt(parts[($parseInt(parts.length) - 2 >> 0)]) >> 0); } openIdx = $parseInt(info.lastIndexOf($externalize("(", $String))) >> 0; if (openIdx === -1) { parts$1 = info.split($externalize(":", $String)); return new basicFrame.ptr("", $internalize(parts$1.slice(0, $parseInt(parts$1.length) - 2 >> 0).join($externalize(":", $String)).replace(new ($global.RegExp)($externalize("^\\s*at ", $String)), $externalize("", $String)), $String), $parseInt(parts$1[($parseInt(parts$1.length) - 2 >> 0)]) >> 0); } _tmp = ""; _tmp$1 = ""; file = _tmp; funcName = _tmp$1; line = 0; pos = info.substring(openIdx + 1 >> 0, $parseInt(info.indexOf($externalize(")", $String))) >> 0); parts$2 = pos.split($externalize(":", $String)); if ($internalize(pos, $String) === "") { file = ""; } else { file = $internalize(parts$2.slice(0, $parseInt(parts$2.length) - 2 >> 0).join($externalize(":", $String)), $String); line = $parseInt(parts$2[($parseInt(parts$2.length) - 2 >> 0)]) >> 0; } fn = info.substring(($parseInt(info.indexOf($externalize("at ", $String))) >> 0) + 3 >> 0, $parseInt(info.indexOf($externalize(" (", $String))) >> 0); idx = $parseInt(fn.indexOf($externalize("[as ", $String))) >> 0; if (idx > 0) { fn = fn.substring(idx + 4 >> 0, fn.indexOf($externalize("]", $String))); } funcName = $internalize(fn, $String); return new basicFrame.ptr(funcName, file, line); }; $pkg.ParseCallFrame = ParseCallFrame; Caller = function(skip) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, file, frames, line, ok, pc, skip; pc = 0; file = ""; line = 0; ok = false; skip = skip + 1 >> 0; frames = callstack(skip, 1); if (!((frames.$length === 1))) { _tmp = 0; _tmp$1 = ""; _tmp$2 = 0; _tmp$3 = false; pc = _tmp; file = _tmp$1; line = _tmp$2; ok = _tmp$3; return [pc, file, line, ok]; } pc = registerPosition((0 >= frames.$length ? ($throwRuntimeError("index out of range"), undefined) : frames.$array[frames.$offset + 0]).FuncName, (0 >= frames.$length ? ($throwRuntimeError("index out of range"), undefined) : frames.$array[frames.$offset + 0]).File, (0 >= frames.$length ? ($throwRuntimeError("index out of range"), undefined) : frames.$array[frames.$offset + 0]).Line); _tmp$4 = pc; _tmp$5 = (0 >= frames.$length ? ($throwRuntimeError("index out of range"), undefined) : frames.$array[frames.$offset + 0]).File; _tmp$6 = (0 >= frames.$length ? ($throwRuntimeError("index out of range"), undefined) : frames.$array[frames.$offset + 0]).Line; _tmp$7 = true; pc = _tmp$4; file = _tmp$5; line = _tmp$6; ok = _tmp$7; return [pc, file, line, ok]; }; $pkg.Caller = Caller; Callers = function(skip, pc) { var _i, _ref, frame, frames, i, pc, skip; frames = callstack(skip, pc.$length); _ref = frames; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; frame = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), basicFrame); ((i < 0 || i >= pc.$length) ? ($throwRuntimeError("index out of range"), undefined) : pc.$array[pc.$offset + i] = registerPosition(frame.FuncName, frame.File, frame.Line)); _i++; } return frames.$length; }; $pkg.Callers = Callers; CallersFrames = function(callers) { var _i, _ref, callers, fun, pc, result; result = new Frames.ptr(sliceType$2.nil, 0); _ref = callers; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } pc = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); fun = FuncForPC(pc); result.frames = $append(result.frames, new Frame.ptr(pc, fun, fun.name, fun.file, fun.line, fun.Entry())); _i++; } return result; }; $pkg.CallersFrames = CallersFrames; Frames.ptr.prototype.Next = function() { var _tmp, _tmp$1, _tmp$2, _tmp$3, ci, f, frame, more, x, x$1; frame = new Frame.ptr(0, ptrType.nil, "", "", 0, 0); more = false; ci = this; if (ci.current >= ci.frames.$length) { _tmp = new Frame.ptr(0, ptrType.nil, "", "", 0, 0); _tmp$1 = false; Frame.copy(frame, _tmp); more = _tmp$1; return [frame, more]; } f = $clone((x = ci.frames, x$1 = ci.current, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])), Frame); ci.current = ci.current + (1) >> 0; _tmp$2 = $clone(f, Frame); _tmp$3 = ci.current < ci.frames.$length; Frame.copy(frame, _tmp$2); more = _tmp$3; return [frame, more]; }; Frames.prototype.Next = function() { return this.$val.Next(); }; Goexit = function() { $curGoroutine.exit = $externalize(true, $Bool); $throw(null); }; $pkg.Goexit = Goexit; SetFinalizer = function(x, f) { var f, x; }; $pkg.SetFinalizer = SetFinalizer; Func.ptr.prototype.Entry = function() { return 0; }; Func.prototype.Entry = function() { return this.$val.Entry(); }; Func.ptr.prototype.FileLine = function(pc) { var _tmp, _tmp$1, _tmp$2, _tmp$3, f, file, line, pc; file = ""; line = 0; f = this; if (f === ptrType.nil) { _tmp = ""; _tmp$1 = 0; file = _tmp; line = _tmp$1; return [file, line]; } _tmp$2 = f.file; _tmp$3 = f.line; file = _tmp$2; line = _tmp$3; return [file, line]; }; Func.prototype.FileLine = function(pc) { return this.$val.FileLine(pc); }; Func.ptr.prototype.Name = function() { var f; f = this; if (f === ptrType.nil || f.name === "") { return ""; } return f.name; }; Func.prototype.Name = function() { return this.$val.Name(); }; FuncForPC = function(pc) { var ipc, pc; ipc = ((pc >> 0)); if (ipc >= positionCounters.$length) { $panic(new $String("GopherJS: pc=" + itoa(ipc) + " is out of range of known position counters")); } return ((ipc < 0 || ipc >= positionCounters.$length) ? ($throwRuntimeError("index out of range"), undefined) : positionCounters.$array[positionCounters.$offset + ipc]); }; $pkg.FuncForPC = FuncForPC; Stack = function(buf, all) { var all, buf, s; s = new ($global.Error)().stack; if (s === undefined) { return 0; } return $copyString(buf, $internalize(s.substr(($parseInt(s.indexOf($externalize("\n", $String))) >> 0) + 1 >> 0), $String)); }; $pkg.Stack = Stack; KeepAlive = function(param) { var param; }; $pkg.KeepAlive = KeepAlive; errorString.prototype.RuntimeError = function() { var e; e = this.$val; }; $ptrType(errorString).prototype.RuntimeError = function() { return new errorString(this.$get()).RuntimeError(); }; errorString.prototype.Error = function() { var e; e = this.$val; return "runtime error: " + (e); }; $ptrType(errorString).prototype.Error = function() { return new errorString(this.$get()).Error(); }; throw$1 = function(s) { var s; $panic(new errorString((s))); }; nanotime = function() { return $mul64($internalize(new ($global.Date)().getTime(), $Int64), new $Int64(0, 1000000)); }; $linknames["runtime.nanotime"] = nanotime; fastrand = function() { return (($parseFloat($global.Math.random()) * 4.294967295e+09 >> 0)); }; $linknames["runtime.fastrand"] = fastrand; ptrType$1.methods = [{prop: "string", name: "string", pkg: "runtime", typ: $funcType([], [$String], false)}, {prop: "pkgpath", name: "pkgpath", pkg: "runtime", typ: $funcType([], [$String], false)}]; ptrType$2.methods = [{prop: "RuntimeError", name: "RuntimeError", pkg: "", typ: $funcType([], [], false)}, {prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$3.methods = [{prop: "Next", name: "Next", pkg: "", typ: $funcType([], [Frame, $Bool], false)}]; ptrType.methods = [{prop: "Entry", name: "Entry", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "FileLine", name: "FileLine", pkg: "", typ: $funcType([$Uintptr], [$String, $Int], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}]; errorString.methods = [{prop: "RuntimeError", name: "RuntimeError", pkg: "", typ: $funcType([], [], false)}, {prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; _type.init("runtime", [{prop: "str", name: "str", embedded: false, exported: false, typ: $String, tag: ""}]); TypeAssertionError.init("runtime", [{prop: "_interface", name: "_interface", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "concrete", name: "concrete", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "asserted", name: "asserted", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "missingMethod", name: "missingMethod", embedded: false, exported: false, typ: $String, tag: ""}]); basicFrame.init("", [{prop: "FuncName", name: "FuncName", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "File", name: "File", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Line", name: "Line", embedded: false, exported: true, typ: $Int, tag: ""}]); Frames.init("runtime", [{prop: "frames", name: "frames", embedded: false, exported: false, typ: sliceType$2, tag: ""}, {prop: "current", name: "current", embedded: false, exported: false, typ: $Int, tag: ""}]); Frame.init("", [{prop: "PC", name: "PC", embedded: false, exported: true, typ: $Uintptr, tag: ""}, {prop: "Func", name: "Func", embedded: false, exported: true, typ: ptrType, tag: ""}, {prop: "Function", name: "Function", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "File", name: "File", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Line", name: "Line", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Entry", name: "Entry", embedded: false, exported: true, typ: $Uintptr, tag: ""}]); Func.init("runtime", [{prop: "name", name: "name", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "file", name: "file", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "line", name: "line", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "opaque", name: "opaque", embedded: false, exported: false, typ: structType, 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; } buildVersion = ""; knownPositions = $makeMap($String.keyFor, []); positionCounters = new sliceType([]); init(); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["internal/unsafeheader"] = (function() { var $pkg = {}, $init, Slice; Slice = $pkg.Slice = $newType(0, $kindStruct, "unsafeheader.Slice", true, "internal/unsafeheader", true, function(Data_, Len_, Cap_) { this.$val = this; if (arguments.length === 0) { this.Data = 0; this.Len = 0; this.Cap = 0; return; } this.Data = Data_; this.Len = Len_; this.Cap = Cap_; }); Slice.init("", [{prop: "Data", name: "Data", embedded: false, exported: true, typ: $UnsafePointer, tag: ""}, {prop: "Len", name: "Len", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Cap", name: "Cap", embedded: false, exported: true, 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: /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["internal/reflectlite"] = (function() { var $pkg = {}, $init, js, unsafeheader, runtime, Value, flag, ValueError, Type, Kind, tflag, rtype, method, chanDir, arrayType, chanType, imethod, interfaceType, mapType, ptrType, sliceType, structField, structType, nameOff, typeOff, textOff, errorString, Method, uncommonType, funcType, name, nameData, mapIter, TypeEx, ptrType$1, sliceType$1, sliceType$2, sliceType$3, sliceType$4, ptrType$2, funcType$1, ptrType$4, sliceType$5, ptrType$5, sliceType$6, ptrType$6, ptrType$7, sliceType$7, sliceType$8, sliceType$9, sliceType$10, ptrType$8, structType$2, ptrType$9, arrayType$2, sliceType$13, ptrType$10, funcType$2, ptrType$11, funcType$3, ptrType$12, ptrType$13, kindNames, callHelper, initialized, uint8Type, idJsType, idReflectType, idKindType, idRtype, uncommonTypeMap, nameMap, nameOffList, typeOffList, jsObjectPtr, selectHelper, implements$1, directlyAssignable, haveIdenticalType, haveIdenticalUnderlyingType, toType, ifaceIndir, unquote, Swapper, init, jsType, reflectType, setKindType, newName, newNameOff, newTypeOff, internalStr, isWrapped, copyStruct, makeValue, TypeOf, ValueOf, FuncOf, SliceOf, unsafe_New, typedmemmove, keyFor, mapaccess, mapiterinit, mapiterkey, mapiternext, maplen, methodReceiver, valueInterface, ifaceE2I, methodName, makeMethodValue, wrapJsObject, unwrapJsObject, getJsTag, PtrTo, copyVal; js = $packages["github.com/gopherjs/gopherjs/js"]; unsafeheader = $packages["internal/unsafeheader"]; runtime = $packages["runtime"]; Value = $pkg.Value = $newType(0, $kindStruct, "reflectlite.Value", true, "internal/reflectlite", true, 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, "reflectlite.flag", true, "internal/reflectlite", false, null); ValueError = $pkg.ValueError = $newType(0, $kindStruct, "reflectlite.ValueError", true, "internal/reflectlite", true, function(Method_, Kind_) { this.$val = this; if (arguments.length === 0) { this.Method = ""; this.Kind = 0; return; } this.Method = Method_; this.Kind = Kind_; }); Type = $pkg.Type = $newType(8, $kindInterface, "reflectlite.Type", true, "internal/reflectlite", true, null); Kind = $pkg.Kind = $newType(4, $kindUint, "reflectlite.Kind", true, "internal/reflectlite", true, null); tflag = $pkg.tflag = $newType(1, $kindUint8, "reflectlite.tflag", true, "internal/reflectlite", false, null); rtype = $pkg.rtype = $newType(0, $kindStruct, "reflectlite.rtype", true, "internal/reflectlite", false, function(size_, ptrdata_, hash_, tflag_, align_, fieldAlign_, kind_, equal_, gcdata_, str_, ptrToThis_) { this.$val = this; if (arguments.length === 0) { this.size = 0; this.ptrdata = 0; this.hash = 0; this.tflag = 0; this.align = 0; this.fieldAlign = 0; this.kind = 0; this.equal = $throwNilPointerError; this.gcdata = ptrType$6.nil; this.str = 0; this.ptrToThis = 0; return; } this.size = size_; this.ptrdata = ptrdata_; this.hash = hash_; this.tflag = tflag_; this.align = align_; this.fieldAlign = fieldAlign_; this.kind = kind_; this.equal = equal_; this.gcdata = gcdata_; this.str = str_; this.ptrToThis = ptrToThis_; }); method = $pkg.method = $newType(0, $kindStruct, "reflectlite.method", true, "internal/reflectlite", false, function(name_, mtyp_, ifn_, tfn_) { this.$val = this; if (arguments.length === 0) { this.name = 0; this.mtyp = 0; this.ifn = 0; this.tfn = 0; return; } this.name = name_; this.mtyp = mtyp_; this.ifn = ifn_; this.tfn = tfn_; }); chanDir = $pkg.chanDir = $newType(4, $kindInt, "reflectlite.chanDir", true, "internal/reflectlite", false, null); arrayType = $pkg.arrayType = $newType(0, $kindStruct, "reflectlite.arrayType", true, "internal/reflectlite", false, function(rtype_, elem_, slice_, len_) { this.$val = this; if (arguments.length === 0) { this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0); 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, "reflectlite.chanType", true, "internal/reflectlite", false, function(rtype_, elem_, dir_) { this.$val = this; if (arguments.length === 0) { this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0); this.elem = ptrType$1.nil; this.dir = 0; return; } this.rtype = rtype_; this.elem = elem_; this.dir = dir_; }); imethod = $pkg.imethod = $newType(0, $kindStruct, "reflectlite.imethod", true, "internal/reflectlite", false, function(name_, typ_) { this.$val = this; if (arguments.length === 0) { this.name = 0; this.typ = 0; return; } this.name = name_; this.typ = typ_; }); interfaceType = $pkg.interfaceType = $newType(0, $kindStruct, "reflectlite.interfaceType", true, "internal/reflectlite", false, function(rtype_, pkgPath_, methods_) { this.$val = this; if (arguments.length === 0) { this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0); this.pkgPath = new name.ptr(ptrType$6.nil); this.methods = sliceType$9.nil; return; } this.rtype = rtype_; this.pkgPath = pkgPath_; this.methods = methods_; }); mapType = $pkg.mapType = $newType(0, $kindStruct, "reflectlite.mapType", true, "internal/reflectlite", false, function(rtype_, key_, elem_, bucket_, hasher_, keysize_, valuesize_, bucketsize_, flags_) { this.$val = this; if (arguments.length === 0) { this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0); this.key = ptrType$1.nil; this.elem = ptrType$1.nil; this.bucket = ptrType$1.nil; this.hasher = $throwNilPointerError; this.keysize = 0; this.valuesize = 0; this.bucketsize = 0; this.flags = 0; return; } this.rtype = rtype_; this.key = key_; this.elem = elem_; this.bucket = bucket_; this.hasher = hasher_; this.keysize = keysize_; this.valuesize = valuesize_; this.bucketsize = bucketsize_; this.flags = flags_; }); ptrType = $pkg.ptrType = $newType(0, $kindStruct, "reflectlite.ptrType", true, "internal/reflectlite", false, function(rtype_, elem_) { this.$val = this; if (arguments.length === 0) { this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0); this.elem = ptrType$1.nil; return; } this.rtype = rtype_; this.elem = elem_; }); sliceType = $pkg.sliceType = $newType(0, $kindStruct, "reflectlite.sliceType", true, "internal/reflectlite", false, function(rtype_, elem_) { this.$val = this; if (arguments.length === 0) { this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0); this.elem = ptrType$1.nil; return; } this.rtype = rtype_; this.elem = elem_; }); structField = $pkg.structField = $newType(0, $kindStruct, "reflectlite.structField", true, "internal/reflectlite", false, function(name_, typ_, offsetEmbed_) { this.$val = this; if (arguments.length === 0) { this.name = new name.ptr(ptrType$6.nil); this.typ = ptrType$1.nil; this.offsetEmbed = 0; return; } this.name = name_; this.typ = typ_; this.offsetEmbed = offsetEmbed_; }); structType = $pkg.structType = $newType(0, $kindStruct, "reflectlite.structType", true, "internal/reflectlite", false, function(rtype_, pkgPath_, fields_) { this.$val = this; if (arguments.length === 0) { this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0); this.pkgPath = new name.ptr(ptrType$6.nil); this.fields = sliceType$10.nil; return; } this.rtype = rtype_; this.pkgPath = pkgPath_; this.fields = fields_; }); nameOff = $pkg.nameOff = $newType(4, $kindInt32, "reflectlite.nameOff", true, "internal/reflectlite", false, null); typeOff = $pkg.typeOff = $newType(4, $kindInt32, "reflectlite.typeOff", true, "internal/reflectlite", false, null); textOff = $pkg.textOff = $newType(4, $kindInt32, "reflectlite.textOff", true, "internal/reflectlite", false, null); errorString = $pkg.errorString = $newType(0, $kindStruct, "reflectlite.errorString", true, "internal/reflectlite", false, function(s_) { this.$val = this; if (arguments.length === 0) { this.s = ""; return; } this.s = s_; }); Method = $pkg.Method = $newType(0, $kindStruct, "reflectlite.Method", true, "internal/reflectlite", true, 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_; }); uncommonType = $pkg.uncommonType = $newType(0, $kindStruct, "reflectlite.uncommonType", true, "internal/reflectlite", false, function(pkgPath_, mcount_, xcount_, moff_, _methods_) { this.$val = this; if (arguments.length === 0) { this.pkgPath = 0; this.mcount = 0; this.xcount = 0; this.moff = 0; this._methods = sliceType$5.nil; return; } this.pkgPath = pkgPath_; this.mcount = mcount_; this.xcount = xcount_; this.moff = moff_; this._methods = _methods_; }); funcType = $pkg.funcType = $newType(0, $kindStruct, "reflectlite.funcType", true, "internal/reflectlite", false, function(rtype_, inCount_, outCount_, _in_, _out_) { this.$val = this; if (arguments.length === 0) { this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0); this.inCount = 0; this.outCount = 0; this._in = sliceType$2.nil; this._out = sliceType$2.nil; return; } this.rtype = rtype_; this.inCount = inCount_; this.outCount = outCount_; this._in = _in_; this._out = _out_; }); name = $pkg.name = $newType(0, $kindStruct, "reflectlite.name", true, "internal/reflectlite", false, function(bytes_) { this.$val = this; if (arguments.length === 0) { this.bytes = ptrType$6.nil; return; } this.bytes = bytes_; }); nameData = $pkg.nameData = $newType(0, $kindStruct, "reflectlite.nameData", true, "internal/reflectlite", false, function(name_, tag_, exported_) { this.$val = this; if (arguments.length === 0) { this.name = ""; this.tag = ""; this.exported = false; return; } this.name = name_; this.tag = tag_; this.exported = exported_; }); mapIter = $pkg.mapIter = $newType(0, $kindStruct, "reflectlite.mapIter", true, "internal/reflectlite", false, function(t_, m_, keys_, i_, last_) { this.$val = this; if (arguments.length === 0) { this.t = $ifaceNil; this.m = null; this.keys = null; this.i = 0; this.last = null; return; } this.t = t_; this.m = m_; this.keys = keys_; this.i = i_; this.last = last_; }); TypeEx = $pkg.TypeEx = $newType(8, $kindInterface, "reflectlite.TypeEx", true, "internal/reflectlite", true, null); ptrType$1 = $ptrType(rtype); sliceType$1 = $sliceType(name); sliceType$2 = $sliceType(ptrType$1); sliceType$3 = $sliceType($String); sliceType$4 = $sliceType($emptyInterface); ptrType$2 = $ptrType(js.Object); funcType$1 = $funcType([sliceType$4], [ptrType$2], true); ptrType$4 = $ptrType(uncommonType); sliceType$5 = $sliceType(method); ptrType$5 = $ptrType(funcType); sliceType$6 = $sliceType(Value); ptrType$6 = $ptrType($Uint8); ptrType$7 = $ptrType($UnsafePointer); sliceType$7 = $sliceType(Type); sliceType$8 = $sliceType(ptrType$2); sliceType$9 = $sliceType(imethod); sliceType$10 = $sliceType(structField); ptrType$8 = $ptrType(nameData); structType$2 = $structType("internal/reflectlite", [{prop: "str", name: "str", embedded: false, exported: false, typ: $String, tag: ""}]); ptrType$9 = $ptrType(mapIter); arrayType$2 = $arrayType($Uintptr, 2); sliceType$13 = $sliceType($Uint8); ptrType$10 = $ptrType(ValueError); funcType$2 = $funcType([$UnsafePointer, $UnsafePointer], [$Bool], false); ptrType$11 = $ptrType(interfaceType); funcType$3 = $funcType([$UnsafePointer, $Uintptr], [$Uintptr], false); ptrType$12 = $ptrType(structField); ptrType$13 = $ptrType(errorString); flag.prototype.kind = function() { var f; f = this.$val; return ((((f & 31) >>> 0) >>> 0)); }; $ptrType(flag).prototype.kind = function() { return new flag(this.$get()).kind(); }; flag.prototype.ro = function() { var f; f = this.$val; if (!((((f & 96) >>> 0) === 0))) { return 32; } return 0; }; $ptrType(flag).prototype.ro = function() { return new flag(this.$get()).ro(); }; Value.ptr.prototype.pointer = function() { var 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 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.mustBeExported = function() { var 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 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.CanSet = function() { var v; v = this; return ((v.flag & 352) >>> 0) === 256; }; Value.prototype.CanSet = function() { return this.$val.CanSet(); }; Value.ptr.prototype.IsValid = function() { var v; v = this; return !((v.flag === 0)); }; Value.prototype.IsValid = function() { return this.$val.IsValid(); }; Value.ptr.prototype.Kind = function() { var v; v = this; return new flag(v.flag).kind(); }; Value.prototype.Kind = function() { return this.$val.Kind(); }; Value.ptr.prototype.Type = function() { var f, v; v = this; f = v.flag; if (f === 0) { $panic(new ValueError.ptr("reflectlite.Value.Type", 0)); } return v.typ; }; Value.prototype.Type = function() { return this.$val.Type(); }; structField.ptr.prototype.embedded = function() { var f; f = this; return !((((f.offsetEmbed & 1) >>> 0) === 0)); }; structField.prototype.embedded = function() { return this.$val.embedded(); }; Kind.prototype.String = function() { var k; k = this.$val; if (((k >> 0)) < kindNames.$length) { return ((k < 0 || k >= kindNames.$length) ? ($throwRuntimeError("index out of range"), undefined) : kindNames.$array[kindNames.$offset + k]); } return (0 >= kindNames.$length ? ($throwRuntimeError("index out of range"), undefined) : kindNames.$array[kindNames.$offset + 0]); }; $ptrType(Kind).prototype.String = function() { return new Kind(this.$get()).String(); }; rtype.ptr.prototype.String = function() { var s, t; t = this; s = $clone(t.nameOff(t.str), name).name(); if (!((((t.tflag & 2) >>> 0) === 0))) { return $substring(s, 1); } return s; }; rtype.prototype.String = function() { return this.$val.String(); }; rtype.ptr.prototype.Size = function() { var t; t = this; return t.size; }; rtype.prototype.Size = function() { return this.$val.Size(); }; rtype.ptr.prototype.Kind = function() { var t; t = this; return ((((t.kind & 31) >>> 0) >>> 0)); }; rtype.prototype.Kind = function() { return this.$val.Kind(); }; rtype.ptr.prototype.pointers = function() { var t; t = this; return !((t.ptrdata === 0)); }; rtype.prototype.pointers = function() { return this.$val.pointers(); }; rtype.ptr.prototype.common = function() { var t; t = this; return t; }; rtype.prototype.common = function() { return this.$val.common(); }; rtype.ptr.prototype.exportedMethods = function() { var t, ut; t = this; ut = t.uncommon(); if (ut === ptrType$4.nil) { return sliceType$5.nil; } return ut.exportedMethods(); }; rtype.prototype.exportedMethods = function() { return this.$val.exportedMethods(); }; rtype.ptr.prototype.NumMethod = function() { var t, tt; t = this; if (t.Kind() === 20) { tt = (t.kindType); return tt.NumMethod(); } return t.exportedMethods().$length; }; rtype.prototype.NumMethod = function() { return this.$val.NumMethod(); }; rtype.ptr.prototype.PkgPath = function() { var t, ut; t = this; if (((t.tflag & 4) >>> 0) === 0) { return ""; } ut = t.uncommon(); if (ut === ptrType$4.nil) { return ""; } return $clone(t.nameOff(ut.pkgPath), name).name(); }; rtype.prototype.PkgPath = function() { return this.$val.PkgPath(); }; rtype.ptr.prototype.hasName = function() { var t; t = this; return !((((t.tflag & 4) >>> 0) === 0)); }; rtype.prototype.hasName = function() { return this.$val.hasName(); }; rtype.ptr.prototype.Name = function() { var i, s, t; t = this; if (!t.hasName()) { return ""; } s = t.String(); i = s.length - 1 >> 0; while (true) { if (!(i >= 0 && !((s.charCodeAt(i) === 46)))) { break; } i = i - (1) >> 0; } return $substring(s, (i + 1 >> 0)); }; rtype.prototype.Name = function() { return this.$val.Name(); }; rtype.ptr.prototype.chanDir = function() { var 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.Elem = function() { var _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.In = function(i) { var 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$(), ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]))); }; rtype.prototype.In = function(i) { return this.$val.In(i); }; rtype.ptr.prototype.Len = function() { var 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.NumIn = function() { var t, tt; t = this; if (!((t.Kind() === 19))) { $panic(new $String("reflect: NumIn of non-func type")); } tt = (t.kindType); return ((tt.inCount >> 0)); }; rtype.prototype.NumIn = function() { return this.$val.NumIn(); }; rtype.ptr.prototype.NumOut = function() { var 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 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"), undefined) : x.$array[x.$offset + i]))); }; rtype.prototype.Out = function(i) { return this.$val.Out(i); }; interfaceType.ptr.prototype.NumMethod = function() { var t; t = this; return t.methods.$length; }; interfaceType.prototype.NumMethod = function() { return this.$val.NumMethod(); }; rtype.ptr.prototype.Implements = function(u) { var _r, t, u, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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: $s = -1; return implements$1($assertType(u, ptrType$1), t); /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.Implements }; } $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 $24r, _r, t, u, uu, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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.AssignableTo")); } uu = $assertType(u, ptrType$1); _r = directlyAssignable(uu, t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r || implements$1(uu, t); $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.AssignableTo }; } $f.$24r = $24r; $f._r = _r; $f.t = t; $f.u = u; $f.uu = uu; $f.$s = $s; $f.$r = $r; return $f; }; rtype.prototype.AssignableTo = function(u) { return this.$val.AssignableTo(u); }; implements$1 = function(T, V) { var T, V, i, i$1, j, j$1, t, tm, tm$1, tmName, tmName$1, tmPkgPath, tmPkgPath$1, v, v$1, vm, vm$1, vmName, vmName$1, vmPkgPath, vmPkgPath$1, vmethods, x, x$1, x$2; 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"), undefined) : x.$array[x.$offset + i])); tmName = $clone(t.rtype.nameOff(tm.name), name); vm = (x$1 = v.methods, ((j < 0 || j >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + j])); vmName = $clone(V.nameOff(vm.name), name); if ($clone(vmName, name).name() === $clone(tmName, name).name() && V.typeOff(vm.typ) === t.rtype.typeOff(tm.typ)) { if (!$clone(tmName, name).isExported()) { tmPkgPath = $clone(tmName, name).pkgPath(); if (tmPkgPath === "") { tmPkgPath = $clone(t.pkgPath, name).name(); } vmPkgPath = $clone(vmName, name).pkgPath(); if (vmPkgPath === "") { vmPkgPath = $clone(v.pkgPath, name).name(); } if (!(tmPkgPath === vmPkgPath)) { j = j + (1) >> 0; continue; } } i = i + (1) >> 0; if (i >= t.methods.$length) { return true; } } j = j + (1) >> 0; } return false; } v$1 = V.uncommon(); if (v$1 === ptrType$4.nil) { return false; } i$1 = 0; vmethods = v$1.methods(); j$1 = 0; while (true) { if (!(j$1 < ((v$1.mcount >> 0)))) { break; } tm$1 = (x$2 = t.methods, ((i$1 < 0 || i$1 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + i$1])); tmName$1 = $clone(t.rtype.nameOff(tm$1.name), name); vm$1 = $clone(((j$1 < 0 || j$1 >= vmethods.$length) ? ($throwRuntimeError("index out of range"), undefined) : vmethods.$array[vmethods.$offset + j$1]), method); vmName$1 = $clone(V.nameOff(vm$1.name), name); if ($clone(vmName$1, name).name() === $clone(tmName$1, name).name() && V.typeOff(vm$1.mtyp) === t.rtype.typeOff(tm$1.typ)) { if (!$clone(tmName$1, name).isExported()) { tmPkgPath$1 = $clone(tmName$1, name).pkgPath(); if (tmPkgPath$1 === "") { tmPkgPath$1 = $clone(t.pkgPath, name).name(); } vmPkgPath$1 = $clone(vmName$1, name).pkgPath(); if (vmPkgPath$1 === "") { vmPkgPath$1 = $clone(V.nameOff(v$1.pkgPath), name).name(); } if (!(tmPkgPath$1 === vmPkgPath$1)) { j$1 = j$1 + (1) >> 0; continue; } } 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 $24r, T, V, _r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; T = $f.T; V = $f.V; _r = $f._r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (T === V) { $s = -1; return true; } if (T.hasName() && V.hasName() || !((T.Kind() === V.Kind()))) { $s = -1; return false; } _r = haveIdenticalUnderlyingType(T, V, true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: directlyAssignable }; } $f.$24r = $24r; $f.T = T; $f.V = V; $f._r = _r; $f.$s = $s; $f.$r = $r; return $f; }; haveIdenticalType = function(T, V, cmpTags) { var $24r, T, V, _arg, _arg$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _v, cmpTags, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; T = $f.T; V = $f.V; _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; cmpTags = $f.cmpTags; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (cmpTags) { $s = -1; return $interfaceIsEqual(T, V); } _r = T.Name(); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = V.Name(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } if (!(_r === _r$1)) { _v = true; $s = 3; continue s; } _r$2 = T.Kind(); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = V.Kind(); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _v = !((_r$2 === _r$3)); case 3: /* */ if (_v) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v) { */ case 1: $s = -1; return false; /* } */ case 2: _r$4 = T.common(); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _arg = _r$4; _r$5 = V.common(); /* */ $s = 9; case 9: 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, false); /* */ $s = 10; case 10: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } $24r = _r$6; $s = 11; case 11: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: haveIdenticalType }; } $f.$24r = $24r; $f.T = T; $f.V = V; $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.cmpTags = cmpTags; $f.$s = $s; $f.$r = $r; return $f; }; haveIdenticalUnderlyingType = function(T, V, cmpTags) { var $24r, $24r$1, $24r$2, $24r$3, T, V, _1, _i, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _ref, _v, _v$1, _v$2, _v$3, cmpTags, i, i$1, i$2, kind, t, t$1, t$2, tf, v, v$1, v$2, vf, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; T = $f.T; V = $f.V; _1 = $f._1; _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; _ref = $f._ref; _v = $f._v; _v$1 = $f._v$1; _v$2 = $f._v$2; _v$3 = $f._v$3; cmpTags = $f.cmpTags; i = $f.i; i$1 = $f.i$1; i$2 = $f.i$2; kind = $f.kind; t = $f.t; t$1 = $f.t$1; t$2 = $f.t$2; tf = $f.tf; v = $f.v; v$1 = $f.v$1; v$2 = $f.v$2; vf = $f.vf; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (T === V) { $s = -1; return true; } kind = T.Kind(); if (!((kind === V.Kind()))) { $s = -1; return false; } if (1 <= kind && kind <= 16 || (kind === 24) || (kind === 26)) { $s = -1; return true; } _1 = kind; /* */ if (_1 === (17)) { $s = 2; continue; } /* */ if (_1 === (18)) { $s = 3; continue; } /* */ if (_1 === (19)) { $s = 4; continue; } /* */ if (_1 === (20)) { $s = 5; continue; } /* */ if (_1 === (21)) { $s = 6; continue; } /* */ if ((_1 === (22)) || (_1 === (23))) { $s = 7; continue; } /* */ if (_1 === (25)) { $s = 8; continue; } /* */ $s = 9; continue; /* if (_1 === (17)) { */ case 2: if (!(T.Len() === V.Len())) { _v = false; $s = 10; continue s; } _r = haveIdenticalType(T.Elem(), V.Elem(), cmpTags); /* */ $s = 11; case 11: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _v = _r; case 10: $24r = _v; $s = 12; case 12: return $24r; /* } else if (_1 === (18)) { */ case 3: if (!(V.chanDir() === 3)) { _v$1 = false; $s = 15; continue s; } _r$1 = haveIdenticalType(T.Elem(), V.Elem(), cmpTags); /* */ $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) { $s = 13; continue; } /* */ $s = 14; continue; /* if (_v$1) { */ case 13: $s = -1; return true; /* } */ case 14: if (!(V.chanDir() === T.chanDir())) { _v$2 = false; $s = 17; continue s; } _r$2 = haveIdenticalType(T.Elem(), V.Elem(), cmpTags); /* */ $s = 18; case 18: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _v$2 = _r$2; case 17: $24r$1 = _v$2; $s = 19; case 19: return $24r$1; /* } else if (_1 === (19)) { */ case 4: t = (T.kindType); v = (V.kindType); if (!((t.outCount === v.outCount)) || !((t.inCount === v.inCount))) { $s = -1; return false; } i = 0; /* while (true) { */ case 20: /* if (!(i < t.rtype.NumIn())) { break; } */ if(!(i < t.rtype.NumIn())) { $s = 21; continue; } _r$3 = haveIdenticalType(t.rtype.In(i), v.rtype.In(i), cmpTags); /* */ $s = 24; case 24: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } /* */ if (!_r$3) { $s = 22; continue; } /* */ $s = 23; continue; /* if (!_r$3) { */ case 22: $s = -1; return false; /* } */ case 23: i = i + (1) >> 0; $s = 20; continue; case 21: i$1 = 0; /* while (true) { */ case 25: /* if (!(i$1 < t.rtype.NumOut())) { break; } */ if(!(i$1 < t.rtype.NumOut())) { $s = 26; continue; } _r$4 = haveIdenticalType(t.rtype.Out(i$1), v.rtype.Out(i$1), cmpTags); /* */ $s = 29; case 29: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } /* */ if (!_r$4) { $s = 27; continue; } /* */ $s = 28; continue; /* if (!_r$4) { */ case 27: $s = -1; return false; /* } */ case 28: i$1 = i$1 + (1) >> 0; $s = 25; continue; case 26: $s = -1; return true; /* } else if (_1 === (20)) { */ case 5: t$1 = (T.kindType); v$1 = (V.kindType); if ((t$1.methods.$length === 0) && (v$1.methods.$length === 0)) { $s = -1; return true; } $s = -1; return false; /* } else if (_1 === (21)) { */ case 6: _r$5 = haveIdenticalType(T.Key(), V.Key(), cmpTags); /* */ $s = 31; case 31: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } if (!(_r$5)) { _v$3 = false; $s = 30; continue s; } _r$6 = haveIdenticalType(T.Elem(), V.Elem(), cmpTags); /* */ $s = 32; case 32: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _v$3 = _r$6; case 30: $24r$2 = _v$3; $s = 33; case 33: return $24r$2; /* } else if ((_1 === (22)) || (_1 === (23))) { */ case 7: _r$7 = haveIdenticalType(T.Elem(), V.Elem(), cmpTags); /* */ $s = 34; case 34: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } $24r$3 = _r$7; $s = 35; case 35: return $24r$3; /* } else if (_1 === (25)) { */ case 8: t$2 = (T.kindType); v$2 = (V.kindType); if (!((t$2.fields.$length === v$2.fields.$length))) { $s = -1; return false; } if (!($clone(t$2.pkgPath, name).name() === $clone(v$2.pkgPath, name).name())) { $s = -1; return false; } _ref = t$2.fields; _i = 0; /* while (true) { */ case 36: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 37; continue; } i$2 = _i; tf = (x = t$2.fields, ((i$2 < 0 || i$2 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i$2])); vf = (x$1 = v$2.fields, ((i$2 < 0 || i$2 >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + i$2])); if (!($clone(tf.name, name).name() === $clone(vf.name, name).name())) { $s = -1; return false; } _r$8 = haveIdenticalType(tf.typ, vf.typ, cmpTags); /* */ $s = 40; case 40: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } /* */ if (!_r$8) { $s = 38; continue; } /* */ $s = 39; continue; /* if (!_r$8) { */ case 38: $s = -1; return false; /* } */ case 39: if (cmpTags && !($clone(tf.name, name).tag() === $clone(vf.name, name).tag())) { $s = -1; return false; } if (!((tf.offsetEmbed === vf.offsetEmbed))) { $s = -1; return false; } _i++; $s = 36; continue; case 37: $s = -1; return true; /* } */ case 9: case 1: $s = -1; return false; /* */ } return; } if ($f === undefined) { $f = { $blk: haveIdenticalUnderlyingType }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.T = T; $f.V = V; $f._1 = _1; $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._ref = _ref; $f._v = _v; $f._v$1 = _v$1; $f._v$2 = _v$2; $f._v$3 = _v$3; $f.cmpTags = cmpTags; $f.i = i; $f.i$1 = i$1; $f.i$2 = i$2; $f.kind = kind; $f.t = t; $f.t$1 = t$1; $f.t$2 = t$2; $f.tf = tf; $f.v = v; $f.v$1 = v$1; $f.v$2 = v$2; $f.vf = vf; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; toType = function(t) { var t; if (t === ptrType$1.nil) { return $ifaceNil; } return t; }; ifaceIndir = function(t) { var t; return ((t.kind & 32) >>> 0) === 0; }; Value.ptr.prototype.object = function() { var _1, 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: _1 = v.typ.Kind(); if ((_1 === (11)) || (_1 === (6))) { val = new (jsType(v.typ))(val.$high, val.$low); } else if ((_1 === (15)) || (_1 === (16))) { val = new (jsType(v.typ))(val.$real, val.$imag); } else if (_1 === (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.assignTo = function(context, dst, target) { var _r, _r$1, _r$2, context, dst, fl, target, v, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; 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, $clone(v, Value)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } Value.copy(v, _r); /* } */ case 2: _r$1 = directlyAssignable(dst, v.typ); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (_r$1) { $s = 5; continue; } /* */ if (implements$1(dst, v.typ)) { $s = 6; continue; } /* */ $s = 7; continue; /* if (_r$1) { */ case 5: fl = (((v.flag & 384) >>> 0) | new flag(v.flag).ro()) >>> 0; fl = (fl | (((dst.Kind() >>> 0)))) >>> 0; $s = -1; 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$2 = valueInterface($clone(v, Value)); /* */ $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; if (dst.NumMethod() === 0) { (target).$set(x); } else { ifaceE2I(dst, x, target); } $s = -1; 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; return new Value.ptr(ptrType$1.nil, 0, 0); /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.assignTo }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $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.Cap = function() { var _1, k, v; v = this; k = new flag(v.flag).kind(); _1 = k; if (_1 === (17)) { return v.typ.Len(); } else if ((_1 === (18)) || (_1 === (23))) { return $parseInt($clone(v, Value).object().$capacity) >> 0; } $panic(new ValueError.ptr("reflect.Value.Cap", k)); }; Value.prototype.Cap = function() { return this.$val.Cap(); }; Value.ptr.prototype.Index = function(i) { var $24r, $24r$1, _1, _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; $24r = $f.$24r; $24r$1 = $f.$24r$1; _1 = $f._1; _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(); _1 = k; /* */ if (_1 === (17)) { $s = 2; continue; } /* */ if (_1 === (23)) { $s = 3; continue; } /* */ if (_1 === (24)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_1 === (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[0] = tt.elem; fl = (((((v.flag & 384) >>> 0) | new flag(v.flag).ro()) >>> 0) | ((typ[0].Kind() >>> 0))) >>> 0; a[0] = v.ptr; /* */ if (!((((fl & 128) >>> 0) === 0)) && !((typ[0].Kind() === 17)) && !((typ[0].Kind() === 25))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!((((fl & 128) >>> 0) === 0)) && !((typ[0].Kind() === 17)) && !((typ[0].Kind() === 25))) { */ case 7: $s = -1; return new Value.ptr(typ[0], (new (jsType(PtrTo(typ[0])))((function(a, a$1, c, i, typ, typ$1) { return function() { 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 x; a[0][i[0]] = unwrapJsObject(typ[0], x); }; })(a, a$1, c, i, typ, typ$1))), fl); /* } */ case 8: _r = makeValue(typ[0], wrapJsObject(typ[0], a[0][i[0]]), fl); /* */ $s = 9; case 9: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 10; case 10: return $24r; /* } else if (_1 === (23)) { */ case 3: s = $clone(v, Value).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$1[0] = tt$1.elem; fl$1 = (((384 | new flag(v.flag).ro()) >>> 0) | ((typ$1[0].Kind() >>> 0))) >>> 0; i[0] = i[0] + (($parseInt(s.$offset) >> 0)) >> 0; a$1[0] = s.$array; /* */ if (!((((fl$1 & 128) >>> 0) === 0)) && !((typ$1[0].Kind() === 17)) && !((typ$1[0].Kind() === 25))) { $s = 11; continue; } /* */ $s = 12; continue; /* if (!((((fl$1 & 128) >>> 0) === 0)) && !((typ$1[0].Kind() === 17)) && !((typ$1[0].Kind() === 25))) { */ case 11: $s = -1; return new Value.ptr(typ$1[0], (new (jsType(PtrTo(typ$1[0])))((function(a, a$1, c, i, typ, typ$1) { return function() { 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 x; a$1[0][i[0]] = unwrapJsObject(typ$1[0], x); }; })(a, a$1, c, i, typ, typ$1))), fl$1); /* } */ case 12: _r$1 = makeValue(typ$1[0], wrapJsObject(typ$1[0], a$1[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; } $24r$1 = _r$1; $s = 14; case 14: return $24r$1; /* } else if (_1 === (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 = (((new flag(v.flag).ro() | 8) >>> 0) | 128) >>> 0; c[0] = str.charCodeAt(i[0]); $s = -1; return new Value.ptr(uint8Type, ((c.$ptr || (c.$ptr = new ptrType$6(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, c)))), fl$2); /* } else { */ case 5: $panic(new ValueError.ptr("reflect.Value.Index", k)); /* } */ case 6: case 1: $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Index }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._1 = _1; $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 v; v = this; $panic(new $String("InterfaceData is not supported by GopherJS")); }; Value.prototype.InterfaceData = function() { return this.$val.InterfaceData(); }; Value.ptr.prototype.IsNil = function() { var _1, k, v; v = this; k = new flag(v.flag).kind(); _1 = k; if ((_1 === (22)) || (_1 === (23))) { return $clone(v, Value).object() === jsType(v.typ).nil; } else if (_1 === (18)) { return $clone(v, Value).object() === $chanNil; } else if (_1 === (19)) { return $clone(v, Value).object() === $throwNilPointerError; } else if (_1 === (21)) { return $clone(v, Value).object() === false; } else if (_1 === (20)) { return $clone(v, Value).object() === $ifaceNil; } else if (_1 === (26)) { return $clone(v, Value).object() === 0; } else { $panic(new ValueError.ptr("reflect.Value.IsNil", k)); } }; Value.prototype.IsNil = function() { return this.$val.IsNil(); }; Value.ptr.prototype.Len = function() { var _1, k, v; v = this; k = new flag(v.flag).kind(); _1 = k; if ((_1 === (17)) || (_1 === (24))) { return $parseInt($clone(v, Value).object().length); } else if (_1 === (23)) { return $parseInt($clone(v, Value).object().$length) >> 0; } else if (_1 === (18)) { return $parseInt($clone(v, Value).object().$buffer.length) >> 0; } else if (_1 === (21)) { return $parseInt($keys($clone(v, Value).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 _1, k, v; v = this; k = new flag(v.flag).kind(); _1 = k; if ((_1 === (18)) || (_1 === (21)) || (_1 === (22)) || (_1 === (26))) { if ($clone(v, Value).IsNil()) { return 0; } return $clone(v, Value).object(); } else if (_1 === (19)) { if ($clone(v, Value).IsNil()) { return 0; } return 1; } else if (_1 === (23)) { if ($clone(v, Value).IsNil()) { return 0; } return $clone(v, Value).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 _1, _r, _r$1, v, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _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: v = this; new flag(v.flag).mustBeAssignable(); new flag(x.flag).mustBeExported(); _r = $clone(x, Value).assignTo("reflect.Set", v.typ, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } Value.copy(x, _r); /* */ if (!((((v.flag & 128) >>> 0) === 0))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!((((v.flag & 128) >>> 0) === 0))) { */ case 2: _1 = v.typ.Kind(); /* */ if (_1 === (17)) { $s = 5; continue; } /* */ if (_1 === (20)) { $s = 6; continue; } /* */ if (_1 === (25)) { $s = 7; continue; } /* */ $s = 8; continue; /* if (_1 === (17)) { */ case 5: jsType(v.typ).copy(v.ptr, x.ptr); $s = 9; continue; /* } else if (_1 === (20)) { */ case 6: _r$1 = valueInterface($clone(x, Value)); /* */ $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 (_1 === (25)) { */ case 7: copyStruct(v.ptr, x.ptr, v.typ); $s = 9; continue; /* } else { */ case 8: v.ptr.$set($clone(x, Value).object()); /* } */ case 9: case 4: $s = -1; return; /* } */ case 3: v.ptr = x.ptr; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Set }; } $f._1 = _1; $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 _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; _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; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.SetBytes }; } $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 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 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 $24r, $24r$1, _1, _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; $24r = $f.$24r; $24r$1 = $f.$24r$1; _1 = $f._1; _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(); _1 = kind; /* */ if (_1 === (17)) { $s = 2; continue; } /* */ if (_1 === (23)) { $s = 3; continue; } /* */ if (_1 === (24)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_1 === (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))($clone(v, Value).object()); $s = 6; continue; /* } else if (_1 === (23)) { */ case 3: typ = v.typ; s = $clone(v, Value).object(); cap = $parseInt(s.$capacity) >> 0; $s = 6; continue; /* } else if (_1 === (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($substring(str, i, j))); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 8; case 8: return $24r; /* } 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), new flag(v.flag).ro()); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r$1 = _r$1; $s = 10; case 10: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Slice }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._1 = _1; $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 $24r, _1, _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; $24r = $f.$24r; _1 = $f._1; _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(); _1 = kind; if (_1 === (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))($clone(v, Value).object()); } else if (_1 === (23)) { typ = v.typ; s = $clone(v, Value).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), new flag(v.flag).ro()); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Slice3 }; } $f.$24r = $24r; $f._1 = _1; $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 v; v = this; new flag(v.flag).mustBe(18); new flag(v.flag).mustBeExported(); $close($clone(v, Value).object()); }; Value.prototype.Close = function() { return this.$val.Close(); }; Value.ptr.prototype.Elem = function() { var $24r, _1, _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; $24r = $f.$24r; _1 = $f._1; _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(); _1 = k; /* */ if (_1 === (20)) { $s = 2; continue; } /* */ if (_1 === (22)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_1 === (20)) { */ case 2: val = $clone(v, Value).object(); if (val === $ifaceNil) { $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); } typ = reflectType(val.constructor); _r = makeValue(typ, val.$val, new flag(v.flag).ro()); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 7; case 7: return $24r; /* } else if (_1 === (22)) { */ case 3: if ($clone(v, Value).IsNil()) { $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); } val$1 = $clone(v, Value).object(); tt = (v.typ.kindType); fl = (((((v.flag & 96) >>> 0) | 128) >>> 0) | 256) >>> 0; fl = (fl | (((tt.elem.Kind() >>> 0)))) >>> 0; $s = -1; 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; return new Value.ptr(ptrType$1.nil, 0, 0); /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Elem }; } $f.$24r = $24r; $f._1 = _1; $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.NumField = function() { var 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.MapKeys = function() { var _r, a, 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; _r = $f._r; a = $f.a; 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 = (new flag(v.flag).ro() | ((keyType.Kind() >>> 0))) >>> 0; m = $clone(v, Value).pointer(); mlen = 0; if (!(m === 0)) { mlen = maplen(m); } it = mapiterinit(v.typ, m); a = $makeSlice(sliceType$6, 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; } Value.copy(((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i]), copyVal(keyType, fl, key)); mapiternext(it); i = i + (1) >> 0; $s = 1; continue; case 2: $s = -1; return $subslice(a, 0, i); /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.MapKeys }; } $f._r = _r; $f.a = a; $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.MapIndex = function(key) { var _r, 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; _r = $f._r; 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: v = this; new flag(v.flag).mustBe(21); tt = (v.typ.kindType); _r = $clone(key, Value).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; } Value.copy(key, _r); k = 0; if (!((((key.flag & 128) >>> 0) === 0))) { k = key.ptr; } else { k = ((key.$ptr_ptr || (key.$ptr_ptr = new ptrType$7(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, key)))); } e = mapaccess(v.typ, $clone(v, Value).pointer(), k); if (e === 0) { $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); } typ = tt.elem; fl = new flag((((v.flag | key.flag) >>> 0))).ro(); fl = (fl | (((typ.Kind() >>> 0)))) >>> 0; $s = -1; return copyVal(typ, fl, e); /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.MapIndex }; } $f._r = _r; $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.Field = function(i) { var $24r, _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; $24r = $f.$24r; _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; if (!((new flag(v.flag).kind() === 25))) { $panic(new ValueError.ptr("reflect.Value.Field", new flag(v.flag).kind())); } tt = (v.typ.kindType); if (((i >>> 0)) >= ((tt.fields.$length >>> 0))) { $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"), undefined) : x.$array[x.$offset + i])); typ[0] = field.typ; fl = (((v.flag & 416) >>> 0) | ((typ[0].Kind() >>> 0))) >>> 0; if (!$clone(field.name, name).isExported()) { if (field.embedded()) { fl = (fl | (64)) >>> 0; } else { fl = (fl | (32)) >>> 0; } } tag = $clone((x$1 = tt.fields, ((i < 0 || i >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + i])).name, name).tag(); /* */ if (!(tag === "") && !((i === 0))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(tag === "") && !((i === 0))) { */ case 1: jsTag[0] = getJsTag(tag); /* */ if (!(jsTag[0] === "")) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!(jsTag[0] === "")) { */ case 3: /* while (true) { */ case 5: o = [o]; _r = $clone(v, Value).Field(0); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } Value.copy(v, _r); /* */ if (v.typ === jsObjectPtr) { $s = 8; continue; } /* */ $s = 9; continue; /* if (v.typ === jsObjectPtr) { */ case 8: o[0] = $clone(v, Value).object().object; $s = -1; return new Value.ptr(typ[0], (new (jsType(PtrTo(typ[0])))((function(jsTag, o, prop, s, typ) { return function() { 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 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 = $clone(v, Value).Elem(); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } Value.copy(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: $s = -1; return new Value.ptr(typ[0], (new (jsType(PtrTo(typ[0])))((function(jsTag, prop, s, typ) { return function() { return wrapJsObject(typ[0], s[0][$externalize(prop[0], $String)]); }; })(jsTag, prop, s, typ), (function(jsTag, prop, s, typ) { return function(x$2) { var 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; } $24r = _r$2; $s = 16; case 16: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Field }; } $f.$24r = $24r; $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); }; errorString.ptr.prototype.Error = function() { var e; e = this; return e.s; }; errorString.prototype.Error = function() { return this.$val.Error(); }; unquote = function(s) { var s; if (s.length < 2) { return [s, $ifaceNil]; } if ((s.charCodeAt(0) === 39) || (s.charCodeAt(0) === 34)) { if (s.charCodeAt((s.length - 1 >> 0)) === s.charCodeAt(0)) { return [$substring(s, 1, (s.length - 1 >> 0)), $ifaceNil]; } return ["", $pkg.ErrSyntax]; } return [s, $ifaceNil]; }; flag.prototype.mustBe = function(expected) { var expected, f; f = this.$val; if (!((((((f & 31) >>> 0) >>> 0)) === expected))) { $panic(new ValueError.ptr(methodName(), new flag(f).kind())); } }; $ptrType(flag).prototype.mustBe = function(expected) { return new flag(this.$get()).mustBe(expected); }; rtype.ptr.prototype.Comparable = function() { var $24r, _1, _r, _r$1, ft, i, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; ft = $f.ft; i = $f.i; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _1 = t.Kind(); /* */ if ((_1 === (19)) || (_1 === (23)) || (_1 === (21))) { $s = 2; continue; } /* */ if (_1 === (17)) { $s = 3; continue; } /* */ if (_1 === (25)) { $s = 4; continue; } /* */ $s = 5; continue; /* if ((_1 === (19)) || (_1 === (23)) || (_1 === (21))) { */ case 2: $s = -1; return false; /* } else if (_1 === (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; } $24r = _r; $s = 7; case 7: return $24r; /* } else if (_1 === (25)) { */ case 4: i = 0; /* while (true) { */ case 8: /* if (!(i < t.NumField())) { break; } */ if(!(i < t.NumField())) { $s = 9; continue; } ft = $clone(t.Field(i), structField); _r$1 = ft.typ.Comparable(); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (!_r$1) { $s = 10; continue; } /* */ $s = 11; continue; /* if (!_r$1) { */ case 10: $s = -1; return false; /* } */ case 11: i = i + (1) >> 0; $s = 8; continue; case 9: /* } */ case 5: case 1: $s = -1; return true; /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.Comparable }; } $f.$24r = $24r; $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f.ft = ft; $f.i = i; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; rtype.prototype.Comparable = function() { return this.$val.Comparable(); }; rtype.ptr.prototype.IsVariadic = function() { var t, tt; t = this; if (!((t.Kind() === 19))) { $panic(new $String("reflect: IsVariadic of non-func type")); } tt = (t.kindType); return !((((tt.outCount & 32768) >>> 0) === 0)); }; rtype.prototype.IsVariadic = function() { return this.$val.IsVariadic(); }; rtype.ptr.prototype.Field = function(i) { var i, t, tt, x; t = this; if (!((t.Kind() === 25))) { $panic(new $String("reflect: Field of non-struct type")); } tt = (t.kindType); if (i < 0 || i >= tt.fields.$length) { $panic(new $String("reflect: Field index out of bounds")); } return (x = tt.fields, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); }; rtype.prototype.Field = function(i) { return this.$val.Field(i); }; rtype.ptr.prototype.Key = function() { var 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.NumField = function() { var 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.Method = function(i) { var $24r, _i, _i$1, _r, _r$1, _ref, _ref$1, arg, fl, fn, ft, i, in$1, m, methods, mt, mtyp, out, p, pname, prop, ret, t, tt, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; _ref$1 = $f._ref$1; arg = $f.arg; fl = $f.fl; fn = $f.fn; ft = $f.ft; i = $f.i; in$1 = $f.in$1; m = $f.m; methods = $f.methods; mt = $f.mt; mtyp = $f.mtyp; out = $f.out; p = $f.p; pname = $f.pname; prop = $f.prop; ret = $f.ret; t = $f.t; tt = $f.tt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: prop = [prop]; m = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); t = this; /* */ if (t.Kind() === 20) { $s = 1; continue; } /* */ $s = 2; continue; /* if (t.Kind() === 20) { */ case 1: tt = (t.kindType); _r = tt.rtype.Method(i); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } Method.copy(m, _r); $24r = m; $s = 4; case 4: return $24r; /* } */ case 2: methods = t.exportedMethods(); if (i < 0 || i >= methods.$length) { $panic(new $String("reflect: Method index out of range")); } p = $clone(((i < 0 || i >= methods.$length) ? ($throwRuntimeError("index out of range"), undefined) : methods.$array[methods.$offset + i]), method); pname = $clone(t.nameOff(p.name), name); m.Name = $clone(pname, name).name(); fl = 19; mtyp = t.typeOff(p.mtyp); ft = (mtyp.kindType); in$1 = $makeSlice(sliceType$7, 0, (1 + ft.in$().$length >> 0)); in$1 = $append(in$1, t); _ref = ft.in$(); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } arg = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); in$1 = $append(in$1, arg); _i++; } out = $makeSlice(sliceType$7, 0, ft.out().$length); _ref$1 = ft.out(); _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } ret = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); out = $append(out, ret); _i$1++; } _r$1 = FuncOf(in$1, out, ft.rtype.IsVariadic()); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } mt = _r$1; m.Type = mt; prop[0] = $internalize($methodSet(t[$externalize(idJsType, $String)])[i].prop, $String); fn = js.MakeFunc((function(prop) { return function(this$1, arguments$1) { var arguments$1, rcvr, this$1; rcvr = (0 >= arguments$1.$length ? ($throwRuntimeError("index out of range"), undefined) : arguments$1.$array[arguments$1.$offset + 0]); return new $jsObjectPtr(rcvr[$externalize(prop[0], $String)].apply(rcvr, $externalize($subslice(arguments$1, 1), sliceType$8))); }; })(prop)); Value.copy(m.Func, new Value.ptr($assertType(mt, ptrType$1), (fn), fl)); m.Index = i; Method.copy(m, m); $s = -1; return m; /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.Method }; } $f.$24r = $24r; $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f._ref$1 = _ref$1; $f.arg = arg; $f.fl = fl; $f.fn = fn; $f.ft = ft; $f.i = i; $f.in$1 = in$1; $f.m = m; $f.methods = methods; $f.mt = mt; $f.mtyp = mtyp; $f.out = out; $f.p = p; $f.pname = pname; $f.prop = prop; $f.ret = ret; $f.t = t; $f.tt = tt; $f.$s = $s; $f.$r = $r; return $f; }; rtype.prototype.Method = function(i) { return this.$val.Method(i); }; Swapper = function(slice) { var _1, _r, a, off, slice, v, vLen, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; a = $f.a; off = $f.off; slice = $f.slice; v = $f.v; vLen = $f.vLen; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: a = [a]; off = [off]; vLen = [vLen]; _r = ValueOf(slice); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } v = $clone(_r, Value); if (!(($clone(v, Value).Kind() === 23))) { $panic(new ValueError.ptr("Swapper", $clone(v, Value).Kind())); } vLen[0] = (($clone(v, Value).Len() >>> 0)); _1 = vLen[0]; if (_1 === (0)) { $s = -1; return (function(a, off, vLen) { return function(i, j) { var i, j; $panic(new $String("reflect: slice index out of range")); }; })(a, off, vLen); } else if (_1 === (1)) { $s = -1; return (function(a, off, vLen) { return function(i, j) { var i, j; if (!((i === 0)) || !((j === 0))) { $panic(new $String("reflect: slice index out of range")); } }; })(a, off, vLen); } a[0] = slice.$array; off[0] = $parseInt(slice.$offset) >> 0; $s = -1; return (function(a, off, vLen) { return function(i, j) { var i, j, tmp; if (((i >>> 0)) >= vLen[0] || ((j >>> 0)) >= vLen[0]) { $panic(new $String("reflect: slice index out of range")); } i = i + (off[0]) >> 0; j = j + (off[0]) >> 0; tmp = a[0][i]; a[0][i] = a[0][j]; a[0][j] = tmp; }; })(a, off, vLen); /* */ } return; } if ($f === undefined) { $f = { $blk: Swapper }; } $f._1 = _1; $f._r = _r; $f.a = a; $f.off = off; $f.slice = slice; $f.v = v; $f.vLen = vLen; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Swapper = Swapper; init = function() { var 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; 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 i; }); $r = used((x = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0), 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(0, 0, 0, 0, sliceType$5.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(0, 0, 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, $throwNilPointerError, ptrType$6.nil, 0, 0), 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, $throwNilPointerError, ptrType$6.nil, 0, 0), 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, $throwNilPointerError, ptrType$6.nil, 0, 0), 0, 0, sliceType$2.nil, sliceType$2.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, $throwNilPointerError, ptrType$6.nil, 0, 0), new name.ptr(ptrType$6.nil), sliceType$9.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, $throwNilPointerError, ptrType$6.nil, 0, 0), ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, $throwNilPointerError, 0, 0, 0, 0), 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, $throwNilPointerError, ptrType$6.nil, 0, 0), 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, $throwNilPointerError, ptrType$6.nil, 0, 0), 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, $throwNilPointerError, ptrType$6.nil, 0, 0), new name.ptr(ptrType$6.nil), sliceType$10.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(0, 0), 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(new name.ptr(ptrType$6.nil), ptrType$1.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; return; /* */ } return; } if ($f === undefined) { $f = { $blk: init }; } $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 typ; return typ[$externalize(idJsType, $String)]; }; reflectType = function(typ) { var _1, _i, _i$1, _i$2, _i$3, _key, _ref, _ref$1, _ref$2, _ref$3, dir, exported, exported$1, f, fields, i, i$1, i$2, i$3, i$4, i$5, imethods, in$1, m, m$1, m$2, methodSet, methods, offsetEmbed, out, outCount, params, reflectFields, reflectMethods, results, rt, typ, ut, xcount; if (typ[$externalize(idReflectType, $String)] === undefined) { rt = new rtype.ptr(((($parseInt(typ.size) >> 0) >>> 0)), 0, 0, 0, 0, 0, ((($parseInt(typ.kind) >> 0) << 24 >>> 24)), $throwNilPointerError, ptrType$6.nil, newNameOff($clone(newName(internalStr(typ.string), "", !!(typ.exported)), name)), 0); rt[$externalize(idJsType, $String)] = typ; typ[$externalize(idReflectType, $String)] = rt; methodSet = $methodSet(typ); if (!(($parseInt(methodSet.length) === 0)) || !!(typ.named)) { rt.tflag = (rt.tflag | (1)) >>> 0; if (!!(typ.named)) { rt.tflag = (rt.tflag | (4)) >>> 0; } reflectMethods = sliceType$5.nil; i = 0; while (true) { if (!(i < $parseInt(methodSet.length))) { break; } m = methodSet[i]; exported = internalStr(m.pkg) === ""; if (!exported) { i = i + (1) >> 0; continue; } reflectMethods = $append(reflectMethods, new method.ptr(newNameOff($clone(newName(internalStr(m.name), "", exported), name)), newTypeOff(reflectType(m.typ)), 0, 0)); i = i + (1) >> 0; } xcount = ((reflectMethods.$length << 16 >>> 16)); i$1 = 0; while (true) { if (!(i$1 < $parseInt(methodSet.length))) { break; } m$1 = methodSet[i$1]; exported$1 = internalStr(m$1.pkg) === ""; if (exported$1) { i$1 = i$1 + (1) >> 0; continue; } reflectMethods = $append(reflectMethods, new method.ptr(newNameOff($clone(newName(internalStr(m$1.name), "", exported$1), name)), newTypeOff(reflectType(m$1.typ)), 0, 0)); i$1 = i$1 + (1) >> 0; } ut = new uncommonType.ptr(newNameOff($clone(newName(internalStr(typ.pkg), "", false), name)), (($parseInt(methodSet.length) << 16 >>> 16)), xcount, 0, reflectMethods); _key = rt; (uncommonTypeMap || $throwRuntimeError("assignment to entry in nil map"))[ptrType$1.keyFor(_key)] = { k: _key, v: ut }; ut[$externalize(idJsType, $String)] = typ; } _1 = rt.Kind(); if (_1 === (17)) { setKindType(rt, new arrayType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0), 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, $throwNilPointerError, ptrType$6.nil, 0, 0), reflectType(typ.elem), ((dir >>> 0)))); } else if (_1 === (19)) { params = typ.params; in$1 = $makeSlice(sliceType$2, $parseInt(params.length)); _ref = in$1; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i$2 = _i; ((i$2 < 0 || i$2 >= in$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + i$2] = reflectType(params[i$2])); _i++; } results = typ.results; out = $makeSlice(sliceType$2, $parseInt(results.length)); _ref$1 = out; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } i$3 = _i$1; ((i$3 < 0 || i$3 >= out.$length) ? ($throwRuntimeError("index out of range"), undefined) : out.$array[out.$offset + i$3] = reflectType(results[i$3])); _i$1++; } outCount = (($parseInt(results.length) << 16 >>> 16)); if (!!(typ.variadic)) { outCount = (outCount | (32768)) >>> 0; } setKindType(rt, new funcType.ptr($clone(rt, rtype), (($parseInt(params.length) << 16 >>> 16)), outCount, in$1, out)); } else if (_1 === (20)) { methods = typ.methods; imethods = $makeSlice(sliceType$9, $parseInt(methods.length)); _ref$2 = imethods; _i$2 = 0; while (true) { if (!(_i$2 < _ref$2.$length)) { break; } i$4 = _i$2; m$2 = methods[i$4]; imethod.copy(((i$4 < 0 || i$4 >= imethods.$length) ? ($throwRuntimeError("index out of range"), undefined) : imethods.$array[imethods.$offset + i$4]), new imethod.ptr(newNameOff($clone(newName(internalStr(m$2.name), "", internalStr(m$2.pkg) === ""), name)), newTypeOff(reflectType(m$2.typ)))); _i$2++; } setKindType(rt, new interfaceType.ptr($clone(rt, rtype), $clone(newName(internalStr(typ.pkg), "", false), name), imethods)); } else if (_1 === (21)) { setKindType(rt, new mapType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0), reflectType(typ.key), reflectType(typ.elem), ptrType$1.nil, $throwNilPointerError, 0, 0, 0, 0)); } else if (_1 === (22)) { setKindType(rt, new ptrType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0), reflectType(typ.elem))); } else if (_1 === (23)) { setKindType(rt, new sliceType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0), reflectType(typ.elem))); } else if (_1 === (25)) { fields = typ.fields; reflectFields = $makeSlice(sliceType$10, $parseInt(fields.length)); _ref$3 = reflectFields; _i$3 = 0; while (true) { if (!(_i$3 < _ref$3.$length)) { break; } i$5 = _i$3; f = fields[i$5]; offsetEmbed = ((i$5 >>> 0)) << 1 >>> 0; if (!!(f.embedded)) { offsetEmbed = (offsetEmbed | (1)) >>> 0; } structField.copy(((i$5 < 0 || i$5 >= reflectFields.$length) ? ($throwRuntimeError("index out of range"), undefined) : reflectFields.$array[reflectFields.$offset + i$5]), new structField.ptr($clone(newName(internalStr(f.name), internalStr(f.tag), !!(f.exported)), name), reflectType(f.typ), offsetEmbed)); _i$3++; } setKindType(rt, new structType.ptr($clone(rt, rtype), $clone(newName(internalStr(typ.pkgPath), "", false), name), reflectFields)); } } return ((typ[$externalize(idReflectType, $String)])); }; setKindType = function(rt, kindType) { var kindType, rt; rt[$externalize(idKindType, $String)] = kindType; kindType[$externalize(idRtype, $String)] = rt; }; uncommonType.ptr.prototype.methods = function() { var t; t = this; return t._methods; }; uncommonType.prototype.methods = function() { return this.$val.methods(); }; uncommonType.ptr.prototype.exportedMethods = function() { var t; t = this; return $subslice(t._methods, 0, t.xcount, t.xcount); }; uncommonType.prototype.exportedMethods = function() { return this.$val.exportedMethods(); }; rtype.ptr.prototype.uncommon = function() { var _entry, t; t = this; return (_entry = uncommonTypeMap[ptrType$1.keyFor(t)], _entry !== undefined ? _entry.v : ptrType$4.nil); }; rtype.prototype.uncommon = function() { return this.$val.uncommon(); }; funcType.ptr.prototype.in$ = function() { var t; t = this; return t._in; }; funcType.prototype.in$ = function() { return this.$val.in$(); }; funcType.ptr.prototype.out = function() { var t; t = this; return t._out; }; funcType.prototype.out = function() { return this.$val.out(); }; name.ptr.prototype.name = function() { var _entry, n, s; s = ""; n = this; s = (_entry = nameMap[ptrType$6.keyFor(n.bytes)], _entry !== undefined ? _entry.v : ptrType$8.nil).name; return s; }; name.prototype.name = function() { return this.$val.name(); }; name.ptr.prototype.tag = function() { var _entry, n, s; s = ""; n = this; s = (_entry = nameMap[ptrType$6.keyFor(n.bytes)], _entry !== undefined ? _entry.v : ptrType$8.nil).tag; return s; }; name.prototype.tag = function() { return this.$val.tag(); }; name.ptr.prototype.pkgPath = function() { var n; n = this; return ""; }; name.prototype.pkgPath = function() { return this.$val.pkgPath(); }; name.ptr.prototype.isExported = function() { var _entry, n; n = this; return (_entry = nameMap[ptrType$6.keyFor(n.bytes)], _entry !== undefined ? _entry.v : ptrType$8.nil).exported; }; name.prototype.isExported = function() { return this.$val.isExported(); }; newName = function(n, tag, exported) { var _key, b, exported, n, tag; b = $newDataPointer(0, ptrType$6); _key = b; (nameMap || $throwRuntimeError("assignment to entry in nil map"))[ptrType$6.keyFor(_key)] = { k: _key, v: new nameData.ptr(n, tag, exported) }; return new name.ptr(b); }; rtype.ptr.prototype.nameOff = function(off) { var off, t, x; t = this; return (x = ((off >> 0)), ((x < 0 || x >= nameOffList.$length) ? ($throwRuntimeError("index out of range"), undefined) : nameOffList.$array[nameOffList.$offset + x])); }; rtype.prototype.nameOff = function(off) { return this.$val.nameOff(off); }; newNameOff = function(n) { var i, n; i = nameOffList.$length; nameOffList = $append(nameOffList, n); return ((i >> 0)); }; rtype.ptr.prototype.typeOff = function(off) { var off, t, x; t = this; return (x = ((off >> 0)), ((x < 0 || x >= typeOffList.$length) ? ($throwRuntimeError("index out of range"), undefined) : typeOffList.$array[typeOffList.$offset + x])); }; rtype.prototype.typeOff = function(off) { return this.$val.typeOff(off); }; newTypeOff = function(t) { var i, t; i = typeOffList.$length; typeOffList = $append(typeOffList, t); return ((i >> 0)); }; internalStr = function(strObj) { var c, strObj; c = new structType$2.ptr(""); c.str = strObj; return c.str; }; isWrapped = function(typ) { var typ; return !!(jsType(typ).wrapped); }; copyStruct = function(dst, src, typ) { var 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 $24r, $24r$1, _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; $24r = $f.$24r; $24r$1 = $f.$24r$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; _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; } $24r = new Value.ptr(rt, (v), (fl | ((_r$4 >>> 0))) >>> 0); $s = 10; case 10: return $24r; /* } */ 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; } $24r$1 = new Value.ptr(rt, ($newDataPointer(v, jsType(rt.ptrTo()))), (((fl | ((_r$5 >>> 0))) >>> 0) | 128) >>> 0); $s = 12; case 12: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: makeValue }; } $f.$24r = $24r; $f.$24r$1 = $24r$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._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; }; TypeOf = function(i) { var i; if (!initialized) { return new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$6.nil, 0, 0); } if ($interfaceIsEqual(i, $ifaceNil)) { return $ifaceNil; } return reflectType(i.constructor); }; $pkg.TypeOf = TypeOf; ValueOf = function(i) { var $24r, _r, i, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; i = $f.i; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if ($interfaceIsEqual(i, $ifaceNil)) { $s = -1; 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; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: ValueOf }; } $f.$24r = $24r; $f._r = _r; $f.i = i; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.ValueOf = ValueOf; FuncOf = function(in$1, out, variadic) { var _i, _i$1, _r, _ref, _ref$1, _v, _v$1, i, i$1, in$1, jsIn, jsOut, out, v, v$1, variadic, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _ref = $f._ref; _ref$1 = $f._ref$1; _v = $f._v; _v$1 = $f._v$1; i = $f.i; i$1 = $f.i$1; in$1 = $f.in$1; jsIn = $f.jsIn; jsOut = $f.jsOut; out = $f.out; v = $f.v; v$1 = $f.v$1; variadic = $f.variadic; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (!(variadic)) { _v = false; $s = 3; continue s; } if (in$1.$length === 0) { _v$1 = true; $s = 4; continue s; } _r = (x = in$1.$length - 1 >> 0, ((x < 0 || x >= in$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + x])).Kind(); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _v$1 = !((_r === 23)); case 4: _v = _v$1; case 3: /* */ if (_v) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v) { */ case 1: $panic(new $String("reflect.FuncOf: last arg of variadic func must be slice")); /* } */ case 2: jsIn = $makeSlice(sliceType$8, in$1.$length); _ref = in$1; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); ((i < 0 || i >= jsIn.$length) ? ($throwRuntimeError("index out of range"), undefined) : jsIn.$array[jsIn.$offset + i] = jsType(v)); _i++; } jsOut = $makeSlice(sliceType$8, out.$length); _ref$1 = out; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } i$1 = _i$1; v$1 = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); ((i$1 < 0 || i$1 >= jsOut.$length) ? ($throwRuntimeError("index out of range"), undefined) : jsOut.$array[jsOut.$offset + i$1] = jsType(v$1)); _i$1++; } $s = -1; return reflectType($funcType($externalize(jsIn, sliceType$8), $externalize(jsOut, sliceType$8), $externalize(variadic, $Bool))); /* */ } return; } if ($f === undefined) { $f = { $blk: FuncOf }; } $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._ref = _ref; $f._ref$1 = _ref$1; $f._v = _v; $f._v$1 = _v$1; $f.i = i; $f.i$1 = i$1; $f.in$1 = in$1; $f.jsIn = jsIn; $f.jsOut = jsOut; $f.out = out; $f.v = v; $f.v$1 = v$1; $f.variadic = variadic; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.FuncOf = FuncOf; rtype.ptr.prototype.ptrTo = function() { var t; t = this; return reflectType($ptrType(jsType(t))); }; rtype.prototype.ptrTo = function() { return this.$val.ptrTo(); }; SliceOf = function(t) { var t; return reflectType($sliceType(jsType(t))); }; $pkg.SliceOf = SliceOf; unsafe_New = function(typ) { var _1, typ; _1 = typ.Kind(); if (_1 === (25)) { return (new (jsType(typ).ptr)()); } else if (_1 === (17)) { return (jsType(typ).zero()); } else { return ($newDataPointer(jsType(typ).zero(), jsType(typ.ptrTo()))); } }; typedmemmove = function(t, dst, src) { var dst, src, t; dst.$set(src.$get()); }; keyFor = function(t, key) { var 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 _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())))); }; mapIter.ptr.prototype.skipUntilValidKey = function() { var iter, k; iter = this; while (true) { if (!(iter.i < $parseInt(iter.keys.length))) { break; } k = iter.keys[iter.i]; if (!(iter.m[$externalize($internalize(k, $String), $String)] === undefined)) { break; } iter.i = iter.i + (1) >> 0; } }; mapIter.prototype.skipUntilValidKey = function() { return this.$val.skipUntilValidKey(); }; mapiterinit = function(t, m) { var m, t; return (new mapIter.ptr(t, m, $keys(m), 0, null)); }; mapiterkey = function(it) { var $24r, _r, _r$1, _r$2, it, iter, k, kv, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; it = $f.it; iter = $f.iter; k = $f.k; kv = $f.kv; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: iter = ($pointerOfStructConversion(it, ptrType$9)); kv = null; if (!(iter.last === null)) { kv = iter.last; } else { iter.skipUntilValidKey(); if (iter.i === $parseInt(iter.keys.length)) { $s = -1; return 0; } k = iter.keys[iter.i]; kv = iter.m[$externalize($internalize(k, $String), $String)]; iter.last = kv; } _r = $assertType(iter.t, TypeEx).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; } $24r = ($newDataPointer(kv.k, _r$2)); $s = 4; case 4: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: mapiterkey }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.it = it; $f.iter = iter; $f.k = k; $f.kv = kv; $f.$s = $s; $f.$r = $r; return $f; }; mapiternext = function(it) { var it, iter; iter = ($pointerOfStructConversion(it, ptrType$9)); iter.last = null; iter.i = iter.i + (1) >> 0; }; maplen = function(m) { var m; return $parseInt($keys(m).length); }; methodReceiver = function(op, v, i) { var _$12, fn, i, m, m$1, ms, op, prop, rcvr, t, tt, v, x; _$12 = ptrType$1.nil; t = ptrType$5.nil; fn = 0; 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"), undefined) : x.$array[x.$offset + i])); if (!$clone(tt.rtype.nameOff(m.name), name).isExported()) { $panic(new $String("reflect: " + op + " of unexported method")); } t = (tt.rtype.typeOff(m.typ).kindType); prop = $clone(tt.rtype.nameOff(m.name), name).name(); } else { ms = v.typ.exportedMethods(); if (((i >>> 0)) >= ((ms.$length >>> 0))) { $panic(new $String("reflect: internal error: invalid method index")); } m$1 = $clone(((i < 0 || i >= ms.$length) ? ($throwRuntimeError("index out of range"), undefined) : ms.$array[ms.$offset + i]), method); if (!$clone(v.typ.nameOff(m$1.name), name).isExported()) { $panic(new $String("reflect: " + op + " of unexported method")); } t = (v.typ.typeOff(m$1.mtyp).kindType); prop = $internalize($methodSet(jsType(v.typ))[i].prop, $String); } rcvr = $clone(v, Value).object(); if (isWrapped(v.typ)) { rcvr = new (jsType(v.typ))(rcvr); } fn = (rcvr[$externalize(prop, $String)]); return [_$12, t, fn]; }; valueInterface = function(v) { var _r, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (v.flag === 0) { $panic(new ValueError.ptr("reflect.Value.Interface", 0)); } /* */ if (!((((v.flag & 512) >>> 0) === 0))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((((v.flag & 512) >>> 0) === 0))) { */ case 1: _r = makeMethodValue("Interface", $clone(v, Value)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } Value.copy(v, _r); /* } */ case 2: if (isWrapped(v.typ)) { $s = -1; return ((new (jsType(v.typ))($clone(v, Value).object()))); } $s = -1; return (($clone(v, Value).object())); /* */ } return; } if ($f === undefined) { $f = { $blk: valueInterface }; } $f._r = _r; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; ifaceE2I = function(t, src, dst) { var dst, src, t; dst.$set(src); }; methodName = function() { return "?FIXME?"; }; makeMethodValue = function(op, v) { var $24r, _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; $24r = $f.$24r; _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]; if (((v.flag & 512) >>> 0) === 0) { $panic(new $String("reflect: internal error: invalid use of makePartialFunc")); } _tuple = methodReceiver(op, $clone(v, Value), ((v.flag >> 0)) >> 10 >> 0); fn[0] = _tuple[2]; rcvr[0] = $clone(v, Value).object(); if (isWrapped(v.typ)) { rcvr[0] = new (jsType(v.typ))(rcvr[0]); } fv = js.MakeFunc((function(fn, rcvr) { return function(this$1, arguments$1) { var arguments$1, this$1; return new $jsObjectPtr(fn[0].apply(rcvr[0], $externalize(arguments$1, sliceType$8))); }; })(fn, rcvr)); _r = $clone(v, Value).Type().common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = new Value.ptr(_r, (fv), (new flag(v.flag).ro() | 19) >>> 0); $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: makeMethodValue }; } $f.$24r = $24r; $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; }; wrapJsObject = function(typ, val) { var typ, val; if ($interfaceIsEqual(typ, jsObjectPtr)) { return new (jsType(jsObjectPtr))(val); } return val; }; unwrapJsObject = function(typ, val) { var typ, val; if ($interfaceIsEqual(typ, jsObjectPtr)) { return val.object; } return val; }; getJsTag = function(tag) { var _tuple, i, name$1, 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 = $substring(tag, 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$1 = ($substring(tag, 0, i)); tag = $substring(tag, (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 = ($substring(tag, 0, (i + 1 >> 0))); tag = $substring(tag, (i + 1 >> 0)); if (name$1 === "js") { _tuple = unquote(qvalue); value = _tuple[0]; return value; } } return ""; }; PtrTo = function(t) { var t; return $assertType(t, ptrType$1).ptrTo(); }; $pkg.PtrTo = PtrTo; copyVal = function(typ, fl, ptr) { var c, fl, ptr, typ; if (ifaceIndir(typ)) { c = unsafe_New(typ); typedmemmove(typ, c, ptr); return new Value.ptr(typ, c, (fl | 128) >>> 0); } return new Value.ptr(typ, (ptr).$get(), fl); }; Value.methods = [{prop: "pointer", name: "pointer", pkg: "internal/reflectlite", typ: $funcType([], [$UnsafePointer], false)}, {prop: "CanSet", name: "CanSet", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "IsValid", name: "IsValid", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Kind", name: "Kind", pkg: "", typ: $funcType([], [Kind], false)}, {prop: "numMethod", name: "numMethod", pkg: "internal/reflectlite", typ: $funcType([], [$Int], false)}, {prop: "Type", name: "Type", pkg: "", typ: $funcType([], [Type], false)}, {prop: "object", name: "object", pkg: "internal/reflectlite", typ: $funcType([], [ptrType$2], false)}, {prop: "assignTo", name: "assignTo", pkg: "internal/reflectlite", typ: $funcType([$String, ptrType$1, $UnsafePointer], [Value], false)}, {prop: "call", name: "call", pkg: "internal/reflectlite", typ: $funcType([$String, sliceType$6], [sliceType$6], false)}, {prop: "Cap", name: "Cap", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Index", name: "Index", pkg: "", typ: $funcType([$Int], [Value], false)}, {prop: "InterfaceData", name: "InterfaceData", pkg: "", typ: $funcType([], [arrayType$2], 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: "Elem", name: "Elem", pkg: "", typ: $funcType([], [Value], false)}, {prop: "NumField", name: "NumField", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "MapKeys", name: "MapKeys", pkg: "", typ: $funcType([], [sliceType$6], false)}, {prop: "MapIndex", name: "MapIndex", pkg: "", typ: $funcType([Value], [Value], false)}, {prop: "Field", name: "Field", pkg: "", typ: $funcType([$Int], [Value], false)}]; flag.methods = [{prop: "kind", name: "kind", pkg: "internal/reflectlite", typ: $funcType([], [Kind], false)}, {prop: "ro", name: "ro", pkg: "internal/reflectlite", typ: $funcType([], [flag], false)}, {prop: "mustBeExported", name: "mustBeExported", pkg: "internal/reflectlite", typ: $funcType([], [], false)}, {prop: "mustBeAssignable", name: "mustBeAssignable", pkg: "internal/reflectlite", typ: $funcType([], [], false)}, {prop: "mustBe", name: "mustBe", pkg: "internal/reflectlite", typ: $funcType([Kind], [], false)}]; ptrType$10.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; Kind.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$1.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "Kind", name: "Kind", pkg: "", typ: $funcType([], [Kind], false)}, {prop: "pointers", name: "pointers", pkg: "internal/reflectlite", typ: $funcType([], [$Bool], false)}, {prop: "common", name: "common", pkg: "internal/reflectlite", typ: $funcType([], [ptrType$1], false)}, {prop: "exportedMethods", name: "exportedMethods", pkg: "internal/reflectlite", typ: $funcType([], [sliceType$5], false)}, {prop: "NumMethod", name: "NumMethod", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "PkgPath", name: "PkgPath", pkg: "", typ: $funcType([], [$String], false)}, {prop: "hasName", name: "hasName", pkg: "internal/reflectlite", typ: $funcType([], [$Bool], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "chanDir", name: "chanDir", pkg: "internal/reflectlite", typ: $funcType([], [chanDir], false)}, {prop: "Elem", name: "Elem", pkg: "", typ: $funcType([], [Type], false)}, {prop: "In", name: "In", pkg: "", typ: $funcType([$Int], [Type], false)}, {prop: "Len", name: "Len", 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: "Comparable", name: "Comparable", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "IsVariadic", name: "IsVariadic", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "kindType", name: "kindType", pkg: "internal/reflectlite", typ: $funcType([], [ptrType$1], false)}, {prop: "Field", name: "Field", pkg: "", typ: $funcType([$Int], [structField], false)}, {prop: "Key", name: "Key", pkg: "", typ: $funcType([], [Type], false)}, {prop: "NumField", name: "NumField", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Method", name: "Method", pkg: "", typ: $funcType([$Int], [Method], false)}, {prop: "uncommon", name: "uncommon", pkg: "internal/reflectlite", typ: $funcType([], [ptrType$4], false)}, {prop: "nameOff", name: "nameOff", pkg: "internal/reflectlite", typ: $funcType([nameOff], [name], false)}, {prop: "typeOff", name: "typeOff", pkg: "internal/reflectlite", typ: $funcType([typeOff], [ptrType$1], false)}, {prop: "ptrTo", name: "ptrTo", pkg: "internal/reflectlite", typ: $funcType([], [ptrType$1], false)}]; ptrType$11.methods = [{prop: "NumMethod", name: "NumMethod", pkg: "", typ: $funcType([], [$Int], false)}]; ptrType$12.methods = [{prop: "offset", name: "offset", pkg: "internal/reflectlite", typ: $funcType([], [$Uintptr], false)}, {prop: "embedded", name: "embedded", pkg: "internal/reflectlite", typ: $funcType([], [$Bool], false)}]; ptrType$13.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$4.methods = [{prop: "methods", name: "methods", pkg: "internal/reflectlite", typ: $funcType([], [sliceType$5], false)}, {prop: "exportedMethods", name: "exportedMethods", pkg: "internal/reflectlite", typ: $funcType([], [sliceType$5], false)}]; ptrType$5.methods = [{prop: "in$", name: "in", pkg: "internal/reflectlite", typ: $funcType([], [sliceType$2], false)}, {prop: "out", name: "out", pkg: "internal/reflectlite", typ: $funcType([], [sliceType$2], false)}]; name.methods = [{prop: "data", name: "data", pkg: "internal/reflectlite", typ: $funcType([$Int, $String], [ptrType$6], false)}, {prop: "hasTag", name: "hasTag", pkg: "internal/reflectlite", typ: $funcType([], [$Bool], false)}, {prop: "readVarint", name: "readVarint", pkg: "internal/reflectlite", typ: $funcType([$Int], [$Int, $Int], false)}, {prop: "name", name: "name", pkg: "internal/reflectlite", typ: $funcType([], [$String], false)}, {prop: "tag", name: "tag", pkg: "internal/reflectlite", typ: $funcType([], [$String], false)}, {prop: "pkgPath", name: "pkgPath", pkg: "internal/reflectlite", typ: $funcType([], [$String], false)}, {prop: "isExported", name: "isExported", pkg: "internal/reflectlite", typ: $funcType([], [$Bool], false)}]; ptrType$9.methods = [{prop: "skipUntilValidKey", name: "skipUntilValidKey", pkg: "internal/reflectlite", typ: $funcType([], [], false)}]; Value.init("internal/reflectlite", [{prop: "typ", name: "typ", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "ptr", name: "ptr", embedded: false, exported: false, typ: $UnsafePointer, tag: ""}, {prop: "flag", name: "flag", embedded: true, exported: false, typ: flag, tag: ""}]); ValueError.init("", [{prop: "Method", name: "Method", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Kind", name: "Kind", embedded: false, exported: true, typ: Kind, tag: ""}]); Type.init([{prop: "AssignableTo", name: "AssignableTo", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "Comparable", name: "Comparable", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Elem", name: "Elem", pkg: "", typ: $funcType([], [Type], false)}, {prop: "Implements", name: "Implements", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "Kind", name: "Kind", pkg: "", typ: $funcType([], [Kind], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], 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: "internal/reflectlite", typ: $funcType([], [ptrType$1], false)}, {prop: "uncommon", name: "uncommon", pkg: "internal/reflectlite", typ: $funcType([], [ptrType$4], false)}]); rtype.init("internal/reflectlite", [{prop: "size", name: "size", embedded: false, exported: false, typ: $Uintptr, tag: ""}, {prop: "ptrdata", name: "ptrdata", embedded: false, exported: false, typ: $Uintptr, tag: ""}, {prop: "hash", name: "hash", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "tflag", name: "tflag", embedded: false, exported: false, typ: tflag, tag: ""}, {prop: "align", name: "align", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "fieldAlign", name: "fieldAlign", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "kind", name: "kind", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "equal", name: "equal", embedded: false, exported: false, typ: funcType$2, tag: ""}, {prop: "gcdata", name: "gcdata", embedded: false, exported: false, typ: ptrType$6, tag: ""}, {prop: "str", name: "str", embedded: false, exported: false, typ: nameOff, tag: ""}, {prop: "ptrToThis", name: "ptrToThis", embedded: false, exported: false, typ: typeOff, tag: ""}]); method.init("internal/reflectlite", [{prop: "name", name: "name", embedded: false, exported: false, typ: nameOff, tag: ""}, {prop: "mtyp", name: "mtyp", embedded: false, exported: false, typ: typeOff, tag: ""}, {prop: "ifn", name: "ifn", embedded: false, exported: false, typ: textOff, tag: ""}, {prop: "tfn", name: "tfn", embedded: false, exported: false, typ: textOff, tag: ""}]); arrayType.init("internal/reflectlite", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "elem", name: "elem", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "slice", name: "slice", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "len", name: "len", embedded: false, exported: false, typ: $Uintptr, tag: ""}]); chanType.init("internal/reflectlite", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "elem", name: "elem", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "dir", name: "dir", embedded: false, exported: false, typ: $Uintptr, tag: ""}]); imethod.init("internal/reflectlite", [{prop: "name", name: "name", embedded: false, exported: false, typ: nameOff, tag: ""}, {prop: "typ", name: "typ", embedded: false, exported: false, typ: typeOff, tag: ""}]); interfaceType.init("internal/reflectlite", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "pkgPath", name: "pkgPath", embedded: false, exported: false, typ: name, tag: ""}, {prop: "methods", name: "methods", embedded: false, exported: false, typ: sliceType$9, tag: ""}]); mapType.init("internal/reflectlite", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "key", name: "key", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "elem", name: "elem", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "bucket", name: "bucket", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "hasher", name: "hasher", embedded: false, exported: false, typ: funcType$3, tag: ""}, {prop: "keysize", name: "keysize", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "valuesize", name: "valuesize", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "bucketsize", name: "bucketsize", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "flags", name: "flags", embedded: false, exported: false, typ: $Uint32, tag: ""}]); ptrType.init("internal/reflectlite", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "elem", name: "elem", embedded: false, exported: false, typ: ptrType$1, tag: ""}]); sliceType.init("internal/reflectlite", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "elem", name: "elem", embedded: false, exported: false, typ: ptrType$1, tag: ""}]); structField.init("internal/reflectlite", [{prop: "name", name: "name", embedded: false, exported: false, typ: name, tag: ""}, {prop: "typ", name: "typ", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "offsetEmbed", name: "offsetEmbed", embedded: false, exported: false, typ: $Uintptr, tag: ""}]); structType.init("internal/reflectlite", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "pkgPath", name: "pkgPath", embedded: false, exported: false, typ: name, tag: ""}, {prop: "fields", name: "fields", embedded: false, exported: false, typ: sliceType$10, tag: ""}]); errorString.init("internal/reflectlite", [{prop: "s", name: "s", embedded: false, exported: false, typ: $String, tag: ""}]); Method.init("", [{prop: "Name", name: "Name", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "PkgPath", name: "PkgPath", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Type", name: "Type", embedded: false, exported: true, typ: Type, tag: ""}, {prop: "Func", name: "Func", embedded: false, exported: true, typ: Value, tag: ""}, {prop: "Index", name: "Index", embedded: false, exported: true, typ: $Int, tag: ""}]); uncommonType.init("internal/reflectlite", [{prop: "pkgPath", name: "pkgPath", embedded: false, exported: false, typ: nameOff, tag: ""}, {prop: "mcount", name: "mcount", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "xcount", name: "xcount", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "moff", name: "moff", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "_methods", name: "_methods", embedded: false, exported: false, typ: sliceType$5, tag: ""}]); funcType.init("internal/reflectlite", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: "reflect:\"func\""}, {prop: "inCount", name: "inCount", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "outCount", name: "outCount", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "_in", name: "_in", embedded: false, exported: false, typ: sliceType$2, tag: ""}, {prop: "_out", name: "_out", embedded: false, exported: false, typ: sliceType$2, tag: ""}]); name.init("internal/reflectlite", [{prop: "bytes", name: "bytes", embedded: false, exported: false, typ: ptrType$6, tag: ""}]); nameData.init("internal/reflectlite", [{prop: "name", name: "name", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "tag", name: "tag", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "exported", name: "exported", embedded: false, exported: false, typ: $Bool, tag: ""}]); mapIter.init("internal/reflectlite", [{prop: "t", name: "t", embedded: false, exported: false, typ: Type, tag: ""}, {prop: "m", name: "m", embedded: false, exported: false, typ: ptrType$2, tag: ""}, {prop: "keys", name: "keys", embedded: false, exported: false, typ: ptrType$2, tag: ""}, {prop: "i", name: "i", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "last", name: "last", embedded: false, exported: false, typ: ptrType$2, tag: ""}]); TypeEx.init([{prop: "AssignableTo", name: "AssignableTo", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "Comparable", name: "Comparable", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Elem", name: "Elem", pkg: "", typ: $funcType([], [Type], false)}, {prop: "Implements", name: "Implements", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "Key", name: "Key", pkg: "", typ: $funcType([], [Type], false)}, {prop: "Kind", name: "Kind", pkg: "", typ: $funcType([], [Kind], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], 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: "internal/reflectlite", typ: $funcType([], [ptrType$1], false)}, {prop: "uncommon", name: "uncommon", pkg: "internal/reflectlite", typ: $funcType([], [ptrType$4], 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 = js.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = unsafeheader.$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; } uint8Type = ptrType$1.nil; nameOffList = sliceType$1.nil; typeOffList = sliceType$2.nil; 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"]); callHelper = $assertType($internalize($call, $emptyInterface), funcType$1); $pkg.ErrSyntax = new errorString.ptr("invalid syntax"); initialized = false; idJsType = "_jsType"; idReflectType = "_reflectType"; idKindType = "kindType"; idRtype = "_rtype"; uncommonTypeMap = {}; nameMap = {}; jsObjectPtr = reflectType($jsObjectPtr); selectHelper = $assertType($internalize($select, $emptyInterface), funcType$1); $r = 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["errors"] = (function() { var $pkg = {}, $init, reflectlite, errorString, ptrType, interfaceType, interfaceType$1, ptrType$1, errorType, _r, Unwrap, Is, New; reflectlite = $packages["internal/reflectlite"]; errorString = $pkg.errorString = $newType(0, $kindStruct, "errors.errorString", true, "errors", false, function(s_) { this.$val = this; if (arguments.length === 0) { this.s = ""; return; } this.s = s_; }); ptrType = $ptrType($error); interfaceType = $interfaceType([{prop: "Unwrap", name: "Unwrap", pkg: "", typ: $funcType([], [$error], false)}]); interfaceType$1 = $interfaceType([{prop: "Is", name: "Is", pkg: "", typ: $funcType([$error], [$Bool], false)}]); ptrType$1 = $ptrType(errorString); Unwrap = function(err) { var $24r, _r$1, _tuple, err, ok, u, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; ok = $f.ok; u = $f.u; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _tuple = $assertType(err, interfaceType, true); u = _tuple[0]; ok = _tuple[1]; if (!ok) { $s = -1; return $ifaceNil; } _r$1 = u.Unwrap(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Unwrap }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.ok = ok; $f.u = u; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Unwrap = Unwrap; Is = function(err, target) { var _r$1, _r$2, _r$3, _tuple, _v, err, isComparable, ok, target, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; _v = $f._v; err = $f.err; isComparable = $f.isComparable; ok = $f.ok; target = $f.target; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if ($interfaceIsEqual(target, $ifaceNil)) { $s = -1; return $interfaceIsEqual(err, target); } _r$1 = reflectlite.TypeOf(target).Comparable(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } isComparable = _r$1; /* while (true) { */ case 2: if (isComparable && $interfaceIsEqual(err, target)) { $s = -1; return true; } _tuple = $assertType(err, interfaceType$1, true); x = _tuple[0]; ok = _tuple[1]; if (!(ok)) { _v = false; $s = 6; continue s; } _r$2 = x.Is(target); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _v = _r$2; case 6: /* */ if (_v) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_v) { */ case 4: $s = -1; return true; /* } */ case 5: _r$3 = Unwrap(err); /* */ $s = 8; case 8: 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 = -1; return false; } $s = 2; continue; case 3: $s = -1; return false; /* */ } return; } if ($f === undefined) { $f = { $blk: Is }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f._v = _v; $f.err = err; $f.isComparable = isComparable; $f.ok = ok; $f.target = target; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Is = Is; New = function(text) { var text; return new errorString.ptr(text); }; $pkg.New = New; errorString.ptr.prototype.Error = function() { var e; e = this; return e.s; }; errorString.prototype.Error = function() { return this.$val.Error(); }; ptrType$1.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; errorString.init("errors", [{prop: "s", name: "s", embedded: false, exported: false, 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 = reflectlite.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r = reflectlite.TypeOf((ptrType.nil)).Elem(); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } errorType = _r; /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["internal/cpu"] = (function() { var $pkg = {}, $init, CacheLinePad, arrayType, structType, structType$2, structType$5; CacheLinePad = $pkg.CacheLinePad = $newType(0, $kindStruct, "cpu.CacheLinePad", true, "internal/cpu", true, function(_$0_) { this.$val = this; if (arguments.length === 0) { this._$0 = arrayType.zero(); return; } this._$0 = _$0_; }); arrayType = $arrayType($Uint8, 0); structType = $structType("internal/cpu", [{prop: "_$0", name: "_", embedded: false, exported: false, typ: CacheLinePad, tag: ""}, {prop: "HasAES", name: "HasAES", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasADX", name: "HasADX", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasAVX", name: "HasAVX", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasAVX2", name: "HasAVX2", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasBMI1", name: "HasBMI1", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasBMI2", name: "HasBMI2", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasERMS", name: "HasERMS", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasFMA", name: "HasFMA", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasOSXSAVE", name: "HasOSXSAVE", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasPCLMULQDQ", name: "HasPCLMULQDQ", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasPOPCNT", name: "HasPOPCNT", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasSSE2", name: "HasSSE2", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasSSE3", name: "HasSSE3", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasSSSE3", name: "HasSSSE3", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasSSE41", name: "HasSSE41", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasSSE42", name: "HasSSE42", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "_$17", name: "_", embedded: false, exported: false, typ: CacheLinePad, tag: ""}]); structType$2 = $structType("internal/cpu", [{prop: "_$0", name: "_", embedded: false, exported: false, typ: CacheLinePad, tag: ""}, {prop: "HasAES", name: "HasAES", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasPMULL", name: "HasPMULL", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasSHA1", name: "HasSHA1", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasSHA2", name: "HasSHA2", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasCRC32", name: "HasCRC32", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasATOMICS", name: "HasATOMICS", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasCPUID", name: "HasCPUID", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "IsNeoverseN1", name: "IsNeoverseN1", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "IsZeus", name: "IsZeus", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "_$10", name: "_", embedded: false, exported: false, typ: CacheLinePad, tag: ""}]); structType$5 = $structType("internal/cpu", [{prop: "_$0", name: "_", embedded: false, exported: false, typ: CacheLinePad, tag: ""}, {prop: "HasZARCH", name: "HasZARCH", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasSTFLE", name: "HasSTFLE", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasLDISP", name: "HasLDISP", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasEIMM", name: "HasEIMM", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasDFP", name: "HasDFP", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasETF3EH", name: "HasETF3EH", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasMSA", name: "HasMSA", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasAES", name: "HasAES", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasAESCBC", name: "HasAESCBC", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasAESCTR", name: "HasAESCTR", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasAESGCM", name: "HasAESGCM", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasGHASH", name: "HasGHASH", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasSHA1", name: "HasSHA1", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasSHA256", name: "HasSHA256", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasSHA512", name: "HasSHA512", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasSHA3", name: "HasSHA3", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasVX", name: "HasVX", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasVXE", name: "HasVXE", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasKDSA", name: "HasKDSA", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasECDSA", name: "HasECDSA", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HasEDDSA", name: "HasEDDSA", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "_$22", name: "_", embedded: false, exported: false, typ: CacheLinePad, tag: ""}]); CacheLinePad.init("internal/cpu", [{prop: "_$0", name: "_", embedded: false, exported: false, 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: $pkg.X86 = new structType.ptr(new CacheLinePad.ptr(arrayType.zero()), false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, new CacheLinePad.ptr(arrayType.zero())); $pkg.ARM64 = new structType$2.ptr(new CacheLinePad.ptr(arrayType.zero()), false, false, false, false, false, false, false, false, false, new CacheLinePad.ptr(arrayType.zero())); $pkg.S390X = new structType$5.ptr(new CacheLinePad.ptr(arrayType.zero()), false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, new CacheLinePad.ptr(arrayType.zero())); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["internal/bytealg"] = (function() { var $pkg = {}, $init, cpu, IndexByte, IndexByteString, Index, IndexString, Cutover, Equal, HashStrBytes, IndexRabinKarpBytes; cpu = $packages["internal/cpu"]; IndexByte = function(b, c) { var _i, _ref, b, c, i, x; _ref = b; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; x = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (x === c) { return i; } _i++; } return -1; }; $pkg.IndexByte = IndexByte; IndexByteString = function(s, c) { var c, i, s; i = 0; while (true) { if (!(i < s.length)) { break; } if (s.charCodeAt(i) === c) { return i; } i = i + (1) >> 0; } return -1; }; $pkg.IndexByteString = IndexByteString; Index = function(a, b) { var a, b; $panic(new $String("unimplemented")); }; $pkg.Index = Index; IndexString = function(a, b) { var a, b; $panic(new $String("unimplemented")); }; $pkg.IndexString = IndexString; Cutover = function(n) { var n; $panic(new $String("unimplemented")); }; $pkg.Cutover = Cutover; Equal = function(a, b) { var _i, _ref, a, b, c, i; if (!((a.$length === b.$length))) { return false; } _ref = a; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; c = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (!((c === ((i < 0 || i >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + i])))) { return false; } _i++; } return true; }; $pkg.Equal = Equal; HashStrBytes = function(sep) { var _tmp, _tmp$1, hash, i, i$1, pow, sep, sq; hash = 0; i = 0; while (true) { if (!(i < sep.$length)) { break; } hash = ($imul(hash, 16777619) >>> 0) + ((((i < 0 || i >= sep.$length) ? ($throwRuntimeError("index out of range"), undefined) : sep.$array[sep.$offset + i]) >>> 0)) >>> 0; i = i + (1) >> 0; } _tmp = 1; _tmp$1 = 16777619; pow = _tmp; sq = _tmp$1; i$1 = sep.$length; while (true) { if (!(i$1 > 0)) { break; } if (!(((i$1 & 1) === 0))) { pow = $imul(pow, (sq)) >>> 0; } sq = $imul(sq, (sq)) >>> 0; i$1 = (i$1 >> $min((1), 31)) >> 0; } return [hash, pow]; }; $pkg.HashStrBytes = HashStrBytes; IndexRabinKarpBytes = function(s, sep) { var _tuple, h, hashsep, i, i$1, n, pow, s, sep, x; _tuple = HashStrBytes(sep); hashsep = _tuple[0]; pow = _tuple[1]; n = sep.$length; h = 0; i = 0; while (true) { if (!(i < n)) { break; } h = ($imul(h, 16777619) >>> 0) + ((((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]) >>> 0)) >>> 0; i = i + (1) >> 0; } if ((h === hashsep) && Equal($subslice(s, 0, n), sep)) { return 0; } i$1 = n; while (true) { if (!(i$1 < s.$length)) { break; } h = $imul(h, (16777619)) >>> 0; h = h + (((((i$1 < 0 || i$1 >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i$1]) >>> 0))) >>> 0; h = h - (($imul(pow, (((x = i$1 - n >> 0, ((x < 0 || x >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + x])) >>> 0))) >>> 0)) >>> 0; i$1 = i$1 + (1) >> 0; if ((h === hashsep) && Equal($subslice(s, (i$1 - n >> 0), i$1), sep)) { return i$1 - n >> 0; } } return -1; }; $pkg.IndexRabinKarpBytes = IndexRabinKarpBytes; $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 = cpu.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $pkg.MaxLen = 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 addr; }; $pkg.Acquire = Acquire; Release = function(addr) { var addr; }; $pkg.Release = Release; ReleaseMerge = function(addr) { var addr; }; $pkg.ReleaseMerge = ReleaseMerge; Disable = function() { }; $pkg.Disable = Disable; Enable = function() { }; $pkg.Enable = Enable; ReadRange = function(addr, len) { var addr, len; }; $pkg.ReadRange = ReadRange; WriteRange = function(addr, len) { var 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, Value, ptrType, CompareAndSwapInt32, CompareAndSwapUint32, CompareAndSwapUint64, CompareAndSwapPointer, AddInt32, AddUint32, LoadInt32, LoadUint32, LoadUint64, LoadPointer, StoreInt32, StoreUint32, StoreUint64, StorePointer, sameType; js = $packages["github.com/gopherjs/gopherjs/js"]; Value = $pkg.Value = $newType(0, $kindStruct, "atomic.Value", true, "sync/atomic", true, function(v_) { this.$val = this; if (arguments.length === 0) { this.v = $ifaceNil; return; } this.v = v_; }); ptrType = $ptrType(Value); CompareAndSwapInt32 = function(addr, old, new$1) { var addr, new$1, old; if (addr.$get() === old) { addr.$set(new$1); return true; } return false; }; $pkg.CompareAndSwapInt32 = CompareAndSwapInt32; CompareAndSwapUint32 = function(addr, old, new$1) { var addr, new$1, old; if (addr.$get() === old) { addr.$set(new$1); return true; } return false; }; $pkg.CompareAndSwapUint32 = CompareAndSwapUint32; CompareAndSwapUint64 = function(addr, old, new$1) { var addr, new$1, old, x; if ((x = addr.$get(), (x.$high === old.$high && x.$low === old.$low))) { addr.$set(new$1); return true; } return false; }; $pkg.CompareAndSwapUint64 = CompareAndSwapUint64; CompareAndSwapPointer = function(addr, old, new$1) { var addr, new$1, old; if (addr.$get() === old) { addr.$set(new$1); return true; } return false; }; $pkg.CompareAndSwapPointer = CompareAndSwapPointer; AddInt32 = function(addr, delta) { var addr, delta, new$1; new$1 = addr.$get() + delta >> 0; addr.$set(new$1); return new$1; }; $pkg.AddInt32 = AddInt32; AddUint32 = function(addr, delta) { var addr, delta, new$1; new$1 = addr.$get() + delta >>> 0; addr.$set(new$1); return new$1; }; $pkg.AddUint32 = AddUint32; LoadInt32 = function(addr) { var addr; return addr.$get(); }; $pkg.LoadInt32 = LoadInt32; LoadUint32 = function(addr) { var addr; return addr.$get(); }; $pkg.LoadUint32 = LoadUint32; LoadUint64 = function(addr) { var addr; return addr.$get(); }; $pkg.LoadUint64 = LoadUint64; LoadPointer = function(addr) { var addr; return addr.$get(); }; $pkg.LoadPointer = LoadPointer; StoreInt32 = function(addr, val) { var addr, val; addr.$set(val); }; $pkg.StoreInt32 = StoreInt32; StoreUint32 = function(addr, val) { var addr, val; addr.$set(val); }; $pkg.StoreUint32 = StoreUint32; StoreUint64 = function(addr, val) { var addr, val; addr.$set(val); }; $pkg.StoreUint64 = StoreUint64; StorePointer = function(addr, val) { var addr, val; addr.$set(val); }; $pkg.StorePointer = StorePointer; Value.ptr.prototype.Load = function() { var v, x; x = $ifaceNil; v = this; x = v.v; return x; }; Value.prototype.Load = function() { return this.$val.Load(); }; Value.ptr.prototype.Store = function(new$1) { var new$1, v; v = this; v.checkNew("store", new$1); v.v = new$1; }; Value.prototype.Store = function(new$1) { return this.$val.Store(new$1); }; Value.ptr.prototype.Swap = function(new$1) { var _tmp, _tmp$1, new$1, old, v; old = $ifaceNil; v = this; v.checkNew("swap", new$1); _tmp = v.v; _tmp$1 = new$1; old = _tmp; v.v = _tmp$1; old = old; return old; }; Value.prototype.Swap = function(new$1) { return this.$val.Swap(new$1); }; Value.ptr.prototype.CompareAndSwap = function(old, new$1) { var new$1, old, swapped, v; swapped = false; v = this; v.checkNew("compare and swap", new$1); if (!($interfaceIsEqual(v.v, $ifaceNil) && $interfaceIsEqual(old, $ifaceNil)) && !sameType(old, new$1)) { $panic(new $String("sync/atomic: compare and swap of inconsistently typed values into Value")); } if (!($interfaceIsEqual(v.v, old))) { swapped = false; return swapped; } v.v = new$1; swapped = true; return swapped; }; Value.prototype.CompareAndSwap = function(old, new$1) { return this.$val.CompareAndSwap(old, new$1); }; Value.ptr.prototype.checkNew = function(op, new$1) { var new$1, op, v; v = this; if ($interfaceIsEqual(new$1, $ifaceNil)) { $panic(new $String("sync/atomic: " + op + " of nil value into Value")); } if (!($interfaceIsEqual(v.v, $ifaceNil)) && !sameType(new$1, v.v)) { $panic(new $String("sync/atomic: " + op + " of inconsistently typed value into Value")); } }; Value.prototype.checkNew = function(op, new$1) { return this.$val.checkNew(op, new$1); }; sameType = function(x, y) { var x, y; return x.constructor === y.constructor; }; ptrType.methods = [{prop: "Load", name: "Load", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "Store", name: "Store", pkg: "", typ: $funcType([$emptyInterface], [], false)}, {prop: "Swap", name: "Swap", pkg: "", typ: $funcType([$emptyInterface], [$emptyInterface], false)}, {prop: "CompareAndSwap", name: "CompareAndSwap", pkg: "", typ: $funcType([$emptyInterface, $emptyInterface], [$Bool], false)}, {prop: "checkNew", name: "checkNew", pkg: "sync/atomic", typ: $funcType([$String, $emptyInterface], [], false)}]; Value.init("sync/atomic", [{prop: "v", name: "v", embedded: false, exported: false, typ: $emptyInterface, 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; } /* */ } 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, js, race, atomic, RWMutex, rlocker, notifyList, Once, Mutex, Locker, Map, readOnly, entry, WaitGroup, Pool, Cond, copyChecker, noCopy, ptrType, ptrType$1, ptrType$2, ptrType$3, ptrType$4, ptrType$5, ptrType$9, ptrType$10, structType, chanType, sliceType$2, arrayType, funcType, ptrType$14, ptrType$15, funcType$1, ptrType$16, mapType, ptrType$17, chanType$1, sliceType$3, ptrType$18, funcType$2, ptrType$19, ptrType$20, ptrType$21, expunged, semWaiters, semAwoken, init, runtime_doSpin, newEntry, runtime_SemacquireMutex, runtime_Semrelease, runtime_notifyListCheck, runtime_canSpin, runtime_nanotime, throw$1, NewCond; js = $packages["github.com/gopherjs/gopherjs/js"]; race = $packages["internal/race"]; atomic = $packages["sync/atomic"]; RWMutex = $pkg.RWMutex = $newType(0, $kindStruct, "sync.RWMutex", true, "sync", true, 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", true, "sync", false, 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_; }); notifyList = $pkg.notifyList = $newType(0, $kindStruct, "sync.notifyList", true, "sync", false, function(wait_, notify_, lock_, head_, tail_) { this.$val = this; if (arguments.length === 0) { this.wait = 0; this.notify = 0; this.lock = 0; this.head = 0; this.tail = 0; return; } this.wait = wait_; this.notify = notify_; this.lock = lock_; this.head = head_; this.tail = tail_; }); Once = $pkg.Once = $newType(0, $kindStruct, "sync.Once", true, "sync", true, function(done_, m_) { this.$val = this; if (arguments.length === 0) { this.done = 0; this.m = new Mutex.ptr(0, 0); return; } this.done = done_; this.m = m_; }); Mutex = $pkg.Mutex = $newType(0, $kindStruct, "sync.Mutex", true, "sync", true, 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", true, "sync", true, null); Map = $pkg.Map = $newType(0, $kindStruct, "sync.Map", true, "sync", true, function(mu_, read_, dirty_, misses_) { this.$val = this; if (arguments.length === 0) { this.mu = new Mutex.ptr(0, 0); this.read = new atomic.Value.ptr($ifaceNil); this.dirty = false; this.misses = 0; return; } this.mu = mu_; this.read = read_; this.dirty = dirty_; this.misses = misses_; }); readOnly = $pkg.readOnly = $newType(0, $kindStruct, "sync.readOnly", true, "sync", false, function(m_, amended_) { this.$val = this; if (arguments.length === 0) { this.m = false; this.amended = false; return; } this.m = m_; this.amended = amended_; }); entry = $pkg.entry = $newType(0, $kindStruct, "sync.entry", true, "sync", false, function(p_) { this.$val = this; if (arguments.length === 0) { this.p = 0; return; } this.p = p_; }); WaitGroup = $pkg.WaitGroup = $newType(0, $kindStruct, "sync.WaitGroup", true, "sync", true, function(counter_, ch_, state1_) { this.$val = this; if (arguments.length === 0) { this.counter = 0; this.ch = $chanNil; this.state1 = arrayType.zero(); return; } this.counter = counter_; this.ch = ch_; this.state1 = state1_; }); Pool = $pkg.Pool = $newType(0, $kindStruct, "sync.Pool", true, "sync", true, function(store_, New_) { this.$val = this; if (arguments.length === 0) { this.store = sliceType$3.nil; this.New = $throwNilPointerError; return; } this.store = store_; this.New = New_; }); Cond = $pkg.Cond = $newType(0, $kindStruct, "sync.Cond", true, "sync", true, function(noCopy_, L_, notify_, checker_, n_, ch_) { this.$val = this; if (arguments.length === 0) { this.noCopy = new noCopy.ptr(); this.L = $ifaceNil; this.notify = new notifyList.ptr(0, 0, 0, 0, 0); this.checker = 0; this.n = 0; this.ch = $chanNil; return; } this.noCopy = noCopy_; this.L = L_; this.notify = notify_; this.checker = checker_; this.n = n_; this.ch = ch_; }); copyChecker = $pkg.copyChecker = $newType(4, $kindUintptr, "sync.copyChecker", true, "sync", false, null); noCopy = $pkg.noCopy = $newType(0, $kindStruct, "sync.noCopy", true, "sync", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); ptrType = $ptrType($Uint64); ptrType$1 = $ptrType($Uint32); ptrType$2 = $ptrType($Int32); ptrType$3 = $ptrType(rlocker); ptrType$4 = $ptrType(RWMutex); ptrType$5 = $ptrType($UnsafePointer); ptrType$9 = $ptrType($emptyInterface); ptrType$10 = $ptrType(entry); structType = $structType("", []); chanType = $chanType($Bool, false, false); sliceType$2 = $sliceType(chanType); arrayType = $arrayType($Uint32, 3); funcType = $funcType([], [], false); ptrType$14 = $ptrType(Once); ptrType$15 = $ptrType(Mutex); funcType$1 = $funcType([$emptyInterface, $emptyInterface], [$Bool], false); ptrType$16 = $ptrType(Map); mapType = $mapType($emptyInterface, ptrType$10); ptrType$17 = $ptrType(WaitGroup); chanType$1 = $chanType(structType, false, false); sliceType$3 = $sliceType($emptyInterface); ptrType$18 = $ptrType(Pool); funcType$2 = $funcType([], [$emptyInterface], false); ptrType$19 = $ptrType(Cond); ptrType$20 = $ptrType(copyChecker); ptrType$21 = $ptrType(noCopy); WaitGroup.ptr.prototype.Done = function() { var wg; wg = this; wg.Add(-1); }; WaitGroup.prototype.Done = function() { return this.$val.Done(); }; RWMutex.ptr.prototype.RLock = function() { var rw, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; rw = $f.rw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rw = this; if (false) { $unused(rw.w.state); race.Disable(); } /* */ if (atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$2(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$2(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), 1) < 0) { */ case 1: $r = runtime_SemacquireMutex((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw))), false, 0); /* */ $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; return; /* */ } return; } if ($f === undefined) { $f = { $blk: RWMutex.ptr.prototype.RLock }; } $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 r, rw, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; r = $f.r; rw = $f.rw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rw = this; if (false) { $unused(rw.w.state); 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$2(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: $r = rw.rUnlockSlow(r); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: if (false) { race.Enable(); } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: RWMutex.ptr.prototype.RUnlock }; } $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.rUnlockSlow = function(r) { var r, rw, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; r = $f.r; rw = $f.rw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rw = this; if (((r + 1 >> 0) === 0) || ((r + 1 >> 0) === -1073741824)) { race.Enable(); throw$1("sync: RUnlock of unlocked RWMutex"); } /* */ if (atomic.AddInt32((rw.$ptr_readerWait || (rw.$ptr_readerWait = new ptrType$2(function() { return this.$target.readerWait; }, function($v) { this.$target.readerWait = $v; }, rw))), -1) === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (atomic.AddInt32((rw.$ptr_readerWait || (rw.$ptr_readerWait = new ptrType$2(function() { return this.$target.readerWait; }, function($v) { this.$target.readerWait = $v; }, rw))), -1) === 0) { */ case 1: $r = runtime_Semrelease((rw.$ptr_writerSem || (rw.$ptr_writerSem = new ptrType$1(function() { return this.$target.writerSem; }, function($v) { this.$target.writerSem = $v; }, rw))), false, 1); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: RWMutex.ptr.prototype.rUnlockSlow }; } $f.r = r; $f.rw = rw; $f.$s = $s; $f.$r = $r; return $f; }; RWMutex.prototype.rUnlockSlow = function(r) { return this.$val.rUnlockSlow(r); }; RWMutex.ptr.prototype.Lock = function() { var r, rw, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; r = $f.r; rw = $f.rw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rw = this; if (false) { $unused(rw.w.state); 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$2(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$2(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$2(function() { return this.$target.readerWait; }, function($v) { this.$target.readerWait = $v; }, rw))), r) === 0))) { */ case 2: $r = runtime_SemacquireMutex((rw.$ptr_writerSem || (rw.$ptr_writerSem = new ptrType$1(function() { return this.$target.writerSem; }, function($v) { this.$target.writerSem = $v; }, rw))), false, 0); /* */ $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; return; /* */ } return; } if ($f === undefined) { $f = { $blk: RWMutex.ptr.prototype.Lock }; } $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 i, r, rw, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; 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) { $unused(rw.w.state); race.Release(((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw))))); race.Disable(); } r = atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$2(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), 1073741824); if (r >= 1073741824) { race.Enable(); throw$1("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))), false, 0); /* */ $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; return; /* */ } return; } if ($f === undefined) { $f = { $blk: RWMutex.ptr.prototype.Unlock }; } $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 rw; rw = this; return ($pointerOfStructConversion(rw, ptrType$3)); }; RWMutex.prototype.RLocker = function() { return this.$val.RLocker(); }; rlocker.ptr.prototype.Lock = function() { var r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; $r = ($pointerOfStructConversion(r, ptrType$4)).RLock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: rlocker.ptr.prototype.Lock }; } $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 r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; $r = ($pointerOfStructConversion(r, ptrType$4)).RUnlock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: rlocker.ptr.prototype.Unlock }; } $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; rlocker.prototype.Unlock = function() { return this.$val.Unlock(); }; init = function() { var n; n = new notifyList.ptr(0, 0, 0, 0, 0); runtime_notifyListCheck(20); }; runtime_doSpin = function() { $throwRuntimeError("native function not implemented: sync.runtime_doSpin"); }; Once.ptr.prototype.Do = function(f) { var f, o, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; f = $f.f; o = $f.o; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: 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)))) === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (atomic.LoadUint32((o.$ptr_done || (o.$ptr_done = new ptrType$1(function() { return this.$target.done; }, function($v) { this.$target.done = $v; }, o)))) === 0) { */ case 1: $r = o.doSlow(f); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Once.ptr.prototype.Do }; } $f.f = f; $f.o = o; $f.$s = $s; $f.$r = $r; return $f; }; Once.prototype.Do = function(f) { return this.$val.Do(f); }; Once.ptr.prototype.doSlow = function(f) { var f, o, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; 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 = []; $curGoroutine.deferStack.push($deferred); o = this; $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; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Once.ptr.prototype.doSlow }; } $f.f = f; $f.o = o; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Once.prototype.doSlow = function(f) { return this.$val.doSlow(f); }; Mutex.ptr.prototype.Lock = function() { var m, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; m = $f.m; $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$2(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), 0, 1)) { if (false) { race.Acquire((m)); } $s = -1; return; } $r = m.lockSlow(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Mutex.ptr.prototype.Lock }; } $f.m = m; $f.$s = $s; $f.$r = $r; return $f; }; Mutex.prototype.Lock = function() { return this.$val.Lock(); }; Mutex.ptr.prototype.lockSlow = function() { var awoke, delta, iter, m, new$1, old, queueLifo, starving, waitStartTime, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; awoke = $f.awoke; delta = $f.delta; iter = $f.iter; m = $f.m; new$1 = $f.new$1; old = $f.old; queueLifo = $f.queueLifo; starving = $f.starving; waitStartTime = $f.waitStartTime; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: m = this; waitStartTime = new $Int64(0, 0); starving = false; awoke = false; iter = 0; old = m.state; /* while (true) { */ case 1: /* */ if (((old & 5) === 1) && runtime_canSpin(iter)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (((old & 5) === 1) && runtime_canSpin(iter)) { */ case 3: if (!awoke && ((old & 2) === 0) && !(((old >> 3 >> 0) === 0)) && atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$2(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), old, old | 2)) { awoke = true; } $r = runtime_doSpin(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } iter = iter + (1) >> 0; old = m.state; /* continue; */ $s = 1; continue; /* } */ case 4: new$1 = old; if ((old & 4) === 0) { new$1 = new$1 | (1); } if (!(((old & 5) === 0))) { new$1 = new$1 + (8) >> 0; } if (starving && !(((old & 1) === 0))) { new$1 = new$1 | (4); } if (awoke) { if ((new$1 & 2) === 0) { throw$1("sync: inconsistent mutex state"); } new$1 = (new$1 & ~(2)) >> 0; } /* */ if (atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$2(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), old, new$1)) { $s = 6; continue; } /* */ $s = 7; continue; /* if (atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$2(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), old, new$1)) { */ case 6: if ((old & 5) === 0) { /* break; */ $s = 2; continue; } queueLifo = !((waitStartTime.$high === 0 && waitStartTime.$low === 0)); if ((waitStartTime.$high === 0 && waitStartTime.$low === 0)) { waitStartTime = runtime_nanotime(); } $r = runtime_SemacquireMutex((m.$ptr_sema || (m.$ptr_sema = new ptrType$1(function() { return this.$target.sema; }, function($v) { this.$target.sema = $v; }, m))), queueLifo, 1); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } starving = starving || (x = (x$1 = runtime_nanotime(), new $Int64(x$1.$high - waitStartTime.$high, x$1.$low - waitStartTime.$low)), (x.$high > 0 || (x.$high === 0 && x.$low > 1000000))); old = m.state; if (!(((old & 4) === 0))) { if (!(((old & 3) === 0)) || ((old >> 3 >> 0) === 0)) { throw$1("sync: inconsistent mutex state"); } delta = -7; if (!starving || ((old >> 3 >> 0) === 1)) { delta = delta - (4) >> 0; } atomic.AddInt32((m.$ptr_state || (m.$ptr_state = new ptrType$2(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), delta); /* break; */ $s = 2; continue; } awoke = true; iter = 0; $s = 8; continue; /* } else { */ case 7: old = m.state; /* } */ case 8: $s = 1; continue; case 2: if (false) { race.Acquire((m)); } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Mutex.ptr.prototype.lockSlow }; } $f.awoke = awoke; $f.delta = delta; $f.iter = iter; $f.m = m; $f.new$1 = new$1; $f.old = old; $f.queueLifo = queueLifo; $f.starving = starving; $f.waitStartTime = waitStartTime; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; Mutex.prototype.lockSlow = function() { return this.$val.lockSlow(); }; Mutex.ptr.prototype.Unlock = function() { var m, new$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; m = $f.m; new$1 = $f.new$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: m = this; if (false) { $unused(m.state); race.Release((m)); } new$1 = atomic.AddInt32((m.$ptr_state || (m.$ptr_state = new ptrType$2(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), -1); /* */ if (!((new$1 === 0))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((new$1 === 0))) { */ case 1: $r = m.unlockSlow(new$1); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Mutex.ptr.prototype.Unlock }; } $f.m = m; $f.new$1 = new$1; $f.$s = $s; $f.$r = $r; return $f; }; Mutex.prototype.Unlock = function() { return this.$val.Unlock(); }; Mutex.ptr.prototype.unlockSlow = function(new$1) { var m, new$1, old, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; 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 ((((new$1 + 1 >> 0)) & 1) === 0) { throw$1("sync: unlock of unlocked mutex"); } /* */ if ((new$1 & 4) === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if ((new$1 & 4) === 0) { */ case 1: old = new$1; /* while (true) { */ case 4: if (((old >> 3 >> 0) === 0) || !(((old & 7) === 0))) { $s = -1; return; } new$1 = ((old - 8 >> 0)) | 2; /* */ if (atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$2(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), old, new$1)) { $s = 6; continue; } /* */ $s = 7; continue; /* if (atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$2(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), old, new$1)) { */ case 6: $r = runtime_Semrelease((m.$ptr_sema || (m.$ptr_sema = new ptrType$1(function() { return this.$target.sema; }, function($v) { this.$target.sema = $v; }, m))), false, 1); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 7: old = m.state; $s = 4; continue; case 5: $s = 3; continue; /* } else { */ case 2: $r = runtime_Semrelease((m.$ptr_sema || (m.$ptr_sema = new ptrType$1(function() { return this.$target.sema; }, function($v) { this.$target.sema = $v; }, m))), true, 1); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Mutex.ptr.prototype.unlockSlow }; } $f.m = m; $f.new$1 = new$1; $f.old = old; $f.$s = $s; $f.$r = $r; return $f; }; Mutex.prototype.unlockSlow = function(new$1) { return this.$val.unlockSlow(new$1); }; newEntry = function(i) { var i, i$24ptr; return new entry.ptr(((i$24ptr || (i$24ptr = new ptrType$9(function() { return i; }, function($v) { i = $v; }))))); }; Map.ptr.prototype.Load = function(key) { var _entry, _entry$1, _entry$2, _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, e, key, m, ok, read, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _entry$2 = $f._entry$2; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _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; e = $f.e; key = $f.key; m = $f.m; ok = $f.ok; read = $f.read; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: value = $ifaceNil; ok = false; m = this; _tuple = $assertType(m.read.Load(), readOnly, true); read = $clone(_tuple[0], readOnly); _tuple$1 = (_entry = read.m[$emptyInterface.keyFor(key)], _entry !== undefined ? [_entry.v, true] : [ptrType$10.nil, false]); e = _tuple$1[0]; ok = _tuple$1[1]; /* */ if (!ok && read.amended) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!ok && read.amended) { */ case 1: $r = m.mu.Lock(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tuple$2 = $assertType(m.read.Load(), readOnly, true); readOnly.copy(read, _tuple$2[0]); _tuple$3 = (_entry$1 = read.m[$emptyInterface.keyFor(key)], _entry$1 !== undefined ? [_entry$1.v, true] : [ptrType$10.nil, false]); e = _tuple$3[0]; ok = _tuple$3[1]; if (!ok && read.amended) { _tuple$4 = (_entry$2 = m.dirty[$emptyInterface.keyFor(key)], _entry$2 !== undefined ? [_entry$2.v, true] : [ptrType$10.nil, false]); e = _tuple$4[0]; ok = _tuple$4[1]; m.missLocked(); } $r = m.mu.Unlock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: if (!ok) { _tmp = $ifaceNil; _tmp$1 = false; value = _tmp; ok = _tmp$1; $s = -1; return [value, ok]; } _tuple$5 = e.load(); value = _tuple$5[0]; ok = _tuple$5[1]; $s = -1; return [value, ok]; /* */ } return; } if ($f === undefined) { $f = { $blk: Map.ptr.prototype.Load }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._entry$2 = _entry$2; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $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.e = e; $f.key = key; $f.m = m; $f.ok = ok; $f.read = read; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; Map.prototype.Load = function(key) { return this.$val.Load(key); }; entry.ptr.prototype.load = function() { var _tmp, _tmp$1, _tmp$2, _tmp$3, e, ok, p, value; value = $ifaceNil; ok = false; e = this; p = atomic.LoadPointer((e.$ptr_p || (e.$ptr_p = new ptrType$5(function() { return this.$target.p; }, function($v) { this.$target.p = $v; }, e)))); if (p === 0 || p === expunged) { _tmp = $ifaceNil; _tmp$1 = false; value = _tmp; ok = _tmp$1; return [value, ok]; } _tmp$2 = (p).$get(); _tmp$3 = true; value = _tmp$2; ok = _tmp$3; return [value, ok]; }; entry.prototype.load = function() { return this.$val.load(); }; Map.ptr.prototype.Store = function(key, value) { var _entry, _entry$1, _entry$2, _key, _key$1, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, e, e$1, e$2, key, m, ok, ok$1, ok$2, read, value, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _entry$2 = $f._entry$2; _key = $f._key; _key$1 = $f._key$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; e = $f.e; e$1 = $f.e$1; e$2 = $f.e$2; key = $f.key; m = $f.m; ok = $f.ok; ok$1 = $f.ok$1; ok$2 = $f.ok$2; read = $f.read; value = $f.value; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: value = [value]; m = this; _tuple = $assertType(m.read.Load(), readOnly, true); read = $clone(_tuple[0], readOnly); _tuple$1 = (_entry = read.m[$emptyInterface.keyFor(key)], _entry !== undefined ? [_entry.v, true] : [ptrType$10.nil, false]); e = _tuple$1[0]; ok = _tuple$1[1]; if (ok && e.tryStore((value.$ptr || (value.$ptr = new ptrType$9(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, value))))) { $s = -1; return; } $r = m.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tuple$2 = $assertType(m.read.Load(), readOnly, true); readOnly.copy(read, _tuple$2[0]); _tuple$3 = (_entry$1 = read.m[$emptyInterface.keyFor(key)], _entry$1 !== undefined ? [_entry$1.v, true] : [ptrType$10.nil, false]); e$1 = _tuple$3[0]; ok$1 = _tuple$3[1]; if (ok$1) { if (e$1.unexpungeLocked()) { _key = key; (m.dirty || $throwRuntimeError("assignment to entry in nil map"))[$emptyInterface.keyFor(_key)] = { k: _key, v: e$1 }; } e$1.storeLocked((value.$ptr || (value.$ptr = new ptrType$9(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, value)))); } else { _tuple$4 = (_entry$2 = m.dirty[$emptyInterface.keyFor(key)], _entry$2 !== undefined ? [_entry$2.v, true] : [ptrType$10.nil, false]); e$2 = _tuple$4[0]; ok$2 = _tuple$4[1]; if (ok$2) { e$2.storeLocked((value.$ptr || (value.$ptr = new ptrType$9(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, value)))); } else { if (!read.amended) { m.dirtyLocked(); m.read.Store((x = new readOnly.ptr(read.m, true), new x.constructor.elem(x))); } _key$1 = key; (m.dirty || $throwRuntimeError("assignment to entry in nil map"))[$emptyInterface.keyFor(_key$1)] = { k: _key$1, v: newEntry(value[0]) }; } } $r = m.mu.Unlock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Map.ptr.prototype.Store }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._entry$2 = _entry$2; $f._key = _key; $f._key$1 = _key$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f.e = e; $f.e$1 = e$1; $f.e$2 = e$2; $f.key = key; $f.m = m; $f.ok = ok; $f.ok$1 = ok$1; $f.ok$2 = ok$2; $f.read = read; $f.value = value; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Map.prototype.Store = function(key, value) { return this.$val.Store(key, value); }; entry.ptr.prototype.tryStore = function(i) { var e, i, p; e = this; while (true) { p = atomic.LoadPointer((e.$ptr_p || (e.$ptr_p = new ptrType$5(function() { return this.$target.p; }, function($v) { this.$target.p = $v; }, e)))); if (p === expunged) { return false; } if (atomic.CompareAndSwapPointer((e.$ptr_p || (e.$ptr_p = new ptrType$5(function() { return this.$target.p; }, function($v) { this.$target.p = $v; }, e))), p, (i))) { return true; } } }; entry.prototype.tryStore = function(i) { return this.$val.tryStore(i); }; entry.ptr.prototype.unexpungeLocked = function() { var e, wasExpunged; wasExpunged = false; e = this; wasExpunged = atomic.CompareAndSwapPointer((e.$ptr_p || (e.$ptr_p = new ptrType$5(function() { return this.$target.p; }, function($v) { this.$target.p = $v; }, e))), expunged, 0); return wasExpunged; }; entry.prototype.unexpungeLocked = function() { return this.$val.unexpungeLocked(); }; entry.ptr.prototype.storeLocked = function(i) { var e, i; e = this; atomic.StorePointer((e.$ptr_p || (e.$ptr_p = new ptrType$5(function() { return this.$target.p; }, function($v) { this.$target.p = $v; }, e))), (i)); }; entry.prototype.storeLocked = function(i) { return this.$val.storeLocked(i); }; Map.ptr.prototype.LoadOrStore = function(key, value) { var _entry, _entry$1, _entry$2, _key, _key$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, actual, actual$1, e, e$1, e$2, key, loaded, loaded$1, m, ok, ok$1, ok$2, ok$3, read, value, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _entry$2 = $f._entry$2; _key = $f._key; _key$1 = $f._key$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 = $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; actual = $f.actual; actual$1 = $f.actual$1; e = $f.e; e$1 = $f.e$1; e$2 = $f.e$2; key = $f.key; loaded = $f.loaded; loaded$1 = $f.loaded$1; m = $f.m; ok = $f.ok; ok$1 = $f.ok$1; ok$2 = $f.ok$2; ok$3 = $f.ok$3; read = $f.read; value = $f.value; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: actual = $ifaceNil; loaded = false; m = this; _tuple = $assertType(m.read.Load(), readOnly, true); read = $clone(_tuple[0], readOnly); _tuple$1 = (_entry = read.m[$emptyInterface.keyFor(key)], _entry !== undefined ? [_entry.v, true] : [ptrType$10.nil, false]); e = _tuple$1[0]; ok = _tuple$1[1]; if (ok) { _tuple$2 = e.tryLoadOrStore(value); actual$1 = _tuple$2[0]; loaded$1 = _tuple$2[1]; ok$1 = _tuple$2[2]; if (ok$1) { _tmp = actual$1; _tmp$1 = loaded$1; actual = _tmp; loaded = _tmp$1; $s = -1; return [actual, loaded]; } } $r = m.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tuple$3 = $assertType(m.read.Load(), readOnly, true); readOnly.copy(read, _tuple$3[0]); _tuple$4 = (_entry$1 = read.m[$emptyInterface.keyFor(key)], _entry$1 !== undefined ? [_entry$1.v, true] : [ptrType$10.nil, false]); e$1 = _tuple$4[0]; ok$2 = _tuple$4[1]; if (ok$2) { if (e$1.unexpungeLocked()) { _key = key; (m.dirty || $throwRuntimeError("assignment to entry in nil map"))[$emptyInterface.keyFor(_key)] = { k: _key, v: e$1 }; } _tuple$5 = e$1.tryLoadOrStore(value); actual = _tuple$5[0]; loaded = _tuple$5[1]; } else { _tuple$6 = (_entry$2 = m.dirty[$emptyInterface.keyFor(key)], _entry$2 !== undefined ? [_entry$2.v, true] : [ptrType$10.nil, false]); e$2 = _tuple$6[0]; ok$3 = _tuple$6[1]; if (ok$3) { _tuple$7 = e$2.tryLoadOrStore(value); actual = _tuple$7[0]; loaded = _tuple$7[1]; m.missLocked(); } else { if (!read.amended) { m.dirtyLocked(); m.read.Store((x = new readOnly.ptr(read.m, true), new x.constructor.elem(x))); } _key$1 = key; (m.dirty || $throwRuntimeError("assignment to entry in nil map"))[$emptyInterface.keyFor(_key$1)] = { k: _key$1, v: newEntry(value) }; _tmp$2 = value; _tmp$3 = false; actual = _tmp$2; loaded = _tmp$3; } } $r = m.mu.Unlock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp$4 = actual; _tmp$5 = loaded; actual = _tmp$4; loaded = _tmp$5; $s = -1; return [actual, loaded]; /* */ } return; } if ($f === undefined) { $f = { $blk: Map.ptr.prototype.LoadOrStore }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._entry$2 = _entry$2; $f._key = _key; $f._key$1 = _key$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 = _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.actual = actual; $f.actual$1 = actual$1; $f.e = e; $f.e$1 = e$1; $f.e$2 = e$2; $f.key = key; $f.loaded = loaded; $f.loaded$1 = loaded$1; $f.m = m; $f.ok = ok; $f.ok$1 = ok$1; $f.ok$2 = ok$2; $f.ok$3 = ok$3; $f.read = read; $f.value = value; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Map.prototype.LoadOrStore = function(key, value) { return this.$val.LoadOrStore(key, value); }; entry.ptr.prototype.tryLoadOrStore = function(i) { var _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, actual, e, i, ic, ic$24ptr, loaded, ok, p; actual = $ifaceNil; loaded = false; ok = false; e = this; p = atomic.LoadPointer((e.$ptr_p || (e.$ptr_p = new ptrType$5(function() { return this.$target.p; }, function($v) { this.$target.p = $v; }, e)))); if (p === expunged) { _tmp = $ifaceNil; _tmp$1 = false; _tmp$2 = false; actual = _tmp; loaded = _tmp$1; ok = _tmp$2; return [actual, loaded, ok]; } if (!(p === 0)) { _tmp$3 = (p).$get(); _tmp$4 = true; _tmp$5 = true; actual = _tmp$3; loaded = _tmp$4; ok = _tmp$5; return [actual, loaded, ok]; } ic = i; while (true) { if (atomic.CompareAndSwapPointer((e.$ptr_p || (e.$ptr_p = new ptrType$5(function() { return this.$target.p; }, function($v) { this.$target.p = $v; }, e))), 0, ((ic$24ptr || (ic$24ptr = new ptrType$9(function() { return ic; }, function($v) { ic = $v; })))))) { _tmp$6 = i; _tmp$7 = false; _tmp$8 = true; actual = _tmp$6; loaded = _tmp$7; ok = _tmp$8; return [actual, loaded, ok]; } p = atomic.LoadPointer((e.$ptr_p || (e.$ptr_p = new ptrType$5(function() { return this.$target.p; }, function($v) { this.$target.p = $v; }, e)))); if (p === expunged) { _tmp$9 = $ifaceNil; _tmp$10 = false; _tmp$11 = false; actual = _tmp$9; loaded = _tmp$10; ok = _tmp$11; return [actual, loaded, ok]; } if (!(p === 0)) { _tmp$12 = (p).$get(); _tmp$13 = true; _tmp$14 = true; actual = _tmp$12; loaded = _tmp$13; ok = _tmp$14; return [actual, loaded, ok]; } } }; entry.prototype.tryLoadOrStore = function(i) { return this.$val.tryLoadOrStore(i); }; Map.ptr.prototype.LoadAndDelete = function(key) { var _entry, _entry$1, _entry$2, _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, e, key, loaded, m, ok, read, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _entry$2 = $f._entry$2; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _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; e = $f.e; key = $f.key; loaded = $f.loaded; m = $f.m; ok = $f.ok; read = $f.read; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: value = $ifaceNil; loaded = false; m = this; _tuple = $assertType(m.read.Load(), readOnly, true); read = $clone(_tuple[0], readOnly); _tuple$1 = (_entry = read.m[$emptyInterface.keyFor(key)], _entry !== undefined ? [_entry.v, true] : [ptrType$10.nil, false]); e = _tuple$1[0]; ok = _tuple$1[1]; /* */ if (!ok && read.amended) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!ok && read.amended) { */ case 1: $r = m.mu.Lock(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tuple$2 = $assertType(m.read.Load(), readOnly, true); readOnly.copy(read, _tuple$2[0]); _tuple$3 = (_entry$1 = read.m[$emptyInterface.keyFor(key)], _entry$1 !== undefined ? [_entry$1.v, true] : [ptrType$10.nil, false]); e = _tuple$3[0]; ok = _tuple$3[1]; if (!ok && read.amended) { _tuple$4 = (_entry$2 = m.dirty[$emptyInterface.keyFor(key)], _entry$2 !== undefined ? [_entry$2.v, true] : [ptrType$10.nil, false]); e = _tuple$4[0]; ok = _tuple$4[1]; delete m.dirty[$emptyInterface.keyFor(key)]; m.missLocked(); } $r = m.mu.Unlock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: if (ok) { _tuple$5 = e.delete$(); value = _tuple$5[0]; loaded = _tuple$5[1]; $s = -1; return [value, loaded]; } _tmp = $ifaceNil; _tmp$1 = false; value = _tmp; loaded = _tmp$1; $s = -1; return [value, loaded]; /* */ } return; } if ($f === undefined) { $f = { $blk: Map.ptr.prototype.LoadAndDelete }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._entry$2 = _entry$2; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $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.e = e; $f.key = key; $f.loaded = loaded; $f.m = m; $f.ok = ok; $f.read = read; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; Map.prototype.LoadAndDelete = function(key) { return this.$val.LoadAndDelete(key); }; Map.ptr.prototype.Delete = function(key) { var _r, key, m, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; key = $f.key; m = $f.m; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: m = this; _r = m.LoadAndDelete(key); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Map.ptr.prototype.Delete }; } $f._r = _r; $f.key = key; $f.m = m; $f.$s = $s; $f.$r = $r; return $f; }; Map.prototype.Delete = function(key) { return this.$val.Delete(key); }; entry.ptr.prototype.delete$ = function() { var _tmp, _tmp$1, _tmp$2, _tmp$3, e, ok, p, value; value = $ifaceNil; ok = false; e = this; while (true) { p = atomic.LoadPointer((e.$ptr_p || (e.$ptr_p = new ptrType$5(function() { return this.$target.p; }, function($v) { this.$target.p = $v; }, e)))); if (p === 0 || p === expunged) { _tmp = $ifaceNil; _tmp$1 = false; value = _tmp; ok = _tmp$1; return [value, ok]; } if (atomic.CompareAndSwapPointer((e.$ptr_p || (e.$ptr_p = new ptrType$5(function() { return this.$target.p; }, function($v) { this.$target.p = $v; }, e))), p, 0)) { _tmp$2 = (p).$get(); _tmp$3 = true; value = _tmp$2; ok = _tmp$3; return [value, ok]; } } }; entry.prototype.delete$ = function() { return this.$val.delete$(); }; Map.ptr.prototype.Range = function(f) { var _entry, _i, _keys, _r, _ref, _tuple, _tuple$1, _tuple$2, e, f, k, m, ok, read, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _i = $f._i; _keys = $f._keys; _r = $f._r; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; e = $f.e; f = $f.f; k = $f.k; m = $f.m; ok = $f.ok; read = $f.read; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: m = this; _tuple = $assertType(m.read.Load(), readOnly, true); read = $clone(_tuple[0], readOnly); /* */ if (read.amended) { $s = 1; continue; } /* */ $s = 2; continue; /* if (read.amended) { */ case 1: $r = m.mu.Lock(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tuple$1 = $assertType(m.read.Load(), readOnly, true); readOnly.copy(read, _tuple$1[0]); if (read.amended) { readOnly.copy(read, new readOnly.ptr(m.dirty, false)); m.read.Store(new read.constructor.elem(read)); m.dirty = false; m.misses = 0; } $r = m.mu.Unlock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: _ref = read.m; _i = 0; _keys = $keys(_ref); /* while (true) { */ case 5: /* if (!(_i < _keys.length)) { break; } */ if(!(_i < _keys.length)) { $s = 6; continue; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; /* continue; */ $s = 5; continue; } k = _entry.k; e = _entry.v; _tuple$2 = e.load(); v = _tuple$2[0]; ok = _tuple$2[1]; if (!ok) { _i++; /* continue; */ $s = 5; continue; } _r = f(k, v); /* */ $s = 9; case 9: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (!_r) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!_r) { */ case 7: /* break; */ $s = 6; continue; /* } */ case 8: _i++; $s = 5; continue; case 6: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Map.ptr.prototype.Range }; } $f._entry = _entry; $f._i = _i; $f._keys = _keys; $f._r = _r; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.e = e; $f.f = f; $f.k = k; $f.m = m; $f.ok = ok; $f.read = read; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Map.prototype.Range = function(f) { return this.$val.Range(f); }; Map.ptr.prototype.missLocked = function() { var m, x; m = this; m.misses = m.misses + (1) >> 0; if (m.misses < $keys(m.dirty).length) { return; } m.read.Store((x = new readOnly.ptr(m.dirty, false), new x.constructor.elem(x))); m.dirty = false; m.misses = 0; }; Map.prototype.missLocked = function() { return this.$val.missLocked(); }; Map.ptr.prototype.dirtyLocked = function() { var _entry, _i, _key, _keys, _ref, _tuple, e, k, m, read, x; m = this; if (!(m.dirty === false)) { return; } _tuple = $assertType(m.read.Load(), readOnly, true); read = $clone(_tuple[0], readOnly); m.dirty = (x = $keys(read.m).length, ((x < 0 || x > 2147483647) ? $throwRuntimeError("makemap: size out of range") : {})); _ref = read.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; e = _entry.v; if (!e.tryExpungeLocked()) { _key = k; (m.dirty || $throwRuntimeError("assignment to entry in nil map"))[$emptyInterface.keyFor(_key)] = { k: _key, v: e }; } _i++; } }; Map.prototype.dirtyLocked = function() { return this.$val.dirtyLocked(); }; entry.ptr.prototype.tryExpungeLocked = function() { var e, isExpunged, p; isExpunged = false; e = this; p = atomic.LoadPointer((e.$ptr_p || (e.$ptr_p = new ptrType$5(function() { return this.$target.p; }, function($v) { this.$target.p = $v; }, e)))); while (true) { if (!(p === 0)) { break; } if (atomic.CompareAndSwapPointer((e.$ptr_p || (e.$ptr_p = new ptrType$5(function() { return this.$target.p; }, function($v) { this.$target.p = $v; }, e))), 0, expunged)) { isExpunged = true; return isExpunged; } p = atomic.LoadPointer((e.$ptr_p || (e.$ptr_p = new ptrType$5(function() { return this.$target.p; }, function($v) { this.$target.p = $v; }, e)))); } isExpunged = p === expunged; return isExpunged; }; entry.prototype.tryExpungeLocked = function() { return this.$val.tryExpungeLocked(); }; WaitGroup.ptr.prototype.Add = function(delta) { var delta, wg; wg = this; wg.counter = wg.counter + (delta) >> 0; if (wg.counter < 0) { $panic(new $String("sync: negative WaitGroup counter")); } if (wg.counter > 0 && wg.ch === $chanNil) { wg.ch = new $Chan(structType, 0); } if ((wg.counter === 0) && !(wg.ch === $chanNil)) { $close(wg.ch); wg.ch = $chanNil; } }; WaitGroup.prototype.Add = function(delta) { return this.$val.Add(delta); }; WaitGroup.ptr.prototype.Wait = function() { var _r, wg, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; wg = $f.wg; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: wg = this; /* */ if (wg.counter > 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (wg.counter > 0) { */ case 1: _r = $recv(wg.ch); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r[0]; /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: WaitGroup.ptr.prototype.Wait }; } $f._r = _r; $f.wg = wg; $f.$s = $s; $f.$r = $r; return $f; }; WaitGroup.prototype.Wait = function() { return this.$val.Wait(); }; runtime_SemacquireMutex = function(s, lifo, skipframes) { var _entry, _entry$1, _entry$2, _entry$3, _entry$4, _key, _key$1, _key$2, _r, ch, lifo, s, skipframes, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _entry$2 = $f._entry$2; _entry$3 = $f._entry$3; _entry$4 = $f._entry$4; _key = $f._key; _key$1 = $f._key$1; _key$2 = $f._key$2; _r = $f._r; ch = $f.ch; lifo = $f.lifo; s = $f.s; skipframes = $f.skipframes; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (((s.$get() - (_entry = semAwoken[ptrType$1.keyFor(s)], _entry !== undefined ? _entry.v : 0) >>> 0)) === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (((s.$get() - (_entry = semAwoken[ptrType$1.keyFor(s)], _entry !== undefined ? _entry.v : 0) >>> 0)) === 0) { */ case 1: ch = new $Chan($Bool, 0); if (lifo) { _key = s; (semWaiters || $throwRuntimeError("assignment to entry in nil map"))[ptrType$1.keyFor(_key)] = { k: _key, v: $appendSlice(new sliceType$2([ch]), (_entry$1 = semWaiters[ptrType$1.keyFor(s)], _entry$1 !== undefined ? _entry$1.v : sliceType$2.nil)) }; } else { _key$1 = s; (semWaiters || $throwRuntimeError("assignment to entry in nil map"))[ptrType$1.keyFor(_key$1)] = { k: _key$1, v: $append((_entry$2 = semWaiters[ptrType$1.keyFor(s)], _entry$2 !== undefined ? _entry$2.v : sliceType$2.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]; _key$2 = s; (semAwoken || $throwRuntimeError("assignment to entry in nil map"))[ptrType$1.keyFor(_key$2)] = { k: _key$2, v: (_entry$3 = semAwoken[ptrType$1.keyFor(s)], _entry$3 !== undefined ? _entry$3.v : 0) - (1) >>> 0 }; if ((_entry$4 = semAwoken[ptrType$1.keyFor(s)], _entry$4 !== undefined ? _entry$4.v : 0) === 0) { delete semAwoken[ptrType$1.keyFor(s)]; } /* } */ case 2: s.$set(s.$get() - (1) >>> 0); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: runtime_SemacquireMutex }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._entry$2 = _entry$2; $f._entry$3 = _entry$3; $f._entry$4 = _entry$4; $f._key = _key; $f._key$1 = _key$1; $f._key$2 = _key$2; $f._r = _r; $f.ch = ch; $f.lifo = lifo; $f.s = s; $f.skipframes = skipframes; $f.$s = $s; $f.$r = $r; return $f; }; runtime_Semrelease = function(s, handoff, skipframes) { var _entry, _entry$1, _key, _key$1, ch, handoff, s, skipframes, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _key = $f._key; _key$1 = $f._key$1; ch = $f.ch; handoff = $f.handoff; s = $f.s; skipframes = $f.skipframes; 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$2.nil); if (w.$length === 0) { $s = -1; return; } ch = (0 >= w.$length ? ($throwRuntimeError("index out of range"), undefined) : 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)]; } _key$1 = s; (semAwoken || $throwRuntimeError("assignment to entry in nil map"))[ptrType$1.keyFor(_key$1)] = { k: _key$1, v: (_entry$1 = semAwoken[ptrType$1.keyFor(s)], _entry$1 !== undefined ? _entry$1.v : 0) + (1) >>> 0 }; $r = $send(ch, true); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: runtime_Semrelease }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._key = _key; $f._key$1 = _key$1; $f.ch = ch; $f.handoff = handoff; $f.s = s; $f.skipframes = skipframes; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; runtime_notifyListCheck = function(size) { var size; }; runtime_canSpin = function(i) { var i; return false; }; runtime_nanotime = function() { return $mul64($internalize(new ($global.Date)().getTime(), $Int64), new $Int64(0, 1000000)); }; throw$1 = function(s) { var s; $throwRuntimeError($externalize(s, $String)); }; Pool.ptr.prototype.Get = function() { var $24r, _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; $24r = $f.$24r; _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; } $24r = _r; $s = 6; case 6: return $24r; /* } */ case 4: $s = -1; 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"), undefined) : x.$array[x.$offset + x$1])); p.store = $subslice(p.store, 0, (p.store.$length - 1 >> 0)); $s = -1; return x$2; /* */ } return; } if ($f === undefined) { $f = { $blk: Pool.ptr.prototype.Get }; } $f.$24r = $24r; $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 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); }; Cond.ptr.prototype.Wait = function() { var _r, c, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; c = $f.c; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; c.n = c.n + (1) >> 0; if (c.ch === $chanNil) { c.ch = new $Chan($Bool, 0); } $r = c.L.Unlock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r = $recv(c.ch); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r[0]; $r = c.L.Lock(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Cond.ptr.prototype.Wait }; } $f._r = _r; $f.c = c; $f.$s = $s; $f.$r = $r; return $f; }; Cond.prototype.Wait = function() { return this.$val.Wait(); }; Cond.ptr.prototype.Signal = function() { var c, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; c = $f.c; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (c.n === 0) { $s = -1; return; } c.n = c.n - (1) >> 0; $r = $send(c.ch, true); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Cond.ptr.prototype.Signal }; } $f.c = c; $f.$s = $s; $f.$r = $r; return $f; }; Cond.prototype.Signal = function() { return this.$val.Signal(); }; Cond.ptr.prototype.Broadcast = function() { var c, i, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; c = $f.c; i = $f.i; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; n = c.n; c.n = 0; i = 0; /* while (true) { */ case 1: /* if (!(i < n)) { break; } */ if(!(i < n)) { $s = 2; continue; } $r = $send(c.ch, true); /* */ $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: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Cond.ptr.prototype.Broadcast }; } $f.c = c; $f.i = i; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; Cond.prototype.Broadcast = function() { return this.$val.Broadcast(); }; NewCond = function(l) { var l; return new Cond.ptr(new noCopy.ptr(), l, new notifyList.ptr(0, 0, 0, 0, 0), 0, 0, $chanNil); }; $pkg.NewCond = NewCond; noCopy.ptr.prototype.Lock = function() { }; noCopy.prototype.Lock = function() { return this.$val.Lock(); }; noCopy.ptr.prototype.Unlock = function() { }; noCopy.prototype.Unlock = function() { return this.$val.Unlock(); }; ptrType$4.methods = [{prop: "RLock", name: "RLock", pkg: "", typ: $funcType([], [], false)}, {prop: "RUnlock", name: "RUnlock", pkg: "", typ: $funcType([], [], false)}, {prop: "rUnlockSlow", name: "rUnlockSlow", pkg: "sync", typ: $funcType([$Int32], [], 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$3.methods = [{prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}]; ptrType$14.methods = [{prop: "Do", name: "Do", pkg: "", typ: $funcType([funcType], [], false)}, {prop: "doSlow", name: "doSlow", pkg: "sync", typ: $funcType([funcType], [], false)}]; ptrType$15.methods = [{prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "lockSlow", name: "lockSlow", pkg: "sync", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}, {prop: "unlockSlow", name: "unlockSlow", pkg: "sync", typ: $funcType([$Int32], [], false)}]; ptrType$16.methods = [{prop: "Load", name: "Load", pkg: "", typ: $funcType([$emptyInterface], [$emptyInterface, $Bool], false)}, {prop: "Store", name: "Store", pkg: "", typ: $funcType([$emptyInterface, $emptyInterface], [], false)}, {prop: "LoadOrStore", name: "LoadOrStore", pkg: "", typ: $funcType([$emptyInterface, $emptyInterface], [$emptyInterface, $Bool], false)}, {prop: "LoadAndDelete", name: "LoadAndDelete", pkg: "", typ: $funcType([$emptyInterface], [$emptyInterface, $Bool], false)}, {prop: "Delete", name: "Delete", pkg: "", typ: $funcType([$emptyInterface], [], false)}, {prop: "Range", name: "Range", pkg: "", typ: $funcType([funcType$1], [], false)}, {prop: "missLocked", name: "missLocked", pkg: "sync", typ: $funcType([], [], false)}, {prop: "dirtyLocked", name: "dirtyLocked", pkg: "sync", typ: $funcType([], [], false)}]; ptrType$10.methods = [{prop: "load", name: "load", pkg: "sync", typ: $funcType([], [$emptyInterface, $Bool], false)}, {prop: "tryStore", name: "tryStore", pkg: "sync", typ: $funcType([ptrType$9], [$Bool], false)}, {prop: "unexpungeLocked", name: "unexpungeLocked", pkg: "sync", typ: $funcType([], [$Bool], false)}, {prop: "storeLocked", name: "storeLocked", pkg: "sync", typ: $funcType([ptrType$9], [], false)}, {prop: "tryLoadOrStore", name: "tryLoadOrStore", pkg: "sync", typ: $funcType([$emptyInterface], [$emptyInterface, $Bool, $Bool], false)}, {prop: "delete$", name: "delete", pkg: "sync", typ: $funcType([], [$emptyInterface, $Bool], false)}, {prop: "tryExpungeLocked", name: "tryExpungeLocked", pkg: "sync", typ: $funcType([], [$Bool], false)}]; ptrType$17.methods = [{prop: "state", name: "state", pkg: "sync", typ: $funcType([], [ptrType, ptrType$1], false)}, {prop: "Done", name: "Done", pkg: "", typ: $funcType([], [], false)}, {prop: "Add", name: "Add", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Wait", name: "Wait", pkg: "", typ: $funcType([], [], false)}]; ptrType$18.methods = [{prop: "Get", name: "Get", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "Put", name: "Put", pkg: "", typ: $funcType([$emptyInterface], [], false)}]; ptrType$19.methods = [{prop: "Wait", name: "Wait", pkg: "", typ: $funcType([], [], false)}, {prop: "Signal", name: "Signal", pkg: "", typ: $funcType([], [], false)}, {prop: "Broadcast", name: "Broadcast", pkg: "", typ: $funcType([], [], false)}]; ptrType$20.methods = [{prop: "check", name: "check", pkg: "sync", typ: $funcType([], [], false)}]; ptrType$21.methods = [{prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}]; RWMutex.init("sync", [{prop: "w", name: "w", embedded: false, exported: false, typ: Mutex, tag: ""}, {prop: "writerSem", name: "writerSem", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "readerSem", name: "readerSem", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "readerCount", name: "readerCount", embedded: false, exported: false, typ: $Int32, tag: ""}, {prop: "readerWait", name: "readerWait", embedded: false, exported: false, typ: $Int32, tag: ""}]); rlocker.init("sync", [{prop: "w", name: "w", embedded: false, exported: false, typ: Mutex, tag: ""}, {prop: "writerSem", name: "writerSem", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "readerSem", name: "readerSem", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "readerCount", name: "readerCount", embedded: false, exported: false, typ: $Int32, tag: ""}, {prop: "readerWait", name: "readerWait", embedded: false, exported: false, typ: $Int32, tag: ""}]); notifyList.init("sync", [{prop: "wait", name: "wait", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "notify", name: "notify", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "lock", name: "lock", embedded: false, exported: false, typ: $Uintptr, tag: ""}, {prop: "head", name: "head", embedded: false, exported: false, typ: $UnsafePointer, tag: ""}, {prop: "tail", name: "tail", embedded: false, exported: false, typ: $UnsafePointer, tag: ""}]); Once.init("sync", [{prop: "done", name: "done", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "m", name: "m", embedded: false, exported: false, typ: Mutex, tag: ""}]); Mutex.init("sync", [{prop: "state", name: "state", embedded: false, exported: false, typ: $Int32, tag: ""}, {prop: "sema", name: "sema", embedded: false, exported: false, typ: $Uint32, tag: ""}]); Locker.init([{prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}]); Map.init("sync", [{prop: "mu", name: "mu", embedded: false, exported: false, typ: Mutex, tag: ""}, {prop: "read", name: "read", embedded: false, exported: false, typ: atomic.Value, tag: ""}, {prop: "dirty", name: "dirty", embedded: false, exported: false, typ: mapType, tag: ""}, {prop: "misses", name: "misses", embedded: false, exported: false, typ: $Int, tag: ""}]); readOnly.init("sync", [{prop: "m", name: "m", embedded: false, exported: false, typ: mapType, tag: ""}, {prop: "amended", name: "amended", embedded: false, exported: false, typ: $Bool, tag: ""}]); entry.init("sync", [{prop: "p", name: "p", embedded: false, exported: false, typ: $UnsafePointer, tag: ""}]); WaitGroup.init("sync", [{prop: "counter", name: "counter", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "ch", name: "ch", embedded: false, exported: false, typ: chanType$1, tag: ""}, {prop: "state1", name: "state1", embedded: false, exported: false, typ: arrayType, tag: ""}]); Pool.init("sync", [{prop: "store", name: "store", embedded: false, exported: false, typ: sliceType$3, tag: ""}, {prop: "New", name: "New", embedded: false, exported: true, typ: funcType$2, tag: ""}]); Cond.init("sync", [{prop: "noCopy", name: "noCopy", embedded: false, exported: false, typ: noCopy, tag: ""}, {prop: "L", name: "L", embedded: false, exported: true, typ: Locker, tag: ""}, {prop: "notify", name: "notify", embedded: false, exported: false, typ: notifyList, tag: ""}, {prop: "checker", name: "checker", embedded: false, exported: false, typ: copyChecker, tag: ""}, {prop: "n", name: "n", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "ch", name: "ch", embedded: false, exported: false, typ: chanType, tag: ""}]); noCopy.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 = 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 = atomic.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } expunged = (new Uint8Array(8)); semWaiters = {}; semAwoken = {}; init(); /* */ } 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, eofReader, multiReader, Reader, Writer, Closer, ReadWriter, ReadCloser, WriteCloser, ReadWriteCloser, ReaderFrom, WriterTo, ReaderAt, ByteScanner, ByteWriter, RuneScanner, StringWriter, LimitedReader, SectionReader, discard, nopCloser, sliceType, sliceType$1, ptrType$1, ptrType$2, sliceType$2, ptrType$3, ptrType$8, errInvalidWrite, errWhence, errOffset, blackHolePool, x, MultiReader, WriteString, ReadAtLeast, ReadFull, CopyN, Copy, CopyBuffer, copyBuffer, LimitReader, NewSectionReader, NopCloser, ReadAll; errors = $packages["errors"]; sync = $packages["sync"]; eofReader = $pkg.eofReader = $newType(0, $kindStruct, "io.eofReader", true, "io", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); multiReader = $pkg.multiReader = $newType(0, $kindStruct, "io.multiReader", true, "io", false, function(readers_) { this.$val = this; if (arguments.length === 0) { this.readers = sliceType$2.nil; return; } this.readers = readers_; }); Reader = $pkg.Reader = $newType(8, $kindInterface, "io.Reader", true, "io", true, null); Writer = $pkg.Writer = $newType(8, $kindInterface, "io.Writer", true, "io", true, null); Closer = $pkg.Closer = $newType(8, $kindInterface, "io.Closer", true, "io", true, null); ReadWriter = $pkg.ReadWriter = $newType(8, $kindInterface, "io.ReadWriter", true, "io", true, null); ReadCloser = $pkg.ReadCloser = $newType(8, $kindInterface, "io.ReadCloser", true, "io", true, null); WriteCloser = $pkg.WriteCloser = $newType(8, $kindInterface, "io.WriteCloser", true, "io", true, null); ReadWriteCloser = $pkg.ReadWriteCloser = $newType(8, $kindInterface, "io.ReadWriteCloser", true, "io", true, null); ReaderFrom = $pkg.ReaderFrom = $newType(8, $kindInterface, "io.ReaderFrom", true, "io", true, null); WriterTo = $pkg.WriterTo = $newType(8, $kindInterface, "io.WriterTo", true, "io", true, null); ReaderAt = $pkg.ReaderAt = $newType(8, $kindInterface, "io.ReaderAt", true, "io", true, null); ByteScanner = $pkg.ByteScanner = $newType(8, $kindInterface, "io.ByteScanner", true, "io", true, null); ByteWriter = $pkg.ByteWriter = $newType(8, $kindInterface, "io.ByteWriter", true, "io", true, null); RuneScanner = $pkg.RuneScanner = $newType(8, $kindInterface, "io.RuneScanner", true, "io", true, null); StringWriter = $pkg.StringWriter = $newType(8, $kindInterface, "io.StringWriter", true, "io", true, null); LimitedReader = $pkg.LimitedReader = $newType(0, $kindStruct, "io.LimitedReader", true, "io", true, function(R_, N_) { this.$val = this; if (arguments.length === 0) { this.R = $ifaceNil; this.N = new $Int64(0, 0); return; } this.R = R_; this.N = N_; }); SectionReader = $pkg.SectionReader = $newType(0, $kindStruct, "io.SectionReader", true, "io", true, function(r_, base_, off_, limit_) { this.$val = this; if (arguments.length === 0) { this.r = $ifaceNil; this.base = new $Int64(0, 0); this.off = new $Int64(0, 0); this.limit = new $Int64(0, 0); return; } this.r = r_; this.base = base_; this.off = off_; this.limit = limit_; }); discard = $pkg.discard = $newType(0, $kindStruct, "io.discard", true, "io", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); nopCloser = $pkg.nopCloser = $newType(0, $kindStruct, "io.nopCloser", true, "io", false, function(Reader_) { this.$val = this; if (arguments.length === 0) { this.Reader = $ifaceNil; return; } this.Reader = Reader_; }); sliceType = $sliceType($emptyInterface); sliceType$1 = $sliceType($Uint8); ptrType$1 = $ptrType(sliceType$1); ptrType$2 = $ptrType(multiReader); sliceType$2 = $sliceType(Reader); ptrType$3 = $ptrType(LimitedReader); ptrType$8 = $ptrType(SectionReader); eofReader.ptr.prototype.Read = function(param) { var param; return [0, $pkg.EOF]; }; eofReader.prototype.Read = function(param) { return this.$val.Read(param); }; multiReader.ptr.prototype.Read = function(p) { var _r, _tmp, _tmp$1, _tuple, _tuple$1, err, mr, n, ok, p, r, 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; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; err = $f.err; mr = $f.mr; n = $f.n; ok = $f.ok; p = $f.p; r = $f.r; 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: n = 0; err = $ifaceNil; mr = this; /* while (true) { */ case 1: /* if (!(mr.readers.$length > 0)) { break; } */ if(!(mr.readers.$length > 0)) { $s = 2; continue; } if (mr.readers.$length === 1) { _tuple = $assertType((x$2 = mr.readers, (0 >= x$2.$length ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + 0])), ptrType$2, true); r = _tuple[0]; ok = _tuple[1]; if (ok) { mr.readers = r.readers; /* continue; */ $s = 1; continue; } } _r = (x$3 = mr.readers, (0 >= x$3.$length ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + 0])).Read(p); /* */ $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]; if ($interfaceIsEqual(err, $pkg.EOF)) { (x$5 = mr.readers, (0 >= x$5.$length ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + 0] = (x$4 = new eofReader.ptr(), new x$4.constructor.elem(x$4)))); mr.readers = $subslice(mr.readers, 1); } if (n > 0 || !($interfaceIsEqual(err, $pkg.EOF))) { if ($interfaceIsEqual(err, $pkg.EOF) && mr.readers.$length > 0) { err = $ifaceNil; } $s = -1; return [n, err]; } $s = 1; continue; case 2: _tmp = 0; _tmp$1 = $pkg.EOF; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: multiReader.ptr.prototype.Read }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.err = err; $f.mr = mr; $f.n = n; $f.ok = ok; $f.p = p; $f.r = r; $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; }; multiReader.prototype.Read = function(p) { return this.$val.Read(p); }; MultiReader = function(readers) { var r, readers; r = $makeSlice(sliceType$2, readers.$length); $copySlice(r, readers); return new multiReader.ptr(r); }; $pkg.MultiReader = MultiReader; WriteString = function(w, s) { var $24r, $24r$1, _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; $24r = $f.$24r; $24r$1 = $f.$24r$1; _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]; $24r = [n, err]; $s = 4; case 4: return $24r; /* } */ case 2: _r$1 = w.Write((new sliceType$1($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]; $24r$1 = [n, err]; $s = 6; case 6: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: WriteString }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $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 _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; _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; $s = -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; } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: ReadAtLeast }; } $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 $24r, _r, _tuple, buf, err, n, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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]; $24r = [n, err]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: ReadFull }; } $f.$24r = $24r; $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; CopyN = function(dst, src, n) { var _r, _tmp, _tmp$1, _tuple, dst, err, n, src, written, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; dst = $f.dst; err = $f.err; n = $f.n; src = $f.src; written = $f.written; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: written = new $Int64(0, 0); err = $ifaceNil; _r = Copy(dst, LimitReader(src, n)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; written = _tuple[0]; err = _tuple[1]; if ((written.$high === n.$high && written.$low === n.$low)) { _tmp = n; _tmp$1 = $ifaceNil; written = _tmp; err = _tmp$1; $s = -1; return [written, err]; } if ((written.$high < n.$high || (written.$high === n.$high && written.$low < n.$low)) && $interfaceIsEqual(err, $ifaceNil)) { err = $pkg.EOF; } $s = -1; return [written, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: CopyN }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.dst = dst; $f.err = err; $f.n = n; $f.src = src; $f.written = written; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.CopyN = CopyN; Copy = function(dst, src) { var $24r, _r, _tuple, dst, err, src, written, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _tuple = $f._tuple; dst = $f.dst; err = $f.err; src = $f.src; written = $f.written; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: written = new $Int64(0, 0); err = $ifaceNil; _r = copyBuffer(dst, src, sliceType$1.nil); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; written = _tuple[0]; err = _tuple[1]; $24r = [written, err]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Copy }; } $f.$24r = $24r; $f._r = _r; $f._tuple = _tuple; $f.dst = dst; $f.err = err; $f.src = src; $f.written = written; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Copy = Copy; CopyBuffer = function(dst, src, buf) { var $24r, _r, _tuple, buf, dst, err, src, written, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _tuple = $f._tuple; buf = $f.buf; dst = $f.dst; err = $f.err; src = $f.src; written = $f.written; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: written = new $Int64(0, 0); err = $ifaceNil; if (!(buf === sliceType$1.nil) && (buf.$length === 0)) { $panic(new $String("empty buffer in CopyBuffer")); } _r = copyBuffer(dst, src, buf); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; written = _tuple[0]; err = _tuple[1]; $24r = [written, err]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: CopyBuffer }; } $f.$24r = $24r; $f._r = _r; $f._tuple = _tuple; $f.buf = buf; $f.dst = dst; $f.err = err; $f.src = src; $f.written = written; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.CopyBuffer = CopyBuffer; copyBuffer = function(dst, src, buf) { var $24r, $24r$1, _r, _r$1, _r$2, _r$3, _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, buf, dst, er, err, ew, l, nr, nw, ok, ok$1, ok$2, rt, size, src, written, wt, x$2, x$3, x$4, x$5, x$6, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _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; buf = $f.buf; dst = $f.dst; er = $f.er; err = $f.err; ew = $f.ew; l = $f.l; nr = $f.nr; nw = $f.nw; ok = $f.ok; ok$1 = $f.ok$1; ok$2 = $f.ok$2; rt = $f.rt; size = $f.size; src = $f.src; written = $f.written; wt = $f.wt; 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; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: written = new $Int64(0, 0); err = $ifaceNil; _tuple = $assertType(src, WriterTo, true); wt = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 1; continue; } /* */ $s = 2; continue; /* if (ok) { */ case 1: _r = wt.WriteTo(dst); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple$1 = _r; written = _tuple$1[0]; err = _tuple$1[1]; $24r = [written, err]; $s = 4; case 4: return $24r; /* } */ case 2: _tuple$2 = $assertType(dst, ReaderFrom, true); rt = _tuple$2[0]; ok$1 = _tuple$2[1]; /* */ if (ok$1) { $s = 5; continue; } /* */ $s = 6; continue; /* if (ok$1) { */ case 5: _r$1 = rt.ReadFrom(src); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$3 = _r$1; written = _tuple$3[0]; err = _tuple$3[1]; $24r$1 = [written, err]; $s = 8; case 8: return $24r$1; /* } */ case 6: if (buf === sliceType$1.nil) { size = 32768; _tuple$4 = $assertType(src, ptrType$3, true); l = _tuple$4[0]; ok$2 = _tuple$4[1]; if (ok$2 && (x$2 = (new $Int64(0, size)), x$3 = l.N, (x$2.$high > x$3.$high || (x$2.$high === x$3.$high && x$2.$low > x$3.$low)))) { if ((x$4 = l.N, (x$4.$high < 0 || (x$4.$high === 0 && x$4.$low < 1)))) { size = 1; } else { size = (((x$5 = l.N, x$5.$low + ((x$5.$high >> 31) * 4294967296)) >> 0)); } } buf = $makeSlice(sliceType$1, size); } /* while (true) { */ case 9: _r$2 = src.Read(buf); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$5 = _r$2; nr = _tuple$5[0]; er = _tuple$5[1]; /* */ if (nr > 0) { $s = 12; continue; } /* */ $s = 13; continue; /* if (nr > 0) { */ case 12: _r$3 = dst.Write($subslice(buf, 0, nr)); /* */ $s = 14; case 14: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$6 = _r$3; nw = _tuple$6[0]; ew = _tuple$6[1]; if (nw < 0 || nr < nw) { nw = 0; if ($interfaceIsEqual(ew, $ifaceNil)) { ew = errInvalidWrite; } } written = (x$6 = (new $Int64(0, nw)), new $Int64(written.$high + x$6.$high, written.$low + x$6.$low)); if (!($interfaceIsEqual(ew, $ifaceNil))) { err = ew; /* break; */ $s = 10; continue; } if (!((nr === nw))) { err = $pkg.ErrShortWrite; /* break; */ $s = 10; continue; } /* } */ case 13: if (!($interfaceIsEqual(er, $ifaceNil))) { if (!($interfaceIsEqual(er, $pkg.EOF))) { err = er; } /* break; */ $s = 10; continue; } $s = 9; continue; case 10: _tmp = written; _tmp$1 = err; written = _tmp; err = _tmp$1; $s = -1; return [written, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: copyBuffer }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $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.buf = buf; $f.dst = dst; $f.er = er; $f.err = err; $f.ew = ew; $f.l = l; $f.nr = nr; $f.nw = nw; $f.ok = ok; $f.ok$1 = ok$1; $f.ok$2 = ok$2; $f.rt = rt; $f.size = size; $f.src = src; $f.written = written; $f.wt = wt; $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.$s = $s; $f.$r = $r; return $f; }; LimitReader = function(r, n) { var n, r; return new LimitedReader.ptr(r, n); }; $pkg.LimitReader = LimitReader; LimitedReader.ptr.prototype.Read = function(p) { var _r, _tmp, _tmp$1, _tuple, err, l, n, p, x$2, x$3, x$4, x$5, x$6, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; err = $f.err; l = $f.l; n = $f.n; p = $f.p; 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; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; l = this; if ((x$2 = l.N, (x$2.$high < 0 || (x$2.$high === 0 && x$2.$low <= 0)))) { _tmp = 0; _tmp$1 = $pkg.EOF; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } if ((x$3 = (new $Int64(0, p.$length)), x$4 = l.N, (x$3.$high > x$4.$high || (x$3.$high === x$4.$high && x$3.$low > x$4.$low)))) { p = $subslice(p, 0, $flatten64(l.N)); } _r = l.R.Read(p); /* */ $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]; l.N = (x$5 = l.N, x$6 = (new $Int64(0, n)), new $Int64(x$5.$high - x$6.$high, x$5.$low - x$6.$low)); $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: LimitedReader.ptr.prototype.Read }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.err = err; $f.l = l; $f.n = n; $f.p = p; $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.$s = $s; $f.$r = $r; return $f; }; LimitedReader.prototype.Read = function(p) { return this.$val.Read(p); }; NewSectionReader = function(r, off, n) { var n, off, r; return new SectionReader.ptr(r, off, off, new $Int64(off.$high + n.$high, off.$low + n.$low)); }; $pkg.NewSectionReader = NewSectionReader; SectionReader.ptr.prototype.Read = function(p) { var _r, _tmp, _tmp$1, _tuple, err, max, n, p, s, x$2, x$3, x$4, x$5, x$6, x$7, x$8, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; err = $f.err; max = $f.max; n = $f.n; p = $f.p; s = $f.s; 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; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; s = this; if ((x$2 = s.off, x$3 = s.limit, (x$2.$high > x$3.$high || (x$2.$high === x$3.$high && x$2.$low >= x$3.$low)))) { _tmp = 0; _tmp$1 = $pkg.EOF; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } max = (x$4 = s.limit, x$5 = s.off, new $Int64(x$4.$high - x$5.$high, x$4.$low - x$5.$low)); if ((x$6 = (new $Int64(0, p.$length)), (x$6.$high > max.$high || (x$6.$high === max.$high && x$6.$low > max.$low)))) { p = $subslice(p, 0, $flatten64(max)); } _r = s.r.ReadAt(p, s.off); /* */ $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.off = (x$7 = s.off, x$8 = (new $Int64(0, n)), new $Int64(x$7.$high + x$8.$high, x$7.$low + x$8.$low)); $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: SectionReader.ptr.prototype.Read }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.err = err; $f.max = max; $f.n = n; $f.p = p; $f.s = s; $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.$s = $s; $f.$r = $r; return $f; }; SectionReader.prototype.Read = function(p) { return this.$val.Read(p); }; SectionReader.ptr.prototype.Seek = function(offset, whence) { var _1, offset, s, whence, x$2, x$3, x$4, x$5, x$6; s = this; _1 = whence; if (_1 === (0)) { offset = (x$2 = s.base, new $Int64(offset.$high + x$2.$high, offset.$low + x$2.$low)); } else if (_1 === (1)) { offset = (x$3 = s.off, new $Int64(offset.$high + x$3.$high, offset.$low + x$3.$low)); } else if (_1 === (2)) { offset = (x$4 = s.limit, new $Int64(offset.$high + x$4.$high, offset.$low + x$4.$low)); } else { return [new $Int64(0, 0), errWhence]; } if ((x$5 = s.base, (offset.$high < x$5.$high || (offset.$high === x$5.$high && offset.$low < x$5.$low)))) { return [new $Int64(0, 0), errOffset]; } s.off = offset; return [(x$6 = s.base, new $Int64(offset.$high - x$6.$high, offset.$low - x$6.$low)), $ifaceNil]; }; SectionReader.prototype.Seek = function(offset, whence) { return this.$val.Seek(offset, whence); }; SectionReader.ptr.prototype.ReadAt = function(p, off) { var $24r, _r, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, err, max, n, off, p, s, x$2, x$3, x$4, x$5, x$6, x$7, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _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; err = $f.err; max = $f.max; n = $f.n; off = $f.off; p = $f.p; s = $f.s; 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; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; s = this; if ((off.$high < 0 || (off.$high === 0 && off.$low < 0)) || (x$2 = (x$3 = s.limit, x$4 = s.base, new $Int64(x$3.$high - x$4.$high, x$3.$low - x$4.$low)), (off.$high > x$2.$high || (off.$high === x$2.$high && off.$low >= x$2.$low)))) { _tmp = 0; _tmp$1 = $pkg.EOF; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } off = (x$5 = s.base, new $Int64(off.$high + x$5.$high, off.$low + x$5.$low)); max = (x$6 = s.limit, new $Int64(x$6.$high - off.$high, x$6.$low - off.$low)); /* */ if ((x$7 = (new $Int64(0, p.$length)), (x$7.$high > max.$high || (x$7.$high === max.$high && x$7.$low > max.$low)))) { $s = 1; continue; } /* */ $s = 2; continue; /* if ((x$7 = (new $Int64(0, p.$length)), (x$7.$high > max.$high || (x$7.$high === max.$high && x$7.$low > max.$low)))) { */ case 1: p = $subslice(p, 0, $flatten64(max)); _r = s.r.ReadAt(p, off); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; err = _tuple[1]; if ($interfaceIsEqual(err, $ifaceNil)) { err = $pkg.EOF; } _tmp$2 = n; _tmp$3 = err; n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; /* } */ case 2: _r$1 = s.r.ReadAt(p, off); /* */ $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; n = _tuple$1[0]; err = _tuple$1[1]; $24r = [n, err]; $s = 5; case 5: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: SectionReader.ptr.prototype.ReadAt }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $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.err = err; $f.max = max; $f.n = n; $f.off = off; $f.p = p; $f.s = s; $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.$s = $s; $f.$r = $r; return $f; }; SectionReader.prototype.ReadAt = function(p, off) { return this.$val.ReadAt(p, off); }; SectionReader.ptr.prototype.Size = function() { var s, x$2, x$3; s = this; return (x$2 = s.limit, x$3 = s.base, new $Int64(x$2.$high - x$3.$high, x$2.$low - x$3.$low)); }; SectionReader.prototype.Size = function() { return this.$val.Size(); }; discard.ptr.prototype.Write = function(p) { var p; return [p.$length, $ifaceNil]; }; discard.prototype.Write = function(p) { return this.$val.Write(p); }; discard.ptr.prototype.WriteString = function(s) { var s; return [s.length, $ifaceNil]; }; discard.prototype.WriteString = function(s) { return this.$val.WriteString(s); }; discard.ptr.prototype.ReadFrom = function(r) { var _r, _r$1, _tmp, _tmp$1, _tuple, bufp, err, n, r, readSize, x$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; bufp = $f.bufp; err = $f.err; n = $f.n; r = $f.r; readSize = $f.readSize; x$2 = $f.x$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = new $Int64(0, 0); err = $ifaceNil; _r = blackHolePool.Get(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } bufp = $assertType(_r, ptrType$1); readSize = 0; /* while (true) { */ case 2: _r$1 = r.Read(bufp.$get()); /* */ $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; readSize = _tuple[0]; err = _tuple[1]; n = (x$2 = (new $Int64(0, readSize)), new $Int64(n.$high + x$2.$high, n.$low + x$2.$low)); if (!($interfaceIsEqual(err, $ifaceNil))) { blackHolePool.Put(bufp); if ($interfaceIsEqual(err, $pkg.EOF)) { _tmp = n; _tmp$1 = $ifaceNil; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } $s = -1; return [n, err]; } $s = 2; continue; case 3: $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: discard.ptr.prototype.ReadFrom }; } $f._r = _r; $f._r$1 = _r$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.bufp = bufp; $f.err = err; $f.n = n; $f.r = r; $f.readSize = readSize; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; }; discard.prototype.ReadFrom = function(r) { return this.$val.ReadFrom(r); }; NopCloser = function(r) { var r, x$2; return (x$2 = new nopCloser.ptr(r), new x$2.constructor.elem(x$2)); }; $pkg.NopCloser = NopCloser; nopCloser.ptr.prototype.Close = function() { return $ifaceNil; }; nopCloser.prototype.Close = function() { return this.$val.Close(); }; ReadAll = function(r) { var _r, _tuple, b, err, n, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; b = $f.b; err = $f.err; n = $f.n; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = $makeSlice(sliceType$1, 0, 512); /* while (true) { */ case 1: if (b.$length === b.$capacity) { b = $subslice($append(b, 0), 0, b.$length); } _r = r.Read($subslice(b, b.$length, b.$capacity)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; err = _tuple[1]; b = $subslice(b, 0, (b.$length + n >> 0)); if (!($interfaceIsEqual(err, $ifaceNil))) { if ($interfaceIsEqual(err, $pkg.EOF)) { err = $ifaceNil; } $s = -1; return [b, err]; } $s = 1; continue; case 2: $s = -1; return [sliceType$1.nil, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: ReadAll }; } $f._r = _r; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.n = n; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.ReadAll = ReadAll; eofReader.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}]; ptrType$2.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}]; ptrType$3.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}]; ptrType$8.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}, {prop: "Seek", name: "Seek", pkg: "", typ: $funcType([$Int64, $Int], [$Int64, $error], false)}, {prop: "ReadAt", name: "ReadAt", pkg: "", typ: $funcType([sliceType$1, $Int64], [$Int, $error], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int64], false)}]; discard.methods = [{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}, {prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([$String], [$Int, $error], false)}, {prop: "ReadFrom", name: "ReadFrom", pkg: "", typ: $funcType([Reader], [$Int64, $error], false)}]; nopCloser.methods = [{prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}]; eofReader.init("", []); multiReader.init("io", [{prop: "readers", name: "readers", embedded: false, exported: false, typ: sliceType$2, tag: ""}]); Reader.init([{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}]); Writer.init([{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}]); Closer.init([{prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}]); ReadWriter.init([{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}]); ReadCloser.init([{prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}]); WriteCloser.init([{prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}]); ReadWriteCloser.init([{prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}]); ReaderFrom.init([{prop: "ReadFrom", name: "ReadFrom", pkg: "", typ: $funcType([Reader], [$Int64, $error], false)}]); WriterTo.init([{prop: "WriteTo", name: "WriteTo", pkg: "", typ: $funcType([Writer], [$Int64, $error], false)}]); ReaderAt.init([{prop: "ReadAt", name: "ReadAt", pkg: "", typ: $funcType([sliceType$1, $Int64], [$Int, $error], false)}]); ByteScanner.init([{prop: "ReadByte", name: "ReadByte", pkg: "", typ: $funcType([], [$Uint8, $error], false)}, {prop: "UnreadByte", name: "UnreadByte", pkg: "", typ: $funcType([], [$error], false)}]); ByteWriter.init([{prop: "WriteByte", name: "WriteByte", pkg: "", typ: $funcType([$Uint8], [$error], false)}]); RuneScanner.init([{prop: "ReadRune", name: "ReadRune", pkg: "", typ: $funcType([], [$Int32, $Int, $error], false)}, {prop: "UnreadRune", name: "UnreadRune", pkg: "", typ: $funcType([], [$error], false)}]); StringWriter.init([{prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([$String], [$Int, $error], false)}]); LimitedReader.init("", [{prop: "R", name: "R", embedded: false, exported: true, typ: Reader, tag: ""}, {prop: "N", name: "N", embedded: false, exported: true, typ: $Int64, tag: ""}]); SectionReader.init("io", [{prop: "r", name: "r", embedded: false, exported: false, typ: ReaderAt, tag: ""}, {prop: "base", name: "base", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "off", name: "off", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "limit", name: "limit", embedded: false, exported: false, typ: $Int64, tag: ""}]); discard.init("", []); nopCloser.init("", [{prop: "Reader", name: "Reader", embedded: true, exported: true, typ: Reader, 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 = sync.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $pkg.ErrClosedPipe = errors.New("io: read/write on closed pipe"); $pkg.ErrShortWrite = errors.New("short write"); errInvalidWrite = errors.New("invalid write result"); $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.Discard = (x = new discard.ptr(), new x.constructor.elem(x)); blackHolePool = new sync.Pool.ptr(sliceType.nil, (function() { var b, b$24ptr; b = $makeSlice(sliceType$1, 8192); return (b$24ptr || (b$24ptr = new ptrType$1(function() { return b; }, function($v) { b = $convertSliceType($v, sliceType$1); }))); })); /* */ } 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, sliceType, sliceType$1, sliceType$2, sliceType$3, arrayType, _L, _Nd, _White_Space, _CaseRanges, properties, asciiFold, caseOrbit, is16, is32, isExcludingLatin, To, ToUpper, ToLower, SimpleFold, IsLetter, IsSpace, to, IsDigit; RangeTable = $pkg.RangeTable = $newType(0, $kindStruct, "unicode.RangeTable", true, "unicode", true, 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", true, "unicode", true, 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", true, "unicode", true, 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", true, "unicode", true, 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", true, "unicode", false, null); foldPair = $pkg.foldPair = $newType(0, $kindStruct, "unicode.foldPair", true, "unicode", false, function(From_, To_) { this.$val = this; if (arguments.length === 0) { this.From = 0; this.To = 0; return; } this.From = From_; this.To = To_; }); sliceType = $sliceType(Range16); sliceType$1 = $sliceType(Range32); sliceType$2 = $sliceType(foldPair); sliceType$3 = $sliceType(CaseRange); arrayType = $arrayType($Int32, 3); is16 = function(ranges, r) { var _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"), undefined) : ranges.$array[ranges.$offset + i]); if (r < range_.Lo) { return false; } if (r <= range_.Hi) { return (range_.Stride === 1) || ((_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"), undefined) : ranges.$array[ranges.$offset + m]); if (range_$1.Lo <= r && r <= range_$1.Hi) { return (range_$1.Stride === 1) || ((_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 _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"), undefined) : ranges.$array[ranges.$offset + i]); if (r < range_.Lo) { return false; } if (r <= range_.Hi) { return (range_.Stride === 1) || ((_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"), undefined) : ranges.$array[ranges.$offset + m]), Range32); if (range_$1.Lo <= r && r <= range_$1.Hi) { return (range_$1.Stride === 1) || ((_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 off, r, r16, r32, rangeTab, x; r16 = rangeTab.R16; off = rangeTab.LatinOffset; if (r16.$length > off && ((r >>> 0)) <= (((x = r16.$length - 1 >> 0, ((x < 0 || x >= r16.$length) ? ($throwRuntimeError("index out of range"), undefined) : 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"), undefined) : r32.$array[r32.$offset + 0]).Lo >> 0))) { return is32(r32, ((r >>> 0))); } return false; }; To = function(_case, r) { var _case, _tuple, r; _tuple = to(_case, r, $pkg.CaseRanges); r = _tuple[0]; return r; }; $pkg.To = To; ToUpper = function(r) { var 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 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 _q, hi, l, lo, m, r; if (r < 0 || r > 1114111) { return r; } if (((r >> 0)) < 128) { return ((((r < 0 || r >= asciiFold.length) ? ($throwRuntimeError("index out of range"), undefined) : asciiFold[r]) >> 0)); } 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"), undefined) : 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"), undefined) : caseOrbit.$array[caseOrbit.$offset + lo]).From >> 0)) === r)) { return ((((lo < 0 || lo >= caseOrbit.$length) ? ($throwRuntimeError("index out of range"), undefined) : caseOrbit.$array[caseOrbit.$offset + lo]).To >> 0)); } l = ToLower(r); if (!((l === r))) { return l; } return ToUpper(r); }; $pkg.SimpleFold = SimpleFold; IsLetter = function(r) { var r, x; if (((r >>> 0)) <= 255) { return !(((((x = ((r << 24 >>> 24)), ((x < 0 || x >= properties.length) ? ($throwRuntimeError("index out of range"), undefined) : properties[x])) & 96) >>> 0) === 0)); } return isExcludingLatin($pkg.Letter, r); }; $pkg.IsLetter = IsLetter; IsSpace = function(r) { var _1, r; if (((r >>> 0)) <= 255) { _1 = r; if ((_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12)) || (_1 === (13)) || (_1 === (32)) || (_1 === (133)) || (_1 === (160))) { return true; } return false; } return isExcludingLatin($pkg.White_Space, r); }; $pkg.IsSpace = IsSpace; to = function(_case, r, caseRange) { var _case, _q, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, caseRange, cr, delta, foundMapping, hi, lo, m, mappedRune, r, x; mappedRune = 0; foundMapping = false; if (_case < 0 || 3 <= _case) { _tmp = 65533; _tmp$1 = false; mappedRune = _tmp; foundMapping = _tmp$1; return [mappedRune, foundMapping]; } 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"), undefined) : 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"), undefined) : x[_case]))); if (delta > 1114111) { _tmp$2 = ((cr.Lo >> 0)) + ((((((r - ((cr.Lo >> 0)) >> 0)) & ~1) >> 0) | (((_case & 1) >> 0)))) >> 0; _tmp$3 = true; mappedRune = _tmp$2; foundMapping = _tmp$3; return [mappedRune, foundMapping]; } _tmp$4 = r + delta >> 0; _tmp$5 = true; mappedRune = _tmp$4; foundMapping = _tmp$5; return [mappedRune, foundMapping]; } if (r < ((cr.Lo >> 0))) { hi = m; } else { lo = m + 1 >> 0; } } _tmp$6 = r; _tmp$7 = false; mappedRune = _tmp$6; foundMapping = _tmp$7; return [mappedRune, foundMapping]; }; IsDigit = function(r) { var r; if (r <= 255) { return 48 <= r && r <= 57; } return isExcludingLatin($pkg.Digit, r); }; $pkg.IsDigit = IsDigit; RangeTable.init("", [{prop: "R16", name: "R16", embedded: false, exported: true, typ: sliceType, tag: ""}, {prop: "R32", name: "R32", embedded: false, exported: true, typ: sliceType$1, tag: ""}, {prop: "LatinOffset", name: "LatinOffset", embedded: false, exported: true, typ: $Int, tag: ""}]); Range16.init("", [{prop: "Lo", name: "Lo", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Hi", name: "Hi", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Stride", name: "Stride", embedded: false, exported: true, typ: $Uint16, tag: ""}]); Range32.init("", [{prop: "Lo", name: "Lo", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Hi", name: "Hi", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Stride", name: "Stride", embedded: false, exported: true, typ: $Uint32, tag: ""}]); CaseRange.init("", [{prop: "Lo", name: "Lo", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Hi", name: "Hi", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Delta", name: "Delta", embedded: false, exported: true, typ: d, tag: ""}]); d.init($Int32, 3); foldPair.init("", [{prop: "From", name: "From", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "To", name: "To", embedded: false, exported: true, 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, 1376, 7), new Range16.ptr(1377, 1416, 1), new Range16.ptr(1488, 1514, 1), new Range16.ptr(1519, 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(2144, 2154, 1), new Range16.ptr(2208, 2228, 1), new Range16.ptr(2230, 2247, 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(2556, 2565, 9), new Range16.ptr(2566, 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(3200, 3205, 5), new Range16.ptr(3206, 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(3332, 3340, 1), new Range16.ptr(3342, 3344, 1), new Range16.ptr(3346, 3386, 1), new Range16.ptr(3389, 3406, 17), new Range16.ptr(3412, 3414, 1), new Range16.ptr(3423, 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, 3718, 2), new Range16.ptr(3719, 3722, 1), new Range16.ptr(3724, 3747, 1), new Range16.ptr(3749, 3751, 2), new Range16.ptr(3752, 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, 6264, 1), new Range16.ptr(6272, 6276, 1), new Range16.ptr(6279, 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(7296, 7304, 1), new Range16.ptr(7312, 7354, 1), new Range16.ptr(7357, 7359, 1), new Range16.ptr(7401, 7404, 1), new Range16.ptr(7406, 7411, 1), new Range16.ptr(7413, 7414, 1), new Range16.ptr(7418, 7424, 6), new Range16.ptr(7425, 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, 12591, 1), new Range16.ptr(12593, 12686, 1), new Range16.ptr(12704, 12735, 1), new Range16.ptr(12784, 12799, 1), new Range16.ptr(13312, 19903, 1), new Range16.ptr(19968, 40956, 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, 42943, 1), new Range16.ptr(42946, 42954, 1), new Range16.ptr(42997, 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(43262, 43274, 12), new Range16.ptr(43275, 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, 43881, 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(66349, 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(66736, 66771, 1), new Range32.ptr(66776, 66811, 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, 68149, 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(68864, 68899, 1), new Range32.ptr(69248, 69289, 1), new Range32.ptr(69296, 69297, 1), new Range32.ptr(69376, 69404, 1), new Range32.ptr(69415, 69424, 9), new Range32.ptr(69425, 69445, 1), new Range32.ptr(69552, 69572, 1), new Range32.ptr(69600, 69622, 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(69956, 69959, 3), 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(70656, 70708, 1), new Range32.ptr(70727, 70730, 1), new Range32.ptr(70751, 70753, 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(71352, 71424, 72), new Range32.ptr(71425, 71450, 1), new Range32.ptr(71680, 71723, 1), new Range32.ptr(71840, 71903, 1), new Range32.ptr(71935, 71942, 1), new Range32.ptr(71945, 71948, 3), new Range32.ptr(71949, 71955, 1), new Range32.ptr(71957, 71958, 1), new Range32.ptr(71960, 71983, 1), new Range32.ptr(71999, 72001, 2), new Range32.ptr(72096, 72103, 1), new Range32.ptr(72106, 72144, 1), new Range32.ptr(72161, 72163, 2), new Range32.ptr(72192, 72203, 11), new Range32.ptr(72204, 72242, 1), new Range32.ptr(72250, 72272, 22), new Range32.ptr(72284, 72329, 1), new Range32.ptr(72349, 72384, 35), new Range32.ptr(72385, 72440, 1), new Range32.ptr(72704, 72712, 1), new Range32.ptr(72714, 72750, 1), new Range32.ptr(72768, 72818, 50), new Range32.ptr(72819, 72847, 1), new Range32.ptr(72960, 72966, 1), new Range32.ptr(72968, 72969, 1), new Range32.ptr(72971, 73008, 1), new Range32.ptr(73030, 73056, 26), new Range32.ptr(73057, 73061, 1), new Range32.ptr(73063, 73064, 1), new Range32.ptr(73066, 73097, 1), new Range32.ptr(73112, 73440, 328), new Range32.ptr(73441, 73458, 1), new Range32.ptr(73648, 73728, 80), new Range32.ptr(73729, 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(93760, 93823, 1), new Range32.ptr(93952, 94026, 1), new Range32.ptr(94032, 94099, 67), new Range32.ptr(94100, 94111, 1), new Range32.ptr(94176, 94177, 1), new Range32.ptr(94179, 94208, 29), new Range32.ptr(94209, 100343, 1), new Range32.ptr(100352, 101589, 1), new Range32.ptr(101632, 101640, 1), new Range32.ptr(110592, 110878, 1), new Range32.ptr(110928, 110930, 1), new Range32.ptr(110948, 110951, 1), new Range32.ptr(110960, 111355, 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(123136, 123180, 1), new Range32.ptr(123191, 123197, 1), new Range32.ptr(123214, 123584, 370), new Range32.ptr(123585, 123627, 1), new Range32.ptr(124928, 125124, 1), new Range32.ptr(125184, 125251, 1), new Range32.ptr(125259, 126464, 1205), new Range32.ptr(126465, 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, 173789, 1), new Range32.ptr(173824, 177972, 1), new Range32.ptr(177984, 178205, 1), new Range32.ptr(178208, 183969, 1), new Range32.ptr(183984, 191456, 1), new Range32.ptr(194560, 195101, 1), new Range32.ptr(196608, 201546, 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(68912, 68921, 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(70736, 70745, 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(72016, 72025, 1), new Range32.ptr(72784, 72793, 1), new Range32.ptr(73040, 73049, 1), new Range32.ptr(73120, 73129, 1), new Range32.ptr(92768, 92777, 1), new Range32.ptr(93008, 93017, 1), new Range32.ptr(120782, 120831, 1), new Range32.ptr(123200, 123209, 1), new Range32.ptr(123632, 123641, 1), new Range32.ptr(125264, 125273, 1), new Range32.ptr(130032, 130041, 1)]), 1); $pkg.Digit = _Nd; $pkg.Letter = _L; _White_Space = new RangeTable.ptr(new sliceType([new Range16.ptr(9, 13, 1), new Range16.ptr(32, 133, 101), new Range16.ptr(160, 5760, 5600), new Range16.ptr(8192, 8202, 1), new Range16.ptr(8232, 8233, 1), new Range16.ptr(8239, 8287, 48), new Range16.ptr(12288, 12288, 1)]), sliceType$1.nil, 2); $pkg.White_Space = _White_Space; caseOrbit = new sliceType$2([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(1042, 1074), new foldPair.ptr(1044, 1076), new foldPair.ptr(1054, 1086), new foldPair.ptr(1057, 1089), new foldPair.ptr(1058, 1090), new foldPair.ptr(1066, 1098), new foldPair.ptr(1074, 7296), new foldPair.ptr(1076, 7297), new foldPair.ptr(1086, 7298), new foldPair.ptr(1089, 7299), new foldPair.ptr(1090, 7300), new foldPair.ptr(1098, 7302), new foldPair.ptr(1122, 1123), new foldPair.ptr(1123, 7303), new foldPair.ptr(7296, 1042), new foldPair.ptr(7297, 1044), new foldPair.ptr(7298, 1054), new foldPair.ptr(7299, 1057), new foldPair.ptr(7300, 7301), new foldPair.ptr(7301, 1058), new foldPair.ptr(7302, 1066), new foldPair.ptr(7303, 1122), new foldPair.ptr(7304, 42570), 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), new foldPair.ptr(42570, 42571), new foldPair.ptr(42571, 7304)]); asciiFold = $toNativeArray($kindUint16, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 91, 92, 93, 94, 95, 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 8490, 76, 77, 78, 79, 80, 81, 82, 383, 84, 85, 86, 87, 88, 89, 90, 123, 124, 125, 126, 127]); _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(618, 618, $toNativeArray($kindInt32, [42308, 0, 42308])), 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(642, 642, $toNativeArray($kindInt32, [42307, 0, 42307])), 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(4304, 4346, $toNativeArray($kindInt32, [3008, 0, 0])), new CaseRange.ptr(4349, 4351, $toNativeArray($kindInt32, [3008, 0, 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(7296, 7296, $toNativeArray($kindInt32, [-6254, 0, -6254])), new CaseRange.ptr(7297, 7297, $toNativeArray($kindInt32, [-6253, 0, -6253])), new CaseRange.ptr(7298, 7298, $toNativeArray($kindInt32, [-6244, 0, -6244])), new CaseRange.ptr(7299, 7300, $toNativeArray($kindInt32, [-6242, 0, -6242])), new CaseRange.ptr(7301, 7301, $toNativeArray($kindInt32, [-6243, 0, -6243])), new CaseRange.ptr(7302, 7302, $toNativeArray($kindInt32, [-6236, 0, -6236])), new CaseRange.ptr(7303, 7303, $toNativeArray($kindInt32, [-6181, 0, -6181])), new CaseRange.ptr(7304, 7304, $toNativeArray($kindInt32, [35266, 0, 35266])), new CaseRange.ptr(7312, 7354, $toNativeArray($kindInt32, [0, -3008, 0])), new CaseRange.ptr(7357, 7359, $toNativeArray($kindInt32, [0, -3008, 0])), new CaseRange.ptr(7545, 7545, $toNativeArray($kindInt32, [35332, 0, 35332])), new CaseRange.ptr(7549, 7549, $toNativeArray($kindInt32, [3814, 0, 3814])), new CaseRange.ptr(7566, 7566, $toNativeArray($kindInt32, [35384, 0, 35384])), 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(42900, 42900, $toNativeArray($kindInt32, [48, 0, 48])), 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(42926, 42926, $toNativeArray($kindInt32, [0, -42308, 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, 42943, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42946, 42947, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42948, 42948, $toNativeArray($kindInt32, [0, -48, 0])), new CaseRange.ptr(42949, 42949, $toNativeArray($kindInt32, [0, -42307, 0])), new CaseRange.ptr(42950, 42950, $toNativeArray($kindInt32, [0, -35384, 0])), new CaseRange.ptr(42951, 42954, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42997, 42998, $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(66736, 66771, $toNativeArray($kindInt32, [0, 40, 0])), new CaseRange.ptr(66776, 66811, $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])), new CaseRange.ptr(93760, 93791, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(93792, 93823, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(125184, 125217, $toNativeArray($kindInt32, [0, 34, 0])), new CaseRange.ptr(125218, 125251, $toNativeArray($kindInt32, [-34, 0, -34]))]); $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]); /* */ } 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, FullRune, DecodeRune, DecodeRuneInString, DecodeLastRune, DecodeLastRuneInString, RuneLen, EncodeRune, RuneCount, RuneCountInString, RuneStart, Valid, ValidString, ValidRune; acceptRange = $pkg.acceptRange = $newType(0, $kindStruct, "utf8.acceptRange", true, "unicode/utf8", false, function(lo_, hi_) { this.$val = this; if (arguments.length === 0) { this.lo = 0; this.hi = 0; return; } this.lo = lo_; this.hi = hi_; }); FullRune = function(p) { var accept, n, p, x, x$1, x$2; n = p.$length; if (n === 0) { return false; } x$1 = (x = (0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0]), ((x < 0 || x >= first.length) ? ($throwRuntimeError("index out of range"), undefined) : first[x])); if (n >= ((((x$1 & 7) >>> 0) >> 0))) { return true; } accept = $clone((x$2 = x$1 >>> 4 << 24 >>> 24, ((x$2 < 0 || x$2 >= acceptRanges.length) ? ($throwRuntimeError("index out of range"), undefined) : acceptRanges[x$2])), acceptRange); if (n > 1 && ((1 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 1]) < accept.lo || accept.hi < (1 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 1]))) { return true; } else if (n > 2 && ((2 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 2]) < 128 || 191 < (2 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 2]))) { return true; } return false; }; $pkg.FullRune = FullRune; DecodeRune = function(p) { var _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"), undefined) : p.$array[p.$offset + 0]); x = ((p0 < 0 || p0 >= first.length) ? ($throwRuntimeError("index out of range"), undefined) : first[p0]); if (x >= 240) { mask = (((x >> 0)) << 31 >> 0) >> 31 >> 0; _tmp$2 = (((((0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : 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) >> 0)); accept = $clone((x$1 = x >>> 4 << 24 >>> 24, ((x$1 < 0 || x$1 >= acceptRanges.length) ? ($throwRuntimeError("index out of range"), undefined) : acceptRanges[x$1])), acceptRange); if (n < sz) { _tmp$4 = 65533; _tmp$5 = 1; r = _tmp$4; size = _tmp$5; return [r, size]; } b1 = (1 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : 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"), undefined) : 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"), undefined) : 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 _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"), undefined) : 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) >> 0)); accept = $clone((x$1 = x >>> 4 << 24 >>> 24, ((x$1 < 0 || x$1 >= acceptRanges.length) ? ($throwRuntimeError("index out of range"), undefined) : acceptRanges[x$1])), acceptRange); if (n < sz) { _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 _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"), undefined) : 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"), undefined) : 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; DecodeLastRuneInString = function(s) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, end, lim, r, s, size, start; r = 0; size = 0; end = s.length; if (end === 0) { _tmp = 65533; _tmp$1 = 0; r = _tmp; size = _tmp$1; return [r, size]; } start = end - 1 >> 0; r = ((s.charCodeAt(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(s.charCodeAt(start))) { break; } start = start - (1) >> 0; } if (start < 0) { start = 0; } _tuple = DecodeRuneInString($substring(s, 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.DecodeLastRuneInString = DecodeLastRuneInString; RuneLen = function(r) { var 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 i, p, r; i = ((r >>> 0)); if (i <= 127) { (0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0] = ((r << 24 >>> 24))); return 1; } else if (i <= 2047) { $unused((1 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 1])); (0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0] = ((192 | (((r >> 6 >> 0) << 24 >>> 24))) >>> 0)); (1 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 1] = ((128 | ((((r << 24 >>> 24)) & 63) >>> 0)) >>> 0)); return 2; } else if ((i > 1114111) || (55296 <= i && i <= 57343)) { r = 65533; $unused((2 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 2])); (0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0] = ((224 | (((r >> 12 >> 0) << 24 >>> 24))) >>> 0)); (1 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 1] = ((128 | (((((r >> 6 >> 0) << 24 >>> 24)) & 63) >>> 0)) >>> 0)); (2 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 2] = ((128 | ((((r << 24 >>> 24)) & 63) >>> 0)) >>> 0)); return 3; } else if (i <= 65535) { $unused((2 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 2])); (0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0] = ((224 | (((r >> 12 >> 0) << 24 >>> 24))) >>> 0)); (1 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 1] = ((128 | (((((r >> 6 >> 0) << 24 >>> 24)) & 63) >>> 0)) >>> 0)); (2 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 2] = ((128 | ((((r << 24 >>> 24)) & 63) >>> 0)) >>> 0)); return 3; } else { $unused((3 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 3])); (0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0] = ((240 | (((r >> 18 >> 0) << 24 >>> 24))) >>> 0)); (1 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 1] = ((128 | (((((r >> 12 >> 0) << 24 >>> 24)) & 63) >>> 0)) >>> 0)); (2 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 2] = ((128 | (((((r >> 6 >> 0) << 24 >>> 24)) & 63) >>> 0)) >>> 0)); (3 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 3] = ((128 | ((((r << 24 >>> 24)) & 63) >>> 0)) >>> 0)); return 4; } }; $pkg.EncodeRune = EncodeRune; RuneCount = function(p) { var 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"), undefined) : p.$array[p.$offset + i]); if (c < 128) { i = i + (1) >> 0; continue; } x = ((c < 0 || c >= first.length) ? ($throwRuntimeError("index out of range"), undefined) : 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"), undefined) : acceptRanges[x$1])), acceptRange); c$1 = (x$2 = i + 1 >> 0, ((x$2 < 0 || x$2 >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : 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"), undefined) : 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"), undefined) : 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 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"), undefined) : 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"), undefined) : 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 b; return !((((b & 192) >>> 0) === 128)); }; $pkg.RuneStart = RuneStart; Valid = function(p) { var accept, c, c$1, c$2, first32, i, n, p, pi, second32, size, x, x$1, x$2, x$3, x$4; while (true) { if (!(p.$length >= 8)) { break; } first32 = ((((((((0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0]) >>> 0)) | ((((1 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 1]) >>> 0)) << 8 >>> 0)) >>> 0) | ((((2 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 2]) >>> 0)) << 16 >>> 0)) >>> 0) | ((((3 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 3]) >>> 0)) << 24 >>> 0)) >>> 0; second32 = ((((((((4 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 4]) >>> 0)) | ((((5 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 5]) >>> 0)) << 8 >>> 0)) >>> 0) | ((((6 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 6]) >>> 0)) << 16 >>> 0)) >>> 0) | ((((7 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 7]) >>> 0)) << 24 >>> 0)) >>> 0; if (!(((((((first32 | second32) >>> 0)) & 2155905152) >>> 0) === 0))) { break; } p = $subslice(p, 8); } n = p.$length; i = 0; while (true) { if (!(i < n)) { break; } pi = ((i < 0 || i >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + i]); if (pi < 128) { i = i + (1) >> 0; continue; } x = ((pi < 0 || pi >= first.length) ? ($throwRuntimeError("index out of range"), undefined) : first[pi]); if (x === 241) { return false; } size = ((((x & 7) >>> 0) >> 0)); if ((i + size >> 0) > n) { return false; } accept = $clone((x$1 = x >>> 4 << 24 >>> 24, ((x$1 < 0 || x$1 >= acceptRanges.length) ? ($throwRuntimeError("index out of range"), undefined) : acceptRanges[x$1])), acceptRange); c = (x$2 = i + 1 >> 0, ((x$2 < 0 || x$2 >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + x$2])); if (c < accept.lo || accept.hi < c) { return false; } else if (size === 2) { } else { c$1 = (x$3 = i + 2 >> 0, ((x$3 < 0 || x$3 >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + x$3])); if (c$1 < 128 || 191 < c$1) { return false; } else if (size === 3) { } else { c$2 = (x$4 = i + 3 >> 0, ((x$4 < 0 || x$4 >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + x$4])); if (c$2 < 128 || 191 < c$2) { return false; } } } i = i + (size) >> 0; } return true; }; $pkg.Valid = Valid; ValidString = function(s) { var accept, c, c$1, c$2, first32, i, n, s, second32, si, size, x, x$1; while (true) { if (!(s.length >= 8)) { break; } first32 = (((((((s.charCodeAt(0) >>> 0)) | (((s.charCodeAt(1) >>> 0)) << 8 >>> 0)) >>> 0) | (((s.charCodeAt(2) >>> 0)) << 16 >>> 0)) >>> 0) | (((s.charCodeAt(3) >>> 0)) << 24 >>> 0)) >>> 0; second32 = (((((((s.charCodeAt(4) >>> 0)) | (((s.charCodeAt(5) >>> 0)) << 8 >>> 0)) >>> 0) | (((s.charCodeAt(6) >>> 0)) << 16 >>> 0)) >>> 0) | (((s.charCodeAt(7) >>> 0)) << 24 >>> 0)) >>> 0; if (!(((((((first32 | second32) >>> 0)) & 2155905152) >>> 0) === 0))) { break; } s = $substring(s, 8); } n = s.length; i = 0; while (true) { if (!(i < n)) { break; } si = s.charCodeAt(i); if (si < 128) { i = i + (1) >> 0; continue; } x = ((si < 0 || si >= first.length) ? ($throwRuntimeError("index out of range"), undefined) : first[si]); if (x === 241) { return false; } size = ((((x & 7) >>> 0) >> 0)); if ((i + size >> 0) > n) { return false; } accept = $clone((x$1 = x >>> 4 << 24 >>> 24, ((x$1 < 0 || x$1 >= acceptRanges.length) ? ($throwRuntimeError("index out of range"), undefined) : acceptRanges[x$1])), acceptRange); c = s.charCodeAt((i + 1 >> 0)); if (c < accept.lo || accept.hi < c) { return false; } else if (size === 2) { } else { c$1 = s.charCodeAt((i + 2 >> 0)); if (c$1 < 128 || 191 < c$1) { return false; } else if (size === 3) { } else { c$2 = s.charCodeAt((i + 3 >> 0)); if (c$2 < 128 || 191 < c$2) { return false; } } } i = i + (size) >> 0; } return true; }; $pkg.ValidString = ValidString; ValidRune = function(r) { var r; if (0 <= r && r < 55296) { return true; } else if (57343 < r && r <= 1114111) { return true; } return false; }; $pkg.ValidRune = ValidRune; acceptRange.init("unicode/utf8", [{prop: "lo", name: "lo", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "hi", name: "hi", embedded: false, exported: false, 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), new acceptRange.ptr(0, 0), new acceptRange.ptr(0, 0), new acceptRange.ptr(0, 0), new acceptRange.ptr(0, 0), new acceptRange.ptr(0, 0), new acceptRange.ptr(0, 0), new acceptRange.ptr(0, 0), new acceptRange.ptr(0, 0), new acceptRange.ptr(0, 0), new acceptRange.ptr(0, 0), new acceptRange.ptr(0, 0)]); /* */ } 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, bytealg, io, unicode, utf8, Reader, asciiSet, Buffer, readOp, sliceType, arrayType, ptrType, arrayType$1, ptrType$1, ptrType$2, asciiSpace, errNegativeRead, errUnreadByte, NewReader, IndexByte, Equal, Compare, Contains, ContainsAny, LastIndexByte, IndexRune, IndexAny, HasPrefix, HasSuffix, TrimLeftFunc, TrimRightFunc, TrimFunc, TrimPrefix, indexFunc, lastIndexFunc, makeASCIISet, makeCutsetFunc, TrimRight, TrimSpace, EqualFold, Index, makeSlice; errors = $packages["errors"]; bytealg = $packages["internal/bytealg"]; io = $packages["io"]; unicode = $packages["unicode"]; utf8 = $packages["unicode/utf8"]; Reader = $pkg.Reader = $newType(0, $kindStruct, "bytes.Reader", true, "bytes", true, function(s_, i_, prevRune_) { this.$val = this; if (arguments.length === 0) { this.s = sliceType.nil; this.i = new $Int64(0, 0); this.prevRune = 0; return; } this.s = s_; this.i = i_; this.prevRune = prevRune_; }); asciiSet = $pkg.asciiSet = $newType(32, $kindArray, "bytes.asciiSet", true, "bytes", false, null); Buffer = $pkg.Buffer = $newType(0, $kindStruct, "bytes.Buffer", true, "bytes", true, function(buf_, off_, lastRead_) { this.$val = this; if (arguments.length === 0) { this.buf = sliceType.nil; this.off = 0; this.lastRead = 0; return; } this.buf = buf_; this.off = off_; this.lastRead = lastRead_; }); readOp = $pkg.readOp = $newType(1, $kindInt8, "bytes.readOp", true, "bytes", false, null); sliceType = $sliceType($Uint8); arrayType = $arrayType($Uint8, 4); ptrType = $ptrType(asciiSet); arrayType$1 = $arrayType($Uint32, 8); ptrType$1 = $ptrType(Buffer); ptrType$2 = $ptrType(Reader); Reader.ptr.prototype.Len = function() { var 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 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 _tmp, _tmp$1, b, err, n, r, x, x$1, x$2, x$3; n = 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)))) { _tmp = 0; _tmp$1 = io.EOF; n = _tmp; err = _tmp$1; return [n, err]; } r.prevRune = -1; n = $copySlice(b, $subslice(r.s, $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 _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("bytes.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 = $copySlice(b, $subslice(r.s, $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 b, r, x, x$1, x$2, x$3, x$4, x$5; 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)))) { return [0, io.EOF]; } b = (x$2 = r.s, x$3 = r.i, (($flatten64(x$3) < 0 || $flatten64(x$3) >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + $flatten64(x$3)])); r.i = (x$4 = r.i, x$5 = new $Int64(0, 1), new $Int64(x$4.$high + x$5.$high, x$4.$low + x$5.$low)); return [b, $ifaceNil]; }; Reader.prototype.ReadByte = function() { return this.$val.ReadByte(); }; Reader.ptr.prototype.UnreadByte = function() { var r, x, x$1, x$2; r = this; if ((x = r.i, (x.$high < 0 || (x.$high === 0 && x.$low <= 0)))) { return errors.New("bytes.Reader.UnreadByte: at beginning of slice"); } r.prevRune = -1; 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 _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, x$7, x$8; 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 = (x$3 = r.s, x$4 = r.i, (($flatten64(x$4) < 0 || $flatten64(x$4) >= x$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + $flatten64(x$4)])); if (c < 128) { r.i = (x$5 = r.i, x$6 = new $Int64(0, 1), new $Int64(x$5.$high + x$6.$high, x$5.$low + x$6.$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.DecodeRune($subslice(r.s, $flatten64(r.i))); ch = _tuple[0]; size = _tuple[1]; r.i = (x$7 = r.i, x$8 = (new $Int64(0, size)), new $Int64(x$7.$high + x$8.$high, x$7.$low + x$8.$low)); return [ch, size, err]; }; Reader.prototype.ReadRune = function() { return this.$val.ReadRune(); }; Reader.ptr.prototype.UnreadRune = function() { var r, x; r = this; if ((x = r.i, (x.$high < 0 || (x.$high === 0 && x.$low <= 0)))) { return errors.New("bytes.Reader.UnreadRune: at beginning of slice"); } if (r.prevRune < 0) { return errors.New("bytes.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 _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("bytes.Reader.Seek: invalid whence")]; } if ((abs.$high < 0 || (abs.$high === 0 && abs.$low < 0))) { return [new $Int64(0, 0), errors.New("bytes.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 _r, _tmp, _tmp$1, _tuple, b, err, m, n, r, 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; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; b = $f.b; err = $f.err; m = $f.m; n = $f.n; r = $f.r; 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; $s = -1; return [n, err]; } b = $subslice(r.s, $flatten64(r.i)); _r = w.Write(b); /* */ $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 > b.$length) { $panic(new $String("bytes.Reader.WriteTo: invalid Write 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 === b.$length)) && $interfaceIsEqual(err, $ifaceNil)) { err = io.ErrShortWrite; } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.WriteTo }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.m = m; $f.n = n; $f.r = r; $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); }; Reader.ptr.prototype.Reset = function(b) { var b, r; r = this; Reader.copy(r, new Reader.ptr(b, new $Int64(0, 0), -1)); }; Reader.prototype.Reset = function(b) { return this.$val.Reset(b); }; NewReader = function(b) { var b; return new Reader.ptr(b, new $Int64(0, 0), -1); }; $pkg.NewReader = NewReader; IndexByte = function(s, c) { var _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"), undefined) : _ref.$array[_ref.$offset + _i]); if (b === c) { return i; } _i++; } return -1; }; $pkg.IndexByte = IndexByte; Equal = function(a, b) { var _i, _ref, a, b, c, i; if (!((a.$length === b.$length))) { return false; } _ref = a; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; c = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (!((c === ((i < 0 || i >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + i])))) { return false; } _i++; } return true; }; $pkg.Equal = Equal; Compare = function(a, b) { var _i, _ref, a, b, ca, cb, i; _ref = a; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; ca = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (i >= b.$length) { return 1; } cb = ((i < 0 || i >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + i]); if (ca < cb) { return -1; } if (ca > cb) { return 1; } _i++; } if (a.$length < b.$length) { return -1; } return 0; }; $pkg.Compare = Compare; Contains = function(b, subslice) { var b, subslice; return !((Index(b, subslice) === -1)); }; $pkg.Contains = Contains; ContainsAny = function(b, chars) { var b, chars; return IndexAny(b, chars) >= 0; }; $pkg.ContainsAny = ContainsAny; LastIndexByte = function(s, c) { var c, i, s; i = s.$length - 1 >> 0; while (true) { if (!(i >= 0)) { break; } if (((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]) === c) { return i; } i = i - (1) >> 0; } return -1; }; $pkg.LastIndexByte = LastIndexByte; IndexRune = function(s, r) { var _tuple, b, i, n, n$1, r, r1, s; if (0 <= r && r < 128) { return IndexByte(s, ((r << 24 >>> 24))); } else if ((r === 65533)) { i = 0; while (true) { if (!(i < s.$length)) { break; } _tuple = utf8.DecodeRune($subslice(s, i)); r1 = _tuple[0]; n = _tuple[1]; if (r1 === 65533) { return i; } i = i + (n) >> 0; } return -1; } else if (!utf8.ValidRune(r)) { return -1; } else { b = arrayType.zero(); n$1 = utf8.EncodeRune(new sliceType(b), r); return Index(s, $subslice(new sliceType(b), 0, n$1)); } }; $pkg.IndexRune = IndexRune; IndexAny = function(s, chars) { var _i, _i$1, _i$2, _ref, _ref$1, _ref$2, _rune, _rune$1, _tuple, _tuple$1, as, c, ch, chars, i, i$1, isASCII, r, r$1, r$2, s, width; if (chars === "") { return -1; } if (s.$length === 1) { r = (((0 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 0]) >> 0)); if (r >= 128) { _ref = chars; _i = 0; while (true) { if (!(_i < _ref.length)) { break; } _rune = $decodeRune(_ref, _i); r = _rune[0]; if (r === 65533) { return 0; } _i += _rune[1]; } return -1; } if (bytealg.IndexByteString(chars, (0 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 0])) >= 0) { return 0; } return -1; } if (chars.length === 1) { r$1 = ((chars.charCodeAt(0) >> 0)); if (r$1 >= 128) { r$1 = 65533; } return IndexRune(s, r$1); } if (s.$length > 8) { _tuple = makeASCIISet(chars); as = $clone(_tuple[0], asciiSet); isASCII = _tuple[1]; if (isASCII) { _ref$1 = s; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } i = _i$1; c = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); if (new ptrType(as).contains(c)) { return i; } _i$1++; } return -1; } } width = 0; i$1 = 0; while (true) { if (!(i$1 < s.$length)) { break; } r$2 = ((((i$1 < 0 || i$1 >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i$1]) >> 0)); if (r$2 < 128) { if (bytealg.IndexByteString(chars, ((i$1 < 0 || i$1 >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i$1])) >= 0) { return i$1; } width = 1; i$1 = i$1 + (width) >> 0; continue; } _tuple$1 = utf8.DecodeRune($subslice(s, i$1)); r$2 = _tuple$1[0]; width = _tuple$1[1]; if (!((r$2 === 65533))) { if (chars.length === width) { if (chars === ($encodeRune(r$2))) { return i$1; } i$1 = i$1 + (width) >> 0; continue; } if (bytealg.MaxLen >= width) { if (bytealg.IndexString(chars, ($encodeRune(r$2))) >= 0) { return i$1; } i$1 = i$1 + (width) >> 0; continue; } } _ref$2 = chars; _i$2 = 0; while (true) { if (!(_i$2 < _ref$2.length)) { break; } _rune$1 = $decodeRune(_ref$2, _i$2); ch = _rune$1[0]; if (r$2 === ch) { return i$1; } _i$2 += _rune$1[1]; } i$1 = i$1 + (width) >> 0; } return -1; }; $pkg.IndexAny = IndexAny; HasPrefix = function(s, prefix) { var prefix, s; return s.$length >= prefix.$length && Equal($subslice(s, 0, prefix.$length), prefix); }; $pkg.HasPrefix = HasPrefix; HasSuffix = function(s, suffix) { var s, suffix; return s.$length >= suffix.$length && Equal($subslice(s, (s.$length - suffix.$length >> 0)), suffix); }; $pkg.HasSuffix = HasSuffix; TrimLeftFunc = function(s, f) { var _r, f, i, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; f = $f.f; i = $f.i; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = indexFunc(s, f, false); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } i = _r; if (i === -1) { $s = -1; return sliceType.nil; } $s = -1; return $subslice(s, i); /* */ } return; } if ($f === undefined) { $f = { $blk: TrimLeftFunc }; } $f._r = _r; $f.f = f; $f.i = i; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.TrimLeftFunc = TrimLeftFunc; TrimRightFunc = function(s, f) { var _r, _tuple, f, i, s, wid, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; f = $f.f; i = $f.i; s = $f.s; wid = $f.wid; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = lastIndexFunc(s, f, false); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } i = _r; if (i >= 0 && ((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]) >= 128) { _tuple = utf8.DecodeRune($subslice(s, i)); wid = _tuple[1]; i = i + (wid) >> 0; } else { i = i + (1) >> 0; } $s = -1; return $subslice(s, 0, i); /* */ } return; } if ($f === undefined) { $f = { $blk: TrimRightFunc }; } $f._r = _r; $f._tuple = _tuple; $f.f = f; $f.i = i; $f.s = s; $f.wid = wid; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.TrimRightFunc = TrimRightFunc; TrimFunc = function(s, f) { var $24r, _r, _r$1, f, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; f = $f.f; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = TrimLeftFunc(s, f); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = TrimRightFunc(_r, f); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: TrimFunc }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f.f = f; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.TrimFunc = TrimFunc; TrimPrefix = function(s, prefix) { var prefix, s; if (HasPrefix(s, prefix)) { return $subslice(s, prefix.$length); } return s; }; $pkg.TrimPrefix = TrimPrefix; indexFunc = function(s, f, truth) { var _r, _tuple, f, r, s, start, truth, wid, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; f = $f.f; r = $f.r; s = $f.s; start = $f.start; truth = $f.truth; wid = $f.wid; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: start = 0; /* while (true) { */ case 1: /* if (!(start < s.$length)) { break; } */ if(!(start < s.$length)) { $s = 2; continue; } wid = 1; r = ((((start < 0 || start >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + start]) >> 0)); if (r >= 128) { _tuple = utf8.DecodeRune($subslice(s, start)); r = _tuple[0]; wid = _tuple[1]; } _r = f(r); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (_r === truth) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_r === truth) { */ case 3: $s = -1; return start; /* } */ case 4: start = start + (wid) >> 0; $s = 1; continue; case 2: $s = -1; return -1; /* */ } return; } if ($f === undefined) { $f = { $blk: indexFunc }; } $f._r = _r; $f._tuple = _tuple; $f.f = f; $f.r = r; $f.s = s; $f.start = start; $f.truth = truth; $f.wid = wid; $f.$s = $s; $f.$r = $r; return $f; }; lastIndexFunc = function(s, f, truth) { var _r, _tmp, _tmp$1, _tuple, f, i, r, s, size, truth, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; f = $f.f; i = $f.i; r = $f.r; s = $f.s; size = $f.size; truth = $f.truth; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: i = s.$length; /* while (true) { */ case 1: /* if (!(i > 0)) { break; } */ if(!(i > 0)) { $s = 2; continue; } _tmp = (((x = i - 1 >> 0, ((x < 0 || x >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + x])) >> 0)); _tmp$1 = 1; r = _tmp; size = _tmp$1; if (r >= 128) { _tuple = utf8.DecodeLastRune($subslice(s, 0, i)); r = _tuple[0]; size = _tuple[1]; } i = i - (size) >> 0; _r = f(r); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (_r === truth) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_r === truth) { */ case 3: $s = -1; return i; /* } */ case 4: $s = 1; continue; case 2: $s = -1; return -1; /* */ } return; } if ($f === undefined) { $f = { $blk: lastIndexFunc }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.f = f; $f.i = i; $f.r = r; $f.s = s; $f.size = size; $f.truth = truth; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; makeASCIISet = function(chars) { var _index, _tmp, _tmp$1, _tmp$2, _tmp$3, as, c, chars, i, ok, y; as = arrayType$1.zero(); ok = false; i = 0; while (true) { if (!(i < chars.length)) { break; } c = chars.charCodeAt(i); if (c >= 128) { _tmp = $clone(as, asciiSet); _tmp$1 = false; asciiSet.copy(as, _tmp); ok = _tmp$1; return [as, ok]; } _index = c >>> 5 << 24 >>> 24; ((_index < 0 || _index >= as.length) ? ($throwRuntimeError("index out of range"), undefined) : as[_index] = ((((_index < 0 || _index >= as.length) ? ($throwRuntimeError("index out of range"), undefined) : as[_index]) | (((y = ((((c & 31) >>> 0) >>> 0)), y < 32 ? (1 << y) : 0) >>> 0))) >>> 0)); i = i + (1) >> 0; } _tmp$2 = $clone(as, asciiSet); _tmp$3 = true; asciiSet.copy(as, _tmp$2); ok = _tmp$3; return [as, ok]; }; asciiSet.prototype.contains = function(c) { var as, c, x, x$1, y; as = this.$val; return !((((((x = as, x$1 = c >>> 5 << 24 >>> 24, ((x$1 < 0 || x$1 >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[x$1])) & (((y = ((((c & 31) >>> 0) >>> 0)), y < 32 ? (1 << y) : 0) >>> 0))) >>> 0)) === 0)); }; $ptrType(asciiSet).prototype.contains = function(c) { return (new asciiSet(this.$get())).contains(c); }; makeCutsetFunc = function(cutset) { var _tuple, as, cutset, isASCII; if ((cutset.length === 1) && cutset.charCodeAt(0) < 128) { return (function(r) { var r; return r === ((cutset.charCodeAt(0) >> 0)); }); } _tuple = makeASCIISet(cutset); as = $clone(_tuple[0], asciiSet); isASCII = _tuple[1]; if (isASCII) { return (function(r) { var r; return r < 128 && new ptrType(as).contains(((r << 24 >>> 24))); }); } return (function(r) { var _i, _ref, _rune, c, r; _ref = cutset; _i = 0; while (true) { if (!(_i < _ref.length)) { break; } _rune = $decodeRune(_ref, _i); c = _rune[0]; if (c === r) { return true; } _i += _rune[1]; } return false; }); }; TrimRight = function(s, cutset) { var $24r, _r, cutset, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; cutset = $f.cutset; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = TrimRightFunc(s, makeCutsetFunc(cutset)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: TrimRight }; } $f.$24r = $24r; $f._r = _r; $f.cutset = cutset; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.TrimRight = TrimRight; TrimSpace = function(s) { var $24r, $24r$1, _r, _r$1, c, c$1, s, start, stop, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; _r$1 = $f._r$1; c = $f.c; c$1 = $f.c$1; s = $f.s; start = $f.start; stop = $f.stop; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: start = 0; /* while (true) { */ case 1: /* if (!(start < s.$length)) { break; } */ if(!(start < s.$length)) { $s = 2; continue; } c = ((start < 0 || start >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + start]); /* */ if (c >= 128) { $s = 3; continue; } /* */ $s = 4; continue; /* if (c >= 128) { */ case 3: _r = TrimFunc($subslice(s, start), unicode.IsSpace); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 6; case 6: return $24r; /* } */ case 4: if (((c < 0 || c >= asciiSpace.length) ? ($throwRuntimeError("index out of range"), undefined) : asciiSpace[c]) === 0) { /* break; */ $s = 2; continue; } start = start + (1) >> 0; $s = 1; continue; case 2: stop = s.$length; /* while (true) { */ case 7: /* if (!(stop > start)) { break; } */ if(!(stop > start)) { $s = 8; continue; } c$1 = (x = stop - 1 >> 0, ((x < 0 || x >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + x])); /* */ if (c$1 >= 128) { $s = 9; continue; } /* */ $s = 10; continue; /* if (c$1 >= 128) { */ case 9: _r$1 = TrimFunc($subslice(s, start, stop), unicode.IsSpace); /* */ $s = 11; case 11: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r$1 = _r$1; $s = 12; case 12: return $24r$1; /* } */ case 10: if (((c$1 < 0 || c$1 >= asciiSpace.length) ? ($throwRuntimeError("index out of range"), undefined) : asciiSpace[c$1]) === 0) { /* break; */ $s = 8; continue; } stop = stop - (1) >> 0; $s = 7; continue; case 8: if (start === stop) { $s = -1; return sliceType.nil; } $s = -1; return $subslice(s, start, stop); /* */ } return; } if ($f === undefined) { $f = { $blk: TrimSpace }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f._r$1 = _r$1; $f.c = c; $f.c$1 = c$1; $f.s = s; $f.start = start; $f.stop = stop; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.TrimSpace = TrimSpace; EqualFold = function(s, t) { var _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"), undefined) : s.$array[s.$offset + 0]) < 128) { _tmp$2 = (((0 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : 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"), undefined) : t.$array[t.$offset + 0]) < 128) { _tmp$6 = (((0 >= t.$length ? ($throwRuntimeError("index out of range"), undefined) : 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) { if (65 <= sr && sr <= 90 && (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; Index = function(s, sep) { var c0, c0$1, c1, c1$1, fails, fails$1, i, i$1, j, n, o, o$1, r, s, sep, t, t$1, x, x$1; n = sep.$length; if ((n === 0)) { return 0; } else if ((n === 1)) { return IndexByte(s, (0 >= sep.$length ? ($throwRuntimeError("index out of range"), undefined) : sep.$array[sep.$offset + 0])); } else if ((n === s.$length)) { if (Equal(sep, s)) { return 0; } return -1; } else if (n > s.$length) { return -1; } else if (n <= bytealg.MaxLen) { if (s.$length <= 0) { return bytealg.Index(s, sep); } c0 = (0 >= sep.$length ? ($throwRuntimeError("index out of range"), undefined) : sep.$array[sep.$offset + 0]); c1 = (1 >= sep.$length ? ($throwRuntimeError("index out of range"), undefined) : sep.$array[sep.$offset + 1]); i = 0; t = (s.$length - n >> 0) + 1 >> 0; fails = 0; while (true) { if (!(i < t)) { break; } if (!((((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]) === c0))) { o = IndexByte($subslice(s, (i + 1 >> 0), t), c0); if (o < 0) { return -1; } i = i + ((o + 1 >> 0)) >> 0; } if (((x = i + 1 >> 0, ((x < 0 || x >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + x])) === c1) && Equal($subslice(s, i, (i + n >> 0)), sep)) { return i; } fails = fails + (1) >> 0; i = i + (1) >> 0; if (fails > bytealg.Cutover(i)) { r = bytealg.Index($subslice(s, i), sep); if (r >= 0) { return r + i >> 0; } return -1; } } return -1; } c0$1 = (0 >= sep.$length ? ($throwRuntimeError("index out of range"), undefined) : sep.$array[sep.$offset + 0]); c1$1 = (1 >= sep.$length ? ($throwRuntimeError("index out of range"), undefined) : sep.$array[sep.$offset + 1]); i$1 = 0; fails$1 = 0; t$1 = (s.$length - n >> 0) + 1 >> 0; while (true) { if (!(i$1 < t$1)) { break; } if (!((((i$1 < 0 || i$1 >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i$1]) === c0$1))) { o$1 = IndexByte($subslice(s, (i$1 + 1 >> 0), t$1), c0$1); if (o$1 < 0) { break; } i$1 = i$1 + ((o$1 + 1 >> 0)) >> 0; } if (((x$1 = i$1 + 1 >> 0, ((x$1 < 0 || x$1 >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + x$1])) === c1$1) && Equal($subslice(s, i$1, (i$1 + n >> 0)), sep)) { return i$1; } i$1 = i$1 + (1) >> 0; fails$1 = fails$1 + (1) >> 0; if (fails$1 >= (4 + (i$1 >> 4 >> 0) >> 0) && i$1 < t$1) { j = bytealg.IndexRabinKarpBytes($subslice(s, i$1), sep); if (j < 0) { return -1; } return i$1 + j >> 0; } } return -1; }; $pkg.Index = Index; Buffer.ptr.prototype.Bytes = function() { var b; b = this; return $subslice(b.buf, b.off); }; Buffer.prototype.Bytes = function() { return this.$val.Bytes(); }; Buffer.ptr.prototype.String = function() { var b; b = this; if (b === ptrType$1.nil) { return ""; } return ($bytesToString($subslice(b.buf, b.off))); }; Buffer.prototype.String = function() { return this.$val.String(); }; Buffer.ptr.prototype.empty = function() { var b; b = this; return b.buf.$length <= b.off; }; Buffer.prototype.empty = function() { return this.$val.empty(); }; Buffer.ptr.prototype.Len = function() { var b; b = this; return b.buf.$length - b.off >> 0; }; Buffer.prototype.Len = function() { return this.$val.Len(); }; Buffer.ptr.prototype.Cap = function() { var b; b = this; return b.buf.$capacity; }; Buffer.prototype.Cap = function() { return this.$val.Cap(); }; Buffer.ptr.prototype.Truncate = function(n) { var b, n; b = this; if (n === 0) { b.Reset(); return; } b.lastRead = 0; if (n < 0 || n > b.Len()) { $panic(new $String("bytes.Buffer: truncation out of range")); } 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 b; b = this; b.buf = $subslice(b.buf, 0, 0); b.off = 0; b.lastRead = 0; }; Buffer.prototype.Reset = function() { return this.$val.Reset(); }; Buffer.ptr.prototype.tryGrowByReslice = function(n) { var b, l, n; b = this; l = b.buf.$length; if (n <= (b.buf.$capacity - l >> 0)) { b.buf = $subslice(b.buf, 0, (l + n >> 0)); return [l, true]; } return [0, false]; }; Buffer.prototype.tryGrowByReslice = function(n) { return this.$val.tryGrowByReslice(n); }; Buffer.ptr.prototype.grow = function(n) { var _q, _r, _tuple, b, buf, c, i, m, n, ok, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _q = $f._q; _r = $f._r; _tuple = $f._tuple; b = $f.b; buf = $f.buf; c = $f.c; i = $f.i; m = $f.m; n = $f.n; ok = $f.ok; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; m = b.Len(); if ((m === 0) && !((b.off === 0))) { b.Reset(); } _tuple = b.tryGrowByReslice(n); i = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return i; } if (b.buf === sliceType.nil && n <= 64) { b.buf = $makeSlice(sliceType, n, 64); $s = -1; return 0; } c = b.buf.$capacity; /* */ if (n <= ((_q = c / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) - m >> 0)) { $s = 1; continue; } /* */ if (c > ((2147483647 - c >> 0) - n >> 0)) { $s = 2; continue; } /* */ $s = 3; continue; /* if (n <= ((_q = c / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) - m >> 0)) { */ case 1: $copySlice(b.buf, $subslice(b.buf, b.off)); $s = 4; continue; /* } else if (c > ((2147483647 - c >> 0) - n >> 0)) { */ case 2: $panic($pkg.ErrTooLarge); $s = 4; continue; /* } else { */ case 3: _r = makeSlice(($imul(2, c)) + n >> 0); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } buf = _r; $copySlice(buf, $subslice(b.buf, b.off)); b.buf = buf; /* } */ case 4: b.off = 0; b.buf = $subslice(b.buf, 0, (m + n >> 0)); $s = -1; return m; /* */ } return; } if ($f === undefined) { $f = { $blk: Buffer.ptr.prototype.grow }; } $f._q = _q; $f._r = _r; $f._tuple = _tuple; $f.b = b; $f.buf = buf; $f.c = c; $f.i = i; $f.m = m; $f.n = n; $f.ok = ok; $f.$s = $s; $f.$r = $r; return $f; }; Buffer.prototype.grow = function(n) { return this.$val.grow(n); }; Buffer.ptr.prototype.Grow = function(n) { var _r, b, m, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; b = $f.b; m = $f.m; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; if (n < 0) { $panic(new $String("bytes.Buffer.Grow: negative count")); } _r = b.grow(n); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } m = _r; b.buf = $subslice(b.buf, 0, m); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Buffer.ptr.prototype.Grow }; } $f._r = _r; $f.b = b; $f.m = m; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; Buffer.prototype.Grow = function(n) { return this.$val.Grow(n); }; Buffer.ptr.prototype.Write = function(p) { var _r, _tmp, _tmp$1, _tuple, b, err, m, n, ok, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; b = $f.b; err = $f.err; m = $f.m; n = $f.n; ok = $f.ok; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; b = this; b.lastRead = 0; _tuple = b.tryGrowByReslice(p.$length); m = _tuple[0]; ok = _tuple[1]; /* */ if (!ok) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!ok) { */ case 1: _r = b.grow(p.$length); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } m = _r; /* } */ case 2: _tmp = $copySlice($subslice(b.buf, m), p); _tmp$1 = $ifaceNil; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Buffer.ptr.prototype.Write }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.m = m; $f.n = n; $f.ok = ok; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; Buffer.prototype.Write = function(p) { return this.$val.Write(p); }; Buffer.ptr.prototype.WriteString = function(s) { var _r, _tmp, _tmp$1, _tuple, b, err, m, n, ok, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; b = $f.b; err = $f.err; m = $f.m; n = $f.n; ok = $f.ok; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; b = this; b.lastRead = 0; _tuple = b.tryGrowByReslice(s.length); m = _tuple[0]; ok = _tuple[1]; /* */ if (!ok) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!ok) { */ case 1: _r = b.grow(s.length); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } m = _r; /* } */ case 2: _tmp = $copyString($subslice(b.buf, m), s); _tmp$1 = $ifaceNil; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Buffer.ptr.prototype.WriteString }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.m = m; $f.n = n; $f.ok = ok; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; Buffer.prototype.WriteString = function(s) { return this.$val.WriteString(s); }; Buffer.ptr.prototype.ReadFrom = function(r) { var _r, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, e, err, i, m, n, r, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _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; i = $f.i; m = $f.m; n = $f.n; 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; /* while (true) { */ case 1: _r = b.grow(512); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } i = _r; b.buf = $subslice(b.buf, 0, i); _r$1 = r.Read($subslice(b.buf, i, b.buf.$capacity)); /* */ $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; m = _tuple[0]; e = _tuple[1]; if (m < 0) { $panic(errNegativeRead); } b.buf = $subslice(b.buf, 0, (i + m >> 0)); n = (x = (new $Int64(0, m)), new $Int64(n.$high + x.$high, n.$low + x.$low)); if ($interfaceIsEqual(e, io.EOF)) { _tmp = n; _tmp$1 = $ifaceNil; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } if (!($interfaceIsEqual(e, $ifaceNil))) { _tmp$2 = n; _tmp$3 = e; n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; } $s = 1; continue; case 2: $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Buffer.ptr.prototype.ReadFrom }; } $f._r = _r; $f._r$1 = _r$1; $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.i = i; $f.m = m; $f.n = n; $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 $24r, n, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; n = $f.n; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); $deferred.push([(function() { if (!($interfaceIsEqual($recover(), $ifaceNil))) { $panic($pkg.ErrTooLarge); } }), []]); $24r = $makeSlice(sliceType, n); $s = 1; case 1: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; return sliceType.nil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: makeSlice }; } $f.$24r = $24r; $f.n = n; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Buffer.ptr.prototype.WriteTo = function(w) { var _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _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; _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; 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; nBytes = b.Len(); /* */ if (nBytes > 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (nBytes > 0) { */ case 1: _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; $s = -1; return [n, err]; } if (!((m === nBytes))) { _tmp$2 = n; _tmp$3 = io.ErrShortWrite; n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; } /* } */ case 2: b.Reset(); _tmp$4 = n; _tmp$5 = $ifaceNil; n = _tmp$4; err = _tmp$5; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Buffer.ptr.prototype.WriteTo }; } $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.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 _r, _tuple, b, c, m, ok, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; b = $f.b; c = $f.c; m = $f.m; ok = $f.ok; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; b.lastRead = 0; _tuple = b.tryGrowByReslice(1); m = _tuple[0]; ok = _tuple[1]; /* */ if (!ok) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!ok) { */ case 1: _r = b.grow(1); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } m = _r; /* } */ case 2: (x = b.buf, ((m < 0 || m >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + m] = c)); $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Buffer.ptr.prototype.WriteByte }; } $f._r = _r; $f._tuple = _tuple; $f.b = b; $f.c = c; $f.m = m; $f.ok = ok; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Buffer.prototype.WriteByte = function(c) { return this.$val.WriteByte(c); }; Buffer.ptr.prototype.WriteRune = function(r) { var _r, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, err, m, n, ok, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; b = $f.b; err = $f.err; m = $f.m; n = $f.n; ok = $f.ok; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; b = this; /* */ if (((r >>> 0)) < 128) { $s = 1; continue; } /* */ $s = 2; continue; /* if (((r >>> 0)) < 128) { */ case 1: _r = b.WriteByte(((r << 24 >>> 24))); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; _tmp = 1; _tmp$1 = $ifaceNil; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; /* } */ case 2: b.lastRead = 0; _tuple = b.tryGrowByReslice(4); m = _tuple[0]; ok = _tuple[1]; /* */ if (!ok) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!ok) { */ case 4: _r$1 = b.grow(4); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } m = _r$1; /* } */ case 5: n = utf8.EncodeRune($subslice(b.buf, m, (m + 4 >> 0)), r); b.buf = $subslice(b.buf, 0, (m + n >> 0)); _tmp$2 = n; _tmp$3 = $ifaceNil; n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Buffer.ptr.prototype.WriteRune }; } $f._r = _r; $f._r$1 = _r$1; $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.err = err; $f.m = m; $f.n = n; $f.ok = ok; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Buffer.prototype.WriteRune = function(r) { return this.$val.WriteRune(r); }; Buffer.ptr.prototype.Read = function(p) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, b, err, n, p; n = 0; err = $ifaceNil; b = this; b.lastRead = 0; if (b.empty()) { b.Reset(); if (p.$length === 0) { _tmp = 0; _tmp$1 = $ifaceNil; n = _tmp; err = _tmp$1; return [n, err]; } _tmp$2 = 0; _tmp$3 = io.EOF; n = _tmp$2; err = _tmp$3; return [n, err]; } n = $copySlice(p, $subslice(b.buf, b.off)); b.off = b.off + (n) >> 0; if (n > 0) { b.lastRead = -1; } _tmp$4 = n; _tmp$5 = $ifaceNil; n = _tmp$4; err = _tmp$5; return [n, err]; }; Buffer.prototype.Read = function(p) { return this.$val.Read(p); }; Buffer.ptr.prototype.Next = function(n) { var 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 = -1; } return data; }; Buffer.prototype.Next = function(n) { return this.$val.Next(n); }; Buffer.ptr.prototype.ReadByte = function() { var b, c, x, x$1; b = this; if (b.empty()) { b.Reset(); return [0, io.EOF]; } c = (x = b.buf, x$1 = b.off, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])); b.off = b.off + (1) >> 0; b.lastRead = -1; return [c, $ifaceNil]; }; Buffer.prototype.ReadByte = function() { return this.$val.ReadByte(); }; Buffer.ptr.prototype.ReadRune = function() { var _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; if (b.empty()) { b.Reset(); _tmp = 0; _tmp$1 = 0; _tmp$2 = io.EOF; r = _tmp; size = _tmp$1; err = _tmp$2; return [r, size, err]; } c = (x = b.buf, x$1 = b.off, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])); if (c < 128) { b.off = b.off + (1) >> 0; b.lastRead = 1; _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; b.lastRead = ((n << 24 >> 24)); _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 b; b = this; if (b.lastRead <= 0) { return errors.New("bytes.Buffer: UnreadRune: previous operation was not a successful ReadRune"); } if (b.off >= ((b.lastRead >> 0))) { b.off = b.off - (((b.lastRead >> 0))) >> 0; } b.lastRead = 0; return $ifaceNil; }; Buffer.prototype.UnreadRune = function() { return this.$val.UnreadRune(); }; Buffer.ptr.prototype.UnreadByte = function() { var b; b = this; if (b.lastRead === 0) { return errUnreadByte; } 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 _tmp, _tmp$1, _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); _tmp = line; _tmp$1 = err; line = _tmp; err = _tmp$1; return [line, err]; }; Buffer.prototype.ReadBytes = function(delim) { return this.$val.ReadBytes(delim); }; Buffer.ptr.prototype.readSlice = function(delim) { var _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 = -1; _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 _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); }; ptrType$2.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)}, {prop: "Reset", name: "Reset", pkg: "", typ: $funcType([sliceType], [], false)}]; ptrType.methods = [{prop: "contains", name: "contains", pkg: "bytes", typ: $funcType([$Uint8], [$Bool], false)}]; ptrType$1.methods = [{prop: "Bytes", name: "Bytes", pkg: "", typ: $funcType([], [sliceType], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "empty", name: "empty", pkg: "bytes", typ: $funcType([], [$Bool], 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: "tryGrowByReslice", name: "tryGrowByReslice", pkg: "bytes", typ: $funcType([$Int], [$Int, $Bool], 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)}]; Reader.init("bytes", [{prop: "s", name: "s", embedded: false, exported: false, typ: sliceType, tag: ""}, {prop: "i", name: "i", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "prevRune", name: "prevRune", embedded: false, exported: false, typ: $Int, tag: ""}]); asciiSet.init($Uint32, 8); Buffer.init("bytes", [{prop: "buf", name: "buf", embedded: false, exported: false, typ: sliceType, tag: ""}, {prop: "off", name: "off", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "lastRead", name: "lastRead", embedded: false, exported: false, 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 = bytealg.$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; } asciiSpace = $toNativeArray($kindUint8, [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); $pkg.ErrTooLarge = errors.New("bytes.Buffer: too large"); errNegativeRead = errors.New("bytes.Buffer: reader returned negative count from Read"); errUnreadByte = errors.New("bytes.Buffer: UnreadByte: previous operation was not a successful read"); /* */ } 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, TextUnmarshaler, sliceType; TextMarshaler = $pkg.TextMarshaler = $newType(8, $kindInterface, "encoding.TextMarshaler", true, "encoding", true, null); TextUnmarshaler = $pkg.TextUnmarshaler = $newType(8, $kindInterface, "encoding.TextUnmarshaler", true, "encoding", true, null); sliceType = $sliceType($Uint8); TextMarshaler.init([{prop: "MarshalText", name: "MarshalText", pkg: "", typ: $funcType([], [sliceType, $error], false)}]); TextUnmarshaler.init([{prop: "UnmarshalText", name: "UnmarshalText", 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["math/bits"] = (function() { var $pkg = {}, $init, _err, overflowError, divideError, deBruijn32tab, deBruijn64tab, Mul32, Add32, Div32, LeadingZeros, LeadingZeros32, LeadingZeros64, TrailingZeros, TrailingZeros32, TrailingZeros64, RotateLeft32, RotateLeft64, Reverse8, Reverse16, Len, Len32, Len64, Add, Add64, Sub, Sub32, Sub64, Mul, Mul64, Div, Div64; _err = $pkg._err = $newType(8, $kindString, "bits._err", true, "math/bits", false, null); _err.prototype.Error = function() { var e; e = this.$val; return (e); }; $ptrType(_err).prototype.Error = function() { return new _err(this.$get()).Error(); }; _err.prototype.RuntimeError = function() { var e; e = this.$val; }; $ptrType(_err).prototype.RuntimeError = function() { return new _err(this.$get()).RuntimeError(); }; Mul32 = function(x, y) { var hi, lo, t, w0, w1, w2, x, x0, x1, y, y0, y1; hi = 0; lo = 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; hi = (($imul(x1, y1) >>> 0) + w2 >>> 0) + (w1 >>> 16 >>> 0) >>> 0; lo = $imul(x, y) >>> 0; return [hi, lo]; }; $pkg.Mul32 = Mul32; Add32 = function(x, y, carry) { var carry, carryOut, sum, x, y; sum = 0; carryOut = 0; sum = (x + y >>> 0) + carry >>> 0; carryOut = ((((((x & y) >>> 0)) | ((((((x | y) >>> 0)) & ~sum) >>> 0))) >>> 0)) >>> 31 >>> 0; return [sum, carryOut]; }; $pkg.Add32 = Add32; Div32 = function(hi, lo, y) { var _q, _q$1, _tmp, _tmp$1, hi, lo, q0, q1, quo, rem, rhat, s, un0, un1, un10, un16, un21, y, y$1, y$2, y$3, y$4, y$5, yn0, yn1; quo = 0; rem = 0; if (y === 0) { $panic(divideError); } if (y <= hi) { $panic(overflowError); } s = ((LeadingZeros32(y) >>> 0)); y = (y$1 = (s), y$1 < 32 ? (y << y$1) : 0) >>> 0; yn1 = y >>> 16 >>> 0; yn0 = (y & 65535) >>> 0; un16 = (((y$2 = s, y$2 < 32 ? (hi << y$2) : 0) >>> 0) | ((y$3 = ((32 - s >>> 0)), y$3 < 32 ? (lo >>> y$3) : 0) >>> 0)) >>> 0; un10 = (y$4 = s, y$4 < 32 ? (lo << y$4) : 0) >>> 0; un1 = un10 >>> 16 >>> 0; un0 = (un10 & 65535) >>> 0; q1 = (_q = un16 / yn1, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); rhat = un16 - ($imul(q1, yn1) >>> 0) >>> 0; while (true) { if (!(q1 >= 65536 || ($imul(q1, yn0) >>> 0) > (($imul(65536, rhat) >>> 0) + un1 >>> 0))) { break; } q1 = q1 - (1) >>> 0; rhat = rhat + (yn1) >>> 0; if (rhat >= 65536) { break; } } un21 = (($imul(un16, 65536) >>> 0) + un1 >>> 0) - ($imul(q1, y) >>> 0) >>> 0; q0 = (_q$1 = un21 / yn1, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >>> 0 : $throwRuntimeError("integer divide by zero")); rhat = un21 - ($imul(q0, yn1) >>> 0) >>> 0; while (true) { if (!(q0 >= 65536 || ($imul(q0, yn0) >>> 0) > (($imul(65536, rhat) >>> 0) + un0 >>> 0))) { break; } q0 = q0 - (1) >>> 0; rhat = rhat + (yn1) >>> 0; if (rhat >= 65536) { break; } } _tmp = ($imul(q1, 65536) >>> 0) + q0 >>> 0; _tmp$1 = (y$5 = s, y$5 < 32 ? ((((($imul(un21, 65536) >>> 0) + un0 >>> 0) - ($imul(q0, y) >>> 0) >>> 0)) >>> y$5) : 0) >>> 0; quo = _tmp; rem = _tmp$1; return [quo, rem]; }; $pkg.Div32 = Div32; LeadingZeros = function(x) { var x; return 32 - Len(x) >> 0; }; $pkg.LeadingZeros = LeadingZeros; LeadingZeros32 = function(x) { var x; return 32 - Len32(x) >> 0; }; $pkg.LeadingZeros32 = LeadingZeros32; LeadingZeros64 = function(x) { var x; return 64 - Len64(x) >> 0; }; $pkg.LeadingZeros64 = LeadingZeros64; TrailingZeros = function(x) { var x; if (true) { return TrailingZeros32(((x >>> 0))); } return TrailingZeros64((new $Uint64(0, x))); }; $pkg.TrailingZeros = TrailingZeros; TrailingZeros32 = function(x) { var x, x$1; if (x === 0) { return 32; } return (((x$1 = ($imul((((x & (-x >>> 0)) >>> 0)), 125613361) >>> 0) >>> 27 >>> 0, ((x$1 < 0 || x$1 >= deBruijn32tab.length) ? ($throwRuntimeError("index out of range"), undefined) : deBruijn32tab[x$1])) >> 0)); }; $pkg.TrailingZeros32 = TrailingZeros32; TrailingZeros64 = function(x) { var x, x$1, x$2; if ((x.$high === 0 && x.$low === 0)) { return 64; } return (((x$1 = $shiftRightUint64($mul64(((x$2 = new $Uint64(-x.$high, -x.$low), new $Uint64(x.$high & x$2.$high, (x.$low & x$2.$low) >>> 0))), new $Uint64(66559345, 3033172745)), 58), (($flatten64(x$1) < 0 || $flatten64(x$1) >= deBruijn64tab.length) ? ($throwRuntimeError("index out of range"), undefined) : deBruijn64tab[$flatten64(x$1)])) >> 0)); }; $pkg.TrailingZeros64 = TrailingZeros64; RotateLeft32 = function(x, k) { var k, s, x, y, y$1; s = (((k >>> 0)) & 31) >>> 0; return (((y = s, y < 32 ? (x << y) : 0) >>> 0) | ((y$1 = ((32 - s >>> 0)), y$1 < 32 ? (x >>> y$1) : 0) >>> 0)) >>> 0; }; $pkg.RotateLeft32 = RotateLeft32; RotateLeft64 = function(x, k) { var k, s, x, x$1, x$2; s = (((k >>> 0)) & 63) >>> 0; return (x$1 = $shiftLeft64(x, s), x$2 = $shiftRightUint64(x, ((64 - s >>> 0))), new $Uint64(x$1.$high | x$2.$high, (x$1.$low | x$2.$low) >>> 0)); }; $pkg.RotateLeft64 = RotateLeft64; Reverse8 = function(x) { var x; return "\x00\x80@\xC0 \xA0`\xE0\x10\x90P\xD00\xB0p\xF0\b\x88H\xC8(\xA8h\xE8\x18\x98X\xD88\xB8x\xF8\x04\x84D\xC4$\xA4d\xE4\x14\x94T\xD44\xB4t\xF4\f\x8CL\xCC,\xACl\xEC\x1C\x9C\\\xDC<\xBC|\xFC\x02\x82B\xC2\"\xA2b\xE2\x12\x92R\xD22\xB2r\xF2\n\x8AJ\xCA*\xAAj\xEA\x1A\x9AZ\xDA:\xBAz\xFA\x06\x86F\xC6&\xA6f\xE6\x16\x96V\xD66\xB6v\xF6\x0E\x8EN\xCE.\xAEn\xEE\x1E\x9E^\xDE>\xBE~\xFE\x01\x81A\xC1!\xA1a\xE1\x11\x91Q\xD11\xB1q\xF1\t\x89I\xC9)\xA9i\xE9\x19\x99Y\xD99\xB9y\xF9\x05\x85E\xC5%\xA5e\xE5\x15\x95U\xD55\xB5u\xF5\r\x8DM\xCD-\xADm\xED\x1D\x9D]\xDD=\xBD}\xFD\x03\x83C\xC3#\xA3c\xE3\x13\x93S\xD33\xB3s\xF3\v\x8BK\xCB+\xABk\xEB\x1B\x9B[\xDB;\xBB{\xFB\x07\x87G\xC7'\xA7g\xE7\x17\x97W\xD77\xB7w\xF7\x0F\x8FO\xCF/\xAFo\xEF\x1F\x9F_\xDF?\xBF\x7F\xFF".charCodeAt(x); }; $pkg.Reverse8 = Reverse8; Reverse16 = function(x) { var x; return ((("\x00\x80@\xC0 \xA0`\xE0\x10\x90P\xD00\xB0p\xF0\b\x88H\xC8(\xA8h\xE8\x18\x98X\xD88\xB8x\xF8\x04\x84D\xC4$\xA4d\xE4\x14\x94T\xD44\xB4t\xF4\f\x8CL\xCC,\xACl\xEC\x1C\x9C\\\xDC<\xBC|\xFC\x02\x82B\xC2\"\xA2b\xE2\x12\x92R\xD22\xB2r\xF2\n\x8AJ\xCA*\xAAj\xEA\x1A\x9AZ\xDA:\xBAz\xFA\x06\x86F\xC6&\xA6f\xE6\x16\x96V\xD66\xB6v\xF6\x0E\x8EN\xCE.\xAEn\xEE\x1E\x9E^\xDE>\xBE~\xFE\x01\x81A\xC1!\xA1a\xE1\x11\x91Q\xD11\xB1q\xF1\t\x89I\xC9)\xA9i\xE9\x19\x99Y\xD99\xB9y\xF9\x05\x85E\xC5%\xA5e\xE5\x15\x95U\xD55\xB5u\xF5\r\x8DM\xCD-\xADm\xED\x1D\x9D]\xDD=\xBD}\xFD\x03\x83C\xC3#\xA3c\xE3\x13\x93S\xD33\xB3s\xF3\v\x8BK\xCB+\xABk\xEB\x1B\x9B[\xDB;\xBB{\xFB\x07\x87G\xC7'\xA7g\xE7\x17\x97W\xD77\xB7w\xF7\x0F\x8FO\xCF/\xAFo\xEF\x1F\x9F_\xDF?\xBF\x7F\xFF".charCodeAt((x >>> 8 << 16 >>> 16)) << 16 >>> 16)) | ((("\x00\x80@\xC0 \xA0`\xE0\x10\x90P\xD00\xB0p\xF0\b\x88H\xC8(\xA8h\xE8\x18\x98X\xD88\xB8x\xF8\x04\x84D\xC4$\xA4d\xE4\x14\x94T\xD44\xB4t\xF4\f\x8CL\xCC,\xACl\xEC\x1C\x9C\\\xDC<\xBC|\xFC\x02\x82B\xC2\"\xA2b\xE2\x12\x92R\xD22\xB2r\xF2\n\x8AJ\xCA*\xAAj\xEA\x1A\x9AZ\xDA:\xBAz\xFA\x06\x86F\xC6&\xA6f\xE6\x16\x96V\xD66\xB6v\xF6\x0E\x8EN\xCE.\xAEn\xEE\x1E\x9E^\xDE>\xBE~\xFE\x01\x81A\xC1!\xA1a\xE1\x11\x91Q\xD11\xB1q\xF1\t\x89I\xC9)\xA9i\xE9\x19\x99Y\xD99\xB9y\xF9\x05\x85E\xC5%\xA5e\xE5\x15\x95U\xD55\xB5u\xF5\r\x8DM\xCD-\xADm\xED\x1D\x9D]\xDD=\xBD}\xFD\x03\x83C\xC3#\xA3c\xE3\x13\x93S\xD33\xB3s\xF3\v\x8BK\xCB+\xABk\xEB\x1B\x9B[\xDB;\xBB{\xFB\x07\x87G\xC7'\xA7g\xE7\x17\x97W\xD77\xB7w\xF7\x0F\x8FO\xCF/\xAFo\xEF\x1F\x9F_\xDF?\xBF\x7F\xFF".charCodeAt(((x & 255) >>> 0)) << 16 >>> 16)) << 8 << 16 >>> 16)) >>> 0; }; $pkg.Reverse16 = Reverse16; Len = function(x) { var x; if (true) { return Len32(((x >>> 0))); } return Len64((new $Uint64(0, x))); }; $pkg.Len = Len; Len32 = function(x) { var n, x, y, y$1; n = 0; if (x >= 65536) { x = (y = (16), y < 32 ? (x >>> y) : 0) >>> 0; n = 16; } if (x >= 256) { x = (y$1 = (8), y$1 < 32 ? (x >>> y$1) : 0) >>> 0; n = n + (8) >> 0; } n = n + (("\x00\x01\x02\x02\x03\x03\x03\x03\x04\x04\x04\x04\x04\x04\x04\x04\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b".charCodeAt(x) >> 0)) >> 0; return n; }; $pkg.Len32 = Len32; Len64 = function(x) { var n, x; n = 0; if ((x.$high > 1 || (x.$high === 1 && x.$low >= 0))) { x = $shiftRightUint64(x, (32)); n = 32; } if ((x.$high > 0 || (x.$high === 0 && x.$low >= 65536))) { x = $shiftRightUint64(x, (16)); n = n + (16) >> 0; } if ((x.$high > 0 || (x.$high === 0 && x.$low >= 256))) { x = $shiftRightUint64(x, (8)); n = n + (8) >> 0; } n = n + (("\x00\x01\x02\x02\x03\x03\x03\x03\x04\x04\x04\x04\x04\x04\x04\x04\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b".charCodeAt($flatten64(x)) >> 0)) >> 0; return n; }; $pkg.Len64 = Len64; Add = function(x, y, carry) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, c32, c64, carry, carryOut, s32, s64, sum, x, y; sum = 0; carryOut = 0; if (true) { _tuple = Add32(((x >>> 0)), ((y >>> 0)), ((carry >>> 0))); s32 = _tuple[0]; c32 = _tuple[1]; _tmp = ((s32 >>> 0)); _tmp$1 = ((c32 >>> 0)); sum = _tmp; carryOut = _tmp$1; return [sum, carryOut]; } _tuple$1 = Add64((new $Uint64(0, x)), (new $Uint64(0, y)), (new $Uint64(0, carry))); s64 = _tuple$1[0]; c64 = _tuple$1[1]; _tmp$2 = ((s64.$low >>> 0)); _tmp$3 = ((c64.$low >>> 0)); sum = _tmp$2; carryOut = _tmp$3; return [sum, carryOut]; }; $pkg.Add = Add; Add64 = function(x, y, carry) { var carry, carryOut, sum, x, x$1, x$2, x$3, x$4, y; sum = new $Uint64(0, 0); carryOut = new $Uint64(0, 0); sum = (x$1 = new $Uint64(x.$high + y.$high, x.$low + y.$low), new $Uint64(x$1.$high + carry.$high, x$1.$low + carry.$low)); carryOut = $shiftRightUint64(((x$2 = new $Uint64(x.$high & y.$high, (x.$low & y.$low) >>> 0), x$3 = (x$4 = new $Uint64(x.$high | y.$high, (x.$low | y.$low) >>> 0), new $Uint64(x$4.$high & ~sum.$high, (x$4.$low & ~sum.$low) >>> 0)), new $Uint64(x$2.$high | x$3.$high, (x$2.$low | x$3.$low) >>> 0))), 63); return [sum, carryOut]; }; $pkg.Add64 = Add64; Sub = function(x, y, borrow) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, b32, b64, borrow, borrowOut, d32, d64, diff, x, y; diff = 0; borrowOut = 0; if (true) { _tuple = Sub32(((x >>> 0)), ((y >>> 0)), ((borrow >>> 0))); d32 = _tuple[0]; b32 = _tuple[1]; _tmp = ((d32 >>> 0)); _tmp$1 = ((b32 >>> 0)); diff = _tmp; borrowOut = _tmp$1; return [diff, borrowOut]; } _tuple$1 = Sub64((new $Uint64(0, x)), (new $Uint64(0, y)), (new $Uint64(0, borrow))); d64 = _tuple$1[0]; b64 = _tuple$1[1]; _tmp$2 = ((d64.$low >>> 0)); _tmp$3 = ((b64.$low >>> 0)); diff = _tmp$2; borrowOut = _tmp$3; return [diff, borrowOut]; }; $pkg.Sub = Sub; Sub32 = function(x, y, borrow) { var borrow, borrowOut, diff, x, y; diff = 0; borrowOut = 0; diff = (x - y >>> 0) - borrow >>> 0; borrowOut = (((((((~x >>> 0) & y) >>> 0)) | ((((~(((x ^ y) >>> 0)) >>> 0) & diff) >>> 0))) >>> 0)) >>> 31 >>> 0; return [diff, borrowOut]; }; $pkg.Sub32 = Sub32; Sub64 = function(x, y, borrow) { var borrow, borrowOut, diff, x, x$1, x$2, x$3, x$4, x$5, x$6, y; diff = new $Uint64(0, 0); borrowOut = new $Uint64(0, 0); diff = (x$1 = new $Uint64(x.$high - y.$high, x.$low - y.$low), new $Uint64(x$1.$high - borrow.$high, x$1.$low - borrow.$low)); borrowOut = $shiftRightUint64(((x$2 = (x$3 = new $Uint64(~x.$high, ~x.$low >>> 0), new $Uint64(x$3.$high & y.$high, (x$3.$low & y.$low) >>> 0)), x$4 = (x$5 = (x$6 = new $Uint64(x.$high ^ y.$high, (x.$low ^ y.$low) >>> 0), new $Uint64(~x$6.$high, ~x$6.$low >>> 0)), new $Uint64(x$5.$high & diff.$high, (x$5.$low & diff.$low) >>> 0)), new $Uint64(x$2.$high | x$4.$high, (x$2.$low | x$4.$low) >>> 0))), 63); return [diff, borrowOut]; }; $pkg.Sub64 = Sub64; Mul = function(x, y) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, h, h$1, hi, l, l$1, lo, x, y; hi = 0; lo = 0; if (true) { _tuple = Mul32(((x >>> 0)), ((y >>> 0))); h = _tuple[0]; l = _tuple[1]; _tmp = ((h >>> 0)); _tmp$1 = ((l >>> 0)); hi = _tmp; lo = _tmp$1; return [hi, lo]; } _tuple$1 = Mul64((new $Uint64(0, x)), (new $Uint64(0, y))); h$1 = _tuple$1[0]; l$1 = _tuple$1[1]; _tmp$2 = ((h$1.$low >>> 0)); _tmp$3 = ((l$1.$low >>> 0)); hi = _tmp$2; lo = _tmp$3; return [hi, lo]; }; $pkg.Mul = Mul; Mul64 = function(x, y) { var hi, lo, t, w0, w1, w2, x, x$1, x$2, x$3, x$4, x$5, x$6, x0, x1, y, y0, y1; hi = new $Uint64(0, 0); lo = new $Uint64(0, 0); x0 = new $Uint64(x.$high & 0, (x.$low & 4294967295) >>> 0); x1 = $shiftRightUint64(x, 32); y0 = new $Uint64(y.$high & 0, (y.$low & 4294967295) >>> 0); y1 = $shiftRightUint64(y, 32); w0 = $mul64(x0, y0); t = (x$1 = $mul64(x1, y0), x$2 = $shiftRightUint64(w0, 32), new $Uint64(x$1.$high + x$2.$high, x$1.$low + x$2.$low)); w1 = new $Uint64(t.$high & 0, (t.$low & 4294967295) >>> 0); w2 = $shiftRightUint64(t, 32); w1 = (x$3 = $mul64(x0, y1), new $Uint64(w1.$high + x$3.$high, w1.$low + x$3.$low)); hi = (x$4 = (x$5 = $mul64(x1, y1), new $Uint64(x$5.$high + w2.$high, x$5.$low + w2.$low)), x$6 = $shiftRightUint64(w1, 32), new $Uint64(x$4.$high + x$6.$high, x$4.$low + x$6.$low)); lo = $mul64(x, y); return [hi, lo]; }; $pkg.Mul64 = Mul64; Div = function(hi, lo, y) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, hi, lo, q, q$1, quo, r, r$1, rem, y; quo = 0; rem = 0; if (true) { _tuple = Div32(((hi >>> 0)), ((lo >>> 0)), ((y >>> 0))); q = _tuple[0]; r = _tuple[1]; _tmp = ((q >>> 0)); _tmp$1 = ((r >>> 0)); quo = _tmp; rem = _tmp$1; return [quo, rem]; } _tuple$1 = Div64((new $Uint64(0, hi)), (new $Uint64(0, lo)), (new $Uint64(0, y))); q$1 = _tuple$1[0]; r$1 = _tuple$1[1]; _tmp$2 = ((q$1.$low >>> 0)); _tmp$3 = ((r$1.$low >>> 0)); quo = _tmp$2; rem = _tmp$3; return [quo, rem]; }; $pkg.Div = Div; Div64 = function(hi, lo, y) { var _tmp, _tmp$1, hi, lo, q0, q1, quo, rem, rhat, s, un0, un1, un10, un21, un32, 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, y, yn0, yn1; quo = new $Uint64(0, 0); rem = new $Uint64(0, 0); if ((y.$high === 0 && y.$low === 0)) { $panic(divideError); } if ((y.$high < hi.$high || (y.$high === hi.$high && y.$low <= hi.$low))) { $panic(overflowError); } s = ((LeadingZeros64(y) >>> 0)); y = $shiftLeft64(y, (s)); yn1 = $shiftRightUint64(y, 32); yn0 = new $Uint64(y.$high & 0, (y.$low & 4294967295) >>> 0); un32 = (x = $shiftLeft64(hi, s), x$1 = $shiftRightUint64(lo, ((64 - s >>> 0))), new $Uint64(x.$high | x$1.$high, (x.$low | x$1.$low) >>> 0)); un10 = $shiftLeft64(lo, s); un1 = $shiftRightUint64(un10, 32); un0 = new $Uint64(un10.$high & 0, (un10.$low & 4294967295) >>> 0); q1 = $div64(un32, yn1, false); rhat = (x$2 = $mul64(q1, yn1), new $Uint64(un32.$high - x$2.$high, un32.$low - x$2.$low)); while (true) { if (!((q1.$high > 1 || (q1.$high === 1 && q1.$low >= 0)) || (x$3 = $mul64(q1, yn0), x$4 = (x$5 = $mul64(new $Uint64(1, 0), rhat), new $Uint64(x$5.$high + un1.$high, x$5.$low + un1.$low)), (x$3.$high > x$4.$high || (x$3.$high === x$4.$high && x$3.$low > x$4.$low))))) { break; } q1 = (x$6 = new $Uint64(0, 1), new $Uint64(q1.$high - x$6.$high, q1.$low - x$6.$low)); rhat = (x$7 = yn1, new $Uint64(rhat.$high + x$7.$high, rhat.$low + x$7.$low)); if ((rhat.$high > 1 || (rhat.$high === 1 && rhat.$low >= 0))) { break; } } un21 = (x$8 = (x$9 = $mul64(un32, new $Uint64(1, 0)), new $Uint64(x$9.$high + un1.$high, x$9.$low + un1.$low)), x$10 = $mul64(q1, y), new $Uint64(x$8.$high - x$10.$high, x$8.$low - x$10.$low)); q0 = $div64(un21, yn1, false); rhat = (x$11 = $mul64(q0, yn1), new $Uint64(un21.$high - x$11.$high, un21.$low - x$11.$low)); while (true) { if (!((q0.$high > 1 || (q0.$high === 1 && q0.$low >= 0)) || (x$12 = $mul64(q0, yn0), x$13 = (x$14 = $mul64(new $Uint64(1, 0), rhat), new $Uint64(x$14.$high + un0.$high, x$14.$low + un0.$low)), (x$12.$high > x$13.$high || (x$12.$high === x$13.$high && x$12.$low > x$13.$low))))) { break; } q0 = (x$15 = new $Uint64(0, 1), new $Uint64(q0.$high - x$15.$high, q0.$low - x$15.$low)); rhat = (x$16 = yn1, new $Uint64(rhat.$high + x$16.$high, rhat.$low + x$16.$low)); if ((rhat.$high > 1 || (rhat.$high === 1 && rhat.$low >= 0))) { break; } } _tmp = (x$17 = $mul64(q1, new $Uint64(1, 0)), new $Uint64(x$17.$high + q0.$high, x$17.$low + q0.$low)); _tmp$1 = $shiftRightUint64(((x$18 = (x$19 = $mul64(un21, new $Uint64(1, 0)), new $Uint64(x$19.$high + un0.$high, x$19.$low + un0.$low)), x$20 = $mul64(q0, y), new $Uint64(x$18.$high - x$20.$high, x$18.$low - x$20.$low))), s); quo = _tmp; rem = _tmp$1; return [quo, rem]; }; $pkg.Div64 = Div64; _err.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "RuntimeError", name: "RuntimeError", pkg: "", typ: $funcType([], [], 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: overflowError = new _err("runtime error: integer overflow"); divideError = new _err("runtime error: integer divide by zero"); deBruijn32tab = $toNativeArray($kindUint8, [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]); deBruijn64tab = $toNativeArray($kindUint8, [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]); /* */ } 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, bits, arrayType, arrayType$1, arrayType$2, structType, math, _zero, posInf, negInf, nan, buf, log2, Exp, Frexp, Inf, IsInf, IsNaN, Log, Log2, NaN, init, Float32bits, Float32frombits, Float64bits, Float64frombits, frexp, normalize, Abs; js = $packages["github.com/gopherjs/gopherjs/js"]; bits = $packages["math/bits"]; arrayType = $arrayType($Uint32, 2); arrayType$1 = $arrayType($Float32, 2); arrayType$2 = $arrayType($Float64, 1); structType = $structType("math", [{prop: "uint32array", name: "uint32array", embedded: false, exported: false, typ: arrayType, tag: ""}, {prop: "float32array", name: "float32array", embedded: false, exported: false, typ: arrayType$1, tag: ""}, {prop: "float64array", name: "float64array", embedded: false, exported: false, typ: arrayType$2, tag: ""}]); log2 = function(x) { var _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); }; Exp = function(x) { var x; return $parseFloat(math.exp(x)); }; $pkg.Exp = Exp; Frexp = function(f) { var _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 sign; if (sign >= 0) { return posInf; } else { return negInf; } }; $pkg.Inf = Inf; IsInf = function(f, sign) { var f, sign; if (f === posInf) { return sign >= 0; } if (f === negInf) { return sign <= 0; } return false; }; $pkg.IsInf = IsInf; IsNaN = function(f) { var f, is; is = false; is = !((f === f)); return is; }; $pkg.IsNaN = IsNaN; Log = function(x) { var x; if (!((x === x))) { return nan; } return $parseFloat(math.log(x)); }; $pkg.Log = Log; Log2 = function(x) { var x; return log2(x); }; $pkg.Log2 = Log2; NaN = function() { return nan; }; $pkg.NaN = NaN; init = function() { var 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 f; buf.float32array[0] = f; return buf.uint32array[0]; }; $pkg.Float32bits = Float32bits; Float32frombits = function(b) { var b; buf.uint32array[0] = b; return buf.float32array[0]; }; $pkg.Float32frombits = Float32frombits; Float64bits = function(f) { var 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 b; buf.uint32array[0] = ((b.$low >>> 0)); buf.uint32array[1] = (($shiftRightUint64(b, 32).$low >>> 0)); return buf.float64array[0]; }; $pkg.Float64frombits = Float64frombits; frexp = function(f) { var _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]; }; normalize = function(x) { var _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]; }; Abs = function(x) { var x, x$1; return Float64frombits((x$1 = Float64bits(x), new $Uint64(x$1.$high & ~2147483648, (x$1.$low & ~0) >>> 0))); }; $pkg.Abs = Abs; $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 = bits.$init(); /* */ $s = 2; case 2: 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()); math = $global.Math; _zero = 0; posInf = 1 / _zero; negInf = -1 / _zero; nan = 0 / _zero; init(); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["internal/abi"] = (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["internal/goexperiment"] = (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["internal/itoa"] = (function() { var $pkg = {}, $init, arrayType, sliceType, Itoa, Uitoa; arrayType = $arrayType($Uint8, 20); sliceType = $sliceType($Uint8); Itoa = function(val) { var val; if (val < 0) { return "-" + Uitoa(((-val >>> 0))); } return Uitoa(((val >>> 0))); }; $pkg.Itoa = Itoa; Uitoa = function(val) { var _q, buf, i, q, val; if (val === 0) { return "0"; } buf = arrayType.zero(); i = 19; while (true) { if (!(val >= 10)) { break; } q = (_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"), undefined) : buf[i] = ((((48 + val >>> 0) - (q * 10 >>> 0) >>> 0) << 24 >>> 24))); i = i - (1) >> 0; val = q; } ((i < 0 || i >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[i] = (((48 + val >>> 0) << 24 >>> 24))); return ($bytesToString($subslice(new sliceType(buf), i))); }; $pkg.Uitoa = Uitoa; $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["strconv"] = (function() { var $pkg = {}, $init, errors, js, bytealg, math, bits, utf8, floatInfo, decimalSlice, decimal, leftCheat, NumError, sliceType, sliceType$1, arrayType, sliceType$2, sliceType$3, sliceType$4, sliceType$5, sliceType$6, arrayType$1, arrayType$2, ptrType, arrayType$3, arrayType$4, arrayType$5, ptrType$1, ptrType$2, isPrint16, isNotPrint16, isPrint32, isNotPrint32, isGraphic, uint64pow10, float32info, float32info$24ptr, float64info, float64info$24ptr, detailedPowersOfTen, leftcheats, optimize, powtab, float64pow10, float32pow10, contains, quoteWith, appendQuotedWith, appendQuotedRuneWith, appendEscapedRune, Quote, AppendQuote, AppendQuoteToASCII, AppendQuoteRune, AppendQuoteRuneToASCII, CanBackquote, unhex, UnquoteChar, Unquote, unquote, bsearch16, bsearch32, IsPrint, isInGraphicList, FormatUint, FormatInt, AppendInt, AppendUint, small, formatBits, isPowerOfTwo, Itoa, Atoi, ryuFtoaFixed32, ryuFtoaFixed64, formatDecimal, ryuFtoaShortest, mulByLog2Log10, mulByLog10Log2, computeBounds, ryuDigits, ryuDigits32, mult64bitPow10, mult128bitPow10, divisibleByPower5, divmod1e9, FormatFloat, AppendFloat, genericFtoa, bigFtoa, formatDigits, roundShortest, fmtE, fmtF, fmtB, fmtX, min, max, eiselLemire64, eiselLemire32, digitZero, trim, rightShift, prefixIsLessThan, leftShift, shouldRoundUp, index, lower, syntaxError, rangeError, baseError, bitSizeError, ParseUint, ParseInt, underscoreOK, commonPrefixLenIgnoreCase, special, readFloat, atof64exact, atof32exact, atofHex, atof32, atof64, ParseFloat, parseFloatPrefix; errors = $packages["errors"]; js = $packages["github.com/gopherjs/gopherjs/js"]; bytealg = $packages["internal/bytealg"]; math = $packages["math"]; bits = $packages["math/bits"]; utf8 = $packages["unicode/utf8"]; floatInfo = $pkg.floatInfo = $newType(0, $kindStruct, "strconv.floatInfo", true, "strconv", false, 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", true, "strconv", false, 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_; }); decimal = $pkg.decimal = $newType(0, $kindStruct, "strconv.decimal", true, "strconv", false, function(d_, nd_, dp_, neg_, trunc_) { this.$val = this; if (arguments.length === 0) { this.d = arrayType$5.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", true, "strconv", false, function(delta_, cutoff_) { this.$val = this; if (arguments.length === 0) { this.delta = 0; this.cutoff = ""; return; } this.delta = delta_; this.cutoff = cutoff_; }); NumError = $pkg.NumError = $newType(0, $kindStruct, "strconv.NumError", true, "strconv", true, 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_; }); sliceType = $sliceType($Uint16); sliceType$1 = $sliceType($Uint32); arrayType = $arrayType($Uint64, 2); sliceType$2 = $sliceType(leftCheat); sliceType$3 = $sliceType($Int); sliceType$4 = $sliceType($Float64); sliceType$5 = $sliceType($Float32); sliceType$6 = $sliceType($Uint8); arrayType$1 = $arrayType($Uint8, 4); arrayType$2 = $arrayType($Uint8, 65); ptrType = $ptrType(floatInfo); arrayType$3 = $arrayType($Uint8, 32); arrayType$4 = $arrayType($Uint8, 24); arrayType$5 = $arrayType($Uint8, 800); ptrType$1 = $ptrType(NumError); ptrType$2 = $ptrType(decimal); contains = function(s, c) { var c, s; return !((index(s, c) === -1)); }; quoteWith = function(s, quote, ASCIIonly, graphicOnly) { var ASCIIonly, _q, graphicOnly, quote, s; return ($bytesToString(appendQuotedWith($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"))), s, quote, ASCIIonly, graphicOnly))); }; appendQuotedWith = function(buf, s, quote, ASCIIonly, graphicOnly) { var ASCIIonly, _tuple, buf, graphicOnly, nBuf, quote, r, s, width; if ((buf.$capacity - buf.$length >> 0) < s.length) { nBuf = $makeSlice(sliceType$6, buf.$length, (((buf.$length + 1 >> 0) + s.length >> 0) + 1 >> 0)); $copySlice(nBuf, buf); buf = nBuf; } 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 = $substring(s, width); continue; } buf = appendEscapedRune(buf, r, quote, ASCIIonly, graphicOnly); s = $substring(s, width); } buf = $append(buf, quote); return buf; }; appendQuotedRuneWith = function(buf, r, quote, ASCIIonly, graphicOnly) { var ASCIIonly, buf, graphicOnly, quote, r; buf = $append(buf, quote); if (!utf8.ValidRune(r)) { r = 65533; } buf = appendEscapedRune(buf, r, quote, ASCIIonly, graphicOnly); buf = $append(buf, quote); return buf; }; appendEscapedRune = function(buf, r, quote, ASCIIonly, graphicOnly) { var ASCIIonly, _1, buf, graphicOnly, n, quote, r, runeTmp, s, s$1; runeTmp = arrayType$1.zero(); if ((r === ((quote >> 0))) || (r === 92)) { buf = $append(buf, 92); buf = $append(buf, ((r << 24 >>> 24))); return buf; } if (ASCIIonly) { if (r < 128 && IsPrint(r)) { buf = $append(buf, ((r << 24 >>> 24))); return buf; } } 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)); return buf; } _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((((r << 24 >>> 24)) >>> 4 << 24 >>> 24))); buf = $append(buf, "0123456789abcdef".charCodeAt(((((r << 24 >>> 24)) & 15) >>> 0))); } else if (r > 1114111) { r = 65533; buf = $appendSlice(buf, "\\u"); s = 12; while (true) { if (!(s >= 0)) { break; } buf = $append(buf, "0123456789abcdef".charCodeAt((((r >> $min(((s >>> 0)), 31)) >> 0) & 15))); s = s - (4) >> 0; } } else if (r < 65536) { buf = $appendSlice(buf, "\\u"); s = 12; while (true) { if (!(s >= 0)) { break; } buf = $append(buf, "0123456789abcdef".charCodeAt((((r >> $min(((s >>> 0)), 31)) >> 0) & 15))); s = s - (4) >> 0; } } else { buf = $appendSlice(buf, "\\U"); s$1 = 28; 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; } } } return buf; }; Quote = function(s) { var s; return quoteWith(s, 34, false, false); }; $pkg.Quote = Quote; AppendQuote = function(dst, s) { var dst, s; return appendQuotedWith(dst, s, 34, false, false); }; $pkg.AppendQuote = AppendQuote; AppendQuoteToASCII = function(dst, s) { var dst, s; return appendQuotedWith(dst, s, 34, true, false); }; $pkg.AppendQuoteToASCII = AppendQuoteToASCII; AppendQuoteRune = function(dst, r) { var dst, r; return appendQuotedRuneWith(dst, r, 39, false, false); }; $pkg.AppendQuoteRune = AppendQuoteRune; AppendQuoteRuneToASCII = function(dst, r) { var dst, r; return appendQuotedRuneWith(dst, r, 39, true, false); }; $pkg.AppendQuoteRuneToASCII = AppendQuoteRuneToASCII; CanBackquote = function(s) { var _tuple, r, s, wid; while (true) { if (!(s.length > 0)) { break; } _tuple = utf8.DecodeRuneInString(s); r = _tuple[0]; wid = _tuple[1]; s = $substring(s, 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 _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 _1, _2, _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; if (s.length === 0) { err = $pkg.ErrSyntax; return [value, multibyte, tail, err]; } 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 = $substring(s, 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 = $substring(s, 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 = $substring(s, 2); switch (0) { default: _1 = c$1; if (_1 === (97)) { value = 7; } else if (_1 === (98)) { value = 8; } else if (_1 === (102)) { value = 12; } else if (_1 === (110)) { value = 10; } else if (_1 === (114)) { value = 13; } else if (_1 === (116)) { value = 9; } else if (_1 === (118)) { value = 11; } else if ((_1 === (120)) || (_1 === (117)) || (_1 === (85))) { n = 0; _2 = c$1; if (_2 === (120)) { n = 2; } else if (_2 === (117)) { n = 4; } else if (_2 === (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 = $substring(s, 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 ((_1 === (48)) || (_1 === (49)) || (_1 === (50)) || (_1 === (51)) || (_1 === (52)) || (_1 === (53)) || (_1 === (54)) || (_1 === (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 = $substring(s, 2); if (v$1 > 255) { err = $pkg.ErrSyntax; return [value, multibyte, tail, err]; } value = v$1; } else if (_1 === (92)) { value = 92; } else if ((_1 === (39)) || (_1 === (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 _tuple, err, out, rem, s; _tuple = unquote(s, true); out = _tuple[0]; rem = _tuple[1]; err = _tuple[2]; if (rem.length > 0) { return ["", $pkg.ErrSyntax]; } return [out, err]; }; $pkg.Unquote = Unquote; unquote = function(in$1, unescape) { var _1, _2, _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$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, arr, buf, buf$1, end, err, err$1, i, in$1, in0, multibyte, n, n$1, out, quote, r, r$1, rem, rem$1, unescape, valid; out = ""; rem = ""; err = $ifaceNil; if (in$1.length < 2) { _tmp = ""; _tmp$1 = in$1; _tmp$2 = $pkg.ErrSyntax; out = _tmp; rem = _tmp$1; err = _tmp$2; return [out, rem, err]; } quote = in$1.charCodeAt(0); end = index($substring(in$1, 1), quote); if (end < 0) { _tmp$3 = ""; _tmp$4 = in$1; _tmp$5 = $pkg.ErrSyntax; out = _tmp$3; rem = _tmp$4; err = _tmp$5; return [out, rem, err]; } end = end + (2) >> 0; _1 = quote; if (_1 === (96)) { if (!unescape) { out = $substring(in$1, 0, end); } else if (!contains($substring(in$1, 0, end), 13)) { out = $substring(in$1, 1, (end - 1 >> 0)); } else { buf = $makeSlice(sliceType$6, 0, (((end - 1 >> 0) - 1 >> 0) - 1 >> 0)); i = 1; while (true) { if (!(i < (end - 1 >> 0))) { break; } if (!((in$1.charCodeAt(i) === 13))) { buf = $append(buf, in$1.charCodeAt(i)); } i = i + (1) >> 0; } out = ($bytesToString(buf)); } _tmp$6 = out; _tmp$7 = $substring(in$1, end); _tmp$8 = $ifaceNil; out = _tmp$6; rem = _tmp$7; err = _tmp$8; return [out, rem, err]; } else if ((_1 === (34)) || (_1 === (39))) { if (!contains($substring(in$1, 0, end), 92) && !contains($substring(in$1, 0, end), 10)) { valid = false; _2 = quote; if (_2 === (34)) { valid = utf8.ValidString($substring(in$1, 1, (end - 1 >> 0))); } else if (_2 === (39)) { _tuple = utf8.DecodeRuneInString($substring(in$1, 1, (end - 1 >> 0))); r = _tuple[0]; n = _tuple[1]; valid = (((1 + n >> 0) + 1 >> 0) === end) && (!((r === 65533)) || !((n === 1))); } if (valid) { out = $substring(in$1, 0, end); if (unescape) { out = $substring(out, 1, (end - 1 >> 0)); } _tmp$9 = out; _tmp$10 = $substring(in$1, end); _tmp$11 = $ifaceNil; out = _tmp$9; rem = _tmp$10; err = _tmp$11; return [out, rem, err]; } } buf$1 = sliceType$6.nil; in0 = in$1; in$1 = $substring(in$1, 1); if (unescape) { buf$1 = $makeSlice(sliceType$6, 0, (_q = ($imul(3, end)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))); } while (true) { if (!(in$1.length > 0 && !((in$1.charCodeAt(0) === quote)))) { break; } _tuple$1 = UnquoteChar(in$1, quote); r$1 = _tuple$1[0]; multibyte = _tuple$1[1]; rem$1 = _tuple$1[2]; err$1 = _tuple$1[3]; if ((in$1.charCodeAt(0) === 10) || !($interfaceIsEqual(err$1, $ifaceNil))) { _tmp$12 = ""; _tmp$13 = in0; _tmp$14 = $pkg.ErrSyntax; out = _tmp$12; rem = _tmp$13; err = _tmp$14; return [out, rem, err]; } in$1 = rem$1; if (unescape) { if (r$1 < 128 || !multibyte) { buf$1 = $append(buf$1, ((r$1 << 24 >>> 24))); } else { arr = arrayType$1.zero(); n$1 = utf8.EncodeRune(new sliceType$6(arr), r$1); buf$1 = $appendSlice(buf$1, $subslice(new sliceType$6(arr), 0, n$1)); } } if (quote === 39) { break; } } if (!(in$1.length > 0 && (in$1.charCodeAt(0) === quote))) { _tmp$15 = ""; _tmp$16 = in0; _tmp$17 = $pkg.ErrSyntax; out = _tmp$15; rem = _tmp$16; err = _tmp$17; return [out, rem, err]; } in$1 = $substring(in$1, 1); if (unescape) { _tmp$18 = ($bytesToString(buf$1)); _tmp$19 = in$1; _tmp$20 = $ifaceNil; out = _tmp$18; rem = _tmp$19; err = _tmp$20; return [out, rem, err]; } _tmp$21 = $substring(in0, 0, (in0.length - in$1.length >> 0)); _tmp$22 = in$1; _tmp$23 = $ifaceNil; out = _tmp$21; rem = _tmp$22; err = _tmp$23; return [out, rem, err]; } else { _tmp$24 = ""; _tmp$25 = in$1; _tmp$26 = $pkg.ErrSyntax; out = _tmp$24; rem = _tmp$25; err = _tmp$26; return [out, rem, err]; } }; bsearch16 = function(a, x) { var _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 + (((j - i >> 0)) >> 1 >> 0) >> 0; if (((h < 0 || h >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + h]) < x) { i = h + 1 >> 0; } else { j = h; } } return i; }; bsearch32 = function(a, x) { var _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 + (((j - i >> 0)) >> 1 >> 0) >> 0; if (((h < 0 || h >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + h]) < x) { i = h + 1 >> 0; } else { j = h; } } return i; }; IsPrint = function(r) { var _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"), undefined) : isPrint.$array[isPrint.$offset + x])) || (x$1 = i | 1, ((x$1 < 0 || x$1 >= isPrint.$length) ? ($throwRuntimeError("index out of range"), undefined) : 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"), undefined) : 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"), undefined) : 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"), undefined) : 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"), undefined) : isNotPrint$1.$array[isNotPrint$1.$offset + j$1]) === ((r << 16 >>> 16)))); }; $pkg.IsPrint = IsPrint; isInGraphicList = function(r) { var 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"), undefined) : isGraphic.$array[isGraphic.$offset + i])); }; FormatUint = function(i, base) { var _tuple, base, i, s; if (true && (i.$high < 0 || (i.$high === 0 && i.$low < 100)) && (base === 10)) { return small(((i.$low >> 0))); } _tuple = formatBits(sliceType$6.nil, i, base, false, false); s = _tuple[1]; return s; }; $pkg.FormatUint = FormatUint; FormatInt = function(i, base) { var _tuple, base, i, s; if (true && (0 < i.$high || (0 === i.$high && 0 <= i.$low)) && (i.$high < 0 || (i.$high === 0 && i.$low < 100)) && (base === 10)) { return small((((i.$low + ((i.$high >> 31) * 4294967296)) >> 0))); } _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; AppendInt = function(dst, i, base) { var _tuple, base, dst, i; if (true && (0 < i.$high || (0 === i.$high && 0 <= i.$low)) && (i.$high < 0 || (i.$high === 0 && i.$low < 100)) && (base === 10)) { return $appendSlice(dst, small((((i.$low + ((i.$high >> 31) * 4294967296)) >> 0)))); } _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 _tuple, base, dst, i; if (true && (i.$high < 0 || (i.$high === 0 && i.$low < 100)) && (base === 10)) { return $appendSlice(dst, small(((i.$low >> 0)))); } _tuple = formatBits(dst, i, base, false, true); dst = _tuple[0]; return dst; }; $pkg.AppendUint = AppendUint; small = function(i) { var i; if (i < 10) { return $substring("0123456789abcdefghijklmnopqrstuvwxyz", i, (i + 1 >> 0)); } return $substring("00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899", ($imul(i, 2)), (($imul(i, 2)) + 2 >> 0)); }; formatBits = function(dst, u, base, neg, append_) { var _q, _q$1, _r, _r$1, a, append_, b, b$1, base, d, dst, i, is, is$1, is$2, j, m, neg, q, q$1, s, shift, u, us, us$1, x, x$1, x$2, x$3, x$4, x$5; d = sliceType$6.nil; s = ""; if (base < 2 || base > 36) { $panic(new $String("strconv: illegal AppendInt/FormatInt base")); } a = arrayType$2.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 >= 1000000000)))) { 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 = 4; while (true) { if (!(j > 0)) { break; } is = (_r = us % 100, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) * 2 >>> 0; us = (_q = us / (100), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); i = i - (2) >> 0; (x$1 = i + 1 >> 0, ((x$1 < 0 || x$1 >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[x$1] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt((is + 1 >>> 0)))); (x$2 = i + 0 >> 0, ((x$2 < 0 || x$2 >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[x$2] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt((is + 0 >>> 0)))); j = j - (1) >> 0; } i = i - (1) >> 0; ((i < 0 || i >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[i] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt(((us * 2 >>> 0) + 1 >>> 0))); u = q; } } us$1 = ((u.$low >>> 0)); while (true) { if (!(us$1 >= 100)) { break; } is$1 = (_r$1 = us$1 % 100, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) * 2 >>> 0; us$1 = (_q$1 = us$1 / (100), (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >>> 0 : $throwRuntimeError("integer divide by zero")); i = i - (2) >> 0; (x$3 = i + 1 >> 0, ((x$3 < 0 || x$3 >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[x$3] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt((is$1 + 1 >>> 0)))); (x$4 = i + 0 >> 0, ((x$4 < 0 || x$4 >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[x$4] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt((is$1 + 0 >>> 0)))); } is$2 = us$1 * 2 >>> 0; i = i - (1) >> 0; ((i < 0 || i >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[i] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt((is$2 + 1 >>> 0))); if (us$1 >= 10) { i = i - (1) >> 0; ((i < 0 || i >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[i] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt(is$2)); } } else if (isPowerOfTwo(base)) { shift = (((bits.TrailingZeros(((base >>> 0))) >>> 0)) & 7) >>> 0; b = (new $Uint64(0, base)); m = ((base >>> 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"), undefined) : a[i] = "0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt(((((u.$low >>> 0)) & m) >>> 0))); u = $shiftRightUint64(u, (shift)); } i = i - (1) >> 0; ((i < 0 || i >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : 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$1 = $div64(u, b$1, false); ((i < 0 || i >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[i] = "0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt((((x$5 = $mul64(q$1, b$1), new $Uint64(u.$high - x$5.$high, u.$low - x$5.$low)).$low >>> 0)))); u = q$1; } i = i - (1) >> 0; ((i < 0 || i >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[i] = "0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt(((u.$low >>> 0)))); } if (neg) { i = i - (1) >> 0; ((i < 0 || i >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : 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]; }; isPowerOfTwo = function(x) { var x; return (x & ((x - 1 >> 0))) === 0; }; Itoa = function(i) { var i; return $internalize(i.toString(), $String); }; $pkg.Itoa = Itoa; Atoi = function(s) { var floatval, i, jsValue, s, v; if (s.length === 0) { return [0, syntaxError("Atoi", s)]; } i = 0; while (true) { if (!(i < s.length)) { break; } v = s.charCodeAt(i); if (v < 48 || v > 57) { if (!((v === 43)) && !((v === 45))) { return [0, syntaxError("Atoi", s)]; } } i = i + (1) >> 0; } jsValue = $global.Number($externalize(s, $String), 10); if (!!!($global.isFinite(jsValue))) { return [0, syntaxError("Atoi", s)]; } floatval = $parseFloat(jsValue); if (floatval > 2.147483647e+09) { return [2147483647, rangeError("Atoi", s)]; } else if (floatval < -2.147483648e+09) { return [-2147483648, rangeError("Atoi", s)]; } return [$parseInt(jsValue) >> 0, $ifaceNil]; }; $pkg.Atoi = Atoi; ryuFtoaFixed32 = function(d, mant, exp, prec) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, d, d0, dexp2, dfrac, di, e2, exact, exp, extra, extraMask, mant, prec, q, roundUp, y, y$1, y$2, y$3, y$4, y$5, y$6; if (prec < 0) { $panic(new $String("ryuFtoaFixed32 called with negative prec")); } if (prec > 9) { $panic(new $String("ryuFtoaFixed32 called with prec > 9")); } if (mant === 0) { _tmp = 0; _tmp$1 = 0; d.nd = _tmp; d.dp = _tmp$1; return; } e2 = exp; b = bits.Len32(mant); if (b < 25) { mant = (y = ((((25 - b >> 0) >>> 0))), y < 32 ? (mant << y) : 0) >>> 0; e2 = e2 + (((b) - 25 >> 0)) >> 0; } q = (-mulByLog2Log10(e2 + 24 >> 0) + prec >> 0) - 1 >> 0; exact = q <= 27 && q >= 0; _tuple = mult64bitPow10(mant, e2, q); di = _tuple[0]; dexp2 = _tuple[1]; d0 = _tuple[2]; if (dexp2 >= 0) { $panic(new $String("not enough significant bits after mult64bitPow10")); } if (q < 0 && q >= -10 && divisibleByPower5((new $Uint64(0, mant)), -q)) { exact = true; d0 = true; } extra = ((-dexp2 >>> 0)); extraMask = ((((y$1 = extra, y$1 < 32 ? (1 << y$1) : 0) >>> 0) - 1 >>> 0)); _tmp$2 = (y$2 = extra, y$2 < 32 ? (di >>> y$2) : 0) >>> 0; _tmp$3 = (di & extraMask) >>> 0; di = _tmp$2; dfrac = _tmp$3; roundUp = false; if (exact) { roundUp = dfrac > ((y$3 = ((extra - 1 >>> 0)), y$3 < 32 ? (1 << y$3) : 0) >>> 0) || ((dfrac === ((y$4 = ((extra - 1 >>> 0)), y$4 < 32 ? (1 << y$4) : 0) >>> 0)) && !d0) || ((dfrac === ((y$5 = ((extra - 1 >>> 0)), y$5 < 32 ? (1 << y$5) : 0) >>> 0)) && d0 && (((di & 1) >>> 0) === 1)); } else { roundUp = ((y$6 = ((extra - 1 >>> 0)), y$6 < 32 ? (dfrac >>> y$6) : 0) >>> 0) === 1; } if (!((dfrac === 0))) { d0 = false; } formatDecimal(d, (new $Uint64(0, di)), !d0, roundUp, prec); d.dp = d.dp - (q) >> 0; }; ryuFtoaFixed64 = function(d, mant, exp, prec) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, d, d0, dexp2, dfrac, di, e2, exact, exp, extra, extraMask, mant, prec, q, roundUp, x, x$1, x$2, x$3, x$4, x$5; if (prec > 18) { $panic(new $String("ryuFtoaFixed64 called with prec > 18")); } if ((mant.$high === 0 && mant.$low === 0)) { _tmp = 0; _tmp$1 = 0; d.nd = _tmp; d.dp = _tmp$1; return; } e2 = exp; b = bits.Len64(mant); if (b < 55) { mant = $shiftLeft64(mant, (((55 - b >> 0) >>> 0))); e2 = e2 + (((b) - 55 >> 0)) >> 0; } q = (-mulByLog2Log10(e2 + 54 >> 0) + prec >> 0) - 1 >> 0; exact = q <= 55 && q >= 0; _tuple = mult128bitPow10(mant, e2, q); di = _tuple[0]; dexp2 = _tuple[1]; d0 = _tuple[2]; if (dexp2 >= 0) { $panic(new $String("not enough significant bits after mult128bitPow10")); } if (q < 0 && q >= -22 && divisibleByPower5(mant, -q)) { exact = true; d0 = true; } extra = ((-dexp2 >>> 0)); extraMask = ((x = $shiftLeft64(new $Uint64(0, 1), extra), new $Uint64(x.$high - 0, x.$low - 1))); _tmp$2 = $shiftRightUint64(di, extra); _tmp$3 = new $Uint64(di.$high & extraMask.$high, (di.$low & extraMask.$low) >>> 0); di = _tmp$2; dfrac = _tmp$3; roundUp = false; if (exact) { roundUp = (x$1 = $shiftLeft64(new $Uint64(0, 1), ((extra - 1 >>> 0))), (dfrac.$high > x$1.$high || (dfrac.$high === x$1.$high && dfrac.$low > x$1.$low))) || ((x$2 = $shiftLeft64(new $Uint64(0, 1), ((extra - 1 >>> 0))), (dfrac.$high === x$2.$high && dfrac.$low === x$2.$low)) && !d0) || ((x$3 = $shiftLeft64(new $Uint64(0, 1), ((extra - 1 >>> 0))), (dfrac.$high === x$3.$high && dfrac.$low === x$3.$low)) && d0 && (x$4 = new $Uint64(di.$high & 0, (di.$low & 1) >>> 0), (x$4.$high === 0 && x$4.$low === 1))); } else { roundUp = (x$5 = $shiftRightUint64(dfrac, ((extra - 1 >>> 0))), (x$5.$high === 0 && x$5.$low === 1)); } if (!((dfrac.$high === 0 && dfrac.$low === 0))) { d0 = false; } formatDecimal(d, di, !d0, roundUp, prec); d.dp = d.dp - (q) >> 0; }; formatDecimal = function(d, m, trunc, roundUp, prec) { var _q, _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, a, b, d, m, max$1, n, prec, roundUp, trimmed, trunc, v, v1, v2, x, x$1, x$10, x$11, x$12, x$13, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; max$1 = ((prec < 0 || prec >= uint64pow10.length) ? ($throwRuntimeError("index out of range"), undefined) : uint64pow10[prec]); trimmed = 0; while (true) { if (!((m.$high > max$1.$high || (m.$high === max$1.$high && m.$low >= max$1.$low)))) { break; } _tmp = $div64(m, new $Uint64(0, 10), false); _tmp$1 = $div64(m, new $Uint64(0, 10), true); a = _tmp; b = _tmp$1; m = a; trimmed = trimmed + (1) >> 0; if ((b.$high > 0 || (b.$high === 0 && b.$low > 5))) { roundUp = true; } else if ((b.$high < 0 || (b.$high === 0 && b.$low < 5))) { roundUp = false; } else { roundUp = trunc || (x = new $Uint64(m.$high & 0, (m.$low & 1) >>> 0), (x.$high === 0 && x.$low === 1)); } if (!((b.$high === 0 && b.$low === 0))) { trunc = true; } } if (roundUp) { m = (x$1 = new $Uint64(0, 1), new $Uint64(m.$high + x$1.$high, m.$low + x$1.$low)); } if ((m.$high > max$1.$high || (m.$high === max$1.$high && m.$low >= max$1.$low))) { m = $div64(m, (new $Uint64(0, 10)), false); trimmed = trimmed + (1) >> 0; } n = ((prec >>> 0)); d.nd = (prec); v = m; while (true) { if (!((v.$high > 0 || (v.$high === 0 && v.$low >= 100)))) { break; } _tmp$2 = new $Uint64(0, 0); _tmp$3 = new $Uint64(0, 0); v1 = _tmp$2; v2 = _tmp$3; if ((x$2 = $shiftRightUint64(v, 32), (x$2.$high === 0 && x$2.$low === 0))) { _tmp$4 = (new $Uint64(0, (_q = ((v.$low >>> 0)) / 100, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")))); _tmp$5 = (new $Uint64(0, (_r = ((v.$low >>> 0)) % 100, _r === _r ? _r : $throwRuntimeError("integer divide by zero")))); v1 = _tmp$4; v2 = _tmp$5; } else { _tmp$6 = $div64(v, new $Uint64(0, 100), false); _tmp$7 = $div64(v, new $Uint64(0, 100), true); v1 = _tmp$6; v2 = _tmp$7; } n = n - (2) >>> 0; (x$4 = d.d, x$5 = n + 1 >>> 0, ((x$5 < 0 || x$5 >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + x$5] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt($flatten64((x$3 = $mul64(new $Uint64(0, 2), v2), new $Uint64(x$3.$high + 0, x$3.$low + 1)))))); (x$7 = d.d, x$8 = n + 0 >>> 0, ((x$8 < 0 || x$8 >= x$7.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$7.$array[x$7.$offset + x$8] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt($flatten64((x$6 = $mul64(new $Uint64(0, 2), v2), new $Uint64(x$6.$high + 0, x$6.$low + 0)))))); v = v1; } if ((v.$high > 0 || (v.$high === 0 && v.$low > 0))) { n = n - (1) >>> 0; (x$10 = d.d, ((n < 0 || n >= x$10.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$10.$array[x$10.$offset + n] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt($flatten64((x$9 = $mul64(new $Uint64(0, 2), v), new $Uint64(x$9.$high + 0, x$9.$low + 1)))))); } if ((v.$high > 0 || (v.$high === 0 && v.$low >= 10))) { n = n - (1) >>> 0; (x$11 = d.d, ((n < 0 || n >= x$11.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$11.$array[x$11.$offset + n] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt($flatten64($mul64(new $Uint64(0, 2), v))))); } while (true) { if (!((x$12 = d.d, x$13 = d.nd - 1 >> 0, ((x$13 < 0 || x$13 >= x$12.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$12.$array[x$12.$offset + x$13])) === 48)) { break; } d.nd = d.nd - (1) >> 0; trimmed = trimmed + (1) >> 0; } d.dp = d.nd + trimmed >> 0; }; ryuFtoaShortest = function(d, mant, exp, flt) { var _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$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, c0, cup, d, dc, dc0, dc32, dl, dl0, dl32, du, du0, du32, e2, exp, extra, extraMask, flt, fracc, fracl, fracu, lok, mant, mc, ml, mu, q, uok, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8; if ((mant.$high === 0 && mant.$low === 0)) { _tmp = 0; _tmp$1 = 0; d.nd = _tmp; d.dp = _tmp$1; return; } if (exp <= 0 && bits.TrailingZeros64(mant) >= -exp) { mant = $shiftRightUint64(mant, (((-exp >>> 0)))); ryuDigits(d, mant, mant, mant, true, false); return; } _tuple = computeBounds(mant, exp, flt); ml = _tuple[0]; mc = _tuple[1]; mu = _tuple[2]; e2 = _tuple[3]; if (e2 === 0) { ryuDigits(d, ml, mc, mu, true, false); return; } q = mulByLog2Log10(-e2) + 1 >> 0; _tmp$2 = new $Uint64(0, 0); _tmp$3 = new $Uint64(0, 0); _tmp$4 = new $Uint64(0, 0); dl = _tmp$2; dc = _tmp$3; du = _tmp$4; _tmp$5 = false; _tmp$6 = false; _tmp$7 = false; dl0 = _tmp$5; dc0 = _tmp$6; du0 = _tmp$7; if (flt === float32info) { _tmp$8 = 0; _tmp$9 = 0; _tmp$10 = 0; dl32 = _tmp$8; dc32 = _tmp$9; du32 = _tmp$10; _tuple$1 = mult64bitPow10(((ml.$low >>> 0)), e2, q); dl32 = _tuple$1[0]; dl0 = _tuple$1[2]; _tuple$2 = mult64bitPow10(((mc.$low >>> 0)), e2, q); dc32 = _tuple$2[0]; dc0 = _tuple$2[2]; _tuple$3 = mult64bitPow10(((mu.$low >>> 0)), e2, q); du32 = _tuple$3[0]; e2 = _tuple$3[1]; du0 = _tuple$3[2]; _tmp$11 = (new $Uint64(0, dl32)); _tmp$12 = (new $Uint64(0, dc32)); _tmp$13 = (new $Uint64(0, du32)); dl = _tmp$11; dc = _tmp$12; du = _tmp$13; } else { _tuple$4 = mult128bitPow10(ml, e2, q); dl = _tuple$4[0]; dl0 = _tuple$4[2]; _tuple$5 = mult128bitPow10(mc, e2, q); dc = _tuple$5[0]; dc0 = _tuple$5[2]; _tuple$6 = mult128bitPow10(mu, e2, q); du = _tuple$6[0]; e2 = _tuple$6[1]; du0 = _tuple$6[2]; } if (e2 >= 0) { $panic(new $String("not enough significant bits after mult128bitPow10")); } if (q > 55) { _tmp$14 = false; _tmp$15 = false; _tmp$16 = false; dl0 = _tmp$14; dc0 = _tmp$15; du0 = _tmp$16; } if (q < 0 && q >= -24) { if (divisibleByPower5(ml, -q)) { dl0 = true; } if (divisibleByPower5(mc, -q)) { dc0 = true; } if (divisibleByPower5(mu, -q)) { du0 = true; } } extra = ((-e2 >>> 0)); extraMask = ((x = $shiftLeft64(new $Uint64(0, 1), extra), new $Uint64(x.$high - 0, x.$low - 1))); _tmp$17 = $shiftRightUint64(dl, extra); _tmp$18 = new $Uint64(dl.$high & extraMask.$high, (dl.$low & extraMask.$low) >>> 0); dl = _tmp$17; fracl = _tmp$18; _tmp$19 = $shiftRightUint64(dc, extra); _tmp$20 = new $Uint64(dc.$high & extraMask.$high, (dc.$low & extraMask.$low) >>> 0); dc = _tmp$19; fracc = _tmp$20; _tmp$21 = $shiftRightUint64(du, extra); _tmp$22 = new $Uint64(du.$high & extraMask.$high, (du.$low & extraMask.$low) >>> 0); du = _tmp$21; fracu = _tmp$22; uok = !du0 || (fracu.$high > 0 || (fracu.$high === 0 && fracu.$low > 0)); if (du0 && (fracu.$high === 0 && fracu.$low === 0)) { uok = (x$1 = new $Uint64(mant.$high & 0, (mant.$low & 1) >>> 0), (x$1.$high === 0 && x$1.$low === 0)); } if (!uok) { du = (x$2 = new $Uint64(0, 1), new $Uint64(du.$high - x$2.$high, du.$low - x$2.$low)); } cup = false; if (dc0) { cup = (x$3 = $shiftLeft64(new $Uint64(0, 1), ((extra - 1 >>> 0))), (fracc.$high > x$3.$high || (fracc.$high === x$3.$high && fracc.$low > x$3.$low))) || ((x$4 = $shiftLeft64(new $Uint64(0, 1), ((extra - 1 >>> 0))), (fracc.$high === x$4.$high && fracc.$low === x$4.$low)) && (x$5 = new $Uint64(dc.$high & 0, (dc.$low & 1) >>> 0), (x$5.$high === 0 && x$5.$low === 1))); } else { cup = (x$6 = $shiftRightUint64(fracc, ((extra - 1 >>> 0))), (x$6.$high === 0 && x$6.$low === 1)); } lok = dl0 && (fracl.$high === 0 && fracl.$low === 0) && ((x$7 = new $Uint64(mant.$high & 0, (mant.$low & 1) >>> 0), (x$7.$high === 0 && x$7.$low === 0))); if (!lok) { dl = (x$8 = new $Uint64(0, 1), new $Uint64(dl.$high + x$8.$high, dl.$low + x$8.$low)); } c0 = dc0 && (fracc.$high === 0 && fracc.$low === 0); ryuDigits(d, dl, dc, du, c0, cup); d.dp = d.dp - (q) >> 0; }; mulByLog2Log10 = function(x) { var x; return (($imul(x, 78913))) >> 18 >> 0; }; mulByLog10Log2 = function(x) { var x; return (($imul(x, 108853))) >> 15 >> 0; }; computeBounds = function(mant, exp, flt) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, central, e2, exp, flt, lower$1, mant, upper, x, x$1, x$2, x$3, x$4; lower$1 = new $Uint64(0, 0); central = new $Uint64(0, 0); upper = new $Uint64(0, 0); e2 = 0; if (!((x = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), (mant.$high === x.$high && mant.$low === x.$low))) || (exp === ((flt.bias + 1 >> 0) - ((flt.mantbits >> 0)) >> 0))) { _tmp = (x$1 = $mul64(new $Uint64(0, 2), mant), new $Uint64(x$1.$high - 0, x$1.$low - 1)); _tmp$1 = $mul64(new $Uint64(0, 2), mant); _tmp$2 = (x$2 = $mul64(new $Uint64(0, 2), mant), new $Uint64(x$2.$high + 0, x$2.$low + 1)); lower$1 = _tmp; central = _tmp$1; upper = _tmp$2; e2 = exp - 1 >> 0; return [lower$1, central, upper, e2]; } else { _tmp$3 = (x$3 = $mul64(new $Uint64(0, 4), mant), new $Uint64(x$3.$high - 0, x$3.$low - 1)); _tmp$4 = $mul64(new $Uint64(0, 4), mant); _tmp$5 = (x$4 = $mul64(new $Uint64(0, 4), mant), new $Uint64(x$4.$high + 0, x$4.$low + 2)); lower$1 = _tmp$3; central = _tmp$4; upper = _tmp$5; e2 = exp - 2 >> 0; return [lower$1, central, upper, e2]; } }; ryuDigits = function(d, lower$1, central, upper, c0, cup) { var _q, _r, _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, c0, central, chi, clo, cup, d, lhi, llo, lower$1, n, uhi, ulo, upper, v, v1, v2, x, x$1, x$2, x$3; _tuple = divmod1e9(lower$1); lhi = _tuple[0]; llo = _tuple[1]; _tuple$1 = divmod1e9(central); chi = _tuple$1[0]; clo = _tuple$1[1]; _tuple$2 = divmod1e9(upper); uhi = _tuple$2[0]; ulo = _tuple$2[1]; if (uhi === 0) { ryuDigits32(d, llo, clo, ulo, c0, cup, 8); } else if (lhi < uhi) { if (!((llo === 0))) { lhi = lhi + (1) >>> 0; } c0 = c0 && (clo === 0); cup = (clo > 500000000) || ((clo === 500000000) && cup); ryuDigits32(d, lhi, chi, uhi, c0, cup, 8); d.dp = d.dp + (9) >> 0; } else { d.nd = 0; n = 9; v = chi; while (true) { if (!(v > 0)) { break; } _tmp = (_q = v / 10, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); _tmp$1 = (_r = v % 10, _r === _r ? _r : $throwRuntimeError("integer divide by zero")); v1 = _tmp; v2 = _tmp$1; v = v1; n = n - (1) >>> 0; (x = d.d, ((n < 0 || n >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + n] = (((v2 + 48 >>> 0) << 24 >>> 24)))); } d.d = $subslice(d.d, n); d.nd = (((9 - n >>> 0) >> 0)); ryuDigits32(d, llo, clo, ulo, c0, cup, d.nd + 8 >> 0); } while (true) { if (!(d.nd > 0 && ((x$1 = d.d, x$2 = d.nd - 1 >> 0, ((x$2 < 0 || x$2 >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + x$2])) === 48))) { break; } d.nd = d.nd - (1) >> 0; } while (true) { if (!(d.nd > 0 && ((x$3 = d.d, (0 >= x$3.$length ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + 0])) === 48))) { break; } d.nd = d.nd - (1) >> 0; d.dp = d.dp - (1) >> 0; d.d = $subslice(d.d, 1); } }; ryuDigits32 = function(d, lower$1, central, upper, c0, cup, endindex) { var _q, _q$1, _q$2, _q$3, _r, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, c, c0, cNextDigit, cdigit, central, cup, d, endindex, l, lower$1, n, trimmed, u, upper, v, v1, v2, x, x$1, x$2, x$3; if (upper === 0) { d.dp = endindex + 1 >> 0; return; } trimmed = 0; cNextDigit = 0; while (true) { if (!(upper > 0)) { break; } l = (_q = ((lower$1 + 9 >>> 0)) / 10, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); _tmp = (_q$1 = central / 10, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >>> 0 : $throwRuntimeError("integer divide by zero")); _tmp$1 = (_r = central % 10, _r === _r ? _r : $throwRuntimeError("integer divide by zero")); c = _tmp; cdigit = _tmp$1; u = (_q$2 = upper / 10, (_q$2 === _q$2 && _q$2 !== 1/0 && _q$2 !== -1/0) ? _q$2 >>> 0 : $throwRuntimeError("integer divide by zero")); if (l > u) { break; } if ((l === (c + 1 >>> 0)) && c < u) { c = c + (1) >>> 0; cdigit = 0; cup = false; } trimmed = trimmed + (1) >> 0; c0 = c0 && (cNextDigit === 0); cNextDigit = ((cdigit >> 0)); _tmp$2 = l; _tmp$3 = c; _tmp$4 = u; lower$1 = _tmp$2; central = _tmp$3; upper = _tmp$4; } if (trimmed > 0) { cup = cNextDigit > 5 || ((cNextDigit === 5) && !c0) || ((cNextDigit === 5) && c0 && (((central & 1) >>> 0) === 1)); } if (central < upper && cup) { central = central + (1) >>> 0; } endindex = endindex - (trimmed) >> 0; v = central; n = endindex; while (true) { if (!(n > d.nd)) { break; } _tmp$5 = (_q$3 = v / 100, (_q$3 === _q$3 && _q$3 !== 1/0 && _q$3 !== -1/0) ? _q$3 >>> 0 : $throwRuntimeError("integer divide by zero")); _tmp$6 = (_r$1 = v % 100, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")); v1 = _tmp$5; v2 = _tmp$6; (x = d.d, ((n < 0 || n >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + n] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt((($imul(2, v2) >>> 0) + 1 >>> 0)))); (x$1 = d.d, x$2 = n - 1 >> 0, ((x$2 < 0 || x$2 >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + x$2] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt((($imul(2, v2) >>> 0) + 0 >>> 0)))); n = n - (2) >> 0; v = v1; } if (n === d.nd) { (x$3 = d.d, ((n < 0 || n >= x$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + n] = (((v + 48 >>> 0) << 24 >>> 24)))); } d.nd = endindex + 1 >> 0; d.dp = d.nd + trimmed >> 0; }; mult64bitPow10 = function(m, e2, q) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, e2, exact, hi, lo, m, pow, q, resE, resM, x, x$1, x$2, x$3, x$4; resM = 0; resE = 0; exact = false; if (q === 0) { _tmp = m << 6 >>> 0; _tmp$1 = e2 - 6 >> 0; _tmp$2 = true; resM = _tmp; resE = _tmp$1; exact = _tmp$2; return [resM, resE, exact]; } if (q < -348 || 347 < q) { $panic(new $String("mult64bitPow10: power of 10 is out of range")); } pow = (x = q - -348 >> 0, ((x < 0 || x >= detailedPowersOfTen.length) ? ($throwRuntimeError("index out of range"), undefined) : detailedPowersOfTen[x]))[1]; if (q < 0) { pow = (x$1 = new $Uint64(0, 1), new $Uint64(pow.$high + x$1.$high, pow.$low + x$1.$low)); } _tuple = bits.Mul64((new $Uint64(0, m)), pow); hi = _tuple[0]; lo = _tuple[1]; e2 = e2 + (((mulByLog10Log2(q) - 63 >> 0) + 57 >> 0)) >> 0; _tmp$3 = (((x$2 = $shiftLeft64(hi, 7), x$3 = $shiftRightUint64(lo, 57), new $Uint64(x$2.$high | x$3.$high, (x$2.$low | x$3.$low) >>> 0)).$low >>> 0)); _tmp$4 = e2; _tmp$5 = (x$4 = $shiftLeft64(lo, 7), (x$4.$high === 0 && x$4.$low === 0)); resM = _tmp$3; resE = _tmp$4; exact = _tmp$5; return [resM, resE, exact]; }; mult128bitPow10 = function(m, e2, q) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, _tuple$1, _tuple$2, carry, e2, exact, h0, h1, l0, l1, m, mid, pow, q, resE, resM, x, x$1, x$2, x$3, x$4, x$5, x$6; resM = new $Uint64(0, 0); resE = 0; exact = false; if (q === 0) { _tmp = $shiftLeft64(m, 8); _tmp$1 = e2 - 8 >> 0; _tmp$2 = true; resM = _tmp; resE = _tmp$1; exact = _tmp$2; return [resM, resE, exact]; } if (q < -348 || 347 < q) { $panic(new $String("mult128bitPow10: power of 10 is out of range")); } pow = $clone((x = q - -348 >> 0, ((x < 0 || x >= detailedPowersOfTen.length) ? ($throwRuntimeError("index out of range"), undefined) : detailedPowersOfTen[x])), arrayType); if (q < 0) { pow[0] = (x$1 = pow[0], x$2 = new $Uint64(0, 1), new $Uint64(x$1.$high + x$2.$high, x$1.$low + x$2.$low)); } e2 = e2 + (((mulByLog10Log2(q) - 127 >> 0) + 119 >> 0)) >> 0; _tuple = bits.Mul64(m, pow[0]); l1 = _tuple[0]; l0 = _tuple[1]; _tuple$1 = bits.Mul64(m, pow[1]); h1 = _tuple$1[0]; h0 = _tuple$1[1]; _tuple$2 = bits.Add64(l1, h0, new $Uint64(0, 0)); mid = _tuple$2[0]; carry = _tuple$2[1]; h1 = (x$3 = carry, new $Uint64(h1.$high + x$3.$high, h1.$low + x$3.$low)); _tmp$3 = (x$4 = $shiftLeft64(h1, 9), x$5 = $shiftRightUint64(mid, 55), new $Uint64(x$4.$high | x$5.$high, (x$4.$low | x$5.$low) >>> 0)); _tmp$4 = e2; _tmp$5 = (x$6 = $shiftLeft64(mid, 9), (x$6.$high === 0 && x$6.$low === 0)) && (l0.$high === 0 && l0.$low === 0); resM = _tmp$3; resE = _tmp$4; exact = _tmp$5; return [resM, resE, exact]; }; divisibleByPower5 = function(m, k) { var i, k, m, x; if ((m.$high === 0 && m.$low === 0)) { return true; } i = 0; while (true) { if (!(i < k)) { break; } if (!((x = $div64(m, new $Uint64(0, 5), true), (x.$high === 0 && x.$low === 0)))) { return false; } m = $div64(m, (new $Uint64(0, 5)), false); i = i + (1) >> 0; } return true; }; divmod1e9 = function(x) { var _tuple, hi, q, x, x$1; if (false) { return [(($div64(x, new $Uint64(0, 1000000000), false).$low >>> 0)), (($div64(x, new $Uint64(0, 1000000000), true).$low >>> 0))]; } _tuple = bits.Mul64($shiftRightUint64(x, 1), new $Uint64(2305843009, 917808536)); hi = _tuple[0]; q = $shiftRightUint64(hi, 28); return [((q.$low >>> 0)), (((x$1 = $mul64(q, new $Uint64(0, 1000000000)), new $Uint64(x.$high - x$1.$high, x.$low - x$1.$low)).$low >>> 0))]; }; FormatFloat = function(f, fmt, prec, bitSize) { var 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 bitSize, dst, f, fmt, prec; return genericFtoa(dst, f, fmt, prec, bitSize); }; $pkg.AppendFloat = AppendFloat; genericFtoa = function(dst, val, fmt, prec, bitSize) { var _1, _2, _3, _4, bitSize, bits$1, buf, buf$1, digits, digs, dst, exp, flt, fmt, mant, neg, ok, prec, s, shortest, val, x, x$1, x$2, x$3, y, y$1; bits$1 = new $Uint64(0, 0); flt = ptrType.nil; _1 = bitSize; if (_1 === (32)) { bits$1 = (new $Uint64(0, math.Float32bits(($fround(val))))); flt = float32info; } else if (_1 === (64)) { bits$1 = math.Float64bits(val); flt = float64info; } else { $panic(new $String("strconv: illegal AppendFloat/FormatFloat bitSize")); } neg = !((x = $shiftRightUint64(bits$1, ((flt.expbits + flt.mantbits >>> 0))), (x.$high === 0 && x.$low === 0))); exp = (($shiftRightUint64(bits$1, 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$1.$high & x$1.$high, (bits$1.$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 ((fmt === 120) || (fmt === 88)) { return fmtX(dst, prec, fmt, 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) { buf = arrayType$3.zero(); digs.d = new sliceType$6(buf); ryuFtoaShortest(digs, mant, exp - ((flt.mantbits >> 0)) >> 0, flt); ok = true; _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; } buf$1 = arrayType$4.zero(); if ((bitSize === 32) && digits <= 9) { digs.d = new sliceType$6(buf$1); ryuFtoaFixed32(digs, ((mant.$low >>> 0)), exp - ((flt.mantbits >> 0)) >> 0, digits); ok = true; } else if (digits <= 18) { digs.d = new sliceType$6(buf$1); ryuFtoaFixed64(digs, mant, exp - ((flt.mantbits >> 0)) >> 0, digits); ok = true; } } if (!ok) { return bigFtoa(dst, prec, fmt, neg, mant, exp, flt); } return formatDigits(dst, shortest, neg, $clone(digs, decimalSlice), prec, fmt); }; bigFtoa = function(dst, prec, fmt, neg, mant, exp, flt) { var _1, _2, d, digs, dst, exp, flt, fmt, mant, neg, prec, shortest; d = new decimal.ptr(arrayType$5.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)); _1 = fmt; if ((_1 === (101)) || (_1 === (69))) { prec = digs.nd - 1 >> 0; } else if (_1 === (102)) { prec = max(digs.nd - digs.dp >> 0, 0); } else if ((_1 === (103)) || (_1 === (71))) { prec = digs.nd; } } else { _2 = fmt; if ((_2 === (101)) || (_2 === (69))) { d.Round(prec + 1 >> 0); } else if (_2 === (102)) { d.Round(d.dp + prec >> 0); } else if ((_2 === (103)) || (_2 === (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, $clone(digs, decimalSlice), prec, fmt); }; formatDigits = function(dst, shortest, neg, digs, prec, fmt) { var _1, digs, dst, eprec, exp, fmt, neg, prec, shortest; _1 = fmt; if ((_1 === (101)) || (_1 === (69))) { return fmtE(dst, neg, $clone(digs, decimalSlice), prec, fmt); } else if (_1 === (102)) { return fmtF(dst, neg, $clone(digs, decimalSlice), prec); } else if ((_1 === (103)) || (_1 === (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, $clone(digs, decimalSlice), prec - 1 >> 0, (fmt + 101 << 24 >>> 24) - 103 << 24 >>> 24); } if (prec > digs.dp) { prec = digs.nd; } return fmtF(dst, neg, $clone(digs, decimalSlice), max(prec - digs.dp >> 0, 0)); } return $append(dst, 37, fmt); }; roundShortest = function(d, mant, exp, flt) { var d, exp, explo, flt, inclusive, l, li, lower$1, m, mant, mantlo, mi, minexp, okdown, okup, u, ui, upper, upperdelta, 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$5.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$1 = new decimal.ptr(arrayType$5.zero(), 0, 0, false, false); lower$1.Assign((x$3 = $mul64(mantlo, new $Uint64(0, 2)), new $Uint64(x$3.$high + 0, x$3.$low + 1))); lower$1.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)); upperdelta = 0; ui = 0; while (true) { mi = (ui - upper.dp >> 0) + d.dp >> 0; if (mi >= d.nd) { break; } li = (ui - upper.dp >> 0) + lower$1.dp >> 0; l = 48; if (li >= 0 && li < lower$1.nd) { l = (x$5 = lower$1.d, ((li < 0 || li >= x$5.length) ? ($throwRuntimeError("index out of range"), undefined) : x$5[li])); } m = 48; if (mi >= 0) { m = (x$6 = d.d, ((mi < 0 || mi >= x$6.length) ? ($throwRuntimeError("index out of range"), undefined) : x$6[mi])); } u = 48; if (ui < upper.nd) { u = (x$7 = upper.d, ((ui < 0 || ui >= x$7.length) ? ($throwRuntimeError("index out of range"), undefined) : x$7[ui])); } okdown = !((l === m)) || inclusive && ((li + 1 >> 0) === lower$1.nd); if ((upperdelta === 0) && (m + 1 << 24 >>> 24) < u) { upperdelta = 2; } else if ((upperdelta === 0) && !((m === u))) { upperdelta = 1; } else if ((upperdelta === 1) && (!((m === 57)) || !((u === 48)))) { upperdelta = 2; } okup = upperdelta > 0 && (inclusive || upperdelta > 1 || (ui + 1 >> 0) < upper.nd); if (okdown && okup) { d.Round(mi + 1 >> 0); return; } else if (okdown) { d.RoundDown(mi + 1 >> 0); return; } else if (okup) { d.RoundUp(mi + 1 >> 0); return; } ui = ui + (1) >> 0; } }; fmtE = function(dst, neg, d, prec, fmt) { var _q, _q$1, _q$2, _r, _r$1, _r$2, ch, d, dst, exp, fmt, i, m, neg, prec, x; if (neg) { dst = $append(dst, 45); } ch = 48; if (!((d.nd === 0))) { ch = (x = d.d, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : 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 ch, d, dst, i, j, m, neg, prec, x; 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"), undefined) : x.$array[x.$offset + j])); } dst = $append(dst, ch); i = i + (1) >> 0; } } return dst; }; fmtB = function(dst, neg, mant, exp, flt) { var _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; }; fmtX = function(dst, prec, fmt, neg, mant, exp, flt) { var _q, _q$1, _q$2, _q$3, _q$4, _q$5, _r, _r$1, _r$2, _r$3, _r$4, _r$5, ch, dst, exp, extra, flt, fmt, hex, i, mant, neg, prec, shift, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8; if ((mant.$high === 0 && mant.$low === 0)) { exp = 0; } mant = $shiftLeft64(mant, ((60 - flt.mantbits >>> 0))); while (true) { if (!(!((mant.$high === 0 && mant.$low === 0)) && (x = new $Uint64(mant.$high & 268435456, (mant.$low & 0) >>> 0), (x.$high === 0 && x.$low === 0)))) { break; } mant = $shiftLeft64(mant, (1)); exp = exp - (1) >> 0; } if (prec >= 0 && prec < 15) { shift = ((($imul(prec, 4)) >>> 0)); extra = (x$1 = $shiftLeft64(mant, shift), new $Uint64(x$1.$high & 268435455, (x$1.$low & 4294967295) >>> 0)); mant = $shiftRightUint64(mant, ((60 - shift >>> 0))); if ((x$2 = (x$3 = new $Uint64(mant.$high & 0, (mant.$low & 1) >>> 0), new $Uint64(extra.$high | x$3.$high, (extra.$low | x$3.$low) >>> 0)), (x$2.$high > 134217728 || (x$2.$high === 134217728 && x$2.$low > 0)))) { mant = (x$4 = new $Uint64(0, 1), new $Uint64(mant.$high + x$4.$high, mant.$low + x$4.$low)); } mant = $shiftLeft64(mant, ((60 - shift >>> 0))); if (!((x$5 = new $Uint64(mant.$high & 536870912, (mant.$low & 0) >>> 0), (x$5.$high === 0 && x$5.$low === 0)))) { mant = $shiftRightUint64(mant, (1)); exp = exp + (1) >> 0; } } hex = "0123456789abcdef"; if (fmt === 88) { hex = "0123456789ABCDEF"; } if (neg) { dst = $append(dst, 45); } dst = $append(dst, 48, fmt, 48 + (((x$6 = $shiftRightUint64(mant, 60), new $Uint64(x$6.$high & 0, (x$6.$low & 1) >>> 0)).$low << 24 >>> 24)) << 24 >>> 24); mant = $shiftLeft64(mant, (4)); if (prec < 0 && !((mant.$high === 0 && mant.$low === 0))) { dst = $append(dst, 46); while (true) { if (!(!((mant.$high === 0 && mant.$low === 0)))) { break; } dst = $append(dst, hex.charCodeAt($flatten64((x$7 = $shiftRightUint64(mant, 60), new $Uint64(x$7.$high & 0, (x$7.$low & 15) >>> 0))))); mant = $shiftLeft64(mant, (4)); } } else if (prec > 0) { dst = $append(dst, 46); i = 0; while (true) { if (!(i < prec)) { break; } dst = $append(dst, hex.charCodeAt($flatten64((x$8 = $shiftRightUint64(mant, 60), new $Uint64(x$8.$high & 0, (x$8.$low & 15) >>> 0))))); mant = $shiftLeft64(mant, (4)); i = i + (1) >> 0; } } ch = 80; if (fmt === lower(fmt)) { ch = 112; } dst = $append(dst, ch); if (exp < 0) { ch = 45; exp = -exp; } else { ch = 43; } dst = $append(dst, ch); 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 if (exp < 1000) { 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"))) % 10, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24)) + 48 << 24 >>> 24, (((_r$2 = exp % 10, _r$2 === _r$2 ? _r$2 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24)) + 48 << 24 >>> 24); } else { dst = $append(dst, (((_q$3 = exp / 1000, (_q$3 === _q$3 && _q$3 !== 1/0 && _q$3 !== -1/0) ? _q$3 >> 0 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24)) + 48 << 24 >>> 24, (_r$3 = (((_q$4 = exp / 100, (_q$4 === _q$4 && _q$4 !== 1/0 && _q$4 !== -1/0) ? _q$4 >> 0 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24)) % 10, _r$3 === _r$3 ? _r$3 : $throwRuntimeError("integer divide by zero")) + 48 << 24 >>> 24, (((_r$4 = ((_q$5 = exp / 10, (_q$5 === _q$5 && _q$5 !== 1/0 && _q$5 !== -1/0) ? _q$5 >> 0 : $throwRuntimeError("integer divide by zero"))) % 10, _r$4 === _r$4 ? _r$4 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24)) + 48 << 24 >>> 24, (((_r$5 = exp % 10, _r$5 === _r$5 ? _r$5 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24)) + 48 << 24 >>> 24); } return dst; }; min = function(a, b) { var a, b; if (a < b) { return a; } return b; }; max = function(a, b) { var a, b; if (a > b) { return a; } return b; }; eiselLemire64 = function(man, exp10, neg) { var _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, _tuple, _tuple$1, clz, exp10, f, man, mergedHi, mergedLo, msb, neg, ok, retBits, retExp2, retMantissa, 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, xHi, xLo, yHi, yLo; f = 0; ok = false; if ((man.$high === 0 && man.$low === 0)) { if (neg) { f = math.Float64frombits(new $Uint64(2147483648, 0)); } _tmp = f; _tmp$1 = true; f = _tmp; ok = _tmp$1; return [f, ok]; } if (exp10 < -348 || 347 < exp10) { _tmp$2 = 0; _tmp$3 = false; f = _tmp$2; ok = _tmp$3; return [f, ok]; } clz = bits.LeadingZeros64(man); man = $shiftLeft64(man, (((clz >>> 0)))); retExp2 = (x = (new $Uint64(0, (((($imul(217706, exp10)) >> 16 >> 0) + 64 >> 0) + 1023 >> 0))), x$1 = (new $Uint64(0, clz)), new $Uint64(x.$high - x$1.$high, x.$low - x$1.$low)); _tuple = bits.Mul64(man, (x$2 = exp10 - -348 >> 0, ((x$2 < 0 || x$2 >= detailedPowersOfTen.length) ? ($throwRuntimeError("index out of range"), undefined) : detailedPowersOfTen[x$2]))[1]); xHi = _tuple[0]; xLo = _tuple[1]; if ((x$3 = new $Uint64(xHi.$high & 0, (xHi.$low & 511) >>> 0), (x$3.$high === 0 && x$3.$low === 511)) && (x$4 = new $Uint64(xLo.$high + man.$high, xLo.$low + man.$low), (x$4.$high < man.$high || (x$4.$high === man.$high && x$4.$low < man.$low)))) { _tuple$1 = bits.Mul64(man, (x$5 = exp10 - -348 >> 0, ((x$5 < 0 || x$5 >= detailedPowersOfTen.length) ? ($throwRuntimeError("index out of range"), undefined) : detailedPowersOfTen[x$5]))[0]); yHi = _tuple$1[0]; yLo = _tuple$1[1]; _tmp$4 = xHi; _tmp$5 = new $Uint64(xLo.$high + yHi.$high, xLo.$low + yHi.$low); mergedHi = _tmp$4; mergedLo = _tmp$5; if ((mergedLo.$high < xLo.$high || (mergedLo.$high === xLo.$high && mergedLo.$low < xLo.$low))) { mergedHi = (x$6 = new $Uint64(0, 1), new $Uint64(mergedHi.$high + x$6.$high, mergedHi.$low + x$6.$low)); } if ((x$7 = new $Uint64(mergedHi.$high & 0, (mergedHi.$low & 511) >>> 0), (x$7.$high === 0 && x$7.$low === 511)) && (x$8 = new $Uint64(mergedLo.$high + 0, mergedLo.$low + 1), (x$8.$high === 0 && x$8.$low === 0)) && (x$9 = new $Uint64(yLo.$high + man.$high, yLo.$low + man.$low), (x$9.$high < man.$high || (x$9.$high === man.$high && x$9.$low < man.$low)))) { _tmp$6 = 0; _tmp$7 = false; f = _tmp$6; ok = _tmp$7; return [f, ok]; } _tmp$8 = mergedHi; _tmp$9 = mergedLo; xHi = _tmp$8; xLo = _tmp$9; } msb = $shiftRightUint64(xHi, 63); retMantissa = $shiftRightUint64(xHi, $flatten64((new $Uint64(msb.$high + 0, msb.$low + 9)))); retExp2 = (x$10 = new $Uint64(0 ^ msb.$high, (1 ^ msb.$low) >>> 0), new $Uint64(retExp2.$high - x$10.$high, retExp2.$low - x$10.$low)); if ((xLo.$high === 0 && xLo.$low === 0) && (x$11 = new $Uint64(xHi.$high & 0, (xHi.$low & 511) >>> 0), (x$11.$high === 0 && x$11.$low === 0)) && (x$12 = new $Uint64(retMantissa.$high & 0, (retMantissa.$low & 3) >>> 0), (x$12.$high === 0 && x$12.$low === 1))) { _tmp$10 = 0; _tmp$11 = false; f = _tmp$10; ok = _tmp$11; return [f, ok]; } retMantissa = (x$13 = new $Uint64(retMantissa.$high & 0, (retMantissa.$low & 1) >>> 0), new $Uint64(retMantissa.$high + x$13.$high, retMantissa.$low + x$13.$low)); retMantissa = $shiftRightUint64(retMantissa, (1)); if ((x$14 = $shiftRightUint64(retMantissa, 53), (x$14.$high > 0 || (x$14.$high === 0 && x$14.$low > 0)))) { retMantissa = $shiftRightUint64(retMantissa, (1)); retExp2 = (x$15 = new $Uint64(0, 1), new $Uint64(retExp2.$high + x$15.$high, retExp2.$low + x$15.$low)); } if ((x$16 = new $Uint64(retExp2.$high - 0, retExp2.$low - 1), (x$16.$high > 0 || (x$16.$high === 0 && x$16.$low >= 2046)))) { _tmp$12 = 0; _tmp$13 = false; f = _tmp$12; ok = _tmp$13; return [f, ok]; } retBits = (x$17 = $shiftLeft64(retExp2, 52), x$18 = new $Uint64(retMantissa.$high & 1048575, (retMantissa.$low & 4294967295) >>> 0), new $Uint64(x$17.$high | x$18.$high, (x$17.$low | x$18.$low) >>> 0)); if (neg) { retBits = (x$19 = new $Uint64(2147483648, 0), new $Uint64(retBits.$high | x$19.$high, (retBits.$low | x$19.$low) >>> 0)); } _tmp$14 = math.Float64frombits(retBits); _tmp$15 = true; f = _tmp$14; ok = _tmp$15; return [f, ok]; }; eiselLemire32 = function(man, exp10, neg) { var _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, _tuple, _tuple$1, clz, exp10, f, man, mergedHi, mergedLo, msb, neg, ok, retBits, retExp2, retMantissa, 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, xHi, xLo, yHi, yLo; f = 0; ok = false; if ((man.$high === 0 && man.$low === 0)) { if (neg) { f = math.Float32frombits(2147483648); } _tmp = f; _tmp$1 = true; f = _tmp; ok = _tmp$1; return [f, ok]; } if (exp10 < -348 || 347 < exp10) { _tmp$2 = 0; _tmp$3 = false; f = _tmp$2; ok = _tmp$3; return [f, ok]; } clz = bits.LeadingZeros64(man); man = $shiftLeft64(man, (((clz >>> 0)))); retExp2 = (x = (new $Uint64(0, (((($imul(217706, exp10)) >> 16 >> 0) + 64 >> 0) + 127 >> 0))), x$1 = (new $Uint64(0, clz)), new $Uint64(x.$high - x$1.$high, x.$low - x$1.$low)); _tuple = bits.Mul64(man, (x$2 = exp10 - -348 >> 0, ((x$2 < 0 || x$2 >= detailedPowersOfTen.length) ? ($throwRuntimeError("index out of range"), undefined) : detailedPowersOfTen[x$2]))[1]); xHi = _tuple[0]; xLo = _tuple[1]; if ((x$3 = new $Uint64(xHi.$high & 63, (xHi.$low & 4294967295) >>> 0), (x$3.$high === 63 && x$3.$low === 4294967295)) && (x$4 = new $Uint64(xLo.$high + man.$high, xLo.$low + man.$low), (x$4.$high < man.$high || (x$4.$high === man.$high && x$4.$low < man.$low)))) { _tuple$1 = bits.Mul64(man, (x$5 = exp10 - -348 >> 0, ((x$5 < 0 || x$5 >= detailedPowersOfTen.length) ? ($throwRuntimeError("index out of range"), undefined) : detailedPowersOfTen[x$5]))[0]); yHi = _tuple$1[0]; yLo = _tuple$1[1]; _tmp$4 = xHi; _tmp$5 = new $Uint64(xLo.$high + yHi.$high, xLo.$low + yHi.$low); mergedHi = _tmp$4; mergedLo = _tmp$5; if ((mergedLo.$high < xLo.$high || (mergedLo.$high === xLo.$high && mergedLo.$low < xLo.$low))) { mergedHi = (x$6 = new $Uint64(0, 1), new $Uint64(mergedHi.$high + x$6.$high, mergedHi.$low + x$6.$low)); } if ((x$7 = new $Uint64(mergedHi.$high & 63, (mergedHi.$low & 4294967295) >>> 0), (x$7.$high === 63 && x$7.$low === 4294967295)) && (x$8 = new $Uint64(mergedLo.$high + 0, mergedLo.$low + 1), (x$8.$high === 0 && x$8.$low === 0)) && (x$9 = new $Uint64(yLo.$high + man.$high, yLo.$low + man.$low), (x$9.$high < man.$high || (x$9.$high === man.$high && x$9.$low < man.$low)))) { _tmp$6 = 0; _tmp$7 = false; f = _tmp$6; ok = _tmp$7; return [f, ok]; } _tmp$8 = mergedHi; _tmp$9 = mergedLo; xHi = _tmp$8; xLo = _tmp$9; } msb = $shiftRightUint64(xHi, 63); retMantissa = $shiftRightUint64(xHi, $flatten64((new $Uint64(msb.$high + 0, msb.$low + 38)))); retExp2 = (x$10 = new $Uint64(0 ^ msb.$high, (1 ^ msb.$low) >>> 0), new $Uint64(retExp2.$high - x$10.$high, retExp2.$low - x$10.$low)); if ((xLo.$high === 0 && xLo.$low === 0) && (x$11 = new $Uint64(xHi.$high & 63, (xHi.$low & 4294967295) >>> 0), (x$11.$high === 0 && x$11.$low === 0)) && (x$12 = new $Uint64(retMantissa.$high & 0, (retMantissa.$low & 3) >>> 0), (x$12.$high === 0 && x$12.$low === 1))) { _tmp$10 = 0; _tmp$11 = false; f = _tmp$10; ok = _tmp$11; return [f, ok]; } retMantissa = (x$13 = new $Uint64(retMantissa.$high & 0, (retMantissa.$low & 1) >>> 0), new $Uint64(retMantissa.$high + x$13.$high, retMantissa.$low + x$13.$low)); retMantissa = $shiftRightUint64(retMantissa, (1)); if ((x$14 = $shiftRightUint64(retMantissa, 24), (x$14.$high > 0 || (x$14.$high === 0 && x$14.$low > 0)))) { retMantissa = $shiftRightUint64(retMantissa, (1)); retExp2 = (x$15 = new $Uint64(0, 1), new $Uint64(retExp2.$high + x$15.$high, retExp2.$low + x$15.$low)); } if ((x$16 = new $Uint64(retExp2.$high - 0, retExp2.$low - 1), (x$16.$high > 0 || (x$16.$high === 0 && x$16.$low >= 254)))) { _tmp$12 = 0; _tmp$13 = false; f = _tmp$12; ok = _tmp$13; return [f, ok]; } retBits = (x$17 = $shiftLeft64(retExp2, 23), x$18 = new $Uint64(retMantissa.$high & 0, (retMantissa.$low & 8388607) >>> 0), new $Uint64(x$17.$high | x$18.$high, (x$17.$low | x$18.$low) >>> 0)); if (neg) { retBits = (x$19 = new $Uint64(0, 2147483648), new $Uint64(retBits.$high | x$19.$high, (retBits.$low | x$19.$low) >>> 0)); } _tmp$14 = math.Float32frombits(((retBits.$low >>> 0))); _tmp$15 = true; f = _tmp$14; ok = _tmp$15; return [f, ok]; }; decimal.ptr.prototype.String = function() { var 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"), undefined) : buf.$array[buf.$offset + w] = 48); w = w + (1) >> 0; ((w < 0 || w >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : 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"), undefined) : 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 _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"), undefined) : dst.$array[dst.$offset + i] = 48); _i++; } return dst.$length; }; trim = function(a) { var 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"), undefined) : 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 a, buf, n, v, v1, x, x$1, x$2; a = this; buf = arrayType$4.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"), undefined) : 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"), undefined) : x$1[x$2] = ((n < 0 || n >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : 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 a, c, c$1, dig, dig$1, k, mask, n, r, w, x, x$1, x$2, x$3, y, y$1, y$2, y$3, y$4; 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"), undefined) : x[r])) >>> 0)); n = ((n * 10 >>> 0) + c >>> 0) - 48 >>> 0; r = r + (1) >> 0; } a.dp = a.dp - ((r - 1 >> 0)) >> 0; mask = (((y$2 = k, y$2 < 32 ? (1 << y$2) : 0) >>> 0)) - 1 >>> 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"), undefined) : x$1[r])) >>> 0)); dig = (y$3 = k, y$3 < 32 ? (n >>> y$3) : 0) >>> 0; n = (n & (mask)) >>> 0; (x$2 = a.d, ((w < 0 || w >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : 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 & (mask)) >>> 0; if (w < 800) { (x$3 = a.d, ((w < 0 || w >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : 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 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"), undefined) : b.$array[b.$offset + i]) === s.charCodeAt(i)))) { return ((i < 0 || i >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + i]) < s.charCodeAt(i); } i = i + (1) >> 0; } return false; }; leftShift = function(a, k) { var _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"), undefined) : 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"), undefined) : 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"), undefined) : 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"), undefined) : 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"), undefined) : 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 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 _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"), undefined) : 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"), undefined) : 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"), undefined) : x$3[nd])) >= 53; }; decimal.ptr.prototype.Round = function(nd) { var 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 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 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"), undefined) : x[i])); if (c < 57) { (x$2 = a.d, ((i < 0 || i >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i] = ((x$1 = a.d, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : 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 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"), undefined) : 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(); }; index = function(s, c) { var c, s; return bytealg.IndexByteString(s, c); }; lower = function(c) { var c; return (c | 32) >>> 0; }; NumError.ptr.prototype.Error = function() { var $24r, _r, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; } $24r = "strconv." + e.Func + ": " + "parsing " + Quote(e.Num) + ": " + _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: NumError.ptr.prototype.Error }; } $f.$24r = $24r; $f._r = _r; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; NumError.prototype.Error = function() { return this.$val.Error(); }; NumError.ptr.prototype.Unwrap = function() { var e; e = this; return e.Err; }; NumError.prototype.Unwrap = function() { return this.$val.Unwrap(); }; syntaxError = function(fn, str) { var fn, str; return new NumError.ptr(fn, str, $pkg.ErrSyntax); }; rangeError = function(fn, str) { var fn, str; return new NumError.ptr(fn, str, $pkg.ErrRange); }; baseError = function(fn, str, base) { var base, fn, str; return new NumError.ptr(fn, str, errors.New("invalid base " + Itoa(base))); }; bitSizeError = function(fn, str, bitSize) { var bitSize, fn, str; return new NumError.ptr(fn, str, errors.New("invalid bit size " + Itoa(bitSize))); }; ParseUint = function(s, base, bitSize) { var _1, _i, _ref, base, base0, bitSize, c, cutoff, d, maxVal, n, n1, s, s0, underscores, x, x$1, x$2; if (s === "") { return [new $Uint64(0, 0), syntaxError("ParseUint", s)]; } base0 = base === 0; s0 = s; if (2 <= base && base <= 36) { } else if ((base === 0)) { base = 10; if (s.charCodeAt(0) === 48) { if (s.length >= 3 && (lower(s.charCodeAt(1)) === 98)) { base = 2; s = $substring(s, 2); } else if (s.length >= 3 && (lower(s.charCodeAt(1)) === 111)) { base = 8; s = $substring(s, 2); } else if (s.length >= 3 && (lower(s.charCodeAt(1)) === 120)) { base = 16; s = $substring(s, 2); } else { base = 8; s = $substring(s, 1); } } } else { return [new $Uint64(0, 0), baseError("ParseUint", s0, base)]; } if (bitSize === 0) { bitSize = 32; } else if (bitSize < 0 || bitSize > 64) { return [new $Uint64(0, 0), bitSizeError("ParseUint", s0, bitSize)]; } cutoff = new $Uint64(0, 0); _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)); underscores = false; n = new $Uint64(0, 0); _ref = (new sliceType$6($stringToBytes(s))); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } c = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); d = 0; if ((c === 95) && base0) { underscores = true; _i++; continue; } else if (48 <= c && c <= 57) { d = c - 48 << 24 >>> 24; } else if (97 <= lower(c) && lower(c) <= 122) { d = (lower(c) - 97 << 24 >>> 24) + 10 << 24 >>> 24; } else { return [new $Uint64(0, 0), syntaxError("ParseUint", s0)]; } if (d >= ((base << 24 >>> 24))) { return [new $Uint64(0, 0), syntaxError("ParseUint", s0)]; } if ((n.$high > cutoff.$high || (n.$high === cutoff.$high && n.$low >= cutoff.$low))) { return [maxVal, rangeError("ParseUint", s0)]; } n = $mul64(n, ((new $Uint64(0, base)))); n1 = (x$2 = (new $Uint64(0, d)), 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))) { return [maxVal, rangeError("ParseUint", s0)]; } n = n1; _i++; } if (underscores && !underscoreOK(s0)) { return [new $Uint64(0, 0), syntaxError("ParseUint", s0)]; } return [n, $ifaceNil]; }; $pkg.ParseUint = ParseUint; ParseInt = function(s, base, bitSize) { var _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 (s === "") { _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 = $substring(s, 1); } else if (s.charCodeAt(0) === 45) { neg = true; s = $substring(s, 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$1).Err, $pkg.ErrRange))) { $assertType(err, ptrType$1).Func = "ParseInt"; $assertType(err, ptrType$1).Num = s0; _tmp$2 = new $Int64(0, 0); _tmp$3 = err; i = _tmp$2; err = _tmp$3; return [i, err]; } if (bitSize === 0) { bitSize = 32; } 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; underscoreOK = function(s) { var hex, i, s, saw; saw = 94; i = 0; if (s.length >= 1 && ((s.charCodeAt(0) === 45) || (s.charCodeAt(0) === 43))) { s = $substring(s, 1); } hex = false; if (s.length >= 2 && (s.charCodeAt(0) === 48) && ((lower(s.charCodeAt(1)) === 98) || (lower(s.charCodeAt(1)) === 111) || (lower(s.charCodeAt(1)) === 120))) { i = 2; saw = 48; hex = lower(s.charCodeAt(1)) === 120; } while (true) { if (!(i < s.length)) { break; } if (48 <= s.charCodeAt(i) && s.charCodeAt(i) <= 57 || hex && 97 <= lower(s.charCodeAt(i)) && lower(s.charCodeAt(i)) <= 102) { saw = 48; i = i + (1) >> 0; continue; } if (s.charCodeAt(i) === 95) { if (!((saw === 48))) { return false; } saw = 95; i = i + (1) >> 0; continue; } if (saw === 95) { return false; } saw = 33; i = i + (1) >> 0; } return !((saw === 95)); }; commonPrefixLenIgnoreCase = function(s, prefix) { var c, i, n, prefix, s; n = prefix.length; if (n > s.length) { n = s.length; } i = 0; while (true) { if (!(i < n)) { break; } c = s.charCodeAt(i); if (65 <= c && c <= 90) { c = c + (32) << 24 >>> 24; } if (!((c === prefix.charCodeAt(i)))) { return i; } i = i + (1) >> 0; } return n; }; special = function(s) { var _1, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, f, n, n$1, nsign, ok, s, sign; f = 0; n = 0; ok = false; if (s.length === 0) { _tmp = 0; _tmp$1 = 0; _tmp$2 = false; f = _tmp; n = _tmp$1; ok = _tmp$2; return [f, n, ok]; } sign = 1; nsign = 0; _1 = s.charCodeAt(0); if ((_1 === (43)) || (_1 === (45))) { if (s.charCodeAt(0) === 45) { sign = -1; } nsign = 1; s = $substring(s, 1); n$1 = commonPrefixLenIgnoreCase(s, "infinity"); if (3 < n$1 && n$1 < 8) { n$1 = 3; } if ((n$1 === 3) || (n$1 === 8)) { _tmp$3 = math.Inf(sign); _tmp$4 = nsign + n$1 >> 0; _tmp$5 = true; f = _tmp$3; n = _tmp$4; ok = _tmp$5; return [f, n, ok]; } } else if ((_1 === (105)) || (_1 === (73))) { n$1 = commonPrefixLenIgnoreCase(s, "infinity"); if (3 < n$1 && n$1 < 8) { n$1 = 3; } if ((n$1 === 3) || (n$1 === 8)) { _tmp$6 = math.Inf(sign); _tmp$7 = nsign + n$1 >> 0; _tmp$8 = true; f = _tmp$6; n = _tmp$7; ok = _tmp$8; return [f, n, ok]; } } else if ((_1 === (110)) || (_1 === (78))) { if (commonPrefixLenIgnoreCase(s, "nan") === 3) { _tmp$9 = math.NaN(); _tmp$10 = 3; _tmp$11 = true; f = _tmp$9; n = _tmp$10; ok = _tmp$11; return [f, n, ok]; } } _tmp$12 = 0; _tmp$13 = 0; _tmp$14 = false; f = _tmp$12; n = _tmp$13; ok = _tmp$14; return [f, n, ok]; }; decimal.ptr.prototype.set = function(s) { var 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) === 95)) { i = i + (1) >> 0; continue; } else 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"), undefined) : 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 && (lower(s.charCodeAt(i)) === 101)) { 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 || (s.charCodeAt(i) === 95)))) { break; } if (s.charCodeAt(i) === 95) { i = i + (1) >> 0; continue; } 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 _1, base, c, dp, e, esign, exp, expChar, hex, i, mantissa, maxMantDigits, nd, ndMant, neg, ok, s, sawdigits, sawdot, trunc, underscores, x, x$1; mantissa = new $Uint64(0, 0); exp = 0; neg = false; trunc = false; hex = false; i = 0; ok = false; underscores = false; if (i >= s.length) { return [mantissa, exp, neg, trunc, hex, i, ok]; } if ((s.charCodeAt(i) === 43)) { i = i + (1) >> 0; } else if ((s.charCodeAt(i) === 45)) { neg = true; i = i + (1) >> 0; } base = new $Uint64(0, 10); maxMantDigits = 19; expChar = 101; if ((i + 2 >> 0) < s.length && (s.charCodeAt(i) === 48) && (lower(s.charCodeAt((i + 1 >> 0))) === 120)) { base = new $Uint64(0, 16); maxMantDigits = 16; i = i + (2) >> 0; expChar = 112; hex = true; } sawdot = false; sawdigits = false; nd = 0; ndMant = 0; dp = 0; loop: while (true) { if (!(i < s.length)) { break; } c = s.charCodeAt(i); _1 = true; if (_1 === ((c === 95))) { underscores = true; i = i + (1) >> 0; continue; } else if (_1 === ((c === 46))) { if (sawdot) { break loop; } sawdot = true; dp = nd; i = i + (1) >> 0; continue; } else if (_1 === (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 < maxMantDigits) { mantissa = $mul64(mantissa, (base)); 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 (!((c === 48))) { trunc = true; } i = i + (1) >> 0; continue; } else if (_1 === ((base.$high === 0 && base.$low === 16) && 97 <= lower(c) && lower(c) <= 102)) { sawdigits = true; nd = nd + (1) >> 0; if (ndMant < maxMantDigits) { mantissa = $mul64(mantissa, (new $Uint64(0, 16))); mantissa = (x$1 = (new $Uint64(0, ((lower(c) - 97 << 24 >>> 24) + 10 << 24 >>> 24))), new $Uint64(mantissa.$high + x$1.$high, mantissa.$low + x$1.$low)); ndMant = ndMant + (1) >> 0; } else { trunc = true; } i = i + (1) >> 0; continue; } break; } if (!sawdigits) { return [mantissa, exp, neg, trunc, hex, i, ok]; } if (!sawdot) { dp = nd; } if ((base.$high === 0 && base.$low === 16)) { dp = $imul(dp, (4)); ndMant = $imul(ndMant, (4)); } if (i < s.length && (lower(s.charCodeAt(i)) === expChar)) { i = i + (1) >> 0; if (i >= s.length) { return [mantissa, exp, neg, trunc, hex, i, 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, hex, i, ok]; } e = 0; while (true) { if (!(i < s.length && (48 <= s.charCodeAt(i) && s.charCodeAt(i) <= 57 || (s.charCodeAt(i) === 95)))) { break; } if (s.charCodeAt(i) === 95) { underscores = true; i = i + (1) >> 0; continue; } if (e < 10000) { e = (($imul(e, 10)) + ((s.charCodeAt(i) >> 0)) >> 0) - 48 >> 0; } i = i + (1) >> 0; } dp = dp + (($imul(e, esign))) >> 0; } else if ((base.$high === 0 && base.$low === 16)) { return [mantissa, exp, neg, trunc, hex, i, ok]; } if (!((mantissa.$high === 0 && mantissa.$low === 0))) { exp = dp - ndMant >> 0; } if (underscores && !underscoreOK($substring(s, 0, i))) { return [mantissa, exp, neg, trunc, hex, i, ok]; } ok = true; return [mantissa, exp, neg, trunc, hex, i, ok]; }; decimal.ptr.prototype.floatBits = function(flt) { var _tmp, _tmp$1, b, bits$1, 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"), undefined) : 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"), undefined) : 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$1 = (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$1 = (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$1.$high | x$7.$high, (bits$1.$low | x$7.$low) >>> 0)); if (d.neg) { bits$1 = (x$8 = $shiftLeft64($shiftLeft64(new $Uint64(0, 1), flt.mantbits), flt.expbits), new $Uint64(bits$1.$high | x$8.$high, (bits$1.$low | x$8.$low) >>> 0)); } _tmp = bits$1; _tmp$1 = overflow; b = _tmp; overflow = _tmp$1; $s = -1; return [b, overflow]; /* */ } return; } }; decimal.prototype.floatBits = function(flt) { return this.$val.floatBits(flt); }; atof64exact = function(mantissa, exp, neg) { var _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"), undefined) : 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"), undefined) : 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"), undefined) : 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 _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"), undefined) : 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"), undefined) : 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"), undefined) : float32pow10.$array[float32pow10.$offset + x$2]))); _tmp$5 = true; f = _tmp$4; ok = _tmp$5; return [f, ok]; } return [f, ok]; }; atofHex = function(s, flt, mantissa, exp, neg, trunc) { var bits$1, err, exp, flt, mantissa, maxExp, minExp, neg, round, s, trunc, 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, y, y$1; maxExp = (((y = flt.expbits, y < 32 ? (1 << y) : 0) >> 0) + flt.bias >> 0) - 2 >> 0; minExp = flt.bias + 1 >> 0; exp = exp + (((flt.mantbits >> 0))) >> 0; while (true) { if (!(!((mantissa.$high === 0 && mantissa.$low === 0)) && (x = $shiftRightUint64(mantissa, ((flt.mantbits + 2 >>> 0))), (x.$high === 0 && x.$low === 0)))) { break; } mantissa = $shiftLeft64(mantissa, (1)); exp = exp - (1) >> 0; } if (trunc) { mantissa = (x$1 = new $Uint64(0, 1), new $Uint64(mantissa.$high | x$1.$high, (mantissa.$low | x$1.$low) >>> 0)); } while (true) { if (!(!((x$2 = $shiftRightUint64(mantissa, (((1 + flt.mantbits >>> 0) + 2 >>> 0))), (x$2.$high === 0 && x$2.$low === 0))))) { break; } mantissa = (x$3 = $shiftRightUint64(mantissa, 1), x$4 = new $Uint64(mantissa.$high & 0, (mantissa.$low & 1) >>> 0), new $Uint64(x$3.$high | x$4.$high, (x$3.$low | x$4.$low) >>> 0)); exp = exp + (1) >> 0; } while (true) { if (!((mantissa.$high > 0 || (mantissa.$high === 0 && mantissa.$low > 1)) && exp < (minExp - 2 >> 0))) { break; } mantissa = (x$5 = $shiftRightUint64(mantissa, 1), x$6 = new $Uint64(mantissa.$high & 0, (mantissa.$low & 1) >>> 0), new $Uint64(x$5.$high | x$6.$high, (x$5.$low | x$6.$low) >>> 0)); exp = exp + (1) >> 0; } round = new $Uint64(mantissa.$high & 0, (mantissa.$low & 3) >>> 0); mantissa = $shiftRightUint64(mantissa, (2)); round = (x$7 = new $Uint64(mantissa.$high & 0, (mantissa.$low & 1) >>> 0), new $Uint64(round.$high | x$7.$high, (round.$low | x$7.$low) >>> 0)); exp = exp + (2) >> 0; if ((round.$high === 0 && round.$low === 3)) { mantissa = (x$8 = new $Uint64(0, 1), new $Uint64(mantissa.$high + x$8.$high, mantissa.$low + x$8.$low)); if ((x$9 = $shiftLeft64(new $Uint64(0, 1), ((1 + flt.mantbits >>> 0))), (mantissa.$high === x$9.$high && mantissa.$low === x$9.$low))) { mantissa = $shiftRightUint64(mantissa, (1)); exp = exp + (1) >> 0; } } if ((x$10 = $shiftRightUint64(mantissa, flt.mantbits), (x$10.$high === 0 && x$10.$low === 0))) { exp = flt.bias; } err = $ifaceNil; if (exp > maxExp) { mantissa = $shiftLeft64(new $Uint64(0, 1), flt.mantbits); exp = maxExp + 1 >> 0; err = rangeError("ParseFloat", s); } bits$1 = (x$11 = (x$12 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), new $Uint64(x$12.$high - 0, x$12.$low - 1)), new $Uint64(mantissa.$high & x$11.$high, (mantissa.$low & x$11.$low) >>> 0)); bits$1 = (x$13 = $shiftLeft64((new $Uint64(0, (((exp - flt.bias >> 0)) & ((((y$1 = flt.expbits, y$1 < 32 ? (1 << y$1) : 0) >> 0) - 1 >> 0))))), flt.mantbits), new $Uint64(bits$1.$high | x$13.$high, (bits$1.$low | x$13.$low) >>> 0)); if (neg) { bits$1 = (x$14 = $shiftLeft64($shiftLeft64(new $Uint64(0, 1), flt.mantbits), flt.expbits), new $Uint64(bits$1.$high | x$14.$high, (bits$1.$low | x$14.$low) >>> 0)); } if (flt === float32info) { return [(math.Float32frombits(((bits$1.$low >>> 0)))), err]; } return [math.Float64frombits(bits$1), err]; }; atof32 = function(s) { var _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, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, b, d, err, err$1, exp, f, f$1, f$2, f$3, fUp, hex, mantissa, n, n$1, neg, ok, ok$1, ok$2, ok$3, ok$4, ovf, s, trunc, val; f = 0; n = 0; err = $ifaceNil; _tuple = special(s); val = _tuple[0]; n$1 = _tuple[1]; ok = _tuple[2]; if (ok) { _tmp = ($fround(val)); _tmp$1 = n$1; _tmp$2 = $ifaceNil; f = _tmp; n = _tmp$1; err = _tmp$2; return [f, n, err]; } _tuple$1 = readFloat(s); mantissa = _tuple$1[0]; exp = _tuple$1[1]; neg = _tuple$1[2]; trunc = _tuple$1[3]; hex = _tuple$1[4]; n = _tuple$1[5]; ok$1 = _tuple$1[6]; if (!ok$1) { _tmp$3 = 0; _tmp$4 = n; _tmp$5 = syntaxError("ParseFloat", s); f = _tmp$3; n = _tmp$4; err = _tmp$5; return [f, n, err]; } if (hex) { _tuple$2 = atofHex($substring(s, 0, n), float32info, mantissa, exp, neg, trunc); f$1 = _tuple$2[0]; err$1 = _tuple$2[1]; _tmp$6 = ($fround(f$1)); _tmp$7 = n; _tmp$8 = err$1; f = _tmp$6; n = _tmp$7; err = _tmp$8; return [f, n, err]; } if (optimize) { if (!trunc) { _tuple$3 = atof32exact(mantissa, exp, neg); f$2 = _tuple$3[0]; ok$2 = _tuple$3[1]; if (ok$2) { _tmp$9 = f$2; _tmp$10 = n; _tmp$11 = $ifaceNil; f = _tmp$9; n = _tmp$10; err = _tmp$11; return [f, n, err]; } } _tuple$4 = eiselLemire32(mantissa, exp, neg); f$3 = _tuple$4[0]; ok$3 = _tuple$4[1]; if (ok$3) { if (!trunc) { _tmp$12 = f$3; _tmp$13 = n; _tmp$14 = $ifaceNil; f = _tmp$12; n = _tmp$13; err = _tmp$14; return [f, n, err]; } _tuple$5 = eiselLemire32(new $Uint64(mantissa.$high + 0, mantissa.$low + 1), exp, neg); fUp = _tuple$5[0]; ok$4 = _tuple$5[1]; if (ok$4 && (f$3 === fUp)) { _tmp$15 = f$3; _tmp$16 = n; _tmp$17 = $ifaceNil; f = _tmp$15; n = _tmp$16; err = _tmp$17; return [f, n, err]; } } } d = new decimal.ptr(arrayType$5.zero(), 0, 0, false, false); if (!d.set($substring(s, 0, n))) { _tmp$18 = 0; _tmp$19 = n; _tmp$20 = syntaxError("ParseFloat", s); f = _tmp$18; n = _tmp$19; err = _tmp$20; return [f, n, err]; } _tuple$6 = d.floatBits(float32info); b = _tuple$6[0]; ovf = _tuple$6[1]; f = math.Float32frombits(((b.$low >>> 0))); if (ovf) { err = rangeError("ParseFloat", s); } _tmp$21 = f; _tmp$22 = n; _tmp$23 = err; f = _tmp$21; n = _tmp$22; err = _tmp$23; return [f, n, err]; }; atof64 = function(s) { var _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, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, b, d, err, err$1, exp, f, f$1, f$2, f$3, fUp, hex, mantissa, n, n$1, neg, ok, ok$1, ok$2, ok$3, ok$4, ovf, s, trunc, val; f = 0; n = 0; err = $ifaceNil; _tuple = special(s); val = _tuple[0]; n$1 = _tuple[1]; ok = _tuple[2]; if (ok) { _tmp = val; _tmp$1 = n$1; _tmp$2 = $ifaceNil; f = _tmp; n = _tmp$1; err = _tmp$2; return [f, n, err]; } _tuple$1 = readFloat(s); mantissa = _tuple$1[0]; exp = _tuple$1[1]; neg = _tuple$1[2]; trunc = _tuple$1[3]; hex = _tuple$1[4]; n = _tuple$1[5]; ok$1 = _tuple$1[6]; if (!ok$1) { _tmp$3 = 0; _tmp$4 = n; _tmp$5 = syntaxError("ParseFloat", s); f = _tmp$3; n = _tmp$4; err = _tmp$5; return [f, n, err]; } if (hex) { _tuple$2 = atofHex($substring(s, 0, n), float64info, mantissa, exp, neg, trunc); f$1 = _tuple$2[0]; err$1 = _tuple$2[1]; _tmp$6 = f$1; _tmp$7 = n; _tmp$8 = err$1; f = _tmp$6; n = _tmp$7; err = _tmp$8; return [f, n, err]; } if (optimize) { if (!trunc) { _tuple$3 = atof64exact(mantissa, exp, neg); f$2 = _tuple$3[0]; ok$2 = _tuple$3[1]; if (ok$2) { _tmp$9 = f$2; _tmp$10 = n; _tmp$11 = $ifaceNil; f = _tmp$9; n = _tmp$10; err = _tmp$11; return [f, n, err]; } } _tuple$4 = eiselLemire64(mantissa, exp, neg); f$3 = _tuple$4[0]; ok$3 = _tuple$4[1]; if (ok$3) { if (!trunc) { _tmp$12 = f$3; _tmp$13 = n; _tmp$14 = $ifaceNil; f = _tmp$12; n = _tmp$13; err = _tmp$14; return [f, n, err]; } _tuple$5 = eiselLemire64(new $Uint64(mantissa.$high + 0, mantissa.$low + 1), exp, neg); fUp = _tuple$5[0]; ok$4 = _tuple$5[1]; if (ok$4 && (f$3 === fUp)) { _tmp$15 = f$3; _tmp$16 = n; _tmp$17 = $ifaceNil; f = _tmp$15; n = _tmp$16; err = _tmp$17; return [f, n, err]; } } } d = new decimal.ptr(arrayType$5.zero(), 0, 0, false, false); if (!d.set($substring(s, 0, n))) { _tmp$18 = 0; _tmp$19 = n; _tmp$20 = syntaxError("ParseFloat", s); f = _tmp$18; n = _tmp$19; err = _tmp$20; return [f, n, err]; } _tuple$6 = d.floatBits(float64info); b = _tuple$6[0]; ovf = _tuple$6[1]; f = math.Float64frombits(b); if (ovf) { err = rangeError("ParseFloat", s); } _tmp$21 = f; _tmp$22 = n; _tmp$23 = err; f = _tmp$21; n = _tmp$22; err = _tmp$23; return [f, n, err]; }; ParseFloat = function(s, bitSize) { var _tuple, bitSize, err, f, n, s; _tuple = parseFloatPrefix(s, bitSize); f = _tuple[0]; n = _tuple[1]; err = _tuple[2]; if (!((n === s.length)) && ($interfaceIsEqual(err, $ifaceNil) || !($interfaceIsEqual($assertType(err, ptrType$1).Err, $pkg.ErrSyntax)))) { return [0, syntaxError("ParseFloat", s)]; } return [f, err]; }; $pkg.ParseFloat = ParseFloat; parseFloatPrefix = function(s, bitSize) { var _tuple, bitSize, err, f, n, s; if (bitSize === 32) { _tuple = atof32(s); f = _tuple[0]; n = _tuple[1]; err = _tuple[2]; return [(f), n, err]; } return atof64(s); }; ptrType$2.methods = [{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)}, {prop: "set", name: "set", pkg: "strconv", typ: $funcType([$String], [$Bool], false)}, {prop: "floatBits", name: "floatBits", pkg: "strconv", typ: $funcType([ptrType], [$Uint64, $Bool], false)}]; ptrType$1.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Unwrap", name: "Unwrap", pkg: "", typ: $funcType([], [$error], false)}]; floatInfo.init("strconv", [{prop: "mantbits", name: "mantbits", embedded: false, exported: false, typ: $Uint, tag: ""}, {prop: "expbits", name: "expbits", embedded: false, exported: false, typ: $Uint, tag: ""}, {prop: "bias", name: "bias", embedded: false, exported: false, typ: $Int, tag: ""}]); decimalSlice.init("strconv", [{prop: "d", name: "d", embedded: false, exported: false, typ: sliceType$6, tag: ""}, {prop: "nd", name: "nd", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "dp", name: "dp", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "neg", name: "neg", embedded: false, exported: false, typ: $Bool, tag: ""}]); decimal.init("strconv", [{prop: "d", name: "d", embedded: false, exported: false, typ: arrayType$5, tag: ""}, {prop: "nd", name: "nd", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "dp", name: "dp", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "neg", name: "neg", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "trunc", name: "trunc", embedded: false, exported: false, typ: $Bool, tag: ""}]); leftCheat.init("strconv", [{prop: "delta", name: "delta", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "cutoff", name: "cutoff", embedded: false, exported: false, typ: $String, tag: ""}]); NumError.init("", [{prop: "Func", name: "Func", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Num", name: "Num", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Err", name: "Err", embedded: false, exported: true, typ: $error, 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 = bytealg.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = math.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = bits.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = utf8.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } isPrint16 = new sliceType([32, 126, 161, 887, 890, 895, 900, 1366, 1369, 1418, 1421, 1479, 1488, 1514, 1519, 1524, 1542, 1563, 1566, 1805, 1808, 1866, 1869, 1969, 1984, 2042, 2045, 2093, 2096, 2139, 2142, 2154, 2208, 2247, 2259, 2444, 2447, 2448, 2451, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2531, 2534, 2558, 2561, 2570, 2575, 2576, 2579, 2617, 2620, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2654, 2662, 2678, 2689, 2745, 2748, 2765, 2768, 2768, 2784, 2787, 2790, 2801, 2809, 2828, 2831, 2832, 2835, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2901, 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, 3191, 3257, 3260, 3277, 3285, 3286, 3294, 3299, 3302, 3314, 3328, 3407, 3412, 3427, 3430, 3478, 3482, 3517, 3520, 3526, 3530, 3530, 3535, 3551, 3558, 3567, 3570, 3572, 3585, 3642, 3647, 3675, 3713, 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, 6264, 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, 6848, 6912, 6987, 6992, 7036, 7040, 7155, 7164, 7223, 7227, 7241, 7245, 7304, 7312, 7354, 7357, 7367, 7376, 7418, 7424, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8061, 8064, 8147, 8150, 8175, 8178, 8190, 8208, 8231, 8240, 8286, 8304, 8305, 8308, 8348, 8352, 8383, 8400, 8432, 8448, 8587, 8592, 9254, 9280, 9290, 9312, 11123, 11126, 11507, 11513, 11559, 11565, 11565, 11568, 11623, 11631, 11632, 11647, 11670, 11680, 11858, 11904, 12019, 12032, 12245, 12272, 12283, 12289, 12438, 12441, 12543, 12549, 12771, 12784, 40956, 40960, 42124, 42128, 42182, 42192, 42539, 42560, 42743, 42752, 42943, 42946, 42954, 42997, 43052, 43056, 43065, 43072, 43127, 43136, 43205, 43214, 43225, 43232, 43347, 43359, 43388, 43392, 43481, 43486, 43574, 43584, 43597, 43600, 43609, 43612, 43714, 43739, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43883, 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([173, 907, 909, 930, 1328, 1424, 1757, 2111, 2143, 2229, 2274, 2436, 2473, 2481, 2526, 2564, 2601, 2609, 2612, 2615, 2621, 2653, 2692, 2702, 2706, 2729, 2737, 2740, 2758, 2762, 2816, 2820, 2857, 2865, 2868, 2910, 2948, 2961, 2971, 2973, 3017, 3085, 3089, 3113, 3141, 3145, 3159, 3213, 3217, 3241, 3252, 3269, 3273, 3295, 3312, 3341, 3345, 3397, 3401, 3456, 3460, 3506, 3516, 3541, 3543, 3715, 3717, 3723, 3748, 3750, 3781, 3783, 3912, 3992, 4029, 4045, 4294, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823, 4881, 5760, 5901, 5997, 6001, 6431, 6751, 7674, 8024, 8026, 8028, 8030, 8117, 8133, 8156, 8181, 8335, 11158, 11311, 11359, 11558, 11687, 11695, 11703, 11711, 11719, 11727, 11735, 11743, 11930, 12352, 12592, 12687, 12831, 43470, 43519, 43815, 43823, 64311, 64317, 64319, 64322, 64325, 65107, 65127, 65141, 65511]); isPrint32 = new sliceType$1([65536, 65613, 65616, 65629, 65664, 65786, 65792, 65794, 65799, 65843, 65847, 65948, 65952, 65952, 66000, 66045, 66176, 66204, 66208, 66256, 66272, 66299, 66304, 66339, 66349, 66378, 66384, 66426, 66432, 66499, 66504, 66517, 66560, 66717, 66720, 66729, 66736, 66771, 66776, 66811, 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, 68149, 68152, 68154, 68159, 68168, 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, 68903, 68912, 68921, 69216, 69293, 69296, 69297, 69376, 69415, 69424, 69465, 69552, 69579, 69600, 69622, 69632, 69709, 69714, 69743, 69759, 69825, 69840, 69864, 69872, 69881, 69888, 69959, 69968, 70006, 70016, 70132, 70144, 70206, 70272, 70313, 70320, 70378, 70384, 70393, 70400, 70412, 70415, 70416, 70419, 70468, 70471, 70472, 70475, 70477, 70480, 70480, 70487, 70487, 70493, 70499, 70502, 70508, 70512, 70516, 70656, 70753, 70784, 70855, 70864, 70873, 71040, 71093, 71096, 71133, 71168, 71236, 71248, 71257, 71264, 71276, 71296, 71352, 71360, 71369, 71424, 71450, 71453, 71467, 71472, 71487, 71680, 71739, 71840, 71922, 71935, 71942, 71945, 71945, 71948, 71992, 71995, 72006, 72016, 72025, 72096, 72103, 72106, 72151, 72154, 72164, 72192, 72263, 72272, 72354, 72384, 72440, 72704, 72773, 72784, 72812, 72816, 72847, 72850, 72886, 72960, 73014, 73018, 73031, 73040, 73049, 73056, 73112, 73120, 73129, 73440, 73464, 73648, 73648, 73664, 73713, 73727, 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, 93760, 93850, 93952, 94026, 94031, 94087, 94095, 94111, 94176, 94180, 94192, 94193, 94208, 100343, 100352, 101589, 101632, 101640, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 113820, 113823, 118784, 119029, 119040, 119078, 119081, 119154, 119163, 119272, 119296, 119365, 119520, 119539, 119552, 119638, 119648, 119672, 119808, 119967, 119970, 119970, 119973, 119974, 119977, 120074, 120077, 120134, 120138, 120485, 120488, 120779, 120782, 121483, 121499, 121519, 122880, 122904, 122907, 122922, 123136, 123180, 123184, 123197, 123200, 123209, 123214, 123215, 123584, 123641, 123647, 123647, 124928, 125124, 125127, 125142, 125184, 125259, 125264, 125273, 125278, 125279, 126065, 126132, 126209, 126269, 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, 127405, 127462, 127490, 127504, 127547, 127552, 127560, 127568, 127569, 127584, 127589, 127744, 128727, 128736, 128748, 128752, 128764, 128768, 128883, 128896, 128984, 128992, 129003, 129024, 129035, 129040, 129095, 129104, 129113, 129120, 129159, 129168, 129197, 129200, 129201, 129280, 129619, 129632, 129645, 129648, 129652, 129656, 129658, 129664, 129670, 129680, 129704, 129712, 129718, 129728, 129730, 129744, 129750, 129792, 129994, 130032, 130041, 131072, 173789, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101, 196608, 201546, 917760, 917999]); isNotPrint32 = new sliceType([12, 39, 59, 62, 399, 926, 2057, 2102, 2134, 2291, 2564, 2580, 2584, 3711, 3754, 4285, 4405, 4576, 4626, 4743, 4745, 4750, 4766, 4868, 4905, 4913, 4916, 4922, 5212, 6420, 6423, 6454, 7177, 7223, 7336, 7431, 7434, 7483, 7486, 7526, 7529, 7567, 7570, 9327, 27231, 27482, 27490, 54357, 54429, 54445, 54458, 54460, 54468, 54534, 54549, 54557, 54586, 54591, 54597, 54609, 55968, 57351, 57378, 57381, 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, 63865, 63948, 64403]); isGraphic = new sliceType([160, 5760, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8239, 8287, 12288]); 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); detailedPowersOfTen = $toNativeArray($kindArray, [$toNativeArray($kindUint64, [new $Uint64(389204073, 3445679187), new $Uint64(4203730336, 136053384)]), $toNativeArray($kindUint64, [new $Uint64(243252546, 542936756), new $Uint64(2627331460, 85033365)]), $toNativeArray($kindUint64, [new $Uint64(1377807506, 2826154593), new $Uint64(3284164325, 106291706)]), $toNativeArray($kindUint64, [new $Uint64(3869743031, 1385209593), new $Uint64(4105205406, 1206606456)]), $toNativeArray($kindUint64, [new $Uint64(2418589394, 2476368732), new $Uint64(2565753378, 3975354507)]), $toNativeArray($kindUint64, [new $Uint64(1949494919, 947977267), new $Uint64(3207191723, 2821709486)]), $toNativeArray($kindUint64, [new $Uint64(289385001, 111229759), new $Uint64(4008989654, 2453395034)]), $toNativeArray($kindUint64, [new $Uint64(1254607449, 2753873159), new $Uint64(2505618534, 459630072)]), $toNativeArray($kindUint64, [new $Uint64(1568259312, 221115977), new $Uint64(3132023167, 2722021238)]), $toNativeArray($kindUint64, [new $Uint64(4107807788, 276394972), new $Uint64(3915028959, 2328784723)]), $toNativeArray($kindUint64, [new $Uint64(2030508955, 2320230505), new $Uint64(2446893099, 3066103188)]), $toNativeArray($kindUint64, [new $Uint64(2538136194, 1826546308), new $Uint64(3058616374, 2758887161)]), $toNativeArray($kindUint64, [new $Uint64(4246412067, 135699237), new $Uint64(3823270468, 1301125303)]), $toNativeArray($kindUint64, [new $Uint64(4264620277, 3842908407), new $Uint64(2389544042, 2960686962)]), $toNativeArray($kindUint64, [new $Uint64(3183291699, 1582410037), new $Uint64(2986930053, 1553375055)]), $toNativeArray($kindUint64, [new $Uint64(2905372800, 904270722), new $Uint64(3733662566, 3015460643)]), $toNativeArray($kindUint64, [new $Uint64(1278987088, 565169201), new $Uint64(2333539104, 810921078)]), $toNativeArray($kindUint64, [new $Uint64(3746217508, 706461501), new $Uint64(2916923880, 1013651347)]), $toNativeArray($kindUint64, [new $Uint64(3609030061, 883076877), new $Uint64(3646154850, 1267064184)]), $toNativeArray($kindUint64, [new $Uint64(2255643788, 1088793960), new $Uint64(2278846781, 1865656939)]), $toNativeArray($kindUint64, [new $Uint64(1745812911, 1360992450), new $Uint64(2848558476, 3405812998)]), $toNativeArray($kindUint64, [new $Uint64(34782491, 627498738), new $Uint64(3560698095, 4257266248)]), $toNativeArray($kindUint64, [new $Uint64(21739056, 4150283095), new $Uint64(2225436309, 4271404141)]), $toNativeArray($kindUint64, [new $Uint64(1100915645, 892886573), new $Uint64(2781795387, 2118029704)]), $toNativeArray($kindUint64, [new $Uint64(1376144556, 2189850041), new $Uint64(3477244234, 1573795306)]), $toNativeArray($kindUint64, [new $Uint64(1933832171, 3516139923), new $Uint64(2173277646, 2057363890)]), $toNativeArray($kindUint64, [new $Uint64(269806566, 3321433080), new $Uint64(2716597058, 424221215)]), $toNativeArray($kindUint64, [new $Uint64(3558483680, 2004307702), new $Uint64(3395746322, 2677760166)]), $toNativeArray($kindUint64, [new $Uint64(2300620952, 2505384628), new $Uint64(4244682903, 1199716560)]), $toNativeArray($kindUint64, [new $Uint64(1437888095, 1565865392), new $Uint64(2652926814, 2360435586)]), $toNativeArray($kindUint64, [new $Uint64(3944843767, 883589917), new $Uint64(3316158518, 803060834)]), $toNativeArray($kindUint64, [new $Uint64(2783571061, 30745572), new $Uint64(4145198147, 3151309691)]), $toNativeArray($kindUint64, [new $Uint64(1202861001, 556086894), new $Uint64(2590748842, 1432697645)]), $toNativeArray($kindUint64, [new $Uint64(2577318075, 1768850442), new $Uint64(3238436052, 3938355704)]), $toNativeArray($kindUint64, [new $Uint64(3221647594, 1137321229), new $Uint64(4048045066, 627977334)]), $toNativeArray($kindUint64, [new $Uint64(939787922, 1784567592), new $Uint64(2530028166, 1466227658)]), $toNativeArray($kindUint64, [new $Uint64(3322218551, 83225842), new $Uint64(3162535207, 3980268220)]), $toNativeArray($kindUint64, [new $Uint64(4152773188, 3325257774), new $Uint64(3953169009, 3901593451)]), $toNativeArray($kindUint64, [new $Uint64(2058612330, 4225769757), new $Uint64(2470730631, 827883171)]), $toNativeArray($kindUint64, [new $Uint64(1499523589, 3134728548), new $Uint64(3088413288, 4256079436)]), $toNativeArray($kindUint64, [new $Uint64(1874404487, 697185213), new $Uint64(3860516611, 1025131999)]), $toNativeArray($kindUint64, [new $Uint64(2782115540, 2046353494), new $Uint64(2412822882, 103836587)]), $toNativeArray($kindUint64, [new $Uint64(2403902601, 2557941868), new $Uint64(3016028602, 2277279382)]), $toNativeArray($kindUint64, [new $Uint64(857394603, 4271169159), new $Uint64(3770035753, 699115580)]), $toNativeArray($kindUint64, [new $Uint64(2683355275, 2132609812), new $Uint64(2356272345, 3121301797)]), $toNativeArray($kindUint64, [new $Uint64(132968622, 1592020441), new $Uint64(2945340432, 680401775)]), $toNativeArray($kindUint64, [new $Uint64(3387436249, 4137509200), new $Uint64(3681675540, 850502218)]), $toNativeArray($kindUint64, [new $Uint64(3190889480, 975330514), new $Uint64(2301047212, 2679047534)]), $toNativeArray($kindUint64, [new $Uint64(1841128202, 1219163142), new $Uint64(2876309015, 3348809418)]), $toNativeArray($kindUint64, [new $Uint64(153926604, 3671437576), new $Uint64(3595386269, 3112269949)]), $toNativeArray($kindUint64, [new $Uint64(633075040, 147164837), new $Uint64(2247116418, 2482039630)]), $toNativeArray($kindUint64, [new $Uint64(2938827448, 183956046), new $Uint64(2808895523, 955065889)]), $toNativeArray($kindUint64, [new $Uint64(452308838, 229945057), new $Uint64(3511119404, 120090538)]), $toNativeArray($kindUint64, [new $Uint64(1356434847, 3364941133), new $Uint64(2194449627, 2222540234)]), $toNativeArray($kindUint64, [new $Uint64(3843027207, 3132434592), new $Uint64(2743062034, 1704433468)]), $toNativeArray($kindUint64, [new $Uint64(508816713, 2841801416), new $Uint64(3428827542, 4278025484)]), $toNativeArray($kindUint64, [new $Uint64(636020892, 331026298), new $Uint64(4286034428, 3200048207)]), $toNativeArray($kindUint64, [new $Uint64(2008125793, 2354375084), new $Uint64(2678771517, 4147513777)]), $toNativeArray($kindUint64, [new $Uint64(3583899065, 4016710679), new $Uint64(3348464397, 1963166749)]), $toNativeArray($kindUint64, [new $Uint64(1258648360, 1799662877), new $Uint64(4185580496, 3527700261)]), $toNativeArray($kindUint64, [new $Uint64(1323526137, 1124789298), new $Uint64(2615987810, 2204812663)]), $toNativeArray($kindUint64, [new $Uint64(580665847, 2479728447), new $Uint64(3269984763, 608532181)]), $toNativeArray($kindUint64, [new $Uint64(1799574133, 2025918735), new $Uint64(4087480953, 3981890698)]), $toNativeArray($kindUint64, [new $Uint64(2198475657, 1803070121), new $Uint64(2554675596, 878068950)]), $toNativeArray($kindUint64, [new $Uint64(600610923, 3327579475), new $Uint64(3193344495, 1097586188)]), $toNativeArray($kindUint64, [new $Uint64(750763654, 3085732520), new $Uint64(3991680619, 298240911)]), $toNativeArray($kindUint64, [new $Uint64(2079840020, 854841001), new $Uint64(2494800386, 3944496953)]), $toNativeArray($kindUint64, [new $Uint64(3673541849, 1068551251), new $Uint64(3118500483, 2783137543)]), $toNativeArray($kindUint64, [new $Uint64(3518185487, 2409430888), new $Uint64(3898125604, 2405180105)]), $toNativeArray($kindUint64, [new $Uint64(588253193, 3116507041), new $Uint64(2436328502, 3650721214)]), $toNativeArray($kindUint64, [new $Uint64(2882800140, 674408330), new $Uint64(3045410628, 2415917869)]), $toNativeArray($kindUint64, [new $Uint64(382274703, 843010412), new $Uint64(3806763285, 3019897337)]), $toNativeArray($kindUint64, [new $Uint64(2923276249, 2137494243), new $Uint64(2379227053, 2424306747)]), $toNativeArray($kindUint64, [new $Uint64(2580353487, 3745609628), new $Uint64(2974033816, 4104125258)]), $toNativeArray($kindUint64, [new $Uint64(1077958211, 3608270211), new $Uint64(3717542271, 835189277)]), $toNativeArray($kindUint64, [new $Uint64(1210594794, 1718297970), new $Uint64(2323463919, 2132606034)]), $toNativeArray($kindUint64, [new $Uint64(3660727141, 388815), new $Uint64(2904329899, 1592015718)]), $toNativeArray($kindUint64, [new $Uint64(2428425278, 1074227842), new $Uint64(3630412374, 916277824)]), $toNativeArray($kindUint64, [new $Uint64(1517765798, 3892617873), new $Uint64(2269007733, 3793899112)]), $toNativeArray($kindUint64, [new $Uint64(1897207248, 2718288694), new $Uint64(2836259667, 1521148418)]), $toNativeArray($kindUint64, [new $Uint64(224025412, 3397860867), new $Uint64(3545324584, 827693699)]), $toNativeArray($kindUint64, [new $Uint64(3898112266, 4271146690), new $Uint64(2215827865, 517308561)]), $toNativeArray($kindUint64, [new $Uint64(1651414861, 3191449714), new $Uint64(2769784831, 1720377526)]), $toNativeArray($kindUint64, [new $Uint64(4211752225, 768086671), new $Uint64(3462231039, 1076730083)]), $toNativeArray($kindUint64, [new $Uint64(2095474228, 3164408729), new $Uint64(2163894399, 2283569038)]), $toNativeArray($kindUint64, [new $Uint64(471859137, 3955510912), new $Uint64(2704867999, 1780719474)]), $toNativeArray($kindUint64, [new $Uint64(2737307570, 1723163168), new $Uint64(3381084999, 1152157518)]), $toNativeArray($kindUint64, [new $Uint64(1274150815, 6470312), new $Uint64(4226356249, 366455074)]), $toNativeArray($kindUint64, [new $Uint64(1870086083, 1614656681), new $Uint64(2641472655, 2913388981)]), $toNativeArray($kindUint64, [new $Uint64(3411349428, 944579027), new $Uint64(3301840819, 2567994402)]), $toNativeArray($kindUint64, [new $Uint64(2116703137, 1180723784), new $Uint64(4127301024, 2136251179)]), $toNativeArray($kindUint64, [new $Uint64(786068548, 3422306925), new $Uint64(2579563140, 1335156987)]), $toNativeArray($kindUint64, [new $Uint64(4203811157, 4277883656), new $Uint64(3224453925, 1668946233)]), $toNativeArray($kindUint64, [new $Uint64(2033538475, 2126129098), new $Uint64(4030567406, 3159924616)]), $toNativeArray($kindUint64, [new $Uint64(1270961547, 791959774), new $Uint64(2519104629, 901211061)]), $toNativeArray($kindUint64, [new $Uint64(2662443757, 4211175190), new $Uint64(3148880786, 2200255650)]), $toNativeArray($kindUint64, [new $Uint64(1180571049, 2042743516), new $Uint64(3936100983, 602835915)]), $toNativeArray($kindUint64, [new $Uint64(200985993, 3961069257), new $Uint64(2460063114, 1987385183)]), $toNativeArray($kindUint64, [new $Uint64(3472457964, 1730111099), new $Uint64(3075078893, 336747830)]), $toNativeArray($kindUint64, [new $Uint64(2193088807, 2162638874), new $Uint64(3843848616, 1494676612)]), $toNativeArray($kindUint64, [new $Uint64(3518164152, 2962262032), new $Uint64(2402405385, 934172882)]), $toNativeArray($kindUint64, [new $Uint64(2250221542, 3702827541), new $Uint64(3003006731, 2241457927)]), $toNativeArray($kindUint64, [new $Uint64(1739035104, 2481050778), new $Uint64(3753758414, 1728080585)]), $toNativeArray($kindUint64, [new $Uint64(3771251500, 1550656736), new $Uint64(2346099009, 6308541)]), $toNativeArray($kindUint64, [new $Uint64(1492838903, 1938320920), new $Uint64(2932623761, 1081627501)]), $toNativeArray($kindUint64, [new $Uint64(2939790453, 1349159326), new $Uint64(3665779701, 2425776200)]), $toNativeArray($kindUint64, [new $Uint64(1837369033, 1380095491), new $Uint64(2291112313, 2052981037)]), $toNativeArray($kindUint64, [new $Uint64(3370453115, 2798861187), new $Uint64(2863890391, 3639968120)]), $toNativeArray($kindUint64, [new $Uint64(4213066394, 2424834660), new $Uint64(3579862989, 3476218326)]), $toNativeArray($kindUint64, [new $Uint64(1559424672, 2589263487), new $Uint64(2237414368, 2709507366)]), $toNativeArray($kindUint64, [new $Uint64(4096764488, 3236579358), new $Uint64(2796767960, 3386884207)]), $toNativeArray($kindUint64, [new $Uint64(4047213786, 4045724198), new $Uint64(3495959950, 4233605259)]), $toNativeArray($kindUint64, [new $Uint64(1992637704, 3602319448), new $Uint64(2184974969, 1572261463)]), $toNativeArray($kindUint64, [new $Uint64(1417055307, 207932014), new $Uint64(2731218711, 3039068653)]), $toNativeArray($kindUint64, [new $Uint64(2845060957, 3481140489), new $Uint64(3414023389, 2725093992)]), $toNativeArray($kindUint64, [new $Uint64(3556326197, 1130200140), new $Uint64(4267529237, 185142018)]), $toNativeArray($kindUint64, [new $Uint64(3296445697, 1243245999), new $Uint64(2667205773, 652584673)]), $toNativeArray($kindUint64, [new $Uint64(899331649, 2627799323), new $Uint64(3334007216, 1889472666)]), $toNativeArray($kindUint64, [new $Uint64(3271648210, 63523682), new $Uint64(4167509020, 2361840832)]), $toNativeArray($kindUint64, [new $Uint64(2044780131, 1113444125), new $Uint64(2604693137, 3623634168)]), $toNativeArray($kindUint64, [new $Uint64(2555975164, 318063332), new $Uint64(3255866422, 1308317238)]), $toNativeArray($kindUint64, [new $Uint64(1047485307, 397579165), new $Uint64(4069833027, 3782880196)]), $toNativeArray($kindUint64, [new $Uint64(2802161964, 4006583362), new $Uint64(2543645642, 1827429210)]), $toNativeArray($kindUint64, [new $Uint64(1355218808, 713261907), new $Uint64(3179557053, 136802865)]), $toNativeArray($kindUint64, [new $Uint64(2767765334, 891577384), new $Uint64(3974446316, 1244745405)]), $toNativeArray($kindUint64, [new $Uint64(2266724245, 3778461337), new $Uint64(2484028947, 2925449526)]), $toNativeArray($kindUint64, [new $Uint64(685921659, 1501851199), new $Uint64(3105036184, 2583070084)]), $toNativeArray($kindUint64, [new $Uint64(857402074, 803572175), new $Uint64(3881295230, 3228837605)]), $toNativeArray($kindUint64, [new $Uint64(1072747208, 1575974433), new $Uint64(2425809519, 944281679)]), $toNativeArray($kindUint64, [new $Uint64(267192186, 1969968041), new $Uint64(3032261899, 106610275)]), $toNativeArray($kindUint64, [new $Uint64(3555215705, 314976404), new $Uint64(3790327373, 3354488315)]), $toNativeArray($kindUint64, [new $Uint64(1685138903, 2881214812), new $Uint64(2368954608, 2633426109)]), $toNativeArray($kindUint64, [new $Uint64(3180165453, 2527776691), new $Uint64(2961193260, 3291782636)]), $toNativeArray($kindUint64, [new $Uint64(3975206816, 4233462688), new $Uint64(3701491575, 4114728295)]), $toNativeArray($kindUint64, [new $Uint64(4095116996, 2645914180), new $Uint64(2313432234, 4182317920)]), $toNativeArray($kindUint64, [new $Uint64(823928949, 3307392725), new $Uint64(2891790293, 3080413753)]), $toNativeArray($kindUint64, [new $Uint64(2103653011, 913015435), new $Uint64(3614737867, 629291719)]), $toNativeArray($kindUint64, [new $Uint64(2925395868, 33763735), new $Uint64(2259211166, 4151403708)]), $toNativeArray($kindUint64, [new $Uint64(3656744835, 42204668), new $Uint64(2824013958, 3041770987)]), $toNativeArray($kindUint64, [new $Uint64(3497189219, 3273981307), new $Uint64(3530017448, 1654730086)]), $toNativeArray($kindUint64, [new $Uint64(1112001438, 1509367405), new $Uint64(2206260905, 1034206304)]), $toNativeArray($kindUint64, [new $Uint64(1390001797, 4034192904), new $Uint64(2757826131, 2366499704)]), $toNativeArray($kindUint64, [new $Uint64(1737502247, 1821515659), new $Uint64(3447282664, 1884382806)]), $toNativeArray($kindUint64, [new $Uint64(12197080, 2749060022), new $Uint64(2154551665, 1177739254)]), $toNativeArray($kindUint64, [new $Uint64(2162729998, 3436325028), new $Uint64(2693189581, 2545915891)]), $toNativeArray($kindUint64, [new $Uint64(1629670674, 2147922637), new $Uint64(3366486976, 4256136688)]), $toNativeArray($kindUint64, [new $Uint64(2037088343, 537419649), new $Uint64(4208108721, 1025203564)]), $toNativeArray($kindUint64, [new $Uint64(3420663862, 1946500016), new $Uint64(2630067950, 3325106787)]), $toNativeArray($kindUint64, [new $Uint64(3202088004, 285641372), new $Uint64(3287584938, 2008899836)]), $toNativeArray($kindUint64, [new $Uint64(4002610005, 357051716), new $Uint64(4109481173, 363641147)]), $toNativeArray($kindUint64, [new $Uint64(1964760341, 760028234), new $Uint64(2568425733, 764146629)]), $toNativeArray($kindUint64, [new $Uint64(3529692250, 2023777117), new $Uint64(3210532166, 2028925110)]), $toNativeArray($kindUint64, [new $Uint64(2264631665, 382237748), new $Uint64(4013165208, 388672740)]), $toNativeArray($kindUint64, [new $Uint64(3562878438, 2923253152), new $Uint64(2508228255, 242920462)]), $toNativeArray($kindUint64, [new $Uint64(2306114400, 1506582793), new $Uint64(3135285318, 3524876050)]), $toNativeArray($kindUint64, [new $Uint64(735159352, 1883228491), new $Uint64(3919106648, 2258611415)]), $toNativeArray($kindUint64, [new $Uint64(2070087331, 1177017807), new $Uint64(2449441655, 1411632134)]), $toNativeArray($kindUint64, [new $Uint64(440125516, 397530434), new $Uint64(3061802069, 690798344)]), $toNativeArray($kindUint64, [new $Uint64(550156895, 496913043), new $Uint64(3827252586, 1937239754)]), $toNativeArray($kindUint64, [new $Uint64(1417589883, 1921183388), new $Uint64(2392032866, 2284516670)]), $toNativeArray($kindUint64, [new $Uint64(3919471002, 1327737411), new $Uint64(2990041083, 708162189)]), $toNativeArray($kindUint64, [new $Uint64(1678113280, 3807155412), new $Uint64(3737551353, 4106428209)]), $toNativeArray($kindUint64, [new $Uint64(3733175360, 2379472132), new $Uint64(2335969596, 955904894)]), $toNativeArray($kindUint64, [new $Uint64(2518985552, 2974340165), new $Uint64(2919961995, 1194881118)]), $toNativeArray($kindUint64, [new $Uint64(1001248292, 3717925207), new $Uint64(3649952494, 419859574)]), $toNativeArray($kindUint64, [new $Uint64(3847005655, 176219606), new $Uint64(2281220308, 3483637705)]), $toNativeArray($kindUint64, [new $Uint64(1587531596, 3441499980), new $Uint64(2851525386, 59579836)]), $toNativeArray($kindUint64, [new $Uint64(1984414496, 6907679), new $Uint64(3564406732, 2221958443)]), $toNativeArray($kindUint64, [new $Uint64(703388148, 4317299), new $Uint64(2227754207, 3536207675)]), $toNativeArray($kindUint64, [new $Uint64(4100460657, 5396624), new $Uint64(2784692759, 3346517769)]), $toNativeArray($kindUint64, [new $Uint64(1904350349, 1080487604), new $Uint64(3480865949, 3109405388)]), $toNativeArray($kindUint64, [new $Uint64(3337702616, 1212175664), new $Uint64(2175541218, 2480249279)]), $toNativeArray($kindUint64, [new $Uint64(3098386446, 1515219580), new $Uint64(2719426523, 952827951)]), $toNativeArray($kindUint64, [new $Uint64(2799241233, 4041508124), new $Uint64(3399283154, 117293115)]), $toNativeArray($kindUint64, [new $Uint64(2425309718, 1830659683), new $Uint64(4249103942, 2294100042)]), $toNativeArray($kindUint64, [new $Uint64(2589560398, 70420478), new $Uint64(2655689964, 360070702)]), $toNativeArray($kindUint64, [new $Uint64(1089466849, 2235509245), new $Uint64(3319612455, 450088378)]), $toNativeArray($kindUint64, [new $Uint64(3509317209, 3868128380), new $Uint64(4149515568, 3783835944)]), $toNativeArray($kindUint64, [new $Uint64(2193323256, 806967502), new $Uint64(2593447230, 2364897465)]), $toNativeArray($kindUint64, [new $Uint64(3815395894, 1008709377), new $Uint64(3241809038, 808638183)]), $toNativeArray($kindUint64, [new $Uint64(3695503043, 3408370369), new $Uint64(4052261297, 3158281377)]), $toNativeArray($kindUint64, [new $Uint64(699076666, 1593360569), new $Uint64(2532663311, 363313125)]), $toNativeArray($kindUint64, [new $Uint64(1947587656, 4139184359), new $Uint64(3165829138, 3675366878)]), $toNativeArray($kindUint64, [new $Uint64(287000923, 879013153), new $Uint64(3957286423, 2446724950)]), $toNativeArray($kindUint64, [new $Uint64(3400601049, 12512308), new $Uint64(2473304014, 3139815829)]), $toNativeArray($kindUint64, [new $Uint64(1029525839, 1089382210), new $Uint64(3091630018, 1777286139)]), $toNativeArray($kindUint64, [new $Uint64(213165475, 287985938), new $Uint64(3864537523, 74124026)]), $toNativeArray($kindUint64, [new $Uint64(1206970245, 3938087595), new $Uint64(2415335951, 3804423900)]), $toNativeArray($kindUint64, [new $Uint64(1508712807, 1701384022), new $Uint64(3019169939, 3681788051)]), $toNativeArray($kindUint64, [new $Uint64(812149185, 1052988204), new $Uint64(3773962424, 3528493240)]), $toNativeArray($kindUint64, [new $Uint64(507593240, 3342472187), new $Uint64(2358726515, 2205308275)]), $toNativeArray($kindUint64, [new $Uint64(3855717022, 4178090234), new $Uint64(2948408144, 1682893519)]), $toNativeArray($kindUint64, [new $Uint64(3745904454, 3075129145), new $Uint64(3685510180, 2103616899)]), $toNativeArray($kindUint64, [new $Uint64(1804319372, 848213891), new $Uint64(2303443862, 3462244210)]), $toNativeArray($kindUint64, [new $Uint64(107915567, 1060267364), new $Uint64(2879304828, 2180321615)]), $toNativeArray($kindUint64, [new $Uint64(3356119931, 251592381), new $Uint64(3599131035, 2725402018)]), $toNativeArray($kindUint64, [new $Uint64(3171316780, 3915341622), new $Uint64(2249456897, 1166505349)]), $toNativeArray($kindUint64, [new $Uint64(742920504, 599209732), new $Uint64(2811821121, 2531873511)]), $toNativeArray($kindUint64, [new $Uint64(4149876102, 749012165), new $Uint64(3514776401, 4238583712)]), $toNativeArray($kindUint64, [new $Uint64(2593672563, 3689358075), new $Uint64(2196735251, 1038502084)]), $toNativeArray($kindUint64, [new $Uint64(3242090704, 3537955770), new $Uint64(2745919064, 224385781)]), $toNativeArray($kindUint64, [new $Uint64(831387909, 127477416), new $Uint64(3432398830, 280482227)]), $toNativeArray($kindUint64, [new $Uint64(4260460358, 1233088594), new $Uint64(4290498537, 2498086431)]), $toNativeArray($kindUint64, [new $Uint64(4273400459, 3991905843), new $Uint64(2681561585, 4245658579)]), $toNativeArray($kindUint64, [new $Uint64(4268008750, 3916140480), new $Uint64(3351951982, 2085847752)]), $toNativeArray($kindUint64, [new $Uint64(1040043642, 2747691952), new $Uint64(4189939978, 459826043)]), $toNativeArray($kindUint64, [new $Uint64(113156364, 2791049294), new $Uint64(2618712486, 1361133101)]), $toNativeArray($kindUint64, [new $Uint64(1215187279, 3488811618), new $Uint64(3273390607, 3848900024)]), $toNativeArray($kindUint64, [new $Uint64(1518984099, 3287272698), new $Uint64(4091738259, 3737383206)]), $toNativeArray($kindUint64, [new $Uint64(4170590534, 1517674524), new $Uint64(2557336412, 1798993591)]), $toNativeArray($kindUint64, [new $Uint64(4139496343, 4044576803), new $Uint64(3196670515, 2248741989)]), $toNativeArray($kindUint64, [new $Uint64(1953144957, 3981979180), new $Uint64(3995838144, 1737185663)]), $toNativeArray($kindUint64, [new $Uint64(2831328334, 3025607900), new $Uint64(2497398840, 1085741039)]), $toNativeArray($kindUint64, [new $Uint64(2465418594, 1634526227), new $Uint64(3121748550, 1357176299)]), $toNativeArray($kindUint64, [new $Uint64(2008031418, 4190641431), new $Uint64(3902185687, 3843954022)]), $toNativeArray($kindUint64, [new $Uint64(181277812, 3692892718), new $Uint64(2438866054, 4013084000)]), $toNativeArray($kindUint64, [new $Uint64(226597266, 321148602), new $Uint64(3048582568, 2868871352)]), $toNativeArray($kindUint64, [new $Uint64(283246582, 2548919401), new $Uint64(3810728210, 3586089190)]), $toNativeArray($kindUint64, [new $Uint64(3398254586, 519332801), new $Uint64(2381705131, 3315047567)]), $toNativeArray($kindUint64, [new $Uint64(3174076408, 2796649650), new $Uint64(2977131414, 3070067635)]), $toNativeArray($kindUint64, [new $Uint64(2893853686, 3495812062), new $Uint64(3721414268, 1690100896)]), $toNativeArray($kindUint64, [new $Uint64(1808658554, 1111140715), new $Uint64(2325883917, 3203796708)]), $toNativeArray($kindUint64, [new $Uint64(2260823192, 3536409542), new $Uint64(2907354897, 783520413)]), $toNativeArray($kindUint64, [new $Uint64(3899770815, 125544631), new $Uint64(3634193621, 2053142340)]), $toNativeArray($kindUint64, [new $Uint64(289873111, 1689078130), new $Uint64(2271371013, 1820084875)]), $toNativeArray($kindUint64, [new $Uint64(3583566861, 1037605839), new $Uint64(2839213766, 3348847917)]), $toNativeArray($kindUint64, [new $Uint64(1258233104, 2370749123), new $Uint64(3549017208, 2038576249)]), $toNativeArray($kindUint64, [new $Uint64(3470750250, 1481718202), new $Uint64(2218135755, 1274110155)]), $toNativeArray($kindUint64, [new $Uint64(3264695988, 3999631400), new $Uint64(2772669694, 518895870)]), $toNativeArray($kindUint64, [new $Uint64(1933386338, 704571954), new $Uint64(3465837117, 2796103486)]), $toNativeArray($kindUint64, [new $Uint64(134624637, 1514099295), new $Uint64(2166148198, 2284435591)]), $toNativeArray($kindUint64, [new $Uint64(3389506268, 2966365943), new $Uint64(2707685248, 708060840)]), $toNativeArray($kindUint64, [new $Uint64(4236882835, 3707957429), new $Uint64(3384606560, 885076050)]), $toNativeArray($kindUint64, [new $Uint64(3148619896, 3561204962), new $Uint64(4230758200, 1106345063)]), $toNativeArray($kindUint64, [new $Uint64(3578500171, 2225753101), new $Uint64(2644223875, 691465664)]), $toNativeArray($kindUint64, [new $Uint64(178157918, 1708449553), new $Uint64(3305279843, 4085557553)]), $toNativeArray($kindUint64, [new $Uint64(1296439221, 4283045589), new $Uint64(4131599804, 4033205117)]), $toNativeArray($kindUint64, [new $Uint64(1347145425, 3213774405), new $Uint64(2582249878, 373269550)]), $toNativeArray($kindUint64, [new $Uint64(3831415430, 795992534), new $Uint64(3227812347, 2614070585)]), $toNativeArray($kindUint64, [new $Uint64(1568043815, 3142474316), new $Uint64(4034765434, 2193846408)]), $toNativeArray($kindUint64, [new $Uint64(980027384, 3574659183), new $Uint64(2521728396, 2444895829)]), $toNativeArray($kindUint64, [new $Uint64(2298776055, 173356683), new $Uint64(3152160495, 3056119786)]), $toNativeArray($kindUint64, [new $Uint64(725986420, 3437921326), new $Uint64(3940200619, 2746407909)]), $toNativeArray($kindUint64, [new $Uint64(990612425, 1217181), new $Uint64(2462625387, 1179634031)]), $toNativeArray($kindUint64, [new $Uint64(164523707, 1075263300), new $Uint64(3078281734, 400800715)]), $toNativeArray($kindUint64, [new $Uint64(3426880106, 270337301), new $Uint64(3847852167, 2648484541)]), $toNativeArray($kindUint64, [new $Uint64(2678670978, 1242702637), new $Uint64(2404907604, 3265915574)]), $toNativeArray($kindUint64, [new $Uint64(1200855074, 3700861945), new $Uint64(3006134505, 4082394468)]), $toNativeArray($kindUint64, [new $Uint64(1501068843, 2478593783), new $Uint64(3757668132, 1881767613)]), $toNativeArray($kindUint64, [new $Uint64(1475038939, 1012250202), new $Uint64(2348542582, 3323588406)]), $toNativeArray($kindUint64, [new $Uint64(3991282322, 191570929), new $Uint64(2935678228, 2007001859)]), $toNativeArray($kindUint64, [new $Uint64(3915361078, 2386947309), new $Uint64(3669597785, 2508752324)]), $toNativeArray($kindUint64, [new $Uint64(299617026, 418100244), new $Uint64(2293498615, 4252324763)]), $toNativeArray($kindUint64, [new $Uint64(3595746754, 2670108953), new $Uint64(2866873269, 4241664129)]), $toNativeArray($kindUint64, [new $Uint64(1273457971, 1190152543), new $Uint64(3583591587, 2080854690)]), $toNativeArray($kindUint64, [new $Uint64(1869653056, 206974427), new $Uint64(2239744742, 763663269)]), $toNativeArray($kindUint64, [new $Uint64(3410808144, 258718034), new $Uint64(2799680927, 3102062734)]), $toNativeArray($kindUint64, [new $Uint64(2116026532, 323397543), new $Uint64(3499601159, 2803836594)]), $toNativeArray($kindUint64, [new $Uint64(2396258406, 2349607112), new $Uint64(2187250724, 3363010607)]), $toNativeArray($kindUint64, [new $Uint64(1921581184, 789525242), new $Uint64(2734063405, 4203763259)]), $toNativeArray($kindUint64, [new $Uint64(1328234656, 986906553), new $Uint64(3417579257, 2033478602)]), $toNativeArray($kindUint64, [new $Uint64(3807776968, 1233633192), new $Uint64(4271974071, 3615590076)]), $toNativeArray($kindUint64, [new $Uint64(232376957, 771020745), new $Uint64(2669983794, 3870356534)]), $toNativeArray($kindUint64, [new $Uint64(2437954844, 2037517755), new $Uint64(3337479743, 2690462019)]), $toNativeArray($kindUint64, [new $Uint64(1973701731, 2546897194), new $Uint64(4171849679, 2289335700)]), $toNativeArray($kindUint64, [new $Uint64(3381047230, 1054939834), new $Uint64(2607406049, 3041447548)]), $toNativeArray($kindUint64, [new $Uint64(4226309037, 3466158440), new $Uint64(3259257562, 580583963)]), $toNativeArray($kindUint64, [new $Uint64(4209144473, 1111472579), new $Uint64(4074071952, 2873213602)]), $toNativeArray($kindUint64, [new $Uint64(3704457119, 3379024922), new $Uint64(2546294970, 1795758501)]), $toNativeArray($kindUint64, [new $Uint64(1409345927, 3150039328), new $Uint64(3182868713, 97214479)]), $toNativeArray($kindUint64, [new $Uint64(687940585, 2863807336), new $Uint64(3978585891, 1195259923)]), $toNativeArray($kindUint64, [new $Uint64(4188059250, 179266849), new $Uint64(2486616182, 210166539)]), $toNativeArray($kindUint64, [new $Uint64(4161332238, 2371567209), new $Uint64(3108270227, 2410191822)]), $toNativeArray($kindUint64, [new $Uint64(3054181650, 816975364), new $Uint64(3885337784, 1938997954)]), $toNativeArray($kindUint64, [new $Uint64(2982605355, 1584351426), new $Uint64(2428336115, 1211873721)]), $toNativeArray($kindUint64, [new $Uint64(507031222, 906697459), new $Uint64(3035420144, 441100328)]), $toNativeArray($kindUint64, [new $Uint64(633789027, 3280855472), new $Uint64(3794275180, 551375410)]), $toNativeArray($kindUint64, [new $Uint64(1469859966, 1513663758), new $Uint64(2371421987, 2492093279)]), $toNativeArray($kindUint64, [new $Uint64(763583133, 4039563345), new $Uint64(2964277484, 2041374775)]), $toNativeArray($kindUint64, [new $Uint64(4175704389, 1828228709), new $Uint64(3705346855, 2551718468)]), $toNativeArray($kindUint64, [new $Uint64(462331595, 1679513855), new $Uint64(2315841784, 3205436779)]), $toNativeArray($kindUint64, [new $Uint64(3799139966, 1025650495), new $Uint64(2894802230, 4006795973)]), $toNativeArray($kindUint64, [new $Uint64(1527699485, 3429546767), new $Uint64(3618502788, 2861011319)]), $toNativeArray($kindUint64, [new $Uint64(2565424914, 2680337641), new $Uint64(2261564242, 3935615722)]), $toNativeArray($kindUint64, [new $Uint64(1059297495, 1202938404), new $Uint64(2826955303, 2772036005)]), $toNativeArray($kindUint64, [new $Uint64(2397863693, 429931181), new $Uint64(3533694129, 2391303182)]), $toNativeArray($kindUint64, [new $Uint64(424922984, 805577900), new $Uint64(2208558830, 4178919049)]), $toNativeArray($kindUint64, [new $Uint64(1604895554, 1006972375), new $Uint64(2760698538, 3076165163)]), $toNativeArray($kindUint64, [new $Uint64(932377618, 3406199117), new $Uint64(3450873173, 1697722806)]), $toNativeArray($kindUint64, [new $Uint64(3803961483, 3202616272), new $Uint64(2156795733, 1597947665)]), $toNativeArray($kindUint64, [new $Uint64(1533726382, 2929528516), new $Uint64(2695994666, 3071176406)]), $toNativeArray($kindUint64, [new $Uint64(4064641626, 1514426997), new $Uint64(3369993333, 1691486859)]), $toNativeArray($kindUint64, [new $Uint64(4007060208, 4040517394), new $Uint64(4212491666, 3188100398)]), $toNativeArray($kindUint64, [new $Uint64(1430670806, 2525323371), new $Uint64(2632807291, 3066304573)]), $toNativeArray($kindUint64, [new $Uint64(2862080332, 1009170566), new $Uint64(3291009114, 2759138892)]), $toNativeArray($kindUint64, [new $Uint64(3577600415, 1261463208), new $Uint64(4113761393, 1301439967)]), $toNativeArray($kindUint64, [new $Uint64(3846612995, 2399027241), new $Uint64(2571100870, 3497754539)]), $toNativeArray($kindUint64, [new $Uint64(3734524420, 1925042227), new $Uint64(3213876088, 2224709526)]), $toNativeArray($kindUint64, [new $Uint64(2520671877, 2406302784), new $Uint64(4017345110, 2780886908)]), $toNativeArray($kindUint64, [new $Uint64(3722903571, 2040810152), new $Uint64(2510840694, 664312493)]), $toNativeArray($kindUint64, [new $Uint64(1432403992, 1477270866), new $Uint64(3138550867, 2977874265)]), $toNativeArray($kindUint64, [new $Uint64(2864246814, 1846588582), new $Uint64(3923188584, 2648601007)]), $toNativeArray($kindUint64, [new $Uint64(3400766995, 80376040), new $Uint64(2451992865, 1655375629)]), $toNativeArray($kindUint64, [new $Uint64(1029733271, 3321695522), new $Uint64(3064991081, 3142961361)]), $toNativeArray($kindUint64, [new $Uint64(2360908413, 3078377578), new $Uint64(3831238852, 707476229)]), $toNativeArray($kindUint64, [new $Uint64(2012438670, 2460856898), new $Uint64(2394524282, 2589656291)]), $toNativeArray($kindUint64, [new $Uint64(1441806514, 928587475), new $Uint64(2993155353, 1089586716)]), $toNativeArray($kindUint64, [new $Uint64(1802258142, 3308217992), new $Uint64(3741444191, 2435725219)]), $toNativeArray($kindUint64, [new $Uint64(589540427, 993894421), new $Uint64(2338402619, 3132940998)]), $toNativeArray($kindUint64, [new $Uint64(2884409182, 168626202), new $Uint64(2923003274, 2842434423)]), $toNativeArray($kindUint64, [new $Uint64(2531769653, 2358266401), new $Uint64(3653754093, 1405559381)]), $toNativeArray($kindUint64, [new $Uint64(2119226945, 2010787412), new $Uint64(2283596308, 1415345525)]), $toNativeArray($kindUint64, [new $Uint64(3722775505, 3587226089), new $Uint64(2854495385, 1769181906)]), $toNativeArray($kindUint64, [new $Uint64(2505985734, 1262807140), new $Uint64(3568119231, 3285219207)]), $toNativeArray($kindUint64, [new $Uint64(3176853819, 4010479934), new $Uint64(2230074519, 3663874740)]), $toNativeArray($kindUint64, [new $Uint64(3971067274, 3939358094), new $Uint64(2787593149, 3506101601)]), $toNativeArray($kindUint64, [new $Uint64(1742608621, 2776713970), new $Uint64(3484491437, 1161401530)]), $toNativeArray($kindUint64, [new $Uint64(2162872212, 2272317143), new $Uint64(2177807148, 1262746868)]), $toNativeArray($kindUint64, [new $Uint64(2703590265, 2840396429), new $Uint64(2722258935, 1578433585)]), $toNativeArray($kindUint64, [new $Uint64(158262360, 329270064), new $Uint64(3402823669, 899300158)]), $toNativeArray($kindUint64, [new $Uint64(2345311598, 411587580), new $Uint64(4253529586, 2197867021)]), $toNativeArray($kindUint64, [new $Uint64(2002690660, 3478467709), new $Uint64(2658455991, 2447408712)]), $toNativeArray($kindUint64, [new $Uint64(2503363326, 53117341), new $Uint64(3323069989, 1985519066)]), $toNativeArray($kindUint64, [new $Uint64(981720509, 2213880324), new $Uint64(4153837486, 3555640657)]), $toNativeArray($kindUint64, [new $Uint64(3297929878, 1920546114), new $Uint64(2596148429, 1148533586)]), $toNativeArray($kindUint64, [new $Uint64(1974928700, 253198995), new $Uint64(3245185536, 2509408807)]), $toNativeArray($kindUint64, [new $Uint64(1394919051, 316498744), new $Uint64(4056481920, 3136761009)]), $toNativeArray($kindUint64, [new $Uint64(3556178966, 3955908099), new $Uint64(2535301200, 1960475630)]), $toNativeArray($kindUint64, [new $Uint64(2297740060, 2797401476), new $Uint64(3169126500, 2450594538)]), $toNativeArray($kindUint64, [new $Uint64(724691427, 3496751845), new $Uint64(3961408125, 3063243173)]), $toNativeArray($kindUint64, [new $Uint64(989803054, 1648598991), new $Uint64(2475880078, 2451397895)]), $toNativeArray($kindUint64, [new $Uint64(163511993, 4208232386), new $Uint64(3094850098, 916763721)]), $toNativeArray($kindUint64, [new $Uint64(1278131816, 2039065011), new $Uint64(3868562622, 3293438299)]), $toNativeArray($kindUint64, [new $Uint64(261961473, 1274415632), new $Uint64(2417851639, 984657113)]), $toNativeArray($kindUint64, [new $Uint64(1401193665, 2666761364), new $Uint64(3022314549, 157079567)]), $toNativeArray($kindUint64, [new $Uint64(677750258, 112226233), new $Uint64(3777893186, 1270091283)]), $toNativeArray($kindUint64, [new $Uint64(4181690295, 1143883219), new $Uint64(2361183241, 1867548875)]), $toNativeArray($kindUint64, [new $Uint64(4153371045, 356112200), new $Uint64(2951479051, 3408177918)]), $toNativeArray($kindUint64, [new $Uint64(3044230158, 1518882075), new $Uint64(3689348814, 3186480574)]), $toNativeArray($kindUint64, [new $Uint64(828902024, 4170526768), new $Uint64(2305843009, 917808535)]), $toNativeArray($kindUint64, [new $Uint64(4257353003, 918191165), new $Uint64(2882303761, 2221002492)]), $toNativeArray($kindUint64, [new $Uint64(1026723958, 73997132), new $Uint64(3602879701, 3849994940)]), $toNativeArray($kindUint64, [new $Uint64(2789186121, 3267473679), new $Uint64(2251799813, 2943117749)]), $toNativeArray($kindUint64, [new $Uint64(265257180, 863116627), new $Uint64(2814749767, 457671715)]), $toNativeArray($kindUint64, [new $Uint64(3552796947, 1078895784), new $Uint64(3518437208, 3793315115)]), $toNativeArray($kindUint64, [new $Uint64(1683627180, 137438953), new $Uint64(2199023255, 2370821947)]), $toNativeArray($kindUint64, [new $Uint64(1030792151, 171798691), new $Uint64(2748779069, 1889785610)]), $toNativeArray($kindUint64, [new $Uint64(3435973836, 3435973836), new $Uint64(3435973836, 3435973836)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(2147483648, 0)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(2684354560, 0)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(3355443200, 0)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(4194304000, 0)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(2621440000, 0)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(3276800000, 0)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(4096000000, 0)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(2560000000, 0)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(3200000000, 0)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(4000000000, 0)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(2500000000, 0)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(3125000000, 0)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(3906250000, 0)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(2441406250, 0)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(3051757812, 2147483648)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(3814697265, 2684354560)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(2384185791, 67108864)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(2980232238, 3305111552)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(3725290298, 1983905792)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(2328306436, 2313682944)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(2910383045, 2892103680)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(3637978807, 393904128)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(2273736754, 1856802816)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(2842170943, 173519872)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(3552713678, 3438125312)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(2220446049, 1075086496)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(2775557561, 2417599944)]), $toNativeArray($kindUint64, [new $Uint64(0, 0), new $Uint64(3469446951, 4095741754)]), $toNativeArray($kindUint64, [new $Uint64(1073741824, 0), new $Uint64(2168404344, 4170451332)]), $toNativeArray($kindUint64, [new $Uint64(1342177280, 0), new $Uint64(2710505431, 918096869)]), $toNativeArray($kindUint64, [new $Uint64(2751463424, 0), new $Uint64(3388131789, 73879262)]), $toNativeArray($kindUint64, [new $Uint64(1291845632, 0), new $Uint64(4235164736, 1166090902)]), $toNativeArray($kindUint64, [new $Uint64(4028628992, 0), new $Uint64(2646977960, 728806813)]), $toNativeArray($kindUint64, [new $Uint64(1814560768, 0), new $Uint64(3308722450, 911008517)]), $toNativeArray($kindUint64, [new $Uint64(3341942784, 0), new $Uint64(4135903062, 3286244294)]), $toNativeArray($kindUint64, [new $Uint64(1014972416, 0), new $Uint64(2584939414, 980160860)]), $toNativeArray($kindUint64, [new $Uint64(1268715520, 0), new $Uint64(3231174267, 3372684723)]), $toNativeArray($kindUint64, [new $Uint64(512152576, 0), new $Uint64(4038967834, 3142114080)]), $toNativeArray($kindUint64, [new $Uint64(320095360, 0), new $Uint64(2524354896, 3037563124)]), $toNativeArray($kindUint64, [new $Uint64(400119200, 0), new $Uint64(3155443620, 3796953905)]), $toNativeArray($kindUint64, [new $Uint64(1573890824, 0), new $Uint64(3944304526, 451225085)]), $toNativeArray($kindUint64, [new $Uint64(1520552677, 0), new $Uint64(2465190328, 3503241150)]), $toNativeArray($kindUint64, [new $Uint64(4048174494, 1073741824), new $Uint64(3081487911, 84084141)]), $toNativeArray($kindUint64, [new $Uint64(1838992645, 3489660928), new $Uint64(3851859888, 3326330649)]), $toNativeArray($kindUint64, [new $Uint64(3833724963, 2717908992), new $Uint64(2407412430, 2078956655)]), $toNativeArray($kindUint64, [new $Uint64(3718414380, 2323644416), new $Uint64(3009265538, 451212171)]), $toNativeArray($kindUint64, [new $Uint64(3574276151, 2904555520), new $Uint64(3761581922, 2711498862)]), $toNativeArray($kindUint64, [new $Uint64(1160180770, 3425959936), new $Uint64(2350988701, 2768428613)]), $toNativeArray($kindUint64, [new $Uint64(2523967787, 2134966272), new $Uint64(2938735877, 239310294)]), $toNativeArray($kindUint64, [new $Uint64(1007476086, 1594966016), new $Uint64(3673419846, 1372879692)]), $toNativeArray($kindUint64, [new $Uint64(2777156201, 4218079232), new $Uint64(2295887403, 4079275279)]), $toNativeArray($kindUint64, [new $Uint64(2397703428, 2051373568), new $Uint64(2869859254, 4025352275)]), $toNativeArray($kindUint64, [new $Uint64(1923387461, 2564216960), new $Uint64(3587324068, 2884206696)]), $toNativeArray($kindUint64, [new $Uint64(1202117163, 2139506512), new $Uint64(2242077542, 3950112833)]), $toNativeArray($kindUint64, [new $Uint64(2576388278, 1600641316), new $Uint64(2802596928, 2790157393)]), $toNativeArray($kindUint64, [new $Uint64(4294227171, 4148285293), new $Uint64(3503246160, 3487696741)]), $toNativeArray($kindUint64, [new $Uint64(3220762894, 2055807396), new $Uint64(2189528850, 2179810463)]), $toNativeArray($kindUint64, [new $Uint64(2952211794, 422275597), new $Uint64(2736911063, 577279431)]), $toNativeArray($kindUint64, [new $Uint64(2616522918, 2675328144), new $Uint64(3421138828, 3942824761)]), $toNativeArray($kindUint64, [new $Uint64(49428176, 1196676532), new $Uint64(4276423536, 633563656)]), $toNativeArray($kindUint64, [new $Uint64(30892610, 747922832), new $Uint64(2672764710, 395977285)]), $toNativeArray($kindUint64, [new $Uint64(1112357586, 3082387189), new $Uint64(3340955887, 2642455254)]), $toNativeArray($kindUint64, [new $Uint64(3537930631, 1705500338), new $Uint64(4176194859, 2229327243)]), $toNativeArray($kindUint64, [new $Uint64(1674335732, 2676550447), new $Uint64(2610121787, 856458615)]), $toNativeArray($kindUint64, [new $Uint64(1019177841, 3345688059), new $Uint64(3262652233, 4291798741)]), $toNativeArray($kindUint64, [new $Uint64(2347714126, 960884602), new $Uint64(4078315292, 2143522954)]), $toNativeArray($kindUint64, [new $Uint64(2541063152, 3821778348), new $Uint64(2548947057, 3487185494)]), $toNativeArray($kindUint64, [new $Uint64(1028845293, 482255639), new $Uint64(3186183822, 1137756396)]), $toNativeArray($kindUint64, [new $Uint64(1286056616, 1676561373), new $Uint64(3982729777, 3569679143)]), $toNativeArray($kindUint64, [new $Uint64(2414398121, 1047850858), new $Uint64(2489206111, 620436728)]), $toNativeArray($kindUint64, [new $Uint64(3017997651, 2383555396), new $Uint64(3111507638, 3996771382)]), $toNativeArray($kindUint64, [new $Uint64(1625013416, 1905702422), new $Uint64(3889384548, 2848480580)]), $toNativeArray($kindUint64, [new $Uint64(3163117033, 1191064013), new $Uint64(2430865342, 3927784010)]), $toNativeArray($kindUint64, [new $Uint64(1806412643, 2562571841), new $Uint64(3038581678, 2762246365)]), $toNativeArray($kindUint64, [new $Uint64(3331757628, 2129472977), new $Uint64(3798227098, 1305324308)]), $toNativeArray($kindUint64, [new $Uint64(4229832165, 3478404258), new $Uint64(2373891936, 1889569516)]), $toNativeArray($kindUint64, [new $Uint64(992322911, 1126779851), new $Uint64(2967364920, 2361961896)]), $toNativeArray($kindUint64, [new $Uint64(1240403639, 334732990), new $Uint64(3709206150, 2952452370)]), $toNativeArray($kindUint64, [new $Uint64(1848994098, 1819820855), new $Uint64(2318253844, 771540907)]), $toNativeArray($kindUint64, [new $Uint64(1237500799, 127292420), new $Uint64(2897817305, 964426134)]), $toNativeArray($kindUint64, [new $Uint64(3694359646, 3380340998), new $Uint64(3622271631, 2279274491)]), $toNativeArray($kindUint64, [new $Uint64(1772103867, 1038971299), new $Uint64(2263919769, 3035159293)]), $toNativeArray($kindUint64, [new $Uint64(3288871658, 224972300), new $Uint64(2829899712, 572723644)]), $toNativeArray($kindUint64, [new $Uint64(4111089572, 2428699024), new $Uint64(3537374640, 715904555)]), $toNativeArray($kindUint64, [new $Uint64(2032560070, 3665420538), new $Uint64(2210859150, 447440347)]), $toNativeArray($kindUint64, [new $Uint64(1466958264, 2434292024), new $Uint64(2763573937, 2706784082)]), $toNativeArray($kindUint64, [new $Uint64(3981181478, 3042865030), new $Uint64(3454467422, 162254630)]), $toNativeArray($kindUint64, [new $Uint64(1414496600, 828048820), new $Uint64(2159042138, 3322634616)]), $toNativeArray($kindUint64, [new $Uint64(1768120750, 1035061025), new $Uint64(2698802673, 2005809622)]), $toNativeArray($kindUint64, [new $Uint64(62667289, 3441309929), new $Uint64(3373503341, 3581003852)]), $toNativeArray($kindUint64, [new $Uint64(78334112, 1080411939), new $Uint64(4216879177, 1255029343)]), $toNativeArray($kindUint64, [new $Uint64(1659571556, 675257462), new $Uint64(2635549485, 3468747899)]), $toNativeArray($kindUint64, [new $Uint64(1000722621, 844071828), new $Uint64(3294436857, 1114709402)]), $toNativeArray($kindUint64, [new $Uint64(3398386924, 2128831609), new $Uint64(4118046071, 2467128576)]), $toNativeArray($kindUint64, [new $Uint64(2123991827, 3478003403), new $Uint64(2573778794, 3152568096)]), $toNativeArray($kindUint64, [new $Uint64(2654989784, 3273762430), new $Uint64(3217223493, 1793226472)]), $toNativeArray($kindUint64, [new $Uint64(3318737230, 4092203038), new $Uint64(4021529366, 3315274914)]), $toNativeArray($kindUint64, [new $Uint64(3147952593, 1483885074), new $Uint64(2513455854, 998304997)]), $toNativeArray($kindUint64, [new $Uint64(713715269, 2928598167), new $Uint64(3141819817, 3395364895)]), $toNativeArray($kindUint64, [new $Uint64(4113369559, 439522237), new $Uint64(3927274772, 1022980646)]), $toNativeArray($kindUint64, [new $Uint64(1497114150, 1885314134), new $Uint64(2454546732, 2786846552)]), $toNativeArray($kindUint64, [new $Uint64(1871392688, 209159020), new $Uint64(3068183415, 3483558190)]), $toNativeArray($kindUint64, [new $Uint64(191757212, 261448775), new $Uint64(3835229269, 3280705914)]), $toNativeArray($kindUint64, [new $Uint64(1193590081, 2310889132), new $Uint64(2397018293, 2587312108)]), $toNativeArray($kindUint64, [new $Uint64(1491987601, 3962353239), new $Uint64(2996272867, 12914663)]), $toNativeArray($kindUint64, [new $Uint64(791242678, 1731716077), new $Uint64(3745341083, 3237368801)]), $toNativeArray($kindUint64, [new $Uint64(3178881234, 8580724), new $Uint64(2340838177, 1486484588)]), $toNativeArray($kindUint64, [new $Uint64(3973601542, 2158209553), new $Uint64(2926047721, 2931847559)]), $toNativeArray($kindUint64, [new $Uint64(3893260104, 550278293), new $Uint64(3657559652, 443583977)]), $toNativeArray($kindUint64, [new $Uint64(822674829, 343923933), new $Uint64(2285974782, 2424723634)]), $toNativeArray($kindUint64, [new $Uint64(3175827184, 1503646741), new $Uint64(2857468478, 883420894)]), $toNativeArray($kindUint64, [new $Uint64(1822300332, 1879558426), new $Uint64(3571835597, 3251759766)]), $toNativeArray($kindUint64, [new $Uint64(65195883, 3322207664), new $Uint64(2232397248, 2569220766)]), $toNativeArray($kindUint64, [new $Uint64(2228978502, 3079017756), new $Uint64(2790496560, 3211525957)]), $toNativeArray($kindUint64, [new $Uint64(3859964952, 1701288547), new $Uint64(3488120700, 4014407446)]), $toNativeArray($kindUint64, [new $Uint64(1338736271, 1063305342), new $Uint64(2180075438, 361521006)]), $toNativeArray($kindUint64, [new $Uint64(3820903987, 255389853), new $Uint64(2725094297, 2599384905)]), $toNativeArray($kindUint64, [new $Uint64(1554904511, 3540462789), new $Uint64(3406367872, 28005660)]), $toNativeArray($kindUint64, [new $Uint64(1943630639, 3351836662), new $Uint64(4257959840, 35007075)]), $toNativeArray($kindUint64, [new $Uint64(677898237, 3705510650), new $Uint64(2661224900, 21879422)]), $toNativeArray($kindUint64, [new $Uint64(2994856445, 1410662840), new $Uint64(3326531125, 27349277)]), $toNativeArray($kindUint64, [new $Uint64(522345084, 2837070374), new $Uint64(4158163906, 1107928421)]), $toNativeArray($kindUint64, [new $Uint64(863336589, 3920652632), new $Uint64(2598852441, 1766197087)]), $toNativeArray($kindUint64, [new $Uint64(5428913, 1679590318), new $Uint64(3248565551, 3281488183)]), $toNativeArray($kindUint64, [new $Uint64(3228011613, 3173229722), new $Uint64(4060706939, 3028118404)]), $toNativeArray($kindUint64, [new $Uint64(4164990906, 2520139488), new $Uint64(2537941837, 1355703090)]), $toNativeArray($kindUint64, [new $Uint64(3058754985, 1002690712), new $Uint64(3172427296, 2768370687)]), $toNativeArray($kindUint64, [new $Uint64(2749701907, 2327105214), new $Uint64(3965534120, 3460463359)]), $toNativeArray($kindUint64, [new $Uint64(3329176428, 917569847), new $Uint64(2478458825, 2162789599)]), $toNativeArray($kindUint64, [new $Uint64(3087728711, 1146962308), new $Uint64(3098073531, 3777228823)]), $toNativeArray($kindUint64, [new $Uint64(2785919065, 359961061), new $Uint64(3872591914, 3647794205)]), $toNativeArray($kindUint64, [new $Uint64(2278070327, 2909330223), new $Uint64(2420369946, 3353613202)]), $toNativeArray($kindUint64, [new $Uint64(700104261, 2562920955), new $Uint64(3025462433, 2044532855)]), $toNativeArray($kindUint64, [new $Uint64(4096355798, 4277393018), new $Uint64(3781828041, 3629407892)]), $toNativeArray($kindUint64, [new $Uint64(412738726, 1599628812), new $Uint64(2363642526, 657767197)]), $toNativeArray($kindUint64, [new $Uint64(1589665231, 4147019663), new $Uint64(2954553157, 2969692644)]), $toNativeArray($kindUint64, [new $Uint64(1987081539, 4110032755), new $Uint64(3693191447, 490890333)]), $toNativeArray($kindUint64, [new $Uint64(1778796874, 2031899560), new $Uint64(2308244654, 1917419194)]), $toNativeArray($kindUint64, [new $Uint64(76012445, 392390802), new $Uint64(2885305818, 249290345)]), $toNativeArray($kindUint64, [new $Uint64(1168757380, 1564230326), new $Uint64(3606632272, 2459096579)]), $toNativeArray($kindUint64, [new $Uint64(193602450, 3125127602), new $Uint64(2254145170, 1536935362)]), $toNativeArray($kindUint64, [new $Uint64(2389486711, 1758925854), new $Uint64(2817681462, 4068652850)]), $toNativeArray($kindUint64, [new $Uint64(839374741, 1124915494), new $Uint64(3522101828, 2938332415)]), $toNativeArray($kindUint64, [new $Uint64(2135221949, 1239943096), new $Uint64(2201313642, 3983941407)]), $toNativeArray($kindUint64, [new $Uint64(1595285612, 2623670694), new $Uint64(2751642053, 2832443111)]), $toNativeArray($kindUint64, [new $Uint64(920365191, 3279588367), new $Uint64(3439552567, 319328417)]), $toNativeArray($kindUint64, [new $Uint64(3259582804, 3660355465), new $Uint64(2149720354, 1810192996)]), $toNativeArray($kindUint64, [new $Uint64(4074478506, 280477036), new $Uint64(2687150443, 115257597)]), $toNativeArray($kindUint64, [new $Uint64(1871872660, 2498079943), new $Uint64(3358938053, 3365297469)]), $toNativeArray($kindUint64, [new $Uint64(3413582649, 3122599929), new $Uint64(4198672567, 985396364)]), $toNativeArray($kindUint64, [new $Uint64(4280972804, 341012219), new $Uint64(2624170354, 2226485463)]), $toNativeArray($kindUint64, [new $Uint64(4277474181, 426265274), new $Uint64(3280212943, 635623181)]), $toNativeArray($kindUint64, [new $Uint64(2125617254, 1606573417), new $Uint64(4100266178, 4015754449)]), $toNativeArray($kindUint64, [new $Uint64(4012865343, 4225333857), new $Uint64(2562666361, 3583588354)]), $toNativeArray($kindUint64, [new $Uint64(2868598031, 4207925498), new $Uint64(3203332952, 1258259971)]), $toNativeArray($kindUint64, [new $Uint64(2512005715, 4186165048), new $Uint64(4004166190, 1572824964)]), $toNativeArray($kindUint64, [new $Uint64(3717487220, 2079482243), new $Uint64(2502603868, 4204241074)]), $toNativeArray($kindUint64, [new $Uint64(2499375377, 2599352804), new $Uint64(3128254836, 960334047)]), $toNativeArray($kindUint64, [new $Uint64(2050477398, 27965533), new $Uint64(3910318545, 1200417559)]), $toNativeArray($kindUint64, [new $Uint64(2892161109, 3238703930), new $Uint64(2443949090, 3434615534)]), $toNativeArray($kindUint64, [new $Uint64(1467717739, 827154441), new $Uint64(3054936363, 2145785770)]), $toNativeArray($kindUint64, [new $Uint64(3982130821, 4255168523), new $Uint64(3818670454, 1608490388)]), $toNativeArray($kindUint64, [new $Uint64(341348115, 3196351239), new $Uint64(2386669033, 4226531965)]), $toNativeArray($kindUint64, [new $Uint64(1500426968, 2921697224), new $Uint64(2983336292, 2061939484)]), $toNativeArray($kindUint64, [new $Uint64(1875533710, 3652121531), new $Uint64(3729170365, 2577424355)]), $toNativeArray($kindUint64, [new $Uint64(635337657, 1208834132), new $Uint64(2330731478, 2147761134)]), $toNativeArray($kindUint64, [new $Uint64(2941655719, 2584784490), new $Uint64(2913414348, 537217769)]), $toNativeArray($kindUint64, [new $Uint64(455844177, 2157238788), new $Uint64(3641767935, 671522212)]), $toNativeArray($kindUint64, [new $Uint64(2432386258, 4032628802), new $Uint64(2276104959, 2030314118)]), $toNativeArray($kindUint64, [new $Uint64(892999175, 2893302355), new $Uint64(2845131199, 1464150824)]), $toNativeArray($kindUint64, [new $Uint64(1116248969, 2542886120), new $Uint64(3556413999, 756446706)]), $toNativeArray($kindUint64, [new $Uint64(1771397429, 4273658385), new $Uint64(2222758749, 2083391927)]), $toNativeArray($kindUint64, [new $Uint64(1140504963, 2120847509), new $Uint64(2778448436, 3677981733)]), $toNativeArray($kindUint64, [new $Uint64(2499373028, 1577317563), new $Uint64(3473060546, 302509870)]), $toNativeArray($kindUint64, [new $Uint64(488366318, 3133307125), new $Uint64(2170662841, 1262810493)]), $toNativeArray($kindUint64, [new $Uint64(1684199722, 1769150258), new $Uint64(2713328551, 2652254940)]), $toNativeArray($kindUint64, [new $Uint64(2105249653, 63954174), new $Uint64(3391660689, 2241576851)]), $toNativeArray($kindUint64, [new $Uint64(1557820242, 1153684542), new $Uint64(4239575861, 3875712888)]), $toNativeArray($kindUint64, [new $Uint64(973637651, 1794794663), new $Uint64(2649734913, 2959191467)]), $toNativeArray($kindUint64, [new $Uint64(143305240, 1169751504), new $Uint64(3312168642, 477763862)]), $toNativeArray($kindUint64, [new $Uint64(2326615198, 1462189381), new $Uint64(4140210802, 2744688475)]), $toNativeArray($kindUint64, [new $Uint64(917263586, 4135093835), new $Uint64(2587631751, 2789172121)]), $toNativeArray($kindUint64, [new $Uint64(2220321307, 3021383645), new $Uint64(3234539689, 2412723327)]), $toNativeArray($kindUint64, [new $Uint64(1701659810, 2702987733), new $Uint64(4043174611, 4089645983)]), $toNativeArray($kindUint64, [new $Uint64(2674150117, 2763109157), new $Uint64(2526984132, 2019157827)]), $toNativeArray($kindUint64, [new $Uint64(2268945823, 232660974), new $Uint64(3158730165, 2523947284)]), $toNativeArray($kindUint64, [new $Uint64(2836182278, 3512051690), new $Uint64(3948412706, 4228675929)]), $toNativeArray($kindUint64, [new $Uint64(162001188, 1121290482), new $Uint64(2467757941, 3716664280)]), $toNativeArray($kindUint64, [new $Uint64(202501485, 1401613103), new $Uint64(3084697427, 1424604878)]), $toNativeArray($kindUint64, [new $Uint64(2400610504, 2825758202), new $Uint64(3855871784, 707014273)]), $toNativeArray($kindUint64, [new $Uint64(4184736125, 1766098876), new $Uint64(2409919865, 441883920)]), $toNativeArray($kindUint64, [new $Uint64(935952860, 3281365420), new $Uint64(3012399831, 1626096725)]), $toNativeArray($kindUint64, [new $Uint64(2243682899, 4101706775), new $Uint64(3765499789, 958879082)]), $toNativeArray($kindUint64, [new $Uint64(2476043636, 2026695822), new $Uint64(2353437368, 1136170338)]), $toNativeArray($kindUint64, [new $Uint64(947570897, 2533369778), new $Uint64(2941796710, 1420212923)]), $toNativeArray($kindUint64, [new $Uint64(110721797, 4240454046), new $Uint64(3677245887, 3922749802)]), $toNativeArray($kindUint64, [new $Uint64(1142942947, 3187154691), new $Uint64(2298278679, 4062331362)]), $toNativeArray($kindUint64, [new $Uint64(3576162332, 2910201539), new $Uint64(2872848349, 4004172378)]), $toNativeArray($kindUint64, [new $Uint64(2322719267, 3637751924), new $Uint64(3591060437, 1783990001)]), $toNativeArray($kindUint64, [new $Uint64(4136054102, 1736724041), new $Uint64(2244412773, 1651864662)]), $toNativeArray($kindUint64, [new $Uint64(3022583980, 23421403), new $Uint64(2805515966, 3138572652)]), $toNativeArray($kindUint64, [new $Uint64(3778229975, 29276754), new $Uint64(3506894958, 1775732167)]), $toNativeArray($kindUint64, [new $Uint64(3972006470, 1628910707), new $Uint64(2191809349, 36090780)]), $toNativeArray($kindUint64, [new $Uint64(670040791, 4183622032), new $Uint64(2739761686, 1118855300)]), $toNativeArray($kindUint64, [new $Uint64(837550989, 4155785716), new $Uint64(3424702107, 3546052773)]), $toNativeArray($kindUint64, [new $Uint64(2120680561, 1973506673), new $Uint64(4280877634, 3358824142)]), $toNativeArray($kindUint64, [new $Uint64(251683526, 3917796230), new $Uint64(2675548521, 3173006913)]), $toNativeArray($kindUint64, [new $Uint64(1388346232, 2749761640), new $Uint64(3344435652, 745033169)]), $toNativeArray($kindUint64, [new $Uint64(2809174614, 3437202050), new $Uint64(4180544565, 931291461)]), $toNativeArray($kindUint64, [new $Uint64(2292605046, 1074509457), new $Uint64(2612840353, 1118928075)]), $toNativeArray($kindUint64, [new $Uint64(1792014483, 3490620469), new $Uint64(3266050441, 2472401918)]), $toNativeArray($kindUint64, [new $Uint64(92534456, 3289533763), new $Uint64(4082563051, 4164244222)]), $toNativeArray($kindUint64, [new $Uint64(3279059507, 2055958602), new $Uint64(2551601907, 2065781726)]), $toNativeArray($kindUint64, [new $Uint64(1951340736, 1496206428), new $Uint64(3189502384, 1508485334)]), $toNativeArray($kindUint64, [new $Uint64(291692272, 1870258035), new $Uint64(3986877980, 1885606668)]), $toNativeArray($kindUint64, [new $Uint64(2329791318, 1168911272), new $Uint64(2491798737, 3325987815)]), $toNativeArray($kindUint64, [new $Uint64(1838497323, 3608622738), new $Uint64(3114748422, 936259297)]), $toNativeArray($kindUint64, [new $Uint64(3371863478, 3437036599), new $Uint64(3893435527, 3317807769)]), $toNativeArray($kindUint64, [new $Uint64(496801938, 1074406050), new $Uint64(2433397204, 3684242592)]), $toNativeArray($kindUint64, [new $Uint64(621002422, 3490491211), new $Uint64(3041746506, 310335944)]), $toNativeArray($kindUint64, [new $Uint64(776253028, 2215630365), new $Uint64(3802183132, 2535403578)]), $toNativeArray($kindUint64, [new $Uint64(1558899966, 3532252626), new $Uint64(2376364457, 3732110884)]), $toNativeArray($kindUint64, [new $Uint64(1948624958, 2267832135), new $Uint64(2970455572, 1443913133)]), $toNativeArray($kindUint64, [new $Uint64(3509523022, 687306521), new $Uint64(3713069465, 1804891416)]), $toNativeArray($kindUint64, [new $Uint64(2193451888, 3650792047), new $Uint64(2320668415, 3812411695)]), $toNativeArray($kindUint64, [new $Uint64(1668073037, 268522763), new $Uint64(2900835519, 3691772795)]), $toNativeArray($kindUint64, [new $Uint64(1011349472, 1409395278), new $Uint64(3626044399, 3540974170)]), $toNativeArray($kindUint64, [new $Uint64(1705835244, 880872049), new $Uint64(2266277749, 3823721592)]), $toNativeArray($kindUint64, [new $Uint64(2132294055, 1101090061), new $Uint64(2832847187, 1558426518)]), $toNativeArray($kindUint64, [new $Uint64(517883921, 302620752), new $Uint64(3541058984, 874291324)]), $toNativeArray($kindUint64, [new $Uint64(2471161098, 2873492530), new $Uint64(2213161865, 546432077)]), $toNativeArray($kindUint64, [new $Uint64(4162693197, 1444382015), new $Uint64(2766452331, 1756781920)]), $toNativeArray($kindUint64, [new $Uint64(908399200, 2879219342), new $Uint64(3458065414, 1122235577)]), $toNativeArray($kindUint64, [new $Uint64(3252104060, 1799512089), new $Uint64(2161290883, 3922622707)]), $toNativeArray($kindUint64, [new $Uint64(2991388251, 2249390111), new $Uint64(2701613604, 3829536560)]), $toNativeArray($kindUint64, [new $Uint64(3739235314, 1737995815), new $Uint64(3377017006, 491953404)]), $toNativeArray($kindUint64, [new $Uint64(379076847, 25011121), new $Uint64(4221271257, 2762425404)]), $toNativeArray($kindUint64, [new $Uint64(2384406677, 1626244686), new $Uint64(2638294536, 115903141)]), $toNativeArray($kindUint64, [new $Uint64(4054250170, 3106547682), new $Uint64(3297868170, 144878926)]), $toNativeArray($kindUint64, [new $Uint64(2920329065, 1735700955), new $Uint64(4122335212, 2328582306)]), $toNativeArray($kindUint64, [new $Uint64(2898947489, 3769167657), new $Uint64(2576459507, 3602847589)]), $toNativeArray($kindUint64, [new $Uint64(402458890, 1490234099), new $Uint64(3220574384, 3429817663)]), $toNativeArray($kindUint64, [new $Uint64(3724299084, 4010276272), new $Uint64(4025717980, 4287272078)]), $toNativeArray($kindUint64, [new $Uint64(1253945104, 358939022), new $Uint64(2516073738, 532061401)]), $toNativeArray($kindUint64, [new $Uint64(2641173204, 448673777), new $Uint64(3145092172, 2812560399)]), $toNativeArray($kindUint64, [new $Uint64(2227724681, 560842221), new $Uint64(3931365215, 3515700499)]), $toNativeArray($kindUint64, [new $Uint64(855457013, 3034880948), new $Uint64(2457103259, 3807925548)]), $toNativeArray($kindUint64, [new $Uint64(1069321267, 572375713), new $Uint64(3071379074, 3686165111)]), $toNativeArray($kindUint64, [new $Uint64(262909759, 3936695114), new $Uint64(3839223843, 2460222741)]), $toNativeArray($kindUint64, [new $Uint64(701189511, 4071047182), new $Uint64(2399514902, 1000768301)]), $toNativeArray($kindUint64, [new $Uint64(1950228713, 4015067154), new $Uint64(2999393627, 3398444024)]), $toNativeArray($kindUint64, [new $Uint64(2437785892, 1797608470), new $Uint64(3749242034, 3174313206)]), $toNativeArray($kindUint64, [new $Uint64(449874358, 3270988942), new $Uint64(2343276271, 3057687578)]), $toNativeArray($kindUint64, [new $Uint64(2709826596, 1941252529), new $Uint64(2929095339, 2748367648)]), $toNativeArray($kindUint64, [new $Uint64(3387283245, 2426565662), new $Uint64(3661369174, 2361717736)]), $toNativeArray($kindUint64, [new $Uint64(2117052028, 2053474450), new $Uint64(2288355734, 402331761)]), $toNativeArray($kindUint64, [new $Uint64(3720056859, 2566843063), new $Uint64(2860444667, 2650398349)]), $toNativeArray($kindUint64, [new $Uint64(1428845602, 2134812005), new $Uint64(3575555834, 2239256113)]), $toNativeArray($kindUint64, [new $Uint64(3577383061, 2407999327), new $Uint64(2234722396, 2473276894)]), $toNativeArray($kindUint64, [new $Uint64(2324245178, 4083740983), new $Uint64(2793402995, 3091596118)]), $toNativeArray($kindUint64, [new $Uint64(757822825, 2957192581), new $Uint64(3491753744, 2790753324)]), $toNativeArray($kindUint64, [new $Uint64(2621122914, 237632627), new $Uint64(2182346090, 1744220827)]), $toNativeArray($kindUint64, [new $Uint64(2202661818, 2444524431), new $Uint64(2727932613, 32792386)]), $toNativeArray($kindUint64, [new $Uint64(605843625, 908171891), new $Uint64(3409915766, 1114732307)]), $toNativeArray($kindUint64, [new $Uint64(3978530003, 2208956688), new $Uint64(4262394707, 3540899031)]), $toNativeArray($kindUint64, [new $Uint64(4097193988, 843727018), new $Uint64(2663996692, 1676190982)]), $toNativeArray($kindUint64, [new $Uint64(2974008837, 1054658773), new $Uint64(3329995865, 2095238728)]), $toNativeArray($kindUint64, [new $Uint64(3717511046, 2392065290), new $Uint64(4162494831, 3692790234)]), $toNativeArray($kindUint64, [new $Uint64(3397186228, 421298982), new $Uint64(2601559269, 3918606632)]), $toNativeArray($kindUint64, [new $Uint64(4246482785, 526623728), new $Uint64(3251949087, 1677032818)]), $toNativeArray($kindUint64, [new $Uint64(3160619833, 1732021484), new $Uint64(4064936359, 1022549199)]), $toNativeArray($kindUint64, [new $Uint64(3586000131, 3766867987), new $Uint64(2540585224, 2249705985)]), $toNativeArray($kindUint64, [new $Uint64(1261274692, 3634843160), new $Uint64(3175731530, 2812132482)]), $toNativeArray($kindUint64, [new $Uint64(3724077014, 248586654), new $Uint64(3969664413, 1367681954)]), $toNativeArray($kindUint64, [new $Uint64(3401289957, 3376592131), new $Uint64(2481040258, 1391672133)]), $toNativeArray($kindUint64, [new $Uint64(1030386975, 999514691), new $Uint64(3101300322, 3887073815)]), $toNativeArray($kindUint64, [new $Uint64(214241895, 175651540), new $Uint64(3876625403, 2711358621)]), $toNativeArray($kindUint64, [new $Uint64(670772096, 1720394949), new $Uint64(2422890877, 1157728226)]), $toNativeArray($kindUint64, [new $Uint64(2985948768, 2150493686), new $Uint64(3028613596, 2520902106)]), $toNativeArray($kindUint64, [new $Uint64(1584952312, 2688117107), new $Uint64(3785766995, 3151127633)]), $toNativeArray($kindUint64, [new $Uint64(3674949755, 1680073192), new $Uint64(2366104372, 1432583858)]), $toNativeArray($kindUint64, [new $Uint64(2446203546, 1026349666), new $Uint64(2957630465, 1790729823)]), $toNativeArray($kindUint64, [new $Uint64(1984012608, 3430420731), new $Uint64(3697038081, 3312154103)]), $toNativeArray($kindUint64, [new $Uint64(2850620616, 2144012957), new $Uint64(2310648801, 459483578)]), $toNativeArray($kindUint64, [new $Uint64(1415792122, 2680016196), new $Uint64(2888311001, 1648096297)]), $toNativeArray($kindUint64, [new $Uint64(2843481977, 1202536597), new $Uint64(3610388751, 3133862195)]), $toNativeArray($kindUint64, [new $Uint64(1240305323, 3435939933), new $Uint64(2256492969, 3569276608)]), $toNativeArray($kindUint64, [new $Uint64(1550381654, 3221183092), new $Uint64(2820616212, 1240370288)]), $toNativeArray($kindUint64, [new $Uint64(1937977068, 1878995217), new $Uint64(3525770265, 1550462860)]), $toNativeArray($kindUint64, [new $Uint64(3358719315, 3321855659), new $Uint64(2203606415, 3653393847)]), $toNativeArray($kindUint64, [new $Uint64(3124657320, 3078577749), new $Uint64(2754508019, 3493000485)]), $toNativeArray($kindUint64, [new $Uint64(684596178, 3848222187), new $Uint64(3443135024, 3292508783)]), $toNativeArray($kindUint64, [new $Uint64(2038485347, 3478880691), new $Uint64(2151959390, 2057817989)]), $toNativeArray($kindUint64, [new $Uint64(3621848508, 3274859039), new $Uint64(2689949238, 424788838)]), $toNativeArray($kindUint64, [new $Uint64(2379826987, 4093573799), new $Uint64(3362436547, 2678469696)]), $toNativeArray($kindUint64, [new $Uint64(2974783734, 4043225425), new $Uint64(4203045684, 2274345296)]), $toNativeArray($kindUint64, [new $Uint64(1859239834, 1453274067), new $Uint64(2626903552, 3568949458)]), $toNativeArray($kindUint64, [new $Uint64(176566144, 3964076232), new $Uint64(3283629441, 166219527)]), $toNativeArray($kindUint64, [new $Uint64(3441933153, 660127994), new $Uint64(4104536801, 1281516232)]), $toNativeArray($kindUint64, [new $Uint64(2151208220, 3096934556), new $Uint64(2565335500, 3485302205)]), $toNativeArray($kindUint64, [new $Uint64(3762752099, 3871168195), new $Uint64(3206669376, 61660460)]), $toNativeArray($kindUint64, [new $Uint64(408472828, 3765218420), new $Uint64(4008336720, 77075576)]), $toNativeArray($kindUint64, [new $Uint64(255295518, 205777864), new $Uint64(2505210450, 48172235)]), $toNativeArray($kindUint64, [new $Uint64(3540344869, 2404705978), new $Uint64(3131513062, 2207698941)]), $toNativeArray($kindUint64, [new $Uint64(1204205614, 4079624297), new $Uint64(3914391328, 612140029)]), $toNativeArray($kindUint64, [new $Uint64(1289499421, 1476023361), new $Uint64(2446494580, 382587518)]), $toNativeArray($kindUint64, [new $Uint64(3759357924, 2918771026), new $Uint64(3058118225, 478234397)]), $toNativeArray($kindUint64, [new $Uint64(1477971933, 3648463782), new $Uint64(3822647781, 1671534821)]), $toNativeArray($kindUint64, [new $Uint64(1460603370, 2817160776), new $Uint64(2389154863, 1581580175)]), $toNativeArray($kindUint64, [new $Uint64(752012389, 1373967322), new $Uint64(2986443579, 903233395)]), $toNativeArray($kindUint64, [new $Uint64(4161240958, 2791200977), new $Uint64(3733054474, 55299919)]), $toNativeArray($kindUint64, [new $Uint64(4211388335, 670758786), new $Uint64(2333159046, 1108304273)]), $toNativeArray($kindUint64, [new $Uint64(2043009946, 4059673955), new $Uint64(2916448807, 3532863990)]), $toNativeArray($kindUint64, [new $Uint64(406278785, 2927108796), new $Uint64(3645561009, 3342338164)]), $toNativeArray($kindUint64, [new $Uint64(2401407889, 218830261), new $Uint64(2278475631, 478348616)]), $toNativeArray($kindUint64, [new $Uint64(3001759861, 1347279650), new $Uint64(2848094538, 3819161242)]), $toNativeArray($kindUint64, [new $Uint64(1604716178, 2757841387), new $Uint64(3560118173, 2626467905)]), $toNativeArray($kindUint64, [new $Uint64(3687302171, 2797392691), new $Uint64(2225073858, 2178413352)]), $toNativeArray($kindUint64, [new $Uint64(314160418, 2422999040), new $Uint64(2781342323, 575533043)]), $toNativeArray($kindUint64, [new $Uint64(3613925995, 881265152), new $Uint64(3476677903, 3940641775)]), $toNativeArray($kindUint64, [new $Uint64(3869316483, 13919808), new $Uint64(2172923689, 4073513845)]), $toNativeArray($kindUint64, [new $Uint64(1615420131, 3238625232), new $Uint64(2716154612, 1870666835)]), $toNativeArray($kindUint64, [new $Uint64(945533340, 2974539716), new $Uint64(3395193265, 2338333544)]), $toNativeArray($kindUint64, [new $Uint64(1181916675, 3718174645), new $Uint64(4243991581, 3996658754)]), $toNativeArray($kindUint64, [new $Uint64(1812439746, 1786988241), new $Uint64(2652494738, 3034782633)]), $toNativeArray($kindUint64, [new $Uint64(3339291507, 86251653), new $Uint64(3315618423, 1645994643)]), $toNativeArray($kindUint64, [new $Uint64(3100372559, 3329040039), new $Uint64(4144523029, 983751480)]), $toNativeArray($kindUint64, [new $Uint64(1937732849, 3691262760), new $Uint64(2590326893, 1151715587)]), $toNativeArray($kindUint64, [new $Uint64(1348424238, 1392852978), new $Uint64(3237908616, 2513386308)]), $toNativeArray($kindUint64, [new $Uint64(1685530297, 3888549871), new $Uint64(4047385770, 3141732885)]), $toNativeArray($kindUint64, [new $Uint64(1590327348, 819730933), new $Uint64(2529616106, 3037324877)]), $toNativeArray($kindUint64, [new $Uint64(3061651009, 1024663666), new $Uint64(3162020133, 1649172448)]), $toNativeArray($kindUint64, [new $Uint64(3827063761, 2354571407), new $Uint64(3952525166, 3135207384)]), $toNativeArray($kindUint64, [new $Uint64(2391914850, 4155961689), new $Uint64(2470328229, 885762791)]), $toNativeArray($kindUint64, [new $Uint64(1916151739, 3047468464), new $Uint64(3087910286, 2180945313)]), $toNativeArray($kindUint64, [new $Uint64(3468931498, 2735593756), new $Uint64(3859887858, 578697993)]), $toNativeArray($kindUint64, [new $Uint64(557469450, 2783487921), new $Uint64(2412429911, 1435428070)]), $toNativeArray($kindUint64, [new $Uint64(2844320461, 1331876253), new $Uint64(3015537389, 720543263)]), $toNativeArray($kindUint64, [new $Uint64(2481658752, 2738587141), new $Uint64(3769421736, 1974420903)]), $toNativeArray($kindUint64, [new $Uint64(3161649456, 1711616963), new $Uint64(2355888585, 1234013064)]), $toNativeArray($kindUint64, [new $Uint64(3952061820, 2139521204), new $Uint64(2944860731, 2616258154)]), $toNativeArray($kindUint64, [new $Uint64(2792593627, 2674401505), new $Uint64(3681075914, 2196580869)]), $toNativeArray($kindUint64, [new $Uint64(2282241929, 1134630028), new $Uint64(2300672446, 2446604867)]), $toNativeArray($kindUint64, [new $Uint64(1779060587, 2492029360), new $Uint64(2875840558, 910772436)]), $toNativeArray($kindUint64, [new $Uint64(2223825734, 2041294876), new $Uint64(3594800697, 3285949193)]), $toNativeArray($kindUint64, [new $Uint64(4074245644, 202067473), new $Uint64(2246750436, 443105509)]), $toNativeArray($kindUint64, [new $Uint64(1871581583, 252584341), new $Uint64(2808438045, 553881887)]), $toNativeArray($kindUint64, [new $Uint64(1265735154, 3536955899), new $Uint64(3510547556, 1766094183)])]); leftcheats = new sliceType$2([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")]); $pkg.ErrRange = errors.New("value out of range"); $pkg.ErrSyntax = errors.New("invalid syntax"); optimize = true; powtab = new sliceType$3([1, 3, 6, 9, 13, 16, 19, 23, 26]); float64pow10 = new sliceType$4([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$5([1, 10, 100, 1000, 10000, 100000, 1e+06, 1e+07, 1e+08, 1e+09, 1e+10]); /* */ } 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, abi, goexperiment, itoa, unsafeheader, math, runtime, strconv, sync, unicode, utf8, Value, flag, ValueError, MapIter, Type, Kind, tflag, rtype, method, ChanDir, arrayType, chanType, imethod, interfaceType, mapType, ptrType, sliceType, structField, structType, Method, nameOff, typeOff, textOff, StructField, StructTag, fieldScan, uncommonType, funcType, name, nameData, mapIter, sliceType$1, ptrType$1, sliceType$2, sliceType$3, sliceType$4, ptrType$2, funcType$1, sliceType$6, ptrType$4, sliceType$7, sliceType$8, ptrType$7, sliceType$10, ptrType$8, sliceType$11, ptrType$9, ptrType$10, sliceType$12, ptrType$11, ptrType$12, sliceType$14, sliceType$15, ptrType$16, structType$3, sliceType$16, ptrType$17, ptrType$18, sliceType$17, sliceType$18, arrayType$6, sliceType$19, funcType$2, ptrType$21, arrayType$7, ptrType$22, funcType$3, funcType$4, ptrType$24, uint8Type, kindNames, initialized, uncommonTypeMap, nameMap, nameOffList, typeOffList, callHelper, jsObjectPtr, selectHelper, methodName, methodNameSkip, copyVal, overflowFloat32, typesMustMatch, MakeMap, MakeMapWithSize, convertOp, makeFloat, makeFloat32, makeComplex, makeString, makeBytes, makeRunes, cvtInt, cvtUint, cvtFloatInt, cvtFloatUint, cvtIntFloat, cvtUintFloat, cvtFloat, cvtComplex, cvtIntString, cvtUintString, cvtBytesString, cvtStringBytes, cvtRunesString, cvtStringRunes, cvtT2I, cvtI2I, PtrTo, implements$1, specialChannelAssignability, directlyAssignable, haveIdenticalType, haveIdenticalUnderlyingType, toType, ifaceIndir, init, New, jsType, reflectType, setKindType, newName, newMethodName, newNameOff, newTypeOff, internalStr, isWrapped, copyStruct, makeValue, MakeSlice, TypeOf, ValueOf, FuncOf, SliceOf, Zero, unsafe_New, makeInt, typedmemmove, makemap, keyFor, mapaccess, mapassign, mapdelete, mapiterinit, mapiterkey, mapiterelem, mapiternext, maplen, cvtDirect, cvtSliceArrayPtr, Copy, methodReceiver, valueInterface, ifaceE2I, makeMethodValue, wrapJsObject, unwrapJsObject, getJsTag, chanrecv, chansend, DeepEqual, deepValueEqualJs; errors = $packages["errors"]; js = $packages["github.com/gopherjs/gopherjs/js"]; abi = $packages["internal/abi"]; goexperiment = $packages["internal/goexperiment"]; itoa = $packages["internal/itoa"]; unsafeheader = $packages["internal/unsafeheader"]; math = $packages["math"]; runtime = $packages["runtime"]; strconv = $packages["strconv"]; sync = $packages["sync"]; unicode = $packages["unicode"]; utf8 = $packages["unicode/utf8"]; Value = $pkg.Value = $newType(0, $kindStruct, "reflect.Value", true, "reflect", true, 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", true, "reflect", false, null); ValueError = $pkg.ValueError = $newType(0, $kindStruct, "reflect.ValueError", true, "reflect", true, function(Method_, Kind_) { this.$val = this; if (arguments.length === 0) { this.Method = ""; this.Kind = 0; return; } this.Method = Method_; this.Kind = Kind_; }); MapIter = $pkg.MapIter = $newType(0, $kindStruct, "reflect.MapIter", true, "reflect", true, function(m_, it_) { this.$val = this; if (arguments.length === 0) { this.m = new Value.ptr(ptrType$1.nil, 0, 0); this.it = 0; return; } this.m = m_; this.it = it_; }); Type = $pkg.Type = $newType(8, $kindInterface, "reflect.Type", true, "reflect", true, null); Kind = $pkg.Kind = $newType(4, $kindUint, "reflect.Kind", true, "reflect", true, null); tflag = $pkg.tflag = $newType(1, $kindUint8, "reflect.tflag", true, "reflect", false, null); rtype = $pkg.rtype = $newType(0, $kindStruct, "reflect.rtype", true, "reflect", false, function(size_, ptrdata_, hash_, tflag_, align_, fieldAlign_, kind_, equal_, gcdata_, str_, ptrToThis_) { this.$val = this; if (arguments.length === 0) { this.size = 0; this.ptrdata = 0; this.hash = 0; this.tflag = 0; this.align = 0; this.fieldAlign = 0; this.kind = 0; this.equal = $throwNilPointerError; this.gcdata = ptrType$12.nil; this.str = 0; this.ptrToThis = 0; return; } this.size = size_; this.ptrdata = ptrdata_; this.hash = hash_; this.tflag = tflag_; this.align = align_; this.fieldAlign = fieldAlign_; this.kind = kind_; this.equal = equal_; this.gcdata = gcdata_; this.str = str_; this.ptrToThis = ptrToThis_; }); method = $pkg.method = $newType(0, $kindStruct, "reflect.method", true, "reflect", false, function(name_, mtyp_, ifn_, tfn_) { this.$val = this; if (arguments.length === 0) { this.name = 0; this.mtyp = 0; this.ifn = 0; this.tfn = 0; return; } this.name = name_; this.mtyp = mtyp_; this.ifn = ifn_; this.tfn = tfn_; }); ChanDir = $pkg.ChanDir = $newType(4, $kindInt, "reflect.ChanDir", true, "reflect", true, null); arrayType = $pkg.arrayType = $newType(0, $kindStruct, "reflect.arrayType", true, "reflect", false, function(rtype_, elem_, slice_, len_) { this.$val = this; if (arguments.length === 0) { this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$12.nil, 0, 0); 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", true, "reflect", false, function(rtype_, elem_, dir_) { this.$val = this; if (arguments.length === 0) { this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$12.nil, 0, 0); this.elem = ptrType$1.nil; this.dir = 0; return; } this.rtype = rtype_; this.elem = elem_; this.dir = dir_; }); imethod = $pkg.imethod = $newType(0, $kindStruct, "reflect.imethod", true, "reflect", false, function(name_, typ_) { this.$val = this; if (arguments.length === 0) { this.name = 0; this.typ = 0; return; } this.name = name_; this.typ = typ_; }); interfaceType = $pkg.interfaceType = $newType(0, $kindStruct, "reflect.interfaceType", true, "reflect", false, function(rtype_, pkgPath_, methods_) { this.$val = this; if (arguments.length === 0) { this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$12.nil, 0, 0); this.pkgPath = new name.ptr(ptrType$12.nil); this.methods = sliceType$14.nil; return; } this.rtype = rtype_; this.pkgPath = pkgPath_; this.methods = methods_; }); mapType = $pkg.mapType = $newType(0, $kindStruct, "reflect.mapType", true, "reflect", false, function(rtype_, key_, elem_, bucket_, hasher_, keysize_, valuesize_, bucketsize_, flags_) { this.$val = this; if (arguments.length === 0) { this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$12.nil, 0, 0); this.key = ptrType$1.nil; this.elem = ptrType$1.nil; this.bucket = ptrType$1.nil; this.hasher = $throwNilPointerError; this.keysize = 0; this.valuesize = 0; this.bucketsize = 0; this.flags = 0; return; } this.rtype = rtype_; this.key = key_; this.elem = elem_; this.bucket = bucket_; this.hasher = hasher_; this.keysize = keysize_; this.valuesize = valuesize_; this.bucketsize = bucketsize_; this.flags = flags_; }); ptrType = $pkg.ptrType = $newType(0, $kindStruct, "reflect.ptrType", true, "reflect", false, function(rtype_, elem_) { this.$val = this; if (arguments.length === 0) { this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$12.nil, 0, 0); this.elem = ptrType$1.nil; return; } this.rtype = rtype_; this.elem = elem_; }); sliceType = $pkg.sliceType = $newType(0, $kindStruct, "reflect.sliceType", true, "reflect", false, function(rtype_, elem_) { this.$val = this; if (arguments.length === 0) { this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$12.nil, 0, 0); this.elem = ptrType$1.nil; return; } this.rtype = rtype_; this.elem = elem_; }); structField = $pkg.structField = $newType(0, $kindStruct, "reflect.structField", true, "reflect", false, function(name_, typ_, offsetEmbed_) { this.$val = this; if (arguments.length === 0) { this.name = new name.ptr(ptrType$12.nil); this.typ = ptrType$1.nil; this.offsetEmbed = 0; return; } this.name = name_; this.typ = typ_; this.offsetEmbed = offsetEmbed_; }); structType = $pkg.structType = $newType(0, $kindStruct, "reflect.structType", true, "reflect", false, function(rtype_, pkgPath_, fields_) { this.$val = this; if (arguments.length === 0) { this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$12.nil, 0, 0); this.pkgPath = new name.ptr(ptrType$12.nil); this.fields = sliceType$15.nil; return; } this.rtype = rtype_; this.pkgPath = pkgPath_; this.fields = fields_; }); Method = $pkg.Method = $newType(0, $kindStruct, "reflect.Method", true, "reflect", true, 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_; }); nameOff = $pkg.nameOff = $newType(4, $kindInt32, "reflect.nameOff", true, "reflect", false, null); typeOff = $pkg.typeOff = $newType(4, $kindInt32, "reflect.typeOff", true, "reflect", false, null); textOff = $pkg.textOff = $newType(4, $kindInt32, "reflect.textOff", true, "reflect", false, null); StructField = $pkg.StructField = $newType(0, $kindStruct, "reflect.StructField", true, "reflect", true, 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$6.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", true, "reflect", true, null); fieldScan = $pkg.fieldScan = $newType(0, $kindStruct, "reflect.fieldScan", true, "reflect", false, function(typ_, index_) { this.$val = this; if (arguments.length === 0) { this.typ = ptrType$11.nil; this.index = sliceType$6.nil; return; } this.typ = typ_; this.index = index_; }); uncommonType = $pkg.uncommonType = $newType(0, $kindStruct, "reflect.uncommonType", true, "reflect", false, function(pkgPath_, mcount_, xcount_, moff_, _methods_) { this.$val = this; if (arguments.length === 0) { this.pkgPath = 0; this.mcount = 0; this.xcount = 0; this.moff = 0; this._methods = sliceType$11.nil; return; } this.pkgPath = pkgPath_; this.mcount = mcount_; this.xcount = xcount_; this.moff = moff_; this._methods = _methods_; }); funcType = $pkg.funcType = $newType(0, $kindStruct, "reflect.funcType", true, "reflect", false, function(rtype_, inCount_, outCount_, _in_, _out_) { this.$val = this; if (arguments.length === 0) { this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$12.nil, 0, 0); this.inCount = 0; this.outCount = 0; this._in = sliceType$2.nil; this._out = sliceType$2.nil; return; } this.rtype = rtype_; this.inCount = inCount_; this.outCount = outCount_; this._in = _in_; this._out = _out_; }); name = $pkg.name = $newType(0, $kindStruct, "reflect.name", true, "reflect", false, function(bytes_) { this.$val = this; if (arguments.length === 0) { this.bytes = ptrType$12.nil; return; } this.bytes = bytes_; }); nameData = $pkg.nameData = $newType(0, $kindStruct, "reflect.nameData", true, "reflect", false, function(name_, tag_, exported_, pkgPath_) { this.$val = this; if (arguments.length === 0) { this.name = ""; this.tag = ""; this.exported = false; this.pkgPath = ""; return; } this.name = name_; this.tag = tag_; this.exported = exported_; this.pkgPath = pkgPath_; }); mapIter = $pkg.mapIter = $newType(0, $kindStruct, "reflect.mapIter", true, "reflect", false, function(t_, m_, keys_, i_, last_) { this.$val = this; if (arguments.length === 0) { this.t = $ifaceNil; this.m = null; this.keys = null; this.i = 0; this.last = null; return; } this.t = t_; this.m = m_; this.keys = keys_; this.i = i_; this.last = last_; }); sliceType$1 = $sliceType(name); ptrType$1 = $ptrType(rtype); sliceType$2 = $sliceType(ptrType$1); sliceType$3 = $sliceType($String); sliceType$4 = $sliceType($emptyInterface); ptrType$2 = $ptrType(js.Object); funcType$1 = $funcType([sliceType$4], [ptrType$2], true); sliceType$6 = $sliceType($Int); ptrType$4 = $ptrType(runtime.Func); sliceType$7 = $sliceType(Value); sliceType$8 = $sliceType($Uint8); ptrType$7 = $ptrType($UnsafePointer); sliceType$10 = $sliceType($Int32); ptrType$8 = $ptrType(uncommonType); sliceType$11 = $sliceType(method); ptrType$9 = $ptrType(interfaceType); ptrType$10 = $ptrType(imethod); sliceType$12 = $sliceType(fieldScan); ptrType$11 = $ptrType(structType); ptrType$12 = $ptrType($Uint8); sliceType$14 = $sliceType(imethod); sliceType$15 = $sliceType(structField); ptrType$16 = $ptrType(nameData); structType$3 = $structType("reflect", [{prop: "str", name: "str", embedded: false, exported: false, typ: $String, tag: ""}]); sliceType$16 = $sliceType(ptrType$2); ptrType$17 = $ptrType(mapIter); ptrType$18 = $ptrType(funcType); sliceType$17 = $sliceType(Type); sliceType$18 = $sliceType(sliceType$16); arrayType$6 = $arrayType($UnsafePointer, 2); sliceType$19 = $sliceType(arrayType$6); funcType$2 = $funcType([$String], [$Bool], false); ptrType$21 = $ptrType(MapIter); arrayType$7 = $arrayType($Uintptr, 2); ptrType$22 = $ptrType(ValueError); funcType$3 = $funcType([$UnsafePointer, $UnsafePointer], [$Bool], false); funcType$4 = $funcType([$UnsafePointer, $Uintptr], [$Uintptr], false); ptrType$24 = $ptrType(structField); flag.prototype.kind = function() { var f; f = this.$val; return ((((f & 31) >>> 0) >>> 0)); }; $ptrType(flag).prototype.kind = function() { return new flag(this.$get()).kind(); }; flag.prototype.ro = function() { var f; f = this.$val; if (!((((f & 96) >>> 0) === 0))) { return 32; } return 0; }; $ptrType(flag).prototype.ro = function() { return new flag(this.$get()).ro(); }; Value.ptr.prototype.pointer = function() { var 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 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(); }; methodName = function() { var _tuple, f, pc; _tuple = runtime.Caller(2); pc = _tuple[0]; f = runtime.FuncForPC(pc); if (f === ptrType$4.nil) { return "unknown method"; } return f.Name(); }; methodNameSkip = function() { var _tuple, f, pc; _tuple = runtime.Caller(3); pc = _tuple[0]; f = runtime.FuncForPC(pc); if (f === ptrType$4.nil) { return "unknown method"; } return f.Name(); }; flag.prototype.mustBe = function(expected) { var expected, f; f = this.$val; if (!((((((f & 31) >>> 0) >>> 0)) === 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 f; f = this.$val; if ((f === 0) || !((((f & 96) >>> 0) === 0))) { new flag(f).mustBeExportedSlow(); } }; $ptrType(flag).prototype.mustBeExported = function() { return new flag(this.$get()).mustBeExported(); }; flag.prototype.mustBeExportedSlow = function() { var f; f = this.$val; if (f === 0) { $panic(new ValueError.ptr(methodNameSkip(), 0)); } if (!((((f & 96) >>> 0) === 0))) { $panic(new $String("reflect: " + methodNameSkip() + " using value obtained using unexported field")); } }; $ptrType(flag).prototype.mustBeExportedSlow = function() { return new flag(this.$get()).mustBeExportedSlow(); }; flag.prototype.mustBeAssignable = function() { var f; f = this.$val; if (!((((f & 96) >>> 0) === 0)) || (((f & 256) >>> 0) === 0)) { new flag(f).mustBeAssignableSlow(); } }; $ptrType(flag).prototype.mustBeAssignable = function() { return new flag(this.$get()).mustBeAssignable(); }; flag.prototype.mustBeAssignableSlow = function() { var f; f = this.$val; if (f === 0) { $panic(new ValueError.ptr(methodNameSkip(), 0)); } if (!((((f & 96) >>> 0) === 0))) { $panic(new $String("reflect: " + methodNameSkip() + " using value obtained using unexported field")); } if (((f & 256) >>> 0) === 0) { $panic(new $String("reflect: " + methodNameSkip() + " using unaddressable value")); } }; $ptrType(flag).prototype.mustBeAssignableSlow = function() { return new flag(this.$get()).mustBeAssignableSlow(); }; Value.ptr.prototype.Addr = function() { var fl, v; v = this; if (((v.flag & 256) >>> 0) === 0) { $panic(new $String("reflect.Value.Addr of unaddressable value")); } fl = (v.flag & 96) >>> 0; return new Value.ptr(v.typ.ptrTo(), v.ptr, (fl | 22) >>> 0); }; Value.prototype.Addr = function() { return this.$val.Addr(); }; Value.ptr.prototype.Bool = function() { var 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 _r, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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: $s = -1; return (v.ptr).$get(); /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Bytes }; } $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 _r, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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: $s = -1; return (v.ptr).$get(); /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.runes }; } $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 v; v = this; return !((((v.flag & 256) >>> 0) === 0)); }; Value.prototype.CanAddr = function() { return this.$val.CanAddr(); }; Value.ptr.prototype.CanSet = function() { var 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 $24r, _r, in$1, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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 = $clone(v, Value).call("Call", in$1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Call }; } $f.$24r = $24r; $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 $24r, _r, in$1, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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 = $clone(v, Value).call("CallSlice", in$1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.CallSlice }; } $f.$24r = $24r; $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 _1, k, v, x; v = this; k = new flag(v.flag).kind(); _1 = k; if (_1 === (15)) { return ((x = (v.ptr).$get(), new $Complex128(x.$real, x.$imag))); } else if (_1 === (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 $24r, _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; $24r = $f.$24r; _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 = $clone(v, Value).Field((0 >= index.$length ? ($throwRuntimeError("index out of range"), undefined) : index.$array[index.$offset + 0])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 4; case 4: return $24r; /* } */ 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"), undefined) : _ref.$array[_ref.$offset + _i]); /* */ if (i > 0) { $s = 7; continue; } /* */ $s = 8; continue; /* if (i > 0) { */ case 7: if (!($clone(v, Value).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 ($clone(v, Value).IsNil()) { $panic(new $String("reflect: indirection through nil pointer to embedded struct")); } _r$2 = $clone(v, Value).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 = $clone(v, Value).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: $s = -1; return v; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.FieldByIndex }; } $f.$24r = $24r; $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$1) { var $24r, _r, _r$1, _tuple, f, name$1, ok, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; f = $f.f; name$1 = $f.name$1; 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$1); /* */ $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 = $clone(v, Value).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; } $24r = _r$1; $s = 5; case 5: return $24r; /* } */ case 3: $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.FieldByName }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.f = f; $f.name$1 = name$1; $f.ok = ok; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.FieldByName = function(name$1) { return this.$val.FieldByName(name$1); }; Value.ptr.prototype.FieldByNameFunc = function(match) { var $24r, _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; $24r = $f.$24r; _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 = $clone(v, Value).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; } $24r = _r$1; $s = 5; case 5: return $24r; /* } */ case 3: $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.FieldByNameFunc }; } $f.$24r = $24r; $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 _1, k, v; v = this; k = new flag(v.flag).kind(); _1 = k; if (_1 === (13)) { return ((v.ptr).$get()); } else if (_1 === (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 _1, k, p, v; v = this; k = new flag(v.flag).kind(); p = v.ptr; _1 = k; if (_1 === (2)) { return (new $Int64(0, (p).$get())); } else if (_1 === (3)) { return (new $Int64(0, (p).$get())); } else if (_1 === (4)) { return (new $Int64(0, (p).$get())); } else if (_1 === (5)) { return (new $Int64(0, (p).$get())); } else if (_1 === (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 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 $24r, _r, i, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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($clone(v, Value), true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } i = _r; $24r = i; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Interface }; } $f.$24r = $24r; $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 v; v = this; return !((v.flag === 0)); }; Value.prototype.IsValid = function() { return this.$val.IsValid(); }; Value.ptr.prototype.IsZero = function() { var _1, _r, _r$1, _r$2, _r$3, c, i, i$1, v, 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; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; c = $f.c; i = $f.i; i$1 = $f.i$1; 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; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = this; _1 = new flag(v.flag).kind(); /* */ if (_1 === (1)) { $s = 2; continue; } /* */ if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { $s = 3; continue; } /* */ if ((_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12))) { $s = 4; continue; } /* */ if ((_1 === (13)) || (_1 === (14))) { $s = 5; continue; } /* */ if ((_1 === (15)) || (_1 === (16))) { $s = 6; continue; } /* */ if (_1 === (17)) { $s = 7; continue; } /* */ if ((_1 === (18)) || (_1 === (19)) || (_1 === (20)) || (_1 === (21)) || (_1 === (22)) || (_1 === (23)) || (_1 === (26))) { $s = 8; continue; } /* */ if (_1 === (24)) { $s = 9; continue; } /* */ if (_1 === (25)) { $s = 10; continue; } /* */ $s = 11; continue; /* if (_1 === (1)) { */ case 2: $s = -1; return !$clone(v, Value).Bool(); /* } else if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { */ case 3: $s = -1; return (x = $clone(v, Value).Int(), (x.$high === 0 && x.$low === 0)); /* } else if ((_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12))) { */ case 4: $s = -1; return (x$1 = $clone(v, Value).Uint(), (x$1.$high === 0 && x$1.$low === 0)); /* } else if ((_1 === (13)) || (_1 === (14))) { */ case 5: $s = -1; return (x$2 = math.Float64bits($clone(v, Value).Float()), (x$2.$high === 0 && x$2.$low === 0)); /* } else if ((_1 === (15)) || (_1 === (16))) { */ case 6: c = $clone(v, Value).Complex(); $s = -1; return (x$3 = math.Float64bits(c.$real), (x$3.$high === 0 && x$3.$low === 0)) && (x$4 = math.Float64bits(c.$imag), (x$4.$high === 0 && x$4.$low === 0)); /* } else if (_1 === (17)) { */ case 7: i = 0; /* while (true) { */ case 13: /* if (!(i < $clone(v, Value).Len())) { break; } */ if(!(i < $clone(v, Value).Len())) { $s = 14; continue; } _r = $clone(v, Value).Index(i); /* */ $s = 17; case 17: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = $clone(_r, Value).IsZero(); /* */ $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 = 15; continue; } /* */ $s = 16; continue; /* if (!_r$1) { */ case 15: $s = -1; return false; /* } */ case 16: i = i + (1) >> 0; $s = 13; continue; case 14: $s = -1; return true; /* } else if ((_1 === (18)) || (_1 === (19)) || (_1 === (20)) || (_1 === (21)) || (_1 === (22)) || (_1 === (23)) || (_1 === (26))) { */ case 8: $s = -1; return $clone(v, Value).IsNil(); /* } else if (_1 === (24)) { */ case 9: $s = -1; return $clone(v, Value).Len() === 0; /* } else if (_1 === (25)) { */ case 10: i$1 = 0; /* while (true) { */ case 19: /* if (!(i$1 < $clone(v, Value).NumField())) { break; } */ if(!(i$1 < $clone(v, Value).NumField())) { $s = 20; continue; } _r$2 = $clone(v, Value).Field(i$1); /* */ $s = 23; case 23: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = $clone(_r$2, Value).IsZero(); /* */ $s = 24; case 24: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } /* */ if (!_r$3) { $s = 21; continue; } /* */ $s = 22; continue; /* if (!_r$3) { */ case 21: $s = -1; return false; /* } */ case 22: i$1 = i$1 + (1) >> 0; $s = 19; continue; case 20: $s = -1; return true; /* } else { */ case 11: $panic(new ValueError.ptr("reflect.Value.IsZero", $clone(v, Value).Kind())); /* } */ case 12: case 1: $s = -1; return false; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.IsZero }; } $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.c = c; $f.i = i; $f.i$1 = i$1; $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.$s = $s; $f.$r = $r; return $f; }; Value.prototype.IsZero = function() { return this.$val.IsZero(); }; Value.ptr.prototype.Kind = function() { var v; v = this; return new flag(v.flag).kind(); }; Value.prototype.Kind = function() { return this.$val.Kind(); }; Value.ptr.prototype.MapIndex = function(key) { var _r, 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; _r = $f._r; 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: v = this; new flag(v.flag).mustBe(21); tt = (v.typ.kindType); _r = $clone(key, Value).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$7(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, key)))); } e = mapaccess(v.typ, $clone(v, Value).pointer(), k); if (e === 0) { $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); } typ = tt.elem; fl = new flag((((v.flag | key.flag) >>> 0))).ro(); fl = (fl | (((typ.Kind() >>> 0)))) >>> 0; $s = -1; return copyVal(typ, fl, e); /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.MapIndex }; } $f._r = _r; $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 _r, a, 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; _r = $f._r; a = $f.a; 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 = (new flag(v.flag).ro() | ((keyType.Kind() >>> 0))) >>> 0; m = $clone(v, Value).pointer(); mlen = 0; if (!(m === 0)) { mlen = maplen(m); } it = mapiterinit(v.typ, m); a = $makeSlice(sliceType$7, 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; } ((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i] = copyVal(keyType, fl, key)); mapiternext(it); i = i + (1) >> 0; $s = 1; continue; case 2: $s = -1; return $subslice(a, 0, i); /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.MapKeys }; } $f._r = _r; $f.a = a; $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(); }; MapIter.ptr.prototype.Key = function() { var $24r, _arg, _arg$1, _arg$2, _r, _r$1, _r$2, it, ktype, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; it = $f.it; ktype = $f.ktype; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: it = this; if (it.it === 0) { $panic(new $String("MapIter.Key called before Next")); } _r = mapiterkey(it.it); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (_r === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_r === 0) { */ case 1: $panic(new $String("MapIter.Key called on exhausted iterator")); /* } */ case 2: t = (it.m.typ.kindType); ktype = t.key; _arg = ktype; _arg$1 = (new flag(it.m.flag).ro() | ((ktype.Kind() >>> 0))) >>> 0; _r$1 = mapiterkey(it.it); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$2 = _r$1; _r$2 = copyVal(_arg, _arg$1, _arg$2); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 6; case 6: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: MapIter.ptr.prototype.Key }; } $f.$24r = $24r; $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.it = it; $f.ktype = ktype; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; MapIter.prototype.Key = function() { return this.$val.Key(); }; MapIter.ptr.prototype.Value = function() { var $24r, _arg, _arg$1, _arg$2, _r, _r$1, _r$2, it, t, vtype, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; it = $f.it; t = $f.t; vtype = $f.vtype; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: it = this; if (it.it === 0) { $panic(new $String("MapIter.Value called before Next")); } _r = mapiterkey(it.it); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (_r === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_r === 0) { */ case 1: $panic(new $String("MapIter.Value called on exhausted iterator")); /* } */ case 2: t = (it.m.typ.kindType); vtype = t.elem; _arg = vtype; _arg$1 = (new flag(it.m.flag).ro() | ((vtype.Kind() >>> 0))) >>> 0; _r$1 = mapiterelem(it.it); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$2 = _r$1; _r$2 = copyVal(_arg, _arg$1, _arg$2); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 6; case 6: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: MapIter.ptr.prototype.Value }; } $f.$24r = $24r; $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.it = it; $f.t = t; $f.vtype = vtype; $f.$s = $s; $f.$r = $r; return $f; }; MapIter.prototype.Value = function() { return this.$val.Value(); }; MapIter.ptr.prototype.Next = function() { var $24r, _r, _r$1, it, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; it = $f.it; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: it = this; /* */ if (it.it === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (it.it === 0) { */ case 1: it.it = mapiterinit(it.m.typ, $clone(it.m, Value).pointer()); $s = 3; continue; /* } else { */ case 2: _r = mapiterkey(it.it); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (_r === 0) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_r === 0) { */ case 4: $panic(new $String("MapIter.Next called on exhausted iterator")); /* } */ case 5: mapiternext(it.it); /* } */ case 3: _r$1 = mapiterkey(it.it); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = !(_r$1 === 0); $s = 8; case 8: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: MapIter.ptr.prototype.Next }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f.it = it; $f.$s = $s; $f.$r = $r; return $f; }; MapIter.prototype.Next = function() { return this.$val.Next(); }; Value.ptr.prototype.MapRange = function() { var v; v = this; new flag(v.flag).mustBe(21); return new MapIter.ptr($clone(v, Value), 0); }; Value.prototype.MapRange = function() { return this.$val.MapRange(); }; copyVal = function(typ, fl, ptr) { var c, fl, ptr, typ; if (ifaceIndir(typ)) { c = unsafe_New(typ); typedmemmove(typ, c, ptr); return new Value.ptr(typ, c, (fl | 128) >>> 0); } return new Value.ptr(typ, (ptr).$get(), fl); }; Value.ptr.prototype.Method = function(i) { var 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) && $clone(v, Value).IsNil()) { $panic(new $String("reflect: Method on nil interface value")); } fl = (new flag(v.flag).ro() | (((v.flag & 128) >>> 0))) >>> 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 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$1) { var _r, _tuple, m, name$1, ok, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; m = $f.m; name$1 = $f.name$1; ok = $f.ok; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = this; if (v.typ === ptrType$1.nil) { $panic(new ValueError.ptr("reflect.Value.MethodByName", 0)); } if (!((((v.flag & 512) >>> 0) === 0))) { $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); } _r = v.typ.MethodByName(name$1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; m = $clone(_tuple[0], Method); ok = _tuple[1]; if (!ok) { $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); } $s = -1; return $clone(v, Value).Method(m.Index); /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.MethodByName }; } $f._r = _r; $f._tuple = _tuple; $f.m = m; $f.name$1 = name$1; $f.ok = ok; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.MethodByName = function(name$1) { return this.$val.MethodByName(name$1); }; Value.ptr.prototype.NumField = function() { var 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 _1, k, v, x; v = this; k = new flag(v.flag).kind(); _1 = k; if (_1 === (15)) { return overflowFloat32(x.$real) || overflowFloat32(x.$imag); } else if (_1 === (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 _1, k, v, x; v = this; k = new flag(v.flag).kind(); _1 = k; if (_1 === (13)) { return overflowFloat32(x); } else if (_1 === (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 x; if (x < 0) { x = -x; } return 3.4028234663852886e+38 < x && x <= 1.7976931348623157e+308; }; Value.ptr.prototype.OverflowInt = function(x) { var _1, bitSize, k, trunc, v, x; v = this; k = new flag(v.flag).kind(); _1 = k; if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (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 _1, bitSize, k, trunc, v, x; v = this; k = new flag(v.flag).kind(); _1 = k; if ((_1 === (7)) || (_1 === (12)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (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 $24r, _r, _tuple, ok, v, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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 = $clone(v, Value).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]; $24r = [x, ok]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Recv }; } $f.$24r = $24r; $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 _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; _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$7(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, val)))); } _r = chanrecv($clone(v, Value).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); } $s = -1; return [val, ok]; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.recv }; } $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 _r, v, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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).mustBe(18); new flag(v.flag).mustBeExported(); _r = $clone(v, Value).send($clone(x, Value), false); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Send }; } $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 $24r, _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; $24r = $f.$24r; _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; 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 = $clone(x, Value).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$7(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, x)))); } _r$1 = chansend($clone(v, Value).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; $24r = selected; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.send }; } $f.$24r = $24r; $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 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 _r, v, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.setRunes }; } $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 _1, k, v, x; v = this; new flag(v.flag).mustBeAssignable(); k = new flag(v.flag).kind(); _1 = k; if (_1 === (15)) { (v.ptr).$set((new $Complex64(x.$real, x.$imag))); } else if (_1 === (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 _1, k, v, x; v = this; new flag(v.flag).mustBeAssignable(); k = new flag(v.flag).kind(); _1 = k; if (_1 === (13)) { (v.ptr).$set(($fround(x))); } else if (_1 === (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 _1, k, v, x; v = this; new flag(v.flag).mustBeAssignable(); k = new flag(v.flag).kind(); _1 = k; if (_1 === (2)) { (v.ptr).$set((((x.$low + ((x.$high >> 31) * 4294967296)) >> 0))); } else if (_1 === (3)) { (v.ptr).$set((((x.$low + ((x.$high >> 31) * 4294967296)) << 24 >> 24))); } else if (_1 === (4)) { (v.ptr).$set((((x.$low + ((x.$high >> 31) * 4294967296)) << 16 >> 16))); } else if (_1 === (5)) { (v.ptr).$set((((x.$low + ((x.$high >> 31) * 4294967296)) >> 0))); } else if (_1 === (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, elem) { var _r, _r$1, e, elem, k, key, tt, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; e = $f.e; elem = $f.elem; k = $f.k; key = $f.key; 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); new flag(v.flag).mustBeExported(); new flag(key.flag).mustBeExported(); tt = (v.typ.kindType); _r = $clone(key, Value).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$7(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, key)))); } if (elem.typ === ptrType$1.nil) { mapdelete(v.typ, $clone(v, Value).pointer(), k); $s = -1; return; } new flag(elem.flag).mustBeExported(); _r$1 = $clone(elem, Value).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; } elem = _r$1; e = 0; if (!((((elem.flag & 128) >>> 0) === 0))) { e = elem.ptr; } else { e = ((elem.$ptr_ptr || (elem.$ptr_ptr = new ptrType$7(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, elem)))); } $r = mapassign(v.typ, $clone(v, Value).pointer(), k, e); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.SetMapIndex }; } $f._r = _r; $f._r$1 = _r$1; $f.e = e; $f.elem = elem; $f.k = k; $f.key = key; $f.tt = tt; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.SetMapIndex = function(key, elem) { return this.$val.SetMapIndex(key, elem); }; Value.ptr.prototype.SetUint = function(x) { var _1, k, v, x; v = this; new flag(v.flag).mustBeAssignable(); k = new flag(v.flag).kind(); _1 = k; if (_1 === (7)) { (v.ptr).$set(((x.$low >>> 0))); } else if (_1 === (8)) { (v.ptr).$set(((x.$low << 24 >>> 24))); } else if (_1 === (9)) { (v.ptr).$set(((x.$low << 16 >>> 16))); } else if (_1 === (10)) { (v.ptr).$set(((x.$low >>> 0))); } else if (_1 === (11)) { (v.ptr).$set(x); } else if (_1 === (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 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 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 $24r, _1, _r, k, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _1 = $f._1; _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(); _1 = k; if (_1 === (0)) { $s = -1; return ""; } else if (_1 === (24)) { $s = -1; return (v.ptr).$get(); } _r = $clone(v, Value).Type().String(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = "<" + _r + " Value>"; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.String }; } $f.$24r = $24r; $f._1 = _1; $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 $24r, _r, _tuple, ok, v, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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 = $clone(v, Value).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]; $24r = [x, ok]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.TryRecv }; } $f.$24r = $24r; $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 $24r, _r, v, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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).mustBe(18); new flag(v.flag).mustBeExported(); _r = $clone(v, Value).send($clone(x, Value), true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.TrySend }; } $f.$24r = $24r; $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 f, i, m, m$1, ms, tt, v, x; 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"), undefined) : x.$array[x.$offset + i])); return v.typ.typeOff(m.typ); } ms = v.typ.exportedMethods(); if (((i >>> 0)) >= ((ms.$length >>> 0))) { $panic(new $String("reflect: internal error: invalid method index")); } m$1 = $clone(((i < 0 || i >= ms.$length) ? ($throwRuntimeError("index out of range"), undefined) : ms.$array[ms.$offset + i]), method); return v.typ.typeOff(m$1.mtyp); }; Value.prototype.Type = function() { return this.$val.Type(); }; Value.ptr.prototype.Uint = function() { var _1, k, p, v, x; v = this; k = new flag(v.flag).kind(); p = v.ptr; _1 = k; if (_1 === (7)) { return (new $Uint64(0, (p).$get())); } else if (_1 === (8)) { return (new $Uint64(0, (p).$get())); } else if (_1 === (9)) { return (new $Uint64(0, (p).$get())); } else if (_1 === (10)) { return (new $Uint64(0, (p).$get())); } else if (_1 === (11)) { return (p).$get(); } else if (_1 === (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 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(); }; typesMustMatch = function(what, t1, t2) { var _r, _r$1, t1, t2, what, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; t1 = $f.t1; t2 = $f.t2; what = $f.what; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (!($interfaceIsEqual(t1, t2))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(t1, t2))) { */ case 1: _r = t1.String(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = t2.String(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $panic(new $String(what + ": " + _r + " != " + _r$1)); /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: typesMustMatch }; } $f._r = _r; $f._r$1 = _r$1; $f.t1 = t1; $f.t2 = t2; $f.what = what; $f.$s = $s; $f.$r = $r; return $f; }; MakeMap = function(typ) { var $24r, _r, typ, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; typ = $f.typ; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = MakeMapWithSize(typ, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: MakeMap }; } $f.$24r = $24r; $f._r = _r; $f.typ = typ; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.MakeMap = MakeMap; MakeMapWithSize = function(typ, n) { var _r, m, n, t, typ, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; m = $f.m; n = $f.n; t = $f.t; typ = $f.typ; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = typ.Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (!((_r === 21))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((_r === 21))) { */ case 1: $panic(new $String("reflect.MakeMapWithSize of non-map type")); /* } */ case 2: t = $assertType(typ, ptrType$1); m = makemap(t, n); $s = -1; return new Value.ptr(t, m, 21); /* */ } return; } if ($f === undefined) { $f = { $blk: MakeMapWithSize }; } $f._r = _r; $f.m = m; $f.n = n; $f.t = t; $f.typ = typ; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.MakeMapWithSize = MakeMapWithSize; Value.ptr.prototype.Convert = function(t) { var $24r, _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; $24r = $f.$24r; _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", $clone(v, Value)); /* */ $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($clone(v, Value), t); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r = _r$4; $s = 10; case 10: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Convert }; } $f.$24r = $24r; $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 _1, _2, _3, _4, _5, _6, _7, _arg, _arg$1, _r, _r$1, _r$10, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _v, _v$1, _v$2, _v$3, _v$4, _v$5, dst, src, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _2 = $f._2; _3 = $f._3; _4 = $f._4; _5 = $f._5; _6 = $f._6; _7 = $f._7; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$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; _v = $f._v; _v$1 = $f._v$1; _v$2 = $f._v$2; _v$3 = $f._v$3; _v$4 = $f._v$4; _v$5 = $f._v$5; dst = $f.dst; src = $f.src; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _1 = src.Kind(); /* */ if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { $s = 2; continue; } /* */ if ((_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12))) { $s = 3; continue; } /* */ if ((_1 === (13)) || (_1 === (14))) { $s = 4; continue; } /* */ if ((_1 === (15)) || (_1 === (16))) { $s = 5; continue; } /* */ if (_1 === (24)) { $s = 6; continue; } /* */ if (_1 === (23)) { $s = 7; continue; } /* */ if (_1 === (18)) { $s = 8; continue; } /* */ $s = 9; continue; /* if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { */ case 2: _2 = dst.Kind(); if ((_2 === (2)) || (_2 === (3)) || (_2 === (4)) || (_2 === (5)) || (_2 === (6)) || (_2 === (7)) || (_2 === (8)) || (_2 === (9)) || (_2 === (10)) || (_2 === (11)) || (_2 === (12))) { $s = -1; return cvtInt; } else if ((_2 === (13)) || (_2 === (14))) { $s = -1; return cvtIntFloat; } else if (_2 === (24)) { $s = -1; return cvtIntString; } $s = 9; continue; /* } else if ((_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12))) { */ case 3: _3 = dst.Kind(); if ((_3 === (2)) || (_3 === (3)) || (_3 === (4)) || (_3 === (5)) || (_3 === (6)) || (_3 === (7)) || (_3 === (8)) || (_3 === (9)) || (_3 === (10)) || (_3 === (11)) || (_3 === (12))) { $s = -1; return cvtUint; } else if ((_3 === (13)) || (_3 === (14))) { $s = -1; return cvtUintFloat; } else if (_3 === (24)) { $s = -1; return cvtUintString; } $s = 9; continue; /* } else if ((_1 === (13)) || (_1 === (14))) { */ case 4: _4 = dst.Kind(); if ((_4 === (2)) || (_4 === (3)) || (_4 === (4)) || (_4 === (5)) || (_4 === (6))) { $s = -1; return cvtFloatInt; } else if ((_4 === (7)) || (_4 === (8)) || (_4 === (9)) || (_4 === (10)) || (_4 === (11)) || (_4 === (12))) { $s = -1; return cvtFloatUint; } else if ((_4 === (13)) || (_4 === (14))) { $s = -1; return cvtFloat; } $s = 9; continue; /* } else if ((_1 === (15)) || (_1 === (16))) { */ case 5: _5 = dst.Kind(); if ((_5 === (15)) || (_5 === (16))) { $s = -1; return cvtComplex; } $s = 9; continue; /* } else if (_1 === (24)) { */ case 6: if (!(dst.Kind() === 23)) { _v = false; $s = 12; continue s; } _r = dst.Elem().PkgPath(); /* */ $s = 13; case 13: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _v = _r === ""; case 12: /* */ if (_v) { $s = 10; continue; } /* */ $s = 11; continue; /* if (_v) { */ case 10: _r$1 = dst.Elem().Kind(); /* */ $s = 15; case 15: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _6 = _r$1; if (_6 === (8)) { $s = -1; return cvtStringBytes; } else if (_6 === (5)) { $s = -1; return cvtStringRunes; } case 14: /* } */ case 11: $s = 9; continue; /* } else if (_1 === (23)) { */ case 7: if (!(dst.Kind() === 24)) { _v$1 = false; $s = 18; continue s; } _r$2 = src.Elem().PkgPath(); /* */ $s = 19; case 19: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _v$1 = _r$2 === ""; case 18: /* */ if (_v$1) { $s = 16; continue; } /* */ $s = 17; continue; /* if (_v$1) { */ case 16: _r$3 = src.Elem().Kind(); /* */ $s = 21; case 21: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _7 = _r$3; if (_7 === (8)) { $s = -1; return cvtBytesString; } else if (_7 === (5)) { $s = -1; return cvtRunesString; } case 20: /* } */ case 17: if (!(dst.Kind() === 22)) { _v$3 = false; $s = 25; continue s; } _r$4 = dst.Elem().Kind(); /* */ $s = 26; case 26: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _v$3 = _r$4 === 17; case 25: if (!(_v$3)) { _v$2 = false; $s = 24; continue s; } _r$5 = dst.Elem().Elem(); /* */ $s = 27; case 27: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _v$2 = $interfaceIsEqual(src.Elem(), _r$5); case 24: /* */ if (_v$2) { $s = 22; continue; } /* */ $s = 23; continue; /* if (_v$2) { */ case 22: $s = -1; return cvtSliceArrayPtr; /* } */ case 23: $s = 9; continue; /* } else if (_1 === (18)) { */ case 8: if (!(dst.Kind() === 18)) { _v$4 = false; $s = 30; continue s; } _r$6 = specialChannelAssignability(dst, src); /* */ $s = 31; case 31: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _v$4 = _r$6; case 30: /* */ if (_v$4) { $s = 28; continue; } /* */ $s = 29; continue; /* if (_v$4) { */ case 28: $s = -1; return cvtDirect; /* } */ case 29: /* } */ case 9: case 1: _r$7 = haveIdenticalUnderlyingType(dst, src, false); /* */ $s = 34; case 34: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } /* */ if (_r$7) { $s = 32; continue; } /* */ $s = 33; continue; /* if (_r$7) { */ case 32: $s = -1; return cvtDirect; /* } */ case 33: if (!((dst.Kind() === 22) && dst.Name() === "" && (src.Kind() === 22) && src.Name() === "")) { _v$5 = false; $s = 37; continue s; } _r$8 = dst.Elem().common(); /* */ $s = 38; case 38: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _arg = _r$8; _r$9 = src.Elem().common(); /* */ $s = 39; case 39: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _arg$1 = _r$9; _r$10 = haveIdenticalUnderlyingType(_arg, _arg$1, false); /* */ $s = 40; case 40: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _v$5 = _r$10; case 37: /* */ if (_v$5) { $s = 35; continue; } /* */ $s = 36; continue; /* if (_v$5) { */ case 35: $s = -1; return cvtDirect; /* } */ case 36: if (implements$1(dst, src)) { if (src.Kind() === 20) { $s = -1; return cvtI2I; } $s = -1; return cvtT2I; } $s = -1; return $throwNilPointerError; /* */ } return; } if ($f === undefined) { $f = { $blk: convertOp }; } $f._1 = _1; $f._2 = _2; $f._3 = _3; $f._4 = _4; $f._5 = _5; $f._6 = _6; $f._7 = _7; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$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._v = _v; $f._v$1 = _v$1; $f._v$2 = _v$2; $f._v$3 = _v$3; $f._v$4 = _v$4; $f._v$5 = _v$5; $f.dst = dst; $f.src = src; $f.$s = $s; $f.$r = $r; return $f; }; makeFloat = function(f, v, t) { var _1, _r, f, ptr, t, typ, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _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); _1 = typ.size; if (_1 === (4)) { (ptr).$set(($fround(v))); } else if (_1 === (8)) { (ptr).$set(v); } $s = -1; return new Value.ptr(typ, ptr, (((f | 128) >>> 0) | ((typ.Kind() >>> 0))) >>> 0); /* */ } return; } if ($f === undefined) { $f = { $blk: makeFloat }; } $f._1 = _1; $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; }; makeFloat32 = function(f, v, t) { var _r, f, ptr, t, typ, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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); (ptr).$set(v); $s = -1; return new Value.ptr(typ, ptr, (((f | 128) >>> 0) | ((typ.Kind() >>> 0))) >>> 0); /* */ } return; } if ($f === undefined) { $f = { $blk: makeFloat32 }; } $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 _1, _r, f, ptr, t, typ, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _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); _1 = typ.size; if (_1 === (8)) { (ptr).$set((new $Complex64(v.$real, v.$imag))); } else if (_1 === (16)) { (ptr).$set(v); } $s = -1; return new Value.ptr(typ, ptr, (((f | 128) >>> 0) | ((typ.Kind() >>> 0))) >>> 0); /* */ } return; } if ($f === undefined) { $f = { $blk: makeComplex }; } $f._1 = _1; $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 _r, f, ret, t, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; 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 = $clone(New(t), Value).Elem(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } ret = _r; $clone(ret, Value).SetString(v); ret.flag = (((ret.flag & ~256) >>> 0) | f) >>> 0; $s = -1; return ret; /* */ } return; } if ($f === undefined) { $f = { $blk: makeString }; } $f._r = _r; $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 _r, f, ret, t, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; 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 = $clone(New(t), Value).Elem(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } ret = _r; $r = $clone(ret, Value).SetBytes(v); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } ret.flag = (((ret.flag & ~256) >>> 0) | f) >>> 0; $s = -1; return ret; /* */ } return; } if ($f === undefined) { $f = { $blk: makeBytes }; } $f._r = _r; $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 _r, f, ret, t, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; 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 = $clone(New(t), Value).Elem(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } ret = _r; $r = $clone(ret, Value).setRunes(v); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } ret.flag = (((ret.flag & ~256) >>> 0) | f) >>> 0; $s = -1; return ret; /* */ } return; } if ($f === undefined) { $f = { $blk: makeRunes }; } $f._r = _r; $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 $24r, _r, t, v, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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: _r = makeInt(new flag(v.flag).ro(), ((x = $clone(v, Value).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; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtInt }; } $f.$24r = $24r; $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 $24r, _r, t, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = makeInt(new flag(v.flag).ro(), $clone(v, Value).Uint(), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtUint }; } $f.$24r = $24r; $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; cvtFloatInt = function(v, t) { var $24r, _r, t, v, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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: _r = makeInt(new flag(v.flag).ro(), ((x = (new $Int64(0, $clone(v, Value).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; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtFloatInt }; } $f.$24r = $24r; $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 $24r, _r, t, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = makeInt(new flag(v.flag).ro(), (new $Uint64(0, $clone(v, Value).Float())), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtFloatUint }; } $f.$24r = $24r; $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; cvtIntFloat = function(v, t) { var $24r, _r, t, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = makeFloat(new flag(v.flag).ro(), ($flatten64($clone(v, Value).Int())), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtIntFloat }; } $f.$24r = $24r; $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; cvtUintFloat = function(v, t) { var $24r, _r, t, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = makeFloat(new flag(v.flag).ro(), ($flatten64($clone(v, Value).Uint())), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtUintFloat }; } $f.$24r = $24r; $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; cvtFloat = function(v, t) { var $24r, $24r$1, _r, _r$1, _r$2, _r$3, _v, t, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _v = $f._v; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = $clone(v, Value).Type().Kind(); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } if (!(_r === 13)) { _v = false; $s = 3; continue s; } _r$1 = t.Kind(); /* */ $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 === 13; case 3: /* */ if (_v) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v) { */ case 1: _r$2 = makeFloat32(new flag(v.flag).ro(), (v.ptr).$get(), t); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 7; case 7: return $24r; /* } */ case 2: _r$3 = makeFloat(new flag(v.flag).ro(), $clone(v, Value).Float(), t); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r$1 = _r$3; $s = 9; case 9: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtFloat }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._v = _v; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; cvtComplex = function(v, t) { var $24r, _r, t, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = makeComplex(new flag(v.flag).ro(), $clone(v, Value).Complex(), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtComplex }; } $f.$24r = $24r; $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; cvtIntString = function(v, t) { var $24r, _r, s, t, v, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; s = $f.s; t = $f.t; v = $f.v; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = "\xEF\xBF\xBD"; x = $clone(v, Value).Int(); if ((x$1 = (new $Int64(0, (((x.$low + ((x.$high >> 31) * 4294967296)) >> 0)))), (x$1.$high === x.$high && x$1.$low === x.$low))) { s = ($encodeRune((((x.$low + ((x.$high >> 31) * 4294967296)) >> 0)))); } _r = makeString(new flag(v.flag).ro(), s, t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtIntString }; } $f.$24r = $24r; $f._r = _r; $f.s = s; $f.t = t; $f.v = v; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; cvtUintString = function(v, t) { var $24r, _r, s, t, v, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; s = $f.s; t = $f.t; v = $f.v; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = "\xEF\xBF\xBD"; x = $clone(v, Value).Uint(); if ((x$1 = (new $Uint64(0, ((x.$low >> 0)))), (x$1.$high === x.$high && x$1.$low === x.$low))) { s = ($encodeRune(((x.$low >> 0)))); } _r = makeString(new flag(v.flag).ro(), s, t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtUintString }; } $f.$24r = $24r; $f._r = _r; $f.s = s; $f.t = t; $f.v = v; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; cvtBytesString = function(v, t) { var $24r, _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; $24r = $f.$24r; _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: _arg = new flag(v.flag).ro(); _r = $clone(v, Value).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; } $24r = _r$1; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtBytesString }; } $f.$24r = $24r; $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 $24r, _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; $24r = $f.$24r; _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: _arg = new flag(v.flag).ro(); _r = $clone(v, Value).String(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = (new sliceType$8($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; } $24r = _r$1; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtStringBytes }; } $f.$24r = $24r; $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 $24r, _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; $24r = $f.$24r; _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: _arg = new flag(v.flag).ro(); _r = $clone(v, Value).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; } $24r = _r$1; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtRunesString }; } $f.$24r = $24r; $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 $24r, _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; $24r = $f.$24r; _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: _arg = new flag(v.flag).ro(); _r = $clone(v, Value).String(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = (new sliceType$10($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; } $24r = _r$1; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtStringRunes }; } $f.$24r = $24r; $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 $24r, _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; $24r = $f.$24r; _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: _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($clone(v, Value), 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; } $24r = new Value.ptr(_r$4, target, (((new flag(v.flag).ro() | 128) >>> 0) | 20) >>> 0); $s = 9; case 9: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtT2I }; } $f.$24r = $24r; $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 $24r, _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; $24r = $f.$24r; _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: /* */ if ($clone(v, Value).IsNil()) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($clone(v, Value).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 | (new flag(v.flag).ro())) >>> 0; $s = -1; return ret; /* } */ case 2: _r$1 = $clone(v, Value).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($clone(_r$1, Value), typ); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 6; case 6: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtI2I }; } $f.$24r = $24r; $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; }; structField.ptr.prototype.offset = function() { var f; f = this; return f.offsetEmbed >>> 1 >>> 0; }; structField.prototype.offset = function() { return this.$val.offset(); }; structField.ptr.prototype.embedded = function() { var f; f = this; return !((((f.offsetEmbed & 1) >>> 0) === 0)); }; structField.prototype.embedded = function() { return this.$val.embedded(); }; Method.ptr.prototype.IsExported = function() { var m; m = this; return m.PkgPath === ""; }; Method.prototype.IsExported = function() { return this.$val.IsExported(); }; Kind.prototype.String = function() { var k; k = this.$val; if (((k >> 0)) < kindNames.$length) { return ((k < 0 || k >= kindNames.$length) ? ($throwRuntimeError("index out of range"), undefined) : kindNames.$array[kindNames.$offset + k]); } return "kind" + strconv.Itoa(((k >> 0))); }; $ptrType(Kind).prototype.String = function() { return new Kind(this.$get()).String(); }; rtype.ptr.prototype.String = function() { var s, t; t = this; s = $clone(t.nameOff(t.str), name).name(); if (!((((t.tflag & 2) >>> 0) === 0))) { return $substring(s, 1); } return s; }; rtype.prototype.String = function() { return this.$val.String(); }; rtype.ptr.prototype.Size = function() { var t; t = this; return t.size; }; rtype.prototype.Size = function() { return this.$val.Size(); }; rtype.ptr.prototype.Bits = function() { var 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 t; t = this; return ((t.align >> 0)); }; rtype.prototype.Align = function() { return this.$val.Align(); }; rtype.ptr.prototype.FieldAlign = function() { var t; t = this; return ((t.fieldAlign >> 0)); }; rtype.prototype.FieldAlign = function() { return this.$val.FieldAlign(); }; rtype.ptr.prototype.Kind = function() { var t; t = this; return ((((t.kind & 31) >>> 0) >>> 0)); }; rtype.prototype.Kind = function() { return this.$val.Kind(); }; rtype.ptr.prototype.common = function() { var t; t = this; return t; }; rtype.prototype.common = function() { return this.$val.common(); }; rtype.ptr.prototype.exportedMethods = function() { var t, ut; t = this; ut = t.uncommon(); if (ut === ptrType$8.nil) { return sliceType$11.nil; } return ut.exportedMethods(); }; rtype.prototype.exportedMethods = function() { return this.$val.exportedMethods(); }; rtype.ptr.prototype.NumMethod = function() { var t, tt; t = this; if (t.Kind() === 20) { tt = (t.kindType); return tt.NumMethod(); } return t.exportedMethods().$length; }; rtype.prototype.NumMethod = function() { return this.$val.NumMethod(); }; rtype.ptr.prototype.MethodByName = function(name$1) { var $24r, _i, _r, _ref, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, i, m, name$1, ok, p, t, tt, ut, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tuple = $f._tuple; i = $f.i; m = $f.m; name$1 = $f.name$1; ok = $f.ok; p = $f.p; t = $f.t; tt = $f.tt; ut = $f.ut; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: 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$1); Method.copy(m, _tuple[0]); ok = _tuple[1]; $s = -1; return [m, ok]; } ut = t.uncommon(); if (ut === ptrType$8.nil) { _tmp = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); _tmp$1 = false; Method.copy(m, _tmp); ok = _tmp$1; $s = -1; return [m, ok]; } _ref = ut.exportedMethods(); _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } i = _i; p = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), method); /* */ if ($clone(t.nameOff(p.name), name).name() === name$1) { $s = 3; continue; } /* */ $s = 4; continue; /* if ($clone(t.nameOff(p.name), name).name() === name$1) { */ case 3: _r = t.Method(i); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tmp$2 = $clone(_r, Method); _tmp$3 = true; Method.copy(m, _tmp$2); ok = _tmp$3; $24r = [m, ok]; $s = 6; case 6: return $24r; /* } */ case 4: _i++; $s = 1; continue; case 2: _tmp$4 = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); _tmp$5 = false; Method.copy(m, _tmp$4); ok = _tmp$5; $s = -1; return [m, ok]; /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.MethodByName }; } $f.$24r = $24r; $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._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tuple = _tuple; $f.i = i; $f.m = m; $f.name$1 = name$1; $f.ok = ok; $f.p = p; $f.t = t; $f.tt = tt; $f.ut = ut; $f.$s = $s; $f.$r = $r; return $f; }; rtype.prototype.MethodByName = function(name$1) { return this.$val.MethodByName(name$1); }; rtype.ptr.prototype.PkgPath = function() { var t, ut; t = this; if (((t.tflag & 4) >>> 0) === 0) { return ""; } ut = t.uncommon(); if (ut === ptrType$8.nil) { return ""; } return $clone(t.nameOff(ut.pkgPath), name).name(); }; rtype.prototype.PkgPath = function() { return this.$val.PkgPath(); }; rtype.ptr.prototype.hasName = function() { var t; t = this; return !((((t.tflag & 4) >>> 0) === 0)); }; rtype.prototype.hasName = function() { return this.$val.hasName(); }; rtype.ptr.prototype.Name = function() { var i, s, t; t = this; if (!t.hasName()) { return ""; } s = t.String(); i = s.length - 1 >> 0; while (true) { if (!(i >= 0 && !((s.charCodeAt(i) === 46)))) { break; } i = i - (1) >> 0; } return $substring(s, (i + 1 >> 0)); }; rtype.prototype.Name = function() { return this.$val.Name(); }; rtype.ptr.prototype.ChanDir = function() { var t, tt; t = this; if (!((t.Kind() === 18))) { $panic(new $String("reflect: ChanDir of non-chan type " + t.String())); } tt = (t.kindType); return ((tt.dir >> 0)); }; rtype.prototype.ChanDir = function() { return this.$val.ChanDir(); }; rtype.ptr.prototype.IsVariadic = function() { var t, tt; t = this; if (!((t.Kind() === 19))) { $panic(new $String("reflect: IsVariadic of non-func type " + t.String())); } tt = (t.kindType); return !((((tt.outCount & 32768) >>> 0) === 0)); }; rtype.prototype.IsVariadic = function() { return this.$val.IsVariadic(); }; rtype.ptr.prototype.Elem = function() { var _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 " + t.String())); }; rtype.prototype.Elem = function() { return this.$val.Elem(); }; rtype.ptr.prototype.Field = function(i) { var i, t, tt; t = this; if (!((t.Kind() === 25))) { $panic(new $String("reflect: Field of non-struct type " + t.String())); } tt = (t.kindType); return tt.Field(i); }; rtype.prototype.Field = function(i) { return this.$val.Field(i); }; rtype.ptr.prototype.FieldByIndex = function(index) { var $24r, _r, index, t, tt, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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 " + t.String())); } 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; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.FieldByIndex }; } $f.$24r = $24r; $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$1) { var $24r, _r, name$1, t, tt, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; name$1 = $f.name$1; 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 " + t.String())); } tt = (t.kindType); _r = tt.FieldByName(name$1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.FieldByName }; } $f.$24r = $24r; $f._r = _r; $f.name$1 = name$1; $f.t = t; $f.tt = tt; $f.$s = $s; $f.$r = $r; return $f; }; rtype.prototype.FieldByName = function(name$1) { return this.$val.FieldByName(name$1); }; rtype.ptr.prototype.FieldByNameFunc = function(match) { var $24r, _r, match, t, tt, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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 " + t.String())); } 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; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.FieldByNameFunc }; } $f.$24r = $24r; $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 i, t, tt, x; t = this; if (!((t.Kind() === 19))) { $panic(new $String("reflect: In of non-func type " + t.String())); } tt = (t.kindType); return toType((x = tt.in$(), ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]))); }; rtype.prototype.In = function(i) { return this.$val.In(i); }; rtype.ptr.prototype.Key = function() { var t, tt; t = this; if (!((t.Kind() === 21))) { $panic(new $String("reflect: Key of non-map type " + t.String())); } tt = (t.kindType); return toType(tt.key); }; rtype.prototype.Key = function() { return this.$val.Key(); }; rtype.ptr.prototype.Len = function() { var t, tt; t = this; if (!((t.Kind() === 17))) { $panic(new $String("reflect: Len of non-array type " + t.String())); } tt = (t.kindType); return ((tt.len >> 0)); }; rtype.prototype.Len = function() { return this.$val.Len(); }; rtype.ptr.prototype.NumField = function() { var t, tt; t = this; if (!((t.Kind() === 25))) { $panic(new $String("reflect: NumField of non-struct type " + t.String())); } tt = (t.kindType); return tt.fields.$length; }; rtype.prototype.NumField = function() { return this.$val.NumField(); }; rtype.ptr.prototype.NumIn = function() { var t, tt; t = this; if (!((t.Kind() === 19))) { $panic(new $String("reflect: NumIn of non-func type " + t.String())); } tt = (t.kindType); return ((tt.inCount >> 0)); }; rtype.prototype.NumIn = function() { return this.$val.NumIn(); }; rtype.ptr.prototype.NumOut = function() { var t, tt; t = this; if (!((t.Kind() === 19))) { $panic(new $String("reflect: NumOut of non-func type " + t.String())); } tt = (t.kindType); return tt.out().$length; }; rtype.prototype.NumOut = function() { return this.$val.NumOut(); }; rtype.ptr.prototype.Out = function(i) { var i, t, tt, x; t = this; if (!((t.Kind() === 19))) { $panic(new $String("reflect: Out of non-func type " + t.String())); } tt = (t.kindType); return toType((x = tt.out(), ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]))); }; rtype.prototype.Out = function(i) { return this.$val.Out(i); }; ChanDir.prototype.String = function() { var _1, d; d = this.$val; _1 = d; if (_1 === (2)) { return "chan<-"; } else if (_1 === (1)) { return "<-chan"; } else if (_1 === (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 i, m, p, pname, 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"), undefined) : x.$array[x.$offset + i])); pname = $clone(t.rtype.nameOff(p.name), name); m.Name = $clone(pname, name).name(); if (!$clone(pname, name).isExported()) { m.PkgPath = $clone(pname, name).pkgPath(); if (m.PkgPath === "") { m.PkgPath = $clone(t.pkgPath, name).name(); } } m.Type = toType(t.rtype.typeOff(p.typ)); m.Index = i; return m; }; interfaceType.prototype.Method = function(i) { return this.$val.Method(i); }; interfaceType.ptr.prototype.NumMethod = function() { var t; t = this; return t.methods.$length; }; interfaceType.prototype.NumMethod = function() { return this.$val.NumMethod(); }; interfaceType.ptr.prototype.MethodByName = function(name$1) { var _i, _ref, _tmp, _tmp$1, i, m, name$1, 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$9.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"), undefined) : x.$array[x.$offset + i])); if ($clone(t.rtype.nameOff(p.name), name).name() === name$1) { _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$1) { return this.$val.MethodByName(name$1); }; StructField.ptr.prototype.IsExported = function() { var f; f = this; return f.PkgPath === ""; }; StructField.prototype.IsExported = function() { return this.$val.IsExported(); }; StructTag.prototype.Get = function(key) { var _tuple, key, tag, v; tag = this.$val; _tuple = new StructTag(tag).Lookup(key); v = _tuple[0]; return v; }; $ptrType(StructTag).prototype.Get = function(key) { return new StructTag(this.$get()).Get(key); }; StructTag.prototype.Lookup = function(key) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, err, i, key, name$1, ok, qvalue, tag, value, value$1; value = ""; ok = false; 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 = $substring(tag, 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$1 = ($substring(tag, 0, i)); tag = $substring(tag, (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 = ($substring(tag, 0, (i + 1 >> 0))); tag = $substring(tag, (i + 1 >> 0)); if (key === name$1) { _tuple = strconv.Unquote(qvalue); value$1 = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { break; } _tmp = value$1; _tmp$1 = true; value = _tmp; ok = _tmp$1; return [value, ok]; } } _tmp$2 = ""; _tmp$3 = false; value = _tmp$2; ok = _tmp$3; return [value, ok]; }; $ptrType(StructTag).prototype.Lookup = function(key) { return new StructTag(this.$get()).Lookup(key); }; structType.ptr.prototype.Field = function(i) { var f, i, p, t, tag, x; f = new StructField.ptr("", "", $ifaceNil, "", 0, sliceType$6.nil, false); t = this; if (i < 0 || i >= t.fields.$length) { $panic(new $String("reflect: Field index out of bounds")); } p = (x = t.fields, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); f.Type = toType(p.typ); f.Name = $clone(p.name, name).name(); f.Anonymous = p.embedded(); if (!$clone(p.name, name).isExported()) { f.PkgPath = $clone(t.pkgPath, name).name(); } tag = $clone(p.name, name).tag(); if (!(tag === "")) { f.Tag = (tag); } f.Offset = p.offset(); f.Index = new sliceType$6([i]); return f; }; structType.prototype.Field = function(i) { return this.$val.Field(i); }; structType.ptr.prototype.FieldByIndex = function(index) { var _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; _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$6.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"), undefined) : _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: $s = -1; return f; /* */ } return; } if ($f === undefined) { $f = { $blk: structType.ptr.prototype.FieldByIndex }; } $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 _entry, _entry$1, _entry$2, _entry$3, _i, _i$1, _key, _key$1, _key$2, _key$3, _r, _r$1, _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; _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; _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$6.nil, false); ok = false; t = this; current = new sliceType$12([]); next = new sliceType$12([new fieldScan.ptr(t, sliceType$6.nil)]); nextCount = false; visited = $makeMap(ptrType$11.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"), undefined) : _ref.$array[_ref.$offset + _i]), fieldScan); t$1 = scan.typ; if ((_entry = visited[ptrType$11.keyFor(t$1)], _entry !== undefined ? _entry.v : false)) { _i++; /* continue; */ $s = 3; continue; } _key = t$1; (visited || $throwRuntimeError("assignment to entry in nil map"))[ptrType$11.keyFor(_key)] = { k: _key, v: true }; _ref$1 = t$1.fields; _i$1 = 0; /* while (true) { */ case 5: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 6; continue; } i = _i$1; f = (x = t$1.fields, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); fname = $clone(f.name, name).name(); ntyp = ptrType$1.nil; /* */ if (f.embedded()) { $s = 7; continue; } /* */ $s = 8; continue; /* if (f.embedded()) { */ case 7: ntyp = f.typ; /* */ if (ntyp.Kind() === 22) { $s = 9; continue; } /* */ $s = 10; continue; /* if (ntyp.Kind() === 22) { */ case 9: _r = ntyp.Elem().common(); /* */ $s = 11; case 11: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } ntyp = _r; /* } */ case 10: /* } */ case 8: _r$1 = match(fname); /* */ $s = 14; case 14: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (_r$1) { $s = 12; continue; } /* */ $s = 13; continue; /* if (_r$1) { */ case 12: if ((_entry$1 = count[ptrType$11.keyFor(t$1)], _entry$1 !== undefined ? _entry$1.v : 0) > 1 || ok) { _tmp$2 = new StructField.ptr("", "", $ifaceNil, "", 0, sliceType$6.nil, false); _tmp$3 = false; StructField.copy(result, _tmp$2); ok = _tmp$3; $s = -1; return [result, ok]; } StructField.copy(result, t$1.Field(i)); result.Index = sliceType$6.nil; result.Index = $appendSlice(result.Index, scan.index); result.Index = $append(result.Index, i); ok = true; _i$1++; /* continue; */ $s = 5; continue; /* } */ case 13: if (ok || ntyp === ptrType$1.nil || !((ntyp.Kind() === 25))) { _i$1++; /* continue; */ $s = 5; continue; } styp = (ntyp.kindType); if ((_entry$2 = nextCount[ptrType$11.keyFor(styp)], _entry$2 !== undefined ? _entry$2.v : 0) > 0) { _key$1 = styp; (nextCount || $throwRuntimeError("assignment to entry in nil map"))[ptrType$11.keyFor(_key$1)] = { k: _key$1, v: 2 }; _i$1++; /* continue; */ $s = 5; continue; } if (nextCount === false) { nextCount = $makeMap(ptrType$11.keyFor, []); } _key$2 = styp; (nextCount || $throwRuntimeError("assignment to entry in nil map"))[ptrType$11.keyFor(_key$2)] = { k: _key$2, v: 1 }; if ((_entry$3 = count[ptrType$11.keyFor(t$1)], _entry$3 !== undefined ? _entry$3.v : 0) > 1) { _key$3 = styp; (nextCount || $throwRuntimeError("assignment to entry in nil map"))[ptrType$11.keyFor(_key$3)] = { k: _key$3, v: 2 }; } index = sliceType$6.nil; index = $appendSlice(index, scan.index); index = $append(index, i); next = $append(next, new fieldScan.ptr(styp, index)); _i$1++; $s = 5; continue; case 6: _i++; $s = 3; continue; case 4: if (ok) { /* break; */ $s = 2; continue; } $s = 1; continue; case 2: $s = -1; return [result, ok]; /* */ } return; } if ($f === undefined) { $f = { $blk: structType.ptr.prototype.FieldByNameFunc }; } $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._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$1) { var $24r, _i, _r, _ref, _tmp, _tmp$1, _tuple, f, hasEmbeds, i, name$1, present, t, tf, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _i = $f._i; _r = $f._r; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; f = $f.f; hasEmbeds = $f.hasEmbeds; i = $f.i; name$1 = $f.name$1; 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$1 = [name$1]; f = new StructField.ptr("", "", $ifaceNil, "", 0, sliceType$6.nil, false); present = false; t = this; hasEmbeds = false; if (!(name$1[0] === "")) { _ref = t.fields; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; tf = (x = t.fields, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); if ($clone(tf.name, name).name() === name$1[0]) { _tmp = $clone(t.Field(i), StructField); _tmp$1 = true; StructField.copy(f, _tmp); present = _tmp$1; $s = -1; return [f, present]; } if (tf.embedded()) { hasEmbeds = true; } _i++; } } if (!hasEmbeds) { $s = -1; return [f, present]; } _r = t.FieldByNameFunc((function(name$1) { return function(s) { var s; return s === name$1[0]; }; })(name$1)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; StructField.copy(f, _tuple[0]); present = _tuple[1]; $24r = [f, present]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: structType.ptr.prototype.FieldByName }; } $f.$24r = $24r; $f._i = _i; $f._r = _r; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.f = f; $f.hasEmbeds = hasEmbeds; $f.i = i; $f.name$1 = name$1; $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$1) { return this.$val.FieldByName(name$1); }; PtrTo = function(t) { var t; return $assertType(t, ptrType$1).ptrTo(); }; $pkg.PtrTo = PtrTo; rtype.ptr.prototype.Implements = function(u) { var _r, t, u, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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: $s = -1; return implements$1($assertType(u, ptrType$1), t); /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.Implements }; } $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 $24r, _r, t, u, uu, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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.AssignableTo")); } uu = $assertType(u, ptrType$1); _r = directlyAssignable(uu, t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r || implements$1(uu, t); $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.AssignableTo }; } $f.$24r = $24r; $f._r = _r; $f.t = t; $f.u = u; $f.uu = uu; $f.$s = $s; $f.$r = $r; return $f; }; rtype.prototype.AssignableTo = function(u) { return this.$val.AssignableTo(u); }; rtype.ptr.prototype.ConvertibleTo = function(u) { var $24r, _r, t, u, uu, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; } $24r = !(_r === $throwNilPointerError); $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.ConvertibleTo }; } $f.$24r = $24r; $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 T, V, i, i$1, j, j$1, t, tm, tm$1, tmName, tmName$1, tmPkgPath, tmPkgPath$1, v, v$1, vm, vm$1, vmName, vmName$1, vmPkgPath, vmPkgPath$1, vmethods, x, x$1, x$2; 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"), undefined) : x.$array[x.$offset + i])); tmName = $clone(t.rtype.nameOff(tm.name), name); vm = (x$1 = v.methods, ((j < 0 || j >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + j])); vmName = $clone(V.nameOff(vm.name), name); if ($clone(vmName, name).name() === $clone(tmName, name).name() && V.typeOff(vm.typ) === t.rtype.typeOff(tm.typ)) { if (!$clone(tmName, name).isExported()) { tmPkgPath = $clone(tmName, name).pkgPath(); if (tmPkgPath === "") { tmPkgPath = $clone(t.pkgPath, name).name(); } vmPkgPath = $clone(vmName, name).pkgPath(); if (vmPkgPath === "") { vmPkgPath = $clone(v.pkgPath, name).name(); } if (!(tmPkgPath === vmPkgPath)) { j = j + (1) >> 0; continue; } } i = i + (1) >> 0; if (i >= t.methods.$length) { return true; } } j = j + (1) >> 0; } return false; } v$1 = V.uncommon(); if (v$1 === ptrType$8.nil) { return false; } i$1 = 0; vmethods = v$1.methods(); j$1 = 0; while (true) { if (!(j$1 < ((v$1.mcount >> 0)))) { break; } tm$1 = (x$2 = t.methods, ((i$1 < 0 || i$1 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + i$1])); tmName$1 = $clone(t.rtype.nameOff(tm$1.name), name); vm$1 = $clone(((j$1 < 0 || j$1 >= vmethods.$length) ? ($throwRuntimeError("index out of range"), undefined) : vmethods.$array[vmethods.$offset + j$1]), method); vmName$1 = $clone(V.nameOff(vm$1.name), name); if ($clone(vmName$1, name).name() === $clone(tmName$1, name).name() && V.typeOff(vm$1.mtyp) === t.rtype.typeOff(tm$1.typ)) { if (!$clone(tmName$1, name).isExported()) { tmPkgPath$1 = $clone(tmName$1, name).pkgPath(); if (tmPkgPath$1 === "") { tmPkgPath$1 = $clone(t.pkgPath, name).name(); } vmPkgPath$1 = $clone(vmName$1, name).pkgPath(); if (vmPkgPath$1 === "") { vmPkgPath$1 = $clone(V.nameOff(v$1.pkgPath), name).name(); } if (!(tmPkgPath$1 === vmPkgPath$1)) { j$1 = j$1 + (1) >> 0; continue; } } i$1 = i$1 + (1) >> 0; if (i$1 >= t.methods.$length) { return true; } } j$1 = j$1 + (1) >> 0; } return false; }; specialChannelAssignability = function(T, V) { var $24r, T, V, _r, _v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; T = $f.T; V = $f.V; _r = $f._r; _v = $f._v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (!((V.ChanDir() === 3) && (T.Name() === "" || V.Name() === ""))) { _v = false; $s = 1; continue s; } _r = haveIdenticalType(T.Elem(), V.Elem(), true); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _v = _r; case 1: $24r = _v; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: specialChannelAssignability }; } $f.$24r = $24r; $f.T = T; $f.V = V; $f._r = _r; $f._v = _v; $f.$s = $s; $f.$r = $r; return $f; }; directlyAssignable = function(T, V) { var $24r, T, V, _r, _r$1, _v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; T = $f.T; V = $f.V; _r = $f._r; _r$1 = $f._r$1; _v = $f._v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (T === V) { $s = -1; return true; } if (T.hasName() && V.hasName() || !((T.Kind() === V.Kind()))) { $s = -1; return false; } if (!(T.Kind() === 18)) { _v = false; $s = 3; continue s; } _r = specialChannelAssignability(T, V); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _v = _r; case 3: /* */ if (_v) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v) { */ case 1: $s = -1; return true; /* } */ case 2: _r$1 = haveIdenticalUnderlyingType(T, V, true); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 6; case 6: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: directlyAssignable }; } $f.$24r = $24r; $f.T = T; $f.V = V; $f._r = _r; $f._r$1 = _r$1; $f._v = _v; $f.$s = $s; $f.$r = $r; return $f; }; haveIdenticalType = function(T, V, cmpTags) { var $24r, T, V, _arg, _arg$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _v, _v$1, cmpTags, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; T = $f.T; V = $f.V; _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; _r$7 = $f._r$7; _r$8 = $f._r$8; _v = $f._v; _v$1 = $f._v$1; cmpTags = $f.cmpTags; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (cmpTags) { $s = -1; return $interfaceIsEqual(T, V); } _r = T.Name(); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = V.Name(); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } if (!(_r === _r$1)) { _v$1 = true; $s = 4; 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; } _r$3 = V.Kind(); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _v$1 = !((_r$2 === _r$3)); case 4: if (_v$1) { _v = true; $s = 3; continue s; } _r$4 = T.PkgPath(); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = V.PkgPath(); /* */ $s = 10; case 10: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _v = !(_r$4 === _r$5); case 3: /* */ if (_v) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v) { */ case 1: $s = -1; return false; /* } */ case 2: _r$6 = T.common(); /* */ $s = 11; case 11: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _arg = _r$6; _r$7 = V.common(); /* */ $s = 12; case 12: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _arg$1 = _r$7; _r$8 = haveIdenticalUnderlyingType(_arg, _arg$1, false); /* */ $s = 13; case 13: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } $24r = _r$8; $s = 14; case 14: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: haveIdenticalType }; } $f.$24r = $24r; $f.T = T; $f.V = V; $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._r$7 = _r$7; $f._r$8 = _r$8; $f._v = _v; $f._v$1 = _v$1; $f.cmpTags = cmpTags; $f.$s = $s; $f.$r = $r; return $f; }; haveIdenticalUnderlyingType = function(T, V, cmpTags) { var $24r, $24r$1, $24r$2, $24r$3, T, V, _1, _i, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _ref, _v, _v$1, _v$2, cmpTags, i, i$1, i$2, kind, t, t$1, t$2, tf, v, v$1, v$2, vf, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; T = $f.T; V = $f.V; _1 = $f._1; _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; _ref = $f._ref; _v = $f._v; _v$1 = $f._v$1; _v$2 = $f._v$2; cmpTags = $f.cmpTags; i = $f.i; i$1 = $f.i$1; i$2 = $f.i$2; kind = $f.kind; t = $f.t; t$1 = $f.t$1; t$2 = $f.t$2; tf = $f.tf; v = $f.v; v$1 = $f.v$1; v$2 = $f.v$2; vf = $f.vf; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (T === V) { $s = -1; return true; } kind = T.Kind(); if (!((kind === V.Kind()))) { $s = -1; return false; } if (1 <= kind && kind <= 16 || (kind === 24) || (kind === 26)) { $s = -1; return true; } _1 = kind; /* */ if (_1 === (17)) { $s = 2; continue; } /* */ if (_1 === (18)) { $s = 3; continue; } /* */ if (_1 === (19)) { $s = 4; continue; } /* */ if (_1 === (20)) { $s = 5; continue; } /* */ if (_1 === (21)) { $s = 6; continue; } /* */ if ((_1 === (22)) || (_1 === (23))) { $s = 7; continue; } /* */ if (_1 === (25)) { $s = 8; continue; } /* */ $s = 9; continue; /* if (_1 === (17)) { */ case 2: if (!(T.Len() === V.Len())) { _v = false; $s = 10; continue s; } _r = haveIdenticalType(T.Elem(), V.Elem(), cmpTags); /* */ $s = 11; case 11: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _v = _r; case 10: $24r = _v; $s = 12; case 12: return $24r; /* } else if (_1 === (18)) { */ case 3: if (!(V.ChanDir() === T.ChanDir())) { _v$1 = false; $s = 13; continue s; } _r$1 = haveIdenticalType(T.Elem(), V.Elem(), cmpTags); /* */ $s = 14; case 14: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _v$1 = _r$1; case 13: $24r$1 = _v$1; $s = 15; case 15: return $24r$1; /* } else if (_1 === (19)) { */ case 4: t = (T.kindType); v = (V.kindType); if (!((t.outCount === v.outCount)) || !((t.inCount === v.inCount))) { $s = -1; return false; } i = 0; /* while (true) { */ case 16: /* if (!(i < t.rtype.NumIn())) { break; } */ if(!(i < t.rtype.NumIn())) { $s = 17; continue; } _r$2 = haveIdenticalType(t.rtype.In(i), v.rtype.In(i), cmpTags); /* */ $s = 20; case 20: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } /* */ if (!_r$2) { $s = 18; continue; } /* */ $s = 19; continue; /* if (!_r$2) { */ case 18: $s = -1; return false; /* } */ case 19: i = i + (1) >> 0; $s = 16; continue; case 17: i$1 = 0; /* while (true) { */ case 21: /* if (!(i$1 < t.rtype.NumOut())) { break; } */ if(!(i$1 < t.rtype.NumOut())) { $s = 22; continue; } _r$3 = haveIdenticalType(t.rtype.Out(i$1), v.rtype.Out(i$1), cmpTags); /* */ $s = 25; case 25: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } /* */ if (!_r$3) { $s = 23; continue; } /* */ $s = 24; continue; /* if (!_r$3) { */ case 23: $s = -1; return false; /* } */ case 24: i$1 = i$1 + (1) >> 0; $s = 21; continue; case 22: $s = -1; return true; /* } else if (_1 === (20)) { */ case 5: t$1 = (T.kindType); v$1 = (V.kindType); if ((t$1.methods.$length === 0) && (v$1.methods.$length === 0)) { $s = -1; return true; } $s = -1; return false; /* } else if (_1 === (21)) { */ case 6: _r$4 = haveIdenticalType(T.Key(), V.Key(), cmpTags); /* */ $s = 27; case 27: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } if (!(_r$4)) { _v$2 = false; $s = 26; continue s; } _r$5 = haveIdenticalType(T.Elem(), V.Elem(), cmpTags); /* */ $s = 28; case 28: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _v$2 = _r$5; case 26: $24r$2 = _v$2; $s = 29; case 29: return $24r$2; /* } else if ((_1 === (22)) || (_1 === (23))) { */ case 7: _r$6 = haveIdenticalType(T.Elem(), V.Elem(), cmpTags); /* */ $s = 30; case 30: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } $24r$3 = _r$6; $s = 31; case 31: return $24r$3; /* } else if (_1 === (25)) { */ case 8: t$2 = (T.kindType); v$2 = (V.kindType); if (!((t$2.fields.$length === v$2.fields.$length))) { $s = -1; return false; } if (!($clone(t$2.pkgPath, name).name() === $clone(v$2.pkgPath, name).name())) { $s = -1; return false; } _ref = t$2.fields; _i = 0; /* while (true) { */ case 32: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 33; continue; } i$2 = _i; tf = (x = t$2.fields, ((i$2 < 0 || i$2 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i$2])); vf = (x$1 = v$2.fields, ((i$2 < 0 || i$2 >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + i$2])); if (!($clone(tf.name, name).name() === $clone(vf.name, name).name())) { $s = -1; return false; } _r$7 = haveIdenticalType(tf.typ, vf.typ, cmpTags); /* */ $s = 36; case 36: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } /* */ if (!_r$7) { $s = 34; continue; } /* */ $s = 35; continue; /* if (!_r$7) { */ case 34: $s = -1; return false; /* } */ case 35: if (cmpTags && !($clone(tf.name, name).tag() === $clone(vf.name, name).tag())) { $s = -1; return false; } if (!((tf.offsetEmbed === vf.offsetEmbed))) { $s = -1; return false; } _i++; $s = 32; continue; case 33: $s = -1; return true; /* } */ case 9: case 1: $s = -1; return false; /* */ } return; } if ($f === undefined) { $f = { $blk: haveIdenticalUnderlyingType }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.T = T; $f.V = V; $f._1 = _1; $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._ref = _ref; $f._v = _v; $f._v$1 = _v$1; $f._v$2 = _v$2; $f.cmpTags = cmpTags; $f.i = i; $f.i$1 = i$1; $f.i$2 = i$2; $f.kind = kind; $f.t = t; $f.t$1 = t$1; $f.t$2 = t$2; $f.tf = tf; $f.v = v; $f.v$1 = v$1; $f.v$2 = v$2; $f.vf = vf; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; toType = function(t) { var t; if (t === ptrType$1.nil) { return $ifaceNil; } return t; }; ifaceIndir = function(t) { var t; return ((t.kind & 32) >>> 0) === 0; }; init = function() { var 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; 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 i; }); $r = used((x = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$12.nil, 0, 0), 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(0, 0, 0, 0, sliceType$11.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(0, 0, 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, $throwNilPointerError, ptrType$12.nil, 0, 0), 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, $throwNilPointerError, ptrType$12.nil, 0, 0), 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, $throwNilPointerError, ptrType$12.nil, 0, 0), 0, 0, sliceType$2.nil, sliceType$2.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, $throwNilPointerError, ptrType$12.nil, 0, 0), new name.ptr(ptrType$12.nil), sliceType$14.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, $throwNilPointerError, ptrType$12.nil, 0, 0), ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, $throwNilPointerError, 0, 0, 0, 0), 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, $throwNilPointerError, ptrType$12.nil, 0, 0), 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, $throwNilPointerError, ptrType$12.nil, 0, 0), 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, $throwNilPointerError, ptrType$12.nil, 0, 0), new name.ptr(ptrType$12.nil), sliceType$15.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(0, 0), 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(new name.ptr(ptrType$12.nil), ptrType$1.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; return; /* */ } return; } if ($f === undefined) { $f = { $blk: init }; } $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; }; New = function(typ) { var fl, pt, ptr, t, typ; if ($interfaceIsEqual(typ, $ifaceNil)) { $panic(new $String("reflect: New(nil)")); } t = $assertType(typ, ptrType$1); pt = t.ptrTo(); ptr = unsafe_New(t); fl = 22; return new Value.ptr(pt, ptr, fl); }; $pkg.New = New; jsType = function(typ) { var typ; return typ.jsType; }; reflectType = function(typ) { var _1, _i, _i$1, _i$2, _i$3, _key, _ref, _ref$1, _ref$2, _ref$3, dir, exported, exported$1, f, fields, i, i$1, i$2, i$3, i$4, i$5, imethods, in$1, m, m$1, m$2, methodSet, methods, offsetEmbed, out, outCount, params, reflectFields, reflectMethods, results, rt, typ, ut, xcount; if (typ.reflectType === undefined) { rt = new rtype.ptr(((($parseInt(typ.size) >> 0) >>> 0)), 0, 0, 0, 0, 0, ((($parseInt(typ.kind) >> 0) << 24 >>> 24)), $throwNilPointerError, ptrType$12.nil, newNameOff($clone(newName(internalStr(typ.string), "", !!(typ.exported)), name)), 0); rt.jsType = typ; typ.reflectType = rt; methodSet = $methodSet(typ); if (!(($parseInt(methodSet.length) === 0)) || !!(typ.named)) { rt.tflag = (rt.tflag | (1)) >>> 0; if (!!(typ.named)) { rt.tflag = (rt.tflag | (4)) >>> 0; } reflectMethods = sliceType$11.nil; i = 0; while (true) { if (!(i < $parseInt(methodSet.length))) { break; } m = methodSet[i]; exported = internalStr(m.pkg) === ""; if (!exported) { i = i + (1) >> 0; continue; } reflectMethods = $append(reflectMethods, new method.ptr(newNameOff($clone(newMethodName(m), name)), newTypeOff(reflectType(m.typ)), 0, 0)); i = i + (1) >> 0; } xcount = ((reflectMethods.$length << 16 >>> 16)); i$1 = 0; while (true) { if (!(i$1 < $parseInt(methodSet.length))) { break; } m$1 = methodSet[i$1]; exported$1 = internalStr(m$1.pkg) === ""; if (exported$1) { i$1 = i$1 + (1) >> 0; continue; } reflectMethods = $append(reflectMethods, new method.ptr(newNameOff($clone(newMethodName(m$1), name)), newTypeOff(reflectType(m$1.typ)), 0, 0)); i$1 = i$1 + (1) >> 0; } ut = new uncommonType.ptr(newNameOff($clone(newName(internalStr(typ.pkg), "", false), name)), (($parseInt(methodSet.length) << 16 >>> 16)), xcount, 0, reflectMethods); _key = rt; (uncommonTypeMap || $throwRuntimeError("assignment to entry in nil map"))[ptrType$1.keyFor(_key)] = { k: _key, v: ut }; ut.jsType = typ; } _1 = rt.Kind(); if (_1 === (17)) { setKindType(rt, new arrayType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$12.nil, 0, 0), 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, $throwNilPointerError, ptrType$12.nil, 0, 0), reflectType(typ.elem), ((dir >>> 0)))); } else if (_1 === (19)) { params = typ.params; in$1 = $makeSlice(sliceType$2, $parseInt(params.length)); _ref = in$1; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i$2 = _i; ((i$2 < 0 || i$2 >= in$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + i$2] = reflectType(params[i$2])); _i++; } results = typ.results; out = $makeSlice(sliceType$2, $parseInt(results.length)); _ref$1 = out; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } i$3 = _i$1; ((i$3 < 0 || i$3 >= out.$length) ? ($throwRuntimeError("index out of range"), undefined) : out.$array[out.$offset + i$3] = reflectType(results[i$3])); _i$1++; } outCount = (($parseInt(results.length) << 16 >>> 16)); if (!!(typ.variadic)) { outCount = (outCount | (32768)) >>> 0; } setKindType(rt, new funcType.ptr($clone(rt, rtype), (($parseInt(params.length) << 16 >>> 16)), outCount, in$1, out)); } else if (_1 === (20)) { methods = typ.methods; imethods = $makeSlice(sliceType$14, $parseInt(methods.length)); _ref$2 = imethods; _i$2 = 0; while (true) { if (!(_i$2 < _ref$2.$length)) { break; } i$4 = _i$2; m$2 = methods[i$4]; imethod.copy(((i$4 < 0 || i$4 >= imethods.$length) ? ($throwRuntimeError("index out of range"), undefined) : imethods.$array[imethods.$offset + i$4]), new imethod.ptr(newNameOff($clone(newMethodName(m$2), name)), newTypeOff(reflectType(m$2.typ)))); _i$2++; } setKindType(rt, new interfaceType.ptr($clone(rt, rtype), $clone(newName(internalStr(typ.pkg), "", false), name), imethods)); } else if (_1 === (21)) { setKindType(rt, new mapType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$12.nil, 0, 0), reflectType(typ.key), reflectType(typ.elem), ptrType$1.nil, $throwNilPointerError, 0, 0, 0, 0)); } else if (_1 === (22)) { setKindType(rt, new ptrType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$12.nil, 0, 0), reflectType(typ.elem))); } else if (_1 === (23)) { setKindType(rt, new sliceType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$12.nil, 0, 0), reflectType(typ.elem))); } else if (_1 === (25)) { fields = typ.fields; reflectFields = $makeSlice(sliceType$15, $parseInt(fields.length)); _ref$3 = reflectFields; _i$3 = 0; while (true) { if (!(_i$3 < _ref$3.$length)) { break; } i$5 = _i$3; f = fields[i$5]; offsetEmbed = ((i$5 >>> 0)) << 1 >>> 0; if (!!(f.embedded)) { offsetEmbed = (offsetEmbed | (1)) >>> 0; } structField.copy(((i$5 < 0 || i$5 >= reflectFields.$length) ? ($throwRuntimeError("index out of range"), undefined) : reflectFields.$array[reflectFields.$offset + i$5]), new structField.ptr($clone(newName(internalStr(f.name), internalStr(f.tag), !!(f.exported)), name), reflectType(f.typ), offsetEmbed)); _i$3++; } setKindType(rt, new structType.ptr($clone(rt, rtype), $clone(newName(internalStr(typ.pkgPath), "", false), name), reflectFields)); } } return ((typ.reflectType)); }; setKindType = function(rt, kindType) { var kindType, rt; rt.kindType = kindType; kindType.rtype = rt; }; uncommonType.ptr.prototype.methods = function() { var t; t = this; return t._methods; }; uncommonType.prototype.methods = function() { return this.$val.methods(); }; uncommonType.ptr.prototype.exportedMethods = function() { var t; t = this; return $subslice(t._methods, 0, t.xcount, t.xcount); }; uncommonType.prototype.exportedMethods = function() { return this.$val.exportedMethods(); }; rtype.ptr.prototype.uncommon = function() { var _entry, t; t = this; return (_entry = uncommonTypeMap[ptrType$1.keyFor(t)], _entry !== undefined ? _entry.v : ptrType$8.nil); }; rtype.prototype.uncommon = function() { return this.$val.uncommon(); }; funcType.ptr.prototype.in$ = function() { var t; t = this; return t._in; }; funcType.prototype.in$ = function() { return this.$val.in$(); }; funcType.ptr.prototype.out = function() { var t; t = this; return t._out; }; funcType.prototype.out = function() { return this.$val.out(); }; name.ptr.prototype.name = function() { var _entry, n, s; s = ""; n = this; s = (_entry = nameMap[ptrType$12.keyFor(n.bytes)], _entry !== undefined ? _entry.v : ptrType$16.nil).name; return s; }; name.prototype.name = function() { return this.$val.name(); }; name.ptr.prototype.tag = function() { var _entry, n, s; s = ""; n = this; s = (_entry = nameMap[ptrType$12.keyFor(n.bytes)], _entry !== undefined ? _entry.v : ptrType$16.nil).tag; return s; }; name.prototype.tag = function() { return this.$val.tag(); }; name.ptr.prototype.pkgPath = function() { var _entry, n; n = this; return (_entry = nameMap[ptrType$12.keyFor(n.bytes)], _entry !== undefined ? _entry.v : ptrType$16.nil).pkgPath; }; name.prototype.pkgPath = function() { return this.$val.pkgPath(); }; name.ptr.prototype.isExported = function() { var _entry, n; n = this; return (_entry = nameMap[ptrType$12.keyFor(n.bytes)], _entry !== undefined ? _entry.v : ptrType$16.nil).exported; }; name.prototype.isExported = function() { return this.$val.isExported(); }; newName = function(n, tag, exported) { var _key, b, exported, n, tag; b = $newDataPointer(0, ptrType$12); _key = b; (nameMap || $throwRuntimeError("assignment to entry in nil map"))[ptrType$12.keyFor(_key)] = { k: _key, v: new nameData.ptr(n, tag, exported, "") }; return new name.ptr(b); }; newMethodName = function(m) { var _key, b, m; b = $newDataPointer(0, ptrType$12); _key = b; (nameMap || $throwRuntimeError("assignment to entry in nil map"))[ptrType$12.keyFor(_key)] = { k: _key, v: new nameData.ptr(internalStr(m.name), "", internalStr(m.pkg) === "", internalStr(m.pkg)) }; return new name.ptr(b); }; rtype.ptr.prototype.nameOff = function(off) { var off, t, x; t = this; return (x = ((off >> 0)), ((x < 0 || x >= nameOffList.$length) ? ($throwRuntimeError("index out of range"), undefined) : nameOffList.$array[nameOffList.$offset + x])); }; rtype.prototype.nameOff = function(off) { return this.$val.nameOff(off); }; newNameOff = function(n) { var i, n; i = nameOffList.$length; nameOffList = $append(nameOffList, n); return ((i >> 0)); }; rtype.ptr.prototype.typeOff = function(off) { var off, t, x; t = this; return (x = ((off >> 0)), ((x < 0 || x >= typeOffList.$length) ? ($throwRuntimeError("index out of range"), undefined) : typeOffList.$array[typeOffList.$offset + x])); }; rtype.prototype.typeOff = function(off) { return this.$val.typeOff(off); }; newTypeOff = function(t) { var i, t; i = typeOffList.$length; typeOffList = $append(typeOffList, t); return ((i >> 0)); }; internalStr = function(strObj) { var c, strObj; c = new structType$3.ptr(""); c.str = strObj; return c.str; }; isWrapped = function(typ) { var typ; return !!(jsType(typ).wrapped); }; copyStruct = function(dst, src, typ) { var 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 $24r, $24r$1, _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; $24r = $f.$24r; $24r$1 = $f.$24r$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; _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; } $24r = new Value.ptr(rt, (v), (fl | ((_r$4 >>> 0))) >>> 0); $s = 10; case 10: return $24r; /* } */ 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; } $24r$1 = new Value.ptr(rt, ($newDataPointer(v, jsType(rt.ptrTo()))), (((fl | ((_r$5 >>> 0))) >>> 0) | 128) >>> 0); $s = 12; case 12: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: makeValue }; } $f.$24r = $24r; $f.$24r$1 = $24r$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._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 $24r, _r, _r$1, cap, len, typ, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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 $24r, _r$1, _r$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; } $24r = _r$2.zero(); $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$24r = $24r; $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; } $24r = _r$1; $s = 5; case 5: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: MakeSlice }; } $f.$24r = $24r; $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 i; if (!initialized) { return new rtype.ptr(0, 0, 0, 0, 0, 0, 0, $throwNilPointerError, ptrType$12.nil, 0, 0); } if ($interfaceIsEqual(i, $ifaceNil)) { return $ifaceNil; } return reflectType(i.constructor); }; $pkg.TypeOf = TypeOf; ValueOf = function(i) { var $24r, _r, i, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; i = $f.i; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if ($interfaceIsEqual(i, $ifaceNil)) { $s = -1; 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; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: ValueOf }; } $f.$24r = $24r; $f._r = _r; $f.i = i; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.ValueOf = ValueOf; FuncOf = function(in$1, out, variadic) { var _i, _i$1, _r, _ref, _ref$1, _v, _v$1, i, i$1, in$1, jsIn, jsOut, out, v, v$1, variadic, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _ref = $f._ref; _ref$1 = $f._ref$1; _v = $f._v; _v$1 = $f._v$1; i = $f.i; i$1 = $f.i$1; in$1 = $f.in$1; jsIn = $f.jsIn; jsOut = $f.jsOut; out = $f.out; v = $f.v; v$1 = $f.v$1; variadic = $f.variadic; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (!(variadic)) { _v = false; $s = 3; continue s; } if (in$1.$length === 0) { _v$1 = true; $s = 4; continue s; } _r = (x = in$1.$length - 1 >> 0, ((x < 0 || x >= in$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + x])).Kind(); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _v$1 = !((_r === 23)); case 4: _v = _v$1; case 3: /* */ if (_v) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v) { */ case 1: $panic(new $String("reflect.FuncOf: last arg of variadic func must be slice")); /* } */ case 2: jsIn = $makeSlice(sliceType$16, in$1.$length); _ref = in$1; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); ((i < 0 || i >= jsIn.$length) ? ($throwRuntimeError("index out of range"), undefined) : jsIn.$array[jsIn.$offset + i] = jsType(v)); _i++; } jsOut = $makeSlice(sliceType$16, out.$length); _ref$1 = out; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } i$1 = _i$1; v$1 = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); ((i$1 < 0 || i$1 >= jsOut.$length) ? ($throwRuntimeError("index out of range"), undefined) : jsOut.$array[jsOut.$offset + i$1] = jsType(v$1)); _i$1++; } $s = -1; return reflectType($funcType($externalize(jsIn, sliceType$16), $externalize(jsOut, sliceType$16), $externalize(variadic, $Bool))); /* */ } return; } if ($f === undefined) { $f = { $blk: FuncOf }; } $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._ref = _ref; $f._ref$1 = _ref$1; $f._v = _v; $f._v$1 = _v$1; $f.i = i; $f.i$1 = i$1; $f.in$1 = in$1; $f.jsIn = jsIn; $f.jsOut = jsOut; $f.out = out; $f.v = v; $f.v$1 = v$1; $f.variadic = variadic; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.FuncOf = FuncOf; rtype.ptr.prototype.ptrTo = function() { var t; t = this; return reflectType($ptrType(jsType(t))); }; rtype.prototype.ptrTo = function() { return this.$val.ptrTo(); }; SliceOf = function(t) { var t; return reflectType($sliceType(jsType(t))); }; $pkg.SliceOf = SliceOf; Zero = function(typ) { var $24r, _r, typ, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Zero }; } $f.$24r = $24r; $f._r = _r; $f.typ = typ; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Zero = Zero; unsafe_New = function(typ) { var _1, typ; _1 = typ.Kind(); if (_1 === (25)) { return (new (jsType(typ).ptr)()); } else if (_1 === (17)) { return (jsType(typ).zero()); } else { return ($newDataPointer(jsType(typ).zero(), jsType(typ.ptrTo()))); } }; makeInt = function(f, bits, t) { var _1, _r, bits, f, ptr, t, typ, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _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); _1 = typ.Kind(); if (_1 === (3)) { (ptr).$set(((bits.$low << 24 >> 24))); } else if (_1 === (4)) { (ptr).$set(((bits.$low << 16 >> 16))); } else if ((_1 === (2)) || (_1 === (5))) { (ptr).$set(((bits.$low >> 0))); } else if (_1 === (6)) { (ptr).$set((new $Int64(bits.$high, bits.$low))); } else if (_1 === (8)) { (ptr).$set(((bits.$low << 24 >>> 24))); } else if (_1 === (9)) { (ptr).$set(((bits.$low << 16 >>> 16))); } else if ((_1 === (7)) || (_1 === (10)) || (_1 === (12))) { (ptr).$set(((bits.$low >>> 0))); } else if (_1 === (11)) { (ptr).$set((bits)); } $s = -1; return new Value.ptr(typ, ptr, (((f | 128) >>> 0) | ((typ.Kind() >>> 0))) >>> 0); /* */ } return; } if ($f === undefined) { $f = { $blk: makeInt }; } $f._1 = _1; $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 dst, src, t; dst.$set(src.$get()); }; makemap = function(t, cap) { var cap, m, t; m = 0; m = (new ($global.Object)()); return m; }; keyFor = function(t, key) { var 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 _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 _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; _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; return; /* */ } return; } if ($f === undefined) { $f = { $blk: mapassign }; } $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 _tuple, k, key, m, t; _tuple = keyFor(t, key); k = _tuple[1]; delete m[$externalize(k, $String)]; }; mapIter.ptr.prototype.skipUntilValidKey = function() { var iter, k; iter = this; while (true) { if (!(iter.i < $parseInt(iter.keys.length))) { break; } k = iter.keys[iter.i]; if (!(iter.m[$externalize($internalize(k, $String), $String)] === undefined)) { break; } iter.i = iter.i + (1) >> 0; } }; mapIter.prototype.skipUntilValidKey = function() { return this.$val.skipUntilValidKey(); }; mapiterinit = function(t, m) { var m, t; return (new mapIter.ptr(t, m, $keys(m), 0, null)); }; mapiterkey = function(it) { var $24r, _r, _r$1, _r$2, it, iter, k, kv, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; it = $f.it; iter = $f.iter; k = $f.k; kv = $f.kv; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: iter = ($pointerOfStructConversion(it, ptrType$17)); kv = null; if (!(iter.last === null)) { kv = iter.last; } else { iter.skipUntilValidKey(); if (iter.i === $parseInt(iter.keys.length)) { $s = -1; return 0; } k = iter.keys[iter.i]; kv = iter.m[$externalize($internalize(k, $String), $String)]; iter.last = kv; } _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; } $24r = ($newDataPointer(kv.k, _r$2)); $s = 4; case 4: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: mapiterkey }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.it = it; $f.iter = iter; $f.k = k; $f.kv = kv; $f.$s = $s; $f.$r = $r; return $f; }; mapiterelem = function(it) { var $24r, _r, _r$1, _r$2, it, iter, k, kv, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; it = $f.it; iter = $f.iter; k = $f.k; kv = $f.kv; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: iter = ($pointerOfStructConversion(it, ptrType$17)); kv = null; if (!(iter.last === null)) { kv = iter.last; } else { iter.skipUntilValidKey(); if (iter.i === $parseInt(iter.keys.length)) { $s = -1; return 0; } k = iter.keys[iter.i]; kv = iter.m[$externalize($internalize(k, $String), $String)]; iter.last = kv; } _r = iter.t.Elem(); /* */ $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; } $24r = ($newDataPointer(kv.v, _r$2)); $s = 4; case 4: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: mapiterelem }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.it = it; $f.iter = iter; $f.k = k; $f.kv = kv; $f.$s = $s; $f.$r = $r; return $f; }; mapiternext = function(it) { var it, iter; iter = ($pointerOfStructConversion(it, ptrType$17)); iter.last = null; iter.i = iter.i + (1) >> 0; }; maplen = function(m) { var m; return $parseInt($keys(m).length); }; cvtDirect = function(v, typ) { var $24r, $24r$1, _1, _2, _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; $24r = $f.$24r; $24r$1 = $f.$24r$1; _1 = $f._1; _2 = $f._2; _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: srcVal = $clone(v, Value).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; } $24r = _r; $s = 4; case 4: return $24r; /* } */ 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; _1 = k; /* */ if (_1 === (23)) { $s = 7; continue; } /* */ if (_1 === (22)) { $s = 8; continue; } /* */ if (_1 === (25)) { $s = 9; continue; } /* */ if ((_1 === (17)) || (_1 === (1)) || (_1 === (18)) || (_1 === (19)) || (_1 === (20)) || (_1 === (21)) || (_1 === (24)) || (_1 === (26))) { $s = 10; continue; } /* */ $s = 11; continue; /* if (_1 === (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 (_1 === (22)) { */ case 8: _r$2 = typ.Elem(); /* */ $s = 14; case 14: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = _r$2.Kind(); /* */ $s = 15; case 15: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _2 = _r$3; /* */ if (_2 === (25)) { $s = 16; continue; } /* */ if (_2 === (17)) { $s = 17; continue; } /* */ $s = 18; continue; /* if (_2 === (25)) { */ case 16: _r$4 = typ.Elem(); /* */ $s = 22; case 22: 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 = 20; continue; } /* */ $s = 21; continue; /* if ($interfaceIsEqual(_r$4, v.typ.Elem())) { */ case 20: val = srcVal; /* break; */ $s = 13; continue; /* } */ case 21: val = new (jsType(typ))(); _arg = val; _arg$1 = srcVal; _r$5 = typ.Elem(); /* */ $s = 23; case 23: 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 = 24; case 24: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 19; continue; /* } else if (_2 === (17)) { */ case 17: val = srcVal; $s = 19; continue; /* } else { */ case 18: val = new (jsType(typ))(srcVal.$get, srcVal.$set); /* } */ case 19: case 13: $s = 12; continue; /* } else if (_1 === (25)) { */ case 9: val = new (jsType(typ).ptr)(); copyStruct(val, srcVal, typ); $s = 12; continue; /* } else if ((_1 === (17)) || (_1 === (1)) || (_1 === (18)) || (_1 === (19)) || (_1 === (20)) || (_1 === (21)) || (_1 === (24)) || (_1 === (26))) { */ 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 = 25; case 25: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$7 = typ.Kind(); /* */ $s = 26; case 26: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } $24r$1 = new Value.ptr(_r$6, (val), (((new flag(v.flag).ro() | ((v.flag & 128) >>> 0)) >>> 0) | ((_r$7 >>> 0))) >>> 0); $s = 27; case 27: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtDirect }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._1 = _1; $f._2 = _2; $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; }; cvtSliceArrayPtr = function(v, t) { var $24r, _r, _r$1, _r$2, alen, array, slen, slice, t, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; alen = $f.alen; array = $f.array; slen = $f.slen; slice = $f.slice; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: slice = $clone(v, Value).object(); slen = $parseInt(slice.$length) >> 0; _r = t.Elem(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = _r.Len(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } alen = _r$1; if (alen > slen) { $panic(new $String("reflect: cannot convert slice with length " + itoa.Itoa(slen) + " to pointer to array with length " + itoa.Itoa(alen))); } array = $sliceToGoArray(slice, jsType(t)); _r$2 = t.common(); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = new Value.ptr(_r$2, (array), (((v.flag & ~415) >>> 0) | 22) >>> 0); $s = 4; case 4: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtSliceArrayPtr }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.alen = alen; $f.array = array; $f.slen = slen; $f.slice = slice; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Copy = function(dst, src) { var _r, _v, dk, dst, dstVal, sk, src, srcVal, stringCopy, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _v = $f._v; dk = $f.dk; dst = $f.dst; dstVal = $f.dstVal; sk = $f.sk; src = $f.src; srcVal = $f.srcVal; stringCopy = $f.stringCopy; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: dk = new flag(dst.flag).kind(); if (!((dk === 17)) && !((dk === 23))) { $panic(new ValueError.ptr("reflect.Copy", dk)); } if (dk === 17) { new flag(dst.flag).mustBeAssignable(); } new flag(dst.flag).mustBeExported(); sk = new flag(src.flag).kind(); stringCopy = false; /* */ if (!((sk === 17)) && !((sk === 23))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((sk === 17)) && !((sk === 23))) { */ case 1: if (!(sk === 24)) { _v = false; $s = 3; continue s; } _r = dst.typ.Elem().Kind(); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _v = _r === 8; case 3: stringCopy = _v; if (!stringCopy) { $panic(new ValueError.ptr("reflect.Copy", sk)); } /* } */ case 2: new flag(src.flag).mustBeExported(); /* */ if (!stringCopy) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!stringCopy) { */ case 5: $r = typesMustMatch("reflect.Copy", dst.typ.Elem(), src.typ.Elem()); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 6: dstVal = $clone(dst, Value).object(); if (dk === 17) { dstVal = new (jsType(SliceOf(dst.typ.Elem())))(dstVal); } srcVal = $clone(src, Value).object(); if (sk === 17) { srcVal = new (jsType(SliceOf(src.typ.Elem())))(srcVal); } if (stringCopy) { $s = -1; return $parseInt($copyString(dstVal, srcVal)) >> 0; } $s = -1; return $parseInt($copySlice(dstVal, srcVal)) >> 0; /* */ } return; } if ($f === undefined) { $f = { $blk: Copy }; } $f._r = _r; $f._v = _v; $f.dk = dk; $f.dst = dst; $f.dstVal = dstVal; $f.sk = sk; $f.src = src; $f.srcVal = srcVal; $f.stringCopy = stringCopy; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Copy = Copy; methodReceiver = function(op, v, i) { var _$42, fn, i, m, m$1, ms, op, prop, rcvr, t, tt, v, x; _$42 = ptrType$1.nil; t = ptrType$18.nil; fn = 0; 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"), undefined) : x.$array[x.$offset + i])); if (!$clone(tt.rtype.nameOff(m.name), name).isExported()) { $panic(new $String("reflect: " + op + " of unexported method")); } t = (tt.rtype.typeOff(m.typ).kindType); prop = $clone(tt.rtype.nameOff(m.name), name).name(); } else { ms = v.typ.exportedMethods(); if (((i >>> 0)) >= ((ms.$length >>> 0))) { $panic(new $String("reflect: internal error: invalid method index")); } m$1 = $clone(((i < 0 || i >= ms.$length) ? ($throwRuntimeError("index out of range"), undefined) : ms.$array[ms.$offset + i]), method); if (!$clone(v.typ.nameOff(m$1.name), name).isExported()) { $panic(new $String("reflect: " + op + " of unexported method")); } t = (v.typ.typeOff(m$1.mtyp).kindType); prop = $internalize($methodSet(jsType(v.typ))[i].prop, $String); } rcvr = $clone(v, Value).object(); if (isWrapped(v.typ)) { rcvr = new (jsType(v.typ))(rcvr); } fn = (rcvr[$externalize(prop, $String)]); return [_$42, t, fn]; }; valueInterface = function(v, safe) { var _r, safe, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; safe = $f.safe; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: 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", $clone(v, Value)); /* */ $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)) { $s = -1; return ((new (jsType(v.typ))($clone(v, Value).object()))); } $s = -1; return (($clone(v, Value).object())); /* */ } return; } if ($f === undefined) { $f = { $blk: valueInterface }; } $f._r = _r; $f.safe = safe; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; ifaceE2I = function(t, src, dst) { var dst, src, t; dst.$set(src); }; makeMethodValue = function(op, v) { var $24r, _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; $24r = $f.$24r; _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]; if (((v.flag & 512) >>> 0) === 0) { $panic(new $String("reflect: internal error: invalid use of makePartialFunc")); } _tuple = methodReceiver(op, $clone(v, Value), ((v.flag >> 0)) >> 10 >> 0); fn[0] = _tuple[2]; rcvr[0] = $clone(v, Value).object(); if (isWrapped(v.typ)) { rcvr[0] = new (jsType(v.typ))(rcvr[0]); } fv = js.MakeFunc((function(fn, rcvr) { return function(this$1, arguments$1) { var arguments$1, this$1; return new $jsObjectPtr(fn[0].apply(rcvr[0], $externalize(arguments$1, sliceType$16))); }; })(fn, rcvr)); _r = $clone(v, Value).Type().common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = new Value.ptr(_r, (fv), (new flag(v.flag).ro() | 19) >>> 0); $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: makeMethodValue }; } $f.$24r = $24r; $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 _1, t; t = this; _1 = t.Kind(); if ((_1 === (22)) || (_1 === (21)) || (_1 === (18)) || (_1 === (19)) || (_1 === (25)) || (_1 === (17))) { return true; } else { return false; } }; rtype.prototype.pointers = function() { return this.$val.pointers(); }; rtype.ptr.prototype.Comparable = function() { var $24r, _1, _r, _r$1, i, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; i = $f.i; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _1 = t.Kind(); /* */ if ((_1 === (19)) || (_1 === (23)) || (_1 === (21))) { $s = 2; continue; } /* */ if (_1 === (17)) { $s = 3; continue; } /* */ if (_1 === (25)) { $s = 4; continue; } /* */ $s = 5; continue; /* if ((_1 === (19)) || (_1 === (23)) || (_1 === (21))) { */ case 2: $s = -1; return false; /* } else if (_1 === (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; } $24r = _r; $s = 7; case 7: return $24r; /* } else if (_1 === (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).Type.Comparable(); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (!_r$1) { $s = 10; continue; } /* */ $s = 11; continue; /* if (!_r$1) { */ case 10: $s = -1; return false; /* } */ case 11: i = i + (1) >> 0; $s = 8; continue; case 9: /* } */ case 5: case 1: $s = -1; return true; /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.Comparable }; } $f.$24r = $24r; $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f.i = i; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; rtype.prototype.Comparable = function() { return this.$val.Comparable(); }; rtype.ptr.prototype.Method = function(i) { var _i, _i$1, _r, _ref, _ref$1, arg, fl, fn, ft, i, in$1, m, methods, mt, mtyp, out, p, pname, prop, ret, t, tt, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _ref = $f._ref; _ref$1 = $f._ref$1; arg = $f.arg; fl = $f.fl; fn = $f.fn; ft = $f.ft; i = $f.i; in$1 = $f.in$1; m = $f.m; methods = $f.methods; mt = $f.mt; mtyp = $f.mtyp; out = $f.out; p = $f.p; pname = $f.pname; prop = $f.prop; ret = $f.ret; t = $f.t; tt = $f.tt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: prop = [prop]; 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)); $s = -1; return m; } methods = t.exportedMethods(); if (i < 0 || i >= methods.$length) { $panic(new $String("reflect: Method index out of range")); } p = $clone(((i < 0 || i >= methods.$length) ? ($throwRuntimeError("index out of range"), undefined) : methods.$array[methods.$offset + i]), method); pname = $clone(t.nameOff(p.name), name); m.Name = $clone(pname, name).name(); fl = 19; mtyp = t.typeOff(p.mtyp); ft = (mtyp.kindType); in$1 = $makeSlice(sliceType$17, 0, (1 + ft.in$().$length >> 0)); in$1 = $append(in$1, t); _ref = ft.in$(); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } arg = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); in$1 = $append(in$1, arg); _i++; } out = $makeSlice(sliceType$17, 0, ft.out().$length); _ref$1 = ft.out(); _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } ret = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); out = $append(out, ret); _i$1++; } _r = FuncOf(in$1, out, ft.rtype.IsVariadic()); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } mt = _r; m.Type = mt; prop[0] = $internalize($methodSet(t.jsType)[i].prop, $String); fn = js.MakeFunc((function(prop) { return function(this$1, arguments$1) { var arguments$1, rcvr, this$1; rcvr = (0 >= arguments$1.$length ? ($throwRuntimeError("index out of range"), undefined) : arguments$1.$array[arguments$1.$offset + 0]); return new $jsObjectPtr(rcvr[$externalize(prop[0], $String)].apply(rcvr, $externalize($subslice(arguments$1, 1), sliceType$16))); }; })(prop)); m.Func = new Value.ptr($assertType(mt, ptrType$1), (fn), fl); m.Index = i; Method.copy(m, m); $s = -1; return m; /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.Method }; } $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._ref = _ref; $f._ref$1 = _ref$1; $f.arg = arg; $f.fl = fl; $f.fn = fn; $f.ft = ft; $f.i = i; $f.in$1 = in$1; $f.m = m; $f.methods = methods; $f.mt = mt; $f.mtyp = mtyp; $f.out = out; $f.p = p; $f.pname = pname; $f.prop = prop; $f.ret = ret; $f.t = t; $f.tt = tt; $f.$s = $s; $f.$r = $r; return $f; }; rtype.prototype.Method = function(i) { return this.$val.Method(i); }; Value.ptr.prototype.object = function() { var _1, 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: _1 = v.typ.Kind(); if ((_1 === (11)) || (_1 === (6))) { val = new (jsType(v.typ))(val.$high, val.$low); } else if ((_1 === (15)) || (_1 === (16))) { val = new (jsType(v.typ))(val.$real, val.$imag); } else if (_1 === (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.assignTo = function(context, dst, target) { var _r, _r$1, _r$2, context, dst, fl, target, v, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; 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, $clone(v, Value)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } v = _r; /* } */ case 2: _r$1 = directlyAssignable(dst, v.typ); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (_r$1) { $s = 5; continue; } /* */ if (implements$1(dst, v.typ)) { $s = 6; continue; } /* */ $s = 7; continue; /* if (_r$1) { */ case 5: fl = (((v.flag & 384) >>> 0) | new flag(v.flag).ro()) >>> 0; fl = (fl | (((dst.Kind() >>> 0)))) >>> 0; $s = -1; 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$2 = valueInterface($clone(v, Value), false); /* */ $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; if (dst.NumMethod() === 0) { (target).$set(x); } else { ifaceE2I(dst, x, target); } $s = -1; 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; return new Value.ptr(ptrType$1.nil, 0, 0); /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.assignTo }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $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.call = function(op, in$1) { var $24r, _1, _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; $24r = $f.$24r; _1 = $f._1; _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 = ptrType$18.nil; fn = 0; rcvr = null; if (!((((v.flag & 512) >>> 0) === 0))) { _tuple = methodReceiver(op, $clone(v, Value), ((v.flag >> 0)) >> 10 >> 0); t = _tuple[1]; fn = _tuple[2]; rcvr = $clone(v, Value).object(); if (isWrapped(v.typ)) { rcvr = new (jsType(v.typ))(rcvr); } } else { t = (v.typ.kindType); fn = ($clone(v, Value).object()); rcvr = undefined; } if (fn === 0) { $panic(new $String("reflect.Value.Call: call of nil function")); } isSlice = op === "CallSlice"; n = t.rtype.NumIn(); if (isSlice) { if (!t.rtype.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.rtype.IsVariadic()) { n = n - (1) >> 0; } if (in$1.$length < n) { $panic(new $String("reflect: Call with too few input arguments")); } if (!t.rtype.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"), undefined) : _ref.$array[_ref.$offset + _i]); if ($clone(x, Value).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 = $clone(((i < 0 || i >= in$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + i]), Value).Type(); _tmp$1 = t.rtype.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.rtype.IsVariadic()) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!isSlice && t.rtype.IsVariadic()) { */ case 8: m = in$1.$length - n >> 0; _r$3 = MakeSlice(t.rtype.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.rtype.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"), undefined) : in$1.$array[in$1.$offset + x$1])); xt$1 = $clone(x$2, Value).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 = $clone(slice, Value).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 = $clone(_r$8, Value).Set($clone(x$2, Value)); /* */ $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$7, (n + 1 >> 0)); $copySlice($subslice(in$1, 0, n), origIn); ((n < 0 || n >= in$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + n] = slice); /* } */ case 9: nin = in$1.$length; if (!((nin === t.rtype.NumIn()))) { $panic(new $String("reflect.Value.Call: wrong argument count")); } nout = t.rtype.NumOut(); argsArray = new ($global.Array)(t.rtype.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"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); _arg = t.rtype.In(i$2); _r$9 = t.rtype.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 = $clone(arg, Value).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 = $clone(_r$10, Value).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$4([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; _1 = nout; /* */ if (_1 === (0)) { $s = 29; continue; } /* */ if (_1 === (1)) { $s = 30; continue; } /* */ $s = 31; continue; /* if (_1 === (0)) { */ case 29: $s = -1; return sliceType$7.nil; /* } else if (_1 === (1)) { */ case 30: _r$14 = makeValue(t.rtype.Out(0), wrapJsObject(t.rtype.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; } $24r = new sliceType$7([$clone(_r$14, Value)]); $s = 34; case 34: return $24r; /* } else { */ case 31: ret = $makeSlice(sliceType$7, 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.rtype.Out(i$3), wrapJsObject(t.rtype.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"), undefined) : ret.$array[ret.$offset + i$3] = _r$15); _i$2++; $s = 35; continue; case 36: $s = -1; return ret; /* } */ case 32: case 28: $s = -1; return sliceType$7.nil; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.call }; } $f.$24r = $24r; $f._1 = _1; $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 _1, k, v; v = this; k = new flag(v.flag).kind(); _1 = k; if (_1 === (17)) { return v.typ.Len(); } else if ((_1 === (18)) || (_1 === (23))) { return $parseInt($clone(v, Value).object().$capacity) >> 0; } $panic(new ValueError.ptr("reflect.Value.Cap", k)); }; Value.prototype.Cap = function() { return this.$val.Cap(); }; wrapJsObject = function(typ, val) { var typ, val; if ($interfaceIsEqual(typ, jsObjectPtr)) { return new (jsType(jsObjectPtr))(val); } return val; }; unwrapJsObject = function(typ, val) { var typ, val; if ($interfaceIsEqual(typ, jsObjectPtr)) { return val.object; } return val; }; Value.ptr.prototype.Elem = function() { var $24r, _1, _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; $24r = $f.$24r; _1 = $f._1; _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(); _1 = k; /* */ if (_1 === (20)) { $s = 2; continue; } /* */ if (_1 === (22)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_1 === (20)) { */ case 2: val = $clone(v, Value).object(); if (val === $ifaceNil) { $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); } typ = reflectType(val.constructor); _r = makeValue(typ, val.$val, new flag(v.flag).ro()); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 7; case 7: return $24r; /* } else if (_1 === (22)) { */ case 3: if ($clone(v, Value).IsNil()) { $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); } val$1 = $clone(v, Value).object(); tt = (v.typ.kindType); fl = (((((v.flag & 96) >>> 0) | 128) >>> 0) | 256) >>> 0; fl = (fl | (((tt.elem.Kind() >>> 0)))) >>> 0; $s = -1; 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; return new Value.ptr(ptrType$1.nil, 0, 0); /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Elem }; } $f.$24r = $24r; $f._1 = _1; $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 $24r, _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; $24r = $f.$24r; _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; if (!((new flag(v.flag).kind() === 25))) { $panic(new ValueError.ptr("reflect.Value.Field", new flag(v.flag).kind())); } tt = (v.typ.kindType); if (((i >>> 0)) >= ((tt.fields.$length >>> 0))) { $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"), undefined) : x.$array[x.$offset + i])); typ[0] = field.typ; fl = (((v.flag & 416) >>> 0) | ((typ[0].Kind() >>> 0))) >>> 0; if (!$clone(field.name, name).isExported()) { if (field.embedded()) { fl = (fl | (64)) >>> 0; } else { fl = (fl | (32)) >>> 0; } } tag = $clone((x$1 = tt.fields, ((i < 0 || i >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + i])).name, name).tag(); /* */ if (!(tag === "") && !((i === 0))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(tag === "") && !((i === 0))) { */ case 1: jsTag[0] = getJsTag(tag); /* */ if (!(jsTag[0] === "")) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!(jsTag[0] === "")) { */ case 3: /* while (true) { */ case 5: o = [o]; _r = $clone(v, Value).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] = $clone(v, Value).object().object; $s = -1; return new Value.ptr(typ[0], (new (jsType(PtrTo(typ[0])))((function(jsTag, o, prop, s, typ) { return function() { 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 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 = $clone(v, Value).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: $s = -1; return new Value.ptr(typ[0], (new (jsType(PtrTo(typ[0])))((function(jsTag, prop, s, typ) { return function() { return wrapJsObject(typ[0], s[0][$externalize(prop[0], $String)]); }; })(jsTag, prop, s, typ), (function(jsTag, prop, s, typ) { return function(x$2) { var 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; } $24r = _r$2; $s = 16; case 16: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Field }; } $f.$24r = $24r; $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 _tuple, i, name$1, 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 = $substring(tag, 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$1 = ($substring(tag, 0, i)); tag = $substring(tag, (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 = ($substring(tag, 0, (i + 1 >> 0))); tag = $substring(tag, (i + 1 >> 0)); if (name$1 === "js") { _tuple = strconv.Unquote(qvalue); value = _tuple[0]; return value; } } return ""; }; Value.ptr.prototype.CanConvert = function(t) { var _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _v, _v$1, n, t, v, vt, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; n = $f.n; t = $f.t; v = $f.v; vt = $f.vt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = this; vt = $clone(v, Value).Type(); _r = vt.ConvertibleTo(t); /* */ $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: $s = -1; return false; /* } */ case 2: _r$1 = vt.Kind(); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } if (!(_r$1 === 23)) { _v$1 = false; $s = 7; continue s; } _r$2 = t.Kind(); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _v$1 = _r$2 === 22; case 7: if (!(_v$1)) { _v = false; $s = 6; continue s; } _r$3 = t.Elem(); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = _r$3.Kind(); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _v = _r$4 === 17; case 6: /* */ if (_v) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_v) { */ case 4: _r$5 = t.Elem(); /* */ $s = 12; case 12: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$6 = _r$5.Len(); /* */ $s = 13; case 13: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } n = _r$6; if (n > $clone(v, Value).Len()) { $s = -1; return false; } /* } */ case 5: $s = -1; return true; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.CanConvert }; } $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.n = n; $f.t = t; $f.v = v; $f.vt = vt; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.CanConvert = function(t) { return this.$val.CanConvert(t); }; Value.ptr.prototype.Index = function(i) { var $24r, $24r$1, _1, _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; $24r = $f.$24r; $24r$1 = $f.$24r$1; _1 = $f._1; _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(); _1 = k; /* */ if (_1 === (17)) { $s = 2; continue; } /* */ if (_1 === (23)) { $s = 3; continue; } /* */ if (_1 === (24)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_1 === (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[0] = tt.elem; fl = (((((v.flag & 384) >>> 0) | new flag(v.flag).ro()) >>> 0) | ((typ[0].Kind() >>> 0))) >>> 0; a[0] = v.ptr; /* */ if (!((((fl & 128) >>> 0) === 0)) && !((typ[0].Kind() === 17)) && !((typ[0].Kind() === 25))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!((((fl & 128) >>> 0) === 0)) && !((typ[0].Kind() === 17)) && !((typ[0].Kind() === 25))) { */ case 7: $s = -1; return new Value.ptr(typ[0], (new (jsType(PtrTo(typ[0])))((function(a, a$1, c, i, typ, typ$1) { return function() { 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 x; a[0][i[0]] = unwrapJsObject(typ[0], x); }; })(a, a$1, c, i, typ, typ$1))), fl); /* } */ case 8: _r = makeValue(typ[0], wrapJsObject(typ[0], a[0][i[0]]), fl); /* */ $s = 9; case 9: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 10; case 10: return $24r; /* } else if (_1 === (23)) { */ case 3: s = $clone(v, Value).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$1[0] = tt$1.elem; fl$1 = (((384 | new flag(v.flag).ro()) >>> 0) | ((typ$1[0].Kind() >>> 0))) >>> 0; i[0] = i[0] + (($parseInt(s.$offset) >> 0)) >> 0; a$1[0] = s.$array; /* */ if (!((((fl$1 & 128) >>> 0) === 0)) && !((typ$1[0].Kind() === 17)) && !((typ$1[0].Kind() === 25))) { $s = 11; continue; } /* */ $s = 12; continue; /* if (!((((fl$1 & 128) >>> 0) === 0)) && !((typ$1[0].Kind() === 17)) && !((typ$1[0].Kind() === 25))) { */ case 11: $s = -1; return new Value.ptr(typ$1[0], (new (jsType(PtrTo(typ$1[0])))((function(a, a$1, c, i, typ, typ$1) { return function() { 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 x; a$1[0][i[0]] = unwrapJsObject(typ$1[0], x); }; })(a, a$1, c, i, typ, typ$1))), fl$1); /* } */ case 12: _r$1 = makeValue(typ$1[0], wrapJsObject(typ$1[0], a$1[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; } $24r$1 = _r$1; $s = 14; case 14: return $24r$1; /* } else if (_1 === (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 = (((new flag(v.flag).ro() | 8) >>> 0) | 128) >>> 0; c[0] = str.charCodeAt(i[0]); $s = -1; return new Value.ptr(uint8Type, ((c.$ptr || (c.$ptr = new ptrType$12(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, c)))), fl$2); /* } else { */ case 5: $panic(new ValueError.ptr("reflect.Value.Index", k)); /* } */ case 6: case 1: $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Index }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._1 = _1; $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 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 _1, k, v; v = this; k = new flag(v.flag).kind(); _1 = k; if ((_1 === (22)) || (_1 === (23))) { return $clone(v, Value).object() === jsType(v.typ).nil; } else if (_1 === (18)) { return $clone(v, Value).object() === $chanNil; } else if (_1 === (19)) { return $clone(v, Value).object() === $throwNilPointerError; } else if (_1 === (21)) { return $clone(v, Value).object() === false; } else if (_1 === (20)) { return $clone(v, Value).object() === $ifaceNil; } else if (_1 === (26)) { return $clone(v, Value).object() === 0; } else { $panic(new ValueError.ptr("reflect.Value.IsNil", k)); } }; Value.prototype.IsNil = function() { return this.$val.IsNil(); }; Value.ptr.prototype.Len = function() { var _1, k, v; v = this; k = new flag(v.flag).kind(); _1 = k; if ((_1 === (17)) || (_1 === (24))) { return $parseInt($clone(v, Value).object().length); } else if (_1 === (23)) { return $parseInt($clone(v, Value).object().$length) >> 0; } else if (_1 === (18)) { return $parseInt($clone(v, Value).object().$buffer.length) >> 0; } else if (_1 === (21)) { return $parseInt($keys($clone(v, Value).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 _1, k, v; v = this; k = new flag(v.flag).kind(); _1 = k; if ((_1 === (18)) || (_1 === (21)) || (_1 === (22)) || (_1 === (26))) { if ($clone(v, Value).IsNil()) { return 0; } return $clone(v, Value).object(); } else if (_1 === (19)) { if ($clone(v, Value).IsNil()) { return 0; } return 1; } else if (_1 === (23)) { if ($clone(v, Value).IsNil()) { return 0; } return $clone(v, Value).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 _1, _r, _r$1, v, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _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: v = this; new flag(v.flag).mustBeAssignable(); new flag(x.flag).mustBeExported(); _r = $clone(x, Value).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: _1 = v.typ.Kind(); /* */ if (_1 === (17)) { $s = 5; continue; } /* */ if (_1 === (20)) { $s = 6; continue; } /* */ if (_1 === (25)) { $s = 7; continue; } /* */ $s = 8; continue; /* if (_1 === (17)) { */ case 5: jsType(v.typ).copy(v.ptr, x.ptr); $s = 9; continue; /* } else if (_1 === (20)) { */ case 6: _r$1 = valueInterface($clone(x, Value), 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 (_1 === (25)) { */ case 7: copyStruct(v.ptr, x.ptr, v.typ); $s = 9; continue; /* } else { */ case 8: v.ptr.$set($clone(x, Value).object()); /* } */ case 9: case 4: $s = -1; return; /* } */ case 3: v.ptr = x.ptr; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Set }; } $f._1 = _1; $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 _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; _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; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.SetBytes }; } $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 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 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 $24r, $24r$1, _1, _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; $24r = $f.$24r; $24r$1 = $f.$24r$1; _1 = $f._1; _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(); _1 = kind; /* */ if (_1 === (17)) { $s = 2; continue; } /* */ if (_1 === (23)) { $s = 3; continue; } /* */ if (_1 === (24)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_1 === (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))($clone(v, Value).object()); $s = 6; continue; /* } else if (_1 === (23)) { */ case 3: typ = v.typ; s = $clone(v, Value).object(); cap = $parseInt(s.$capacity) >> 0; $s = 6; continue; /* } else if (_1 === (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($substring(str, i, j))); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 8; case 8: return $24r; /* } 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), new flag(v.flag).ro()); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r$1 = _r$1; $s = 10; case 10: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Slice }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._1 = _1; $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 $24r, _1, _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; $24r = $f.$24r; _1 = $f._1; _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(); _1 = kind; if (_1 === (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))($clone(v, Value).object()); } else if (_1 === (23)) { typ = v.typ; s = $clone(v, Value).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), new flag(v.flag).ro()); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Slice3 }; } $f.$24r = $24r; $f._1 = _1; $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 v; v = this; new flag(v.flag).mustBe(18); new flag(v.flag).mustBeExported(); $close($clone(v, Value).object()); }; Value.prototype.Close = function() { return this.$val.Close(); }; chanrecv = function(ch, nb, val) { var _r, _tmp, _tmp$1, _tmp$2, _tmp$3, ch, comms, nb, received, recvRes, selectRes, selected, val, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: selected = false; received = false; comms = new sliceType$18([new sliceType$16([ch])]); if (nb) { comms = $append(comms, new sliceType$16([])); } _r = selectHelper(new sliceType$4([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; $s = -1; return [selected, received]; } recvRes = selectRes[1]; val.$set(recvRes[0]); _tmp$2 = true; _tmp$3 = !!(recvRes[1]); selected = _tmp$2; received = _tmp$3; $s = -1; return [selected, received]; /* */ } return; } if ($f === undefined) { $f = { $blk: chanrecv }; } $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.val = val; $f.$s = $s; $f.$r = $r; return $f; }; chansend = function(ch, val, nb) { var _r, ch, comms, nb, selectRes, val, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; ch = $f.ch; comms = $f.comms; nb = $f.nb; selectRes = $f.selectRes; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: comms = new sliceType$18([new sliceType$16([ch, val.$get()])]); if (nb) { comms = $append(comms, new sliceType$16([])); } _r = selectHelper(new sliceType$4([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)) { $s = -1; return false; } $s = -1; return true; /* */ } return; } if ($f === undefined) { $f = { $blk: chansend }; } $f._r = _r; $f.ch = ch; $f.comms = comms; $f.nb = nb; $f.selectRes = selectRes; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; }; DeepEqual = function(a1, a2) { var $24r, _arg, _arg$1, _arg$2, _r, _r$1, _r$2, a1, a2, i1, i2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; a1 = $f.a1; a2 = $f.a2; i1 = $f.i1; i2 = $f.i2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: i1 = a1; i2 = a2; if (i1 === i2) { $s = -1; return true; } if (i1 === null || i2 === null || !(i1.constructor === i2.constructor)) { $s = -1; return false; } _r = ValueOf(a1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg = $clone(_r, Value); _r$1 = ValueOf(a2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$1 = $clone(_r$1, Value); _arg$2 = sliceType$19.nil; _r$2 = deepValueEqualJs(_arg, _arg$1, _arg$2); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 4; case 4: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: DeepEqual }; } $f.$24r = $24r; $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.a1 = a1; $f.a2 = a2; $f.i1 = i1; $f.i2 = i2; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.DeepEqual = DeepEqual; deepValueEqualJs = function(v1, v2, visited) { var $24r, $24r$1, $24r$2, _1, _2, _arg, _arg$1, _arg$10, _arg$11, _arg$2, _arg$3, _arg$4, _arg$5, _arg$6, _arg$7, _arg$8, _arg$9, _i, _i$1, _r, _r$1, _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, _ref, _ref$1, _v, entry, i, i$1, k, keys, n, n$1, v1, v2, val1, val2, visited, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _1 = $f._1; _2 = $f._2; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$10 = $f._arg$10; _arg$11 = $f._arg$11; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _arg$4 = $f._arg$4; _arg$5 = $f._arg$5; _arg$6 = $f._arg$6; _arg$7 = $f._arg$7; _arg$8 = $f._arg$8; _arg$9 = $f._arg$9; _i = $f._i; _i$1 = $f._i$1; _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$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; _ref = $f._ref; _ref$1 = $f._ref$1; _v = $f._v; entry = $f.entry; i = $f.i; i$1 = $f.i$1; k = $f.k; keys = $f.keys; n = $f.n; n$1 = $f.n$1; v1 = $f.v1; v2 = $f.v2; val1 = $f.val1; val2 = $f.val2; visited = $f.visited; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (!$clone(v1, Value).IsValid() || !$clone(v2, Value).IsValid()) { $s = -1; return !$clone(v1, Value).IsValid() && !$clone(v2, Value).IsValid(); } if (!($interfaceIsEqual($clone(v1, Value).Type(), $clone(v2, Value).Type()))) { $s = -1; return false; } if ($interfaceIsEqual($clone(v1, Value).Type(), jsObjectPtr)) { $s = -1; return unwrapJsObject(jsObjectPtr, $clone(v1, Value).object()) === unwrapJsObject(jsObjectPtr, $clone(v2, Value).object()); } _1 = $clone(v1, Value).Kind(); if ((_1 === (17)) || (_1 === (21)) || (_1 === (23)) || (_1 === (25))) { _ref = visited; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } entry = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), arrayType$6); if (v1.ptr === entry[0] && v2.ptr === entry[1]) { $s = -1; return true; } _i++; } visited = $append(visited, $toNativeArray($kindUnsafePointer, [v1.ptr, v2.ptr])); } _2 = $clone(v1, Value).Kind(); /* */ if ((_2 === (17)) || (_2 === (23))) { $s = 2; continue; } /* */ if (_2 === (20)) { $s = 3; continue; } /* */ if (_2 === (22)) { $s = 4; continue; } /* */ if (_2 === (25)) { $s = 5; continue; } /* */ if (_2 === (21)) { $s = 6; continue; } /* */ if (_2 === (19)) { $s = 7; continue; } /* */ if (_2 === (26)) { $s = 8; continue; } /* */ $s = 9; continue; /* if ((_2 === (17)) || (_2 === (23))) { */ case 2: if ($clone(v1, Value).Kind() === 23) { if (!($clone(v1, Value).IsNil() === $clone(v2, Value).IsNil())) { $s = -1; return false; } if ($clone(v1, Value).object() === $clone(v2, Value).object()) { $s = -1; return true; } } n = $clone(v1, Value).Len(); if (!((n === $clone(v2, Value).Len()))) { $s = -1; return false; } i = 0; /* while (true) { */ case 10: /* if (!(i < n)) { break; } */ if(!(i < n)) { $s = 11; continue; } _r = $clone(v1, Value).Index(i); /* */ $s = 14; case 14: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg = $clone(_r, Value); _r$1 = $clone(v2, Value).Index(i); /* */ $s = 15; case 15: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$1 = $clone(_r$1, Value); _arg$2 = visited; _r$2 = deepValueEqualJs(_arg, _arg$1, _arg$2); /* */ $s = 16; case 16: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } /* */ if (!_r$2) { $s = 12; continue; } /* */ $s = 13; continue; /* if (!_r$2) { */ case 12: $s = -1; return false; /* } */ case 13: i = i + (1) >> 0; $s = 10; continue; case 11: $s = -1; return true; /* } else if (_2 === (20)) { */ case 3: if ($clone(v1, Value).IsNil() || $clone(v2, Value).IsNil()) { $s = -1; return $clone(v1, Value).IsNil() && $clone(v2, Value).IsNil(); } _r$3 = $clone(v1, Value).Elem(); /* */ $s = 17; case 17: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _arg$3 = $clone(_r$3, Value); _r$4 = $clone(v2, Value).Elem(); /* */ $s = 18; case 18: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _arg$4 = $clone(_r$4, Value); _arg$5 = visited; _r$5 = deepValueEqualJs(_arg$3, _arg$4, _arg$5); /* */ $s = 19; case 19: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $24r = _r$5; $s = 20; case 20: return $24r; /* } else if (_2 === (22)) { */ case 4: _r$6 = $clone(v1, Value).Elem(); /* */ $s = 21; case 21: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _arg$6 = $clone(_r$6, Value); _r$7 = $clone(v2, Value).Elem(); /* */ $s = 22; case 22: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _arg$7 = $clone(_r$7, Value); _arg$8 = visited; _r$8 = deepValueEqualJs(_arg$6, _arg$7, _arg$8); /* */ $s = 23; case 23: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } $24r$1 = _r$8; $s = 24; case 24: return $24r$1; /* } else if (_2 === (25)) { */ case 5: n$1 = $clone(v1, Value).NumField(); i$1 = 0; /* while (true) { */ case 25: /* if (!(i$1 < n$1)) { break; } */ if(!(i$1 < n$1)) { $s = 26; continue; } _r$9 = $clone(v1, Value).Field(i$1); /* */ $s = 29; case 29: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _arg$9 = $clone(_r$9, Value); _r$10 = $clone(v2, Value).Field(i$1); /* */ $s = 30; case 30: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _arg$10 = $clone(_r$10, Value); _arg$11 = visited; _r$11 = deepValueEqualJs(_arg$9, _arg$10, _arg$11); /* */ $s = 31; case 31: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } /* */ if (!_r$11) { $s = 27; continue; } /* */ $s = 28; continue; /* if (!_r$11) { */ case 27: $s = -1; return false; /* } */ case 28: i$1 = i$1 + (1) >> 0; $s = 25; continue; case 26: $s = -1; return true; /* } else if (_2 === (21)) { */ case 6: if (!($clone(v1, Value).IsNil() === $clone(v2, Value).IsNil())) { $s = -1; return false; } if ($clone(v1, Value).object() === $clone(v2, Value).object()) { $s = -1; return true; } _r$12 = $clone(v1, Value).MapKeys(); /* */ $s = 32; case 32: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } keys = _r$12; if (!((keys.$length === $clone(v2, Value).Len()))) { $s = -1; return false; } _ref$1 = keys; _i$1 = 0; /* while (true) { */ case 33: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 34; continue; } k = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); _r$13 = $clone(v1, Value).MapIndex($clone(k, Value)); /* */ $s = 35; case 35: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } val1 = _r$13; _r$14 = $clone(v2, Value).MapIndex($clone(k, Value)); /* */ $s = 36; case 36: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } val2 = _r$14; if (!$clone(val1, Value).IsValid() || !$clone(val2, Value).IsValid()) { _v = true; $s = 39; continue s; } _r$15 = deepValueEqualJs($clone(val1, Value), $clone(val2, Value), visited); /* */ $s = 40; case 40: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _v = !_r$15; case 39: /* */ if (_v) { $s = 37; continue; } /* */ $s = 38; continue; /* if (_v) { */ case 37: $s = -1; return false; /* } */ case 38: _i$1++; $s = 33; continue; case 34: $s = -1; return true; /* } else if (_2 === (19)) { */ case 7: $s = -1; return $clone(v1, Value).IsNil() && $clone(v2, Value).IsNil(); /* } else if (_2 === (26)) { */ case 8: $s = -1; return $clone(v1, Value).object() === $clone(v2, Value).object(); /* } */ case 9: case 1: _r$16 = valueInterface($clone(v1, Value), false); /* */ $s = 41; case 41: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _r$17 = valueInterface($clone(v2, Value), false); /* */ $s = 42; case 42: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } $24r$2 = !!($interfaceIsEqual(_r$16, _r$17)); $s = 43; case 43: return $24r$2; /* */ } return; } if ($f === undefined) { $f = { $blk: deepValueEqualJs }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._1 = _1; $f._2 = _2; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$10 = _arg$10; $f._arg$11 = _arg$11; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._arg$4 = _arg$4; $f._arg$5 = _arg$5; $f._arg$6 = _arg$6; $f._arg$7 = _arg$7; $f._arg$8 = _arg$8; $f._arg$9 = _arg$9; $f._i = _i; $f._i$1 = _i$1; $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$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._ref = _ref; $f._ref$1 = _ref$1; $f._v = _v; $f.entry = entry; $f.i = i; $f.i$1 = i$1; $f.k = k; $f.keys = keys; $f.n = n; $f.n$1 = n$1; $f.v1 = v1; $f.v2 = v2; $f.val1 = val1; $f.val2 = val2; $f.visited = visited; $f.$s = $s; $f.$r = $r; return $f; }; Value.methods = [{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$8], false)}, {prop: "runes", name: "runes", pkg: "reflect", typ: $funcType([], [sliceType$10], 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$7], [sliceType$7], false)}, {prop: "CallSlice", name: "CallSlice", pkg: "", typ: $funcType([sliceType$7], [sliceType$7], false)}, {prop: "Complex", name: "Complex", pkg: "", typ: $funcType([], [$Complex128], false)}, {prop: "FieldByIndex", name: "FieldByIndex", pkg: "", typ: $funcType([sliceType$6], [Value], false)}, {prop: "FieldByName", name: "FieldByName", pkg: "", typ: $funcType([$String], [Value], false)}, {prop: "FieldByNameFunc", name: "FieldByNameFunc", pkg: "", typ: $funcType([funcType$2], [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: "IsZero", name: "IsZero", 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$7], false)}, {prop: "MapRange", name: "MapRange", pkg: "", typ: $funcType([], [ptrType$21], 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$10], [], 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: "Convert", name: "Convert", pkg: "", typ: $funcType([Type], [Value], false)}, {prop: "object", name: "object", pkg: "reflect", typ: $funcType([], [ptrType$2], false)}, {prop: "assignTo", name: "assignTo", pkg: "reflect", typ: $funcType([$String, ptrType$1, $UnsafePointer], [Value], false)}, {prop: "call", name: "call", pkg: "reflect", typ: $funcType([$String, sliceType$7], [sliceType$7], 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: "CanConvert", name: "CanConvert", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "Index", name: "Index", pkg: "", typ: $funcType([$Int], [Value], false)}, {prop: "InterfaceData", name: "InterfaceData", pkg: "", typ: $funcType([], [arrayType$7], 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$8], [], 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)}]; flag.methods = [{prop: "kind", name: "kind", pkg: "reflect", typ: $funcType([], [Kind], false)}, {prop: "ro", name: "ro", pkg: "reflect", typ: $funcType([], [flag], false)}, {prop: "mustBe", name: "mustBe", pkg: "reflect", typ: $funcType([Kind], [], false)}, {prop: "mustBeExported", name: "mustBeExported", pkg: "reflect", typ: $funcType([], [], false)}, {prop: "mustBeExportedSlow", name: "mustBeExportedSlow", pkg: "reflect", typ: $funcType([], [], false)}, {prop: "mustBeAssignable", name: "mustBeAssignable", pkg: "reflect", typ: $funcType([], [], false)}, {prop: "mustBeAssignableSlow", name: "mustBeAssignableSlow", pkg: "reflect", typ: $funcType([], [], false)}]; ptrType$22.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$21.methods = [{prop: "Key", name: "Key", pkg: "", typ: $funcType([], [Value], false)}, {prop: "Value", name: "Value", pkg: "", typ: $funcType([], [Value], false)}, {prop: "Next", name: "Next", pkg: "", typ: $funcType([], [$Bool], false)}]; Kind.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$1.methods = [{prop: "textOff", name: "textOff", pkg: "reflect", typ: $funcType([textOff], [$UnsafePointer], 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: "exportedMethods", name: "exportedMethods", pkg: "reflect", typ: $funcType([], [sliceType$11], false)}, {prop: "NumMethod", name: "NumMethod", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "MethodByName", name: "MethodByName", pkg: "", typ: $funcType([$String], [Method, $Bool], false)}, {prop: "PkgPath", name: "PkgPath", pkg: "", typ: $funcType([], [$String], false)}, {prop: "hasName", name: "hasName", pkg: "reflect", typ: $funcType([], [$Bool], 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$6], [StructField], false)}, {prop: "FieldByName", name: "FieldByName", pkg: "", typ: $funcType([$String], [StructField, $Bool], false)}, {prop: "FieldByNameFunc", name: "FieldByNameFunc", pkg: "", typ: $funcType([funcType$2], [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)}, {prop: "gcSlice", name: "gcSlice", pkg: "reflect", typ: $funcType([$Uintptr, $Uintptr], [sliceType$8], false)}, {prop: "uncommon", name: "uncommon", pkg: "reflect", typ: $funcType([], [ptrType$8], false)}, {prop: "nameOff", name: "nameOff", pkg: "reflect", typ: $funcType([nameOff], [name], false)}, {prop: "typeOff", name: "typeOff", pkg: "reflect", typ: $funcType([typeOff], [ptrType$1], false)}, {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: "Method", name: "Method", pkg: "", typ: $funcType([$Int], [Method], false)}]; ChanDir.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$9.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$24.methods = [{prop: "offset", name: "offset", pkg: "reflect", typ: $funcType([], [$Uintptr], false)}, {prop: "embedded", name: "embedded", pkg: "reflect", typ: $funcType([], [$Bool], false)}]; ptrType$11.methods = [{prop: "Field", name: "Field", pkg: "", typ: $funcType([$Int], [StructField], false)}, {prop: "FieldByIndex", name: "FieldByIndex", pkg: "", typ: $funcType([sliceType$6], [StructField], false)}, {prop: "FieldByNameFunc", name: "FieldByNameFunc", pkg: "", typ: $funcType([funcType$2], [StructField, $Bool], false)}, {prop: "FieldByName", name: "FieldByName", pkg: "", typ: $funcType([$String], [StructField, $Bool], false)}]; Method.methods = [{prop: "IsExported", name: "IsExported", pkg: "", typ: $funcType([], [$Bool], false)}]; StructField.methods = [{prop: "IsExported", name: "IsExported", pkg: "", typ: $funcType([], [$Bool], false)}]; StructTag.methods = [{prop: "Get", name: "Get", pkg: "", typ: $funcType([$String], [$String], false)}, {prop: "Lookup", name: "Lookup", pkg: "", typ: $funcType([$String], [$String, $Bool], false)}]; ptrType$8.methods = [{prop: "methods", name: "methods", pkg: "reflect", typ: $funcType([], [sliceType$11], false)}, {prop: "exportedMethods", name: "exportedMethods", pkg: "reflect", typ: $funcType([], [sliceType$11], false)}]; ptrType$18.methods = [{prop: "in$", name: "in", pkg: "reflect", typ: $funcType([], [sliceType$2], false)}, {prop: "out", name: "out", pkg: "reflect", typ: $funcType([], [sliceType$2], false)}]; name.methods = [{prop: "data", name: "data", pkg: "reflect", typ: $funcType([$Int, $String], [ptrType$12], false)}, {prop: "hasTag", name: "hasTag", pkg: "reflect", typ: $funcType([], [$Bool], false)}, {prop: "readVarint", name: "readVarint", pkg: "reflect", typ: $funcType([$Int], [$Int, $Int], false)}, {prop: "name", name: "name", pkg: "reflect", typ: $funcType([], [$String], false)}, {prop: "tag", name: "tag", pkg: "reflect", typ: $funcType([], [$String], false)}, {prop: "pkgPath", name: "pkgPath", pkg: "reflect", typ: $funcType([], [$String], false)}, {prop: "isExported", name: "isExported", pkg: "reflect", typ: $funcType([], [$Bool], false)}]; ptrType$17.methods = [{prop: "skipUntilValidKey", name: "skipUntilValidKey", pkg: "reflect", typ: $funcType([], [], false)}]; Value.init("reflect", [{prop: "typ", name: "typ", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "ptr", name: "ptr", embedded: false, exported: false, typ: $UnsafePointer, tag: ""}, {prop: "flag", name: "flag", embedded: true, exported: false, typ: flag, tag: ""}]); ValueError.init("", [{prop: "Method", name: "Method", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Kind", name: "Kind", embedded: false, exported: true, typ: Kind, tag: ""}]); MapIter.init("reflect", [{prop: "m", name: "m", embedded: false, exported: false, typ: Value, tag: ""}, {prop: "it", name: "it", embedded: false, exported: false, typ: $UnsafePointer, 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$6], [StructField], false)}, {prop: "FieldByName", name: "FieldByName", pkg: "", typ: $funcType([$String], [StructField, $Bool], false)}, {prop: "FieldByNameFunc", name: "FieldByNameFunc", pkg: "", typ: $funcType([funcType$2], [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$8], false)}]); rtype.init("reflect", [{prop: "size", name: "size", embedded: false, exported: false, typ: $Uintptr, tag: ""}, {prop: "ptrdata", name: "ptrdata", embedded: false, exported: false, typ: $Uintptr, tag: ""}, {prop: "hash", name: "hash", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "tflag", name: "tflag", embedded: false, exported: false, typ: tflag, tag: ""}, {prop: "align", name: "align", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "fieldAlign", name: "fieldAlign", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "kind", name: "kind", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "equal", name: "equal", embedded: false, exported: false, typ: funcType$3, tag: ""}, {prop: "gcdata", name: "gcdata", embedded: false, exported: false, typ: ptrType$12, tag: ""}, {prop: "str", name: "str", embedded: false, exported: false, typ: nameOff, tag: ""}, {prop: "ptrToThis", name: "ptrToThis", embedded: false, exported: false, typ: typeOff, tag: ""}]); method.init("reflect", [{prop: "name", name: "name", embedded: false, exported: false, typ: nameOff, tag: ""}, {prop: "mtyp", name: "mtyp", embedded: false, exported: false, typ: typeOff, tag: ""}, {prop: "ifn", name: "ifn", embedded: false, exported: false, typ: textOff, tag: ""}, {prop: "tfn", name: "tfn", embedded: false, exported: false, typ: textOff, tag: ""}]); arrayType.init("reflect", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "elem", name: "elem", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "slice", name: "slice", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "len", name: "len", embedded: false, exported: false, typ: $Uintptr, tag: ""}]); chanType.init("reflect", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "elem", name: "elem", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "dir", name: "dir", embedded: false, exported: false, typ: $Uintptr, tag: ""}]); imethod.init("reflect", [{prop: "name", name: "name", embedded: false, exported: false, typ: nameOff, tag: ""}, {prop: "typ", name: "typ", embedded: false, exported: false, typ: typeOff, tag: ""}]); interfaceType.init("reflect", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "pkgPath", name: "pkgPath", embedded: false, exported: false, typ: name, tag: ""}, {prop: "methods", name: "methods", embedded: false, exported: false, typ: sliceType$14, tag: ""}]); mapType.init("reflect", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "key", name: "key", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "elem", name: "elem", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "bucket", name: "bucket", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "hasher", name: "hasher", embedded: false, exported: false, typ: funcType$4, tag: ""}, {prop: "keysize", name: "keysize", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "valuesize", name: "valuesize", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "bucketsize", name: "bucketsize", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "flags", name: "flags", embedded: false, exported: false, typ: $Uint32, tag: ""}]); ptrType.init("reflect", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "elem", name: "elem", embedded: false, exported: false, typ: ptrType$1, tag: ""}]); sliceType.init("reflect", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "elem", name: "elem", embedded: false, exported: false, typ: ptrType$1, tag: ""}]); structField.init("reflect", [{prop: "name", name: "name", embedded: false, exported: false, typ: name, tag: ""}, {prop: "typ", name: "typ", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "offsetEmbed", name: "offsetEmbed", embedded: false, exported: false, typ: $Uintptr, tag: ""}]); structType.init("reflect", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "pkgPath", name: "pkgPath", embedded: false, exported: false, typ: name, tag: ""}, {prop: "fields", name: "fields", embedded: false, exported: false, typ: sliceType$15, tag: ""}]); Method.init("", [{prop: "Name", name: "Name", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "PkgPath", name: "PkgPath", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Type", name: "Type", embedded: false, exported: true, typ: Type, tag: ""}, {prop: "Func", name: "Func", embedded: false, exported: true, typ: Value, tag: ""}, {prop: "Index", name: "Index", embedded: false, exported: true, typ: $Int, tag: ""}]); StructField.init("", [{prop: "Name", name: "Name", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "PkgPath", name: "PkgPath", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Type", name: "Type", embedded: false, exported: true, typ: Type, tag: ""}, {prop: "Tag", name: "Tag", embedded: false, exported: true, typ: StructTag, tag: ""}, {prop: "Offset", name: "Offset", embedded: false, exported: true, typ: $Uintptr, tag: ""}, {prop: "Index", name: "Index", embedded: false, exported: true, typ: sliceType$6, tag: ""}, {prop: "Anonymous", name: "Anonymous", embedded: false, exported: true, typ: $Bool, tag: ""}]); fieldScan.init("reflect", [{prop: "typ", name: "typ", embedded: false, exported: false, typ: ptrType$11, tag: ""}, {prop: "index", name: "index", embedded: false, exported: false, typ: sliceType$6, tag: ""}]); uncommonType.init("reflect", [{prop: "pkgPath", name: "pkgPath", embedded: false, exported: false, typ: nameOff, tag: ""}, {prop: "mcount", name: "mcount", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "xcount", name: "xcount", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "moff", name: "moff", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "_methods", name: "_methods", embedded: false, exported: false, typ: sliceType$11, tag: ""}]); funcType.init("reflect", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: "reflect:\"func\""}, {prop: "inCount", name: "inCount", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "outCount", name: "outCount", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "_in", name: "_in", embedded: false, exported: false, typ: sliceType$2, tag: ""}, {prop: "_out", name: "_out", embedded: false, exported: false, typ: sliceType$2, tag: ""}]); name.init("reflect", [{prop: "bytes", name: "bytes", embedded: false, exported: false, typ: ptrType$12, tag: ""}]); nameData.init("reflect", [{prop: "name", name: "name", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "tag", name: "tag", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "exported", name: "exported", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "pkgPath", name: "pkgPath", embedded: false, exported: false, typ: $String, tag: ""}]); mapIter.init("reflect", [{prop: "t", name: "t", embedded: false, exported: false, typ: Type, tag: ""}, {prop: "m", name: "m", embedded: false, exported: false, typ: ptrType$2, tag: ""}, {prop: "keys", name: "keys", embedded: false, exported: false, typ: ptrType$2, tag: ""}, {prop: "i", name: "i", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "last", name: "last", embedded: false, exported: false, typ: ptrType$2, 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 = abi.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = goexperiment.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = itoa.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = unsafeheader.$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 = runtime.$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 = sync.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = unicode.$init(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = utf8.$init(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } nameOffList = sliceType$1.nil; typeOffList = sliceType$2.nil; 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"]); initialized = false; uncommonTypeMap = {}; nameMap = {}; uint8Type = $assertType(TypeOf(new $Uint8(0)), ptrType$1); callHelper = $assertType($internalize($call, $emptyInterface), funcType$1); jsObjectPtr = reflectType($jsObjectPtr); selectHelper = $assertType($internalize($select, $emptyInterface), funcType$1); $r = init(); /* */ $s = 13; case 13: 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, sync, littleEndian, bigEndian, sliceType, overflow; errors = $packages["errors"]; io = $packages["io"]; math = $packages["math"]; reflect = $packages["reflect"]; sync = $packages["sync"]; littleEndian = $pkg.littleEndian = $newType(0, $kindStruct, "binary.littleEndian", true, "encoding/binary", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); bigEndian = $pkg.bigEndian = $newType(0, $kindStruct, "binary.bigEndian", true, "encoding/binary", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); sliceType = $sliceType($Uint8); littleEndian.ptr.prototype.Uint16 = function(b) { var b; $unused((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1])); return ((((0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]) << 16 >>> 16)) | ((((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]) << 16 >>> 16)) << 8 << 16 >>> 16)) >>> 0; }; littleEndian.prototype.Uint16 = function(b) { return this.$val.Uint16(b); }; littleEndian.ptr.prototype.PutUint16 = function(b, v) { var b, v; $unused((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1])); (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0] = ((v << 24 >>> 24))); (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1] = (((v >>> 8 << 16 >>> 16) << 24 >>> 24))); }; littleEndian.prototype.PutUint16 = function(b, v) { return this.$val.PutUint16(b, v); }; littleEndian.ptr.prototype.Uint32 = function(b) { var b; $unused((3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3])); return ((((((((0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]) >>> 0)) | ((((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]) >>> 0)) << 8 >>> 0)) >>> 0) | ((((2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]) >>> 0)) << 16 >>> 0)) >>> 0) | ((((3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]) >>> 0)) << 24 >>> 0)) >>> 0; }; littleEndian.prototype.Uint32 = function(b) { return this.$val.Uint32(b); }; littleEndian.ptr.prototype.PutUint32 = function(b, v) { var b, v; $unused((3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3])); (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0] = ((v << 24 >>> 24))); (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1] = (((v >>> 8 >>> 0) << 24 >>> 24))); (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2] = (((v >>> 16 >>> 0) << 24 >>> 24))); (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3] = (((v >>> 24 >>> 0) << 24 >>> 24))); }; littleEndian.prototype.PutUint32 = function(b, v) { return this.$val.PutUint32(b, v); }; littleEndian.ptr.prototype.Uint64 = function(b) { var b, x, x$1, x$10, x$11, x$12, x$13, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; $unused((7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7])); return (x = (x$1 = (x$2 = (x$3 = (x$4 = (x$5 = (x$6 = (new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), x$7 = $shiftLeft64((new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), 8), new $Uint64(x$6.$high | x$7.$high, (x$6.$low | x$7.$low) >>> 0)), x$8 = $shiftLeft64((new $Uint64(0, (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]))), 16), new $Uint64(x$5.$high | x$8.$high, (x$5.$low | x$8.$low) >>> 0)), x$9 = $shiftLeft64((new $Uint64(0, (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]))), 24), new $Uint64(x$4.$high | x$9.$high, (x$4.$low | x$9.$low) >>> 0)), x$10 = $shiftLeft64((new $Uint64(0, (4 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 4]))), 32), new $Uint64(x$3.$high | x$10.$high, (x$3.$low | x$10.$low) >>> 0)), x$11 = $shiftLeft64((new $Uint64(0, (5 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 5]))), 40), new $Uint64(x$2.$high | x$11.$high, (x$2.$low | x$11.$low) >>> 0)), x$12 = $shiftLeft64((new $Uint64(0, (6 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 6]))), 48), new $Uint64(x$1.$high | x$12.$high, (x$1.$low | x$12.$low) >>> 0)), x$13 = $shiftLeft64((new $Uint64(0, (7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7]))), 56), new $Uint64(x.$high | x$13.$high, (x.$low | x$13.$low) >>> 0)); }; littleEndian.prototype.Uint64 = function(b) { return this.$val.Uint64(b); }; littleEndian.ptr.prototype.PutUint64 = function(b, v) { var b, v; $unused((7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7])); (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0] = ((v.$low << 24 >>> 24))); (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1] = (($shiftRightUint64(v, 8).$low << 24 >>> 24))); (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2] = (($shiftRightUint64(v, 16).$low << 24 >>> 24))); (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3] = (($shiftRightUint64(v, 24).$low << 24 >>> 24))); (4 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 4] = (($shiftRightUint64(v, 32).$low << 24 >>> 24))); (5 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 5] = (($shiftRightUint64(v, 40).$low << 24 >>> 24))); (6 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 6] = (($shiftRightUint64(v, 48).$low << 24 >>> 24))); (7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7] = (($shiftRightUint64(v, 56).$low << 24 >>> 24))); }; littleEndian.prototype.PutUint64 = function(b, v) { return this.$val.PutUint64(b, v); }; littleEndian.ptr.prototype.String = function() { return "LittleEndian"; }; littleEndian.prototype.String = function() { return this.$val.String(); }; littleEndian.ptr.prototype.GoString = function() { return "binary.LittleEndian"; }; littleEndian.prototype.GoString = function() { return this.$val.GoString(); }; bigEndian.ptr.prototype.Uint16 = function(b) { var b; $unused((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1])); return ((((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]) << 16 >>> 16)) | ((((0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]) << 16 >>> 16)) << 8 << 16 >>> 16)) >>> 0; }; bigEndian.prototype.Uint16 = function(b) { return this.$val.Uint16(b); }; bigEndian.ptr.prototype.PutUint16 = function(b, v) { var b, v; $unused((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1])); (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0] = (((v >>> 8 << 16 >>> 16) << 24 >>> 24))); (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1] = ((v << 24 >>> 24))); }; bigEndian.prototype.PutUint16 = function(b, v) { return this.$val.PutUint16(b, v); }; bigEndian.ptr.prototype.Uint32 = function(b) { var b; $unused((3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3])); return ((((((((3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]) >>> 0)) | ((((2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]) >>> 0)) << 8 >>> 0)) >>> 0) | ((((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]) >>> 0)) << 16 >>> 0)) >>> 0) | ((((0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]) >>> 0)) << 24 >>> 0)) >>> 0; }; bigEndian.prototype.Uint32 = function(b) { return this.$val.Uint32(b); }; bigEndian.ptr.prototype.PutUint32 = function(b, v) { var b, v; $unused((3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3])); (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0] = (((v >>> 24 >>> 0) << 24 >>> 24))); (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1] = (((v >>> 16 >>> 0) << 24 >>> 24))); (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2] = (((v >>> 8 >>> 0) << 24 >>> 24))); (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3] = ((v << 24 >>> 24))); }; bigEndian.prototype.PutUint32 = function(b, v) { return this.$val.PutUint32(b, v); }; bigEndian.ptr.prototype.Uint64 = function(b) { var b, x, x$1, x$10, x$11, x$12, x$13, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; $unused((7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7])); return (x = (x$1 = (x$2 = (x$3 = (x$4 = (x$5 = (x$6 = (new $Uint64(0, (7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7]))), x$7 = $shiftLeft64((new $Uint64(0, (6 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 6]))), 8), new $Uint64(x$6.$high | x$7.$high, (x$6.$low | x$7.$low) >>> 0)), x$8 = $shiftLeft64((new $Uint64(0, (5 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 5]))), 16), new $Uint64(x$5.$high | x$8.$high, (x$5.$low | x$8.$low) >>> 0)), x$9 = $shiftLeft64((new $Uint64(0, (4 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 4]))), 24), new $Uint64(x$4.$high | x$9.$high, (x$4.$low | x$9.$low) >>> 0)), x$10 = $shiftLeft64((new $Uint64(0, (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]))), 32), new $Uint64(x$3.$high | x$10.$high, (x$3.$low | x$10.$low) >>> 0)), x$11 = $shiftLeft64((new $Uint64(0, (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]))), 40), new $Uint64(x$2.$high | x$11.$high, (x$2.$low | x$11.$low) >>> 0)), x$12 = $shiftLeft64((new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), 48), new $Uint64(x$1.$high | x$12.$high, (x$1.$low | x$12.$low) >>> 0)), x$13 = $shiftLeft64((new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), 56), new $Uint64(x.$high | x$13.$high, (x.$low | x$13.$low) >>> 0)); }; bigEndian.prototype.Uint64 = function(b) { return this.$val.Uint64(b); }; bigEndian.ptr.prototype.PutUint64 = function(b, v) { var b, v; $unused((7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7])); (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0] = (($shiftRightUint64(v, 56).$low << 24 >>> 24))); (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1] = (($shiftRightUint64(v, 48).$low << 24 >>> 24))); (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2] = (($shiftRightUint64(v, 40).$low << 24 >>> 24))); (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3] = (($shiftRightUint64(v, 32).$low << 24 >>> 24))); (4 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 4] = (($shiftRightUint64(v, 24).$low << 24 >>> 24))); (5 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 5] = (($shiftRightUint64(v, 16).$low << 24 >>> 24))); (6 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 6] = (($shiftRightUint64(v, 8).$low << 24 >>> 24))); (7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7] = ((v.$low << 24 >>> 24))); }; bigEndian.prototype.PutUint64 = function(b, v) { return this.$val.PutUint64(b, v); }; bigEndian.ptr.prototype.String = function() { return "BigEndian"; }; bigEndian.prototype.String = function() { return this.$val.String(); }; bigEndian.ptr.prototype.GoString = function() { return "binary.BigEndian"; }; bigEndian.prototype.GoString = function() { return this.$val.GoString(); }; littleEndian.methods = [{prop: "Uint16", name: "Uint16", pkg: "", typ: $funcType([sliceType], [$Uint16], false)}, {prop: "PutUint16", name: "PutUint16", pkg: "", typ: $funcType([sliceType, $Uint16], [], false)}, {prop: "Uint32", name: "Uint32", pkg: "", typ: $funcType([sliceType], [$Uint32], false)}, {prop: "PutUint32", name: "PutUint32", pkg: "", typ: $funcType([sliceType, $Uint32], [], false)}, {prop: "Uint64", name: "Uint64", pkg: "", typ: $funcType([sliceType], [$Uint64], false)}, {prop: "PutUint64", name: "PutUint64", pkg: "", typ: $funcType([sliceType, $Uint64], [], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "GoString", name: "GoString", pkg: "", typ: $funcType([], [$String], false)}]; bigEndian.methods = [{prop: "Uint16", name: "Uint16", pkg: "", typ: $funcType([sliceType], [$Uint16], false)}, {prop: "PutUint16", name: "PutUint16", pkg: "", typ: $funcType([sliceType, $Uint16], [], false)}, {prop: "Uint32", name: "Uint32", pkg: "", typ: $funcType([sliceType], [$Uint32], false)}, {prop: "PutUint32", name: "PutUint32", pkg: "", typ: $funcType([sliceType, $Uint32], [], false)}, {prop: "Uint64", name: "Uint64", pkg: "", typ: $funcType([sliceType], [$Uint64], false)}, {prop: "PutUint64", name: "PutUint64", pkg: "", typ: $funcType([sliceType, $Uint64], [], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "GoString", name: "GoString", pkg: "", typ: $funcType([], [$String], false)}]; littleEndian.init("", []); bigEndian.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 = 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; } $r = sync.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $pkg.LittleEndian = new littleEndian.ptr(); $pkg.BigEndian = new bigEndian.ptr(); 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["encoding/base64"] = (function() { var $pkg = {}, $init, binary, io, strconv, Encoding, encoder, CorruptInputError, arrayType, arrayType$1, sliceType, ptrType, arrayType$2, arrayType$3, arrayType$4, ptrType$1, NewEncoding, NewEncoder, assemble32, assemble64; binary = $packages["encoding/binary"]; io = $packages["io"]; strconv = $packages["strconv"]; Encoding = $pkg.Encoding = $newType(0, $kindStruct, "base64.Encoding", true, "encoding/base64", true, function(encode_, decodeMap_, padChar_, strict_) { this.$val = this; if (arguments.length === 0) { this.encode = arrayType.zero(); this.decodeMap = arrayType$1.zero(); this.padChar = 0; this.strict = false; return; } this.encode = encode_; this.decodeMap = decodeMap_; this.padChar = padChar_; this.strict = strict_; }); encoder = $pkg.encoder = $newType(0, $kindStruct, "base64.encoder", true, "encoding/base64", false, 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", true, "encoding/base64", true, 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 e, encoder$1, i, i$1, i$2, x, x$1, x$2; if (!((encoder$1.length === 64))) { $panic(new $String("encoding alphabet is not 64-bytes long")); } i = 0; while (true) { if (!(i < encoder$1.length)) { break; } if ((encoder$1.charCodeAt(i) === 10) || (encoder$1.charCodeAt(i) === 13)) { $panic(new $String("encoding alphabet contains newline character")); } i = i + (1) >> 0; } e = new Encoding.ptr(arrayType.zero(), arrayType$1.zero(), 0, false); e.padChar = 61; $copyString(new sliceType(e.encode), encoder$1); i$1 = 0; while (true) { if (!(i$1 < 256)) { break; } (x = e.decodeMap, ((i$1 < 0 || i$1 >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i$1] = 255)); i$1 = i$1 + (1) >> 0; } i$2 = 0; while (true) { if (!(i$2 < encoder$1.length)) { break; } (x$1 = e.decodeMap, x$2 = encoder$1.charCodeAt(i$2), ((x$2 < 0 || x$2 >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[x$2] = ((i$2 << 24 >>> 24)))); i$2 = i$2 + (1) >> 0; } return e; }; $pkg.NewEncoding = NewEncoding; Encoding.ptr.prototype.WithPadding = function(padding) { var enc, i, padding, x; enc = this; if ((padding === 13) || (padding === 10) || padding > 255) { $panic(new $String("invalid padding")); } i = 0; while (true) { if (!(i < 64)) { break; } if ((((x = enc.encode, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i])) >> 0)) === padding) { $panic(new $String("padding contained in alphabet")); } i = i + (1) >> 0; } enc.padChar = padding; return enc; }; Encoding.prototype.WithPadding = function(padding) { return this.$val.WithPadding(padding); }; Encoding.ptr.prototype.Strict = function() { var enc; enc = this; enc.strict = true; return enc; }; Encoding.prototype.Strict = function() { return this.$val.Strict(); }; Encoding.ptr.prototype.Encode = function(dst, src) { var _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; } $unused(enc.encode); _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"), undefined) : 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"), undefined) : 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"), undefined) : 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"), undefined) : 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"), undefined) : x$3[x$4])))); (x$8 = di + 1 >> 0, ((x$8 < 0 || x$8 >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : 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"), undefined) : x$6[x$7])))); (x$11 = di + 2 >> 0, ((x$11 < 0 || x$11 >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : 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"), undefined) : x$9[x$10])))); (x$14 = di + 3 >> 0, ((x$14 < 0 || x$14 >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : 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"), undefined) : 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"), undefined) : 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"), undefined) : 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"), undefined) : 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"), undefined) : x$17[x$18])))); (x$22 = di + 1 >> 0, ((x$22 < 0 || x$22 >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : 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"), undefined) : 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"), undefined) : 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"), undefined) : 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"), undefined) : 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"), undefined) : 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"), undefined) : 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 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 _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; _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; $s = -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"), undefined) : x[x$1] = ((i < 0 || i >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : 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) { $s = -1; 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; $s = -1; 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; $s = -1; 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"), undefined) : x$2[i$1] = ((i$1 < 0 || i$1 >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + i$1]))); i$1 = i$1 + (1) >> 0; } e.nbuf = p.$length; n = n + (p.$length) >> 0; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: encoder.ptr.prototype.Write }; } $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 _r, _tuple, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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: $s = -1; return e.err; /* */ } return; } if ($f === undefined) { $f = { $blk: encoder.ptr.prototype.Close }; } $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 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 _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 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.decodeQuantum = function(dst, src, si) { var _1, _2, _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$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, dbuf, dlen, dst, enc, err, in$1, j, n, nsi, out, si, src, val, x; nsi = 0; n = 0; err = $ifaceNil; enc = this; dbuf = arrayType$4.zero(); dlen = 4; $unused(enc.decodeMap); j = 0; while (true) { if (!(j < 4)) { break; } if (src.$length === si) { if ((j === 0)) { _tmp = si; _tmp$1 = 0; _tmp$2 = $ifaceNil; nsi = _tmp; n = _tmp$1; err = _tmp$2; return [nsi, n, err]; } else if (((j === 1)) || (!((enc.padChar === -1)))) { _tmp$3 = si; _tmp$4 = 0; _tmp$5 = (new CorruptInputError(0, (si - j >> 0))); nsi = _tmp$3; n = _tmp$4; err = _tmp$5; return [nsi, n, err]; } dlen = j; break; } in$1 = ((si < 0 || si >= src.$length) ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + si]); si = si + (1) >> 0; out = (x = enc.decodeMap, ((in$1 < 0 || in$1 >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[in$1])); if (!((out === 255))) { ((j < 0 || j >= dbuf.length) ? ($throwRuntimeError("index out of range"), undefined) : dbuf[j] = out); j = j + (1) >> 0; continue; } if ((in$1 === 10) || (in$1 === 13)) { j = j - (1) >> 0; j = j + (1) >> 0; continue; } if (!((((in$1 >> 0)) === enc.padChar))) { _tmp$6 = si; _tmp$7 = 0; _tmp$8 = (new CorruptInputError(0, (si - 1 >> 0))); nsi = _tmp$6; n = _tmp$7; err = _tmp$8; return [nsi, n, err]; } _1 = j; if ((_1 === (0)) || (_1 === (1))) { _tmp$9 = si; _tmp$10 = 0; _tmp$11 = (new CorruptInputError(0, (si - 1 >> 0))); nsi = _tmp$9; n = _tmp$10; err = _tmp$11; return [nsi, n, err]; } else if (_1 === (2)) { while (true) { if (!(si < src.$length && ((((si < 0 || si >= src.$length) ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + si]) === 10) || (((si < 0 || si >= src.$length) ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + si]) === 13)))) { break; } si = si + (1) >> 0; } if (si === src.$length) { _tmp$12 = si; _tmp$13 = 0; _tmp$14 = (new CorruptInputError(0, src.$length)); nsi = _tmp$12; n = _tmp$13; err = _tmp$14; return [nsi, n, err]; } if (!((((((si < 0 || si >= src.$length) ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + si]) >> 0)) === enc.padChar))) { _tmp$15 = si; _tmp$16 = 0; _tmp$17 = (new CorruptInputError(0, (si - 1 >> 0))); nsi = _tmp$15; n = _tmp$16; err = _tmp$17; return [nsi, n, err]; } si = si + (1) >> 0; } while (true) { if (!(si < src.$length && ((((si < 0 || si >= src.$length) ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + si]) === 10) || (((si < 0 || si >= src.$length) ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + si]) === 13)))) { break; } si = si + (1) >> 0; } if (si < src.$length) { err = (new CorruptInputError(0, si)); } dlen = j; break; } val = ((((((((dbuf[0] >>> 0)) << 18 >>> 0) | (((dbuf[1] >>> 0)) << 12 >>> 0)) >>> 0) | (((dbuf[2] >>> 0)) << 6 >>> 0)) >>> 0) | ((dbuf[3] >>> 0))) >>> 0; _tmp$18 = (((val >>> 0 >>> 0) << 24 >>> 24)); _tmp$19 = (((val >>> 8 >>> 0) << 24 >>> 24)); _tmp$20 = (((val >>> 16 >>> 0) << 24 >>> 24)); dbuf[2] = _tmp$18; dbuf[1] = _tmp$19; dbuf[0] = _tmp$20; _2 = dlen; if (_2 === (4)) { (2 >= dst.$length ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + 2] = dbuf[2]); dbuf[2] = 0; (1 >= dst.$length ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + 1] = dbuf[1]); if (enc.strict && !((dbuf[2] === 0))) { _tmp$21 = si; _tmp$22 = 0; _tmp$23 = (new CorruptInputError(0, (si - 1 >> 0))); nsi = _tmp$21; n = _tmp$22; err = _tmp$23; return [nsi, n, err]; } dbuf[1] = 0; (0 >= dst.$length ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + 0] = dbuf[0]); if (enc.strict && (!((dbuf[1] === 0)) || !((dbuf[2] === 0)))) { _tmp$24 = si; _tmp$25 = 0; _tmp$26 = (new CorruptInputError(0, (si - 2 >> 0))); nsi = _tmp$24; n = _tmp$25; err = _tmp$26; return [nsi, n, err]; } } else if (_2 === (3)) { (1 >= dst.$length ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + 1] = dbuf[1]); if (enc.strict && !((dbuf[2] === 0))) { _tmp$27 = si; _tmp$28 = 0; _tmp$29 = (new CorruptInputError(0, (si - 1 >> 0))); nsi = _tmp$27; n = _tmp$28; err = _tmp$29; return [nsi, n, err]; } dbuf[1] = 0; (0 >= dst.$length ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + 0] = dbuf[0]); if (enc.strict && (!((dbuf[1] === 0)) || !((dbuf[2] === 0)))) { _tmp$30 = si; _tmp$31 = 0; _tmp$32 = (new CorruptInputError(0, (si - 2 >> 0))); nsi = _tmp$30; n = _tmp$31; err = _tmp$32; return [nsi, n, err]; } } else if (_2 === (2)) { (0 >= dst.$length ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + 0] = dbuf[0]); if (enc.strict && (!((dbuf[1] === 0)) || !((dbuf[2] === 0)))) { _tmp$33 = si; _tmp$34 = 0; _tmp$35 = (new CorruptInputError(0, (si - 2 >> 0))); nsi = _tmp$33; n = _tmp$34; err = _tmp$35; return [nsi, n, err]; } } _tmp$36 = si; _tmp$37 = dlen - 1 >> 0; _tmp$38 = err; nsi = _tmp$36; n = _tmp$37; err = _tmp$38; return [nsi, n, err]; }; Encoding.prototype.decodeQuantum = function(dst, src, si) { return this.$val.decodeQuantum(dst, src, si); }; Encoding.ptr.prototype.DecodeString = function(s) { var _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[1]; return [$subslice(dbuf, 0, n), err]; }; Encoding.prototype.DecodeString = function(s) { return this.$val.DecodeString(s); }; Encoding.ptr.prototype.Decode = function(dst, src) { var _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, dn, dn$1, dst, enc, err, n, ninc, ninc$1, ninc$2, ok, ok$1, si, src, src2, src2$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$3, x$4, x$5, x$6, x$7, x$8, x$9; n = 0; err = $ifaceNil; enc = this; if (src.$length === 0) { _tmp = 0; _tmp$1 = $ifaceNil; n = _tmp; err = _tmp$1; return [n, err]; } $unused(enc.decodeMap); si = 0; while (true) { if (!(false && (src.$length - si >> 0) >= 8 && (dst.$length - n >> 0) >= 8)) { break; } src2 = $subslice(src, si, (si + 8 >> 0)); _tuple = assemble64((x = enc.decodeMap, x$1 = (0 >= src2.$length ? ($throwRuntimeError("index out of range"), undefined) : src2.$array[src2.$offset + 0]), ((x$1 < 0 || x$1 >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[x$1])), (x$2 = enc.decodeMap, x$3 = (1 >= src2.$length ? ($throwRuntimeError("index out of range"), undefined) : src2.$array[src2.$offset + 1]), ((x$3 < 0 || x$3 >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[x$3])), (x$4 = enc.decodeMap, x$5 = (2 >= src2.$length ? ($throwRuntimeError("index out of range"), undefined) : src2.$array[src2.$offset + 2]), ((x$5 < 0 || x$5 >= x$4.length) ? ($throwRuntimeError("index out of range"), undefined) : x$4[x$5])), (x$6 = enc.decodeMap, x$7 = (3 >= src2.$length ? ($throwRuntimeError("index out of range"), undefined) : src2.$array[src2.$offset + 3]), ((x$7 < 0 || x$7 >= x$6.length) ? ($throwRuntimeError("index out of range"), undefined) : x$6[x$7])), (x$8 = enc.decodeMap, x$9 = (4 >= src2.$length ? ($throwRuntimeError("index out of range"), undefined) : src2.$array[src2.$offset + 4]), ((x$9 < 0 || x$9 >= x$8.length) ? ($throwRuntimeError("index out of range"), undefined) : x$8[x$9])), (x$10 = enc.decodeMap, x$11 = (5 >= src2.$length ? ($throwRuntimeError("index out of range"), undefined) : src2.$array[src2.$offset + 5]), ((x$11 < 0 || x$11 >= x$10.length) ? ($throwRuntimeError("index out of range"), undefined) : x$10[x$11])), (x$12 = enc.decodeMap, x$13 = (6 >= src2.$length ? ($throwRuntimeError("index out of range"), undefined) : src2.$array[src2.$offset + 6]), ((x$13 < 0 || x$13 >= x$12.length) ? ($throwRuntimeError("index out of range"), undefined) : x$12[x$13])), (x$14 = enc.decodeMap, x$15 = (7 >= src2.$length ? ($throwRuntimeError("index out of range"), undefined) : src2.$array[src2.$offset + 7]), ((x$15 < 0 || x$15 >= x$14.length) ? ($throwRuntimeError("index out of range"), undefined) : x$14[x$15]))); dn = _tuple[0]; ok = _tuple[1]; if (ok) { $clone(binary.BigEndian, binary.bigEndian).PutUint64($subslice(dst, n), dn); n = n + (6) >> 0; si = si + (8) >> 0; } else { ninc = 0; _tuple$1 = enc.decodeQuantum($subslice(dst, n), src, si); si = _tuple$1[0]; ninc = _tuple$1[1]; err = _tuple$1[2]; n = n + (ninc) >> 0; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$2 = n; _tmp$3 = err; n = _tmp$2; err = _tmp$3; return [n, err]; } } } while (true) { if (!((src.$length - si >> 0) >= 4 && (dst.$length - n >> 0) >= 4)) { break; } src2$1 = $subslice(src, si, (si + 4 >> 0)); _tuple$2 = assemble32((x$16 = enc.decodeMap, x$17 = (0 >= src2$1.$length ? ($throwRuntimeError("index out of range"), undefined) : src2$1.$array[src2$1.$offset + 0]), ((x$17 < 0 || x$17 >= x$16.length) ? ($throwRuntimeError("index out of range"), undefined) : x$16[x$17])), (x$18 = enc.decodeMap, x$19 = (1 >= src2$1.$length ? ($throwRuntimeError("index out of range"), undefined) : src2$1.$array[src2$1.$offset + 1]), ((x$19 < 0 || x$19 >= x$18.length) ? ($throwRuntimeError("index out of range"), undefined) : x$18[x$19])), (x$20 = enc.decodeMap, x$21 = (2 >= src2$1.$length ? ($throwRuntimeError("index out of range"), undefined) : src2$1.$array[src2$1.$offset + 2]), ((x$21 < 0 || x$21 >= x$20.length) ? ($throwRuntimeError("index out of range"), undefined) : x$20[x$21])), (x$22 = enc.decodeMap, x$23 = (3 >= src2$1.$length ? ($throwRuntimeError("index out of range"), undefined) : src2$1.$array[src2$1.$offset + 3]), ((x$23 < 0 || x$23 >= x$22.length) ? ($throwRuntimeError("index out of range"), undefined) : x$22[x$23]))); dn$1 = _tuple$2[0]; ok$1 = _tuple$2[1]; if (ok$1) { $clone(binary.BigEndian, binary.bigEndian).PutUint32($subslice(dst, n), dn$1); n = n + (3) >> 0; si = si + (4) >> 0; } else { ninc$1 = 0; _tuple$3 = enc.decodeQuantum($subslice(dst, n), src, si); si = _tuple$3[0]; ninc$1 = _tuple$3[1]; err = _tuple$3[2]; n = n + (ninc$1) >> 0; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$4 = n; _tmp$5 = err; n = _tmp$4; err = _tmp$5; return [n, err]; } } } while (true) { if (!(si < src.$length)) { break; } ninc$2 = 0; _tuple$4 = enc.decodeQuantum($subslice(dst, n), src, si); si = _tuple$4[0]; ninc$2 = _tuple$4[1]; err = _tuple$4[2]; n = n + (ninc$2) >> 0; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$6 = n; _tmp$7 = err; n = _tmp$6; err = _tmp$7; return [n, err]; } } _tmp$8 = n; _tmp$9 = err; n = _tmp$8; err = _tmp$9; return [n, err]; }; Encoding.prototype.Decode = function(dst, src) { return this.$val.Decode(dst, src); }; assemble32 = function(n1, n2, n3, n4) { var _tmp, _tmp$1, _tmp$2, _tmp$3, dn, n1, n2, n3, n4, ok; dn = 0; ok = false; if (((((((n1 | n2) >>> 0) | n3) >>> 0) | n4) >>> 0) === 255) { _tmp = 0; _tmp$1 = false; dn = _tmp; ok = _tmp$1; return [dn, ok]; } _tmp$2 = ((((((((n1 >>> 0)) << 26 >>> 0) | (((n2 >>> 0)) << 20 >>> 0)) >>> 0) | (((n3 >>> 0)) << 14 >>> 0)) >>> 0) | (((n4 >>> 0)) << 8 >>> 0)) >>> 0; _tmp$3 = true; dn = _tmp$2; ok = _tmp$3; return [dn, ok]; }; assemble64 = function(n1, n2, n3, n4, n5, n6, n7, n8) { var _tmp, _tmp$1, _tmp$2, _tmp$3, dn, n1, n2, n3, n4, n5, n6, n7, n8, ok, x, x$1, x$10, x$11, x$12, x$13, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; dn = new $Uint64(0, 0); ok = false; if (((((((((((((((n1 | n2) >>> 0) | n3) >>> 0) | n4) >>> 0) | n5) >>> 0) | n6) >>> 0) | n7) >>> 0) | n8) >>> 0) === 255) { _tmp = new $Uint64(0, 0); _tmp$1 = false; dn = _tmp; ok = _tmp$1; return [dn, ok]; } _tmp$2 = (x = (x$1 = (x$2 = (x$3 = (x$4 = (x$5 = (x$6 = $shiftLeft64((new $Uint64(0, n1)), 58), x$7 = $shiftLeft64((new $Uint64(0, n2)), 52), new $Uint64(x$6.$high | x$7.$high, (x$6.$low | x$7.$low) >>> 0)), x$8 = $shiftLeft64((new $Uint64(0, n3)), 46), new $Uint64(x$5.$high | x$8.$high, (x$5.$low | x$8.$low) >>> 0)), x$9 = $shiftLeft64((new $Uint64(0, n4)), 40), new $Uint64(x$4.$high | x$9.$high, (x$4.$low | x$9.$low) >>> 0)), x$10 = $shiftLeft64((new $Uint64(0, n5)), 34), new $Uint64(x$3.$high | x$10.$high, (x$3.$low | x$10.$low) >>> 0)), x$11 = $shiftLeft64((new $Uint64(0, n6)), 28), new $Uint64(x$2.$high | x$11.$high, (x$2.$low | x$11.$low) >>> 0)), x$12 = $shiftLeft64((new $Uint64(0, n7)), 22), new $Uint64(x$1.$high | x$12.$high, (x$1.$low | x$12.$low) >>> 0)), x$13 = $shiftLeft64((new $Uint64(0, n8)), 16), new $Uint64(x.$high | x$13.$high, (x.$low | x$13.$low) >>> 0)); _tmp$3 = true; dn = _tmp$2; ok = _tmp$3; return [dn, ok]; }; Encoding.ptr.prototype.DecodedLen = function(n) { var _q, _q$1, enc, n; enc = this; if (enc.padChar === -1) { return (_q = ($imul(n, 6)) / 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)}, {prop: "Strict", name: "Strict", pkg: "", typ: $funcType([], [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: "decodeQuantum", name: "decodeQuantum", pkg: "encoding/base64", typ: $funcType([sliceType, sliceType, $Int], [$Int, $Int, $error], false)}, {prop: "DecodeString", name: "DecodeString", pkg: "", typ: $funcType([$String], [sliceType, $error], false)}, {prop: "Decode", name: "Decode", pkg: "", typ: $funcType([sliceType, sliceType], [$Int, $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("encoding/base64", [{prop: "encode", name: "encode", embedded: false, exported: false, typ: arrayType, tag: ""}, {prop: "decodeMap", name: "decodeMap", embedded: false, exported: false, typ: arrayType$1, tag: ""}, {prop: "padChar", name: "padChar", embedded: false, exported: false, typ: $Int32, tag: ""}, {prop: "strict", name: "strict", embedded: false, exported: false, typ: $Bool, tag: ""}]); encoder.init("encoding/base64", [{prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "enc", name: "enc", embedded: false, exported: false, typ: ptrType, tag: ""}, {prop: "w", name: "w", embedded: false, exported: false, typ: io.Writer, tag: ""}, {prop: "buf", name: "buf", embedded: false, exported: false, typ: arrayType$2, tag: ""}, {prop: "nbuf", name: "nbuf", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "out", name: "out", embedded: false, exported: false, 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 = binary.$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; } $pkg.StdEncoding = NewEncoding("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"); $pkg.URLEncoding = NewEncoding("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"); $pkg.RawStdEncoding = $clone($pkg.StdEncoding, Encoding).WithPadding(-1); $pkg.RawURLEncoding = $clone($pkg.URLEncoding, Encoding).WithPadding(-1); /* */ } 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, reflectlite, Interface, lessSwap, reverse, StringSlice, sliceType$2, funcType, funcType$1, reflectValueOf, reflectSwapper, insertionSort_func, siftDown_func, heapSort_func, medianOfThree_func, doPivot_func, quickSort_func, insertionSort, siftDown, heapSort, medianOfThree, swapRange, doPivot, quickSort, Sort, maxDepth, Reverse, Strings, Stable, stable, symMerge, rotate, Slice, Search, SearchStrings; reflectlite = $packages["internal/reflectlite"]; Interface = $pkg.Interface = $newType(8, $kindInterface, "sort.Interface", true, "sort", true, null); lessSwap = $pkg.lessSwap = $newType(0, $kindStruct, "sort.lessSwap", true, "sort", false, function(Less_, Swap_) { this.$val = this; if (arguments.length === 0) { this.Less = $throwNilPointerError; this.Swap = $throwNilPointerError; return; } this.Less = Less_; this.Swap = Swap_; }); reverse = $pkg.reverse = $newType(0, $kindStruct, "sort.reverse", true, "sort", false, function(Interface_) { this.$val = this; if (arguments.length === 0) { this.Interface = $ifaceNil; return; } this.Interface = Interface_; }); StringSlice = $pkg.StringSlice = $newType(12, $kindSlice, "sort.StringSlice", true, "sort", true, null); sliceType$2 = $sliceType($String); funcType = $funcType([$Int, $Int], [$Bool], false); funcType$1 = $funcType([$Int, $Int], [], false); insertionSort_func = function(data, a, b) { var _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; _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; return; /* */ } return; } if ($f === undefined) { $f = { $blk: insertionSort_func }; } $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_func = function(data, lo, hi, first) { var _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; _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: $s = -1; 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; return; /* */ } return; } if ($f === undefined) { $f = { $blk: siftDown_func }; } $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_func = function(data, a, b) { var _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; _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_func($clone(data, lessSwap), 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_func($clone(data, lessSwap), 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; return; /* */ } return; } if ($f === undefined) { $f = { $blk: heapSort_func }; } $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_func = function(data, m1, m0, m2) { var _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; _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; return; /* */ } return; } if ($f === undefined) { $f = { $blk: medianOfThree_func }; } $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_func = function(data, lo, hi) { var _q, _q$1, _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; _q = $f._q; _q$1 = $f._q$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; _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 + hi >> 0) >>> 0)) >>> 1 >>> 0) >> 0)); /* */ if ((hi - lo >> 0) > 40) { $s = 1; continue; } /* */ $s = 2; continue; /* if ((hi - lo >> 0) > 40) { */ case 1: s = (_q = ((hi - lo >> 0)) / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); $r = medianOfThree_func($clone(data, lessSwap), 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_func($clone(data, lessSwap), 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_func($clone(data, lessSwap), 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_func($clone(data, lessSwap), 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$1 = ((hi - lo >> 0)) / 4, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero"))) { $s = 22; continue; } /* */ $s = 23; continue; /* if (!protect && (hi - c >> 0) < (_q$1 = ((hi - lo >> 0)) / 4, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 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; $s = -1; return [midlo, midhi]; /* */ } return; } if ($f === undefined) { $f = { $blk: doPivot_func }; } $f._q = _q; $f._q$1 = _q$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._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_func = function(data, a, b, maxDepth$1) { var _r, _r$1, _tuple, a, b, data, i, maxDepth$1, mhi, mlo, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; a = $f.a; b = $f.b; data = $f.data; i = $f.i; maxDepth$1 = $f.maxDepth$1; 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$1 === 0) { $s = 3; continue; } /* */ $s = 4; continue; /* if (maxDepth$1 === 0) { */ case 3: $r = heapSort_func($clone(data, lessSwap), a, b); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 4: maxDepth$1 = maxDepth$1 - (1) >> 0; _r = doPivot_func($clone(data, lessSwap), 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_func($clone(data, lessSwap), a, mlo, maxDepth$1); /* */ $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_func($clone(data, lessSwap), mhi, b, maxDepth$1); /* */ $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_func($clone(data, lessSwap), a, b); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 13: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: quickSort_func }; } $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$1 = maxDepth$1; $f.mhi = mhi; $f.mlo = mlo; $f.$s = $s; $f.$r = $r; return $f; }; insertionSort = function(data, a, b) { var _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; _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; return; /* */ } return; } if ($f === undefined) { $f = { $blk: insertionSort }; } $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 _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; _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: $s = -1; 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; return; /* */ } return; } if ($f === undefined) { $f = { $blk: siftDown }; } $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 _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; _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; return; /* */ } return; } if ($f === undefined) { $f = { $blk: heapSort }; } $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 _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; _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; return; /* */ } return; } if ($f === undefined) { $f = { $blk: medianOfThree }; } $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; }; swapRange = function(data, a, b, n) { var a, b, data, i, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; a = $f.a; b = $f.b; data = $f.data; i = $f.i; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: i = 0; /* while (true) { */ case 1: /* if (!(i < n)) { break; } */ if(!(i < n)) { $s = 2; continue; } $r = data.Swap(a + i >> 0, b + i >> 0); /* */ $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: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: swapRange }; } $f.a = a; $f.b = b; $f.data = data; $f.i = i; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; doPivot = function(data, lo, hi) { var _q, _q$1, _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; _q = $f._q; _q$1 = $f._q$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; _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 + hi >> 0) >>> 0)) >>> 1 >>> 0) >> 0)); /* */ if ((hi - lo >> 0) > 40) { $s = 1; continue; } /* */ $s = 2; continue; /* if ((hi - lo >> 0) > 40) { */ case 1: s = (_q = ((hi - lo >> 0)) / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 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$1 = ((hi - lo >> 0)) / 4, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero"))) { $s = 22; continue; } /* */ $s = 23; continue; /* if (!protect && (hi - c >> 0) < (_q$1 = ((hi - lo >> 0)) / 4, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 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; $s = -1; return [midlo, midhi]; /* */ } return; } if ($f === undefined) { $f = { $blk: doPivot }; } $f._q = _q; $f._q$1 = _q$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._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$1) { var _r, _r$1, _tuple, a, b, data, i, maxDepth$1, mhi, mlo, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; a = $f.a; b = $f.b; data = $f.data; i = $f.i; maxDepth$1 = $f.maxDepth$1; 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$1 === 0) { $s = 3; continue; } /* */ $s = 4; continue; /* if (maxDepth$1 === 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; } $s = -1; return; /* } */ case 4: maxDepth$1 = maxDepth$1 - (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$1); /* */ $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$1); /* */ $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; return; /* */ } return; } if ($f === undefined) { $f = { $blk: quickSort }; } $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$1 = maxDepth$1; $f.mhi = mhi; $f.mlo = mlo; $f.$s = $s; $f.$r = $r; return $f; }; Sort = function(data) { var _r, data, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; data = $f.data; 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; $r = quickSort(data, 0, n, maxDepth(n)); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Sort }; } $f._r = _r; $f.data = data; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Sort = Sort; maxDepth = function(n) { var depth, i, n; depth = 0; i = n; while (true) { if (!(i > 0)) { break; } depth = depth + (1) >> 0; i = (i >> $min((1), 31)) >> 0; } return $imul(depth, 2); }; reverse.ptr.prototype.Less = function(i, j) { var $24r, _r, i, j, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; i = $f.i; j = $f.j; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r = r.Interface.Less(j, i); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: reverse.ptr.prototype.Less }; } $f.$24r = $24r; $f._r = _r; $f.i = i; $f.j = j; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; reverse.prototype.Less = function(i, j) { return this.$val.Less(i, j); }; Reverse = function(data) { var data; return new reverse.ptr(data); }; $pkg.Reverse = Reverse; StringSlice.prototype.Len = function() { var x; x = this; return x.$length; }; $ptrType(StringSlice).prototype.Len = function() { return this.$get().Len(); }; StringSlice.prototype.Less = function(i, j) { var i, j, x; x = this; return ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]) < ((j < 0 || j >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + j]); }; $ptrType(StringSlice).prototype.Less = function(i, j) { return this.$get().Less(i, j); }; StringSlice.prototype.Swap = function(i, j) { var _tmp, _tmp$1, i, j, x; x = this; _tmp = ((j < 0 || j >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + j]); _tmp$1 = ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]); ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i] = _tmp); ((j < 0 || j >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + j] = _tmp$1); }; $ptrType(StringSlice).prototype.Swap = function(i, j) { return this.$get().Swap(i, j); }; StringSlice.prototype.Sort = function() { var x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: x = this; $r = Sort(x); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: StringSlice.prototype.Sort }; } $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(StringSlice).prototype.Sort = function() { return this.$get().Sort(); }; Strings = function(x) { var x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = Sort(($convertSliceType(x, StringSlice))); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Strings }; } $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Strings = Strings; Stable = function(data) { var _arg, _arg$1, _r, data, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; data = $f.data; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _arg = data; _r = data.Len(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = _r; $r = stable(_arg, _arg$1); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Stable }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f.data = data; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Stable = Stable; stable = function(data, n) { var _tmp, _tmp$1, _tmp$2, _tmp$3, a, b, blockSize, data, m, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; a = $f.a; b = $f.b; blockSize = $f.blockSize; data = $f.data; m = $f.m; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: blockSize = 20; _tmp = 0; _tmp$1 = blockSize; a = _tmp; b = _tmp$1; /* while (true) { */ case 1: /* if (!(b <= n)) { break; } */ if(!(b <= n)) { $s = 2; continue; } $r = insertionSort(data, a, b); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } a = b; b = b + (blockSize) >> 0; $s = 1; continue; case 2: $r = insertionSort(data, a, n); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* while (true) { */ case 5: /* if (!(blockSize < n)) { break; } */ if(!(blockSize < n)) { $s = 6; continue; } _tmp$2 = 0; _tmp$3 = $imul(2, blockSize); a = _tmp$2; b = _tmp$3; /* while (true) { */ case 7: /* if (!(b <= n)) { break; } */ if(!(b <= n)) { $s = 8; continue; } $r = symMerge(data, a, a + blockSize >> 0, b); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } a = b; b = b + (($imul(2, blockSize))) >> 0; $s = 7; continue; case 8: m = a + blockSize >> 0; /* */ if (m < n) { $s = 10; continue; } /* */ $s = 11; continue; /* if (m < n) { */ case 10: $r = symMerge(data, a, m, n); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 11: blockSize = $imul(blockSize, (2)); $s = 5; continue; case 6: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: stable }; } $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f.a = a; $f.b = b; $f.blockSize = blockSize; $f.data = data; $f.m = m; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; symMerge = function(data, a, m, b) { var _r, _r$1, _r$2, _tmp, _tmp$1, a, b, c, data, end, h, h$1, i, i$1, j, j$1, k, k$1, m, mid, n, p, r, start, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; a = $f.a; b = $f.b; c = $f.c; data = $f.data; end = $f.end; h = $f.h; h$1 = $f.h$1; i = $f.i; i$1 = $f.i$1; j = $f.j; j$1 = $f.j$1; k = $f.k; k$1 = $f.k$1; m = $f.m; mid = $f.mid; n = $f.n; p = $f.p; r = $f.r; start = $f.start; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if ((m - a >> 0) === 1) { $s = 1; continue; } /* */ $s = 2; continue; /* if ((m - a >> 0) === 1) { */ case 1: i = m; j = b; /* while (true) { */ case 3: /* if (!(i < j)) { break; } */ if(!(i < j)) { $s = 4; continue; } h = ((((((i + j >> 0) >>> 0)) >>> 1 >>> 0) >> 0)); _r = data.Less(h, a); /* */ $s = 8; case 8: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (_r) { $s = 5; continue; } /* */ $s = 6; continue; /* if (_r) { */ case 5: i = h + 1 >> 0; $s = 7; continue; /* } else { */ case 6: j = h; /* } */ case 7: $s = 3; continue; case 4: k = a; /* while (true) { */ case 9: /* if (!(k < (i - 1 >> 0))) { break; } */ if(!(k < (i - 1 >> 0))) { $s = 10; continue; } $r = data.Swap(k, k + 1 >> 0); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } k = k + (1) >> 0; $s = 9; continue; case 10: $s = -1; return; /* } */ case 2: /* */ if ((b - m >> 0) === 1) { $s = 12; continue; } /* */ $s = 13; continue; /* if ((b - m >> 0) === 1) { */ case 12: i$1 = a; j$1 = m; /* while (true) { */ case 14: /* if (!(i$1 < j$1)) { break; } */ if(!(i$1 < j$1)) { $s = 15; continue; } h$1 = ((((((i$1 + j$1 >> 0) >>> 0)) >>> 1 >>> 0) >> 0)); _r$1 = data.Less(m, h$1); /* */ $s = 19; case 19: 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: i$1 = h$1 + 1 >> 0; $s = 18; continue; /* } else { */ case 17: j$1 = h$1; /* } */ case 18: $s = 14; continue; case 15: k$1 = m; /* while (true) { */ case 20: /* if (!(k$1 > i$1)) { break; } */ if(!(k$1 > i$1)) { $s = 21; continue; } $r = data.Swap(k$1, k$1 - 1 >> 0); /* */ $s = 22; case 22: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } k$1 = k$1 - (1) >> 0; $s = 20; continue; case 21: $s = -1; return; /* } */ case 13: mid = ((((((a + b >> 0) >>> 0)) >>> 1 >>> 0) >> 0)); n = mid + m >> 0; _tmp = 0; _tmp$1 = 0; start = _tmp; r = _tmp$1; if (m > mid) { start = n - b >> 0; r = mid; } else { start = a; r = m; } p = n - 1 >> 0; /* while (true) { */ case 23: /* if (!(start < r)) { break; } */ if(!(start < r)) { $s = 24; continue; } c = ((((((start + r >> 0) >>> 0)) >>> 1 >>> 0) >> 0)); _r$2 = data.Less(p - c >> 0, c); /* */ $s = 28; case 28: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } /* */ if (!_r$2) { $s = 25; continue; } /* */ $s = 26; continue; /* if (!_r$2) { */ case 25: start = c + 1 >> 0; $s = 27; continue; /* } else { */ case 26: r = c; /* } */ case 27: $s = 23; continue; case 24: end = n - start >> 0; /* */ if (start < m && m < end) { $s = 29; continue; } /* */ $s = 30; continue; /* if (start < m && m < end) { */ case 29: $r = rotate(data, start, m, end); /* */ $s = 31; case 31: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 30: /* */ if (a < start && start < mid) { $s = 32; continue; } /* */ $s = 33; continue; /* if (a < start && start < mid) { */ case 32: $r = symMerge(data, a, start, mid); /* */ $s = 34; case 34: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 33: /* */ if (mid < end && end < b) { $s = 35; continue; } /* */ $s = 36; continue; /* if (mid < end && end < b) { */ case 35: $r = symMerge(data, mid, end, b); /* */ $s = 37; case 37: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 36: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: symMerge }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.a = a; $f.b = b; $f.c = c; $f.data = data; $f.end = end; $f.h = h; $f.h$1 = h$1; $f.i = i; $f.i$1 = i$1; $f.j = j; $f.j$1 = j$1; $f.k = k; $f.k$1 = k$1; $f.m = m; $f.mid = mid; $f.n = n; $f.p = p; $f.r = r; $f.start = start; $f.$s = $s; $f.$r = $r; return $f; }; rotate = function(data, a, m, b) { var a, b, data, i, j, m, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; a = $f.a; b = $f.b; data = $f.data; i = $f.i; j = $f.j; m = $f.m; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: i = m - a >> 0; j = b - m >> 0; /* while (true) { */ case 1: /* if (!(!((i === j)))) { break; } */ if(!(!((i === j)))) { $s = 2; continue; } /* */ if (i > j) { $s = 3; continue; } /* */ $s = 4; continue; /* if (i > j) { */ case 3: $r = swapRange(data, m - i >> 0, m, j); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i = i - (j) >> 0; $s = 5; continue; /* } else { */ case 4: $r = swapRange(data, m - i >> 0, (m + j >> 0) - i >> 0, i); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } j = j - (i) >> 0; /* } */ case 5: $s = 1; continue; case 2: $r = swapRange(data, m - i >> 0, m, i); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: rotate }; } $f.a = a; $f.b = b; $f.data = data; $f.i = i; $f.j = j; $f.m = m; $f.$s = $s; $f.$r = $r; return $f; }; Slice = function(x, less) { var _r, _r$1, length, less, rv, swap, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; length = $f.length; less = $f.less; rv = $f.rv; swap = $f.swap; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = reflectValueOf(x); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } rv = $clone(_r, reflectlite.Value); _r$1 = reflectSwapper(x); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } swap = _r$1; length = $clone(rv, reflectlite.Value).Len(); $r = quickSort_func(new lessSwap.ptr(less, swap), 0, length, maxDepth(length)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Slice }; } $f._r = _r; $f._r$1 = _r$1; $f.length = length; $f.less = less; $f.rv = rv; $f.swap = swap; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Slice = Slice; Search = function(n, f) { var _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; _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 + j >> 0) >>> 0)) >>> 1 >>> 0) >> 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: $s = -1; return i; /* */ } return; } if ($f === undefined) { $f = { $blk: Search }; } $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 $24r, _r, a, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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 i; return ((i < 0 || i >= a[0].$length) ? ($throwRuntimeError("index out of range"), undefined) : 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; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: SearchStrings }; } $f.$24r = $24r; $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 $24r, _r, p, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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($convertSliceType(p, sliceType$2), x); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: StringSlice.prototype.Search }; } $f.$24r = $24r; $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); }; reverse.methods = [{prop: "Less", name: "Less", pkg: "", typ: $funcType([$Int, $Int], [$Bool], false)}]; StringSlice.methods = [{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)}, {prop: "Search", name: "Search", pkg: "", typ: $funcType([$String], [$Int], false)}]; Interface.init([{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)}]); lessSwap.init("", [{prop: "Less", name: "Less", embedded: false, exported: true, typ: funcType, tag: ""}, {prop: "Swap", name: "Swap", embedded: false, exported: true, typ: funcType$1, tag: ""}]); reverse.init("", [{prop: "Interface", name: "Interface", embedded: true, exported: true, typ: Interface, tag: ""}]); 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: $r = reflectlite.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } reflectValueOf = reflectlite.ValueOf; reflectSwapper = reflectlite.Swapper; /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["internal/fmtsort"] = (function() { var $pkg = {}, $init, reflect, sort, SortedMap, ptrType, sliceType, Sort, compare, nilCompare, floatCompare, isNaN; reflect = $packages["reflect"]; sort = $packages["sort"]; SortedMap = $pkg.SortedMap = $newType(0, $kindStruct, "fmtsort.SortedMap", true, "internal/fmtsort", true, function(Key_, Value_) { this.$val = this; if (arguments.length === 0) { this.Key = sliceType.nil; this.Value = sliceType.nil; return; } this.Key = Key_; this.Value = Value_; }); ptrType = $ptrType(SortedMap); sliceType = $sliceType(reflect.Value); SortedMap.ptr.prototype.Len = function() { var o; o = this; return o.Key.$length; }; SortedMap.prototype.Len = function() { return this.$val.Len(); }; SortedMap.ptr.prototype.Less = function(i, j) { var $24r, _r, i, j, o, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; i = $f.i; j = $f.j; o = $f.o; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: o = this; _r = compare($clone((x = o.Key, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])), reflect.Value), $clone((x$1 = o.Key, ((j < 0 || j >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + j])), reflect.Value)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r < 0; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: SortedMap.ptr.prototype.Less }; } $f.$24r = $24r; $f._r = _r; $f.i = i; $f.j = j; $f.o = o; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; SortedMap.prototype.Less = function(i, j) { return this.$val.Less(i, j); }; SortedMap.ptr.prototype.Swap = function(i, j) { var _tmp, _tmp$1, _tmp$2, _tmp$3, i, j, o, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7; o = this; _tmp = (x = o.Key, ((j < 0 || j >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + j])); _tmp$1 = (x$1 = o.Key, ((i < 0 || i >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + i])); (x$2 = o.Key, ((i < 0 || i >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + i] = _tmp)); (x$3 = o.Key, ((j < 0 || j >= x$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + j] = _tmp$1)); _tmp$2 = (x$4 = o.Value, ((j < 0 || j >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + j])); _tmp$3 = (x$5 = o.Value, ((i < 0 || i >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + i])); (x$6 = o.Value, ((i < 0 || i >= x$6.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$6.$array[x$6.$offset + i] = _tmp$2)); (x$7 = o.Value, ((j < 0 || j >= x$7.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$7.$array[x$7.$offset + j] = _tmp$3)); }; SortedMap.prototype.Swap = function(i, j) { return this.$val.Swap(i, j); }; Sort = function(mapValue) { var _r, _r$1, _r$2, _r$3, iter, key, mapValue, n, sorted, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; iter = $f.iter; key = $f.key; mapValue = $f.mapValue; n = $f.n; sorted = $f.sorted; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = $clone(mapValue, reflect.Value).Type().Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (!((_r === 21))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((_r === 21))) { */ case 1: $s = -1; return ptrType.nil; /* } */ case 2: n = $clone(mapValue, reflect.Value).Len(); key = $makeSlice(sliceType, 0, n); value = $makeSlice(sliceType, 0, n); iter = $clone(mapValue, reflect.Value).MapRange(); /* while (true) { */ case 4: _r$1 = iter.Next(); /* */ $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)) { break; } */ if(!(_r$1)) { $s = 5; continue; } _r$2 = iter.Key(); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } key = $append(key, _r$2); _r$3 = iter.Value(); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } value = $append(value, _r$3); $s = 4; continue; case 5: sorted = new SortedMap.ptr(key, value); $r = sort.Stable(sorted); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return sorted; /* */ } return; } if ($f === undefined) { $f = { $blk: Sort }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.iter = iter; $f.key = key; $f.mapValue = mapValue; $f.n = n; $f.sorted = sorted; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Sort = Sort; compare = function(aVal, bVal) { var $24r, _1, _arg, _arg$1, _arg$2, _arg$3, _arg$4, _arg$5, _arg$6, _arg$7, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _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, _tuple, _tuple$1, a, a$1, a$2, a$3, a$4, a$5, aType, aVal, ap, b, b$1, b$2, b$3, b$4, b$5, bType, bVal, bp, c, c$1, c$2, c$3, c$4, c$5, i, i$1, ok, ok$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _1 = $f._1; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _arg$4 = $f._arg$4; _arg$5 = $f._arg$5; _arg$6 = $f._arg$6; _arg$7 = $f._arg$7; _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$17 = $f._r$17; _r$18 = $f._r$18; _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$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$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; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; a = $f.a; a$1 = $f.a$1; a$2 = $f.a$2; a$3 = $f.a$3; a$4 = $f.a$4; a$5 = $f.a$5; aType = $f.aType; aVal = $f.aVal; ap = $f.ap; b = $f.b; b$1 = $f.b$1; b$2 = $f.b$2; b$3 = $f.b$3; b$4 = $f.b$4; b$5 = $f.b$5; bType = $f.bType; bVal = $f.bVal; bp = $f.bp; c = $f.c; c$1 = $f.c$1; c$2 = $f.c$2; c$3 = $f.c$3; c$4 = $f.c$4; c$5 = $f.c$5; i = $f.i; i$1 = $f.i$1; ok = $f.ok; ok$1 = $f.ok$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _tmp = $clone(aVal, reflect.Value).Type(); _tmp$1 = $clone(bVal, reflect.Value).Type(); aType = _tmp; bType = _tmp$1; if (!($interfaceIsEqual(aType, bType))) { $s = -1; return -1; } _1 = $clone(aVal, reflect.Value).Kind(); /* */ if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { $s = 2; continue; } /* */ if ((_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12))) { $s = 3; continue; } /* */ if (_1 === (24)) { $s = 4; continue; } /* */ if ((_1 === (13)) || (_1 === (14))) { $s = 5; continue; } /* */ if ((_1 === (15)) || (_1 === (16))) { $s = 6; continue; } /* */ if (_1 === (1)) { $s = 7; continue; } /* */ if ((_1 === (22)) || (_1 === (26))) { $s = 8; continue; } /* */ if (_1 === (18)) { $s = 9; continue; } /* */ if (_1 === (25)) { $s = 10; continue; } /* */ if (_1 === (17)) { $s = 11; continue; } /* */ if (_1 === (20)) { $s = 12; continue; } /* */ $s = 13; continue; /* if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { */ case 2: _tmp$2 = $clone(aVal, reflect.Value).Int(); _tmp$3 = $clone(bVal, reflect.Value).Int(); a = _tmp$2; b = _tmp$3; if ((a.$high < b.$high || (a.$high === b.$high && a.$low < b.$low))) { $s = -1; return -1; } else if ((a.$high > b.$high || (a.$high === b.$high && a.$low > b.$low))) { $s = -1; return 1; } else { $s = -1; return 0; } $s = 14; continue; /* } else if ((_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12))) { */ case 3: _tmp$4 = $clone(aVal, reflect.Value).Uint(); _tmp$5 = $clone(bVal, reflect.Value).Uint(); a$1 = _tmp$4; b$1 = _tmp$5; if ((a$1.$high < b$1.$high || (a$1.$high === b$1.$high && a$1.$low < b$1.$low))) { $s = -1; return -1; } else if ((a$1.$high > b$1.$high || (a$1.$high === b$1.$high && a$1.$low > b$1.$low))) { $s = -1; return 1; } else { $s = -1; return 0; } $s = 14; continue; /* } else if (_1 === (24)) { */ case 4: _r = $clone(aVal, reflect.Value).String(); /* */ $s = 15; case 15: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tmp$6 = _r; _r$1 = $clone(bVal, reflect.Value).String(); /* */ $s = 16; case 16: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tmp$7 = _r$1; a$2 = _tmp$6; b$2 = _tmp$7; if (a$2 < b$2) { $s = -1; return -1; } else if (a$2 > b$2) { $s = -1; return 1; } else { $s = -1; return 0; } $s = 14; continue; /* } else if ((_1 === (13)) || (_1 === (14))) { */ case 5: $s = -1; return floatCompare($clone(aVal, reflect.Value).Float(), $clone(bVal, reflect.Value).Float()); /* } else if ((_1 === (15)) || (_1 === (16))) { */ case 6: _tmp$8 = $clone(aVal, reflect.Value).Complex(); _tmp$9 = $clone(bVal, reflect.Value).Complex(); a$3 = _tmp$8; b$3 = _tmp$9; c = floatCompare(a$3.$real, b$3.$real); if (!((c === 0))) { $s = -1; return c; } $s = -1; return floatCompare(a$3.$imag, b$3.$imag); /* } else if (_1 === (1)) { */ case 7: _tmp$10 = $clone(aVal, reflect.Value).Bool(); _tmp$11 = $clone(bVal, reflect.Value).Bool(); a$4 = _tmp$10; b$4 = _tmp$11; if (a$4 === b$4) { $s = -1; return 0; } else if (a$4) { $s = -1; return 1; } else { $s = -1; return -1; } $s = 14; continue; /* } else if ((_1 === (22)) || (_1 === (26))) { */ case 8: _tmp$12 = $clone(aVal, reflect.Value).Pointer(); _tmp$13 = $clone(bVal, reflect.Value).Pointer(); a$5 = _tmp$12; b$5 = _tmp$13; if (a$5 < b$5) { $s = -1; return -1; } else if (a$5 > b$5) { $s = -1; return 1; } else { $s = -1; return 0; } $s = 14; continue; /* } else if (_1 === (18)) { */ case 9: _tuple = nilCompare($clone(aVal, reflect.Value), $clone(bVal, reflect.Value)); c$1 = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return c$1; } _tmp$14 = $clone(aVal, reflect.Value).Pointer(); _tmp$15 = $clone(bVal, reflect.Value).Pointer(); ap = _tmp$14; bp = _tmp$15; if (ap < bp) { $s = -1; return -1; } else if (ap > bp) { $s = -1; return 1; } else { $s = -1; return 0; } $s = 14; continue; /* } else if (_1 === (25)) { */ case 10: i = 0; /* while (true) { */ case 17: /* if (!(i < $clone(aVal, reflect.Value).NumField())) { break; } */ if(!(i < $clone(aVal, reflect.Value).NumField())) { $s = 18; continue; } _r$2 = $clone(aVal, reflect.Value).Field(i); /* */ $s = 19; case 19: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg = $clone(_r$2, reflect.Value); _r$3 = $clone(bVal, reflect.Value).Field(i); /* */ $s = 20; case 20: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _arg$1 = $clone(_r$3, reflect.Value); _r$4 = compare(_arg, _arg$1); /* */ $s = 21; case 21: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } c$2 = _r$4; if (!((c$2 === 0))) { $s = -1; return c$2; } i = i + (1) >> 0; $s = 17; continue; case 18: $s = -1; return 0; /* } else if (_1 === (17)) { */ case 11: i$1 = 0; /* while (true) { */ case 22: /* if (!(i$1 < $clone(aVal, reflect.Value).Len())) { break; } */ if(!(i$1 < $clone(aVal, reflect.Value).Len())) { $s = 23; continue; } _r$5 = $clone(aVal, reflect.Value).Index(i$1); /* */ $s = 24; case 24: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg$2 = $clone(_r$5, reflect.Value); _r$6 = $clone(bVal, reflect.Value).Index(i$1); /* */ $s = 25; case 25: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _arg$3 = $clone(_r$6, reflect.Value); _r$7 = compare(_arg$2, _arg$3); /* */ $s = 26; case 26: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } c$3 = _r$7; if (!((c$3 === 0))) { $s = -1; return c$3; } i$1 = i$1 + (1) >> 0; $s = 22; continue; case 23: $s = -1; return 0; /* } else if (_1 === (20)) { */ case 12: _tuple$1 = nilCompare($clone(aVal, reflect.Value), $clone(bVal, reflect.Value)); c$4 = _tuple$1[0]; ok$1 = _tuple$1[1]; if (ok$1) { $s = -1; return c$4; } _r$8 = $clone(aVal, reflect.Value).Elem(); /* */ $s = 27; case 27: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$9 = $clone(_r$8, reflect.Value).Type(); /* */ $s = 28; case 28: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$10 = reflect.ValueOf(_r$9); /* */ $s = 29; case 29: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _arg$4 = $clone(_r$10, reflect.Value); _r$11 = $clone(bVal, reflect.Value).Elem(); /* */ $s = 30; case 30: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _r$12 = $clone(_r$11, reflect.Value).Type(); /* */ $s = 31; case 31: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _r$13 = reflect.ValueOf(_r$12); /* */ $s = 32; case 32: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _arg$5 = $clone(_r$13, reflect.Value); _r$14 = compare(_arg$4, _arg$5); /* */ $s = 33; case 33: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } c$5 = _r$14; if (!((c$5 === 0))) { $s = -1; return c$5; } _r$15 = $clone(aVal, reflect.Value).Elem(); /* */ $s = 34; case 34: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _arg$6 = $clone(_r$15, reflect.Value); _r$16 = $clone(bVal, reflect.Value).Elem(); /* */ $s = 35; case 35: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _arg$7 = $clone(_r$16, reflect.Value); _r$17 = compare(_arg$6, _arg$7); /* */ $s = 36; case 36: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } $24r = _r$17; $s = 37; case 37: return $24r; /* } else { */ case 13: _r$18 = aType.String(); /* */ $s = 38; case 38: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } $panic(new $String("bad type in compare: " + _r$18)); /* } */ case 14: case 1: $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: compare }; } $f.$24r = $24r; $f._1 = _1; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._arg$4 = _arg$4; $f._arg$5 = _arg$5; $f._arg$6 = _arg$6; $f._arg$7 = _arg$7; $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$17 = _r$17; $f._r$18 = _r$18; $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$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$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._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.a = a; $f.a$1 = a$1; $f.a$2 = a$2; $f.a$3 = a$3; $f.a$4 = a$4; $f.a$5 = a$5; $f.aType = aType; $f.aVal = aVal; $f.ap = ap; $f.b = b; $f.b$1 = b$1; $f.b$2 = b$2; $f.b$3 = b$3; $f.b$4 = b$4; $f.b$5 = b$5; $f.bType = bType; $f.bVal = bVal; $f.bp = bp; $f.c = c; $f.c$1 = c$1; $f.c$2 = c$2; $f.c$3 = c$3; $f.c$4 = c$4; $f.c$5 = c$5; $f.i = i; $f.i$1 = i$1; $f.ok = ok; $f.ok$1 = ok$1; $f.$s = $s; $f.$r = $r; return $f; }; nilCompare = function(aVal, bVal) { var aVal, bVal; if ($clone(aVal, reflect.Value).IsNil()) { if ($clone(bVal, reflect.Value).IsNil()) { return [0, true]; } return [-1, true]; } if ($clone(bVal, reflect.Value).IsNil()) { return [1, true]; } return [0, false]; }; floatCompare = function(a, b) { var a, b; if (isNaN(a)) { return -1; } else if (isNaN(b)) { return 1; } else if (a < b) { return -1; } else if (a > b) { return 1; } return 0; }; isNaN = function(a) { var a; return !((a === a)); }; ptrType.methods = [{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)}]; SortedMap.init("", [{prop: "Key", name: "Key", embedded: false, exported: true, typ: sliceType, tag: ""}, {prop: "Value", name: "Value", embedded: false, exported: true, typ: sliceType, 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 = reflect.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sort.$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["internal/oserror"] = (function() { var $pkg = {}, $init, errors; errors = $packages["errors"]; $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; } $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"); $pkg.ErrClosed = errors.New("file already closed"); /* */ } 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, errors, js, bytealg, itoa, oserror, race, unsafeheader, runtime, sync, _C_int, Timespec, Stat_t, RawSockaddrInet4, RawSockaddrInet6, RawSockaddrUnix, RawSockaddrLinklayer, RawSockaddrNetlink, RawSockaddr, RawSockaddrAny, _Socklen, Linger, Iovec, IPMreq, IPMreqn, IPv6Mreq, Msghdr, NlMsghdr, RtGenmsg, RtAttr, IfInfomsg, IfAddrmsg, Utsname, mmapper, Errno, Sockaddr, SockaddrInet4, SockaddrInet6, SockaddrUnix, SockaddrLinklayer, SockaddrNetlink, NetlinkRouteRequest, NetlinkMessage, NetlinkRouteAttr, RawConn, sliceType, sliceType$1, ptrType$2, ptrType$3, ptrType$4, arrayType, arrayType$1, ptrType$5, ptrType$6, arrayType$3, ptrType$7, arrayType$6, ptrType$18, arrayType$8, arrayType$9, arrayType$10, arrayType$11, ptrType$19, ptrType$23, sliceType$9, ptrType$24, sliceType$10, ptrType$25, ptrType$32, arrayType$24, ptrType$34, mapType, funcType, funcType$1, ptrType$35, ptrType$36, ptrType$37, ptrType$38, ptrType$40, funcType$2, funcType$3, errors$1, errEAGAIN, errEINVAL, errENOENT, ioSync, ioSync$24ptr, mapper, syscallModule, alreadyTriedToLoad, minusOne, warningPrinted, lineBuffer, envOnce, envLock, env, envs, fchmodat, openat, unlinkat, Close, Dup, Fchdir, Fchmod, fcntl, Fsync, Getdents, read, Uname, write, munmap, Fchown, Fstat, Fstatat, Ftruncate, Listen, Pread, Pwrite, Seek, sendfile, Shutdown, Splice, accept, accept4, bind, connect, getsockopt, setsockopt, socket, getpeername, getsockname, recvfrom, sendto, recvmsg, sendmsg, mmap, pipe2, faketimeWrite, errnoErr, Read, Write, Bind, Connect, Getpeername, GetsockoptInt, Recvfrom, Sendto, SetsockoptByte, SetsockoptInt, SetsockoptInet4Addr, SetsockoptIPMreq, SetsockoptIPv6Mreq, SetsockoptLinger, Socket, Sendfile, Stat, Lstat, Pipe2, Chmod, Fchmodat, Open, Rmdir, Unlink, anyToSockaddr, Accept, Accept4, Getsockname, SetsockoptIPMreqn, Recvmsg, SendmsgN, ReadDirent, Getpagesize, cloexecSocket, nlmAlignOf, rtaAlignOf, newNetlinkRouteRequest, NetlinkRIB, ParseNetlinkMessage, netlinkMessageHeaderAndData, ParseNetlinkRouteAttr, netlinkRouteAttrAndValue, msanRead, msanWrite, runtime_envs, syscallByName, Syscall, Syscall6, RawSyscall, BytePtrFromString, init, printWarning, printToConsole, Exit, indexByte, CloseOnExec, SetNonblock, copyenv, Getenv; errors = $packages["errors"]; js = $packages["github.com/gopherjs/gopherjs/js"]; bytealg = $packages["internal/bytealg"]; itoa = $packages["internal/itoa"]; oserror = $packages["internal/oserror"]; race = $packages["internal/race"]; unsafeheader = $packages["internal/unsafeheader"]; runtime = $packages["runtime"]; sync = $packages["sync"]; _C_int = $pkg._C_int = $newType(4, $kindInt32, "syscall._C_int", true, "syscall", false, null); Timespec = $pkg.Timespec = $newType(0, $kindStruct, "syscall.Timespec", true, "syscall", true, 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", true, "syscall", true, function(Dev_, Ino_, Mode_, Nlink_, Uid_, Gid_, Rdev_, X__pad1_, Size_, Blksize_, X__pad2_, Blocks_, Atim_, Mtim_, Ctim_, X__glibc_reserved_) { this.$val = this; if (arguments.length === 0) { this.Dev = new $Uint64(0, 0); this.Ino = new $Uint64(0, 0); this.Mode = 0; this.Nlink = 0; this.Uid = 0; this.Gid = 0; this.Rdev = new $Uint64(0, 0); this.X__pad1 = new $Uint64(0, 0); this.Size = new $Int64(0, 0); this.Blksize = 0; this.X__pad2 = 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__glibc_reserved = arrayType$3.zero(); return; } this.Dev = Dev_; this.Ino = Ino_; this.Mode = Mode_; this.Nlink = Nlink_; this.Uid = Uid_; this.Gid = Gid_; this.Rdev = Rdev_; this.X__pad1 = X__pad1_; this.Size = Size_; this.Blksize = Blksize_; this.X__pad2 = X__pad2_; this.Blocks = Blocks_; this.Atim = Atim_; this.Mtim = Mtim_; this.Ctim = Ctim_; this.X__glibc_reserved = X__glibc_reserved_; }); RawSockaddrInet4 = $pkg.RawSockaddrInet4 = $newType(0, $kindStruct, "syscall.RawSockaddrInet4", true, "syscall", true, function(Family_, Port_, Addr_, Zero_) { this.$val = this; if (arguments.length === 0) { this.Family = 0; this.Port = 0; this.Addr = arrayType$10.zero(); this.Zero = arrayType$8.zero(); return; } this.Family = Family_; this.Port = Port_; this.Addr = Addr_; this.Zero = Zero_; }); RawSockaddrInet6 = $pkg.RawSockaddrInet6 = $newType(0, $kindStruct, "syscall.RawSockaddrInet6", true, "syscall", true, function(Family_, Port_, Flowinfo_, Addr_, Scope_id_) { this.$val = this; if (arguments.length === 0) { this.Family = 0; this.Port = 0; this.Flowinfo = 0; this.Addr = arrayType$11.zero(); this.Scope_id = 0; return; } this.Family = Family_; this.Port = Port_; this.Flowinfo = Flowinfo_; this.Addr = Addr_; this.Scope_id = Scope_id_; }); RawSockaddrUnix = $pkg.RawSockaddrUnix = $newType(0, $kindStruct, "syscall.RawSockaddrUnix", true, "syscall", true, function(Family_, Path_) { this.$val = this; if (arguments.length === 0) { this.Family = 0; this.Path = arrayType$9.zero(); return; } this.Family = Family_; this.Path = Path_; }); RawSockaddrLinklayer = $pkg.RawSockaddrLinklayer = $newType(0, $kindStruct, "syscall.RawSockaddrLinklayer", true, "syscall", true, function(Family_, Protocol_, Ifindex_, Hatype_, Pkttype_, Halen_, Addr_) { this.$val = this; if (arguments.length === 0) { this.Family = 0; this.Protocol = 0; this.Ifindex = 0; this.Hatype = 0; this.Pkttype = 0; this.Halen = 0; this.Addr = arrayType$8.zero(); return; } this.Family = Family_; this.Protocol = Protocol_; this.Ifindex = Ifindex_; this.Hatype = Hatype_; this.Pkttype = Pkttype_; this.Halen = Halen_; this.Addr = Addr_; }); RawSockaddrNetlink = $pkg.RawSockaddrNetlink = $newType(0, $kindStruct, "syscall.RawSockaddrNetlink", true, "syscall", true, function(Family_, Pad_, Pid_, Groups_) { this.$val = this; if (arguments.length === 0) { this.Family = 0; this.Pad = 0; this.Pid = 0; this.Groups = 0; return; } this.Family = Family_; this.Pad = Pad_; this.Pid = Pid_; this.Groups = Groups_; }); RawSockaddr = $pkg.RawSockaddr = $newType(0, $kindStruct, "syscall.RawSockaddr", true, "syscall", true, function(Family_, Data_) { this.$val = this; if (arguments.length === 0) { this.Family = 0; this.Data = arrayType.zero(); return; } this.Family = Family_; this.Data = Data_; }); RawSockaddrAny = $pkg.RawSockaddrAny = $newType(0, $kindStruct, "syscall.RawSockaddrAny", true, "syscall", true, function(Addr_, Pad_) { this.$val = this; if (arguments.length === 0) { this.Addr = new RawSockaddr.ptr(0, arrayType.zero()); this.Pad = arrayType$1.zero(); return; } this.Addr = Addr_; this.Pad = Pad_; }); _Socklen = $pkg._Socklen = $newType(4, $kindUint32, "syscall._Socklen", true, "syscall", false, null); Linger = $pkg.Linger = $newType(0, $kindStruct, "syscall.Linger", true, "syscall", true, function(Onoff_, Linger_) { this.$val = this; if (arguments.length === 0) { this.Onoff = 0; this.Linger = 0; return; } this.Onoff = Onoff_; this.Linger = Linger_; }); Iovec = $pkg.Iovec = $newType(0, $kindStruct, "syscall.Iovec", true, "syscall", true, function(Base_, Len_) { this.$val = this; if (arguments.length === 0) { this.Base = ptrType$2.nil; this.Len = new $Uint64(0, 0); return; } this.Base = Base_; this.Len = Len_; }); IPMreq = $pkg.IPMreq = $newType(0, $kindStruct, "syscall.IPMreq", true, "syscall", true, function(Multiaddr_, Interface_) { this.$val = this; if (arguments.length === 0) { this.Multiaddr = arrayType$10.zero(); this.Interface = arrayType$10.zero(); return; } this.Multiaddr = Multiaddr_; this.Interface = Interface_; }); IPMreqn = $pkg.IPMreqn = $newType(0, $kindStruct, "syscall.IPMreqn", true, "syscall", true, function(Multiaddr_, Address_, Ifindex_) { this.$val = this; if (arguments.length === 0) { this.Multiaddr = arrayType$10.zero(); this.Address = arrayType$10.zero(); this.Ifindex = 0; return; } this.Multiaddr = Multiaddr_; this.Address = Address_; this.Ifindex = Ifindex_; }); IPv6Mreq = $pkg.IPv6Mreq = $newType(0, $kindStruct, "syscall.IPv6Mreq", true, "syscall", true, function(Multiaddr_, Interface_) { this.$val = this; if (arguments.length === 0) { this.Multiaddr = arrayType$11.zero(); this.Interface = 0; return; } this.Multiaddr = Multiaddr_; this.Interface = Interface_; }); Msghdr = $pkg.Msghdr = $newType(0, $kindStruct, "syscall.Msghdr", true, "syscall", true, function(Name_, Namelen_, Pad_cgo_0_, Iov_, Iovlen_, Control_, Controllen_, Flags_, Pad_cgo_1_) { this.$val = this; if (arguments.length === 0) { this.Name = ptrType$2.nil; this.Namelen = 0; this.Pad_cgo_0 = arrayType$10.zero(); this.Iov = ptrType$19.nil; this.Iovlen = new $Uint64(0, 0); this.Control = ptrType$2.nil; this.Controllen = new $Uint64(0, 0); this.Flags = 0; this.Pad_cgo_1 = arrayType$10.zero(); return; } this.Name = Name_; this.Namelen = Namelen_; this.Pad_cgo_0 = Pad_cgo_0_; this.Iov = Iov_; this.Iovlen = Iovlen_; this.Control = Control_; this.Controllen = Controllen_; this.Flags = Flags_; this.Pad_cgo_1 = Pad_cgo_1_; }); NlMsghdr = $pkg.NlMsghdr = $newType(0, $kindStruct, "syscall.NlMsghdr", true, "syscall", true, function(Len_, Type_, Flags_, Seq_, Pid_) { this.$val = this; if (arguments.length === 0) { this.Len = 0; this.Type = 0; this.Flags = 0; this.Seq = 0; this.Pid = 0; return; } this.Len = Len_; this.Type = Type_; this.Flags = Flags_; this.Seq = Seq_; this.Pid = Pid_; }); RtGenmsg = $pkg.RtGenmsg = $newType(0, $kindStruct, "syscall.RtGenmsg", true, "syscall", true, function(Family_) { this.$val = this; if (arguments.length === 0) { this.Family = 0; return; } this.Family = Family_; }); RtAttr = $pkg.RtAttr = $newType(0, $kindStruct, "syscall.RtAttr", true, "syscall", true, function(Len_, Type_) { this.$val = this; if (arguments.length === 0) { this.Len = 0; this.Type = 0; return; } this.Len = Len_; this.Type = Type_; }); IfInfomsg = $pkg.IfInfomsg = $newType(0, $kindStruct, "syscall.IfInfomsg", true, "syscall", true, function(Family_, X__ifi_pad_, Type_, Index_, Flags_, Change_) { this.$val = this; if (arguments.length === 0) { this.Family = 0; this.X__ifi_pad = 0; this.Type = 0; this.Index = 0; this.Flags = 0; this.Change = 0; return; } this.Family = Family_; this.X__ifi_pad = X__ifi_pad_; this.Type = Type_; this.Index = Index_; this.Flags = Flags_; this.Change = Change_; }); IfAddrmsg = $pkg.IfAddrmsg = $newType(0, $kindStruct, "syscall.IfAddrmsg", true, "syscall", true, function(Family_, Prefixlen_, Flags_, Scope_, Index_) { this.$val = this; if (arguments.length === 0) { this.Family = 0; this.Prefixlen = 0; this.Flags = 0; this.Scope = 0; this.Index = 0; return; } this.Family = Family_; this.Prefixlen = Prefixlen_; this.Flags = Flags_; this.Scope = Scope_; this.Index = Index_; }); Utsname = $pkg.Utsname = $newType(0, $kindStruct, "syscall.Utsname", true, "syscall", true, function(Sysname_, Nodename_, Release_, Version_, Machine_, Domainname_) { this.$val = this; if (arguments.length === 0) { this.Sysname = arrayType$24.zero(); this.Nodename = arrayType$24.zero(); this.Release = arrayType$24.zero(); this.Version = arrayType$24.zero(); this.Machine = arrayType$24.zero(); this.Domainname = arrayType$24.zero(); return; } this.Sysname = Sysname_; this.Nodename = Nodename_; this.Release = Release_; this.Version = Version_; this.Machine = Machine_; this.Domainname = Domainname_; }); mmapper = $pkg.mmapper = $newType(0, $kindStruct, "syscall.mmapper", true, "syscall", false, 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", true, "syscall", true, null); Sockaddr = $pkg.Sockaddr = $newType(8, $kindInterface, "syscall.Sockaddr", true, "syscall", true, null); SockaddrInet4 = $pkg.SockaddrInet4 = $newType(0, $kindStruct, "syscall.SockaddrInet4", true, "syscall", true, function(Port_, Addr_, raw_) { this.$val = this; if (arguments.length === 0) { this.Port = 0; this.Addr = arrayType$10.zero(); this.raw = new RawSockaddrInet4.ptr(0, 0, arrayType$10.zero(), arrayType$8.zero()); return; } this.Port = Port_; this.Addr = Addr_; this.raw = raw_; }); SockaddrInet6 = $pkg.SockaddrInet6 = $newType(0, $kindStruct, "syscall.SockaddrInet6", true, "syscall", true, function(Port_, ZoneId_, Addr_, raw_) { this.$val = this; if (arguments.length === 0) { this.Port = 0; this.ZoneId = 0; this.Addr = arrayType$11.zero(); this.raw = new RawSockaddrInet6.ptr(0, 0, 0, arrayType$11.zero(), 0); return; } this.Port = Port_; this.ZoneId = ZoneId_; this.Addr = Addr_; this.raw = raw_; }); SockaddrUnix = $pkg.SockaddrUnix = $newType(0, $kindStruct, "syscall.SockaddrUnix", true, "syscall", true, function(Name_, raw_) { this.$val = this; if (arguments.length === 0) { this.Name = ""; this.raw = new RawSockaddrUnix.ptr(0, arrayType$9.zero()); return; } this.Name = Name_; this.raw = raw_; }); SockaddrLinklayer = $pkg.SockaddrLinklayer = $newType(0, $kindStruct, "syscall.SockaddrLinklayer", true, "syscall", true, function(Protocol_, Ifindex_, Hatype_, Pkttype_, Halen_, Addr_, raw_) { this.$val = this; if (arguments.length === 0) { this.Protocol = 0; this.Ifindex = 0; this.Hatype = 0; this.Pkttype = 0; this.Halen = 0; this.Addr = arrayType$8.zero(); this.raw = new RawSockaddrLinklayer.ptr(0, 0, 0, 0, 0, 0, arrayType$8.zero()); return; } this.Protocol = Protocol_; this.Ifindex = Ifindex_; this.Hatype = Hatype_; this.Pkttype = Pkttype_; this.Halen = Halen_; this.Addr = Addr_; this.raw = raw_; }); SockaddrNetlink = $pkg.SockaddrNetlink = $newType(0, $kindStruct, "syscall.SockaddrNetlink", true, "syscall", true, function(Family_, Pad_, Pid_, Groups_, raw_) { this.$val = this; if (arguments.length === 0) { this.Family = 0; this.Pad = 0; this.Pid = 0; this.Groups = 0; this.raw = new RawSockaddrNetlink.ptr(0, 0, 0, 0); return; } this.Family = Family_; this.Pad = Pad_; this.Pid = Pid_; this.Groups = Groups_; this.raw = raw_; }); NetlinkRouteRequest = $pkg.NetlinkRouteRequest = $newType(0, $kindStruct, "syscall.NetlinkRouteRequest", true, "syscall", true, function(Header_, Data_) { this.$val = this; if (arguments.length === 0) { this.Header = new NlMsghdr.ptr(0, 0, 0, 0, 0); this.Data = new RtGenmsg.ptr(0); return; } this.Header = Header_; this.Data = Data_; }); NetlinkMessage = $pkg.NetlinkMessage = $newType(0, $kindStruct, "syscall.NetlinkMessage", true, "syscall", true, function(Header_, Data_) { this.$val = this; if (arguments.length === 0) { this.Header = new NlMsghdr.ptr(0, 0, 0, 0, 0); this.Data = sliceType.nil; return; } this.Header = Header_; this.Data = Data_; }); NetlinkRouteAttr = $pkg.NetlinkRouteAttr = $newType(0, $kindStruct, "syscall.NetlinkRouteAttr", true, "syscall", true, function(Attr_, Value_) { this.$val = this; if (arguments.length === 0) { this.Attr = new RtAttr.ptr(0, 0); this.Value = sliceType.nil; return; } this.Attr = Attr_; this.Value = Value_; }); RawConn = $pkg.RawConn = $newType(8, $kindInterface, "syscall.RawConn", true, "syscall", true, null); sliceType = $sliceType($Uint8); sliceType$1 = $sliceType($String); ptrType$2 = $ptrType($Uint8); ptrType$3 = $ptrType(sliceType); ptrType$4 = $ptrType($Int64); arrayType = $arrayType($Int8, 14); arrayType$1 = $arrayType($Int8, 96); ptrType$5 = $ptrType(_Socklen); ptrType$6 = $ptrType($Int32); arrayType$3 = $arrayType($Int32, 2); ptrType$7 = $ptrType(Timespec); arrayType$6 = $arrayType(_C_int, 2); ptrType$18 = $ptrType($Uint16); arrayType$8 = $arrayType($Uint8, 8); arrayType$9 = $arrayType($Int8, 108); arrayType$10 = $arrayType($Uint8, 4); arrayType$11 = $arrayType($Uint8, 16); ptrType$19 = $ptrType(Iovec); ptrType$23 = $ptrType(SockaddrNetlink); sliceType$9 = $sliceType(NetlinkMessage); ptrType$24 = $ptrType(NlMsghdr); sliceType$10 = $sliceType(NetlinkRouteAttr); ptrType$25 = $ptrType(RtAttr); ptrType$32 = $ptrType(Msghdr); arrayType$24 = $arrayType($Int8, 65); ptrType$34 = $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$35 = $ptrType(SockaddrInet4); ptrType$36 = $ptrType(SockaddrInet6); ptrType$37 = $ptrType(SockaddrUnix); ptrType$38 = $ptrType(SockaddrLinklayer); ptrType$40 = $ptrType(NetlinkRouteRequest); funcType$2 = $funcType([$Uintptr], [], false); funcType$3 = $funcType([$Uintptr], [$Bool], false); fchmodat = function(dirfd, path, mode) { var _p0, _r, _tuple, _tuple$1, dirfd, e1, err, mode, path, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _p0 = $f._p0; _r = $f._r; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; dirfd = $f.dirfd; e1 = $f.e1; err = $f.err; mode = $f.mode; path = $f.path; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _p0 = ptrType$2.nil; _tuple = BytePtrFromString(path); _p0 = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _r = Syscall(53, ((dirfd >>> 0)), ((_p0)), ((mode >>> 0))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple$1 = _r; e1 = _tuple$1[2]; if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: fchmodat }; } $f._p0 = _p0; $f._r = _r; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.dirfd = dirfd; $f.e1 = e1; $f.err = err; $f.mode = mode; $f.path = path; $f.$s = $s; $f.$r = $r; return $f; }; openat = function(dirfd, path, flags, mode) { var _p0, _r, _tuple, _tuple$1, dirfd, e1, err, fd, flags, mode, path, r0, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _p0 = $f._p0; _r = $f._r; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; dirfd = $f.dirfd; e1 = $f.e1; err = $f.err; fd = $f.fd; flags = $f.flags; mode = $f.mode; path = $f.path; r0 = $f.r0; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = 0; err = $ifaceNil; _p0 = ptrType$2.nil; _tuple = BytePtrFromString(path); _p0 = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [fd, err]; } _r = Syscall6(56, ((dirfd >>> 0)), ((_p0)), ((flags >>> 0)), ((mode >>> 0)), 0, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple$1 = _r; r0 = _tuple$1[0]; e1 = _tuple$1[2]; fd = ((r0 >> 0)); if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return [fd, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: openat }; } $f._p0 = _p0; $f._r = _r; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.dirfd = dirfd; $f.e1 = e1; $f.err = err; $f.fd = fd; $f.flags = flags; $f.mode = mode; $f.path = path; $f.r0 = r0; $f.$s = $s; $f.$r = $r; return $f; }; unlinkat = function(dirfd, path, flags) { var _p0, _r, _tuple, _tuple$1, dirfd, e1, err, flags, path, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _p0 = $f._p0; _r = $f._r; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; dirfd = $f.dirfd; e1 = $f.e1; err = $f.err; flags = $f.flags; path = $f.path; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _p0 = ptrType$2.nil; _tuple = BytePtrFromString(path); _p0 = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _r = Syscall(35, ((dirfd >>> 0)), ((_p0)), ((flags >>> 0))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple$1 = _r; e1 = _tuple$1[2]; if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: unlinkat }; } $f._p0 = _p0; $f._r = _r; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.dirfd = dirfd; $f.e1 = e1; $f.err = err; $f.flags = flags; $f.path = path; $f.$s = $s; $f.$r = $r; return $f; }; Close = function(fd) { var _r, _tuple, e1, err, fd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; e1 = $f.e1; err = $f.err; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _r = Syscall(57, ((fd >>> 0)), 0, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: Close }; } $f._r = _r; $f._tuple = _tuple; $f.e1 = e1; $f.err = err; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Close = Close; Dup = function(oldfd) { var _r, _tuple, e1, err, fd, oldfd, r0, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; e1 = $f.e1; err = $f.err; fd = $f.fd; oldfd = $f.oldfd; r0 = $f.r0; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = 0; err = $ifaceNil; _r = Syscall(23, ((oldfd >>> 0)), 0, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; r0 = _tuple[0]; e1 = _tuple[2]; fd = ((r0 >> 0)); if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return [fd, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Dup }; } $f._r = _r; $f._tuple = _tuple; $f.e1 = e1; $f.err = err; $f.fd = fd; $f.oldfd = oldfd; $f.r0 = r0; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Dup = Dup; Fchdir = function(fd) { var _r, _tuple, e1, err, fd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; e1 = $f.e1; err = $f.err; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _r = Syscall(50, ((fd >>> 0)), 0, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: Fchdir }; } $f._r = _r; $f._tuple = _tuple; $f.e1 = e1; $f.err = err; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Fchdir = Fchdir; Fchmod = function(fd, mode) { var _r, _tuple, e1, err, fd, mode, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; e1 = $f.e1; err = $f.err; fd = $f.fd; mode = $f.mode; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _r = Syscall(52, ((fd >>> 0)), ((mode >>> 0)), 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: Fchmod }; } $f._r = _r; $f._tuple = _tuple; $f.e1 = e1; $f.err = err; $f.fd = fd; $f.mode = mode; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Fchmod = Fchmod; fcntl = function(fd, cmd, arg) { var _r, _tuple, arg, cmd, e1, err, fd, r0, val, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; arg = $f.arg; cmd = $f.cmd; e1 = $f.e1; err = $f.err; fd = $f.fd; r0 = $f.r0; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: val = 0; err = $ifaceNil; _r = Syscall(25, ((fd >>> 0)), ((cmd >>> 0)), ((arg >>> 0))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; r0 = _tuple[0]; e1 = _tuple[2]; val = ((r0 >> 0)); if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return [val, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: fcntl }; } $f._r = _r; $f._tuple = _tuple; $f.arg = arg; $f.cmd = cmd; $f.e1 = e1; $f.err = err; $f.fd = fd; $f.r0 = r0; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; }; Fsync = function(fd) { var _r, _tuple, e1, err, fd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; e1 = $f.e1; err = $f.err; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _r = Syscall(82, ((fd >>> 0)), 0, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: Fsync }; } $f._r = _r; $f._tuple = _tuple; $f.e1 = e1; $f.err = err; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Fsync = Fsync; Getdents = function(fd, buf) { var _p0, _r, _tuple, buf, e1, err, fd, n, r0, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _p0 = $f._p0; _r = $f._r; _tuple = $f._tuple; buf = $f.buf; e1 = $f.e1; err = $f.err; fd = $f.fd; n = $f.n; r0 = $f.r0; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; _p0 = 0; if (buf.$length > 0) { _p0 = ($sliceToNativeArray(buf)); } else { _p0 = (new Uint8Array(0)); } _r = Syscall(61, ((fd >>> 0)), (_p0), ((buf.$length >>> 0))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; r0 = _tuple[0]; e1 = _tuple[2]; n = ((r0 >> 0)); if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Getdents }; } $f._p0 = _p0; $f._r = _r; $f._tuple = _tuple; $f.buf = buf; $f.e1 = e1; $f.err = err; $f.fd = fd; $f.n = n; $f.r0 = r0; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Getdents = Getdents; read = function(fd, p) { var _p0, _r, _tuple, e1, err, fd, n, p, r0, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _p0 = $f._p0; _r = $f._r; _tuple = $f._tuple; e1 = $f.e1; err = $f.err; fd = $f.fd; n = $f.n; p = $f.p; r0 = $f.r0; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; _p0 = 0; if (p.$length > 0) { _p0 = ($sliceToNativeArray(p)); } else { _p0 = (new Uint8Array(0)); } _r = Syscall(63, ((fd >>> 0)), (_p0), ((p.$length >>> 0))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; r0 = _tuple[0]; e1 = _tuple[2]; n = ((r0 >> 0)); if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: read }; } $f._p0 = _p0; $f._r = _r; $f._tuple = _tuple; $f.e1 = e1; $f.err = err; $f.fd = fd; $f.n = n; $f.p = p; $f.r0 = r0; $f.$s = $s; $f.$r = $r; return $f; }; Uname = function(buf) { var _array, _r, _struct, _tuple, _view, buf, e1, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _array = $f._array; _r = $f._r; _struct = $f._struct; _tuple = $f._tuple; _view = $f._view; buf = $f.buf; e1 = $f.e1; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _array = new Uint8Array(390); _r = RawSyscall(160, ((_array)), 0, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _struct = buf, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Sysname = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 0, _array.buffer.byteLength)), _struct.Nodename = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 65, _array.buffer.byteLength)), _struct.Release = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 130, _array.buffer.byteLength)), _struct.Version = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 195, _array.buffer.byteLength)), _struct.Machine = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 260, _array.buffer.byteLength)), _struct.Domainname = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 325, _array.buffer.byteLength)); _tuple = _r; e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: Uname }; } $f._array = _array; $f._r = _r; $f._struct = _struct; $f._tuple = _tuple; $f._view = _view; $f.buf = buf; $f.e1 = e1; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Uname = Uname; write = function(fd, p) { var _p0, _r, _tuple, e1, err, fd, n, p, r0, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _p0 = $f._p0; _r = $f._r; _tuple = $f._tuple; e1 = $f.e1; err = $f.err; fd = $f.fd; n = $f.n; p = $f.p; r0 = $f.r0; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; _p0 = 0; if (p.$length > 0) { _p0 = ($sliceToNativeArray(p)); } else { _p0 = (new Uint8Array(0)); } _r = Syscall(64, ((fd >>> 0)), (_p0), ((p.$length >>> 0))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; r0 = _tuple[0]; e1 = _tuple[2]; n = ((r0 >> 0)); if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: write }; } $f._p0 = _p0; $f._r = _r; $f._tuple = _tuple; $f.e1 = e1; $f.err = err; $f.fd = fd; $f.n = n; $f.p = p; $f.r0 = r0; $f.$s = $s; $f.$r = $r; return $f; }; munmap = function(addr, length) { var _r, _tuple, addr, e1, err, length, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; addr = $f.addr; e1 = $f.e1; err = $f.err; length = $f.length; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _r = Syscall(215, (addr), (length), 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: munmap }; } $f._r = _r; $f._tuple = _tuple; $f.addr = addr; $f.e1 = e1; $f.err = err; $f.length = length; $f.$s = $s; $f.$r = $r; return $f; }; Fchown = function(fd, uid, gid) { var _r, _tuple, e1, err, fd, gid, uid, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; e1 = $f.e1; err = $f.err; fd = $f.fd; gid = $f.gid; uid = $f.uid; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _r = Syscall(55, ((fd >>> 0)), ((uid >>> 0)), ((gid >>> 0))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: Fchown }; } $f._r = _r; $f._tuple = _tuple; $f.e1 = e1; $f.err = err; $f.fd = fd; $f.gid = gid; $f.uid = uid; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Fchown = Fchown; Fstat = function(fd, stat) { var _array, _r, _struct, _tuple, _view, e1, err, fd, stat, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _array = $f._array; _r = $f._r; _struct = $f._struct; _tuple = $f._tuple; _view = $f._view; e1 = $f.e1; err = $f.err; fd = $f.fd; stat = $f.stat; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _array = new Uint8Array(128); _r = Syscall(80, ((fd >>> 0)), ((_array)), 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _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.Mode = _view.getUint32(16, true), _struct.Nlink = _view.getUint32(20, true), _struct.Uid = _view.getUint32(24, true), _struct.Gid = _view.getUint32(28, true), _struct.Rdev = new $Uint64(_view.getUint32(36, true), _view.getUint32(32, true)), _struct.X__pad1 = new $Uint64(_view.getUint32(44, true), _view.getUint32(40, true)), _struct.Size = new $Int64(_view.getUint32(52, true), _view.getUint32(48, true)), _struct.Blksize = _view.getInt32(56, true), _struct.X__pad2 = _view.getInt32(60, 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__glibc_reserved = new ($nativeArray($kindInt32))(_array.buffer, $min(_array.byteOffset + 120, _array.buffer.byteLength)); _tuple = _r; e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: Fstat }; } $f._array = _array; $f._r = _r; $f._struct = _struct; $f._tuple = _tuple; $f._view = _view; $f.e1 = e1; $f.err = err; $f.fd = fd; $f.stat = stat; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Fstat = Fstat; Fstatat = function(fd, path, stat, flags) { var _array, _p0, _r, _struct, _tuple, _tuple$1, _view, e1, err, fd, flags, path, stat, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _array = $f._array; _p0 = $f._p0; _r = $f._r; _struct = $f._struct; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _view = $f._view; e1 = $f.e1; err = $f.err; fd = $f.fd; flags = $f.flags; path = $f.path; stat = $f.stat; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _p0 = ptrType$2.nil; _tuple = BytePtrFromString(path); _p0 = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _array = new Uint8Array(128); _r = Syscall6(79, ((fd >>> 0)), ((_p0)), ((_array)), ((flags >>> 0)), 0, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _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.Mode = _view.getUint32(16, true), _struct.Nlink = _view.getUint32(20, true), _struct.Uid = _view.getUint32(24, true), _struct.Gid = _view.getUint32(28, true), _struct.Rdev = new $Uint64(_view.getUint32(36, true), _view.getUint32(32, true)), _struct.X__pad1 = new $Uint64(_view.getUint32(44, true), _view.getUint32(40, true)), _struct.Size = new $Int64(_view.getUint32(52, true), _view.getUint32(48, true)), _struct.Blksize = _view.getInt32(56, true), _struct.X__pad2 = _view.getInt32(60, 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__glibc_reserved = new ($nativeArray($kindInt32))(_array.buffer, $min(_array.byteOffset + 120, _array.buffer.byteLength)); _tuple$1 = _r; e1 = _tuple$1[2]; if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: Fstatat }; } $f._array = _array; $f._p0 = _p0; $f._r = _r; $f._struct = _struct; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._view = _view; $f.e1 = e1; $f.err = err; $f.fd = fd; $f.flags = flags; $f.path = path; $f.stat = stat; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Fstatat = Fstatat; Ftruncate = function(fd, length) { var _r, _tuple, e1, err, fd, length, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; e1 = $f.e1; err = $f.err; fd = $f.fd; length = $f.length; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _r = Syscall(46, ((fd >>> 0)), ((length.$low >>> 0)), 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: Ftruncate }; } $f._r = _r; $f._tuple = _tuple; $f.e1 = e1; $f.err = err; $f.fd = fd; $f.length = length; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Ftruncate = Ftruncate; Listen = function(s, n) { var _r, _tuple, e1, err, n, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; e1 = $f.e1; err = $f.err; n = $f.n; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _r = Syscall(201, ((s >>> 0)), ((n >>> 0)), 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: Listen }; } $f._r = _r; $f._tuple = _tuple; $f.e1 = e1; $f.err = err; $f.n = n; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Listen = Listen; Pread = function(fd, p, offset) { var _p0, _r, _tuple, e1, err, fd, n, offset, p, r0, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _p0 = $f._p0; _r = $f._r; _tuple = $f._tuple; e1 = $f.e1; err = $f.err; fd = $f.fd; n = $f.n; offset = $f.offset; p = $f.p; r0 = $f.r0; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; _p0 = 0; if (p.$length > 0) { _p0 = ($sliceToNativeArray(p)); } else { _p0 = (new Uint8Array(0)); } _r = Syscall6(67, ((fd >>> 0)), (_p0), ((p.$length >>> 0)), ((offset.$low >>> 0)), 0, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; r0 = _tuple[0]; e1 = _tuple[2]; n = ((r0 >> 0)); if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Pread }; } $f._p0 = _p0; $f._r = _r; $f._tuple = _tuple; $f.e1 = e1; $f.err = err; $f.fd = fd; $f.n = n; $f.offset = offset; $f.p = p; $f.r0 = r0; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Pread = Pread; Pwrite = function(fd, p, offset) { var _p0, _r, _tuple, e1, err, fd, n, offset, p, r0, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _p0 = $f._p0; _r = $f._r; _tuple = $f._tuple; e1 = $f.e1; err = $f.err; fd = $f.fd; n = $f.n; offset = $f.offset; p = $f.p; r0 = $f.r0; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; _p0 = 0; if (p.$length > 0) { _p0 = ($sliceToNativeArray(p)); } else { _p0 = (new Uint8Array(0)); } _r = Syscall6(68, ((fd >>> 0)), (_p0), ((p.$length >>> 0)), ((offset.$low >>> 0)), 0, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; r0 = _tuple[0]; e1 = _tuple[2]; n = ((r0 >> 0)); if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Pwrite }; } $f._p0 = _p0; $f._r = _r; $f._tuple = _tuple; $f.e1 = e1; $f.err = err; $f.fd = fd; $f.n = n; $f.offset = offset; $f.p = p; $f.r0 = r0; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Pwrite = Pwrite; Seek = function(fd, offset, whence) { var _r, _tuple, e1, err, fd, off, offset, r0, whence, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; e1 = $f.e1; err = $f.err; fd = $f.fd; off = $f.off; offset = $f.offset; r0 = $f.r0; whence = $f.whence; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: off = new $Int64(0, 0); err = $ifaceNil; _r = Syscall(62, ((fd >>> 0)), ((offset.$low >>> 0)), ((whence >>> 0))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; r0 = _tuple[0]; e1 = _tuple[2]; off = (new $Int64(0, r0.constructor === Number ? r0 : 1)); if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return [off, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Seek }; } $f._r = _r; $f._tuple = _tuple; $f.e1 = e1; $f.err = err; $f.fd = fd; $f.off = off; $f.offset = offset; $f.r0 = r0; $f.whence = whence; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Seek = Seek; sendfile = function(outfd, infd, offset, count) { var _r, _tuple, count, e1, err, infd, offset, outfd, r0, written, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; count = $f.count; e1 = $f.e1; err = $f.err; infd = $f.infd; offset = $f.offset; outfd = $f.outfd; r0 = $f.r0; written = $f.written; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: written = 0; err = $ifaceNil; _r = Syscall6(71, ((outfd >>> 0)), ((infd >>> 0)), ((offset)), ((count >>> 0)), 0, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; r0 = _tuple[0]; e1 = _tuple[2]; written = ((r0 >> 0)); if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return [written, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: sendfile }; } $f._r = _r; $f._tuple = _tuple; $f.count = count; $f.e1 = e1; $f.err = err; $f.infd = infd; $f.offset = offset; $f.outfd = outfd; $f.r0 = r0; $f.written = written; $f.$s = $s; $f.$r = $r; return $f; }; Shutdown = function(fd, how) { var _r, _tuple, e1, err, fd, how, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; e1 = $f.e1; err = $f.err; fd = $f.fd; how = $f.how; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _r = Syscall(210, ((fd >>> 0)), ((how >>> 0)), 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: Shutdown }; } $f._r = _r; $f._tuple = _tuple; $f.e1 = e1; $f.err = err; $f.fd = fd; $f.how = how; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Shutdown = Shutdown; Splice = function(rfd, roff, wfd, woff, len, flags) { var _r, _tuple, e1, err, flags, len, n, r0, rfd, roff, wfd, woff, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; e1 = $f.e1; err = $f.err; flags = $f.flags; len = $f.len; n = $f.n; r0 = $f.r0; rfd = $f.rfd; roff = $f.roff; wfd = $f.wfd; woff = $f.woff; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = new $Int64(0, 0); err = $ifaceNil; _r = Syscall6(76, ((rfd >>> 0)), ((roff)), ((wfd >>> 0)), ((woff)), ((len >>> 0)), ((flags >>> 0))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; r0 = _tuple[0]; e1 = _tuple[2]; n = (new $Int64(0, r0.constructor === Number ? r0 : 1)); if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Splice }; } $f._r = _r; $f._tuple = _tuple; $f.e1 = e1; $f.err = err; $f.flags = flags; $f.len = len; $f.n = n; $f.r0 = r0; $f.rfd = rfd; $f.roff = roff; $f.wfd = wfd; $f.woff = woff; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Splice = Splice; accept = function(s, rsa, addrlen) { var _array, _r, _struct, _tuple, _view, addrlen, e1, err, fd, r0, rsa, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _array = $f._array; _r = $f._r; _struct = $f._struct; _tuple = $f._tuple; _view = $f._view; addrlen = $f.addrlen; e1 = $f.e1; err = $f.err; fd = $f.fd; r0 = $f.r0; rsa = $f.rsa; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = 0; err = $ifaceNil; _array = new Uint8Array(112); _r = Syscall(202, ((s >>> 0)), ((_array)), ((addrlen))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _struct = rsa, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Addr.Family = _view.getUint16(0, true), _struct.Addr.Data = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 2, _array.buffer.byteLength)), _struct.Pad = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 16, _array.buffer.byteLength)); _tuple = _r; r0 = _tuple[0]; e1 = _tuple[2]; fd = ((r0 >> 0)); if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return [fd, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: accept }; } $f._array = _array; $f._r = _r; $f._struct = _struct; $f._tuple = _tuple; $f._view = _view; $f.addrlen = addrlen; $f.e1 = e1; $f.err = err; $f.fd = fd; $f.r0 = r0; $f.rsa = rsa; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; accept4 = function(s, rsa, addrlen, flags) { var _array, _r, _struct, _tuple, _view, addrlen, e1, err, fd, flags, r0, rsa, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _array = $f._array; _r = $f._r; _struct = $f._struct; _tuple = $f._tuple; _view = $f._view; addrlen = $f.addrlen; e1 = $f.e1; err = $f.err; fd = $f.fd; flags = $f.flags; r0 = $f.r0; rsa = $f.rsa; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = 0; err = $ifaceNil; _array = new Uint8Array(112); _r = Syscall6(242, ((s >>> 0)), ((_array)), ((addrlen)), ((flags >>> 0)), 0, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _struct = rsa, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Addr.Family = _view.getUint16(0, true), _struct.Addr.Data = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 2, _array.buffer.byteLength)), _struct.Pad = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 16, _array.buffer.byteLength)); _tuple = _r; r0 = _tuple[0]; e1 = _tuple[2]; fd = ((r0 >> 0)); if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return [fd, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: accept4 }; } $f._array = _array; $f._r = _r; $f._struct = _struct; $f._tuple = _tuple; $f._view = _view; $f.addrlen = addrlen; $f.e1 = e1; $f.err = err; $f.fd = fd; $f.flags = flags; $f.r0 = r0; $f.rsa = rsa; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; bind = function(s, addr, addrlen) { var _r, _tuple, addr, addrlen, e1, err, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; addr = $f.addr; addrlen = $f.addrlen; e1 = $f.e1; err = $f.err; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _r = Syscall(200, ((s >>> 0)), (addr), ((addrlen >>> 0))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: bind }; } $f._r = _r; $f._tuple = _tuple; $f.addr = addr; $f.addrlen = addrlen; $f.e1 = e1; $f.err = err; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; connect = function(s, addr, addrlen) { var _r, _tuple, addr, addrlen, e1, err, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; addr = $f.addr; addrlen = $f.addrlen; e1 = $f.e1; err = $f.err; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _r = Syscall(203, ((s >>> 0)), (addr), ((addrlen >>> 0))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: connect }; } $f._r = _r; $f._tuple = _tuple; $f.addr = addr; $f.addrlen = addrlen; $f.e1 = e1; $f.err = err; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; getsockopt = function(s, level, name, val, vallen) { var _r, _tuple, e1, err, level, name, s, val, vallen, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; e1 = $f.e1; err = $f.err; level = $f.level; name = $f.name; s = $f.s; val = $f.val; vallen = $f.vallen; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _r = Syscall6(209, ((s >>> 0)), ((level >>> 0)), ((name >>> 0)), (val), ((vallen)), 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: getsockopt }; } $f._r = _r; $f._tuple = _tuple; $f.e1 = e1; $f.err = err; $f.level = level; $f.name = name; $f.s = s; $f.val = val; $f.vallen = vallen; $f.$s = $s; $f.$r = $r; return $f; }; setsockopt = function(s, level, name, val, vallen) { var _r, _tuple, e1, err, level, name, s, val, vallen, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; e1 = $f.e1; err = $f.err; level = $f.level; name = $f.name; s = $f.s; val = $f.val; vallen = $f.vallen; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _r = Syscall6(208, ((s >>> 0)), ((level >>> 0)), ((name >>> 0)), (val), (vallen), 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: setsockopt }; } $f._r = _r; $f._tuple = _tuple; $f.e1 = e1; $f.err = err; $f.level = level; $f.name = name; $f.s = s; $f.val = val; $f.vallen = vallen; $f.$s = $s; $f.$r = $r; return $f; }; socket = function(domain, typ, proto) { var _r, _tuple, domain, e1, err, fd, proto, r0, typ, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; domain = $f.domain; e1 = $f.e1; err = $f.err; fd = $f.fd; proto = $f.proto; r0 = $f.r0; typ = $f.typ; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = 0; err = $ifaceNil; _r = RawSyscall(198, ((domain >>> 0)), ((typ >>> 0)), ((proto >>> 0))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; r0 = _tuple[0]; e1 = _tuple[2]; fd = ((r0 >> 0)); if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return [fd, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: socket }; } $f._r = _r; $f._tuple = _tuple; $f.domain = domain; $f.e1 = e1; $f.err = err; $f.fd = fd; $f.proto = proto; $f.r0 = r0; $f.typ = typ; $f.$s = $s; $f.$r = $r; return $f; }; getpeername = function(fd, rsa, addrlen) { var _array, _r, _struct, _tuple, _view, addrlen, e1, err, fd, rsa, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _array = $f._array; _r = $f._r; _struct = $f._struct; _tuple = $f._tuple; _view = $f._view; addrlen = $f.addrlen; e1 = $f.e1; err = $f.err; fd = $f.fd; rsa = $f.rsa; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _array = new Uint8Array(112); _r = RawSyscall(205, ((fd >>> 0)), ((_array)), ((addrlen))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _struct = rsa, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Addr.Family = _view.getUint16(0, true), _struct.Addr.Data = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 2, _array.buffer.byteLength)), _struct.Pad = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 16, _array.buffer.byteLength)); _tuple = _r; e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: getpeername }; } $f._array = _array; $f._r = _r; $f._struct = _struct; $f._tuple = _tuple; $f._view = _view; $f.addrlen = addrlen; $f.e1 = e1; $f.err = err; $f.fd = fd; $f.rsa = rsa; $f.$s = $s; $f.$r = $r; return $f; }; getsockname = function(fd, rsa, addrlen) { var _array, _r, _struct, _tuple, _view, addrlen, e1, err, fd, rsa, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _array = $f._array; _r = $f._r; _struct = $f._struct; _tuple = $f._tuple; _view = $f._view; addrlen = $f.addrlen; e1 = $f.e1; err = $f.err; fd = $f.fd; rsa = $f.rsa; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _array = new Uint8Array(112); _r = RawSyscall(204, ((fd >>> 0)), ((_array)), ((addrlen))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _struct = rsa, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Addr.Family = _view.getUint16(0, true), _struct.Addr.Data = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 2, _array.buffer.byteLength)), _struct.Pad = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 16, _array.buffer.byteLength)); _tuple = _r; e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: getsockname }; } $f._array = _array; $f._r = _r; $f._struct = _struct; $f._tuple = _tuple; $f._view = _view; $f.addrlen = addrlen; $f.e1 = e1; $f.err = err; $f.fd = fd; $f.rsa = rsa; $f.$s = $s; $f.$r = $r; return $f; }; recvfrom = function(fd, p, flags, from, fromlen) { var _array, _p0, _r, _struct, _tuple, _view, e1, err, fd, flags, from, fromlen, n, p, r0, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _array = $f._array; _p0 = $f._p0; _r = $f._r; _struct = $f._struct; _tuple = $f._tuple; _view = $f._view; e1 = $f.e1; err = $f.err; fd = $f.fd; flags = $f.flags; from = $f.from; fromlen = $f.fromlen; n = $f.n; p = $f.p; r0 = $f.r0; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; _p0 = 0; if (p.$length > 0) { _p0 = ($sliceToNativeArray(p)); } else { _p0 = (new Uint8Array(0)); } _array = new Uint8Array(112); _r = Syscall6(207, ((fd >>> 0)), (_p0), ((p.$length >>> 0)), ((flags >>> 0)), ((_array)), ((fromlen))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _struct = from, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Addr.Family = _view.getUint16(0, true), _struct.Addr.Data = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 2, _array.buffer.byteLength)), _struct.Pad = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 16, _array.buffer.byteLength)); _tuple = _r; r0 = _tuple[0]; e1 = _tuple[2]; n = ((r0 >> 0)); if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: recvfrom }; } $f._array = _array; $f._p0 = _p0; $f._r = _r; $f._struct = _struct; $f._tuple = _tuple; $f._view = _view; $f.e1 = e1; $f.err = err; $f.fd = fd; $f.flags = flags; $f.from = from; $f.fromlen = fromlen; $f.n = n; $f.p = p; $f.r0 = r0; $f.$s = $s; $f.$r = $r; return $f; }; sendto = function(s, buf, flags, to, addrlen) { var _p0, _r, _tuple, addrlen, buf, e1, err, flags, s, to, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _p0 = $f._p0; _r = $f._r; _tuple = $f._tuple; addrlen = $f.addrlen; buf = $f.buf; e1 = $f.e1; err = $f.err; flags = $f.flags; s = $f.s; to = $f.to; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _p0 = 0; if (buf.$length > 0) { _p0 = ($sliceToNativeArray(buf)); } else { _p0 = (new Uint8Array(0)); } _r = Syscall6(206, ((s >>> 0)), (_p0), ((buf.$length >>> 0)), ((flags >>> 0)), (to), ((addrlen >>> 0))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: sendto }; } $f._p0 = _p0; $f._r = _r; $f._tuple = _tuple; $f.addrlen = addrlen; $f.buf = buf; $f.e1 = e1; $f.err = err; $f.flags = flags; $f.s = s; $f.to = to; $f.$s = $s; $f.$r = $r; return $f; }; recvmsg = function(s, msg, flags) { var _array, _r, _struct, _tuple, _view, e1, err, flags, msg, n, r0, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _array = $f._array; _r = $f._r; _struct = $f._struct; _tuple = $f._tuple; _view = $f._view; e1 = $f.e1; err = $f.err; flags = $f.flags; msg = $f.msg; n = $f.n; r0 = $f.r0; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; _array = new Uint8Array(48); _r = Syscall(212, ((s >>> 0)), ((_array)), ((flags >>> 0))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _struct = msg, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Namelen = _view.getUint32(4, true), _struct.Pad_cgo_0 = new ($nativeArray($kindUint8))(_array.buffer, $min(_array.byteOffset + 8, _array.buffer.byteLength)), _struct.Iovlen = new $Uint64(_view.getUint32(20, true), _view.getUint32(16, true)), _struct.Controllen = new $Uint64(_view.getUint32(36, true), _view.getUint32(32, true)), _struct.Flags = _view.getInt32(40, true), _struct.Pad_cgo_1 = new ($nativeArray($kindUint8))(_array.buffer, $min(_array.byteOffset + 44, _array.buffer.byteLength)); _tuple = _r; r0 = _tuple[0]; e1 = _tuple[2]; n = ((r0 >> 0)); if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: recvmsg }; } $f._array = _array; $f._r = _r; $f._struct = _struct; $f._tuple = _tuple; $f._view = _view; $f.e1 = e1; $f.err = err; $f.flags = flags; $f.msg = msg; $f.n = n; $f.r0 = r0; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; sendmsg = function(s, msg, flags) { var _array, _r, _struct, _tuple, _view, e1, err, flags, msg, n, r0, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _array = $f._array; _r = $f._r; _struct = $f._struct; _tuple = $f._tuple; _view = $f._view; e1 = $f.e1; err = $f.err; flags = $f.flags; msg = $f.msg; n = $f.n; r0 = $f.r0; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; _array = new Uint8Array(48); _r = Syscall(211, ((s >>> 0)), ((_array)), ((flags >>> 0))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _struct = msg, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Namelen = _view.getUint32(4, true), _struct.Pad_cgo_0 = new ($nativeArray($kindUint8))(_array.buffer, $min(_array.byteOffset + 8, _array.buffer.byteLength)), _struct.Iovlen = new $Uint64(_view.getUint32(20, true), _view.getUint32(16, true)), _struct.Controllen = new $Uint64(_view.getUint32(36, true), _view.getUint32(32, true)), _struct.Flags = _view.getInt32(40, true), _struct.Pad_cgo_1 = new ($nativeArray($kindUint8))(_array.buffer, $min(_array.byteOffset + 44, _array.buffer.byteLength)); _tuple = _r; r0 = _tuple[0]; e1 = _tuple[2]; n = ((r0 >> 0)); if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: sendmsg }; } $f._array = _array; $f._r = _r; $f._struct = _struct; $f._tuple = _tuple; $f._view = _view; $f.e1 = e1; $f.err = err; $f.flags = flags; $f.msg = msg; $f.n = n; $f.r0 = r0; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; mmap = function(addr, length, prot, flags, fd, offset) { var _r, _tuple, addr, e1, err, fd, flags, length, offset, prot, r0, xaddr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; addr = $f.addr; e1 = $f.e1; err = $f.err; fd = $f.fd; flags = $f.flags; length = $f.length; offset = $f.offset; prot = $f.prot; r0 = $f.r0; xaddr = $f.xaddr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: xaddr = 0; err = $ifaceNil; _r = Syscall6(222, (addr), (length), ((prot >>> 0)), ((flags >>> 0)), ((fd >>> 0)), ((offset.$low >>> 0))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; r0 = _tuple[0]; e1 = _tuple[2]; xaddr = (r0); if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return [xaddr, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: mmap }; } $f._r = _r; $f._tuple = _tuple; $f.addr = addr; $f.e1 = e1; $f.err = err; $f.fd = fd; $f.flags = flags; $f.length = length; $f.offset = offset; $f.prot = prot; $f.r0 = r0; $f.xaddr = xaddr; $f.$s = $s; $f.$r = $r; return $f; }; pipe2 = function(p, flags) { var _r, _tuple, e1, err, flags, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; e1 = $f.e1; err = $f.err; flags = $f.flags; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _r = RawSyscall(59, ((p)), ((flags >>> 0)), 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: pipe2 }; } $f._r = _r; $f._tuple = _tuple; $f.e1 = e1; $f.err = err; $f.flags = flags; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; faketimeWrite = function(fd, p) { var fd, p; $panic(new $String("not implemented")); }; mmapper.ptr.prototype.Mmap = function(fd, offset, length, prot, flags) { var $24r, $24r$1, $24r$2, _array, _key, _r, _struct, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, _view, addr, b, data, err, errno, fd, flags, hdr, length, m, offset, p, prot, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _array = $f._array; _key = $f._key; _r = $f._r; _struct = $f._struct; _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; _view = $f._view; addr = $f.addr; b = $f.b; data = $f.data; err = $f.err; errno = $f.errno; fd = $f.fd; flags = $f.flags; hdr = $f.hdr; length = $f.length; m = $f.m; offset = $f.offset; p = $f.p; prot = $f.prot; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); b = [b]; data = sliceType.nil; err = $ifaceNil; m = this; /* */ if (length <= 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (length <= 0) { */ case 1: _tmp = sliceType.nil; _tmp$1 = new Errno(22); data = _tmp; err = _tmp$1; $24r = [data, err]; $s = 3; case 3: return $24r; /* } */ case 2: _r = m.mmap(0, ((length >>> 0)), prot, flags, fd, offset); /* */ $s = 4; case 4: 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))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(errno, $ifaceNil))) { */ case 5: _tmp$2 = sliceType.nil; _tmp$3 = errno; data = _tmp$2; err = _tmp$3; $24r$1 = [data, err]; $s = 7; case 7: return $24r$1; /* } */ case 6: b[0] = sliceType.nil; hdr = ((_array = ((b.$ptr || (b.$ptr = new ptrType$3(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, b)))), _struct = new unsafeheader.Slice.ptr(0, 0, 0), _view = new DataView(_array.buffer, _array.byteOffset), _struct.Len = _view.getInt(4, true), _struct.Cap = _view.getInt(8, true), _struct)); hdr.Data = (addr); hdr.Cap = length; hdr.Len = length; p = $indexPtr(b[0].$array, b[0].$offset + (b[0].$capacity - 1 >> 0), ptrType$2); $r = m.Mutex.Lock(); /* */ $s = 8; case 8: 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[0] }; _tmp$4 = b[0]; _tmp$5 = $ifaceNil; data = _tmp$4; err = _tmp$5; $24r$2 = [data, err]; $s = 9; case 9: return $24r$2; /* */ } 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.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._array = _array; $f._key = _key; $f._r = _r; $f._struct = _struct; $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._view = _view; $f.addr = addr; $f.b = b; $f.data = data; $f.err = err; $f.errno = errno; $f.fd = fd; $f.flags = flags; $f.hdr = hdr; $f.length = length; $f.m = m; $f.offset = offset; $f.p = p; $f.prot = prot; $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 $24r, $24r$1, $24r$2, $24r$3, _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; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; _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 = []; $curGoroutine.deferStack.push($deferred); err = $ifaceNil; m = this; /* */ if ((data.$length === 0) || !((data.$length === data.$capacity))) { $s = 1; continue; } /* */ $s = 2; continue; /* if ((data.$length === 0) || !((data.$length === data.$capacity))) { */ case 1: err = new Errno(22); $24r = err; $s = 3; case 3: return $24r; /* } */ case 2: p = $indexPtr(data.$array, data.$offset + (data.$capacity - 1 >> 0), ptrType$2); $r = m.Mutex.Lock(); /* */ $s = 4; case 4: 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))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (b === sliceType.nil || !($indexPtr(b.$array, b.$offset + 0, ptrType$2) === $indexPtr(data.$array, data.$offset + 0, ptrType$2))) { */ case 5: err = new Errno(22); $24r$1 = err; $s = 7; case 7: return $24r$1; /* } */ case 6: _r = m.munmap((($sliceToNativeArray(b))), ((b.$length >>> 0))); /* */ $s = 8; case 8: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } errno = _r; /* */ if (!($interfaceIsEqual(errno, $ifaceNil))) { $s = 9; continue; } /* */ $s = 10; continue; /* if (!($interfaceIsEqual(errno, $ifaceNil))) { */ case 9: err = errno; $24r$2 = err; $s = 11; case 11: return $24r$2; /* } */ case 10: delete m.active[ptrType$2.keyFor(p)]; err = $ifaceNil; $24r$3 = err; $s = 12; case 12: return $24r$3; /* */ } 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.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $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 e, s; e = this.$val; if (0 <= ((e >> 0)) && ((e >> 0)) < 134) { s = ((e < 0 || e >= errors$1.length) ? ($throwRuntimeError("index out of range"), undefined) : errors$1[e]); if (!(s === "")) { return s; } } return "errno " + itoa.Itoa(((e >> 0))); }; $ptrType(Errno).prototype.Error = function() { return new Errno(this.$get()).Error(); }; Errno.prototype.Is = function(target) { var _1, e, target; e = this.$val; _1 = target; if ($interfaceIsEqual(_1, (oserror.ErrPermission))) { return (e === 13) || (e === 1); } else if ($interfaceIsEqual(_1, (oserror.ErrExist))) { return (e === 17) || (e === 39); } else if ($interfaceIsEqual(_1, (oserror.ErrNotExist))) { return e === 2; } return false; }; $ptrType(Errno).prototype.Is = function(target) { return new Errno(this.$get()).Is(target); }; Errno.prototype.Temporary = function() { var e; e = this.$val; return (e === 4) || (e === 24) || (e === 23) || new Errno(e).Timeout(); }; $ptrType(Errno).prototype.Temporary = function() { return new Errno(this.$get()).Temporary(); }; Errno.prototype.Timeout = function() { var 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 _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 _r, _tuple, err, fd, n, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; fd = $f.fd; n = $f.n; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; _r = read(fd, p); /* */ $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]; if (false) { if (n > 0) { race.WriteRange(($sliceToNativeArray(p)), n); } if ($interfaceIsEqual(err, $ifaceNil)) { race.Acquire(((ioSync$24ptr || (ioSync$24ptr = new ptrType$4(function() { return ioSync; }, function($v) { ioSync = $v; }))))); } } if (false && n > 0) { msanWrite(($sliceToNativeArray(p)), n); } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Read }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.fd = fd; $f.n = n; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Read = Read; Write = function(fd, p) { var _r, _tmp, _tmp$1, _tuple, err, fd, n, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; err = $f.err; fd = $f.fd; n = $f.n; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; if (false) { race.ReleaseMerge(((ioSync$24ptr || (ioSync$24ptr = new ptrType$4(function() { return ioSync; }, function($v) { ioSync = $v; }))))); } /* */ if (false && ((fd === 1) || (fd === 2))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (false && ((fd === 1) || (fd === 2))) { */ case 1: n = faketimeWrite(fd, p); if (n < 0) { _tmp = 0; _tmp$1 = errnoErr(((-n >>> 0))); n = _tmp; err = _tmp$1; } $s = 3; continue; /* } else { */ case 2: _r = write(fd, p); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; err = _tuple[1]; /* } */ case 3: if (false && n > 0) { race.ReadRange(($sliceToNativeArray(p)), n); } if (false && n > 0) { msanRead(($sliceToNativeArray(p)), n); } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Write }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.err = err; $f.fd = fd; $f.n = n; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Write = Write; Bind = function(fd, sa) { var $24r, _r, _r$1, _tuple, err, fd, n, ptr, sa, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; fd = $f.fd; n = $f.n; ptr = $f.ptr; sa = $f.sa; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _r = sa.sockaddr(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; ptr = _tuple[0]; n = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { err = err; $s = -1; return err; } _r$1 = bind(fd, ptr, n); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err = _r$1; $24r = err; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Bind }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.fd = fd; $f.n = n; $f.ptr = ptr; $f.sa = sa; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Bind = Bind; Connect = function(fd, sa) { var $24r, _r, _r$1, _tuple, err, fd, n, ptr, sa, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; fd = $f.fd; n = $f.n; ptr = $f.ptr; sa = $f.sa; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _r = sa.sockaddr(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; ptr = _tuple[0]; n = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { err = err; $s = -1; return err; } _r$1 = connect(fd, ptr, n); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err = _r$1; $24r = err; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Connect }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.fd = fd; $f.n = n; $f.ptr = ptr; $f.sa = sa; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Connect = Connect; Getpeername = function(fd) { var _r, _tuple, err, fd, len, rsa, sa, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; fd = $f.fd; len = $f.len; rsa = $f.rsa; sa = $f.sa; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: len = [len]; rsa = [rsa]; sa = $ifaceNil; err = $ifaceNil; rsa[0] = new RawSockaddrAny.ptr(new RawSockaddr.ptr(0, arrayType.zero()), arrayType$1.zero()); len[0] = 112; _r = getpeername(fd, rsa[0], (len.$ptr || (len.$ptr = new ptrType$5(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, len)))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sa, err]; } _tuple = anyToSockaddr(rsa[0]); sa = _tuple[0]; err = _tuple[1]; $s = -1; return [sa, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Getpeername }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.fd = fd; $f.len = len; $f.rsa = rsa; $f.sa = sa; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Getpeername = Getpeername; GetsockoptInt = function(fd, level, opt) { var _r, _tmp, _tmp$1, err, fd, level, n, opt, vallen, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; err = $f.err; fd = $f.fd; level = $f.level; n = $f.n; opt = $f.opt; vallen = $f.vallen; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = [n]; vallen = [vallen]; value = 0; err = $ifaceNil; n[0] = 0; vallen[0] = 4; _r = getsockopt(fd, level, opt, ((n.$ptr || (n.$ptr = new ptrType$6(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, n)))), (vallen.$ptr || (vallen.$ptr = new ptrType$5(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, vallen)))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; _tmp = ((n[0] >> 0)); _tmp$1 = err; value = _tmp; err = _tmp$1; $s = -1; return [value, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: GetsockoptInt }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.err = err; $f.fd = fd; $f.level = level; $f.n = n; $f.opt = opt; $f.vallen = vallen; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.GetsockoptInt = GetsockoptInt; Recvfrom = function(fd, p, flags) { var _r, _tuple, _tuple$1, err, fd, flags, from, len, n, p, rsa, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; err = $f.err; fd = $f.fd; flags = $f.flags; from = $f.from; len = $f.len; n = $f.n; p = $f.p; rsa = $f.rsa; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: len = [len]; rsa = [rsa]; n = 0; from = $ifaceNil; err = $ifaceNil; rsa[0] = new RawSockaddrAny.ptr(new RawSockaddr.ptr(0, arrayType.zero()), arrayType$1.zero()); len[0] = 112; _r = recvfrom(fd, p, flags, rsa[0], (len.$ptr || (len.$ptr = new ptrType$5(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, len)))); /* */ $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]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [n, from, err]; } if (!((rsa[0].Addr.Family === 0))) { _tuple$1 = anyToSockaddr(rsa[0]); from = _tuple$1[0]; err = _tuple$1[1]; } $s = -1; return [n, from, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Recvfrom }; } $f._r = _r; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.err = err; $f.fd = fd; $f.flags = flags; $f.from = from; $f.len = len; $f.n = n; $f.p = p; $f.rsa = rsa; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Recvfrom = Recvfrom; Sendto = function(fd, p, flags, to) { var $24r, _r, _r$1, _tuple, err, fd, flags, n, p, ptr, to, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; fd = $f.fd; flags = $f.flags; n = $f.n; p = $f.p; ptr = $f.ptr; to = $f.to; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _r = to.sockaddr(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; ptr = _tuple[0]; n = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { err = err; $s = -1; return err; } _r$1 = sendto(fd, p, flags, ptr, n); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err = _r$1; $24r = err; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Sendto }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.fd = fd; $f.flags = flags; $f.n = n; $f.p = p; $f.ptr = ptr; $f.to = to; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Sendto = Sendto; SetsockoptByte = function(fd, level, opt, value) { var $24r, _r, err, fd, level, opt, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; err = $f.err; fd = $f.fd; level = $f.level; opt = $f.opt; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: value = [value]; err = $ifaceNil; _r = setsockopt(fd, level, opt, ((value.$ptr || (value.$ptr = new ptrType$2(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, value)))), 1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; $24r = err; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: SetsockoptByte }; } $f.$24r = $24r; $f._r = _r; $f.err = err; $f.fd = fd; $f.level = level; $f.opt = opt; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.SetsockoptByte = SetsockoptByte; SetsockoptInt = function(fd, level, opt, value) { var $24r, _r, err, fd, level, n, opt, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; err = $f.err; fd = $f.fd; level = $f.level; n = $f.n; opt = $f.opt; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = [n]; err = $ifaceNil; n[0] = ((value >> 0)); _r = setsockopt(fd, level, opt, ((n.$ptr || (n.$ptr = new ptrType$6(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, n)))), 4); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; $24r = err; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: SetsockoptInt }; } $f.$24r = $24r; $f._r = _r; $f.err = err; $f.fd = fd; $f.level = level; $f.n = n; $f.opt = opt; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.SetsockoptInt = SetsockoptInt; SetsockoptInet4Addr = function(fd, level, opt, value) { var $24r, _r, err, fd, level, opt, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; err = $f.err; fd = $f.fd; level = $f.level; opt = $f.opt; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _r = setsockopt(fd, level, opt, ($sliceToNativeArray(new sliceType(value))), 4); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; $24r = err; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: SetsockoptInet4Addr }; } $f.$24r = $24r; $f._r = _r; $f.err = err; $f.fd = fd; $f.level = level; $f.opt = opt; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.SetsockoptInet4Addr = SetsockoptInet4Addr; SetsockoptIPMreq = function(fd, level, opt, mreq) { var $24r, _array, _r, _struct, _view, err, fd, level, mreq, opt, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _array = $f._array; _r = $f._r; _struct = $f._struct; _view = $f._view; err = $f.err; fd = $f.fd; level = $f.level; mreq = $f.mreq; opt = $f.opt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _array = new Uint8Array(8); _r = setsockopt(fd, level, opt, (_array), 8); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _struct = mreq, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Multiaddr = new ($nativeArray($kindUint8))(_array.buffer, $min(_array.byteOffset + 0, _array.buffer.byteLength)), _struct.Interface = new ($nativeArray($kindUint8))(_array.buffer, $min(_array.byteOffset + 4, _array.buffer.byteLength)); err = _r; $24r = err; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: SetsockoptIPMreq }; } $f.$24r = $24r; $f._array = _array; $f._r = _r; $f._struct = _struct; $f._view = _view; $f.err = err; $f.fd = fd; $f.level = level; $f.mreq = mreq; $f.opt = opt; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.SetsockoptIPMreq = SetsockoptIPMreq; SetsockoptIPv6Mreq = function(fd, level, opt, mreq) { var $24r, _array, _r, _struct, _view, err, fd, level, mreq, opt, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _array = $f._array; _r = $f._r; _struct = $f._struct; _view = $f._view; err = $f.err; fd = $f.fd; level = $f.level; mreq = $f.mreq; opt = $f.opt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _array = new Uint8Array(20); _r = setsockopt(fd, level, opt, (_array), 20); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _struct = mreq, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Multiaddr = new ($nativeArray($kindUint8))(_array.buffer, $min(_array.byteOffset + 0, _array.buffer.byteLength)), _struct.Interface = _view.getUint32(16, true); err = _r; $24r = err; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: SetsockoptIPv6Mreq }; } $f.$24r = $24r; $f._array = _array; $f._r = _r; $f._struct = _struct; $f._view = _view; $f.err = err; $f.fd = fd; $f.level = level; $f.mreq = mreq; $f.opt = opt; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.SetsockoptIPv6Mreq = SetsockoptIPv6Mreq; SetsockoptLinger = function(fd, level, opt, l) { var $24r, _array, _r, _struct, _view, err, fd, l, level, opt, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _array = $f._array; _r = $f._r; _struct = $f._struct; _view = $f._view; err = $f.err; fd = $f.fd; l = $f.l; level = $f.level; opt = $f.opt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _array = new Uint8Array(8); _r = setsockopt(fd, level, opt, (_array), 8); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _struct = l, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Onoff = _view.getInt32(0, true), _struct.Linger = _view.getInt32(4, true); err = _r; $24r = err; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: SetsockoptLinger }; } $f.$24r = $24r; $f._array = _array; $f._r = _r; $f._struct = _struct; $f._view = _view; $f.err = err; $f.fd = fd; $f.l = l; $f.level = level; $f.opt = opt; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.SetsockoptLinger = SetsockoptLinger; Socket = function(domain, typ, proto) { var _r, _tmp, _tmp$1, _tuple, domain, err, fd, proto, typ, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; domain = $f.domain; err = $f.err; fd = $f.fd; proto = $f.proto; typ = $f.typ; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = 0; err = $ifaceNil; if ((domain === 10) && $pkg.SocketDisableIPv6) { _tmp = -1; _tmp$1 = new Errno(97); fd = _tmp; err = _tmp$1; $s = -1; return [fd, err]; } _r = socket(domain, typ, proto); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; fd = _tuple[0]; err = _tuple[1]; $s = -1; return [fd, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Socket }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.domain = domain; $f.err = err; $f.fd = fd; $f.proto = proto; $f.typ = typ; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Socket = Socket; Sendfile = function(outfd, infd, offset, count) { var $24r, _r, _tuple, count, err, infd, offset, outfd, written, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _tuple = $f._tuple; count = $f.count; err = $f.err; infd = $f.infd; offset = $f.offset; outfd = $f.outfd; written = $f.written; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: written = 0; err = $ifaceNil; if (false) { race.ReleaseMerge(((ioSync$24ptr || (ioSync$24ptr = new ptrType$4(function() { return ioSync; }, function($v) { ioSync = $v; }))))); } _r = sendfile(outfd, infd, offset, count); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; written = _tuple[0]; err = _tuple[1]; $24r = [written, err]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Sendfile }; } $f.$24r = $24r; $f._r = _r; $f._tuple = _tuple; $f.count = count; $f.err = err; $f.infd = infd; $f.offset = offset; $f.outfd = outfd; $f.written = written; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Sendfile = Sendfile; Stat = function(path, stat) { var $24r, _r, err, path, stat, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; err = $f.err; path = $f.path; stat = $f.stat; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _r = Fstatat(-100, path, stat, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; $24r = err; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Stat }; } $f.$24r = $24r; $f._r = _r; $f.err = err; $f.path = path; $f.stat = stat; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Stat = Stat; Lstat = function(path, stat) { var $24r, _r, err, path, stat, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; err = $f.err; path = $f.path; stat = $f.stat; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _r = Fstatat(-100, path, stat, 256); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; $24r = err; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Lstat }; } $f.$24r = $24r; $f._r = _r; $f.err = err; $f.path = path; $f.stat = stat; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Lstat = Lstat; Pipe2 = function(p, flags) { var _r, err, flags, p, pp, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; err = $f.err; flags = $f.flags; p = $f.p; pp = $f.pp; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: pp = [pp]; err = $ifaceNil; if (!((p.$length === 2))) { err = new Errno(22); $s = -1; return err; } pp[0] = arrayType$6.zero(); _r = pipe2(pp[0], flags); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; (0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0] = ((pp[0][0] >> 0))); (1 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 1] = ((pp[0][1] >> 0))); $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: Pipe2 }; } $f._r = _r; $f.err = err; $f.flags = flags; $f.p = p; $f.pp = pp; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Pipe2 = Pipe2; Iovec.ptr.prototype.SetLen = function(length) { var iov, length; iov = this; iov.Len = (new $Uint64(0, length)); }; Iovec.prototype.SetLen = function(length) { return this.$val.SetLen(length); }; Msghdr.ptr.prototype.SetControllen = function(length) { var length, msghdr; msghdr = this; msghdr.Controllen = (new $Uint64(0, length)); }; Msghdr.prototype.SetControllen = function(length) { return this.$val.SetControllen(length); }; Chmod = function(path, mode) { var $24r, _r, err, mode, path, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; err = $f.err; mode = $f.mode; path = $f.path; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _r = Fchmodat(-100, path, mode, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; $24r = err; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Chmod }; } $f.$24r = $24r; $f._r = _r; $f.err = err; $f.mode = mode; $f.path = path; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Chmod = Chmod; Fchmodat = function(dirfd, path, mode, flags) { var $24r, _r, dirfd, err, flags, mode, path, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; dirfd = $f.dirfd; err = $f.err; flags = $f.flags; mode = $f.mode; path = $f.path; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; if (!((((flags & ~256) >> 0) === 0))) { err = new Errno(22); $s = -1; return err; } else if (!(((flags & 256) === 0))) { err = new Errno(95); $s = -1; return err; } _r = fchmodat(dirfd, path, mode); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; $24r = err; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Fchmodat }; } $f.$24r = $24r; $f._r = _r; $f.dirfd = dirfd; $f.err = err; $f.flags = flags; $f.mode = mode; $f.path = path; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Fchmodat = Fchmodat; Open = function(path, mode, perm) { var $24r, _r, _tuple, err, fd, mode, path, perm, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _tuple = $f._tuple; err = $f.err; fd = $f.fd; mode = $f.mode; path = $f.path; perm = $f.perm; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = 0; err = $ifaceNil; _r = openat(-100, path, mode | 0, perm); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; fd = _tuple[0]; err = _tuple[1]; $24r = [fd, err]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Open }; } $f.$24r = $24r; $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.fd = fd; $f.mode = mode; $f.path = path; $f.perm = perm; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Open = Open; Rmdir = function(path) { var $24r, _r, path, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; path = $f.path; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = unlinkat(-100, path, 512); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Rmdir }; } $f.$24r = $24r; $f._r = _r; $f.path = path; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Rmdir = Rmdir; Unlink = function(path) { var $24r, _r, path, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; path = $f.path; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = unlinkat(-100, path, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Unlink }; } $f.$24r = $24r; $f._r = _r; $f.path = path; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Unlink = Unlink; SockaddrInet4.ptr.prototype.sockaddr = function() { var _array, _struct, _view, i, p, sa, x, x$1, x$2; sa = this; if (sa.Port < 0 || sa.Port > 65535) { return [0, 0, new Errno(22)]; } sa.raw.Family = 2; p = (((x = sa.raw, (x.$ptr_Port || (x.$ptr_Port = new ptrType$18(function() { return this.$target.Port; }, function($v) { this.$target.Port = $v; }, x)))))); p.nilCheck, p[0] = (((sa.Port >> 8 >> 0) << 24 >>> 24)); p.nilCheck, p[1] = ((sa.Port << 24 >>> 24)); i = 0; while (true) { if (!(i < 4)) { break; } (x$2 = sa.raw.Addr, ((i < 0 || i >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i] = (x$1 = sa.Addr, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i])))); i = i + (1) >> 0; } _array = new Uint8Array(16); return [(_array), 16, $ifaceNil]; }; SockaddrInet4.prototype.sockaddr = function() { return this.$val.sockaddr(); }; SockaddrInet6.ptr.prototype.sockaddr = function() { var _array, _struct, _view, i, p, sa, x, x$1, x$2; sa = this; if (sa.Port < 0 || sa.Port > 65535) { return [0, 0, new Errno(22)]; } sa.raw.Family = 10; p = (((x = sa.raw, (x.$ptr_Port || (x.$ptr_Port = new ptrType$18(function() { return this.$target.Port; }, function($v) { this.$target.Port = $v; }, x)))))); p.nilCheck, p[0] = (((sa.Port >> 8 >> 0) << 24 >>> 24)); p.nilCheck, p[1] = ((sa.Port << 24 >>> 24)); sa.raw.Scope_id = sa.ZoneId; i = 0; while (true) { if (!(i < 16)) { break; } (x$2 = sa.raw.Addr, ((i < 0 || i >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i] = (x$1 = sa.Addr, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i])))); i = i + (1) >> 0; } _array = new Uint8Array(28); return [(_array), 28, $ifaceNil]; }; SockaddrInet6.prototype.sockaddr = function() { return this.$val.sockaddr(); }; SockaddrUnix.ptr.prototype.sockaddr = function() { var _array, _struct, _view, i, n, name, sa, sl, x; sa = this; name = sa.Name; n = name.length; if (n > 108) { return [0, 0, new Errno(22)]; } if ((n === 108) && !((name.charCodeAt(0) === 64))) { return [0, 0, new Errno(22)]; } sa.raw.Family = 1; i = 0; while (true) { if (!(i < n)) { break; } (x = sa.raw.Path, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i] = ((name.charCodeAt(i) << 24 >> 24)))); i = i + (1) >> 0; } sl = 2; if (n > 0) { sl = sl + ((((n >>> 0)) + 1 >>> 0)) >>> 0; } if (sa.raw.Path[0] === 64) { sa.raw.Path[0] = 0; sl = sl - (1) >>> 0; } _array = new Uint8Array(110); return [(_array), sl, $ifaceNil]; }; SockaddrUnix.prototype.sockaddr = function() { return this.$val.sockaddr(); }; SockaddrLinklayer.ptr.prototype.sockaddr = function() { var _array, _struct, _view, i, sa, x, x$1; sa = this; if (sa.Ifindex < 0 || sa.Ifindex > 2147483647) { return [0, 0, new Errno(22)]; } sa.raw.Family = 17; sa.raw.Protocol = sa.Protocol; sa.raw.Ifindex = ((sa.Ifindex >> 0)); sa.raw.Hatype = sa.Hatype; sa.raw.Pkttype = sa.Pkttype; sa.raw.Halen = sa.Halen; i = 0; while (true) { if (!(i < 8)) { break; } (x$1 = sa.raw.Addr, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i] = (x = sa.Addr, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i])))); i = i + (1) >> 0; } _array = new Uint8Array(20); return [(_array), 20, $ifaceNil]; }; SockaddrLinklayer.prototype.sockaddr = function() { return this.$val.sockaddr(); }; SockaddrNetlink.ptr.prototype.sockaddr = function() { var _array, _struct, _view, sa; sa = this; sa.raw.Family = 16; sa.raw.Pad = sa.Pad; sa.raw.Pid = sa.Pid; sa.raw.Groups = sa.Groups; _array = new Uint8Array(12); return [(_array), 12, $ifaceNil]; }; SockaddrNetlink.prototype.sockaddr = function() { return this.$val.sockaddr(); }; anyToSockaddr = function(rsa) { var _1, _array, _array$1, _array$2, _array$3, _array$4, _array$5, _array$6, _array$7, _array$8, _array$9, _struct, _struct$1, _struct$2, _struct$3, _struct$4, _struct$5, _struct$6, _struct$7, _struct$8, _struct$9, _view, _view$1, _view$2, _view$3, _view$4, _view$5, _view$6, _view$7, _view$8, _view$9, bytes, i, i$1, i$2, n, p, p$1, pp, pp$1, pp$2, pp$3, pp$4, rsa, sa, sa$1, sa$2, sa$3, sa$4, x, x$1, x$2, x$3, x$4, x$5, x$6; _1 = rsa.Addr.Family; if (_1 === (16)) { _array$1 = new Uint8Array(112); pp = ((_array = (_array$1), _struct = new RawSockaddrNetlink.ptr(0, 0, 0, 0), _view = new DataView(_array.buffer, _array.byteOffset), _struct.Family = _view.getUint16(0, true), _struct.Pad = _view.getUint16(2, true), _struct.Pid = _view.getUint32(4, true), _struct.Groups = _view.getUint32(8, true), _struct)); _struct$1 = rsa, _view$1 = new DataView(_array$1.buffer, _array$1.byteOffset), _struct$1.Addr.Family = _view$1.getUint16(0, true), _struct$1.Addr.Data = new ($nativeArray($kindInt8))(_array$1.buffer, $min(_array$1.byteOffset + 2, _array$1.buffer.byteLength)), _struct$1.Pad = new ($nativeArray($kindInt8))(_array$1.buffer, $min(_array$1.byteOffset + 16, _array$1.buffer.byteLength)); sa = new SockaddrNetlink.ptr(0, 0, 0, 0, new RawSockaddrNetlink.ptr(0, 0, 0, 0)); sa.Family = pp.Family; sa.Pad = pp.Pad; sa.Pid = pp.Pid; sa.Groups = pp.Groups; return [sa, $ifaceNil]; } else if (_1 === (17)) { _array$3 = new Uint8Array(112); pp$1 = ((_array$2 = (_array$3), _struct$2 = new RawSockaddrLinklayer.ptr(0, 0, 0, 0, 0, 0, arrayType$8.zero()), _view$2 = new DataView(_array$2.buffer, _array$2.byteOffset), _struct$2.Family = _view$2.getUint16(0, true), _struct$2.Protocol = _view$2.getUint16(2, true), _struct$2.Ifindex = _view$2.getInt32(4, true), _struct$2.Hatype = _view$2.getUint16(8, true), _struct$2.Pkttype = _view$2.getUint8(10, true), _struct$2.Halen = _view$2.getUint8(11, true), _struct$2.Addr = new ($nativeArray($kindUint8))(_array$2.buffer, $min(_array$2.byteOffset + 12, _array$2.buffer.byteLength)), _struct$2)); _struct$3 = rsa, _view$3 = new DataView(_array$3.buffer, _array$3.byteOffset), _struct$3.Addr.Family = _view$3.getUint16(0, true), _struct$3.Addr.Data = new ($nativeArray($kindInt8))(_array$3.buffer, $min(_array$3.byteOffset + 2, _array$3.buffer.byteLength)), _struct$3.Pad = new ($nativeArray($kindInt8))(_array$3.buffer, $min(_array$3.byteOffset + 16, _array$3.buffer.byteLength)); sa$1 = new SockaddrLinklayer.ptr(0, 0, 0, 0, 0, arrayType$8.zero(), new RawSockaddrLinklayer.ptr(0, 0, 0, 0, 0, 0, arrayType$8.zero())); sa$1.Protocol = pp$1.Protocol; sa$1.Ifindex = ((pp$1.Ifindex >> 0)); sa$1.Hatype = pp$1.Hatype; sa$1.Pkttype = pp$1.Pkttype; sa$1.Halen = pp$1.Halen; i = 0; while (true) { if (!(i < 8)) { break; } (x$1 = sa$1.Addr, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i] = (x = pp$1.Addr, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i])))); i = i + (1) >> 0; } return [sa$1, $ifaceNil]; } else if (_1 === (1)) { _array$5 = new Uint8Array(112); pp$2 = ((_array$4 = (_array$5), _struct$4 = new RawSockaddrUnix.ptr(0, arrayType$9.zero()), _view$4 = new DataView(_array$4.buffer, _array$4.byteOffset), _struct$4.Family = _view$4.getUint16(0, true), _struct$4.Path = new ($nativeArray($kindInt8))(_array$4.buffer, $min(_array$4.byteOffset + 2, _array$4.buffer.byteLength)), _struct$4)); _struct$5 = rsa, _view$5 = new DataView(_array$5.buffer, _array$5.byteOffset), _struct$5.Addr.Family = _view$5.getUint16(0, true), _struct$5.Addr.Data = new ($nativeArray($kindInt8))(_array$5.buffer, $min(_array$5.byteOffset + 2, _array$5.buffer.byteLength)), _struct$5.Pad = new ($nativeArray($kindInt8))(_array$5.buffer, $min(_array$5.byteOffset + 16, _array$5.buffer.byteLength)); sa$2 = new SockaddrUnix.ptr("", new RawSockaddrUnix.ptr(0, arrayType$9.zero())); if (pp$2.Path[0] === 0) { pp$2.Path[0] = 64; } n = 0; while (true) { if (!(n < 108 && !(((x$2 = pp$2.Path, ((n < 0 || n >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[n])) === 0)))) { break; } n = n + (1) >> 0; } bytes = $subslice(new sliceType((($sliceToNativeArray(new sliceType(pp$2.Path))))), 0, n); sa$2.Name = ($bytesToString(bytes)); return [sa$2, $ifaceNil]; } else if (_1 === (2)) { _array$7 = new Uint8Array(112); pp$3 = ((_array$6 = (_array$7), _struct$6 = new RawSockaddrInet4.ptr(0, 0, arrayType$10.zero(), arrayType$8.zero()), _view$6 = new DataView(_array$6.buffer, _array$6.byteOffset), _struct$6.Family = _view$6.getUint16(0, true), _struct$6.Port = _view$6.getUint16(2, true), _struct$6.Addr = new ($nativeArray($kindUint8))(_array$6.buffer, $min(_array$6.byteOffset + 4, _array$6.buffer.byteLength)), _struct$6.Zero = new ($nativeArray($kindUint8))(_array$6.buffer, $min(_array$6.byteOffset + 8, _array$6.buffer.byteLength)), _struct$6)); _struct$7 = rsa, _view$7 = new DataView(_array$7.buffer, _array$7.byteOffset), _struct$7.Addr.Family = _view$7.getUint16(0, true), _struct$7.Addr.Data = new ($nativeArray($kindInt8))(_array$7.buffer, $min(_array$7.byteOffset + 2, _array$7.buffer.byteLength)), _struct$7.Pad = new ($nativeArray($kindInt8))(_array$7.buffer, $min(_array$7.byteOffset + 16, _array$7.buffer.byteLength)); sa$3 = new SockaddrInet4.ptr(0, arrayType$10.zero(), new RawSockaddrInet4.ptr(0, 0, arrayType$10.zero(), arrayType$8.zero())); p = (((pp$3.$ptr_Port || (pp$3.$ptr_Port = new ptrType$18(function() { return this.$target.Port; }, function($v) { this.$target.Port = $v; }, pp$3))))); sa$3.Port = (((p[0] >> 0)) << 8 >> 0) + ((p[1] >> 0)) >> 0; i$1 = 0; while (true) { if (!(i$1 < 4)) { break; } (x$4 = sa$3.Addr, ((i$1 < 0 || i$1 >= x$4.length) ? ($throwRuntimeError("index out of range"), undefined) : x$4[i$1] = (x$3 = pp$3.Addr, ((i$1 < 0 || i$1 >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[i$1])))); i$1 = i$1 + (1) >> 0; } return [sa$3, $ifaceNil]; } else if (_1 === (10)) { _array$9 = new Uint8Array(112); pp$4 = ((_array$8 = (_array$9), _struct$8 = new RawSockaddrInet6.ptr(0, 0, 0, arrayType$11.zero(), 0), _view$8 = new DataView(_array$8.buffer, _array$8.byteOffset), _struct$8.Family = _view$8.getUint16(0, true), _struct$8.Port = _view$8.getUint16(2, true), _struct$8.Flowinfo = _view$8.getUint32(4, true), _struct$8.Addr = new ($nativeArray($kindUint8))(_array$8.buffer, $min(_array$8.byteOffset + 8, _array$8.buffer.byteLength)), _struct$8.Scope_id = _view$8.getUint32(24, true), _struct$8)); _struct$9 = rsa, _view$9 = new DataView(_array$9.buffer, _array$9.byteOffset), _struct$9.Addr.Family = _view$9.getUint16(0, true), _struct$9.Addr.Data = new ($nativeArray($kindInt8))(_array$9.buffer, $min(_array$9.byteOffset + 2, _array$9.buffer.byteLength)), _struct$9.Pad = new ($nativeArray($kindInt8))(_array$9.buffer, $min(_array$9.byteOffset + 16, _array$9.buffer.byteLength)); sa$4 = new SockaddrInet6.ptr(0, 0, arrayType$11.zero(), new RawSockaddrInet6.ptr(0, 0, 0, arrayType$11.zero(), 0)); p$1 = (((pp$4.$ptr_Port || (pp$4.$ptr_Port = new ptrType$18(function() { return this.$target.Port; }, function($v) { this.$target.Port = $v; }, pp$4))))); sa$4.Port = (((p$1[0] >> 0)) << 8 >> 0) + ((p$1[1] >> 0)) >> 0; sa$4.ZoneId = pp$4.Scope_id; i$2 = 0; while (true) { if (!(i$2 < 16)) { break; } (x$6 = sa$4.Addr, ((i$2 < 0 || i$2 >= x$6.length) ? ($throwRuntimeError("index out of range"), undefined) : x$6[i$2] = (x$5 = pp$4.Addr, ((i$2 < 0 || i$2 >= x$5.length) ? ($throwRuntimeError("index out of range"), undefined) : x$5[i$2])))); i$2 = i$2 + (1) >> 0; } return [sa$4, $ifaceNil]; } return [$ifaceNil, new Errno(97)]; }; Accept = function(fd) { var _r, _r$1, _r$2, _tuple, _tuple$1, _tuple$2, err, fd, len, nfd, rsa, sa, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; err = $f.err; fd = $f.fd; len = $f.len; nfd = $f.nfd; rsa = $f.rsa; sa = $f.sa; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: len = [len]; rsa = [rsa]; nfd = 0; sa = $ifaceNil; err = $ifaceNil; rsa[0] = new RawSockaddrAny.ptr(new RawSockaddr.ptr(0, arrayType.zero()), arrayType$1.zero()); len[0] = 112; _r = accept4(fd, rsa[0], (len.$ptr || (len.$ptr = new ptrType$5(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, len))), 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; nfd = _tuple[0]; err = _tuple[1]; /* */ if ($interfaceIsEqual(err, new Errno(38))) { $s = 2; continue; } /* */ $s = 3; continue; /* if ($interfaceIsEqual(err, new Errno(38))) { */ case 2: _r$1 = accept(fd, rsa[0], (len.$ptr || (len.$ptr = new ptrType$5(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, len)))); /* */ $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; nfd = _tuple$1[0]; err = _tuple$1[1]; /* } */ case 3: if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [nfd, sa, err]; } _tuple$2 = anyToSockaddr(rsa[0]); sa = _tuple$2[0]; err = _tuple$2[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 5: _r$2 = Close(nfd); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; nfd = 0; /* } */ case 6: $s = -1; return [nfd, sa, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Accept }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.err = err; $f.fd = fd; $f.len = len; $f.nfd = nfd; $f.rsa = rsa; $f.sa = sa; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Accept = Accept; Accept4 = function(fd, flags) { var _r, _r$1, _tuple, _tuple$1, err, fd, flags, len, nfd, rsa, sa, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; err = $f.err; fd = $f.fd; flags = $f.flags; len = $f.len; nfd = $f.nfd; rsa = $f.rsa; sa = $f.sa; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: len = [len]; rsa = [rsa]; nfd = 0; sa = $ifaceNil; err = $ifaceNil; rsa[0] = new RawSockaddrAny.ptr(new RawSockaddr.ptr(0, arrayType.zero()), arrayType$1.zero()); len[0] = 112; _r = accept4(fd, rsa[0], (len.$ptr || (len.$ptr = new ptrType$5(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, len))), flags); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; nfd = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [nfd, sa, err]; } if (len[0] > 112) { $panic(new $String("RawSockaddrAny too small")); } _tuple$1 = anyToSockaddr(rsa[0]); sa = _tuple$1[0]; err = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: _r$1 = Close(nfd); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; nfd = 0; /* } */ case 3: $s = -1; return [nfd, sa, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Accept4 }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.err = err; $f.fd = fd; $f.flags = flags; $f.len = len; $f.nfd = nfd; $f.rsa = rsa; $f.sa = sa; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Accept4 = Accept4; Getsockname = function(fd) { var _r, _tuple, err, fd, len, rsa, sa, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; fd = $f.fd; len = $f.len; rsa = $f.rsa; sa = $f.sa; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: len = [len]; rsa = [rsa]; sa = $ifaceNil; err = $ifaceNil; rsa[0] = new RawSockaddrAny.ptr(new RawSockaddr.ptr(0, arrayType.zero()), arrayType$1.zero()); len[0] = 112; _r = getsockname(fd, rsa[0], (len.$ptr || (len.$ptr = new ptrType$5(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, len)))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sa, err]; } _tuple = anyToSockaddr(rsa[0]); sa = _tuple[0]; err = _tuple[1]; $s = -1; return [sa, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Getsockname }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.fd = fd; $f.len = len; $f.rsa = rsa; $f.sa = sa; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Getsockname = Getsockname; SetsockoptIPMreqn = function(fd, level, opt, mreq) { var $24r, _array, _r, _struct, _view, err, fd, level, mreq, opt, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _array = $f._array; _r = $f._r; _struct = $f._struct; _view = $f._view; err = $f.err; fd = $f.fd; level = $f.level; mreq = $f.mreq; opt = $f.opt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _array = new Uint8Array(12); _r = setsockopt(fd, level, opt, (_array), 12); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _struct = mreq, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Multiaddr = new ($nativeArray($kindUint8))(_array.buffer, $min(_array.byteOffset + 0, _array.buffer.byteLength)), _struct.Address = new ($nativeArray($kindUint8))(_array.buffer, $min(_array.byteOffset + 4, _array.buffer.byteLength)), _struct.Ifindex = _view.getInt32(8, true); err = _r; $24r = err; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: SetsockoptIPMreqn }; } $f.$24r = $24r; $f._array = _array; $f._r = _r; $f._struct = _struct; $f._view = _view; $f.err = err; $f.fd = fd; $f.level = level; $f.mreq = mreq; $f.opt = opt; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.SetsockoptIPMreqn = SetsockoptIPMreqn; Recvmsg = function(fd, p, oob, flags) { var _array, _r, _r$1, _struct, _tuple, _tuple$1, _tuple$2, _view, dummy, err, fd, flags, from, iov, msg, n, oob, oobn, p, recvflags, rsa, sockType, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _array = $f._array; _r = $f._r; _r$1 = $f._r$1; _struct = $f._struct; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _view = $f._view; dummy = $f.dummy; err = $f.err; fd = $f.fd; flags = $f.flags; from = $f.from; iov = $f.iov; msg = $f.msg; n = $f.n; oob = $f.oob; oobn = $f.oobn; p = $f.p; recvflags = $f.recvflags; rsa = $f.rsa; sockType = $f.sockType; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: dummy = [dummy]; iov = [iov]; msg = [msg]; rsa = [rsa]; n = 0; oobn = 0; recvflags = 0; from = $ifaceNil; err = $ifaceNil; msg[0] = new Msghdr.ptr(ptrType$2.nil, 0, arrayType$10.zero(), ptrType$19.nil, new $Uint64(0, 0), ptrType$2.nil, new $Uint64(0, 0), 0, arrayType$10.zero()); rsa[0] = new RawSockaddrAny.ptr(new RawSockaddr.ptr(0, arrayType.zero()), arrayType$1.zero()); _array = new Uint8Array(112); msg[0].Name = ((_array)); _struct = rsa[0], _view = new DataView(_array.buffer, _array.byteOffset), _struct.Addr.Family = _view.getUint16(0, true), _struct.Addr.Data = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 2, _array.buffer.byteLength)), _struct.Pad = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 16, _array.buffer.byteLength)); msg[0].Namelen = 112; iov[0] = new Iovec.ptr(ptrType$2.nil, new $Uint64(0, 0)); if (p.$length > 0) { iov[0].Base = $indexPtr(p.$array, p.$offset + 0, ptrType$2); iov[0].SetLen(p.$length); } dummy[0] = 0; /* */ if (oob.$length > 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (oob.$length > 0) { */ case 1: /* */ if (p.$length === 0) { $s = 3; continue; } /* */ $s = 4; continue; /* if (p.$length === 0) { */ case 3: sockType = 0; _r = GetsockoptInt(fd, 1, 3); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; sockType = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [n, oobn, recvflags, from, err]; } if (!((sockType === 2))) { iov[0].Base = (dummy.$ptr || (dummy.$ptr = new ptrType$2(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, dummy))); iov[0].SetLen(1); } /* } */ case 4: msg[0].Control = $indexPtr(oob.$array, oob.$offset + 0, ptrType$2); msg[0].SetControllen(oob.$length); /* } */ case 2: msg[0].Iov = iov[0]; msg[0].Iovlen = new $Uint64(0, 1); _r$1 = recvmsg(fd, msg[0], flags); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; n = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [n, oobn, recvflags, from, err]; } oobn = ((msg[0].Controllen.$low >> 0)); recvflags = ((msg[0].Flags >> 0)); if (!((rsa[0].Addr.Family === 0))) { _tuple$2 = anyToSockaddr(rsa[0]); from = _tuple$2[0]; err = _tuple$2[1]; } $s = -1; return [n, oobn, recvflags, from, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Recvmsg }; } $f._array = _array; $f._r = _r; $f._r$1 = _r$1; $f._struct = _struct; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._view = _view; $f.dummy = dummy; $f.err = err; $f.fd = fd; $f.flags = flags; $f.from = from; $f.iov = iov; $f.msg = msg; $f.n = n; $f.oob = oob; $f.oobn = oobn; $f.p = p; $f.recvflags = recvflags; $f.rsa = rsa; $f.sockType = sockType; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Recvmsg = Recvmsg; SendmsgN = function(fd, p, oob, to, flags) { var _r, _r$1, _r$2, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, _tuple$1, _tuple$2, dummy, err, err$1, fd, flags, iov, msg, n, oob, p, ptr, salen, sockType, to, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; dummy = $f.dummy; err = $f.err; err$1 = $f.err$1; fd = $f.fd; flags = $f.flags; iov = $f.iov; msg = $f.msg; n = $f.n; oob = $f.oob; p = $f.p; ptr = $f.ptr; salen = $f.salen; sockType = $f.sockType; to = $f.to; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: dummy = [dummy]; iov = [iov]; msg = [msg]; n = 0; err = $ifaceNil; ptr = 0; salen = 0; /* */ if (!($interfaceIsEqual(to, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(to, $ifaceNil))) { */ case 1: err$1 = $ifaceNil; _r = to.sockaddr(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; ptr = _tuple[0]; salen = _tuple[1]; err$1 = _tuple[2]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { _tmp = 0; _tmp$1 = err$1; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } /* } */ case 2: msg[0] = new Msghdr.ptr(ptrType$2.nil, 0, arrayType$10.zero(), ptrType$19.nil, new $Uint64(0, 0), ptrType$2.nil, new $Uint64(0, 0), 0, arrayType$10.zero()); msg[0].Name = (ptr); msg[0].Namelen = ((salen >>> 0)); iov[0] = new Iovec.ptr(ptrType$2.nil, new $Uint64(0, 0)); if (p.$length > 0) { iov[0].Base = $indexPtr(p.$array, p.$offset + 0, ptrType$2); iov[0].SetLen(p.$length); } dummy[0] = 0; /* */ if (oob.$length > 0) { $s = 4; continue; } /* */ $s = 5; continue; /* if (oob.$length > 0) { */ case 4: /* */ if (p.$length === 0) { $s = 6; continue; } /* */ $s = 7; continue; /* if (p.$length === 0) { */ case 6: sockType = 0; _r$1 = GetsockoptInt(fd, 1, 3); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; sockType = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$2 = 0; _tmp$3 = err; n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; } if (!((sockType === 2))) { iov[0].Base = (dummy.$ptr || (dummy.$ptr = new ptrType$2(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, dummy))); iov[0].SetLen(1); } /* } */ case 7: msg[0].Control = $indexPtr(oob.$array, oob.$offset + 0, ptrType$2); msg[0].SetControllen(oob.$length); /* } */ case 5: msg[0].Iov = iov[0]; msg[0].Iovlen = new $Uint64(0, 1); _r$2 = sendmsg(fd, msg[0], flags); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$2 = _r$2; n = _tuple$2[0]; err = _tuple$2[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$4 = 0; _tmp$5 = err; n = _tmp$4; err = _tmp$5; $s = -1; return [n, err]; } if (oob.$length > 0 && (p.$length === 0)) { n = 0; } _tmp$6 = n; _tmp$7 = $ifaceNil; n = _tmp$6; err = _tmp$7; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: SendmsgN }; } $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._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.dummy = dummy; $f.err = err; $f.err$1 = err$1; $f.fd = fd; $f.flags = flags; $f.iov = iov; $f.msg = msg; $f.n = n; $f.oob = oob; $f.p = p; $f.ptr = ptr; $f.salen = salen; $f.sockType = sockType; $f.to = to; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.SendmsgN = SendmsgN; ReadDirent = function(fd, buf) { var $24r, _r, _tuple, buf, err, fd, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _tuple = $f._tuple; buf = $f.buf; err = $f.err; fd = $f.fd; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; _r = Getdents(fd, buf); /* */ $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]; $24r = [n, err]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: ReadDirent }; } $f.$24r = $24r; $f._r = _r; $f._tuple = _tuple; $f.buf = buf; $f.err = err; $f.fd = fd; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.ReadDirent = ReadDirent; Timespec.ptr.prototype.Unix = function() { var _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 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(); }; Getpagesize = function() { $throwRuntimeError("native function not implemented: syscall.Getpagesize"); }; $pkg.Getpagesize = Getpagesize; cloexecSocket = function(family, sotype, proto) { var _1, _r, _r$1, _r$2, _tuple, _tuple$1, err, family, proto, s, sotype, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; err = $f.err; family = $f.family; proto = $f.proto; s = $f.s; sotype = $f.sotype; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = Socket(family, sotype | 524288, proto); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; s = _tuple[0]; err = _tuple[1]; _1 = err; if ($interfaceIsEqual(_1, $ifaceNil)) { $s = -1; return [s, $ifaceNil]; } else if ($interfaceIsEqual(_1, new Errno((22)))) { } else { $s = -1; return [-1, err]; } $r = $pkg.ForkLock.RLock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = Socket(family, sotype, proto); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; s = _tuple$1[0]; err = _tuple$1[1]; /* */ if ($interfaceIsEqual(err, $ifaceNil)) { $s = 4; continue; } /* */ $s = 5; continue; /* if ($interfaceIsEqual(err, $ifaceNil)) { */ case 4: $r = CloseOnExec(s); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: $r = $pkg.ForkLock.RUnlock(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 8: _r$2 = Close(s); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; $s = -1; return [-1, err]; /* } */ case 9: $s = -1; return [s, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: cloexecSocket }; } $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.err = err; $f.family = family; $f.proto = proto; $f.s = s; $f.sotype = sotype; $f.$s = $s; $f.$r = $r; return $f; }; nlmAlignOf = function(msglen) { var msglen; return (((msglen + 4 >> 0) - 1 >> 0)) & -4; }; rtaAlignOf = function(attrlen) { var attrlen; return (((attrlen + 4 >> 0) - 1 >> 0)) & -4; }; NetlinkRouteRequest.ptr.prototype.toWireFormat = function() { var b, rr; rr = this; b = $makeSlice(sliceType, rr.Header.Len); (($sliceToNativeArray($subslice(b, 0, 4)))).$set(rr.Header.Len); (($sliceToNativeArray($subslice(b, 4, 6)))).$set(rr.Header.Type); (($sliceToNativeArray($subslice(b, 6, 8)))).$set(rr.Header.Flags); (($sliceToNativeArray($subslice(b, 8, 12)))).$set(rr.Header.Seq); (($sliceToNativeArray($subslice(b, 12, 16)))).$set(rr.Header.Pid); (16 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 16] = (rr.Data.Family)); return b; }; NetlinkRouteRequest.prototype.toWireFormat = function() { return this.$val.toWireFormat(); }; newNetlinkRouteRequest = function(proto, seq, family) { var family, proto, rr, seq; rr = new NetlinkRouteRequest.ptr(new NlMsghdr.ptr(0, 0, 0, 0, 0), new RtGenmsg.ptr(0)); rr.Header.Len = 17; rr.Header.Type = ((proto << 16 >>> 16)); rr.Header.Flags = 769; rr.Header.Seq = ((seq >>> 0)); rr.Data.Family = ((family << 24 >>> 24)); return rr.toWireFormat(); }; NetlinkRIB = function(proto, family) { var $24r, $24r$1, $24r$10, $24r$2, $24r$3, $24r$4, $24r$5, $24r$6, $24r$7, $24r$8, $24r$9, _i, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _ref, _ref$1, _tuple, _tuple$1, _tuple$2, _tuple$3, err, err$1, err$2, err$3, err$4, family, lsa, lsa$1, m, msgs, nr, proto, rb, rbNew, s, tab, v, v$1, wb, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$10 = $f.$24r$10; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; $24r$6 = $f.$24r$6; $24r$7 = $f.$24r$7; $24r$8 = $f.$24r$8; $24r$9 = $f.$24r$9; _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; _ref = $f._ref; _ref$1 = $f._ref$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; err$4 = $f.err$4; family = $f.family; lsa = $f.lsa; lsa$1 = $f.lsa$1; m = $f.m; msgs = $f.msgs; nr = $f.nr; proto = $f.proto; rb = $f.rb; rbNew = $f.rbNew; s = $f.s; tab = $f.tab; v = $f.v; v$1 = $f.v$1; wb = $f.wb; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); _r = cloexecSocket(16, 3, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; s = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $24r = [sliceType.nil, err]; $s = 4; case 4: return $24r; /* } */ case 3: $deferred.push([Close, [s]]); lsa = new SockaddrNetlink.ptr(16, 0, 0, 0, new RawSockaddrNetlink.ptr(0, 0, 0, 0)); _r$1 = Bind(s, lsa); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err$1 = _r$1; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 6: $24r$1 = [sliceType.nil, err$1]; $s = 8; case 8: return $24r$1; /* } */ case 7: wb = newNetlinkRouteRequest(proto, 1, family); _r$2 = Sendto(s, wb, 0, lsa); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } err$2 = _r$2; /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 10; continue; } /* */ $s = 11; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 10: $24r$2 = [sliceType.nil, err$2]; $s = 12; case 12: return $24r$2; /* } */ case 11: tab = sliceType.nil; _r$3 = Getpagesize(); /* */ $s = 13; case 13: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } rbNew = $makeSlice(sliceType, _r$3); /* while (true) { */ case 14: rb = rbNew; _r$4 = Recvfrom(s, rb, 0); /* */ $s = 16; case 16: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$1 = _r$4; nr = _tuple$1[0]; err$3 = _tuple$1[2]; /* */ if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = 17; continue; } /* */ $s = 18; continue; /* if (!($interfaceIsEqual(err$3, $ifaceNil))) { */ case 17: $24r$3 = [sliceType.nil, err$3]; $s = 19; case 19: return $24r$3; /* } */ case 18: /* */ if (nr < 16) { $s = 20; continue; } /* */ $s = 21; continue; /* if (nr < 16) { */ case 20: $24r$4 = [sliceType.nil, new Errno(22)]; $s = 22; case 22: return $24r$4; /* } */ case 21: rb = $subslice(rb, 0, nr); tab = $appendSlice(tab, rb); _tuple$2 = ParseNetlinkMessage(rb); msgs = _tuple$2[0]; err$3 = _tuple$2[1]; /* */ if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = 23; continue; } /* */ $s = 24; continue; /* if (!($interfaceIsEqual(err$3, $ifaceNil))) { */ case 23: $24r$5 = [sliceType.nil, err$3]; $s = 25; case 25: return $24r$5; /* } */ case 24: _ref = msgs; _i = 0; /* while (true) { */ case 26: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 27; continue; } m = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), NetlinkMessage); _r$5 = Getsockname(s); /* */ $s = 28; case 28: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$3 = _r$5; lsa$1 = _tuple$3[0]; err$4 = _tuple$3[1]; /* */ if (!($interfaceIsEqual(err$4, $ifaceNil))) { $s = 29; continue; } /* */ $s = 30; continue; /* if (!($interfaceIsEqual(err$4, $ifaceNil))) { */ case 29: $24r$6 = [sliceType.nil, err$4]; $s = 31; case 31: return $24r$6; /* } */ case 30: _ref$1 = lsa$1; /* */ if ($assertType(_ref$1, ptrType$23, true)[1]) { $s = 32; continue; } /* */ $s = 33; continue; /* if ($assertType(_ref$1, ptrType$23, true)[1]) { */ case 32: v = _ref$1.$val; /* */ if (!((m.Header.Seq === 1)) || !((m.Header.Pid === v.Pid))) { $s = 35; continue; } /* */ $s = 36; continue; /* if (!((m.Header.Seq === 1)) || !((m.Header.Pid === v.Pid))) { */ case 35: $24r$7 = [sliceType.nil, new Errno(22)]; $s = 37; case 37: return $24r$7; /* } */ case 36: $s = 34; continue; /* } else { */ case 33: v$1 = _ref$1; $24r$8 = [sliceType.nil, new Errno(22)]; $s = 38; case 38: return $24r$8; /* } */ case 34: if (m.Header.Type === 3) { /* break done; */ $s = 15; continue s; } /* */ if (m.Header.Type === 2) { $s = 39; continue; } /* */ $s = 40; continue; /* if (m.Header.Type === 2) { */ case 39: $24r$9 = [sliceType.nil, new Errno(22)]; $s = 41; case 41: return $24r$9; /* } */ case 40: _i++; $s = 26; continue; case 27: $s = 14; continue; case 15: $24r$10 = [tab, $ifaceNil]; $s = 42; case 42: return $24r$10; /* */ } return; } } catch(err) { $err = err; $s = -1; return [sliceType.nil, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: NetlinkRIB }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$10 = $24r$10; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f.$24r$6 = $24r$6; $f.$24r$7 = $24r$7; $f.$24r$8 = $24r$8; $f.$24r$9 = $24r$9; $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._ref = _ref; $f._ref$1 = _ref$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.err$4 = err$4; $f.family = family; $f.lsa = lsa; $f.lsa$1 = lsa$1; $f.m = m; $f.msgs = msgs; $f.nr = nr; $f.proto = proto; $f.rb = rb; $f.rbNew = rbNew; $f.s = s; $f.tab = tab; $f.v = v; $f.v$1 = v$1; $f.wb = wb; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; $pkg.NetlinkRIB = NetlinkRIB; ParseNetlinkMessage = function(b) { var _tuple, b, dbuf, dlen, err, h, m, msgs; msgs = sliceType$9.nil; while (true) { if (!(b.$length >= 16)) { break; } _tuple = netlinkMessageHeaderAndData(b); h = _tuple[0]; dbuf = _tuple[1]; dlen = _tuple[2]; err = _tuple[3]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [sliceType$9.nil, err]; } m = new NetlinkMessage.ptr($clone(h, NlMsghdr), $subslice(dbuf, 0, (((h.Len >> 0)) - 16 >> 0))); msgs = $append(msgs, m); b = $subslice(b, dlen); } return [msgs, $ifaceNil]; }; $pkg.ParseNetlinkMessage = ParseNetlinkMessage; netlinkMessageHeaderAndData = function(b) { var _array, _struct, _view, b, h, l; h = ((_array = ($sliceToNativeArray(b)), _struct = new NlMsghdr.ptr(0, 0, 0, 0, 0), _view = new DataView(_array.buffer, _array.byteOffset), _struct.Len = _view.getUint32(0, true), _struct.Type = _view.getUint16(4, true), _struct.Flags = _view.getUint16(6, true), _struct.Seq = _view.getUint32(8, true), _struct.Pid = _view.getUint32(12, true), _struct)); l = nlmAlignOf(((h.Len >> 0))); if (((h.Len >> 0)) < 16 || l > b.$length) { return [ptrType$24.nil, sliceType.nil, 0, new Errno(22)]; } return [h, $subslice(b, 16), l, $ifaceNil]; }; ParseNetlinkRouteAttr = function(m) { var _1, _tuple, a, alen, attrs, b, err, m, ra, vbuf; b = sliceType.nil; _1 = m.Header.Type; if ((_1 === (16)) || (_1 === (17))) { b = $subslice(m.Data, 16); } else if ((_1 === (20)) || (_1 === (21))) { b = $subslice(m.Data, 8); } else if ((_1 === (24)) || (_1 === (25))) { b = $subslice(m.Data, 12); } else { return [sliceType$10.nil, new Errno(22)]; } attrs = sliceType$10.nil; while (true) { if (!(b.$length >= 4)) { break; } _tuple = netlinkRouteAttrAndValue(b); a = _tuple[0]; vbuf = _tuple[1]; alen = _tuple[2]; err = _tuple[3]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [sliceType$10.nil, err]; } ra = new NetlinkRouteAttr.ptr($clone(a, RtAttr), $subslice(vbuf, 0, (((a.Len >> 0)) - 4 >> 0))); attrs = $append(attrs, ra); b = $subslice(b, alen); } return [attrs, $ifaceNil]; }; $pkg.ParseNetlinkRouteAttr = ParseNetlinkRouteAttr; netlinkRouteAttrAndValue = function(b) { var _array, _struct, _view, a, b; a = ((_array = ($sliceToNativeArray(b)), _struct = new RtAttr.ptr(0, 0), _view = new DataView(_array.buffer, _array.byteOffset), _struct.Len = _view.getUint16(0, true), _struct.Type = _view.getUint16(2, true), _struct)); if (((a.Len >> 0)) < 4 || ((a.Len >> 0)) > b.$length) { return [ptrType$25.nil, sliceType.nil, 0, new Errno(22)]; } return [a, $subslice(b, 4), rtaAlignOf(((a.Len >> 0))), $ifaceNil]; }; msanRead = function(addr, len) { var addr, len; }; msanWrite = function(addr, len) { var addr, len; }; runtime_envs = function() { var 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"), undefined) : envs$1.$array[envs$1.$offset + i] = key + "=" + $internalize(jsEnv[$externalize(key, $String)], $String)); i = i + (1) >> 0; } return envs$1; }; syscallByName = function(name) { var $24r, $24r$1, name, require, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; name = $f.name; require = $f.require; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); $deferred.push([(function() { $recover(); }), []]); /* */ if (syscallModule === null) { $s = 1; continue; } /* */ $s = 2; continue; /* if (syscallModule === null) { */ case 1: /* */ if (alreadyTriedToLoad) { $s = 3; continue; } /* */ $s = 4; continue; /* if (alreadyTriedToLoad) { */ case 3: $24r = null; $s = 5; case 5: return $24r; /* } */ case 4: alreadyTriedToLoad = true; require = $global.require; if (require === undefined) { $panic(new $String("")); } syscallModule = require($externalize("syscall", $String)); /* } */ case 2: $24r$1 = syscallModule[$externalize(name, $String)]; $s = 6; case 6: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return null; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: syscallByName }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.name = name; $f.require = require; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Syscall = function(trap, a1, a2, a3) { var _r, _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, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tmp$8 = $f._tmp$8; a1 = $f.a1; a2 = $f.a2; a3 = $f.a3; array = $f.array; err = $f.err; f = $f.f; r = $f.r; r1 = $f.r1; r2 = $f.r2; slice = $f.slice; trap = $f.trap; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r1 = 0; r2 = 0; err = 0; _r = syscallByName("Syscall"); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } f = _r; 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; $s = -1; return [r1, r2, err]; } if ((trap === 64) && ((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; $s = -1; return [r1, r2, err]; } if (trap === 94) { runtime.Goexit(); } printWarning(); _tmp$6 = ((minusOne >>> 0)); _tmp$7 = 0; _tmp$8 = 13; r1 = _tmp$6; r2 = _tmp$7; err = _tmp$8; $s = -1; return [r1, r2, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Syscall }; } $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._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f._tmp$8 = _tmp$8; $f.a1 = a1; $f.a2 = a2; $f.a3 = a3; $f.array = array; $f.err = err; $f.f = f; $f.r = r; $f.r1 = r1; $f.r2 = r2; $f.slice = slice; $f.trap = trap; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Syscall = Syscall; Syscall6 = function(trap, a1, a2, a3, a4, a5, a6) { var _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, a1, a2, a3, a4, a5, a6, err, f, r, r1, r2, trap, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; a1 = $f.a1; a2 = $f.a2; a3 = $f.a3; a4 = $f.a4; a5 = $f.a5; a6 = $f.a6; err = $f.err; f = $f.f; r = $f.r; r1 = $f.r1; r2 = $f.r2; trap = $f.trap; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r1 = 0; r2 = 0; err = 0; _r = syscallByName("Syscall6"); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } f = _r; 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; $s = -1; 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; $s = -1; return [r1, r2, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Syscall6 }; } $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.a1 = a1; $f.a2 = a2; $f.a3 = a3; $f.a4 = a4; $f.a5 = a5; $f.a6 = a6; $f.err = err; $f.f = f; $f.r = r; $f.r1 = r1; $f.r2 = r2; $f.trap = trap; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Syscall6 = Syscall6; RawSyscall = function(trap, a1, a2, a3) { var _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, a1, a2, a3, err, f, r, r1, r2, trap, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; a1 = $f.a1; a2 = $f.a2; a3 = $f.a3; err = $f.err; f = $f.f; r = $f.r; r1 = $f.r1; r2 = $f.r2; trap = $f.trap; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r1 = 0; r2 = 0; err = 0; _r = syscallByName("Syscall"); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } f = _r; 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; $s = -1; return [r1, r2, err]; } printWarning(); _tmp$3 = ((minusOne >>> 0)); _tmp$4 = 0; _tmp$5 = 13; r1 = _tmp$3; r2 = _tmp$4; err = _tmp$5; $s = -1; return [r1, r2, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: RawSyscall }; } $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.a1 = a1; $f.a2 = a2; $f.a3 = a3; $f.err = err; $f.f = f; $f.r = r; $f.r1 = r1; $f.r2 = r2; $f.trap = trap; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.RawSyscall = RawSyscall; BytePtrFromString = function(s) { var _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"), undefined) : _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; init = function() { $flushConsole = (function() { if (!((lineBuffer.$length === 0))) { $global.console.log($externalize(($bytesToString(lineBuffer)), $String)); lineBuffer = sliceType.nil; } }); }; printWarning = function() { 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 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)); } }; Exit = function(code) { var _r, code, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; code = $f.code; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = Syscall(94, ((code >>> 0)), 0, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Exit }; } $f._r = _r; $f.code = code; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Exit = Exit; indexByte = function(s, c) { var _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"), undefined) : _ref.$array[_ref.$offset + _i]); if (b === c) { return i; } _i++; } return -1; }; CloseOnExec = function(fd) { var _r, fd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = fcntl(fd, 2, 1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: CloseOnExec }; } $f._r = _r; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.CloseOnExec = CloseOnExec; SetNonblock = function(fd, nonblocking) { var _r, _r$1, _tuple, _tuple$1, err, fd, flag, nonblocking, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; err = $f.err; fd = $f.fd; flag = $f.flag; nonblocking = $f.nonblocking; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _r = fcntl(fd, 3, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; flag = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { err = err; $s = -1; return err; } if (nonblocking) { flag = flag | (2048); } else { flag = (flag & ~(2048)) >> 0; } _r$1 = fcntl(fd, 4, flag); /* */ $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; err = _tuple$1[1]; err = err; $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: SetNonblock }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.err = err; $f.fd = fd; $f.flag = flag; $f.nonblocking = nonblocking; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.SetNonblock = SetNonblock; copyenv = function() { var _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"), undefined) : _ref.$array[_ref.$offset + _i]); j = 0; while (true) { if (!(j < s.length)) { break; } if (s.charCodeAt(j) === 61) { key = $substring(s, 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"), undefined) : envs.$array[envs.$offset + i] = ""); } break; } j = j + (1) >> 0; } _i++; } }; Getenv = function(key) { var $24r, $24r$1, $24r$2, $24r$3, _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; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; _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 = []; $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) { $s = 2; continue; } /* */ $s = 3; continue; /* if (key.length === 0) { */ case 2: _tmp = ""; _tmp$1 = false; value = _tmp; found = _tmp$1; $24r = [value, found]; $s = 4; case 4: return $24r; /* } */ case 3: $r = envLock.RLock(); /* */ $s = 5; case 5: 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) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!ok) { */ case 6: _tmp$2 = ""; _tmp$3 = false; value = _tmp$2; found = _tmp$3; $24r$1 = [value, found]; $s = 8; case 8: return $24r$1; /* } */ case 7: s = ((i < 0 || i >= envs.$length) ? ($throwRuntimeError("index out of range"), undefined) : envs.$array[envs.$offset + i]); i$1 = 0; /* while (true) { */ case 9: /* if (!(i$1 < s.length)) { break; } */ if(!(i$1 < s.length)) { $s = 10; continue; } /* */ if (s.charCodeAt(i$1) === 61) { $s = 11; continue; } /* */ $s = 12; continue; /* if (s.charCodeAt(i$1) === 61) { */ case 11: _tmp$4 = $substring(s, (i$1 + 1 >> 0)); _tmp$5 = true; value = _tmp$4; found = _tmp$5; $24r$2 = [value, found]; $s = 13; case 13: return $24r$2; /* } */ case 12: i$1 = i$1 + (1) >> 0; $s = 9; continue; case 10: _tmp$6 = ""; _tmp$7 = false; value = _tmp$6; found = _tmp$7; $24r$3 = [value, found]; $s = 14; case 14: return $24r$3; /* */ } 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.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $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; ptrType$7.methods = [{prop: "Unix", name: "Unix", pkg: "", typ: $funcType([], [$Int64, $Int64], false)}, {prop: "Nano", name: "Nano", pkg: "", typ: $funcType([], [$Int64], false)}]; ptrType$19.methods = [{prop: "SetLen", name: "SetLen", pkg: "", typ: $funcType([$Int], [], false)}]; ptrType$32.methods = [{prop: "SetControllen", name: "SetControllen", pkg: "", typ: $funcType([$Int], [], false)}]; ptrType$34.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: "Is", name: "Is", pkg: "", typ: $funcType([$error], [$Bool], false)}, {prop: "Temporary", name: "Temporary", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}]; ptrType$35.methods = [{prop: "sockaddr", name: "sockaddr", pkg: "syscall", typ: $funcType([], [$UnsafePointer, _Socklen, $error], false)}]; ptrType$36.methods = [{prop: "sockaddr", name: "sockaddr", pkg: "syscall", typ: $funcType([], [$UnsafePointer, _Socklen, $error], false)}]; ptrType$37.methods = [{prop: "sockaddr", name: "sockaddr", pkg: "syscall", typ: $funcType([], [$UnsafePointer, _Socklen, $error], false)}]; ptrType$38.methods = [{prop: "sockaddr", name: "sockaddr", pkg: "syscall", typ: $funcType([], [$UnsafePointer, _Socklen, $error], false)}]; ptrType$23.methods = [{prop: "sockaddr", name: "sockaddr", pkg: "syscall", typ: $funcType([], [$UnsafePointer, _Socklen, $error], false)}]; ptrType$40.methods = [{prop: "toWireFormat", name: "toWireFormat", pkg: "syscall", typ: $funcType([], [sliceType], false)}]; Timespec.init("", [{prop: "Sec", name: "Sec", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Nsec", name: "Nsec", embedded: false, exported: true, typ: $Int64, tag: ""}]); Stat_t.init("", [{prop: "Dev", name: "Dev", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "Ino", name: "Ino", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "Mode", name: "Mode", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Nlink", name: "Nlink", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Uid", name: "Uid", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Gid", name: "Gid", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Rdev", name: "Rdev", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "X__pad1", name: "X__pad1", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "Size", name: "Size", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Blksize", name: "Blksize", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "X__pad2", name: "X__pad2", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "Blocks", name: "Blocks", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Atim", name: "Atim", embedded: false, exported: true, typ: Timespec, tag: ""}, {prop: "Mtim", name: "Mtim", embedded: false, exported: true, typ: Timespec, tag: ""}, {prop: "Ctim", name: "Ctim", embedded: false, exported: true, typ: Timespec, tag: ""}, {prop: "X__glibc_reserved", name: "X__glibc_reserved", embedded: false, exported: true, typ: arrayType$3, tag: ""}]); RawSockaddrInet4.init("", [{prop: "Family", name: "Family", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Port", name: "Port", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Addr", name: "Addr", embedded: false, exported: true, typ: arrayType$10, tag: ""}, {prop: "Zero", name: "Zero", embedded: false, exported: true, typ: arrayType$8, tag: ""}]); RawSockaddrInet6.init("", [{prop: "Family", name: "Family", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Port", name: "Port", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Flowinfo", name: "Flowinfo", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Addr", name: "Addr", embedded: false, exported: true, typ: arrayType$11, tag: ""}, {prop: "Scope_id", name: "Scope_id", embedded: false, exported: true, typ: $Uint32, tag: ""}]); RawSockaddrUnix.init("", [{prop: "Family", name: "Family", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Path", name: "Path", embedded: false, exported: true, typ: arrayType$9, tag: ""}]); RawSockaddrLinklayer.init("", [{prop: "Family", name: "Family", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Protocol", name: "Protocol", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Ifindex", name: "Ifindex", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "Hatype", name: "Hatype", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Pkttype", name: "Pkttype", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Halen", name: "Halen", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Addr", name: "Addr", embedded: false, exported: true, typ: arrayType$8, tag: ""}]); RawSockaddrNetlink.init("", [{prop: "Family", name: "Family", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Pad", name: "Pad", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Pid", name: "Pid", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Groups", name: "Groups", embedded: false, exported: true, typ: $Uint32, tag: ""}]); RawSockaddr.init("", [{prop: "Family", name: "Family", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Data", name: "Data", embedded: false, exported: true, typ: arrayType, tag: ""}]); RawSockaddrAny.init("", [{prop: "Addr", name: "Addr", embedded: false, exported: true, typ: RawSockaddr, tag: ""}, {prop: "Pad", name: "Pad", embedded: false, exported: true, typ: arrayType$1, tag: ""}]); Linger.init("", [{prop: "Onoff", name: "Onoff", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "Linger", name: "Linger", embedded: false, exported: true, typ: $Int32, tag: ""}]); Iovec.init("", [{prop: "Base", name: "Base", embedded: false, exported: true, typ: ptrType$2, tag: ""}, {prop: "Len", name: "Len", embedded: false, exported: true, typ: $Uint64, tag: ""}]); IPMreq.init("", [{prop: "Multiaddr", name: "Multiaddr", embedded: false, exported: true, typ: arrayType$10, tag: ""}, {prop: "Interface", name: "Interface", embedded: false, exported: true, typ: arrayType$10, tag: ""}]); IPMreqn.init("", [{prop: "Multiaddr", name: "Multiaddr", embedded: false, exported: true, typ: arrayType$10, tag: ""}, {prop: "Address", name: "Address", embedded: false, exported: true, typ: arrayType$10, tag: ""}, {prop: "Ifindex", name: "Ifindex", embedded: false, exported: true, typ: $Int32, tag: ""}]); IPv6Mreq.init("", [{prop: "Multiaddr", name: "Multiaddr", embedded: false, exported: true, typ: arrayType$11, tag: ""}, {prop: "Interface", name: "Interface", embedded: false, exported: true, typ: $Uint32, tag: ""}]); Msghdr.init("", [{prop: "Name", name: "Name", embedded: false, exported: true, typ: ptrType$2, tag: ""}, {prop: "Namelen", name: "Namelen", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Pad_cgo_0", name: "Pad_cgo_0", embedded: false, exported: true, typ: arrayType$10, tag: ""}, {prop: "Iov", name: "Iov", embedded: false, exported: true, typ: ptrType$19, tag: ""}, {prop: "Iovlen", name: "Iovlen", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "Control", name: "Control", embedded: false, exported: true, typ: ptrType$2, tag: ""}, {prop: "Controllen", name: "Controllen", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "Flags", name: "Flags", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "Pad_cgo_1", name: "Pad_cgo_1", embedded: false, exported: true, typ: arrayType$10, tag: ""}]); NlMsghdr.init("", [{prop: "Len", name: "Len", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Type", name: "Type", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Flags", name: "Flags", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Seq", name: "Seq", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Pid", name: "Pid", embedded: false, exported: true, typ: $Uint32, tag: ""}]); RtGenmsg.init("", [{prop: "Family", name: "Family", embedded: false, exported: true, typ: $Uint8, tag: ""}]); RtAttr.init("", [{prop: "Len", name: "Len", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Type", name: "Type", embedded: false, exported: true, typ: $Uint16, tag: ""}]); IfInfomsg.init("", [{prop: "Family", name: "Family", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "X__ifi_pad", name: "X__ifi_pad", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Type", name: "Type", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Index", name: "Index", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "Flags", name: "Flags", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Change", name: "Change", embedded: false, exported: true, typ: $Uint32, tag: ""}]); IfAddrmsg.init("", [{prop: "Family", name: "Family", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Prefixlen", name: "Prefixlen", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Flags", name: "Flags", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Scope", name: "Scope", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Index", name: "Index", embedded: false, exported: true, typ: $Uint32, tag: ""}]); Utsname.init("", [{prop: "Sysname", name: "Sysname", embedded: false, exported: true, typ: arrayType$24, tag: ""}, {prop: "Nodename", name: "Nodename", embedded: false, exported: true, typ: arrayType$24, tag: ""}, {prop: "Release", name: "Release", embedded: false, exported: true, typ: arrayType$24, tag: ""}, {prop: "Version", name: "Version", embedded: false, exported: true, typ: arrayType$24, tag: ""}, {prop: "Machine", name: "Machine", embedded: false, exported: true, typ: arrayType$24, tag: ""}, {prop: "Domainname", name: "Domainname", embedded: false, exported: true, typ: arrayType$24, tag: ""}]); mmapper.init("syscall", [{prop: "Mutex", name: "Mutex", embedded: true, exported: true, typ: sync.Mutex, tag: ""}, {prop: "active", name: "active", embedded: false, exported: false, typ: mapType, tag: ""}, {prop: "mmap", name: "mmap", embedded: false, exported: false, typ: funcType, tag: ""}, {prop: "munmap", name: "munmap", embedded: false, exported: false, typ: funcType$1, tag: ""}]); Sockaddr.init([{prop: "sockaddr", name: "sockaddr", pkg: "syscall", typ: $funcType([], [$UnsafePointer, _Socklen, $error], false)}]); SockaddrInet4.init("syscall", [{prop: "Port", name: "Port", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Addr", name: "Addr", embedded: false, exported: true, typ: arrayType$10, tag: ""}, {prop: "raw", name: "raw", embedded: false, exported: false, typ: RawSockaddrInet4, tag: ""}]); SockaddrInet6.init("syscall", [{prop: "Port", name: "Port", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "ZoneId", name: "ZoneId", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Addr", name: "Addr", embedded: false, exported: true, typ: arrayType$11, tag: ""}, {prop: "raw", name: "raw", embedded: false, exported: false, typ: RawSockaddrInet6, tag: ""}]); SockaddrUnix.init("syscall", [{prop: "Name", name: "Name", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "raw", name: "raw", embedded: false, exported: false, typ: RawSockaddrUnix, tag: ""}]); SockaddrLinklayer.init("syscall", [{prop: "Protocol", name: "Protocol", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Ifindex", name: "Ifindex", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Hatype", name: "Hatype", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Pkttype", name: "Pkttype", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Halen", name: "Halen", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Addr", name: "Addr", embedded: false, exported: true, typ: arrayType$8, tag: ""}, {prop: "raw", name: "raw", embedded: false, exported: false, typ: RawSockaddrLinklayer, tag: ""}]); SockaddrNetlink.init("syscall", [{prop: "Family", name: "Family", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Pad", name: "Pad", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Pid", name: "Pid", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Groups", name: "Groups", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "raw", name: "raw", embedded: false, exported: false, typ: RawSockaddrNetlink, tag: ""}]); NetlinkRouteRequest.init("", [{prop: "Header", name: "Header", embedded: false, exported: true, typ: NlMsghdr, tag: ""}, {prop: "Data", name: "Data", embedded: false, exported: true, typ: RtGenmsg, tag: ""}]); NetlinkMessage.init("", [{prop: "Header", name: "Header", embedded: false, exported: true, typ: NlMsghdr, tag: ""}, {prop: "Data", name: "Data", embedded: false, exported: true, typ: sliceType, tag: ""}]); NetlinkRouteAttr.init("", [{prop: "Attr", name: "Attr", embedded: false, exported: true, typ: RtAttr, tag: ""}, {prop: "Value", name: "Value", embedded: false, exported: true, typ: sliceType, tag: ""}]); RawConn.init([{prop: "Control", name: "Control", pkg: "", typ: $funcType([funcType$2], [$error], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([funcType$3], [$error], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([funcType$3], [$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 = js.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = bytealg.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = itoa.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = oserror.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = race.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = unsafeheader.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = runtime.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sync.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $pkg.SocketDisableIPv6 = false; ioSync = new $Int64(0, 0); syscallModule = null; lineBuffer = sliceType.nil; $pkg.ForkLock = new sync.RWMutex.ptr(new sync.Mutex.ptr(0, 0), 0, 0, 0, 0); envOnce = new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)); envLock = new sync.RWMutex.ptr(new sync.Mutex.ptr(0, 0), 0, 0, 0, 0); env = false; errors$1 = $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 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", "memory page has hardware error"]); $pkg.Stdin = 0; $pkg.Stdout = 1; $pkg.Stderr = 2; errEAGAIN = new Errno(11); errEINVAL = new Errno(22); errENOENT = new Errno(2); alreadyTriedToLoad = false; minusOne = -1; warningPrinted = false; mapper = new mmapper.ptr(new sync.Mutex.ptr(0, 0), {}, mmap, munmap); envs = runtime_envs(); init(); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["internal/syscall/unix"] = (function() { var $pkg = {}, $init, atomic, syscall, IsNonblock, CopyFileRange; atomic = $packages["sync/atomic"]; syscall = $packages["syscall"]; IsNonblock = function(fd) { var _tmp, _tmp$1, err, fd, nonblocking; nonblocking = false; err = $ifaceNil; _tmp = false; _tmp$1 = $ifaceNil; nonblocking = _tmp; err = _tmp$1; return [nonblocking, err]; }; $pkg.IsNonblock = IsNonblock; CopyFileRange = function(rfd, roff, wfd, woff, len, flags) { var _r, _tuple, err, errno, flags, len, n, r1, rfd, roff, wfd, woff, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; errno = $f.errno; flags = $f.flags; len = $f.len; n = $f.n; r1 = $f.r1; rfd = $f.rfd; roff = $f.roff; wfd = $f.wfd; woff = $f.woff; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; _r = syscall.Syscall6(0, ((rfd >>> 0)), ((roff)), ((wfd >>> 0)), ((woff)), ((len >>> 0)), ((flags >>> 0))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; r1 = _tuple[0]; errno = _tuple[2]; n = ((r1 >> 0)); if (!((errno === 0))) { err = new syscall.Errno(errno); } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: CopyFileRange }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.errno = errno; $f.flags = flags; $f.len = len; $f.n = n; $f.r1 = r1; $f.rfd = rfd; $f.roff = roff; $f.wfd = wfd; $f.woff = woff; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.CopyFileRange = CopyFileRange; $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 = atomic.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = syscall.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $pkg.FcntlSyscall = 25; /* */ } 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, Pool, Once, Mutex, WaitGroup, Map, sliceType, ptrType, funcType, funcType$1, ptrType$1, ptrType$2, ptrType$4, funcType$2, ptrType$5, mapType; Pool = $pkg.Pool = $newType(0, $kindStruct, "nosync.Pool", true, "github.com/gopherjs/gopherjs/nosync", true, function(store_, New_) { this.$val = this; if (arguments.length === 0) { this.store = sliceType.nil; this.New = $throwNilPointerError; return; } this.store = store_; this.New = New_; }); Once = $pkg.Once = $newType(0, $kindStruct, "nosync.Once", true, "github.com/gopherjs/gopherjs/nosync", true, function(doing_, done_) { this.$val = this; if (arguments.length === 0) { this.doing = false; this.done = false; return; } this.doing = doing_; this.done = done_; }); Mutex = $pkg.Mutex = $newType(0, $kindStruct, "nosync.Mutex", true, "github.com/gopherjs/gopherjs/nosync", true, function(locked_) { this.$val = this; if (arguments.length === 0) { this.locked = false; return; } this.locked = locked_; }); WaitGroup = $pkg.WaitGroup = $newType(0, $kindStruct, "nosync.WaitGroup", true, "github.com/gopherjs/gopherjs/nosync", true, function(counter_) { this.$val = this; if (arguments.length === 0) { this.counter = 0; return; } this.counter = counter_; }); Map = $pkg.Map = $newType(0, $kindStruct, "nosync.Map", true, "github.com/gopherjs/gopherjs/nosync", true, function(m_) { this.$val = this; if (arguments.length === 0) { this.m = false; return; } this.m = m_; }); sliceType = $sliceType($emptyInterface); ptrType = $ptrType(Pool); funcType = $funcType([], [$emptyInterface], false); funcType$1 = $funcType([], [], false); ptrType$1 = $ptrType(Once); ptrType$2 = $ptrType(Mutex); ptrType$4 = $ptrType(WaitGroup); funcType$2 = $funcType([$emptyInterface, $emptyInterface], [$Bool], false); ptrType$5 = $ptrType(Map); mapType = $mapType($emptyInterface, $emptyInterface); Pool.ptr.prototype.Get = function() { var $24r, _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; $24r = $f.$24r; _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; } $24r = _r; $s = 6; case 6: return $24r; /* } */ case 4: $s = -1; 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"), undefined) : x.$array[x.$offset + x$1])); p.store = $subslice(p.store, 0, (p.store.$length - 1 >> 0)); $s = -1; return x$2; /* */ } return; } if ($f === undefined) { $f = { $blk: Pool.ptr.prototype.Get }; } $f.$24r = $24r; $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 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); }; Once.ptr.prototype.Do = function(f) { var f, o, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; 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 = []; $curGoroutine.deferStack.push($deferred); o = [o]; o[0] = this; /* */ if (o[0].done) { $s = 1; continue; } /* */ $s = 2; continue; /* if (o[0].done) { */ case 1: $s = 3; case 3: return; /* } */ case 2: if (o[0].doing) { $panic(new $String("nosync: Do called within f")); } o[0].doing = true; $deferred.push([(function(o) { return function() { o[0].doing = false; o[0].done = true; }; })(o), []]); $r = f(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Once.ptr.prototype.Do }; } $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); }; Mutex.ptr.prototype.Lock = function() { var 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 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(); }; WaitGroup.ptr.prototype.Add = function(delta) { var 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 wg; wg = this; wg.Add(-1); }; WaitGroup.prototype.Done = function() { return this.$val.Done(); }; WaitGroup.ptr.prototype.Wait = function() { var wg; wg = this; if (!((wg.counter === 0))) { $panic(new $String("sync: WaitGroup counter not zero")); } }; WaitGroup.prototype.Wait = function() { return this.$val.Wait(); }; Map.ptr.prototype.Load = function(key) { var _entry, _tmp, _tmp$1, _tuple, key, m, ok, value; value = $ifaceNil; ok = false; m = this; _tuple = (_entry = m.m[$emptyInterface.keyFor(key)], _entry !== undefined ? [_entry.v, true] : [$ifaceNil, false]); value = _tuple[0]; ok = _tuple[1]; _tmp = value; _tmp$1 = ok; value = _tmp; ok = _tmp$1; return [value, ok]; }; Map.prototype.Load = function(key) { return this.$val.Load(key); }; Map.ptr.prototype.Store = function(key, value) { var _key, key, m, value; m = this; if (m.m === false) { m.m = {}; } _key = key; (m.m || $throwRuntimeError("assignment to entry in nil map"))[$emptyInterface.keyFor(_key)] = { k: _key, v: value }; }; Map.prototype.Store = function(key, value) { return this.$val.Store(key, value); }; Map.ptr.prototype.LoadOrStore = function(key, value) { var _entry, _key, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, actual, key, loaded, m, ok, value, value$1; actual = $ifaceNil; loaded = false; m = this; _tuple = (_entry = m.m[$emptyInterface.keyFor(key)], _entry !== undefined ? [_entry.v, true] : [$ifaceNil, false]); value$1 = _tuple[0]; ok = _tuple[1]; if (ok) { _tmp = value$1; _tmp$1 = true; actual = _tmp; loaded = _tmp$1; return [actual, loaded]; } if (m.m === false) { m.m = {}; } _key = key; (m.m || $throwRuntimeError("assignment to entry in nil map"))[$emptyInterface.keyFor(_key)] = { k: _key, v: value }; _tmp$2 = value; _tmp$3 = false; actual = _tmp$2; loaded = _tmp$3; return [actual, loaded]; }; Map.prototype.LoadOrStore = function(key, value) { return this.$val.LoadOrStore(key, value); }; Map.ptr.prototype.Delete = function(key) { var key, m; m = this; if (m.m === false) { return; } delete m.m[$emptyInterface.keyFor(key)]; }; Map.prototype.Delete = function(key) { return this.$val.Delete(key); }; Map.ptr.prototype.Range = function(f) { var _entry, _i, _keys, _r, _ref, f, k, m, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _i = $f._i; _keys = $f._keys; _r = $f._r; _ref = $f._ref; f = $f.f; k = $f.k; m = $f.m; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: m = this; _ref = m.m; _i = 0; _keys = $keys(_ref); /* while (true) { */ case 1: /* if (!(_i < _keys.length)) { break; } */ if(!(_i < _keys.length)) { $s = 2; continue; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; /* continue; */ $s = 1; continue; } k = _entry.k; v = _entry.v; _r = f(k, v); /* */ $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: /* break; */ $s = 2; continue; /* } */ case 4: _i++; $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Map.ptr.prototype.Range }; } $f._entry = _entry; $f._i = _i; $f._keys = _keys; $f._r = _r; $f._ref = _ref; $f.f = f; $f.k = k; $f.m = m; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Map.prototype.Range = function(f) { return this.$val.Range(f); }; ptrType.methods = [{prop: "Get", name: "Get", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "Put", name: "Put", pkg: "", typ: $funcType([$emptyInterface], [], false)}]; ptrType$1.methods = [{prop: "Do", name: "Do", pkg: "", typ: $funcType([funcType$1], [], false)}]; ptrType$2.methods = [{prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}]; ptrType$4.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$5.methods = [{prop: "Load", name: "Load", pkg: "", typ: $funcType([$emptyInterface], [$emptyInterface, $Bool], false)}, {prop: "Store", name: "Store", pkg: "", typ: $funcType([$emptyInterface, $emptyInterface], [], false)}, {prop: "LoadOrStore", name: "LoadOrStore", pkg: "", typ: $funcType([$emptyInterface, $emptyInterface], [$emptyInterface, $Bool], false)}, {prop: "Delete", name: "Delete", pkg: "", typ: $funcType([$emptyInterface], [], false)}, {prop: "Range", name: "Range", pkg: "", typ: $funcType([funcType$2], [], false)}]; Pool.init("github.com/gopherjs/gopherjs/nosync", [{prop: "store", name: "store", embedded: false, exported: false, typ: sliceType, tag: ""}, {prop: "New", name: "New", embedded: false, exported: true, typ: funcType, tag: ""}]); Once.init("github.com/gopherjs/gopherjs/nosync", [{prop: "doing", name: "doing", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "done", name: "done", embedded: false, exported: false, typ: $Bool, tag: ""}]); Mutex.init("github.com/gopherjs/gopherjs/nosync", [{prop: "locked", name: "locked", embedded: false, exported: false, typ: $Bool, tag: ""}]); WaitGroup.init("github.com/gopherjs/gopherjs/nosync", [{prop: "counter", name: "counter", embedded: false, exported: false, typ: $Int, tag: ""}]); Map.init("github.com/gopherjs/gopherjs/nosync", [{prop: "m", name: "m", embedded: false, exported: false, typ: mapType, 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["time"] = (function() { var $pkg = {}, $init, errors, js, nosync, runtime, syscall, Location, zone, zoneTrans, ruleKind, rule, Time, Month, Weekday, Duration, Timer, runtimeTimer, ParseError, sliceType, sliceType$1, ptrType, sliceType$2, sliceType$3, ptrType$2, arrayType$2, chanType, funcType, structType, arrayType$3, arrayType$4, arrayType$5, ptrType$4, chanType$1, funcType$1, ptrType$6, ptrType$7, ptrType$8, badData, utcLoc, utcLoc$24ptr, localLoc, localLoc$24ptr, localOnce, errLocation, daysBefore, startNano, zoneSources, std0x, longDayNames, shortDayNames, shortMonthNames, longMonthNames, atoiError, errBad, errLeadingInt, x, _r, FixedZone, tzset, tzsetName, tzsetOffset, tzsetRule, tzsetNum, tzruleTime, absWeekday, absClock, fmtFrac, fmtInt, lessThanHalf, Since, Until, absDate, daysIn, daysSinceEpoch, runtimeNano, Now, unixTime, Unix, isLeap, norm, Date, div, when, NewTimer, sendTime, After, AfterFunc, goFunc, initLocal, itoa, init, now, Sleep, startTimer, stopTimer, modTimer, resetTimer, startsWithLowerCase, nextStdChunk, match, lookup, appendInt, atoi, formatNano, quote, isDigit, getnum, getnum3, cutspace, skip, Parse, parse, parseTimeZone, parseGMT, parseSignedOffset, commaOrPeriod, parseNanoseconds, leadingInt; errors = $packages["errors"]; js = $packages["github.com/gopherjs/gopherjs/js"]; nosync = $packages["github.com/gopherjs/gopherjs/nosync"]; runtime = $packages["runtime"]; syscall = $packages["syscall"]; Location = $pkg.Location = $newType(0, $kindStruct, "time.Location", true, "time", true, function(name_, zone_, tx_, extend_, cacheStart_, cacheEnd_, cacheZone_) { this.$val = this; if (arguments.length === 0) { this.name = ""; this.zone = sliceType.nil; this.tx = sliceType$1.nil; this.extend = ""; 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.extend = extend_; this.cacheStart = cacheStart_; this.cacheEnd = cacheEnd_; this.cacheZone = cacheZone_; }); zone = $pkg.zone = $newType(0, $kindStruct, "time.zone", true, "time", false, 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", true, "time", false, 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_; }); ruleKind = $pkg.ruleKind = $newType(4, $kindInt, "time.ruleKind", true, "time", false, null); rule = $pkg.rule = $newType(0, $kindStruct, "time.rule", true, "time", false, function(kind_, day_, week_, mon_, time_) { this.$val = this; if (arguments.length === 0) { this.kind = 0; this.day = 0; this.week = 0; this.mon = 0; this.time = 0; return; } this.kind = kind_; this.day = day_; this.week = week_; this.mon = mon_; this.time = time_; }); Time = $pkg.Time = $newType(0, $kindStruct, "time.Time", true, "time", true, function(wall_, ext_, loc_) { this.$val = this; if (arguments.length === 0) { this.wall = new $Uint64(0, 0); this.ext = new $Int64(0, 0); this.loc = ptrType$2.nil; return; } this.wall = wall_; this.ext = ext_; this.loc = loc_; }); Month = $pkg.Month = $newType(4, $kindInt, "time.Month", true, "time", true, null); Weekday = $pkg.Weekday = $newType(4, $kindInt, "time.Weekday", true, "time", true, null); Duration = $pkg.Duration = $newType(8, $kindInt64, "time.Duration", true, "time", true, null); Timer = $pkg.Timer = $newType(0, $kindStruct, "time.Timer", true, "time", true, function(C_, r_) { this.$val = this; if (arguments.length === 0) { this.C = $chanNil; this.r = new runtimeTimer.ptr(0, new $Int64(0, 0), new $Int64(0, 0), $throwNilPointerError, $ifaceNil, 0, null, false); return; } this.C = C_; this.r = r_; }); runtimeTimer = $pkg.runtimeTimer = $newType(0, $kindStruct, "time.runtimeTimer", true, "time", false, function(i_, when_, period_, f_, arg_, seq_, timeout_, active_) { this.$val = this; if (arguments.length === 0) { this.i = 0; this.when = new $Int64(0, 0); this.period = new $Int64(0, 0); this.f = $throwNilPointerError; this.arg = $ifaceNil; this.seq = 0; this.timeout = null; this.active = false; return; } this.i = i_; this.when = when_; this.period = period_; this.f = f_; this.arg = arg_; this.seq = seq_; this.timeout = timeout_; this.active = active_; }); ParseError = $pkg.ParseError = $newType(0, $kindStruct, "time.ParseError", true, "time", true, 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_; }); sliceType = $sliceType(zone); sliceType$1 = $sliceType(zoneTrans); ptrType = $ptrType(zone); sliceType$2 = $sliceType($String); sliceType$3 = $sliceType($Uint8); ptrType$2 = $ptrType(Location); arrayType$2 = $arrayType($Uint8, 32); chanType = $chanType(Time, false, false); funcType = $funcType([], [], false); structType = $structType("", []); arrayType$3 = $arrayType($Uint8, 20); arrayType$4 = $arrayType($Uint8, 9); arrayType$5 = $arrayType($Uint8, 64); ptrType$4 = $ptrType(Time); chanType$1 = $chanType(Time, false, true); funcType$1 = $funcType([$emptyInterface, $Uintptr], [], false); ptrType$6 = $ptrType(Timer); ptrType$7 = $ptrType(js.Object); ptrType$8 = $ptrType(ParseError); Location.ptr.prototype.get = function() { var l, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; l = $f.l; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: l = this; if (l === ptrType$2.nil) { $s = -1; 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: $s = -1; return l; /* */ } return; } if ($f === undefined) { $f = { $blk: Location.ptr.prototype.get }; } $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 $24r, _r$1, l, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; } $24r = _r$1.name; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Location.ptr.prototype.String }; } $f.$24r = $24r; $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 l, name, offset, x$1; 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$1 = l.zone, (0 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 0])); return l; }; $pkg.FixedZone = FixedZone; Location.ptr.prototype.lookup = function(sec) { var _q, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tuple, eend, eisDST, ename, end, eoffset, estart, hi, isDST, l, lim, lo, m, name, offset, ok, sec, start, tx, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, zone$1, zone$2, zone$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _q = $f._q; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tuple = $f._tuple; eend = $f.eend; eisDST = $f.eisDST; ename = $f.ename; end = $f.end; eoffset = $f.eoffset; estart = $f.estart; hi = $f.hi; isDST = $f.isDST; l = $f.l; lim = $f.lim; lo = $f.lo; m = $f.m; name = $f.name; offset = $f.offset; ok = $f.ok; sec = $f.sec; start = $f.start; tx = $f.tx; 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; x$9 = $f.x$9; 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; start = new $Int64(0, 0); end = new $Int64(0, 0); isDST = 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; if (l.zone.$length === 0) { name = "UTC"; offset = 0; start = new $Int64(-2147483648, 0); end = new $Int64(2147483647, 4294967295); isDST = false; $s = -1; return [name, offset, start, end, isDST]; } zone$1 = l.cacheZone; if (!(zone$1 === 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)))) { name = zone$1.name; offset = zone$1.offset; start = l.cacheStart; end = l.cacheEnd; isDST = zone$1.isDST; $s = -1; return [name, offset, start, end, isDST]; } if ((l.tx.$length === 0) || (x$3 = (x$4 = l.tx, (0 >= x$4.$length ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + 0])).when, (sec.$high < x$3.$high || (sec.$high === x$3.$high && sec.$low < x$3.$low)))) { zone$2 = (x$5 = l.zone, x$6 = l.lookupFirstZone(), ((x$6 < 0 || x$6 >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + x$6])); name = zone$2.name; offset = zone$2.offset; start = new $Int64(-2147483648, 0); if (l.tx.$length > 0) { end = (x$7 = l.tx, (0 >= x$7.$length ? ($throwRuntimeError("index out of range"), undefined) : x$7.$array[x$7.$offset + 0])).when; } else { end = new $Int64(2147483647, 4294967295); } isDST = zone$2.isDST; $s = -1; return [name, offset, start, end, isDST]; } 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"), undefined) : 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$8 = l.zone, x$9 = ((lo < 0 || lo >= tx.$length) ? ($throwRuntimeError("index out of range"), undefined) : tx.$array[tx.$offset + lo]).index, ((x$9 < 0 || x$9 >= x$8.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$8.$array[x$8.$offset + x$9])); name = zone$3.name; offset = zone$3.offset; start = ((lo < 0 || lo >= tx.$length) ? ($throwRuntimeError("index out of range"), undefined) : tx.$array[tx.$offset + lo]).when; isDST = zone$3.isDST; if ((lo === (tx.$length - 1 >> 0)) && !(l.extend === "")) { _tuple = tzset(l.extend, end, sec); ename = _tuple[0]; eoffset = _tuple[1]; estart = _tuple[2]; eend = _tuple[3]; eisDST = _tuple[4]; ok = _tuple[5]; if (ok) { _tmp = ename; _tmp$1 = eoffset; _tmp$2 = estart; _tmp$3 = eend; _tmp$4 = eisDST; name = _tmp; offset = _tmp$1; start = _tmp$2; end = _tmp$3; isDST = _tmp$4; $s = -1; return [name, offset, start, end, isDST]; } } $s = -1; return [name, offset, start, end, isDST]; /* */ } return; } if ($f === undefined) { $f = { $blk: Location.ptr.prototype.lookup }; } $f._q = _q; $f._r$1 = _r$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._tuple = _tuple; $f.eend = eend; $f.eisDST = eisDST; $f.ename = ename; $f.end = end; $f.eoffset = eoffset; $f.estart = estart; $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.ok = ok; $f.sec = sec; $f.start = start; $f.tx = tx; $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.x$9 = x$9; $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 _i, _ref, l, x$1, x$2, x$3, x$4, x$5, x$6, zi, zi$1; l = this; if (!l.firstZoneUsed()) { return 0; } if (l.tx.$length > 0 && (x$1 = l.zone, x$2 = (x$3 = l.tx, (0 >= x$3.$length ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + 0])).index, ((x$2 < 0 || x$2 >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + x$2])).isDST) { zi = (((x$4 = l.tx, (0 >= x$4.$length ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + 0])).index >> 0)) - 1 >> 0; while (true) { if (!(zi >= 0)) { break; } if (!(x$5 = l.zone, ((zi < 0 || zi >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$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$6 = l.zone, ((zi$1 < 0 || zi$1 >= x$6.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$6.$array[x$6.$offset + zi$1])).isDST) { return zi$1; } _i++; } return 0; }; Location.prototype.lookupFirstZone = function() { return this.$val.lookupFirstZone(); }; Location.ptr.prototype.firstZoneUsed = function() { var _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"), undefined) : _ref.$array[_ref.$offset + _i]), zoneTrans); if (tx.index === 0) { return true; } _i++; } return false; }; Location.prototype.firstZoneUsed = function() { return this.$val.firstZoneUsed(); }; tzset = function(s, initEnd, sec) { var _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$8, _tmp$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, abs, d, dstIsDST, dstName, dstOffset, end, endRule, endSec, initEnd, isDST, name, offset, ok, s, sec, start, startRule, startSec, stdIsDST, stdName, stdOffset, x$1, x$2, x$3, x$4, x$5, x$6, yday, year, ysec; name = ""; offset = 0; start = new $Int64(0, 0); end = new $Int64(0, 0); isDST = false; ok = false; _tmp = ""; _tmp$1 = ""; stdName = _tmp; dstName = _tmp$1; _tmp$2 = 0; _tmp$3 = 0; stdOffset = _tmp$2; dstOffset = _tmp$3; _tuple = tzsetName(s); stdName = _tuple[0]; s = _tuple[1]; ok = _tuple[2]; if (ok) { _tuple$1 = tzsetOffset(s); stdOffset = _tuple$1[0]; s = _tuple$1[1]; ok = _tuple$1[2]; } if (!ok) { _tmp$4 = ""; _tmp$5 = 0; _tmp$6 = new $Int64(0, 0); _tmp$7 = new $Int64(0, 0); _tmp$8 = false; _tmp$9 = false; name = _tmp$4; offset = _tmp$5; start = _tmp$6; end = _tmp$7; isDST = _tmp$8; ok = _tmp$9; return [name, offset, start, end, isDST, ok]; } stdOffset = -stdOffset; if ((s.length === 0) || (s.charCodeAt(0) === 44)) { _tmp$10 = stdName; _tmp$11 = stdOffset; _tmp$12 = initEnd; _tmp$13 = new $Int64(2147483647, 4294967295); _tmp$14 = false; _tmp$15 = true; name = _tmp$10; offset = _tmp$11; start = _tmp$12; end = _tmp$13; isDST = _tmp$14; ok = _tmp$15; return [name, offset, start, end, isDST, ok]; } _tuple$2 = tzsetName(s); dstName = _tuple$2[0]; s = _tuple$2[1]; ok = _tuple$2[2]; if (ok) { if ((s.length === 0) || (s.charCodeAt(0) === 44)) { dstOffset = stdOffset + 3600 >> 0; } else { _tuple$3 = tzsetOffset(s); dstOffset = _tuple$3[0]; s = _tuple$3[1]; ok = _tuple$3[2]; dstOffset = -dstOffset; } } if (!ok) { _tmp$16 = ""; _tmp$17 = 0; _tmp$18 = new $Int64(0, 0); _tmp$19 = new $Int64(0, 0); _tmp$20 = false; _tmp$21 = false; name = _tmp$16; offset = _tmp$17; start = _tmp$18; end = _tmp$19; isDST = _tmp$20; ok = _tmp$21; return [name, offset, start, end, isDST, ok]; } if (s.length === 0) { s = ",M3.2.0,M11.1.0"; } if (!((s.charCodeAt(0) === 44)) && !((s.charCodeAt(0) === 59))) { _tmp$22 = ""; _tmp$23 = 0; _tmp$24 = new $Int64(0, 0); _tmp$25 = new $Int64(0, 0); _tmp$26 = false; _tmp$27 = false; name = _tmp$22; offset = _tmp$23; start = _tmp$24; end = _tmp$25; isDST = _tmp$26; ok = _tmp$27; return [name, offset, start, end, isDST, ok]; } s = $substring(s, 1); _tmp$28 = new rule.ptr(0, 0, 0, 0, 0); _tmp$29 = new rule.ptr(0, 0, 0, 0, 0); startRule = $clone(_tmp$28, rule); endRule = $clone(_tmp$29, rule); _tuple$4 = tzsetRule(s); rule.copy(startRule, _tuple$4[0]); s = _tuple$4[1]; ok = _tuple$4[2]; if (!ok || (s.length === 0) || !((s.charCodeAt(0) === 44))) { _tmp$30 = ""; _tmp$31 = 0; _tmp$32 = new $Int64(0, 0); _tmp$33 = new $Int64(0, 0); _tmp$34 = false; _tmp$35 = false; name = _tmp$30; offset = _tmp$31; start = _tmp$32; end = _tmp$33; isDST = _tmp$34; ok = _tmp$35; return [name, offset, start, end, isDST, ok]; } s = $substring(s, 1); _tuple$5 = tzsetRule(s); rule.copy(endRule, _tuple$5[0]); s = _tuple$5[1]; ok = _tuple$5[2]; if (!ok || s.length > 0) { _tmp$36 = ""; _tmp$37 = 0; _tmp$38 = new $Int64(0, 0); _tmp$39 = new $Int64(0, 0); _tmp$40 = false; _tmp$41 = false; name = _tmp$36; offset = _tmp$37; start = _tmp$38; end = _tmp$39; isDST = _tmp$40; ok = _tmp$41; return [name, offset, start, end, isDST, ok]; } _tuple$6 = absDate(((x$1 = (x$2 = new $Int64(sec.$high + 14, sec.$low + 2006054656), new $Int64(x$2.$high + 2147483631, x$2.$low + 2739393024)), new $Uint64(x$1.$high, x$1.$low))), false); year = _tuple$6[0]; yday = _tuple$6[3]; ysec = (x$3 = (new $Int64(0, ($imul(yday, 86400)))), x$4 = $div64(sec, new $Int64(0, 86400), true), new $Int64(x$3.$high + x$4.$high, x$3.$low + x$4.$low)); d = daysSinceEpoch(year); abs = ((x$5 = $mul64(d, new $Uint64(0, 86400)), new $Int64(x$5.$high, x$5.$low))); abs = (x$6 = new $Int64(-2147483647, 3844486912), new $Int64(abs.$high + x$6.$high, abs.$low + x$6.$low)); startSec = (new $Int64(0, tzruleTime(year, $clone(startRule, rule), stdOffset))); endSec = (new $Int64(0, tzruleTime(year, $clone(endRule, rule), dstOffset))); _tmp$42 = true; _tmp$43 = false; dstIsDST = _tmp$42; stdIsDST = _tmp$43; if ((endSec.$high < startSec.$high || (endSec.$high === startSec.$high && endSec.$low < startSec.$low))) { _tmp$44 = endSec; _tmp$45 = startSec; startSec = _tmp$44; endSec = _tmp$45; _tmp$46 = dstName; _tmp$47 = stdName; stdName = _tmp$46; dstName = _tmp$47; _tmp$48 = dstOffset; _tmp$49 = stdOffset; stdOffset = _tmp$48; dstOffset = _tmp$49; _tmp$50 = dstIsDST; _tmp$51 = stdIsDST; stdIsDST = _tmp$50; dstIsDST = _tmp$51; } if ((ysec.$high < startSec.$high || (ysec.$high === startSec.$high && ysec.$low < startSec.$low))) { _tmp$52 = stdName; _tmp$53 = stdOffset; _tmp$54 = abs; _tmp$55 = new $Int64(startSec.$high + abs.$high, startSec.$low + abs.$low); _tmp$56 = stdIsDST; _tmp$57 = true; name = _tmp$52; offset = _tmp$53; start = _tmp$54; end = _tmp$55; isDST = _tmp$56; ok = _tmp$57; return [name, offset, start, end, isDST, ok]; } else if ((ysec.$high > endSec.$high || (ysec.$high === endSec.$high && ysec.$low >= endSec.$low))) { _tmp$58 = stdName; _tmp$59 = stdOffset; _tmp$60 = new $Int64(endSec.$high + abs.$high, endSec.$low + abs.$low); _tmp$61 = new $Int64(abs.$high + 0, abs.$low + 31536000); _tmp$62 = stdIsDST; _tmp$63 = true; name = _tmp$58; offset = _tmp$59; start = _tmp$60; end = _tmp$61; isDST = _tmp$62; ok = _tmp$63; return [name, offset, start, end, isDST, ok]; } else { _tmp$64 = dstName; _tmp$65 = dstOffset; _tmp$66 = new $Int64(startSec.$high + abs.$high, startSec.$low + abs.$low); _tmp$67 = new $Int64(endSec.$high + abs.$high, endSec.$low + abs.$low); _tmp$68 = dstIsDST; _tmp$69 = true; name = _tmp$64; offset = _tmp$65; start = _tmp$66; end = _tmp$67; isDST = _tmp$68; ok = _tmp$69; return [name, offset, start, end, isDST, ok]; } }; tzsetName = function(s) { var _1, _i, _i$1, _ref, _ref$1, _rune, _rune$1, i, i$1, r, r$1, s; if (s.length === 0) { return ["", "", false]; } if (!((s.charCodeAt(0) === 60))) { _ref = s; _i = 0; while (true) { if (!(_i < _ref.length)) { break; } _rune = $decodeRune(_ref, _i); i = _i; r = _rune[0]; _1 = r; if ((_1 === (48)) || (_1 === (49)) || (_1 === (50)) || (_1 === (51)) || (_1 === (52)) || (_1 === (53)) || (_1 === (54)) || (_1 === (55)) || (_1 === (56)) || (_1 === (57)) || (_1 === (44)) || (_1 === (45)) || (_1 === (43))) { if (i < 3) { return ["", "", false]; } return [$substring(s, 0, i), $substring(s, i), true]; } _i += _rune[1]; } if (s.length < 3) { return ["", "", false]; } return [s, "", true]; } else { _ref$1 = s; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.length)) { break; } _rune$1 = $decodeRune(_ref$1, _i$1); i$1 = _i$1; r$1 = _rune$1[0]; if (r$1 === 62) { return [$substring(s, 1, i$1), $substring(s, (i$1 + 1 >> 0)), true]; } _i$1 += _rune$1[1]; } return ["", "", false]; } }; tzsetOffset = function(s) { var _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$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, hours, mins, neg, off, offset, ok, rest, s, secs; offset = 0; rest = ""; ok = false; if (s.length === 0) { _tmp = 0; _tmp$1 = ""; _tmp$2 = false; offset = _tmp; rest = _tmp$1; ok = _tmp$2; return [offset, rest, ok]; } neg = false; if (s.charCodeAt(0) === 43) { s = $substring(s, 1); } else if (s.charCodeAt(0) === 45) { s = $substring(s, 1); neg = true; } hours = 0; _tuple = tzsetNum(s, 0, 168); hours = _tuple[0]; s = _tuple[1]; ok = _tuple[2]; if (!ok) { _tmp$3 = 0; _tmp$4 = ""; _tmp$5 = false; offset = _tmp$3; rest = _tmp$4; ok = _tmp$5; return [offset, rest, ok]; } off = $imul(hours, 3600); if ((s.length === 0) || !((s.charCodeAt(0) === 58))) { if (neg) { off = -off; } _tmp$6 = off; _tmp$7 = s; _tmp$8 = true; offset = _tmp$6; rest = _tmp$7; ok = _tmp$8; return [offset, rest, ok]; } mins = 0; _tuple$1 = tzsetNum($substring(s, 1), 0, 59); mins = _tuple$1[0]; s = _tuple$1[1]; ok = _tuple$1[2]; if (!ok) { _tmp$9 = 0; _tmp$10 = ""; _tmp$11 = false; offset = _tmp$9; rest = _tmp$10; ok = _tmp$11; return [offset, rest, ok]; } off = off + (($imul(mins, 60))) >> 0; if ((s.length === 0) || !((s.charCodeAt(0) === 58))) { if (neg) { off = -off; } _tmp$12 = off; _tmp$13 = s; _tmp$14 = true; offset = _tmp$12; rest = _tmp$13; ok = _tmp$14; return [offset, rest, ok]; } secs = 0; _tuple$2 = tzsetNum($substring(s, 1), 0, 59); secs = _tuple$2[0]; s = _tuple$2[1]; ok = _tuple$2[2]; if (!ok) { _tmp$15 = 0; _tmp$16 = ""; _tmp$17 = false; offset = _tmp$15; rest = _tmp$16; ok = _tmp$17; return [offset, rest, ok]; } off = off + (secs) >> 0; if (neg) { off = -off; } _tmp$18 = off; _tmp$19 = s; _tmp$20 = true; offset = _tmp$18; rest = _tmp$19; ok = _tmp$20; return [offset, rest, ok]; }; tzsetRule = function(s) { var _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, day, day$1, jday, mon, offset, ok, r, s, week; r = new rule.ptr(0, 0, 0, 0, 0); if (s.length === 0) { return [new rule.ptr(0, 0, 0, 0, 0), "", false]; } ok = false; if (s.charCodeAt(0) === 74) { jday = 0; _tuple = tzsetNum($substring(s, 1), 1, 365); jday = _tuple[0]; s = _tuple[1]; ok = _tuple[2]; if (!ok) { return [new rule.ptr(0, 0, 0, 0, 0), "", false]; } r.kind = 0; r.day = jday; } else if (s.charCodeAt(0) === 77) { mon = 0; _tuple$1 = tzsetNum($substring(s, 1), 1, 12); mon = _tuple$1[0]; s = _tuple$1[1]; ok = _tuple$1[2]; if (!ok || (s.length === 0) || !((s.charCodeAt(0) === 46))) { return [new rule.ptr(0, 0, 0, 0, 0), "", false]; } week = 0; _tuple$2 = tzsetNum($substring(s, 1), 1, 5); week = _tuple$2[0]; s = _tuple$2[1]; ok = _tuple$2[2]; if (!ok || (s.length === 0) || !((s.charCodeAt(0) === 46))) { return [new rule.ptr(0, 0, 0, 0, 0), "", false]; } day = 0; _tuple$3 = tzsetNum($substring(s, 1), 0, 6); day = _tuple$3[0]; s = _tuple$3[1]; ok = _tuple$3[2]; if (!ok) { return [new rule.ptr(0, 0, 0, 0, 0), "", false]; } r.kind = 2; r.day = day; r.week = week; r.mon = mon; } else { day$1 = 0; _tuple$4 = tzsetNum(s, 0, 365); day$1 = _tuple$4[0]; s = _tuple$4[1]; ok = _tuple$4[2]; if (!ok) { return [new rule.ptr(0, 0, 0, 0, 0), "", false]; } r.kind = 1; r.day = day$1; } if ((s.length === 0) || !((s.charCodeAt(0) === 47))) { r.time = 7200; return [r, s, true]; } _tuple$5 = tzsetOffset($substring(s, 1)); offset = _tuple$5[0]; s = _tuple$5[1]; ok = _tuple$5[2]; if (!ok) { return [new rule.ptr(0, 0, 0, 0, 0), "", false]; } r.time = offset; return [r, s, true]; }; tzsetNum = function(s, min, max) { var _i, _ref, _rune, _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, i, max, min, num, ok, r, rest, s; num = 0; rest = ""; ok = false; if (s.length === 0) { _tmp = 0; _tmp$1 = ""; _tmp$2 = false; num = _tmp; rest = _tmp$1; ok = _tmp$2; return [num, rest, ok]; } num = 0; _ref = s; _i = 0; while (true) { if (!(_i < _ref.length)) { break; } _rune = $decodeRune(_ref, _i); i = _i; r = _rune[0]; if (r < 48 || r > 57) { if ((i === 0) || num < min) { _tmp$3 = 0; _tmp$4 = ""; _tmp$5 = false; num = _tmp$3; rest = _tmp$4; ok = _tmp$5; return [num, rest, ok]; } _tmp$6 = num; _tmp$7 = $substring(s, i); _tmp$8 = true; num = _tmp$6; rest = _tmp$7; ok = _tmp$8; return [num, rest, ok]; } num = $imul(num, (10)); num = num + ((((r >> 0)) - 48 >> 0)) >> 0; if (num > max) { _tmp$9 = 0; _tmp$10 = ""; _tmp$11 = false; num = _tmp$9; rest = _tmp$10; ok = _tmp$11; return [num, rest, ok]; } _i += _rune[1]; } if (num < min) { _tmp$12 = 0; _tmp$13 = ""; _tmp$14 = false; num = _tmp$12; rest = _tmp$13; ok = _tmp$14; return [num, rest, ok]; } _tmp$15 = num; _tmp$16 = ""; _tmp$17 = true; num = _tmp$15; rest = _tmp$16; ok = _tmp$17; return [num, rest, ok]; }; tzruleTime = function(year, r, off) { var _1, _q, _q$1, _q$2, _q$3, _r$1, _r$2, _r$3, d, dow, i, m1, off, r, s, x$1, year, yy0, yy1, yy2; s = 0; _1 = r.kind; if (_1 === (0)) { s = $imul(((r.day - 1 >> 0)), 86400); if (isLeap(year) && r.day >= 60) { s = s + (86400) >> 0; } } else if (_1 === (1)) { s = $imul(r.day, 86400); } else if (_1 === (2)) { m1 = (_r$1 = ((r.mon + 9 >> 0)) % 12, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) + 1 >> 0; yy0 = year; if (r.mon <= 2) { yy0 = yy0 - (1) >> 0; } yy1 = (_q = yy0 / 100, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); yy2 = (_r$2 = yy0 % 100, _r$2 === _r$2 ? _r$2 : $throwRuntimeError("integer divide by zero")); dow = (_r$3 = (((((((_q$1 = ((($imul(26, m1)) - 2 >> 0)) / 10, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")) + 1 >> 0) + yy2 >> 0) + (_q$2 = yy2 / 4, (_q$2 === _q$2 && _q$2 !== 1/0 && _q$2 !== -1/0) ? _q$2 >> 0 : $throwRuntimeError("integer divide by zero")) >> 0) + (_q$3 = yy1 / 4, (_q$3 === _q$3 && _q$3 !== 1/0 && _q$3 !== -1/0) ? _q$3 >> 0 : $throwRuntimeError("integer divide by zero")) >> 0) - ($imul(2, yy1)) >> 0)) % 7, _r$3 === _r$3 ? _r$3 : $throwRuntimeError("integer divide by zero")); if (dow < 0) { dow = dow + (7) >> 0; } d = r.day - dow >> 0; if (d < 0) { d = d + (7) >> 0; } i = 1; while (true) { if (!(i < r.week)) { break; } if ((d + 7 >> 0) >= daysIn(((r.mon >> 0)), year)) { break; } d = d + (7) >> 0; i = i + (1) >> 0; } d = d + ((((x$1 = r.mon - 1 >> 0, ((x$1 < 0 || x$1 >= daysBefore.length) ? ($throwRuntimeError("index out of range"), undefined) : daysBefore[x$1])) >> 0))) >> 0; if (isLeap(year) && r.mon > 2) { d = d + (1) >> 0; } s = $imul(d, 86400); } return (s + r.time >> 0) - off >> 0; }; Location.ptr.prototype.lookupName = function(name, unix) { var _i, _i$1, _r$1, _r$2, _ref, _ref$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, i, i$1, l, nam, name, offset, offset$1, ok, unix, x$1, x$2, x$3, zone$1, zone$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; _tuple = $f._tuple; i = $f.i; i$1 = $f.i$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$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; 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; 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$1 = l.zone, ((i < 0 || i >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$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$2 = (new $Int64(0, zone$1.offset)), new $Int64(unix.$high - x$2.$high, unix.$low - x$2.$low))); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; nam = _tuple[0]; offset$1 = _tuple[1]; if (nam === zone$1.name) { _tmp = offset$1; _tmp$1 = true; offset = _tmp; ok = _tmp$1; $s = -1; return [offset, 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$3 = l.zone, ((i$1 < 0 || i$1 >= x$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + i$1])); if (zone$2.name === name) { _tmp$2 = zone$2.offset; _tmp$3 = true; offset = _tmp$2; ok = _tmp$3; $s = -1; return [offset, ok]; } _i$1++; } $s = -1; return [offset, ok]; /* */ } return; } if ($f === undefined) { $f = { $blk: Location.ptr.prototype.lookupName }; } $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._tuple = _tuple; $f.i = i; $f.i$1 = i$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$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $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); }; Time.ptr.prototype.nsec = function() { var t, x$1; t = this; return (((x$1 = t.wall, new $Uint64(x$1.$high & 0, (x$1.$low & 1073741823) >>> 0)).$low >> 0)); }; Time.prototype.nsec = function() { return this.$val.nsec(); }; Time.ptr.prototype.sec = function() { var t, x$1, x$2, x$3, x$4; t = this; if (!((x$1 = (x$2 = t.wall, new $Uint64(x$2.$high & 2147483648, (x$2.$low & 0) >>> 0)), (x$1.$high === 0 && x$1.$low === 0)))) { return (x$3 = ((x$4 = $shiftRightUint64($shiftLeft64(t.wall, 1), 31), new $Int64(x$4.$high, x$4.$low))), new $Int64(13 + x$3.$high, 3618733952 + x$3.$low)); } return t.ext; }; Time.prototype.sec = function() { return this.$val.sec(); }; Time.ptr.prototype.unixSec = function() { var t, x$1; t = this; return (x$1 = t.sec(), new $Int64(x$1.$high + -15, x$1.$low + 2288912640)); }; Time.prototype.unixSec = function() { return this.$val.unixSec(); }; Time.ptr.prototype.addSec = function(d) { var d, dsec, sec, sum, t, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; t = this; if (!((x$1 = (x$2 = t.wall, new $Uint64(x$2.$high & 2147483648, (x$2.$low & 0) >>> 0)), (x$1.$high === 0 && x$1.$low === 0)))) { sec = ((x$3 = $shiftRightUint64($shiftLeft64(t.wall, 1), 31), new $Int64(x$3.$high, x$3.$low))); dsec = new $Int64(sec.$high + d.$high, sec.$low + d.$low); if ((0 < dsec.$high || (0 === dsec.$high && 0 <= dsec.$low)) && (dsec.$high < 1 || (dsec.$high === 1 && dsec.$low <= 4294967295))) { t.wall = (x$4 = (x$5 = (x$6 = t.wall, new $Uint64(x$6.$high & 0, (x$6.$low & 1073741823) >>> 0)), x$7 = $shiftLeft64((new $Uint64(dsec.$high, dsec.$low)), 30), new $Uint64(x$5.$high | x$7.$high, (x$5.$low | x$7.$low) >>> 0)), new $Uint64(x$4.$high | 2147483648, (x$4.$low | 0) >>> 0)); return; } t.stripMono(); } sum = (x$8 = t.ext, new $Int64(x$8.$high + d.$high, x$8.$low + d.$low)); if (((x$9 = t.ext, (sum.$high > x$9.$high || (sum.$high === x$9.$high && sum.$low > x$9.$low)))) === ((d.$high > 0 || (d.$high === 0 && d.$low > 0)))) { t.ext = sum; } else if ((d.$high > 0 || (d.$high === 0 && d.$low > 0))) { t.ext = new $Int64(2147483647, 4294967295); } else { t.ext = new $Int64(-2147483648, 1); } }; Time.prototype.addSec = function(d) { return this.$val.addSec(d); }; Time.ptr.prototype.setLoc = function(loc) { var loc, t; t = this; if (loc === utcLoc) { loc = ptrType$2.nil; } t.stripMono(); t.loc = loc; }; Time.prototype.setLoc = function(loc) { return this.$val.setLoc(loc); }; Time.ptr.prototype.stripMono = function() { var t, x$1, x$2, x$3, x$4; t = this; if (!((x$1 = (x$2 = t.wall, new $Uint64(x$2.$high & 2147483648, (x$2.$low & 0) >>> 0)), (x$1.$high === 0 && x$1.$low === 0)))) { t.ext = t.sec(); t.wall = (x$3 = t.wall, x$4 = new $Uint64(0, 1073741823), new $Uint64(x$3.$high & x$4.$high, (x$3.$low & x$4.$low) >>> 0)); } }; Time.prototype.stripMono = function() { return this.$val.stripMono(); }; Time.ptr.prototype.After = function(u) { var t, ts, u, us, x$1, x$2, x$3, x$4, x$5, x$6; t = this; if (!((x$1 = (x$2 = (x$3 = t.wall, x$4 = u.wall, new $Uint64(x$3.$high & x$4.$high, (x$3.$low & x$4.$low) >>> 0)), new $Uint64(x$2.$high & 2147483648, (x$2.$low & 0) >>> 0)), (x$1.$high === 0 && x$1.$low === 0)))) { return (x$5 = t.ext, x$6 = u.ext, (x$5.$high > x$6.$high || (x$5.$high === x$6.$high && x$5.$low > x$6.$low))); } ts = t.sec(); us = u.sec(); return (ts.$high > us.$high || (ts.$high === us.$high && ts.$low > us.$low)) || (ts.$high === us.$high && ts.$low === us.$low) && t.nsec() > u.nsec(); }; Time.prototype.After = function(u) { return this.$val.After(u); }; Time.ptr.prototype.Before = function(u) { var t, ts, u, us, x$1, x$2, x$3, x$4, x$5, x$6; t = this; if (!((x$1 = (x$2 = (x$3 = t.wall, x$4 = u.wall, new $Uint64(x$3.$high & x$4.$high, (x$3.$low & x$4.$low) >>> 0)), new $Uint64(x$2.$high & 2147483648, (x$2.$low & 0) >>> 0)), (x$1.$high === 0 && x$1.$low === 0)))) { return (x$5 = t.ext, x$6 = u.ext, (x$5.$high < x$6.$high || (x$5.$high === x$6.$high && x$5.$low < x$6.$low))); } ts = t.sec(); us = u.sec(); return (ts.$high < us.$high || (ts.$high === us.$high && ts.$low < us.$low)) || (ts.$high === us.$high && ts.$low === us.$low) && t.nsec() < u.nsec(); }; Time.prototype.Before = function(u) { return this.$val.Before(u); }; Time.ptr.prototype.Equal = function(u) { var t, u, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8; t = this; if (!((x$1 = (x$2 = (x$3 = t.wall, x$4 = u.wall, new $Uint64(x$3.$high & x$4.$high, (x$3.$low & x$4.$low) >>> 0)), new $Uint64(x$2.$high & 2147483648, (x$2.$low & 0) >>> 0)), (x$1.$high === 0 && x$1.$low === 0)))) { return (x$5 = t.ext, x$6 = u.ext, (x$5.$high === x$6.$high && x$5.$low === x$6.$low)); } return (x$7 = t.sec(), x$8 = u.sec(), (x$7.$high === x$8.$high && x$7.$low === x$8.$low)) && (t.nsec() === u.nsec()); }; Time.prototype.Equal = function(u) { return this.$val.Equal(u); }; Month.prototype.String = function() { var buf, m, n, x$1; m = this.$val; if (1 <= m && m <= 12) { return (x$1 = m - 1 >> 0, ((x$1 < 0 || x$1 >= longMonthNames.$length) ? ($throwRuntimeError("index out of range"), undefined) : longMonthNames.$array[longMonthNames.$offset + x$1])); } buf = $makeSlice(sliceType$3, 20); n = fmtInt(buf, (new $Uint64(0, m))); return "%!Month(" + ($bytesToString($subslice(buf, n))) + ")"; }; $ptrType(Month).prototype.String = function() { return new Month(this.$get()).String(); }; Weekday.prototype.String = function() { var buf, d, n; d = this.$val; if (0 <= d && d <= 6) { return ((d < 0 || d >= longDayNames.$length) ? ($throwRuntimeError("index out of range"), undefined) : longDayNames.$array[longDayNames.$offset + d]); } buf = $makeSlice(sliceType$3, 20); n = fmtInt(buf, (new $Uint64(0, d))); return "%!Weekday(" + ($bytesToString($subslice(buf, n))) + ")"; }; $ptrType(Weekday).prototype.String = function() { return new Weekday(this.$get()).String(); }; Time.ptr.prototype.IsZero = function() { var t, x$1; t = this; return (x$1 = t.sec(), (x$1.$high === 0 && x$1.$low === 0)) && (t.nsec() === 0); }; Time.prototype.IsZero = function() { return this.$val.IsZero(); }; Time.ptr.prototype.abs = function() { var _r$1, _r$2, _tuple, l, offset, sec, t, 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; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; l = $f.l; offset = $f.offset; sec = $f.sec; t = $f.t; 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 = this; l = t.loc; /* */ if (l === ptrType$2.nil || l === localLoc) { $s = 1; continue; } /* */ $s = 2; continue; /* if (l === ptrType$2.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 = t.unixSec(); /* */ 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 = _r$2; offset = _tuple[1]; sec = (x$4 = (new $Int64(0, offset)), new $Int64(sec.$high + x$4.$high, sec.$low + x$4.$low)); /* } */ case 8: /* } */ case 5: $s = -1; 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._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.l = l; $f.offset = offset; $f.sec = sec; $f.t = t; $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 _r$1, _r$2, _tuple, abs, l, name, offset, sec, t, 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; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; abs = $f.abs; l = $f.l; name = $f.name; offset = $f.offset; sec = $f.sec; t = $f.t; 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 = this; l = t.loc; /* */ if (l === ptrType$2.nil || l === localLoc) { $s = 1; continue; } /* */ $s = 2; continue; /* if (l === ptrType$2.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 = t.unixSec(); /* */ 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 = _r$2; name = _tuple[0]; offset = _tuple[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))); $s = -1; return [name, offset, abs]; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.locabs }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.abs = abs; $f.l = l; $f.name = name; $f.offset = offset; $f.sec = sec; $f.t = t; $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 _r$1, _tuple, day, month, t, year, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; 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 = this; _r$1 = $clone(t, Time).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 = _r$1; year = _tuple[0]; month = _tuple[1]; day = _tuple[2]; $s = -1; return [year, month, day]; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Date }; } $f._r$1 = _r$1; $f._tuple = _tuple; $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 _r$1, _tuple, t, year, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; t = $f.t; year = $f.year; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r$1 = $clone(t, Time).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 = _r$1; year = _tuple[0]; $s = -1; return year; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Year }; } $f._r$1 = _r$1; $f._tuple = _tuple; $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 _r$1, _tuple, month, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; month = $f.month; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r$1 = $clone(t, Time).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 = _r$1; month = _tuple[1]; $s = -1; return month; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Month }; } $f._r$1 = _r$1; $f._tuple = _tuple; $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 _r$1, _tuple, day, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; day = $f.day; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r$1 = $clone(t, Time).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 = _r$1; day = _tuple[2]; $s = -1; return day; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Day }; } $f._r$1 = _r$1; $f._tuple = _tuple; $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 $24r, _r$1, _r$2, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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 = this; _r$1 = $clone(t, Time).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; } $24r = _r$2; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Weekday }; } $f.$24r = $24r; $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 _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 _q, _r$1, _tmp, _tmp$1, _tuple, abs, d, t, week, x$1, yday, year, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _q = $f._q; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; abs = $f.abs; d = $f.d; t = $f.t; week = $f.week; x$1 = $f.x$1; yday = $f.yday; year = $f.year; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: year = 0; week = 0; t = this; _r$1 = $clone(t, Time).abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } abs = _r$1; d = 4 - absWeekday(abs) >> 0; if (d === 4) { d = -3; } abs = (x$1 = $mul64((new $Uint64(0, d)), new $Uint64(0, 86400)), new $Uint64(abs.$high + x$1.$high, abs.$low + x$1.$low)); _tuple = absDate(abs, false); year = _tuple[0]; yday = _tuple[3]; _tmp = year; _tmp$1 = (_q = yday / 7, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) + 1 >> 0; year = _tmp; week = _tmp$1; $s = -1; return [year, week]; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.ISOWeek }; } $f._q = _q; $f._r$1 = _r$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.abs = abs; $f.d = d; $f.t = t; $f.week = week; $f.x$1 = x$1; $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 $24r, _r$1, _r$2, _tuple, hour, min, sec, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; 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 = this; _r$1 = $clone(t, Time).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 = _r$2; hour = _tuple[0]; min = _tuple[1]; sec = _tuple[2]; $24r = [hour, min, sec]; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Clock }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $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 _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 $24r, _q, _r$1, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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 = this; _r$1 = $clone(t, Time).abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = (_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")); $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Hour }; } $f.$24r = $24r; $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 $24r, _q, _r$1, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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 = this; _r$1 = $clone(t, Time).abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = (_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")); $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Minute }; } $f.$24r = $24r; $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 $24r, _r$1, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r$1 = $clone(t, Time).abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = (($div64(_r$1, new $Uint64(0, 60), true).$low >> 0)); $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Second }; } $f.$24r = $24r; $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 t; t = this; return ((t.nsec() >> 0)); }; Time.prototype.Nanosecond = function() { return this.$val.Nanosecond(); }; Time.ptr.prototype.YearDay = function() { var _r$1, _tuple, t, yday, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; t = $f.t; yday = $f.yday; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r$1 = $clone(t, Time).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 = _r$1; yday = _tuple[3]; $s = -1; return yday + 1 >> 0; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.YearDay }; } $f._r$1 = _r$1; $f._tuple = _tuple; $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 _tuple, _tuple$1, buf, d, neg, prec, u, w; d = this; buf = arrayType$2.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"), undefined) : buf[w] = 115); w = w - (1) >> 0; if ((u.$high === 0 && u.$low === 0)) { return "0s"; } else if ((u.$high < 0 || (u.$high === 0 && u.$low < 1000))) { prec = 0; ((w < 0 || w >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : 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"), undefined) : buf[w] = 109); } _tuple = fmtFrac($subslice(new sliceType$3(buf), 0, w), u, prec); w = _tuple[0]; u = _tuple[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"), undefined) : buf[w] = 115); _tuple$1 = fmtFrac($subslice(new sliceType$3(buf), 0, w), u, 9); w = _tuple$1[0]; u = _tuple$1[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"), undefined) : 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"), undefined) : 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"), undefined) : 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 _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"), undefined) : 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"), undefined) : buf.$array[buf.$offset + w] = 46); } _tmp = w; _tmp$1 = v; nw = _tmp; nv = _tmp$1; return [nw, nv]; }; fmtInt = function(buf, v) { var 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"), undefined) : 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"), undefined) : 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 d; d = this; return (new $Int64(d.$high, d.$low)); }; $ptrType(Duration).prototype.Nanoseconds = function() { return this.$get().Nanoseconds(); }; Duration.prototype.Microseconds = function() { var d; d = this; return $div64((new $Int64(d.$high, d.$low)), new $Int64(0, 1000), false); }; $ptrType(Duration).prototype.Microseconds = function() { return this.$get().Microseconds(); }; Duration.prototype.Milliseconds = function() { var d; d = this; return $div64((new $Int64(d.$high, d.$low)), new $Int64(0, 1000000), false); }; $ptrType(Duration).prototype.Milliseconds = function() { return this.$get().Milliseconds(); }; Duration.prototype.Seconds = function() { var 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 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)) / 6e+10; }; $ptrType(Duration).prototype.Minutes = function() { return this.$get().Minutes(); }; Duration.prototype.Hours = function() { var 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)) / 3.6e+12; }; $ptrType(Duration).prototype.Hours = function() { return this.$get().Hours(); }; Duration.prototype.Truncate = function(m) { var d, m, x$1; d = this; if ((m.$high < 0 || (m.$high === 0 && m.$low <= 0))) { return d; } return (x$1 = $div64(d, m, true), new Duration(d.$high - x$1.$high, d.$low - x$1.$low)); }; $ptrType(Duration).prototype.Truncate = function(m) { return this.$get().Truncate(m); }; lessThanHalf = function(x$1, y) { var x$1, x$2, x$3, x$4, x$5, y; return (x$2 = (x$3 = (new $Uint64(x$1.$high, x$1.$low)), x$4 = (new $Uint64(x$1.$high, x$1.$low)), new $Uint64(x$3.$high + x$4.$high, x$3.$low + x$4.$low)), x$5 = (new $Uint64(y.$high, y.$low)), (x$2.$high < x$5.$high || (x$2.$high === x$5.$high && x$2.$low < x$5.$low))); }; Duration.prototype.Round = function(m) { var d, d1, d1$1, m, r, x$1, x$2; d = this; if ((m.$high < 0 || (m.$high === 0 && m.$low <= 0))) { return d; } r = $div64(d, m, true); if ((d.$high < 0 || (d.$high === 0 && d.$low < 0))) { r = new Duration(-r.$high, -r.$low); if (lessThanHalf(r, m)) { return new Duration(d.$high + r.$high, d.$low + r.$low); } d1 = (x$1 = new Duration(d.$high - m.$high, d.$low - m.$low), new Duration(x$1.$high + r.$high, x$1.$low + r.$low)); if ((d1.$high < d.$high || (d1.$high === d.$high && d1.$low < d.$low))) { return d1; } return new Duration(-2147483648, 0); } if (lessThanHalf(r, m)) { return new Duration(d.$high - r.$high, d.$low - r.$low); } d1$1 = (x$2 = new Duration(d.$high + m.$high, d.$low + m.$low), new Duration(x$2.$high - r.$high, x$2.$low - r.$low)); if ((d1$1.$high > d.$high || (d1$1.$high === d.$high && d1$1.$low > d.$low))) { return d1$1; } return new Duration(2147483647, 4294967295); }; $ptrType(Duration).prototype.Round = function(m) { return this.$get().Round(m); }; Time.ptr.prototype.Add = function(d) { var d, dsec, nsec, t, te, x$1, x$10, x$11, x$12, x$13, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; t = this; dsec = ((x$1 = $div64(d, new Duration(0, 1000000000), false), new $Int64(x$1.$high, x$1.$low))); nsec = t.nsec() + (((x$2 = $div64(d, new Duration(0, 1000000000), true), x$2.$low + ((x$2.$high >> 31) * 4294967296)) >> 0)) >> 0; if (nsec >= 1000000000) { dsec = (x$3 = new $Int64(0, 1), new $Int64(dsec.$high + x$3.$high, dsec.$low + x$3.$low)); nsec = nsec - (1000000000) >> 0; } else if (nsec < 0) { dsec = (x$4 = new $Int64(0, 1), new $Int64(dsec.$high - x$4.$high, dsec.$low - x$4.$low)); nsec = nsec + (1000000000) >> 0; } t.wall = (x$5 = (x$6 = t.wall, new $Uint64(x$6.$high & ~0, (x$6.$low & ~1073741823) >>> 0)), x$7 = (new $Uint64(0, nsec)), new $Uint64(x$5.$high | x$7.$high, (x$5.$low | x$7.$low) >>> 0)); t.addSec(dsec); if (!((x$8 = (x$9 = t.wall, new $Uint64(x$9.$high & 2147483648, (x$9.$low & 0) >>> 0)), (x$8.$high === 0 && x$8.$low === 0)))) { te = (x$10 = t.ext, x$11 = (new $Int64(d.$high, d.$low)), new $Int64(x$10.$high + x$11.$high, x$10.$low + x$11.$low)); if ((d.$high < 0 || (d.$high === 0 && d.$low < 0)) && (x$12 = t.ext, (te.$high > x$12.$high || (te.$high === x$12.$high && te.$low > x$12.$low))) || (d.$high > 0 || (d.$high === 0 && d.$low > 0)) && (x$13 = t.ext, (te.$high < x$13.$high || (te.$high === x$13.$high && te.$low < x$13.$low)))) { t.stripMono(); } else { t.ext = te; } } return t; }; Time.prototype.Add = function(d) { return this.$val.Add(d); }; Time.ptr.prototype.Sub = function(u) { var d, d$1, t, te, u, ue, x$1, x$10, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; t = this; if (!((x$1 = (x$2 = (x$3 = t.wall, x$4 = u.wall, new $Uint64(x$3.$high & x$4.$high, (x$3.$low & x$4.$low) >>> 0)), new $Uint64(x$2.$high & 2147483648, (x$2.$low & 0) >>> 0)), (x$1.$high === 0 && x$1.$low === 0)))) { te = t.ext; ue = u.ext; d = ((x$5 = new $Int64(te.$high - ue.$high, te.$low - ue.$low), new Duration(x$5.$high, x$5.$low))); if ((d.$high < 0 || (d.$high === 0 && d.$low < 0)) && (te.$high > ue.$high || (te.$high === ue.$high && te.$low > ue.$low))) { return new Duration(2147483647, 4294967295); } if ((d.$high > 0 || (d.$high === 0 && d.$low > 0)) && (te.$high < ue.$high || (te.$high === ue.$high && te.$low < ue.$low))) { return new Duration(-2147483648, 0); } return d; } d$1 = (x$6 = $mul64(((x$7 = (x$8 = t.sec(), x$9 = u.sec(), new $Int64(x$8.$high - x$9.$high, x$8.$low - x$9.$low)), new Duration(x$7.$high, x$7.$low))), new Duration(0, 1000000000)), x$10 = (new Duration(0, (t.nsec() - u.nsec() >> 0))), new Duration(x$6.$high + x$10.$high, x$6.$low + x$10.$low)); if ($clone($clone(u, Time).Add(d$1), Time).Equal($clone(t, Time))) { return d$1; } else if ($clone(t, Time).Before($clone(u, Time))) { return new Duration(-2147483648, 0); } else { return new Duration(2147483647, 4294967295); } }; Time.prototype.Sub = function(u) { return this.$val.Sub(u); }; Since = function(t) { var _r$1, _r$2, now$1, t, x$1, x$2, x$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; now$1 = $f.now$1; t = $f.t; 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: now$1 = new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil); /* */ if (!((x$1 = (x$2 = t.wall, new $Uint64(x$2.$high & 2147483648, (x$2.$low & 0) >>> 0)), (x$1.$high === 0 && x$1.$low === 0)))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((x$1 = (x$2 = t.wall, new $Uint64(x$2.$high & 2147483648, (x$2.$low & 0) >>> 0)), (x$1.$high === 0 && x$1.$low === 0)))) { */ case 1: _r$1 = runtimeNano(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } Time.copy(now$1, new Time.ptr(new $Uint64(2147483648, 0), (x$3 = _r$1, new $Int64(x$3.$high - startNano.$high, x$3.$low - startNano.$low)), ptrType$2.nil)); $s = 3; continue; /* } else { */ case 2: _r$2 = Now(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } Time.copy(now$1, _r$2); /* } */ case 3: $s = -1; return $clone(now$1, Time).Sub($clone(t, Time)); /* */ } return; } if ($f === undefined) { $f = { $blk: Since }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f.now$1 = now$1; $f.t = t; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Since = Since; Until = function(t) { var _r$1, _r$2, now$1, t, x$1, x$2, x$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; now$1 = $f.now$1; t = $f.t; 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: now$1 = new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil); /* */ if (!((x$1 = (x$2 = t.wall, new $Uint64(x$2.$high & 2147483648, (x$2.$low & 0) >>> 0)), (x$1.$high === 0 && x$1.$low === 0)))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((x$1 = (x$2 = t.wall, new $Uint64(x$2.$high & 2147483648, (x$2.$low & 0) >>> 0)), (x$1.$high === 0 && x$1.$low === 0)))) { */ case 1: _r$1 = runtimeNano(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } Time.copy(now$1, new Time.ptr(new $Uint64(2147483648, 0), (x$3 = _r$1, new $Int64(x$3.$high - startNano.$high, x$3.$low - startNano.$low)), ptrType$2.nil)); $s = 3; continue; /* } else { */ case 2: _r$2 = Now(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } Time.copy(now$1, _r$2); /* } */ case 3: $s = -1; return $clone(t, Time).Sub($clone(now$1, Time)); /* */ } return; } if ($f === undefined) { $f = { $blk: Until }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f.now$1 = now$1; $f.t = t; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Until = Until; Time.ptr.prototype.AddDate = function(years, months, days) { var $24r, _r$1, _r$2, _r$3, _tuple, _tuple$1, day, days, hour, min, month, months, sec, t, year, years, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; day = $f.day; days = $f.days; hour = $f.hour; min = $f.min; month = $f.month; months = $f.months; 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 = this; _r$1 = $clone(t, Time).Date(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; year = _tuple[0]; month = _tuple[1]; day = _tuple[2]; _r$2 = $clone(t, Time).Clock(); /* */ $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]; _r$3 = Date(year + years >> 0, month + ((months >> 0)) >> 0, day + days >> 0, hour, min, sec, ((t.nsec() >> 0)), $clone(t, Time).Location()); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = _r$3; $s = 4; case 4: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.AddDate }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.day = day; $f.days = days; $f.hour = hour; $f.min = min; $f.month = month; $f.months = months; $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, days) { return this.$val.AddDate(years, months, days); }; Time.ptr.prototype.date = function(full) { var $24r, _r$1, _r$2, _tuple, day, full, month, t, yday, year, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; 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 = this; _r$1 = $clone(t, Time).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 = _r$2; year = _tuple[0]; month = _tuple[1]; day = _tuple[2]; yday = _tuple[3]; $24r = [year, month, day, yday]; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.date }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $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 _q, abs, begin, d, day, end, full, month, n, 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, 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$1 = $mul64(new $Uint64(0, 146097), n), new $Uint64(d.$high - x$1.$high, d.$low - x$1.$low)); n = $div64(d, new $Uint64(0, 36524), false); n = (x$2 = $shiftRightUint64(n, 2), new $Uint64(n.$high - x$2.$high, n.$low - x$2.$low)); 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(d, new $Uint64(0, 1461), 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 = $div64(d, new $Uint64(0, 365), false); n = (x$7 = $shiftRightUint64(n, 2), new $Uint64(n.$high - x$7.$high, n.$low - x$7.$low)); y = (x$8 = n, new $Uint64(y.$high + x$8.$high, y.$low + x$8.$low)); d = (x$9 = $mul64(new $Uint64(0, 365), n), new $Uint64(d.$high - x$9.$high, d.$low - x$9.$low)); year = (((x$10 = (x$11 = (new $Int64(y.$high, y.$low)), new $Int64(x$11.$high + -69, x$11.$low + 4075721025)), x$10.$low + ((x$10.$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$12 = month + 1 >> 0, ((x$12 < 0 || x$12 >= daysBefore.length) ? ($throwRuntimeError("index out of range"), undefined) : daysBefore[x$12])) >> 0)); begin = 0; if (day >= end) { month = month + (1) >> 0; begin = end; } else { begin = ((((month < 0 || month >= daysBefore.length) ? ($throwRuntimeError("index out of range"), undefined) : daysBefore[month]) >> 0)); } month = month + (1) >> 0; day = (day - begin >> 0) + 1 >> 0; return [year, month, day, yday]; }; daysIn = function(m, year) { var m, x$1, year; if ((m === 2) && isLeap(year)) { return 29; } return (((((m < 0 || m >= daysBefore.length) ? ($throwRuntimeError("index out of range"), undefined) : daysBefore[m]) - (x$1 = m - 1 >> 0, ((x$1 < 0 || x$1 >= daysBefore.length) ? ($throwRuntimeError("index out of range"), undefined) : daysBefore[x$1])) >> 0) >> 0)); }; daysSinceEpoch = function(year) { var d, n, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, y, year; y = ((x$1 = (x$2 = (new $Int64(0, year)), new $Int64(x$2.$high - -69, x$2.$low - 4075721025)), new $Uint64(x$1.$high, x$1.$low))); n = $div64(y, new $Uint64(0, 400), false); y = (x$3 = $mul64(new $Uint64(0, 400), n), new $Uint64(y.$high - x$3.$high, y.$low - x$3.$low)); d = $mul64(new $Uint64(0, 146097), n); n = $div64(y, new $Uint64(0, 100), false); y = (x$4 = $mul64(new $Uint64(0, 100), n), new $Uint64(y.$high - x$4.$high, y.$low - x$4.$low)); d = (x$5 = $mul64(new $Uint64(0, 36524), n), new $Uint64(d.$high + x$5.$high, d.$low + x$5.$low)); n = $div64(y, new $Uint64(0, 4), false); y = (x$6 = $mul64(new $Uint64(0, 4), n), new $Uint64(y.$high - x$6.$high, y.$low - x$6.$low)); d = (x$7 = $mul64(new $Uint64(0, 1461), n), new $Uint64(d.$high + x$7.$high, d.$low + x$7.$low)); n = y; d = (x$8 = $mul64(new $Uint64(0, 365), n), new $Uint64(d.$high + x$8.$high, d.$low + x$8.$low)); return d; }; runtimeNano = function() { $throwRuntimeError("native function not implemented: time.runtimeNano"); }; Now = function() { var _r$1, _tuple, mono, nsec, sec, x$1, x$2, x$3, x$4, x$5, x$6, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; mono = $f.mono; nsec = $f.nsec; sec = $f.sec; 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; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = now(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; sec = _tuple[0]; nsec = _tuple[1]; mono = _tuple[2]; mono = (x$1 = startNano, new $Int64(mono.$high - x$1.$high, mono.$low - x$1.$low)); sec = (x$2 = new $Int64(0, 2682288000), new $Int64(sec.$high + x$2.$high, sec.$low + x$2.$low)); if (!((x$3 = $shiftRightUint64((new $Uint64(sec.$high, sec.$low)), 33), (x$3.$high === 0 && x$3.$low === 0)))) { $s = -1; return new Time.ptr((new $Uint64(0, nsec)), new $Int64(sec.$high + 13, sec.$low + 3618733952), $pkg.Local); } $s = -1; return new Time.ptr((x$4 = (x$5 = $shiftLeft64((new $Uint64(sec.$high, sec.$low)), 30), new $Uint64(2147483648 | x$5.$high, (0 | x$5.$low) >>> 0)), x$6 = (new $Uint64(0, nsec)), new $Uint64(x$4.$high | x$6.$high, (x$4.$low | x$6.$low) >>> 0)), mono, $pkg.Local); /* */ } return; } if ($f === undefined) { $f = { $blk: Now }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.mono = mono; $f.nsec = nsec; $f.sec = sec; $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.$s = $s; $f.$r = $r; return $f; }; $pkg.Now = Now; unixTime = function(sec, nsec) { var nsec, sec; return new Time.ptr((new $Uint64(0, nsec)), new $Int64(sec.$high + 14, sec.$low + 2006054656), $pkg.Local); }; Time.ptr.prototype.UTC = function() { var t; t = this; t.setLoc(utcLoc); return t; }; Time.prototype.UTC = function() { return this.$val.UTC(); }; Time.ptr.prototype.Local = function() { var t; t = this; t.setLoc($pkg.Local); return t; }; Time.prototype.Local = function() { return this.$val.Local(); }; Time.ptr.prototype.In = function(loc) { var loc, t; t = this; if (loc === ptrType$2.nil) { $panic(new $String("time: missing Location in call to Time.In")); } t.setLoc(loc); return t; }; Time.prototype.In = function(loc) { return this.$val.In(loc); }; Time.ptr.prototype.Location = function() { var l, t; t = this; l = t.loc; if (l === ptrType$2.nil) { l = $pkg.UTC; } return l; }; Time.prototype.Location = function() { return this.$val.Location(); }; Time.ptr.prototype.Zone = function() { var _r$1, _tuple, name, offset, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; name = $f.name; offset = $f.offset; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: name = ""; offset = 0; t = this; _r$1 = t.loc.lookup(t.unixSec()); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; name = _tuple[0]; offset = _tuple[1]; $s = -1; return [name, offset]; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Zone }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.name = name; $f.offset = offset; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.Zone = function() { return this.$val.Zone(); }; Time.ptr.prototype.Unix = function() { var t; t = this; return t.unixSec(); }; Time.prototype.Unix = function() { return this.$val.Unix(); }; Time.ptr.prototype.UnixMilli = function() { var t, x$1, x$2; t = this; return (x$1 = $mul64(t.unixSec(), new $Int64(0, 1000)), x$2 = $div64((new $Int64(0, t.nsec())), new $Int64(0, 1000000), false), new $Int64(x$1.$high + x$2.$high, x$1.$low + x$2.$low)); }; Time.prototype.UnixMilli = function() { return this.$val.UnixMilli(); }; Time.ptr.prototype.UnixMicro = function() { var t, x$1, x$2; t = this; return (x$1 = $mul64(t.unixSec(), new $Int64(0, 1000000)), x$2 = $div64((new $Int64(0, t.nsec())), new $Int64(0, 1000), false), new $Int64(x$1.$high + x$2.$high, x$1.$low + x$2.$low)); }; Time.prototype.UnixMicro = function() { return this.$val.UnixMicro(); }; Time.ptr.prototype.UnixNano = function() { var t, x$1, x$2; t = this; return (x$1 = $mul64((t.unixSec()), new $Int64(0, 1000000000)), x$2 = (new $Int64(0, t.nsec())), new $Int64(x$1.$high + x$2.$high, x$1.$low + x$2.$low)); }; Time.prototype.UnixNano = function() { return this.$val.UnixNano(); }; Time.ptr.prototype.MarshalBinary = function() { var _q, _r$1, _r$2, _tuple, enc, nsec, offset, offsetMin, sec, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _q = $f._q; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; enc = $f.enc; nsec = $f.nsec; offset = $f.offset; offsetMin = $f.offsetMin; sec = $f.sec; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; offsetMin = 0; /* */ if ($clone(t, Time).Location() === $pkg.UTC) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($clone(t, Time).Location() === $pkg.UTC) { */ case 1: offsetMin = -1; $s = 3; continue; /* } else { */ case 2: _r$1 = $clone(t, Time).Zone(); /* */ $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; offset = _tuple[1]; if (!(((_r$2 = offset % 60, _r$2 === _r$2 ? _r$2 : $throwRuntimeError("integer divide by zero")) === 0))) { $s = -1; 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) { $s = -1; return [sliceType$3.nil, errors.New("Time.MarshalBinary: unexpected zone offset")]; } offsetMin = ((offset << 16 >> 16)); /* } */ case 3: sec = t.sec(); nsec = t.nsec(); enc = new sliceType$3([1, (($shiftRightInt64(sec, 56).$low << 24 >>> 24)), (($shiftRightInt64(sec, 48).$low << 24 >>> 24)), (($shiftRightInt64(sec, 40).$low << 24 >>> 24)), (($shiftRightInt64(sec, 32).$low << 24 >>> 24)), (($shiftRightInt64(sec, 24).$low << 24 >>> 24)), (($shiftRightInt64(sec, 16).$low << 24 >>> 24)), (($shiftRightInt64(sec, 8).$low << 24 >>> 24)), ((sec.$low << 24 >>> 24)), (((nsec >> 24 >> 0) << 24 >>> 24)), (((nsec >> 16 >> 0) << 24 >>> 24)), (((nsec >> 8 >> 0) << 24 >>> 24)), ((nsec << 24 >>> 24)), (((offsetMin >> 8 << 16 >> 16) << 24 >>> 24)), ((offsetMin << 24 >>> 24))]); $s = -1; return [enc, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.MarshalBinary }; } $f._q = _q; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.enc = enc; $f.nsec = nsec; $f.offset = offset; $f.offsetMin = offsetMin; $f.sec = sec; $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) { var _r$1, _tuple, buf, data, localoff, nsec, offset, sec, t, 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; _r$1 = $f._r$1; _tuple = $f._tuple; buf = $f.buf; data = $f.data; localoff = $f.localoff; nsec = $f.nsec; offset = $f.offset; sec = $f.sec; t = $f.t; 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; if (buf.$length === 0) { $s = -1; return errors.New("Time.UnmarshalBinary: no data"); } if (!(((0 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 0]) === 1))) { $s = -1; return errors.New("Time.UnmarshalBinary: unsupported version"); } if (!((buf.$length === 15))) { $s = -1; return errors.New("Time.UnmarshalBinary: invalid length"); } buf = $subslice(buf, 1); sec = (x$1 = (x$2 = (x$3 = (x$4 = (x$5 = (x$6 = (x$7 = (new $Int64(0, (7 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 7]))), x$8 = $shiftLeft64((new $Int64(0, (6 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 6]))), 8), new $Int64(x$7.$high | x$8.$high, (x$7.$low | x$8.$low) >>> 0)), x$9 = $shiftLeft64((new $Int64(0, (5 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 5]))), 16), new $Int64(x$6.$high | x$9.$high, (x$6.$low | x$9.$low) >>> 0)), x$10 = $shiftLeft64((new $Int64(0, (4 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 4]))), 24), new $Int64(x$5.$high | x$10.$high, (x$5.$low | x$10.$low) >>> 0)), x$11 = $shiftLeft64((new $Int64(0, (3 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 3]))), 32), new $Int64(x$4.$high | x$11.$high, (x$4.$low | x$11.$low) >>> 0)), x$12 = $shiftLeft64((new $Int64(0, (2 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 2]))), 40), new $Int64(x$3.$high | x$12.$high, (x$3.$low | x$12.$low) >>> 0)), x$13 = $shiftLeft64((new $Int64(0, (1 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 1]))), 48), new $Int64(x$2.$high | x$13.$high, (x$2.$low | x$13.$low) >>> 0)), x$14 = $shiftLeft64((new $Int64(0, (0 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 0]))), 56), new $Int64(x$1.$high | x$14.$high, (x$1.$low | x$14.$low) >>> 0)); buf = $subslice(buf, 8); nsec = (((((3 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 3]) >> 0)) | ((((2 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 2]) >> 0)) << 8 >> 0)) | ((((1 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 1]) >> 0)) << 16 >> 0)) | ((((0 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 0]) >> 0)) << 24 >> 0); buf = $subslice(buf, 4); offset = $imul(((((((1 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 1]) << 16 >> 16)) | ((((0 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 0]) << 16 >> 16)) << 8 << 16 >> 16)) >> 0)), 60); Time.copy(t, new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil)); t.wall = (new $Uint64(0, nsec)); t.ext = sec; /* */ if (offset === -60) { $s = 1; continue; } /* */ $s = 2; continue; /* if (offset === -60) { */ case 1: t.setLoc(utcLoc); $s = 3; continue; /* } else { */ case 2: _r$1 = $pkg.Local.lookup(t.unixSec()); /* */ $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; localoff = _tuple[1]; if (offset === localoff) { t.setLoc($pkg.Local); } else { t.setLoc(FixedZone("", offset)); } /* } */ case 3: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.UnmarshalBinary }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.buf = buf; $f.data = data; $f.localoff = localoff; $f.nsec = nsec; $f.offset = offset; $f.sec = sec; $f.t = t; $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) { return this.$val.UnmarshalBinary(data); }; Time.ptr.prototype.GobEncode = function() { var $24r, _r$1, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r$1 = $clone(t, Time).MarshalBinary(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.GobEncode }; } $f.$24r = $24r; $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) { var $24r, _r$1, data, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; data = $f.data; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r$1 = t.UnmarshalBinary(data); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.GobDecode }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.data = data; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.GobDecode = function(data) { return this.$val.GobDecode(data); }; Time.ptr.prototype.MarshalJSON = function() { var _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; _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 = this; _r$1 = $clone(t, Time).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) { $s = -1; 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 = $clone(t, Time).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); $s = -1; return [b, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.MarshalJSON }; } $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) { var _r$1, _tuple, data, err, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; data = $f.data; err = $f.err; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; if (($bytesToString(data)) === "null") { $s = -1; return $ifaceNil; } err = $ifaceNil; _r$1 = Parse("\"2006-01-02T15:04:05Z07:00\"", ($bytesToString(data))); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; Time.copy(t, _tuple[0]); err = _tuple[1]; $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.UnmarshalJSON }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.data = data; $f.err = err; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.UnmarshalJSON = function(data) { return this.$val.UnmarshalJSON(data); }; Time.ptr.prototype.MarshalText = function() { var $24r, _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; $24r = $f.$24r; _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 = this; _r$1 = $clone(t, Time).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) { $s = -1; return [sliceType$3.nil, errors.New("Time.MarshalText: year outside of range [0,9999]")]; } b = $makeSlice(sliceType$3, 0, 35); _r$2 = $clone(t, Time).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; } $24r = [_r$2, $ifaceNil]; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.MarshalText }; } $f.$24r = $24r; $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) { var _r$1, _tuple, data, err, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; data = $f.data; err = $f.err; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; err = $ifaceNil; _r$1 = Parse("2006-01-02T15:04:05Z07:00", ($bytesToString(data))); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; Time.copy(t, _tuple[0]); err = _tuple[1]; $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.UnmarshalText }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.data = data; $f.err = err; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.UnmarshalText = function(data) { return this.$val.UnmarshalText(data); }; Unix = function(sec, nsec) { var n, nsec, sec, x$1, x$2, x$3, x$4; 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$1 = n, new $Int64(sec.$high + x$1.$high, sec.$low + x$1.$low)); nsec = (x$2 = $mul64(n, new $Int64(0, 1000000000)), new $Int64(nsec.$high - x$2.$high, nsec.$low - x$2.$low)); if ((nsec.$high < 0 || (nsec.$high === 0 && nsec.$low < 0))) { nsec = (x$3 = new $Int64(0, 1000000000), new $Int64(nsec.$high + x$3.$high, nsec.$low + x$3.$low)); sec = (x$4 = new $Int64(0, 1), new $Int64(sec.$high - x$4.$high, sec.$low - x$4.$low)); } } return unixTime(sec, (((nsec.$low + ((nsec.$high >> 31) * 4294967296)) >> 0))); }; $pkg.Unix = Unix; Time.ptr.prototype.IsDST = function() { var _r$1, _tuple, isDST, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; isDST = $f.isDST; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r$1 = t.loc.lookup($clone(t, Time).Unix()); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; isDST = _tuple[4]; $s = -1; return isDST; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.IsDST }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.isDST = isDST; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.IsDST = function() { return this.$val.IsDST(); }; isLeap = function(year) { var _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 _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 _r$1, _r$2, _r$3, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, abs, d, day, end, hour, loc, m, min, month, nsec, offset, sec, start, t, unix, utc, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, year, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _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; 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; nsec = $f.nsec; offset = $f.offset; sec = $f.sec; start = $f.start; t = $f.t; unix = $f.unix; utc = $f.utc; 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; year = $f.year; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (loc === ptrType$2.nil) { $panic(new $String("time: missing Location in call to Date")); } m = ((month >> 0)) - 1 >> 0; _tuple = norm(year, m, 12); year = _tuple[0]; m = _tuple[1]; month = ((m >> 0)) + 1 >> 0; _tuple$1 = norm(sec, nsec, 1000000000); sec = _tuple$1[0]; nsec = _tuple$1[1]; _tuple$2 = norm(min, sec, 60); min = _tuple$2[0]; sec = _tuple$2[1]; _tuple$3 = norm(hour, min, 60); hour = _tuple$3[0]; min = _tuple$3[1]; _tuple$4 = norm(day, hour, 24); day = _tuple$4[0]; hour = _tuple$4[1]; d = daysSinceEpoch(year); d = (x$1 = (new $Uint64(0, (x$2 = month - 1 >> 0, ((x$2 < 0 || x$2 >= daysBefore.length) ? ($throwRuntimeError("index out of range"), undefined) : daysBefore[x$2])))), new $Uint64(d.$high + x$1.$high, d.$low + x$1.$low)); if (isLeap(year) && month >= 3) { d = (x$3 = new $Uint64(0, 1), new $Uint64(d.$high + x$3.$high, d.$low + x$3.$low)); } d = (x$4 = (new $Uint64(0, (day - 1 >> 0))), new $Uint64(d.$high + x$4.$high, d.$low + x$4.$low)); abs = $mul64(d, new $Uint64(0, 86400)); abs = (x$5 = (new $Uint64(0, ((($imul(hour, 3600)) + ($imul(min, 60)) >> 0) + sec >> 0))), new $Uint64(abs.$high + x$5.$high, abs.$low + x$5.$low)); unix = (x$6 = (new $Int64(abs.$high, abs.$low)), new $Int64(x$6.$high + -2147483647, x$6.$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$5 = _r$1; offset = _tuple$5[1]; start = _tuple$5[2]; end = _tuple$5[3]; /* */ if (!((offset === 0))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!((offset === 0))) { */ case 2: utc = (x$7 = (new $Int64(0, offset)), new $Int64(unix.$high - x$7.$high, unix.$low - x$7.$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$6 = _r$2; offset = _tuple$6[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$7 = _r$3; offset = _tuple$7[1]; /* } */ case 7: case 4: unix = (x$8 = (new $Int64(0, offset)), new $Int64(unix.$high - x$8.$high, unix.$low - x$8.$low)); /* } */ case 3: t = $clone(unixTime(unix, ((nsec >> 0))), Time); t.setLoc(loc); $s = -1; return t; /* */ } return; } if ($f === undefined) { $f = { $blk: Date }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $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.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.nsec = nsec; $f.offset = offset; $f.sec = sec; $f.start = start; $f.t = t; $f.unix = unix; $f.utc = utc; $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.year = year; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Date = Date; Time.ptr.prototype.Truncate = function(d) { var _tuple, d, r, t; t = this; t.stripMono(); if ((d.$high < 0 || (d.$high === 0 && d.$low <= 0))) { return t; } _tuple = div($clone(t, Time), d); r = _tuple[1]; return $clone(t, Time).Add(new Duration(-r.$high, -r.$low)); }; Time.prototype.Truncate = function(d) { return this.$val.Truncate(d); }; Time.ptr.prototype.Round = function(d) { var _tuple, d, r, t; t = this; t.stripMono(); if ((d.$high < 0 || (d.$high === 0 && d.$low <= 0))) { return t; } _tuple = div($clone(t, Time), d); r = _tuple[1]; if (lessThanHalf(r, d)) { return $clone(t, Time).Add(new Duration(-r.$high, -r.$low)); } return $clone(t, Time).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 _q, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, d, d0, d1, d1$1, neg, nsec, qmod2, r, sec, sec$1, t, tmp, u0, u0x, u1, 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; qmod2 = 0; r = new Duration(0, 0); neg = false; nsec = t.nsec(); sec = t.sec(); if ((sec.$high < 0 || (sec.$high === 0 && sec.$low < 0))) { neg = true; sec = new $Int64(-sec.$high, -sec.$low); nsec = -nsec; if (nsec < 0) { nsec = nsec + (1000000000) >> 0; sec = (x$1 = new $Int64(0, 1), new $Int64(sec.$high - x$1.$high, sec.$low - x$1.$low)); } } if ((d.$high < 0 || (d.$high === 0 && d.$low < 1000000000)) && (x$2 = $div64(new Duration(0, 1000000000), (new Duration(d.$high + d.$high, d.$low + d.$low)), true), (x$2.$high === 0 && x$2.$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$3 = $div64(d, new Duration(0, 1000000000), true), (x$3.$high === 0 && x$3.$low === 0))) { d1 = ((x$4 = $div64(d, new Duration(0, 1000000000), false), new $Int64(x$4.$high, x$4.$low))); qmod2 = (((x$5 = $div64(sec, d1, false), x$5.$low + ((x$5.$high >> 31) * 4294967296)) >> 0)) & 1; r = (x$6 = $mul64(((x$7 = $div64(sec, d1, true), new Duration(x$7.$high, x$7.$low))), new Duration(0, 1000000000)), x$8 = (new Duration(0, nsec)), new Duration(x$6.$high + x$8.$high, x$6.$low + x$8.$low)); } else { sec$1 = (new $Uint64(sec.$high, sec.$low)); tmp = $mul64(($shiftRightUint64(sec$1, 32)), new $Uint64(0, 1000000000)); u1 = $shiftRightUint64(tmp, 32); u0 = $shiftLeft64(tmp, 32); tmp = $mul64((new $Uint64(sec$1.$high & 0, (sec$1.$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$9 = new $Uint64(0, 1), new $Uint64(u1.$high + x$9.$high, u1.$low + x$9.$low)); } _tmp$2 = u0; _tmp$3 = (x$10 = (new $Uint64(0, nsec)), new $Uint64(u0.$high + x$10.$high, u0.$low + x$10.$low)); u0x = _tmp$2; u0 = _tmp$3; if ((u0.$high < u0x.$high || (u0.$high === u0x.$high && u0.$low < u0x.$low))) { u1 = (x$11 = new $Uint64(0, 1), new $Uint64(u1.$high + x$11.$high, u1.$low + x$11.$low)); } d1$1 = (new $Uint64(d.$high, d.$low)); while (true) { if (!(!((x$12 = $shiftRightUint64(d1$1, 63), (x$12.$high === 0 && x$12.$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$13 = new $Uint64(0, 1), new $Uint64(u1.$high - x$13.$high, u1.$low - x$13.$low)); } u1 = (x$14 = d1$1, new $Uint64(u1.$high - x$14.$high, u1.$low - x$14.$low)); } if ((d1$1.$high === 0 && d1$1.$low === 0) && (x$15 = (new $Uint64(d.$high, d.$low)), (d0.$high === x$15.$high && d0.$low === x$15.$low))) { break; } d0 = $shiftRightUint64(d0, (1)); d0 = (x$16 = $shiftLeft64((new $Uint64(d1$1.$high & 0, (d1$1.$low & 1) >>> 0)), 63), new $Uint64(d0.$high | x$16.$high, (d0.$low | x$16.$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]; }; when = function(d) { var $24r, _r$1, _r$2, d, t, x$1, x$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; d = $f.d; t = $f.t; x$1 = $f.x$1; x$2 = $f.x$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if ((d.$high < 0 || (d.$high === 0 && d.$low <= 0))) { $s = 1; continue; } /* */ $s = 2; continue; /* if ((d.$high < 0 || (d.$high === 0 && d.$low <= 0))) { */ case 1: _r$1 = runtimeNano(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 4; case 4: return $24r; /* } */ case 2: _r$2 = runtimeNano(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } t = (x$1 = _r$2, x$2 = (new $Int64(d.$high, d.$low)), new $Int64(x$1.$high + x$2.$high, x$1.$low + x$2.$low)); if ((t.$high < 0 || (t.$high === 0 && t.$low < 0))) { t = new $Int64(2147483647, 4294967295); } $s = -1; return t; /* */ } return; } if ($f === undefined) { $f = { $blk: when }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.d = d; $f.t = t; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; }; Timer.ptr.prototype.Stop = function() { var t; t = this; if (t.r.f === $throwNilPointerError) { $panic(new $String("time: Stop called on uninitialized Timer")); } return stopTimer(t.r); }; Timer.prototype.Stop = function() { return this.$val.Stop(); }; NewTimer = function(d) { var _r$1, c, d, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; c = $f.c; d = $f.d; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = new $Chan(Time, 1); _r$1 = when(d); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } t = new Timer.ptr(c, new runtimeTimer.ptr(0, _r$1, new $Int64(0, 0), sendTime, new chanType(c), 0, null, false)); $r = startTimer(t.r); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return t; /* */ } return; } if ($f === undefined) { $f = { $blk: NewTimer }; } $f._r$1 = _r$1; $f.c = c; $f.d = d; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.NewTimer = NewTimer; Timer.ptr.prototype.Reset = function(d) { var $24r, _r$1, _r$2, d, t, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; d = $f.d; t = $f.t; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; if (t.r.f === $throwNilPointerError) { $panic(new $String("time: Reset called on uninitialized Timer")); } _r$1 = when(d); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } w = _r$1; _r$2 = resetTimer(t.r, w); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Timer.ptr.prototype.Reset }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.d = d; $f.t = t; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; Timer.prototype.Reset = function(d) { return this.$val.Reset(d); }; sendTime = function(c, seq) { var _r$1, _selection, c, seq, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _selection = $f._selection; c = $f.c; seq = $f.seq; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = Now(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _selection = $select([[$assertType(c, chanType), $clone(_r$1, Time)], []]); /* */ if (_selection[0] === 0) { $s = 2; continue; } /* */ if (_selection[0] === 1) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_selection[0] === 0) { */ case 2: $s = 4; continue; /* } else if (_selection[0] === 1) { */ case 3: /* } */ case 4: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: sendTime }; } $f._r$1 = _r$1; $f._selection = _selection; $f.c = c; $f.seq = seq; $f.$s = $s; $f.$r = $r; return $f; }; After = function(d) { var $24r, _r$1, d, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; d = $f.d; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = NewTimer(d); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1.C; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: After }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.d = d; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.After = After; AfterFunc = function(d, f) { var _r$1, d, f, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; d = $f.d; f = $f.f; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = when(d); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } t = new Timer.ptr($chanNil, new runtimeTimer.ptr(0, _r$1, new $Int64(0, 0), goFunc, new funcType(f), 0, null, false)); $r = startTimer(t.r); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return t; /* */ } return; } if ($f === undefined) { $f = { $blk: AfterFunc }; } $f._r$1 = _r$1; $f.d = d; $f.f = f; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.AfterFunc = AfterFunc; goFunc = function(arg, seq) { var arg, seq; $go($assertType(arg, funcType), []); }; initLocal = function() { var _q, _r$1, d, min, offset, z; localLoc.name = "Local"; z = new zone.ptr("", 0, false); d = new ($global.Date)(); offset = $imul(($parseInt(d.getTimezoneOffset()) >> 0), -1); z.offset = $imul(offset, 60); z.name = "UTC"; if (offset < 0) { z.name = z.name + ("-"); offset = $imul(offset, (-1)); } else { z.name = z.name + ("+"); } z.name = z.name + (itoa((_q = offset / 60, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")))); min = (_r$1 = offset % 60, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")); if (!((min === 0))) { z.name = z.name + (":" + itoa(min)); } localLoc.zone = new sliceType([$clone(z, zone)]); }; itoa = function(i) { var i; if (i < 10) { return $substring("0123456789", i, (i + 1 >> 0)); } return $substring("00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899", ($imul(i, 2)), (($imul(i, 2)) + 2 >> 0)); }; init = function() { $unused(Unix(new $Int64(0, 0), new $Int64(0, 0))); }; now = function() { var _r$1, _tmp, _tmp$1, _tmp$2, mono, n, nsec, sec, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; mono = $f.mono; n = $f.n; nsec = $f.nsec; sec = $f.sec; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sec = new $Int64(0, 0); nsec = 0; mono = new $Int64(0, 0); _r$1 = runtimeNano(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } n = _r$1; _tmp = $div64(n, new $Int64(0, 1000000000), false); _tmp$1 = (((x$1 = $div64(n, new $Int64(0, 1000000000), true), x$1.$low + ((x$1.$high >> 31) * 4294967296)) >> 0)); _tmp$2 = n; sec = _tmp; nsec = _tmp$1; mono = _tmp$2; $s = -1; return [sec, nsec, mono]; /* */ } return; } if ($f === undefined) { $f = { $blk: now }; } $f._r$1 = _r$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f.mono = mono; $f.n = n; $f.nsec = nsec; $f.sec = sec; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; Sleep = function(d) { var _r$1, c, d, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; c = $f.c; d = $f.d; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = [c]; c[0] = new $Chan(structType, 0); $setTimeout((function(c) { return function() { $close(c[0]); }; })(c), (((x$1 = $div64(d, new Duration(0, 1000000), false), x$1.$low + ((x$1.$high >> 31) * 4294967296)) >> 0))); _r$1 = $recv(c[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1[0]; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Sleep }; } $f._r$1 = _r$1; $f.c = c; $f.d = d; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Sleep = Sleep; startTimer = function(t) { var _r$1, diff, t, x$1, x$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; diff = $f.diff; t = $f.t; x$1 = $f.x$1; x$2 = $f.x$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = [t]; t[0].active = true; _r$1 = runtimeNano(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } diff = $div64(((x$1 = t[0].when, x$2 = _r$1, new $Int64(x$1.$high - x$2.$high, x$1.$low - x$2.$low))), new $Int64(0, 1000000), false); if ((diff.$high > 0 || (diff.$high === 0 && diff.$low > 2147483647))) { $s = -1; return; } if ((diff.$high < 0 || (diff.$high === 0 && diff.$low < 0))) { diff = new $Int64(0, 0); } t[0].timeout = $setTimeout((function(t) { return function $b() { var x$3, x$4, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; 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[0].active = false; /* */ if (!((x$3 = t[0].period, (x$3.$high === 0 && x$3.$low === 0)))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((x$3 = t[0].period, (x$3.$high === 0 && x$3.$low === 0)))) { */ case 1: t[0].when = (x$4 = t[0].when, x$5 = t[0].period, new $Int64(x$4.$high + x$5.$high, x$4.$low + x$5.$low)); $r = startTimer(t[0]); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $go(t[0].f, [t[0].arg, 0]); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; })(t), $externalize(new $Int64(diff.$high + 0, diff.$low + 1), $Int64)); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: startTimer }; } $f._r$1 = _r$1; $f.diff = diff; $f.t = t; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; }; stopTimer = function(t) { var t, wasActive; $global.clearTimeout(t.timeout); wasActive = t.active; t.active = false; return wasActive; }; modTimer = function(t, when$1, period, f, arg, seq) { var arg, f, period, seq, t, when$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; arg = $f.arg; f = $f.f; period = $f.period; seq = $f.seq; t = $f.t; when$1 = $f.when$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: stopTimer(t); t.when = when$1; t.period = period; t.f = f; t.arg = arg; t.seq = seq; $r = startTimer(t); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: modTimer }; } $f.arg = arg; $f.f = f; $f.period = period; $f.seq = seq; $f.t = t; $f.when$1 = when$1; $f.$s = $s; $f.$r = $r; return $f; }; resetTimer = function(t, when$1) { var t, wasActive, when$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; t = $f.t; wasActive = $f.wasActive; when$1 = $f.when$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: wasActive = t.active; $r = modTimer(t, when$1, t.period, t.f, t.arg, t.seq); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return wasActive; /* */ } return; } if ($f === undefined) { $f = { $blk: resetTimer }; } $f.t = t; $f.wasActive = wasActive; $f.when$1 = when$1; $f.$s = $s; $f.$r = $r; return $f; }; startsWithLowerCase = function(str) { var c, str; if (str.length === 0) { return false; } c = str.charCodeAt(0); return 97 <= c && c <= 122; }; nextStdChunk = function(layout) { var _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$87, _tmp$88, _tmp$89, _tmp$9, _tmp$90, _tmp$91, _tmp$92, c, ch, i, j, layout, prefix, std, std$1, suffix, x$1; 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) && $substring(layout, i, (i + 3 >> 0)) === "Jan") { if (layout.length >= (i + 7 >> 0) && $substring(layout, i, (i + 7 >> 0)) === "January") { _tmp = $substring(layout, 0, i); _tmp$1 = 257; _tmp$2 = $substring(layout, (i + 7 >> 0)); prefix = _tmp; std = _tmp$1; suffix = _tmp$2; return [prefix, std, suffix]; } if (!startsWithLowerCase($substring(layout, (i + 3 >> 0)))) { _tmp$3 = $substring(layout, 0, i); _tmp$4 = 258; _tmp$5 = $substring(layout, (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 ($substring(layout, i, (i + 3 >> 0)) === "Mon") { if (layout.length >= (i + 6 >> 0) && $substring(layout, i, (i + 6 >> 0)) === "Monday") { _tmp$6 = $substring(layout, 0, i); _tmp$7 = 261; _tmp$8 = $substring(layout, (i + 6 >> 0)); prefix = _tmp$6; std = _tmp$7; suffix = _tmp$8; return [prefix, std, suffix]; } if (!startsWithLowerCase($substring(layout, (i + 3 >> 0)))) { _tmp$9 = $substring(layout, 0, i); _tmp$10 = 262; _tmp$11 = $substring(layout, (i + 3 >> 0)); prefix = _tmp$9; std = _tmp$10; suffix = _tmp$11; return [prefix, std, suffix]; } } if ($substring(layout, i, (i + 3 >> 0)) === "MST") { _tmp$12 = $substring(layout, 0, i); _tmp$13 = 23; _tmp$14 = $substring(layout, (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 = $substring(layout, 0, i); _tmp$16 = (x$1 = layout.charCodeAt((i + 1 >> 0)) - 49 << 24 >>> 24, ((x$1 < 0 || x$1 >= std0x.length) ? ($throwRuntimeError("index out of range"), undefined) : std0x[x$1])); _tmp$17 = $substring(layout, (i + 2 >> 0)); prefix = _tmp$15; std = _tmp$16; suffix = _tmp$17; return [prefix, std, suffix]; } if (layout.length >= (i + 3 >> 0) && (layout.charCodeAt((i + 1 >> 0)) === 48) && (layout.charCodeAt((i + 2 >> 0)) === 50)) { _tmp$18 = $substring(layout, 0, i); _tmp$19 = 267; _tmp$20 = $substring(layout, (i + 3 >> 0)); prefix = _tmp$18; std = _tmp$19; suffix = _tmp$20; return [prefix, std, suffix]; } } else if (_1 === (49)) { if (layout.length >= (i + 2 >> 0) && (layout.charCodeAt((i + 1 >> 0)) === 53)) { _tmp$21 = $substring(layout, 0, i); _tmp$22 = 524; _tmp$23 = $substring(layout, (i + 2 >> 0)); prefix = _tmp$21; std = _tmp$22; suffix = _tmp$23; return [prefix, std, suffix]; } _tmp$24 = $substring(layout, 0, i); _tmp$25 = 259; _tmp$26 = $substring(layout, (i + 1 >> 0)); prefix = _tmp$24; std = _tmp$25; suffix = _tmp$26; return [prefix, std, suffix]; } else if (_1 === (50)) { if (layout.length >= (i + 4 >> 0) && $substring(layout, i, (i + 4 >> 0)) === "2006") { _tmp$27 = $substring(layout, 0, i); _tmp$28 = 275; _tmp$29 = $substring(layout, (i + 4 >> 0)); prefix = _tmp$27; std = _tmp$28; suffix = _tmp$29; return [prefix, std, suffix]; } _tmp$30 = $substring(layout, 0, i); _tmp$31 = 263; _tmp$32 = $substring(layout, (i + 1 >> 0)); prefix = _tmp$30; std = _tmp$31; suffix = _tmp$32; 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) && $substring(layout, (i + 1 >> 0), (i + 5 >> 0)) === "2006") { _tmp$33 = $substring(layout, 0, (i + 1 >> 0)); _tmp$34 = 275; _tmp$35 = $substring(layout, (i + 5 >> 0)); prefix = _tmp$33; std = _tmp$34; suffix = _tmp$35; return [prefix, std, suffix]; } _tmp$36 = $substring(layout, 0, i); _tmp$37 = 264; _tmp$38 = $substring(layout, (i + 2 >> 0)); prefix = _tmp$36; std = _tmp$37; suffix = _tmp$38; return [prefix, std, suffix]; } if (layout.length >= (i + 3 >> 0) && (layout.charCodeAt((i + 1 >> 0)) === 95) && (layout.charCodeAt((i + 2 >> 0)) === 50)) { _tmp$39 = $substring(layout, 0, i); _tmp$40 = 266; _tmp$41 = $substring(layout, (i + 3 >> 0)); prefix = _tmp$39; std = _tmp$40; suffix = _tmp$41; return [prefix, std, suffix]; } } else if (_1 === (51)) { _tmp$42 = $substring(layout, 0, i); _tmp$43 = 525; _tmp$44 = $substring(layout, (i + 1 >> 0)); prefix = _tmp$42; std = _tmp$43; suffix = _tmp$44; return [prefix, std, suffix]; } else if (_1 === (52)) { _tmp$45 = $substring(layout, 0, i); _tmp$46 = 527; _tmp$47 = $substring(layout, (i + 1 >> 0)); prefix = _tmp$45; std = _tmp$46; suffix = _tmp$47; return [prefix, std, suffix]; } else if (_1 === (53)) { _tmp$48 = $substring(layout, 0, i); _tmp$49 = 529; _tmp$50 = $substring(layout, (i + 1 >> 0)); prefix = _tmp$48; std = _tmp$49; suffix = _tmp$50; return [prefix, std, suffix]; } else if (_1 === (80)) { if (layout.length >= (i + 2 >> 0) && (layout.charCodeAt((i + 1 >> 0)) === 77)) { _tmp$51 = $substring(layout, 0, i); _tmp$52 = 533; _tmp$53 = $substring(layout, (i + 2 >> 0)); prefix = _tmp$51; std = _tmp$52; suffix = _tmp$53; return [prefix, std, suffix]; } } else if (_1 === (112)) { if (layout.length >= (i + 2 >> 0) && (layout.charCodeAt((i + 1 >> 0)) === 109)) { _tmp$54 = $substring(layout, 0, i); _tmp$55 = 534; _tmp$56 = $substring(layout, (i + 2 >> 0)); prefix = _tmp$54; std = _tmp$55; suffix = _tmp$56; return [prefix, std, suffix]; } } else if (_1 === (45)) { if (layout.length >= (i + 7 >> 0) && $substring(layout, i, (i + 7 >> 0)) === "-070000") { _tmp$57 = $substring(layout, 0, i); _tmp$58 = 30; _tmp$59 = $substring(layout, (i + 7 >> 0)); prefix = _tmp$57; std = _tmp$58; suffix = _tmp$59; return [prefix, std, suffix]; } if (layout.length >= (i + 9 >> 0) && $substring(layout, i, (i + 9 >> 0)) === "-07:00:00") { _tmp$60 = $substring(layout, 0, i); _tmp$61 = 33; _tmp$62 = $substring(layout, (i + 9 >> 0)); prefix = _tmp$60; std = _tmp$61; suffix = _tmp$62; return [prefix, std, suffix]; } if (layout.length >= (i + 5 >> 0) && $substring(layout, i, (i + 5 >> 0)) === "-0700") { _tmp$63 = $substring(layout, 0, i); _tmp$64 = 29; _tmp$65 = $substring(layout, (i + 5 >> 0)); prefix = _tmp$63; std = _tmp$64; suffix = _tmp$65; return [prefix, std, suffix]; } if (layout.length >= (i + 6 >> 0) && $substring(layout, i, (i + 6 >> 0)) === "-07:00") { _tmp$66 = $substring(layout, 0, i); _tmp$67 = 32; _tmp$68 = $substring(layout, (i + 6 >> 0)); prefix = _tmp$66; std = _tmp$67; suffix = _tmp$68; return [prefix, std, suffix]; } if (layout.length >= (i + 3 >> 0) && $substring(layout, i, (i + 3 >> 0)) === "-07") { _tmp$69 = $substring(layout, 0, i); _tmp$70 = 31; _tmp$71 = $substring(layout, (i + 3 >> 0)); prefix = _tmp$69; std = _tmp$70; suffix = _tmp$71; return [prefix, std, suffix]; } } else if (_1 === (90)) { if (layout.length >= (i + 7 >> 0) && $substring(layout, i, (i + 7 >> 0)) === "Z070000") { _tmp$72 = $substring(layout, 0, i); _tmp$73 = 25; _tmp$74 = $substring(layout, (i + 7 >> 0)); prefix = _tmp$72; std = _tmp$73; suffix = _tmp$74; return [prefix, std, suffix]; } if (layout.length >= (i + 9 >> 0) && $substring(layout, i, (i + 9 >> 0)) === "Z07:00:00") { _tmp$75 = $substring(layout, 0, i); _tmp$76 = 28; _tmp$77 = $substring(layout, (i + 9 >> 0)); prefix = _tmp$75; std = _tmp$76; suffix = _tmp$77; return [prefix, std, suffix]; } if (layout.length >= (i + 5 >> 0) && $substring(layout, i, (i + 5 >> 0)) === "Z0700") { _tmp$78 = $substring(layout, 0, i); _tmp$79 = 24; _tmp$80 = $substring(layout, (i + 5 >> 0)); prefix = _tmp$78; std = _tmp$79; suffix = _tmp$80; return [prefix, std, suffix]; } if (layout.length >= (i + 6 >> 0) && $substring(layout, i, (i + 6 >> 0)) === "Z07:00") { _tmp$81 = $substring(layout, 0, i); _tmp$82 = 27; _tmp$83 = $substring(layout, (i + 6 >> 0)); prefix = _tmp$81; std = _tmp$82; suffix = _tmp$83; return [prefix, std, suffix]; } if (layout.length >= (i + 3 >> 0) && $substring(layout, i, (i + 3 >> 0)) === "Z07") { _tmp$84 = $substring(layout, 0, i); _tmp$85 = 26; _tmp$86 = $substring(layout, (i + 3 >> 0)); prefix = _tmp$84; std = _tmp$85; suffix = _tmp$86; return [prefix, std, suffix]; } } else if ((_1 === (46)) || (_1 === (44))) { 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 = 34; if (layout.charCodeAt((i + 1 >> 0)) === 57) { std$1 = 35; } std$1 = std$1 | ((((j - ((i + 1 >> 0)) >> 0)) << 16 >> 0)); _tmp$87 = $substring(layout, 0, i); _tmp$88 = std$1; _tmp$89 = $substring(layout, j); prefix = _tmp$87; std = _tmp$88; suffix = _tmp$89; return [prefix, std, suffix]; } } } i = i + (1) >> 0; } _tmp$90 = layout; _tmp$91 = 0; _tmp$92 = ""; prefix = _tmp$90; std = _tmp$91; suffix = _tmp$92; return [prefix, std, suffix]; }; match = function(s1, s2) { var 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 _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"), undefined) : _ref.$array[_ref.$offset + _i]); if (val.length >= v.length && match($substring(val, 0, v.length), v)) { return [i, $substring(val, v.length), $ifaceNil]; } _i++; } return [-1, val, errBad]; }; appendInt = function(b, x$1, width) { var _q, b, buf, i, q, u, w, width, x$1; u = ((x$1 >>> 0)); if (x$1 < 0) { b = $append(b, 45); u = ((-x$1 >>> 0)); } buf = arrayType$3.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"), undefined) : 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"), undefined) : 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 _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, err, neg, q, rem, s, x$1; x$1 = 0; err = $ifaceNil; neg = false; if (!(s === "") && ((s.charCodeAt(0) === 45) || (s.charCodeAt(0) === 43))) { neg = s.charCodeAt(0) === 45; s = $substring(s, 1); } _tuple = leadingInt(s); q = _tuple[0]; rem = _tuple[1]; err = _tuple[2]; x$1 = (((q.$low + ((q.$high >> 31) * 4294967296)) >> 0)); if (!($interfaceIsEqual(err, $ifaceNil)) || !(rem === "")) { _tmp = 0; _tmp$1 = atoiError; x$1 = _tmp; err = _tmp$1; return [x$1, err]; } if (neg) { x$1 = -x$1; } _tmp$2 = x$1; _tmp$3 = $ifaceNil; x$1 = _tmp$2; err = _tmp$3; return [x$1, err]; }; formatNano = function(b, nanosec, n, trim) { var _q, _r$1, b, buf, n, nanosec, start, trim, u, x$1; u = nanosec; buf = arrayType$4.zero(); start = 9; while (true) { if (!(start > 0)) { break; } start = start - (1) >> 0; ((start < 0 || start >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : 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$1 = n - 1 >> 0, ((x$1 < 0 || x$1 >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[x$1])) === 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 _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, buf, m0, m1, m2, s, sign, t, wid, 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; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; buf = $f.buf; m0 = $f.m0; m1 = $f.m1; m2 = $f.m2; s = $f.s; sign = $f.sign; t = $f.t; wid = $f.wid; 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: t = this; _r$1 = $clone(t, Time).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 = _r$1; if (!((x$1 = (x$2 = t.wall, new $Uint64(x$2.$high & 2147483648, (x$2.$low & 0) >>> 0)), (x$1.$high === 0 && x$1.$low === 0)))) { m2 = ((x$3 = t.ext, new $Uint64(x$3.$high, x$3.$low))); sign = 43; if ((x$4 = t.ext, (x$4.$high < 0 || (x$4.$high === 0 && x$4.$low < 0)))) { sign = 45; m2 = new $Uint64(-m2.$high, -m2.$low); } _tmp = $div64(m2, new $Uint64(0, 1000000000), false); _tmp$1 = $div64(m2, new $Uint64(0, 1000000000), true); m1 = _tmp; m2 = _tmp$1; _tmp$2 = $div64(m1, new $Uint64(0, 1000000000), false); _tmp$3 = $div64(m1, new $Uint64(0, 1000000000), true); m0 = _tmp$2; m1 = _tmp$3; buf = sliceType$3.nil; buf = $appendSlice(buf, " m="); buf = $append(buf, sign); wid = 0; if (!((m0.$high === 0 && m0.$low === 0))) { buf = appendInt(buf, ((m0.$low >> 0)), 0); wid = 9; } buf = appendInt(buf, ((m1.$low >> 0)), wid); buf = $append(buf, 46); buf = appendInt(buf, ((m2.$low >> 0)), 9); s = s + (($bytesToString(buf))); } $s = -1; return s; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.String }; } $f._r$1 = _r$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f.buf = buf; $f.m0 = m0; $f.m1 = m1; $f.m2 = m2; $f.s = s; $f.sign = sign; $f.t = t; $f.wid = wid; $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.String = function() { return this.$val.String(); }; Time.ptr.prototype.GoString = function() { var _1, _arg, _arg$1, _arg$10, _arg$11, _arg$2, _arg$3, _arg$4, _arg$5, _arg$6, _arg$7, _arg$8, _arg$9, _r$1, _r$10, _r$11, _r$12, _r$13, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, buf, loc, month, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$10 = $f._arg$10; _arg$11 = $f._arg$11; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _arg$4 = $f._arg$4; _arg$5 = $f._arg$5; _arg$6 = $f._arg$6; _arg$7 = $f._arg$7; _arg$8 = $f._arg$8; _arg$9 = $f._arg$9; _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$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; buf = $f.buf; loc = $f.loc; month = $f.month; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; buf = (new sliceType$3($stringToBytes("time.Date("))); _arg = buf; _r$1 = $clone(t, Time).Year(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$1 = _r$1; _r$2 = appendInt(_arg, _arg$1, 0); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } buf = _r$2; _r$3 = $clone(t, Time).Month(); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } month = _r$3; /* */ if (1 <= month && month <= 12) { $s = 4; continue; } /* */ $s = 5; continue; /* if (1 <= month && month <= 12) { */ case 4: buf = $appendSlice(buf, ", time."); _arg$2 = buf; _r$4 = $clone(t, Time).Month(); /* */ $s = 7; case 7: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = new Month(_r$4).String(); /* */ $s = 8; case 8: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg$3 = _r$5; buf = $appendSlice(_arg$2, _arg$3); $s = 6; continue; /* } else { */ case 5: buf = appendInt(buf, ((month >> 0)), 0); /* } */ case 6: buf = $appendSlice(buf, ", "); _arg$4 = buf; _r$6 = $clone(t, Time).Day(); /* */ $s = 9; case 9: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _arg$5 = _r$6; _r$7 = appendInt(_arg$4, _arg$5, 0); /* */ $s = 10; case 10: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } buf = _r$7; buf = $appendSlice(buf, ", "); _arg$6 = buf; _r$8 = $clone(t, Time).Hour(); /* */ $s = 11; case 11: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _arg$7 = _r$8; _r$9 = appendInt(_arg$6, _arg$7, 0); /* */ $s = 12; case 12: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } buf = _r$9; buf = $appendSlice(buf, ", "); _arg$8 = buf; _r$10 = $clone(t, Time).Minute(); /* */ $s = 13; case 13: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _arg$9 = _r$10; _r$11 = appendInt(_arg$8, _arg$9, 0); /* */ $s = 14; case 14: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } buf = _r$11; buf = $appendSlice(buf, ", "); _arg$10 = buf; _r$12 = $clone(t, Time).Second(); /* */ $s = 15; case 15: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _arg$11 = _r$12; _r$13 = appendInt(_arg$10, _arg$11, 0); /* */ $s = 16; case 16: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } buf = _r$13; buf = $appendSlice(buf, ", "); buf = appendInt(buf, $clone(t, Time).Nanosecond(), 0); buf = $appendSlice(buf, ", "); loc = $clone(t, Time).Location(); _1 = loc; if (_1 === ($pkg.UTC) || _1 === ptrType$2.nil) { buf = $appendSlice(buf, "time.UTC"); } else if (_1 === ($pkg.Local)) { buf = $appendSlice(buf, "time.Local"); } else { buf = $appendSlice(buf, "time.Location("); buf = $appendSlice(buf, (new sliceType$3($stringToBytes(quote(loc.name))))); buf = $appendSlice(buf, ")"); } buf = $append(buf, 41); $s = -1; return ($bytesToString(buf)); /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.GoString }; } $f._1 = _1; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$10 = _arg$10; $f._arg$11 = _arg$11; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._arg$4 = _arg$4; $f._arg$5 = _arg$5; $f._arg$6 = _arg$6; $f._arg$7 = _arg$7; $f._arg$8 = _arg$8; $f._arg$9 = _arg$9; $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$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.buf = buf; $f.loc = loc; $f.month = month; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.GoString = function() { return this.$val.GoString(); }; Time.ptr.prototype.Format = function(layout) { var _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; _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 = this; b = sliceType$3.nil; max = layout.length + 10 >> 0; if (max < 64) { buf = arrayType$5.zero(); b = $subslice(new sliceType$3(buf), 0, 0); } else { b = $makeSlice(sliceType$3, 0, max); } _r$1 = $clone(t, Time).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; $s = -1; return ($bytesToString(b)); /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Format }; } $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 _1, _q, _q$1, _q$2, _q$3, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _tuple, _tuple$1, _tuple$2, _tuple$3, abs, absoffset, b, day, hour, hr, hr$1, layout, m, min, month, name, offset, prefix, s, sec, std, suffix, t, y, yday, year, zone$1, zone$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _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 = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; 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; yday = $f.yday; 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 = this; _r$1 = $clone(t, Time).locabs(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; name = _tuple[0]; offset = _tuple[1]; abs = _tuple[2]; year = -1; month = 0; day = 0; yday = 0; hour = -1; min = 0; sec = 0; while (true) { if (!(!(layout === ""))) { break; } _tuple$1 = nextStdChunk(layout); prefix = _tuple$1[0]; std = _tuple$1[1]; suffix = _tuple$1[2]; if (!(prefix === "")) { b = $appendSlice(b, prefix); } if (std === 0) { break; } layout = suffix; if (year < 0 && !(((std & 256) === 0))) { _tuple$2 = absDate(abs, true); year = _tuple$2[0]; month = _tuple$2[1]; day = _tuple$2[2]; yday = _tuple$2[3]; yday = yday + (1) >> 0; } if (hour < 0 && !(((std & 512) === 0))) { _tuple$3 = absClock(abs); hour = _tuple$3[0]; min = _tuple$3[1]; sec = _tuple$3[2]; } switch (0) { default: _1 = std & 65535; if (_1 === (276)) { 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 (_1 === (275)) { b = appendInt(b, year, 4); } else if (_1 === (258)) { b = $appendSlice(b, $substring(new Month(month).String(), 0, 3)); } else if (_1 === (257)) { m = new Month(month).String(); b = $appendSlice(b, m); } else if (_1 === (259)) { b = appendInt(b, ((month >> 0)), 0); } else if (_1 === (260)) { b = appendInt(b, ((month >> 0)), 2); } else if (_1 === (262)) { b = $appendSlice(b, $substring(new Weekday(absWeekday(abs)).String(), 0, 3)); } else if (_1 === (261)) { s = new Weekday(absWeekday(abs)).String(); b = $appendSlice(b, s); } else if (_1 === (263)) { b = appendInt(b, day, 0); } else if (_1 === (264)) { if (day < 10) { b = $append(b, 32); } b = appendInt(b, day, 0); } else if (_1 === (265)) { b = appendInt(b, day, 2); } else if (_1 === (266)) { if (yday < 100) { b = $append(b, 32); if (yday < 10) { b = $append(b, 32); } } b = appendInt(b, yday, 0); } else if (_1 === (267)) { b = appendInt(b, yday, 3); } else if (_1 === (524)) { b = appendInt(b, hour, 2); } else if (_1 === (525)) { 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 (_1 === (526)) { 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 (_1 === (527)) { b = appendInt(b, min, 0); } else if (_1 === (528)) { b = appendInt(b, min, 2); } else if (_1 === (529)) { b = appendInt(b, sec, 0); } else if (_1 === (530)) { b = appendInt(b, sec, 2); } else if (_1 === (533)) { if (hour >= 12) { b = $appendSlice(b, "PM"); } else { b = $appendSlice(b, "AM"); } } else if (_1 === (534)) { if (hour >= 12) { b = $appendSlice(b, "pm"); } else { b = $appendSlice(b, "am"); } } else if ((_1 === (24)) || (_1 === (27)) || (_1 === (25)) || (_1 === (26)) || (_1 === (28)) || (_1 === (29)) || (_1 === (32)) || (_1 === (30)) || (_1 === (31)) || (_1 === (33))) { if ((offset === 0) && ((std === 24) || (std === 27) || (std === 25) || (std === 26) || (std === 28))) { 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 === 27) || (std === 32) || (std === 28) || (std === 33)) { b = $append(b, 58); } if (!((std === 31)) && !((std === 26))) { b = appendInt(b, (_r$5 = zone$1 % 60, _r$5 === _r$5 ? _r$5 : $throwRuntimeError("integer divide by zero")), 2); } if ((std === 25) || (std === 30) || (std === 33) || (std === 28)) { if ((std === 33) || (std === 28)) { 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 (_1 === (23)) { 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 ((_1 === (34)) || (_1 === (35))) { b = formatNano(b, (($clone(t, Time).Nanosecond() >>> 0)), std >> 16 >> 0, (std & 65535) === 35); } } } $s = -1; return b; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.AppendFormat }; } $f._1 = _1; $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 = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $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.yday = yday; $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 _i, _ref, _rune, buf, c, i, j, s, width; buf = $makeSlice(sliceType$3, 1, (s.length + 2 >> 0)); (0 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 0] = 34); _ref = s; _i = 0; while (true) { if (!(_i < _ref.length)) { break; } _rune = $decodeRune(_ref, _i); i = _i; c = _rune[0]; if (c >= 128 || c < 32) { width = 0; if (c === 65533) { width = 1; if ((i + 2 >> 0) < s.length && $substring(s, i, (i + 3 >> 0)) === "\xEF\xBF\xBD") { width = 3; } } else { width = ($encodeRune(c)).length; } j = 0; while (true) { if (!(j < width)) { break; } buf = $appendSlice(buf, "\\x"); buf = $append(buf, "0123456789abcdef".charCodeAt((s.charCodeAt((i + j >> 0)) >>> 4 << 24 >>> 24))); buf = $append(buf, "0123456789abcdef".charCodeAt(((s.charCodeAt((i + j >> 0)) & 15) >>> 0))); j = j + (1) >> 0; } } else { if ((c === 34) || (c === 92)) { buf = $append(buf, 92); } buf = $appendSlice(buf, ($encodeRune(c))); } _i += _rune[1]; } buf = $append(buf, 34); return ($bytesToString(buf)); }; ParseError.ptr.prototype.Error = function() { var 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 c, i, s; if (s.length <= i) { return false; } c = s.charCodeAt(i); return 48 <= c && c <= 57; }; getnum = function(s, fixed) { var 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)), $substring(s, 1), $ifaceNil]; } return [($imul((((s.charCodeAt(0) - 48 << 24 >>> 24) >> 0)), 10)) + (((s.charCodeAt(1) - 48 << 24 >>> 24) >> 0)) >> 0, $substring(s, 2), $ifaceNil]; }; getnum3 = function(s, fixed) { var _tmp, _tmp$1, fixed, i, n, s; _tmp = 0; _tmp$1 = 0; n = _tmp; i = _tmp$1; i = 0; while (true) { if (!(i < 3 && isDigit(s, i))) { break; } n = ($imul(n, 10)) + (((s.charCodeAt(i) - 48 << 24 >>> 24) >> 0)) >> 0; i = i + (1) >> 0; } if ((i === 0) || fixed && !((i === 3))) { return [0, s, errBad]; } return [n, $substring(s, i), $ifaceNil]; }; cutspace = function(s) { var s; while (true) { if (!(s.length > 0 && (s.charCodeAt(0) === 32))) { break; } s = $substring(s, 1); } return s; }; skip = function(value, prefix) { var 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 = $substring(prefix, 1); value = $substring(value, 1); } return [value, $ifaceNil]; }; Parse = function(layout, value) { var $24r, _r$1, layout, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Parse }; } $f.$24r = $24r; $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 $24r, $24r$1, _1, _2, _3, _4, _q, _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, _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, d, day, defaultLocation, err, hold, hour, hour$1, hr, i, i$1, layout, local, m, 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$1, x$2, x$3, yday, year, z, zoneName, zoneOffset, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _1 = $f._1; _2 = $f._2; _3 = $f._3; _4 = $f._4; _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; _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 = $f._tuple; _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; d = $f.d; day = $f.day; defaultLocation = $f.defaultLocation; err = $f.err; hold = $f.hold; hour = $f.hour; hour$1 = $f.hour$1; hr = $f.hr; i = $f.i; i$1 = $f.i$1; layout = $f.layout; local = $f.local; m = $f.m; 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$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; yday = $f.yday; 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; yday = -1; hour = 0; min = 0; sec = 0; nsec = 0; z = ptrType$2.nil; zoneOffset = -1; zoneName = ""; while (true) { err = $ifaceNil; _tuple = nextStdChunk(layout); prefix = _tuple[0]; std = _tuple[1]; suffix = _tuple[2]; stdstr = $substring(layout, prefix.length, (layout.length - suffix.length >> 0)); _tuple$1 = skip(value, prefix); value = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil), new ParseError.ptr(alayout, avalue, prefix, value, "")]; } if (std === 0) { if (!((value.length === 0))) { $s = -1; return [new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil), new ParseError.ptr(alayout, avalue, "", value, ": extra text: " + quote(value))]; } break; } layout = suffix; p = ""; switch (0) { default: _1 = std & 65535; if (_1 === (276)) { if (value.length < 2) { err = errBad; break; } hold = value; _tmp$2 = $substring(value, 0, 2); _tmp$3 = $substring(value, 2); p = _tmp$2; value = _tmp$3; _tuple$2 = atoi(p); year = _tuple$2[0]; err = _tuple$2[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { value = hold; } else if (year >= 69) { year = year + (1900) >> 0; } else { year = year + (2000) >> 0; } } else if (_1 === (275)) { if (value.length < 4 || !isDigit(value, 0)) { err = errBad; break; } _tmp$4 = $substring(value, 0, 4); _tmp$5 = $substring(value, 4); p = _tmp$4; value = _tmp$5; _tuple$3 = atoi(p); year = _tuple$3[0]; err = _tuple$3[1]; } else if (_1 === (258)) { _tuple$4 = lookup(shortMonthNames, value); month = _tuple$4[0]; value = _tuple$4[1]; err = _tuple$4[2]; month = month + (1) >> 0; } else if (_1 === (257)) { _tuple$5 = lookup(longMonthNames, value); month = _tuple$5[0]; value = _tuple$5[1]; err = _tuple$5[2]; month = month + (1) >> 0; } else if ((_1 === (259)) || (_1 === (260))) { _tuple$6 = getnum(value, std === 260); month = _tuple$6[0]; value = _tuple$6[1]; err = _tuple$6[2]; if ($interfaceIsEqual(err, $ifaceNil) && (month <= 0 || 12 < month)) { rangeErrString = "month"; } } else if (_1 === (262)) { _tuple$7 = lookup(shortDayNames, value); value = _tuple$7[1]; err = _tuple$7[2]; } else if (_1 === (261)) { _tuple$8 = lookup(longDayNames, value); value = _tuple$8[1]; err = _tuple$8[2]; } else if ((_1 === (263)) || (_1 === (264)) || (_1 === (265))) { if ((std === 264) && value.length > 0 && (value.charCodeAt(0) === 32)) { value = $substring(value, 1); } _tuple$9 = getnum(value, std === 265); day = _tuple$9[0]; value = _tuple$9[1]; err = _tuple$9[2]; } else if ((_1 === (266)) || (_1 === (267))) { i = 0; while (true) { if (!(i < 2)) { break; } if ((std === 266) && value.length > 0 && (value.charCodeAt(0) === 32)) { value = $substring(value, 1); } i = i + (1) >> 0; } _tuple$10 = getnum3(value, std === 267); yday = _tuple$10[0]; value = _tuple$10[1]; err = _tuple$10[2]; } else if (_1 === (524)) { _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 ((_1 === (525)) || (_1 === (526))) { _tuple$12 = getnum(value, std === 526); hour = _tuple$12[0]; value = _tuple$12[1]; err = _tuple$12[2]; if (hour < 0 || 12 < hour) { rangeErrString = "hour"; } } else if ((_1 === (527)) || (_1 === (528))) { _tuple$13 = getnum(value, std === 528); min = _tuple$13[0]; value = _tuple$13[1]; err = _tuple$13[2]; if (min < 0 || 60 <= min) { rangeErrString = "minute"; } } else if ((_1 === (529)) || (_1 === (530))) { _tuple$14 = getnum(value, std === 530); sec = _tuple$14[0]; value = _tuple$14[1]; err = _tuple$14[2]; if (sec < 0 || 60 <= sec) { rangeErrString = "second"; break; } if (value.length >= 2 && commaOrPeriod(value.charCodeAt(0)) && isDigit(value, 1)) { _tuple$15 = nextStdChunk(layout); std = _tuple$15[1]; std = std & (65535); if ((std === 34) || (std === 35)) { 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 = $substring(value, n); } } else if (_1 === (533)) { if (value.length < 2) { err = errBad; break; } _tmp$6 = $substring(value, 0, 2); _tmp$7 = $substring(value, 2); p = _tmp$6; value = _tmp$7; _2 = p; if (_2 === ("PM")) { pmSet = true; } else if (_2 === ("AM")) { amSet = true; } else { err = errBad; } } else if (_1 === (534)) { if (value.length < 2) { err = errBad; break; } _tmp$8 = $substring(value, 0, 2); _tmp$9 = $substring(value, 2); p = _tmp$8; value = _tmp$9; _3 = p; if (_3 === ("pm")) { pmSet = true; } else if (_3 === ("am")) { amSet = true; } else { err = errBad; } } else if ((_1 === (24)) || (_1 === (27)) || (_1 === (25)) || (_1 === (26)) || (_1 === (28)) || (_1 === (29)) || (_1 === (31)) || (_1 === (32)) || (_1 === (30)) || (_1 === (33))) { if (((std === 24) || (std === 26) || (std === 27)) && value.length >= 1 && (value.charCodeAt(0) === 90)) { value = $substring(value, 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 === 27) || (std === 32)) { if (value.length < 6) { err = errBad; break; } if (!((value.charCodeAt(3) === 58))) { err = errBad; break; } _tmp$14 = $substring(value, 0, 1); _tmp$15 = $substring(value, 1, 3); _tmp$16 = $substring(value, 4, 6); _tmp$17 = "00"; _tmp$18 = $substring(value, 6); sign = _tmp$14; hour$1 = _tmp$15; min$1 = _tmp$16; seconds = _tmp$17; value = _tmp$18; } else if ((std === 31) || (std === 26)) { if (value.length < 3) { err = errBad; break; } _tmp$19 = $substring(value, 0, 1); _tmp$20 = $substring(value, 1, 3); _tmp$21 = "00"; _tmp$22 = "00"; _tmp$23 = $substring(value, 3); sign = _tmp$19; hour$1 = _tmp$20; min$1 = _tmp$21; seconds = _tmp$22; value = _tmp$23; } else if ((std === 28) || (std === 33)) { if (value.length < 9) { err = errBad; break; } if (!((value.charCodeAt(3) === 58)) || !((value.charCodeAt(6) === 58))) { err = errBad; break; } _tmp$24 = $substring(value, 0, 1); _tmp$25 = $substring(value, 1, 3); _tmp$26 = $substring(value, 4, 6); _tmp$27 = $substring(value, 7, 9); _tmp$28 = $substring(value, 9); sign = _tmp$24; hour$1 = _tmp$25; min$1 = _tmp$26; seconds = _tmp$27; value = _tmp$28; } else if ((std === 25) || (std === 30)) { if (value.length < 7) { err = errBad; break; } _tmp$29 = $substring(value, 0, 1); _tmp$30 = $substring(value, 1, 3); _tmp$31 = $substring(value, 3, 5); _tmp$32 = $substring(value, 5, 7); _tmp$33 = $substring(value, 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 = $substring(value, 0, 1); _tmp$35 = $substring(value, 1, 3); _tmp$36 = $substring(value, 3, 5); _tmp$37 = "00"; _tmp$38 = $substring(value, 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; _4 = sign.charCodeAt(0); if (_4 === (43)) { } else if (_4 === (45)) { zoneOffset = -zoneOffset; } else { err = errBad; } } else if (_1 === (23)) { if (value.length >= 3 && $substring(value, 0, 3) === "UTC") { z = $pkg.UTC; value = $substring(value, 3); break; } _tuple$20 = parseTimeZone(value); n$1 = _tuple$20[0]; ok = _tuple$20[1]; if (!ok) { err = errBad; break; } _tmp$42 = $substring(value, 0, n$1); _tmp$43 = $substring(value, n$1); zoneName = _tmp$42; value = _tmp$43; } else if (_1 === (34)) { 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 = $substring(value, ndigit); } else if (_1 === (35)) { if (value.length < 2 || !commaOrPeriod(value.charCodeAt(0)) || value.charCodeAt(1) < 48 || 57 < value.charCodeAt(1)) { break; } i$1 = 0; while (true) { if (!(i$1 < 9 && (i$1 + 1 >> 0) < value.length && 48 <= value.charCodeAt((i$1 + 1 >> 0)) && value.charCodeAt((i$1 + 1 >> 0)) <= 57)) { break; } i$1 = i$1 + (1) >> 0; } _tuple$22 = parseNanoseconds(value, 1 + i$1 >> 0); nsec = _tuple$22[0]; rangeErrString = _tuple$22[1]; err = _tuple$22[2]; value = $substring(value, (1 + i$1 >> 0)); } } if (!(rangeErrString === "")) { $s = -1; return [new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil), new ParseError.ptr(alayout, avalue, stdstr, value, ": " + rangeErrString + " out of range")]; } if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil), new ParseError.ptr(alayout, avalue, stdstr, value, "")]; } } if (pmSet && hour < 12) { hour = hour + (12) >> 0; } else if (amSet && (hour === 12)) { hour = 0; } if (yday >= 0) { d = 0; m = 0; if (isLeap(year)) { if (yday === 60) { m = 2; d = 29; } else if (yday > 60) { yday = yday - (1) >> 0; } } if (yday < 1 || yday > 365) { $s = -1; return [new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil), new ParseError.ptr(alayout, avalue, "", value, ": day-of-year out of range")]; } if (m === 0) { m = (_q = ((yday - 1 >> 0)) / 31, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) + 1 >> 0; if (((((m < 0 || m >= daysBefore.length) ? ($throwRuntimeError("index out of range"), undefined) : daysBefore[m]) >> 0)) < yday) { m = m + (1) >> 0; } d = yday - (((x$1 = m - 1 >> 0, ((x$1 < 0 || x$1 >= daysBefore.length) ? ($throwRuntimeError("index out of range"), undefined) : daysBefore[x$1])) >> 0)) >> 0; } if (month >= 0 && !((month === m))) { $s = -1; return [new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil), new ParseError.ptr(alayout, avalue, "", value, ": day-of-year does not match month")]; } month = m; if (day >= 0 && !((day === d))) { $s = -1; return [new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil), new ParseError.ptr(alayout, avalue, "", value, ": day-of-year does not match day")]; } day = d; } else { if (month < 0) { month = 1; } if (day < 0) { day = 1; } } if (day < 1 || day > daysIn(((month >> 0)), year)) { $s = -1; return [new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil), new ParseError.ptr(alayout, avalue, "", value, ": day out of range")]; } /* */ if (!(z === ptrType$2.nil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(z === ptrType$2.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; } $24r = [_r$1, $ifaceNil]; $s = 4; case 4: return $24r; /* } */ 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.addSec((x$2 = (new $Int64(0, zoneOffset)), new $Int64(-x$2.$high, -x$2.$low))); _r$3 = local.lookup(t.unixSec()); /* */ $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.setLoc(local); $s = -1; return [t, $ifaceNil]; } t.setLoc(FixedZone(zoneName, zoneOffset)); $s = -1; 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, t$1.unixSec()); /* */ $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[1]; if (ok$1) { t$1.addSec((x$3 = (new $Int64(0, offset$1)), new $Int64(-x$3.$high, -x$3.$low))); t$1.setLoc(local); $s = -1; return [t$1, $ifaceNil]; } if (zoneName.length > 3 && $substring(zoneName, 0, 3) === "GMT") { _tuple$25 = atoi($substring(zoneName, 3)); offset$1 = _tuple$25[0]; offset$1 = $imul(offset$1, (3600)); } t$1.setLoc(FixedZone(zoneName, offset$1)); $s = -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; } $24r$1 = [_r$6, $ifaceNil]; $s = 14; case 14: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: parse }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._1 = _1; $f._2 = _2; $f._3 = _3; $f._4 = _4; $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._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 = _tuple; $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.d = d; $f.day = day; $f.defaultLocation = defaultLocation; $f.err = err; $f.hold = hold; $f.hour = hour; $f.hour$1 = hour$1; $f.hr = hr; $f.i = i; $f.i$1 = i$1; $f.layout = layout; $f.local = local; $f.m = m; $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$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.yday = yday; $f.year = year; $f.z = z; $f.zoneName = zoneName; $f.zoneOffset = zoneOffset; $f.$s = $s; $f.$r = $r; return $f; }; parseTimeZone = function(value) { var _1, _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, c, length, nUpper, ok, ok$1, 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 && ($substring(value, 0, 4) === "ChST" || $substring(value, 0, 4) === "MeST")) { _tmp$2 = 4; _tmp$3 = true; length = _tmp$2; ok = _tmp$3; return [length, ok]; } if ($substring(value, 0, 3) === "GMT") { length = parseGMT(value); _tmp$4 = length; _tmp$5 = true; length = _tmp$4; ok = _tmp$5; return [length, ok]; } if ((value.charCodeAt(0) === 43) || (value.charCodeAt(0) === 45)) { length = parseSignedOffset(value); ok$1 = length > 0; _tmp$6 = length; _tmp$7 = ok$1; length = _tmp$6; ok = _tmp$7; 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; } _1 = nUpper; if ((_1 === (0)) || (_1 === (1)) || (_1 === (2)) || (_1 === (6))) { _tmp$8 = 0; _tmp$9 = false; length = _tmp$8; ok = _tmp$9; return [length, ok]; } else if (_1 === (5)) { if (value.charCodeAt(4) === 84) { _tmp$10 = 5; _tmp$11 = true; length = _tmp$10; ok = _tmp$11; return [length, ok]; } } else if (_1 === (4)) { if ((value.charCodeAt(3) === 84) || $substring(value, 0, 4) === "WITA") { _tmp$12 = 4; _tmp$13 = true; length = _tmp$12; ok = _tmp$13; return [length, ok]; } } else if (_1 === (3)) { _tmp$14 = 3; _tmp$15 = true; length = _tmp$14; ok = _tmp$15; return [length, ok]; } _tmp$16 = 0; _tmp$17 = false; length = _tmp$16; ok = _tmp$17; return [length, ok]; }; parseGMT = function(value) { var value; value = $substring(value, 3); if (value.length === 0) { return 3; } return 3 + parseSignedOffset(value) >> 0; }; parseSignedOffset = function(value) { var _tuple, err, rem, sign, value, x$1; sign = value.charCodeAt(0); if (!((sign === 45)) && !((sign === 43))) { return 0; } _tuple = leadingInt($substring(value, 1)); x$1 = _tuple[0]; rem = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil)) || $substring(value, 1) === rem) { return 0; } if (sign === 45) { x$1 = new $Int64(-x$1.$high, -x$1.$low); } if ((x$1.$high < -1 || (x$1.$high === -1 && x$1.$low < 4294967273)) || (0 < x$1.$high || (0 === x$1.$high && 23 < x$1.$low))) { return 0; } return value.length - rem.length >> 0; }; commaOrPeriod = function(b) { var b; return (b === 46) || (b === 44); }; parseNanoseconds = function(value, nbytes) { var _tuple, err, i, nbytes, ns, rangeErrString, scaleDigits, value; ns = 0; rangeErrString = ""; err = $ifaceNil; if (!commaOrPeriod(value.charCodeAt(0))) { err = errBad; return [ns, rangeErrString, err]; } _tuple = atoi($substring(value, 1, nbytes)); ns = _tuple[0]; err = _tuple[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 _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, c, err, i, rem, s, x$1, x$2, x$3, x$4; x$1 = 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$1.$high > 214748364 || (x$1.$high === 214748364 && x$1.$low > 3435973836))) { _tmp = new $Int64(0, 0); _tmp$1 = ""; _tmp$2 = errLeadingInt; x$1 = _tmp; rem = _tmp$1; err = _tmp$2; return [x$1, rem, err]; } x$1 = (x$2 = (x$3 = $mul64(x$1, new $Int64(0, 10)), x$4 = (new $Int64(0, c)), new $Int64(x$3.$high + x$4.$high, x$3.$low + x$4.$low)), new $Int64(x$2.$high - 0, x$2.$low - 48)); if ((x$1.$high < 0 || (x$1.$high === 0 && x$1.$low < 0))) { _tmp$3 = new $Int64(0, 0); _tmp$4 = ""; _tmp$5 = errLeadingInt; x$1 = _tmp$3; rem = _tmp$4; err = _tmp$5; return [x$1, rem, err]; } i = i + (1) >> 0; } _tmp$6 = x$1; _tmp$7 = $substring(s, i); _tmp$8 = $ifaceNil; x$1 = _tmp$6; rem = _tmp$7; err = _tmp$8; return [x$1, rem, err]; }; ptrType$2.methods = [{prop: "get", name: "get", pkg: "time", typ: $funcType([], [ptrType$2], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "lookup", name: "lookup", pkg: "time", typ: $funcType([$Int64], [$String, $Int, $Int64, $Int64, $Bool], 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], false)}]; Time.methods = [{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$2], [Time], false)}, {prop: "Location", name: "Location", pkg: "", typ: $funcType([], [ptrType$2], false)}, {prop: "Zone", name: "Zone", pkg: "", typ: $funcType([], [$String, $Int], false)}, {prop: "Unix", name: "Unix", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "UnixMilli", name: "UnixMilli", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "UnixMicro", name: "UnixMicro", 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: "IsDST", name: "IsDST", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Truncate", name: "Truncate", pkg: "", typ: $funcType([Duration], [Time], false)}, {prop: "Round", name: "Round", pkg: "", typ: $funcType([Duration], [Time], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "GoString", name: "GoString", 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)}]; ptrType$4.methods = [{prop: "nsec", name: "nsec", pkg: "time", typ: $funcType([], [$Int32], false)}, {prop: "sec", name: "sec", pkg: "time", typ: $funcType([], [$Int64], false)}, {prop: "unixSec", name: "unixSec", pkg: "time", typ: $funcType([], [$Int64], false)}, {prop: "addSec", name: "addSec", pkg: "time", typ: $funcType([$Int64], [], false)}, {prop: "setLoc", name: "setLoc", pkg: "time", typ: $funcType([ptrType$2], [], false)}, {prop: "stripMono", name: "stripMono", pkg: "time", typ: $funcType([], [], false)}, {prop: "setMono", name: "setMono", pkg: "time", typ: $funcType([$Int64], [], false)}, {prop: "mono", name: "mono", pkg: "time", typ: $funcType([], [$Int64], false)}, {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: "Microseconds", name: "Microseconds", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Milliseconds", name: "Milliseconds", 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)}, {prop: "Truncate", name: "Truncate", pkg: "", typ: $funcType([Duration], [Duration], false)}, {prop: "Round", name: "Round", pkg: "", typ: $funcType([Duration], [Duration], false)}]; ptrType$6.methods = [{prop: "Stop", name: "Stop", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Reset", name: "Reset", pkg: "", typ: $funcType([Duration], [$Bool], false)}]; ptrType$8.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; Location.init("time", [{prop: "name", name: "name", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "zone", name: "zone", embedded: false, exported: false, typ: sliceType, tag: ""}, {prop: "tx", name: "tx", embedded: false, exported: false, typ: sliceType$1, tag: ""}, {prop: "extend", name: "extend", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "cacheStart", name: "cacheStart", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "cacheEnd", name: "cacheEnd", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "cacheZone", name: "cacheZone", embedded: false, exported: false, typ: ptrType, tag: ""}]); zone.init("time", [{prop: "name", name: "name", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "offset", name: "offset", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "isDST", name: "isDST", embedded: false, exported: false, typ: $Bool, tag: ""}]); zoneTrans.init("time", [{prop: "when", name: "when", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "index", name: "index", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "isstd", name: "isstd", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "isutc", name: "isutc", embedded: false, exported: false, typ: $Bool, tag: ""}]); rule.init("time", [{prop: "kind", name: "kind", embedded: false, exported: false, typ: ruleKind, tag: ""}, {prop: "day", name: "day", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "week", name: "week", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "mon", name: "mon", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "time", name: "time", embedded: false, exported: false, typ: $Int, tag: ""}]); Time.init("time", [{prop: "wall", name: "wall", embedded: false, exported: false, typ: $Uint64, tag: ""}, {prop: "ext", name: "ext", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "loc", name: "loc", embedded: false, exported: false, typ: ptrType$2, tag: ""}]); Timer.init("time", [{prop: "C", name: "C", embedded: false, exported: true, typ: chanType$1, tag: ""}, {prop: "r", name: "r", embedded: false, exported: false, typ: runtimeTimer, tag: ""}]); runtimeTimer.init("time", [{prop: "i", name: "i", embedded: false, exported: false, typ: $Int32, tag: ""}, {prop: "when", name: "when", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "period", name: "period", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "f", name: "f", embedded: false, exported: false, typ: funcType$1, tag: ""}, {prop: "arg", name: "arg", embedded: false, exported: false, typ: $emptyInterface, tag: ""}, {prop: "seq", name: "seq", embedded: false, exported: false, typ: $Uintptr, tag: ""}, {prop: "timeout", name: "timeout", embedded: false, exported: false, typ: ptrType$7, tag: ""}, {prop: "active", name: "active", embedded: false, exported: false, typ: $Bool, tag: ""}]); ParseError.init("", [{prop: "Layout", name: "Layout", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Value", name: "Value", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "LayoutElem", name: "LayoutElem", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "ValueElem", name: "ValueElem", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Message", name: "Message", embedded: false, exported: true, typ: $String, tag: ""}]); $pkg.$initLinknames = function() { runtimeNano = $linknames["runtime.nanotime"]; }; $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 = syscall.$init(); /* */ $s = 5; case 5: 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); $unused(new sliceType$2(["/usr/share/zoneinfo/", "/usr/share/lib/zoneinfo/", "/usr/lib/locale/TZ/", runtime.GOROOT() + "/lib/time/zoneinfo.zip"])); badData = errors.New("malformed time zone information"); 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; errLocation = errors.New("time: invalid location name"); daysBefore = $toNativeArray($kindInt32, [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]); _r = runtimeNano(); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } startNano = (x = _r, new $Int64(x.$high - 0, x.$low - 1)); zoneSources = new sliceType$2([runtime.GOROOT() + "/lib/time/zoneinfo.zip"]); std0x = $toNativeArray($kindInt, [260, 265, 526, 528, 530, 276]); 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]*"); init(); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["internal/poll"] = (function() { var $pkg = {}, $init, errors, unix, io, runtime, sync, atomic, syscall, time, splicePipe, pollDesc, FD, fdMutex, errNetClosing, DeadlineExceededError, ptrType, sliceType, sliceType$1, ptrType$1, ptrType$2, ptrType$3, ptrType$4, funcType, ptrType$5, arrayType, sliceType$2, arrayType$1, ptrType$6, chanType, sliceType$3, ptrType$7, ptrType$8, arrayType$2, ptrType$9, ptrType$10, sliceType$4, sliceType$5, ptrType$11, ptrType$12, ptrType$13, ptrType$14, ptrType$15, ptrType$16, funcType$1, funcType$2, ptrType$17, ptrType$18, splicePipePool, disableSplice, disableSplice$24ptr, semWaiters, tryDupCloexec, tryDupCloexec$24ptr, copyFileRangeSupported, copyFileRangeSupported$24ptr, Splice, spliceDrain, splicePump, splice, newPoolPipe, getPipe, putPipe, newPipe, destroyPipe, accept, SendFile, newIovecWithBase, runtime_Semacquire, runtime_Semrelease, writev, DupCloseOnExec, dupCloseOnExecOld, ignoringEINTRIO, ignoringEINTR, errClosing, consume, fcntl, kernelVersion, CopyFileRange, copyFileRange; errors = $packages["errors"]; unix = $packages["internal/syscall/unix"]; io = $packages["io"]; runtime = $packages["runtime"]; sync = $packages["sync"]; atomic = $packages["sync/atomic"]; syscall = $packages["syscall"]; time = $packages["time"]; splicePipe = $pkg.splicePipe = $newType(0, $kindStruct, "poll.splicePipe", true, "internal/poll", false, function(rfd_, wfd_, data_) { this.$val = this; if (arguments.length === 0) { this.rfd = 0; this.wfd = 0; this.data = 0; return; } this.rfd = rfd_; this.wfd = wfd_; this.data = data_; }); pollDesc = $pkg.pollDesc = $newType(0, $kindStruct, "poll.pollDesc", true, "internal/poll", false, function(closing_) { this.$val = this; if (arguments.length === 0) { this.closing = false; return; } this.closing = closing_; }); FD = $pkg.FD = $newType(0, $kindStruct, "poll.FD", true, "internal/poll", true, function(fdmu_, Sysfd_, pd_, iovecs_, csema_, isBlocking_, IsStream_, ZeroReadIsEOF_, isFile_) { this.$val = this; if (arguments.length === 0) { this.fdmu = new fdMutex.ptr(new $Uint64(0, 0), 0, 0); this.Sysfd = 0; this.pd = new pollDesc.ptr(false); this.iovecs = ptrType$1.nil; this.csema = 0; this.isBlocking = 0; this.IsStream = false; this.ZeroReadIsEOF = false; this.isFile = false; return; } this.fdmu = fdmu_; this.Sysfd = Sysfd_; this.pd = pd_; this.iovecs = iovecs_; this.csema = csema_; this.isBlocking = isBlocking_; this.IsStream = IsStream_; this.ZeroReadIsEOF = ZeroReadIsEOF_; this.isFile = isFile_; }); fdMutex = $pkg.fdMutex = $newType(0, $kindStruct, "poll.fdMutex", true, "internal/poll", false, function(state_, rsema_, wsema_) { this.$val = this; if (arguments.length === 0) { this.state = new $Uint64(0, 0); this.rsema = 0; this.wsema = 0; return; } this.state = state_; this.rsema = rsema_; this.wsema = wsema_; }); errNetClosing = $pkg.errNetClosing = $newType(0, $kindStruct, "poll.errNetClosing", true, "internal/poll", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); DeadlineExceededError = $pkg.DeadlineExceededError = $newType(0, $kindStruct, "poll.DeadlineExceededError", true, "internal/poll", true, function() { this.$val = this; if (arguments.length === 0) { return; } }); ptrType = $ptrType($Bool); sliceType = $sliceType($emptyInterface); sliceType$1 = $sliceType(syscall.Iovec); ptrType$1 = $ptrType(sliceType$1); ptrType$2 = $ptrType($Uint8); ptrType$3 = $ptrType($Int64); ptrType$4 = $ptrType(splicePipe); funcType = $funcType([ptrType$4], [], false); ptrType$5 = $ptrType($UnsafePointer); arrayType = $arrayType($Int, 2); sliceType$2 = $sliceType($Int); arrayType$1 = $arrayType($Uint8, 4); ptrType$6 = $ptrType($Uint32); chanType = $chanType($Bool, false, false); sliceType$3 = $sliceType(chanType); ptrType$7 = $ptrType($Int32); ptrType$8 = $ptrType($Uint64); arrayType$2 = $arrayType($Int8, 65); ptrType$9 = $ptrType(FD); ptrType$10 = $ptrType(pollDesc); sliceType$4 = $sliceType($Uint8); sliceType$5 = $sliceType(sliceType$4); ptrType$11 = $ptrType(sliceType$5); ptrType$12 = $ptrType(syscall.IPMreq); ptrType$13 = $ptrType(syscall.IPv6Mreq); ptrType$14 = $ptrType(syscall.IPMreqn); ptrType$15 = $ptrType(syscall.Linger); ptrType$16 = $ptrType(syscall.Stat_t); funcType$1 = $funcType([$Uintptr], [$Bool], false); funcType$2 = $funcType([$Uintptr], [], false); ptrType$17 = $ptrType(fdMutex); ptrType$18 = $ptrType(DeadlineExceededError); FD.ptr.prototype.Writev = function(v) { var $24r, $24r$1, $24r$2, _i, _i$1, _r, _r$1, _ref, _ref$1, _tuple, chunk, err, err$1, err$2, fd, i, iovecs, maxVec, n, v, wrote, x, x$1, x$2, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; _ref$1 = $f._ref$1; _tuple = $f._tuple; chunk = $f.chunk; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; fd = $f.fd; i = $f.i; iovecs = $f.iovecs; maxVec = $f.maxVec; n = $f.n; v = $f.v; wrote = $f.wrote; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fd = this; _r = fd.writeLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $24r = [new $Int64(0, 0), err]; $s = 4; case 4: return $24r; /* } */ case 3: $deferred.push([$methodVal(fd, "writeUnlock"), []]); err$1 = fd.pd.prepareWrite(fd.isFile); /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 5: $24r$1 = [new $Int64(0, 0), err$1]; $s = 7; case 7: return $24r$1; /* } */ case 6: iovecs = sliceType$1.nil; if (!(fd.iovecs === ptrType$1.nil)) { iovecs = fd.iovecs.$get(); } maxVec = 1024; n = new $Int64(0, 0); err$2 = $ifaceNil; /* while (true) { */ case 8: /* if (!(v.$get().$length > 0)) { break; } */ if(!(v.$get().$length > 0)) { $s = 9; continue; } iovecs = $subslice(iovecs, 0, 0); _ref = v.$get(); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } chunk = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (chunk.$length === 0) { _i++; continue; } iovecs = $append(iovecs, newIovecWithBase($indexPtr(chunk.$array, chunk.$offset + 0, ptrType$2))); if (fd.IsStream && chunk.$length > 1073741824) { (x = iovecs.$length - 1 >> 0, ((x < 0 || x >= iovecs.$length) ? ($throwRuntimeError("index out of range"), undefined) : iovecs.$array[iovecs.$offset + x])).SetLen(1073741824); break; } (x$1 = iovecs.$length - 1 >> 0, ((x$1 < 0 || x$1 >= iovecs.$length) ? ($throwRuntimeError("index out of range"), undefined) : iovecs.$array[iovecs.$offset + x$1])).SetLen(chunk.$length); if (iovecs.$length === maxVec) { break; } _i++; } if (iovecs.$length === 0) { /* break; */ $s = 9; continue; } if (fd.iovecs === ptrType$1.nil) { fd.iovecs = $newDataPointer(sliceType$1.nil, ptrType$1); } fd.iovecs.$set(iovecs); wrote = 0; _r$1 = writev(fd.Sysfd, iovecs); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; wrote = _tuple[0]; err$2 = _tuple[1]; if (wrote === 4294967295) { wrote = 0; } $r = $pkg.TestHookDidWritev(((wrote >> 0))); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } n = (x$2 = (new $Int64(0, wrote.constructor === Number ? wrote : 1)), new $Int64(n.$high + x$2.$high, n.$low + x$2.$low)); consume(v, (new $Int64(0, wrote.constructor === Number ? wrote : 1))); _ref$1 = iovecs; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } i = _i$1; syscall.Iovec.copy(((i < 0 || i >= iovecs.$length) ? ($throwRuntimeError("index out of range"), undefined) : iovecs.$array[iovecs.$offset + i]), new syscall.Iovec.ptr(ptrType$2.nil, new $Uint64(0, 0))); _i$1++; } if (!($interfaceIsEqual(err$2, $ifaceNil))) { if ($interfaceIsEqual(err$2, new syscall.Errno(4))) { /* continue; */ $s = 8; continue; } if ($interfaceIsEqual(err$2, new syscall.Errno(11))) { err$2 = fd.pd.waitWrite(fd.isFile); if ($interfaceIsEqual(err$2, $ifaceNil)) { /* continue; */ $s = 8; continue; } } /* break; */ $s = 9; continue; } if ((n.$high === 0 && n.$low === 0)) { err$2 = io.ErrUnexpectedEOF; /* break; */ $s = 9; continue; } $s = 8; continue; case 9: $24r$2 = [n, err$2]; $s = 12; case 12: return $24r$2; /* */ } return; } } catch(err) { $err = err; $s = -1; return [new $Int64(0, 0), $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Writev }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f._ref$1 = _ref$1; $f._tuple = _tuple; $f.chunk = chunk; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.fd = fd; $f.i = i; $f.iovecs = iovecs; $f.maxVec = maxVec; $f.n = n; $f.v = v; $f.wrote = wrote; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.Writev = function(v) { return this.$val.Writev(v); }; Splice = function(dst, src, remain) { var $24r, $24r$1, $24r$2, _r, _r$1, _r$2, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, dst, err, handled, inPipe, max, n, p, remain, sc, src, written, x, x$1, x$2, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _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$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; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; dst = $f.dst; err = $f.err; handled = $f.handled; inPipe = $f.inPipe; max = $f.max; n = $f.n; p = $f.p; remain = $f.remain; sc = $f.sc; src = $f.src; written = $f.written; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); written = new $Int64(0, 0); handled = false; sc = ""; err = $ifaceNil; _r = getPipe(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; p = _tuple[0]; sc = _tuple[1]; err = _tuple[2]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: _tmp = new $Int64(0, 0); _tmp$1 = false; _tmp$2 = sc; _tmp$3 = err; written = _tmp; handled = _tmp$1; sc = _tmp$2; err = _tmp$3; $24r = [written, handled, sc, err]; $s = 4; case 4: return $24r; /* } */ case 3: $deferred.push([putPipe, [p]]); _tmp$4 = 0; _tmp$5 = 0; inPipe = _tmp$4; n = _tmp$5; /* while (true) { */ case 5: /* if (!($interfaceIsEqual(err, $ifaceNil) && (remain.$high > 0 || (remain.$high === 0 && remain.$low > 0)))) { break; } */ if(!($interfaceIsEqual(err, $ifaceNil) && (remain.$high > 0 || (remain.$high === 0 && remain.$low > 0)))) { $s = 6; continue; } max = 4194304; if ((x = (new $Int64(0, max)), (x.$high > remain.$high || (x.$high === remain.$high && x.$low > remain.$low)))) { max = (((remain.$low + ((remain.$high >> 31) * 4294967296)) >> 0)); } _r$1 = spliceDrain(p.wfd, src, max); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; inPipe = _tuple$1[0]; err = _tuple$1[1]; handled = handled || (!($interfaceIsEqual(err, new syscall.Errno(22)))); if (!($interfaceIsEqual(err, $ifaceNil)) || (inPipe === 0)) { /* break; */ $s = 6; continue; } p.data = p.data + (inPipe) >> 0; _r$2 = splicePump(dst, p.rfd, inPipe); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$2 = _r$2; n = _tuple$2[0]; err = _tuple$2[1]; if (n > 0) { written = (x$1 = (new $Int64(0, n)), new $Int64(written.$high + x$1.$high, written.$low + x$1.$low)); remain = (x$2 = (new $Int64(0, n)), new $Int64(remain.$high - x$2.$high, remain.$low - x$2.$low)); p.data = p.data - (n) >> 0; } $s = 5; continue; case 6: /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 9; continue; } /* */ $s = 10; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 9: _tmp$6 = written; _tmp$7 = handled; _tmp$8 = "splice"; _tmp$9 = err; written = _tmp$6; handled = _tmp$7; sc = _tmp$8; err = _tmp$9; $24r$1 = [written, handled, sc, err]; $s = 11; case 11: return $24r$1; /* } */ case 10: _tmp$10 = written; _tmp$11 = true; _tmp$12 = ""; _tmp$13 = $ifaceNil; written = _tmp$10; handled = _tmp$11; sc = _tmp$12; err = _tmp$13; $24r$2 = [written, handled, sc, err]; $s = 12; case 12: return $24r$2; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [written, handled, sc, err]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Splice }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $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$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._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.dst = dst; $f.err = err; $f.handled = handled; $f.inPipe = inPipe; $f.max = max; $f.n = n; $f.p = p; $f.remain = remain; $f.sc = sc; $f.src = src; $f.written = written; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; $pkg.Splice = Splice; spliceDrain = function(pipefd, sock, max) { var $24r, $24r$1, $24r$2, $24r$3, _r, _r$1, _tuple, err, err$1, err$2, err$3, max, n, pipefd, sock, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; max = $f.max; n = $f.n; pipefd = $f.pipefd; sock = $f.sock; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); _r = sock.readLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $24r = [0, err]; $s = 4; case 4: return $24r; /* } */ case 3: $deferred.push([$methodVal(sock, "readUnlock"), []]); err$1 = sock.pd.prepareRead(sock.isFile); /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 5: $24r$1 = [0, err$1]; $s = 7; case 7: return $24r$1; /* } */ case 6: /* while (true) { */ case 8: _r$1 = splice(pipefd, sock.Sysfd, max, 2); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err$2 = _tuple[1]; if ($interfaceIsEqual(err$2, new syscall.Errno(4))) { /* continue; */ $s = 8; continue; } /* */ if (!($interfaceIsEqual(err$2, new syscall.Errno(11)))) { $s = 11; continue; } /* */ $s = 12; continue; /* if (!($interfaceIsEqual(err$2, new syscall.Errno(11)))) { */ case 11: $24r$2 = [n, err$2]; $s = 13; case 13: return $24r$2; /* } */ case 12: err$3 = sock.pd.waitRead(sock.isFile); /* */ if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = 14; continue; } /* */ $s = 15; continue; /* if (!($interfaceIsEqual(err$3, $ifaceNil))) { */ case 14: $24r$3 = [n, err$3]; $s = 16; case 16: return $24r$3; /* } */ case 15: $s = 8; continue; case 9: $s = -1; return [0, $ifaceNil]; /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: spliceDrain }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.max = max; $f.n = n; $f.pipefd = pipefd; $f.sock = sock; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; splicePump = function(sock, pipefd, inPipe) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, _r, _r$1, _tuple, err, err$1, err$2, err$3, inPipe, n, pipefd, sock, written, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; inPipe = $f.inPipe; n = $f.n; pipefd = $f.pipefd; sock = $f.sock; written = $f.written; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); _r = sock.writeLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $24r = [0, err]; $s = 4; case 4: return $24r; /* } */ case 3: $deferred.push([$methodVal(sock, "writeUnlock"), []]); err$1 = sock.pd.prepareWrite(sock.isFile); /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 5: $24r$1 = [0, err$1]; $s = 7; case 7: return $24r$1; /* } */ case 6: written = 0; /* while (true) { */ case 8: /* if (!(inPipe > 0)) { break; } */ if(!(inPipe > 0)) { $s = 9; continue; } _r$1 = splice(sock.Sysfd, pipefd, inPipe, 2); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err$2 = _tuple[1]; if (n > 0) { inPipe = inPipe - (n) >> 0; written = written + (n) >> 0; /* continue; */ $s = 8; continue; } /* */ if (!($interfaceIsEqual(err$2, new syscall.Errno(11)))) { $s = 11; continue; } /* */ $s = 12; continue; /* if (!($interfaceIsEqual(err$2, new syscall.Errno(11)))) { */ case 11: $24r$2 = [written, err$2]; $s = 13; case 13: return $24r$2; /* } */ case 12: err$3 = sock.pd.waitWrite(sock.isFile); /* */ if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = 14; continue; } /* */ $s = 15; continue; /* if (!($interfaceIsEqual(err$3, $ifaceNil))) { */ case 14: $24r$3 = [written, err$3]; $s = 16; case 16: return $24r$3; /* } */ case 15: $s = 8; continue; case 9: $24r$4 = [written, $ifaceNil]; $s = 17; case 17: return $24r$4; /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: splicePump }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.inPipe = inPipe; $f.n = n; $f.pipefd = pipefd; $f.sock = sock; $f.written = written; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; splice = function(out, in$1, max, flags) { var _r, _tuple, err, flags, in$1, max, n, out, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; flags = $f.flags; in$1 = $f.in$1; max = $f.max; n = $f.n; out = $f.out; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = syscall.Splice(in$1, ptrType$3.nil, out, ptrType$3.nil, max, flags); /* */ $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 = -1; return [(((n.$low + ((n.$high >> 31) * 4294967296)) >> 0)), err]; /* */ } return; } if ($f === undefined) { $f = { $blk: splice }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.flags = flags; $f.in$1 = in$1; $f.max = max; $f.n = n; $f.out = out; $f.$s = $s; $f.$r = $r; return $f; }; newPoolPipe = function() { var _r, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = newPipe(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } p = _r; if (p === ptrType$4.nil) { $s = -1; return $ifaceNil; } runtime.SetFinalizer(p, new funcType(destroyPipe)); $s = -1; return p; /* */ } return; } if ($f === undefined) { $f = { $blk: newPoolPipe }; } $f._r = _r; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; getPipe = function() { var _r, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = splicePipePool.Get(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } v = _r; if ($interfaceIsEqual(v, $ifaceNil)) { $s = -1; return [ptrType$4.nil, "splice", new syscall.Errno(22)]; } $s = -1; return [$assertType(v, ptrType$4), "", $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: getPipe }; } $f._r = _r; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; putPipe = function(p) { var p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (!((p.data === 0))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((p.data === 0))) { */ case 1: runtime.SetFinalizer(p, $ifaceNil); $r = destroyPipe(p); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 2: splicePipePool.Put(p); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: putPipe }; } $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; newPipe = function() { var $24r, $24r$1, $24r$2, $24r$3, _r, _r$1, _tuple, err, errno, fds, p, sp, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; errno = $f.errno; fds = $f.fds; p = $f.p; sp = $f.sp; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); sp = ptrType$4.nil; p = (atomic.LoadPointer((disableSplice$24ptr || (disableSplice$24ptr = new ptrType$5(function() { return disableSplice; }, function($v) { disableSplice = $v; }))))); /* */ if (!(p === ptrType.nil) && p.$get()) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(p === ptrType.nil) && p.$get()) { */ case 1: sp = ptrType$4.nil; $24r = sp; $s = 3; case 3: return $24r; /* } */ case 2: fds = arrayType.zero(); _r = syscall.Pipe2(new sliceType$2(fds), 526336); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 5: sp = ptrType$4.nil; $24r$1 = sp; $s = 7; case 7: return $24r$1; /* } */ case 6: sp = new splicePipe.ptr(fds[0], fds[1], 0); /* */ if (p === ptrType.nil) { $s = 8; continue; } /* */ $s = 9; continue; /* if (p === ptrType.nil) { */ case 8: p = $newDataPointer(false, ptrType); $deferred.push([atomic.StorePointer, [(disableSplice$24ptr || (disableSplice$24ptr = new ptrType$5(function() { return disableSplice; }, function($v) { disableSplice = $v; }))), (p)]]); _r$1 = syscall.Syscall(unix.FcntlSyscall, ((fds[0] >>> 0)), 1032, 0); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; errno = _tuple[2]; /* */ if (!((errno === 0))) { $s = 11; continue; } /* */ $s = 12; continue; /* if (!((errno === 0))) { */ case 11: p.$set(true); $r = destroyPipe(sp); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } sp = ptrType$4.nil; $24r$2 = sp; $s = 14; case 14: return $24r$2; /* } */ case 12: /* } */ case 9: $24r$3 = sp; $s = 15; case 15: return $24r$3; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return sp; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: newPipe }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.errno = errno; $f.fds = fds; $f.p = p; $f.sp = sp; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; destroyPipe = function(p) { var _r, _r$1, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = $pkg.CloseFunc(p.rfd); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; _r$1 = $pkg.CloseFunc(p.wfd); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: destroyPipe }; } $f._r = _r; $f._r$1 = _r$1; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; FD.ptr.prototype.SetsockoptIPMreq = function(level, name, mreq) { var $24r, $24r$1, _r, err, fd, level, mreq, name, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; err = $f.err; fd = $f.fd; level = $f.level; mreq = $f.mreq; name = $f.name; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: $24r = err; $s = 3; case 3: return $24r; /* } */ case 2: $deferred.push([$methodVal(fd, "decref"), []]); _r = syscall.SetsockoptIPMreq(fd.Sysfd, level, name, mreq); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r$1 = _r; $s = 5; case 5: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.SetsockoptIPMreq }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f.err = err; $f.fd = fd; $f.level = level; $f.mreq = mreq; $f.name = name; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.SetsockoptIPMreq = function(level, name, mreq) { return this.$val.SetsockoptIPMreq(level, name, mreq); }; FD.ptr.prototype.SetsockoptIPv6Mreq = function(level, name, mreq) { var $24r, $24r$1, _r, err, fd, level, mreq, name, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; err = $f.err; fd = $f.fd; level = $f.level; mreq = $f.mreq; name = $f.name; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: $24r = err; $s = 3; case 3: return $24r; /* } */ case 2: $deferred.push([$methodVal(fd, "decref"), []]); _r = syscall.SetsockoptIPv6Mreq(fd.Sysfd, level, name, mreq); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r$1 = _r; $s = 5; case 5: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.SetsockoptIPv6Mreq }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f.err = err; $f.fd = fd; $f.level = level; $f.mreq = mreq; $f.name = name; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.SetsockoptIPv6Mreq = function(level, name, mreq) { return this.$val.SetsockoptIPv6Mreq(level, name, mreq); }; FD.ptr.prototype.SetsockoptByte = function(level, name, arg) { var $24r, $24r$1, _r, arg, err, fd, level, name, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; arg = $f.arg; err = $f.err; fd = $f.fd; level = $f.level; name = $f.name; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: $24r = err; $s = 3; case 3: return $24r; /* } */ case 2: $deferred.push([$methodVal(fd, "decref"), []]); _r = syscall.SetsockoptByte(fd.Sysfd, level, name, arg); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r$1 = _r; $s = 5; case 5: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.SetsockoptByte }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f.arg = arg; $f.err = err; $f.fd = fd; $f.level = level; $f.name = name; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.SetsockoptByte = function(level, name, arg) { return this.$val.SetsockoptByte(level, name, arg); }; FD.ptr.prototype.SetsockoptIPMreqn = function(level, name, mreq) { var $24r, $24r$1, _r, err, fd, level, mreq, name, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; err = $f.err; fd = $f.fd; level = $f.level; mreq = $f.mreq; name = $f.name; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: $24r = err; $s = 3; case 3: return $24r; /* } */ case 2: $deferred.push([$methodVal(fd, "decref"), []]); _r = syscall.SetsockoptIPMreqn(fd.Sysfd, level, name, mreq); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r$1 = _r; $s = 5; case 5: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.SetsockoptIPMreqn }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f.err = err; $f.fd = fd; $f.level = level; $f.mreq = mreq; $f.name = name; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.SetsockoptIPMreqn = function(level, name, mreq) { return this.$val.SetsockoptIPMreqn(level, name, mreq); }; FD.ptr.prototype.SetsockoptInt = function(level, name, arg) { var $24r, $24r$1, _r, arg, err, fd, level, name, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; arg = $f.arg; err = $f.err; fd = $f.fd; level = $f.level; name = $f.name; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: $24r = err; $s = 3; case 3: return $24r; /* } */ case 2: $deferred.push([$methodVal(fd, "decref"), []]); _r = syscall.SetsockoptInt(fd.Sysfd, level, name, arg); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r$1 = _r; $s = 5; case 5: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.SetsockoptInt }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f.arg = arg; $f.err = err; $f.fd = fd; $f.level = level; $f.name = name; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.SetsockoptInt = function(level, name, arg) { return this.$val.SetsockoptInt(level, name, arg); }; FD.ptr.prototype.SetsockoptInet4Addr = function(level, name, arg) { var $24r, $24r$1, _r, arg, err, fd, level, name, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; arg = $f.arg; err = $f.err; fd = $f.fd; level = $f.level; name = $f.name; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: $24r = err; $s = 3; case 3: return $24r; /* } */ case 2: $deferred.push([$methodVal(fd, "decref"), []]); _r = syscall.SetsockoptInet4Addr(fd.Sysfd, level, name, $clone(arg, arrayType$1)); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r$1 = _r; $s = 5; case 5: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.SetsockoptInet4Addr }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f.arg = arg; $f.err = err; $f.fd = fd; $f.level = level; $f.name = name; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.SetsockoptInet4Addr = function(level, name, arg) { return this.$val.SetsockoptInet4Addr(level, name, arg); }; FD.ptr.prototype.SetsockoptLinger = function(level, name, l) { var $24r, $24r$1, _r, err, fd, l, level, name, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; err = $f.err; fd = $f.fd; l = $f.l; level = $f.level; name = $f.name; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: $24r = err; $s = 3; case 3: return $24r; /* } */ case 2: $deferred.push([$methodVal(fd, "decref"), []]); _r = syscall.SetsockoptLinger(fd.Sysfd, level, name, l); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r$1 = _r; $s = 5; case 5: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.SetsockoptLinger }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f.err = err; $f.fd = fd; $f.l = l; $f.level = level; $f.name = name; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.SetsockoptLinger = function(level, name, l) { return this.$val.SetsockoptLinger(level, name, l); }; accept = function(s) { var _1, _r, _r$1, _r$2, _r$3, _tuple, _tuple$1, err, ns, s, sa, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _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; err = $f.err; ns = $f.ns; s = $f.s; sa = $f.sa; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = $pkg.Accept4Func(s, 526336); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; ns = _tuple[0]; sa = _tuple[1]; err = _tuple[2]; _1 = err; if ($interfaceIsEqual(_1, $ifaceNil)) { $s = -1; return [ns, sa, "", $ifaceNil]; } else if ($interfaceIsEqual(_1, new syscall.Errno((38)))) { } else if ($interfaceIsEqual(_1, new syscall.Errno((22)))) { } else if ($interfaceIsEqual(_1, new syscall.Errno((13)))) { } else if ($interfaceIsEqual(_1, new syscall.Errno((14)))) { } else { $s = -1; return [-1, sa, "accept4", err]; } _r$1 = $pkg.AcceptFunc(s); /* */ $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; ns = _tuple$1[0]; sa = _tuple$1[1]; err = _tuple$1[2]; /* */ if ($interfaceIsEqual(err, $ifaceNil)) { $s = 3; continue; } /* */ $s = 4; continue; /* if ($interfaceIsEqual(err, $ifaceNil)) { */ case 3: $r = syscall.CloseOnExec(ns); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [-1, $ifaceNil, "accept", err]; } _r$2 = syscall.SetNonblock(ns, true); /* */ $s = 6; case 6: 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))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 7: _r$3 = $pkg.CloseFunc(ns); /* */ $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; return [-1, $ifaceNil, "setnonblock", err]; /* } */ case 8: $s = -1; return [ns, sa, "", $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: accept }; } $f._1 = _1; $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.err = err; $f.ns = ns; $f.s = s; $f.sa = sa; $f.$s = $s; $f.$r = $r; return $f; }; SendFile = function(dstFD, src, remain) { var $24r, $24r$1, $24r$2, _r, _r$1, _tuple, dst, dstFD, err, err$1, err$2, err1, n, remain, src, written, x, x$1, x$2, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; dst = $f.dst; dstFD = $f.dstFD; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err1 = $f.err1; n = $f.n; remain = $f.remain; src = $f.src; written = $f.written; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); _r = dstFD.writeLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $24r = [new $Int64(0, 0), err]; $s = 4; case 4: return $24r; /* } */ case 3: $deferred.push([$methodVal(dstFD, "writeUnlock"), []]); err$1 = dstFD.pd.prepareWrite(dstFD.isFile); /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 5: $24r$1 = [new $Int64(0, 0), err$1]; $s = 7; case 7: return $24r$1; /* } */ case 6: dst = dstFD.Sysfd; written = new $Int64(0, 0); err$2 = $ifaceNil; /* while (true) { */ case 8: /* if (!((remain.$high > 0 || (remain.$high === 0 && remain.$low > 0)))) { break; } */ if(!((remain.$high > 0 || (remain.$high === 0 && remain.$low > 0)))) { $s = 9; continue; } n = 4194304; if ((x = (new $Int64(0, n)), (x.$high > remain.$high || (x.$high === remain.$high && x.$low > remain.$low)))) { n = (((remain.$low + ((remain.$high >> 31) * 4294967296)) >> 0)); } _r$1 = syscall.Sendfile(dst, src, ptrType$3.nil, n); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err1 = _tuple[1]; if (n > 0) { written = (x$1 = (new $Int64(0, n)), new $Int64(written.$high + x$1.$high, written.$low + x$1.$low)); remain = (x$2 = (new $Int64(0, n)), new $Int64(remain.$high - x$2.$high, remain.$low - x$2.$low)); } else if ((n === 0) && $interfaceIsEqual(err1, $ifaceNil)) { /* break; */ $s = 9; continue; } if ($interfaceIsEqual(err1, new syscall.Errno(4))) { /* continue; */ $s = 8; continue; } if ($interfaceIsEqual(err1, new syscall.Errno(11))) { err1 = dstFD.pd.waitWrite(dstFD.isFile); if ($interfaceIsEqual(err1, $ifaceNil)) { /* continue; */ $s = 8; continue; } } if (!($interfaceIsEqual(err1, $ifaceNil))) { err$2 = err1; /* break; */ $s = 9; continue; } $s = 8; continue; case 9: $24r$2 = [written, err$2]; $s = 11; case 11: return $24r$2; /* */ } return; } } catch(err) { $err = err; $s = -1; return [new $Int64(0, 0), $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: SendFile }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.dst = dst; $f.dstFD = dstFD; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err1 = err1; $f.n = n; $f.remain = remain; $f.src = src; $f.written = written; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; $pkg.SendFile = SendFile; newIovecWithBase = function(base) { var base; return new syscall.Iovec.ptr(base, new $Uint64(0, 0)); }; pollDesc.ptr.prototype.init = function(fd) { var fd, pd; pd = this; return $ifaceNil; }; pollDesc.prototype.init = function(fd) { return this.$val.init(fd); }; pollDesc.ptr.prototype.close = function() { var pd; pd = this; }; pollDesc.prototype.close = function() { return this.$val.close(); }; pollDesc.ptr.prototype.evict = function() { var pd; pd = this; pd.closing = true; }; pollDesc.prototype.evict = function() { return this.$val.evict(); }; pollDesc.ptr.prototype.prepare = function(mode, isFile) { var isFile, mode, pd; pd = this; if (pd.closing) { return errClosing(isFile); } return $ifaceNil; }; pollDesc.prototype.prepare = function(mode, isFile) { return this.$val.prepare(mode, isFile); }; pollDesc.ptr.prototype.prepareRead = function(isFile) { var isFile, pd; pd = this; return pd.prepare(114, isFile); }; pollDesc.prototype.prepareRead = function(isFile) { return this.$val.prepareRead(isFile); }; pollDesc.ptr.prototype.prepareWrite = function(isFile) { var isFile, pd; pd = this; return pd.prepare(119, isFile); }; pollDesc.prototype.prepareWrite = function(isFile) { return this.$val.prepareWrite(isFile); }; pollDesc.ptr.prototype.wait = function(mode, isFile) { var isFile, mode, pd; pd = this; if (pd.closing) { return errClosing(isFile); } return $pkg.ErrDeadlineExceeded; }; pollDesc.prototype.wait = function(mode, isFile) { return this.$val.wait(mode, isFile); }; pollDesc.ptr.prototype.waitRead = function(isFile) { var isFile, pd; pd = this; return pd.wait(114, isFile); }; pollDesc.prototype.waitRead = function(isFile) { return this.$val.waitRead(isFile); }; pollDesc.ptr.prototype.waitWrite = function(isFile) { var isFile, pd; pd = this; return pd.wait(119, isFile); }; pollDesc.prototype.waitWrite = function(isFile) { return this.$val.waitWrite(isFile); }; pollDesc.ptr.prototype.pollable = function() { return true; }; pollDesc.prototype.pollable = function() { return this.$val.pollable(); }; FD.ptr.prototype.SetDeadline = function(t) { var t; return $ifaceNil; }; FD.prototype.SetDeadline = function(t) { return this.$val.SetDeadline(t); }; FD.ptr.prototype.SetReadDeadline = function(t) { var t; return $ifaceNil; }; FD.prototype.SetReadDeadline = function(t) { return this.$val.SetReadDeadline(t); }; FD.ptr.prototype.SetWriteDeadline = function(t) { var t; return $ifaceNil; }; FD.prototype.SetWriteDeadline = function(t) { return this.$val.SetWriteDeadline(t); }; runtime_Semacquire = function(s) { var _entry, _key, _r, ch, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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$6.keyFor(_key)] = { k: _key, v: $append((_entry = semWaiters[ptrType$6.keyFor(s)], _entry !== undefined ? _entry.v : sliceType$3.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; return; /* */ } return; } if ($f === undefined) { $f = { $blk: runtime_Semacquire }; } $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 _entry, _key, ch, s, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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$6.keyFor(s)], _entry !== undefined ? _entry.v : sliceType$3.nil); if (w.$length === 0) { $s = -1; return; } ch = (0 >= w.$length ? ($throwRuntimeError("index out of range"), undefined) : w.$array[w.$offset + 0]); w = $subslice(w, 1); _key = s; (semWaiters || $throwRuntimeError("assignment to entry in nil map"))[ptrType$6.keyFor(_key)] = { k: _key, v: w }; if (w.$length === 0) { delete semWaiters[ptrType$6.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; return; /* */ } return; } if ($f === undefined) { $f = { $blk: runtime_Semrelease }; } $f._entry = _entry; $f._key = _key; $f.ch = ch; $f.s = s; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; writev = function(fd, iovecs) { var _r, _tuple, e, fd, iovecs, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; e = $f.e; fd = $f.fd; iovecs = $f.iovecs; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = 0; e = 0; /* while (true) { */ case 1: _r = syscall.Syscall(66, ((fd >>> 0)), (($sliceToNativeArray(iovecs))), ((iovecs.$length >>> 0))); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; r = _tuple[0]; e = _tuple[2]; if (!((e === 4))) { /* break; */ $s = 2; continue; } $s = 1; continue; case 2: if (!((e === 0))) { $s = -1; return [r, new syscall.Errno(e)]; } $s = -1; return [r, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: writev }; } $f._r = _r; $f._tuple = _tuple; $f.e = e; $f.fd = fd; $f.iovecs = iovecs; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; FD.ptr.prototype.Init = function(net, pollable) { var err, fd, net, pollable; fd = this; if (net === "file") { fd.isFile = true; } if (!pollable) { fd.isBlocking = 1; return $ifaceNil; } err = fd.pd.init(fd); if (!($interfaceIsEqual(err, $ifaceNil))) { fd.isBlocking = 1; } return err; }; FD.prototype.Init = function(net, pollable) { return this.$val.Init(net, pollable); }; FD.ptr.prototype.destroy = function() { var _r, err, fd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; err = $f.err; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = this; fd.pd.close(); _r = $pkg.CloseFunc(fd.Sysfd); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; fd.Sysfd = -1; $r = runtime_Semrelease((fd.$ptr_csema || (fd.$ptr_csema = new ptrType$6(function() { return this.$target.csema; }, function($v) { this.$target.csema = $v; }, fd)))); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: FD.ptr.prototype.destroy }; } $f._r = _r; $f.err = err; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; }; FD.prototype.destroy = function() { return this.$val.destroy(); }; FD.ptr.prototype.Close = function() { var _r, _r$1, err, fd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; err = $f.err; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = this; _r = fd.fdmu.increfAndClose(); /* */ $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: $s = -1; return errClosing(fd.isFile); /* } */ case 2: fd.pd.evict(); _r$1 = fd.decref(); /* */ $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; /* */ if (fd.isBlocking === 0) { $s = 5; continue; } /* */ $s = 6; continue; /* if (fd.isBlocking === 0) { */ case 5: $r = runtime_Semacquire((fd.$ptr_csema || (fd.$ptr_csema = new ptrType$6(function() { return this.$target.csema; }, function($v) { this.$target.csema = $v; }, fd)))); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 6: $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Close }; } $f._r = _r; $f._r$1 = _r$1; $f.err = err; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; }; FD.prototype.Close = function() { return this.$val.Close(); }; FD.ptr.prototype.SetBlocking = function() { var $24r, $24r$1, _r, err, fd, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; err = $f.err; fd = $f.fd; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: $24r = err; $s = 3; case 3: return $24r; /* } */ case 2: $deferred.push([$methodVal(fd, "decref"), []]); atomic.StoreUint32((fd.$ptr_isBlocking || (fd.$ptr_isBlocking = new ptrType$6(function() { return this.$target.isBlocking; }, function($v) { this.$target.isBlocking = $v; }, fd))), 1); _r = syscall.SetNonblock(fd.Sysfd, false); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r$1 = _r; $s = 5; case 5: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.SetBlocking }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f.err = err; $f.fd = fd; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.SetBlocking = function() { return this.$val.SetBlocking(); }; FD.ptr.prototype.Read = function(p) { var $24r, $24r$1, $24r$2, $24r$3, _r, _r$1, _tuple, err, err$1, err$2, fd, n, p, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; fd = $f.fd; n = $f.n; p = $f.p; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fd = this; _r = fd.readLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $24r = [0, err]; $s = 4; case 4: return $24r; /* } */ case 3: $deferred.push([$methodVal(fd, "readUnlock"), []]); /* */ if (p.$length === 0) { $s = 5; continue; } /* */ $s = 6; continue; /* if (p.$length === 0) { */ case 5: $24r$1 = [0, $ifaceNil]; $s = 7; case 7: return $24r$1; /* } */ case 6: err$1 = fd.pd.prepareRead(fd.isFile); /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 8: $24r$2 = [0, err$1]; $s = 10; case 10: return $24r$2; /* } */ case 9: if (fd.IsStream && p.$length > 1073741824) { p = $subslice(p, 0, 1073741824); } /* while (true) { */ case 11: _r$1 = ignoringEINTRIO(syscall.Read, fd.Sysfd, p); /* */ $s = 13; case 13: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err$2 = _tuple[1]; if (!($interfaceIsEqual(err$2, $ifaceNil))) { n = 0; if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { err$2 = fd.pd.waitRead(fd.isFile); if ($interfaceIsEqual(err$2, $ifaceNil)) { /* continue; */ $s = 11; continue; } } } err$2 = fd.eofError(n, err$2); $24r$3 = [n, err$2]; $s = 14; case 14: return $24r$3; case 12: $s = -1; return [0, $ifaceNil]; /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Read }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.fd = fd; $f.n = n; $f.p = p; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.Read = function(p) { return this.$val.Read(p); }; FD.ptr.prototype.Pread = function(p, off) { var _r, _r$1, _tuple, err, err$1, fd, n, off, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; err$1 = $f.err$1; fd = $f.fd; n = $f.n; off = $f.off; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = this; err = fd.incref(); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [0, err]; } if (fd.IsStream && p.$length > 1073741824) { p = $subslice(p, 0, 1073741824); } n = 0; err$1 = $ifaceNil; /* while (true) { */ case 1: _r = syscall.Pread(fd.Sysfd, p, off); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; err$1 = _tuple[1]; if (!($interfaceIsEqual(err$1, new syscall.Errno(4)))) { /* break; */ $s = 2; continue; } $s = 1; continue; case 2: if (!($interfaceIsEqual(err$1, $ifaceNil))) { n = 0; } _r$1 = fd.decref(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; err$1 = fd.eofError(n, err$1); $s = -1; return [n, err$1]; /* */ } return; } if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Pread }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.err$1 = err$1; $f.fd = fd; $f.n = n; $f.off = off; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; FD.prototype.Pread = function(p, off) { return this.$val.Pread(p, off); }; FD.ptr.prototype.ReadFrom = function(p) { var $24r, $24r$1, $24r$2, _r, _r$1, _tuple, err, err$1, err$2, fd, n, p, sa, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; fd = $f.fd; n = $f.n; p = $f.p; sa = $f.sa; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fd = this; _r = fd.readLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $24r = [0, $ifaceNil, err]; $s = 4; case 4: return $24r; /* } */ case 3: $deferred.push([$methodVal(fd, "readUnlock"), []]); err$1 = fd.pd.prepareRead(fd.isFile); /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 5: $24r$1 = [0, $ifaceNil, err$1]; $s = 7; case 7: return $24r$1; /* } */ case 6: /* while (true) { */ case 8: _r$1 = syscall.Recvfrom(fd.Sysfd, p, 0); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; sa = _tuple[1]; err$2 = _tuple[2]; if (!($interfaceIsEqual(err$2, $ifaceNil))) { if ($interfaceIsEqual(err$2, new syscall.Errno(4))) { /* continue; */ $s = 8; continue; } n = 0; if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { err$2 = fd.pd.waitRead(fd.isFile); if ($interfaceIsEqual(err$2, $ifaceNil)) { /* continue; */ $s = 8; continue; } } } err$2 = fd.eofError(n, err$2); $24r$2 = [n, sa, err$2]; $s = 11; case 11: return $24r$2; case 9: $s = -1; return [0, $ifaceNil, $ifaceNil]; /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.ReadFrom }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.fd = fd; $f.n = n; $f.p = p; $f.sa = sa; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.ReadFrom = function(p) { return this.$val.ReadFrom(p); }; FD.ptr.prototype.ReadMsg = function(p, oob, flags) { var $24r, $24r$1, $24r$2, _r, _r$1, _tuple, err, err$1, err$2, fd, flags, n, oob, oobn, p, sa, sysflags, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; fd = $f.fd; flags = $f.flags; n = $f.n; oob = $f.oob; oobn = $f.oobn; p = $f.p; sa = $f.sa; sysflags = $f.sysflags; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fd = this; _r = fd.readLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $24r = [0, 0, 0, $ifaceNil, err]; $s = 4; case 4: return $24r; /* } */ case 3: $deferred.push([$methodVal(fd, "readUnlock"), []]); err$1 = fd.pd.prepareRead(fd.isFile); /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 5: $24r$1 = [0, 0, 0, $ifaceNil, err$1]; $s = 7; case 7: return $24r$1; /* } */ case 6: /* while (true) { */ case 8: _r$1 = syscall.Recvmsg(fd.Sysfd, p, oob, flags); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; oobn = _tuple[1]; sysflags = _tuple[2]; sa = _tuple[3]; err$2 = _tuple[4]; if (!($interfaceIsEqual(err$2, $ifaceNil))) { if ($interfaceIsEqual(err$2, new syscall.Errno(4))) { /* continue; */ $s = 8; continue; } if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { err$2 = fd.pd.waitRead(fd.isFile); if ($interfaceIsEqual(err$2, $ifaceNil)) { /* continue; */ $s = 8; continue; } } } err$2 = fd.eofError(n, err$2); $24r$2 = [n, oobn, sysflags, sa, err$2]; $s = 11; case 11: return $24r$2; case 9: $s = -1; return [0, 0, 0, $ifaceNil, $ifaceNil]; /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, 0, 0, $ifaceNil, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.ReadMsg }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.fd = fd; $f.flags = flags; $f.n = n; $f.oob = oob; $f.oobn = oobn; $f.p = p; $f.sa = sa; $f.sysflags = sysflags; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.ReadMsg = function(p, oob, flags) { return this.$val.ReadMsg(p, oob, flags); }; FD.ptr.prototype.Write = function(p) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, _r, _r$1, _tuple, err, err$1, err$2, fd, max, n, nn, p, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; fd = $f.fd; max = $f.max; n = $f.n; nn = $f.nn; p = $f.p; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fd = this; _r = fd.writeLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $24r = [0, err]; $s = 4; case 4: return $24r; /* } */ case 3: $deferred.push([$methodVal(fd, "writeUnlock"), []]); err$1 = fd.pd.prepareWrite(fd.isFile); /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 5: $24r$1 = [0, err$1]; $s = 7; case 7: return $24r$1; /* } */ case 6: nn = 0; /* while (true) { */ case 8: max = p.$length; if (fd.IsStream && (max - nn >> 0) > 1073741824) { max = nn + 1073741824 >> 0; } _r$1 = ignoringEINTRIO(syscall.Write, fd.Sysfd, $subslice(p, nn, max)); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err$2 = _tuple[1]; if (n > 0) { nn = nn + (n) >> 0; } /* */ if (nn === p.$length) { $s = 11; continue; } /* */ $s = 12; continue; /* if (nn === p.$length) { */ case 11: $24r$2 = [nn, err$2]; $s = 13; case 13: return $24r$2; /* } */ case 12: if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { err$2 = fd.pd.waitWrite(fd.isFile); if ($interfaceIsEqual(err$2, $ifaceNil)) { /* continue; */ $s = 8; continue; } } /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 14; continue; } /* */ $s = 15; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 14: $24r$3 = [nn, err$2]; $s = 16; case 16: return $24r$3; /* } */ case 15: /* */ if (n === 0) { $s = 17; continue; } /* */ $s = 18; continue; /* if (n === 0) { */ case 17: $24r$4 = [nn, io.ErrUnexpectedEOF]; $s = 19; case 19: return $24r$4; /* } */ case 18: $s = 8; continue; case 9: $s = -1; return [0, $ifaceNil]; /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Write }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.fd = fd; $f.max = max; $f.n = n; $f.nn = nn; $f.p = p; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.Write = function(p) { return this.$val.Write(p); }; FD.ptr.prototype.Pwrite = function(p, off) { var $24r, $24r$1, $24r$2, $24r$3, _r, _tuple, err, err$1, fd, max, n, nn, off, p, x, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; _r = $f._r; _tuple = $f._tuple; err = $f.err; err$1 = $f.err$1; fd = $f.fd; max = $f.max; n = $f.n; nn = $f.nn; off = $f.off; p = $f.p; x = $f.x; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: $24r = [0, err]; $s = 3; case 3: return $24r; /* } */ case 2: $deferred.push([$methodVal(fd, "decref"), []]); nn = 0; /* while (true) { */ case 4: max = p.$length; if (fd.IsStream && (max - nn >> 0) > 1073741824) { max = nn + 1073741824 >> 0; } _r = syscall.Pwrite(fd.Sysfd, $subslice(p, nn, max), (x = (new $Int64(0, nn)), new $Int64(off.$high + x.$high, off.$low + x.$low))); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; err$1 = _tuple[1]; if ($interfaceIsEqual(err$1, new syscall.Errno(4))) { /* continue; */ $s = 4; continue; } if (n > 0) { nn = nn + (n) >> 0; } /* */ if (nn === p.$length) { $s = 7; continue; } /* */ $s = 8; continue; /* if (nn === p.$length) { */ case 7: $24r$1 = [nn, err$1]; $s = 9; case 9: return $24r$1; /* } */ case 8: /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 10; continue; } /* */ $s = 11; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 10: $24r$2 = [nn, err$1]; $s = 12; case 12: return $24r$2; /* } */ case 11: /* */ if (n === 0) { $s = 13; continue; } /* */ $s = 14; continue; /* if (n === 0) { */ case 13: $24r$3 = [nn, io.ErrUnexpectedEOF]; $s = 15; case 15: return $24r$3; /* } */ case 14: $s = 4; continue; case 5: $s = -1; return [0, $ifaceNil]; /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Pwrite }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.err$1 = err$1; $f.fd = fd; $f.max = max; $f.n = n; $f.nn = nn; $f.off = off; $f.p = p; $f.x = x; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.Pwrite = function(p, off) { return this.$val.Pwrite(p, off); }; FD.ptr.prototype.WriteTo = function(p, sa) { var $24r, $24r$1, $24r$2, $24r$3, _r, _r$1, err, err$1, err$2, fd, p, sa, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; _r = $f._r; _r$1 = $f._r$1; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; fd = $f.fd; p = $f.p; sa = $f.sa; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fd = this; _r = fd.writeLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $24r = [0, err]; $s = 4; case 4: return $24r; /* } */ case 3: $deferred.push([$methodVal(fd, "writeUnlock"), []]); err$1 = fd.pd.prepareWrite(fd.isFile); /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 5: $24r$1 = [0, err$1]; $s = 7; case 7: return $24r$1; /* } */ case 6: /* while (true) { */ case 8: _r$1 = syscall.Sendto(fd.Sysfd, p, 0, sa); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err$2 = _r$1; if ($interfaceIsEqual(err$2, new syscall.Errno(4))) { /* continue; */ $s = 8; continue; } if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { err$2 = fd.pd.waitWrite(fd.isFile); if ($interfaceIsEqual(err$2, $ifaceNil)) { /* continue; */ $s = 8; continue; } } /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 11; continue; } /* */ $s = 12; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 11: $24r$2 = [0, err$2]; $s = 13; case 13: return $24r$2; /* } */ case 12: $24r$3 = [p.$length, $ifaceNil]; $s = 14; case 14: return $24r$3; case 9: $s = -1; return [0, $ifaceNil]; /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.WriteTo }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f._r = _r; $f._r$1 = _r$1; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.fd = fd; $f.p = p; $f.sa = sa; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.WriteTo = function(p, sa) { return this.$val.WriteTo(p, sa); }; FD.ptr.prototype.WriteMsg = function(p, oob, sa) { var $24r, $24r$1, $24r$2, $24r$3, _r, _r$1, _tuple, err, err$1, err$2, fd, n, oob, p, sa, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; fd = $f.fd; n = $f.n; oob = $f.oob; p = $f.p; sa = $f.sa; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fd = this; _r = fd.writeLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $24r = [0, 0, err]; $s = 4; case 4: return $24r; /* } */ case 3: $deferred.push([$methodVal(fd, "writeUnlock"), []]); err$1 = fd.pd.prepareWrite(fd.isFile); /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 5: $24r$1 = [0, 0, err$1]; $s = 7; case 7: return $24r$1; /* } */ case 6: /* while (true) { */ case 8: _r$1 = syscall.SendmsgN(fd.Sysfd, p, oob, sa, 0); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err$2 = _tuple[1]; if ($interfaceIsEqual(err$2, new syscall.Errno(4))) { /* continue; */ $s = 8; continue; } if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { err$2 = fd.pd.waitWrite(fd.isFile); if ($interfaceIsEqual(err$2, $ifaceNil)) { /* continue; */ $s = 8; continue; } } /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 11; continue; } /* */ $s = 12; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 11: $24r$2 = [n, 0, err$2]; $s = 13; case 13: return $24r$2; /* } */ case 12: $24r$3 = [n, oob.$length, err$2]; $s = 14; case 14: return $24r$3; case 9: $s = -1; return [0, 0, $ifaceNil]; /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, 0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.WriteMsg }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.fd = fd; $f.n = n; $f.oob = oob; $f.p = p; $f.sa = sa; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.WriteMsg = function(p, oob, sa) { return this.$val.WriteMsg(p, oob, sa); }; FD.ptr.prototype.Accept = function() { var $24r, $24r$1, $24r$2, $24r$3, _1, _r, _r$1, _tuple, err, err$1, err$2, errcall, fd, rsa, s, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; errcall = $f.errcall; fd = $f.fd; rsa = $f.rsa; s = $f.s; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fd = this; _r = fd.readLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $24r = [-1, $ifaceNil, "", err]; $s = 4; case 4: return $24r; /* } */ case 3: $deferred.push([$methodVal(fd, "readUnlock"), []]); err$1 = fd.pd.prepareRead(fd.isFile); /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 5: $24r$1 = [-1, $ifaceNil, "", err$1]; $s = 7; case 7: return $24r$1; /* } */ case 6: /* while (true) { */ case 8: _r$1 = accept(fd.Sysfd); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; s = _tuple[0]; rsa = _tuple[1]; errcall = _tuple[2]; err$2 = _tuple[3]; /* */ if ($interfaceIsEqual(err$2, $ifaceNil)) { $s = 11; continue; } /* */ $s = 12; continue; /* if ($interfaceIsEqual(err$2, $ifaceNil)) { */ case 11: $24r$2 = [s, rsa, "", err$2]; $s = 13; case 13: return $24r$2; /* } */ case 12: _1 = err$2; if ($interfaceIsEqual(_1, new syscall.Errno((4)))) { /* continue; */ $s = 8; continue; } else if ($interfaceIsEqual(_1, new syscall.Errno((11)))) { if (fd.pd.pollable()) { err$2 = fd.pd.waitRead(fd.isFile); if ($interfaceIsEqual(err$2, $ifaceNil)) { /* continue; */ $s = 8; continue; } } } else if ($interfaceIsEqual(_1, new syscall.Errno((103)))) { /* continue; */ $s = 8; continue; } $24r$3 = [-1, $ifaceNil, errcall, err$2]; $s = 14; case 14: return $24r$3; case 9: $s = -1; return [0, $ifaceNil, "", $ifaceNil]; /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil, "", $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Accept }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.errcall = errcall; $f.fd = fd; $f.rsa = rsa; $f.s = s; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.Accept = function() { return this.$val.Accept(); }; FD.ptr.prototype.Seek = function(offset, whence) { var $24r, $24r$1, _r, err, fd, offset, whence, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; err = $f.err; fd = $f.fd; offset = $f.offset; whence = $f.whence; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: $24r = [new $Int64(0, 0), err]; $s = 3; case 3: return $24r; /* } */ case 2: $deferred.push([$methodVal(fd, "decref"), []]); _r = syscall.Seek(fd.Sysfd, offset, whence); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r$1 = _r; $s = 5; case 5: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return [new $Int64(0, 0), $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Seek }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f.err = err; $f.fd = fd; $f.offset = offset; $f.whence = whence; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.Seek = function(offset, whence) { return this.$val.Seek(offset, whence); }; FD.ptr.prototype.ReadDirent = function(buf) { var $24r, $24r$1, _r, _tuple, buf, err, err$1, fd, n, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; _tuple = $f._tuple; buf = $f.buf; err = $f.err; err$1 = $f.err$1; fd = $f.fd; n = $f.n; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: $24r = [0, err]; $s = 3; case 3: return $24r; /* } */ case 2: $deferred.push([$methodVal(fd, "decref"), []]); /* while (true) { */ case 4: _r = ignoringEINTRIO(syscall.ReadDirent, fd.Sysfd, buf); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; err$1 = _tuple[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { n = 0; if ($interfaceIsEqual(err$1, new syscall.Errno(11)) && fd.pd.pollable()) { err$1 = fd.pd.waitRead(fd.isFile); if ($interfaceIsEqual(err$1, $ifaceNil)) { /* continue; */ $s = 4; continue; } } } $24r$1 = [n, err$1]; $s = 7; case 7: return $24r$1; case 5: $s = -1; return [0, $ifaceNil]; /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.ReadDirent }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f._tuple = _tuple; $f.buf = buf; $f.err = err; $f.err$1 = err$1; $f.fd = fd; $f.n = n; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.ReadDirent = function(buf) { return this.$val.ReadDirent(buf); }; FD.ptr.prototype.Fchmod = function(mode) { var $24r, $24r$1, _r, err, fd, mode, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; err = $f.err; fd = $f.fd; mode = $f.mode; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fd = [fd]; mode = [mode]; fd[0] = this; err = fd[0].incref(); /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: $24r = err; $s = 3; case 3: return $24r; /* } */ case 2: $deferred.push([$methodVal(fd[0], "decref"), []]); _r = ignoringEINTR((function(fd, mode) { return function $b() { var $24r$1, _r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r$1 = $f.$24r$1; _r = $f._r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = syscall.Fchmod(fd[0].Sysfd, mode[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r$1 = _r; $s = 2; case 2: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$24r$1 = $24r$1; $f._r = _r; $f.$s = $s; $f.$r = $r; return $f; }; })(fd, mode)); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r$1 = _r; $s = 5; case 5: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Fchmod }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f.err = err; $f.fd = fd; $f.mode = mode; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.Fchmod = function(mode) { return this.$val.Fchmod(mode); }; FD.ptr.prototype.Fchdir = function() { var $24r, $24r$1, _r, err, fd, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; err = $f.err; fd = $f.fd; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: $24r = err; $s = 3; case 3: return $24r; /* } */ case 2: $deferred.push([$methodVal(fd, "decref"), []]); _r = syscall.Fchdir(fd.Sysfd); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r$1 = _r; $s = 5; case 5: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Fchdir }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f.err = err; $f.fd = fd; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.Fchdir = function() { return this.$val.Fchdir(); }; FD.ptr.prototype.Fstat = function(s) { var $24r, $24r$1, _r, err, fd, s, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; err = $f.err; fd = $f.fd; s = $f.s; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fd = [fd]; s = [s]; fd[0] = this; err = fd[0].incref(); /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: $24r = err; $s = 3; case 3: return $24r; /* } */ case 2: $deferred.push([$methodVal(fd[0], "decref"), []]); _r = ignoringEINTR((function(fd, s) { return function $b() { var $24r$1, _r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r$1 = $f.$24r$1; _r = $f._r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = syscall.Fstat(fd[0].Sysfd, s[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r$1 = _r; $s = 2; case 2: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$24r$1 = $24r$1; $f._r = _r; $f.$s = $s; $f.$r = $r; return $f; }; })(fd, s)); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r$1 = _r; $s = 5; case 5: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Fstat }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f.err = err; $f.fd = fd; $f.s = s; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.Fstat = function(s) { return this.$val.Fstat(s); }; DupCloseOnExec = function(fd) { var $24r, _1, _r, _r$1, _tuple, e1, fd, r0, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; e1 = $f.e1; fd = $f.fd; r0 = $f.r0; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (true && (atomic.LoadInt32((tryDupCloexec$24ptr || (tryDupCloexec$24ptr = new ptrType$7(function() { return tryDupCloexec; }, function($v) { tryDupCloexec = $v; })))) === 1)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (true && (atomic.LoadInt32((tryDupCloexec$24ptr || (tryDupCloexec$24ptr = new ptrType$7(function() { return tryDupCloexec; }, function($v) { tryDupCloexec = $v; })))) === 1)) { */ case 1: _r = fcntl(fd, 1030, 0); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; r0 = _tuple[0]; e1 = _tuple[1]; if ($interfaceIsEqual(e1, $ifaceNil)) { $s = -1; return [r0, "", $ifaceNil]; } _1 = $assertType(e1, syscall.Errno); if ((_1 === (22)) || (_1 === (38))) { atomic.StoreInt32((tryDupCloexec$24ptr || (tryDupCloexec$24ptr = new ptrType$7(function() { return tryDupCloexec; }, function($v) { tryDupCloexec = $v; }))), 0); } else { $s = -1; return [-1, "fcntl", e1]; } /* } */ case 2: _r$1 = dupCloseOnExecOld(fd); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 5; case 5: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: DupCloseOnExec }; } $f.$24r = $24r; $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.e1 = e1; $f.fd = fd; $f.r0 = r0; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.DupCloseOnExec = DupCloseOnExec; dupCloseOnExecOld = function(fd) { var $24r, $24r$1, _r, _tuple, err, fd, newfd, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; _tuple = $f._tuple; err = $f.err; fd = $f.fd; newfd = $f.newfd; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); $r = syscall.ForkLock.RLock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(syscall.ForkLock, "RUnlock"), []]); _r = syscall.Dup(fd); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; newfd = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 3: $24r = [-1, "dup", err]; $s = 5; case 5: return $24r; /* } */ case 4: $r = syscall.CloseOnExec(newfd); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $24r$1 = [newfd, "", $ifaceNil]; $s = 7; case 7: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, "", $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: dupCloseOnExecOld }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.fd = fd; $f.newfd = newfd; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.ptr.prototype.Dup = function() { var $24r, $24r$1, _r, err, fd, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; err = $f.err; fd = $f.fd; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: $24r = [-1, "", err]; $s = 3; case 3: return $24r; /* } */ case 2: $deferred.push([$methodVal(fd, "decref"), []]); _r = DupCloseOnExec(fd.Sysfd); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r$1 = _r; $s = 5; case 5: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, "", $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Dup }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f.err = err; $f.fd = fd; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.Dup = function() { return this.$val.Dup(); }; FD.ptr.prototype.WaitWrite = function() { var fd; fd = this; return fd.pd.waitWrite(fd.isFile); }; FD.prototype.WaitWrite = function() { return this.$val.WaitWrite(); }; FD.ptr.prototype.WriteOnce = function(p) { var $24r, $24r$1, _r, _r$1, err, fd, p, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; _r$1 = $f._r$1; err = $f.err; fd = $f.fd; p = $f.p; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fd = this; _r = fd.writeLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $24r = [0, err]; $s = 4; case 4: return $24r; /* } */ case 3: $deferred.push([$methodVal(fd, "writeUnlock"), []]); _r$1 = ignoringEINTRIO(syscall.Write, fd.Sysfd, p); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r$1 = _r$1; $s = 6; case 6: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.WriteOnce }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f._r$1 = _r$1; $f.err = err; $f.fd = fd; $f.p = p; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.WriteOnce = function(p) { return this.$val.WriteOnce(p); }; FD.ptr.prototype.RawRead = function(f) { var $24r, $24r$1, $24r$2, $24r$3, _r, _r$1, err, err$1, err$2, f, fd, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; _r = $f._r; _r$1 = $f._r$1; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; f = $f.f; fd = $f.fd; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fd = this; _r = fd.readLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $24r = err; $s = 4; case 4: return $24r; /* } */ case 3: $deferred.push([$methodVal(fd, "readUnlock"), []]); err$1 = fd.pd.prepareRead(fd.isFile); /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 5: $24r$1 = err$1; $s = 7; case 7: return $24r$1; /* } */ case 6: /* while (true) { */ case 8: _r$1 = f(((fd.Sysfd >>> 0))); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (_r$1) { $s = 10; continue; } /* */ $s = 11; continue; /* if (_r$1) { */ case 10: $24r$2 = $ifaceNil; $s = 13; case 13: return $24r$2; /* } */ case 11: err$2 = fd.pd.waitRead(fd.isFile); /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 14; continue; } /* */ $s = 15; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 14: $24r$3 = err$2; $s = 16; case 16: return $24r$3; /* } */ case 15: $s = 8; continue; case 9: $s = -1; return $ifaceNil; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.RawRead }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f._r = _r; $f._r$1 = _r$1; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.f = f; $f.fd = fd; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.RawRead = function(f) { return this.$val.RawRead(f); }; FD.ptr.prototype.RawWrite = function(f) { var $24r, $24r$1, $24r$2, $24r$3, _r, _r$1, err, err$1, err$2, f, fd, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; _r = $f._r; _r$1 = $f._r$1; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; f = $f.f; fd = $f.fd; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fd = this; _r = fd.writeLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $24r = err; $s = 4; case 4: return $24r; /* } */ case 3: $deferred.push([$methodVal(fd, "writeUnlock"), []]); err$1 = fd.pd.prepareWrite(fd.isFile); /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 5: $24r$1 = err$1; $s = 7; case 7: return $24r$1; /* } */ case 6: /* while (true) { */ case 8: _r$1 = f(((fd.Sysfd >>> 0))); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (_r$1) { $s = 10; continue; } /* */ $s = 11; continue; /* if (_r$1) { */ case 10: $24r$2 = $ifaceNil; $s = 13; case 13: return $24r$2; /* } */ case 11: err$2 = fd.pd.waitWrite(fd.isFile); /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 14; continue; } /* */ $s = 15; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 14: $24r$3 = err$2; $s = 16; case 16: return $24r$3; /* } */ case 15: $s = 8; continue; case 9: $s = -1; return $ifaceNil; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.RawWrite }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f._r = _r; $f._r$1 = _r$1; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.f = f; $f.fd = fd; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.RawWrite = function(f) { return this.$val.RawWrite(f); }; ignoringEINTRIO = function(fn, fd, p) { var _r, _tuple, err, fd, fn, n, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; fd = $f.fd; fn = $f.fn; n = $f.n; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* while (true) { */ case 1: _r = fn(fd, p); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, new syscall.Errno(4)))) { $s = -1; return [n, err]; } $s = 1; continue; case 2: $s = -1; return [0, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: ignoringEINTRIO }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.fd = fd; $f.fn = fn; $f.n = n; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; FD.ptr.prototype.eofError = function(n, err) { var err, fd, n; fd = this; if ((n === 0) && $interfaceIsEqual(err, $ifaceNil) && fd.ZeroReadIsEOF) { return io.EOF; } return err; }; FD.prototype.eofError = function(n, err) { return this.$val.eofError(n, err); }; FD.ptr.prototype.Shutdown = function(how) { var $24r, $24r$1, _r, err, fd, how, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; err = $f.err; fd = $f.fd; how = $f.how; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: $24r = err; $s = 3; case 3: return $24r; /* } */ case 2: $deferred.push([$methodVal(fd, "decref"), []]); _r = syscall.Shutdown(fd.Sysfd, how); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r$1 = _r; $s = 5; case 5: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Shutdown }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f.err = err; $f.fd = fd; $f.how = how; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.Shutdown = function(how) { return this.$val.Shutdown(how); }; FD.ptr.prototype.Fchown = function(uid, gid) { var $24r, $24r$1, _r, err, fd, gid, uid, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; err = $f.err; fd = $f.fd; gid = $f.gid; uid = $f.uid; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fd = [fd]; gid = [gid]; uid = [uid]; fd[0] = this; err = fd[0].incref(); /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: $24r = err; $s = 3; case 3: return $24r; /* } */ case 2: $deferred.push([$methodVal(fd[0], "decref"), []]); _r = ignoringEINTR((function(fd, gid, uid) { return function $b() { var $24r$1, _r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r$1 = $f.$24r$1; _r = $f._r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = syscall.Fchown(fd[0].Sysfd, uid[0], gid[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r$1 = _r; $s = 2; case 2: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$24r$1 = $24r$1; $f._r = _r; $f.$s = $s; $f.$r = $r; return $f; }; })(fd, gid, uid)); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r$1 = _r; $s = 5; case 5: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Fchown }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f.err = err; $f.fd = fd; $f.gid = gid; $f.uid = uid; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.Fchown = function(uid, gid) { return this.$val.Fchown(uid, gid); }; FD.ptr.prototype.Ftruncate = function(size) { var $24r, $24r$1, _r, err, fd, size, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; err = $f.err; fd = $f.fd; size = $f.size; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fd = [fd]; size = [size]; fd[0] = this; err = fd[0].incref(); /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: $24r = err; $s = 3; case 3: return $24r; /* } */ case 2: $deferred.push([$methodVal(fd[0], "decref"), []]); _r = ignoringEINTR((function(fd, size) { return function $b() { var $24r$1, _r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r$1 = $f.$24r$1; _r = $f._r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = syscall.Ftruncate(fd[0].Sysfd, size[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r$1 = _r; $s = 2; case 2: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$24r$1 = $24r$1; $f._r = _r; $f.$s = $s; $f.$r = $r; return $f; }; })(fd, size)); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r$1 = _r; $s = 5; case 5: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Ftruncate }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f.err = err; $f.fd = fd; $f.size = size; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.Ftruncate = function(size) { return this.$val.Ftruncate(size); }; FD.ptr.prototype.RawControl = function(f) { var $24r, $24r$1, err, f, fd, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; err = $f.err; f = $f.f; fd = $f.fd; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: $24r = err; $s = 3; case 3: return $24r; /* } */ case 2: $deferred.push([$methodVal(fd, "decref"), []]); $r = f(((fd.Sysfd >>> 0))); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $24r$1 = $ifaceNil; $s = 5; case 5: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.RawControl }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.err = err; $f.f = f; $f.fd = fd; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.RawControl = function(f) { return this.$val.RawControl(f); }; ignoringEINTR = function(fn) { var _r, err, fn, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; err = $f.err; fn = $f.fn; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* while (true) { */ case 1: _r = fn(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, new syscall.Errno(4)))) { $s = -1; return err; } $s = 1; continue; case 2: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: ignoringEINTR }; } $f._r = _r; $f.err = err; $f.fn = fn; $f.$s = $s; $f.$r = $r; return $f; }; fdMutex.ptr.prototype.incref = function() { var mu, new$1, old, x, x$1; mu = this; while (true) { old = atomic.LoadUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$8(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu)))); if (!((x = new $Uint64(old.$high & 0, (old.$low & 1) >>> 0), (x.$high === 0 && x.$low === 0)))) { return false; } new$1 = new $Uint64(old.$high + 0, old.$low + 8); if ((x$1 = new $Uint64(new$1.$high & 0, (new$1.$low & 8388600) >>> 0), (x$1.$high === 0 && x$1.$low === 0))) { $panic(new $String("too many concurrent operations on a single file or socket (max 1048575)")); } if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$8(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { return true; } } }; fdMutex.prototype.incref = function() { return this.$val.incref(); }; fdMutex.ptr.prototype.increfAndClose = function() { var mu, new$1, old, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; mu = $f.mu; new$1 = $f.new$1; old = $f.old; 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; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: mu = this; /* while (true) { */ case 1: old = atomic.LoadUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$8(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu)))); if (!((x = new $Uint64(old.$high & 0, (old.$low & 1) >>> 0), (x.$high === 0 && x.$low === 0)))) { $s = -1; return false; } new$1 = (x$1 = new $Uint64(old.$high | 0, (old.$low | 1) >>> 0), new $Uint64(x$1.$high + 0, x$1.$low + 8)); if ((x$2 = new $Uint64(new$1.$high & 0, (new$1.$low & 8388600) >>> 0), (x$2.$high === 0 && x$2.$low === 0))) { $panic(new $String("too many concurrent operations on a single file or socket (max 1048575)")); } new$1 = (x$3 = new $Uint64(2147483647, 4286578688), new $Uint64(new$1.$high & ~x$3.$high, (new$1.$low & ~x$3.$low) >>> 0)); /* */ if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$8(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$8(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { */ case 3: /* while (true) { */ case 5: /* if (!(!((x$4 = new $Uint64(old.$high & 2047, (old.$low & 4286578688) >>> 0), (x$4.$high === 0 && x$4.$low === 0))))) { break; } */ if(!(!((x$4 = new $Uint64(old.$high & 2047, (old.$low & 4286578688) >>> 0), (x$4.$high === 0 && x$4.$low === 0))))) { $s = 6; continue; } old = (x$5 = new $Uint64(0, 8388608), new $Uint64(old.$high - x$5.$high, old.$low - x$5.$low)); $r = runtime_Semrelease((mu.$ptr_rsema || (mu.$ptr_rsema = new ptrType$6(function() { return this.$target.rsema; }, function($v) { this.$target.rsema = $v; }, mu)))); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 5; continue; case 6: /* while (true) { */ case 8: /* if (!(!((x$6 = new $Uint64(old.$high & 2147481600, (old.$low & 0) >>> 0), (x$6.$high === 0 && x$6.$low === 0))))) { break; } */ if(!(!((x$6 = new $Uint64(old.$high & 2147481600, (old.$low & 0) >>> 0), (x$6.$high === 0 && x$6.$low === 0))))) { $s = 9; continue; } old = (x$7 = new $Uint64(2048, 0), new $Uint64(old.$high - x$7.$high, old.$low - x$7.$low)); $r = runtime_Semrelease((mu.$ptr_wsema || (mu.$ptr_wsema = new ptrType$6(function() { return this.$target.wsema; }, function($v) { this.$target.wsema = $v; }, mu)))); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 8; continue; case 9: $s = -1; return true; /* } */ case 4: $s = 1; continue; case 2: $s = -1; return false; /* */ } return; } if ($f === undefined) { $f = { $blk: fdMutex.ptr.prototype.increfAndClose }; } $f.mu = mu; $f.new$1 = new$1; $f.old = old; $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.$s = $s; $f.$r = $r; return $f; }; fdMutex.prototype.increfAndClose = function() { return this.$val.increfAndClose(); }; fdMutex.ptr.prototype.decref = function() { var mu, new$1, old, x, x$1; mu = this; while (true) { old = atomic.LoadUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$8(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu)))); if ((x = new $Uint64(old.$high & 0, (old.$low & 8388600) >>> 0), (x.$high === 0 && x.$low === 0))) { $panic(new $String("inconsistent poll.fdMutex")); } new$1 = new $Uint64(old.$high - 0, old.$low - 8); if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$8(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { return (x$1 = new $Uint64(new$1.$high & 0, (new$1.$low & 8388601) >>> 0), (x$1.$high === 0 && x$1.$low === 1)); } } }; fdMutex.prototype.decref = function() { return this.$val.decref(); }; fdMutex.ptr.prototype.rwlock = function(read) { var _tmp, _tmp$1, _tmp$2, mu, mutexBit, mutexMask, mutexSema, mutexWait, new$1, old, read, 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; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; mu = $f.mu; mutexBit = $f.mutexBit; mutexMask = $f.mutexMask; mutexSema = $f.mutexSema; mutexWait = $f.mutexWait; new$1 = $f.new$1; old = $f.old; read = $f.read; 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: mu = this; _tmp = new $Uint64(0, 0); _tmp$1 = new $Uint64(0, 0); _tmp$2 = new $Uint64(0, 0); mutexBit = _tmp; mutexWait = _tmp$1; mutexMask = _tmp$2; mutexSema = ptrType$6.nil; if (read) { mutexBit = new $Uint64(0, 2); mutexWait = new $Uint64(0, 8388608); mutexMask = new $Uint64(2047, 4286578688); mutexSema = (mu.$ptr_rsema || (mu.$ptr_rsema = new ptrType$6(function() { return this.$target.rsema; }, function($v) { this.$target.rsema = $v; }, mu))); } else { mutexBit = new $Uint64(0, 4); mutexWait = new $Uint64(2048, 0); mutexMask = new $Uint64(2147481600, 0); mutexSema = (mu.$ptr_wsema || (mu.$ptr_wsema = new ptrType$6(function() { return this.$target.wsema; }, function($v) { this.$target.wsema = $v; }, mu))); } /* while (true) { */ case 1: old = atomic.LoadUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$8(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu)))); if (!((x = new $Uint64(old.$high & 0, (old.$low & 1) >>> 0), (x.$high === 0 && x.$low === 0)))) { $s = -1; return false; } new$1 = new $Uint64(0, 0); if ((x$1 = new $Uint64(old.$high & mutexBit.$high, (old.$low & mutexBit.$low) >>> 0), (x$1.$high === 0 && x$1.$low === 0))) { new$1 = (x$2 = new $Uint64(old.$high | mutexBit.$high, (old.$low | mutexBit.$low) >>> 0), new $Uint64(x$2.$high + 0, x$2.$low + 8)); if ((x$3 = new $Uint64(new$1.$high & 0, (new$1.$low & 8388600) >>> 0), (x$3.$high === 0 && x$3.$low === 0))) { $panic(new $String("too many concurrent operations on a single file or socket (max 1048575)")); } } else { new$1 = new $Uint64(old.$high + mutexWait.$high, old.$low + mutexWait.$low); if ((x$4 = new $Uint64(new$1.$high & mutexMask.$high, (new$1.$low & mutexMask.$low) >>> 0), (x$4.$high === 0 && x$4.$low === 0))) { $panic(new $String("too many concurrent operations on a single file or socket (max 1048575)")); } } /* */ if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$8(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$8(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { */ case 3: if ((x$5 = new $Uint64(old.$high & mutexBit.$high, (old.$low & mutexBit.$low) >>> 0), (x$5.$high === 0 && x$5.$low === 0))) { $s = -1; return true; } $r = runtime_Semacquire(mutexSema); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: $s = 1; continue; case 2: $s = -1; return false; /* */ } return; } if ($f === undefined) { $f = { $blk: fdMutex.ptr.prototype.rwlock }; } $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f.mu = mu; $f.mutexBit = mutexBit; $f.mutexMask = mutexMask; $f.mutexSema = mutexSema; $f.mutexWait = mutexWait; $f.new$1 = new$1; $f.old = old; $f.read = read; $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; }; fdMutex.prototype.rwlock = function(read) { return this.$val.rwlock(read); }; fdMutex.ptr.prototype.rwunlock = function(read) { var _tmp, _tmp$1, _tmp$2, mu, mutexBit, mutexMask, mutexSema, mutexWait, new$1, old, read, x, x$1, x$2, x$3, x$4, x$5, x$6, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; mu = $f.mu; mutexBit = $f.mutexBit; mutexMask = $f.mutexMask; mutexSema = $f.mutexSema; mutexWait = $f.mutexWait; new$1 = $f.new$1; old = $f.old; read = $f.read; 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; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: mu = this; _tmp = new $Uint64(0, 0); _tmp$1 = new $Uint64(0, 0); _tmp$2 = new $Uint64(0, 0); mutexBit = _tmp; mutexWait = _tmp$1; mutexMask = _tmp$2; mutexSema = ptrType$6.nil; if (read) { mutexBit = new $Uint64(0, 2); mutexWait = new $Uint64(0, 8388608); mutexMask = new $Uint64(2047, 4286578688); mutexSema = (mu.$ptr_rsema || (mu.$ptr_rsema = new ptrType$6(function() { return this.$target.rsema; }, function($v) { this.$target.rsema = $v; }, mu))); } else { mutexBit = new $Uint64(0, 4); mutexWait = new $Uint64(2048, 0); mutexMask = new $Uint64(2147481600, 0); mutexSema = (mu.$ptr_wsema || (mu.$ptr_wsema = new ptrType$6(function() { return this.$target.wsema; }, function($v) { this.$target.wsema = $v; }, mu))); } /* while (true) { */ case 1: old = atomic.LoadUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$8(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu)))); if ((x = new $Uint64(old.$high & mutexBit.$high, (old.$low & mutexBit.$low) >>> 0), (x.$high === 0 && x.$low === 0)) || (x$1 = new $Uint64(old.$high & 0, (old.$low & 8388600) >>> 0), (x$1.$high === 0 && x$1.$low === 0))) { $panic(new $String("inconsistent poll.fdMutex")); } new$1 = (x$2 = new $Uint64(old.$high & ~mutexBit.$high, (old.$low & ~mutexBit.$low) >>> 0), new $Uint64(x$2.$high - 0, x$2.$low - 8)); if (!((x$3 = new $Uint64(old.$high & mutexMask.$high, (old.$low & mutexMask.$low) >>> 0), (x$3.$high === 0 && x$3.$low === 0)))) { new$1 = (x$4 = mutexWait, new $Uint64(new$1.$high - x$4.$high, new$1.$low - x$4.$low)); } /* */ if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$8(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$8(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { */ case 3: /* */ if (!((x$5 = new $Uint64(old.$high & mutexMask.$high, (old.$low & mutexMask.$low) >>> 0), (x$5.$high === 0 && x$5.$low === 0)))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!((x$5 = new $Uint64(old.$high & mutexMask.$high, (old.$low & mutexMask.$low) >>> 0), (x$5.$high === 0 && x$5.$low === 0)))) { */ case 5: $r = runtime_Semrelease(mutexSema); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 6: $s = -1; return (x$6 = new $Uint64(new$1.$high & 0, (new$1.$low & 8388601) >>> 0), (x$6.$high === 0 && x$6.$low === 1)); /* } */ case 4: $s = 1; continue; case 2: $s = -1; return false; /* */ } return; } if ($f === undefined) { $f = { $blk: fdMutex.ptr.prototype.rwunlock }; } $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f.mu = mu; $f.mutexBit = mutexBit; $f.mutexMask = mutexMask; $f.mutexSema = mutexSema; $f.mutexWait = mutexWait; $f.new$1 = new$1; $f.old = old; $f.read = read; $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.$s = $s; $f.$r = $r; return $f; }; fdMutex.prototype.rwunlock = function(read) { return this.$val.rwunlock(read); }; FD.ptr.prototype.incref = function() { var fd; fd = this; if (!fd.fdmu.incref()) { return errClosing(fd.isFile); } return $ifaceNil; }; FD.prototype.incref = function() { return this.$val.incref(); }; FD.ptr.prototype.decref = function() { var $24r, _r, fd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = this; /* */ if (fd.fdmu.decref()) { $s = 1; continue; } /* */ $s = 2; continue; /* if (fd.fdmu.decref()) { */ case 1: _r = fd.destroy(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 4; case 4: return $24r; /* } */ case 2: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: FD.ptr.prototype.decref }; } $f.$24r = $24r; $f._r = _r; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; }; FD.prototype.decref = function() { return this.$val.decref(); }; FD.ptr.prototype.readLock = function() { var _r, fd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = this; _r = fd.fdmu.rwlock(true); /* */ $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: $s = -1; return errClosing(fd.isFile); /* } */ case 2: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: FD.ptr.prototype.readLock }; } $f._r = _r; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; }; FD.prototype.readLock = function() { return this.$val.readLock(); }; FD.ptr.prototype.readUnlock = function() { var _r, _r$1, fd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = this; _r = fd.fdmu.rwunlock(true); /* */ $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$1 = fd.destroy(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: FD.ptr.prototype.readUnlock }; } $f._r = _r; $f._r$1 = _r$1; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; }; FD.prototype.readUnlock = function() { return this.$val.readUnlock(); }; FD.ptr.prototype.writeLock = function() { var _r, fd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = this; _r = fd.fdmu.rwlock(false); /* */ $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: $s = -1; return errClosing(fd.isFile); /* } */ case 2: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: FD.ptr.prototype.writeLock }; } $f._r = _r; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; }; FD.prototype.writeLock = function() { return this.$val.writeLock(); }; FD.ptr.prototype.writeUnlock = function() { var _r, _r$1, fd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = this; _r = fd.fdmu.rwunlock(false); /* */ $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$1 = fd.destroy(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: FD.ptr.prototype.writeUnlock }; } $f._r = _r; $f._r$1 = _r$1; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; }; FD.prototype.writeUnlock = function() { return this.$val.writeUnlock(); }; FD.ptr.prototype.Fsync = function() { var $24r, $24r$1, _r, err, fd, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; err = $f.err; fd = $f.fd; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fd = [fd]; fd[0] = this; err = fd[0].incref(); /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: $24r = err; $s = 3; case 3: return $24r; /* } */ case 2: $deferred.push([$methodVal(fd[0], "decref"), []]); _r = ignoringEINTR((function(fd) { return function $b() { var $24r$1, _r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r$1 = $f.$24r$1; _r = $f._r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = syscall.Fsync(fd[0].Sysfd); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r$1 = _r; $s = 2; case 2: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$24r$1 = $24r$1; $f._r = _r; $f.$s = $s; $f.$r = $r; return $f; }; })(fd)); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r$1 = _r; $s = 5; case 5: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Fsync }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f.err = err; $f.fd = fd; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.Fsync = function() { return this.$val.Fsync(); }; errNetClosing.ptr.prototype.Error = function() { var e; e = this; return "use of closed network connection"; }; errNetClosing.prototype.Error = function() { return this.$val.Error(); }; errNetClosing.ptr.prototype.Timeout = function() { var e; e = this; return false; }; errNetClosing.prototype.Timeout = function() { return this.$val.Timeout(); }; errNetClosing.ptr.prototype.Temporary = function() { var e; e = this; return false; }; errNetClosing.prototype.Temporary = function() { return this.$val.Temporary(); }; errClosing = function(isFile) { var isFile; if (isFile) { return $pkg.ErrFileClosing; } return new $pkg.ErrNetClosing.constructor.elem($pkg.ErrNetClosing); }; DeadlineExceededError.ptr.prototype.Error = function() { var e; e = this; return "i/o timeout"; }; DeadlineExceededError.prototype.Error = function() { return this.$val.Error(); }; DeadlineExceededError.ptr.prototype.Timeout = function() { var e; e = this; return true; }; DeadlineExceededError.prototype.Timeout = function() { return this.$val.Timeout(); }; DeadlineExceededError.ptr.prototype.Temporary = function() { var e; e = this; return true; }; DeadlineExceededError.prototype.Temporary = function() { return this.$val.Temporary(); }; consume = function(v, n) { var ln0, n, v, x, x$1, x$2, x$3; while (true) { if (!(v.$get().$length > 0)) { break; } ln0 = (new $Int64(0, (x = v.$get(), (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])).$length)); if ((ln0.$high > n.$high || (ln0.$high === n.$high && ln0.$low > n.$low))) { (x$2 = v.$get(), (0 >= x$2.$length ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + 0] = $subslice((x$1 = v.$get(), (0 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 0])), $flatten64(n)))); return; } n = (x$3 = ln0, new $Int64(n.$high - x$3.$high, n.$low - x$3.$low)); v.$set($subslice((v.$get()), 1)); } }; fcntl = function(fd, cmd, arg) { var _r, _tuple, arg, cmd, e, fd, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; arg = $f.arg; cmd = $f.cmd; e = $f.e; fd = $f.fd; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = syscall.Syscall(unix.FcntlSyscall, ((fd >>> 0)), ((cmd >>> 0)), ((arg >>> 0))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; r = _tuple[0]; e = _tuple[2]; if (!((e === 0))) { $s = -1; return [((r >> 0)), new syscall.Errno((e))]; } $s = -1; return [((r >> 0)), $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: fcntl }; } $f._r = _r; $f._tuple = _tuple; $f.arg = arg; $f.cmd = cmd; $f.e = e; $f.fd = fd; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; kernelVersion = function() { var _1, _i, _r, _ref, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, c, err, major, minor, rl, uname, value, values, vi, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _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; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; c = $f.c; err = $f.err; major = $f.major; minor = $f.minor; rl = $f.rl; uname = $f.uname; value = $f.value; values = $f.values; vi = $f.vi; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: uname = [uname]; major = 0; minor = 0; uname[0] = new syscall.Utsname.ptr(arrayType$2.zero(), arrayType$2.zero(), arrayType$2.zero(), arrayType$2.zero(), arrayType$2.zero(), arrayType$2.zero()); _r = syscall.Uname(uname[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [major, minor]; } rl = $clone(uname[0].Release, arrayType$2); values = arrayType.zero(); vi = 0; value = 0; _ref = rl; _i = 0; while (true) { if (!(_i < 65)) { break; } c = ((_i < 0 || _i >= _ref.length) ? ($throwRuntimeError("index out of range"), undefined) : _ref[_i]); if (48 <= c && c <= 57) { value = (($imul(value, 10))) + (((c - 48 << 24 >> 24) >> 0)) >> 0; } else { ((vi < 0 || vi >= values.length) ? ($throwRuntimeError("index out of range"), undefined) : values[vi] = value); vi = vi + (1) >> 0; if (vi >= 2) { break; } value = 0; } _i++; } _1 = vi; if (_1 === (0)) { _tmp = 0; _tmp$1 = 0; major = _tmp; minor = _tmp$1; $s = -1; return [major, minor]; } else if (_1 === (1)) { _tmp$2 = values[0]; _tmp$3 = 0; major = _tmp$2; minor = _tmp$3; $s = -1; return [major, minor]; } else if (_1 === (2)) { _tmp$4 = values[0]; _tmp$5 = values[1]; major = _tmp$4; minor = _tmp$5; $s = -1; return [major, minor]; } $s = -1; return [major, minor]; /* */ } return; } if ($f === undefined) { $f = { $blk: kernelVersion }; } $f._1 = _1; $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._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f.c = c; $f.err = err; $f.major = major; $f.minor = minor; $f.rl = rl; $f.uname = uname; $f.value = value; $f.values = values; $f.vi = vi; $f.$s = $s; $f.$r = $r; return $f; }; CopyFileRange = function(dst, src, remain) { var _1, _r, _r$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$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, dst, err, err$1, handled, major, max, minor, n, remain, src, supported, written, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; _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$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _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 = $f._tuple; _tuple$1 = $f._tuple$1; dst = $f.dst; err = $f.err; err$1 = $f.err$1; handled = $f.handled; major = $f.major; max = $f.max; minor = $f.minor; n = $f.n; remain = $f.remain; src = $f.src; supported = $f.supported; written = $f.written; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: written = new $Int64(0, 0); handled = false; err = $ifaceNil; supported = atomic.LoadInt32((copyFileRangeSupported$24ptr || (copyFileRangeSupported$24ptr = new ptrType$7(function() { return copyFileRangeSupported; }, function($v) { copyFileRangeSupported = $v; })))); /* */ if (supported === 0) { $s = 1; continue; } /* */ if (supported === -1) { $s = 2; continue; } /* */ $s = 3; continue; /* if (supported === 0) { */ case 1: _tmp = new $Int64(0, 0); _tmp$1 = false; _tmp$2 = $ifaceNil; written = _tmp; handled = _tmp$1; err = _tmp$2; $s = -1; return [written, handled, err]; /* } else if (supported === -1) { */ case 2: _r = kernelVersion(); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; major = _tuple[0]; minor = _tuple[1]; if (major > 5 || ((major === 5) && minor >= 3)) { atomic.StoreInt32((copyFileRangeSupported$24ptr || (copyFileRangeSupported$24ptr = new ptrType$7(function() { return copyFileRangeSupported; }, function($v) { copyFileRangeSupported = $v; }))), 1); } else { atomic.StoreInt32((copyFileRangeSupported$24ptr || (copyFileRangeSupported$24ptr = new ptrType$7(function() { return copyFileRangeSupported; }, function($v) { copyFileRangeSupported = $v; }))), 0); _tmp$3 = new $Int64(0, 0); _tmp$4 = false; _tmp$5 = $ifaceNil; written = _tmp$3; handled = _tmp$4; err = _tmp$5; $s = -1; return [written, handled, err]; } /* } */ case 3: /* while (true) { */ case 5: /* if (!((remain.$high > 0 || (remain.$high === 0 && remain.$low > 0)))) { break; } */ if(!((remain.$high > 0 || (remain.$high === 0 && remain.$low > 0)))) { $s = 6; continue; } max = remain; if ((max.$high > 0 || (max.$high === 0 && max.$low > 1073741824))) { max = new $Int64(0, 1073741824); } _r$1 = copyFileRange(dst, src, (((max.$low + ((max.$high >> 31) * 4294967296)) >> 0))); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; n = _tuple$1[0]; err$1 = _tuple$1[1]; _1 = err$1; if ($interfaceIsEqual(_1, new syscall.Errno((38)))) { atomic.StoreInt32((copyFileRangeSupported$24ptr || (copyFileRangeSupported$24ptr = new ptrType$7(function() { return copyFileRangeSupported; }, function($v) { copyFileRangeSupported = $v; }))), 0); _tmp$6 = new $Int64(0, 0); _tmp$7 = false; _tmp$8 = $ifaceNil; written = _tmp$6; handled = _tmp$7; err = _tmp$8; $s = -1; return [written, handled, err]; } else if ($interfaceIsEqual(_1, new syscall.Errno((18))) || $interfaceIsEqual(_1, new syscall.Errno((22))) || $interfaceIsEqual(_1, new syscall.Errno((5))) || $interfaceIsEqual(_1, new syscall.Errno((95))) || $interfaceIsEqual(_1, new syscall.Errno((1)))) { _tmp$9 = new $Int64(0, 0); _tmp$10 = false; _tmp$11 = $ifaceNil; written = _tmp$9; handled = _tmp$10; err = _tmp$11; $s = -1; return [written, handled, err]; } else if ($interfaceIsEqual(_1, $ifaceNil)) { if ((n.$high === 0 && n.$low === 0)) { if ((written.$high === 0 && written.$low === 0)) { _tmp$12 = new $Int64(0, 0); _tmp$13 = false; _tmp$14 = $ifaceNil; written = _tmp$12; handled = _tmp$13; err = _tmp$14; $s = -1; return [written, handled, err]; } _tmp$15 = written; _tmp$16 = true; _tmp$17 = $ifaceNil; written = _tmp$15; handled = _tmp$16; err = _tmp$17; $s = -1; return [written, handled, err]; } remain = (x = n, new $Int64(remain.$high - x.$high, remain.$low - x.$low)); written = (x$1 = n, new $Int64(written.$high + x$1.$high, written.$low + x$1.$low)); } else { _tmp$18 = written; _tmp$19 = true; _tmp$20 = err$1; written = _tmp$18; handled = _tmp$19; err = _tmp$20; $s = -1; return [written, handled, err]; } $s = 5; continue; case 6: _tmp$21 = written; _tmp$22 = true; _tmp$23 = $ifaceNil; written = _tmp$21; handled = _tmp$22; err = _tmp$23; $s = -1; return [written, handled, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: CopyFileRange }; } $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $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$3 = _tmp$3; $f._tmp$4 = _tmp$4; $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 = _tuple; $f._tuple$1 = _tuple$1; $f.dst = dst; $f.err = err; $f.err$1 = err$1; $f.handled = handled; $f.major = major; $f.max = max; $f.minor = minor; $f.n = n; $f.remain = remain; $f.src = src; $f.supported = supported; $f.written = written; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.CopyFileRange = CopyFileRange; copyFileRange = function(dst, src, max) { var $24r, $24r$1, $24r$2, _r, _r$1, _r$2, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, dst, err, err$1, err$2, max, n, src, written, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _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; dst = $f.dst; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; max = $f.max; n = $f.n; src = $f.src; written = $f.written; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); written = new $Int64(0, 0); err = $ifaceNil; _r = dst.writeLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err$1 = _r; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 2: _tmp = new $Int64(0, 0); _tmp$1 = err$1; written = _tmp; err = _tmp$1; $24r = [written, err]; $s = 4; case 4: return $24r; /* } */ case 3: $deferred.push([$methodVal(dst, "writeUnlock"), []]); _r$1 = src.readLock(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err$2 = _r$1; /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 6: _tmp$2 = new $Int64(0, 0); _tmp$3 = err$2; written = _tmp$2; err = _tmp$3; $24r$1 = [written, err]; $s = 8; case 8: return $24r$1; /* } */ case 7: $deferred.push([$methodVal(src, "readUnlock"), []]); n = 0; /* while (true) { */ case 9: _r$2 = unix.CopyFileRange(src.Sysfd, ptrType$3.nil, dst.Sysfd, ptrType$3.nil, max, 0); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; n = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, new syscall.Errno(4)))) { /* break; */ $s = 10; continue; } $s = 9; continue; case 10: _tmp$4 = (new $Int64(0, n)); _tmp$5 = err; written = _tmp$4; err = _tmp$5; $24r$2 = [written, err]; $s = 12; case 12: return $24r$2; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [written, err]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: copyFileRange }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $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.dst = dst; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.max = max; $f.n = n; $f.src = src; $f.written = written; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; ptrType$10.methods = [{prop: "init", name: "init", pkg: "internal/poll", typ: $funcType([ptrType$9], [$error], false)}, {prop: "close", name: "close", pkg: "internal/poll", typ: $funcType([], [], false)}, {prop: "evict", name: "evict", pkg: "internal/poll", typ: $funcType([], [], false)}, {prop: "prepare", name: "prepare", pkg: "internal/poll", typ: $funcType([$Int, $Bool], [$error], false)}, {prop: "prepareRead", name: "prepareRead", pkg: "internal/poll", typ: $funcType([$Bool], [$error], false)}, {prop: "prepareWrite", name: "prepareWrite", pkg: "internal/poll", typ: $funcType([$Bool], [$error], false)}, {prop: "wait", name: "wait", pkg: "internal/poll", typ: $funcType([$Int, $Bool], [$error], false)}, {prop: "waitRead", name: "waitRead", pkg: "internal/poll", typ: $funcType([$Bool], [$error], false)}, {prop: "waitWrite", name: "waitWrite", pkg: "internal/poll", typ: $funcType([$Bool], [$error], false)}, {prop: "waitCanceled", name: "waitCanceled", pkg: "internal/poll", typ: $funcType([$Int], [], false)}, {prop: "pollable", name: "pollable", pkg: "internal/poll", typ: $funcType([], [$Bool], false)}]; ptrType$9.methods = [{prop: "Writev", name: "Writev", pkg: "", typ: $funcType([ptrType$11], [$Int64, $error], false)}, {prop: "SetsockoptIPMreq", name: "SetsockoptIPMreq", pkg: "", typ: $funcType([$Int, $Int, ptrType$12], [$error], false)}, {prop: "SetsockoptIPv6Mreq", name: "SetsockoptIPv6Mreq", pkg: "", typ: $funcType([$Int, $Int, ptrType$13], [$error], false)}, {prop: "SetsockoptByte", name: "SetsockoptByte", pkg: "", typ: $funcType([$Int, $Int, $Uint8], [$error], false)}, {prop: "SetsockoptIPMreqn", name: "SetsockoptIPMreqn", pkg: "", typ: $funcType([$Int, $Int, ptrType$14], [$error], false)}, {prop: "SetsockoptInt", name: "SetsockoptInt", pkg: "", typ: $funcType([$Int, $Int, $Int], [$error], false)}, {prop: "SetsockoptInet4Addr", name: "SetsockoptInet4Addr", pkg: "", typ: $funcType([$Int, $Int, arrayType$1], [$error], false)}, {prop: "SetsockoptLinger", name: "SetsockoptLinger", pkg: "", typ: $funcType([$Int, $Int, ptrType$15], [$error], false)}, {prop: "SetDeadline", name: "SetDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "SetReadDeadline", name: "SetReadDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "SetWriteDeadline", name: "SetWriteDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "Init", name: "Init", pkg: "", typ: $funcType([$String, $Bool], [$error], false)}, {prop: "destroy", name: "destroy", pkg: "internal/poll", typ: $funcType([], [$error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "SetBlocking", name: "SetBlocking", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$4], [$Int, $error], false)}, {prop: "Pread", name: "Pread", pkg: "", typ: $funcType([sliceType$4, $Int64], [$Int, $error], false)}, {prop: "ReadFrom", name: "ReadFrom", pkg: "", typ: $funcType([sliceType$4], [$Int, syscall.Sockaddr, $error], false)}, {prop: "ReadMsg", name: "ReadMsg", pkg: "", typ: $funcType([sliceType$4, sliceType$4, $Int], [$Int, $Int, $Int, syscall.Sockaddr, $error], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$4], [$Int, $error], false)}, {prop: "Pwrite", name: "Pwrite", pkg: "", typ: $funcType([sliceType$4, $Int64], [$Int, $error], false)}, {prop: "WriteTo", name: "WriteTo", pkg: "", typ: $funcType([sliceType$4, syscall.Sockaddr], [$Int, $error], false)}, {prop: "WriteMsg", name: "WriteMsg", pkg: "", typ: $funcType([sliceType$4, sliceType$4, syscall.Sockaddr], [$Int, $Int, $error], false)}, {prop: "Accept", name: "Accept", pkg: "", typ: $funcType([], [$Int, syscall.Sockaddr, $String, $error], false)}, {prop: "Seek", name: "Seek", pkg: "", typ: $funcType([$Int64, $Int], [$Int64, $error], false)}, {prop: "ReadDirent", name: "ReadDirent", pkg: "", typ: $funcType([sliceType$4], [$Int, $error], false)}, {prop: "Fchmod", name: "Fchmod", pkg: "", typ: $funcType([$Uint32], [$error], false)}, {prop: "Fchdir", name: "Fchdir", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Fstat", name: "Fstat", pkg: "", typ: $funcType([ptrType$16], [$error], false)}, {prop: "Dup", name: "Dup", pkg: "", typ: $funcType([], [$Int, $String, $error], false)}, {prop: "WaitWrite", name: "WaitWrite", pkg: "", typ: $funcType([], [$error], false)}, {prop: "WriteOnce", name: "WriteOnce", pkg: "", typ: $funcType([sliceType$4], [$Int, $error], false)}, {prop: "RawRead", name: "RawRead", pkg: "", typ: $funcType([funcType$1], [$error], false)}, {prop: "RawWrite", name: "RawWrite", pkg: "", typ: $funcType([funcType$1], [$error], false)}, {prop: "eofError", name: "eofError", pkg: "internal/poll", typ: $funcType([$Int, $error], [$error], false)}, {prop: "Shutdown", name: "Shutdown", pkg: "", typ: $funcType([$Int], [$error], false)}, {prop: "Fchown", name: "Fchown", pkg: "", typ: $funcType([$Int, $Int], [$error], false)}, {prop: "Ftruncate", name: "Ftruncate", pkg: "", typ: $funcType([$Int64], [$error], false)}, {prop: "RawControl", name: "RawControl", pkg: "", typ: $funcType([funcType$2], [$error], false)}, {prop: "incref", name: "incref", pkg: "internal/poll", typ: $funcType([], [$error], false)}, {prop: "decref", name: "decref", pkg: "internal/poll", typ: $funcType([], [$error], false)}, {prop: "readLock", name: "readLock", pkg: "internal/poll", typ: $funcType([], [$error], false)}, {prop: "readUnlock", name: "readUnlock", pkg: "internal/poll", typ: $funcType([], [], false)}, {prop: "writeLock", name: "writeLock", pkg: "internal/poll", typ: $funcType([], [$error], false)}, {prop: "writeUnlock", name: "writeUnlock", pkg: "internal/poll", typ: $funcType([], [], false)}, {prop: "Fsync", name: "Fsync", pkg: "", typ: $funcType([], [$error], false)}]; ptrType$17.methods = [{prop: "incref", name: "incref", pkg: "internal/poll", typ: $funcType([], [$Bool], false)}, {prop: "increfAndClose", name: "increfAndClose", pkg: "internal/poll", typ: $funcType([], [$Bool], false)}, {prop: "decref", name: "decref", pkg: "internal/poll", typ: $funcType([], [$Bool], false)}, {prop: "rwlock", name: "rwlock", pkg: "internal/poll", typ: $funcType([$Bool], [$Bool], false)}, {prop: "rwunlock", name: "rwunlock", pkg: "internal/poll", typ: $funcType([$Bool], [$Bool], false)}]; errNetClosing.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Temporary", name: "Temporary", pkg: "", typ: $funcType([], [$Bool], false)}]; ptrType$18.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Temporary", name: "Temporary", pkg: "", typ: $funcType([], [$Bool], false)}]; splicePipe.init("internal/poll", [{prop: "rfd", name: "rfd", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "wfd", name: "wfd", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "data", name: "data", embedded: false, exported: false, typ: $Int, tag: ""}]); pollDesc.init("internal/poll", [{prop: "closing", name: "closing", embedded: false, exported: false, typ: $Bool, tag: ""}]); FD.init("internal/poll", [{prop: "fdmu", name: "fdmu", embedded: false, exported: false, typ: fdMutex, tag: ""}, {prop: "Sysfd", name: "Sysfd", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "pd", name: "pd", embedded: false, exported: false, typ: pollDesc, tag: ""}, {prop: "iovecs", name: "iovecs", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "csema", name: "csema", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "isBlocking", name: "isBlocking", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "IsStream", name: "IsStream", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "ZeroReadIsEOF", name: "ZeroReadIsEOF", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "isFile", name: "isFile", embedded: false, exported: false, typ: $Bool, tag: ""}]); fdMutex.init("internal/poll", [{prop: "state", name: "state", embedded: false, exported: false, typ: $Uint64, tag: ""}, {prop: "rsema", name: "rsema", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "wsema", name: "wsema", embedded: false, exported: false, typ: $Uint32, tag: ""}]); errNetClosing.init("", []); DeadlineExceededError.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 = unix.$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.CloseFunc = syscall.Close; $pkg.AcceptFunc = syscall.Accept; $pkg.Accept4Func = syscall.Accept4; disableSplice = ((ptrType.nil)); splicePipePool = new sync.Pool.ptr(sliceType.nil, newPoolPipe); semWaiters = {}; tryDupCloexec = 1; $pkg.ErrNetClosing = new errNetClosing.ptr(); $pkg.ErrFileClosing = errors.New("use of closed file"); $pkg.ErrNoDeadline = errors.New("file type does not support deadline"); $pkg.ErrDeadlineExceeded = new DeadlineExceededError.ptr(); $pkg.ErrNotPollable = errors.New("not pollable"); $pkg.TestHookDidWritev = (function(wrote) { var wrote; }); copyFileRangeSupported = -1; /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["internal/syscall/execenv"] = (function() { var $pkg = {}, $init, syscall; syscall = $packages["syscall"]; $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 = syscall.$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["internal/testlog"] = (function() { var $pkg = {}, $init, sync, atomic, Interface, structType, ptrType, logger, panicOnExit0, Logger, Getenv, Open, Stat, PanicOnExit0; sync = $packages["sync"]; atomic = $packages["sync/atomic"]; Interface = $pkg.Interface = $newType(8, $kindInterface, "testlog.Interface", true, "internal/testlog", true, null); structType = $structType("internal/testlog", [{prop: "mu", name: "mu", embedded: false, exported: false, typ: sync.Mutex, tag: ""}, {prop: "val", name: "val", embedded: false, exported: false, typ: $Bool, tag: ""}]); ptrType = $ptrType(Interface); Logger = function() { var impl; impl = logger.Load(); if ($interfaceIsEqual(impl, $ifaceNil)) { return $ifaceNil; } return $assertType(impl, ptrType).$get(); }; $pkg.Logger = Logger; Getenv = function(name) { var log, name, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; log = $f.log; name = $f.name; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: log = Logger(); /* */ if (!($interfaceIsEqual(log, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(log, $ifaceNil))) { */ case 1: $r = log.Getenv(name); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Getenv }; } $f.log = log; $f.name = name; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Getenv = Getenv; Open = function(name) { var log, name, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; log = $f.log; name = $f.name; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: log = Logger(); /* */ if (!($interfaceIsEqual(log, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(log, $ifaceNil))) { */ case 1: $r = log.Open(name); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Open }; } $f.log = log; $f.name = name; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Open = Open; Stat = function(name) { var log, name, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; log = $f.log; name = $f.name; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: log = Logger(); /* */ if (!($interfaceIsEqual(log, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(log, $ifaceNil))) { */ case 1: $r = log.Stat(name); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Stat }; } $f.log = log; $f.name = name; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Stat = Stat; PanicOnExit0 = function() { var $24r, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); $r = panicOnExit0.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(panicOnExit0.mu, "Unlock"), []]); $24r = panicOnExit0.val; $s = 2; case 2: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; return false; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: PanicOnExit0 }; } $f.$24r = $24r; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; $pkg.PanicOnExit0 = PanicOnExit0; Interface.init([{prop: "Chdir", name: "Chdir", pkg: "", typ: $funcType([$String], [], false)}, {prop: "Getenv", name: "Getenv", pkg: "", typ: $funcType([$String], [], false)}, {prop: "Open", name: "Open", pkg: "", typ: $funcType([$String], [], false)}, {prop: "Stat", name: "Stat", pkg: "", typ: $funcType([$String], [], 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 = sync.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = atomic.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } logger = new atomic.Value.ptr($ifaceNil); panicOnExit0 = new structType.ptr(new sync.Mutex.ptr(0, 0), false); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["path"] = (function() { var $pkg = {}, $init, errors, bytealg, utf8, lazybuf, sliceType, ptrType, Clean, lastSlash, Split, Base; errors = $packages["errors"]; bytealg = $packages["internal/bytealg"]; utf8 = $packages["unicode/utf8"]; lazybuf = $pkg.lazybuf = $newType(0, $kindStruct, "path.lazybuf", true, "path", false, function(s_, buf_, w_) { this.$val = this; if (arguments.length === 0) { this.s = ""; this.buf = sliceType.nil; this.w = 0; return; } this.s = s_; this.buf = buf_; this.w = w_; }); sliceType = $sliceType($Uint8); ptrType = $ptrType(lazybuf); lazybuf.ptr.prototype.index = function(i) { var b, i, x; b = this; if (!(b.buf === sliceType.nil)) { return (x = b.buf, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); } return b.s.charCodeAt(i); }; lazybuf.prototype.index = function(i) { return this.$val.index(i); }; lazybuf.ptr.prototype.append = function(c) { var b, c, x, x$1; b = this; if (b.buf === sliceType.nil) { if (b.w < b.s.length && (b.s.charCodeAt(b.w) === c)) { b.w = b.w + (1) >> 0; return; } b.buf = $makeSlice(sliceType, b.s.length); $copyString(b.buf, $substring(b.s, 0, b.w)); } (x = b.buf, x$1 = b.w, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1] = c)); b.w = b.w + (1) >> 0; }; lazybuf.prototype.append = function(c) { return this.$val.append(c); }; lazybuf.ptr.prototype.string = function() { var b; b = this; if (b.buf === sliceType.nil) { return $substring(b.s, 0, b.w); } return ($bytesToString($subslice(b.buf, 0, b.w))); }; lazybuf.prototype.string = function() { return this.$val.string(); }; Clean = function(path) { var _tmp, _tmp$1, _tmp$2, _tmp$3, dotdot, n, out, path, r, rooted; if (path === "") { return "."; } rooted = path.charCodeAt(0) === 47; n = path.length; out = new lazybuf.ptr(path, sliceType.nil, 0); _tmp = 0; _tmp$1 = 0; r = _tmp; dotdot = _tmp$1; if (rooted) { out.append(47); _tmp$2 = 1; _tmp$3 = 1; r = _tmp$2; dotdot = _tmp$3; } while (true) { if (!(r < n)) { break; } if ((path.charCodeAt(r) === 47)) { r = r + (1) >> 0; } else if ((path.charCodeAt(r) === 46) && (((r + 1 >> 0) === n) || (path.charCodeAt((r + 1 >> 0)) === 47))) { r = r + (1) >> 0; } else if ((path.charCodeAt(r) === 46) && (path.charCodeAt((r + 1 >> 0)) === 46) && (((r + 2 >> 0) === n) || (path.charCodeAt((r + 2 >> 0)) === 47))) { r = r + (2) >> 0; if (out.w > dotdot) { out.w = out.w - (1) >> 0; while (true) { if (!(out.w > dotdot && !((out.index(out.w) === 47)))) { break; } out.w = out.w - (1) >> 0; } } else if (!rooted) { if (out.w > 0) { out.append(47); } out.append(46); out.append(46); dotdot = out.w; } } else { if (rooted && !((out.w === 1)) || !rooted && !((out.w === 0))) { out.append(47); } while (true) { if (!(r < n && !((path.charCodeAt(r) === 47)))) { break; } out.append(path.charCodeAt(r)); r = r + (1) >> 0; } } } if (out.w === 0) { return "."; } return out.string(); }; $pkg.Clean = Clean; lastSlash = function(s) { var i, s; i = s.length - 1 >> 0; while (true) { if (!(i >= 0 && !((s.charCodeAt(i) === 47)))) { break; } i = i - (1) >> 0; } return i; }; Split = function(path) { var _tmp, _tmp$1, dir, file, i, path; dir = ""; file = ""; i = lastSlash(path); _tmp = $substring(path, 0, (i + 1 >> 0)); _tmp$1 = $substring(path, (i + 1 >> 0)); dir = _tmp; file = _tmp$1; return [dir, file]; }; $pkg.Split = Split; Base = function(path) { var i, path; if (path === "") { return "."; } while (true) { if (!(path.length > 0 && (path.charCodeAt((path.length - 1 >> 0)) === 47))) { break; } path = $substring(path, 0, (path.length - 1 >> 0)); } i = lastSlash(path); if (i >= 0) { path = $substring(path, (i + 1 >> 0)); } if (path === "") { return "/"; } return path; }; $pkg.Base = Base; ptrType.methods = [{prop: "index", name: "index", pkg: "path", typ: $funcType([$Int], [$Uint8], false)}, {prop: "append", name: "append", pkg: "path", typ: $funcType([$Uint8], [], false)}, {prop: "string", name: "string", pkg: "path", typ: $funcType([], [$String], false)}]; lazybuf.init("path", [{prop: "s", name: "s", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "buf", name: "buf", embedded: false, exported: false, typ: sliceType, tag: ""}, {prop: "w", name: "w", embedded: false, exported: false, 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 = bytealg.$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; } $pkg.ErrBadPattern = errors.New("syntax error in pattern"); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["io/fs"] = (function() { var $pkg = {}, $init, errors, oserror, io, path, sort, time, utf8, DirEntry, FileInfo, FileMode, PathError, ptrType, sliceType$2, arrayType, interfaceType, errInvalid, errPermission, errExist, errNotExist, errClosed; errors = $packages["errors"]; oserror = $packages["internal/oserror"]; io = $packages["io"]; path = $packages["path"]; sort = $packages["sort"]; time = $packages["time"]; utf8 = $packages["unicode/utf8"]; DirEntry = $pkg.DirEntry = $newType(8, $kindInterface, "fs.DirEntry", true, "io/fs", true, null); FileInfo = $pkg.FileInfo = $newType(8, $kindInterface, "fs.FileInfo", true, "io/fs", true, null); FileMode = $pkg.FileMode = $newType(4, $kindUint32, "fs.FileMode", true, "io/fs", true, null); PathError = $pkg.PathError = $newType(0, $kindStruct, "fs.PathError", true, "io/fs", true, 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_; }); ptrType = $ptrType(PathError); sliceType$2 = $sliceType($Uint8); arrayType = $arrayType($Uint8, 32); interfaceType = $interfaceType([{prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}]); errInvalid = function() { return oserror.ErrInvalid; }; errPermission = function() { return oserror.ErrPermission; }; errExist = function() { return oserror.ErrExist; }; errNotExist = function() { return oserror.ErrNotExist; }; errClosed = function() { return oserror.ErrClosed; }; FileMode.prototype.String = function() { var _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.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"), undefined) : 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"), undefined) : 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"), undefined) : buf[w] = ((c$1 << 24 >>> 24))); } else { ((w < 0 || w >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[w] = 45); } w = w + (1) >> 0; _i$1 += _rune$1[1]; } return ($bytesToString($subslice(new sliceType$2(buf), 0, w))); }; $ptrType(FileMode).prototype.String = function() { return new FileMode(this.$get()).String(); }; FileMode.prototype.IsDir = function() { var 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 m; m = this.$val; return ((m & 2401763328) >>> 0) === 0; }; $ptrType(FileMode).prototype.IsRegular = function() { return new FileMode(this.$get()).IsRegular(); }; FileMode.prototype.Perm = function() { var m; m = this.$val; return (m & 511) >>> 0; }; $ptrType(FileMode).prototype.Perm = function() { return new FileMode(this.$get()).Perm(); }; FileMode.prototype.Type = function() { var m; m = this.$val; return (m & 2401763328) >>> 0; }; $ptrType(FileMode).prototype.Type = function() { return new FileMode(this.$get()).Type(); }; PathError.ptr.prototype.Error = function() { var $24r, _r, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; } $24r = e.Op + " " + e.Path + ": " + _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: PathError.ptr.prototype.Error }; } $f.$24r = $24r; $f._r = _r; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; PathError.prototype.Error = function() { return this.$val.Error(); }; PathError.ptr.prototype.Unwrap = function() { var e; e = this; return e.Err; }; PathError.prototype.Unwrap = function() { return this.$val.Unwrap(); }; PathError.ptr.prototype.Timeout = function() { var $24r, _r, _tuple, _v, e, ok, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _tuple = $f._tuple; _v = $f._v; e = $f.e; ok = $f.ok; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; _tuple = $assertType(e.Err, interfaceType, true); t = _tuple[0]; ok = _tuple[1]; if (!(ok)) { _v = false; $s = 1; continue s; } _r = t.Timeout(); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _v = _r; case 1: $24r = _v; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: PathError.ptr.prototype.Timeout }; } $f.$24r = $24r; $f._r = _r; $f._tuple = _tuple; $f._v = _v; $f.e = e; $f.ok = ok; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; PathError.prototype.Timeout = function() { return this.$val.Timeout(); }; 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)}, {prop: "Type", name: "Type", pkg: "", typ: $funcType([], [FileMode], false)}]; ptrType.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Unwrap", name: "Unwrap", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}]; DirEntry.init([{prop: "Info", name: "Info", pkg: "", typ: $funcType([], [FileInfo, $error], false)}, {prop: "IsDir", name: "IsDir", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Type", name: "Type", pkg: "", typ: $funcType([], [FileMode], false)}]); 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)}]); PathError.init("", [{prop: "Op", name: "Op", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Path", name: "Path", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Err", name: "Err", embedded: false, exported: true, typ: $error, 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 = oserror.$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 = path.$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 = time.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = utf8.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $pkg.SkipDir = errors.New("skip this directory"); $pkg.ErrInvalid = errInvalid(); $pkg.ErrPermission = errPermission(); $pkg.ErrExist = errExist(); $pkg.ErrNotExist = errNotExist(); $pkg.ErrClosed = errClosed(); /* */ } 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, itoa, oserror, poll, execenv, unix, testlog, unsafeheader, io, fs, runtime, sort, sync, atomic, syscall, time, fileStat, File, rawConn, file, unixDirent, LinkError, onlyWriter, timeout, SyscallError, dirInfo, readdirMode, sliceType, sliceType$1, sliceType$2, ptrType, ptrType$2, ptrType$3, arrayType$1, arrayType$2, sliceType$3, ptrType$4, arrayType$4, ptrType$6, ptrType$7, sliceType$5, ptrType$8, ptrType$9, ptrType$10, funcType, ptrType$18, ptrType$19, sliceType$8, sliceType$9, funcType$2, funcType$3, ptrType$20, ptrType$21, errPatternHasSeparator, pollCopyFileRange, errWriteAtInAppendMode, lstat, dirBufPool, testingForceReadDirLstat, _r, _r$1, _r$2, nextRandom, CreateTemp, prefixAndSuffix, joinPath, lastIndex, hostname, Hostname, statNolog, lstatNolog, fillFileStatFromSys, timespecToTime, Stat, Lstat, newRawConn, init, Exit, IsPathSeparator, basename, runtime_args, init$1, runtime_beforeExit, fastrand, fixLongPath, NewFile, newFile, epipecheck, openFileNolog, Remove, tempDir, newUnixDirent, sigpipe, syscallMode, chmod, ignoringEINTR, genericReadFrom, setStickyBit, Open, OpenFile, TempDir, Chmod, ReadFile, errNoDeadline, errDeadlineExceeded, NewSyscallError, IsExist, IsNotExist, IsPermission, underlyingErrorIs, underlyingError, Getenv, direntIno, direntReclen, direntNamlen, direntType, readInt, readIntBE, readIntLE; errors = $packages["errors"]; js = $packages["github.com/gopherjs/gopherjs/js"]; itoa = $packages["internal/itoa"]; oserror = $packages["internal/oserror"]; poll = $packages["internal/poll"]; execenv = $packages["internal/syscall/execenv"]; unix = $packages["internal/syscall/unix"]; testlog = $packages["internal/testlog"]; unsafeheader = $packages["internal/unsafeheader"]; io = $packages["io"]; fs = $packages["io/fs"]; runtime = $packages["runtime"]; sort = $packages["sort"]; sync = $packages["sync"]; atomic = $packages["sync/atomic"]; syscall = $packages["syscall"]; time = $packages["time"]; fileStat = $pkg.fileStat = $newType(0, $kindStruct, "os.fileStat", true, "os", false, 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 $Uint64(0, 0), new $Int64(0, 0), ptrType$4.nil); this.sys = new syscall.Stat_t.ptr(new $Uint64(0, 0), new $Uint64(0, 0), 0, 0, 0, 0, new $Uint64(0, 0), new $Uint64(0, 0), new $Int64(0, 0), 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$4.zero()); return; } this.name = name_; this.size = size_; this.mode = mode_; this.modTime = modTime_; this.sys = sys_; }); File = $pkg.File = $newType(0, $kindStruct, "os.File", true, "os", true, function(file_) { this.$val = this; if (arguments.length === 0) { this.file = ptrType$10.nil; return; } this.file = file_; }); rawConn = $pkg.rawConn = $newType(0, $kindStruct, "os.rawConn", true, "os", false, function(file_) { this.$val = this; if (arguments.length === 0) { this.file = ptrType$3.nil; return; } this.file = file_; }); file = $pkg.file = $newType(0, $kindStruct, "os.file", true, "os", false, function(pfd_, name_, dirinfo_, nonblock_, stdoutOrErr_, appendMode_) { this.$val = this; if (arguments.length === 0) { this.pfd = new poll.FD.ptr(new poll.fdMutex.ptr(new $Uint64(0, 0), 0, 0), 0, new poll.pollDesc.ptr(false), ptrType$8.nil, 0, 0, false, false, false); this.name = ""; this.dirinfo = ptrType$9.nil; this.nonblock = false; this.stdoutOrErr = false; this.appendMode = false; return; } this.pfd = pfd_; this.name = name_; this.dirinfo = dirinfo_; this.nonblock = nonblock_; this.stdoutOrErr = stdoutOrErr_; this.appendMode = appendMode_; }); unixDirent = $pkg.unixDirent = $newType(0, $kindStruct, "os.unixDirent", true, "os", false, function(parent_, name_, typ_, info_) { this.$val = this; if (arguments.length === 0) { this.parent = ""; this.name = ""; this.typ = 0; this.info = $ifaceNil; return; } this.parent = parent_; this.name = name_; this.typ = typ_; this.info = info_; }); LinkError = $pkg.LinkError = $newType(0, $kindStruct, "os.LinkError", true, "os", true, 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_; }); onlyWriter = $pkg.onlyWriter = $newType(0, $kindStruct, "os.onlyWriter", true, "os", false, function(Writer_) { this.$val = this; if (arguments.length === 0) { this.Writer = $ifaceNil; return; } this.Writer = Writer_; }); timeout = $pkg.timeout = $newType(8, $kindInterface, "os.timeout", true, "os", false, null); SyscallError = $pkg.SyscallError = $newType(0, $kindStruct, "os.SyscallError", true, "os", true, function(Syscall_, Err_) { this.$val = this; if (arguments.length === 0) { this.Syscall = ""; this.Err = $ifaceNil; return; } this.Syscall = Syscall_; this.Err = Err_; }); dirInfo = $pkg.dirInfo = $newType(0, $kindStruct, "os.dirInfo", true, "os", false, function(buf_, nbuf_, bufp_) { this.$val = this; if (arguments.length === 0) { this.buf = ptrType.nil; this.nbuf = 0; this.bufp = 0; return; } this.buf = buf_; this.nbuf = nbuf_; this.bufp = bufp_; }); readdirMode = $pkg.readdirMode = $newType(4, $kindInt, "os.readdirMode", true, "os", false, null); sliceType = $sliceType($String); sliceType$1 = $sliceType($emptyInterface); sliceType$2 = $sliceType($Uint8); ptrType = $ptrType(sliceType$2); ptrType$2 = $ptrType(fileStat); ptrType$3 = $ptrType(File); arrayType$1 = $arrayType($Int8, 65); arrayType$2 = $arrayType($Uint8, 512); sliceType$3 = $sliceType($Int8); ptrType$4 = $ptrType(time.Location); arrayType$4 = $arrayType($Int32, 2); ptrType$6 = $ptrType(fs.PathError); ptrType$7 = $ptrType(io.LimitedReader); sliceType$5 = $sliceType(syscall.Iovec); ptrType$8 = $ptrType(sliceType$5); ptrType$9 = $ptrType(dirInfo); ptrType$10 = $ptrType(file); funcType = $funcType([ptrType$10], [$error], false); ptrType$18 = $ptrType(LinkError); ptrType$19 = $ptrType(SyscallError); sliceType$8 = $sliceType(fs.DirEntry); sliceType$9 = $sliceType(fs.FileInfo); funcType$2 = $funcType([$Uintptr], [], false); funcType$3 = $funcType([$Uintptr], [$Bool], false); ptrType$20 = $ptrType(rawConn); ptrType$21 = $ptrType(unixDirent); fileStat.ptr.prototype.Size = function() { var fs$1; fs$1 = this; return fs$1.size; }; fileStat.prototype.Size = function() { return this.$val.Size(); }; fileStat.ptr.prototype.Mode = function() { var fs$1; fs$1 = this; return fs$1.mode; }; fileStat.prototype.Mode = function() { return this.$val.Mode(); }; fileStat.ptr.prototype.ModTime = function() { var fs$1; fs$1 = this; return fs$1.modTime; }; fileStat.prototype.ModTime = function() { return this.$val.ModTime(); }; fileStat.ptr.prototype.Sys = function() { var fs$1; fs$1 = this; return fs$1.sys; }; fileStat.prototype.Sys = function() { return this.$val.Sys(); }; fileStat.ptr.prototype.Name = function() { var fs$1; fs$1 = this; return fs$1.name; }; fileStat.prototype.Name = function() { return this.$val.Name(); }; fileStat.ptr.prototype.IsDir = function() { var fs$1; fs$1 = this; return new fs.FileMode(fs$1.Mode()).IsDir(); }; fileStat.prototype.IsDir = function() { return this.$val.IsDir(); }; nextRandom = function() { var $24r, _r$3, _r$4, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$3 = $f._r$3; _r$4 = $f._r$4; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$3 = fastrand(); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = itoa.Uitoa(((_r$3 >>> 0))); /* */ $s = 2; case 2: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r = _r$4; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: nextRandom }; } $f.$24r = $24r; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.$s = $s; $f.$r = $r; return $f; }; CreateTemp = function(dir, pattern) { var _r$3, _r$4, _r$5, _tuple, _tuple$1, dir, err, err$1, f, name, pattern, prefix, suffix, try$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; dir = $f.dir; err = $f.err; err$1 = $f.err$1; f = $f.f; name = $f.name; pattern = $f.pattern; prefix = $f.prefix; suffix = $f.suffix; try$1 = $f.try$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (dir === "") { $s = 1; continue; } /* */ $s = 2; continue; /* if (dir === "") { */ case 1: _r$3 = TempDir(); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } dir = _r$3; /* } */ case 2: _tuple = prefixAndSuffix(pattern); prefix = _tuple[0]; suffix = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$3.nil, new fs.PathError.ptr("createtemp", pattern, err)]; } prefix = joinPath(dir, prefix); try$1 = 0; /* while (true) { */ case 4: _r$4 = nextRandom(); /* */ $s = 6; case 6: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } name = prefix + _r$4 + suffix; _r$5 = OpenFile(name, 194, 384); /* */ $s = 7; case 7: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$1 = _r$5; f = _tuple$1[0]; err$1 = _tuple$1[1]; if (IsExist(err$1)) { try$1 = try$1 + (1) >> 0; if (try$1 < 10000) { /* continue; */ $s = 4; continue; } $s = -1; return [ptrType$3.nil, new fs.PathError.ptr("createtemp", dir + "/" + prefix + "*" + suffix, $pkg.ErrExist)]; } $s = -1; return [f, err$1]; case 5: $s = -1; return [ptrType$3.nil, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: CreateTemp }; } $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.dir = dir; $f.err = err; $f.err$1 = err$1; $f.f = f; $f.name = name; $f.pattern = pattern; $f.prefix = prefix; $f.suffix = suffix; $f.try$1 = try$1; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.CreateTemp = CreateTemp; prefixAndSuffix = function(pattern) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, err, i, pattern, pos, prefix, suffix; prefix = ""; suffix = ""; err = $ifaceNil; i = 0; while (true) { if (!(i < pattern.length)) { break; } if (IsPathSeparator(pattern.charCodeAt(i))) { _tmp = ""; _tmp$1 = ""; _tmp$2 = errPatternHasSeparator; prefix = _tmp; suffix = _tmp$1; err = _tmp$2; return [prefix, suffix, err]; } i = i + (1) >> 0; } pos = lastIndex(pattern, 42); if (!((pos === -1))) { _tmp$3 = $substring(pattern, 0, pos); _tmp$4 = $substring(pattern, (pos + 1 >> 0)); prefix = _tmp$3; suffix = _tmp$4; } else { prefix = pattern; } _tmp$5 = prefix; _tmp$6 = suffix; _tmp$7 = $ifaceNil; prefix = _tmp$5; suffix = _tmp$6; err = _tmp$7; return [prefix, suffix, err]; }; joinPath = function(dir, name) { var dir, name; if (dir.length > 0 && IsPathSeparator(dir.charCodeAt((dir.length - 1 >> 0)))) { return dir + name; } return dir + "/" + name; }; lastIndex = function(s, sep) { var i, s, sep; i = s.length - 1 >> 0; while (true) { if (!(i >= 0)) { break; } if (s.charCodeAt(i) === sep) { return i; } i = i - (1) >> 0; } return -1; }; hostname = function() { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, $24r$5, _i, _r$3, _r$4, _r$5, _ref, _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, b, buf, err, f, i, n, name, un, x, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; _i = $f._i; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$10 = $f._tmp$10; _tmp$11 = $f._tmp$11; _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; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; b = $f.b; buf = $f.buf; err = $f.err; f = $f.f; i = $f.i; n = $f.n; name = $f.name; un = $f.un; x = $f.x; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); un = [un]; name = ""; err = $ifaceNil; un[0] = new syscall.Utsname.ptr(arrayType$1.zero(), arrayType$1.zero(), arrayType$1.zero(), arrayType$1.zero(), arrayType$1.zero(), arrayType$1.zero()); _r$3 = syscall.Uname(un[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } err = _r$3; buf = arrayType$2.zero(); _ref = new sliceType$3(un[0].Nodename); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; b = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); ((i < 0 || i >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[i] = ((b << 24 >>> 24))); if (b === 0) { name = ($bytesToString($subslice(new sliceType$2(buf), 0, i))); break; } _i++; } /* */ if ($interfaceIsEqual(err, $ifaceNil) && name.length > 0 && name.length < 64) { $s = 2; continue; } /* */ $s = 3; continue; /* if ($interfaceIsEqual(err, $ifaceNil) && name.length > 0 && name.length < 64) { */ case 2: _tmp = name; _tmp$1 = $ifaceNil; name = _tmp; err = _tmp$1; $24r = [name, err]; $s = 4; case 4: return $24r; /* } */ case 3: /* */ if (false) { $s = 5; continue; } /* */ $s = 6; continue; /* if (false) { */ case 5: /* */ if (!(name === "")) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!(name === "")) { */ case 7: _tmp$2 = name; _tmp$3 = $ifaceNil; name = _tmp$2; err = _tmp$3; $24r$1 = [name, err]; $s = 9; case 9: return $24r$1; /* } */ case 8: _tmp$4 = "localhost"; _tmp$5 = $ifaceNil; name = _tmp$4; err = _tmp$5; $24r$2 = [name, err]; $s = 10; case 10: return $24r$2; /* } */ case 6: _r$4 = Open("/proc/sys/kernel/hostname"); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple = _r$4; f = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 12; continue; } /* */ $s = 13; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 12: _tmp$6 = ""; _tmp$7 = err; name = _tmp$6; err = _tmp$7; $24r$3 = [name, err]; $s = 14; case 14: return $24r$3; /* } */ case 13: $deferred.push([$methodVal(f, "Close"), []]); _r$5 = f.Read(new sliceType$2(buf)); /* */ $s = 15; case 15: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$1 = _r$5; n = _tuple$1[0]; err = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 16; continue; } /* */ $s = 17; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 16: _tmp$8 = ""; _tmp$9 = err; name = _tmp$8; err = _tmp$9; $24r$4 = [name, err]; $s = 18; case 18: return $24r$4; /* } */ case 17: if (n > 0 && ((x = n - 1 >> 0, ((x < 0 || x >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[x])) === 10)) { n = n - (1) >> 0; } _tmp$10 = ($bytesToString($subslice(new sliceType$2(buf), 0, n))); _tmp$11 = $ifaceNil; name = _tmp$10; err = _tmp$11; $24r$5 = [name, err]; $s = 19; case 19: return $24r$5; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [name, err]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: hostname }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f._i = _i; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$10 = _tmp$10; $f._tmp$11 = _tmp$11; $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._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.b = b; $f.buf = buf; $f.err = err; $f.f = f; $f.i = i; $f.n = n; $f.name = name; $f.un = un; $f.x = x; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Hostname = function() { var $24r, _r$3, _tuple, err, name, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$3 = $f._r$3; _tuple = $f._tuple; err = $f.err; name = $f.name; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: name = ""; err = $ifaceNil; _r$3 = hostname(); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; name = _tuple[0]; err = _tuple[1]; $24r = [name, err]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Hostname }; } $f.$24r = $24r; $f._r$3 = _r$3; $f._tuple = _tuple; $f.err = err; $f.name = name; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Hostname = Hostname; File.ptr.prototype.Stat = function() { var _r$3, err, f, fs$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; err = $f.err; f = $f.f; fs$1 = $f.fs$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fs$1 = [fs$1]; f = this; if (f === ptrType$3.nil) { $s = -1; return [$ifaceNil, $pkg.ErrInvalid]; } fs$1[0] = new fileStat.ptr("", new $Int64(0, 0), 0, new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$4.nil), new syscall.Stat_t.ptr(new $Uint64(0, 0), new $Uint64(0, 0), 0, 0, 0, 0, new $Uint64(0, 0), new $Uint64(0, 0), new $Int64(0, 0), 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$4.zero())); _r$3 = f.file.pfd.Fstat(fs$1[0].sys); /* */ $s = 1; case 1: 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 = -1; return [$ifaceNil, new fs.PathError.ptr("stat", f.file.name, err)]; } fillFileStatFromSys(fs$1[0], f.file.name); $s = -1; return [fs$1[0], $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Stat }; } $f._r$3 = _r$3; $f.err = err; $f.f = f; $f.fs$1 = fs$1; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.Stat = function() { return this.$val.Stat(); }; statNolog = function(name) { var _r$3, err, fs$1, name, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; err = $f.err; fs$1 = $f.fs$1; name = $f.name; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fs$1 = [fs$1]; name = [name]; fs$1[0] = new fileStat.ptr("", new $Int64(0, 0), 0, new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$4.nil), new syscall.Stat_t.ptr(new $Uint64(0, 0), new $Uint64(0, 0), 0, 0, 0, 0, new $Uint64(0, 0), new $Uint64(0, 0), new $Int64(0, 0), 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$4.zero())); _r$3 = ignoringEINTR((function(fs$1, name) { return function $b() { var $24r, _r$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$3 = $f._r$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$3 = syscall.Stat(name[0], fs$1[0].sys); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = _r$3; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$24r = $24r; $f._r$3 = _r$3; $f.$s = $s; $f.$r = $r; return $f; }; })(fs$1, name)); /* */ $s = 1; case 1: 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 = -1; return [$ifaceNil, new fs.PathError.ptr("stat", name[0], err)]; } fillFileStatFromSys(fs$1[0], name[0]); $s = -1; return [fs$1[0], $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: statNolog }; } $f._r$3 = _r$3; $f.err = err; $f.fs$1 = fs$1; $f.name = name; $f.$s = $s; $f.$r = $r; return $f; }; lstatNolog = function(name) { var _r$3, err, fs$1, name, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; err = $f.err; fs$1 = $f.fs$1; name = $f.name; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fs$1 = [fs$1]; name = [name]; fs$1[0] = new fileStat.ptr("", new $Int64(0, 0), 0, new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$4.nil), new syscall.Stat_t.ptr(new $Uint64(0, 0), new $Uint64(0, 0), 0, 0, 0, 0, new $Uint64(0, 0), new $Uint64(0, 0), new $Int64(0, 0), 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$4.zero())); _r$3 = ignoringEINTR((function(fs$1, name) { return function $b() { var $24r, _r$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$3 = $f._r$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$3 = syscall.Lstat(name[0], fs$1[0].sys); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = _r$3; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$24r = $24r; $f._r$3 = _r$3; $f.$s = $s; $f.$r = $r; return $f; }; })(fs$1, name)); /* */ $s = 1; case 1: 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 = -1; return [$ifaceNil, new fs.PathError.ptr("lstat", name[0], err)]; } fillFileStatFromSys(fs$1[0], name[0]); $s = -1; return [fs$1[0], $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: lstatNolog }; } $f._r$3 = _r$3; $f.err = err; $f.fs$1 = fs$1; $f.name = name; $f.$s = $s; $f.$r = $r; return $f; }; fillFileStatFromSys = function(fs$1, name) { var _1, fs$1, name; fs$1.name = basename(name); fs$1.size = fs$1.sys.Size; time.Time.copy(fs$1.modTime, timespecToTime($clone(fs$1.sys.Mtim, syscall.Timespec))); fs$1.mode = ((((fs$1.sys.Mode & 511) >>> 0) >>> 0)); _1 = (fs$1.sys.Mode & 61440) >>> 0; if (_1 === (24576)) { fs$1.mode = (fs$1.mode | (67108864)) >>> 0; } else if (_1 === (8192)) { fs$1.mode = (fs$1.mode | (69206016)) >>> 0; } else if (_1 === (16384)) { fs$1.mode = (fs$1.mode | (2147483648)) >>> 0; } else if (_1 === (4096)) { fs$1.mode = (fs$1.mode | (33554432)) >>> 0; } else if (_1 === (40960)) { fs$1.mode = (fs$1.mode | (134217728)) >>> 0; } else if (_1 === (32768)) { } else if (_1 === (49152)) { fs$1.mode = (fs$1.mode | (16777216)) >>> 0; } if (!((((fs$1.sys.Mode & 1024) >>> 0) === 0))) { fs$1.mode = (fs$1.mode | (4194304)) >>> 0; } if (!((((fs$1.sys.Mode & 2048) >>> 0) === 0))) { fs$1.mode = (fs$1.mode | (8388608)) >>> 0; } if (!((((fs$1.sys.Mode & 512) >>> 0) === 0))) { fs$1.mode = (fs$1.mode | (1048576)) >>> 0; } }; timespecToTime = function(ts) { var ts; return time.Unix((ts.Sec), (ts.Nsec)); }; Stat = function(name) { var $24r, _r$3, name, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$3 = $f._r$3; name = $f.name; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = testlog.Stat(name); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$3 = statNolog(name); /* */ $s = 2; case 2: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = _r$3; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Stat }; } $f.$24r = $24r; $f._r$3 = _r$3; $f.name = name; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Stat = Stat; Lstat = function(name) { var $24r, _r$3, name, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$3 = $f._r$3; name = $f.name; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = testlog.Stat(name); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$3 = lstatNolog(name); /* */ $s = 2; case 2: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = _r$3; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Lstat }; } $f.$24r = $24r; $f._r$3 = _r$3; $f.name = name; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Lstat = Lstat; File.ptr.prototype.readFrom = function(r) { var _r$3, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, err, f, handled, lr, ok, r, remain, src, written, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _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$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; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; err = $f.err; f = $f.f; handled = $f.handled; lr = $f.lr; ok = $f.ok; r = $f.r; remain = $f.remain; src = $f.src; written = $f.written; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: written = new $Int64(0, 0); handled = false; err = $ifaceNil; f = this; if (f.file.appendMode) { _tmp = new $Int64(0, 0); _tmp$1 = false; _tmp$2 = $ifaceNil; written = _tmp; handled = _tmp$1; err = _tmp$2; $s = -1; return [written, handled, err]; } remain = new $Int64(1073741824, 0); _tuple = $assertType(r, ptrType$7, true); lr = _tuple[0]; ok = _tuple[1]; if (ok) { _tmp$3 = lr.N; _tmp$4 = lr.R; remain = _tmp$3; r = _tmp$4; if ((remain.$high < 0 || (remain.$high === 0 && remain.$low <= 0))) { _tmp$5 = new $Int64(0, 0); _tmp$6 = true; _tmp$7 = $ifaceNil; written = _tmp$5; handled = _tmp$6; err = _tmp$7; $s = -1; return [written, handled, err]; } } _tuple$1 = $assertType(r, ptrType$3, true); src = _tuple$1[0]; ok = _tuple$1[1]; if (!ok) { _tmp$8 = new $Int64(0, 0); _tmp$9 = false; _tmp$10 = $ifaceNil; written = _tmp$8; handled = _tmp$9; err = _tmp$10; $s = -1; return [written, handled, err]; } if (!($interfaceIsEqual(src.checkValid("ReadFrom"), $ifaceNil))) { _tmp$11 = new $Int64(0, 0); _tmp$12 = false; _tmp$13 = $ifaceNil; written = _tmp$11; handled = _tmp$12; err = _tmp$13; $s = -1; return [written, handled, err]; } _r$3 = pollCopyFileRange(f.file.pfd, src.file.pfd, remain); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$2 = _r$3; written = _tuple$2[0]; handled = _tuple$2[1]; err = _tuple$2[2]; if (!(lr === ptrType$7.nil)) { lr.N = (x = lr.N, x$1 = written, new $Int64(x.$high - x$1.$high, x.$low - x$1.$low)); } _tmp$14 = written; _tmp$15 = handled; _tmp$16 = NewSyscallError("copy_file_range", err); written = _tmp$14; handled = _tmp$15; err = _tmp$16; $s = -1; return [written, handled, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.readFrom }; } $f._r$3 = _r$3; $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$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._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.err = err; $f.f = f; $f.handled = handled; $f.lr = lr; $f.ok = ok; $f.r = r; $f.remain = remain; $f.src = src; $f.written = written; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.readFrom = function(r) { return this.$val.readFrom(r); }; rawConn.ptr.prototype.Control = function(f) { var _r$3, c, err, err$1, f, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; c = $f.c; err = $f.err; err$1 = $f.err$1; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; err = c.file.checkValid("SyscallConn.Control"); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _r$3 = c.file.file.pfd.RawControl(f); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } err$1 = _r$3; runtime.KeepAlive(c.file); $s = -1; return err$1; /* */ } return; } if ($f === undefined) { $f = { $blk: rawConn.ptr.prototype.Control }; } $f._r$3 = _r$3; $f.c = c; $f.err = err; $f.err$1 = err$1; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; }; rawConn.prototype.Control = function(f) { return this.$val.Control(f); }; rawConn.ptr.prototype.Read = function(f) { var _r$3, c, err, err$1, f, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; c = $f.c; err = $f.err; err$1 = $f.err$1; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; err = c.file.checkValid("SyscallConn.Read"); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _r$3 = c.file.file.pfd.RawRead(f); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } err$1 = _r$3; runtime.KeepAlive(c.file); $s = -1; return err$1; /* */ } return; } if ($f === undefined) { $f = { $blk: rawConn.ptr.prototype.Read }; } $f._r$3 = _r$3; $f.c = c; $f.err = err; $f.err$1 = err$1; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; }; rawConn.prototype.Read = function(f) { return this.$val.Read(f); }; rawConn.ptr.prototype.Write = function(f) { var _r$3, c, err, err$1, f, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; c = $f.c; err = $f.err; err$1 = $f.err$1; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; err = c.file.checkValid("SyscallConn.Write"); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _r$3 = c.file.file.pfd.RawWrite(f); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } err$1 = _r$3; runtime.KeepAlive(c.file); $s = -1; return err$1; /* */ } return; } if ($f === undefined) { $f = { $blk: rawConn.ptr.prototype.Write }; } $f._r$3 = _r$3; $f.c = c; $f.err = err; $f.err$1 = err$1; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; }; rawConn.prototype.Write = function(f) { return this.$val.Write(f); }; newRawConn = function(file$1) { var file$1; return [new rawConn.ptr(file$1), $ifaceNil]; }; init = function() { if (false) { return; } $pkg.Args = runtime_args(); }; Exit = function(code) { var _r$3, code, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; code = $f.code; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (code === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (code === 0) { */ case 1: _r$3 = testlog.PanicOnExit0(); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } /* */ if (_r$3) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_r$3) { */ case 3: $panic(new $String("unexpected call to os.Exit(0) during test")); /* } */ case 4: runtime_beforeExit(); /* } */ case 2: $r = syscall.Exit(code); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Exit }; } $f._r$3 = _r$3; $f.code = code; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Exit = Exit; IsPathSeparator = function(c) { var c; return 47 === c; }; $pkg.IsPathSeparator = IsPathSeparator; basename = function(name) { var i, name; i = name.length - 1 >> 0; while (true) { if (!(i > 0 && (name.charCodeAt(i) === 47))) { break; } name = $substring(name, 0, i); i = i - (1) >> 0; } i = i - (1) >> 0; while (true) { if (!(i >= 0)) { break; } if (name.charCodeAt(i) === 47) { name = $substring(name, (i + 1 >> 0)); break; } i = i - (1) >> 0; } return name; }; runtime_args = function() { return $pkg.Args; }; init$1 = function() { var argv, i, process; process = $global.process; if (!(process === undefined)) { argv = process.argv; if (!(argv === undefined)) { $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"), undefined) : $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() { }; fastrand = function() { $throwRuntimeError("native function not implemented: os.fastrand"); }; File.ptr.prototype.WriteString = function(s) { var $24r, _r$3, _tuple, err, f, n, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$3 = $f._r$3; _tuple = $f._tuple; err = $f.err; f = $f.f; n = $f.n; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; f = this; _r$3 = f.Write((new sliceType$2($stringToBytes(s)))); /* */ $s = 1; case 1: 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]; $24r = [n, err]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.WriteString }; } $f.$24r = $24r; $f._r$3 = _r$3; $f._tuple = _tuple; $f.err = err; $f.f = f; $f.n = n; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.WriteString = function(s) { return this.$val.WriteString(s); }; fixLongPath = function(path) { var path; return path; }; File.ptr.prototype.Fd = function() { var _r$3, f, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; if (f === ptrType$3.nil) { $s = -1; return 4294967295; } /* */ if (f.file.nonblock) { $s = 1; continue; } /* */ $s = 2; continue; /* if (f.file.nonblock) { */ case 1: _r$3 = f.file.pfd.SetBlocking(); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; /* } */ case 2: $s = -1; return ((f.file.pfd.Sysfd >>> 0)); /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Fd }; } $f._r$3 = _r$3; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.Fd = function() { return this.$val.Fd(); }; NewFile = function(fd, name) { var $24r, _r$3, _tuple, err, fd, kind, name, nb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$3 = $f._r$3; _tuple = $f._tuple; err = $f.err; fd = $f.fd; kind = $f.kind; name = $f.name; nb = $f.nb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: kind = 0; _tuple = unix.IsNonblock(((fd >> 0))); nb = _tuple[0]; err = _tuple[1]; if ($interfaceIsEqual(err, $ifaceNil) && nb) { kind = 3; } _r$3 = newFile(fd, name, kind); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = _r$3; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: NewFile }; } $f.$24r = $24r; $f._r$3 = _r$3; $f._tuple = _tuple; $f.err = err; $f.fd = fd; $f.kind = kind; $f.name = name; $f.nb = nb; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.NewFile = NewFile; newFile = function(fd, name, kind) { var _1, _r$3, _r$4, err, err$1, err$2, f, fd, fdi, kind, name, pollable, st, typ, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r$3 = $f._r$3; _r$4 = $f._r$4; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; f = $f.f; fd = $f.fd; fdi = $f.fdi; kind = $f.kind; name = $f.name; pollable = $f.pollable; st = $f.st; typ = $f.typ; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fdi = [fdi]; st = [st]; fdi[0] = ((fd >> 0)); if (fdi[0] < 0) { $s = -1; return ptrType$3.nil; } f = new File.ptr(new file.ptr(new poll.FD.ptr(new poll.fdMutex.ptr(new $Uint64(0, 0), 0, 0), fdi[0], new poll.pollDesc.ptr(false), ptrType$8.nil, 0, 0, true, true, false), name, ptrType$9.nil, false, (fdi[0] === 1) || (fdi[0] === 2), false)); pollable = (kind === 1) || (kind === 2) || (kind === 3); /* */ if (kind === 1) { $s = 1; continue; } /* */ $s = 2; continue; /* if (kind === 1) { */ case 1: _1 = "linux"; /* */ if (_1 === ("darwin") || _1 === ("ios") || _1 === ("dragonfly") || _1 === ("freebsd") || _1 === ("netbsd") || _1 === ("openbsd")) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_1 === ("darwin") || _1 === ("ios") || _1 === ("dragonfly") || _1 === ("freebsd") || _1 === ("netbsd") || _1 === ("openbsd")) { */ case 4: st[0] = new syscall.Stat_t.ptr(new $Uint64(0, 0), new $Uint64(0, 0), 0, 0, 0, 0, new $Uint64(0, 0), new $Uint64(0, 0), new $Int64(0, 0), 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$4.zero()); _r$3 = ignoringEINTR((function(fdi, st) { return function $b() { var $24r, _r$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$3 = $f._r$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$3 = syscall.Fstat(fdi[0], st[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = _r$3; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$24r = $24r; $f._r$3 = _r$3; $f.$s = $s; $f.$r = $r; return $f; }; })(fdi, st)); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } err = _r$3; typ = (st[0].Mode & 61440) >>> 0; if ($interfaceIsEqual(err, $ifaceNil) && ((typ === 32768) || (typ === 16384))) { pollable = false; } if (false && (typ === 4096)) { pollable = false; } /* } */ case 5: case 3: /* } */ case 2: err$1 = f.file.pfd.Init("file", pollable); /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 7; continue; } /* */ if (pollable) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 7: $s = 9; continue; /* } else if (pollable) { */ case 8: _r$4 = syscall.SetNonblock(fdi[0], true); /* */ $s = 10; case 10: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } err$2 = _r$4; if ($interfaceIsEqual(err$2, $ifaceNil)) { f.file.nonblock = true; } /* } */ case 9: runtime.SetFinalizer(f.file, new funcType($methodExpr(ptrType$10, "close"))); $s = -1; return f; /* */ } return; } if ($f === undefined) { $f = { $blk: newFile }; } $f._1 = _1; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.f = f; $f.fd = fd; $f.fdi = fdi; $f.kind = kind; $f.name = name; $f.pollable = pollable; $f.st = st; $f.typ = typ; $f.$s = $s; $f.$r = $r; return $f; }; epipecheck = function(file$1, e) { var e, file$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; e = $f.e; file$1 = $f.file$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if ($interfaceIsEqual(e, new syscall.Errno(32)) && file$1.file.stdoutOrErr) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($interfaceIsEqual(e, new syscall.Errno(32)) && file$1.file.stdoutOrErr) { */ case 1: $r = sigpipe(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: epipecheck }; } $f.e = e; $f.file$1 = file$1; $f.$s = $s; $f.$r = $r; return $f; }; openFileNolog = function(name, flag, perm) { var $24r, _r$3, _r$4, _r$5, _r$6, _tuple, _tuple$1, e, err, flag, name, perm, r, setSticky, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; e = $f.e; err = $f.err; flag = $f.flag; name = $f.name; perm = $f.perm; r = $f.r; setSticky = $f.setSticky; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: setSticky = false; /* */ if (false && !(((flag & 64) === 0)) && !((((perm & 1048576) >>> 0) === 0))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (false && !(((flag & 64) === 0)) && !((((perm & 1048576) >>> 0) === 0))) { */ case 1: _r$3 = Stat(name); /* */ $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; err = _tuple[1]; if (IsNotExist(err)) { setSticky = true; } /* } */ case 2: r = 0; /* while (true) { */ case 4: e = $ifaceNil; _r$4 = syscall.Open(name, flag | 524288, syscallMode(perm)); /* */ $s = 6; case 6: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$1 = _r$4; r = _tuple$1[0]; e = _tuple$1[1]; if ($interfaceIsEqual(e, $ifaceNil)) { /* break; */ $s = 5; continue; } if ($interfaceIsEqual(e, new syscall.Errno(4))) { /* continue; */ $s = 4; continue; } $s = -1; return [ptrType$3.nil, new fs.PathError.ptr("open", name, e)]; case 5: /* */ if (setSticky) { $s = 7; continue; } /* */ $s = 8; continue; /* if (setSticky) { */ case 7: _r$5 = setStickyBit(name); /* */ $s = 9; case 9: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; /* } */ case 8: /* */ if (false) { $s = 10; continue; } /* */ $s = 11; continue; /* if (false) { */ case 10: $r = syscall.CloseOnExec(r); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 11: _r$6 = newFile(((r >>> 0)), name, 1); /* */ $s = 13; case 13: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } $24r = [_r$6, $ifaceNil]; $s = 14; case 14: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: openFileNolog }; } $f.$24r = $24r; $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.e = e; $f.err = err; $f.flag = flag; $f.name = name; $f.perm = perm; $f.r = r; $f.setSticky = setSticky; $f.$s = $s; $f.$r = $r; return $f; }; file.ptr.prototype.close = function() { var _r$3, e, err, file$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; e = $f.e; err = $f.err; file$1 = $f.file$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: file$1 = this; if (file$1 === ptrType$10.nil) { $s = -1; return new syscall.Errno(22); } if (!(file$1.dirinfo === ptrType$9.nil)) { file$1.dirinfo.close(); file$1.dirinfo = ptrType$9.nil; } err = $ifaceNil; _r$3 = file$1.pfd.Close(); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } e = _r$3; if (!($interfaceIsEqual(e, $ifaceNil))) { if ($interfaceIsEqual(e, poll.ErrFileClosing)) { e = $pkg.ErrClosed; } err = new fs.PathError.ptr("close", file$1.name, e); } runtime.SetFinalizer(file$1, $ifaceNil); $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: file.ptr.prototype.close }; } $f._r$3 = _r$3; $f.e = e; $f.err = err; $f.file$1 = file$1; $f.$s = $s; $f.$r = $r; return $f; }; file.prototype.close = function() { return this.$val.close(); }; File.ptr.prototype.seek = function(offset, whence) { var _r$3, _tmp, _tmp$1, _tuple, err, f, offset, ret, whence, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; err = $f.err; f = $f.f; offset = $f.offset; ret = $f.ret; whence = $f.whence; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ret = new $Int64(0, 0); err = $ifaceNil; f = this; if (!(f.file.dirinfo === ptrType$9.nil)) { f.file.dirinfo.close(); f.file.dirinfo = ptrType$9.nil; } _r$3 = f.file.pfd.Seek(offset, whence); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; ret = _tuple[0]; err = _tuple[1]; runtime.KeepAlive(f); _tmp = ret; _tmp$1 = err; ret = _tmp; err = _tmp$1; $s = -1; return [ret, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.seek }; } $f._r$3 = _r$3; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.err = err; $f.f = f; $f.offset = offset; $f.ret = ret; $f.whence = whence; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.seek = function(offset, whence) { return this.$val.seek(offset, whence); }; Remove = function(name) { var _r$3, _r$4, e, e1, name, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _r$4 = $f._r$4; e = $f.e; e1 = $f.e1; name = $f.name; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: name = [name]; _r$3 = ignoringEINTR((function(name) { return function $b() { var $24r, _r$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$3 = $f._r$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$3 = syscall.Unlink(name[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = _r$3; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$24r = $24r; $f._r$3 = _r$3; $f.$s = $s; $f.$r = $r; return $f; }; })(name)); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } e = _r$3; if ($interfaceIsEqual(e, $ifaceNil)) { $s = -1; return $ifaceNil; } _r$4 = ignoringEINTR((function(name) { return function $b() { var $24r, _r$4, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$4 = $f._r$4; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$4 = syscall.Rmdir(name[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r = _r$4; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$24r = $24r; $f._r$4 = _r$4; $f.$s = $s; $f.$r = $r; return $f; }; })(name)); /* */ $s = 2; case 2: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } e1 = _r$4; if ($interfaceIsEqual(e1, $ifaceNil)) { $s = -1; return $ifaceNil; } if (!($interfaceIsEqual(e1, new syscall.Errno(20)))) { e = e1; } $s = -1; return new fs.PathError.ptr("remove", name[0], e); /* */ } return; } if ($f === undefined) { $f = { $blk: Remove }; } $f._r$3 = _r$3; $f._r$4 = _r$4; $f.e = e; $f.e1 = e1; $f.name = name; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Remove = Remove; tempDir = function() { var _r$3, dir, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; dir = $f.dir; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$3 = Getenv("TMPDIR"); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } dir = _r$3; if (dir === "") { if (false) { dir = "/data/local/tmp"; } else { dir = "/tmp"; } } $s = -1; return dir; /* */ } return; } if ($f === undefined) { $f = { $blk: tempDir }; } $f._r$3 = _r$3; $f.dir = dir; $f.$s = $s; $f.$r = $r; return $f; }; unixDirent.ptr.prototype.Name = function() { var d; d = this; return d.name; }; unixDirent.prototype.Name = function() { return this.$val.Name(); }; unixDirent.ptr.prototype.IsDir = function() { var d; d = this; return new fs.FileMode(d.typ).IsDir(); }; unixDirent.prototype.IsDir = function() { return this.$val.IsDir(); }; unixDirent.ptr.prototype.Type = function() { var d; d = this; return d.typ; }; unixDirent.prototype.Type = function() { return this.$val.Type(); }; unixDirent.ptr.prototype.Info = function() { var $24r, _r$3, d, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$3 = $f._r$3; d = $f.d; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: d = this; if (!($interfaceIsEqual(d.info, $ifaceNil))) { $s = -1; return [d.info, $ifaceNil]; } _r$3 = lstat(d.parent + "/" + d.name); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = _r$3; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: unixDirent.ptr.prototype.Info }; } $f.$24r = $24r; $f._r$3 = _r$3; $f.d = d; $f.$s = $s; $f.$r = $r; return $f; }; unixDirent.prototype.Info = function() { return this.$val.Info(); }; newUnixDirent = function(parent, name, typ) { var _r$3, _r$4, _r$5, _tuple, err, info, name, parent, typ, ude, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _tuple = $f._tuple; err = $f.err; info = $f.info; name = $f.name; parent = $f.parent; typ = $f.typ; ude = $f.ude; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ude = new unixDirent.ptr(parent, name, typ, $ifaceNil); if (!((typ === 4294967295)) && !testingForceReadDirLstat) { $s = -1; return [ude, $ifaceNil]; } _r$3 = lstat(parent + "/" + name); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; info = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [$ifaceNil, err]; } _r$4 = info.Mode(); /* */ $s = 2; case 2: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = new fs.FileMode(_r$4).Type(); /* */ $s = 3; case 3: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } ude.typ = _r$5; ude.info = info; $s = -1; return [ude, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: newUnixDirent }; } $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._tuple = _tuple; $f.err = err; $f.info = info; $f.name = name; $f.parent = parent; $f.typ = typ; $f.ude = ude; $f.$s = $s; $f.$r = $r; return $f; }; sigpipe = function() { $throwRuntimeError("native function not implemented: os.sigpipe"); }; File.ptr.prototype.Close = function() { var $24r, _r$3, f, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$3 = $f._r$3; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; if (f === ptrType$3.nil) { $s = -1; return $pkg.ErrInvalid; } _r$3 = f.file.close(); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = _r$3; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Close }; } $f.$24r = $24r; $f._r$3 = _r$3; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.Close = function() { return this.$val.Close(); }; File.ptr.prototype.read = function(b) { var _r$3, _tmp, _tmp$1, _tuple, b, err, f, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; b = $f.b; err = $f.err; f = $f.f; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; f = this; _r$3 = f.file.pfd.Read(b); /* */ $s = 1; case 1: 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]; runtime.KeepAlive(f); _tmp = n; _tmp$1 = err; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.read }; } $f._r$3 = _r$3; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.f = f; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.read = function(b) { return this.$val.read(b); }; File.ptr.prototype.pread = function(b, off) { var _r$3, _tmp, _tmp$1, _tuple, b, err, f, n, off, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; b = $f.b; err = $f.err; f = $f.f; n = $f.n; off = $f.off; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; f = this; _r$3 = f.file.pfd.Pread(b, off); /* */ $s = 1; case 1: 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]; runtime.KeepAlive(f); _tmp = n; _tmp$1 = err; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.pread }; } $f._r$3 = _r$3; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.f = f; $f.n = n; $f.off = off; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.pread = function(b, off) { return this.$val.pread(b, off); }; File.ptr.prototype.write = function(b) { var _r$3, _tmp, _tmp$1, _tuple, b, err, f, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; b = $f.b; err = $f.err; f = $f.f; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; f = this; _r$3 = f.file.pfd.Write(b); /* */ $s = 1; case 1: 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]; runtime.KeepAlive(f); _tmp = n; _tmp$1 = err; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.write }; } $f._r$3 = _r$3; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.f = f; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.write = function(b) { return this.$val.write(b); }; File.ptr.prototype.pwrite = function(b, off) { var _r$3, _tmp, _tmp$1, _tuple, b, err, f, n, off, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; b = $f.b; err = $f.err; f = $f.f; n = $f.n; off = $f.off; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; f = this; _r$3 = f.file.pfd.Pwrite(b, off); /* */ $s = 1; case 1: 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]; runtime.KeepAlive(f); _tmp = n; _tmp$1 = err; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.pwrite }; } $f._r$3 = _r$3; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.f = f; $f.n = n; $f.off = off; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.pwrite = function(b, off) { return this.$val.pwrite(b, off); }; syscallMode = function(i) { var i, o; o = 0; o = (o | (((new fs.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; }; chmod = function(name, mode) { var _r$3, e, longName, mode, name, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; e = $f.e; longName = $f.longName; mode = $f.mode; name = $f.name; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: longName = [longName]; mode = [mode]; longName[0] = fixLongPath(name); _r$3 = ignoringEINTR((function(longName, mode) { return function $b() { var $24r, _r$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$3 = $f._r$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$3 = syscall.Chmod(longName[0], syscallMode(mode[0])); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = _r$3; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$24r = $24r; $f._r$3 = _r$3; $f.$s = $s; $f.$r = $r; return $f; }; })(longName, mode)); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } e = _r$3; if (!($interfaceIsEqual(e, $ifaceNil))) { $s = -1; return new fs.PathError.ptr("chmod", name, e); } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: chmod }; } $f._r$3 = _r$3; $f.e = e; $f.longName = longName; $f.mode = mode; $f.name = name; $f.$s = $s; $f.$r = $r; return $f; }; File.ptr.prototype.chmod = function(mode) { var _r$3, e, err, f, mode, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; e = $f.e; err = $f.err; f = $f.f; mode = $f.mode; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; err = f.checkValid("chmod"); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _r$3 = f.file.pfd.Fchmod(syscallMode(mode)); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } e = _r$3; if (!($interfaceIsEqual(e, $ifaceNil))) { $s = -1; return f.wrapErr("chmod", e); } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.chmod }; } $f._r$3 = _r$3; $f.e = e; $f.err = err; $f.f = f; $f.mode = mode; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.chmod = function(mode) { return this.$val.chmod(mode); }; File.ptr.prototype.Chown = function(uid, gid) { var _r$3, e, err, f, gid, uid, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; e = $f.e; err = $f.err; f = $f.f; gid = $f.gid; uid = $f.uid; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; err = f.checkValid("chown"); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _r$3 = f.file.pfd.Fchown(uid, gid); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } e = _r$3; if (!($interfaceIsEqual(e, $ifaceNil))) { $s = -1; return f.wrapErr("chown", e); } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Chown }; } $f._r$3 = _r$3; $f.e = e; $f.err = err; $f.f = f; $f.gid = gid; $f.uid = uid; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.Chown = function(uid, gid) { return this.$val.Chown(uid, gid); }; File.ptr.prototype.Truncate = function(size) { var _r$3, e, err, f, size, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; e = $f.e; err = $f.err; f = $f.f; size = $f.size; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; err = f.checkValid("truncate"); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _r$3 = f.file.pfd.Ftruncate(size); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } e = _r$3; if (!($interfaceIsEqual(e, $ifaceNil))) { $s = -1; return f.wrapErr("truncate", e); } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Truncate }; } $f._r$3 = _r$3; $f.e = e; $f.err = err; $f.f = f; $f.size = size; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.Truncate = function(size) { return this.$val.Truncate(size); }; File.ptr.prototype.Sync = function() { var _r$3, e, err, f, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; e = $f.e; err = $f.err; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; err = f.checkValid("sync"); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _r$3 = f.file.pfd.Fsync(); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } e = _r$3; if (!($interfaceIsEqual(e, $ifaceNil))) { $s = -1; return f.wrapErr("sync", e); } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Sync }; } $f._r$3 = _r$3; $f.e = e; $f.err = err; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.Sync = function() { return this.$val.Sync(); }; File.ptr.prototype.Chdir = function() { var _r$3, e, err, f, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; e = $f.e; err = $f.err; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; err = f.checkValid("chdir"); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _r$3 = f.file.pfd.Fchdir(); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } e = _r$3; if (!($interfaceIsEqual(e, $ifaceNil))) { $s = -1; return f.wrapErr("chdir", e); } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Chdir }; } $f._r$3 = _r$3; $f.e = e; $f.err = err; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.Chdir = function() { return this.$val.Chdir(); }; File.ptr.prototype.setDeadline = function(t) { var err, f, t; f = this; err = f.checkValid("SetDeadline"); if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } return f.file.pfd.SetDeadline($clone(t, time.Time)); }; File.prototype.setDeadline = function(t) { return this.$val.setDeadline(t); }; File.ptr.prototype.setReadDeadline = function(t) { var err, f, t; f = this; err = f.checkValid("SetReadDeadline"); if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } return f.file.pfd.SetReadDeadline($clone(t, time.Time)); }; File.prototype.setReadDeadline = function(t) { return this.$val.setReadDeadline(t); }; File.ptr.prototype.setWriteDeadline = function(t) { var err, f, t; f = this; err = f.checkValid("SetWriteDeadline"); if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } return f.file.pfd.SetWriteDeadline($clone(t, time.Time)); }; File.prototype.setWriteDeadline = function(t) { return this.$val.setWriteDeadline(t); }; File.ptr.prototype.checkValid = function(op) { var f, op; f = this; if (f === ptrType$3.nil) { return $pkg.ErrInvalid; } return $ifaceNil; }; File.prototype.checkValid = function(op) { return this.$val.checkValid(op); }; ignoringEINTR = function(fn) { var _r$3, err, fn, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; err = $f.err; fn = $f.fn; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* while (true) { */ case 1: _r$3 = fn(); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } err = _r$3; if (!($interfaceIsEqual(err, new syscall.Errno(4)))) { $s = -1; return err; } $s = 1; continue; case 2: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: ignoringEINTR }; } $f._r$3 = _r$3; $f.err = err; $f.fn = fn; $f.$s = $s; $f.$r = $r; return $f; }; File.ptr.prototype.Name = function() { var f; f = this; return f.file.name; }; File.prototype.Name = function() { return this.$val.Name(); }; LinkError.ptr.prototype.Error = function() { var $24r, _r$3, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$3 = $f._r$3; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; _r$3 = e.Err.Error(); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = e.Op + " " + e.Old + " " + e.New + ": " + _r$3; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: LinkError.ptr.prototype.Error }; } $f.$24r = $24r; $f._r$3 = _r$3; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; LinkError.prototype.Error = function() { return this.$val.Error(); }; LinkError.ptr.prototype.Unwrap = function() { var e; e = this; return e.Err; }; LinkError.prototype.Unwrap = function() { return this.$val.Unwrap(); }; File.ptr.prototype.Read = function(b) { var _r$3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, e, err, err$1, f, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _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; err$1 = $f.err$1; f = $f.f; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; f = this; err$1 = f.checkValid("read"); if (!($interfaceIsEqual(err$1, $ifaceNil))) { _tmp = 0; _tmp$1 = err$1; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } _r$3 = f.read(b); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; n = _tuple[0]; e = _tuple[1]; _tmp$2 = n; _tmp$3 = f.wrapErr("read", e); n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Read }; } $f._r$3 = _r$3; $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.err$1 = err$1; $f.f = f; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.Read = function(b) { return this.$val.Read(b); }; File.ptr.prototype.ReadAt = function(b, off) { var _r$3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, e, err, err$1, f, m, n, off, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _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; err$1 = $f.err$1; f = $f.f; m = $f.m; n = $f.n; off = $f.off; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; f = this; err$1 = f.checkValid("read"); if (!($interfaceIsEqual(err$1, $ifaceNil))) { _tmp = 0; _tmp$1 = err$1; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } if ((off.$high < 0 || (off.$high === 0 && off.$low < 0))) { _tmp$2 = 0; _tmp$3 = new fs.PathError.ptr("readat", f.file.name, errors.New("negative offset")); n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; } /* while (true) { */ case 1: /* if (!(b.$length > 0)) { break; } */ if(!(b.$length > 0)) { $s = 2; continue; } _r$3 = f.pread(b, off); /* */ $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; m = _tuple[0]; e = _tuple[1]; if (!($interfaceIsEqual(e, $ifaceNil))) { err = f.wrapErr("read", e); /* break; */ $s = 2; continue; } n = n + (m) >> 0; b = $subslice(b, m); off = (x = (new $Int64(0, m)), new $Int64(off.$high + x.$high, off.$low + x.$low)); $s = 1; continue; case 2: $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.ReadAt }; } $f._r$3 = _r$3; $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.err$1 = err$1; $f.f = f; $f.m = m; $f.n = n; $f.off = off; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.ReadAt = function(b, off) { return this.$val.ReadAt(b, off); }; File.ptr.prototype.ReadFrom = function(r) { var $24r, _r$3, _r$4, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, e, err, err$1, f, handled, n, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$3 = $f._r$3; _r$4 = $f._r$4; _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; e = $f.e; err = $f.err; err$1 = $f.err$1; f = $f.f; handled = $f.handled; n = $f.n; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = new $Int64(0, 0); err = $ifaceNil; f = this; err$1 = f.checkValid("write"); if (!($interfaceIsEqual(err$1, $ifaceNil))) { _tmp = new $Int64(0, 0); _tmp$1 = err$1; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } _r$3 = f.readFrom(r); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; n = _tuple[0]; handled = _tuple[1]; e = _tuple[2]; /* */ if (!handled) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!handled) { */ case 2: _r$4 = genericReadFrom(f, r); /* */ $s = 4; case 4: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$1 = _r$4; n = _tuple$1[0]; err = _tuple$1[1]; $24r = [n, err]; $s = 5; case 5: return $24r; /* } */ case 3: _tmp$2 = n; _tmp$3 = f.wrapErr("write", e); n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.ReadFrom }; } $f.$24r = $24r; $f._r$3 = _r$3; $f._r$4 = _r$4; $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.e = e; $f.err = err; $f.err$1 = err$1; $f.f = f; $f.handled = handled; $f.n = n; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.ReadFrom = function(r) { return this.$val.ReadFrom(r); }; genericReadFrom = function(f, r) { var $24r, _r$3, f, r, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$3 = $f._r$3; f = $f.f; r = $f.r; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$3 = io.Copy((x = new onlyWriter.ptr(f), new x.constructor.elem(x)), r); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = _r$3; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: genericReadFrom }; } $f.$24r = $24r; $f._r$3 = _r$3; $f.f = f; $f.r = r; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; File.ptr.prototype.Write = function(b) { var _r$3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, e, err, err$1, f, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _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; err$1 = $f.err$1; f = $f.f; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; f = this; err$1 = f.checkValid("write"); if (!($interfaceIsEqual(err$1, $ifaceNil))) { _tmp = 0; _tmp$1 = err$1; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } _r$3 = f.write(b); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; n = _tuple[0]; e = _tuple[1]; if (n < 0) { n = 0; } if (!((n === b.$length))) { err = io.ErrShortWrite; } $r = epipecheck(f, e); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (!($interfaceIsEqual(e, $ifaceNil))) { err = f.wrapErr("write", e); } _tmp$2 = n; _tmp$3 = err; n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Write }; } $f._r$3 = _r$3; $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.err$1 = err$1; $f.f = f; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.Write = function(b) { return this.$val.Write(b); }; File.ptr.prototype.WriteAt = function(b, off) { var _r$3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, b, e, err, err$1, f, m, n, off, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _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; b = $f.b; e = $f.e; err = $f.err; err$1 = $f.err$1; f = $f.f; m = $f.m; n = $f.n; off = $f.off; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; f = this; err$1 = f.checkValid("write"); if (!($interfaceIsEqual(err$1, $ifaceNil))) { _tmp = 0; _tmp$1 = err$1; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } if (f.file.appendMode) { _tmp$2 = 0; _tmp$3 = errWriteAtInAppendMode; n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; } if ((off.$high < 0 || (off.$high === 0 && off.$low < 0))) { _tmp$4 = 0; _tmp$5 = new fs.PathError.ptr("writeat", f.file.name, errors.New("negative offset")); n = _tmp$4; err = _tmp$5; $s = -1; return [n, err]; } /* while (true) { */ case 1: /* if (!(b.$length > 0)) { break; } */ if(!(b.$length > 0)) { $s = 2; continue; } _r$3 = f.pwrite(b, off); /* */ $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; m = _tuple[0]; e = _tuple[1]; if (!($interfaceIsEqual(e, $ifaceNil))) { err = f.wrapErr("write", e); /* break; */ $s = 2; continue; } n = n + (m) >> 0; b = $subslice(b, m); off = (x = (new $Int64(0, m)), new $Int64(off.$high + x.$high, off.$low + x.$low)); $s = 1; continue; case 2: $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.WriteAt }; } $f._r$3 = _r$3; $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.b = b; $f.e = e; $f.err = err; $f.err$1 = err$1; $f.f = f; $f.m = m; $f.n = n; $f.off = off; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.WriteAt = function(b, off) { return this.$val.WriteAt(b, off); }; File.ptr.prototype.Seek = function(offset, whence) { var _r$3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, e, err, err$1, f, offset, r, ret, whence, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _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; e = $f.e; err = $f.err; err$1 = $f.err$1; f = $f.f; offset = $f.offset; r = $f.r; ret = $f.ret; whence = $f.whence; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ret = new $Int64(0, 0); err = $ifaceNil; f = this; err$1 = f.checkValid("seek"); if (!($interfaceIsEqual(err$1, $ifaceNil))) { _tmp = new $Int64(0, 0); _tmp$1 = err$1; ret = _tmp; err = _tmp$1; $s = -1; return [ret, err]; } _r$3 = f.seek(offset, whence); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; r = _tuple[0]; e = _tuple[1]; if ($interfaceIsEqual(e, $ifaceNil) && !(f.file.dirinfo === ptrType$9.nil) && !((r.$high === 0 && r.$low === 0))) { e = new syscall.Errno(21); } if (!($interfaceIsEqual(e, $ifaceNil))) { _tmp$2 = new $Int64(0, 0); _tmp$3 = f.wrapErr("seek", e); ret = _tmp$2; err = _tmp$3; $s = -1; return [ret, err]; } _tmp$4 = r; _tmp$5 = $ifaceNil; ret = _tmp$4; err = _tmp$5; $s = -1; return [ret, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Seek }; } $f._r$3 = _r$3; $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.e = e; $f.err = err; $f.err$1 = err$1; $f.f = f; $f.offset = offset; $f.r = r; $f.ret = ret; $f.whence = whence; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.Seek = function(offset, whence) { return this.$val.Seek(offset, whence); }; setStickyBit = function(name) { var $24r, _arg, _arg$1, _r$3, _r$4, _r$5, _tuple, err, fi, name, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _arg = $f._arg; _arg$1 = $f._arg$1; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _tuple = $f._tuple; err = $f.err; fi = $f.fi; name = $f.name; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$3 = Stat(name); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; fi = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _arg = name; _r$4 = fi.Mode(); /* */ $s = 2; case 2: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _arg$1 = (_r$4 | 1048576) >>> 0; _r$5 = Chmod(_arg, _arg$1); /* */ $s = 3; case 3: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $24r = _r$5; $s = 4; case 4: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: setStickyBit }; } $f.$24r = $24r; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._tuple = _tuple; $f.err = err; $f.fi = fi; $f.name = name; $f.$s = $s; $f.$r = $r; return $f; }; Open = function(name) { var $24r, _r$3, name, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$3 = $f._r$3; name = $f.name; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$3 = OpenFile(name, 0, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = _r$3; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Open }; } $f.$24r = $24r; $f._r$3 = _r$3; $f.name = name; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Open = Open; OpenFile = function(name, flag, perm) { var _r$3, _tuple, err, f, flag, name, perm, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _tuple = $f._tuple; err = $f.err; f = $f.f; flag = $f.flag; name = $f.name; perm = $f.perm; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = testlog.Open(name); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$3 = openFileNolog(name, flag, perm); /* */ $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; f = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$3.nil, err]; } f.file.appendMode = !(((flag & 1024) === 0)); $s = -1; return [f, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: OpenFile }; } $f._r$3 = _r$3; $f._tuple = _tuple; $f.err = err; $f.f = f; $f.flag = flag; $f.name = name; $f.perm = perm; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.OpenFile = OpenFile; File.ptr.prototype.wrapErr = function(op, err) { var err, f, op; f = this; if ($interfaceIsEqual(err, $ifaceNil) || $interfaceIsEqual(err, io.EOF)) { return err; } if ($interfaceIsEqual(err, poll.ErrFileClosing)) { err = $pkg.ErrClosed; } return new fs.PathError.ptr(op, f.file.name, err); }; File.prototype.wrapErr = function(op, err) { return this.$val.wrapErr(op, err); }; TempDir = function() { var $24r, _r$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$3 = $f._r$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$3 = tempDir(); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = _r$3; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: TempDir }; } $f.$24r = $24r; $f._r$3 = _r$3; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.TempDir = TempDir; Chmod = function(name, mode) { var $24r, _r$3, mode, name, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$3 = $f._r$3; mode = $f.mode; name = $f.name; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$3 = chmod(name, mode); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = _r$3; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Chmod }; } $f.$24r = $24r; $f._r$3 = _r$3; $f.mode = mode; $f.name = name; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Chmod = Chmod; File.ptr.prototype.Chmod = function(mode) { var $24r, _r$3, f, mode, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$3 = $f._r$3; f = $f.f; mode = $f.mode; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; _r$3 = f.chmod(mode); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = _r$3; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Chmod }; } $f.$24r = $24r; $f._r$3 = _r$3; $f.f = f; $f.mode = mode; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.Chmod = function(mode) { return this.$val.Chmod(mode); }; File.ptr.prototype.SetDeadline = function(t) { var f, t; f = this; return f.setDeadline($clone(t, time.Time)); }; File.prototype.SetDeadline = function(t) { return this.$val.SetDeadline(t); }; File.ptr.prototype.SetReadDeadline = function(t) { var f, t; f = this; return f.setReadDeadline($clone(t, time.Time)); }; File.prototype.SetReadDeadline = function(t) { return this.$val.SetReadDeadline(t); }; File.ptr.prototype.SetWriteDeadline = function(t) { var f, t; f = this; return f.setWriteDeadline($clone(t, time.Time)); }; File.prototype.SetWriteDeadline = function(t) { return this.$val.SetWriteDeadline(t); }; File.ptr.prototype.SyscallConn = function() { var _returncast, err, f; f = this; err = f.checkValid("SyscallConn"); if (!($interfaceIsEqual(err, $ifaceNil))) { return [$ifaceNil, err]; } _returncast = newRawConn(f); return [_returncast[0], _returncast[1]]; }; File.prototype.SyscallConn = function() { return this.$val.SyscallConn(); }; ReadFile = function(name) { var $24r, $24r$1, _r$3, _r$4, _r$5, _r$6, _tuple, _tuple$1, _tuple$2, d, data, err, err$1, err$2, f, info, n, name, size, size64, x, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _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; d = $f.d; data = $f.data; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; f = $f.f; info = $f.info; n = $f.n; name = $f.name; size = $f.size; size64 = $f.size64; x = $f.x; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); _r$3 = Open(name); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; f = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $24r = [sliceType$2.nil, err]; $s = 4; case 4: return $24r; /* } */ case 3: $deferred.push([$methodVal(f, "Close"), []]); size = 0; _r$4 = f.Stat(); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$1 = _r$4; info = _tuple$1[0]; err$1 = _tuple$1[1]; /* */ if ($interfaceIsEqual(err$1, $ifaceNil)) { $s = 6; continue; } /* */ $s = 7; continue; /* if ($interfaceIsEqual(err$1, $ifaceNil)) { */ case 6: _r$5 = info.Size(); /* */ $s = 8; case 8: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } size64 = _r$5; if ((x = (new $Int64(0, (((size64.$low + ((size64.$high >> 31) * 4294967296)) >> 0)))), (x.$high === size64.$high && x.$low === size64.$low))) { size = (((size64.$low + ((size64.$high >> 31) * 4294967296)) >> 0)); } /* } */ case 7: size = size + (1) >> 0; if (size < 512) { size = 512; } data = $makeSlice(sliceType$2, 0, size); /* while (true) { */ case 9: if (data.$length >= data.$capacity) { d = $append($subslice(data, 0, data.$capacity), 0); data = $subslice(d, 0, data.$length); } _r$6 = f.Read($subslice(data, data.$length, data.$capacity)); /* */ $s = 11; case 11: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tuple$2 = _r$6; n = _tuple$2[0]; err$2 = _tuple$2[1]; data = $subslice(data, 0, (data.$length + n >> 0)); /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 12; continue; } /* */ $s = 13; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 12: if ($interfaceIsEqual(err$2, io.EOF)) { err$2 = $ifaceNil; } $24r$1 = [data, err$2]; $s = 14; case 14: return $24r$1; /* } */ case 13: $s = 9; continue; case 10: $s = -1; return [sliceType$2.nil, $ifaceNil]; /* */ } return; } } catch(err) { $err = err; $s = -1; return [sliceType$2.nil, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: ReadFile }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $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.d = d; $f.data = data; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.f = f; $f.info = info; $f.n = n; $f.name = name; $f.size = size; $f.size64 = size64; $f.x = x; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; $pkg.ReadFile = ReadFile; errNoDeadline = function() { return poll.ErrNoDeadline; }; errDeadlineExceeded = function() { return poll.ErrDeadlineExceeded; }; SyscallError.ptr.prototype.Error = function() { var $24r, _r$3, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$3 = $f._r$3; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; _r$3 = e.Err.Error(); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = e.Syscall + ": " + _r$3; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: SyscallError.ptr.prototype.Error }; } $f.$24r = $24r; $f._r$3 = _r$3; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; SyscallError.prototype.Error = function() { return this.$val.Error(); }; SyscallError.ptr.prototype.Unwrap = function() { var e; e = this; return e.Err; }; SyscallError.prototype.Unwrap = function() { return this.$val.Unwrap(); }; SyscallError.ptr.prototype.Timeout = function() { var $24r, _r$3, _tuple, _v, e, ok, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$3 = $f._r$3; _tuple = $f._tuple; _v = $f._v; e = $f.e; ok = $f.ok; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; _tuple = $assertType(e.Err, timeout, true); t = _tuple[0]; ok = _tuple[1]; if (!(ok)) { _v = false; $s = 1; continue s; } _r$3 = t.Timeout(); /* */ $s = 2; case 2: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _v = _r$3; case 1: $24r = _v; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: SyscallError.ptr.prototype.Timeout }; } $f.$24r = $24r; $f._r$3 = _r$3; $f._tuple = _tuple; $f._v = _v; $f.e = e; $f.ok = ok; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; SyscallError.prototype.Timeout = function() { return this.$val.Timeout(); }; NewSyscallError = function(syscall$1, err) { var err, syscall$1; if ($interfaceIsEqual(err, $ifaceNil)) { return $ifaceNil; } return new SyscallError.ptr(syscall$1, err); }; $pkg.NewSyscallError = NewSyscallError; IsExist = function(err) { var err; return underlyingErrorIs(err, $pkg.ErrExist); }; $pkg.IsExist = IsExist; IsNotExist = function(err) { var err; return underlyingErrorIs(err, $pkg.ErrNotExist); }; $pkg.IsNotExist = IsNotExist; IsPermission = function(err) { var err; return underlyingErrorIs(err, $pkg.ErrPermission); }; $pkg.IsPermission = IsPermission; underlyingErrorIs = function(err, target) { var _tuple, e, err, ok, target; err = underlyingError(err); if ($interfaceIsEqual(err, target)) { return true; } _tuple = $assertType(err, syscall.Errno, true); e = _tuple[0]; ok = _tuple[1]; return ok && new syscall.Errno(e).Is(target); }; underlyingError = function(err) { var _ref, err, err$1, err$2, err$3; _ref = err; if ($assertType(_ref, ptrType$6, true)[1]) { err$1 = _ref.$val; return err$1.Err; } else if ($assertType(_ref, ptrType$18, true)[1]) { err$2 = _ref.$val; return err$2.Err; } else if ($assertType(_ref, ptrType$19, true)[1]) { err$3 = _ref.$val; return err$3.Err; } return err; }; Getenv = function(key) { var _r$3, _tuple, key, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _tuple = $f._tuple; key = $f.key; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = testlog.Getenv(key); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$3 = syscall.Getenv(key); /* */ $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; v = _tuple[0]; $s = -1; return v; /* */ } return; } if ($f === undefined) { $f = { $blk: Getenv }; } $f._r$3 = _r$3; $f._tuple = _tuple; $f.key = key; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Getenv = Getenv; direntIno = function(buf) { var buf; return readInt(buf, 0, 8); }; direntReclen = function(buf) { var buf; return readInt(buf, 16, 2); }; direntNamlen = function(buf) { var _tuple, buf, ok, reclen; _tuple = direntReclen(buf); reclen = _tuple[0]; ok = _tuple[1]; if (!ok) { return [new $Uint64(0, 0), false]; } return [new $Uint64(reclen.$high - 0, reclen.$low - 19), true]; }; direntType = function(buf) { var _1, buf, off, typ; off = 18; if (off >= ((buf.$length >>> 0))) { return 4294967295; } typ = ((off < 0 || off >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + off]); _1 = typ; if (_1 === (6)) { return 67108864; } else if (_1 === (2)) { return 69206016; } else if (_1 === (4)) { return 2147483648; } else if (_1 === (1)) { return 33554432; } else if (_1 === (10)) { return 134217728; } else if (_1 === (8)) { return 0; } else if (_1 === (12)) { return 16777216; } return 4294967295; }; dirInfo.ptr.prototype.close = function() { var d; d = this; if (!(d.buf === ptrType.nil)) { dirBufPool.Put(d.buf); d.buf = ptrType.nil; } }; dirInfo.prototype.close = function() { return this.$val.close(); }; File.ptr.prototype.readdir = function(n, mode) { var _i, _r$3, _r$4, _r$5, _r$6, _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$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, buf, c, d, de, dirents, err, err$1, err$2, errno, f, i, info, infos, ino, mode, n, name, names, namlen, ok, rec, reclen, x, x$1, x$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _ref = $f._ref; _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$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _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 = $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; buf = $f.buf; c = $f.c; d = $f.d; de = $f.de; dirents = $f.dirents; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; errno = $f.errno; f = $f.f; i = $f.i; info = $f.info; infos = $f.infos; ino = $f.ino; mode = $f.mode; n = $f.n; name = $f.name; names = $f.names; namlen = $f.namlen; ok = $f.ok; rec = $f.rec; reclen = $f.reclen; 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: names = sliceType.nil; dirents = sliceType$8.nil; infos = sliceType$9.nil; err = $ifaceNil; f = this; /* */ if (f.file.dirinfo === ptrType$9.nil) { $s = 1; continue; } /* */ $s = 2; continue; /* if (f.file.dirinfo === ptrType$9.nil) { */ case 1: f.file.dirinfo = new dirInfo.ptr(ptrType.nil, 0, 0); _r$3 = dirBufPool.Get(); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } f.file.dirinfo.buf = $assertType(_r$3, ptrType); /* } */ case 2: d = f.file.dirinfo; if (n === 0) { n = -1; } /* while (true) { */ case 4: /* if (!(!((n === 0)))) { break; } */ if(!(!((n === 0)))) { $s = 5; continue; } /* */ if (d.bufp >= d.nbuf) { $s = 6; continue; } /* */ $s = 7; continue; /* if (d.bufp >= d.nbuf) { */ case 6: d.bufp = 0; errno = $ifaceNil; _r$4 = f.file.pfd.ReadDirent(d.buf.$get()); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple = _r$4; d.nbuf = _tuple[0]; errno = _tuple[1]; runtime.KeepAlive(f); if (!($interfaceIsEqual(errno, $ifaceNil))) { _tmp = names; _tmp$1 = dirents; _tmp$2 = infos; _tmp$3 = new fs.PathError.ptr("readdirent", f.file.name, errno); names = _tmp; dirents = _tmp$1; infos = _tmp$2; err = _tmp$3; $s = -1; return [names, dirents, infos, err]; } if (d.nbuf <= 0) { /* break; */ $s = 5; continue; } /* } */ case 7: buf = $subslice((d.buf.$get()), d.bufp, d.nbuf); _tuple$1 = direntReclen(buf); reclen = _tuple$1[0]; ok = _tuple$1[1]; if (!ok || (x = (new $Uint64(0, buf.$length)), (reclen.$high > x.$high || (reclen.$high === x.$high && reclen.$low > x.$low)))) { /* break; */ $s = 5; continue; } rec = $subslice(buf, 0, $flatten64(reclen)); d.bufp = d.bufp + (((reclen.$low >> 0))) >> 0; _tuple$2 = direntIno(rec); ino = _tuple$2[0]; ok = _tuple$2[1]; if (!ok) { /* break; */ $s = 5; continue; } if ((ino.$high === 0 && ino.$low === 0)) { /* continue; */ $s = 4; continue; } _tuple$3 = direntNamlen(rec); namlen = _tuple$3[0]; ok = _tuple$3[1]; if (!ok || (x$1 = new $Uint64(0 + namlen.$high, 19 + namlen.$low), x$2 = (new $Uint64(0, rec.$length)), (x$1.$high > x$2.$high || (x$1.$high === x$2.$high && x$1.$low > x$2.$low)))) { /* break; */ $s = 5; continue; } name = $subslice(rec, 19, $flatten64(new $Uint64(0 + namlen.$high, 19 + namlen.$low))); _ref = name; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; c = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (c === 0) { name = $subslice(name, 0, i); break; } _i++; } if (($bytesToString(name)) === "." || ($bytesToString(name)) === "..") { /* continue; */ $s = 4; continue; } if (n > 0) { n = n - (1) >> 0; } /* */ if (mode === 0) { $s = 9; continue; } /* */ if (mode === 1) { $s = 10; continue; } /* */ $s = 11; continue; /* if (mode === 0) { */ case 9: names = $append(names, ($bytesToString(name))); $s = 12; continue; /* } else if (mode === 1) { */ case 10: _r$5 = newUnixDirent(f.file.name, ($bytesToString(name)), direntType(rec)); /* */ $s = 13; case 13: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$4 = _r$5; de = _tuple$4[0]; err$1 = _tuple$4[1]; if (IsNotExist(err$1)) { /* continue; */ $s = 4; continue; } if (!($interfaceIsEqual(err$1, $ifaceNil))) { _tmp$4 = sliceType.nil; _tmp$5 = dirents; _tmp$6 = sliceType$9.nil; _tmp$7 = err$1; names = _tmp$4; dirents = _tmp$5; infos = _tmp$6; err = _tmp$7; $s = -1; return [names, dirents, infos, err]; } dirents = $append(dirents, de); $s = 12; continue; /* } else { */ case 11: _r$6 = lstat(f.file.name + "/" + ($bytesToString(name))); /* */ $s = 14; case 14: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tuple$5 = _r$6; info = _tuple$5[0]; err$2 = _tuple$5[1]; if (IsNotExist(err$2)) { /* continue; */ $s = 4; continue; } if (!($interfaceIsEqual(err$2, $ifaceNil))) { _tmp$8 = sliceType.nil; _tmp$9 = sliceType$8.nil; _tmp$10 = infos; _tmp$11 = err$2; names = _tmp$8; dirents = _tmp$9; infos = _tmp$10; err = _tmp$11; $s = -1; return [names, dirents, infos, err]; } infos = $append(infos, info); /* } */ case 12: $s = 4; continue; case 5: if (n > 0 && (((names.$length + dirents.$length >> 0) + infos.$length >> 0) === 0)) { _tmp$12 = sliceType.nil; _tmp$13 = sliceType$8.nil; _tmp$14 = sliceType$9.nil; _tmp$15 = io.EOF; names = _tmp$12; dirents = _tmp$13; infos = _tmp$14; err = _tmp$15; $s = -1; return [names, dirents, infos, err]; } _tmp$16 = names; _tmp$17 = dirents; _tmp$18 = infos; _tmp$19 = $ifaceNil; names = _tmp$16; dirents = _tmp$17; infos = _tmp$18; err = _tmp$19; $s = -1; return [names, dirents, infos, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.readdir }; } $f._i = _i; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._ref = _ref; $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$3 = _tmp$3; $f._tmp$4 = _tmp$4; $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 = _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.buf = buf; $f.c = c; $f.d = d; $f.de = de; $f.dirents = dirents; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.errno = errno; $f.f = f; $f.i = i; $f.info = info; $f.infos = infos; $f.ino = ino; $f.mode = mode; $f.n = n; $f.name = name; $f.names = names; $f.namlen = namlen; $f.ok = ok; $f.rec = rec; $f.reclen = reclen; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.readdir = function(n, mode) { return this.$val.readdir(n, mode); }; readInt = function(b, off, size) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, b, off, ok, size, u; u = new $Uint64(0, 0); ok = false; if (b.$length < (((off + size >>> 0) >> 0))) { _tmp = new $Uint64(0, 0); _tmp$1 = false; u = _tmp; ok = _tmp$1; return [u, ok]; } if (false) { _tmp$2 = readIntBE($subslice(b, off), size); _tmp$3 = true; u = _tmp$2; ok = _tmp$3; return [u, ok]; } _tmp$4 = readIntLE($subslice(b, off), size); _tmp$5 = true; u = _tmp$4; ok = _tmp$5; return [u, ok]; }; readIntBE = function(b, size) { var _1, b, size, 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$3, x$4, x$5, x$6, x$7, x$8, x$9; _1 = size; if (_1 === (1)) { return (new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))); } else if (_1 === (2)) { $unused((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1])); return (x = (new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), x$1 = $shiftLeft64((new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), 8), new $Uint64(x.$high | x$1.$high, (x.$low | x$1.$low) >>> 0)); } else if (_1 === (4)) { $unused((3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3])); return (x$2 = (x$3 = (x$4 = (new $Uint64(0, (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]))), x$5 = $shiftLeft64((new $Uint64(0, (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]))), 8), new $Uint64(x$4.$high | x$5.$high, (x$4.$low | x$5.$low) >>> 0)), x$6 = $shiftLeft64((new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), 16), new $Uint64(x$3.$high | x$6.$high, (x$3.$low | x$6.$low) >>> 0)), x$7 = $shiftLeft64((new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), 24), new $Uint64(x$2.$high | x$7.$high, (x$2.$low | x$7.$low) >>> 0)); } else if (_1 === (8)) { $unused((7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7])); return (x$8 = (x$9 = (x$10 = (x$11 = (x$12 = (x$13 = (x$14 = (new $Uint64(0, (7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7]))), x$15 = $shiftLeft64((new $Uint64(0, (6 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 6]))), 8), new $Uint64(x$14.$high | x$15.$high, (x$14.$low | x$15.$low) >>> 0)), x$16 = $shiftLeft64((new $Uint64(0, (5 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 5]))), 16), new $Uint64(x$13.$high | x$16.$high, (x$13.$low | x$16.$low) >>> 0)), x$17 = $shiftLeft64((new $Uint64(0, (4 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 4]))), 24), new $Uint64(x$12.$high | x$17.$high, (x$12.$low | x$17.$low) >>> 0)), x$18 = $shiftLeft64((new $Uint64(0, (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]))), 32), new $Uint64(x$11.$high | x$18.$high, (x$11.$low | x$18.$low) >>> 0)), x$19 = $shiftLeft64((new $Uint64(0, (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]))), 40), new $Uint64(x$10.$high | x$19.$high, (x$10.$low | x$19.$low) >>> 0)), x$20 = $shiftLeft64((new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), 48), new $Uint64(x$9.$high | x$20.$high, (x$9.$low | x$20.$low) >>> 0)), x$21 = $shiftLeft64((new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), 56), new $Uint64(x$8.$high | x$21.$high, (x$8.$low | x$21.$low) >>> 0)); } else { $panic(new $String("syscall: readInt with unsupported size")); } }; readIntLE = function(b, size) { var _1, b, size, 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$3, x$4, x$5, x$6, x$7, x$8, x$9; _1 = size; if (_1 === (1)) { return (new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))); } else if (_1 === (2)) { $unused((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1])); return (x = (new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), x$1 = $shiftLeft64((new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), 8), new $Uint64(x.$high | x$1.$high, (x.$low | x$1.$low) >>> 0)); } else if (_1 === (4)) { $unused((3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3])); return (x$2 = (x$3 = (x$4 = (new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), x$5 = $shiftLeft64((new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), 8), new $Uint64(x$4.$high | x$5.$high, (x$4.$low | x$5.$low) >>> 0)), x$6 = $shiftLeft64((new $Uint64(0, (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]))), 16), new $Uint64(x$3.$high | x$6.$high, (x$3.$low | x$6.$low) >>> 0)), x$7 = $shiftLeft64((new $Uint64(0, (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]))), 24), new $Uint64(x$2.$high | x$7.$high, (x$2.$low | x$7.$low) >>> 0)); } else if (_1 === (8)) { $unused((7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7])); return (x$8 = (x$9 = (x$10 = (x$11 = (x$12 = (x$13 = (x$14 = (new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), x$15 = $shiftLeft64((new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), 8), new $Uint64(x$14.$high | x$15.$high, (x$14.$low | x$15.$low) >>> 0)), x$16 = $shiftLeft64((new $Uint64(0, (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]))), 16), new $Uint64(x$13.$high | x$16.$high, (x$13.$low | x$16.$low) >>> 0)), x$17 = $shiftLeft64((new $Uint64(0, (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]))), 24), new $Uint64(x$12.$high | x$17.$high, (x$12.$low | x$17.$low) >>> 0)), x$18 = $shiftLeft64((new $Uint64(0, (4 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 4]))), 32), new $Uint64(x$11.$high | x$18.$high, (x$11.$low | x$18.$low) >>> 0)), x$19 = $shiftLeft64((new $Uint64(0, (5 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 5]))), 40), new $Uint64(x$10.$high | x$19.$high, (x$10.$low | x$19.$low) >>> 0)), x$20 = $shiftLeft64((new $Uint64(0, (6 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 6]))), 48), new $Uint64(x$9.$high | x$20.$high, (x$9.$low | x$20.$low) >>> 0)), x$21 = $shiftLeft64((new $Uint64(0, (7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7]))), 56), new $Uint64(x$8.$high | x$21.$high, (x$8.$low | x$21.$low) >>> 0)); } else { $panic(new $String("syscall: readInt with unsupported size")); } }; File.ptr.prototype.Readdir = function(n) { var _r$3, _tuple, err, f, infos, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _tuple = $f._tuple; err = $f.err; f = $f.f; infos = $f.infos; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; if (f === ptrType$3.nil) { $s = -1; return [sliceType$9.nil, $pkg.ErrInvalid]; } _r$3 = f.readdir(n, 2); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; infos = _tuple[2]; err = _tuple[3]; if (infos === sliceType$9.nil) { infos = new sliceType$9([]); } $s = -1; return [infos, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Readdir }; } $f._r$3 = _r$3; $f._tuple = _tuple; $f.err = err; $f.f = f; $f.infos = infos; $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 _r$3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, err, f, n, names, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; err = $f.err; f = $f.f; n = $f.n; names = $f.names; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: names = sliceType.nil; err = $ifaceNil; f = this; if (f === ptrType$3.nil) { _tmp = sliceType.nil; _tmp$1 = $pkg.ErrInvalid; names = _tmp; err = _tmp$1; $s = -1; return [names, err]; } _r$3 = f.readdir(n, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; names = _tuple[0]; err = _tuple[3]; if (names === sliceType.nil) { names = new sliceType([]); } _tmp$2 = names; _tmp$3 = err; names = _tmp$2; err = _tmp$3; $s = -1; return [names, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Readdirnames }; } $f._r$3 = _r$3; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f.err = err; $f.f = f; $f.n = n; $f.names = names; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.Readdirnames = function(n) { return this.$val.Readdirnames(n); }; File.ptr.prototype.ReadDir = function(n) { var _r$3, _tuple, dirents, err, f, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _tuple = $f._tuple; dirents = $f.dirents; err = $f.err; f = $f.f; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; if (f === ptrType$3.nil) { $s = -1; return [sliceType$8.nil, $pkg.ErrInvalid]; } _r$3 = f.readdir(n, 1); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; dirents = _tuple[1]; err = _tuple[3]; if (dirents === sliceType$8.nil) { dirents = new sliceType$8([]); } $s = -1; return [dirents, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.ReadDir }; } $f._r$3 = _r$3; $f._tuple = _tuple; $f.dirents = dirents; $f.err = err; $f.f = f; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.ReadDir = function(n) { return this.$val.ReadDir(n); }; ptrType$2.methods = [{prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Mode", name: "Mode", pkg: "", typ: $funcType([], [fs.FileMode], false)}, {prop: "ModTime", name: "ModTime", pkg: "", typ: $funcType([], [time.Time], false)}, {prop: "Sys", name: "Sys", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "IsDir", name: "IsDir", pkg: "", typ: $funcType([], [$Bool], false)}]; ptrType$3.methods = [{prop: "Stat", name: "Stat", pkg: "", typ: $funcType([], [fs.FileInfo, $error], false)}, {prop: "readFrom", name: "readFrom", pkg: "os", typ: $funcType([io.Reader], [$Int64, $Bool, $error], false)}, {prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([$String], [$Int, $error], false)}, {prop: "Fd", name: "Fd", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "seek", name: "seek", pkg: "os", typ: $funcType([$Int64, $Int], [$Int64, $error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "read", name: "read", pkg: "os", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "pread", name: "pread", pkg: "os", typ: $funcType([sliceType$2, $Int64], [$Int, $error], false)}, {prop: "write", name: "write", pkg: "os", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "pwrite", name: "pwrite", pkg: "os", typ: $funcType([sliceType$2, $Int64], [$Int, $error], false)}, {prop: "chmod", name: "chmod", pkg: "os", typ: $funcType([fs.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: "Chdir", name: "Chdir", pkg: "", typ: $funcType([], [$error], false)}, {prop: "setDeadline", name: "setDeadline", pkg: "os", typ: $funcType([time.Time], [$error], false)}, {prop: "setReadDeadline", name: "setReadDeadline", pkg: "os", typ: $funcType([time.Time], [$error], false)}, {prop: "setWriteDeadline", name: "setWriteDeadline", pkg: "os", typ: $funcType([time.Time], [$error], false)}, {prop: "checkValid", name: "checkValid", pkg: "os", typ: $funcType([$String], [$error], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "ReadAt", name: "ReadAt", pkg: "", typ: $funcType([sliceType$2, $Int64], [$Int, $error], false)}, {prop: "ReadFrom", name: "ReadFrom", pkg: "", typ: $funcType([io.Reader], [$Int64, $error], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "WriteAt", name: "WriteAt", pkg: "", typ: $funcType([sliceType$2, $Int64], [$Int, $error], false)}, {prop: "Seek", name: "Seek", pkg: "", typ: $funcType([$Int64, $Int], [$Int64, $error], false)}, {prop: "wrapErr", name: "wrapErr", pkg: "os", typ: $funcType([$String, $error], [$error], false)}, {prop: "Chmod", name: "Chmod", pkg: "", typ: $funcType([fs.FileMode], [$error], false)}, {prop: "SetDeadline", name: "SetDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "SetReadDeadline", name: "SetReadDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "SetWriteDeadline", name: "SetWriteDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "SyscallConn", name: "SyscallConn", pkg: "", typ: $funcType([], [syscall.RawConn, $error], false)}, {prop: "readdir", name: "readdir", pkg: "os", typ: $funcType([$Int, readdirMode], [sliceType, sliceType$8, sliceType$9, $error], false)}, {prop: "Readdir", name: "Readdir", pkg: "", typ: $funcType([$Int], [sliceType$9, $error], false)}, {prop: "Readdirnames", name: "Readdirnames", pkg: "", typ: $funcType([$Int], [sliceType, $error], false)}, {prop: "ReadDir", name: "ReadDir", pkg: "", typ: $funcType([$Int], [sliceType$8, $error], false)}]; ptrType$20.methods = [{prop: "Control", name: "Control", pkg: "", typ: $funcType([funcType$2], [$error], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([funcType$3], [$error], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([funcType$3], [$error], false)}]; ptrType$10.methods = [{prop: "close", name: "close", pkg: "os", typ: $funcType([], [$error], false)}]; ptrType$21.methods = [{prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "IsDir", name: "IsDir", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Type", name: "Type", pkg: "", typ: $funcType([], [fs.FileMode], false)}, {prop: "Info", name: "Info", pkg: "", typ: $funcType([], [fs.FileInfo, $error], false)}]; ptrType$18.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Unwrap", name: "Unwrap", pkg: "", typ: $funcType([], [$error], false)}]; ptrType$19.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Unwrap", name: "Unwrap", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}]; ptrType$9.methods = [{prop: "close", name: "close", pkg: "os", typ: $funcType([], [], false)}]; fileStat.init("os", [{prop: "name", name: "name", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "size", name: "size", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "mode", name: "mode", embedded: false, exported: false, typ: fs.FileMode, tag: ""}, {prop: "modTime", name: "modTime", embedded: false, exported: false, typ: time.Time, tag: ""}, {prop: "sys", name: "sys", embedded: false, exported: false, typ: syscall.Stat_t, tag: ""}]); File.init("os", [{prop: "file", name: "file", embedded: true, exported: false, typ: ptrType$10, tag: ""}]); rawConn.init("os", [{prop: "file", name: "file", embedded: false, exported: false, typ: ptrType$3, tag: ""}]); file.init("os", [{prop: "pfd", name: "pfd", embedded: false, exported: false, typ: poll.FD, tag: ""}, {prop: "name", name: "name", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "dirinfo", name: "dirinfo", embedded: false, exported: false, typ: ptrType$9, tag: ""}, {prop: "nonblock", name: "nonblock", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "stdoutOrErr", name: "stdoutOrErr", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "appendMode", name: "appendMode", embedded: false, exported: false, typ: $Bool, tag: ""}]); unixDirent.init("os", [{prop: "parent", name: "parent", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "name", name: "name", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "typ", name: "typ", embedded: false, exported: false, typ: fs.FileMode, tag: ""}, {prop: "info", name: "info", embedded: false, exported: false, typ: fs.FileInfo, tag: ""}]); LinkError.init("", [{prop: "Op", name: "Op", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Old", name: "Old", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "New", name: "New", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Err", name: "Err", embedded: false, exported: true, typ: $error, tag: ""}]); onlyWriter.init("", [{prop: "Writer", name: "Writer", embedded: true, exported: true, typ: io.Writer, tag: ""}]); timeout.init([{prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}]); SyscallError.init("", [{prop: "Syscall", name: "Syscall", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Err", name: "Err", embedded: false, exported: true, typ: $error, tag: ""}]); dirInfo.init("os", [{prop: "buf", name: "buf", embedded: false, exported: false, typ: ptrType, tag: ""}, {prop: "nbuf", name: "nbuf", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "bufp", name: "bufp", embedded: false, exported: false, typ: $Int, tag: ""}]); $pkg.$initLinknames = function() { fastrand = $linknames["runtime.fastrand"]; }; $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 = itoa.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = oserror.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = poll.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = execenv.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = unix.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = testlog.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = unsafeheader.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = io.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = fs.$init(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = runtime.$init(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sort.$init(); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sync.$init(); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = atomic.$init(); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = syscall.$init(); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = time.$init(); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $pkg.Args = sliceType.nil; testingForceReadDirLstat = false; errPatternHasSeparator = errors.New("pattern contains path separator"); pollCopyFileRange = poll.CopyFileRange; errWriteAtInAppendMode = errors.New("os: invalid use of WriteAt on file opened with O_APPEND"); lstat = Lstat; $pkg.ErrProcessDone = errors.New("os: process already finished"); $pkg.ErrInvalid = fs.ErrInvalid; $pkg.ErrPermission = fs.ErrPermission; $pkg.ErrExist = fs.ErrExist; $pkg.ErrNotExist = fs.ErrNotExist; $pkg.ErrClosed = fs.ErrClosed; $pkg.ErrNoDeadline = errNoDeadline(); $pkg.ErrDeadlineExceeded = errDeadlineExceeded(); dirBufPool = new sync.Pool.ptr(sliceType$1.nil, (function() { var buf, buf$24ptr; buf = $makeSlice(sliceType$2, 8192); return (buf$24ptr || (buf$24ptr = new ptrType(function() { return buf; }, function($v) { buf = $convertSliceType($v, sliceType$2); }))); })); _r = NewFile(((syscall.Stdin >>> 0)), "/dev/stdin"); /* */ $s = 18; case 18: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $pkg.Stdin = _r; _r$1 = NewFile(((syscall.Stdout >>> 0)), "/dev/stdout"); /* */ $s = 19; case 19: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $pkg.Stdout = _r$1; _r$2 = NewFile(((syscall.Stderr >>> 0)), "/dev/stderr"); /* */ $s = 20; case 20: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $pkg.Stderr = _r$2; 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, fmtsort, io, math, os, reflect, strconv, sync, utf8, ScanState, scanError, ss, ssave, State, Formatter, Stringer, GoStringer, buffer, pp, fmtFlags, fmt, wrapError, arrayType, sliceType, sliceType$1, ptrType, ptrType$1, arrayType$1, sliceType$2, ptrType$4, ptrType$24, arrayType$3, funcType, ptrType$26, ptrType$27, space, ssFree, complexError, boolError, ppFree, isSpace, notSpace, indexRune, newPrinter, Fprintf, Sprintf, Fprint, Sprint, Fprintln, Println, Sprintln, getField, tooLarge, parsenum, intFromArg, parseArgNumber, Errorf; errors = $packages["errors"]; fmtsort = $packages["internal/fmtsort"]; io = $packages["io"]; math = $packages["math"]; os = $packages["os"]; reflect = $packages["reflect"]; strconv = $packages["strconv"]; sync = $packages["sync"]; utf8 = $packages["unicode/utf8"]; ScanState = $pkg.ScanState = $newType(8, $kindInterface, "fmt.ScanState", true, "fmt", true, null); scanError = $pkg.scanError = $newType(0, $kindStruct, "fmt.scanError", true, "fmt", false, function(err_) { this.$val = this; if (arguments.length === 0) { this.err = $ifaceNil; return; } this.err = err_; }); ss = $pkg.ss = $newType(0, $kindStruct, "fmt.ss", true, "fmt", false, function(rs_, buf_, count_, atEOF_, ssave_) { this.$val = this; if (arguments.length === 0) { this.rs = $ifaceNil; this.buf = buffer.nil; this.count = 0; this.atEOF = false; this.ssave = new ssave.ptr(false, false, false, 0, 0, 0); return; } this.rs = rs_; this.buf = buf_; this.count = count_; this.atEOF = atEOF_; this.ssave = ssave_; }); ssave = $pkg.ssave = $newType(0, $kindStruct, "fmt.ssave", true, "fmt", false, 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_; }); State = $pkg.State = $newType(8, $kindInterface, "fmt.State", true, "fmt", true, null); Formatter = $pkg.Formatter = $newType(8, $kindInterface, "fmt.Formatter", true, "fmt", true, null); Stringer = $pkg.Stringer = $newType(8, $kindInterface, "fmt.Stringer", true, "fmt", true, null); GoStringer = $pkg.GoStringer = $newType(8, $kindInterface, "fmt.GoStringer", true, "fmt", true, null); buffer = $pkg.buffer = $newType(12, $kindSlice, "fmt.buffer", true, "fmt", false, null); pp = $pkg.pp = $newType(0, $kindStruct, "fmt.pp", true, "fmt", false, function(buf_, arg_, value_, fmt_, reordered_, goodArgNum_, panicking_, erroring_, wrapErrs_, wrappedErr_) { this.$val = this; if (arguments.length === 0) { this.buf = buffer.nil; this.arg = $ifaceNil; this.value = new reflect.Value.ptr(ptrType.nil, 0, 0); this.fmt = new fmt.ptr(ptrType$1.nil, new fmtFlags.ptr(false, false, false, false, false, false, false, false, false), 0, 0, arrayType$1.zero()); this.reordered = false; this.goodArgNum = false; this.panicking = false; this.erroring = false; this.wrapErrs = false; this.wrappedErr = $ifaceNil; return; } this.buf = buf_; this.arg = arg_; this.value = value_; this.fmt = fmt_; this.reordered = reordered_; this.goodArgNum = goodArgNum_; this.panicking = panicking_; this.erroring = erroring_; this.wrapErrs = wrapErrs_; this.wrappedErr = wrappedErr_; }); fmtFlags = $pkg.fmtFlags = $newType(0, $kindStruct, "fmt.fmtFlags", true, "fmt", false, function(widPresent_, precPresent_, minus_, plus_, sharp_, space_, 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.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.zero = zero_; this.plusV = plusV_; this.sharpV = sharpV_; }); fmt = $pkg.fmt = $newType(0, $kindStruct, "fmt.fmt", true, "fmt", false, function(buf_, fmtFlags_, wid_, prec_, intbuf_) { this.$val = this; if (arguments.length === 0) { this.buf = ptrType$1.nil; this.fmtFlags = new fmtFlags.ptr(false, false, false, false, false, false, false, false, false); this.wid = 0; this.prec = 0; this.intbuf = arrayType$1.zero(); return; } this.buf = buf_; this.fmtFlags = fmtFlags_; this.wid = wid_; this.prec = prec_; this.intbuf = intbuf_; }); wrapError = $pkg.wrapError = $newType(0, $kindStruct, "fmt.wrapError", true, "fmt", false, function(msg_, err_) { this.$val = this; if (arguments.length === 0) { this.msg = ""; this.err = $ifaceNil; return; } this.msg = msg_; this.err = err_; }); arrayType = $arrayType($Uint16, 2); sliceType = $sliceType(arrayType); sliceType$1 = $sliceType($emptyInterface); ptrType = $ptrType(reflect.rtype); ptrType$1 = $ptrType(buffer); arrayType$1 = $arrayType($Uint8, 68); sliceType$2 = $sliceType($Uint8); ptrType$4 = $ptrType(ss); ptrType$24 = $ptrType(pp); arrayType$3 = $arrayType($Uint8, 6); funcType = $funcType([$Int32], [$Bool], false); ptrType$26 = $ptrType(fmt); ptrType$27 = $ptrType(wrapError); ss.ptr.prototype.Read = function(buf) { var _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 _r, _tuple, err, r, s, size, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _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.atEOF || s.count >= s.ssave.argLimit) { err = io.EOF; $s = -1; return [r, size, err]; } _r = s.rs.ReadRune(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; r = _tuple[0]; size = _tuple[1]; err = _tuple[2]; if ($interfaceIsEqual(err, $ifaceNil)) { s.count = s.count + (1) >> 0; if (s.ssave.nlIsEnd && (r === 10)) { s.atEOF = true; } } else if ($interfaceIsEqual(err, io.EOF)) { s.atEOF = true; } $s = -1; return [r, size, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.ReadRune }; } $f._r = _r; $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 _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 _r, _tuple, err, r, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _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 = s.ReadRune(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; r = _tuple[0]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { if ($interfaceIsEqual(err, io.EOF)) { r = -1; $s = -1; return r; } s.error(err); } $s = -1; return r; /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.getRune }; } $f._r = _r; $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 _r, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; _r = s.rs.UnreadRune(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; s.atEOF = false; s.count = s.count - (1) >> 0; $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.UnreadRune }; } $f._r = _r; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; ss.prototype.UnreadRune = function() { return this.$val.UnreadRune(); }; ss.ptr.prototype.error = function(err) { var 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 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 $24r, _r, err, f, s, skipSpace, tok, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; 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 = []; $curGoroutine.deferStack.push($deferred); err = [err]; tok = sliceType$2.nil; err[0] = $ifaceNil; s = this; $deferred.push([(function(err) { return function() { var _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 = s.token(skipSpace, f); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } tok = _r; $24r = [tok, err[0]]; $s = 2; case 2: return $24r; /* */ } 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.$24r = $24r; $f._r = _r; $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 _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"), undefined) : _ref.$array[_ref.$offset + _i]), arrayType); if (rx < rng[0]) { return false; } if (rx <= rng[1]) { return true; } _i++; } return false; }; notSpace = function(r) { var r; return !isSpace(r); }; ss.ptr.prototype.free = function(old) { var old, s; 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.rs = $ifaceNil; ssFree.Put(s); }; ss.prototype.free = function(old) { return this.$val.free(old); }; ss.ptr.prototype.SkipSpace = function() { var _r, _r$1, _r$2, _v, r, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _v = $f._v; r = $f.r; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; /* while (true) { */ case 1: _r = s.getRune(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } r = _r; if (r === -1) { $s = -1; return; } if (!(r === 13)) { _v = false; $s = 6; continue s; } _r$1 = s.peek("\n"); /* */ $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: /* continue; */ $s = 1; continue; /* } */ case 5: if (r === 10) { if (s.ssave.nlIsSpace) { /* continue; */ $s = 1; continue; } s.errorString("unexpected newline"); $s = -1; return; } /* */ if (!isSpace(r)) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!isSpace(r)) { */ case 8: _r$2 = s.UnreadRune(); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; /* break; */ $s = 2; continue; /* } */ case 9: $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.SkipSpace }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._v = _v; $f.r = r; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; ss.prototype.SkipSpace = function() { return this.$val.SkipSpace(); }; ss.ptr.prototype.token = function(skipSpace, f) { var _r, _r$1, _r$2, f, r, s, skipSpace, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; f = $f.f; r = $f.r; s = $f.s; skipSpace = $f.skipSpace; $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(); /* */ $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 = s.getRune(); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } r = _r; if (r === -1) { /* break; */ $s = 5; continue; } _r$1 = f(r); /* */ $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: _r$2 = s.UnreadRune(); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; /* 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: $s = -1; return $convertSliceType(s.buf, sliceType$2); /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.token }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.f = f; $f.r = r; $f.s = s; $f.skipSpace = skipSpace; $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 _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 _r, _r$1, ok, r, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; 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 = s.getRune(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } r = _r; /* */ if (!((r === -1))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!((r === -1))) { */ case 2: _r$1 = s.UnreadRune(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; /* } */ case 3: $s = -1; return indexRune(ok, r) >= 0; /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.peek }; } $f._r = _r; $f._r$1 = _r$1; $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(buffer).prototype.write = function(p) { var b, p; b = this; b.$set($appendSlice(b.$get(), p)); }; $ptrType(buffer).prototype.writeString = function(s) { var b, s; b = this; b.$set($appendSlice(b.$get(), s)); }; $ptrType(buffer).prototype.writeByte = function(c) { var b, c; b = this; b.$set($append(b.$get(), c)); }; $ptrType(buffer).prototype.writeRune = function(r) { var b, bp, n, r, w; bp = this; if (r < 128) { bp.$set($append(bp.$get(), ((r << 24 >>> 24)))); return; } b = bp.$get(); n = b.$length; while (true) { if (!((n + 4 >> 0) > b.$capacity)) { break; } b = $append(b, 0); } w = utf8.EncodeRune($convertSliceType($subslice(b, n, (n + 4 >> 0)), sliceType$2), r); bp.$set($subslice(b, 0, (n + w >> 0))); }; newPrinter = function() { var _r, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = ppFree.Get(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } p = $assertType(_r, ptrType$24); p.panicking = false; p.erroring = false; p.wrapErrs = 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)))); $s = -1; return p; /* */ } return; } if ($f === undefined) { $f = { $blk: newPrinter }; } $f._r = _r; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; pp.ptr.prototype.free = function() { var p; p = this; if (p.buf.$capacity > 65536) { return; } p.buf = $subslice(p.buf, 0, 0); p.arg = $ifaceNil; p.value = new reflect.Value.ptr(ptrType.nil, 0, 0); p.wrappedErr = $ifaceNil; ppFree.Put(p); }; pp.prototype.free = function() { return this.$val.free(); }; pp.ptr.prototype.Width = function() { var _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 _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 _1, b, p; p = this; _1 = b; if (_1 === (45)) { return p.fmt.fmtFlags.minus; } else if (_1 === (43)) { return p.fmt.fmtFlags.plus || p.fmt.fmtFlags.plusV; } else if (_1 === (35)) { return p.fmt.fmtFlags.sharp || p.fmt.fmtFlags.sharpV; } 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.Write = function(b) { var _tmp, _tmp$1, b, err, p, ret; ret = 0; err = $ifaceNil; p = this; (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).write(b); _tmp = b.$length; _tmp$1 = $ifaceNil; ret = _tmp; err = _tmp$1; return [ret, err]; }; pp.prototype.Write = function(b) { return this.$val.Write(b); }; pp.ptr.prototype.WriteString = function(s) { var _tmp, _tmp$1, err, p, ret, s; ret = 0; err = $ifaceNil; p = this; (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(s); _tmp = s.length; _tmp$1 = $ifaceNil; ret = _tmp; err = _tmp$1; return [ret, err]; }; pp.prototype.WriteString = function(s) { return this.$val.WriteString(s); }; Fprintf = function(w, format, a) { var _r, _r$1, _tuple, a, err, format, n, p, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; a = $f.a; err = $f.err; format = $f.format; n = $f.n; p = $f.p; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; _r = newPrinter(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } p = _r; $r = p.doPrintf(format, a); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = w.Write($convertSliceType(p.buf, sliceType$2)); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err = _tuple[1]; p.free(); $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Fprintf }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.a = a; $f.err = err; $f.format = format; $f.n = n; $f.p = p; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Fprintf = Fprintf; Sprintf = function(format, a) { var _r, a, format, p, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; 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 = newPrinter(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } p = _r; $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(); $s = -1; return s; /* */ } return; } if ($f === undefined) { $f = { $blk: Sprintf }; } $f._r = _r; $f.a = a; $f.format = format; $f.p = p; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Sprintf = Sprintf; Fprint = function(w, a) { var _r, _r$1, _tuple, a, err, n, p, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; a = $f.a; err = $f.err; n = $f.n; p = $f.p; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; _r = newPrinter(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } p = _r; $r = p.doPrint(a); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = w.Write($convertSliceType(p.buf, sliceType$2)); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err = _tuple[1]; p.free(); $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Fprint }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.a = a; $f.err = err; $f.n = n; $f.p = p; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Fprint = Fprint; Sprint = function(a) { var _r, a, p, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; a = $f.a; p = $f.p; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = newPrinter(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } p = _r; $r = p.doPrint(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(); $s = -1; return s; /* */ } return; } if ($f === undefined) { $f = { $blk: Sprint }; } $f._r = _r; $f.a = a; $f.p = p; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Sprint = Sprint; Fprintln = function(w, a) { var _r, _r$1, _tuple, a, err, n, p, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; a = $f.a; err = $f.err; n = $f.n; p = $f.p; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; _r = newPrinter(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } p = _r; $r = p.doPrintln(a); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = w.Write($convertSliceType(p.buf, sliceType$2)); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err = _tuple[1]; p.free(); $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Fprintln }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.a = a; $f.err = err; $f.n = n; $f.p = p; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Fprintln = Fprintln; Println = function(a) { var $24r, _r, _tuple, a, err, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _tuple = $f._tuple; a = $f.a; err = $f.err; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; _r = Fprintln(os.Stdout, a); /* */ $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]; $24r = [n, err]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Println }; } $f.$24r = $24r; $f._r = _r; $f._tuple = _tuple; $f.a = a; $f.err = err; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Println = Println; Sprintln = function(a) { var _r, a, p, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; a = $f.a; p = $f.p; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = newPrinter(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } p = _r; $r = p.doPrintln(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(); $s = -1; return s; /* */ } return; } if ($f === undefined) { $f = { $blk: Sprintln }; } $f._r = _r; $f.a = a; $f.p = p; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Sprintln = Sprintln; getField = function(v, i) { var _r, _r$1, i, v, val, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; i = $f.i; v = $f.v; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = $clone(v, reflect.Value).Field(i); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } val = _r; /* */ if (($clone(val, reflect.Value).Kind() === 20) && !$clone(val, reflect.Value).IsNil()) { $s = 2; continue; } /* */ $s = 3; continue; /* if (($clone(val, reflect.Value).Kind() === 20) && !$clone(val, reflect.Value).IsNil()) { */ case 2: _r$1 = $clone(val, reflect.Value).Elem(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } val = _r$1; /* } */ case 3: $s = -1; return val; /* */ } return; } if ($f === undefined) { $f = { $blk: getField }; } $f._r = _r; $f._r$1 = _r$1; $f.i = i; $f.v = v; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; }; tooLarge = function(x) { var x; return x > 1000000 || x < -1000000; }; parsenum = function(s, start, end) { var _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 _r, p, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; p = $f.p; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; if (!$clone(v, reflect.Value).IsValid()) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(""); $s = -1; 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 = $clone(v, reflect.Value).Type().String(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(_r); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } (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; return; /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.unknownType }; } $f._r = _r; $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 _r, _r$1, p, verb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; 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.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("%!"); (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeRune(verb); (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(40); /* */ if (!($interfaceIsEqual(p.arg, $ifaceNil))) { $s = 2; continue; } /* */ if ($clone(p.value, reflect.Value).IsValid()) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!($interfaceIsEqual(p.arg, $ifaceNil))) { */ case 2: _r = reflect.TypeOf(p.arg).String(); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(_r); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(61); $r = p.printArg(p.arg, 118); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 5; continue; /* } else if ($clone(p.value, reflect.Value).IsValid()) { */ case 3: _r$1 = $clone(p.value, reflect.Value).Type().String(); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(_r$1); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(61); $r = p.printValue($clone(p.value, reflect.Value), 118, 0); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $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))).writeString(""); /* } */ case 5: case 1: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(41); p.erroring = false; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.badVerb }; } $f._r = _r; $f._r$1 = _r$1; $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 _1, p, v, verb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; p = $f.p; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; _1 = verb; /* */ if ((_1 === (116)) || (_1 === (118))) { $s = 2; continue; } /* */ $s = 3; continue; /* if ((_1 === (116)) || (_1 === (118))) { */ case 2: p.fmt.fmtBoolean(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; return; /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtBool }; } $f._1 = _1; $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.fmt0x64 = function(v, leading0x) { var leading0x, p, sharp, v; p = this; sharp = p.fmt.fmtFlags.sharp; p.fmt.fmtFlags.sharp = leading0x; p.fmt.fmtInteger(v, 16, false, 118, "0123456789abcdefx"); p.fmt.fmtFlags.sharp = sharp; }; pp.prototype.fmt0x64 = function(v, leading0x) { return this.$val.fmt0x64(v, leading0x); }; pp.ptr.prototype.fmtInteger = function(v, isSigned, verb) { var _1, isSigned, p, v, verb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; isSigned = $f.isSigned; p = $f.p; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; _1 = verb; /* */ if (_1 === (118)) { $s = 2; continue; } /* */ if (_1 === (100)) { $s = 3; continue; } /* */ if (_1 === (98)) { $s = 4; continue; } /* */ if ((_1 === (111)) || (_1 === (79))) { $s = 5; continue; } /* */ if (_1 === (120)) { $s = 6; continue; } /* */ if (_1 === (88)) { $s = 7; continue; } /* */ if (_1 === (99)) { $s = 8; continue; } /* */ if (_1 === (113)) { $s = 9; continue; } /* */ if (_1 === (85)) { $s = 10; continue; } /* */ $s = 11; continue; /* if (_1 === (118)) { */ case 2: if (p.fmt.fmtFlags.sharpV && !isSigned) { p.fmt0x64(v, true); } else { p.fmt.fmtInteger(v, 10, isSigned, verb, "0123456789abcdefx"); } $s = 12; continue; /* } else if (_1 === (100)) { */ case 3: p.fmt.fmtInteger(v, 10, isSigned, verb, "0123456789abcdefx"); $s = 12; continue; /* } else if (_1 === (98)) { */ case 4: p.fmt.fmtInteger(v, 2, isSigned, verb, "0123456789abcdefx"); $s = 12; continue; /* } else if ((_1 === (111)) || (_1 === (79))) { */ case 5: p.fmt.fmtInteger(v, 8, isSigned, verb, "0123456789abcdefx"); $s = 12; continue; /* } else if (_1 === (120)) { */ case 6: p.fmt.fmtInteger(v, 16, isSigned, verb, "0123456789abcdefx"); $s = 12; continue; /* } else if (_1 === (88)) { */ case 7: p.fmt.fmtInteger(v, 16, isSigned, verb, "0123456789ABCDEFX"); $s = 12; continue; /* } else if (_1 === (99)) { */ case 8: p.fmt.fmtC(v); $s = 12; continue; /* } else if (_1 === (113)) { */ case 9: p.fmt.fmtQc(v); $s = 12; continue; /* } else if (_1 === (85)) { */ case 10: p.fmt.fmtUnicode(v); $s = 12; continue; /* } else { */ case 11: $r = p.badVerb(verb); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 12: case 1: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtInteger }; } $f._1 = _1; $f.isSigned = isSigned; $f.p = p; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; }; pp.prototype.fmtInteger = function(v, isSigned, verb) { return this.$val.fmtInteger(v, isSigned, verb); }; pp.ptr.prototype.fmtFloat = function(v, size, verb) { var _1, p, size, v, verb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; p = $f.p; size = $f.size; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; _1 = verb; /* */ if (_1 === (118)) { $s = 2; continue; } /* */ if ((_1 === (98)) || (_1 === (103)) || (_1 === (71)) || (_1 === (120)) || (_1 === (88))) { $s = 3; continue; } /* */ if ((_1 === (102)) || (_1 === (101)) || (_1 === (69))) { $s = 4; continue; } /* */ if (_1 === (70)) { $s = 5; continue; } /* */ $s = 6; continue; /* if (_1 === (118)) { */ case 2: p.fmt.fmtFloat(v, size, 103, -1); $s = 7; continue; /* } else if ((_1 === (98)) || (_1 === (103)) || (_1 === (71)) || (_1 === (120)) || (_1 === (88))) { */ case 3: p.fmt.fmtFloat(v, size, verb, -1); $s = 7; continue; /* } else if ((_1 === (102)) || (_1 === (101)) || (_1 === (69))) { */ case 4: p.fmt.fmtFloat(v, size, verb, 6); $s = 7; continue; /* } else if (_1 === (70)) { */ case 5: p.fmt.fmtFloat(v, size, 102, 6); $s = 7; continue; /* } else { */ case 6: $r = p.badVerb(verb); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 7: case 1: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtFloat }; } $f._1 = _1; $f.p = p; $f.size = size; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; }; pp.prototype.fmtFloat = function(v, size, verb) { return this.$val.fmtFloat(v, size, verb); }; pp.ptr.prototype.fmtComplex = function(v, size, verb) { var _1, _q, _q$1, oldPlus, p, size, v, verb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _q = $f._q; _q$1 = $f._q$1; oldPlus = $f.oldPlus; p = $f.p; size = $f.size; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; _1 = verb; /* */ if ((_1 === (118)) || (_1 === (98)) || (_1 === (103)) || (_1 === (71)) || (_1 === (120)) || (_1 === (88)) || (_1 === (102)) || (_1 === (70)) || (_1 === (101)) || (_1 === (69))) { $s = 2; continue; } /* */ $s = 3; continue; /* if ((_1 === (118)) || (_1 === (98)) || (_1 === (103)) || (_1 === (71)) || (_1 === (120)) || (_1 === (88)) || (_1 === (102)) || (_1 === (70)) || (_1 === (101)) || (_1 === (69))) { */ case 2: oldPlus = p.fmt.fmtFlags.plus; (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(40); $r = p.fmtFloat(v.$real, (_q = size / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")), verb); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } p.fmt.fmtFlags.plus = true; $r = p.fmtFloat(v.$imag, (_q$1 = size / 2, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")), verb); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("i)"); p.fmt.fmtFlags.plus = oldPlus; $s = 4; continue; /* } else { */ case 3: $r = p.badVerb(verb); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: case 1: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtComplex }; } $f._1 = _1; $f._q = _q; $f._q$1 = _q$1; $f.oldPlus = oldPlus; $f.p = p; $f.size = size; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; }; pp.prototype.fmtComplex = function(v, size, verb) { return this.$val.fmtComplex(v, size, verb); }; pp.ptr.prototype.fmtString = function(v, verb) { var _1, p, v, verb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; p = $f.p; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; _1 = verb; /* */ if (_1 === (118)) { $s = 2; continue; } /* */ if (_1 === (115)) { $s = 3; continue; } /* */ if (_1 === (120)) { $s = 4; continue; } /* */ if (_1 === (88)) { $s = 5; continue; } /* */ if (_1 === (113)) { $s = 6; continue; } /* */ $s = 7; continue; /* if (_1 === (118)) { */ case 2: if (p.fmt.fmtFlags.sharpV) { p.fmt.fmtQ(v); } else { p.fmt.fmtS(v); } $s = 8; continue; /* } else if (_1 === (115)) { */ case 3: p.fmt.fmtS(v); $s = 8; continue; /* } else if (_1 === (120)) { */ case 4: p.fmt.fmtSx(v, "0123456789abcdefx"); $s = 8; continue; /* } else if (_1 === (88)) { */ case 5: p.fmt.fmtSx(v, "0123456789ABCDEFX"); $s = 8; continue; /* } else if (_1 === (113)) { */ case 6: p.fmt.fmtQ(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; return; /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtString }; } $f._1 = _1; $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, typeString) { var _1, _i, _i$1, _r, _ref, _ref$1, c, c$1, i, i$1, p, typeString, v, verb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _ref = $f._ref; _ref$1 = $f._ref$1; c = $f.c; c$1 = $f.c$1; i = $f.i; i$1 = $f.i$1; p = $f.p; typeString = $f.typeString; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; _1 = verb; /* */ if ((_1 === (118)) || (_1 === (100))) { $s = 2; continue; } /* */ if (_1 === (115)) { $s = 3; continue; } /* */ if (_1 === (120)) { $s = 4; continue; } /* */ if (_1 === (88)) { $s = 5; continue; } /* */ if (_1 === (113)) { $s = 6; continue; } /* */ $s = 7; continue; /* if ((_1 === (118)) || (_1 === (100))) { */ case 2: 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))).writeString(typeString); if (v === sliceType$2.nil) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("(nil)"); $s = -1; return; } (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(123); _ref = v; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; c = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (i > 0) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(", "); } p.fmt0x64((new $Uint64(0, c)), true); _i++; } (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(91); _ref$1 = v; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } i$1 = _i$1; c$1 = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); if (i$1 > 0) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(32); } p.fmt.fmtInteger((new $Uint64(0, c$1)), 10, false, verb, "0123456789abcdefx"); _i$1++; } (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(93); } $s = 8; continue; /* } else if (_1 === (115)) { */ case 3: p.fmt.fmtBs(v); $s = 8; continue; /* } else if (_1 === (120)) { */ case 4: p.fmt.fmtBx(v, "0123456789abcdefx"); $s = 8; continue; /* } else if (_1 === (88)) { */ case 5: p.fmt.fmtBx(v, "0123456789ABCDEFX"); $s = 8; continue; /* } else if (_1 === (113)) { */ case 6: p.fmt.fmtQ(($bytesToString(v))); $s = 8; continue; /* } else { */ case 7: _r = reflect.ValueOf(v); /* */ $s = 9; case 9: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $r = p.printValue($clone(_r, reflect.Value), verb, 0); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 8: case 1: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtBytes }; } $f._1 = _1; $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._ref = _ref; $f._ref$1 = _ref$1; $f.c = c; $f.c$1 = c$1; $f.i = i; $f.i$1 = i$1; $f.p = p; $f.typeString = typeString; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; }; pp.prototype.fmtBytes = function(v, verb, typeString) { return this.$val.fmtBytes(v, verb, typeString); }; pp.ptr.prototype.fmtPointer = function(value, verb) { var _1, _2, _r, p, u, value, verb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _2 = $f._2; _r = $f._r; p = $f.p; u = $f.u; value = $f.value; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; u = 0; _1 = $clone(value, reflect.Value).Kind(); /* */ if ((_1 === (18)) || (_1 === (19)) || (_1 === (21)) || (_1 === (22)) || (_1 === (23)) || (_1 === (26))) { $s = 2; continue; } /* */ $s = 3; continue; /* if ((_1 === (18)) || (_1 === (19)) || (_1 === (21)) || (_1 === (22)) || (_1 === (23)) || (_1 === (26))) { */ case 2: u = $clone(value, reflect.Value).Pointer(); $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; } $s = -1; return; /* } */ case 4: case 1: _2 = verb; /* */ if (_2 === (118)) { $s = 7; continue; } /* */ if (_2 === (112)) { $s = 8; continue; } /* */ if ((_2 === (98)) || (_2 === (111)) || (_2 === (100)) || (_2 === (120)) || (_2 === (88))) { $s = 9; continue; } /* */ $s = 10; continue; /* if (_2 === (118)) { */ case 7: /* */ if (p.fmt.fmtFlags.sharpV) { $s = 12; continue; } /* */ $s = 13; continue; /* if (p.fmt.fmtFlags.sharpV) { */ case 12: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(40); _r = $clone(value, reflect.Value).Type().String(); /* */ $s = 15; case 15: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(_r); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(")("); if (u === 0) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("nil"); } else { p.fmt0x64((new $Uint64(0, u.constructor === Number ? u : 1)), true); } (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(41); $s = 14; continue; /* } else { */ case 13: if (u === 0) { p.fmt.padString(""); } else { p.fmt0x64((new $Uint64(0, u.constructor === Number ? u : 1)), !p.fmt.fmtFlags.sharp); } /* } */ case 14: $s = 11; continue; /* } else if (_2 === (112)) { */ case 8: p.fmt0x64((new $Uint64(0, u.constructor === Number ? u : 1)), !p.fmt.fmtFlags.sharp); $s = 11; continue; /* } else if ((_2 === (98)) || (_2 === (111)) || (_2 === (100)) || (_2 === (120)) || (_2 === (88))) { */ case 9: $r = p.fmtInteger((new $Uint64(0, u.constructor === Number ? u : 1)), false, verb); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 11; continue; /* } else { */ case 10: $r = p.badVerb(verb); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 11: case 6: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtPointer }; } $f._1 = _1; $f._2 = _2; $f._r = _r; $f.p = p; $f.u = u; $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, method) { var _r, arg, err, method, oldFlags, p, v, verb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; arg = $f.arg; err = $f.err; method = $f.method; oldFlags = $f.oldFlags; 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 = reflect.ValueOf(arg); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } v = _r; if (($clone(v, reflect.Value).Kind() === 22) && $clone(v, reflect.Value).IsNil()) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(""); $s = -1; return; } if (p.panicking) { $panic(err); } oldFlags = $clone(p.fmt.fmtFlags, fmtFlags); p.fmt.clearflags(); (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("%!"); (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeRune(verb); (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("(PANIC="); (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(method); (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(" method: "); p.panicking = true; $r = p.printArg(err, 118); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } 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); fmtFlags.copy(p.fmt.fmtFlags, oldFlags); /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.catchPanic }; } $f._r = _r; $f.arg = arg; $f.err = err; $f.method = method; $f.oldFlags = oldFlags; $f.p = p; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; }; pp.prototype.catchPanic = function(arg, verb, method) { return this.$val.catchPanic(arg, verb, method); }; pp.ptr.prototype.handleMethods = function(verb) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, $24r$5, $24r$6, _1, _r, _r$1, _r$2, _ref, _tuple, _tuple$1, _tuple$2, err, formatter, handled, ok, ok$1, ok$2, 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; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; $24r$6 = $f.$24r$6; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; err = $f.err; formatter = $f.formatter; handled = $f.handled; ok = $f.ok; ok$1 = $f.ok$1; ok$2 = $f.ok$2; 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 = []; $curGoroutine.deferStack.push($deferred); handled = false; p = this; /* */ if (p.erroring) { $s = 1; continue; } /* */ $s = 2; continue; /* if (p.erroring) { */ case 1: $24r = handled; $s = 3; case 3: return $24r; /* } */ case 2: /* */ if (verb === 119) { $s = 4; continue; } /* */ $s = 5; continue; /* if (verb === 119) { */ case 4: _tuple = $assertType(p.arg, $error, true); err = _tuple[0]; ok = _tuple[1]; /* */ if (!ok || !p.wrapErrs || !($interfaceIsEqual(p.wrappedErr, $ifaceNil))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!ok || !p.wrapErrs || !($interfaceIsEqual(p.wrappedErr, $ifaceNil))) { */ case 6: p.wrappedErr = $ifaceNil; p.wrapErrs = false; $r = p.badVerb(verb); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } handled = true; $24r$1 = handled; $s = 9; case 9: return $24r$1; /* } */ case 7: p.wrappedErr = err; verb = 118; /* } */ case 5: _tuple$1 = $assertType(p.arg, Formatter, true); formatter = _tuple$1[0]; ok$1 = _tuple$1[1]; /* */ if (ok$1) { $s = 10; continue; } /* */ $s = 11; continue; /* if (ok$1) { */ case 10: handled = true; $deferred.push([$methodVal(p, "catchPanic"), [p.arg, verb, "Format"]]); $r = formatter.Format(p, verb); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $24r$2 = handled; $s = 13; case 13: return $24r$2; /* } */ case 11: /* */ if (p.fmt.fmtFlags.sharpV) { $s = 14; continue; } /* */ $s = 15; continue; /* if (p.fmt.fmtFlags.sharpV) { */ case 14: _tuple$2 = $assertType(p.arg, GoStringer, true); stringer = _tuple$2[0]; ok$2 = _tuple$2[1]; /* */ if (ok$2) { $s = 17; continue; } /* */ $s = 18; continue; /* if (ok$2) { */ case 17: handled = true; $deferred.push([$methodVal(p, "catchPanic"), [p.arg, verb, "GoString"]]); _r = stringer.GoString(); /* */ $s = 19; case 19: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $r = p.fmt.fmtS(_r); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $24r$3 = handled; $s = 21; case 21: return $24r$3; /* } */ case 18: $s = 16; continue; /* } else { */ case 15: _1 = verb; /* */ if ((_1 === (118)) || (_1 === (115)) || (_1 === (120)) || (_1 === (88)) || (_1 === (113))) { $s = 23; continue; } /* */ $s = 24; continue; /* if ((_1 === (118)) || (_1 === (115)) || (_1 === (120)) || (_1 === (88)) || (_1 === (113))) { */ case 23: _ref = p.arg; /* */ if ($assertType(_ref, $error, true)[1]) { $s = 25; continue; } /* */ if ($assertType(_ref, Stringer, true)[1]) { $s = 26; continue; } /* */ $s = 27; continue; /* if ($assertType(_ref, $error, true)[1]) { */ case 25: v = _ref; handled = true; $deferred.push([$methodVal(p, "catchPanic"), [p.arg, verb, "Error"]]); _r$1 = v.Error(); /* */ $s = 28; case 28: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = p.fmtString(_r$1, verb); /* */ $s = 29; case 29: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $24r$4 = handled; $s = 30; case 30: return $24r$4; /* } else if ($assertType(_ref, Stringer, true)[1]) { */ case 26: v$1 = _ref; handled = true; $deferred.push([$methodVal(p, "catchPanic"), [p.arg, verb, "String"]]); _r$2 = v$1.String(); /* */ $s = 31; case 31: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $r = p.fmtString(_r$2, verb); /* */ $s = 32; case 32: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $24r$5 = handled; $s = 33; case 33: return $24r$5; /* } */ case 27: /* } */ case 24: case 22: /* } */ case 16: handled = false; $24r$6 = handled; $s = 34; case 34: return $24r$6; /* */ } 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.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f.$24r$6 = $24r$6; $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.err = err; $f.formatter = formatter; $f.handled = handled; $f.ok = ok; $f.ok$1 = ok$1; $f.ok$2 = ok$2; $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) { return this.$val.handleMethods(verb); }; pp.ptr.prototype.printArg = function(arg, verb) { var _1, _2, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _ref, arg, 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, p, verb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _2 = $f._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; _ref = $f._ref; arg = $f.arg; 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; p = $f.p; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: 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: _1 = verb; /* */ if ((_1 === (84)) || (_1 === (118))) { $s = 4; continue; } /* */ $s = 5; continue; /* if ((_1 === (84)) || (_1 === (118))) { */ case 4: p.fmt.padString(""); $s = 6; continue; /* } else { */ case 5: $r = p.badVerb(verb); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 6: case 3: $s = -1; return; /* } */ case 2: _2 = verb; /* */ if (_2 === (84)) { $s = 9; continue; } /* */ if (_2 === (112)) { $s = 10; continue; } /* */ $s = 11; continue; /* if (_2 === (84)) { */ case 9: _r = reflect.TypeOf(arg).String(); /* */ $s = 12; case 12: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $r = p.fmt.fmtS(_r); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } else if (_2 === (112)) { */ case 10: _r$1 = reflect.ValueOf(arg); /* */ $s = 14; case 14: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = p.fmtPointer($clone(_r$1, reflect.Value), 112); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 11: case 8: _ref = arg; /* */ if ($assertType(_ref, $Bool, true)[1]) { $s = 16; continue; } /* */ if ($assertType(_ref, $Float32, true)[1]) { $s = 17; continue; } /* */ if ($assertType(_ref, $Float64, true)[1]) { $s = 18; continue; } /* */ if ($assertType(_ref, $Complex64, true)[1]) { $s = 19; continue; } /* */ if ($assertType(_ref, $Complex128, true)[1]) { $s = 20; continue; } /* */ if ($assertType(_ref, $Int, true)[1]) { $s = 21; continue; } /* */ if ($assertType(_ref, $Int8, true)[1]) { $s = 22; continue; } /* */ if ($assertType(_ref, $Int16, true)[1]) { $s = 23; continue; } /* */ if ($assertType(_ref, $Int32, true)[1]) { $s = 24; continue; } /* */ if ($assertType(_ref, $Int64, true)[1]) { $s = 25; continue; } /* */ if ($assertType(_ref, $Uint, true)[1]) { $s = 26; continue; } /* */ if ($assertType(_ref, $Uint8, true)[1]) { $s = 27; continue; } /* */ if ($assertType(_ref, $Uint16, true)[1]) { $s = 28; continue; } /* */ if ($assertType(_ref, $Uint32, true)[1]) { $s = 29; continue; } /* */ if ($assertType(_ref, $Uint64, true)[1]) { $s = 30; continue; } /* */ if ($assertType(_ref, $Uintptr, true)[1]) { $s = 31; continue; } /* */ if ($assertType(_ref, $String, true)[1]) { $s = 32; continue; } /* */ if ($assertType(_ref, sliceType$2, true)[1]) { $s = 33; continue; } /* */ if ($assertType(_ref, reflect.Value, true)[1]) { $s = 34; continue; } /* */ $s = 35; continue; /* if ($assertType(_ref, $Bool, true)[1]) { */ case 16: f = _ref.$val; $r = p.fmtBool(f, verb); /* */ $s = 37; case 37: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $Float32, true)[1]) { */ case 17: f$1 = _ref.$val; $r = p.fmtFloat((f$1), 32, verb); /* */ $s = 38; case 38: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $Float64, true)[1]) { */ case 18: f$2 = _ref.$val; $r = p.fmtFloat(f$2, 64, verb); /* */ $s = 39; case 39: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $Complex64, true)[1]) { */ case 19: f$3 = _ref.$val; $r = p.fmtComplex((new $Complex128(f$3.$real, f$3.$imag)), 64, verb); /* */ $s = 40; case 40: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $Complex128, true)[1]) { */ case 20: f$4 = _ref.$val; $r = p.fmtComplex(f$4, 128, verb); /* */ $s = 41; case 41: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $Int, true)[1]) { */ case 21: f$5 = _ref.$val; $r = p.fmtInteger((new $Uint64(0, f$5)), true, verb); /* */ $s = 42; case 42: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $Int8, true)[1]) { */ case 22: f$6 = _ref.$val; $r = p.fmtInteger((new $Uint64(0, f$6)), true, verb); /* */ $s = 43; case 43: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $Int16, true)[1]) { */ case 23: f$7 = _ref.$val; $r = p.fmtInteger((new $Uint64(0, f$7)), true, verb); /* */ $s = 44; case 44: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $Int32, true)[1]) { */ case 24: f$8 = _ref.$val; $r = p.fmtInteger((new $Uint64(0, f$8)), true, verb); /* */ $s = 45; case 45: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $Int64, true)[1]) { */ case 25: f$9 = _ref.$val; $r = p.fmtInteger((new $Uint64(f$9.$high, f$9.$low)), true, verb); /* */ $s = 46; case 46: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $Uint, true)[1]) { */ case 26: f$10 = _ref.$val; $r = p.fmtInteger((new $Uint64(0, f$10)), false, verb); /* */ $s = 47; case 47: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $Uint8, true)[1]) { */ case 27: f$11 = _ref.$val; $r = p.fmtInteger((new $Uint64(0, f$11)), false, verb); /* */ $s = 48; case 48: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $Uint16, true)[1]) { */ case 28: f$12 = _ref.$val; $r = p.fmtInteger((new $Uint64(0, f$12)), false, verb); /* */ $s = 49; case 49: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $Uint32, true)[1]) { */ case 29: f$13 = _ref.$val; $r = p.fmtInteger((new $Uint64(0, f$13)), false, verb); /* */ $s = 50; case 50: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $Uint64, true)[1]) { */ case 30: f$14 = _ref.$val; $r = p.fmtInteger(f$14, false, verb); /* */ $s = 51; case 51: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $Uintptr, true)[1]) { */ case 31: f$15 = _ref.$val; $r = p.fmtInteger((new $Uint64(0, f$15.constructor === Number ? f$15 : 1)), false, verb); /* */ $s = 52; case 52: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $String, true)[1]) { */ case 32: f$16 = _ref.$val; $r = p.fmtString(f$16, verb); /* */ $s = 53; case 53: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, sliceType$2, true)[1]) { */ case 33: f$17 = _ref.$val; $r = p.fmtBytes(f$17, verb, "[]byte"); /* */ $s = 54; case 54: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, reflect.Value, true)[1]) { */ case 34: f$18 = _ref.$val; /* */ if ($clone(f$18, reflect.Value).IsValid() && $clone(f$18, reflect.Value).CanInterface()) { $s = 55; continue; } /* */ $s = 56; continue; /* if ($clone(f$18, reflect.Value).IsValid() && $clone(f$18, reflect.Value).CanInterface()) { */ case 55: _r$2 = $clone(f$18, reflect.Value).Interface(); /* */ $s = 57; case 57: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } p.arg = _r$2; _r$3 = p.handleMethods(verb); /* */ $s = 60; case 60: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } /* */ if (_r$3) { $s = 58; continue; } /* */ $s = 59; continue; /* if (_r$3) { */ case 58: $s = -1; return; /* } */ case 59: /* } */ case 56: $r = p.printValue($clone(f$18, reflect.Value), verb, 0); /* */ $s = 61; case 61: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else { */ case 35: f$19 = _ref; _r$4 = p.handleMethods(verb); /* */ $s = 64; case 64: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } /* */ if (!_r$4) { $s = 62; continue; } /* */ $s = 63; continue; /* if (!_r$4) { */ case 62: _r$5 = reflect.ValueOf(f$19); /* */ $s = 65; case 65: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $r = p.printValue($clone(_r$5, reflect.Value), verb, 0); /* */ $s = 66; case 66: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 63: /* } */ case 36: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.printArg }; } $f._1 = _1; $f._2 = _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._ref = _ref; $f.arg = arg; $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.p = p; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; }; pp.prototype.printArg = function(arg, verb) { return this.$val.printArg(arg, verb); }; pp.ptr.prototype.printValue = function(value, verb, depth) { var _1, _2, _3, _4, _arg, _arg$1, _arg$2, _i, _i$1, _r, _r$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$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _ref$1, a, bytes, depth, f, i, i$1, i$2, i$3, i$4, key, name, p, sorted, t, value, value$1, verb, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _2 = $f._2; _3 = $f._3; _4 = $f._4; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _i = $f._i; _i$1 = $f._i$1; _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$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$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; a = $f.a; bytes = $f.bytes; depth = $f.depth; f = $f.f; i = $f.i; i$1 = $f.i$1; i$2 = $f.i$2; i$3 = $f.i$3; i$4 = $f.i$4; key = $f.key; name = $f.name; p = $f.p; sorted = $f.sorted; t = $f.t; value = $f.value; value$1 = $f.value$1; verb = $f.verb; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; /* */ if (depth > 0 && $clone(value, reflect.Value).IsValid() && $clone(value, reflect.Value).CanInterface()) { $s = 1; continue; } /* */ $s = 2; continue; /* if (depth > 0 && $clone(value, reflect.Value).IsValid() && $clone(value, reflect.Value).CanInterface()) { */ case 1: _r = $clone(value, reflect.Value).Interface(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } p.arg = _r; _r$1 = p.handleMethods(verb); /* */ $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) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_r$1) { */ case 4: $s = -1; return; /* } */ case 5: /* } */ case 2: p.arg = $ifaceNil; p.value = value; f = value; _1 = $clone(value, reflect.Value).Kind(); /* */ if (_1 === (0)) { $s = 8; continue; } /* */ if (_1 === (1)) { $s = 9; continue; } /* */ if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { $s = 10; continue; } /* */ if ((_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12))) { $s = 11; continue; } /* */ if (_1 === (13)) { $s = 12; continue; } /* */ if (_1 === (14)) { $s = 13; continue; } /* */ if (_1 === (15)) { $s = 14; continue; } /* */ if (_1 === (16)) { $s = 15; continue; } /* */ if (_1 === (24)) { $s = 16; continue; } /* */ if (_1 === (21)) { $s = 17; continue; } /* */ if (_1 === (25)) { $s = 18; continue; } /* */ if (_1 === (20)) { $s = 19; continue; } /* */ if ((_1 === (17)) || (_1 === (23))) { $s = 20; continue; } /* */ if (_1 === (22)) { $s = 21; continue; } /* */ if ((_1 === (18)) || (_1 === (19)) || (_1 === (26))) { $s = 22; continue; } /* */ $s = 23; continue; /* if (_1 === (0)) { */ case 8: /* */ if (depth === 0) { $s = 25; continue; } /* */ $s = 26; continue; /* if (depth === 0) { */ case 25: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(""); $s = 27; continue; /* } else { */ case 26: _2 = verb; /* */ if (_2 === (118)) { $s = 29; continue; } /* */ $s = 30; continue; /* if (_2 === (118)) { */ case 29: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(""); $s = 31; continue; /* } else { */ case 30: $r = p.badVerb(verb); /* */ $s = 32; case 32: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 31: case 28: /* } */ case 27: $s = 24; continue; /* } else if (_1 === (1)) { */ case 9: $r = p.fmtBool($clone(f, reflect.Value).Bool(), verb); /* */ $s = 33; case 33: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 24; continue; /* } else if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { */ case 10: $r = p.fmtInteger(((x = $clone(f, reflect.Value).Int(), new $Uint64(x.$high, x.$low))), true, verb); /* */ $s = 34; case 34: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 24; continue; /* } else if ((_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12))) { */ case 11: $r = p.fmtInteger($clone(f, reflect.Value).Uint(), false, verb); /* */ $s = 35; case 35: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 24; continue; /* } else if (_1 === (13)) { */ case 12: $r = p.fmtFloat($clone(f, reflect.Value).Float(), 32, verb); /* */ $s = 36; case 36: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 24; continue; /* } else if (_1 === (14)) { */ case 13: $r = p.fmtFloat($clone(f, reflect.Value).Float(), 64, verb); /* */ $s = 37; case 37: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 24; continue; /* } else if (_1 === (15)) { */ case 14: $r = p.fmtComplex($clone(f, reflect.Value).Complex(), 64, verb); /* */ $s = 38; case 38: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 24; continue; /* } else if (_1 === (16)) { */ case 15: $r = p.fmtComplex($clone(f, reflect.Value).Complex(), 128, verb); /* */ $s = 39; case 39: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 24; continue; /* } else if (_1 === (24)) { */ case 16: _r$2 = $clone(f, reflect.Value).String(); /* */ $s = 40; case 40: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $r = p.fmtString(_r$2, verb); /* */ $s = 41; case 41: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 24; continue; /* } else if (_1 === (21)) { */ case 17: /* */ if (p.fmt.fmtFlags.sharpV) { $s = 42; continue; } /* */ $s = 43; continue; /* if (p.fmt.fmtFlags.sharpV) { */ case 42: _r$3 = $clone(f, reflect.Value).Type().String(); /* */ $s = 45; case 45: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(_r$3); /* */ $s = 46; case 46: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if ($clone(f, reflect.Value).IsNil()) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("(nil)"); $s = -1; return; } (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(123); $s = 44; continue; /* } else { */ case 43: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("map["); /* } */ case 44: _r$4 = fmtsort.Sort($clone(f, reflect.Value)); /* */ $s = 47; case 47: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } sorted = _r$4; _ref = sorted.Key; _i = 0; /* while (true) { */ case 48: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 49; continue; } i = _i; key = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _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))).writeString(", "); } 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 = p.printValue($clone(key, reflect.Value), verb, depth + 1 >> 0); /* */ $s = 50; case 50: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(58); $r = p.printValue($clone((x$1 = sorted.Value, ((i < 0 || i >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + i])), reflect.Value), verb, depth + 1 >> 0); /* */ $s = 51; case 51: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i++; $s = 48; continue; case 49: 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 = 24; continue; /* } else if (_1 === (25)) { */ case 18: /* */ if (p.fmt.fmtFlags.sharpV) { $s = 52; continue; } /* */ $s = 53; continue; /* if (p.fmt.fmtFlags.sharpV) { */ case 52: _r$5 = $clone(f, reflect.Value).Type().String(); /* */ $s = 54; case 54: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $r = (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 = 55; case 55: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 53: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(123); i$1 = 0; /* while (true) { */ case 56: /* if (!(i$1 < $clone(f, reflect.Value).NumField())) { break; } */ if(!(i$1 < $clone(f, reflect.Value).NumField())) { $s = 57; 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))).writeString(", "); } 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 = 58; continue; } /* */ $s = 59; continue; /* if (p.fmt.fmtFlags.plusV || p.fmt.fmtFlags.sharpV) { */ case 58: _r$6 = $clone(f, reflect.Value).Type().Field(i$1); /* */ $s = 60; case 60: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } name = _r$6.Name; if (!(name === "")) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(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 59: _r$7 = getField($clone(f, reflect.Value), i$1); /* */ $s = 61; case 61: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } $r = p.printValue($clone(_r$7, reflect.Value), verb, depth + 1 >> 0); /* */ $s = 62; case 62: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i$1 = i$1 + (1) >> 0; $s = 56; continue; case 57: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(125); $s = 24; continue; /* } else if (_1 === (20)) { */ case 19: _r$8 = $clone(f, reflect.Value).Elem(); /* */ $s = 63; case 63: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } value$1 = _r$8; /* */ if (!$clone(value$1, reflect.Value).IsValid()) { $s = 64; continue; } /* */ $s = 65; continue; /* if (!$clone(value$1, reflect.Value).IsValid()) { */ case 64: /* */ if (p.fmt.fmtFlags.sharpV) { $s = 67; continue; } /* */ $s = 68; continue; /* if (p.fmt.fmtFlags.sharpV) { */ case 67: _r$9 = $clone(f, reflect.Value).Type().String(); /* */ $s = 70; case 70: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(_r$9); /* */ $s = 71; case 71: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("(nil)"); $s = 69; continue; /* } else { */ case 68: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(""); /* } */ case 69: $s = 66; continue; /* } else { */ case 65: $r = p.printValue($clone(value$1, reflect.Value), verb, depth + 1 >> 0); /* */ $s = 72; case 72: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 66: $s = 24; continue; /* } else if ((_1 === (17)) || (_1 === (23))) { */ case 20: _3 = verb; /* */ if ((_3 === (115)) || (_3 === (113)) || (_3 === (120)) || (_3 === (88))) { $s = 74; continue; } /* */ $s = 75; continue; /* if ((_3 === (115)) || (_3 === (113)) || (_3 === (120)) || (_3 === (88))) { */ case 74: t = $clone(f, reflect.Value).Type(); _r$10 = t.Elem(); /* */ $s = 78; case 78: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$11 = _r$10.Kind(); /* */ $s = 79; case 79: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } /* */ if (_r$11 === 8) { $s = 76; continue; } /* */ $s = 77; continue; /* if (_r$11 === 8) { */ case 76: bytes = sliceType$2.nil; /* */ if ($clone(f, reflect.Value).Kind() === 23) { $s = 80; continue; } /* */ if ($clone(f, reflect.Value).CanAddr()) { $s = 81; continue; } /* */ $s = 82; continue; /* if ($clone(f, reflect.Value).Kind() === 23) { */ case 80: _r$12 = $clone(f, reflect.Value).Bytes(); /* */ $s = 84; case 84: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } bytes = _r$12; $s = 83; continue; /* } else if ($clone(f, reflect.Value).CanAddr()) { */ case 81: _r$13 = $clone(f, reflect.Value).Slice(0, $clone(f, reflect.Value).Len()); /* */ $s = 85; case 85: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _r$14 = $clone(_r$13, reflect.Value).Bytes(); /* */ $s = 86; case 86: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } bytes = _r$14; $s = 83; continue; /* } else { */ case 82: bytes = $makeSlice(sliceType$2, $clone(f, reflect.Value).Len()); _ref$1 = bytes; _i$1 = 0; /* while (true) { */ case 87: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 88; continue; } i$2 = _i$1; _r$15 = $clone(f, reflect.Value).Index(i$2); /* */ $s = 89; case 89: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _r$16 = $clone(_r$15, reflect.Value).Uint(); /* */ $s = 90; case 90: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } ((i$2 < 0 || i$2 >= bytes.$length) ? ($throwRuntimeError("index out of range"), undefined) : bytes.$array[bytes.$offset + i$2] = ((_r$16.$low << 24 >>> 24))); _i$1++; $s = 87; continue; case 88: /* } */ case 83: _arg = bytes; _arg$1 = verb; _r$17 = t.String(); /* */ $s = 91; case 91: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } _arg$2 = _r$17; $r = p.fmtBytes(_arg, _arg$1, _arg$2); /* */ $s = 92; case 92: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 77: /* } */ case 75: case 73: /* */ if (p.fmt.fmtFlags.sharpV) { $s = 93; continue; } /* */ $s = 94; continue; /* if (p.fmt.fmtFlags.sharpV) { */ case 93: _r$18 = $clone(f, reflect.Value).Type().String(); /* */ $s = 96; case 96: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(_r$18); /* */ $s = 97; case 97: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (($clone(f, reflect.Value).Kind() === 23) && $clone(f, reflect.Value).IsNil()) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("(nil)"); $s = -1; return; } (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(123); i$3 = 0; /* while (true) { */ case 98: /* if (!(i$3 < $clone(f, reflect.Value).Len())) { break; } */ if(!(i$3 < $clone(f, reflect.Value).Len())) { $s = 99; continue; } if (i$3 > 0) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(", "); } _r$19 = $clone(f, reflect.Value).Index(i$3); /* */ $s = 100; case 100: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } $r = p.printValue($clone(_r$19, reflect.Value), verb, depth + 1 >> 0); /* */ $s = 101; case 101: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i$3 = i$3 + (1) >> 0; $s = 98; continue; case 99: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(125); $s = 95; continue; /* } else { */ case 94: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(91); i$4 = 0; /* while (true) { */ case 102: /* if (!(i$4 < $clone(f, reflect.Value).Len())) { break; } */ if(!(i$4 < $clone(f, reflect.Value).Len())) { $s = 103; continue; } if (i$4 > 0) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(32); } _r$20 = $clone(f, reflect.Value).Index(i$4); /* */ $s = 104; case 104: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } $r = p.printValue($clone(_r$20, reflect.Value), verb, depth + 1 >> 0); /* */ $s = 105; case 105: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i$4 = i$4 + (1) >> 0; $s = 102; continue; case 103: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(93); /* } */ case 95: $s = 24; continue; /* } else if (_1 === (22)) { */ case 21: /* */ if ((depth === 0) && !(($clone(f, reflect.Value).Pointer() === 0))) { $s = 106; continue; } /* */ $s = 107; continue; /* if ((depth === 0) && !(($clone(f, reflect.Value).Pointer() === 0))) { */ case 106: _r$21 = $clone(f, reflect.Value).Elem(); /* */ $s = 109; case 109: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } a = _r$21; _4 = $clone(a, reflect.Value).Kind(); /* */ if ((_4 === (17)) || (_4 === (23)) || (_4 === (25)) || (_4 === (21))) { $s = 110; continue; } /* */ $s = 111; continue; /* if ((_4 === (17)) || (_4 === (23)) || (_4 === (25)) || (_4 === (21))) { */ case 110: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(38); $r = p.printValue($clone(a, reflect.Value), verb, depth + 1 >> 0); /* */ $s = 112; case 112: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 111: case 108: /* } */ case 107: $r = p.fmtPointer($clone(f, reflect.Value), verb); /* */ $s = 113; case 113: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 24; continue; /* } else if ((_1 === (18)) || (_1 === (19)) || (_1 === (26))) { */ case 22: $r = p.fmtPointer($clone(f, reflect.Value), verb); /* */ $s = 114; case 114: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 24; continue; /* } else { */ case 23: $r = p.unknownType($clone(f, reflect.Value)); /* */ $s = 115; case 115: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 24: case 7: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.printValue }; } $f._1 = _1; $f._2 = _2; $f._3 = _3; $f._4 = _4; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._i = _i; $f._i$1 = _i$1; $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$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$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.a = a; $f.bytes = bytes; $f.depth = depth; $f.f = f; $f.i = i; $f.i$1 = i$1; $f.i$2 = i$2; $f.i$3 = i$3; $f.i$4 = i$4; $f.key = key; $f.name = name; $f.p = p; $f.sorted = sorted; $f.t = t; $f.value = value; $f.value$1 = value$1; $f.verb = verb; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; pp.prototype.printValue = function(value, verb, depth) { return this.$val.printValue(value, verb, depth); }; intFromArg = function(a, argNum) { var _1, _r, _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; _1 = $f._1; _r = $f._r; _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"), undefined) : 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 = reflect.ValueOf(((argNum < 0 || argNum >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + argNum])); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } v = _r; _1 = $clone(v, reflect.Value).Kind(); if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { n = $clone(v, reflect.Value).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 ((_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12))) { n$1 = $clone(v, reflect.Value).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: $s = -1; return [num, isInt, newArgNum]; /* */ } return; } if ($f === undefined) { $f = { $blk: intFromArg }; } $f._1 = _1; $f._r = _r; $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 _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 _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($substring(format, 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.badArgNum = function(verb) { var p, verb; p = this; (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("%!"); (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeRune(verb); (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("(BADINDEX)"); }; pp.prototype.badArgNum = function(verb) { return this.$val.badArgNum(verb); }; pp.ptr.prototype.missingArg = function(verb) { var p, verb; p = this; (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("%!"); (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeRune(verb); (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("(MISSING)"); }; pp.prototype.missingArg = function(verb) { return this.$val.missingArg(verb); }; pp.ptr.prototype.doPrintf = function(format, a) { var _1, _i, _r, _r$1, _r$2, _ref, _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, a, afterIndex, arg, argNum, c, end, format, i, i$1, lasti, p, size, verb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _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; argNum = $f.argNum; c = $f.c; end = $f.end; format = $f.format; i = $f.i; i$1 = $f.i$1; lasti = $f.lasti; p = $f.p; size = $f.size; verb = $f.verb; $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($substring(format, lasti, i)); } if (i >= end) { /* break; */ $s = 2; continue; } i = i + (1) >> 0; p.fmt.clearflags(); /* while (true) { */ case 3: /* if (!(i < end)) { break; } */ if(!(i < end)) { $s = 4; continue; } c = format.charCodeAt(i); _1 = c; /* */ if (_1 === (35)) { $s = 6; continue; } /* */ if (_1 === (48)) { $s = 7; continue; } /* */ if (_1 === (43)) { $s = 8; continue; } /* */ if (_1 === (45)) { $s = 9; continue; } /* */ if (_1 === (32)) { $s = 10; continue; } /* */ $s = 11; continue; /* if (_1 === (35)) { */ case 6: p.fmt.fmtFlags.sharp = true; $s = 12; continue; /* } else if (_1 === (48)) { */ case 7: p.fmt.fmtFlags.zero = !p.fmt.fmtFlags.minus; $s = 12; continue; /* } else if (_1 === (43)) { */ case 8: p.fmt.fmtFlags.plus = true; $s = 12; continue; /* } else if (_1 === (45)) { */ case 9: p.fmt.fmtFlags.minus = true; p.fmt.fmtFlags.zero = false; $s = 12; continue; /* } else if (_1 === (32)) { */ case 10: p.fmt.fmtFlags.space = true; $s = 12; continue; /* } else { */ case 11: /* */ if (97 <= c && c <= 122 && argNum < a.$length) { $s = 13; continue; } /* */ $s = 14; continue; /* if (97 <= c && c <= 122 && argNum < a.$length) { */ case 13: if (c === 118) { p.fmt.fmtFlags.sharpV = p.fmt.fmtFlags.sharp; p.fmt.fmtFlags.sharp = false; p.fmt.fmtFlags.plusV = p.fmt.fmtFlags.plus; p.fmt.fmtFlags.plus = false; } $r = p.printArg(((argNum < 0 || argNum >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + argNum]), ((c >> 0))); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } argNum = argNum + (1) >> 0; i = i + (1) >> 0; /* continue formatLoop; */ $s = 1; continue s; /* } */ case 14: /* break simpleFormat; */ $s = 4; continue s; /* } */ case 12: case 5: i = i + (1) >> 0; $s = 3; continue; case 4: _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 = 16; continue; } /* */ $s = 17; continue; /* if (i < end && (format.charCodeAt(i) === 42)) { */ case 16: i = i + (1) >> 0; _r = intFromArg(a, argNum); /* */ $s = 19; case 19: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple$1 = _r; 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))).writeString("%!(BADWIDTH)"); } if (p.fmt.wid < 0) { p.fmt.wid = -p.fmt.wid; p.fmt.fmtFlags.minus = true; p.fmt.fmtFlags.zero = false; } afterIndex = false; $s = 18; continue; /* } else { */ case 17: _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 18: /* */ if ((i + 1 >> 0) < end && (format.charCodeAt(i) === 46)) { $s = 20; continue; } /* */ $s = 21; continue; /* if ((i + 1 >> 0) < end && (format.charCodeAt(i) === 46)) { */ case 20: 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 = 22; continue; } /* */ $s = 23; continue; /* if (i < end && (format.charCodeAt(i) === 42)) { */ case 22: i = i + (1) >> 0; _r$1 = intFromArg(a, argNum); /* */ $s = 25; case 25: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$4 = _r$1; 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))).writeString("%!(BADPREC)"); } afterIndex = false; $s = 24; continue; /* } else { */ case 23: _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 24: /* } */ case 21: 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) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("%!(NOVERB)"); /* break; */ $s = 2; continue; } _tmp = ((format.charCodeAt(i) >> 0)); _tmp$1 = 1; verb = _tmp; size = _tmp$1; if (verb >= 128) { _tuple$7 = utf8.DecodeRuneInString($substring(format, i)); verb = _tuple$7[0]; size = _tuple$7[1]; } i = i + (size) >> 0; /* */ if ((verb === 37)) { $s = 27; continue; } /* */ if (!p.goodArgNum) { $s = 28; continue; } /* */ if (argNum >= a.$length) { $s = 29; continue; } /* */ if ((verb === 118)) { $s = 30; continue; } /* */ $s = 31; continue; /* if ((verb === 37)) { */ case 27: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(37); $s = 32; continue; /* } else if (!p.goodArgNum) { */ case 28: p.badArgNum(verb); $s = 32; continue; /* } else if (argNum >= a.$length) { */ case 29: p.missingArg(verb); $s = 32; continue; /* } else if ((verb === 118)) { */ case 30: p.fmt.fmtFlags.sharpV = p.fmt.fmtFlags.sharp; p.fmt.fmtFlags.sharp = false; p.fmt.fmtFlags.plusV = p.fmt.fmtFlags.plus; p.fmt.fmtFlags.plus = false; $r = p.printArg(((argNum < 0 || argNum >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + argNum]), verb); /* */ $s = 33; case 33: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } argNum = argNum + (1) >> 0; $s = 32; continue; /* } else { */ case 31: $r = p.printArg(((argNum < 0 || argNum >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + argNum]), verb); /* */ $s = 34; case 34: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } argNum = argNum + (1) >> 0; /* } */ case 32: case 26: $s = 1; continue; case 2: /* */ if (!p.reordered && argNum < a.$length) { $s = 35; continue; } /* */ $s = 36; continue; /* if (!p.reordered && argNum < a.$length) { */ case 35: p.fmt.clearflags(); (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString("%!(EXTRA "); _ref = $subslice(a, argNum); _i = 0; /* while (true) { */ case 37: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 38; continue; } i$1 = _i; arg = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (i$1 > 0) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(", "); } /* */ if ($interfaceIsEqual(arg, $ifaceNil)) { $s = 39; continue; } /* */ $s = 40; continue; /* if ($interfaceIsEqual(arg, $ifaceNil)) { */ case 39: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeString(""); $s = 41; continue; /* } else { */ case 40: _r$2 = reflect.TypeOf(arg).String(); /* */ $s = 42; case 42: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $r = (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 = 43; case 43: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(61); $r = p.printArg(arg, 118); /* */ $s = 44; case 44: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 41: _i++; $s = 37; continue; case 38: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(41); /* } */ case 36: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.doPrintf }; } $f._1 = _1; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $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.argNum = argNum; $f.c = c; $f.end = end; $f.format = format; $f.i = i; $f.i$1 = i$1; $f.lasti = lasti; $f.p = p; $f.size = size; $f.verb = verb; $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) { var _i, _r, _ref, _v, a, arg, argNum, isString, p, prevString, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _ref = $f._ref; _v = $f._v; a = $f.a; 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; _ref = a; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } argNum = _i; arg = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (!(!($interfaceIsEqual(arg, $ifaceNil)))) { _v = false; $s = 3; continue s; } _r = reflect.TypeOf(arg).Kind(); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _v = _r === 24; case 3: isString = _v; if (argNum > 0 && !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); } $r = p.printArg(arg, 118); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } prevString = isString; _i++; $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.doPrint }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f._v = _v; $f.a = a; $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) { return this.$val.doPrint(a); }; pp.ptr.prototype.doPrintln = function(a) { var _i, _ref, a, arg, argNum, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _ref = $f._ref; a = $f.a; arg = $f.arg; argNum = $f.argNum; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; _ref = a; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } argNum = _i; arg = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (argNum > 0) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).writeByte(32); } $r = p.printArg(arg, 118); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i++; $s = 1; continue; case 2: (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; return; /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.doPrintln }; } $f._i = _i; $f._ref = _ref; $f.a = a; $f.arg = arg; $f.argNum = argNum; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; pp.prototype.doPrintln = function(a) { return this.$val.doPrintln(a); }; fmt.ptr.prototype.clearflags = function() { var f; f = this; fmtFlags.copy(f.fmtFlags, new fmtFlags.ptr(false, false, false, false, false, false, false, false, false)); }; fmt.prototype.clearflags = function() { return this.$val.clearflags(); }; fmt.ptr.prototype.init = function(buf) { var buf, f; f = this; f.buf = buf; f.clearflags(); }; fmt.prototype.init = function(buf) { return this.$val.init(buf); }; fmt.ptr.prototype.writePadding = function(n) { var _i, _ref, buf, f, i, n, newLen, oldLen, padByte, padding; f = this; if (n <= 0) { return; } buf = f.buf.$get(); oldLen = buf.$length; newLen = oldLen + n >> 0; if (newLen > buf.$capacity) { buf = $makeSlice(buffer, (($imul(buf.$capacity, 2)) + n >> 0)); $copySlice(buf, f.buf.$get()); } padByte = 32; if (f.fmtFlags.zero) { padByte = 48; } padding = $subslice(buf, oldLen, newLen); _ref = padding; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; ((i < 0 || i >= padding.$length) ? ($throwRuntimeError("index out of range"), undefined) : padding.$array[padding.$offset + i] = padByte); _i++; } f.buf.$set($subslice(buf, 0, newLen)); }; fmt.prototype.writePadding = function(n) { return this.$val.writePadding(n); }; fmt.ptr.prototype.pad = function(b) { var b, f, width; f = this; if (!f.fmtFlags.widPresent || (f.wid === 0)) { f.buf.write(b); return; } width = f.wid - utf8.RuneCount(b) >> 0; if (!f.fmtFlags.minus) { f.writePadding(width); f.buf.write(b); } else { f.buf.write(b); f.writePadding(width); } }; fmt.prototype.pad = function(b) { return this.$val.pad(b); }; fmt.ptr.prototype.padString = function(s) { var f, s, width; f = this; if (!f.fmtFlags.widPresent || (f.wid === 0)) { f.buf.writeString(s); return; } width = f.wid - utf8.RuneCountInString(s) >> 0; if (!f.fmtFlags.minus) { f.writePadding(width); f.buf.writeString(s); } else { f.buf.writeString(s); f.writePadding(width); } }; fmt.prototype.padString = function(s) { return this.$val.padString(s); }; fmt.ptr.prototype.fmtBoolean = function(v) { var f, v; f = this; if (v) { f.padString("true"); } else { f.padString("false"); } }; fmt.prototype.fmtBoolean = function(v) { return this.$val.fmtBoolean(v); }; fmt.ptr.prototype.fmtUnicode = function(u) { var buf, f, i, oldZero, prec, u, width; f = this; buf = $subslice(new sliceType$2(f.intbuf), 0); prec = 4; if (f.fmtFlags.precPresent && f.prec > 4) { prec = f.prec; width = (((2 + prec >> 0) + 2 >> 0) + 4 >> 0) + 1 >> 0; if (width > buf.$length) { buf = $makeSlice(sliceType$2, width); } } i = buf.$length; if (f.fmtFlags.sharp && (u.$high < 0 || (u.$high === 0 && u.$low <= 1114111)) && strconv.IsPrint(((u.$low >> 0)))) { i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 39); i = i - (utf8.RuneLen(((u.$low >> 0)))) >> 0; utf8.EncodeRune($subslice(buf, i), ((u.$low >> 0))); i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 39); i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 32); } while (true) { if (!((u.$high > 0 || (u.$high === 0 && u.$low >= 16)))) { break; } i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = "0123456789ABCDEFX".charCodeAt($flatten64(new $Uint64(u.$high & 0, (u.$low & 15) >>> 0)))); prec = prec - (1) >> 0; u = $shiftRightUint64(u, (4)); } i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = "0123456789ABCDEFX".charCodeAt($flatten64(u))); prec = prec - (1) >> 0; while (true) { if (!(prec > 0)) { break; } i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 48); prec = prec - (1) >> 0; } i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 43); i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 85); oldZero = f.fmtFlags.zero; f.fmtFlags.zero = false; f.pad($subslice(buf, i)); f.fmtFlags.zero = oldZero; }; fmt.prototype.fmtUnicode = function(u) { return this.$val.fmtUnicode(u); }; fmt.ptr.prototype.fmtInteger = function(u, base, isSigned, verb, digits) { var _1, _2, base, buf, digits, f, i, isSigned, negative, next, oldZero, oldZero$1, prec, u, verb, width, x, x$1, x$2, x$3, x$4; f = this; negative = isSigned && (x = (new $Int64(u.$high, u.$low)), (x.$high < 0 || (x.$high === 0 && x.$low < 0))); if (negative) { u = new $Uint64(-u.$high, -u.$low); } buf = $subslice(new sliceType$2(f.intbuf), 0); if (f.fmtFlags.widPresent || f.fmtFlags.precPresent) { width = (3 + f.wid >> 0) + f.prec >> 0; if (width > buf.$length) { buf = $makeSlice(sliceType$2, width); } } prec = 0; if (f.fmtFlags.precPresent) { prec = f.prec; if ((prec === 0) && (u.$high === 0 && u.$low === 0)) { oldZero = f.fmtFlags.zero; f.fmtFlags.zero = false; f.writePadding(f.wid); f.fmtFlags.zero = oldZero; return; } } else if (f.fmtFlags.zero && f.fmtFlags.widPresent) { prec = f.wid; if (negative || f.fmtFlags.plus || f.fmtFlags.space) { prec = prec - (1) >> 0; } } i = buf.$length; _1 = base; if (_1 === (10)) { while (true) { if (!((u.$high > 0 || (u.$high === 0 && u.$low >= 10)))) { break; } i = i - (1) >> 0; next = $div64(u, new $Uint64(0, 10), false); ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = (((x$1 = new $Uint64(0 + u.$high, 48 + u.$low), x$2 = $mul64(next, new $Uint64(0, 10)), new $Uint64(x$1.$high - x$2.$high, x$1.$low - x$2.$low)).$low << 24 >>> 24))); u = next; } } else if (_1 === (16)) { while (true) { if (!((u.$high > 0 || (u.$high === 0 && u.$low >= 16)))) { break; } i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = digits.charCodeAt($flatten64(new $Uint64(u.$high & 0, (u.$low & 15) >>> 0)))); u = $shiftRightUint64(u, (4)); } } else if (_1 === (8)) { while (true) { if (!((u.$high > 0 || (u.$high === 0 && u.$low >= 8)))) { break; } i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = (((x$3 = new $Uint64(u.$high & 0, (u.$low & 7) >>> 0), new $Uint64(0 + x$3.$high, 48 + x$3.$low)).$low << 24 >>> 24))); u = $shiftRightUint64(u, (3)); } } else if (_1 === (2)) { while (true) { if (!((u.$high > 0 || (u.$high === 0 && u.$low >= 2)))) { break; } i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = (((x$4 = new $Uint64(u.$high & 0, (u.$low & 1) >>> 0), new $Uint64(0 + x$4.$high, 48 + x$4.$low)).$low << 24 >>> 24))); u = $shiftRightUint64(u, (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"), undefined) : buf.$array[buf.$offset + i] = digits.charCodeAt($flatten64(u))); 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"), undefined) : buf.$array[buf.$offset + i] = 48); } if (f.fmtFlags.sharp) { _2 = base; if (_2 === (2)) { i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 98); i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 48); } else if (_2 === (8)) { if (!((((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i]) === 48))) { i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 48); } } else if (_2 === (16)) { i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = digits.charCodeAt(16)); i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 48); } } if (verb === 79) { i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 111); i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 48); } if (negative) { i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : 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"), undefined) : 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"), undefined) : buf.$array[buf.$offset + i] = 32); } oldZero$1 = f.fmtFlags.zero; f.fmtFlags.zero = false; f.pad($subslice(buf, i)); f.fmtFlags.zero = oldZero$1; }; fmt.prototype.fmtInteger = function(u, base, isSigned, verb, digits) { return this.$val.fmtInteger(u, base, isSigned, verb, digits); }; fmt.ptr.prototype.truncateString = function(s) { var _i, _ref, _rune, f, i, n, s; f = this; if (f.fmtFlags.precPresent) { n = f.prec; _ref = s; _i = 0; while (true) { if (!(_i < _ref.length)) { break; } _rune = $decodeRune(_ref, _i); i = _i; n = n - (1) >> 0; if (n < 0) { return $substring(s, 0, i); } _i += _rune[1]; } } return s; }; fmt.prototype.truncateString = function(s) { return this.$val.truncateString(s); }; fmt.ptr.prototype.truncate = function(b) { var _tuple, b, f, i, n, wid; f = this; if (f.fmtFlags.precPresent) { n = f.prec; i = 0; while (true) { if (!(i < b.$length)) { break; } n = n - (1) >> 0; if (n < 0) { return $subslice(b, 0, i); } wid = 1; if (((i < 0 || i >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + i]) >= 128) { _tuple = utf8.DecodeRune($subslice(b, i)); wid = _tuple[1]; } i = i + (wid) >> 0; } } return b; }; fmt.prototype.truncate = function(b) { return this.$val.truncate(b); }; fmt.ptr.prototype.fmtS = function(s) { var f, s; f = this; s = f.truncateString(s); f.padString(s); }; fmt.prototype.fmtS = function(s) { return this.$val.fmtS(s); }; fmt.ptr.prototype.fmtBs = function(b) { var b, f; f = this; b = f.truncate(b); f.pad(b); }; fmt.prototype.fmtBs = function(b) { return this.$val.fmtBs(b); }; fmt.ptr.prototype.fmtSbx = function(s, b, digits) { var b, buf, c, digits, f, i, length, s, width; f = this; length = b.$length; if (b === sliceType$2.nil) { length = s.length; } if (f.fmtFlags.precPresent && f.prec < length) { length = f.prec; } width = $imul(2, length); if (width > 0) { if (f.fmtFlags.space) { if (f.fmtFlags.sharp) { width = $imul(width, (2)); } width = width + ((length - 1 >> 0)) >> 0; } else if (f.fmtFlags.sharp) { width = width + (2) >> 0; } } else { if (f.fmtFlags.widPresent) { f.writePadding(f.wid); } return; } if (f.fmtFlags.widPresent && f.wid > width && !f.fmtFlags.minus) { f.writePadding(f.wid - width >> 0); } buf = f.buf.$get(); if (f.fmtFlags.sharp) { buf = $append(buf, 48, digits.charCodeAt(16)); } c = 0; i = 0; while (true) { if (!(i < length)) { break; } if (f.fmtFlags.space && i > 0) { buf = $append(buf, 32); if (f.fmtFlags.sharp) { buf = $append(buf, 48, digits.charCodeAt(16)); } } if (!(b === sliceType$2.nil)) { c = ((i < 0 || i >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + i]); } else { c = s.charCodeAt(i); } buf = $append(buf, digits.charCodeAt((c >>> 4 << 24 >>> 24)), digits.charCodeAt(((c & 15) >>> 0))); i = i + (1) >> 0; } f.buf.$set(buf); if (f.fmtFlags.widPresent && f.wid > width && f.fmtFlags.minus) { f.writePadding(f.wid - width >> 0); } }; fmt.prototype.fmtSbx = function(s, b, digits) { return this.$val.fmtSbx(s, b, digits); }; fmt.ptr.prototype.fmtSx = function(s, digits) { var digits, f, s; f = this; f.fmtSbx(s, sliceType$2.nil, digits); }; fmt.prototype.fmtSx = function(s, digits) { return this.$val.fmtSx(s, digits); }; fmt.ptr.prototype.fmtBx = function(b, digits) { var b, digits, f; f = this; f.fmtSbx("", b, digits); }; fmt.prototype.fmtBx = function(b, digits) { return this.$val.fmtBx(b, digits); }; fmt.ptr.prototype.fmtQ = function(s) { var buf, f, s; f = this; s = f.truncateString(s); if (f.fmtFlags.sharp && strconv.CanBackquote(s)) { f.padString("`" + s + "`"); return; } buf = $subslice(new sliceType$2(f.intbuf), 0, 0); if (f.fmtFlags.plus) { f.pad(strconv.AppendQuoteToASCII(buf, s)); } else { f.pad(strconv.AppendQuote(buf, s)); } }; fmt.prototype.fmtQ = function(s) { return this.$val.fmtQ(s); }; fmt.ptr.prototype.fmtC = function(c) { var buf, c, f, r, w; f = this; r = ((c.$low >> 0)); if ((c.$high > 0 || (c.$high === 0 && c.$low > 1114111))) { r = 65533; } buf = $subslice(new sliceType$2(f.intbuf), 0, 0); w = utf8.EncodeRune($subslice(buf, 0, 4), r); f.pad($subslice(buf, 0, w)); }; fmt.prototype.fmtC = function(c) { return this.$val.fmtC(c); }; fmt.ptr.prototype.fmtQc = function(c) { var buf, c, f, r; f = this; r = ((c.$low >> 0)); if ((c.$high > 0 || (c.$high === 0 && c.$low > 1114111))) { r = 65533; } buf = $subslice(new sliceType$2(f.intbuf), 0, 0); if (f.fmtFlags.plus) { f.pad(strconv.AppendQuoteRuneToASCII(buf, r)); } else { f.pad(strconv.AppendQuoteRune(buf, r)); } }; fmt.prototype.fmtQc = function(c) { return this.$val.fmtQc(c); }; fmt.ptr.prototype.fmtFloat = function(v, size, verb, prec) { var _1, _2, digits, f, hasDecimalPoint, i, num, oldZero, prec, sawNonzeroDigit, size, tail, tailBuf, v, verb; f = this; if (f.fmtFlags.precPresent) { prec = f.prec; } num = strconv.AppendFloat($subslice(new sliceType$2(f.intbuf), 0, 1), v, ((verb << 24 >>> 24)), prec, size); if (((1 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 1]) === 45) || ((1 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 1]) === 43)) { num = $subslice(num, 1); } else { (0 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 0] = 43); } if (f.fmtFlags.space && ((0 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 0]) === 43) && !f.fmtFlags.plus) { (0 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 0] = 32); } if (((1 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 1]) === 73) || ((1 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 1]) === 78)) { oldZero = f.fmtFlags.zero; f.fmtFlags.zero = false; if (((1 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 1]) === 78) && !f.fmtFlags.space && !f.fmtFlags.plus) { num = $subslice(num, 1); } f.pad(num); f.fmtFlags.zero = oldZero; return; } if (f.fmtFlags.sharp && !((verb === 98))) { digits = 0; _1 = verb; if ((_1 === (118)) || (_1 === (103)) || (_1 === (71)) || (_1 === (120))) { digits = prec; if (digits === -1) { digits = 6; } } tailBuf = arrayType$3.zero(); tail = $subslice(new sliceType$2(tailBuf), 0, 0); hasDecimalPoint = false; sawNonzeroDigit = false; i = 1; while (true) { if (!(i < num.$length)) { break; } switch (0) { default: _2 = ((i < 0 || i >= num.$length) ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + i]); if (_2 === (46)) { hasDecimalPoint = true; } else if ((_2 === (112)) || (_2 === (80))) { tail = $appendSlice(tail, $subslice(num, i)); num = $subslice(num, 0, i); } else if ((_2 === (101)) || (_2 === (69))) { if (!((verb === 120)) && !((verb === 88))) { tail = $appendSlice(tail, $subslice(num, i)); num = $subslice(num, 0, i); break; } if (!((((i < 0 || i >= num.$length) ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + i]) === 48))) { sawNonzeroDigit = true; } if (sawNonzeroDigit) { digits = digits - (1) >> 0; } } else { if (!((((i < 0 || i >= num.$length) ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + i]) === 48))) { sawNonzeroDigit = true; } if (sawNonzeroDigit) { digits = digits - (1) >> 0; } } } i = i + (1) >> 0; } if (!hasDecimalPoint) { if ((num.$length === 2) && ((1 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 1]) === 48)) { digits = digits - (1) >> 0; } num = $append(num, 46); } while (true) { if (!(digits > 0)) { break; } num = $append(num, 48); digits = digits - (1) >> 0; } num = $appendSlice(num, tail); } if (f.fmtFlags.plus || !(((0 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 0]) === 43))) { if (f.fmtFlags.zero && f.fmtFlags.widPresent && f.wid > num.$length) { f.buf.writeByte((0 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 0])); f.writePadding(f.wid - num.$length >> 0); f.buf.write($subslice(num, 1)); return; } f.pad(num); return; } f.pad($subslice(num, 1)); }; fmt.prototype.fmtFloat = function(v, size, verb, prec) { return this.$val.fmtFloat(v, size, verb, prec); }; Errorf = function(format, a) { var _r, a, err, format, p, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; a = $f.a; err = $f.err; format = $f.format; p = $f.p; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = newPrinter(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } p = _r; p.wrapErrs = true; $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)); err = $ifaceNil; if ($interfaceIsEqual(p.wrappedErr, $ifaceNil)) { err = errors.New(s); } else { err = new wrapError.ptr(s, p.wrappedErr); } p.free(); $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: Errorf }; } $f._r = _r; $f.a = a; $f.err = err; $f.format = format; $f.p = p; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Errorf = Errorf; wrapError.ptr.prototype.Error = function() { var e; e = this; return e.msg; }; wrapError.prototype.Error = function() { return this.$val.Error(); }; wrapError.ptr.prototype.Unwrap = function() { var e; e = this; return e.err; }; wrapError.prototype.Unwrap = function() { return this.$val.Unwrap(); }; ptrType$4.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$2], [$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$2, $error], false)}, {prop: "free", name: "free", pkg: "fmt", typ: $funcType([ssave], [], false)}, {prop: "SkipSpace", name: "SkipSpace", pkg: "", typ: $funcType([], [], false)}, {prop: "token", name: "token", pkg: "fmt", typ: $funcType([$Bool, funcType], [sliceType$2], 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: "scanPercent", name: "scanPercent", pkg: "fmt", typ: $funcType([], [], 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)}]; ptrType$1.methods = [{prop: "write", name: "write", pkg: "fmt", typ: $funcType([sliceType$2], [], false)}, {prop: "writeString", name: "writeString", pkg: "fmt", typ: $funcType([$String], [], false)}, {prop: "writeByte", name: "writeByte", pkg: "fmt", typ: $funcType([$Uint8], [], false)}, {prop: "writeRune", name: "writeRune", pkg: "fmt", typ: $funcType([$Int32], [], false)}]; ptrType$24.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: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([$String], [$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: "fmt0x64", name: "fmt0x64", pkg: "fmt", typ: $funcType([$Uint64, $Bool], [], false)}, {prop: "fmtInteger", name: "fmtInteger", pkg: "fmt", typ: $funcType([$Uint64, $Bool, $Int32], [], false)}, {prop: "fmtFloat", name: "fmtFloat", pkg: "fmt", typ: $funcType([$Float64, $Int, $Int32], [], false)}, {prop: "fmtComplex", name: "fmtComplex", pkg: "fmt", typ: $funcType([$Complex128, $Int, $Int32], [], false)}, {prop: "fmtString", name: "fmtString", pkg: "fmt", typ: $funcType([$String, $Int32], [], false)}, {prop: "fmtBytes", name: "fmtBytes", pkg: "fmt", typ: $funcType([sliceType$2, $Int32, $String], [], false)}, {prop: "fmtPointer", name: "fmtPointer", pkg: "fmt", typ: $funcType([reflect.Value, $Int32], [], false)}, {prop: "catchPanic", name: "catchPanic", pkg: "fmt", typ: $funcType([$emptyInterface, $Int32, $String], [], false)}, {prop: "handleMethods", name: "handleMethods", pkg: "fmt", typ: $funcType([$Int32], [$Bool], false)}, {prop: "printArg", name: "printArg", pkg: "fmt", typ: $funcType([$emptyInterface, $Int32], [], false)}, {prop: "printValue", name: "printValue", pkg: "fmt", typ: $funcType([reflect.Value, $Int32, $Int], [], false)}, {prop: "argNumber", name: "argNumber", pkg: "fmt", typ: $funcType([$Int, $String, $Int, $Int], [$Int, $Int, $Bool], false)}, {prop: "badArgNum", name: "badArgNum", pkg: "fmt", typ: $funcType([$Int32], [], false)}, {prop: "missingArg", name: "missingArg", pkg: "fmt", typ: $funcType([$Int32], [], false)}, {prop: "doPrintf", name: "doPrintf", pkg: "fmt", typ: $funcType([$String, sliceType$1], [], false)}, {prop: "doPrint", name: "doPrint", pkg: "fmt", typ: $funcType([sliceType$1], [], false)}, {prop: "doPrintln", name: "doPrintln", pkg: "fmt", typ: $funcType([sliceType$1], [], false)}]; ptrType$26.methods = [{prop: "clearflags", name: "clearflags", pkg: "fmt", typ: $funcType([], [], false)}, {prop: "init", name: "init", pkg: "fmt", typ: $funcType([ptrType$1], [], false)}, {prop: "writePadding", name: "writePadding", pkg: "fmt", typ: $funcType([$Int], [], false)}, {prop: "pad", name: "pad", pkg: "fmt", typ: $funcType([sliceType$2], [], false)}, {prop: "padString", name: "padString", pkg: "fmt", typ: $funcType([$String], [], false)}, {prop: "fmtBoolean", name: "fmtBoolean", pkg: "fmt", typ: $funcType([$Bool], [], false)}, {prop: "fmtUnicode", name: "fmtUnicode", pkg: "fmt", typ: $funcType([$Uint64], [], false)}, {prop: "fmtInteger", name: "fmtInteger", pkg: "fmt", typ: $funcType([$Uint64, $Int, $Bool, $Int32, $String], [], false)}, {prop: "truncateString", name: "truncateString", pkg: "fmt", typ: $funcType([$String], [$String], false)}, {prop: "truncate", name: "truncate", pkg: "fmt", typ: $funcType([sliceType$2], [sliceType$2], false)}, {prop: "fmtS", name: "fmtS", pkg: "fmt", typ: $funcType([$String], [], false)}, {prop: "fmtBs", name: "fmtBs", pkg: "fmt", typ: $funcType([sliceType$2], [], false)}, {prop: "fmtSbx", name: "fmtSbx", pkg: "fmt", typ: $funcType([$String, sliceType$2, $String], [], false)}, {prop: "fmtSx", name: "fmtSx", pkg: "fmt", typ: $funcType([$String, $String], [], false)}, {prop: "fmtBx", name: "fmtBx", pkg: "fmt", typ: $funcType([sliceType$2, $String], [], false)}, {prop: "fmtQ", name: "fmtQ", pkg: "fmt", typ: $funcType([$String], [], false)}, {prop: "fmtC", name: "fmtC", pkg: "fmt", typ: $funcType([$Uint64], [], false)}, {prop: "fmtQc", name: "fmtQc", pkg: "fmt", typ: $funcType([$Uint64], [], false)}, {prop: "fmtFloat", name: "fmtFloat", pkg: "fmt", typ: $funcType([$Float64, $Int, $Int32, $Int], [], false)}]; ptrType$27.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Unwrap", name: "Unwrap", pkg: "", typ: $funcType([], [$error], false)}]; ScanState.init([{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$2], [$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$2, $error], false)}, {prop: "UnreadRune", name: "UnreadRune", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Width", name: "Width", pkg: "", typ: $funcType([], [$Int, $Bool], false)}]); scanError.init("fmt", [{prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}]); ss.init("fmt", [{prop: "rs", name: "rs", embedded: false, exported: false, typ: io.RuneScanner, tag: ""}, {prop: "buf", name: "buf", embedded: false, exported: false, typ: buffer, tag: ""}, {prop: "count", name: "count", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "atEOF", name: "atEOF", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "ssave", name: "ssave", embedded: true, exported: false, typ: ssave, tag: ""}]); ssave.init("fmt", [{prop: "validSave", name: "validSave", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "nlIsEnd", name: "nlIsEnd", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "nlIsSpace", name: "nlIsSpace", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "argLimit", name: "argLimit", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "limit", name: "limit", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "maxWid", name: "maxWid", embedded: false, exported: false, typ: $Int, 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$2], [$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("fmt", [{prop: "buf", name: "buf", embedded: false, exported: false, typ: buffer, tag: ""}, {prop: "arg", name: "arg", embedded: false, exported: false, typ: $emptyInterface, tag: ""}, {prop: "value", name: "value", embedded: false, exported: false, typ: reflect.Value, tag: ""}, {prop: "fmt", name: "fmt", embedded: false, exported: false, typ: fmt, tag: ""}, {prop: "reordered", name: "reordered", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "goodArgNum", name: "goodArgNum", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "panicking", name: "panicking", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "erroring", name: "erroring", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "wrapErrs", name: "wrapErrs", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "wrappedErr", name: "wrappedErr", embedded: false, exported: false, typ: $error, tag: ""}]); fmtFlags.init("fmt", [{prop: "widPresent", name: "widPresent", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "precPresent", name: "precPresent", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "minus", name: "minus", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "plus", name: "plus", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "sharp", name: "sharp", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "space", name: "space", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "zero", name: "zero", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "plusV", name: "plusV", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "sharpV", name: "sharpV", embedded: false, exported: false, typ: $Bool, tag: ""}]); fmt.init("fmt", [{prop: "buf", name: "buf", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "fmtFlags", name: "fmtFlags", embedded: true, exported: false, typ: fmtFlags, tag: ""}, {prop: "wid", name: "wid", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "prec", name: "prec", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "intbuf", name: "intbuf", embedded: false, exported: false, typ: arrayType$1, tag: ""}]); wrapError.init("fmt", [{prop: "msg", name: "msg", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, 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 = fmtsort.$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 = math.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = os.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = reflect.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strconv.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sync.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = utf8.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } space = new sliceType([$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(sliceType$1.nil, (function() { return new ss.ptr($ifaceNil, buffer.nil, 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"); ppFree = new sync.Pool.ptr(sliceType$1.nil, (function() { return new pp.ptr(buffer.nil, $ifaceNil, new reflect.Value.ptr(ptrType.nil, 0, 0), new fmt.ptr(ptrType$1.nil, new fmtFlags.ptr(false, false, false, false, false, false, false, false, false), 0, 0, arrayType$1.zero()), false, false, false, false, false, $ifaceNil); })); /* */ } 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, bytealg, io, sync, unicode, utf8, asciiSet, stringFinder, Replacer, replacer, trieNode, genericReplacer, appendSliceWriter, stringWriter, singleStringReplacer, byteReplacer, byteStringReplacer, Reader, Builder, span, sliceType, ptrType, sliceType$1, ptrType$1, sliceType$2, arrayType, arrayType$1, sliceType$3, arrayType$2, ptrType$2, arrayType$3, ptrType$3, sliceType$4, ptrType$4, ptrType$5, ptrType$6, ptrType$7, ptrType$8, ptrType$9, ptrType$10, asciiSpace, explode, Contains, ContainsRune, IndexRune, IndexAny, LastIndexByte, genSplit, SplitN, Split, Fields, FieldsFunc, Join, HasPrefix, HasSuffix, Map, ToLower, TrimLeftFunc, TrimRightFunc, TrimFunc, IndexFunc, indexFunc, lastIndexFunc, makeASCIISet, makeCutsetFunc, Trim, TrimLeft, TrimRight, TrimSpace, TrimPrefix, TrimSuffix, Replace, EqualFold, makeStringFinder, longestCommonSuffix, max, NewReplacer, makeGenericReplacer, getStringWriter, makeSingleStringReplacer, NewReader, IndexByte, Index, LastIndex, Count; errors = $packages["errors"]; js = $packages["github.com/gopherjs/gopherjs/js"]; bytealg = $packages["internal/bytealg"]; io = $packages["io"]; sync = $packages["sync"]; unicode = $packages["unicode"]; utf8 = $packages["unicode/utf8"]; asciiSet = $pkg.asciiSet = $newType(32, $kindArray, "strings.asciiSet", true, "strings", false, null); stringFinder = $pkg.stringFinder = $newType(0, $kindStruct, "strings.stringFinder", true, "strings", false, function(pattern_, badCharSkip_, goodSuffixSkip_) { this.$val = this; if (arguments.length === 0) { this.pattern = ""; this.badCharSkip = arrayType$1.zero(); this.goodSuffixSkip = sliceType$3.nil; return; } this.pattern = pattern_; this.badCharSkip = badCharSkip_; this.goodSuffixSkip = goodSuffixSkip_; }); Replacer = $pkg.Replacer = $newType(0, $kindStruct, "strings.Replacer", true, "strings", true, function(once_, r_, oldnew_) { this.$val = this; if (arguments.length === 0) { this.once = new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)); this.r = $ifaceNil; this.oldnew = sliceType.nil; return; } this.once = once_; this.r = r_; this.oldnew = oldnew_; }); replacer = $pkg.replacer = $newType(8, $kindInterface, "strings.replacer", true, "strings", false, null); trieNode = $pkg.trieNode = $newType(0, $kindStruct, "strings.trieNode", true, "strings", false, function(value_, priority_, prefix_, next_, table_) { this.$val = this; if (arguments.length === 0) { this.value = ""; this.priority = 0; this.prefix = ""; this.next = ptrType$3.nil; this.table = sliceType$4.nil; return; } this.value = value_; this.priority = priority_; this.prefix = prefix_; this.next = next_; this.table = table_; }); genericReplacer = $pkg.genericReplacer = $newType(0, $kindStruct, "strings.genericReplacer", true, "strings", false, function(root_, tableSize_, mapping_) { this.$val = this; if (arguments.length === 0) { this.root = new trieNode.ptr("", 0, "", ptrType$3.nil, sliceType$4.nil); this.tableSize = 0; this.mapping = arrayType$2.zero(); return; } this.root = root_; this.tableSize = tableSize_; this.mapping = mapping_; }); appendSliceWriter = $pkg.appendSliceWriter = $newType(12, $kindSlice, "strings.appendSliceWriter", true, "strings", false, null); stringWriter = $pkg.stringWriter = $newType(0, $kindStruct, "strings.stringWriter", true, "strings", false, function(w_) { this.$val = this; if (arguments.length === 0) { this.w = $ifaceNil; return; } this.w = w_; }); singleStringReplacer = $pkg.singleStringReplacer = $newType(0, $kindStruct, "strings.singleStringReplacer", true, "strings", false, function(finder_, value_) { this.$val = this; if (arguments.length === 0) { this.finder = ptrType$5.nil; this.value = ""; return; } this.finder = finder_; this.value = value_; }); byteReplacer = $pkg.byteReplacer = $newType(256, $kindArray, "strings.byteReplacer", true, "strings", false, null); byteStringReplacer = $pkg.byteStringReplacer = $newType(0, $kindStruct, "strings.byteStringReplacer", true, "strings", false, function(replacements_, toReplace_) { this.$val = this; if (arguments.length === 0) { this.replacements = arrayType$3.zero(); this.toReplace = sliceType.nil; return; } this.replacements = replacements_; this.toReplace = toReplace_; }); Reader = $pkg.Reader = $newType(0, $kindStruct, "strings.Reader", true, "strings", true, 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_; }); Builder = $pkg.Builder = $newType(0, $kindStruct, "strings.Builder", true, "strings", true, function(addr_, buf_) { this.$val = this; if (arguments.length === 0) { this.addr = ptrType$1.nil; this.buf = sliceType$2.nil; return; } this.addr = addr_; this.buf = buf_; }); span = $newType(0, $kindStruct, "strings.span", true, "strings", false, function(start_, end_) { this.$val = this; if (arguments.length === 0) { this.start = 0; this.end = 0; return; } this.start = start_; this.end = end_; }); sliceType = $sliceType($String); ptrType = $ptrType(asciiSet); sliceType$1 = $sliceType(span); ptrType$1 = $ptrType(Builder); sliceType$2 = $sliceType($Uint8); arrayType = $arrayType($Uint32, 8); arrayType$1 = $arrayType($Int, 256); sliceType$3 = $sliceType($Int); arrayType$2 = $arrayType($Uint8, 256); ptrType$2 = $ptrType(byteReplacer); arrayType$3 = $arrayType(sliceType$2, 256); ptrType$3 = $ptrType(trieNode); sliceType$4 = $sliceType(ptrType$3); ptrType$4 = $ptrType(appendSliceWriter); ptrType$5 = $ptrType(stringFinder); ptrType$6 = $ptrType(Replacer); ptrType$7 = $ptrType(genericReplacer); ptrType$8 = $ptrType(singleStringReplacer); ptrType$9 = $ptrType(byteStringReplacer); ptrType$10 = $ptrType(Reader); explode = function(s, n) { var _tuple, a, ch, i, l, n, s, size, x; l = utf8.RuneCountInString(s); if (n < 0 || n > l) { n = l; } a = $makeSlice(sliceType, n); i = 0; while (true) { if (!(i < (n - 1 >> 0))) { break; } _tuple = utf8.DecodeRuneInString(s); ch = _tuple[0]; size = _tuple[1]; ((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i] = $substring(s, 0, size)); s = $substring(s, size); if (ch === 65533) { ((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i] = "\xEF\xBF\xBD"); } i = i + (1) >> 0; } if (n > 0) { (x = n - 1 >> 0, ((x < 0 || x >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + x] = s)); } return a; }; Contains = function(s, substr) { var s, substr; return Index(s, substr) >= 0; }; $pkg.Contains = Contains; ContainsRune = function(s, r) { var r, s; return IndexRune(s, r) >= 0; }; $pkg.ContainsRune = ContainsRune; IndexRune = function(s, r) { var _i, _ref, _rune, i, r, r$1, s; if (0 <= r && r < 128) { return IndexByte(s, ((r << 24 >>> 24))); } else if ((r === 65533)) { _ref = s; _i = 0; while (true) { if (!(_i < _ref.length)) { break; } _rune = $decodeRune(_ref, _i); i = _i; r$1 = _rune[0]; if (r$1 === 65533) { return i; } _i += _rune[1]; } return -1; } else if (!utf8.ValidRune(r)) { return -1; } else { return Index(s, ($encodeRune(r))); } }; $pkg.IndexRune = IndexRune; IndexAny = function(s, chars) { var _i, _ref, _rune, _tuple, as, c, chars, i, i$1, isASCII, r, s; if (chars === "") { return -1; } if (chars.length === 1) { r = ((chars.charCodeAt(0) >> 0)); if (r >= 128) { r = 65533; } return IndexRune(s, r); } if (s.length > 8) { _tuple = makeASCIISet(chars); as = $clone(_tuple[0], asciiSet); isASCII = _tuple[1]; if (isASCII) { i = 0; while (true) { if (!(i < s.length)) { break; } if (new ptrType(as).contains(s.charCodeAt(i))) { return i; } i = i + (1) >> 0; } return -1; } } _ref = s; _i = 0; while (true) { if (!(_i < _ref.length)) { break; } _rune = $decodeRune(_ref, _i); i$1 = _i; c = _rune[0]; if (IndexRune(chars, c) >= 0) { return i$1; } _i += _rune[1]; } return -1; }; $pkg.IndexAny = IndexAny; LastIndexByte = function(s, c) { var c, i, s; i = s.length - 1 >> 0; while (true) { if (!(i >= 0)) { break; } if (s.charCodeAt(i) === c) { return i; } i = i - (1) >> 0; } return -1; }; $pkg.LastIndexByte = LastIndexByte; genSplit = function(s, sep, sepSave, n) { var a, i, m, n, s, sep, sepSave; if (n === 0) { return sliceType.nil; } if (sep === "") { return explode(s, n); } if (n < 0) { n = Count(s, sep) + 1 >> 0; } a = $makeSlice(sliceType, n); n = n - (1) >> 0; i = 0; while (true) { if (!(i < n)) { break; } m = Index(s, sep); if (m < 0) { break; } ((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i] = $substring(s, 0, (m + sepSave >> 0))); s = $substring(s, (m + sep.length >> 0)); i = i + (1) >> 0; } ((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i] = s); return $subslice(a, 0, (i + 1 >> 0)); }; SplitN = function(s, sep, n) { var n, s, sep; return genSplit(s, sep, 0, n); }; $pkg.SplitN = SplitN; Split = function(s, sep) { var s, sep; return genSplit(s, sep, 0, -1); }; $pkg.Split = Split; Fields = function(s) { var $24r, _r, a, fieldStart, i, i$1, isSpace, n, na, r, s, setBits, wasSpace, x, x$1, x$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; a = $f.a; fieldStart = $f.fieldStart; i = $f.i; i$1 = $f.i$1; isSpace = $f.isSpace; n = $f.n; na = $f.na; r = $f.r; s = $f.s; setBits = $f.setBits; wasSpace = $f.wasSpace; 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; wasSpace = 1; setBits = 0; i = 0; while (true) { if (!(i < s.length)) { break; } r = s.charCodeAt(i); setBits = (setBits | (r)) >>> 0; isSpace = ((((r < 0 || r >= asciiSpace.length) ? ($throwRuntimeError("index out of range"), undefined) : asciiSpace[r]) >> 0)); n = n + ((wasSpace & (~isSpace >> 0))) >> 0; wasSpace = isSpace; i = i + (1) >> 0; } /* */ if (setBits >= 128) { $s = 1; continue; } /* */ $s = 2; continue; /* if (setBits >= 128) { */ case 1: _r = FieldsFunc(s, unicode.IsSpace); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 4; case 4: return $24r; /* } */ case 2: a = $makeSlice(sliceType, n); na = 0; fieldStart = 0; i$1 = 0; while (true) { if (!(i$1 < s.length && !(((x = s.charCodeAt(i$1), ((x < 0 || x >= asciiSpace.length) ? ($throwRuntimeError("index out of range"), undefined) : asciiSpace[x])) === 0)))) { break; } i$1 = i$1 + (1) >> 0; } fieldStart = i$1; while (true) { if (!(i$1 < s.length)) { break; } if ((x$1 = s.charCodeAt(i$1), ((x$1 < 0 || x$1 >= asciiSpace.length) ? ($throwRuntimeError("index out of range"), undefined) : asciiSpace[x$1])) === 0) { i$1 = i$1 + (1) >> 0; continue; } ((na < 0 || na >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + na] = $substring(s, fieldStart, i$1)); na = na + (1) >> 0; i$1 = i$1 + (1) >> 0; while (true) { if (!(i$1 < s.length && !(((x$2 = s.charCodeAt(i$1), ((x$2 < 0 || x$2 >= asciiSpace.length) ? ($throwRuntimeError("index out of range"), undefined) : asciiSpace[x$2])) === 0)))) { break; } i$1 = i$1 + (1) >> 0; } fieldStart = i$1; } if (fieldStart < s.length) { ((na < 0 || na >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + na] = $substring(s, fieldStart)); } $s = -1; return a; /* */ } return; } if ($f === undefined) { $f = { $blk: Fields }; } $f.$24r = $24r; $f._r = _r; $f.a = a; $f.fieldStart = fieldStart; $f.i = i; $f.i$1 = i$1; $f.isSpace = isSpace; $f.n = n; $f.na = na; $f.r = r; $f.s = s; $f.setBits = setBits; $f.wasSpace = wasSpace; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Fields = Fields; FieldsFunc = function(s, f) { var _i, _i$1, _r, _ref, _ref$1, _rune, a, end, f, i, rune, s, span$1, spans, start, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _ref = $f._ref; _ref$1 = $f._ref$1; _rune = $f._rune; a = $f.a; end = $f.end; f = $f.f; i = $f.i; rune = $f.rune; s = $f.s; span$1 = $f.span$1; spans = $f.spans; start = $f.start; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: spans = $makeSlice(sliceType$1, 0, 32); start = -1; _ref = s; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.length)) { break; } */ if(!(_i < _ref.length)) { $s = 2; continue; } _rune = $decodeRune(_ref, _i); end = _i; rune = _rune[0]; _r = f(rune); /* */ $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: if (start >= 0) { spans = $append(spans, new span.ptr(start, end)); start = ~start >> 0; } $s = 5; continue; /* } else { */ case 4: if (start < 0) { start = end; } /* } */ case 5: _i += _rune[1]; $s = 1; continue; case 2: if (start >= 0) { spans = $append(spans, new span.ptr(start, s.length)); } a = $makeSlice(sliceType, spans.$length); _ref$1 = spans; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } i = _i$1; span$1 = $clone(((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]), span); ((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i] = $substring(s, span$1.start, span$1.end)); _i$1++; } $s = -1; return a; /* */ } return; } if ($f === undefined) { $f = { $blk: FieldsFunc }; } $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._ref = _ref; $f._ref$1 = _ref$1; $f._rune = _rune; $f.a = a; $f.end = end; $f.f = f; $f.i = i; $f.rune = rune; $f.s = s; $f.span$1 = span$1; $f.spans = spans; $f.start = start; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.FieldsFunc = FieldsFunc; Join = function(elems, sep) { var _1, _i, _ref, b, elems, i, n, s, sep; _1 = elems.$length; if (_1 === (0)) { return ""; } else if (_1 === (1)) { return (0 >= elems.$length ? ($throwRuntimeError("index out of range"), undefined) : elems.$array[elems.$offset + 0]); } n = $imul(sep.length, ((elems.$length - 1 >> 0))); i = 0; while (true) { if (!(i < elems.$length)) { break; } n = n + (((i < 0 || i >= elems.$length) ? ($throwRuntimeError("index out of range"), undefined) : elems.$array[elems.$offset + i]).length) >> 0; i = i + (1) >> 0; } b = new Builder.ptr(ptrType$1.nil, sliceType$2.nil); b.Grow(n); b.WriteString((0 >= elems.$length ? ($throwRuntimeError("index out of range"), undefined) : elems.$array[elems.$offset + 0])); _ref = $subslice(elems, 1); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } s = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); b.WriteString(sep); b.WriteString(s); _i++; } return b.String(); }; $pkg.Join = Join; HasPrefix = function(s, prefix) { var prefix, s; return s.length >= prefix.length && $substring(s, 0, prefix.length) === prefix; }; $pkg.HasPrefix = HasPrefix; HasSuffix = function(s, suffix) { var s, suffix; return s.length >= suffix.length && $substring(s, (s.length - suffix.length >> 0)) === suffix; }; $pkg.HasSuffix = HasSuffix; Map = function(mapping, s) { var _i, _i$1, _r, _r$1, _ref, _ref$1, _rune, _rune$1, _tuple, b, c, c$1, i, mapping, r, r$1, s, width, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; _ref$1 = $f._ref$1; _rune = $f._rune; _rune$1 = $f._rune$1; _tuple = $f._tuple; b = $f.b; c = $f.c; c$1 = $f.c$1; i = $f.i; mapping = $f.mapping; r = $f.r; r$1 = $f.r$1; s = $f.s; width = $f.width; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = new Builder.ptr(ptrType$1.nil, sliceType$2.nil); _ref = s; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.length)) { break; } */ if(!(_i < _ref.length)) { $s = 2; continue; } _rune = $decodeRune(_ref, _i); i = _i; c = _rune[0]; _r = mapping(c); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } r = _r; if ((r === c) && !((c === 65533))) { _i += _rune[1]; /* continue; */ $s = 1; continue; } width = 0; if (c === 65533) { _tuple = utf8.DecodeRuneInString($substring(s, i)); c = _tuple[0]; width = _tuple[1]; if (!((width === 1)) && (r === c)) { _i += _rune[1]; /* continue; */ $s = 1; continue; } } else { width = utf8.RuneLen(c); } b.Grow(s.length + 4 >> 0); b.WriteString($substring(s, 0, i)); if (r >= 0) { b.WriteRune(r); } s = $substring(s, (i + width >> 0)); /* break; */ $s = 2; continue; case 2: if (b.Cap() === 0) { $s = -1; return s; } _ref$1 = s; _i$1 = 0; /* while (true) { */ case 4: /* if (!(_i$1 < _ref$1.length)) { break; } */ if(!(_i$1 < _ref$1.length)) { $s = 5; continue; } _rune$1 = $decodeRune(_ref$1, _i$1); c$1 = _rune$1[0]; _r$1 = mapping(c$1); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } r$1 = _r$1; if (r$1 >= 0) { if (r$1 < 128) { b.WriteByte(((r$1 << 24 >>> 24))); } else { b.WriteRune(r$1); } } _i$1 += _rune$1[1]; $s = 4; continue; case 5: $s = -1; return b.String(); /* */ } return; } if ($f === undefined) { $f = { $blk: Map }; } $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f._ref$1 = _ref$1; $f._rune = _rune; $f._rune$1 = _rune$1; $f._tuple = _tuple; $f.b = b; $f.c = c; $f.c$1 = c$1; $f.i = i; $f.mapping = mapping; $f.r = r; $f.r$1 = r$1; $f.s = s; $f.width = width; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Map = Map; ToLower = function(s) { var $24r, _r, _tmp, _tmp$1, b, c, c$1, hasUpper, i, i$1, isASCII, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; b = $f.b; c = $f.c; c$1 = $f.c$1; hasUpper = $f.hasUpper; i = $f.i; i$1 = $f.i$1; isASCII = $f.isASCII; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _tmp = true; _tmp$1 = false; isASCII = _tmp; hasUpper = _tmp$1; i = 0; while (true) { if (!(i < s.length)) { break; } c = s.charCodeAt(i); if (c >= 128) { isASCII = false; break; } hasUpper = hasUpper || (65 <= c && c <= 90); i = i + (1) >> 0; } if (isASCII) { if (!hasUpper) { $s = -1; return s; } b = new Builder.ptr(ptrType$1.nil, sliceType$2.nil); b.Grow(s.length); i$1 = 0; while (true) { if (!(i$1 < s.length)) { break; } c$1 = s.charCodeAt(i$1); if (65 <= c$1 && c$1 <= 90) { c$1 = c$1 + (32) << 24 >>> 24; } b.WriteByte(c$1); i$1 = i$1 + (1) >> 0; } $s = -1; return b.String(); } _r = Map(unicode.ToLower, s); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: ToLower }; } $f.$24r = $24r; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.b = b; $f.c = c; $f.c$1 = c$1; $f.hasUpper = hasUpper; $f.i = i; $f.i$1 = i$1; $f.isASCII = isASCII; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.ToLower = ToLower; TrimLeftFunc = function(s, f) { var _r, f, i, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; f = $f.f; i = $f.i; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = indexFunc(s, f, false); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } i = _r; if (i === -1) { $s = -1; return ""; } $s = -1; return $substring(s, i); /* */ } return; } if ($f === undefined) { $f = { $blk: TrimLeftFunc }; } $f._r = _r; $f.f = f; $f.i = i; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.TrimLeftFunc = TrimLeftFunc; TrimRightFunc = function(s, f) { var _r, _tuple, f, i, s, wid, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; f = $f.f; i = $f.i; s = $f.s; wid = $f.wid; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = lastIndexFunc(s, f, false); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } i = _r; if (i >= 0 && s.charCodeAt(i) >= 128) { _tuple = utf8.DecodeRuneInString($substring(s, i)); wid = _tuple[1]; i = i + (wid) >> 0; } else { i = i + (1) >> 0; } $s = -1; return $substring(s, 0, i); /* */ } return; } if ($f === undefined) { $f = { $blk: TrimRightFunc }; } $f._r = _r; $f._tuple = _tuple; $f.f = f; $f.i = i; $f.s = s; $f.wid = wid; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.TrimRightFunc = TrimRightFunc; TrimFunc = function(s, f) { var $24r, _r, _r$1, f, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; f = $f.f; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = TrimLeftFunc(s, f); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = TrimRightFunc(_r, f); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: TrimFunc }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f.f = f; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.TrimFunc = TrimFunc; IndexFunc = function(s, f) { var $24r, _r, f, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; f = $f.f; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = indexFunc(s, f, true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: IndexFunc }; } $f.$24r = $24r; $f._r = _r; $f.f = f; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.IndexFunc = IndexFunc; indexFunc = function(s, f, truth) { var _i, _r, _ref, _rune, f, i, r, s, truth, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _ref = $f._ref; _rune = $f._rune; f = $f.f; i = $f.i; r = $f.r; s = $f.s; truth = $f.truth; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _ref = s; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.length)) { break; } */ if(!(_i < _ref.length)) { $s = 2; continue; } _rune = $decodeRune(_ref, _i); i = _i; r = _rune[0]; _r = f(r); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (_r === truth) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_r === truth) { */ case 3: $s = -1; return i; /* } */ case 4: _i += _rune[1]; $s = 1; continue; case 2: $s = -1; return -1; /* */ } return; } if ($f === undefined) { $f = { $blk: indexFunc }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f._rune = _rune; $f.f = f; $f.i = i; $f.r = r; $f.s = s; $f.truth = truth; $f.$s = $s; $f.$r = $r; return $f; }; lastIndexFunc = function(s, f, truth) { var _r, _tuple, f, i, r, s, size, truth, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; f = $f.f; i = $f.i; r = $f.r; s = $f.s; size = $f.size; truth = $f.truth; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: i = s.length; /* while (true) { */ case 1: /* if (!(i > 0)) { break; } */ if(!(i > 0)) { $s = 2; continue; } _tuple = utf8.DecodeLastRuneInString($substring(s, 0, i)); r = _tuple[0]; size = _tuple[1]; i = i - (size) >> 0; _r = f(r); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (_r === truth) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_r === truth) { */ case 3: $s = -1; return i; /* } */ case 4: $s = 1; continue; case 2: $s = -1; return -1; /* */ } return; } if ($f === undefined) { $f = { $blk: lastIndexFunc }; } $f._r = _r; $f._tuple = _tuple; $f.f = f; $f.i = i; $f.r = r; $f.s = s; $f.size = size; $f.truth = truth; $f.$s = $s; $f.$r = $r; return $f; }; makeASCIISet = function(chars) { var _index, _tmp, _tmp$1, _tmp$2, _tmp$3, as, c, chars, i, ok, y; as = arrayType.zero(); ok = false; i = 0; while (true) { if (!(i < chars.length)) { break; } c = chars.charCodeAt(i); if (c >= 128) { _tmp = $clone(as, asciiSet); _tmp$1 = false; asciiSet.copy(as, _tmp); ok = _tmp$1; return [as, ok]; } _index = c >>> 5 << 24 >>> 24; ((_index < 0 || _index >= as.length) ? ($throwRuntimeError("index out of range"), undefined) : as[_index] = ((((_index < 0 || _index >= as.length) ? ($throwRuntimeError("index out of range"), undefined) : as[_index]) | (((y = ((((c & 31) >>> 0) >>> 0)), y < 32 ? (1 << y) : 0) >>> 0))) >>> 0)); i = i + (1) >> 0; } _tmp$2 = $clone(as, asciiSet); _tmp$3 = true; asciiSet.copy(as, _tmp$2); ok = _tmp$3; return [as, ok]; }; asciiSet.prototype.contains = function(c) { var as, c, x, x$1, y; as = this.$val; return !((((((x = as, x$1 = c >>> 5 << 24 >>> 24, ((x$1 < 0 || x$1 >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[x$1])) & (((y = ((((c & 31) >>> 0) >>> 0)), y < 32 ? (1 << y) : 0) >>> 0))) >>> 0)) === 0)); }; $ptrType(asciiSet).prototype.contains = function(c) { return (new asciiSet(this.$get())).contains(c); }; makeCutsetFunc = function(cutset) { var _tuple, as, cutset, isASCII; if ((cutset.length === 1) && cutset.charCodeAt(0) < 128) { return (function(r) { var r; return r === ((cutset.charCodeAt(0) >> 0)); }); } _tuple = makeASCIISet(cutset); as = $clone(_tuple[0], asciiSet); isASCII = _tuple[1]; if (isASCII) { return (function(r) { var r; return r < 128 && new ptrType(as).contains(((r << 24 >>> 24))); }); } return (function(r) { var r; return IndexRune(cutset, r) >= 0; }); }; Trim = function(s, cutset) { var $24r, _r, cutset, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; cutset = $f.cutset; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (s === "" || cutset === "") { $s = -1; return s; } _r = TrimFunc(s, makeCutsetFunc(cutset)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Trim }; } $f.$24r = $24r; $f._r = _r; $f.cutset = cutset; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Trim = Trim; TrimLeft = function(s, cutset) { var $24r, _r, cutset, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; cutset = $f.cutset; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (s === "" || cutset === "") { $s = -1; return s; } _r = TrimLeftFunc(s, makeCutsetFunc(cutset)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: TrimLeft }; } $f.$24r = $24r; $f._r = _r; $f.cutset = cutset; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.TrimLeft = TrimLeft; TrimRight = function(s, cutset) { var $24r, _r, cutset, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; cutset = $f.cutset; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (s === "" || cutset === "") { $s = -1; return s; } _r = TrimRightFunc(s, makeCutsetFunc(cutset)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: TrimRight }; } $f.$24r = $24r; $f._r = _r; $f.cutset = cutset; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.TrimRight = TrimRight; TrimSpace = function(s) { var $24r, $24r$1, _r, _r$1, c, c$1, s, start, stop, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; _r$1 = $f._r$1; c = $f.c; c$1 = $f.c$1; s = $f.s; start = $f.start; stop = $f.stop; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: start = 0; /* while (true) { */ case 1: /* if (!(start < s.length)) { break; } */ if(!(start < s.length)) { $s = 2; continue; } c = s.charCodeAt(start); /* */ if (c >= 128) { $s = 3; continue; } /* */ $s = 4; continue; /* if (c >= 128) { */ case 3: _r = TrimFunc($substring(s, start), unicode.IsSpace); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 6; case 6: return $24r; /* } */ case 4: if (((c < 0 || c >= asciiSpace.length) ? ($throwRuntimeError("index out of range"), undefined) : asciiSpace[c]) === 0) { /* break; */ $s = 2; continue; } start = start + (1) >> 0; $s = 1; continue; case 2: stop = s.length; /* while (true) { */ case 7: /* if (!(stop > start)) { break; } */ if(!(stop > start)) { $s = 8; continue; } c$1 = s.charCodeAt((stop - 1 >> 0)); /* */ if (c$1 >= 128) { $s = 9; continue; } /* */ $s = 10; continue; /* if (c$1 >= 128) { */ case 9: _r$1 = TrimFunc($substring(s, start, stop), unicode.IsSpace); /* */ $s = 11; case 11: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r$1 = _r$1; $s = 12; case 12: return $24r$1; /* } */ case 10: if (((c$1 < 0 || c$1 >= asciiSpace.length) ? ($throwRuntimeError("index out of range"), undefined) : asciiSpace[c$1]) === 0) { /* break; */ $s = 8; continue; } stop = stop - (1) >> 0; $s = 7; continue; case 8: $s = -1; return $substring(s, start, stop); /* */ } return; } if ($f === undefined) { $f = { $blk: TrimSpace }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f._r$1 = _r$1; $f.c = c; $f.c$1 = c$1; $f.s = s; $f.start = start; $f.stop = stop; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.TrimSpace = TrimSpace; TrimPrefix = function(s, prefix) { var prefix, s; if (HasPrefix(s, prefix)) { return $substring(s, prefix.length); } return s; }; $pkg.TrimPrefix = TrimPrefix; TrimSuffix = function(s, suffix) { var s, suffix; if (HasSuffix(s, suffix)) { return $substring(s, 0, (s.length - suffix.length >> 0)); } return s; }; $pkg.TrimSuffix = TrimSuffix; Replace = function(s, old, new$1, n) { var _tuple, b, i, j, m, n, new$1, old, s, start, wid; if (old === new$1 || (n === 0)) { return s; } m = Count(s, old); if (m === 0) { return s; } else if (n < 0 || m < n) { n = m; } b = new Builder.ptr(ptrType$1.nil, sliceType$2.nil); b.Grow(s.length + ($imul(n, ((new$1.length - old.length >> 0)))) >> 0); start = 0; i = 0; while (true) { if (!(i < n)) { break; } j = start; if (old.length === 0) { if (i > 0) { _tuple = utf8.DecodeRuneInString($substring(s, start)); wid = _tuple[1]; j = j + (wid) >> 0; } } else { j = j + (Index($substring(s, start), old)) >> 0; } b.WriteString($substring(s, start, j)); b.WriteString(new$1); start = j + old.length >> 0; i = i + (1) >> 0; } b.WriteString($substring(s, start)); return b.String(); }; $pkg.Replace = Replace; EqualFold = function(s, t) { var _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 === "") && !(t === ""))) { break; } _tmp = 0; _tmp$1 = 0; sr = _tmp; tr = _tmp$1; if (s.charCodeAt(0) < 128) { _tmp$2 = ((s.charCodeAt(0) >> 0)); _tmp$3 = $substring(s, 1); sr = _tmp$2; s = _tmp$3; } else { _tuple = utf8.DecodeRuneInString(s); r = _tuple[0]; size = _tuple[1]; _tmp$4 = r; _tmp$5 = $substring(s, size); sr = _tmp$4; s = _tmp$5; } if (t.charCodeAt(0) < 128) { _tmp$6 = ((t.charCodeAt(0) >> 0)); _tmp$7 = $substring(t, 1); tr = _tmp$6; t = _tmp$7; } else { _tuple$1 = utf8.DecodeRuneInString(t); r$1 = _tuple$1[0]; size$1 = _tuple$1[1]; _tmp$8 = r$1; _tmp$9 = $substring(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) { if (65 <= sr && sr <= 90 && (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 === t; }; $pkg.EqualFold = EqualFold; makeStringFinder = function(pattern) { var _i, _ref, f, i, i$1, i$2, i$3, last, lastPrefix, lenSuffix, pattern, x, x$1, x$2, x$3, x$4, x$5; f = new stringFinder.ptr(pattern, arrayType$1.zero(), $makeSlice(sliceType$3, pattern.length)); last = pattern.length - 1 >> 0; _ref = f.badCharSkip; _i = 0; while (true) { if (!(_i < 256)) { break; } i = _i; (x = f.badCharSkip, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i] = pattern.length)); _i++; } i$1 = 0; while (true) { if (!(i$1 < last)) { break; } (x$1 = f.badCharSkip, x$2 = pattern.charCodeAt(i$1), ((x$2 < 0 || x$2 >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[x$2] = (last - i$1 >> 0))); i$1 = i$1 + (1) >> 0; } lastPrefix = last; i$2 = last; while (true) { if (!(i$2 >= 0)) { break; } if (HasPrefix(pattern, $substring(pattern, (i$2 + 1 >> 0)))) { lastPrefix = i$2 + 1 >> 0; } (x$3 = f.goodSuffixSkip, ((i$2 < 0 || i$2 >= x$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + i$2] = ((lastPrefix + last >> 0) - i$2 >> 0))); i$2 = i$2 - (1) >> 0; } i$3 = 0; while (true) { if (!(i$3 < last)) { break; } lenSuffix = longestCommonSuffix(pattern, $substring(pattern, 1, (i$3 + 1 >> 0))); if (!((pattern.charCodeAt((i$3 - lenSuffix >> 0)) === pattern.charCodeAt((last - lenSuffix >> 0))))) { (x$4 = f.goodSuffixSkip, x$5 = last - lenSuffix >> 0, ((x$5 < 0 || x$5 >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + x$5] = ((lenSuffix + last >> 0) - i$3 >> 0))); } i$3 = i$3 + (1) >> 0; } return f; }; longestCommonSuffix = function(a, b) { var a, b, i; i = 0; while (true) { if (!(i < a.length && i < b.length)) { break; } if (!((a.charCodeAt(((a.length - 1 >> 0) - i >> 0)) === b.charCodeAt(((b.length - 1 >> 0) - i >> 0))))) { break; } i = i + (1) >> 0; } return i; }; stringFinder.ptr.prototype.next = function(text) { var f, i, j, text, x, x$1, x$2; f = this; i = f.pattern.length - 1 >> 0; while (true) { if (!(i < text.length)) { break; } j = f.pattern.length - 1 >> 0; while (true) { if (!(j >= 0 && (text.charCodeAt(i) === f.pattern.charCodeAt(j)))) { break; } i = i - (1) >> 0; j = j - (1) >> 0; } if (j < 0) { return i + 1 >> 0; } i = i + (max((x = f.badCharSkip, x$1 = text.charCodeAt(i), ((x$1 < 0 || x$1 >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[x$1])), (x$2 = f.goodSuffixSkip, ((j < 0 || j >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + j])))) >> 0; } return -1; }; stringFinder.prototype.next = function(text) { return this.$val.next(text); }; max = function(a, b) { var a, b; if (a > b) { return a; } return b; }; NewReplacer = function(oldnew) { var _r, oldnew; if ((_r = oldnew.$length % 2, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) === 1) { $panic(new $String("strings.NewReplacer: odd argument count")); } return new Replacer.ptr(new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)), $ifaceNil, $appendSlice((sliceType.nil), oldnew)); }; $pkg.NewReplacer = NewReplacer; Replacer.ptr.prototype.buildOnce = function() { var r; r = this; r.r = r.build(); r.oldnew = sliceType.nil; }; Replacer.prototype.buildOnce = function() { return this.$val.buildOnce(); }; Replacer.ptr.prototype.build = function() { var _i, _q, _ref, allNewBytes, b, i, i$1, i$2, i$3, n, n$1, o, o$1, oldnew, r, r$1, x, x$1, x$2, x$3, x$4; b = this; oldnew = b.oldnew; if ((oldnew.$length === 2) && (0 >= oldnew.$length ? ($throwRuntimeError("index out of range"), undefined) : oldnew.$array[oldnew.$offset + 0]).length > 1) { return makeSingleStringReplacer((0 >= oldnew.$length ? ($throwRuntimeError("index out of range"), undefined) : oldnew.$array[oldnew.$offset + 0]), (1 >= oldnew.$length ? ($throwRuntimeError("index out of range"), undefined) : oldnew.$array[oldnew.$offset + 1])); } allNewBytes = true; i = 0; while (true) { if (!(i < oldnew.$length)) { break; } if (!((((i < 0 || i >= oldnew.$length) ? ($throwRuntimeError("index out of range"), undefined) : oldnew.$array[oldnew.$offset + i]).length === 1))) { return makeGenericReplacer(oldnew); } if (!(((x = i + 1 >> 0, ((x < 0 || x >= oldnew.$length) ? ($throwRuntimeError("index out of range"), undefined) : oldnew.$array[oldnew.$offset + x])).length === 1))) { allNewBytes = false; } i = i + (2) >> 0; } if (allNewBytes) { r = arrayType$2.zero(); _ref = r; _i = 0; while (true) { if (!(_i < 256)) { break; } i$1 = _i; ((i$1 < 0 || i$1 >= r.length) ? ($throwRuntimeError("index out of range"), undefined) : r[i$1] = ((i$1 << 24 >>> 24))); _i++; } i$2 = oldnew.$length - 2 >> 0; while (true) { if (!(i$2 >= 0)) { break; } o = ((i$2 < 0 || i$2 >= oldnew.$length) ? ($throwRuntimeError("index out of range"), undefined) : oldnew.$array[oldnew.$offset + i$2]).charCodeAt(0); n = (x$1 = i$2 + 1 >> 0, ((x$1 < 0 || x$1 >= oldnew.$length) ? ($throwRuntimeError("index out of range"), undefined) : oldnew.$array[oldnew.$offset + x$1])).charCodeAt(0); ((o < 0 || o >= r.length) ? ($throwRuntimeError("index out of range"), undefined) : r[o] = n); i$2 = i$2 - (2) >> 0; } return new ptrType$2(r); } r$1 = new byteStringReplacer.ptr(arrayType$3.zero(), $makeSlice(sliceType, 0, (_q = oldnew.$length / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")))); i$3 = oldnew.$length - 2 >> 0; while (true) { if (!(i$3 >= 0)) { break; } o$1 = ((i$3 < 0 || i$3 >= oldnew.$length) ? ($throwRuntimeError("index out of range"), undefined) : oldnew.$array[oldnew.$offset + i$3]).charCodeAt(0); n$1 = (x$2 = i$3 + 1 >> 0, ((x$2 < 0 || x$2 >= oldnew.$length) ? ($throwRuntimeError("index out of range"), undefined) : oldnew.$array[oldnew.$offset + x$2])); if ((x$3 = r$1.replacements, ((o$1 < 0 || o$1 >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[o$1])) === sliceType$2.nil) { r$1.toReplace = $append(r$1.toReplace, ($bytesToString(new sliceType$2([o$1])))); } (x$4 = r$1.replacements, ((o$1 < 0 || o$1 >= x$4.length) ? ($throwRuntimeError("index out of range"), undefined) : x$4[o$1] = (new sliceType$2($stringToBytes(n$1))))); i$3 = i$3 - (2) >> 0; } return r$1; }; Replacer.prototype.build = function() { return this.$val.build(); }; Replacer.ptr.prototype.Replace = function(s) { var $24r, _r, r, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; r = $f.r; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; $r = r.once.Do($methodVal(r, "buildOnce")); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r = r.r.Replace(s); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Replacer.ptr.prototype.Replace }; } $f.$24r = $24r; $f._r = _r; $f.r = r; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; Replacer.prototype.Replace = function(s) { return this.$val.Replace(s); }; Replacer.ptr.prototype.WriteString = function(w, s) { var $24r, _r, _tuple, err, n, r, s, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _tuple = $f._tuple; err = $f.err; n = $f.n; r = $f.r; s = $f.s; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; r = this; $r = r.once.Do($methodVal(r, "buildOnce")); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r = r.r.WriteString(w, s); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; err = _tuple[1]; $24r = [n, err]; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Replacer.ptr.prototype.WriteString }; } $f.$24r = $24r; $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.n = n; $f.r = r; $f.s = s; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; Replacer.prototype.WriteString = function(w, s) { return this.$val.WriteString(w, s); }; trieNode.ptr.prototype.add = function(key, val, priority, r) { var key, keyNode, m, n, next, prefixNode, priority, r, t, val, 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; t = this; if (key === "") { if (t.priority === 0) { t.value = val; t.priority = priority; } return; } if (!(t.prefix === "")) { n = 0; while (true) { if (!(n < t.prefix.length && n < key.length)) { break; } if (!((t.prefix.charCodeAt(n) === key.charCodeAt(n)))) { break; } n = n + (1) >> 0; } if (n === t.prefix.length) { t.next.add($substring(key, n), val, priority, r); } else if (n === 0) { prefixNode = ptrType$3.nil; if (t.prefix.length === 1) { prefixNode = t.next; } else { prefixNode = new trieNode.ptr("", 0, $substring(t.prefix, 1), t.next, sliceType$4.nil); } keyNode = new trieNode.ptr("", 0, "", ptrType$3.nil, sliceType$4.nil); t.table = $makeSlice(sliceType$4, r.tableSize); (x = t.table, x$1 = (x$2 = r.mapping, x$3 = t.prefix.charCodeAt(0), ((x$3 < 0 || x$3 >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[x$3])), ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1] = prefixNode)); (x$4 = t.table, x$5 = (x$6 = r.mapping, x$7 = key.charCodeAt(0), ((x$7 < 0 || x$7 >= x$6.length) ? ($throwRuntimeError("index out of range"), undefined) : x$6[x$7])), ((x$5 < 0 || x$5 >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + x$5] = keyNode)); t.prefix = ""; t.next = ptrType$3.nil; keyNode.add($substring(key, 1), val, priority, r); } else { next = new trieNode.ptr("", 0, $substring(t.prefix, n), t.next, sliceType$4.nil); t.prefix = $substring(t.prefix, 0, n); t.next = next; next.add($substring(key, n), val, priority, r); } } else if (!(t.table === sliceType$4.nil)) { m = (x$8 = r.mapping, x$9 = key.charCodeAt(0), ((x$9 < 0 || x$9 >= x$8.length) ? ($throwRuntimeError("index out of range"), undefined) : x$8[x$9])); if ((x$10 = t.table, ((m < 0 || m >= x$10.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$10.$array[x$10.$offset + m])) === ptrType$3.nil) { (x$11 = t.table, ((m < 0 || m >= x$11.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$11.$array[x$11.$offset + m] = new trieNode.ptr("", 0, "", ptrType$3.nil, sliceType$4.nil))); } (x$12 = t.table, ((m < 0 || m >= x$12.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$12.$array[x$12.$offset + m])).add($substring(key, 1), val, priority, r); } else { t.prefix = key; t.next = new trieNode.ptr("", 0, "", ptrType$3.nil, sliceType$4.nil); t.next.add("", val, priority, r); } }; trieNode.prototype.add = function(key, val, priority, r) { return this.$val.add(key, val, priority, r); }; genericReplacer.ptr.prototype.lookup = function(s, ignoreRoot) { var bestPriority, found, ignoreRoot, index, keylen, n, node, r, s, val, x, x$1, x$2; val = ""; keylen = 0; found = false; r = this; bestPriority = 0; node = r.root; n = 0; while (true) { if (!(!(node === ptrType$3.nil))) { break; } if (node.priority > bestPriority && !(ignoreRoot && node === r.root)) { bestPriority = node.priority; val = node.value; keylen = n; found = true; } if (s === "") { break; } if (!(node.table === sliceType$4.nil)) { index = (x = r.mapping, x$1 = s.charCodeAt(0), ((x$1 < 0 || x$1 >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[x$1])); if (((index >> 0)) === r.tableSize) { break; } node = (x$2 = node.table, ((index < 0 || index >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + index])); s = $substring(s, 1); n = n + (1) >> 0; } else if (!(node.prefix === "") && HasPrefix(s, node.prefix)) { n = n + (node.prefix.length) >> 0; s = $substring(s, node.prefix.length); node = node.next; } else { break; } } return [val, keylen, found]; }; genericReplacer.prototype.lookup = function(s, ignoreRoot) { return this.$val.lookup(s, ignoreRoot); }; makeGenericReplacer = function(oldnew) { var _i, _i$1, _ref, _ref$1, b, b$1, i, i$1, i$2, index, j, key, oldnew, r, x, x$1, x$2, x$3, x$4; r = new genericReplacer.ptr(new trieNode.ptr("", 0, "", ptrType$3.nil, sliceType$4.nil), 0, arrayType$2.zero()); i = 0; while (true) { if (!(i < oldnew.$length)) { break; } key = ((i < 0 || i >= oldnew.$length) ? ($throwRuntimeError("index out of range"), undefined) : oldnew.$array[oldnew.$offset + i]); j = 0; while (true) { if (!(j < key.length)) { break; } (x = r.mapping, x$1 = key.charCodeAt(j), ((x$1 < 0 || x$1 >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[x$1] = 1)); j = j + (1) >> 0; } i = i + (2) >> 0; } _ref = r.mapping; _i = 0; while (true) { if (!(_i < 256)) { break; } b = ((_i < 0 || _i >= _ref.length) ? ($throwRuntimeError("index out of range"), undefined) : _ref[_i]); r.tableSize = r.tableSize + (((b >> 0))) >> 0; _i++; } index = 0; _ref$1 = r.mapping; _i$1 = 0; while (true) { if (!(_i$1 < 256)) { break; } i$1 = _i$1; b$1 = ((_i$1 < 0 || _i$1 >= _ref$1.length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1[_i$1]); if (b$1 === 0) { (x$2 = r.mapping, ((i$1 < 0 || i$1 >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i$1] = ((r.tableSize << 24 >>> 24)))); } else { (x$3 = r.mapping, ((i$1 < 0 || i$1 >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[i$1] = index)); index = index + (1) << 24 >>> 24; } _i$1++; } r.root.table = $makeSlice(sliceType$4, r.tableSize); i$2 = 0; while (true) { if (!(i$2 < oldnew.$length)) { break; } r.root.add(((i$2 < 0 || i$2 >= oldnew.$length) ? ($throwRuntimeError("index out of range"), undefined) : oldnew.$array[oldnew.$offset + i$2]), (x$4 = i$2 + 1 >> 0, ((x$4 < 0 || x$4 >= oldnew.$length) ? ($throwRuntimeError("index out of range"), undefined) : oldnew.$array[oldnew.$offset + x$4])), oldnew.$length - i$2 >> 0, r); i$2 = i$2 + (2) >> 0; } return r; }; $ptrType(appendSliceWriter).prototype.Write = function(p) { var p, w; w = this; w.$set($appendSlice(w.$get(), p)); return [p.$length, $ifaceNil]; }; $ptrType(appendSliceWriter).prototype.WriteString = function(s) { var s, w; w = this; w.$set($appendSlice(w.$get(), s)); return [s.length, $ifaceNil]; }; stringWriter.ptr.prototype.WriteString = function(s) { var $24r, _r, s, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; s = $f.s; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: w = this; _r = w.w.Write((new sliceType$2($stringToBytes(s)))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: stringWriter.ptr.prototype.WriteString }; } $f.$24r = $24r; $f._r = _r; $f.s = s; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; stringWriter.prototype.WriteString = function(s) { return this.$val.WriteString(s); }; getStringWriter = function(w) { var _tuple, ok, sw, w, x; _tuple = $assertType(w, io.StringWriter, true); sw = _tuple[0]; ok = _tuple[1]; if (!ok) { sw = (x = new stringWriter.ptr(w), new x.constructor.elem(x)); } return sw; }; genericReplacer.ptr.prototype.Replace = function(s) { var _r, buf, r, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; buf = $f.buf; r = $f.r; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: buf = [buf]; r = this; buf[0] = $makeSlice(appendSliceWriter, 0, s.length); _r = r.WriteString((buf.$ptr || (buf.$ptr = new ptrType$4(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, buf))), s); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; $s = -1; return ($bytesToString(buf[0])); /* */ } return; } if ($f === undefined) { $f = { $blk: genericReplacer.ptr.prototype.Replace }; } $f._r = _r; $f.buf = buf; $f.r = r; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; genericReplacer.prototype.Replace = function(s) { return this.$val.Replace(s); }; genericReplacer.ptr.prototype.WriteString = function(w, s) { var _r, _r$1, _r$2, _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, _tuple$3, err, i, index, keylen, last, match, n, prevMatchEmpty, r, s, sw, val, w, wn, x, x$1, x$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; err = $f.err; i = $f.i; index = $f.index; keylen = $f.keylen; last = $f.last; match = $f.match; n = $f.n; prevMatchEmpty = $f.prevMatchEmpty; r = $f.r; s = $f.s; sw = $f.sw; val = $f.val; w = $f.w; wn = $f.wn; 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; r = this; sw = getStringWriter(w); _tmp = 0; _tmp$1 = 0; last = _tmp; wn = _tmp$1; prevMatchEmpty = false; i = 0; /* while (true) { */ case 1: /* if (!(i <= s.length)) { break; } */ if(!(i <= s.length)) { $s = 2; continue; } if (!((i === s.length)) && (r.root.priority === 0)) { index = (((x = r.mapping, x$1 = s.charCodeAt(i), ((x$1 < 0 || x$1 >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[x$1])) >> 0)); if ((index === r.tableSize) || (x$2 = r.root.table, ((index < 0 || index >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + index])) === ptrType$3.nil) { i = i + (1) >> 0; /* continue; */ $s = 1; continue; } } _tuple = r.lookup($substring(s, i), prevMatchEmpty); val = _tuple[0]; keylen = _tuple[1]; match = _tuple[2]; prevMatchEmpty = match && (keylen === 0); /* */ if (match) { $s = 3; continue; } /* */ $s = 4; continue; /* if (match) { */ case 3: _r = sw.WriteString($substring(s, last, i)); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple$1 = _r; wn = _tuple$1[0]; err = _tuple$1[1]; n = n + (wn) >> 0; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [n, err]; } _r$1 = sw.WriteString(val); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$2 = _r$1; wn = _tuple$2[0]; err = _tuple$2[1]; n = n + (wn) >> 0; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [n, err]; } i = i + (keylen) >> 0; last = i; /* continue; */ $s = 1; continue; /* } */ case 4: i = i + (1) >> 0; $s = 1; continue; case 2: /* */ if (!((last === s.length))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!((last === s.length))) { */ case 7: _r$2 = sw.WriteString($substring(s, last)); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$3 = _r$2; wn = _tuple$3[0]; err = _tuple$3[1]; n = n + (wn) >> 0; /* } */ case 8: $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: genericReplacer.ptr.prototype.WriteString }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.err = err; $f.i = i; $f.index = index; $f.keylen = keylen; $f.last = last; $f.match = match; $f.n = n; $f.prevMatchEmpty = prevMatchEmpty; $f.r = r; $f.s = s; $f.sw = sw; $f.val = val; $f.w = w; $f.wn = wn; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; }; genericReplacer.prototype.WriteString = function(w, s) { return this.$val.WriteString(w, s); }; makeSingleStringReplacer = function(pattern, value) { var pattern, value; return new singleStringReplacer.ptr(makeStringFinder(pattern), value); }; singleStringReplacer.ptr.prototype.Replace = function(s) { var _tmp, _tmp$1, buf, i, match, matched, r, s; r = this; buf = sliceType$2.nil; _tmp = 0; _tmp$1 = false; i = _tmp; matched = _tmp$1; while (true) { match = r.finder.next($substring(s, i)); if (match === -1) { break; } matched = true; buf = $appendSlice(buf, $substring(s, i, (i + match >> 0))); buf = $appendSlice(buf, r.value); i = i + ((match + r.finder.pattern.length >> 0)) >> 0; } if (!matched) { return s; } buf = $appendSlice(buf, $substring(s, i)); return ($bytesToString(buf)); }; singleStringReplacer.prototype.Replace = function(s) { return this.$val.Replace(s); }; singleStringReplacer.ptr.prototype.WriteString = function(w, s) { var _r, _r$1, _r$2, _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, err, i, match, n, r, s, sw, w, wn, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; err = $f.err; i = $f.i; match = $f.match; n = $f.n; r = $f.r; s = $f.s; sw = $f.sw; w = $f.w; wn = $f.wn; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; r = this; sw = getStringWriter(w); _tmp = 0; _tmp$1 = 0; i = _tmp; wn = _tmp$1; /* while (true) { */ case 1: match = r.finder.next($substring(s, i)); if (match === -1) { /* break; */ $s = 2; continue; } _r = sw.WriteString($substring(s, i, (i + match >> 0))); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; wn = _tuple[0]; err = _tuple[1]; n = n + (wn) >> 0; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [n, err]; } _r$1 = sw.WriteString(r.value); /* */ $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; wn = _tuple$1[0]; err = _tuple$1[1]; n = n + (wn) >> 0; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [n, err]; } i = i + ((match + r.finder.pattern.length >> 0)) >> 0; $s = 1; continue; case 2: _r$2 = sw.WriteString($substring(s, i)); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$2 = _r$2; wn = _tuple$2[0]; err = _tuple$2[1]; n = n + (wn) >> 0; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: singleStringReplacer.ptr.prototype.WriteString }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.err = err; $f.i = i; $f.match = match; $f.n = n; $f.r = r; $f.s = s; $f.sw = sw; $f.w = w; $f.wn = wn; $f.$s = $s; $f.$r = $r; return $f; }; singleStringReplacer.prototype.WriteString = function(w, s) { return this.$val.WriteString(w, s); }; byteReplacer.prototype.Replace = function(s) { var b, buf, i, r, s, x, x$1; r = this.$val; buf = sliceType$2.nil; i = 0; while (true) { if (!(i < s.length)) { break; } b = s.charCodeAt(i); if (!(((x = r, ((b < 0 || b >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[b])) === b))) { if (buf === sliceType$2.nil) { buf = (new sliceType$2($stringToBytes(s))); } ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = (x$1 = r, ((b < 0 || b >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[b]))); } i = i + (1) >> 0; } if (buf === sliceType$2.nil) { return s; } return ($bytesToString(buf)); }; $ptrType(byteReplacer).prototype.Replace = function(s) { return (new byteReplacer(this.$get())).Replace(s); }; byteReplacer.prototype.WriteString = function(w, s) { var _i, _r, _ref, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, buf, bufsize, err, err$1, i, n, ncopy, r, s, w, wn, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; b = $f.b; buf = $f.buf; bufsize = $f.bufsize; err = $f.err; err$1 = $f.err$1; i = $f.i; n = $f.n; ncopy = $f.ncopy; r = $f.r; s = $f.s; w = $f.w; wn = $f.wn; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; r = this.$val; bufsize = 32768; if (s.length < bufsize) { bufsize = s.length; } buf = $makeSlice(sliceType$2, bufsize); /* while (true) { */ case 1: /* if (!(s.length > 0)) { break; } */ if(!(s.length > 0)) { $s = 2; continue; } ncopy = $copyString(buf, s); s = $substring(s, ncopy); _ref = $subslice(buf, 0, ncopy); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; b = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = (x = r, ((b < 0 || b >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[b]))); _i++; } _r = w.Write($subslice(buf, 0, ncopy)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; wn = _tuple[0]; err$1 = _tuple[1]; n = n + (wn) >> 0; if (!($interfaceIsEqual(err$1, $ifaceNil))) { _tmp = n; _tmp$1 = err$1; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } $s = 1; continue; case 2: _tmp$2 = n; _tmp$3 = $ifaceNil; n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: byteReplacer.prototype.WriteString }; } $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.b = b; $f.buf = buf; $f.bufsize = bufsize; $f.err = err; $f.err$1 = err$1; $f.i = i; $f.n = n; $f.ncopy = ncopy; $f.r = r; $f.s = s; $f.w = w; $f.wn = wn; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(byteReplacer).prototype.WriteString = function(w, s) { return (new byteReplacer(this.$get())).WriteString(w, s); }; byteStringReplacer.ptr.prototype.Replace = function(s) { var _i, _ref, anyChanges, b, b$1, buf, c, i, i$1, j, newSize, r, s, x, x$1, x$2, x$3, x$4, x$5, x$6; r = this; newSize = s.length; anyChanges = false; if (($imul(r.toReplace.$length, 8)) <= s.length) { _ref = r.toReplace; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } x = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); c = Count(s, x); if (!((c === 0))) { newSize = newSize + (($imul(c, (((x$1 = r.replacements, x$2 = x.charCodeAt(0), ((x$2 < 0 || x$2 >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[x$2])).$length - 1 >> 0))))) >> 0; anyChanges = true; } _i++; } } else { i = 0; while (true) { if (!(i < s.length)) { break; } b = s.charCodeAt(i); if (!((x$3 = r.replacements, ((b < 0 || b >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[b])) === sliceType$2.nil)) { newSize = newSize + (((x$4 = r.replacements, ((b < 0 || b >= x$4.length) ? ($throwRuntimeError("index out of range"), undefined) : x$4[b])).$length - 1 >> 0)) >> 0; anyChanges = true; } i = i + (1) >> 0; } } if (!anyChanges) { return s; } buf = $makeSlice(sliceType$2, newSize); j = 0; i$1 = 0; while (true) { if (!(i$1 < s.length)) { break; } b$1 = s.charCodeAt(i$1); if (!((x$5 = r.replacements, ((b$1 < 0 || b$1 >= x$5.length) ? ($throwRuntimeError("index out of range"), undefined) : x$5[b$1])) === sliceType$2.nil)) { j = j + ($copySlice($subslice(buf, j), (x$6 = r.replacements, ((b$1 < 0 || b$1 >= x$6.length) ? ($throwRuntimeError("index out of range"), undefined) : x$6[b$1])))) >> 0; } else { ((j < 0 || j >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + j] = b$1); j = j + (1) >> 0; } i$1 = i$1 + (1) >> 0; } return ($bytesToString(buf)); }; byteStringReplacer.prototype.Replace = function(s) { return this.$val.Replace(s); }; byteStringReplacer.ptr.prototype.WriteString = function(w, s) { var _r, _r$1, _r$2, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, _tuple$2, b, err, err$1, err$2, i, last, n, nw, nw$1, nw$2, r, s, sw, w, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; b = $f.b; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; i = $f.i; last = $f.last; n = $f.n; nw = $f.nw; nw$1 = $f.nw$1; nw$2 = $f.nw$2; r = $f.r; s = $f.s; sw = $f.sw; w = $f.w; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; r = this; sw = getStringWriter(w); last = 0; i = 0; /* while (true) { */ case 1: /* if (!(i < s.length)) { break; } */ if(!(i < s.length)) { $s = 2; continue; } b = s.charCodeAt(i); if ((x = r.replacements, ((b < 0 || b >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[b])) === sliceType$2.nil) { i = i + (1) >> 0; /* continue; */ $s = 1; continue; } /* */ if (!((last === i))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!((last === i))) { */ case 3: _r = sw.WriteString($substring(s, last, i)); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; nw = _tuple[0]; err$1 = _tuple[1]; n = n + (nw) >> 0; if (!($interfaceIsEqual(err$1, $ifaceNil))) { _tmp = n; _tmp$1 = err$1; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } /* } */ case 4: last = i + 1 >> 0; _r$1 = w.Write((x$1 = r.replacements, ((b < 0 || b >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[b]))); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; nw$1 = _tuple$1[0]; err$2 = _tuple$1[1]; n = n + (nw$1) >> 0; if (!($interfaceIsEqual(err$2, $ifaceNil))) { _tmp$2 = n; _tmp$3 = err$2; n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; } i = i + (1) >> 0; $s = 1; continue; case 2: /* */ if (!((last === s.length))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!((last === s.length))) { */ case 7: nw$2 = 0; _r$2 = sw.WriteString($substring(s, last)); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$2 = _r$2; nw$2 = _tuple$2[0]; err = _tuple$2[1]; n = n + (nw$2) >> 0; /* } */ case 8: $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: byteStringReplacer.ptr.prototype.WriteString }; } $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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.b = b; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.i = i; $f.last = last; $f.n = n; $f.nw = nw; $f.nw$1 = nw$1; $f.nw$2 = nw$2; $f.r = r; $f.s = s; $f.sw = sw; $f.w = w; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; byteStringReplacer.prototype.WriteString = function(w, s) { return this.$val.WriteString(w, s); }; Reader.ptr.prototype.Len = function() { var 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 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 _tmp, _tmp$1, b, err, n, r, x, x$1, x$2, x$3; n = 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)))) { _tmp = 0; _tmp$1 = io.EOF; n = _tmp; err = _tmp$1; return [n, err]; } r.prevRune = -1; n = $copyString(b, $substring(r.s, $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 _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, $substring(r.s, $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 b, r, x, x$1, x$2, x$3; 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)))) { return [0, io.EOF]; } 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, $ifaceNil]; }; Reader.prototype.ReadByte = function() { return this.$val.ReadByte(); }; Reader.ptr.prototype.UnreadByte = function() { var r, x, x$1, x$2; r = this; if ((x = r.i, (x.$high < 0 || (x.$high === 0 && x.$low <= 0)))) { return errors.New("strings.Reader.UnreadByte: at beginning of string"); } r.prevRune = -1; 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 _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($substring(r.s, $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 r, x; r = this; if ((x = r.i, (x.$high < 0 || (x.$high === 0 && x.$low <= 0)))) { return errors.New("strings.Reader.UnreadRune: at beginning of string"); } 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 _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 _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; _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; $s = -1; return [n, err]; } s = $substring(r.s, $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; } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.WriteTo }; } $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); }; Reader.ptr.prototype.Reset = function(s) { var r, s; r = this; Reader.copy(r, new Reader.ptr(s, new $Int64(0, 0), -1)); }; Reader.prototype.Reset = function(s) { return this.$val.Reset(s); }; NewReader = function(s) { var s; return new Reader.ptr(s, new $Int64(0, 0), -1); }; $pkg.NewReader = NewReader; IndexByte = function(s, c) { var c, s; return $parseInt(s.indexOf($global.String.fromCharCode(c))) >> 0; }; $pkg.IndexByte = IndexByte; Index = function(s, sep) { var s, sep; return $parseInt(s.indexOf(sep)) >> 0; }; $pkg.Index = Index; LastIndex = function(s, sep) { var s, sep; return $parseInt(s.lastIndexOf(sep)) >> 0; }; $pkg.LastIndex = LastIndex; Count = function(s, sep) { var n, pos, s, sep; n = 0; if ((sep.length === 0)) { return utf8.RuneCountInString(s) + 1 >> 0; } else if (sep.length > s.length) { return 0; } else if ((sep.length === s.length)) { if (sep === s) { return 1; } return 0; } while (true) { pos = Index(s, sep); if (pos === -1) { break; } n = n + (1) >> 0; s = $substring(s, (pos + sep.length >> 0)); } return n; }; $pkg.Count = Count; Builder.ptr.prototype.String = function() { var b; b = this; return ($bytesToString(b.buf)); }; Builder.prototype.String = function() { return this.$val.String(); }; Builder.ptr.prototype.copyCheck = function() { var b; b = this; if (b.addr === ptrType$1.nil) { b.addr = b; } else if (!(b.addr === b)) { $panic(new $String("strings: illegal use of non-zero Builder copied by value")); } }; Builder.prototype.copyCheck = function() { return this.$val.copyCheck(); }; Builder.ptr.prototype.Len = function() { var b; b = this; return b.buf.$length; }; Builder.prototype.Len = function() { return this.$val.Len(); }; Builder.ptr.prototype.Cap = function() { var b; b = this; return b.buf.$capacity; }; Builder.prototype.Cap = function() { return this.$val.Cap(); }; Builder.ptr.prototype.Reset = function() { var b; b = this; b.addr = ptrType$1.nil; b.buf = sliceType$2.nil; }; Builder.prototype.Reset = function() { return this.$val.Reset(); }; Builder.ptr.prototype.grow = function(n) { var b, buf, n; b = this; buf = $makeSlice(sliceType$2, b.buf.$length, (($imul(2, b.buf.$capacity)) + n >> 0)); $copySlice(buf, b.buf); b.buf = buf; }; Builder.prototype.grow = function(n) { return this.$val.grow(n); }; Builder.ptr.prototype.Grow = function(n) { var b, n; b = this; b.copyCheck(); if (n < 0) { $panic(new $String("strings.Builder.Grow: negative count")); } if ((b.buf.$capacity - b.buf.$length >> 0) < n) { b.grow(n); } }; Builder.prototype.Grow = function(n) { return this.$val.Grow(n); }; Builder.ptr.prototype.Write = function(p) { var b, p; b = this; b.copyCheck(); b.buf = $appendSlice(b.buf, p); return [p.$length, $ifaceNil]; }; Builder.prototype.Write = function(p) { return this.$val.Write(p); }; Builder.ptr.prototype.WriteByte = function(c) { var b, c; b = this; b.copyCheck(); b.buf = $append(b.buf, c); return $ifaceNil; }; Builder.prototype.WriteByte = function(c) { return this.$val.WriteByte(c); }; Builder.ptr.prototype.WriteRune = function(r) { var b, l, n, r; b = this; b.copyCheck(); if (((r >>> 0)) < 128) { b.buf = $append(b.buf, ((r << 24 >>> 24))); return [1, $ifaceNil]; } l = b.buf.$length; if ((b.buf.$capacity - l >> 0) < 4) { b.grow(4); } n = utf8.EncodeRune($subslice(b.buf, l, (l + 4 >> 0)), r); b.buf = $subslice(b.buf, 0, (l + n >> 0)); return [n, $ifaceNil]; }; Builder.prototype.WriteRune = function(r) { return this.$val.WriteRune(r); }; Builder.ptr.prototype.WriteString = function(s) { var b, s; b = this; b.copyCheck(); b.buf = $appendSlice(b.buf, s); return [s.length, $ifaceNil]; }; Builder.prototype.WriteString = function(s) { return this.$val.WriteString(s); }; ptrType.methods = [{prop: "contains", name: "contains", pkg: "strings", typ: $funcType([$Uint8], [$Bool], false)}]; ptrType$5.methods = [{prop: "next", name: "next", pkg: "strings", typ: $funcType([$String], [$Int], false)}]; ptrType$6.methods = [{prop: "buildOnce", name: "buildOnce", pkg: "strings", typ: $funcType([], [], false)}, {prop: "build", name: "build", pkg: "strings", typ: $funcType([], [replacer], false)}, {prop: "Replace", name: "Replace", pkg: "", typ: $funcType([$String], [$String], false)}, {prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([io.Writer, $String], [$Int, $error], false)}]; ptrType$3.methods = [{prop: "add", name: "add", pkg: "strings", typ: $funcType([$String, $String, $Int, ptrType$7], [], false)}]; ptrType$7.methods = [{prop: "lookup", name: "lookup", pkg: "strings", typ: $funcType([$String, $Bool], [$String, $Int, $Bool], false)}, {prop: "Replace", name: "Replace", pkg: "", typ: $funcType([$String], [$String], false)}, {prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([io.Writer, $String], [$Int, $error], false)}]; ptrType$4.methods = [{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([$String], [$Int, $error], false)}]; stringWriter.methods = [{prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([$String], [$Int, $error], false)}]; ptrType$8.methods = [{prop: "Replace", name: "Replace", pkg: "", typ: $funcType([$String], [$String], false)}, {prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([io.Writer, $String], [$Int, $error], false)}]; ptrType$2.methods = [{prop: "Replace", name: "Replace", pkg: "", typ: $funcType([$String], [$String], false)}, {prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([io.Writer, $String], [$Int, $error], false)}]; ptrType$9.methods = [{prop: "Replace", name: "Replace", pkg: "", typ: $funcType([$String], [$String], false)}, {prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([io.Writer, $String], [$Int, $error], false)}]; ptrType$10.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$2], [$Int, $error], false)}, {prop: "ReadAt", name: "ReadAt", pkg: "", typ: $funcType([sliceType$2, $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)}, {prop: "Reset", name: "Reset", pkg: "", typ: $funcType([$String], [], false)}]; ptrType$1.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "copyCheck", name: "copyCheck", pkg: "strings", typ: $funcType([], [], false)}, {prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Cap", name: "Cap", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Reset", name: "Reset", pkg: "", typ: $funcType([], [], false)}, {prop: "grow", name: "grow", pkg: "strings", typ: $funcType([$Int], [], false)}, {prop: "Grow", name: "Grow", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "WriteByte", name: "WriteByte", pkg: "", typ: $funcType([$Uint8], [$error], false)}, {prop: "WriteRune", name: "WriteRune", pkg: "", typ: $funcType([$Int32], [$Int, $error], false)}, {prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([$String], [$Int, $error], false)}]; asciiSet.init($Uint32, 8); stringFinder.init("strings", [{prop: "pattern", name: "pattern", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "badCharSkip", name: "badCharSkip", embedded: false, exported: false, typ: arrayType$1, tag: ""}, {prop: "goodSuffixSkip", name: "goodSuffixSkip", embedded: false, exported: false, typ: sliceType$3, tag: ""}]); Replacer.init("strings", [{prop: "once", name: "once", embedded: false, exported: false, typ: sync.Once, tag: ""}, {prop: "r", name: "r", embedded: false, exported: false, typ: replacer, tag: ""}, {prop: "oldnew", name: "oldnew", embedded: false, exported: false, typ: sliceType, tag: ""}]); replacer.init([{prop: "Replace", name: "Replace", pkg: "", typ: $funcType([$String], [$String], false)}, {prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([io.Writer, $String], [$Int, $error], false)}]); trieNode.init("strings", [{prop: "value", name: "value", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "priority", name: "priority", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "prefix", name: "prefix", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "next", name: "next", embedded: false, exported: false, typ: ptrType$3, tag: ""}, {prop: "table", name: "table", embedded: false, exported: false, typ: sliceType$4, tag: ""}]); genericReplacer.init("strings", [{prop: "root", name: "root", embedded: false, exported: false, typ: trieNode, tag: ""}, {prop: "tableSize", name: "tableSize", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "mapping", name: "mapping", embedded: false, exported: false, typ: arrayType$2, tag: ""}]); appendSliceWriter.init($Uint8); stringWriter.init("strings", [{prop: "w", name: "w", embedded: false, exported: false, typ: io.Writer, tag: ""}]); singleStringReplacer.init("strings", [{prop: "finder", name: "finder", embedded: false, exported: false, typ: ptrType$5, tag: ""}, {prop: "value", name: "value", embedded: false, exported: false, typ: $String, tag: ""}]); byteReplacer.init($Uint8, 256); byteStringReplacer.init("strings", [{prop: "replacements", name: "replacements", embedded: false, exported: false, typ: arrayType$3, tag: ""}, {prop: "toReplace", name: "toReplace", embedded: false, exported: false, typ: sliceType, tag: ""}]); Reader.init("strings", [{prop: "s", name: "s", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "i", name: "i", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "prevRune", name: "prevRune", embedded: false, exported: false, typ: $Int, tag: ""}]); Builder.init("strings", [{prop: "addr", name: "addr", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "buf", name: "buf", embedded: false, exported: false, typ: sliceType$2, tag: ""}]); span.init("strings", [{prop: "start", name: "start", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "end", name: "end", embedded: false, exported: false, 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 = bytealg.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = io.$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 = unicode.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = utf8.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } asciiSpace = $toNativeArray($kindUint8, [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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["unicode/utf16"] = (function() { var $pkg = {}, $init, sliceType$1, IsSurrogate, DecodeRune, Decode; sliceType$1 = $sliceType($Int32); IsSurrogate = function(r) { var r; return 55296 <= r && r < 57344; }; $pkg.IsSurrogate = IsSurrogate; DecodeRune = function(r1, r2) { var r1, r2; if (55296 <= r1 && r1 < 56320 && 56320 <= r2 && r2 < 57344) { return ((((r1 - 55296 >> 0)) << 10 >> 0) | ((r2 - 56320 >> 0))) + 65536 >> 0; } return 65533; }; $pkg.DecodeRune = DecodeRune; Decode = function(s) { var a, i, n, r, s, x, x$1, x$2; a = $makeSlice(sliceType$1, s.$length); n = 0; i = 0; while (true) { if (!(i < s.$length)) { break; } r = ((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]); if ((r < 55296) || (57344 <= r)) { ((n < 0 || n >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + n] = ((r >> 0))); } else if (55296 <= r && r < 56320 && (i + 1 >> 0) < s.$length && 56320 <= (x = i + 1 >> 0, ((x < 0 || x >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + x])) && (x$1 = i + 1 >> 0, ((x$1 < 0 || x$1 >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + x$1])) < 57344) { ((n < 0 || n >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + n] = DecodeRune(((r >> 0)), (((x$2 = i + 1 >> 0, ((x$2 < 0 || x$2 >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + x$2])) >> 0)))); i = i + (1) >> 0; } else { ((n < 0 || n >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + n] = 65533); } n = n + (1) >> 0; i = i + (1) >> 0; } return $subslice(a, 0, n); }; $pkg.Decode = Decode; $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, sort, strconv, strings, unicode, utf16, utf8, tagOptions, Decoder, Token, Delim, SyntaxError, scanner, Marshaler, UnsupportedTypeError, UnsupportedValueError, MarshalerError, encodeState, jsonError, encOpts, encoderFunc, floatEncoder, structEncoder, structFields, mapEncoder, sliceEncoder, arrayEncoder, ptrEncoder, condAddrEncoder, reflectWithString, field, byIndex, Unmarshaler, UnmarshalTypeError, InvalidUnmarshalError, Number, errorContext, decodeState, unquotedValue, sliceType, sliceType$1, ptrType$1, ptrType$2, sliceType$2, ptrType$3, ptrType$4, ptrType$6, ptrType$7, ptrType$8, ptrType$9, arrayType, sliceType$3, structType, sliceType$4, structType$1, ptrType$10, ptrType$11, mapType, sliceType$5, ptrType$12, ptrType$13, ptrType$15, funcType, ptrType$16, ptrType$17, ptrType$19, mapType$1, mapType$2, ptrType$20, funcType$1, ptrType$22, ptrType$23, safeSet, htmlSafeSet, scannerPool, hex, encodeStatePool, encoderCache, marshalerType, textMarshalerType, float32Encoder, float64Encoder, fieldCache, nullLiteral, textUnmarshalerType, numberType, _r, _r$1, _r$2, parseTag, NewDecoder, nonSpace, newScanner, freeScanner, 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, compact, foldFunc, equalFoldRight, asciiEqualFold, simpleLetterEqualFold, HTMLEscape, newEncodeState, isEmptyValue, valueEncoder, typeEncoder, newTypeEncoder, invalidValueEncoder, marshalerEncoder, addrMarshalerEncoder, textMarshalerEncoder, addrTextMarshalerEncoder, boolEncoder, intEncoder, uintEncoder, stringEncoder, isValidNumber, interfaceEncoder, unsupportedTypeEncoder, newStructEncoder, newMapEncoder, encodeByteSlice, newSliceEncoder, newArrayEncoder, newPtrEncoder, newCondAddrEncoder, isValidTag, typeByIndex, typeFields, dominantField, cachedTypeFields, indirect, getu4, unquote, unquoteBytes; 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"]; sort = $packages["sort"]; strconv = $packages["strconv"]; strings = $packages["strings"]; unicode = $packages["unicode"]; utf16 = $packages["unicode/utf16"]; utf8 = $packages["unicode/utf8"]; tagOptions = $pkg.tagOptions = $newType(8, $kindString, "json.tagOptions", true, "encoding/json", false, null); Decoder = $pkg.Decoder = $newType(0, $kindStruct, "json.Decoder", true, "encoding/json", true, function(r_, buf_, d_, scanp_, scanned_, scan_, err_, tokenState_, tokenStack_) { this.$val = this; if (arguments.length === 0) { this.r = $ifaceNil; this.buf = sliceType$2.nil; this.d = new decodeState.ptr(sliceType$2.nil, 0, 0, new scanner.ptr($throwNilPointerError, false, sliceType$1.nil, $ifaceNil, new $Int64(0, 0)), ptrType$4.nil, $ifaceNil, false, false); this.scanp = 0; this.scanned = new $Int64(0, 0); this.scan = new scanner.ptr($throwNilPointerError, false, sliceType$1.nil, $ifaceNil, new $Int64(0, 0)); this.err = $ifaceNil; this.tokenState = 0; this.tokenStack = sliceType$1.nil; return; } this.r = r_; this.buf = buf_; this.d = d_; this.scanp = scanp_; this.scanned = scanned_; this.scan = scan_; this.err = err_; this.tokenState = tokenState_; this.tokenStack = tokenStack_; }); Token = $pkg.Token = $newType(8, $kindInterface, "json.Token", true, "encoding/json", true, null); Delim = $pkg.Delim = $newType(4, $kindInt32, "json.Delim", true, "encoding/json", true, null); SyntaxError = $pkg.SyntaxError = $newType(0, $kindStruct, "json.SyntaxError", true, "encoding/json", true, 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", true, "encoding/json", false, function(step_, endTop_, parseState_, err_, bytes_) { this.$val = this; if (arguments.length === 0) { this.step = $throwNilPointerError; this.endTop = false; this.parseState = sliceType$1.nil; this.err = $ifaceNil; this.bytes = new $Int64(0, 0); return; } this.step = step_; this.endTop = endTop_; this.parseState = parseState_; this.err = err_; this.bytes = bytes_; }); Marshaler = $pkg.Marshaler = $newType(8, $kindInterface, "json.Marshaler", true, "encoding/json", true, null); UnsupportedTypeError = $pkg.UnsupportedTypeError = $newType(0, $kindStruct, "json.UnsupportedTypeError", true, "encoding/json", true, function(Type_) { this.$val = this; if (arguments.length === 0) { this.Type = $ifaceNil; return; } this.Type = Type_; }); UnsupportedValueError = $pkg.UnsupportedValueError = $newType(0, $kindStruct, "json.UnsupportedValueError", true, "encoding/json", true, function(Value_, Str_) { this.$val = this; if (arguments.length === 0) { this.Value = new reflect.Value.ptr(ptrType$11.nil, 0, 0); this.Str = ""; return; } this.Value = Value_; this.Str = Str_; }); MarshalerError = $pkg.MarshalerError = $newType(0, $kindStruct, "json.MarshalerError", true, "encoding/json", true, function(Type_, Err_, sourceFunc_) { this.$val = this; if (arguments.length === 0) { this.Type = $ifaceNil; this.Err = $ifaceNil; this.sourceFunc = ""; return; } this.Type = Type_; this.Err = Err_; this.sourceFunc = sourceFunc_; }); encodeState = $pkg.encodeState = $newType(0, $kindStruct, "json.encodeState", true, "encoding/json", false, function(Buffer_, scratch_, ptrLevel_, ptrSeen_) { this.$val = this; if (arguments.length === 0) { this.Buffer = new bytes.Buffer.ptr(sliceType$2.nil, 0, 0); this.scratch = arrayType.zero(); this.ptrLevel = 0; this.ptrSeen = false; return; } this.Buffer = Buffer_; this.scratch = scratch_; this.ptrLevel = ptrLevel_; this.ptrSeen = ptrSeen_; }); jsonError = $pkg.jsonError = $newType(0, $kindStruct, "json.jsonError", true, "encoding/json", false, function(error_) { this.$val = this; if (arguments.length === 0) { this.error = $ifaceNil; return; } this.error = error_; }); encOpts = $pkg.encOpts = $newType(0, $kindStruct, "json.encOpts", true, "encoding/json", false, function(quoted_, escapeHTML_) { this.$val = this; if (arguments.length === 0) { this.quoted = false; this.escapeHTML = false; return; } this.quoted = quoted_; this.escapeHTML = escapeHTML_; }); encoderFunc = $pkg.encoderFunc = $newType(4, $kindFunc, "json.encoderFunc", true, "encoding/json", false, null); floatEncoder = $pkg.floatEncoder = $newType(4, $kindInt, "json.floatEncoder", true, "encoding/json", false, null); structEncoder = $pkg.structEncoder = $newType(0, $kindStruct, "json.structEncoder", true, "encoding/json", false, function(fields_) { this.$val = this; if (arguments.length === 0) { this.fields = new structFields.ptr(sliceType$3.nil, false); return; } this.fields = fields_; }); structFields = $pkg.structFields = $newType(0, $kindStruct, "json.structFields", true, "encoding/json", false, function(list_, nameIndex_) { this.$val = this; if (arguments.length === 0) { this.list = sliceType$3.nil; this.nameIndex = false; return; } this.list = list_; this.nameIndex = nameIndex_; }); mapEncoder = $pkg.mapEncoder = $newType(0, $kindStruct, "json.mapEncoder", true, "encoding/json", false, function(elemEnc_) { this.$val = this; if (arguments.length === 0) { this.elemEnc = $throwNilPointerError; return; } this.elemEnc = elemEnc_; }); sliceEncoder = $pkg.sliceEncoder = $newType(0, $kindStruct, "json.sliceEncoder", true, "encoding/json", false, function(arrayEnc_) { this.$val = this; if (arguments.length === 0) { this.arrayEnc = $throwNilPointerError; return; } this.arrayEnc = arrayEnc_; }); arrayEncoder = $pkg.arrayEncoder = $newType(0, $kindStruct, "json.arrayEncoder", true, "encoding/json", false, function(elemEnc_) { this.$val = this; if (arguments.length === 0) { this.elemEnc = $throwNilPointerError; return; } this.elemEnc = elemEnc_; }); ptrEncoder = $pkg.ptrEncoder = $newType(0, $kindStruct, "json.ptrEncoder", true, "encoding/json", false, function(elemEnc_) { this.$val = this; if (arguments.length === 0) { this.elemEnc = $throwNilPointerError; return; } this.elemEnc = elemEnc_; }); condAddrEncoder = $pkg.condAddrEncoder = $newType(0, $kindStruct, "json.condAddrEncoder", true, "encoding/json", false, function(canAddrEnc_, elseEnc_) { this.$val = this; if (arguments.length === 0) { this.canAddrEnc = $throwNilPointerError; this.elseEnc = $throwNilPointerError; return; } this.canAddrEnc = canAddrEnc_; this.elseEnc = elseEnc_; }); reflectWithString = $pkg.reflectWithString = $newType(0, $kindStruct, "json.reflectWithString", true, "encoding/json", false, function(k_, v_, ks_) { this.$val = this; if (arguments.length === 0) { this.k = new reflect.Value.ptr(ptrType$11.nil, 0, 0); this.v = new reflect.Value.ptr(ptrType$11.nil, 0, 0); this.ks = ""; return; } this.k = k_; this.v = v_; this.ks = ks_; }); field = $pkg.field = $newType(0, $kindStruct, "json.field", true, "encoding/json", false, function(name_, nameBytes_, equalFold_, nameNonEsc_, nameEscHTML_, tag_, index_, typ_, omitEmpty_, quoted_, encoder_) { this.$val = this; if (arguments.length === 0) { this.name = ""; this.nameBytes = sliceType$2.nil; this.equalFold = $throwNilPointerError; this.nameNonEsc = ""; this.nameEscHTML = ""; this.tag = false; this.index = sliceType$1.nil; this.typ = $ifaceNil; this.omitEmpty = false; this.quoted = false; this.encoder = $throwNilPointerError; return; } this.name = name_; this.nameBytes = nameBytes_; this.equalFold = equalFold_; this.nameNonEsc = nameNonEsc_; this.nameEscHTML = nameEscHTML_; this.tag = tag_; this.index = index_; this.typ = typ_; this.omitEmpty = omitEmpty_; this.quoted = quoted_; this.encoder = encoder_; }); byIndex = $pkg.byIndex = $newType(12, $kindSlice, "json.byIndex", true, "encoding/json", false, null); Unmarshaler = $pkg.Unmarshaler = $newType(8, $kindInterface, "json.Unmarshaler", true, "encoding/json", true, null); UnmarshalTypeError = $pkg.UnmarshalTypeError = $newType(0, $kindStruct, "json.UnmarshalTypeError", true, "encoding/json", true, function(Value_, Type_, Offset_, Struct_, Field_) { this.$val = this; if (arguments.length === 0) { this.Value = ""; this.Type = $ifaceNil; this.Offset = new $Int64(0, 0); this.Struct = ""; this.Field = ""; return; } this.Value = Value_; this.Type = Type_; this.Offset = Offset_; this.Struct = Struct_; this.Field = Field_; }); InvalidUnmarshalError = $pkg.InvalidUnmarshalError = $newType(0, $kindStruct, "json.InvalidUnmarshalError", true, "encoding/json", true, function(Type_) { this.$val = this; if (arguments.length === 0) { this.Type = $ifaceNil; return; } this.Type = Type_; }); Number = $pkg.Number = $newType(8, $kindString, "json.Number", true, "encoding/json", true, null); errorContext = $pkg.errorContext = $newType(0, $kindStruct, "json.errorContext", true, "encoding/json", false, function(Struct_, FieldStack_) { this.$val = this; if (arguments.length === 0) { this.Struct = $ifaceNil; this.FieldStack = sliceType$5.nil; return; } this.Struct = Struct_; this.FieldStack = FieldStack_; }); decodeState = $pkg.decodeState = $newType(0, $kindStruct, "json.decodeState", true, "encoding/json", false, function(data_, off_, opcode_, scan_, errorContext_, savedError_, useNumber_, disallowUnknownFields_) { this.$val = this; if (arguments.length === 0) { this.data = sliceType$2.nil; this.off = 0; this.opcode = 0; this.scan = new scanner.ptr($throwNilPointerError, false, sliceType$1.nil, $ifaceNil, new $Int64(0, 0)); this.errorContext = ptrType$4.nil; this.savedError = $ifaceNil; this.useNumber = false; this.disallowUnknownFields = false; return; } this.data = data_; this.off = off_; this.opcode = opcode_; this.scan = scan_; this.errorContext = errorContext_; this.savedError = savedError_; this.useNumber = useNumber_; this.disallowUnknownFields = disallowUnknownFields_; }); unquotedValue = $pkg.unquotedValue = $newType(0, $kindStruct, "json.unquotedValue", true, "encoding/json", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); sliceType = $sliceType($emptyInterface); sliceType$1 = $sliceType($Int); ptrType$1 = $ptrType(Marshaler); ptrType$2 = $ptrType(encoding.TextMarshaler); sliceType$2 = $sliceType($Uint8); ptrType$3 = $ptrType(encoding.TextUnmarshaler); ptrType$4 = $ptrType(errorContext); ptrType$6 = $ptrType($String); ptrType$7 = $ptrType($emptyInterface); ptrType$8 = $ptrType(scanner); ptrType$9 = $ptrType(encodeState); arrayType = $arrayType($Uint8, 64); sliceType$3 = $sliceType(field); structType = $structType("", []); sliceType$4 = $sliceType(reflectWithString); structType$1 = $structType("encoding/json", [{prop: "ptr", name: "ptr", embedded: false, exported: false, typ: $Uintptr, tag: ""}, {prop: "len", name: "len", embedded: false, exported: false, typ: $Int, tag: ""}]); ptrType$10 = $ptrType(UnmarshalTypeError); ptrType$11 = $ptrType(reflect.rtype); mapType = $mapType($String, $emptyInterface); sliceType$5 = $sliceType($String); ptrType$12 = $ptrType(field); ptrType$13 = $ptrType(Decoder); ptrType$15 = $ptrType(SyntaxError); funcType = $funcType([ptrType$8, $Uint8], [$Int], false); ptrType$16 = $ptrType(UnsupportedTypeError); ptrType$17 = $ptrType(UnsupportedValueError); ptrType$19 = $ptrType(MarshalerError); mapType$1 = $mapType($emptyInterface, structType); mapType$2 = $mapType($String, $Int); ptrType$20 = $ptrType(reflectWithString); funcType$1 = $funcType([sliceType$2, sliceType$2], [$Bool], false); ptrType$22 = $ptrType(InvalidUnmarshalError); ptrType$23 = $ptrType(decodeState); parseTag = function(tag) { var idx, tag; idx = strings.Index(tag, ","); if (!((idx === -1))) { return [$substring(tag, 0, idx), ($substring(tag, (idx + 1 >> 0)))]; } return [tag, ""]; }; tagOptions.prototype.Contains = function(optionName) { var _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 = $substring(s, 0, i); _tmp$1 = $substring(s, (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); }; NewDecoder = function(r) { var r; return new Decoder.ptr(r, sliceType$2.nil, new decodeState.ptr(sliceType$2.nil, 0, 0, new scanner.ptr($throwNilPointerError, false, sliceType$1.nil, $ifaceNil, new $Int64(0, 0)), ptrType$4.nil, $ifaceNil, false, false), 0, new $Int64(0, 0), new scanner.ptr($throwNilPointerError, false, sliceType$1.nil, $ifaceNil, new $Int64(0, 0)), $ifaceNil, 0, sliceType$1.nil); }; $pkg.NewDecoder = NewDecoder; Decoder.ptr.prototype.UseNumber = function() { var dec; dec = this; dec.d.useNumber = true; }; Decoder.prototype.UseNumber = function() { return this.$val.UseNumber(); }; Decoder.ptr.prototype.DisallowUnknownFields = function() { var dec; dec = this; dec.d.disallowUnknownFields = true; }; Decoder.prototype.DisallowUnknownFields = function() { return this.$val.DisallowUnknownFields(); }; Decoder.ptr.prototype.Decode = function(v) { var _r$3, _r$4, _r$5, _tuple, dec, err, err$1, n, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _tuple = $f._tuple; dec = $f.dec; err = $f.err; err$1 = $f.err$1; n = $f.n; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: dec = this; if (!($interfaceIsEqual(dec.err, $ifaceNil))) { $s = -1; return dec.err; } _r$3 = dec.tokenPrepareForDecode(); /* */ $s = 1; case 1: 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 = -1; return err; } if (!dec.tokenValueAllowed()) { $s = -1; return new SyntaxError.ptr("not at beginning of value", dec.InputOffset()); } _r$4 = dec.readValue(); /* */ $s = 2; case 2: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple = _r$4; n = _tuple[0]; err$1 = _tuple[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } dec.d.init($subslice(dec.buf, dec.scanp, (dec.scanp + n >> 0))); dec.scanp = dec.scanp + (n) >> 0; _r$5 = dec.d.unmarshal(v); /* */ $s = 3; case 3: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } err$1 = _r$5; dec.tokenValueEnd(); $s = -1; return err$1; /* */ } return; } if ($f === undefined) { $f = { $blk: Decoder.ptr.prototype.Decode }; } $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._tuple = _tuple; $f.dec = dec; $f.err = err; $f.err$1 = err$1; $f.n = n; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Decoder.prototype.Decode = function(v) { return this.$val.Decode(v); }; Decoder.ptr.prototype.Buffered = function() { var dec; dec = this; return bytes.NewReader($subslice(dec.buf, dec.scanp)); }; Decoder.prototype.Buffered = function() { return this.$val.Buffered(); }; Decoder.ptr.prototype.readValue = function() { var _1, _r$3, _r$4, _r$5, c, dec, err, n, scanp, 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; _1 = $f._1; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; c = $f.c; dec = $f.dec; err = $f.err; n = $f.n; scanp = $f.scanp; 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: dec = this; dec.scan.reset(); scanp = dec.scanp; err = $ifaceNil; /* while (true) { */ case 1: /* if (!(scanp >= 0)) { break; } */ if(!(scanp >= 0)) { $s = 2; continue; } /* while (true) { */ case 3: /* if (!(scanp < dec.buf.$length)) { break; } */ if(!(scanp < dec.buf.$length)) { $s = 4; continue; } c = (x = dec.buf, ((scanp < 0 || scanp >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + scanp])); dec.scan.bytes = (x$1 = dec.scan.bytes, x$2 = new $Int64(0, 1), new $Int64(x$1.$high + x$2.$high, x$1.$low + x$2.$low)); _r$3 = dec.scan.step(dec.scan, c); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _1 = _r$3; if (_1 === (10)) { dec.scan.bytes = (x$3 = dec.scan.bytes, x$4 = new $Int64(0, 1), new $Int64(x$3.$high - x$4.$high, x$3.$low - x$4.$low)); /* break Input; */ $s = 2; continue s; } else if ((_1 === (5)) || (_1 === (8))) { if (stateEndValue(dec.scan, 32) === 10) { scanp = scanp + (1) >> 0; /* break Input; */ $s = 2; continue s; } } else if (_1 === (11)) { dec.err = dec.scan.err; $s = -1; return [0, dec.scan.err]; } case 5: scanp = scanp + (1) >> 0; $s = 3; continue; case 4: /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 7: /* */ if ($interfaceIsEqual(err, io.EOF)) { $s = 9; continue; } /* */ $s = 10; continue; /* if ($interfaceIsEqual(err, io.EOF)) { */ case 9: _r$4 = dec.scan.step(dec.scan, 32); /* */ $s = 13; case 13: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } /* */ if (_r$4 === 10) { $s = 11; continue; } /* */ $s = 12; continue; /* if (_r$4 === 10) { */ case 11: /* break Input; */ $s = 2; continue s; /* } */ case 12: if (nonSpace(dec.buf)) { err = io.ErrUnexpectedEOF; } /* } */ case 10: dec.err = err; $s = -1; return [0, err]; /* } */ case 8: n = scanp - dec.scanp >> 0; _r$5 = dec.refill(); /* */ $s = 14; case 14: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } err = _r$5; scanp = dec.scanp + n >> 0; $s = 1; continue; case 2: $s = -1; return [scanp - dec.scanp >> 0, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Decoder.ptr.prototype.readValue }; } $f._1 = _1; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f.c = c; $f.dec = dec; $f.err = err; $f.n = n; $f.scanp = scanp; $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; }; Decoder.prototype.readValue = function() { return this.$val.readValue(); }; Decoder.ptr.prototype.refill = function() { var _r$3, _tuple, dec, err, n, n$1, newBuf, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _tuple = $f._tuple; dec = $f.dec; err = $f.err; n = $f.n; n$1 = $f.n$1; newBuf = $f.newBuf; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: dec = this; if (dec.scanp > 0) { dec.scanned = (x = dec.scanned, x$1 = (new $Int64(0, dec.scanp)), new $Int64(x.$high + x$1.$high, x.$low + x$1.$low)); n = $copySlice(dec.buf, $subslice(dec.buf, dec.scanp)); dec.buf = $subslice(dec.buf, 0, n); dec.scanp = 0; } if ((dec.buf.$capacity - dec.buf.$length >> 0) < 512) { newBuf = $makeSlice(sliceType$2, dec.buf.$length, (($imul(2, dec.buf.$capacity)) + 512 >> 0)); $copySlice(newBuf, dec.buf); dec.buf = newBuf; } _r$3 = dec.r.Read($subslice(dec.buf, dec.buf.$length, dec.buf.$capacity)); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; n$1 = _tuple[0]; err = _tuple[1]; dec.buf = $subslice(dec.buf, 0, (dec.buf.$length + n$1 >> 0)); $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: Decoder.ptr.prototype.refill }; } $f._r$3 = _r$3; $f._tuple = _tuple; $f.dec = dec; $f.err = err; $f.n = n; $f.n$1 = n$1; $f.newBuf = newBuf; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; Decoder.prototype.refill = function() { return this.$val.refill(); }; nonSpace = function(b) { var _i, _ref, b, c; _ref = b; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } c = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (!isSpace(c)) { return true; } _i++; } return false; }; Decoder.ptr.prototype.tokenPrepareForDecode = function() { var _1, _r$3, _r$4, _tuple, _tuple$1, c, c$1, dec, err, err$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; c = $f.c; c$1 = $f.c$1; dec = $f.dec; err = $f.err; err$1 = $f.err$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: dec = this; _1 = dec.tokenState; /* */ if (_1 === (3)) { $s = 2; continue; } /* */ if (_1 === (6)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_1 === (3)) { */ case 2: _r$3 = dec.peek(); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; c = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } if (!((c === 44))) { $s = -1; return new SyntaxError.ptr("expected comma after array element", dec.InputOffset()); } dec.scanp = dec.scanp + (1) >> 0; dec.tokenState = 2; $s = 4; continue; /* } else if (_1 === (6)) { */ case 3: _r$4 = dec.peek(); /* */ $s = 6; case 6: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$1 = _r$4; c$1 = _tuple$1[0]; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } if (!((c$1 === 58))) { $s = -1; return new SyntaxError.ptr("expected colon after object key", dec.InputOffset()); } dec.scanp = dec.scanp + (1) >> 0; dec.tokenState = 7; /* } */ case 4: case 1: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Decoder.ptr.prototype.tokenPrepareForDecode }; } $f._1 = _1; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.c = c; $f.c$1 = c$1; $f.dec = dec; $f.err = err; $f.err$1 = err$1; $f.$s = $s; $f.$r = $r; return $f; }; Decoder.prototype.tokenPrepareForDecode = function() { return this.$val.tokenPrepareForDecode(); }; Decoder.ptr.prototype.tokenValueAllowed = function() { var _1, dec; dec = this; _1 = dec.tokenState; if ((_1 === (0)) || (_1 === (1)) || (_1 === (2)) || (_1 === (7))) { return true; } return false; }; Decoder.prototype.tokenValueAllowed = function() { return this.$val.tokenValueAllowed(); }; Decoder.ptr.prototype.tokenValueEnd = function() { var _1, dec; dec = this; _1 = dec.tokenState; if ((_1 === (1)) || (_1 === (2))) { dec.tokenState = 3; } else if (_1 === (7)) { dec.tokenState = 8; } }; Decoder.prototype.tokenValueEnd = function() { return this.$val.tokenValueEnd(); }; Delim.prototype.String = function() { var d; d = this.$val; return ($encodeRune(d)); }; $ptrType(Delim).prototype.String = function() { return new Delim(this.$get()).String(); }; Decoder.ptr.prototype.Token = function() { var _1, _r$3, _r$4, _r$5, _r$6, _tuple, c, dec, err, err$1, err$2, old, 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; _1 = $f._1; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _tuple = $f._tuple; c = $f.c; dec = $f.dec; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; old = $f.old; 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: dec = this; /* while (true) { */ case 1: x = [x]; x$1 = [x$1]; _r$3 = dec.peek(); /* */ $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; c = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [$ifaceNil, err]; } _1 = c; /* */ if (_1 === (91)) { $s = 5; continue; } /* */ if (_1 === (93)) { $s = 6; continue; } /* */ if (_1 === (123)) { $s = 7; continue; } /* */ if (_1 === (125)) { $s = 8; continue; } /* */ if (_1 === (58)) { $s = 9; continue; } /* */ if (_1 === (44)) { $s = 10; continue; } /* */ if (_1 === (34)) { $s = 11; continue; } /* */ $s = 12; continue; /* if (_1 === (91)) { */ case 5: if (!dec.tokenValueAllowed()) { $s = -1; return dec.tokenError(c); } dec.scanp = dec.scanp + (1) >> 0; dec.tokenStack = $append(dec.tokenStack, dec.tokenState); dec.tokenState = 1; $s = -1; return [new Delim(91), $ifaceNil]; /* } else if (_1 === (93)) { */ case 6: if (!((dec.tokenState === 1)) && !((dec.tokenState === 3))) { $s = -1; return dec.tokenError(c); } dec.scanp = dec.scanp + (1) >> 0; dec.tokenState = (x$2 = dec.tokenStack, x$3 = dec.tokenStack.$length - 1 >> 0, ((x$3 < 0 || x$3 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + x$3])); dec.tokenStack = $subslice(dec.tokenStack, 0, (dec.tokenStack.$length - 1 >> 0)); dec.tokenValueEnd(); $s = -1; return [new Delim(93), $ifaceNil]; /* } else if (_1 === (123)) { */ case 7: if (!dec.tokenValueAllowed()) { $s = -1; return dec.tokenError(c); } dec.scanp = dec.scanp + (1) >> 0; dec.tokenStack = $append(dec.tokenStack, dec.tokenState); dec.tokenState = 4; $s = -1; return [new Delim(123), $ifaceNil]; /* } else if (_1 === (125)) { */ case 8: if (!((dec.tokenState === 4)) && !((dec.tokenState === 8))) { $s = -1; return dec.tokenError(c); } dec.scanp = dec.scanp + (1) >> 0; dec.tokenState = (x$4 = dec.tokenStack, x$5 = dec.tokenStack.$length - 1 >> 0, ((x$5 < 0 || x$5 >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + x$5])); dec.tokenStack = $subslice(dec.tokenStack, 0, (dec.tokenStack.$length - 1 >> 0)); dec.tokenValueEnd(); $s = -1; return [new Delim(125), $ifaceNil]; /* } else if (_1 === (58)) { */ case 9: if (!((dec.tokenState === 6))) { $s = -1; return dec.tokenError(c); } dec.scanp = dec.scanp + (1) >> 0; dec.tokenState = 7; /* continue; */ $s = 1; continue; $s = 13; continue; /* } else if (_1 === (44)) { */ case 10: if (dec.tokenState === 3) { dec.scanp = dec.scanp + (1) >> 0; dec.tokenState = 2; /* continue; */ $s = 1; continue; } if (dec.tokenState === 8) { dec.scanp = dec.scanp + (1) >> 0; dec.tokenState = 5; /* continue; */ $s = 1; continue; } $s = -1; return dec.tokenError(c); /* } else if (_1 === (34)) { */ case 11: /* */ if ((dec.tokenState === 4) || (dec.tokenState === 5)) { $s = 14; continue; } /* */ $s = 15; continue; /* if ((dec.tokenState === 4) || (dec.tokenState === 5)) { */ case 14: x[0] = ""; old = dec.tokenState; dec.tokenState = 0; _r$4 = dec.Decode((x.$ptr || (x.$ptr = new ptrType$6(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, x)))); /* */ $s = 16; case 16: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } err$1 = _r$4; dec.tokenState = old; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [$ifaceNil, err$1]; } dec.tokenState = 6; $s = -1; return [new $String(x[0]), $ifaceNil]; /* } */ case 15: if (!dec.tokenValueAllowed()) { $s = -1; return dec.tokenError(c); } x$1[0] = $ifaceNil; _r$5 = dec.Decode((x$1.$ptr || (x$1.$ptr = new ptrType$7(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, x$1)))); /* */ $s = 17; case 17: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } err$2 = _r$5; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return [$ifaceNil, err$2]; } $s = -1; return [x$1[0], $ifaceNil]; /* } else { */ case 12: if (!dec.tokenValueAllowed()) { $s = -1; return dec.tokenError(c); } x$1[0] = $ifaceNil; _r$6 = dec.Decode((x$1.$ptr || (x$1.$ptr = new ptrType$7(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, x$1)))); /* */ $s = 18; case 18: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } err$2 = _r$6; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return [$ifaceNil, err$2]; } $s = -1; return [x$1[0], $ifaceNil]; /* } */ case 13: case 4: $s = 1; continue; case 2: $s = -1; return [$ifaceNil, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Decoder.ptr.prototype.Token }; } $f._1 = _1; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._tuple = _tuple; $f.c = c; $f.dec = dec; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.old = old; $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; }; Decoder.prototype.Token = function() { return this.$val.Token(); }; Decoder.ptr.prototype.tokenError = function(c) { var _1, c, context, dec; dec = this; context = ""; _1 = dec.tokenState; if (_1 === (0)) { context = " looking for beginning of value"; } else if ((_1 === (1)) || (_1 === (2)) || (_1 === (7))) { context = " looking for beginning of value"; } else if (_1 === (3)) { context = " after array element"; } else if (_1 === (5)) { context = " looking for beginning of object key string"; } else if (_1 === (6)) { context = " after object key"; } else if (_1 === (8)) { context = " after object key:value pair"; } return [$ifaceNil, new SyntaxError.ptr("invalid character " + quoteChar(c) + context, dec.InputOffset())]; }; Decoder.prototype.tokenError = function(c) { return this.$val.tokenError(c); }; Decoder.ptr.prototype.More = function() { var _r$3, _tuple, c, dec, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _tuple = $f._tuple; c = $f.c; dec = $f.dec; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: dec = this; _r$3 = dec.peek(); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; c = _tuple[0]; err = _tuple[1]; $s = -1; return $interfaceIsEqual(err, $ifaceNil) && !((c === 93)) && !((c === 125)); /* */ } return; } if ($f === undefined) { $f = { $blk: Decoder.ptr.prototype.More }; } $f._r$3 = _r$3; $f._tuple = _tuple; $f.c = c; $f.dec = dec; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; Decoder.prototype.More = function() { return this.$val.More(); }; Decoder.ptr.prototype.peek = function() { var _r$3, c, dec, err, i, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; c = $f.c; dec = $f.dec; err = $f.err; i = $f.i; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: dec = this; err = $ifaceNil; /* while (true) { */ case 1: i = dec.scanp; while (true) { if (!(i < dec.buf.$length)) { break; } c = (x = dec.buf, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); if (isSpace(c)) { i = i + (1) >> 0; continue; } dec.scanp = i; $s = -1; return [c, $ifaceNil]; } if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [0, err]; } _r$3 = dec.refill(); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } err = _r$3; $s = 1; continue; case 2: $s = -1; return [0, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Decoder.ptr.prototype.peek }; } $f._r$3 = _r$3; $f.c = c; $f.dec = dec; $f.err = err; $f.i = i; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Decoder.prototype.peek = function() { return this.$val.peek(); }; Decoder.ptr.prototype.InputOffset = function() { var dec, x, x$1; dec = this; return (x = dec.scanned, x$1 = (new $Int64(0, dec.scanp)), new $Int64(x.$high + x$1.$high, x.$low + x$1.$low)); }; Decoder.prototype.InputOffset = function() { return this.$val.InputOffset(); }; SyntaxError.ptr.prototype.Error = function() { var e; e = this; return e.msg; }; SyntaxError.prototype.Error = function() { return this.$val.Error(); }; newScanner = function() { var _r$3, scan, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; scan = $f.scan; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$3 = scannerPool.Get(); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } scan = $assertType(_r$3, ptrType$8); scan.bytes = new $Int64(0, 0); scan.reset(); $s = -1; return scan; /* */ } return; } if ($f === undefined) { $f = { $blk: newScanner }; } $f._r$3 = _r$3; $f.scan = scan; $f.$s = $s; $f.$r = $r; return $f; }; freeScanner = function(scan) { var scan; if (scan.parseState.$length > 1024) { scan.parseState = sliceType$1.nil; } scannerPool.Put(scan); }; scanner.ptr.prototype.reset = function() { var s; s = this; s.step = stateBeginValue; s.parseState = $subslice(s.parseState, 0, 0); s.err = $ifaceNil; s.endTop = false; }; scanner.prototype.reset = function() { return this.$val.reset(); }; scanner.ptr.prototype.eof = function() { var _r$3, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; if (!($interfaceIsEqual(s.err, $ifaceNil))) { $s = -1; return 11; } if (s.endTop) { $s = -1; return 10; } _r$3 = s.step(s, 32); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; if (s.endTop) { $s = -1; return 10; } if ($interfaceIsEqual(s.err, $ifaceNil)) { s.err = new SyntaxError.ptr("unexpected end of JSON input", s.bytes); } $s = -1; return 11; /* */ } return; } if ($f === undefined) { $f = { $blk: scanner.ptr.prototype.eof }; } $f._r$3 = _r$3; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; scanner.prototype.eof = function() { return this.$val.eof(); }; scanner.ptr.prototype.pushParseState = function(c, newParseState, successState) { var c, newParseState, s, successState; s = this; s.parseState = $append(s.parseState, newParseState); if (s.parseState.$length <= 10000) { return successState; } return s.error(c, "exceeded max depth"); }; scanner.prototype.pushParseState = function(c, newParseState, successState) { return this.$val.pushParseState(c, newParseState, successState); }; scanner.ptr.prototype.popParseState = function() { var n, s; s = this; n = s.parseState.$length - 1 >> 0; s.parseState = $subslice(s.parseState, 0, n); 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 c; return c <= 32 && ((c === 32) || (c === 9) || (c === 13) || (c === 10)); }; stateBeginValueOrEmpty = function(s, c) { var c, s; if (isSpace(c)) { return 9; } if (c === 93) { return stateEndValue(s, c); } return stateBeginValue(s, c); }; stateBeginValue = function(s, c) { var _1, c, s; if (isSpace(c)) { return 9; } _1 = c; if (_1 === (123)) { s.step = stateBeginStringOrEmpty; return s.pushParseState(c, 0, 2); } else if (_1 === (91)) { s.step = stateBeginValueOrEmpty; return s.pushParseState(c, 2, 6); } else if (_1 === (34)) { s.step = stateInString; return 1; } else if (_1 === (45)) { s.step = stateNeg; return 1; } else if (_1 === (48)) { s.step = state0; return 1; } else if (_1 === (116)) { s.step = stateT; return 1; } else if (_1 === (102)) { s.step = stateF; return 1; } else if (_1 === (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 c, n, s, x, x$1; if (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"), undefined) : x.$array[x.$offset + x$1] = 1)); return stateEndValue(s, c); } return stateBeginString(s, c); }; stateBeginString = function(s, c) { var c, s; if (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 _1, 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 (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"), undefined) : x.$array[x.$offset + x$1])); _1 = ps; if (_1 === (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"), undefined) : x$2.$array[x$2.$offset + x$3] = 1)); s.step = stateBeginValue; return 3; } return s.error(c, "after object key"); } else if (_1 === (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"), undefined) : 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 (_1 === (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 c, s; if (!isSpace(c)) { s.error(c, "after top-level value"); } return 10; }; stateInString = function(s, c) { var 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 _1, c, s; _1 = c; if ((_1 === (98)) || (_1 === (102)) || (_1 === (110)) || (_1 === (114)) || (_1 === (116)) || (_1 === (92)) || (_1 === (47)) || (_1 === (34))) { s.step = stateInString; return 0; } else if (_1 === (117)) { s.step = stateInStringEscU; return 0; } return s.error(c, "in string escape code"); }; stateInStringEscU = function(s, c) { var 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 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 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 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 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 c, s; if (48 <= c && c <= 57) { s.step = state1; return 0; } return state0(s, c); }; state0 = function(s, c) { var 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 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 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 c, s; if ((c === 43) || (c === 45)) { s.step = stateESign; return 0; } return stateESign(s, c); }; stateESign = function(s, c) { var 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 c, s; if (48 <= c && c <= 57) { return 0; } return stateEndValue(s, c); }; stateT = function(s, c) { var c, s; if (c === 114) { s.step = stateTr; return 0; } return s.error(c, "in literal true (expecting 'r')"); }; stateTr = function(s, c) { var c, s; if (c === 117) { s.step = stateTru; return 0; } return s.error(c, "in literal true (expecting 'u')"); }; stateTru = function(s, c) { var c, s; if (c === 101) { s.step = stateEndValue; return 0; } return s.error(c, "in literal true (expecting 'e')"); }; stateF = function(s, c) { var c, s; if (c === 97) { s.step = stateFa; return 0; } return s.error(c, "in literal false (expecting 'a')"); }; stateFa = function(s, c) { var c, s; if (c === 108) { s.step = stateFal; return 0; } return s.error(c, "in literal false (expecting 'l')"); }; stateFal = function(s, c) { var c, s; if (c === 115) { s.step = stateFals; return 0; } return s.error(c, "in literal false (expecting 's')"); }; stateFals = function(s, c) { var c, s; if (c === 101) { s.step = stateEndValue; return 0; } return s.error(c, "in literal false (expecting 'e')"); }; stateN = function(s, c) { var c, s; if (c === 117) { s.step = stateNu; return 0; } return s.error(c, "in literal null (expecting 'u')"); }; stateNu = function(s, c) { var c, s; if (c === 108) { s.step = stateNul; return 0; } return s.error(c, "in literal null (expecting 'l')"); }; stateNul = function(s, c) { var c, s; if (c === 108) { s.step = stateEndValue; return 0; } return s.error(c, "in literal null (expecting 'l')"); }; stateError = function(s, c) { var c, s; return 11; }; scanner.ptr.prototype.error = function(c, context) { var 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 c, s; if (c === 39) { return "'\\''"; } if (c === 34) { return "'\"'"; } s = strconv.Quote(($encodeRune(c))); return "'" + $substring(s, 1, (s.length - 1 >> 0)) + "'"; }; compact = function(dst, src, escape) { var $24r, $24r$1, _i, _r$10, _r$11, _r$12, _r$13, _r$14, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, c, dst, escape, i, origLen, scan, src, start, v, x, x$1, x$2, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _i = $f._i; _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$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; 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; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); origLen = dst.Len(); _r$3 = newScanner(); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } scan = _r$3; $deferred.push([freeScanner, [scan]]); start = 0; _ref = src; _i = 0; /* while (true) { */ case 2: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 3; continue; } i = _i; c = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); /* */ if (escape && ((c === 60) || (c === 62) || (c === 38))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (escape && ((c === 60) || (c === 62) || (c === 38))) { */ case 4: /* */ if (start < i) { $s = 6; continue; } /* */ $s = 7; continue; /* if (start < i) { */ case 6: _r$4 = dst.Write($subslice(src, start, i)); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; /* } */ case 7: _r$5 = dst.WriteString("\\u00"); /* */ $s = 9; case 9: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; _r$6 = dst.WriteByte(hex.charCodeAt((c >>> 4 << 24 >>> 24))); /* */ $s = 10; case 10: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; _r$7 = dst.WriteByte(hex.charCodeAt(((c & 15) >>> 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; start = i + 1 >> 0; /* } */ case 5: /* */ if (escape && (c === 226) && (i + 2 >> 0) < src.$length && ((x = i + 1 >> 0, ((x < 0 || x >= src.$length) ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + x])) === 128) && ((((x$1 = i + 2 >> 0, ((x$1 < 0 || x$1 >= src.$length) ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + x$1])) & ~1) << 24 >>> 24) === 168)) { $s = 12; continue; } /* */ $s = 13; continue; /* if (escape && (c === 226) && (i + 2 >> 0) < src.$length && ((x = i + 1 >> 0, ((x < 0 || x >= src.$length) ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + x])) === 128) && ((((x$1 = i + 2 >> 0, ((x$1 < 0 || x$1 >= src.$length) ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + x$1])) & ~1) << 24 >>> 24) === 168)) { */ case 12: /* */ if (start < i) { $s = 14; continue; } /* */ $s = 15; continue; /* if (start < i) { */ case 14: _r$8 = dst.Write($subslice(src, start, i)); /* */ $s = 16; case 16: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$8; /* } */ case 15: _r$9 = dst.WriteString("\\u202"); /* */ $s = 17; case 17: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$9; _r$10 = dst.WriteByte(hex.charCodeAt((((x$2 = i + 2 >> 0, ((x$2 < 0 || x$2 >= src.$length) ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + x$2])) & 15) >>> 0))); /* */ $s = 18; case 18: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; start = i + 3 >> 0; /* } */ case 13: _r$11 = scan.step(scan, c); /* */ $s = 19; case 19: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } v = _r$11; /* */ if (v >= 9) { $s = 20; continue; } /* */ $s = 21; continue; /* if (v >= 9) { */ case 20: if (v === 11) { /* break; */ $s = 3; continue; } /* */ if (start < i) { $s = 22; continue; } /* */ $s = 23; continue; /* if (start < i) { */ case 22: _r$12 = dst.Write($subslice(src, start, i)); /* */ $s = 24; case 24: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _r$12; /* } */ case 23: start = i + 1 >> 0; /* } */ case 21: _i++; $s = 2; continue; case 3: _r$13 = scan.eof(); /* */ $s = 27; case 27: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } /* */ if (_r$13 === 11) { $s = 25; continue; } /* */ $s = 26; continue; /* if (_r$13 === 11) { */ case 25: dst.Truncate(origLen); $24r = scan.err; $s = 28; case 28: return $24r; /* } */ case 26: /* */ if (start < src.$length) { $s = 29; continue; } /* */ $s = 30; continue; /* if (start < src.$length) { */ case 29: _r$14 = dst.Write($subslice(src, start)); /* */ $s = 31; case 31: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _r$14; /* } */ case 30: $24r$1 = $ifaceNil; $s = 32; case 32: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: compact }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._i = _i; $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$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.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.$deferred = $deferred; $f.$r = $r; return $f; } } }; foldFunc = function(s) { var _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"), undefined) : _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 _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"), undefined) : _ref.$array[_ref.$offset + _i]); if (t.$length === 0) { return false; } tb = (0 >= t.$length ? ($throwRuntimeError("index out of range"), undefined) : 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 _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"), undefined) : _ref.$array[_ref.$offset + _i]); tb = ((i < 0 || i >= t.$length) ? ($throwRuntimeError("index out of range"), undefined) : 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 _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"), undefined) : _ref.$array[_ref.$offset + _i]); if (!((((b & 223) >>> 0) === ((((i < 0 || i >= t.$length) ? ($throwRuntimeError("index out of range"), undefined) : t.$array[t.$offset + i]) & 223) >>> 0)))) { return false; } _i++; } return true; }; HTMLEscape = function(dst, src) { var _i, _r$10, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, c, dst, i, src, start, x, x$1, x$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r$10 = $f._r$10; _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; c = $f.c; dst = $f.dst; i = $f.i; src = $f.src; start = $f.start; 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: 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"), undefined) : _ref.$array[_ref.$offset + _i]); /* */ if ((c === 60) || (c === 62) || (c === 38)) { $s = 3; continue; } /* */ $s = 4; continue; /* if ((c === 60) || (c === 62) || (c === 38)) { */ case 3: /* */ if (start < i) { $s = 5; continue; } /* */ $s = 6; continue; /* if (start < i) { */ case 5: _r$3 = dst.Write($subslice(src, start, i)); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; /* } */ case 6: _r$4 = dst.WriteString("\\u00"); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; _r$5 = dst.WriteByte(hex.charCodeAt((c >>> 4 << 24 >>> 24))); /* */ $s = 9; case 9: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; _r$6 = dst.WriteByte(hex.charCodeAt(((c & 15) >>> 0))); /* */ $s = 10; case 10: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; start = i + 1 >> 0; /* } */ case 4: /* */ if ((c === 226) && (i + 2 >> 0) < src.$length && ((x = i + 1 >> 0, ((x < 0 || x >= src.$length) ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + x])) === 128) && ((((x$1 = i + 2 >> 0, ((x$1 < 0 || x$1 >= src.$length) ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + x$1])) & ~1) << 24 >>> 24) === 168)) { $s = 11; continue; } /* */ $s = 12; continue; /* if ((c === 226) && (i + 2 >> 0) < src.$length && ((x = i + 1 >> 0, ((x < 0 || x >= src.$length) ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + x])) === 128) && ((((x$1 = i + 2 >> 0, ((x$1 < 0 || x$1 >= src.$length) ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + x$1])) & ~1) << 24 >>> 24) === 168)) { */ case 11: /* */ if (start < i) { $s = 13; continue; } /* */ $s = 14; continue; /* if (start < i) { */ case 13: _r$7 = dst.Write($subslice(src, start, i)); /* */ $s = 15; case 15: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$7; /* } */ case 14: _r$8 = dst.WriteString("\\u202"); /* */ $s = 16; case 16: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$8; _r$9 = dst.WriteByte(hex.charCodeAt((((x$2 = i + 2 >> 0, ((x$2 < 0 || x$2 >= src.$length) ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + x$2])) & 15) >>> 0))); /* */ $s = 17; case 17: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$9; start = i + 3 >> 0; /* } */ case 12: _i++; $s = 1; continue; case 2: /* */ if (start < src.$length) { $s = 18; continue; } /* */ $s = 19; continue; /* if (start < src.$length) { */ case 18: _r$10 = dst.Write($subslice(src, start)); /* */ $s = 20; case 20: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; /* } */ case 19: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: HTMLEscape }; } $f._i = _i; $f._r$10 = _r$10; $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.c = c; $f.dst = dst; $f.i = i; $f.src = src; $f.start = start; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.HTMLEscape = HTMLEscape; UnsupportedTypeError.ptr.prototype.Error = function() { var $24r, _r$3, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$3 = $f._r$3; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; _r$3 = e.Type.String(); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = "json: unsupported type: " + _r$3; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: UnsupportedTypeError.ptr.prototype.Error }; } $f.$24r = $24r; $f._r$3 = _r$3; $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 e; e = this; return "json: unsupported value: " + e.Str; }; UnsupportedValueError.prototype.Error = function() { return this.$val.Error(); }; MarshalerError.ptr.prototype.Error = function() { var $24r, _r$3, _r$4, e, srcFunc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$3 = $f._r$3; _r$4 = $f._r$4; e = $f.e; srcFunc = $f.srcFunc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; srcFunc = e.sourceFunc; if (srcFunc === "") { srcFunc = "MarshalJSON"; } _r$3 = e.Type.String(); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = e.Err.Error(); /* */ $s = 2; case 2: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r = "json: error calling " + srcFunc + " for type " + _r$3 + ": " + _r$4; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: MarshalerError.ptr.prototype.Error }; } $f.$24r = $24r; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.e = e; $f.srcFunc = srcFunc; $f.$s = $s; $f.$r = $r; return $f; }; MarshalerError.prototype.Error = function() { return this.$val.Error(); }; MarshalerError.ptr.prototype.Unwrap = function() { var e; e = this; return e.Err; }; MarshalerError.prototype.Unwrap = function() { return this.$val.Unwrap(); }; newEncodeState = function() { var _r$3, e, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; e = $f.e; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$3 = encodeStatePool.Get(); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } v = _r$3; if (!($interfaceIsEqual(v, $ifaceNil))) { e = $assertType(v, ptrType$9); e.Buffer.Reset(); if ($keys(e.ptrSeen).length > 0) { $panic(new $String("ptrEncoder.encode should have emptied ptrSeen via defers")); } e.ptrLevel = 0; $s = -1; return e; } $s = -1; return new encodeState.ptr(new bytes.Buffer.ptr(sliceType$2.nil, 0, 0), arrayType.zero(), 0, {}); /* */ } return; } if ($f === undefined) { $f = { $blk: newEncodeState }; } $f._r$3 = _r$3; $f.e = e; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; encodeState.ptr.prototype.error = function(err) { var e, err, x; e = this; $panic((x = new jsonError.ptr(err), new x.constructor.elem(x))); }; encodeState.prototype.error = function(err) { return this.$val.error(err); }; isEmptyValue = function(v) { var _1, v, x, x$1; _1 = $clone(v, reflect.Value).Kind(); if ((_1 === (17)) || (_1 === (21)) || (_1 === (23)) || (_1 === (24))) { return $clone(v, reflect.Value).Len() === 0; } else if (_1 === (1)) { return !$clone(v, reflect.Value).Bool(); } else if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { return (x = $clone(v, reflect.Value).Int(), (x.$high === 0 && x.$low === 0)); } else if ((_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12))) { return (x$1 = $clone(v, reflect.Value).Uint(), (x$1.$high === 0 && x$1.$low === 0)); } else if ((_1 === (13)) || (_1 === (14))) { return $clone(v, reflect.Value).Float() === 0; } else if ((_1 === (20)) || (_1 === (22))) { return $clone(v, reflect.Value).IsNil(); } return false; }; encodeState.ptr.prototype.reflectValue = function(v, opts) { var _r$3, e, opts, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; e = $f.e; opts = $f.opts; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; _r$3 = valueEncoder($clone(v, reflect.Value)); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $r = _r$3(e, $clone(v, reflect.Value), $clone(opts, encOpts)); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: encodeState.ptr.prototype.reflectValue }; } $f._r$3 = _r$3; $f.e = e; $f.opts = opts; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; encodeState.prototype.reflectValue = function(v, opts) { return this.$val.reflectValue(v, opts); }; valueEncoder = function(v) { var $24r, _r$3, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$3 = $f._r$3; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (!$clone(v, reflect.Value).IsValid()) { $s = -1; return invalidValueEncoder; } _r$3 = typeEncoder($clone(v, reflect.Value).Type()); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = _r$3; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: valueEncoder }; } $f.$24r = $24r; $f._r$3 = _r$3; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; typeEncoder = function(t) { var _r$3, _tuple, _tuple$1, f, fi, fi$1, loaded, ok, t, wg, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; f = $f.f; fi = $f.fi; fi$1 = $f.fi$1; loaded = $f.loaded; ok = $f.ok; t = $f.t; wg = $f.wg; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = [f]; wg = [wg]; _tuple = encoderCache.Load(t); fi = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return $assertType(fi, encoderFunc); } wg[0] = new nosync.WaitGroup.ptr(0); f[0] = $throwNilPointerError; wg[0].Add(1); _tuple$1 = encoderCache.LoadOrStore(t, new encoderFunc(((function(f, wg) { return function $b(e, v, opts) { var e, opts, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; e = $f.e; opts = $f.opts; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: wg[0].Wait(); $r = f[0](e, $clone(v, reflect.Value), $clone(opts, encOpts)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.e = e; $f.opts = opts; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; })(f, wg)))); fi$1 = _tuple$1[0]; loaded = _tuple$1[1]; if (loaded) { $s = -1; return $assertType(fi$1, encoderFunc); } _r$3 = newTypeEncoder(t, true); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } f[0] = _r$3; wg[0].Done(); encoderCache.Store(t, new encoderFunc(f[0])); $s = -1; return f[0]; /* */ } return; } if ($f === undefined) { $f = { $blk: typeEncoder }; } $f._r$3 = _r$3; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.f = f; $f.fi = fi; $f.fi$1 = fi$1; $f.loaded = loaded; $f.ok = ok; $f.t = t; $f.wg = wg; $f.$s = $s; $f.$r = $r; return $f; }; newTypeEncoder = function(t, allowAddr) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, $24r$5, $24r$6, _1, _arg, _arg$1, _arg$2, _arg$3, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _v, _v$1, allowAddr, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; $24r$6 = $f.$24r$6; _1 = $f._1; _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$18 = $f._r$18; _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; _v = $f._v; _v$1 = $f._v$1; allowAddr = $f.allowAddr; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$3 = t.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 === 22)) && allowAddr)) { _v = false; $s = 3; continue s; } _r$4 = reflect.PtrTo(t).Implements(marshalerType); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _v = _r$4; case 3: /* */ if (_v) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v) { */ case 1: _arg = addrMarshalerEncoder; _r$5 = newTypeEncoder(t, false); /* */ $s = 6; case 6: 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 = 7; case 7: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } $24r = _r$6; $s = 8; case 8: return $24r; /* } */ case 2: _r$7 = t.Implements(marshalerType); /* */ $s = 11; case 11: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } /* */ if (_r$7) { $s = 9; continue; } /* */ $s = 10; continue; /* if (_r$7) { */ case 9: $s = -1; return marshalerEncoder; /* } */ case 10: _r$8 = t.Kind(); /* */ $s = 15; case 15: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } if (!(!((_r$8 === 22)) && allowAddr)) { _v$1 = false; $s = 14; continue s; } _r$9 = reflect.PtrTo(t).Implements(textMarshalerType); /* */ $s = 16; case 16: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _v$1 = _r$9; case 14: /* */ if (_v$1) { $s = 12; continue; } /* */ $s = 13; continue; /* if (_v$1) { */ case 12: _arg$2 = addrTextMarshalerEncoder; _r$10 = newTypeEncoder(t, false); /* */ $s = 17; case 17: 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 = 18; case 18: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } $24r$1 = _r$11; $s = 19; case 19: return $24r$1; /* } */ case 13: _r$12 = t.Implements(textMarshalerType); /* */ $s = 22; case 22: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } /* */ if (_r$12) { $s = 20; continue; } /* */ $s = 21; continue; /* if (_r$12) { */ case 20: $s = -1; return textMarshalerEncoder; /* } */ case 21: _r$13 = t.Kind(); /* */ $s = 24; case 24: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _1 = _r$13; /* */ if (_1 === (1)) { $s = 25; continue; } /* */ if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { $s = 26; continue; } /* */ if ((_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12))) { $s = 27; continue; } /* */ if (_1 === (13)) { $s = 28; continue; } /* */ if (_1 === (14)) { $s = 29; continue; } /* */ if (_1 === (24)) { $s = 30; continue; } /* */ if (_1 === (20)) { $s = 31; continue; } /* */ if (_1 === (25)) { $s = 32; continue; } /* */ if (_1 === (21)) { $s = 33; continue; } /* */ if (_1 === (23)) { $s = 34; continue; } /* */ if (_1 === (17)) { $s = 35; continue; } /* */ if (_1 === (22)) { $s = 36; continue; } /* */ $s = 37; continue; /* if (_1 === (1)) { */ case 25: $s = -1; return boolEncoder; /* } else if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { */ case 26: $s = -1; return intEncoder; /* } else if ((_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12))) { */ case 27: $s = -1; return uintEncoder; /* } else if (_1 === (13)) { */ case 28: $s = -1; return float32Encoder; /* } else if (_1 === (14)) { */ case 29: $s = -1; return float64Encoder; /* } else if (_1 === (24)) { */ case 30: $s = -1; return stringEncoder; /* } else if (_1 === (20)) { */ case 31: $s = -1; return interfaceEncoder; /* } else if (_1 === (25)) { */ case 32: _r$14 = newStructEncoder(t); /* */ $s = 39; case 39: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } $24r$2 = _r$14; $s = 40; case 40: return $24r$2; /* } else if (_1 === (21)) { */ case 33: _r$15 = newMapEncoder(t); /* */ $s = 41; case 41: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } $24r$3 = _r$15; $s = 42; case 42: return $24r$3; /* } else if (_1 === (23)) { */ case 34: _r$16 = newSliceEncoder(t); /* */ $s = 43; case 43: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } $24r$4 = _r$16; $s = 44; case 44: return $24r$4; /* } else if (_1 === (17)) { */ case 35: _r$17 = newArrayEncoder(t); /* */ $s = 45; case 45: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } $24r$5 = _r$17; $s = 46; case 46: return $24r$5; /* } else if (_1 === (22)) { */ case 36: _r$18 = newPtrEncoder(t); /* */ $s = 47; case 47: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } $24r$6 = _r$18; $s = 48; case 48: return $24r$6; /* } else { */ case 37: $s = -1; return unsupportedTypeEncoder; /* } */ case 38: case 23: $s = -1; return $throwNilPointerError; /* */ } return; } if ($f === undefined) { $f = { $blk: newTypeEncoder }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f.$24r$6 = $24r$6; $f._1 = _1; $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$18 = _r$18; $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._v = _v; $f._v$1 = _v$1; $f.allowAddr = allowAddr; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; invalidValueEncoder = function(e, v, param) { var _r$3, e, param, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; e = $f.e; param = $f.param; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$3 = e.Buffer.WriteString("null"); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: invalidValueEncoder }; } $f._r$3 = _r$3; $f.e = e; $f.param = param; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; marshalerEncoder = function(e, v, opts) { var _r$3, _r$4, _r$5, _r$6, _r$7, _tuple, _tuple$1, b, e, err, m, ok, opts, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; b = $f.b; e = $f.e; err = $f.err; m = $f.m; ok = $f.ok; opts = $f.opts; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (($clone(v, reflect.Value).Kind() === 22) && $clone(v, reflect.Value).IsNil()) { $s = 1; continue; } /* */ $s = 2; continue; /* if (($clone(v, reflect.Value).Kind() === 22) && $clone(v, reflect.Value).IsNil()) { */ case 1: _r$3 = e.Buffer.WriteString("null"); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $s = -1; return; /* } */ case 2: _r$4 = $clone(v, reflect.Value).Interface(); /* */ $s = 4; case 4: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple = $assertType(_r$4, Marshaler, true); m = _tuple[0]; ok = _tuple[1]; /* */ if (!ok) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!ok) { */ case 5: _r$5 = e.Buffer.WriteString("null"); /* */ $s = 7; case 7: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; $s = -1; return; /* } */ case 6: _r$6 = m.MarshalJSON(); /* */ $s = 8; case 8: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tuple$1 = _r$6; b = _tuple$1[0]; err = _tuple$1[1]; /* */ if ($interfaceIsEqual(err, $ifaceNil)) { $s = 9; continue; } /* */ $s = 10; continue; /* if ($interfaceIsEqual(err, $ifaceNil)) { */ case 9: _r$7 = compact(e.Buffer, b, opts.escapeHTML); /* */ $s = 11; case 11: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } err = _r$7; /* } */ case 10: if (!($interfaceIsEqual(err, $ifaceNil))) { e.error(new MarshalerError.ptr($clone(v, reflect.Value).Type(), err, "MarshalJSON")); } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: marshalerEncoder }; } $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.b = b; $f.e = e; $f.err = err; $f.m = m; $f.ok = ok; $f.opts = opts; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; addrMarshalerEncoder = function(e, v, opts) { var _r$3, _r$4, _r$5, _r$6, _tuple, b, e, err, m, opts, v, va, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _tuple = $f._tuple; b = $f.b; e = $f.e; err = $f.err; m = $f.m; opts = $f.opts; v = $f.v; va = $f.va; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: va = $clone(v, reflect.Value).Addr(); /* */ if ($clone(va, reflect.Value).IsNil()) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($clone(va, reflect.Value).IsNil()) { */ case 1: _r$3 = e.Buffer.WriteString("null"); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $s = -1; return; /* } */ case 2: _r$4 = $clone(va, reflect.Value).Interface(); /* */ $s = 4; case 4: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } m = $assertType(_r$4, Marshaler); _r$5 = m.MarshalJSON(); /* */ $s = 5; case 5: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple = _r$5; b = _tuple[0]; err = _tuple[1]; /* */ if ($interfaceIsEqual(err, $ifaceNil)) { $s = 6; continue; } /* */ $s = 7; continue; /* if ($interfaceIsEqual(err, $ifaceNil)) { */ case 6: _r$6 = compact(e.Buffer, b, opts.escapeHTML); /* */ $s = 8; case 8: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } err = _r$6; /* } */ case 7: if (!($interfaceIsEqual(err, $ifaceNil))) { e.error(new MarshalerError.ptr($clone(v, reflect.Value).Type(), err, "MarshalJSON")); } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: addrMarshalerEncoder }; } $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._tuple = _tuple; $f.b = b; $f.e = e; $f.err = err; $f.m = m; $f.opts = opts; $f.v = v; $f.va = va; $f.$s = $s; $f.$r = $r; return $f; }; textMarshalerEncoder = function(e, v, opts) { var _r$3, _r$4, _r$5, _r$6, _tuple, _tuple$1, b, e, err, m, ok, opts, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; b = $f.b; e = $f.e; err = $f.err; m = $f.m; ok = $f.ok; opts = $f.opts; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (($clone(v, reflect.Value).Kind() === 22) && $clone(v, reflect.Value).IsNil()) { $s = 1; continue; } /* */ $s = 2; continue; /* if (($clone(v, reflect.Value).Kind() === 22) && $clone(v, reflect.Value).IsNil()) { */ case 1: _r$3 = e.Buffer.WriteString("null"); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $s = -1; return; /* } */ case 2: _r$4 = $clone(v, reflect.Value).Interface(); /* */ $s = 4; case 4: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple = $assertType(_r$4, encoding.TextMarshaler, true); m = _tuple[0]; ok = _tuple[1]; /* */ if (!ok) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!ok) { */ case 5: _r$5 = e.Buffer.WriteString("null"); /* */ $s = 7; case 7: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; $s = -1; return; /* } */ case 6: _r$6 = m.MarshalText(); /* */ $s = 8; case 8: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tuple$1 = _r$6; b = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { e.error(new MarshalerError.ptr($clone(v, reflect.Value).Type(), err, "MarshalText")); } $r = e.stringBytes(b, opts.escapeHTML); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: textMarshalerEncoder }; } $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.b = b; $f.e = e; $f.err = err; $f.m = m; $f.ok = ok; $f.opts = opts; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; addrTextMarshalerEncoder = function(e, v, opts) { var _r$3, _r$4, _r$5, _tuple, b, e, err, m, opts, v, va, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _tuple = $f._tuple; b = $f.b; e = $f.e; err = $f.err; m = $f.m; opts = $f.opts; v = $f.v; va = $f.va; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: va = $clone(v, reflect.Value).Addr(); /* */ if ($clone(va, reflect.Value).IsNil()) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($clone(va, reflect.Value).IsNil()) { */ case 1: _r$3 = e.Buffer.WriteString("null"); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $s = -1; return; /* } */ case 2: _r$4 = $clone(va, reflect.Value).Interface(); /* */ $s = 4; case 4: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } m = $assertType(_r$4, encoding.TextMarshaler); _r$5 = m.MarshalText(); /* */ $s = 5; case 5: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple = _r$5; b = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { e.error(new MarshalerError.ptr($clone(v, reflect.Value).Type(), err, "MarshalText")); } $r = e.stringBytes(b, opts.escapeHTML); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: addrTextMarshalerEncoder }; } $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._tuple = _tuple; $f.b = b; $f.e = e; $f.err = err; $f.m = m; $f.opts = opts; $f.v = v; $f.va = va; $f.$s = $s; $f.$r = $r; return $f; }; boolEncoder = function(e, v, opts) { var _r$3, _r$4, _r$5, _r$6, e, opts, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; e = $f.e; opts = $f.opts; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (opts.quoted) { $s = 1; continue; } /* */ $s = 2; continue; /* if (opts.quoted) { */ case 1: _r$3 = e.Buffer.WriteByte(34); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; /* } */ case 2: /* */ if ($clone(v, reflect.Value).Bool()) { $s = 4; continue; } /* */ $s = 5; continue; /* if ($clone(v, reflect.Value).Bool()) { */ case 4: _r$4 = e.Buffer.WriteString("true"); /* */ $s = 7; case 7: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; $s = 6; continue; /* } else { */ case 5: _r$5 = e.Buffer.WriteString("false"); /* */ $s = 8; case 8: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; /* } */ case 6: /* */ if (opts.quoted) { $s = 9; continue; } /* */ $s = 10; continue; /* if (opts.quoted) { */ case 9: _r$6 = e.Buffer.WriteByte(34); /* */ $s = 11; case 11: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; /* } */ case 10: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: boolEncoder }; } $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f.e = e; $f.opts = opts; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; intEncoder = function(e, v, opts) { var _r$3, _r$4, _r$5, b, e, opts, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; b = $f.b; e = $f.e; opts = $f.opts; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = strconv.AppendInt($subslice(new sliceType$2(e.scratch), 0, 0), $clone(v, reflect.Value).Int(), 10); /* */ if (opts.quoted) { $s = 1; continue; } /* */ $s = 2; continue; /* if (opts.quoted) { */ case 1: _r$3 = e.Buffer.WriteByte(34); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; /* } */ case 2: _r$4 = e.Buffer.Write(b); /* */ $s = 4; case 4: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; /* */ if (opts.quoted) { $s = 5; continue; } /* */ $s = 6; continue; /* if (opts.quoted) { */ case 5: _r$5 = e.Buffer.WriteByte(34); /* */ $s = 7; case 7: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; /* } */ case 6: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: intEncoder }; } $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f.b = b; $f.e = e; $f.opts = opts; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; uintEncoder = function(e, v, opts) { var _r$3, _r$4, _r$5, b, e, opts, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; b = $f.b; e = $f.e; opts = $f.opts; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = strconv.AppendUint($subslice(new sliceType$2(e.scratch), 0, 0), $clone(v, reflect.Value).Uint(), 10); /* */ if (opts.quoted) { $s = 1; continue; } /* */ $s = 2; continue; /* if (opts.quoted) { */ case 1: _r$3 = e.Buffer.WriteByte(34); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; /* } */ case 2: _r$4 = e.Buffer.Write(b); /* */ $s = 4; case 4: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; /* */ if (opts.quoted) { $s = 5; continue; } /* */ $s = 6; continue; /* if (opts.quoted) { */ case 5: _r$5 = e.Buffer.WriteByte(34); /* */ $s = 7; case 7: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; /* } */ case 6: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: uintEncoder }; } $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f.b = b; $f.e = e; $f.opts = opts; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; floatEncoder.prototype.encode = function(e, v, opts) { var _r$3, _r$4, _r$5, abs, b, bits, e, f, fmt$1, n, opts, v, 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; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; abs = $f.abs; b = $f.b; bits = $f.bits; e = $f.e; f = $f.f; fmt$1 = $f.fmt$1; n = $f.n; opts = $f.opts; 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; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: bits = this.$val; f = $clone(v, reflect.Value).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 = $subslice(new sliceType$2(e.scratch), 0, 0); abs = math.Abs(f); fmt$1 = 102; if (!((abs === 0))) { if ((bits === 64) && (abs < 1e-06 || abs >= 1e+21) || (bits === 32) && (($fround(abs)) < 9.999999974752427e-07 || ($fround(abs)) >= 1.0000000200408773e+21)) { fmt$1 = 101; } } b = strconv.AppendFloat(b, f, fmt$1, -1, ((bits >> 0))); if (fmt$1 === 101) { n = b.$length; if (n >= 4 && ((x = n - 4 >> 0, ((x < 0 || x >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + x])) === 101) && ((x$1 = n - 3 >> 0, ((x$1 < 0 || x$1 >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + x$1])) === 45) && ((x$2 = n - 2 >> 0, ((x$2 < 0 || x$2 >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + x$2])) === 48)) { (x$4 = n - 2 >> 0, ((x$4 < 0 || x$4 >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + x$4] = (x$3 = n - 1 >> 0, ((x$3 < 0 || x$3 >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + x$3])))); b = $subslice(b, 0, (n - 1 >> 0)); } } /* */ if (opts.quoted) { $s = 1; continue; } /* */ $s = 2; continue; /* if (opts.quoted) { */ case 1: _r$3 = e.Buffer.WriteByte(34); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; /* } */ case 2: _r$4 = e.Buffer.Write(b); /* */ $s = 4; case 4: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; /* */ if (opts.quoted) { $s = 5; continue; } /* */ $s = 6; continue; /* if (opts.quoted) { */ case 5: _r$5 = e.Buffer.WriteByte(34); /* */ $s = 7; case 7: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; /* } */ case 6: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: floatEncoder.prototype.encode }; } $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f.abs = abs; $f.b = b; $f.bits = bits; $f.e = e; $f.f = f; $f.fmt$1 = fmt$1; $f.n = n; $f.opts = opts; $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.$s = $s; $f.$r = $r; return $f; }; $ptrType(floatEncoder).prototype.encode = function(e, v, opts) { return new floatEncoder(this.$get()).encode(e, v, opts); }; stringEncoder = function(e, v, opts) { var _r$10, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, e, e2, numStr, opts, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$10 = $f._r$10; _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; e = $f.e; e2 = $f.e2; numStr = $f.numStr; opts = $f.opts; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if ($interfaceIsEqual($clone(v, reflect.Value).Type(), numberType)) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($interfaceIsEqual($clone(v, reflect.Value).Type(), numberType)) { */ case 1: _r$3 = $clone(v, reflect.Value).String(); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } numStr = _r$3; if (numStr === "") { numStr = "0"; } /* */ if (!isValidNumber(numStr)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!isValidNumber(numStr)) { */ case 4: _r$4 = fmt.Errorf("json: invalid number literal %q", new sliceType([new $String(numStr)])); /* */ $s = 6; case 6: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $r = e.error(_r$4); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: /* */ if (opts.quoted) { $s = 8; continue; } /* */ $s = 9; continue; /* if (opts.quoted) { */ case 8: _r$5 = e.Buffer.WriteByte(34); /* */ $s = 10; case 10: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; /* } */ case 9: _r$6 = e.Buffer.WriteString(numStr); /* */ $s = 11; case 11: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; /* */ if (opts.quoted) { $s = 12; continue; } /* */ $s = 13; continue; /* if (opts.quoted) { */ case 12: _r$7 = e.Buffer.WriteByte(34); /* */ $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 13: $s = -1; return; /* } */ case 2: /* */ if (opts.quoted) { $s = 15; continue; } /* */ $s = 16; continue; /* if (opts.quoted) { */ case 15: _r$8 = newEncodeState(); /* */ $s = 18; case 18: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } e2 = _r$8; _r$9 = $clone(v, reflect.Value).String(); /* */ $s = 19; case 19: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $r = e2.string(_r$9, opts.escapeHTML); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = e.stringBytes(e2.Buffer.Bytes(), false); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } encodeStatePool.Put(e2); $s = 17; continue; /* } else { */ case 16: _r$10 = $clone(v, reflect.Value).String(); /* */ $s = 22; case 22: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } $r = e.string(_r$10, opts.escapeHTML); /* */ $s = 23; case 23: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 17: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: stringEncoder }; } $f._r$10 = _r$10; $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.e = e; $f.e2 = e2; $f.numStr = numStr; $f.opts = opts; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; isValidNumber = function(s) { var s; if (s === "") { return false; } if (s.charCodeAt(0) === 45) { s = $substring(s, 1); if (s === "") { return false; } } if ((s.charCodeAt(0) === 48)) { s = $substring(s, 1); } else if (49 <= s.charCodeAt(0) && s.charCodeAt(0) <= 57) { s = $substring(s, 1); while (true) { if (!(s.length > 0 && 48 <= s.charCodeAt(0) && s.charCodeAt(0) <= 57)) { break; } s = $substring(s, 1); } } else { return false; } if (s.length >= 2 && (s.charCodeAt(0) === 46) && 48 <= s.charCodeAt(1) && s.charCodeAt(1) <= 57) { s = $substring(s, 2); while (true) { if (!(s.length > 0 && 48 <= s.charCodeAt(0) && s.charCodeAt(0) <= 57)) { break; } s = $substring(s, 1); } } if (s.length >= 2 && ((s.charCodeAt(0) === 101) || (s.charCodeAt(0) === 69))) { s = $substring(s, 1); if ((s.charCodeAt(0) === 43) || (s.charCodeAt(0) === 45)) { s = $substring(s, 1); if (s === "") { return false; } } while (true) { if (!(s.length > 0 && 48 <= s.charCodeAt(0) && s.charCodeAt(0) <= 57)) { break; } s = $substring(s, 1); } } return s === ""; }; interfaceEncoder = function(e, v, opts) { var _r$3, _r$4, e, opts, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _r$4 = $f._r$4; e = $f.e; opts = $f.opts; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if ($clone(v, reflect.Value).IsNil()) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($clone(v, reflect.Value).IsNil()) { */ case 1: _r$3 = e.Buffer.WriteString("null"); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $s = -1; return; /* } */ case 2: _r$4 = $clone(v, reflect.Value).Elem(); /* */ $s = 4; case 4: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $r = e.reflectValue($clone(_r$4, reflect.Value), $clone(opts, encOpts)); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: interfaceEncoder }; } $f._r$3 = _r$3; $f._r$4 = _r$4; $f.e = e; $f.opts = opts; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; unsupportedTypeEncoder = function(e, v, param) { var e, param, v; e.error(new UnsupportedTypeError.ptr($clone(v, reflect.Value).Type())); }; structEncoder.ptr.prototype.encode = function(e, v, opts) { var _i, _i$1, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _ref$1, e, f, fv, i, i$1, next, opts, se, v, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _i$1 = $f._i$1; _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; e = $f.e; f = $f.f; fv = $f.fv; i = $f.i; i$1 = $f.i$1; next = $f.next; opts = $f.opts; se = $f.se; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: se = this; next = 123; _ref = se.fields.list; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } i = _i; f = (x = se.fields.list, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); fv = v; _ref$1 = f.index; _i$1 = 0; /* while (true) { */ case 3: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 4; continue; } i$1 = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); /* */ if ($clone(fv, reflect.Value).Kind() === 22) { $s = 5; continue; } /* */ $s = 6; continue; /* if ($clone(fv, reflect.Value).Kind() === 22) { */ case 5: if ($clone(fv, reflect.Value).IsNil()) { _i++; /* continue FieldLoop; */ $s = 1; continue s; } _r$3 = $clone(fv, reflect.Value).Elem(); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } fv = _r$3; /* } */ case 6: _r$4 = $clone(fv, reflect.Value).Field(i$1); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } fv = _r$4; _i$1++; $s = 3; continue; case 4: if (f.omitEmpty && isEmptyValue($clone(fv, reflect.Value))) { _i++; /* continue; */ $s = 1; continue; } _r$5 = e.Buffer.WriteByte(next); /* */ $s = 9; case 9: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; next = 44; /* */ if (opts.escapeHTML) { $s = 10; continue; } /* */ $s = 11; continue; /* if (opts.escapeHTML) { */ case 10: _r$6 = e.Buffer.WriteString(f.nameEscHTML); /* */ $s = 13; case 13: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; $s = 12; continue; /* } else { */ case 11: _r$7 = e.Buffer.WriteString(f.nameNonEsc); /* */ $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 12: opts.quoted = f.quoted; $r = f.encoder(e, $clone(fv, reflect.Value), $clone(opts, encOpts)); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i++; $s = 1; continue; case 2: /* */ if (next === 123) { $s = 16; continue; } /* */ $s = 17; continue; /* if (next === 123) { */ case 16: _r$8 = e.Buffer.WriteString("{}"); /* */ $s = 19; case 19: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$8; $s = 18; continue; /* } else { */ case 17: _r$9 = e.Buffer.WriteByte(125); /* */ $s = 20; case 20: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$9; /* } */ case 18: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: structEncoder.ptr.prototype.encode }; } $f._i = _i; $f._i$1 = _i$1; $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.e = e; $f.f = f; $f.fv = fv; $f.i = i; $f.i$1 = i$1; $f.next = next; $f.opts = opts; $f.se = se; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; structEncoder.prototype.encode = function(e, v, opts) { return this.$val.encode(e, v, opts); }; newStructEncoder = function(t) { var _r$3, se, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; se = $f.se; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$3 = cachedTypeFields(t); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } se = new structEncoder.ptr($clone(_r$3, structFields)); $s = -1; return $methodVal($clone(se, structEncoder), "encode"); /* */ } return; } if ($f === undefined) { $f = { $blk: newStructEncoder }; } $f._r$3 = _r$3; $f.se = se; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; mapEncoder.ptr.prototype.encode = function(e, v, opts) { var _arg, _arg$1, _arg$2, _arg$3, _entry, _i, _key, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _tuple, e, err, i, i$1, kv, me, mi, ok, opts, ptr, sv, v, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _entry = $f._entry; _i = $f._i; _key = $f._key; _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$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; e = $f.e; err = $f.err; i = $f.i; i$1 = $f.i$1; kv = $f.kv; me = $f.me; mi = $f.mi; ok = $f.ok; opts = $f.opts; ptr = $f.ptr; sv = $f.sv; v = $f.v; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); sv = [sv]; me = this; /* */ if ($clone(v, reflect.Value).IsNil()) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($clone(v, reflect.Value).IsNil()) { */ case 1: _r$3 = e.Buffer.WriteString("null"); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $s = 4; case 4: return; /* } */ case 2: e.ptrLevel = e.ptrLevel + (1) >>> 0; /* */ if (e.ptrLevel > 1000) { $s = 5; continue; } /* */ $s = 6; continue; /* if (e.ptrLevel > 1000) { */ case 5: ptr = $clone(v, reflect.Value).Pointer(); _tuple = (_entry = e.ptrSeen[$emptyInterface.keyFor(new $Uintptr(ptr))], _entry !== undefined ? [_entry.v, true] : [new structType.ptr(), false]); ok = _tuple[1]; /* */ if (ok) { $s = 7; continue; } /* */ $s = 8; continue; /* if (ok) { */ case 7: _r$4 = fmt.Sprintf("encountered a cycle via %s", new sliceType([$clone(v, reflect.Value).Type()])); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $r = e.error(new UnsupportedValueError.ptr($clone(v, reflect.Value), _r$4)); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 8: _key = new $Uintptr(ptr); (e.ptrSeen || $throwRuntimeError("assignment to entry in nil map"))[$emptyInterface.keyFor(_key)] = { k: _key, v: new structType.ptr() }; $deferred.push([function(_arg, _arg$1) { delete _arg[$emptyInterface.keyFor(_arg$1)]; }, [e.ptrSeen, new $Uintptr(ptr)]]); /* } */ case 6: _r$5 = e.Buffer.WriteByte(123); /* */ $s = 11; case 11: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; sv[0] = $makeSlice(sliceType$4, $clone(v, reflect.Value).Len()); mi = $clone(v, reflect.Value).MapRange(); i = 0; /* while (true) { */ case 12: _r$6 = mi.Next(); /* */ $s = 14; case 14: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } /* if (!(_r$6)) { break; } */ if(!(_r$6)) { $s = 13; continue; } _r$7 = mi.Key(); /* */ $s = 15; case 15: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } ((i < 0 || i >= sv[0].$length) ? ($throwRuntimeError("index out of range"), undefined) : sv[0].$array[sv[0].$offset + i]).k = _r$7; _r$8 = mi.Value(); /* */ $s = 16; case 16: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } ((i < 0 || i >= sv[0].$length) ? ($throwRuntimeError("index out of range"), undefined) : sv[0].$array[sv[0].$offset + i]).v = _r$8; _r$9 = ((i < 0 || i >= sv[0].$length) ? ($throwRuntimeError("index out of range"), undefined) : sv[0].$array[sv[0].$offset + i]).resolve(); /* */ $s = 17; case 17: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err = _r$9; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 18; continue; } /* */ $s = 19; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 18: _r$10 = $clone(v, reflect.Value).Type().String(); /* */ $s = 20; case 20: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _arg$2 = new $String(_r$10); _r$11 = err.Error(); /* */ $s = 21; case 21: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _arg$3 = new $String(_r$11); _r$12 = fmt.Errorf("json: encoding error for type %q: %q", new sliceType([_arg$2, _arg$3])); /* */ $s = 22; case 22: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } $r = e.error(_r$12); /* */ $s = 23; case 23: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 19: i = i + (1) >> 0; $s = 12; continue; case 13: $r = sort.Slice(sv[0], (function(sv) { return function(i$1, j) { var i$1, j; return ((i$1 < 0 || i$1 >= sv[0].$length) ? ($throwRuntimeError("index out of range"), undefined) : sv[0].$array[sv[0].$offset + i$1]).ks < ((j < 0 || j >= sv[0].$length) ? ($throwRuntimeError("index out of range"), undefined) : sv[0].$array[sv[0].$offset + j]).ks; }; })(sv)); /* */ $s = 24; case 24: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _ref = sv[0]; _i = 0; /* while (true) { */ case 25: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 26; continue; } i$1 = _i; kv = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), reflectWithString); /* */ if (i$1 > 0) { $s = 27; continue; } /* */ $s = 28; continue; /* if (i$1 > 0) { */ case 27: _r$13 = e.Buffer.WriteByte(44); /* */ $s = 29; case 29: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _r$13; /* } */ case 28: $r = e.string(kv.ks, opts.escapeHTML); /* */ $s = 30; case 30: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$14 = e.Buffer.WriteByte(58); /* */ $s = 31; case 31: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _r$14; $r = me.elemEnc(e, $clone(kv.v, reflect.Value), $clone(opts, encOpts)); /* */ $s = 32; case 32: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i++; $s = 25; continue; case 26: _r$15 = e.Buffer.WriteByte(125); /* */ $s = 33; case 33: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _r$15; e.ptrLevel = e.ptrLevel - (1) >>> 0; $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: mapEncoder.ptr.prototype.encode }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._entry = _entry; $f._i = _i; $f._key = _key; $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$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.e = e; $f.err = err; $f.i = i; $f.i$1 = i$1; $f.kv = kv; $f.me = me; $f.mi = mi; $f.ok = ok; $f.opts = opts; $f.ptr = ptr; $f.sv = sv; $f.v = v; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; mapEncoder.prototype.encode = function(e, v, opts) { return this.$val.encode(e, v, opts); }; newMapEncoder = function(t) { var _1, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, me, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _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; me = $f.me; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$3 = t.Key(); /* */ $s = 2; case 2: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = _r$3.Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _1 = _r$4; /* */ if ((_1 === (24)) || (_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6)) || (_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12))) { $s = 4; continue; } _r$5 = t.Key(); /* */ $s = 7; case 7: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$6 = _r$5.Implements(textMarshalerType); /* */ $s = 8; case 8: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } /* */ if (!_r$6) { $s = 5; continue; } /* */ $s = 6; continue; /* if ((_1 === (24)) || (_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6)) || (_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12))) { */ case 4: $s = 6; continue; /* } else if (!_r$6) { */ case 5: $s = -1; return unsupportedTypeEncoder; /* } */ case 6: case 1: _r$7 = t.Elem(); /* */ $s = 9; case 9: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$8 = typeEncoder(_r$7); /* */ $s = 10; case 10: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } me = new mapEncoder.ptr(_r$8); $s = -1; return $methodVal($clone(me, mapEncoder), "encode"); /* */ } return; } if ($f === undefined) { $f = { $blk: newMapEncoder }; } $f._1 = _1; $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.me = me; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; encodeByteSlice = function(e, v, param) { var _r$10, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, dst, dst$1, e, enc, encodedLen, param, s, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$10 = $f._r$10; _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; dst = $f.dst; dst$1 = $f.dst$1; e = $f.e; enc = $f.enc; encodedLen = $f.encodedLen; param = $f.param; s = $f.s; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if ($clone(v, reflect.Value).IsNil()) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($clone(v, reflect.Value).IsNil()) { */ case 1: _r$3 = e.Buffer.WriteString("null"); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $s = -1; return; /* } */ case 2: _r$4 = $clone(v, reflect.Value).Bytes(); /* */ $s = 4; case 4: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } s = _r$4; _r$5 = e.Buffer.WriteByte(34); /* */ $s = 5; case 5: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; encodedLen = base64.StdEncoding.EncodedLen(s.$length); /* */ if (encodedLen <= 64) { $s = 6; continue; } /* */ if (encodedLen <= 1024) { $s = 7; continue; } /* */ $s = 8; continue; /* if (encodedLen <= 64) { */ case 6: dst = $subslice(new sliceType$2(e.scratch), 0, encodedLen); base64.StdEncoding.Encode(dst, s); _r$6 = e.Buffer.Write(dst); /* */ $s = 10; case 10: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; $s = 9; continue; /* } else if (encodedLen <= 1024) { */ case 7: dst$1 = $makeSlice(sliceType$2, encodedLen); base64.StdEncoding.Encode(dst$1, s); _r$7 = e.Buffer.Write(dst$1); /* */ $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 = 9; continue; /* } else { */ case 8: enc = base64.NewEncoder(base64.StdEncoding, e); _r$8 = enc.Write(s); /* */ $s = 12; case 12: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$8; _r$9 = enc.Close(); /* */ $s = 13; case 13: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$9; /* } */ case 9: _r$10 = e.Buffer.WriteByte(34); /* */ $s = 14; case 14: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: encodeByteSlice }; } $f._r$10 = _r$10; $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.dst = dst; $f.dst$1 = dst$1; $f.e = e; $f.enc = enc; $f.encodedLen = encodedLen; $f.param = param; $f.s = s; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; sliceEncoder.ptr.prototype.encode = function(e, v, opts) { var _arg, _arg$1, _entry, _key, _r$3, _r$4, _tuple, e, ok, opts, ptr, se, v, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _entry = $f._entry; _key = $f._key; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; e = $f.e; ok = $f.ok; opts = $f.opts; ptr = $f.ptr; se = $f.se; v = $f.v; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); se = this; /* */ if ($clone(v, reflect.Value).IsNil()) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($clone(v, reflect.Value).IsNil()) { */ case 1: _r$3 = e.Buffer.WriteString("null"); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $s = 4; case 4: return; /* } */ case 2: e.ptrLevel = e.ptrLevel + (1) >>> 0; /* */ if (e.ptrLevel > 1000) { $s = 5; continue; } /* */ $s = 6; continue; /* if (e.ptrLevel > 1000) { */ case 5: ptr = new structType$1.ptr($clone(v, reflect.Value).Pointer(), $clone(v, reflect.Value).Len()); _tuple = (_entry = e.ptrSeen[$emptyInterface.keyFor(new ptr.constructor.elem(ptr))], _entry !== undefined ? [_entry.v, true] : [new structType.ptr(), false]); ok = _tuple[1]; /* */ if (ok) { $s = 7; continue; } /* */ $s = 8; continue; /* if (ok) { */ case 7: _r$4 = fmt.Sprintf("encountered a cycle via %s", new sliceType([$clone(v, reflect.Value).Type()])); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $r = e.error(new UnsupportedValueError.ptr($clone(v, reflect.Value), _r$4)); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 8: _key = new ptr.constructor.elem(ptr); (e.ptrSeen || $throwRuntimeError("assignment to entry in nil map"))[$emptyInterface.keyFor(_key)] = { k: _key, v: new structType.ptr() }; $deferred.push([function(_arg, _arg$1) { delete _arg[$emptyInterface.keyFor(_arg$1)]; }, [e.ptrSeen, new ptr.constructor.elem(ptr)]]); /* } */ case 6: $r = se.arrayEnc(e, $clone(v, reflect.Value), $clone(opts, encOpts)); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } e.ptrLevel = e.ptrLevel - (1) >>> 0; $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: sliceEncoder.ptr.prototype.encode }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._entry = _entry; $f._key = _key; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f.e = e; $f.ok = ok; $f.opts = opts; $f.ptr = ptr; $f.se = se; $f.v = v; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; sliceEncoder.prototype.encode = function(e, v, opts) { return this.$val.encode(e, v, opts); }; newSliceEncoder = function(t) { var _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _v, enc, p, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; _v = $f._v; enc = $f.enc; p = $f.p; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$3 = t.Elem(); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = _r$3.Kind(); /* */ $s = 4; case 4: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } /* */ if (_r$4 === 8) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_r$4 === 8) { */ case 1: _r$5 = t.Elem(); /* */ $s = 5; case 5: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$6 = reflect.PtrTo(_r$5); /* */ $s = 6; case 6: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } p = _r$6; _r$7 = p.Implements(marshalerType); /* */ $s = 10; case 10: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } if (!(!_r$7)) { _v = false; $s = 9; continue s; } _r$8 = p.Implements(textMarshalerType); /* */ $s = 11; case 11: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _v = !_r$8; case 9: /* */ if (_v) { $s = 7; continue; } /* */ $s = 8; continue; /* if (_v) { */ case 7: $s = -1; return encodeByteSlice; /* } */ case 8: /* } */ case 2: _r$9 = newArrayEncoder(t); /* */ $s = 12; case 12: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } enc = new sliceEncoder.ptr(_r$9); $s = -1; return $methodVal($clone(enc, sliceEncoder), "encode"); /* */ } return; } if ($f === undefined) { $f = { $blk: newSliceEncoder }; } $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._v = _v; $f.enc = enc; $f.p = p; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; arrayEncoder.ptr.prototype.encode = function(e, v, opts) { var _arg, _arg$1, _arg$2, _r$3, _r$4, _r$5, _r$6, ae, e, i, n, opts, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; ae = $f.ae; e = $f.e; i = $f.i; n = $f.n; opts = $f.opts; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ae = this; _r$3 = e.Buffer.WriteByte(91); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; n = $clone(v, reflect.Value).Len(); i = 0; /* while (true) { */ case 2: /* if (!(i < n)) { break; } */ if(!(i < n)) { $s = 3; continue; } /* */ if (i > 0) { $s = 4; continue; } /* */ $s = 5; continue; /* if (i > 0) { */ case 4: _r$4 = e.Buffer.WriteByte(44); /* */ $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 5: _arg = e; _r$5 = $clone(v, reflect.Value).Index(i); /* */ $s = 7; case 7: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg$1 = $clone(_r$5, reflect.Value); _arg$2 = $clone(opts, encOpts); $r = ae.elemEnc(_arg, _arg$1, _arg$2); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i = i + (1) >> 0; $s = 2; continue; case 3: _r$6 = e.Buffer.WriteByte(93); /* */ $s = 9; case 9: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: arrayEncoder.ptr.prototype.encode }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f.ae = ae; $f.e = e; $f.i = i; $f.n = n; $f.opts = opts; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; arrayEncoder.prototype.encode = function(e, v, opts) { return this.$val.encode(e, v, opts); }; newArrayEncoder = function(t) { var _r$3, _r$4, enc, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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$3 = t.Elem(); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = typeEncoder(_r$3); /* */ $s = 2; case 2: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } enc = new arrayEncoder.ptr(_r$4); $s = -1; return $methodVal($clone(enc, arrayEncoder), "encode"); /* */ } return; } if ($f === undefined) { $f = { $blk: newArrayEncoder }; } $f._r$3 = _r$3; $f._r$4 = _r$4; $f.enc = enc; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; ptrEncoder.ptr.prototype.encode = function(e, v, opts) { var _arg, _arg$1, _arg$2, _arg$3, _arg$4, _entry, _key, _r$3, _r$4, _r$5, _r$6, _tuple, e, ok, opts, pe, ptr, v, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _arg$4 = $f._arg$4; _entry = $f._entry; _key = $f._key; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _tuple = $f._tuple; e = $f.e; ok = $f.ok; opts = $f.opts; pe = $f.pe; ptr = $f.ptr; v = $f.v; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); pe = this; /* */ if ($clone(v, reflect.Value).IsNil()) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($clone(v, reflect.Value).IsNil()) { */ case 1: _r$3 = e.Buffer.WriteString("null"); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $s = 4; case 4: return; /* } */ case 2: e.ptrLevel = e.ptrLevel + (1) >>> 0; /* */ if (e.ptrLevel > 1000) { $s = 5; continue; } /* */ $s = 6; continue; /* if (e.ptrLevel > 1000) { */ case 5: _r$4 = $clone(v, reflect.Value).Interface(); /* */ $s = 7; case 7: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } ptr = _r$4; _tuple = (_entry = e.ptrSeen[$emptyInterface.keyFor(ptr)], _entry !== undefined ? [_entry.v, true] : [new structType.ptr(), false]); ok = _tuple[1]; /* */ if (ok) { $s = 8; continue; } /* */ $s = 9; continue; /* if (ok) { */ case 8: _r$5 = fmt.Sprintf("encountered a cycle via %s", new sliceType([$clone(v, reflect.Value).Type()])); /* */ $s = 10; case 10: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $r = e.error(new UnsupportedValueError.ptr($clone(v, reflect.Value), _r$5)); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 9: _key = ptr; (e.ptrSeen || $throwRuntimeError("assignment to entry in nil map"))[$emptyInterface.keyFor(_key)] = { k: _key, v: new structType.ptr() }; $deferred.push([function(_arg, _arg$1) { delete _arg[$emptyInterface.keyFor(_arg$1)]; }, [e.ptrSeen, ptr]]); /* } */ case 6: _arg$2 = e; _r$6 = $clone(v, reflect.Value).Elem(); /* */ $s = 12; case 12: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _arg$3 = $clone(_r$6, reflect.Value); _arg$4 = $clone(opts, encOpts); $r = pe.elemEnc(_arg$2, _arg$3, _arg$4); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } e.ptrLevel = e.ptrLevel - (1) >>> 0; $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: ptrEncoder.ptr.prototype.encode }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._arg$4 = _arg$4; $f._entry = _entry; $f._key = _key; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._tuple = _tuple; $f.e = e; $f.ok = ok; $f.opts = opts; $f.pe = pe; $f.ptr = ptr; $f.v = v; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; ptrEncoder.prototype.encode = function(e, v, opts) { return this.$val.encode(e, v, opts); }; newPtrEncoder = function(t) { var _r$3, _r$4, enc, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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$3 = t.Elem(); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = typeEncoder(_r$3); /* */ $s = 2; case 2: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } enc = new ptrEncoder.ptr(_r$4); $s = -1; return $methodVal($clone(enc, ptrEncoder), "encode"); /* */ } return; } if ($f === undefined) { $f = { $blk: newPtrEncoder }; } $f._r$3 = _r$3; $f._r$4 = _r$4; $f.enc = enc; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; condAddrEncoder.ptr.prototype.encode = function(e, v, opts) { var ce, e, opts, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; ce = $f.ce; e = $f.e; opts = $f.opts; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ce = this; /* */ if ($clone(v, reflect.Value).CanAddr()) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($clone(v, reflect.Value).CanAddr()) { */ case 1: $r = ce.canAddrEnc(e, $clone(v, reflect.Value), $clone(opts, encOpts)); /* */ $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, $clone(v, reflect.Value), $clone(opts, encOpts)); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: condAddrEncoder.ptr.prototype.encode }; } $f.ce = ce; $f.e = e; $f.opts = opts; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; condAddrEncoder.prototype.encode = function(e, v, opts) { return this.$val.encode(e, v, opts); }; newCondAddrEncoder = function(canAddrEnc, elseEnc) { var canAddrEnc, elseEnc, enc; enc = new condAddrEncoder.ptr(canAddrEnc, elseEnc); return $methodVal($clone(enc, condAddrEncoder), "encode"); }; isValidTag = function(s) { var _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; }; typeByIndex = function(t, index) { var _i, _r$3, _r$4, _r$5, _ref, i, index, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _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"), undefined) : _ref.$array[_ref.$offset + _i]); _r$3 = t.Kind(); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } /* */ if (_r$3 === 22) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_r$3 === 22) { */ case 3: _r$4 = t.Elem(); /* */ $s = 6; case 6: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } t = _r$4; /* } */ case 4: _r$5 = t.Field(i); /* */ $s = 7; case 7: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } t = _r$5.Type; _i++; $s = 1; continue; case 2: $s = -1; return t; /* */ } return; } if ($f === undefined) { $f = { $blk: typeByIndex }; } $f._i = _i; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._ref = _ref; $f.i = i; $f.index = index; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; reflectWithString.ptr.prototype.resolve = function() { var _1, _r$3, _r$4, _r$5, _tuple, _tuple$1, buf, err, ok, tm, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; buf = $f.buf; err = $f.err; ok = $f.ok; tm = $f.tm; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: w = this; /* */ if ($clone(w.k, reflect.Value).Kind() === 24) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($clone(w.k, reflect.Value).Kind() === 24) { */ case 1: _r$3 = $clone(w.k, reflect.Value).String(); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } w.ks = _r$3; $s = -1; return $ifaceNil; /* } */ case 2: _r$4 = $clone(w.k, reflect.Value).Interface(); /* */ $s = 4; case 4: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple = $assertType(_r$4, encoding.TextMarshaler, true); tm = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 5; continue; } /* */ $s = 6; continue; /* if (ok) { */ case 5: if (($clone(w.k, reflect.Value).Kind() === 22) && $clone(w.k, reflect.Value).IsNil()) { $s = -1; return $ifaceNil; } _r$5 = tm.MarshalText(); /* */ $s = 7; case 7: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$1 = _r$5; buf = _tuple$1[0]; err = _tuple$1[1]; w.ks = ($bytesToString(buf)); $s = -1; return err; /* } */ case 6: _1 = $clone(w.k, reflect.Value).Kind(); if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { w.ks = strconv.FormatInt($clone(w.k, reflect.Value).Int(), 10); $s = -1; return $ifaceNil; } else if ((_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12))) { w.ks = strconv.FormatUint($clone(w.k, reflect.Value).Uint(), 10); $s = -1; return $ifaceNil; } $panic(new $String("unexpected map key type")); $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: reflectWithString.ptr.prototype.resolve }; } $f._1 = _1; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.buf = buf; $f.err = err; $f.ok = ok; $f.tm = tm; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; reflectWithString.prototype.resolve = function() { return this.$val.resolve(); }; encodeState.ptr.prototype.string = function(s, escapeHTML) { var _1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$19, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, b, c, e, escapeHTML, i, s, size, start, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._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$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; _tuple = $f._tuple; b = $f.b; c = $f.c; e = $f.e; escapeHTML = $f.escapeHTML; i = $f.i; s = $f.s; size = $f.size; start = $f.start; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; _r$3 = e.Buffer.WriteByte(34); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; start = 0; i = 0; /* while (true) { */ case 2: /* if (!(i < s.length)) { break; } */ if(!(i < s.length)) { $s = 3; continue; } b = s.charCodeAt(i); /* */ if (b < 128) { $s = 4; continue; } /* */ $s = 5; continue; /* if (b < 128) { */ case 4: if (((b < 0 || b >= htmlSafeSet.length) ? ($throwRuntimeError("index out of range"), undefined) : htmlSafeSet[b]) || (!escapeHTML && ((b < 0 || b >= safeSet.length) ? ($throwRuntimeError("index out of range"), undefined) : safeSet[b]))) { i = i + (1) >> 0; /* continue; */ $s = 2; continue; } /* */ if (start < i) { $s = 6; continue; } /* */ $s = 7; continue; /* if (start < i) { */ case 6: _r$4 = e.Buffer.WriteString($substring(s, start, i)); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; /* } */ case 7: _r$5 = e.Buffer.WriteByte(92); /* */ $s = 9; case 9: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; _1 = b; /* */ if ((_1 === (92)) || (_1 === (34))) { $s = 11; continue; } /* */ if (_1 === (10)) { $s = 12; continue; } /* */ if (_1 === (13)) { $s = 13; continue; } /* */ if (_1 === (9)) { $s = 14; continue; } /* */ $s = 15; continue; /* if ((_1 === (92)) || (_1 === (34))) { */ case 11: _r$6 = e.Buffer.WriteByte(b); /* */ $s = 17; case 17: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; $s = 16; continue; /* } else if (_1 === (10)) { */ case 12: _r$7 = e.Buffer.WriteByte(110); /* */ $s = 18; case 18: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$7; $s = 16; continue; /* } else if (_1 === (13)) { */ case 13: _r$8 = e.Buffer.WriteByte(114); /* */ $s = 19; case 19: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$8; $s = 16; continue; /* } else if (_1 === (9)) { */ case 14: _r$9 = e.Buffer.WriteByte(116); /* */ $s = 20; case 20: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$9; $s = 16; continue; /* } else { */ case 15: _r$10 = e.Buffer.WriteString("u00"); /* */ $s = 21; case 21: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; _r$11 = e.Buffer.WriteByte(hex.charCodeAt((b >>> 4 << 24 >>> 24))); /* */ $s = 22; case 22: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _r$11; _r$12 = e.Buffer.WriteByte(hex.charCodeAt(((b & 15) >>> 0))); /* */ $s = 23; case 23: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _r$12; /* } */ case 16: case 10: i = i + (1) >> 0; start = i; /* continue; */ $s = 2; continue; /* } */ case 5: _tuple = utf8.DecodeRuneInString($substring(s, i)); c = _tuple[0]; size = _tuple[1]; /* */ if ((c === 65533) && (size === 1)) { $s = 24; continue; } /* */ $s = 25; continue; /* if ((c === 65533) && (size === 1)) { */ case 24: /* */ if (start < i) { $s = 26; continue; } /* */ $s = 27; continue; /* if (start < i) { */ case 26: _r$13 = e.Buffer.WriteString($substring(s, start, i)); /* */ $s = 28; case 28: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _r$13; /* } */ case 27: _r$14 = e.Buffer.WriteString("\\ufffd"); /* */ $s = 29; case 29: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _r$14; i = i + (size) >> 0; start = i; /* continue; */ $s = 2; continue; /* } */ case 25: /* */ if ((c === 8232) || (c === 8233)) { $s = 30; continue; } /* */ $s = 31; continue; /* if ((c === 8232) || (c === 8233)) { */ case 30: /* */ if (start < i) { $s = 32; continue; } /* */ $s = 33; continue; /* if (start < i) { */ case 32: _r$15 = e.Buffer.WriteString($substring(s, start, i)); /* */ $s = 34; case 34: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _r$15; /* } */ case 33: _r$16 = e.Buffer.WriteString("\\u202"); /* */ $s = 35; case 35: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _r$16; _r$17 = e.Buffer.WriteByte(hex.charCodeAt((c & 15))); /* */ $s = 36; case 36: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } _r$17; i = i + (size) >> 0; start = i; /* continue; */ $s = 2; continue; /* } */ case 31: i = i + (size) >> 0; $s = 2; continue; case 3: /* */ if (start < s.length) { $s = 37; continue; } /* */ $s = 38; continue; /* if (start < s.length) { */ case 37: _r$18 = e.Buffer.WriteString($substring(s, start)); /* */ $s = 39; case 39: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } _r$18; /* } */ case 38: _r$19 = e.Buffer.WriteByte(34); /* */ $s = 40; case 40: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } _r$19; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: encodeState.ptr.prototype.string }; } $f._1 = _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$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._tuple = _tuple; $f.b = b; $f.c = c; $f.e = e; $f.escapeHTML = escapeHTML; $f.i = i; $f.s = s; $f.size = size; $f.start = start; $f.$s = $s; $f.$r = $r; return $f; }; encodeState.prototype.string = function(s, escapeHTML) { return this.$val.string(s, escapeHTML); }; encodeState.ptr.prototype.stringBytes = function(s, escapeHTML) { var _1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$19, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, b, c, e, escapeHTML, i, s, size, start, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._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$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; _tuple = $f._tuple; b = $f.b; c = $f.c; e = $f.e; escapeHTML = $f.escapeHTML; i = $f.i; s = $f.s; size = $f.size; start = $f.start; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; _r$3 = e.Buffer.WriteByte(34); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; start = 0; i = 0; /* while (true) { */ case 2: /* if (!(i < s.$length)) { break; } */ if(!(i < s.$length)) { $s = 3; continue; } b = ((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]); /* */ if (b < 128) { $s = 4; continue; } /* */ $s = 5; continue; /* if (b < 128) { */ case 4: if (((b < 0 || b >= htmlSafeSet.length) ? ($throwRuntimeError("index out of range"), undefined) : htmlSafeSet[b]) || (!escapeHTML && ((b < 0 || b >= safeSet.length) ? ($throwRuntimeError("index out of range"), undefined) : safeSet[b]))) { i = i + (1) >> 0; /* continue; */ $s = 2; continue; } /* */ if (start < i) { $s = 6; continue; } /* */ $s = 7; continue; /* if (start < i) { */ case 6: _r$4 = e.Buffer.Write($subslice(s, start, i)); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; /* } */ case 7: _r$5 = e.Buffer.WriteByte(92); /* */ $s = 9; case 9: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; _1 = b; /* */ if ((_1 === (92)) || (_1 === (34))) { $s = 11; continue; } /* */ if (_1 === (10)) { $s = 12; continue; } /* */ if (_1 === (13)) { $s = 13; continue; } /* */ if (_1 === (9)) { $s = 14; continue; } /* */ $s = 15; continue; /* if ((_1 === (92)) || (_1 === (34))) { */ case 11: _r$6 = e.Buffer.WriteByte(b); /* */ $s = 17; case 17: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; $s = 16; continue; /* } else if (_1 === (10)) { */ case 12: _r$7 = e.Buffer.WriteByte(110); /* */ $s = 18; case 18: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$7; $s = 16; continue; /* } else if (_1 === (13)) { */ case 13: _r$8 = e.Buffer.WriteByte(114); /* */ $s = 19; case 19: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$8; $s = 16; continue; /* } else if (_1 === (9)) { */ case 14: _r$9 = e.Buffer.WriteByte(116); /* */ $s = 20; case 20: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$9; $s = 16; continue; /* } else { */ case 15: _r$10 = e.Buffer.WriteString("u00"); /* */ $s = 21; case 21: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; _r$11 = e.Buffer.WriteByte(hex.charCodeAt((b >>> 4 << 24 >>> 24))); /* */ $s = 22; case 22: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _r$11; _r$12 = e.Buffer.WriteByte(hex.charCodeAt(((b & 15) >>> 0))); /* */ $s = 23; case 23: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _r$12; /* } */ case 16: case 10: i = i + (1) >> 0; start = i; /* continue; */ $s = 2; continue; /* } */ case 5: _tuple = utf8.DecodeRune($subslice(s, i)); c = _tuple[0]; size = _tuple[1]; /* */ if ((c === 65533) && (size === 1)) { $s = 24; continue; } /* */ $s = 25; continue; /* if ((c === 65533) && (size === 1)) { */ case 24: /* */ if (start < i) { $s = 26; continue; } /* */ $s = 27; continue; /* if (start < i) { */ case 26: _r$13 = e.Buffer.Write($subslice(s, start, i)); /* */ $s = 28; case 28: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _r$13; /* } */ case 27: _r$14 = e.Buffer.WriteString("\\ufffd"); /* */ $s = 29; case 29: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _r$14; i = i + (size) >> 0; start = i; /* continue; */ $s = 2; continue; /* } */ case 25: /* */ if ((c === 8232) || (c === 8233)) { $s = 30; continue; } /* */ $s = 31; continue; /* if ((c === 8232) || (c === 8233)) { */ case 30: /* */ if (start < i) { $s = 32; continue; } /* */ $s = 33; continue; /* if (start < i) { */ case 32: _r$15 = e.Buffer.Write($subslice(s, start, i)); /* */ $s = 34; case 34: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _r$15; /* } */ case 33: _r$16 = e.Buffer.WriteString("\\u202"); /* */ $s = 35; case 35: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _r$16; _r$17 = e.Buffer.WriteByte(hex.charCodeAt((c & 15))); /* */ $s = 36; case 36: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } _r$17; i = i + (size) >> 0; start = i; /* continue; */ $s = 2; continue; /* } */ case 31: i = i + (size) >> 0; $s = 2; continue; case 3: /* */ if (start < s.$length) { $s = 37; continue; } /* */ $s = 38; continue; /* if (start < s.$length) { */ case 37: _r$18 = e.Buffer.Write($subslice(s, start)); /* */ $s = 39; case 39: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } _r$18; /* } */ case 38: _r$19 = e.Buffer.WriteByte(34); /* */ $s = 40; case 40: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } _r$19; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: encodeState.ptr.prototype.stringBytes }; } $f._1 = _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$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._tuple = _tuple; $f.b = b; $f.c = c; $f.e = e; $f.escapeHTML = escapeHTML; $f.i = i; $f.s = s; $f.size = size; $f.start = start; $f.$s = $s; $f.$r = $r; return $f; }; encodeState.prototype.stringBytes = function(s, escapeHTML) { return this.$val.stringBytes(s, escapeHTML); }; byIndex.prototype.Len = function() { var x; x = this; return x.$length; }; $ptrType(byIndex).prototype.Len = function() { return this.$get().Len(); }; byIndex.prototype.Swap = function(i, j) { var _tmp, _tmp$1, i, j, x; x = this; _tmp = $clone(((j < 0 || j >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + j]), field); _tmp$1 = $clone(((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]), field); field.copy(((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]), _tmp); field.copy(((j < 0 || j >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : 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 _i, _ref, i, j, k, x, x$1, x$2, xik; x = this; _ref = ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : 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"), undefined) : _ref.$array[_ref.$offset + _i]); if (k >= ((j < 0 || j >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + j]).index.$length) { return false; } if (!((xik === (x$1 = ((j < 0 || j >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + j]).index, ((k < 0 || k >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + k]))))) { return xik < (x$2 = ((j < 0 || j >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + j]).index, ((k < 0 || k >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + k])); } _i++; } return ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]).index.$length < ((j < 0 || j >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + j]).index.$length; }; $ptrType(byIndex).prototype.Less = function(i, j) { return this.$get().Less(i, j); }; typeFields = function(t) { var _1, _entry, _entry$1, _entry$2, _entry$3, _i, _i$1, _i$2, _key, _key$1, _key$2, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _ref$1, _ref$2, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, _tuple$1, _v, _v$1, _v$2, advance, count, current, dominant, f, f$1, fi, field$1, field$2, fields, fj, ft, i, i$1, i$2, i$3, index, name, name$1, nameEscBuf, nameIndex, next, nextCount, ok, opts, out, quoted, sf, t, t$1, tag, tagged, visited, 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; _1 = $f._1; _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; _i$2 = $f._i$2; _key = $f._key; _key$1 = $f._key$1; _key$2 = $f._key$2; _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$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; _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; _tuple$1 = $f._tuple$1; _v = $f._v; _v$1 = $f._v$1; _v$2 = $f._v$2; advance = $f.advance; count = $f.count; current = $f.current; dominant = $f.dominant; f = $f.f; f$1 = $f.f$1; fi = $f.fi; field$1 = $f.field$1; field$2 = $f.field$2; fields = $f.fields; fj = $f.fj; ft = $f.ft; i = $f.i; i$1 = $f.i$1; i$2 = $f.i$2; i$3 = $f.i$3; index = $f.index; name = $f.name; name$1 = $f.name$1; nameEscBuf = $f.nameEscBuf; nameIndex = $f.nameIndex; next = $f.next; nextCount = $f.nextCount; ok = $f.ok; opts = $f.opts; out = $f.out; quoted = $f.quoted; sf = $f.sf; t = $f.t; t$1 = $f.t$1; tag = $f.tag; tagged = $f.tagged; visited = $f.visited; 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: fields = [fields]; nameEscBuf = [nameEscBuf]; current = new sliceType$3([]); next = new sliceType$3([new field.ptr("", sliceType$2.nil, $throwNilPointerError, "", "", false, sliceType$1.nil, t, false, false, $throwNilPointerError)]); _tmp = false; _tmp$1 = false; count = _tmp; nextCount = _tmp$1; visited = $makeMap(reflect.Type.keyFor, []); fields[0] = sliceType$3.nil; nameEscBuf[0] = new bytes.Buffer.ptr(sliceType$2.nil, 0, 0); /* while (true) { */ case 1: /* if (!(next.$length > 0)) { break; } */ if(!(next.$length > 0)) { $s = 2; continue; } _tmp$2 = next; _tmp$3 = $subslice(current, 0, 0); current = _tmp$2; next = _tmp$3; _tmp$4 = nextCount; _tmp$5 = $makeMap(reflect.Type.keyFor, []); count = _tmp$4; nextCount = _tmp$5; _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"), undefined) : _ref.$array[_ref.$offset + _i]), field); if ((_entry = visited[reflect.Type.keyFor(f.typ)], _entry !== undefined ? _entry.v : false)) { _i++; /* continue; */ $s = 3; continue; } _key = f.typ; (visited || $throwRuntimeError("assignment to entry in nil map"))[reflect.Type.keyFor(_key)] = { k: _key, v: true }; i = 0; /* while (true) { */ case 5: _r$3 = f.typ.NumField(); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } /* if (!(i < _r$3)) { break; } */ if(!(i < _r$3)) { $s = 6; continue; } _r$4 = f.typ.Field(i); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } sf = $clone(_r$4, reflect.StructField); /* */ if (sf.Anonymous) { $s = 9; continue; } /* */ if (!$clone(sf, reflect.StructField).IsExported()) { $s = 10; continue; } /* */ $s = 11; continue; /* if (sf.Anonymous) { */ case 9: t$1 = sf.Type; _r$5 = t$1.Kind(); /* */ $s = 14; case 14: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } /* */ if (_r$5 === 22) { $s = 12; continue; } /* */ $s = 13; continue; /* if (_r$5 === 22) { */ case 12: _r$6 = t$1.Elem(); /* */ $s = 15; case 15: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } t$1 = _r$6; /* } */ case 13: if (!(!$clone(sf, reflect.StructField).IsExported())) { _v = false; $s = 18; continue s; } _r$7 = t$1.Kind(); /* */ $s = 19; case 19: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _v = !((_r$7 === 25)); case 18: /* */ if (_v) { $s = 16; continue; } /* */ $s = 17; continue; /* if (_v) { */ case 16: i = i + (1) >> 0; /* continue; */ $s = 5; continue; /* } */ case 17: $s = 11; continue; /* } else if (!$clone(sf, reflect.StructField).IsExported()) { */ case 10: i = i + (1) >> 0; /* continue; */ $s = 5; continue; /* } */ case 11: tag = new reflect.StructTag(sf.Tag).Get("json"); if (tag === "-") { i = i + (1) >> 0; /* continue; */ $s = 5; continue; } _tuple = parseTag(tag); name = _tuple[0]; opts = _tuple[1]; if (!isValidTag(name)) { name = ""; } index = $makeSlice(sliceType$1, (f.index.$length + 1 >> 0)); $copySlice(index, f.index); (x = f.index.$length, ((x < 0 || x >= index.$length) ? ($throwRuntimeError("index out of range"), undefined) : index.$array[index.$offset + x] = i)); ft = sf.Type; _r$8 = ft.Name(); /* */ $s = 23; case 23: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } if (!(_r$8 === "")) { _v$1 = false; $s = 22; continue s; } _r$9 = ft.Kind(); /* */ $s = 24; case 24: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _v$1 = _r$9 === 22; case 22: /* */ if (_v$1) { $s = 20; continue; } /* */ $s = 21; continue; /* if (_v$1) { */ case 20: _r$10 = ft.Elem(); /* */ $s = 25; case 25: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } ft = _r$10; /* } */ case 21: quoted = false; /* */ if (new tagOptions(opts).Contains("string")) { $s = 26; continue; } /* */ $s = 27; continue; /* if (new tagOptions(opts).Contains("string")) { */ case 26: _r$11 = ft.Kind(); /* */ $s = 29; case 29: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _1 = _r$11; if ((_1 === (1)) || (_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6)) || (_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12)) || (_1 === (13)) || (_1 === (14)) || (_1 === (24))) { quoted = true; } case 28: /* } */ case 27: if (!(name === "") || !sf.Anonymous) { _v$2 = true; $s = 32; continue s; } _r$12 = ft.Kind(); /* */ $s = 33; case 33: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _v$2 = !((_r$12 === 25)); case 32: /* */ if (_v$2) { $s = 30; continue; } /* */ $s = 31; continue; /* if (_v$2) { */ case 30: tagged = !(name === ""); if (name === "") { name = sf.Name; } field$1 = new field.ptr(name, sliceType$2.nil, $throwNilPointerError, "", "", tagged, index, ft, new tagOptions(opts).Contains("omitempty"), quoted, $throwNilPointerError); field$1.nameBytes = (new sliceType$2($stringToBytes(field$1.name))); field$1.equalFold = foldFunc(field$1.nameBytes); nameEscBuf[0].Reset(); _r$13 = nameEscBuf[0].WriteString("\""); /* */ $s = 34; case 34: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _r$13; $r = HTMLEscape(nameEscBuf[0], field$1.nameBytes); /* */ $s = 35; case 35: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$14 = nameEscBuf[0].WriteString("\":"); /* */ $s = 36; case 36: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _r$14; field$1.nameEscHTML = nameEscBuf[0].String(); field$1.nameNonEsc = "\"" + field$1.name + "\":"; fields[0] = $append(fields[0], field$1); if ((_entry$1 = count[reflect.Type.keyFor(f.typ)], _entry$1 !== undefined ? _entry$1.v : 0) > 1) { fields[0] = $append(fields[0], (x$1 = fields[0].$length - 1 >> 0, ((x$1 < 0 || x$1 >= fields[0].$length) ? ($throwRuntimeError("index out of range"), undefined) : fields[0].$array[fields[0].$offset + x$1]))); } i = i + (1) >> 0; /* continue; */ $s = 5; continue; /* } */ case 31: _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 = 37; continue; } /* */ $s = 38; continue; /* if ((_entry$3 = nextCount[reflect.Type.keyFor(ft)], _entry$3 !== undefined ? _entry$3.v : 0) === 1) { */ case 37: _r$15 = ft.Name(); /* */ $s = 39; case 39: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } next = $append(next, new field.ptr(_r$15, sliceType$2.nil, $throwNilPointerError, "", "", false, index, ft, false, false, $throwNilPointerError)); /* } */ case 38: i = i + (1) >> 0; $s = 5; continue; case 6: _i++; $s = 3; continue; case 4: $s = 1; continue; case 2: $r = sort.Slice(fields[0], (function(fields, nameEscBuf) { return function(i$1, j) { var i$1, j, x$2; x$2 = fields[0]; if (!(((i$1 < 0 || i$1 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + i$1]).name === ((j < 0 || j >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + j]).name)) { return ((i$1 < 0 || i$1 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + i$1]).name < ((j < 0 || j >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + j]).name; } if (!((((i$1 < 0 || i$1 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + i$1]).index.$length === ((j < 0 || j >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + j]).index.$length))) { return ((i$1 < 0 || i$1 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + i$1]).index.$length < ((j < 0 || j >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + j]).index.$length; } if (!(((i$1 < 0 || i$1 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + i$1]).tag === ((j < 0 || j >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + j]).tag)) { return ((i$1 < 0 || i$1 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + i$1]).tag; } return ($convertSliceType(x$2, byIndex)).Less(i$1, j); }; })(fields, nameEscBuf)); /* */ $s = 40; case 40: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } out = $subslice(fields[0], 0, 0); _tmp$6 = 0; _tmp$7 = 0; advance = _tmp$6; i$1 = _tmp$7; while (true) { if (!(i$1 < fields[0].$length)) { break; } fi = $clone(((i$1 < 0 || i$1 >= fields[0].$length) ? ($throwRuntimeError("index out of range"), undefined) : fields[0].$array[fields[0].$offset + i$1]), field); name$1 = fi.name; advance = 1; while (true) { if (!((i$1 + advance >> 0) < fields[0].$length)) { break; } fj = $clone((x$2 = i$1 + advance >> 0, ((x$2 < 0 || x$2 >= fields[0].$length) ? ($throwRuntimeError("index out of range"), undefined) : fields[0].$array[fields[0].$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; } _tuple$1 = dominantField($subslice(fields[0], 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; } fields[0] = out; $r = sort.Sort(($convertSliceType(fields[0], byIndex))); /* */ $s = 41; case 41: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _ref$1 = fields[0]; _i$1 = 0; /* while (true) { */ case 42: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 43; continue; } i$2 = _i$1; f$1 = ((i$2 < 0 || i$2 >= fields[0].$length) ? ($throwRuntimeError("index out of range"), undefined) : fields[0].$array[fields[0].$offset + i$2]); _r$16 = typeByIndex(t, f$1.index); /* */ $s = 44; case 44: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _r$17 = typeEncoder(_r$16); /* */ $s = 45; case 45: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } f$1.encoder = _r$17; _i$1++; $s = 42; continue; case 43: nameIndex = (x$3 = fields[0].$length, ((x$3 < 0 || x$3 > 2147483647) ? $throwRuntimeError("makemap: size out of range") : {})); _ref$2 = fields[0]; _i$2 = 0; while (true) { if (!(_i$2 < _ref$2.$length)) { break; } i$3 = _i$2; field$2 = $clone(((_i$2 < 0 || _i$2 >= _ref$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$2.$array[_ref$2.$offset + _i$2]), field); _key$2 = field$2.name; (nameIndex || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key$2)] = { k: _key$2, v: i$3 }; _i$2++; } $s = -1; return new structFields.ptr(fields[0], nameIndex); /* */ } return; } if ($f === undefined) { $f = { $blk: typeFields }; } $f._1 = _1; $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._i$2 = _i$2; $f._key = _key; $f._key$1 = _key$1; $f._key$2 = _key$2; $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$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._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._tuple$1 = _tuple$1; $f._v = _v; $f._v$1 = _v$1; $f._v$2 = _v$2; $f.advance = advance; $f.count = count; $f.current = current; $f.dominant = dominant; $f.f = f; $f.f$1 = f$1; $f.fi = fi; $f.field$1 = field$1; $f.field$2 = field$2; $f.fields = fields; $f.fj = fj; $f.ft = ft; $f.i = i; $f.i$1 = i$1; $f.i$2 = i$2; $f.i$3 = i$3; $f.index = index; $f.name = name; $f.name$1 = name$1; $f.nameEscBuf = nameEscBuf; $f.nameIndex = nameIndex; $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.t$1 = t$1; $f.tag = tag; $f.tagged = tagged; $f.visited = visited; $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; }; dominantField = function(fields) { var fields; if (fields.$length > 1 && ((0 >= fields.$length ? ($throwRuntimeError("index out of range"), undefined) : fields.$array[fields.$offset + 0]).index.$length === (1 >= fields.$length ? ($throwRuntimeError("index out of range"), undefined) : fields.$array[fields.$offset + 1]).index.$length) && (0 >= fields.$length ? ($throwRuntimeError("index out of range"), undefined) : fields.$array[fields.$offset + 0]).tag === (1 >= fields.$length ? ($throwRuntimeError("index out of range"), undefined) : fields.$array[fields.$offset + 1]).tag) { return [new field.ptr("", sliceType$2.nil, $throwNilPointerError, "", "", false, sliceType$1.nil, $ifaceNil, false, false, $throwNilPointerError), false]; } return [(0 >= fields.$length ? ($throwRuntimeError("index out of range"), undefined) : fields.$array[fields.$offset + 0]), true]; }; cachedTypeFields = function(t) { var _arg, _arg$1, _r$3, _r$4, _tuple, _tuple$1, f, f$1, ok, t, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; f = $f.f; f$1 = $f.f$1; ok = $f.ok; t = $f.t; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _tuple = fieldCache.Load(t); f = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return $assertType(f, structFields); } _arg = t; _r$3 = typeFields(t); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _arg$1 = (x = _r$3, new x.constructor.elem(x)); _r$4 = fieldCache.LoadOrStore(_arg, _arg$1); /* */ $s = 2; case 2: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$1 = _r$4; f$1 = _tuple$1[0]; $s = -1; return $assertType(f$1, structFields); /* */ } return; } if ($f === undefined) { $f = { $blk: cachedTypeFields }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.f = f; $f.f$1 = f$1; $f.ok = ok; $f.t = t; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; UnmarshalTypeError.ptr.prototype.Error = function() { var $24r, $24r$1, _r$3, _r$4, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r$3 = $f._r$3; _r$4 = $f._r$4; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; /* */ if (!(e.Struct === "") || !(e.Field === "")) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(e.Struct === "") || !(e.Field === "")) { */ case 1: _r$3 = e.Type.String(); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = "json: cannot unmarshal " + e.Value + " into Go struct field " + e.Struct + "." + e.Field + " of type " + _r$3; $s = 4; case 4: return $24r; /* } */ case 2: _r$4 = e.Type.String(); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r$1 = "json: cannot unmarshal " + e.Value + " into Go value of type " + _r$4; $s = 6; case 6: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: UnmarshalTypeError.ptr.prototype.Error }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; UnmarshalTypeError.prototype.Error = function() { return this.$val.Error(); }; InvalidUnmarshalError.ptr.prototype.Error = function() { var $24r, $24r$1, _r$3, _r$4, _r$5, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; if ($interfaceIsEqual(e.Type, $ifaceNil)) { $s = -1; return "json: Unmarshal(nil)"; } _r$3 = e.Type.Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } /* */ if (!((_r$3 === 22))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((_r$3 === 22))) { */ case 1: _r$4 = e.Type.String(); /* */ $s = 4; case 4: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r = "json: Unmarshal(non-pointer " + _r$4 + ")"; $s = 5; case 5: return $24r; /* } */ case 2: _r$5 = e.Type.String(); /* */ $s = 6; case 6: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $24r$1 = "json: Unmarshal(nil " + _r$5 + ")"; $s = 7; case 7: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: InvalidUnmarshalError.ptr.prototype.Error }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; InvalidUnmarshalError.prototype.Error = function() { return this.$val.Error(); }; decodeState.ptr.prototype.unmarshal = function(v) { var $24r, _r$3, _r$4, _r$5, d, err, rv, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; d = $f.d; err = $f.err; rv = $f.rv; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: d = this; _r$3 = reflect.ValueOf(v); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } rv = _r$3; if (!(($clone(rv, reflect.Value).Kind() === 22)) || $clone(rv, reflect.Value).IsNil()) { $s = -1; return new InvalidUnmarshalError.ptr(reflect.TypeOf(v)); } d.scan.reset(); $r = d.scanWhile(9); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$4 = d.value($clone(rv, reflect.Value)); /* */ $s = 3; case 3: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } err = _r$4; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 4: _r$5 = d.addErrorContext(err); /* */ $s = 6; case 6: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $24r = _r$5; $s = 7; case 7: return $24r; /* } */ case 5: $s = -1; return d.savedError; /* */ } return; } if ($f === undefined) { $f = { $blk: decodeState.ptr.prototype.unmarshal }; } $f.$24r = $24r; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f.d = d; $f.err = err; $f.rv = rv; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; decodeState.prototype.unmarshal = function(v) { return this.$val.unmarshal(v); }; Number.prototype.String = function() { var n; n = this.$val; return (n); }; $ptrType(Number).prototype.String = function() { return new Number(this.$get()).String(); }; Number.prototype.Float64 = function() { var 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 n; n = this.$val; return strconv.ParseInt((n), 10, 64); }; $ptrType(Number).prototype.Int64 = function() { return new Number(this.$get()).Int64(); }; decodeState.ptr.prototype.readIndex = function() { var d; d = this; return d.off - 1 >> 0; }; decodeState.prototype.readIndex = function() { return this.$val.readIndex(); }; decodeState.ptr.prototype.init = function(data) { var d, data; d = this; d.data = data; d.off = 0; d.savedError = $ifaceNil; if (!(d.errorContext === ptrType$4.nil)) { d.errorContext.Struct = $ifaceNil; d.errorContext.FieldStack = $subslice(d.errorContext.FieldStack, 0, 0); } return d; }; decodeState.prototype.init = function(data) { return this.$val.init(data); }; decodeState.ptr.prototype.saveError = function(err) { var _r$3, d, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; d = $f.d; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: d = this; /* */ if ($interfaceIsEqual(d.savedError, $ifaceNil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($interfaceIsEqual(d.savedError, $ifaceNil)) { */ case 1: _r$3 = d.addErrorContext(err); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } d.savedError = _r$3; /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: decodeState.ptr.prototype.saveError }; } $f._r$3 = _r$3; $f.d = d; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; decodeState.prototype.saveError = function(err) { return this.$val.saveError(err); }; decodeState.ptr.prototype.addErrorContext = function(err) { var _r$3, _ref, d, err, err$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _ref = $f._ref; d = $f.d; err = $f.err; err$1 = $f.err$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: d = this; /* */ if (!(d.errorContext === ptrType$4.nil) && (!($interfaceIsEqual(d.errorContext.Struct, $ifaceNil)) || d.errorContext.FieldStack.$length > 0)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(d.errorContext === ptrType$4.nil) && (!($interfaceIsEqual(d.errorContext.Struct, $ifaceNil)) || d.errorContext.FieldStack.$length > 0)) { */ case 1: _ref = err; /* */ if ($assertType(_ref, ptrType$10, true)[1]) { $s = 3; continue; } /* */ $s = 4; continue; /* if ($assertType(_ref, ptrType$10, true)[1]) { */ case 3: err$1 = _ref.$val; _r$3 = d.errorContext.Struct.Name(); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } err$1.Struct = _r$3; err$1.Field = strings.Join(d.errorContext.FieldStack, "."); /* } */ case 4: /* } */ case 2: $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: decodeState.ptr.prototype.addErrorContext }; } $f._r$3 = _r$3; $f._ref = _ref; $f.d = d; $f.err = err; $f.err$1 = err$1; $f.$s = $s; $f.$r = $r; return $f; }; decodeState.prototype.addErrorContext = function(err) { return this.$val.addErrorContext(err); }; decodeState.ptr.prototype.skip = function() { var _r$3, _tmp, _tmp$1, _tmp$2, d, data, depth, i, op, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; d = $f.d; data = $f.data; depth = $f.depth; i = $f.i; op = $f.op; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: d = this; _tmp = d.scan; _tmp$1 = d.data; _tmp$2 = d.off; s = _tmp; data = _tmp$1; i = _tmp$2; depth = s.parseState.$length; /* while (true) { */ case 1: _r$3 = s.step(s, ((i < 0 || i >= data.$length) ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + i])); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } op = _r$3; i = i + (1) >> 0; if (s.parseState.$length < depth) { d.off = i; d.opcode = op; $s = -1; return; } $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: decodeState.ptr.prototype.skip }; } $f._r$3 = _r$3; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f.d = d; $f.data = data; $f.depth = depth; $f.i = i; $f.op = op; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; decodeState.prototype.skip = function() { return this.$val.skip(); }; decodeState.ptr.prototype.scanNext = function() { var _r$3, _r$4, d, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _r$4 = $f._r$4; d = $f.d; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: d = this; /* */ if (d.off < d.data.$length) { $s = 1; continue; } /* */ $s = 2; continue; /* if (d.off < d.data.$length) { */ case 1: _r$3 = d.scan.step(d.scan, (x = d.data, x$1 = d.off, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1]))); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } d.opcode = _r$3; d.off = d.off + (1) >> 0; $s = 3; continue; /* } else { */ case 2: _r$4 = d.scan.eof(); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } d.opcode = _r$4; d.off = d.data.$length + 1 >> 0; /* } */ case 3: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: decodeState.ptr.prototype.scanNext }; } $f._r$3 = _r$3; $f._r$4 = _r$4; $f.d = d; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; decodeState.prototype.scanNext = function() { return this.$val.scanNext(); }; decodeState.ptr.prototype.scanWhile = function(op) { var _r$3, _r$4, _tmp, _tmp$1, _tmp$2, d, data, i, newOp, op, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _r$4 = $f._r$4; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; d = $f.d; data = $f.data; i = $f.i; newOp = $f.newOp; op = $f.op; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: d = this; _tmp = d.scan; _tmp$1 = d.data; _tmp$2 = d.off; s = _tmp; data = _tmp$1; i = _tmp$2; /* while (true) { */ case 1: /* if (!(i < data.$length)) { break; } */ if(!(i < data.$length)) { $s = 2; continue; } _r$3 = s.step(s, ((i < 0 || i >= data.$length) ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + i])); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } newOp = _r$3; i = i + (1) >> 0; if (!((newOp === op))) { d.opcode = newOp; d.off = i; $s = -1; return; } $s = 1; continue; case 2: d.off = data.$length + 1 >> 0; _r$4 = d.scan.eof(); /* */ $s = 4; case 4: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } d.opcode = _r$4; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: decodeState.ptr.prototype.scanWhile }; } $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f.d = d; $f.data = data; $f.i = i; $f.newOp = newOp; $f.op = op; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; decodeState.prototype.scanWhile = function(op) { return this.$val.scanWhile(op); }; decodeState.ptr.prototype.rescanLiteral = function() { var _1, _2, _3, _tmp, _tmp$1, d, data, i, x; d = this; _tmp = d.data; _tmp$1 = d.off; data = _tmp; i = _tmp$1; Switch: switch (0) { default: _1 = (x = i - 1 >> 0, ((x < 0 || x >= data.$length) ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + x])); if (_1 === (34)) { while (true) { if (!(i < data.$length)) { break; } _2 = ((i < 0 || i >= data.$length) ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + i]); if (_2 === (92)) { i = i + (1) >> 0; } else if (_2 === (34)) { i = i + (1) >> 0; break Switch; } i = i + (1) >> 0; } } else if ((_1 === (48)) || (_1 === (49)) || (_1 === (50)) || (_1 === (51)) || (_1 === (52)) || (_1 === (53)) || (_1 === (54)) || (_1 === (55)) || (_1 === (56)) || (_1 === (57)) || (_1 === (45))) { while (true) { if (!(i < data.$length)) { break; } _3 = ((i < 0 || i >= data.$length) ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + i]); if ((_3 === (48)) || (_3 === (49)) || (_3 === (50)) || (_3 === (51)) || (_3 === (52)) || (_3 === (53)) || (_3 === (54)) || (_3 === (55)) || (_3 === (56)) || (_3 === (57)) || (_3 === (46)) || (_3 === (101)) || (_3 === (69)) || (_3 === (43)) || (_3 === (45))) { } else { break Switch; } i = i + (1) >> 0; } } else if (_1 === (116)) { i = i + (3) >> 0; } else if (_1 === (102)) { i = i + (4) >> 0; } else if (_1 === (110)) { i = i + (3) >> 0; } } if (i < data.$length) { d.opcode = stateEndValue(d.scan, ((i < 0 || i >= data.$length) ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + i])); } else { d.opcode = 10; } d.off = i + 1 >> 0; }; decodeState.prototype.rescanLiteral = function() { return this.$val.rescanLiteral(); }; decodeState.ptr.prototype.value = function(v) { var _1, _r$3, _r$4, _r$5, d, err, err$1, err$2, start, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; d = $f.d; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; start = $f.start; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: d = this; _1 = d.opcode; /* */ if (_1 === (6)) { $s = 2; continue; } /* */ if (_1 === (2)) { $s = 3; continue; } /* */ if (_1 === (1)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_1 === (6)) { */ case 2: /* */ if ($clone(v, reflect.Value).IsValid()) { $s = 7; continue; } /* */ $s = 8; continue; /* if ($clone(v, reflect.Value).IsValid()) { */ case 7: _r$3 = d.array($clone(v, reflect.Value)); /* */ $s = 10; case 10: 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 = -1; return err; } $s = 9; continue; /* } else { */ case 8: $r = d.skip(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 9: $r = d.scanNext(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 6; continue; /* } else if (_1 === (2)) { */ case 3: /* */ if ($clone(v, reflect.Value).IsValid()) { $s = 13; continue; } /* */ $s = 14; continue; /* if ($clone(v, reflect.Value).IsValid()) { */ case 13: _r$4 = d.object($clone(v, reflect.Value)); /* */ $s = 16; case 16: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } err$1 = _r$4; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } $s = 15; continue; /* } else { */ case 14: $r = d.skip(); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 15: $r = d.scanNext(); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 6; continue; /* } else if (_1 === (1)) { */ case 4: start = d.readIndex(); d.rescanLiteral(); /* */ if ($clone(v, reflect.Value).IsValid()) { $s = 19; continue; } /* */ $s = 20; continue; /* if ($clone(v, reflect.Value).IsValid()) { */ case 19: _r$5 = d.literalStore($subslice(d.data, start, d.readIndex()), $clone(v, reflect.Value), false); /* */ $s = 21; case 21: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } err$2 = _r$5; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return err$2; } /* } */ case 20: $s = 6; continue; /* } else { */ case 5: $panic(new $String("JSON decoder out of sync - data changing underfoot?")); /* } */ case 6: case 1: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: decodeState.ptr.prototype.value }; } $f._1 = _1; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f.d = d; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.start = start; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; decodeState.prototype.value = function(v) { return this.$val.value(v); }; decodeState.ptr.prototype.valueQuoted = function() { var _1, _r$3, _ref, d, v, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r$3 = $f._r$3; _ref = $f._ref; d = $f.d; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: d = this; _1 = d.opcode; /* */ if ((_1 === (6)) || (_1 === (2))) { $s = 2; continue; } /* */ if (_1 === (1)) { $s = 3; continue; } /* */ $s = 4; continue; /* if ((_1 === (6)) || (_1 === (2))) { */ case 2: $r = d.skip(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = d.scanNext(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 5; continue; /* } else if (_1 === (1)) { */ case 3: _r$3 = d.literalInterface(); /* */ $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; _ref = v; if (_ref === $ifaceNil || $assertType(_ref, $String, true)[1]) { $s = -1; return v; } $s = 5; continue; /* } else { */ case 4: $panic(new $String("JSON decoder out of sync - data changing underfoot?")); /* } */ case 5: case 1: $s = -1; return (x = new unquotedValue.ptr(), new x.constructor.elem(x)); /* */ } return; } if ($f === undefined) { $f = { $blk: decodeState.ptr.prototype.valueQuoted }; } $f._1 = _1; $f._r$3 = _r$3; $f._ref = _ref; $f.d = d; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; decodeState.prototype.valueQuoted = function() { return this.$val.valueQuoted(); }; indirect = function(v, decodingNull) { var _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, _v, _v$1, _v$2, _v$3, decodingNull, e, haveAddr, ok, ok$1, u, u$1, v, v0, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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$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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _v = $f._v; _v$1 = $f._v$1; _v$2 = $f._v$2; _v$3 = $f._v$3; decodingNull = $f.decodingNull; e = $f.e; haveAddr = $f.haveAddr; ok = $f.ok; ok$1 = $f.ok$1; u = $f.u; u$1 = $f.u$1; v = $f.v; v0 = $f.v0; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v0 = v; haveAddr = false; if (!(!(($clone(v, reflect.Value).Kind() === 22)))) { _v = false; $s = 3; continue s; } _r$3 = $clone(v, reflect.Value).Type().Name(); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _v = !(_r$3 === ""); case 3: /* */ if (_v && $clone(v, reflect.Value).CanAddr()) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v && $clone(v, reflect.Value).CanAddr()) { */ case 1: haveAddr = true; v = $clone(v, reflect.Value).Addr(); /* } */ case 2: /* while (true) { */ case 5: /* */ if (($clone(v, reflect.Value).Kind() === 20) && !$clone(v, reflect.Value).IsNil()) { $s = 7; continue; } /* */ $s = 8; continue; /* if (($clone(v, reflect.Value).Kind() === 20) && !$clone(v, reflect.Value).IsNil()) { */ case 7: _r$4 = $clone(v, reflect.Value).Elem(); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } e = _r$4; if (!(($clone(e, reflect.Value).Kind() === 22) && !$clone(e, reflect.Value).IsNil())) { _v$1 = false; $s = 12; continue s; } if (!decodingNull) { _v$2 = true; $s = 13; continue s; } _r$5 = $clone(e, reflect.Value).Elem(); /* */ $s = 14; case 14: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$6 = $clone(_r$5, reflect.Value).Kind(); /* */ $s = 15; case 15: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _v$2 = _r$6 === 22; case 13: _v$1 = _v$2; case 12: /* */ if (_v$1) { $s = 10; continue; } /* */ $s = 11; continue; /* if (_v$1) { */ case 10: haveAddr = false; v = e; /* continue; */ $s = 5; continue; /* } */ case 11: /* } */ case 8: if (!(($clone(v, reflect.Value).Kind() === 22))) { /* break; */ $s = 6; continue; } if (decodingNull && $clone(v, reflect.Value).CanSet()) { /* break; */ $s = 6; continue; } _r$7 = $clone(v, reflect.Value).Elem(); /* */ $s = 19; case 19: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$8 = $clone(_r$7, reflect.Value).Kind(); /* */ $s = 20; case 20: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } if (!(_r$8 === 20)) { _v$3 = false; $s = 18; continue s; } _r$9 = $clone(v, reflect.Value).Elem(); /* */ $s = 21; case 21: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$10 = $clone(_r$9, reflect.Value).Elem(); /* */ $s = 22; case 22: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _v$3 = $equal(_r$10, v, reflect.Value); case 18: /* */ if (_v$3) { $s = 16; continue; } /* */ $s = 17; continue; /* if (_v$3) { */ case 16: _r$11 = $clone(v, reflect.Value).Elem(); /* */ $s = 23; case 23: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } v = _r$11; /* break; */ $s = 6; continue; /* } */ case 17: /* */ if ($clone(v, reflect.Value).IsNil()) { $s = 24; continue; } /* */ $s = 25; continue; /* if ($clone(v, reflect.Value).IsNil()) { */ case 24: _r$12 = $clone(v, reflect.Value).Type().Elem(); /* */ $s = 26; case 26: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _r$13 = reflect.New(_r$12); /* */ $s = 27; case 27: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } $r = $clone(v, reflect.Value).Set($clone(_r$13, reflect.Value)); /* */ $s = 28; case 28: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 25: _r$14 = $clone(v, reflect.Value).Type().NumMethod(); /* */ $s = 31; case 31: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } /* */ if (_r$14 > 0 && $clone(v, reflect.Value).CanInterface()) { $s = 29; continue; } /* */ $s = 30; continue; /* if (_r$14 > 0 && $clone(v, reflect.Value).CanInterface()) { */ case 29: _r$15 = $clone(v, reflect.Value).Interface(); /* */ $s = 32; case 32: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _tuple = $assertType(_r$15, Unmarshaler, true); u = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return [u, $ifaceNil, new reflect.Value.ptr(ptrType$11.nil, 0, 0)]; } /* */ if (!decodingNull) { $s = 33; continue; } /* */ $s = 34; continue; /* if (!decodingNull) { */ case 33: _r$16 = $clone(v, reflect.Value).Interface(); /* */ $s = 35; case 35: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _tuple$1 = $assertType(_r$16, encoding.TextUnmarshaler, true); u$1 = _tuple$1[0]; ok$1 = _tuple$1[1]; if (ok$1) { $s = -1; return [$ifaceNil, u$1, new reflect.Value.ptr(ptrType$11.nil, 0, 0)]; } /* } */ case 34: /* } */ case 30: /* */ if (haveAddr) { $s = 36; continue; } /* */ $s = 37; continue; /* if (haveAddr) { */ case 36: v = v0; haveAddr = false; $s = 38; continue; /* } else { */ case 37: _r$17 = $clone(v, reflect.Value).Elem(); /* */ $s = 39; case 39: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } v = _r$17; /* } */ case 38: $s = 5; continue; case 6: $s = -1; return [$ifaceNil, $ifaceNil, v]; /* */ } return; } if ($f === undefined) { $f = { $blk: indirect }; } $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$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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._v = _v; $f._v$1 = _v$1; $f._v$2 = _v$2; $f._v$3 = _v$3; $f.decodingNull = decodingNull; $f.e = e; $f.haveAddr = haveAddr; $f.ok = ok; $f.ok$1 = ok$1; $f.u = u; $f.u$1 = u$1; $f.v = v; $f.v0 = v0; $f.$s = $s; $f.$r = $r; return $f; }; decodeState.ptr.prototype.array = function(v) { var $24r, _1, _q, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, ai, d, err, err$1, i, newcap, newv, pv, start, u, ut, v, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _1 = $f._1; _q = $f._q; _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$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; _tuple = $f._tuple; ai = $f.ai; d = $f.d; err = $f.err; err$1 = $f.err$1; i = $f.i; newcap = $f.newcap; newv = $f.newv; pv = $f.pv; start = $f.start; u = $f.u; ut = $f.ut; v = $f.v; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: d = this; _r$3 = indirect($clone(v, reflect.Value), false); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; u = _tuple[0]; ut = _tuple[1]; pv = _tuple[2]; /* */ if (!($interfaceIsEqual(u, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(u, $ifaceNil))) { */ case 2: start = d.readIndex(); $r = d.skip(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$4 = u.UnmarshalJSON($subslice(d.data, start, d.off)); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r = _r$4; $s = 6; case 6: return $24r; /* } */ case 3: /* */ if (!($interfaceIsEqual(ut, $ifaceNil))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!($interfaceIsEqual(ut, $ifaceNil))) { */ case 7: $r = d.saveError(new UnmarshalTypeError.ptr("array", $clone(v, reflect.Value).Type(), (new $Int64(0, d.off)), "", "")); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = d.skip(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $ifaceNil; /* } */ case 8: v = pv; _1 = $clone(v, reflect.Value).Kind(); /* */ if (_1 === (20)) { $s = 12; continue; } /* */ if ((_1 === (17)) || (_1 === (23))) { $s = 13; continue; } /* */ $s = 14; continue; /* if (_1 === (20)) { */ case 12: /* */ if ($clone(v, reflect.Value).NumMethod() === 0) { $s = 16; continue; } /* */ $s = 17; continue; /* if ($clone(v, reflect.Value).NumMethod() === 0) { */ case 16: _r$5 = d.arrayInterface(); /* */ $s = 18; case 18: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } ai = _r$5; _r$6 = reflect.ValueOf(ai); /* */ $s = 19; case 19: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } $r = $clone(v, reflect.Value).Set($clone(_r$6, reflect.Value)); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $ifaceNil; /* } */ case 17: $r = d.saveError(new UnmarshalTypeError.ptr("array", $clone(v, reflect.Value).Type(), (new $Int64(0, d.off)), "", "")); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = d.skip(); /* */ $s = 22; case 22: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $ifaceNil; /* } else if ((_1 === (17)) || (_1 === (23))) { */ case 13: /* break; */ $s = 11; continue; $s = 15; continue; /* } else { */ case 14: $r = d.saveError(new UnmarshalTypeError.ptr("array", $clone(v, reflect.Value).Type(), (new $Int64(0, d.off)), "", "")); /* */ $s = 23; case 23: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = d.skip(); /* */ $s = 24; case 24: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $ifaceNil; /* } */ case 15: case 11: i = 0; /* while (true) { */ case 25: $r = d.scanWhile(9); /* */ $s = 27; case 27: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (d.opcode === 8) { /* break; */ $s = 26; continue; } /* */ if ($clone(v, reflect.Value).Kind() === 23) { $s = 28; continue; } /* */ $s = 29; continue; /* if ($clone(v, reflect.Value).Kind() === 23) { */ case 28: /* */ if (i >= $clone(v, reflect.Value).Cap()) { $s = 30; continue; } /* */ $s = 31; continue; /* if (i >= $clone(v, reflect.Value).Cap()) { */ case 30: newcap = $clone(v, reflect.Value).Cap() + (_q = $clone(v, reflect.Value).Cap() / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0; if (newcap < 4) { newcap = 4; } _r$7 = reflect.MakeSlice($clone(v, reflect.Value).Type(), $clone(v, reflect.Value).Len(), newcap); /* */ $s = 32; case 32: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } newv = _r$7; _r$8 = reflect.Copy($clone(newv, reflect.Value), $clone(v, reflect.Value)); /* */ $s = 33; case 33: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$8; $r = $clone(v, reflect.Value).Set($clone(newv, reflect.Value)); /* */ $s = 34; case 34: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 31: if (i >= $clone(v, reflect.Value).Len()) { $clone(v, reflect.Value).SetLen(i + 1 >> 0); } /* } */ case 29: /* */ if (i < $clone(v, reflect.Value).Len()) { $s = 35; continue; } /* */ $s = 36; continue; /* if (i < $clone(v, reflect.Value).Len()) { */ case 35: _r$9 = $clone(v, reflect.Value).Index(i); /* */ $s = 38; case 38: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$10 = d.value($clone(_r$9, reflect.Value)); /* */ $s = 39; case 39: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } err = _r$10; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $s = 37; continue; /* } else { */ case 36: _r$11 = d.value(new reflect.Value.ptr(ptrType$11.nil, 0, 0)); /* */ $s = 40; case 40: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } err$1 = _r$11; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } /* } */ case 37: i = i + (1) >> 0; /* */ if (d.opcode === 9) { $s = 41; continue; } /* */ $s = 42; continue; /* if (d.opcode === 9) { */ case 41: $r = d.scanWhile(9); /* */ $s = 43; case 43: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 42: if (d.opcode === 8) { /* break; */ $s = 26; continue; } if (!((d.opcode === 7))) { $panic(new $String("JSON decoder out of sync - data changing underfoot?")); } $s = 25; continue; case 26: /* */ if (i < $clone(v, reflect.Value).Len()) { $s = 44; continue; } /* */ $s = 45; continue; /* if (i < $clone(v, reflect.Value).Len()) { */ case 44: /* */ if ($clone(v, reflect.Value).Kind() === 17) { $s = 46; continue; } /* */ $s = 47; continue; /* if ($clone(v, reflect.Value).Kind() === 17) { */ case 46: _r$12 = $clone(v, reflect.Value).Type().Elem(); /* */ $s = 49; case 49: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _r$13 = reflect.Zero(_r$12); /* */ $s = 50; case 50: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } z = _r$13; /* while (true) { */ case 51: /* if (!(i < $clone(v, reflect.Value).Len())) { break; } */ if(!(i < $clone(v, reflect.Value).Len())) { $s = 52; continue; } _r$14 = $clone(v, reflect.Value).Index(i); /* */ $s = 53; case 53: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } $r = $clone(_r$14, reflect.Value).Set($clone(z, reflect.Value)); /* */ $s = 54; case 54: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i = i + (1) >> 0; $s = 51; continue; case 52: $s = 48; continue; /* } else { */ case 47: $clone(v, reflect.Value).SetLen(i); /* } */ case 48: /* } */ case 45: /* */ if ((i === 0) && ($clone(v, reflect.Value).Kind() === 23)) { $s = 55; continue; } /* */ $s = 56; continue; /* if ((i === 0) && ($clone(v, reflect.Value).Kind() === 23)) { */ case 55: _r$15 = reflect.MakeSlice($clone(v, reflect.Value).Type(), 0, 0); /* */ $s = 57; case 57: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } $r = $clone(v, reflect.Value).Set($clone(_r$15, reflect.Value)); /* */ $s = 58; case 58: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 56: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: decodeState.ptr.prototype.array }; } $f.$24r = $24r; $f._1 = _1; $f._q = _q; $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$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._tuple = _tuple; $f.ai = ai; $f.d = d; $f.err = err; $f.err$1 = err$1; $f.i = i; $f.newcap = newcap; $f.newv = newv; $f.pv = pv; $f.start = start; $f.u = u; $f.ut = ut; $f.v = v; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; decodeState.prototype.array = function(v) { return this.$val.array(v); }; decodeState.ptr.prototype.object = function(v) { var $24r, _1, _2, _3, _arg, _entry, _i, _i$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$19, _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$36, _r$37, _r$38, _r$39, _r$4, _r$40, _r$41, _r$42, _r$43, _r$44, _r$45, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _ref$1, _ref$2, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _v, _v$1, d, destring, elemType, err, err$1, err$2, err$3, err$4, err$5, f, ff, fields, i, i$1, i$2, item, key, kt, kv, mapElem, n, n$1, oi, ok, ok$1, origErrorContext, pv, qv, qv$1, qv$2, s, s$1, start, start$1, subv, t, u, ut, v, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _1 = $f._1; _2 = $f._2; _3 = $f._3; _arg = $f._arg; _entry = $f._entry; _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$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$36 = $f._r$36; _r$37 = $f._r$37; _r$38 = $f._r$38; _r$39 = $f._r$39; _r$4 = $f._r$4; _r$40 = $f._r$40; _r$41 = $f._r$41; _r$42 = $f._r$42; _r$43 = $f._r$43; _r$44 = $f._r$44; _r$45 = $f._r$45; _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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; _v = $f._v; _v$1 = $f._v$1; d = $f.d; destring = $f.destring; elemType = $f.elemType; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; err$4 = $f.err$4; err$5 = $f.err$5; f = $f.f; ff = $f.ff; fields = $f.fields; i = $f.i; i$1 = $f.i$1; i$2 = $f.i$2; item = $f.item; key = $f.key; kt = $f.kt; kv = $f.kv; mapElem = $f.mapElem; n = $f.n; n$1 = $f.n$1; oi = $f.oi; ok = $f.ok; ok$1 = $f.ok$1; origErrorContext = $f.origErrorContext; pv = $f.pv; qv = $f.qv; qv$1 = $f.qv$1; qv$2 = $f.qv$2; s = $f.s; s$1 = $f.s$1; start = $f.start; start$1 = $f.start$1; subv = $f.subv; t = $f.t; u = $f.u; ut = $f.ut; v = $f.v; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: d = this; _r$3 = indirect($clone(v, reflect.Value), false); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; u = _tuple[0]; ut = _tuple[1]; pv = _tuple[2]; /* */ if (!($interfaceIsEqual(u, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(u, $ifaceNil))) { */ case 2: start = d.readIndex(); $r = d.skip(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$4 = u.UnmarshalJSON($subslice(d.data, start, d.off)); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r = _r$4; $s = 6; case 6: return $24r; /* } */ case 3: /* */ if (!($interfaceIsEqual(ut, $ifaceNil))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!($interfaceIsEqual(ut, $ifaceNil))) { */ case 7: $r = d.saveError(new UnmarshalTypeError.ptr("object", $clone(v, reflect.Value).Type(), (new $Int64(0, d.off)), "", "")); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = d.skip(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $ifaceNil; /* } */ case 8: v = pv; t = $clone(v, reflect.Value).Type(); /* */ if (($clone(v, reflect.Value).Kind() === 20) && ($clone(v, reflect.Value).NumMethod() === 0)) { $s = 11; continue; } /* */ $s = 12; continue; /* if (($clone(v, reflect.Value).Kind() === 20) && ($clone(v, reflect.Value).NumMethod() === 0)) { */ case 11: _r$5 = d.objectInterface(); /* */ $s = 13; case 13: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } oi = _r$5; _r$6 = reflect.ValueOf(new mapType(oi)); /* */ $s = 14; case 14: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } $r = $clone(v, reflect.Value).Set($clone(_r$6, reflect.Value)); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $ifaceNil; /* } */ case 12: fields = new structFields.ptr(sliceType$3.nil, false); _1 = $clone(v, reflect.Value).Kind(); /* */ if (_1 === (21)) { $s = 17; continue; } /* */ if (_1 === (25)) { $s = 18; continue; } /* */ $s = 19; continue; /* if (_1 === (21)) { */ case 17: _r$7 = t.Key(); /* */ $s = 22; case 22: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$8 = _r$7.Kind(); /* */ $s = 23; case 23: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _2 = _r$8; /* */ if ((_2 === (24)) || (_2 === (2)) || (_2 === (3)) || (_2 === (4)) || (_2 === (5)) || (_2 === (6)) || (_2 === (7)) || (_2 === (8)) || (_2 === (9)) || (_2 === (10)) || (_2 === (11)) || (_2 === (12))) { $s = 24; continue; } _r$9 = t.Key(); /* */ $s = 27; case 27: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$10 = reflect.PtrTo(_r$9); /* */ $s = 28; case 28: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$11 = _r$10.Implements(textUnmarshalerType); /* */ $s = 29; case 29: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } /* */ if (!_r$11) { $s = 25; continue; } /* */ $s = 26; continue; /* if ((_2 === (24)) || (_2 === (2)) || (_2 === (3)) || (_2 === (4)) || (_2 === (5)) || (_2 === (6)) || (_2 === (7)) || (_2 === (8)) || (_2 === (9)) || (_2 === (10)) || (_2 === (11)) || (_2 === (12))) { */ case 24: $s = 26; continue; /* } else if (!_r$11) { */ case 25: $r = d.saveError(new UnmarshalTypeError.ptr("object", t, (new $Int64(0, d.off)), "", "")); /* */ $s = 30; case 30: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = d.skip(); /* */ $s = 31; case 31: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $ifaceNil; /* } */ case 26: case 21: /* */ if ($clone(v, reflect.Value).IsNil()) { $s = 32; continue; } /* */ $s = 33; continue; /* if ($clone(v, reflect.Value).IsNil()) { */ case 32: _r$12 = reflect.MakeMap(t); /* */ $s = 34; case 34: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } $r = $clone(v, reflect.Value).Set($clone(_r$12, reflect.Value)); /* */ $s = 35; case 35: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 33: $s = 20; continue; /* } else if (_1 === (25)) { */ case 18: _r$13 = cachedTypeFields(t); /* */ $s = 36; case 36: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } structFields.copy(fields, _r$13); $s = 20; continue; /* } else { */ case 19: $r = d.saveError(new UnmarshalTypeError.ptr("object", t, (new $Int64(0, d.off)), "", "")); /* */ $s = 37; case 37: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = d.skip(); /* */ $s = 38; case 38: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $ifaceNil; /* } */ case 20: case 16: mapElem = new reflect.Value.ptr(ptrType$11.nil, 0, 0); origErrorContext = new errorContext.ptr($ifaceNil, sliceType$5.nil); if (!(d.errorContext === ptrType$4.nil)) { errorContext.copy(origErrorContext, d.errorContext); } /* while (true) { */ case 39: $r = d.scanWhile(9); /* */ $s = 41; case 41: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (d.opcode === 5) { /* break; */ $s = 40; continue; } if (!((d.opcode === 1))) { $panic(new $String("JSON decoder out of sync - data changing underfoot?")); } start$1 = d.readIndex(); d.rescanLiteral(); item = $subslice(d.data, start$1, d.readIndex()); _tuple$1 = unquoteBytes(item); key = _tuple$1[0]; ok = _tuple$1[1]; if (!ok) { $panic(new $String("JSON decoder out of sync - data changing underfoot?")); } subv = new reflect.Value.ptr(ptrType$11.nil, 0, 0); destring = false; /* */ if ($clone(v, reflect.Value).Kind() === 21) { $s = 42; continue; } /* */ $s = 43; continue; /* if ($clone(v, reflect.Value).Kind() === 21) { */ case 42: _r$14 = t.Elem(); /* */ $s = 45; case 45: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } elemType = _r$14; /* */ if (!$clone(mapElem, reflect.Value).IsValid()) { $s = 46; continue; } /* */ $s = 47; continue; /* if (!$clone(mapElem, reflect.Value).IsValid()) { */ case 46: _r$15 = $clone(reflect.New(elemType), reflect.Value).Elem(); /* */ $s = 49; case 49: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } mapElem = _r$15; $s = 48; continue; /* } else { */ case 47: _r$16 = reflect.Zero(elemType); /* */ $s = 50; case 50: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } $r = $clone(mapElem, reflect.Value).Set($clone(_r$16, reflect.Value)); /* */ $s = 51; case 51: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 48: subv = mapElem; $s = 44; continue; /* } else { */ case 43: f = ptrType$12.nil; _tuple$2 = (_entry = fields.nameIndex[$String.keyFor(($bytesToString(key)))], _entry !== undefined ? [_entry.v, true] : [0, false]); i = _tuple$2[0]; ok$1 = _tuple$2[1]; /* */ if (ok$1) { $s = 52; continue; } /* */ $s = 53; continue; /* if (ok$1) { */ case 52: f = (x = fields.list, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); $s = 54; continue; /* } else { */ case 53: _ref = fields.list; _i = 0; /* while (true) { */ case 55: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 56; continue; } i$1 = _i; ff = (x$1 = fields.list, ((i$1 < 0 || i$1 >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + i$1])); _r$17 = ff.equalFold(ff.nameBytes, key); /* */ $s = 59; case 59: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } /* */ if (_r$17) { $s = 57; continue; } /* */ $s = 58; continue; /* if (_r$17) { */ case 57: f = ff; /* break; */ $s = 56; continue; /* } */ case 58: _i++; $s = 55; continue; case 56: /* } */ case 54: /* */ if (!(f === ptrType$12.nil)) { $s = 60; continue; } /* */ if (d.disallowUnknownFields) { $s = 61; continue; } /* */ $s = 62; continue; /* if (!(f === ptrType$12.nil)) { */ case 60: subv = v; destring = f.quoted; _ref$1 = f.index; _i$1 = 0; /* while (true) { */ case 63: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 64; continue; } i$2 = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); /* */ if ($clone(subv, reflect.Value).Kind() === 22) { $s = 65; continue; } /* */ $s = 66; continue; /* if ($clone(subv, reflect.Value).Kind() === 22) { */ case 65: /* */ if ($clone(subv, reflect.Value).IsNil()) { $s = 67; continue; } /* */ $s = 68; continue; /* if ($clone(subv, reflect.Value).IsNil()) { */ case 67: /* */ if (!$clone(subv, reflect.Value).CanSet()) { $s = 69; continue; } /* */ $s = 70; continue; /* if (!$clone(subv, reflect.Value).CanSet()) { */ case 69: _r$18 = $clone(subv, reflect.Value).Type().Elem(); /* */ $s = 71; case 71: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } _arg = _r$18; _r$19 = fmt.Errorf("json: cannot set embedded pointer to unexported struct: %v", new sliceType([_arg])); /* */ $s = 72; case 72: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } $r = d.saveError(_r$19); /* */ $s = 73; case 73: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } subv = new reflect.Value.ptr(ptrType$11.nil, 0, 0); destring = false; /* break; */ $s = 64; continue; /* } */ case 70: _r$20 = $clone(subv, reflect.Value).Type().Elem(); /* */ $s = 74; case 74: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } _r$21 = reflect.New(_r$20); /* */ $s = 75; case 75: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } $r = $clone(subv, reflect.Value).Set($clone(_r$21, reflect.Value)); /* */ $s = 76; case 76: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 68: _r$22 = $clone(subv, reflect.Value).Elem(); /* */ $s = 77; case 77: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; } subv = _r$22; /* } */ case 66: _r$23 = $clone(subv, reflect.Value).Field(i$2); /* */ $s = 78; case 78: if($c) { $c = false; _r$23 = _r$23.$blk(); } if (_r$23 && _r$23.$blk !== undefined) { break s; } subv = _r$23; _i$1++; $s = 63; continue; case 64: if (d.errorContext === ptrType$4.nil) { d.errorContext = new errorContext.ptr($ifaceNil, sliceType$5.nil); } d.errorContext.FieldStack = $append(d.errorContext.FieldStack, f.name); d.errorContext.Struct = t; $s = 62; continue; /* } else if (d.disallowUnknownFields) { */ case 61: _r$24 = fmt.Errorf("json: unknown field %q", new sliceType([key])); /* */ $s = 79; case 79: if($c) { $c = false; _r$24 = _r$24.$blk(); } if (_r$24 && _r$24.$blk !== undefined) { break s; } $r = d.saveError(_r$24); /* */ $s = 80; case 80: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 62: /* } */ case 44: /* */ if (d.opcode === 9) { $s = 81; continue; } /* */ $s = 82; continue; /* if (d.opcode === 9) { */ case 81: $r = d.scanWhile(9); /* */ $s = 83; case 83: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 82: if (!((d.opcode === 3))) { $panic(new $String("JSON decoder out of sync - data changing underfoot?")); } $r = d.scanWhile(9); /* */ $s = 84; case 84: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (destring) { $s = 85; continue; } /* */ $s = 86; continue; /* if (destring) { */ case 85: _r$25 = d.valueQuoted(); /* */ $s = 88; case 88: if($c) { $c = false; _r$25 = _r$25.$blk(); } if (_r$25 && _r$25.$blk !== undefined) { break s; } _ref$2 = _r$25; /* */ if (_ref$2 === $ifaceNil) { $s = 89; continue; } /* */ if ($assertType(_ref$2, $String, true)[1]) { $s = 90; continue; } /* */ $s = 91; continue; /* if (_ref$2 === $ifaceNil) { */ case 89: qv = _ref$2; _r$26 = d.literalStore(nullLiteral, $clone(subv, reflect.Value), false); /* */ $s = 93; case 93: if($c) { $c = false; _r$26 = _r$26.$blk(); } if (_r$26 && _r$26.$blk !== undefined) { break s; } err = _r$26; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $s = 92; continue; /* } else if ($assertType(_ref$2, $String, true)[1]) { */ case 90: qv$1 = _ref$2.$val; _r$27 = d.literalStore((new sliceType$2($stringToBytes(qv$1))), $clone(subv, reflect.Value), true); /* */ $s = 94; case 94: if($c) { $c = false; _r$27 = _r$27.$blk(); } if (_r$27 && _r$27.$blk !== undefined) { break s; } err$1 = _r$27; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } $s = 92; continue; /* } else { */ case 91: qv$2 = _ref$2; _r$28 = fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal unquoted value into %v", new sliceType([$clone(subv, reflect.Value).Type()])); /* */ $s = 95; case 95: if($c) { $c = false; _r$28 = _r$28.$blk(); } if (_r$28 && _r$28.$blk !== undefined) { break s; } $r = d.saveError(_r$28); /* */ $s = 96; case 96: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 92: $s = 87; continue; /* } else { */ case 86: _r$29 = d.value($clone(subv, reflect.Value)); /* */ $s = 97; case 97: if($c) { $c = false; _r$29 = _r$29.$blk(); } if (_r$29 && _r$29.$blk !== undefined) { break s; } err$2 = _r$29; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return err$2; } /* } */ case 87: /* */ if ($clone(v, reflect.Value).Kind() === 21) { $s = 98; continue; } /* */ $s = 99; continue; /* if ($clone(v, reflect.Value).Kind() === 21) { */ case 98: _r$30 = t.Key(); /* */ $s = 100; case 100: if($c) { $c = false; _r$30 = _r$30.$blk(); } if (_r$30 && _r$30.$blk !== undefined) { break s; } kt = _r$30; kv = new reflect.Value.ptr(ptrType$11.nil, 0, 0); _r$31 = reflect.PtrTo(kt).Implements(textUnmarshalerType); /* */ $s = 106; case 106: if($c) { $c = false; _r$31 = _r$31.$blk(); } if (_r$31 && _r$31.$blk !== undefined) { break s; } /* */ if (_r$31) { $s = 102; continue; } _r$32 = kt.Kind(); /* */ $s = 107; case 107: if($c) { $c = false; _r$32 = _r$32.$blk(); } if (_r$32 && _r$32.$blk !== undefined) { break s; } /* */ if ((_r$32 === 24)) { $s = 103; continue; } /* */ $s = 104; continue; /* if (_r$31) { */ case 102: kv = reflect.New(kt); _r$33 = d.literalStore(item, $clone(kv, reflect.Value), true); /* */ $s = 108; case 108: if($c) { $c = false; _r$33 = _r$33.$blk(); } if (_r$33 && _r$33.$blk !== undefined) { break s; } err$3 = _r$33; if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = -1; return err$3; } _r$34 = $clone(kv, reflect.Value).Elem(); /* */ $s = 109; case 109: if($c) { $c = false; _r$34 = _r$34.$blk(); } if (_r$34 && _r$34.$blk !== undefined) { break s; } kv = _r$34; $s = 105; continue; /* } else if ((_r$32 === 24)) { */ case 103: _r$35 = reflect.ValueOf(key); /* */ $s = 110; case 110: if($c) { $c = false; _r$35 = _r$35.$blk(); } if (_r$35 && _r$35.$blk !== undefined) { break s; } _r$36 = $clone(_r$35, reflect.Value).Convert(kt); /* */ $s = 111; case 111: if($c) { $c = false; _r$36 = _r$36.$blk(); } if (_r$36 && _r$36.$blk !== undefined) { break s; } kv = _r$36; $s = 105; continue; /* } else { */ case 104: _r$37 = kt.Kind(); /* */ $s = 113; case 113: if($c) { $c = false; _r$37 = _r$37.$blk(); } if (_r$37 && _r$37.$blk !== undefined) { break s; } _3 = _r$37; /* */ if ((_3 === (2)) || (_3 === (3)) || (_3 === (4)) || (_3 === (5)) || (_3 === (6))) { $s = 114; continue; } /* */ if ((_3 === (7)) || (_3 === (8)) || (_3 === (9)) || (_3 === (10)) || (_3 === (11)) || (_3 === (12))) { $s = 115; continue; } /* */ $s = 116; continue; /* if ((_3 === (2)) || (_3 === (3)) || (_3 === (4)) || (_3 === (5)) || (_3 === (6))) { */ case 114: s = ($bytesToString(key)); _tuple$3 = strconv.ParseInt(s, 10, 64); n = _tuple$3[0]; err$4 = _tuple$3[1]; if (!($interfaceIsEqual(err$4, $ifaceNil))) { _v = true; $s = 120; continue s; } _r$38 = reflect.Zero(kt); /* */ $s = 121; case 121: if($c) { $c = false; _r$38 = _r$38.$blk(); } if (_r$38 && _r$38.$blk !== undefined) { break s; } _r$39 = $clone(_r$38, reflect.Value).OverflowInt(n); /* */ $s = 122; case 122: if($c) { $c = false; _r$39 = _r$39.$blk(); } if (_r$39 && _r$39.$blk !== undefined) { break s; } _v = _r$39; case 120: /* */ if (_v) { $s = 118; continue; } /* */ $s = 119; continue; /* if (_v) { */ case 118: $r = d.saveError(new UnmarshalTypeError.ptr("number " + s, kt, (new $Int64(0, (start$1 + 1 >> 0))), "", "")); /* */ $s = 123; case 123: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* break; */ $s = 112; continue; /* } */ case 119: _r$40 = reflect.ValueOf(n); /* */ $s = 124; case 124: if($c) { $c = false; _r$40 = _r$40.$blk(); } if (_r$40 && _r$40.$blk !== undefined) { break s; } _r$41 = $clone(_r$40, reflect.Value).Convert(kt); /* */ $s = 125; case 125: if($c) { $c = false; _r$41 = _r$41.$blk(); } if (_r$41 && _r$41.$blk !== undefined) { break s; } kv = _r$41; $s = 117; continue; /* } else if ((_3 === (7)) || (_3 === (8)) || (_3 === (9)) || (_3 === (10)) || (_3 === (11)) || (_3 === (12))) { */ case 115: s$1 = ($bytesToString(key)); _tuple$4 = strconv.ParseUint(s$1, 10, 64); n$1 = _tuple$4[0]; err$5 = _tuple$4[1]; if (!($interfaceIsEqual(err$5, $ifaceNil))) { _v$1 = true; $s = 128; continue s; } _r$42 = reflect.Zero(kt); /* */ $s = 129; case 129: if($c) { $c = false; _r$42 = _r$42.$blk(); } if (_r$42 && _r$42.$blk !== undefined) { break s; } _r$43 = $clone(_r$42, reflect.Value).OverflowUint(n$1); /* */ $s = 130; case 130: if($c) { $c = false; _r$43 = _r$43.$blk(); } if (_r$43 && _r$43.$blk !== undefined) { break s; } _v$1 = _r$43; case 128: /* */ if (_v$1) { $s = 126; continue; } /* */ $s = 127; continue; /* if (_v$1) { */ case 126: $r = d.saveError(new UnmarshalTypeError.ptr("number " + s$1, kt, (new $Int64(0, (start$1 + 1 >> 0))), "", "")); /* */ $s = 131; case 131: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* break; */ $s = 112; continue; /* } */ case 127: _r$44 = reflect.ValueOf(n$1); /* */ $s = 132; case 132: if($c) { $c = false; _r$44 = _r$44.$blk(); } if (_r$44 && _r$44.$blk !== undefined) { break s; } _r$45 = $clone(_r$44, reflect.Value).Convert(kt); /* */ $s = 133; case 133: if($c) { $c = false; _r$45 = _r$45.$blk(); } if (_r$45 && _r$45.$blk !== undefined) { break s; } kv = _r$45; $s = 117; continue; /* } else { */ case 116: $panic(new $String("json: Unexpected key type")); /* } */ case 117: case 112: /* } */ case 105: case 101: /* */ if ($clone(kv, reflect.Value).IsValid()) { $s = 134; continue; } /* */ $s = 135; continue; /* if ($clone(kv, reflect.Value).IsValid()) { */ case 134: $r = $clone(v, reflect.Value).SetMapIndex($clone(kv, reflect.Value), $clone(subv, reflect.Value)); /* */ $s = 136; case 136: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 135: /* } */ case 99: /* */ if (d.opcode === 9) { $s = 137; continue; } /* */ $s = 138; continue; /* if (d.opcode === 9) { */ case 137: $r = d.scanWhile(9); /* */ $s = 139; case 139: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 138: if (!(d.errorContext === ptrType$4.nil)) { d.errorContext.FieldStack = $subslice(d.errorContext.FieldStack, 0, origErrorContext.FieldStack.$length); d.errorContext.Struct = origErrorContext.Struct; } if (d.opcode === 5) { /* break; */ $s = 40; continue; } if (!((d.opcode === 4))) { $panic(new $String("JSON decoder out of sync - data changing underfoot?")); } $s = 39; continue; case 40: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: decodeState.ptr.prototype.object }; } $f.$24r = $24r; $f._1 = _1; $f._2 = _2; $f._3 = _3; $f._arg = _arg; $f._entry = _entry; $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$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$36 = _r$36; $f._r$37 = _r$37; $f._r$38 = _r$38; $f._r$39 = _r$39; $f._r$4 = _r$4; $f._r$40 = _r$40; $f._r$41 = _r$41; $f._r$42 = _r$42; $f._r$43 = _r$43; $f._r$44 = _r$44; $f._r$45 = _r$45; $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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f._v = _v; $f._v$1 = _v$1; $f.d = d; $f.destring = destring; $f.elemType = elemType; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.err$4 = err$4; $f.err$5 = err$5; $f.f = f; $f.ff = ff; $f.fields = fields; $f.i = i; $f.i$1 = i$1; $f.i$2 = i$2; $f.item = item; $f.key = key; $f.kt = kt; $f.kv = kv; $f.mapElem = mapElem; $f.n = n; $f.n$1 = n$1; $f.oi = oi; $f.ok = ok; $f.ok$1 = ok$1; $f.origErrorContext = origErrorContext; $f.pv = pv; $f.qv = qv; $f.qv$1 = qv$1; $f.qv$2 = qv$2; $f.s = s; $f.s$1 = s$1; $f.start = start; $f.start$1 = start$1; $f.subv = subv; $f.t = t; $f.u = u; $f.ut = ut; $f.v = v; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; decodeState.prototype.object = function(v) { return this.$val.object(v); }; decodeState.ptr.prototype.convertNumber = function(s) { var _tuple, d, err, f, s; d = this; if (d.useNumber) { return [new Number((s)), $ifaceNil]; } _tuple = strconv.ParseFloat(s, 64); f = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [$ifaceNil, new UnmarshalTypeError.ptr("number " + s, reflect.TypeOf(new $Float64(0)), (new $Int64(0, d.off)), "", "")]; } return [new $Float64(f), $ifaceNil]; }; decodeState.prototype.convertNumber = function(s) { return this.$val.convertNumber(s); }; decodeState.ptr.prototype.literalStore = function(item, v, fromQuoted) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, $24r$5, $24r$6, _1, _2, _3, _4, _5, _6, _arg, _arg$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$19, _r$20, _r$21, _r$22, _r$23, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, b, c, d, err, err$1, err$2, err$3, err$4, fromQuoted, isNull, item, n, n$1, n$2, n$3, n$4, ok, ok$1, pv, s, s$1, s$2, u, ut, v, val, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; $24r$6 = $f.$24r$6; _1 = $f._1; _2 = $f._2; _3 = $f._3; _4 = $f._4; _5 = $f._5; _6 = $f._6; _arg = $f._arg; _arg$1 = $f._arg$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$20 = $f._r$20; _r$21 = $f._r$21; _r$22 = $f._r$22; _r$23 = $f._r$23; _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; _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; b = $f.b; c = $f.c; d = $f.d; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; err$4 = $f.err$4; fromQuoted = $f.fromQuoted; isNull = $f.isNull; item = $f.item; n = $f.n; n$1 = $f.n$1; n$2 = $f.n$2; n$3 = $f.n$3; n$4 = $f.n$4; ok = $f.ok; ok$1 = $f.ok$1; pv = $f.pv; s = $f.s; s$1 = $f.s$1; s$2 = $f.s$2; u = $f.u; ut = $f.ut; v = $f.v; val = $f.val; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: d = this; /* */ if (item.$length === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (item.$length === 0) { */ case 1: _r$3 = fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", new sliceType([item, $clone(v, reflect.Value).Type()])); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $r = d.saveError(_r$3); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $ifaceNil; /* } */ case 2: isNull = (0 >= item.$length ? ($throwRuntimeError("index out of range"), undefined) : item.$array[item.$offset + 0]) === 110; _r$4 = indirect($clone(v, reflect.Value), isNull); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple = _r$4; u = _tuple[0]; ut = _tuple[1]; pv = _tuple[2]; /* */ if (!($interfaceIsEqual(u, $ifaceNil))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!($interfaceIsEqual(u, $ifaceNil))) { */ case 6: _r$5 = u.UnmarshalJSON(item); /* */ $s = 8; case 8: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $24r = _r$5; $s = 9; case 9: return $24r; /* } */ case 7: /* */ if (!($interfaceIsEqual(ut, $ifaceNil))) { $s = 10; continue; } /* */ $s = 11; continue; /* if (!($interfaceIsEqual(ut, $ifaceNil))) { */ case 10: /* */ if (!(((0 >= item.$length ? ($throwRuntimeError("index out of range"), undefined) : item.$array[item.$offset + 0]) === 34))) { $s = 12; continue; } /* */ $s = 13; continue; /* if (!(((0 >= item.$length ? ($throwRuntimeError("index out of range"), undefined) : item.$array[item.$offset + 0]) === 34))) { */ case 12: /* */ if (fromQuoted) { $s = 14; continue; } /* */ $s = 15; continue; /* if (fromQuoted) { */ case 14: _r$6 = fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", new sliceType([item, $clone(v, reflect.Value).Type()])); /* */ $s = 16; case 16: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } $r = d.saveError(_r$6); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $ifaceNil; /* } */ case 15: val = "number"; _1 = (0 >= item.$length ? ($throwRuntimeError("index out of range"), undefined) : item.$array[item.$offset + 0]); if (_1 === (110)) { val = "null"; } else if ((_1 === (116)) || (_1 === (102))) { val = "bool"; } $r = d.saveError(new UnmarshalTypeError.ptr(val, $clone(v, reflect.Value).Type(), (new $Int64(0, d.readIndex())), "", "")); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $ifaceNil; /* } */ case 13: _tuple$1 = unquoteBytes(item); s = _tuple$1[0]; ok = _tuple$1[1]; /* */ if (!ok) { $s = 19; continue; } /* */ $s = 20; continue; /* if (!ok) { */ case 19: /* */ if (fromQuoted) { $s = 21; continue; } /* */ $s = 22; continue; /* if (fromQuoted) { */ case 21: _r$7 = fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", new sliceType([item, $clone(v, reflect.Value).Type()])); /* */ $s = 23; case 23: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } $24r$1 = _r$7; $s = 24; case 24: return $24r$1; /* } */ case 22: $panic(new $String("JSON decoder out of sync - data changing underfoot?")); /* } */ case 20: _r$8 = ut.UnmarshalText(s); /* */ $s = 25; case 25: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } $24r$2 = _r$8; $s = 26; case 26: return $24r$2; /* } */ case 11: v = pv; c = (0 >= item.$length ? ($throwRuntimeError("index out of range"), undefined) : item.$array[item.$offset + 0]); _2 = c; /* */ if (_2 === (110)) { $s = 28; continue; } /* */ if ((_2 === (116)) || (_2 === (102))) { $s = 29; continue; } /* */ if (_2 === (34)) { $s = 30; continue; } /* */ $s = 31; continue; /* if (_2 === (110)) { */ case 28: /* */ if (fromQuoted && !(($bytesToString(item)) === "null")) { $s = 33; continue; } /* */ $s = 34; continue; /* if (fromQuoted && !(($bytesToString(item)) === "null")) { */ case 33: _r$9 = fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", new sliceType([item, $clone(v, reflect.Value).Type()])); /* */ $s = 35; case 35: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $r = d.saveError(_r$9); /* */ $s = 36; case 36: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* break; */ $s = 27; continue; /* } */ case 34: _3 = $clone(v, reflect.Value).Kind(); /* */ if ((_3 === (20)) || (_3 === (22)) || (_3 === (21)) || (_3 === (23))) { $s = 38; continue; } /* */ $s = 39; continue; /* if ((_3 === (20)) || (_3 === (22)) || (_3 === (21)) || (_3 === (23))) { */ case 38: _r$10 = reflect.Zero($clone(v, reflect.Value).Type()); /* */ $s = 40; case 40: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } $r = $clone(v, reflect.Value).Set($clone(_r$10, reflect.Value)); /* */ $s = 41; case 41: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 39: case 37: $s = 32; continue; /* } else if ((_2 === (116)) || (_2 === (102))) { */ case 29: value = (0 >= item.$length ? ($throwRuntimeError("index out of range"), undefined) : item.$array[item.$offset + 0]) === 116; /* */ if (fromQuoted && !(($bytesToString(item)) === "true") && !(($bytesToString(item)) === "false")) { $s = 42; continue; } /* */ $s = 43; continue; /* if (fromQuoted && !(($bytesToString(item)) === "true") && !(($bytesToString(item)) === "false")) { */ case 42: _r$11 = fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", new sliceType([item, $clone(v, reflect.Value).Type()])); /* */ $s = 44; case 44: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } $r = d.saveError(_r$11); /* */ $s = 45; case 45: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* break; */ $s = 27; continue; /* } */ case 43: _4 = $clone(v, reflect.Value).Kind(); /* */ if (_4 === (1)) { $s = 47; continue; } /* */ if (_4 === (20)) { $s = 48; continue; } /* */ if (fromQuoted) { $s = 49; continue; } /* */ $s = 50; continue; /* if (_4 === (1)) { */ case 47: $clone(v, reflect.Value).SetBool(value); $s = 51; continue; /* } else if (_4 === (20)) { */ case 48: /* */ if ($clone(v, reflect.Value).NumMethod() === 0) { $s = 52; continue; } /* */ $s = 53; continue; /* if ($clone(v, reflect.Value).NumMethod() === 0) { */ case 52: _r$12 = reflect.ValueOf(new $Bool(value)); /* */ $s = 55; case 55: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } $r = $clone(v, reflect.Value).Set($clone(_r$12, reflect.Value)); /* */ $s = 56; case 56: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 54; continue; /* } else { */ case 53: $r = d.saveError(new UnmarshalTypeError.ptr("bool", $clone(v, reflect.Value).Type(), (new $Int64(0, d.readIndex())), "", "")); /* */ $s = 57; case 57: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 54: $s = 51; continue; /* } else if (fromQuoted) { */ case 49: _r$13 = fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", new sliceType([item, $clone(v, reflect.Value).Type()])); /* */ $s = 58; case 58: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } $r = d.saveError(_r$13); /* */ $s = 59; case 59: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 51; continue; /* } else { */ case 50: $r = d.saveError(new UnmarshalTypeError.ptr("bool", $clone(v, reflect.Value).Type(), (new $Int64(0, d.readIndex())), "", "")); /* */ $s = 60; case 60: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 51: case 46: $s = 32; continue; /* } else if (_2 === (34)) { */ case 30: _tuple$2 = unquoteBytes(item); s$1 = _tuple$2[0]; ok$1 = _tuple$2[1]; /* */ if (!ok$1) { $s = 61; continue; } /* */ $s = 62; continue; /* if (!ok$1) { */ case 61: /* */ if (fromQuoted) { $s = 63; continue; } /* */ $s = 64; continue; /* if (fromQuoted) { */ case 63: _r$14 = fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", new sliceType([item, $clone(v, reflect.Value).Type()])); /* */ $s = 65; case 65: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } $24r$3 = _r$14; $s = 66; case 66: return $24r$3; /* } */ case 64: $panic(new $String("JSON decoder out of sync - data changing underfoot?")); /* } */ case 62: _5 = $clone(v, reflect.Value).Kind(); /* */ if (_5 === (23)) { $s = 68; continue; } /* */ if (_5 === (24)) { $s = 69; continue; } /* */ if (_5 === (20)) { $s = 70; continue; } /* */ $s = 71; continue; /* if (_5 === (23)) { */ case 68: _r$15 = $clone(v, reflect.Value).Type().Elem(); /* */ $s = 75; case 75: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _r$16 = _r$15.Kind(); /* */ $s = 76; case 76: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } /* */ if (!((_r$16 === 8))) { $s = 73; continue; } /* */ $s = 74; continue; /* if (!((_r$16 === 8))) { */ case 73: $r = d.saveError(new UnmarshalTypeError.ptr("string", $clone(v, reflect.Value).Type(), (new $Int64(0, d.readIndex())), "", "")); /* */ $s = 77; case 77: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* break; */ $s = 67; continue; /* } */ case 74: b = $makeSlice(sliceType$2, base64.StdEncoding.DecodedLen(s$1.$length)); _tuple$3 = base64.StdEncoding.Decode(b, s$1); n = _tuple$3[0]; err = _tuple$3[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 78; continue; } /* */ $s = 79; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 78: $r = d.saveError(err); /* */ $s = 80; case 80: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* break; */ $s = 67; continue; /* } */ case 79: $r = $clone(v, reflect.Value).SetBytes($subslice(b, 0, n)); /* */ $s = 81; case 81: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 72; continue; /* } else if (_5 === (24)) { */ case 69: /* */ if ($interfaceIsEqual($clone(v, reflect.Value).Type(), numberType) && !isValidNumber(($bytesToString(s$1)))) { $s = 82; continue; } /* */ $s = 83; continue; /* if ($interfaceIsEqual($clone(v, reflect.Value).Type(), numberType) && !isValidNumber(($bytesToString(s$1)))) { */ case 82: _r$17 = fmt.Errorf("json: invalid number literal, trying to unmarshal %q into Number", new sliceType([item])); /* */ $s = 84; case 84: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } $24r$4 = _r$17; $s = 85; case 85: return $24r$4; /* } */ case 83: $clone(v, reflect.Value).SetString(($bytesToString(s$1))); $s = 72; continue; /* } else if (_5 === (20)) { */ case 70: /* */ if ($clone(v, reflect.Value).NumMethod() === 0) { $s = 86; continue; } /* */ $s = 87; continue; /* if ($clone(v, reflect.Value).NumMethod() === 0) { */ case 86: _r$18 = reflect.ValueOf(new $String(($bytesToString(s$1)))); /* */ $s = 89; case 89: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } $r = $clone(v, reflect.Value).Set($clone(_r$18, reflect.Value)); /* */ $s = 90; case 90: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 88; continue; /* } else { */ case 87: $r = d.saveError(new UnmarshalTypeError.ptr("string", $clone(v, reflect.Value).Type(), (new $Int64(0, d.readIndex())), "", "")); /* */ $s = 91; case 91: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 88: $s = 72; continue; /* } else { */ case 71: $r = d.saveError(new UnmarshalTypeError.ptr("string", $clone(v, reflect.Value).Type(), (new $Int64(0, d.readIndex())), "", "")); /* */ $s = 92; case 92: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 72: case 67: $s = 32; continue; /* } else { */ case 31: /* */ if (!((c === 45)) && (c < 48 || c > 57)) { $s = 93; continue; } /* */ $s = 94; continue; /* if (!((c === 45)) && (c < 48 || c > 57)) { */ case 93: /* */ if (fromQuoted) { $s = 95; continue; } /* */ $s = 96; continue; /* if (fromQuoted) { */ case 95: _r$19 = fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", new sliceType([item, $clone(v, reflect.Value).Type()])); /* */ $s = 97; case 97: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } $24r$5 = _r$19; $s = 98; case 98: return $24r$5; /* } */ case 96: $panic(new $String("JSON decoder out of sync - data changing underfoot?")); /* } */ case 94: s$2 = ($bytesToString(item)); _6 = $clone(v, reflect.Value).Kind(); /* */ if (_6 === (20)) { $s = 100; continue; } /* */ if ((_6 === (2)) || (_6 === (3)) || (_6 === (4)) || (_6 === (5)) || (_6 === (6))) { $s = 101; continue; } /* */ if ((_6 === (7)) || (_6 === (8)) || (_6 === (9)) || (_6 === (10)) || (_6 === (11)) || (_6 === (12))) { $s = 102; continue; } /* */ if ((_6 === (13)) || (_6 === (14))) { $s = 103; continue; } /* */ $s = 104; continue; /* if (_6 === (20)) { */ case 100: _tuple$4 = d.convertNumber(s$2); n$1 = _tuple$4[0]; err$1 = _tuple$4[1]; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 106; continue; } /* */ $s = 107; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 106: $r = d.saveError(err$1); /* */ $s = 108; case 108: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* break; */ $s = 99; continue; /* } */ case 107: /* */ if (!(($clone(v, reflect.Value).NumMethod() === 0))) { $s = 109; continue; } /* */ $s = 110; continue; /* if (!(($clone(v, reflect.Value).NumMethod() === 0))) { */ case 109: $r = d.saveError(new UnmarshalTypeError.ptr("number", $clone(v, reflect.Value).Type(), (new $Int64(0, d.readIndex())), "", "")); /* */ $s = 111; case 111: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* break; */ $s = 99; continue; /* } */ case 110: _r$20 = reflect.ValueOf(n$1); /* */ $s = 112; case 112: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } $r = $clone(v, reflect.Value).Set($clone(_r$20, reflect.Value)); /* */ $s = 113; case 113: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 105; continue; /* } else if ((_6 === (2)) || (_6 === (3)) || (_6 === (4)) || (_6 === (5)) || (_6 === (6))) { */ case 101: _tuple$5 = strconv.ParseInt(s$2, 10, 64); n$2 = _tuple$5[0]; err$2 = _tuple$5[1]; /* */ if (!($interfaceIsEqual(err$2, $ifaceNil)) || $clone(v, reflect.Value).OverflowInt(n$2)) { $s = 114; continue; } /* */ $s = 115; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil)) || $clone(v, reflect.Value).OverflowInt(n$2)) { */ case 114: $r = d.saveError(new UnmarshalTypeError.ptr("number " + s$2, $clone(v, reflect.Value).Type(), (new $Int64(0, d.readIndex())), "", "")); /* */ $s = 116; case 116: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* break; */ $s = 99; continue; /* } */ case 115: $clone(v, reflect.Value).SetInt(n$2); $s = 105; continue; /* } else if ((_6 === (7)) || (_6 === (8)) || (_6 === (9)) || (_6 === (10)) || (_6 === (11)) || (_6 === (12))) { */ case 102: _tuple$6 = strconv.ParseUint(s$2, 10, 64); n$3 = _tuple$6[0]; err$3 = _tuple$6[1]; /* */ if (!($interfaceIsEqual(err$3, $ifaceNil)) || $clone(v, reflect.Value).OverflowUint(n$3)) { $s = 117; continue; } /* */ $s = 118; continue; /* if (!($interfaceIsEqual(err$3, $ifaceNil)) || $clone(v, reflect.Value).OverflowUint(n$3)) { */ case 117: $r = d.saveError(new UnmarshalTypeError.ptr("number " + s$2, $clone(v, reflect.Value).Type(), (new $Int64(0, d.readIndex())), "", "")); /* */ $s = 119; case 119: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* break; */ $s = 99; continue; /* } */ case 118: $clone(v, reflect.Value).SetUint(n$3); $s = 105; continue; /* } else if ((_6 === (13)) || (_6 === (14))) { */ case 103: _arg = s$2; _r$21 = $clone(v, reflect.Value).Type().Bits(); /* */ $s = 120; case 120: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } _arg$1 = _r$21; _r$22 = strconv.ParseFloat(_arg, _arg$1); /* */ $s = 121; case 121: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; } _tuple$7 = _r$22; n$4 = _tuple$7[0]; err$4 = _tuple$7[1]; /* */ if (!($interfaceIsEqual(err$4, $ifaceNil)) || $clone(v, reflect.Value).OverflowFloat(n$4)) { $s = 122; continue; } /* */ $s = 123; continue; /* if (!($interfaceIsEqual(err$4, $ifaceNil)) || $clone(v, reflect.Value).OverflowFloat(n$4)) { */ case 122: $r = d.saveError(new UnmarshalTypeError.ptr("number " + s$2, $clone(v, reflect.Value).Type(), (new $Int64(0, d.readIndex())), "", "")); /* */ $s = 124; case 124: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* break; */ $s = 99; continue; /* } */ case 123: $clone(v, reflect.Value).SetFloat(n$4); $s = 105; continue; /* } else { */ case 104: if (($clone(v, reflect.Value).Kind() === 24) && $interfaceIsEqual($clone(v, reflect.Value).Type(), numberType)) { $clone(v, reflect.Value).SetString(s$2); /* break; */ $s = 99; continue; } /* */ if (fromQuoted) { $s = 125; continue; } /* */ $s = 126; continue; /* if (fromQuoted) { */ case 125: _r$23 = fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", new sliceType([item, $clone(v, reflect.Value).Type()])); /* */ $s = 127; case 127: if($c) { $c = false; _r$23 = _r$23.$blk(); } if (_r$23 && _r$23.$blk !== undefined) { break s; } $24r$6 = _r$23; $s = 128; case 128: return $24r$6; /* } */ case 126: $r = d.saveError(new UnmarshalTypeError.ptr("number", $clone(v, reflect.Value).Type(), (new $Int64(0, d.readIndex())), "", "")); /* */ $s = 129; case 129: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 105: case 99: /* } */ case 32: case 27: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: decodeState.ptr.prototype.literalStore }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f.$24r$6 = $24r$6; $f._1 = _1; $f._2 = _2; $f._3 = _3; $f._4 = _4; $f._5 = _5; $f._6 = _6; $f._arg = _arg; $f._arg$1 = _arg$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$20 = _r$20; $f._r$21 = _r$21; $f._r$22 = _r$22; $f._r$23 = _r$23; $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._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.b = b; $f.c = c; $f.d = d; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.err$4 = err$4; $f.fromQuoted = fromQuoted; $f.isNull = isNull; $f.item = item; $f.n = n; $f.n$1 = n$1; $f.n$2 = n$2; $f.n$3 = n$3; $f.n$4 = n$4; $f.ok = ok; $f.ok$1 = ok$1; $f.pv = pv; $f.s = s; $f.s$1 = s$1; $f.s$2 = s$2; $f.u = u; $f.ut = ut; $f.v = v; $f.val = val; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; decodeState.prototype.literalStore = function(item, v, fromQuoted) { return this.$val.literalStore(item, v, fromQuoted); }; decodeState.ptr.prototype.valueInterface = function() { var _1, _r$3, _r$4, _r$5, d, val, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; d = $f.d; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: val = $ifaceNil; d = this; _1 = d.opcode; /* */ if (_1 === (6)) { $s = 2; continue; } /* */ if (_1 === (2)) { $s = 3; continue; } /* */ if (_1 === (1)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_1 === (6)) { */ case 2: _r$3 = d.arrayInterface(); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } val = _r$3; $r = d.scanNext(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 6; continue; /* } else if (_1 === (2)) { */ case 3: _r$4 = d.objectInterface(); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } val = new mapType(_r$4); $r = d.scanNext(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 6; continue; /* } else if (_1 === (1)) { */ case 4: _r$5 = d.literalInterface(); /* */ $s = 11; case 11: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } val = _r$5; $s = 6; continue; /* } else { */ case 5: $panic(new $String("JSON decoder out of sync - data changing underfoot?")); /* } */ case 6: case 1: $s = -1; return val; /* */ } return; } if ($f === undefined) { $f = { $blk: decodeState.ptr.prototype.valueInterface }; } $f._1 = _1; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f.d = d; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; }; decodeState.prototype.valueInterface = function() { return this.$val.valueInterface(); }; decodeState.ptr.prototype.arrayInterface = function() { var _r$3, d, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; d = $f.d; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: d = this; v = $makeSlice(sliceType, 0); /* while (true) { */ case 1: $r = d.scanWhile(9); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (d.opcode === 8) { /* break; */ $s = 2; continue; } _r$3 = d.valueInterface(); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } v = $append(v, _r$3); /* */ if (d.opcode === 9) { $s = 5; continue; } /* */ $s = 6; continue; /* if (d.opcode === 9) { */ case 5: $r = d.scanWhile(9); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 6: if (d.opcode === 8) { /* break; */ $s = 2; continue; } if (!((d.opcode === 7))) { $panic(new $String("JSON decoder out of sync - data changing underfoot?")); } $s = 1; continue; case 2: $s = -1; return v; /* */ } return; } if ($f === undefined) { $f = { $blk: decodeState.ptr.prototype.arrayInterface }; } $f._r$3 = _r$3; $f.d = d; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; decodeState.prototype.arrayInterface = function() { return this.$val.arrayInterface(); }; decodeState.ptr.prototype.objectInterface = function() { var _key, _r$3, _tuple, d, item, key, m, ok, start, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _key = $f._key; _r$3 = $f._r$3; _tuple = $f._tuple; d = $f.d; item = $f.item; key = $f.key; m = $f.m; ok = $f.ok; start = $f.start; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: d = this; m = {}; /* while (true) { */ case 1: $r = d.scanWhile(9); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (d.opcode === 5) { /* break; */ $s = 2; continue; } if (!((d.opcode === 1))) { $panic(new $String("JSON decoder out of sync - data changing underfoot?")); } start = d.readIndex(); d.rescanLiteral(); item = $subslice(d.data, start, d.readIndex()); _tuple = unquote(item); key = _tuple[0]; ok = _tuple[1]; if (!ok) { $panic(new $String("JSON decoder out of sync - data changing underfoot?")); } /* */ if (d.opcode === 9) { $s = 4; continue; } /* */ $s = 5; continue; /* if (d.opcode === 9) { */ case 4: $r = d.scanWhile(9); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: if (!((d.opcode === 3))) { $panic(new $String("JSON decoder out of sync - data changing underfoot?")); } $r = d.scanWhile(9); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$3 = d.valueInterface(); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _key = key; (m || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: _r$3 }; /* */ if (d.opcode === 9) { $s = 9; continue; } /* */ $s = 10; continue; /* if (d.opcode === 9) { */ case 9: $r = d.scanWhile(9); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 10: if (d.opcode === 5) { /* break; */ $s = 2; continue; } if (!((d.opcode === 4))) { $panic(new $String("JSON decoder out of sync - data changing underfoot?")); } $s = 1; continue; case 2: $s = -1; return m; /* */ } return; } if ($f === undefined) { $f = { $blk: decodeState.ptr.prototype.objectInterface }; } $f._key = _key; $f._r$3 = _r$3; $f._tuple = _tuple; $f.d = d; $f.item = item; $f.key = key; $f.m = m; $f.ok = ok; $f.start = start; $f.$s = $s; $f.$r = $r; return $f; }; decodeState.prototype.objectInterface = function() { return this.$val.objectInterface(); }; decodeState.ptr.prototype.literalInterface = function() { var _1, _tuple, _tuple$1, c, d, err, item, n, ok, s, start, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; c = $f.c; d = $f.d; err = $f.err; item = $f.item; n = $f.n; ok = $f.ok; s = $f.s; start = $f.start; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: d = this; start = d.readIndex(); d.rescanLiteral(); item = $subslice(d.data, start, d.readIndex()); c = (0 >= item.$length ? ($throwRuntimeError("index out of range"), undefined) : item.$array[item.$offset + 0]); _1 = c; /* */ if (_1 === (110)) { $s = 2; continue; } /* */ if ((_1 === (116)) || (_1 === (102))) { $s = 3; continue; } /* */ if (_1 === (34)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_1 === (110)) { */ case 2: $s = -1; return $ifaceNil; /* } else if ((_1 === (116)) || (_1 === (102))) { */ case 3: $s = -1; return new $Bool((c === 116)); /* } else if (_1 === (34)) { */ case 4: _tuple = unquote(item); s = _tuple[0]; ok = _tuple[1]; if (!ok) { $panic(new $String("JSON decoder out of sync - data changing underfoot?")); } $s = -1; return new $String(s); /* } else { */ case 5: if (!((c === 45)) && (c < 48 || c > 57)) { $panic(new $String("JSON decoder out of sync - data changing underfoot?")); } _tuple$1 = d.convertNumber(($bytesToString(item))); n = _tuple$1[0]; err = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 7: $r = d.saveError(err); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 8: $s = -1; return n; /* } */ case 6: case 1: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: decodeState.ptr.prototype.literalInterface }; } $f._1 = _1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.c = c; $f.d = d; $f.err = err; $f.item = item; $f.n = n; $f.ok = ok; $f.s = s; $f.start = start; $f.$s = $s; $f.$r = $r; return $f; }; decodeState.prototype.literalInterface = function() { return this.$val.literalInterface(); }; getu4 = function(s) { var _i, _ref, c, r, s; if (s.$length < 6 || !(((0 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 0]) === 92)) || !(((1 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 1]) === 117))) { return -1; } r = 0; _ref = $subslice(s, 2, 6); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } c = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (48 <= c && c <= 57) { c = c - 48 << 24 >>> 24; } else if (97 <= c && c <= 102) { c = (c - 97 << 24 >>> 24) + 10 << 24 >>> 24; } else if (65 <= c && c <= 70) { c = (c - 65 << 24 >>> 24) + 10 << 24 >>> 24; } else { return -1; } r = ($imul(r, 16)) + ((c >> 0)) >> 0; _i++; } return r; }; unquote = function(s) { var _tuple, ok, s, t; t = ""; ok = false; _tuple = unquoteBytes(s); s = _tuple[0]; ok = _tuple[1]; t = ($bytesToString(s)); return [t, ok]; }; unquoteBytes = function(s) { var _1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, b, c, c$1, dec, nb, ok, r, rr, rr$1, rr$2, rr1, s, size, size$1, t, w, x; t = sliceType$2.nil; ok = false; if (s.$length < 2 || !(((0 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 0]) === 34)) || !(((x = s.$length - 1 >> 0, ((x < 0 || x >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + x])) === 34))) { return [t, ok]; } s = $subslice(s, 1, (s.$length - 1 >> 0)); r = 0; while (true) { if (!(r < s.$length)) { break; } c = ((r < 0 || r >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + r]); if ((c === 92) || (c === 34) || c < 32) { break; } if (c < 128) { r = r + (1) >> 0; continue; } _tuple = utf8.DecodeRune($subslice(s, r)); rr = _tuple[0]; size = _tuple[1]; if ((rr === 65533) && (size === 1)) { break; } r = r + (size) >> 0; } if (r === s.$length) { _tmp = s; _tmp$1 = true; t = _tmp; ok = _tmp$1; return [t, ok]; } b = $makeSlice(sliceType$2, (s.$length + 8 >> 0)); w = $copySlice(b, $subslice(s, 0, r)); while (true) { if (!(r < s.$length)) { break; } if (w >= (b.$length - 8 >> 0)) { nb = $makeSlice(sliceType$2, ($imul(((b.$length + 4 >> 0)), 2))); $copySlice(nb, $subslice(b, 0, w)); b = nb; } c$1 = ((r < 0 || r >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + r]); if ((c$1 === 92)) { r = r + (1) >> 0; if (r >= s.$length) { return [t, ok]; } switch (0) { default: _1 = ((r < 0 || r >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + r]); if ((_1 === (34)) || (_1 === (92)) || (_1 === (47)) || (_1 === (39))) { ((w < 0 || w >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + w] = ((r < 0 || r >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + r])); r = r + (1) >> 0; w = w + (1) >> 0; } else if (_1 === (98)) { ((w < 0 || w >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + w] = 8); r = r + (1) >> 0; w = w + (1) >> 0; } else if (_1 === (102)) { ((w < 0 || w >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + w] = 12); r = r + (1) >> 0; w = w + (1) >> 0; } else if (_1 === (110)) { ((w < 0 || w >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + w] = 10); r = r + (1) >> 0; w = w + (1) >> 0; } else if (_1 === (114)) { ((w < 0 || w >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + w] = 13); r = r + (1) >> 0; w = w + (1) >> 0; } else if (_1 === (116)) { ((w < 0 || w >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + w] = 9); r = r + (1) >> 0; w = w + (1) >> 0; } else if (_1 === (117)) { r = r - (1) >> 0; rr$1 = getu4($subslice(s, r)); if (rr$1 < 0) { return [t, ok]; } r = r + (6) >> 0; if (utf16.IsSurrogate(rr$1)) { rr1 = getu4($subslice(s, r)); dec = utf16.DecodeRune(rr$1, rr1); if (!((dec === 65533))) { r = r + (6) >> 0; w = w + (utf8.EncodeRune($subslice(b, w), dec)) >> 0; break; } rr$1 = 65533; } w = w + (utf8.EncodeRune($subslice(b, w), rr$1)) >> 0; } else { return [t, ok]; } } } else if (((c$1 === 34)) || (c$1 < 32)) { return [t, ok]; } else if (c$1 < 128) { ((w < 0 || w >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + w] = c$1); r = r + (1) >> 0; w = w + (1) >> 0; } else { _tuple$1 = utf8.DecodeRune($subslice(s, r)); rr$2 = _tuple$1[0]; size$1 = _tuple$1[1]; r = r + (size$1) >> 0; w = w + (utf8.EncodeRune($subslice(b, w), rr$2)) >> 0; } } _tmp$2 = $subslice(b, 0, w); _tmp$3 = true; t = _tmp$2; ok = _tmp$3; return [t, ok]; }; tagOptions.methods = [{prop: "Contains", name: "Contains", pkg: "", typ: $funcType([$String], [$Bool], false)}]; ptrType$13.methods = [{prop: "UseNumber", name: "UseNumber", pkg: "", typ: $funcType([], [], false)}, {prop: "DisallowUnknownFields", name: "DisallowUnknownFields", pkg: "", typ: $funcType([], [], false)}, {prop: "Decode", name: "Decode", pkg: "", typ: $funcType([$emptyInterface], [$error], false)}, {prop: "Buffered", name: "Buffered", pkg: "", typ: $funcType([], [io.Reader], false)}, {prop: "readValue", name: "readValue", pkg: "encoding/json", typ: $funcType([], [$Int, $error], false)}, {prop: "refill", name: "refill", pkg: "encoding/json", typ: $funcType([], [$error], false)}, {prop: "tokenPrepareForDecode", name: "tokenPrepareForDecode", pkg: "encoding/json", typ: $funcType([], [$error], false)}, {prop: "tokenValueAllowed", name: "tokenValueAllowed", pkg: "encoding/json", typ: $funcType([], [$Bool], false)}, {prop: "tokenValueEnd", name: "tokenValueEnd", pkg: "encoding/json", typ: $funcType([], [], false)}, {prop: "Token", name: "Token", pkg: "", typ: $funcType([], [Token, $error], false)}, {prop: "tokenError", name: "tokenError", pkg: "encoding/json", typ: $funcType([$Uint8], [Token, $error], false)}, {prop: "More", name: "More", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "peek", name: "peek", pkg: "encoding/json", typ: $funcType([], [$Uint8, $error], false)}, {prop: "InputOffset", name: "InputOffset", pkg: "", typ: $funcType([], [$Int64], false)}]; Delim.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$15.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$8.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([$Uint8, $Int, $Int], [$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)}]; ptrType$16.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$17.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$19.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Unwrap", name: "Unwrap", pkg: "", typ: $funcType([], [$error], false)}]; ptrType$9.methods = [{prop: "marshal", name: "marshal", pkg: "encoding/json", typ: $funcType([$emptyInterface, encOpts], [$error], false)}, {prop: "error", name: "error", pkg: "encoding/json", typ: $funcType([$error], [], false)}, {prop: "reflectValue", name: "reflectValue", pkg: "encoding/json", typ: $funcType([reflect.Value, encOpts], [], false)}, {prop: "string", name: "string", pkg: "encoding/json", typ: $funcType([$String, $Bool], [], false)}, {prop: "stringBytes", name: "stringBytes", pkg: "encoding/json", typ: $funcType([sliceType$2, $Bool], [], false)}]; floatEncoder.methods = [{prop: "encode", name: "encode", pkg: "encoding/json", typ: $funcType([ptrType$9, reflect.Value, encOpts], [], false)}]; structEncoder.methods = [{prop: "encode", name: "encode", pkg: "encoding/json", typ: $funcType([ptrType$9, reflect.Value, encOpts], [], false)}]; mapEncoder.methods = [{prop: "encode", name: "encode", pkg: "encoding/json", typ: $funcType([ptrType$9, reflect.Value, encOpts], [], false)}]; sliceEncoder.methods = [{prop: "encode", name: "encode", pkg: "encoding/json", typ: $funcType([ptrType$9, reflect.Value, encOpts], [], false)}]; arrayEncoder.methods = [{prop: "encode", name: "encode", pkg: "encoding/json", typ: $funcType([ptrType$9, reflect.Value, encOpts], [], false)}]; ptrEncoder.methods = [{prop: "encode", name: "encode", pkg: "encoding/json", typ: $funcType([ptrType$9, reflect.Value, encOpts], [], false)}]; condAddrEncoder.methods = [{prop: "encode", name: "encode", pkg: "encoding/json", typ: $funcType([ptrType$9, reflect.Value, encOpts], [], false)}]; ptrType$20.methods = [{prop: "resolve", name: "resolve", pkg: "encoding/json", typ: $funcType([], [$error], 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$10.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$22.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; 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$23.methods = [{prop: "unmarshal", name: "unmarshal", pkg: "encoding/json", typ: $funcType([$emptyInterface], [$error], false)}, {prop: "readIndex", name: "readIndex", pkg: "encoding/json", typ: $funcType([], [$Int], false)}, {prop: "init", name: "init", pkg: "encoding/json", typ: $funcType([sliceType$2], [ptrType$23], false)}, {prop: "saveError", name: "saveError", pkg: "encoding/json", typ: $funcType([$error], [], false)}, {prop: "addErrorContext", name: "addErrorContext", pkg: "encoding/json", typ: $funcType([$error], [$error], false)}, {prop: "skip", name: "skip", pkg: "encoding/json", typ: $funcType([], [], false)}, {prop: "scanNext", name: "scanNext", pkg: "encoding/json", typ: $funcType([], [], false)}, {prop: "scanWhile", name: "scanWhile", pkg: "encoding/json", typ: $funcType([$Int], [], false)}, {prop: "rescanLiteral", name: "rescanLiteral", pkg: "encoding/json", typ: $funcType([], [], false)}, {prop: "value", name: "value", pkg: "encoding/json", typ: $funcType([reflect.Value], [$error], false)}, {prop: "valueQuoted", name: "valueQuoted", pkg: "encoding/json", typ: $funcType([], [$emptyInterface], false)}, {prop: "array", name: "array", pkg: "encoding/json", typ: $funcType([reflect.Value], [$error], false)}, {prop: "object", name: "object", pkg: "encoding/json", typ: $funcType([reflect.Value], [$error], false)}, {prop: "convertNumber", name: "convertNumber", pkg: "encoding/json", typ: $funcType([$String], [$emptyInterface, $error], false)}, {prop: "literalStore", name: "literalStore", pkg: "encoding/json", typ: $funcType([sliceType$2, reflect.Value, $Bool], [$error], false)}, {prop: "valueInterface", name: "valueInterface", pkg: "encoding/json", typ: $funcType([], [$emptyInterface], false)}, {prop: "arrayInterface", name: "arrayInterface", pkg: "encoding/json", typ: $funcType([], [sliceType], false)}, {prop: "objectInterface", name: "objectInterface", pkg: "encoding/json", typ: $funcType([], [mapType], false)}, {prop: "literalInterface", name: "literalInterface", pkg: "encoding/json", typ: $funcType([], [$emptyInterface], false)}]; Decoder.init("encoding/json", [{prop: "r", name: "r", embedded: false, exported: false, typ: io.Reader, tag: ""}, {prop: "buf", name: "buf", embedded: false, exported: false, typ: sliceType$2, tag: ""}, {prop: "d", name: "d", embedded: false, exported: false, typ: decodeState, tag: ""}, {prop: "scanp", name: "scanp", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "scanned", name: "scanned", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "scan", name: "scan", embedded: false, exported: false, typ: scanner, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "tokenState", name: "tokenState", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "tokenStack", name: "tokenStack", embedded: false, exported: false, typ: sliceType$1, tag: ""}]); Token.init([]); SyntaxError.init("encoding/json", [{prop: "msg", name: "msg", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "Offset", name: "Offset", embedded: false, exported: true, typ: $Int64, tag: ""}]); scanner.init("encoding/json", [{prop: "step", name: "step", embedded: false, exported: false, typ: funcType, tag: ""}, {prop: "endTop", name: "endTop", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "parseState", name: "parseState", embedded: false, exported: false, typ: sliceType$1, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "bytes", name: "bytes", embedded: false, exported: false, typ: $Int64, tag: ""}]); Marshaler.init([{prop: "MarshalJSON", name: "MarshalJSON", pkg: "", typ: $funcType([], [sliceType$2, $error], false)}]); UnsupportedTypeError.init("", [{prop: "Type", name: "Type", embedded: false, exported: true, typ: reflect.Type, tag: ""}]); UnsupportedValueError.init("", [{prop: "Value", name: "Value", embedded: false, exported: true, typ: reflect.Value, tag: ""}, {prop: "Str", name: "Str", embedded: false, exported: true, typ: $String, tag: ""}]); MarshalerError.init("encoding/json", [{prop: "Type", name: "Type", embedded: false, exported: true, typ: reflect.Type, tag: ""}, {prop: "Err", name: "Err", embedded: false, exported: true, typ: $error, tag: ""}, {prop: "sourceFunc", name: "sourceFunc", embedded: false, exported: false, typ: $String, tag: ""}]); encodeState.init("encoding/json", [{prop: "Buffer", name: "Buffer", embedded: true, exported: true, typ: bytes.Buffer, tag: ""}, {prop: "scratch", name: "scratch", embedded: false, exported: false, typ: arrayType, tag: ""}, {prop: "ptrLevel", name: "ptrLevel", embedded: false, exported: false, typ: $Uint, tag: ""}, {prop: "ptrSeen", name: "ptrSeen", embedded: false, exported: false, typ: mapType$1, tag: ""}]); jsonError.init("encoding/json", [{prop: "error", name: "error", embedded: true, exported: false, typ: $error, tag: ""}]); encOpts.init("encoding/json", [{prop: "quoted", name: "quoted", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "escapeHTML", name: "escapeHTML", embedded: false, exported: false, typ: $Bool, tag: ""}]); encoderFunc.init([ptrType$9, reflect.Value, encOpts], [], false); structEncoder.init("encoding/json", [{prop: "fields", name: "fields", embedded: false, exported: false, typ: structFields, tag: ""}]); structFields.init("encoding/json", [{prop: "list", name: "list", embedded: false, exported: false, typ: sliceType$3, tag: ""}, {prop: "nameIndex", name: "nameIndex", embedded: false, exported: false, typ: mapType$2, tag: ""}]); mapEncoder.init("encoding/json", [{prop: "elemEnc", name: "elemEnc", embedded: false, exported: false, typ: encoderFunc, tag: ""}]); sliceEncoder.init("encoding/json", [{prop: "arrayEnc", name: "arrayEnc", embedded: false, exported: false, typ: encoderFunc, tag: ""}]); arrayEncoder.init("encoding/json", [{prop: "elemEnc", name: "elemEnc", embedded: false, exported: false, typ: encoderFunc, tag: ""}]); ptrEncoder.init("encoding/json", [{prop: "elemEnc", name: "elemEnc", embedded: false, exported: false, typ: encoderFunc, tag: ""}]); condAddrEncoder.init("encoding/json", [{prop: "canAddrEnc", name: "canAddrEnc", embedded: false, exported: false, typ: encoderFunc, tag: ""}, {prop: "elseEnc", name: "elseEnc", embedded: false, exported: false, typ: encoderFunc, tag: ""}]); reflectWithString.init("encoding/json", [{prop: "k", name: "k", embedded: false, exported: false, typ: reflect.Value, tag: ""}, {prop: "v", name: "v", embedded: false, exported: false, typ: reflect.Value, tag: ""}, {prop: "ks", name: "ks", embedded: false, exported: false, typ: $String, tag: ""}]); field.init("encoding/json", [{prop: "name", name: "name", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "nameBytes", name: "nameBytes", embedded: false, exported: false, typ: sliceType$2, tag: ""}, {prop: "equalFold", name: "equalFold", embedded: false, exported: false, typ: funcType$1, tag: ""}, {prop: "nameNonEsc", name: "nameNonEsc", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "nameEscHTML", name: "nameEscHTML", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "tag", name: "tag", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "index", name: "index", embedded: false, exported: false, typ: sliceType$1, tag: ""}, {prop: "typ", name: "typ", embedded: false, exported: false, typ: reflect.Type, tag: ""}, {prop: "omitEmpty", name: "omitEmpty", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "quoted", name: "quoted", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "encoder", name: "encoder", embedded: false, exported: false, typ: encoderFunc, tag: ""}]); byIndex.init(field); Unmarshaler.init([{prop: "UnmarshalJSON", name: "UnmarshalJSON", pkg: "", typ: $funcType([sliceType$2], [$error], false)}]); UnmarshalTypeError.init("", [{prop: "Value", name: "Value", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Type", name: "Type", embedded: false, exported: true, typ: reflect.Type, tag: ""}, {prop: "Offset", name: "Offset", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Struct", name: "Struct", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Field", name: "Field", embedded: false, exported: true, typ: $String, tag: ""}]); InvalidUnmarshalError.init("", [{prop: "Type", name: "Type", embedded: false, exported: true, typ: reflect.Type, tag: ""}]); errorContext.init("", [{prop: "Struct", name: "Struct", embedded: false, exported: true, typ: reflect.Type, tag: ""}, {prop: "FieldStack", name: "FieldStack", embedded: false, exported: true, typ: sliceType$5, tag: ""}]); decodeState.init("encoding/json", [{prop: "data", name: "data", embedded: false, exported: false, typ: sliceType$2, tag: ""}, {prop: "off", name: "off", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "opcode", name: "opcode", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "scan", name: "scan", embedded: false, exported: false, typ: scanner, tag: ""}, {prop: "errorContext", name: "errorContext", embedded: false, exported: false, typ: ptrType$4, tag: ""}, {prop: "savedError", name: "savedError", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "useNumber", name: "useNumber", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "disallowUnknownFields", name: "disallowUnknownFields", embedded: false, exported: false, typ: $Bool, tag: ""}]); unquotedValue.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 = 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 = sort.$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 = unicode.$init(); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = utf16.$init(); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = utf8.$init(); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } encodeStatePool = new nosync.Pool.ptr(sliceType.nil, $throwNilPointerError); encoderCache = new nosync.Map.ptr(false); fieldCache = new nosync.Map.ptr(false); safeSet = $toNativeArray($kindBool, [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true]); htmlSafeSet = $toNativeArray($kindBool, [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, true, false, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true]); scannerPool = new nosync.Pool.ptr(sliceType.nil, (function() { return new scanner.ptr($throwNilPointerError, false, sliceType$1.nil, $ifaceNil, new $Int64(0, 0)); })); hex = "0123456789abcdef"; _r = reflect.TypeOf((ptrType$1.nil)).Elem(); /* */ $s = 16; case 16: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } marshalerType = _r; _r$1 = reflect.TypeOf((ptrType$2.nil)).Elem(); /* */ $s = 17; case 17: 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"); nullLiteral = (new sliceType$2($stringToBytes("null"))); _r$2 = reflect.TypeOf((ptrType$3.nil)).Elem(); /* */ $s = 18; case 18: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } textUnmarshalerType = _r$2; numberType = reflect.TypeOf(new Number("")); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["io/ioutil"] = (function() { var $pkg = {}, $init, io, fs, os, sort, ReadAll, NopCloser; io = $packages["io"]; fs = $packages["io/fs"]; os = $packages["os"]; sort = $packages["sort"]; ReadAll = function(r) { var $24r, _r, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = io.ReadAll(r); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: ReadAll }; } $f.$24r = $24r; $f._r = _r; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.ReadAll = ReadAll; NopCloser = function(r) { var r; return io.NopCloser(r); }; $pkg.NopCloser = NopCloser; $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 = fs.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = os.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sort.$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["context"] = (function() { var $pkg = {}, $init, errors, reflectlite, sync, atomic, time, Context, deadlineExceededError, emptyCtx, CancelFunc, canceler, cancelCtx, stringer, timerCtx, valueCtx, ptrType, structType, ptrType$1, ptrType$2, ptrType$3, ptrType$4, chanType, ptrType$5, chanType$1, mapType, ptrType$6, ptrType$7, background, todo, goroutines, goroutines$24ptr, cancelCtxKey, cancelCtxKey$24ptr, closedchan, x, Background, WithCancel, newCancelCtx, propagateCancel, parentCancelCtx, removeChild, init, contextName, WithDeadline, WithTimeout, WithValue, stringify; errors = $packages["errors"]; reflectlite = $packages["internal/reflectlite"]; sync = $packages["sync"]; atomic = $packages["sync/atomic"]; time = $packages["time"]; Context = $pkg.Context = $newType(8, $kindInterface, "context.Context", true, "context", true, null); deadlineExceededError = $pkg.deadlineExceededError = $newType(0, $kindStruct, "context.deadlineExceededError", true, "context", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); emptyCtx = $pkg.emptyCtx = $newType(4, $kindInt, "context.emptyCtx", true, "context", false, null); CancelFunc = $pkg.CancelFunc = $newType(4, $kindFunc, "context.CancelFunc", true, "context", true, null); canceler = $pkg.canceler = $newType(8, $kindInterface, "context.canceler", true, "context", false, null); cancelCtx = $pkg.cancelCtx = $newType(0, $kindStruct, "context.cancelCtx", true, "context", false, function(Context_, mu_, done_, children_, err_) { this.$val = this; if (arguments.length === 0) { this.Context = $ifaceNil; this.mu = new sync.Mutex.ptr(0, 0); this.done = new atomic.Value.ptr($ifaceNil); this.children = false; this.err = $ifaceNil; return; } this.Context = Context_; this.mu = mu_; this.done = done_; this.children = children_; this.err = err_; }); stringer = $pkg.stringer = $newType(8, $kindInterface, "context.stringer", true, "context", false, null); timerCtx = $pkg.timerCtx = $newType(0, $kindStruct, "context.timerCtx", true, "context", false, function(cancelCtx_, timer_, deadline_) { this.$val = this; if (arguments.length === 0) { this.cancelCtx = new cancelCtx.ptr($ifaceNil, new sync.Mutex.ptr(0, 0), new atomic.Value.ptr($ifaceNil), false, $ifaceNil); this.timer = ptrType$5.nil; this.deadline = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$1.nil); return; } this.cancelCtx = cancelCtx_; this.timer = timer_; this.deadline = deadline_; }); valueCtx = $pkg.valueCtx = $newType(0, $kindStruct, "context.valueCtx", true, "context", false, function(Context_, key_, val_) { this.$val = this; if (arguments.length === 0) { this.Context = $ifaceNil; this.key = $ifaceNil; this.val = $ifaceNil; return; } this.Context = Context_; this.key = key_; this.val = val_; }); ptrType = $ptrType(emptyCtx); structType = $structType("", []); ptrType$1 = $ptrType(time.Location); ptrType$2 = $ptrType($Int32); ptrType$3 = $ptrType(cancelCtx); ptrType$4 = $ptrType($Int); chanType = $chanType(structType, false, false); ptrType$5 = $ptrType(time.Timer); chanType$1 = $chanType(structType, false, true); mapType = $mapType(canceler, structType); ptrType$6 = $ptrType(timerCtx); ptrType$7 = $ptrType(valueCtx); deadlineExceededError.ptr.prototype.Error = function() { return "context deadline exceeded"; }; deadlineExceededError.prototype.Error = function() { return this.$val.Error(); }; deadlineExceededError.ptr.prototype.Timeout = function() { return true; }; deadlineExceededError.prototype.Timeout = function() { return this.$val.Timeout(); }; deadlineExceededError.ptr.prototype.Temporary = function() { return true; }; deadlineExceededError.prototype.Temporary = function() { return this.$val.Temporary(); }; $ptrType(emptyCtx).prototype.Deadline = function() { var deadline, ok; deadline = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$1.nil); ok = false; return [deadline, ok]; }; $ptrType(emptyCtx).prototype.Done = function() { return $chanNil; }; $ptrType(emptyCtx).prototype.Err = function() { return $ifaceNil; }; $ptrType(emptyCtx).prototype.Value = function(key) { var key; return $ifaceNil; }; $ptrType(emptyCtx).prototype.String = function() { var _1, e; e = this; _1 = e; if (_1 === (background)) { return "context.Background"; } else if (_1 === (todo)) { return "context.TODO"; } return "unknown empty Context"; }; Background = function() { return background; }; $pkg.Background = Background; WithCancel = function(parent) { var _tmp, _tmp$1, c, cancel, ctx, parent, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; c = $f.c; cancel = $f.cancel; ctx = $f.ctx; parent = $f.parent; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = [c]; ctx = $ifaceNil; cancel = $throwNilPointerError; if ($interfaceIsEqual(parent, $ifaceNil)) { $panic(new $String("cannot create context from nil parent")); } c[0] = $clone(newCancelCtx(parent), cancelCtx); $r = propagateCancel(parent, c[0]); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp = c[0]; _tmp$1 = (function(c) { return function $b() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = c[0].cancel(true, $pkg.Canceled); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$s = $s; $f.$r = $r; return $f; }; })(c); ctx = _tmp; cancel = _tmp$1; $s = -1; return [ctx, cancel]; /* */ } return; } if ($f === undefined) { $f = { $blk: WithCancel }; } $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.c = c; $f.cancel = cancel; $f.ctx = ctx; $f.parent = parent; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.WithCancel = WithCancel; newCancelCtx = function(parent) { var parent; return new cancelCtx.ptr(parent, new sync.Mutex.ptr(0, 0), new atomic.Value.ptr($ifaceNil), false, $ifaceNil); }; propagateCancel = function(parent, child) { var _arg, _key, _r, _r$1, _r$2, _selection, _tuple, child, done, ok, p, parent, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _key = $f._key; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _selection = $f._selection; _tuple = $f._tuple; child = $f.child; done = $f.done; ok = $f.ok; p = $f.p; parent = $f.parent; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: child = [child]; parent = [parent]; _r = parent[0].Done(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } done = _r; if (done === $chanNil) { $s = -1; return; } _selection = $select([[done], []]); /* */ if (_selection[0] === 0) { $s = 2; continue; } /* */ if (_selection[0] === 1) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_selection[0] === 0) { */ case 2: _r$1 = parent[0].Err(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg = _r$1; $r = child[0].cancel(false, _arg); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } else if (_selection[0] === 1) { */ case 3: /* } */ case 4: _r$2 = parentCancelCtx(parent[0]); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; p = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 8; continue; } /* */ $s = 9; continue; /* if (ok) { */ case 8: $r = p.mu.Lock(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!($interfaceIsEqual(p.err, $ifaceNil))) { $s = 12; continue; } /* */ $s = 13; continue; /* if (!($interfaceIsEqual(p.err, $ifaceNil))) { */ case 12: $r = child[0].cancel(false, p.err); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 14; continue; /* } else { */ case 13: if (p.children === false) { p.children = {}; } _key = child[0]; (p.children || $throwRuntimeError("assignment to entry in nil map"))[canceler.keyFor(_key)] = { k: _key, v: new structType.ptr() }; /* } */ case 14: $r = p.mu.Unlock(); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 10; continue; /* } else { */ case 9: atomic.AddInt32((goroutines$24ptr || (goroutines$24ptr = new ptrType$2(function() { return goroutines; }, function($v) { goroutines = $v; }))), 1); $go((function(child, parent) { return function $b() { var _arg$1, _r$3, _r$4, _r$5, _r$6, _selection$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg$1 = $f._arg$1; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _selection$1 = $f._selection$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$3 = parent[0].Done(); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = child[0].Done(); /* */ $s = 2; case 2: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = $select([[_r$3], [_r$4]]); /* */ $s = 3; case 3: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _selection$1 = _r$5; /* */ if (_selection$1[0] === 0) { $s = 4; continue; } /* */ if (_selection$1[0] === 1) { $s = 5; continue; } /* */ $s = 6; continue; /* if (_selection$1[0] === 0) { */ case 4: _r$6 = parent[0].Err(); /* */ $s = 7; case 7: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _arg$1 = _r$6; $r = child[0].cancel(false, _arg$1); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 6; continue; /* } else if (_selection$1[0] === 1) { */ case 5: /* } */ case 6: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._arg$1 = _arg$1; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._selection$1 = _selection$1; $f.$s = $s; $f.$r = $r; return $f; }; })(child, parent), []); /* } */ case 10: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: propagateCancel }; } $f._arg = _arg; $f._key = _key; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._selection = _selection; $f._tuple = _tuple; $f.child = child; $f.done = done; $f.ok = ok; $f.p = p; $f.parent = parent; $f.$s = $s; $f.$r = $r; return $f; }; parentCancelCtx = function(parent) { var _r, _r$1, _tuple, _tuple$1, done, ok, p, parent, pdone, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; done = $f.done; ok = $f.ok; p = $f.p; parent = $f.parent; pdone = $f.pdone; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = parent.Done(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } done = _r; if (done === closedchan || done === $chanNil) { $s = -1; return [ptrType$3.nil, false]; } _r$1 = parent.Value((cancelCtxKey$24ptr || (cancelCtxKey$24ptr = new ptrType$4(function() { return cancelCtxKey; }, function($v) { cancelCtxKey = $v; })))); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = $assertType(_r$1, ptrType$3, true); p = _tuple[0]; ok = _tuple[1]; if (!ok) { $s = -1; return [ptrType$3.nil, false]; } _tuple$1 = $assertType(p.done.Load(), chanType, true); pdone = _tuple$1[0]; if (!(pdone === done)) { $s = -1; return [ptrType$3.nil, false]; } $s = -1; return [p, true]; /* */ } return; } if ($f === undefined) { $f = { $blk: parentCancelCtx }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.done = done; $f.ok = ok; $f.p = p; $f.parent = parent; $f.pdone = pdone; $f.$s = $s; $f.$r = $r; return $f; }; removeChild = function(parent, child) { var _r, _tuple, child, ok, p, parent, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; child = $f.child; ok = $f.ok; p = $f.p; parent = $f.parent; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = parentCancelCtx(parent); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; p = _tuple[0]; ok = _tuple[1]; if (!ok) { $s = -1; return; } $r = p.mu.Lock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (!(p.children === false)) { delete p.children[canceler.keyFor(child)]; } $r = p.mu.Unlock(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: removeChild }; } $f._r = _r; $f._tuple = _tuple; $f.child = child; $f.ok = ok; $f.p = p; $f.parent = parent; $f.$s = $s; $f.$r = $r; return $f; }; init = function() { $close(closedchan); }; cancelCtx.ptr.prototype.Value = function(key) { var $24r, _r, c, key, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; c = $f.c; key = $f.key; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if ($interfaceIsEqual(key, (cancelCtxKey$24ptr || (cancelCtxKey$24ptr = new ptrType$4(function() { return cancelCtxKey; }, function($v) { cancelCtxKey = $v; }))))) { $s = -1; return c; } _r = c.Context.Value(key); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: cancelCtx.ptr.prototype.Value }; } $f.$24r = $24r; $f._r = _r; $f.c = c; $f.key = key; $f.$s = $s; $f.$r = $r; return $f; }; cancelCtx.prototype.Value = function(key) { return this.$val.Value(key); }; cancelCtx.ptr.prototype.Done = function() { var $24r, $24r$1, c, d, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; c = $f.c; d = $f.d; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); c = this; d = c.done.Load(); /* */ if (!($interfaceIsEqual(d, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(d, $ifaceNil))) { */ case 1: $24r = $assertType(d, chanType); $s = 3; case 3: return $24r; /* } */ case 2: $r = c.mu.Lock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(c.mu, "Unlock"), []]); d = c.done.Load(); if ($interfaceIsEqual(d, $ifaceNil)) { d = new chanType(new $Chan(structType, 0)); c.done.Store(d); } $24r$1 = $assertType(d, chanType); $s = 5; case 5: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return $chanNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: cancelCtx.ptr.prototype.Done }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.c = c; $f.d = d; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; cancelCtx.prototype.Done = function() { return this.$val.Done(); }; cancelCtx.ptr.prototype.Err = function() { var c, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; c = $f.c; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; $r = c.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } err = c.err; $r = c.mu.Unlock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: cancelCtx.ptr.prototype.Err }; } $f.c = c; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; cancelCtx.prototype.Err = function() { return this.$val.Err(); }; contextName = function(c) { var $24r, $24r$1, _r, _r$1, _tuple, c, ok, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; c = $f.c; ok = $f.ok; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _tuple = $assertType(c, stringer, true); s = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 1; continue; } /* */ $s = 2; continue; /* if (ok) { */ case 1: _r = s.String(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 4; case 4: return $24r; /* } */ case 2: _r$1 = reflectlite.TypeOf(c).String(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r$1 = _r$1; $s = 6; case 6: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: contextName }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.c = c; $f.ok = ok; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; cancelCtx.ptr.prototype.String = function() { var $24r, _r, c, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; c = $f.c; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r = contextName(c.Context); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r + ".WithCancel"; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: cancelCtx.ptr.prototype.String }; } $f.$24r = $24r; $f._r = _r; $f.c = c; $f.$s = $s; $f.$r = $r; return $f; }; cancelCtx.prototype.String = function() { return this.$val.String(); }; cancelCtx.ptr.prototype.cancel = function(removeFromParent, err) { var _entry, _i, _keys, _ref, _tuple, c, child, d, err, removeFromParent, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _i = $f._i; _keys = $f._keys; _ref = $f._ref; _tuple = $f._tuple; c = $f.c; child = $f.child; d = $f.d; err = $f.err; removeFromParent = $f.removeFromParent; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if ($interfaceIsEqual(err, $ifaceNil)) { $panic(new $String("context: internal error: missing cancel error")); } $r = c.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!($interfaceIsEqual(c.err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(c.err, $ifaceNil))) { */ case 2: $r = c.mu.Unlock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 3: c.err = err; _tuple = $assertType(c.done.Load(), chanType, true); d = _tuple[0]; if (d === $chanNil) { c.done.Store(new chanType(closedchan)); } else { $close(d); } _ref = c.children; _i = 0; _keys = $keys(_ref); /* while (true) { */ case 5: /* if (!(_i < _keys.length)) { break; } */ if(!(_i < _keys.length)) { $s = 6; continue; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; /* continue; */ $s = 5; continue; } child = _entry.k; $r = child.cancel(false, err); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i++; $s = 5; continue; case 6: c.children = false; $r = c.mu.Unlock(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (removeFromParent) { $s = 9; continue; } /* */ $s = 10; continue; /* if (removeFromParent) { */ case 9: $r = removeChild(c.Context, c); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 10: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: cancelCtx.ptr.prototype.cancel }; } $f._entry = _entry; $f._i = _i; $f._keys = _keys; $f._ref = _ref; $f._tuple = _tuple; $f.c = c; $f.child = child; $f.d = d; $f.err = err; $f.removeFromParent = removeFromParent; $f.$s = $s; $f.$r = $r; return $f; }; cancelCtx.prototype.cancel = function(removeFromParent, err) { return this.$val.cancel(removeFromParent, err); }; WithDeadline = function(parent, d) { var $24r, $24r$1, $24r$2, _r, _r$1, _r$2, _r$3, _tuple, c, cur, d, dur, ok, parent, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; c = $f.c; cur = $f.cur; d = $f.d; dur = $f.dur; ok = $f.ok; parent = $f.parent; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); c = [c]; if ($interfaceIsEqual(parent, $ifaceNil)) { $panic(new $String("cannot create context from nil parent")); } _r = parent.Deadline(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; cur = $clone(_tuple[0], time.Time); ok = _tuple[1]; /* */ if (ok && $clone(cur, time.Time).Before($clone(d, time.Time))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (ok && $clone(cur, time.Time).Before($clone(d, time.Time))) { */ case 2: _r$1 = WithCancel(parent); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 5; case 5: return $24r; /* } */ case 3: c[0] = new timerCtx.ptr($clone(newCancelCtx(parent), cancelCtx), ptrType$5.nil, $clone(d, time.Time)); $r = propagateCancel(parent, c[0]); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$2 = time.Until($clone(d, time.Time)); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } dur = _r$2; /* */ if ((dur.$high < 0 || (dur.$high === 0 && dur.$low <= 0))) { $s = 8; continue; } /* */ $s = 9; continue; /* if ((dur.$high < 0 || (dur.$high === 0 && dur.$low <= 0))) { */ case 8: $r = c[0].cancel(true, $pkg.DeadlineExceeded); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $24r$1 = [c[0], (function(c) { return function $b() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = c[0].cancel(false, $pkg.Canceled); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$s = $s; $f.$r = $r; return $f; }; })(c)]; $s = 11; case 11: return $24r$1; /* } */ case 9: $r = c[0].cancelCtx.mu.Lock(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(c[0].cancelCtx.mu, "Unlock"), []]); /* */ if ($interfaceIsEqual(c[0].cancelCtx.err, $ifaceNil)) { $s = 13; continue; } /* */ $s = 14; continue; /* if ($interfaceIsEqual(c[0].cancelCtx.err, $ifaceNil)) { */ case 13: _r$3 = time.AfterFunc(dur, (function(c) { return function $b() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = c[0].cancel(true, $pkg.DeadlineExceeded); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$s = $s; $f.$r = $r; return $f; }; })(c)); /* */ $s = 15; case 15: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } c[0].timer = _r$3; /* } */ case 14: $24r$2 = [c[0], (function(c) { return function $b() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = c[0].cancel(true, $pkg.Canceled); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$s = $s; $f.$r = $r; return $f; }; })(c)]; $s = 16; case 16: return $24r$2; /* */ } return; } } catch(err) { $err = err; $s = -1; return [$ifaceNil, $throwNilPointerError]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: WithDeadline }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.c = c; $f.cur = cur; $f.d = d; $f.dur = dur; $f.ok = ok; $f.parent = parent; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; $pkg.WithDeadline = WithDeadline; timerCtx.ptr.prototype.Deadline = function() { var _tmp, _tmp$1, c, deadline, ok; deadline = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$1.nil); ok = false; c = this; _tmp = $clone(c.deadline, time.Time); _tmp$1 = true; time.Time.copy(deadline, _tmp); ok = _tmp$1; return [deadline, ok]; }; timerCtx.prototype.Deadline = function() { return this.$val.Deadline(); }; timerCtx.ptr.prototype.String = function() { var $24r, _r, _r$1, _r$2, _r$3, c, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; c = $f.c; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r = contextName(c.cancelCtx.Context); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = $clone(c.deadline, time.Time).String(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = time.Until($clone(c.deadline, time.Time)); /* */ $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.String(); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = _r + ".WithDeadline(" + _r$1 + " [" + _r$3 + "])"; $s = 5; case 5: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: timerCtx.ptr.prototype.String }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.c = c; $f.$s = $s; $f.$r = $r; return $f; }; timerCtx.prototype.String = function() { return this.$val.String(); }; timerCtx.ptr.prototype.cancel = function(removeFromParent, err) { var c, err, removeFromParent, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; c = $f.c; err = $f.err; removeFromParent = $f.removeFromParent; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; $r = c.cancelCtx.cancel(false, err); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (removeFromParent) { $s = 2; continue; } /* */ $s = 3; continue; /* if (removeFromParent) { */ case 2: $r = removeChild(c.cancelCtx.Context, c); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: $r = c.cancelCtx.mu.Lock(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (!(c.timer === ptrType$5.nil)) { c.timer.Stop(); c.timer = ptrType$5.nil; } $r = c.cancelCtx.mu.Unlock(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: timerCtx.ptr.prototype.cancel }; } $f.c = c; $f.err = err; $f.removeFromParent = removeFromParent; $f.$s = $s; $f.$r = $r; return $f; }; timerCtx.prototype.cancel = function(removeFromParent, err) { return this.$val.cancel(removeFromParent, err); }; WithTimeout = function(parent, timeout) { var $24r, _arg, _arg$1, _r, _r$1, _r$2, parent, timeout, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; parent = $f.parent; timeout = $f.timeout; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _arg = parent; _r = time.Now(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = $clone(_r, time.Time).Add(timeout); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$1 = $clone(_r$1, time.Time); _r$2 = WithDeadline(_arg, _arg$1); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 4; case 4: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: WithTimeout }; } $f.$24r = $24r; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.parent = parent; $f.timeout = timeout; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.WithTimeout = WithTimeout; WithValue = function(parent, key, val) { var _r, key, parent, val, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; key = $f.key; parent = $f.parent; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if ($interfaceIsEqual(parent, $ifaceNil)) { $panic(new $String("cannot create context from nil parent")); } if ($interfaceIsEqual(key, $ifaceNil)) { $panic(new $String("nil key")); } _r = reflectlite.TypeOf(key).Comparable(); /* */ $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: $panic(new $String("key is not comparable")); /* } */ case 2: $s = -1; return new valueCtx.ptr(parent, key, val); /* */ } return; } if ($f === undefined) { $f = { $blk: WithValue }; } $f._r = _r; $f.key = key; $f.parent = parent; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.WithValue = WithValue; stringify = function(v) { var $24r, _r, _ref, s, s$1, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _ref = $f._ref; s = $f.s; s$1 = $f.s$1; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _ref = v; /* */ if ($assertType(_ref, stringer, true)[1]) { $s = 1; continue; } /* */ if ($assertType(_ref, $String, true)[1]) { $s = 2; continue; } /* */ $s = 3; continue; /* if ($assertType(_ref, stringer, true)[1]) { */ case 1: s = _ref; _r = s.String(); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 5; case 5: return $24r; /* } else if ($assertType(_ref, $String, true)[1]) { */ case 2: s$1 = _ref.$val; $s = -1; return s$1; /* } */ case 3: $s = -1; return ""; /* */ } return; } if ($f === undefined) { $f = { $blk: stringify }; } $f.$24r = $24r; $f._r = _r; $f._ref = _ref; $f.s = s; $f.s$1 = s$1; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; valueCtx.ptr.prototype.String = function() { var $24r, _r, _r$1, _r$2, c, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; c = $f.c; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r = contextName(c.Context); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = reflectlite.TypeOf(c.key).String(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = stringify(c.val); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r + ".WithValue(type " + _r$1 + ", val " + _r$2 + ")"; $s = 4; case 4: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: valueCtx.ptr.prototype.String }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.c = c; $f.$s = $s; $f.$r = $r; return $f; }; valueCtx.prototype.String = function() { return this.$val.String(); }; valueCtx.ptr.prototype.Value = function(key) { var $24r, _r, c, key, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; c = $f.c; key = $f.key; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if ($interfaceIsEqual(c.key, key)) { $s = -1; return c.val; } _r = c.Context.Value(key); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: valueCtx.ptr.prototype.Value }; } $f.$24r = $24r; $f._r = _r; $f.c = c; $f.key = key; $f.$s = $s; $f.$r = $r; return $f; }; valueCtx.prototype.Value = function(key) { return this.$val.Value(key); }; deadlineExceededError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Temporary", name: "Temporary", pkg: "", typ: $funcType([], [$Bool], false)}]; ptrType.methods = [{prop: "Deadline", name: "Deadline", pkg: "", typ: $funcType([], [time.Time, $Bool], false)}, {prop: "Done", name: "Done", pkg: "", typ: $funcType([], [chanType$1], false)}, {prop: "Err", name: "Err", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Value", name: "Value", pkg: "", typ: $funcType([$emptyInterface], [$emptyInterface], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$3.methods = [{prop: "Value", name: "Value", pkg: "", typ: $funcType([$emptyInterface], [$emptyInterface], false)}, {prop: "Done", name: "Done", pkg: "", typ: $funcType([], [chanType$1], false)}, {prop: "Err", name: "Err", pkg: "", typ: $funcType([], [$error], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "cancel", name: "cancel", pkg: "context", typ: $funcType([$Bool, $error], [], false)}]; ptrType$6.methods = [{prop: "Deadline", name: "Deadline", pkg: "", typ: $funcType([], [time.Time, $Bool], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "cancel", name: "cancel", pkg: "context", typ: $funcType([$Bool, $error], [], false)}]; ptrType$7.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Value", name: "Value", pkg: "", typ: $funcType([$emptyInterface], [$emptyInterface], false)}]; Context.init([{prop: "Deadline", name: "Deadline", pkg: "", typ: $funcType([], [time.Time, $Bool], false)}, {prop: "Done", name: "Done", pkg: "", typ: $funcType([], [chanType$1], false)}, {prop: "Err", name: "Err", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Value", name: "Value", pkg: "", typ: $funcType([$emptyInterface], [$emptyInterface], false)}]); deadlineExceededError.init("", []); CancelFunc.init([], [], false); canceler.init([{prop: "Done", name: "Done", pkg: "", typ: $funcType([], [chanType$1], false)}, {prop: "cancel", name: "cancel", pkg: "context", typ: $funcType([$Bool, $error], [], false)}]); cancelCtx.init("context", [{prop: "Context", name: "Context", embedded: true, exported: true, typ: Context, tag: ""}, {prop: "mu", name: "mu", embedded: false, exported: false, typ: sync.Mutex, tag: ""}, {prop: "done", name: "done", embedded: false, exported: false, typ: atomic.Value, tag: ""}, {prop: "children", name: "children", embedded: false, exported: false, typ: mapType, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}]); stringer.init([{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]); timerCtx.init("context", [{prop: "cancelCtx", name: "cancelCtx", embedded: true, exported: false, typ: cancelCtx, tag: ""}, {prop: "timer", name: "timer", embedded: false, exported: false, typ: ptrType$5, tag: ""}, {prop: "deadline", name: "deadline", embedded: false, exported: false, typ: time.Time, tag: ""}]); valueCtx.init("context", [{prop: "Context", name: "Context", embedded: true, exported: true, typ: Context, tag: ""}, {prop: "key", name: "key", embedded: false, exported: false, typ: $emptyInterface, tag: ""}, {prop: "val", name: "val", embedded: false, exported: false, typ: $emptyInterface, 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 = reflectlite.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sync.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = atomic.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = time.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } goroutines = 0; cancelCtxKey = 0; $pkg.Canceled = errors.New("context canceled"); $pkg.DeadlineExceeded = (x = new deadlineExceededError.ptr(), new x.constructor.elem(x)); background = $newDataPointer(0, ptrType); todo = $newDataPointer(0, ptrType); closedchan = new $Chan(structType, 0); init(); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["internal/nettrace"] = (function() { var $pkg = {}, $init, TraceKey, LookupIPAltResolverKey, Trace, funcType, sliceType, funcType$1, funcType$2, funcType$3; TraceKey = $pkg.TraceKey = $newType(0, $kindStruct, "nettrace.TraceKey", true, "internal/nettrace", true, function() { this.$val = this; if (arguments.length === 0) { return; } }); LookupIPAltResolverKey = $pkg.LookupIPAltResolverKey = $newType(0, $kindStruct, "nettrace.LookupIPAltResolverKey", true, "internal/nettrace", true, function() { this.$val = this; if (arguments.length === 0) { return; } }); Trace = $pkg.Trace = $newType(0, $kindStruct, "nettrace.Trace", true, "internal/nettrace", true, function(DNSStart_, DNSDone_, ConnectStart_, ConnectDone_) { this.$val = this; if (arguments.length === 0) { this.DNSStart = $throwNilPointerError; this.DNSDone = $throwNilPointerError; this.ConnectStart = $throwNilPointerError; this.ConnectDone = $throwNilPointerError; return; } this.DNSStart = DNSStart_; this.DNSDone = DNSDone_; this.ConnectStart = ConnectStart_; this.ConnectDone = ConnectDone_; }); funcType = $funcType([$String], [], false); sliceType = $sliceType($emptyInterface); funcType$1 = $funcType([sliceType, $Bool, $error], [], false); funcType$2 = $funcType([$String, $String], [], false); funcType$3 = $funcType([$String, $String, $error], [], false); TraceKey.init("", []); LookupIPAltResolverKey.init("", []); Trace.init("", [{prop: "DNSStart", name: "DNSStart", embedded: false, exported: true, typ: funcType, tag: ""}, {prop: "DNSDone", name: "DNSDone", embedded: false, exported: true, typ: funcType$1, tag: ""}, {prop: "ConnectStart", name: "ConnectStart", embedded: false, exported: true, typ: funcType$2, tag: ""}, {prop: "ConnectDone", name: "ConnectDone", embedded: false, exported: true, typ: funcType$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: /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["internal/singleflight"] = (function() { var $pkg = {}, $init, sync, call, Group, Result, ptrType, arrayType, chanType, sliceType, funcType, chanType$1, ptrType$1, mapType; sync = $packages["sync"]; call = $pkg.call = $newType(0, $kindStruct, "singleflight.call", true, "internal/singleflight", false, function(wg_, val_, err_, dups_, chans_) { this.$val = this; if (arguments.length === 0) { this.wg = new sync.WaitGroup.ptr(0, $chanNil, arrayType.zero()); this.val = $ifaceNil; this.err = $ifaceNil; this.dups = 0; this.chans = sliceType.nil; return; } this.wg = wg_; this.val = val_; this.err = err_; this.dups = dups_; this.chans = chans_; }); Group = $pkg.Group = $newType(0, $kindStruct, "singleflight.Group", true, "internal/singleflight", true, function(mu_, m_) { this.$val = this; if (arguments.length === 0) { this.mu = new sync.Mutex.ptr(0, 0); this.m = false; return; } this.mu = mu_; this.m = m_; }); Result = $pkg.Result = $newType(0, $kindStruct, "singleflight.Result", true, "internal/singleflight", true, function(Val_, Err_, Shared_) { this.$val = this; if (arguments.length === 0) { this.Val = $ifaceNil; this.Err = $ifaceNil; this.Shared = false; return; } this.Val = Val_; this.Err = Err_; this.Shared = Shared_; }); ptrType = $ptrType(call); arrayType = $arrayType($Uint32, 3); chanType = $chanType(Result, true, false); sliceType = $sliceType(chanType); funcType = $funcType([], [$emptyInterface, $error], false); chanType$1 = $chanType(Result, false, true); ptrType$1 = $ptrType(Group); mapType = $mapType($String, ptrType); Group.ptr.prototype.Do = function(key, fn) { var _entry, _key, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, c, c$1, err, fn, g, key, ok, shared, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _key = $f._key; _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; c = $f.c; c$1 = $f.c$1; err = $f.err; fn = $f.fn; g = $f.g; key = $f.key; ok = $f.ok; shared = $f.shared; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = $ifaceNil; err = $ifaceNil; shared = false; g = this; $r = g.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (g.m === false) { g.m = {}; } _tuple = (_entry = g.m[$String.keyFor(key)], _entry !== undefined ? [_entry.v, true] : [ptrType.nil, false]); c = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (ok) { */ case 2: c.dups = c.dups + (1) >> 0; $r = g.mu.Unlock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = c.wg.Wait(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp = c.val; _tmp$1 = c.err; _tmp$2 = true; v = _tmp; err = _tmp$1; shared = _tmp$2; $s = -1; return [v, err, shared]; /* } */ case 3: c$1 = new call.ptr(new sync.WaitGroup.ptr(0, $chanNil, arrayType.zero()), $ifaceNil, $ifaceNil, 0, sliceType.nil); c$1.wg.Add(1); _key = key; (g.m || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: c$1 }; $r = g.mu.Unlock(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = g.doCall(c$1, key, fn); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp$3 = c$1.val; _tmp$4 = c$1.err; _tmp$5 = c$1.dups > 0; v = _tmp$3; err = _tmp$4; shared = _tmp$5; $s = -1; return [v, err, shared]; /* */ } return; } if ($f === undefined) { $f = { $blk: Group.ptr.prototype.Do }; } $f._entry = _entry; $f._key = _key; $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.c = c; $f.c$1 = c$1; $f.err = err; $f.fn = fn; $f.g = g; $f.key = key; $f.ok = ok; $f.shared = shared; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Group.prototype.Do = function(key, fn) { return this.$val.Do(key, fn); }; Group.ptr.prototype.DoChan = function(key, fn) { var _entry, _key, _tuple, c, c$1, ch, fn, g, key, ok, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _key = $f._key; _tuple = $f._tuple; c = $f.c; c$1 = $f.c$1; ch = $f.ch; fn = $f.fn; g = $f.g; key = $f.key; ok = $f.ok; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: g = this; ch = new $Chan(Result, 1); $r = g.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (g.m === false) { g.m = {}; } _tuple = (_entry = g.m[$String.keyFor(key)], _entry !== undefined ? [_entry.v, true] : [ptrType.nil, false]); c = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (ok) { */ case 2: c.dups = c.dups + (1) >> 0; c.chans = $append(c.chans, ch); $r = g.mu.Unlock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return [ch, false]; /* } */ case 3: c$1 = new call.ptr(new sync.WaitGroup.ptr(0, $chanNil, arrayType.zero()), $ifaceNil, $ifaceNil, 0, new sliceType([ch])); c$1.wg.Add(1); _key = key; (g.m || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: c$1 }; $r = g.mu.Unlock(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $go($methodVal(g, "doCall"), [c$1, key, fn]); $s = -1; return [ch, true]; /* */ } return; } if ($f === undefined) { $f = { $blk: Group.ptr.prototype.DoChan }; } $f._entry = _entry; $f._key = _key; $f._tuple = _tuple; $f.c = c; $f.c$1 = c$1; $f.ch = ch; $f.fn = fn; $f.g = g; $f.key = key; $f.ok = ok; $f.$s = $s; $f.$r = $r; return $f; }; Group.prototype.DoChan = function(key, fn) { return this.$val.DoChan(key, fn); }; Group.ptr.prototype.doCall = function(c, key, fn) { var _i, _r, _ref, _tuple, c, ch, fn, g, key, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _ref = $f._ref; _tuple = $f._tuple; c = $f.c; ch = $f.ch; fn = $f.fn; g = $f.g; key = $f.key; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: g = this; _r = fn(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; c.val = _tuple[0]; c.err = _tuple[1]; c.wg.Done(); $r = g.mu.Lock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } delete g.m[$String.keyFor(key)]; _ref = c.chans; _i = 0; /* while (true) { */ case 3: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 4; continue; } ch = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); $r = $send(ch, $clone(new Result.ptr(c.val, c.err, c.dups > 0), Result)); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i++; $s = 3; continue; case 4: $r = g.mu.Unlock(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Group.ptr.prototype.doCall }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f._tuple = _tuple; $f.c = c; $f.ch = ch; $f.fn = fn; $f.g = g; $f.key = key; $f.$s = $s; $f.$r = $r; return $f; }; Group.prototype.doCall = function(c, key, fn) { return this.$val.doCall(c, key, fn); }; Group.ptr.prototype.ForgetUnshared = function(key) { var $24r, $24r$1, $24r$2, _entry, _tuple, c, g, key, ok, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _entry = $f._entry; _tuple = $f._tuple; c = $f.c; g = $f.g; key = $f.key; ok = $f.ok; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); g = this; $r = g.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(g.mu, "Unlock"), []]); _tuple = (_entry = g.m[$String.keyFor(key)], _entry !== undefined ? [_entry.v, true] : [ptrType.nil, false]); c = _tuple[0]; ok = _tuple[1]; /* */ if (!ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!ok) { */ case 2: $24r = true; $s = 4; case 4: return $24r; /* } */ case 3: /* */ if (c.dups === 0) { $s = 5; continue; } /* */ $s = 6; continue; /* if (c.dups === 0) { */ case 5: delete g.m[$String.keyFor(key)]; $24r$1 = true; $s = 7; case 7: return $24r$1; /* } */ case 6: $24r$2 = false; $s = 8; case 8: return $24r$2; /* */ } return; } } catch(err) { $err = err; $s = -1; return false; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Group.ptr.prototype.ForgetUnshared }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._entry = _entry; $f._tuple = _tuple; $f.c = c; $f.g = g; $f.key = key; $f.ok = ok; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Group.prototype.ForgetUnshared = function(key) { return this.$val.ForgetUnshared(key); }; ptrType$1.methods = [{prop: "Do", name: "Do", pkg: "", typ: $funcType([$String, funcType], [$emptyInterface, $error, $Bool], false)}, {prop: "DoChan", name: "DoChan", pkg: "", typ: $funcType([$String, funcType], [chanType$1, $Bool], false)}, {prop: "doCall", name: "doCall", pkg: "internal/singleflight", typ: $funcType([ptrType, $String, funcType], [], false)}, {prop: "ForgetUnshared", name: "ForgetUnshared", pkg: "", typ: $funcType([$String], [$Bool], false)}]; call.init("internal/singleflight", [{prop: "wg", name: "wg", embedded: false, exported: false, typ: sync.WaitGroup, tag: ""}, {prop: "val", name: "val", embedded: false, exported: false, typ: $emptyInterface, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "dups", name: "dups", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "chans", name: "chans", embedded: false, exported: false, typ: sliceType, tag: ""}]); Group.init("internal/singleflight", [{prop: "mu", name: "mu", embedded: false, exported: false, typ: sync.Mutex, tag: ""}, {prop: "m", name: "m", embedded: false, exported: false, typ: mapType, tag: ""}]); Result.init("", [{prop: "Val", name: "Val", embedded: false, exported: true, typ: $emptyInterface, tag: ""}, {prop: "Err", name: "Err", embedded: false, exported: true, typ: $error, tag: ""}, {prop: "Shared", name: "Shared", embedded: false, exported: true, 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 = sync.$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["vendor/golang.org/x/net/dns/dnsmessage"] = (function() { var $pkg = {}, $init, errors, Type, Class, OpCode, RCode, nestedError, Header, section, header, Resource, ResourceBody, Parser, Builder, ResourceHeader, Name, Question, CNAMEResource, MXResource, NSResource, PTRResource, SOAResource, TXTResource, SRVResource, AResource, AAAAResource, OPTResource, Option, UnknownResource, sliceType, arrayType, sliceType$1, sliceType$2, sliceType$3, arrayType$1, arrayType$2, sliceType$4, arrayType$3, ptrType, ptrType$1, ptrType$2, ptrType$4, mapType, ptrType$5, ptrType$6, ptrType$7, ptrType$8, ptrType$9, ptrType$10, ptrType$11, ptrType$12, ptrType$13, ptrType$14, ptrType$15, ptrType$16, ptrType$17, ptrType$18, ptrType$19, ptrType$20, ptrType$21, ptrType$22, typeNames, classNames, rCodeNames, errBaseLen, errCalcLen, errReserved, errTooManyPtr, errInvalidPtr, errNilResouceBody, errResourceLen, errSegTooLong, errZeroSegLen, errResTooLong, errTooManyQuestions, errTooManyAnswers, errTooManyAuthorities, errTooManyAdditionals, errNonCanonicalName, errStringTooLong, errCompressedSRV, sectionNames, printUint8Bytes, printByteSlice, printString, printUint16, printUint32, printBool, NewBuilder, skipResource, packUint16, unpackUint16, skipUint16, packType, unpackType, skipType, packClass, unpackClass, skipClass, packUint32, unpackUint32, skipUint32, packText, unpackText, packBytes, unpackBytes, NewName, skipName, unpackResourceBody, unpackCNAMEResource, unpackMXResource, unpackNSResource, unpackPTRResource, unpackSOAResource, unpackTXTResource, unpackSRVResource, unpackAResource, unpackAAAAResource, unpackOPTResource, unpackUnknownResource; errors = $packages["errors"]; Type = $pkg.Type = $newType(2, $kindUint16, "dnsmessage.Type", true, "vendor/golang.org/x/net/dns/dnsmessage", true, null); Class = $pkg.Class = $newType(2, $kindUint16, "dnsmessage.Class", true, "vendor/golang.org/x/net/dns/dnsmessage", true, null); OpCode = $pkg.OpCode = $newType(2, $kindUint16, "dnsmessage.OpCode", true, "vendor/golang.org/x/net/dns/dnsmessage", true, null); RCode = $pkg.RCode = $newType(2, $kindUint16, "dnsmessage.RCode", true, "vendor/golang.org/x/net/dns/dnsmessage", true, null); nestedError = $pkg.nestedError = $newType(0, $kindStruct, "dnsmessage.nestedError", true, "vendor/golang.org/x/net/dns/dnsmessage", false, function(s_, err_) { this.$val = this; if (arguments.length === 0) { this.s = ""; this.err = $ifaceNil; return; } this.s = s_; this.err = err_; }); Header = $pkg.Header = $newType(0, $kindStruct, "dnsmessage.Header", true, "vendor/golang.org/x/net/dns/dnsmessage", true, function(ID_, Response_, OpCode_, Authoritative_, Truncated_, RecursionDesired_, RecursionAvailable_, RCode_) { this.$val = this; if (arguments.length === 0) { this.ID = 0; this.Response = false; this.OpCode = 0; this.Authoritative = false; this.Truncated = false; this.RecursionDesired = false; this.RecursionAvailable = false; this.RCode = 0; return; } this.ID = ID_; this.Response = Response_; this.OpCode = OpCode_; this.Authoritative = Authoritative_; this.Truncated = Truncated_; this.RecursionDesired = RecursionDesired_; this.RecursionAvailable = RecursionAvailable_; this.RCode = RCode_; }); section = $pkg.section = $newType(1, $kindUint8, "dnsmessage.section", true, "vendor/golang.org/x/net/dns/dnsmessage", false, null); header = $pkg.header = $newType(0, $kindStruct, "dnsmessage.header", true, "vendor/golang.org/x/net/dns/dnsmessage", false, function(id_, bits_, questions_, answers_, authorities_, additionals_) { this.$val = this; if (arguments.length === 0) { this.id = 0; this.bits = 0; this.questions = 0; this.answers = 0; this.authorities = 0; this.additionals = 0; return; } this.id = id_; this.bits = bits_; this.questions = questions_; this.answers = answers_; this.authorities = authorities_; this.additionals = additionals_; }); Resource = $pkg.Resource = $newType(0, $kindStruct, "dnsmessage.Resource", true, "vendor/golang.org/x/net/dns/dnsmessage", true, function(Header_, Body_) { this.$val = this; if (arguments.length === 0) { this.Header = new ResourceHeader.ptr(new Name.ptr(arrayType.zero(), 0), 0, 0, 0, 0); this.Body = $ifaceNil; return; } this.Header = Header_; this.Body = Body_; }); ResourceBody = $pkg.ResourceBody = $newType(8, $kindInterface, "dnsmessage.ResourceBody", true, "vendor/golang.org/x/net/dns/dnsmessage", true, null); Parser = $pkg.Parser = $newType(0, $kindStruct, "dnsmessage.Parser", true, "vendor/golang.org/x/net/dns/dnsmessage", true, function(msg_, header_, section_, off_, index_, resHeaderValid_, resHeader_) { this.$val = this; if (arguments.length === 0) { this.msg = sliceType.nil; this.header = new header.ptr(0, 0, 0, 0, 0, 0); this.section = 0; this.off = 0; this.index = 0; this.resHeaderValid = false; this.resHeader = new ResourceHeader.ptr(new Name.ptr(arrayType.zero(), 0), 0, 0, 0, 0); return; } this.msg = msg_; this.header = header_; this.section = section_; this.off = off_; this.index = index_; this.resHeaderValid = resHeaderValid_; this.resHeader = resHeader_; }); Builder = $pkg.Builder = $newType(0, $kindStruct, "dnsmessage.Builder", true, "vendor/golang.org/x/net/dns/dnsmessage", true, function(msg_, section_, header_, start_, compression_) { this.$val = this; if (arguments.length === 0) { this.msg = sliceType.nil; this.section = 0; this.header = new header.ptr(0, 0, 0, 0, 0, 0); this.start = 0; this.compression = false; return; } this.msg = msg_; this.section = section_; this.header = header_; this.start = start_; this.compression = compression_; }); ResourceHeader = $pkg.ResourceHeader = $newType(0, $kindStruct, "dnsmessage.ResourceHeader", true, "vendor/golang.org/x/net/dns/dnsmessage", true, function(Name_, Type_, Class_, TTL_, Length_) { this.$val = this; if (arguments.length === 0) { this.Name = new Name.ptr(arrayType.zero(), 0); this.Type = 0; this.Class = 0; this.TTL = 0; this.Length = 0; return; } this.Name = Name_; this.Type = Type_; this.Class = Class_; this.TTL = TTL_; this.Length = Length_; }); Name = $pkg.Name = $newType(0, $kindStruct, "dnsmessage.Name", true, "vendor/golang.org/x/net/dns/dnsmessage", true, function(Data_, Length_) { this.$val = this; if (arguments.length === 0) { this.Data = arrayType.zero(); this.Length = 0; return; } this.Data = Data_; this.Length = Length_; }); Question = $pkg.Question = $newType(0, $kindStruct, "dnsmessage.Question", true, "vendor/golang.org/x/net/dns/dnsmessage", true, function(Name_, Type_, Class_) { this.$val = this; if (arguments.length === 0) { this.Name = new Name.ptr(arrayType.zero(), 0); this.Type = 0; this.Class = 0; return; } this.Name = Name_; this.Type = Type_; this.Class = Class_; }); CNAMEResource = $pkg.CNAMEResource = $newType(0, $kindStruct, "dnsmessage.CNAMEResource", true, "vendor/golang.org/x/net/dns/dnsmessage", true, function(CNAME_) { this.$val = this; if (arguments.length === 0) { this.CNAME = new Name.ptr(arrayType.zero(), 0); return; } this.CNAME = CNAME_; }); MXResource = $pkg.MXResource = $newType(0, $kindStruct, "dnsmessage.MXResource", true, "vendor/golang.org/x/net/dns/dnsmessage", true, function(Pref_, MX_) { this.$val = this; if (arguments.length === 0) { this.Pref = 0; this.MX = new Name.ptr(arrayType.zero(), 0); return; } this.Pref = Pref_; this.MX = MX_; }); NSResource = $pkg.NSResource = $newType(0, $kindStruct, "dnsmessage.NSResource", true, "vendor/golang.org/x/net/dns/dnsmessage", true, function(NS_) { this.$val = this; if (arguments.length === 0) { this.NS = new Name.ptr(arrayType.zero(), 0); return; } this.NS = NS_; }); PTRResource = $pkg.PTRResource = $newType(0, $kindStruct, "dnsmessage.PTRResource", true, "vendor/golang.org/x/net/dns/dnsmessage", true, function(PTR_) { this.$val = this; if (arguments.length === 0) { this.PTR = new Name.ptr(arrayType.zero(), 0); return; } this.PTR = PTR_; }); SOAResource = $pkg.SOAResource = $newType(0, $kindStruct, "dnsmessage.SOAResource", true, "vendor/golang.org/x/net/dns/dnsmessage", true, function(NS_, MBox_, Serial_, Refresh_, Retry_, Expire_, MinTTL_) { this.$val = this; if (arguments.length === 0) { this.NS = new Name.ptr(arrayType.zero(), 0); this.MBox = new Name.ptr(arrayType.zero(), 0); this.Serial = 0; this.Refresh = 0; this.Retry = 0; this.Expire = 0; this.MinTTL = 0; return; } this.NS = NS_; this.MBox = MBox_; this.Serial = Serial_; this.Refresh = Refresh_; this.Retry = Retry_; this.Expire = Expire_; this.MinTTL = MinTTL_; }); TXTResource = $pkg.TXTResource = $newType(0, $kindStruct, "dnsmessage.TXTResource", true, "vendor/golang.org/x/net/dns/dnsmessage", true, function(TXT_) { this.$val = this; if (arguments.length === 0) { this.TXT = sliceType$3.nil; return; } this.TXT = TXT_; }); SRVResource = $pkg.SRVResource = $newType(0, $kindStruct, "dnsmessage.SRVResource", true, "vendor/golang.org/x/net/dns/dnsmessage", true, function(Priority_, Weight_, Port_, Target_) { this.$val = this; if (arguments.length === 0) { this.Priority = 0; this.Weight = 0; this.Port = 0; this.Target = new Name.ptr(arrayType.zero(), 0); return; } this.Priority = Priority_; this.Weight = Weight_; this.Port = Port_; this.Target = Target_; }); AResource = $pkg.AResource = $newType(0, $kindStruct, "dnsmessage.AResource", true, "vendor/golang.org/x/net/dns/dnsmessage", true, function(A_) { this.$val = this; if (arguments.length === 0) { this.A = arrayType$1.zero(); return; } this.A = A_; }); AAAAResource = $pkg.AAAAResource = $newType(0, $kindStruct, "dnsmessage.AAAAResource", true, "vendor/golang.org/x/net/dns/dnsmessage", true, function(AAAA_) { this.$val = this; if (arguments.length === 0) { this.AAAA = arrayType$2.zero(); return; } this.AAAA = AAAA_; }); OPTResource = $pkg.OPTResource = $newType(0, $kindStruct, "dnsmessage.OPTResource", true, "vendor/golang.org/x/net/dns/dnsmessage", true, function(Options_) { this.$val = this; if (arguments.length === 0) { this.Options = sliceType$4.nil; return; } this.Options = Options_; }); Option = $pkg.Option = $newType(0, $kindStruct, "dnsmessage.Option", true, "vendor/golang.org/x/net/dns/dnsmessage", true, function(Code_, Data_) { this.$val = this; if (arguments.length === 0) { this.Code = 0; this.Data = sliceType.nil; return; } this.Code = Code_; this.Data = Data_; }); UnknownResource = $pkg.UnknownResource = $newType(0, $kindStruct, "dnsmessage.UnknownResource", true, "vendor/golang.org/x/net/dns/dnsmessage", true, function(Type_, Data_) { this.$val = this; if (arguments.length === 0) { this.Type = 0; this.Data = sliceType.nil; return; } this.Type = Type_; this.Data = Data_; }); sliceType = $sliceType($Uint8); arrayType = $arrayType($Uint8, 255); sliceType$1 = $sliceType(Question); sliceType$2 = $sliceType(Resource); sliceType$3 = $sliceType($String); arrayType$1 = $arrayType($Uint8, 4); arrayType$2 = $arrayType($Uint8, 16); sliceType$4 = $sliceType(Option); arrayType$3 = $arrayType($Uint8, 12); ptrType = $ptrType($Uint16); ptrType$1 = $ptrType(nestedError); ptrType$2 = $ptrType(Header); ptrType$4 = $ptrType(header); mapType = $mapType($String, $Int); ptrType$5 = $ptrType(Resource); ptrType$6 = $ptrType(Parser); ptrType$7 = $ptrType(Builder); ptrType$8 = $ptrType(ResourceHeader); ptrType$9 = $ptrType(Name); ptrType$10 = $ptrType(Question); ptrType$11 = $ptrType(CNAMEResource); ptrType$12 = $ptrType(MXResource); ptrType$13 = $ptrType(NSResource); ptrType$14 = $ptrType(PTRResource); ptrType$15 = $ptrType(SOAResource); ptrType$16 = $ptrType(TXTResource); ptrType$17 = $ptrType(SRVResource); ptrType$18 = $ptrType(AResource); ptrType$19 = $ptrType(AAAAResource); ptrType$20 = $ptrType(OPTResource); ptrType$21 = $ptrType(Option); ptrType$22 = $ptrType(UnknownResource); Type.prototype.String = function() { var _entry, _tuple, n, ok, t; t = this.$val; _tuple = (_entry = typeNames[Type.keyFor(t)], _entry !== undefined ? [_entry.v, true] : ["", false]); n = _tuple[0]; ok = _tuple[1]; if (ok) { return n; } return printUint16(((t << 16 >>> 16))); }; $ptrType(Type).prototype.String = function() { return new Type(this.$get()).String(); }; Type.prototype.GoString = function() { var _entry, _tuple, n, ok, t; t = this.$val; _tuple = (_entry = typeNames[Type.keyFor(t)], _entry !== undefined ? [_entry.v, true] : ["", false]); n = _tuple[0]; ok = _tuple[1]; if (ok) { return "dnsmessage." + n; } return printUint16(((t << 16 >>> 16))); }; $ptrType(Type).prototype.GoString = function() { return new Type(this.$get()).GoString(); }; Class.prototype.String = function() { var _entry, _tuple, c, n, ok; c = this.$val; _tuple = (_entry = classNames[Class.keyFor(c)], _entry !== undefined ? [_entry.v, true] : ["", false]); n = _tuple[0]; ok = _tuple[1]; if (ok) { return n; } return printUint16(((c << 16 >>> 16))); }; $ptrType(Class).prototype.String = function() { return new Class(this.$get()).String(); }; Class.prototype.GoString = function() { var _entry, _tuple, c, n, ok; c = this.$val; _tuple = (_entry = classNames[Class.keyFor(c)], _entry !== undefined ? [_entry.v, true] : ["", false]); n = _tuple[0]; ok = _tuple[1]; if (ok) { return "dnsmessage." + n; } return printUint16(((c << 16 >>> 16))); }; $ptrType(Class).prototype.GoString = function() { return new Class(this.$get()).GoString(); }; OpCode.prototype.GoString = function() { var o; o = this.$val; return printUint16(((o << 16 >>> 16))); }; $ptrType(OpCode).prototype.GoString = function() { return new OpCode(this.$get()).GoString(); }; RCode.prototype.String = function() { var _entry, _tuple, n, ok, r; r = this.$val; _tuple = (_entry = rCodeNames[RCode.keyFor(r)], _entry !== undefined ? [_entry.v, true] : ["", false]); n = _tuple[0]; ok = _tuple[1]; if (ok) { return n; } return printUint16(((r << 16 >>> 16))); }; $ptrType(RCode).prototype.String = function() { return new RCode(this.$get()).String(); }; RCode.prototype.GoString = function() { var _entry, _tuple, n, ok, r; r = this.$val; _tuple = (_entry = rCodeNames[RCode.keyFor(r)], _entry !== undefined ? [_entry.v, true] : ["", false]); n = _tuple[0]; ok = _tuple[1]; if (ok) { return "dnsmessage." + n; } return printUint16(((r << 16 >>> 16))); }; $ptrType(RCode).prototype.GoString = function() { return new RCode(this.$get()).GoString(); }; printUint8Bytes = function(buf, i) { var _q, _q$1, _r, _r$1, b, buf, i; b = (i); if (i >= 100) { buf = $append(buf, (_q = b / 100, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")) + 48 << 24 >>> 24); } if (i >= 10) { buf = $append(buf, (_r = (_q$1 = b / 10, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >>> 0 : $throwRuntimeError("integer divide by zero")) % 10, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) + 48 << 24 >>> 24); } return $append(buf, (_r$1 = b % 10, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) + 48 << 24 >>> 24); }; printByteSlice = function(b) { var _i, _ref, b, buf, n; if (b.$length === 0) { return ""; } buf = $makeSlice(sliceType, 0, ($imul(5, b.$length))); buf = printUint8Bytes(buf, ((0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))); _ref = $subslice(b, 1); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } n = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); buf = $append(buf, 44, 32); buf = printUint8Bytes(buf, (n)); _i++; } return ($bytesToString(buf)); }; printString = function(str) { var buf, c, i, lower, str, upper; buf = $makeSlice(sliceType, 0, str.$length); i = 0; while (true) { if (!(i < str.$length)) { break; } c = ((i < 0 || i >= str.$length) ? ($throwRuntimeError("index out of range"), undefined) : str.$array[str.$offset + i]); if ((c === 46) || (c === 45) || (c === 32) || 65 <= c && c <= 90 || 97 <= c && c <= 122 || 48 <= c && c <= 57) { buf = $append(buf, c); i = i + (1) >> 0; continue; } upper = c >>> 4 << 24 >>> 24; lower = ((c << 4 << 24 >>> 24)) >>> 4 << 24 >>> 24; buf = $append(buf, 92, 120, "0123456789abcdef".charCodeAt(upper), "0123456789abcdef".charCodeAt(lower)); i = i + (1) >> 0; } return ($bytesToString(buf)); }; printUint16 = function(i) { var i; return printUint32(((i >>> 0))); }; printUint32 = function(i) { var _q, _q$1, _r, _r$1, _tmp, _tmp$1, b, buf, d, i; buf = $makeSlice(sliceType, 10); _tmp = buf; _tmp$1 = 1000000000; b = _tmp; d = _tmp$1; while (true) { if (!(d > 0)) { break; } (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0] = ((((_r = (_q = i / d, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")) % 10, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) + 48 >>> 0) << 24 >>> 24))); if (((0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]) === 48) && (b.$length === buf.$length) && buf.$length > 1) { buf = $subslice(buf, 1); } b = $subslice(b, 1); i = (_r$1 = i % (d), _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")); d = (_q$1 = d / (10), (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >>> 0 : $throwRuntimeError("integer divide by zero")); } return ($bytesToString(buf)); }; printBool = function(b) { var b; if (b) { return "true"; } return "false"; }; nestedError.ptr.prototype.Error = function() { var $24r, _r, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; } $24r = e.s + ": " + _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: nestedError.ptr.prototype.Error }; } $f.$24r = $24r; $f._r = _r; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; nestedError.prototype.Error = function() { return this.$val.Error(); }; Header.ptr.prototype.pack = function() { var bits, id, m; id = 0; bits = 0; m = this; id = m.ID; bits = ((((m.OpCode << 16 >>> 16)) << 11 << 16 >>> 16) | ((m.RCode << 16 >>> 16))) >>> 0; if (m.RecursionAvailable) { bits = (bits | (128)) >>> 0; } if (m.RecursionDesired) { bits = (bits | (256)) >>> 0; } if (m.Truncated) { bits = (bits | (512)) >>> 0; } if (m.Authoritative) { bits = (bits | (1024)) >>> 0; } if (m.Response) { bits = (bits | (32768)) >>> 0; } return [id, bits]; }; Header.prototype.pack = function() { return this.$val.pack(); }; Header.ptr.prototype.GoString = function() { var m; m = this; return "dnsmessage.Header{ID: " + printUint16(m.ID) + ", " + "Response: " + printBool(m.Response) + ", " + "OpCode: " + new OpCode(m.OpCode).GoString() + ", " + "Authoritative: " + printBool(m.Authoritative) + ", " + "Truncated: " + printBool(m.Truncated) + ", " + "RecursionDesired: " + printBool(m.RecursionDesired) + ", " + "RecursionAvailable: " + printBool(m.RecursionAvailable) + ", " + "RCode: " + new RCode(m.RCode).GoString() + "}"; }; Header.prototype.GoString = function() { return this.$val.GoString(); }; header.ptr.prototype.count = function(sec) { var _1, h, sec; h = this; _1 = sec; if (_1 === (2)) { return h.questions; } else if (_1 === (3)) { return h.answers; } else if (_1 === (4)) { return h.authorities; } else if (_1 === (5)) { return h.additionals; } return 0; }; header.prototype.count = function(sec) { return this.$val.count(sec); }; header.ptr.prototype.pack = function(msg) { var h, msg; h = this; msg = packUint16(msg, h.id); msg = packUint16(msg, h.bits); msg = packUint16(msg, h.questions); msg = packUint16(msg, h.answers); msg = packUint16(msg, h.authorities); return packUint16(msg, h.additionals); }; header.prototype.pack = function(msg) { return this.$val.pack(msg); }; header.ptr.prototype.unpack = function(msg, off) { var _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, err, h, msg, newOff, off; h = this; newOff = off; err = $ifaceNil; _tuple = unpackUint16(msg, newOff); h.id = _tuple[0]; newOff = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [off, new nestedError.ptr("id", err)]; } _tuple$1 = unpackUint16(msg, newOff); h.bits = _tuple$1[0]; newOff = _tuple$1[1]; err = _tuple$1[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [off, new nestedError.ptr("bits", err)]; } _tuple$2 = unpackUint16(msg, newOff); h.questions = _tuple$2[0]; newOff = _tuple$2[1]; err = _tuple$2[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [off, new nestedError.ptr("questions", err)]; } _tuple$3 = unpackUint16(msg, newOff); h.answers = _tuple$3[0]; newOff = _tuple$3[1]; err = _tuple$3[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [off, new nestedError.ptr("answers", err)]; } _tuple$4 = unpackUint16(msg, newOff); h.authorities = _tuple$4[0]; newOff = _tuple$4[1]; err = _tuple$4[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [off, new nestedError.ptr("authorities", err)]; } _tuple$5 = unpackUint16(msg, newOff); h.additionals = _tuple$5[0]; newOff = _tuple$5[1]; err = _tuple$5[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [off, new nestedError.ptr("additionals", err)]; } return [newOff, $ifaceNil]; }; header.prototype.unpack = function(msg, off) { return this.$val.unpack(msg, off); }; header.ptr.prototype.header = function() { var h; h = this; return new Header.ptr(h.id, !(((((h.bits & 32768) >>> 0)) === 0)), ((((h.bits >>> 11 << 16 >>> 16) << 16 >>> 16)) & 15) >>> 0, !(((((h.bits & 1024) >>> 0)) === 0)), !(((((h.bits & 512) >>> 0)) === 0)), !(((((h.bits & 256) >>> 0)) === 0)), !(((((h.bits & 128) >>> 0)) === 0)), ((((h.bits & 15) >>> 0) << 16 >>> 16))); }; header.prototype.header = function() { return this.$val.header(); }; Resource.ptr.prototype.GoString = function() { var $24r, _r, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r = r.Body.GoString(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = "dnsmessage.Resource{Header: " + r.Header.GoString() + ", Body: &" + _r + "}"; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Resource.ptr.prototype.GoString }; } $f.$24r = $24r; $f._r = _r; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Resource.prototype.GoString = function() { return this.$val.GoString(); }; Resource.ptr.prototype.pack = function(msg, compression, compressionOff) { var _r, _r$1, _tuple, _tuple$1, compression, compressionOff, err, err$1, lenOff, msg, oldMsg, preLen, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; compression = $f.compression; compressionOff = $f.compressionOff; err = $f.err; err$1 = $f.err$1; lenOff = $f.lenOff; msg = $f.msg; oldMsg = $f.oldMsg; preLen = $f.preLen; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; if ($interfaceIsEqual(r.Body, $ifaceNil)) { $s = -1; return [msg, errNilResouceBody]; } oldMsg = msg; _r = r.Body.realType(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } r.Header.Type = _r; _tuple = r.Header.pack(msg, compression, compressionOff); msg = _tuple[0]; lenOff = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [msg, new nestedError.ptr("ResourceHeader", err)]; } preLen = msg.$length; _r$1 = r.Body.pack(msg, compression, compressionOff); /* */ $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; msg = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [msg, new nestedError.ptr("content", err)]; } err$1 = r.Header.fixLen(msg, lenOff, preLen); if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [oldMsg, err$1]; } $s = -1; return [msg, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Resource.ptr.prototype.pack }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.compression = compression; $f.compressionOff = compressionOff; $f.err = err; $f.err$1 = err$1; $f.lenOff = lenOff; $f.msg = msg; $f.oldMsg = oldMsg; $f.preLen = preLen; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Resource.prototype.pack = function(msg, compression, compressionOff) { return this.$val.pack(msg, compression, compressionOff); }; Parser.ptr.prototype.Start = function(msg) { var _tuple, err, msg, p; p = this; if (!(p.msg === sliceType.nil)) { Parser.copy(p, new Parser.ptr(sliceType.nil, new header.ptr(0, 0, 0, 0, 0, 0), 0, 0, 0, false, new ResourceHeader.ptr(new Name.ptr(arrayType.zero(), 0), 0, 0, 0, 0))); } p.msg = msg; err = $ifaceNil; _tuple = p.header.unpack(msg, 0); p.off = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new Header.ptr(0, false, 0, false, false, false, false, 0), new nestedError.ptr("unpacking header", err)]; } p.section = 2; return [p.header.header(), $ifaceNil]; }; Parser.prototype.Start = function(msg) { return this.$val.Start(msg); }; Parser.ptr.prototype.checkAdvance = function(sec) { var p, sec; p = this; if (p.section < sec) { return $pkg.ErrNotStarted; } if (p.section > sec) { return $pkg.ErrSectionDone; } p.resHeaderValid = false; if (p.index === ((p.header.count(sec) >> 0))) { p.index = 0; p.section = p.section + (1) << 24 >>> 24; return $pkg.ErrSectionDone; } return $ifaceNil; }; Parser.prototype.checkAdvance = function(sec) { return this.$val.checkAdvance(sec); }; Parser.ptr.prototype.resource = function(sec) { var _entry, _tuple, _tuple$1, err, p, r, sec; p = this; r = new Resource.ptr(new ResourceHeader.ptr(new Name.ptr(arrayType.zero(), 0), 0, 0, 0, 0), $ifaceNil); err = $ifaceNil; _tuple = p.resourceHeader(sec); ResourceHeader.copy(r.Header, _tuple[0]); err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [r, err]; } p.resHeaderValid = false; _tuple$1 = unpackResourceBody(p.msg, p.off, $clone(r.Header, ResourceHeader)); r.Body = _tuple$1[0]; p.off = _tuple$1[1]; err = _tuple$1[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new Resource.ptr(new ResourceHeader.ptr(new Name.ptr(arrayType.zero(), 0), 0, 0, 0, 0), $ifaceNil), new nestedError.ptr("unpacking " + (_entry = sectionNames[section.keyFor(sec)], _entry !== undefined ? _entry.v : ""), err)]; } p.index = p.index + (1) >> 0; return [r, $ifaceNil]; }; Parser.prototype.resource = function(sec) { return this.$val.resource(sec); }; Parser.ptr.prototype.resourceHeader = function(sec) { var _tuple, err, err$1, hdr, off, p, sec; p = this; if (p.resHeaderValid) { return [p.resHeader, $ifaceNil]; } err = p.checkAdvance(sec); if (!($interfaceIsEqual(err, $ifaceNil))) { return [new ResourceHeader.ptr(new Name.ptr(arrayType.zero(), 0), 0, 0, 0, 0), err]; } hdr = new ResourceHeader.ptr(new Name.ptr(arrayType.zero(), 0), 0, 0, 0, 0); _tuple = hdr.unpack(p.msg, p.off); off = _tuple[0]; err$1 = _tuple[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return [new ResourceHeader.ptr(new Name.ptr(arrayType.zero(), 0), 0, 0, 0, 0), err$1]; } p.resHeaderValid = true; ResourceHeader.copy(p.resHeader, hdr); p.off = off; return [hdr, $ifaceNil]; }; Parser.prototype.resourceHeader = function(sec) { return this.$val.resourceHeader(sec); }; Parser.ptr.prototype.skipResource = function(sec) { var _entry, _tuple, err, err$1, newOff, p, sec; p = this; if (p.resHeaderValid) { newOff = p.off + ((p.resHeader.Length >> 0)) >> 0; if (newOff > p.msg.$length) { return errResourceLen; } p.off = newOff; p.resHeaderValid = false; p.index = p.index + (1) >> 0; return $ifaceNil; } err = p.checkAdvance(sec); if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } err$1 = $ifaceNil; _tuple = skipResource(p.msg, p.off); p.off = _tuple[0]; err$1 = _tuple[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return new nestedError.ptr("skipping: " + (_entry = sectionNames[section.keyFor(sec)], _entry !== undefined ? _entry.v : ""), err$1); } p.index = p.index + (1) >> 0; return $ifaceNil; }; Parser.prototype.skipResource = function(sec) { return this.$val.skipResource(sec); }; Parser.ptr.prototype.Question = function() { var _tuple, _tuple$1, _tuple$2, class$1, err, err$1, name, off, p, typ; p = this; err = p.checkAdvance(2); if (!($interfaceIsEqual(err, $ifaceNil))) { return [new Question.ptr(new Name.ptr(arrayType.zero(), 0), 0, 0), err]; } name = new Name.ptr(arrayType.zero(), 0); _tuple = name.unpack(p.msg, p.off); off = _tuple[0]; err$1 = _tuple[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return [new Question.ptr(new Name.ptr(arrayType.zero(), 0), 0, 0), new nestedError.ptr("unpacking Question.Name", err$1)]; } _tuple$1 = unpackType(p.msg, off); typ = _tuple$1[0]; off = _tuple$1[1]; err$1 = _tuple$1[2]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return [new Question.ptr(new Name.ptr(arrayType.zero(), 0), 0, 0), new nestedError.ptr("unpacking Question.Type", err$1)]; } _tuple$2 = unpackClass(p.msg, off); class$1 = _tuple$2[0]; off = _tuple$2[1]; err$1 = _tuple$2[2]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return [new Question.ptr(new Name.ptr(arrayType.zero(), 0), 0, 0), new nestedError.ptr("unpacking Question.Class", err$1)]; } p.off = off; p.index = p.index + (1) >> 0; return [new Question.ptr($clone(name, Name), typ, class$1), $ifaceNil]; }; Parser.prototype.Question = function() { return this.$val.Question(); }; Parser.ptr.prototype.AllQuestions = function() { var _tuple, err, p, q, qs; p = this; qs = new sliceType$1([]); while (true) { _tuple = p.Question(); q = $clone(_tuple[0], Question); err = _tuple[1]; if ($interfaceIsEqual(err, $pkg.ErrSectionDone)) { return [qs, $ifaceNil]; } if (!($interfaceIsEqual(err, $ifaceNil))) { return [sliceType$1.nil, err]; } qs = $append(qs, q); } }; Parser.prototype.AllQuestions = function() { return this.$val.AllQuestions(); }; Parser.ptr.prototype.SkipQuestion = function() { var _tuple, _tuple$1, _tuple$2, err, err$1, off, p; p = this; err = p.checkAdvance(2); if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } _tuple = skipName(p.msg, p.off); off = _tuple[0]; err$1 = _tuple[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return new nestedError.ptr("skipping Question Name", err$1); } _tuple$1 = skipType(p.msg, off); off = _tuple$1[0]; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return new nestedError.ptr("skipping Question Type", err$1); } _tuple$2 = skipClass(p.msg, off); off = _tuple$2[0]; err$1 = _tuple$2[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return new nestedError.ptr("skipping Question Class", err$1); } p.off = off; p.index = p.index + (1) >> 0; return $ifaceNil; }; Parser.prototype.SkipQuestion = function() { return this.$val.SkipQuestion(); }; Parser.ptr.prototype.SkipAllQuestions = function() { var err, p; p = this; while (true) { err = p.SkipQuestion(); if ($interfaceIsEqual(err, $pkg.ErrSectionDone)) { return $ifaceNil; } else if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } } }; Parser.prototype.SkipAllQuestions = function() { return this.$val.SkipAllQuestions(); }; Parser.ptr.prototype.AnswerHeader = function() { var p; p = this; return p.resourceHeader(3); }; Parser.prototype.AnswerHeader = function() { return this.$val.AnswerHeader(); }; Parser.ptr.prototype.Answer = function() { var p; p = this; return p.resource(3); }; Parser.prototype.Answer = function() { return this.$val.Answer(); }; Parser.ptr.prototype.AllAnswers = function() { var _tuple, a, as, err, n, p; p = this; n = ((p.header.answers >> 0)); if (n > 20) { n = 20; } as = $makeSlice(sliceType$2, 0, n); while (true) { _tuple = p.Answer(); a = $clone(_tuple[0], Resource); err = _tuple[1]; if ($interfaceIsEqual(err, $pkg.ErrSectionDone)) { return [as, $ifaceNil]; } if (!($interfaceIsEqual(err, $ifaceNil))) { return [sliceType$2.nil, err]; } as = $append(as, a); } }; Parser.prototype.AllAnswers = function() { return this.$val.AllAnswers(); }; Parser.ptr.prototype.SkipAnswer = function() { var p; p = this; return p.skipResource(3); }; Parser.prototype.SkipAnswer = function() { return this.$val.SkipAnswer(); }; Parser.ptr.prototype.SkipAllAnswers = function() { var err, p; p = this; while (true) { err = p.SkipAnswer(); if ($interfaceIsEqual(err, $pkg.ErrSectionDone)) { return $ifaceNil; } else if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } } }; Parser.prototype.SkipAllAnswers = function() { return this.$val.SkipAllAnswers(); }; Parser.ptr.prototype.AuthorityHeader = function() { var p; p = this; return p.resourceHeader(4); }; Parser.prototype.AuthorityHeader = function() { return this.$val.AuthorityHeader(); }; Parser.ptr.prototype.Authority = function() { var p; p = this; return p.resource(4); }; Parser.prototype.Authority = function() { return this.$val.Authority(); }; Parser.ptr.prototype.AllAuthorities = function() { var _tuple, a, as, err, n, p; p = this; n = ((p.header.authorities >> 0)); if (n > 10) { n = 10; } as = $makeSlice(sliceType$2, 0, n); while (true) { _tuple = p.Authority(); a = $clone(_tuple[0], Resource); err = _tuple[1]; if ($interfaceIsEqual(err, $pkg.ErrSectionDone)) { return [as, $ifaceNil]; } if (!($interfaceIsEqual(err, $ifaceNil))) { return [sliceType$2.nil, err]; } as = $append(as, a); } }; Parser.prototype.AllAuthorities = function() { return this.$val.AllAuthorities(); }; Parser.ptr.prototype.SkipAuthority = function() { var p; p = this; return p.skipResource(4); }; Parser.prototype.SkipAuthority = function() { return this.$val.SkipAuthority(); }; Parser.ptr.prototype.SkipAllAuthorities = function() { var err, p; p = this; while (true) { err = p.SkipAuthority(); if ($interfaceIsEqual(err, $pkg.ErrSectionDone)) { return $ifaceNil; } else if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } } }; Parser.prototype.SkipAllAuthorities = function() { return this.$val.SkipAllAuthorities(); }; Parser.ptr.prototype.AdditionalHeader = function() { var p; p = this; return p.resourceHeader(5); }; Parser.prototype.AdditionalHeader = function() { return this.$val.AdditionalHeader(); }; Parser.ptr.prototype.Additional = function() { var p; p = this; return p.resource(5); }; Parser.prototype.Additional = function() { return this.$val.Additional(); }; Parser.ptr.prototype.AllAdditionals = function() { var _tuple, a, as, err, n, p; p = this; n = ((p.header.additionals >> 0)); if (n > 10) { n = 10; } as = $makeSlice(sliceType$2, 0, n); while (true) { _tuple = p.Additional(); a = $clone(_tuple[0], Resource); err = _tuple[1]; if ($interfaceIsEqual(err, $pkg.ErrSectionDone)) { return [as, $ifaceNil]; } if (!($interfaceIsEqual(err, $ifaceNil))) { return [sliceType$2.nil, err]; } as = $append(as, a); } }; Parser.prototype.AllAdditionals = function() { return this.$val.AllAdditionals(); }; Parser.ptr.prototype.SkipAdditional = function() { var p; p = this; return p.skipResource(5); }; Parser.prototype.SkipAdditional = function() { return this.$val.SkipAdditional(); }; Parser.ptr.prototype.SkipAllAdditionals = function() { var err, p; p = this; while (true) { err = p.SkipAdditional(); if ($interfaceIsEqual(err, $pkg.ErrSectionDone)) { return $ifaceNil; } else if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } } }; Parser.prototype.SkipAllAdditionals = function() { return this.$val.SkipAllAdditionals(); }; Parser.ptr.prototype.CNAMEResource = function() { var _tuple, err, p, r; p = this; if (!p.resHeaderValid || !((p.resHeader.Type === 5))) { return [new CNAMEResource.ptr(new Name.ptr(arrayType.zero(), 0)), $pkg.ErrNotStarted]; } _tuple = unpackCNAMEResource(p.msg, p.off); r = $clone(_tuple[0], CNAMEResource); err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new CNAMEResource.ptr(new Name.ptr(arrayType.zero(), 0)), err]; } p.off = p.off + (((p.resHeader.Length >> 0))) >> 0; p.resHeaderValid = false; p.index = p.index + (1) >> 0; return [r, $ifaceNil]; }; Parser.prototype.CNAMEResource = function() { return this.$val.CNAMEResource(); }; Parser.ptr.prototype.MXResource = function() { var _tuple, err, p, r; p = this; if (!p.resHeaderValid || !((p.resHeader.Type === 15))) { return [new MXResource.ptr(0, new Name.ptr(arrayType.zero(), 0)), $pkg.ErrNotStarted]; } _tuple = unpackMXResource(p.msg, p.off); r = $clone(_tuple[0], MXResource); err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new MXResource.ptr(0, new Name.ptr(arrayType.zero(), 0)), err]; } p.off = p.off + (((p.resHeader.Length >> 0))) >> 0; p.resHeaderValid = false; p.index = p.index + (1) >> 0; return [r, $ifaceNil]; }; Parser.prototype.MXResource = function() { return this.$val.MXResource(); }; Parser.ptr.prototype.NSResource = function() { var _tuple, err, p, r; p = this; if (!p.resHeaderValid || !((p.resHeader.Type === 2))) { return [new NSResource.ptr(new Name.ptr(arrayType.zero(), 0)), $pkg.ErrNotStarted]; } _tuple = unpackNSResource(p.msg, p.off); r = $clone(_tuple[0], NSResource); err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new NSResource.ptr(new Name.ptr(arrayType.zero(), 0)), err]; } p.off = p.off + (((p.resHeader.Length >> 0))) >> 0; p.resHeaderValid = false; p.index = p.index + (1) >> 0; return [r, $ifaceNil]; }; Parser.prototype.NSResource = function() { return this.$val.NSResource(); }; Parser.ptr.prototype.PTRResource = function() { var _tuple, err, p, r; p = this; if (!p.resHeaderValid || !((p.resHeader.Type === 12))) { return [new PTRResource.ptr(new Name.ptr(arrayType.zero(), 0)), $pkg.ErrNotStarted]; } _tuple = unpackPTRResource(p.msg, p.off); r = $clone(_tuple[0], PTRResource); err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new PTRResource.ptr(new Name.ptr(arrayType.zero(), 0)), err]; } p.off = p.off + (((p.resHeader.Length >> 0))) >> 0; p.resHeaderValid = false; p.index = p.index + (1) >> 0; return [r, $ifaceNil]; }; Parser.prototype.PTRResource = function() { return this.$val.PTRResource(); }; Parser.ptr.prototype.SOAResource = function() { var _tuple, err, p, r; p = this; if (!p.resHeaderValid || !((p.resHeader.Type === 6))) { return [new SOAResource.ptr(new Name.ptr(arrayType.zero(), 0), new Name.ptr(arrayType.zero(), 0), 0, 0, 0, 0, 0), $pkg.ErrNotStarted]; } _tuple = unpackSOAResource(p.msg, p.off); r = $clone(_tuple[0], SOAResource); err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new SOAResource.ptr(new Name.ptr(arrayType.zero(), 0), new Name.ptr(arrayType.zero(), 0), 0, 0, 0, 0, 0), err]; } p.off = p.off + (((p.resHeader.Length >> 0))) >> 0; p.resHeaderValid = false; p.index = p.index + (1) >> 0; return [r, $ifaceNil]; }; Parser.prototype.SOAResource = function() { return this.$val.SOAResource(); }; Parser.ptr.prototype.TXTResource = function() { var _tuple, err, p, r; p = this; if (!p.resHeaderValid || !((p.resHeader.Type === 16))) { return [new TXTResource.ptr(sliceType$3.nil), $pkg.ErrNotStarted]; } _tuple = unpackTXTResource(p.msg, p.off, p.resHeader.Length); r = $clone(_tuple[0], TXTResource); err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new TXTResource.ptr(sliceType$3.nil), err]; } p.off = p.off + (((p.resHeader.Length >> 0))) >> 0; p.resHeaderValid = false; p.index = p.index + (1) >> 0; return [r, $ifaceNil]; }; Parser.prototype.TXTResource = function() { return this.$val.TXTResource(); }; Parser.ptr.prototype.SRVResource = function() { var _tuple, err, p, r; p = this; if (!p.resHeaderValid || !((p.resHeader.Type === 33))) { return [new SRVResource.ptr(0, 0, 0, new Name.ptr(arrayType.zero(), 0)), $pkg.ErrNotStarted]; } _tuple = unpackSRVResource(p.msg, p.off); r = $clone(_tuple[0], SRVResource); err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new SRVResource.ptr(0, 0, 0, new Name.ptr(arrayType.zero(), 0)), err]; } p.off = p.off + (((p.resHeader.Length >> 0))) >> 0; p.resHeaderValid = false; p.index = p.index + (1) >> 0; return [r, $ifaceNil]; }; Parser.prototype.SRVResource = function() { return this.$val.SRVResource(); }; Parser.ptr.prototype.AResource = function() { var _tuple, err, p, r; p = this; if (!p.resHeaderValid || !((p.resHeader.Type === 1))) { return [new AResource.ptr(arrayType$1.zero()), $pkg.ErrNotStarted]; } _tuple = unpackAResource(p.msg, p.off); r = $clone(_tuple[0], AResource); err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new AResource.ptr(arrayType$1.zero()), err]; } p.off = p.off + (((p.resHeader.Length >> 0))) >> 0; p.resHeaderValid = false; p.index = p.index + (1) >> 0; return [r, $ifaceNil]; }; Parser.prototype.AResource = function() { return this.$val.AResource(); }; Parser.ptr.prototype.AAAAResource = function() { var _tuple, err, p, r; p = this; if (!p.resHeaderValid || !((p.resHeader.Type === 28))) { return [new AAAAResource.ptr(arrayType$2.zero()), $pkg.ErrNotStarted]; } _tuple = unpackAAAAResource(p.msg, p.off); r = $clone(_tuple[0], AAAAResource); err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new AAAAResource.ptr(arrayType$2.zero()), err]; } p.off = p.off + (((p.resHeader.Length >> 0))) >> 0; p.resHeaderValid = false; p.index = p.index + (1) >> 0; return [r, $ifaceNil]; }; Parser.prototype.AAAAResource = function() { return this.$val.AAAAResource(); }; Parser.ptr.prototype.OPTResource = function() { var _tuple, err, p, r; p = this; if (!p.resHeaderValid || !((p.resHeader.Type === 41))) { return [new OPTResource.ptr(sliceType$4.nil), $pkg.ErrNotStarted]; } _tuple = unpackOPTResource(p.msg, p.off, p.resHeader.Length); r = $clone(_tuple[0], OPTResource); err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new OPTResource.ptr(sliceType$4.nil), err]; } p.off = p.off + (((p.resHeader.Length >> 0))) >> 0; p.resHeaderValid = false; p.index = p.index + (1) >> 0; return [r, $ifaceNil]; }; Parser.prototype.OPTResource = function() { return this.$val.OPTResource(); }; Parser.ptr.prototype.UnknownResource = function() { var _tuple, err, p, r; p = this; if (!p.resHeaderValid) { return [new UnknownResource.ptr(0, sliceType.nil), $pkg.ErrNotStarted]; } _tuple = unpackUnknownResource(p.resHeader.Type, p.msg, p.off, p.resHeader.Length); r = $clone(_tuple[0], UnknownResource); err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new UnknownResource.ptr(0, sliceType.nil), err]; } p.off = p.off + (((p.resHeader.Length >> 0))) >> 0; p.resHeaderValid = false; p.index = p.index + (1) >> 0; return [r, $ifaceNil]; }; Parser.prototype.UnknownResource = function() { return this.$val.UnknownResource(); }; NewBuilder = function(buf, h) { var _tuple, b, buf, h, hb; if (buf === sliceType.nil) { buf = $makeSlice(sliceType, 0, 512); } b = new Builder.ptr(buf, 0, new header.ptr(0, 0, 0, 0, 0, 0), buf.$length, false); _tuple = h.pack(); b.header.id = _tuple[0]; b.header.bits = _tuple[1]; hb = arrayType$3.zero(); b.msg = $appendSlice(b.msg, new sliceType(hb)); b.section = 1; return b; }; $pkg.NewBuilder = NewBuilder; Builder.ptr.prototype.EnableCompression = function() { var b; b = this; b.compression = $makeMap($String.keyFor, []); }; Builder.prototype.EnableCompression = function() { return this.$val.EnableCompression(); }; Builder.ptr.prototype.startCheck = function(s) { var b, s; b = this; if (b.section <= 0) { return $pkg.ErrNotStarted; } if (b.section > s) { return $pkg.ErrSectionDone; } return $ifaceNil; }; Builder.prototype.startCheck = function(s) { return this.$val.startCheck(s); }; Builder.ptr.prototype.StartQuestions = function() { var b, err; b = this; err = b.startCheck(2); if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } b.section = 2; return $ifaceNil; }; Builder.prototype.StartQuestions = function() { return this.$val.StartQuestions(); }; Builder.ptr.prototype.StartAnswers = function() { var b, err; b = this; err = b.startCheck(3); if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } b.section = 3; return $ifaceNil; }; Builder.prototype.StartAnswers = function() { return this.$val.StartAnswers(); }; Builder.ptr.prototype.StartAuthorities = function() { var b, err; b = this; err = b.startCheck(4); if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } b.section = 4; return $ifaceNil; }; Builder.prototype.StartAuthorities = function() { return this.$val.StartAuthorities(); }; Builder.ptr.prototype.StartAdditionals = function() { var b, err; b = this; err = b.startCheck(5); if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } b.section = 5; return $ifaceNil; }; Builder.prototype.StartAdditionals = function() { return this.$val.StartAdditionals(); }; Builder.ptr.prototype.incrementSectionCount = function() { var _1, b, count, err, x, x$1, x$2, x$3; b = this; count = ptrType.nil; err = $ifaceNil; _1 = b.section; if (_1 === (2)) { count = (x = b.header, (x.$ptr_questions || (x.$ptr_questions = new ptrType(function() { return this.$target.questions; }, function($v) { this.$target.questions = $v; }, x)))); err = errTooManyQuestions; } else if (_1 === (3)) { count = (x$1 = b.header, (x$1.$ptr_answers || (x$1.$ptr_answers = new ptrType(function() { return this.$target.answers; }, function($v) { this.$target.answers = $v; }, x$1)))); err = errTooManyAnswers; } else if (_1 === (4)) { count = (x$2 = b.header, (x$2.$ptr_authorities || (x$2.$ptr_authorities = new ptrType(function() { return this.$target.authorities; }, function($v) { this.$target.authorities = $v; }, x$2)))); err = errTooManyAuthorities; } else if (_1 === (5)) { count = (x$3 = b.header, (x$3.$ptr_additionals || (x$3.$ptr_additionals = new ptrType(function() { return this.$target.additionals; }, function($v) { this.$target.additionals = $v; }, x$3)))); err = errTooManyAdditionals; } if (count.$get() === 65535) { return err; } count.$set(count.$get() + (1) << 16 >>> 16); return $ifaceNil; }; Builder.prototype.incrementSectionCount = function() { return this.$val.incrementSectionCount(); }; Builder.ptr.prototype.Question = function(q) { var _tuple, b, err, err$1, msg, q; b = this; if (b.section < 2) { return $pkg.ErrNotStarted; } if (b.section > 2) { return $pkg.ErrSectionDone; } _tuple = q.pack(b.msg, b.compression, b.start); msg = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } err$1 = b.incrementSectionCount(); if (!($interfaceIsEqual(err$1, $ifaceNil))) { return err$1; } b.msg = msg; return $ifaceNil; }; Builder.prototype.Question = function(q) { return this.$val.Question(q); }; Builder.ptr.prototype.checkResourceSection = function() { var b; b = this; if (b.section < 3) { return $pkg.ErrNotStarted; } if (b.section > 5) { return $pkg.ErrSectionDone; } return $ifaceNil; }; Builder.prototype.checkResourceSection = function() { return this.$val.checkResourceSection(); }; Builder.ptr.prototype.CNAMEResource = function(h, r) { var _tuple, _tuple$1, b, err, err$1, err$2, err$3, h, lenOff, msg, preLen, r; b = this; err = b.checkResourceSection(); if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } h.Type = r.realType(); _tuple = h.pack(b.msg, b.compression, b.start); msg = _tuple[0]; lenOff = _tuple[1]; err$1 = _tuple[2]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return new nestedError.ptr("ResourceHeader", err$1); } preLen = msg.$length; _tuple$1 = r.pack(msg, b.compression, b.start); msg = _tuple$1[0]; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return new nestedError.ptr("CNAMEResource body", err$1); } err$2 = h.fixLen(msg, lenOff, preLen); if (!($interfaceIsEqual(err$2, $ifaceNil))) { return err$2; } err$3 = b.incrementSectionCount(); if (!($interfaceIsEqual(err$3, $ifaceNil))) { return err$3; } b.msg = msg; return $ifaceNil; }; Builder.prototype.CNAMEResource = function(h, r) { return this.$val.CNAMEResource(h, r); }; Builder.ptr.prototype.MXResource = function(h, r) { var _tuple, _tuple$1, b, err, err$1, err$2, err$3, h, lenOff, msg, preLen, r; b = this; err = b.checkResourceSection(); if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } h.Type = r.realType(); _tuple = h.pack(b.msg, b.compression, b.start); msg = _tuple[0]; lenOff = _tuple[1]; err$1 = _tuple[2]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return new nestedError.ptr("ResourceHeader", err$1); } preLen = msg.$length; _tuple$1 = r.pack(msg, b.compression, b.start); msg = _tuple$1[0]; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return new nestedError.ptr("MXResource body", err$1); } err$2 = h.fixLen(msg, lenOff, preLen); if (!($interfaceIsEqual(err$2, $ifaceNil))) { return err$2; } err$3 = b.incrementSectionCount(); if (!($interfaceIsEqual(err$3, $ifaceNil))) { return err$3; } b.msg = msg; return $ifaceNil; }; Builder.prototype.MXResource = function(h, r) { return this.$val.MXResource(h, r); }; Builder.ptr.prototype.NSResource = function(h, r) { var _tuple, _tuple$1, b, err, err$1, err$2, err$3, h, lenOff, msg, preLen, r; b = this; err = b.checkResourceSection(); if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } h.Type = r.realType(); _tuple = h.pack(b.msg, b.compression, b.start); msg = _tuple[0]; lenOff = _tuple[1]; err$1 = _tuple[2]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return new nestedError.ptr("ResourceHeader", err$1); } preLen = msg.$length; _tuple$1 = r.pack(msg, b.compression, b.start); msg = _tuple$1[0]; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return new nestedError.ptr("NSResource body", err$1); } err$2 = h.fixLen(msg, lenOff, preLen); if (!($interfaceIsEqual(err$2, $ifaceNil))) { return err$2; } err$3 = b.incrementSectionCount(); if (!($interfaceIsEqual(err$3, $ifaceNil))) { return err$3; } b.msg = msg; return $ifaceNil; }; Builder.prototype.NSResource = function(h, r) { return this.$val.NSResource(h, r); }; Builder.ptr.prototype.PTRResource = function(h, r) { var _tuple, _tuple$1, b, err, err$1, err$2, err$3, h, lenOff, msg, preLen, r; b = this; err = b.checkResourceSection(); if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } h.Type = r.realType(); _tuple = h.pack(b.msg, b.compression, b.start); msg = _tuple[0]; lenOff = _tuple[1]; err$1 = _tuple[2]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return new nestedError.ptr("ResourceHeader", err$1); } preLen = msg.$length; _tuple$1 = r.pack(msg, b.compression, b.start); msg = _tuple$1[0]; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return new nestedError.ptr("PTRResource body", err$1); } err$2 = h.fixLen(msg, lenOff, preLen); if (!($interfaceIsEqual(err$2, $ifaceNil))) { return err$2; } err$3 = b.incrementSectionCount(); if (!($interfaceIsEqual(err$3, $ifaceNil))) { return err$3; } b.msg = msg; return $ifaceNil; }; Builder.prototype.PTRResource = function(h, r) { return this.$val.PTRResource(h, r); }; Builder.ptr.prototype.SOAResource = function(h, r) { var _tuple, _tuple$1, b, err, err$1, err$2, err$3, h, lenOff, msg, preLen, r; b = this; err = b.checkResourceSection(); if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } h.Type = r.realType(); _tuple = h.pack(b.msg, b.compression, b.start); msg = _tuple[0]; lenOff = _tuple[1]; err$1 = _tuple[2]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return new nestedError.ptr("ResourceHeader", err$1); } preLen = msg.$length; _tuple$1 = r.pack(msg, b.compression, b.start); msg = _tuple$1[0]; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return new nestedError.ptr("SOAResource body", err$1); } err$2 = h.fixLen(msg, lenOff, preLen); if (!($interfaceIsEqual(err$2, $ifaceNil))) { return err$2; } err$3 = b.incrementSectionCount(); if (!($interfaceIsEqual(err$3, $ifaceNil))) { return err$3; } b.msg = msg; return $ifaceNil; }; Builder.prototype.SOAResource = function(h, r) { return this.$val.SOAResource(h, r); }; Builder.ptr.prototype.TXTResource = function(h, r) { var _tuple, _tuple$1, b, err, err$1, err$2, err$3, h, lenOff, msg, preLen, r; b = this; err = b.checkResourceSection(); if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } h.Type = r.realType(); _tuple = h.pack(b.msg, b.compression, b.start); msg = _tuple[0]; lenOff = _tuple[1]; err$1 = _tuple[2]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return new nestedError.ptr("ResourceHeader", err$1); } preLen = msg.$length; _tuple$1 = r.pack(msg, b.compression, b.start); msg = _tuple$1[0]; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return new nestedError.ptr("TXTResource body", err$1); } err$2 = h.fixLen(msg, lenOff, preLen); if (!($interfaceIsEqual(err$2, $ifaceNil))) { return err$2; } err$3 = b.incrementSectionCount(); if (!($interfaceIsEqual(err$3, $ifaceNil))) { return err$3; } b.msg = msg; return $ifaceNil; }; Builder.prototype.TXTResource = function(h, r) { return this.$val.TXTResource(h, r); }; Builder.ptr.prototype.SRVResource = function(h, r) { var _tuple, _tuple$1, b, err, err$1, err$2, err$3, h, lenOff, msg, preLen, r; b = this; err = b.checkResourceSection(); if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } h.Type = r.realType(); _tuple = h.pack(b.msg, b.compression, b.start); msg = _tuple[0]; lenOff = _tuple[1]; err$1 = _tuple[2]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return new nestedError.ptr("ResourceHeader", err$1); } preLen = msg.$length; _tuple$1 = r.pack(msg, b.compression, b.start); msg = _tuple$1[0]; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return new nestedError.ptr("SRVResource body", err$1); } err$2 = h.fixLen(msg, lenOff, preLen); if (!($interfaceIsEqual(err$2, $ifaceNil))) { return err$2; } err$3 = b.incrementSectionCount(); if (!($interfaceIsEqual(err$3, $ifaceNil))) { return err$3; } b.msg = msg; return $ifaceNil; }; Builder.prototype.SRVResource = function(h, r) { return this.$val.SRVResource(h, r); }; Builder.ptr.prototype.AResource = function(h, r) { var _tuple, _tuple$1, b, err, err$1, err$2, err$3, h, lenOff, msg, preLen, r; b = this; err = b.checkResourceSection(); if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } h.Type = r.realType(); _tuple = h.pack(b.msg, b.compression, b.start); msg = _tuple[0]; lenOff = _tuple[1]; err$1 = _tuple[2]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return new nestedError.ptr("ResourceHeader", err$1); } preLen = msg.$length; _tuple$1 = r.pack(msg, b.compression, b.start); msg = _tuple$1[0]; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return new nestedError.ptr("AResource body", err$1); } err$2 = h.fixLen(msg, lenOff, preLen); if (!($interfaceIsEqual(err$2, $ifaceNil))) { return err$2; } err$3 = b.incrementSectionCount(); if (!($interfaceIsEqual(err$3, $ifaceNil))) { return err$3; } b.msg = msg; return $ifaceNil; }; Builder.prototype.AResource = function(h, r) { return this.$val.AResource(h, r); }; Builder.ptr.prototype.AAAAResource = function(h, r) { var _tuple, _tuple$1, b, err, err$1, err$2, err$3, h, lenOff, msg, preLen, r; b = this; err = b.checkResourceSection(); if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } h.Type = r.realType(); _tuple = h.pack(b.msg, b.compression, b.start); msg = _tuple[0]; lenOff = _tuple[1]; err$1 = _tuple[2]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return new nestedError.ptr("ResourceHeader", err$1); } preLen = msg.$length; _tuple$1 = r.pack(msg, b.compression, b.start); msg = _tuple$1[0]; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return new nestedError.ptr("AAAAResource body", err$1); } err$2 = h.fixLen(msg, lenOff, preLen); if (!($interfaceIsEqual(err$2, $ifaceNil))) { return err$2; } err$3 = b.incrementSectionCount(); if (!($interfaceIsEqual(err$3, $ifaceNil))) { return err$3; } b.msg = msg; return $ifaceNil; }; Builder.prototype.AAAAResource = function(h, r) { return this.$val.AAAAResource(h, r); }; Builder.ptr.prototype.OPTResource = function(h, r) { var _tuple, _tuple$1, b, err, err$1, err$2, err$3, h, lenOff, msg, preLen, r; b = this; err = b.checkResourceSection(); if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } h.Type = r.realType(); _tuple = h.pack(b.msg, b.compression, b.start); msg = _tuple[0]; lenOff = _tuple[1]; err$1 = _tuple[2]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return new nestedError.ptr("ResourceHeader", err$1); } preLen = msg.$length; _tuple$1 = r.pack(msg, b.compression, b.start); msg = _tuple$1[0]; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return new nestedError.ptr("OPTResource body", err$1); } err$2 = h.fixLen(msg, lenOff, preLen); if (!($interfaceIsEqual(err$2, $ifaceNil))) { return err$2; } err$3 = b.incrementSectionCount(); if (!($interfaceIsEqual(err$3, $ifaceNil))) { return err$3; } b.msg = msg; return $ifaceNil; }; Builder.prototype.OPTResource = function(h, r) { return this.$val.OPTResource(h, r); }; Builder.ptr.prototype.UnknownResource = function(h, r) { var _tuple, _tuple$1, b, err, err$1, err$2, err$3, h, lenOff, msg, preLen, r; b = this; err = b.checkResourceSection(); if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } h.Type = r.realType(); _tuple = h.pack(b.msg, b.compression, b.start); msg = _tuple[0]; lenOff = _tuple[1]; err$1 = _tuple[2]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return new nestedError.ptr("ResourceHeader", err$1); } preLen = msg.$length; _tuple$1 = r.pack(msg, b.compression, b.start); msg = _tuple$1[0]; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return new nestedError.ptr("UnknownResource body", err$1); } err$2 = h.fixLen(msg, lenOff, preLen); if (!($interfaceIsEqual(err$2, $ifaceNil))) { return err$2; } err$3 = b.incrementSectionCount(); if (!($interfaceIsEqual(err$3, $ifaceNil))) { return err$3; } b.msg = msg; return $ifaceNil; }; Builder.prototype.UnknownResource = function(h, r) { return this.$val.UnknownResource(h, r); }; Builder.ptr.prototype.Finish = function() { var b; b = this; if (b.section < 1) { return [sliceType.nil, $pkg.ErrNotStarted]; } b.section = 6; b.header.pack($subslice(b.msg, b.start, b.start)); return [b.msg, $ifaceNil]; }; Builder.prototype.Finish = function() { return this.$val.Finish(); }; ResourceHeader.ptr.prototype.GoString = function() { var h; h = this; return "dnsmessage.ResourceHeader{Name: " + h.Name.GoString() + ", " + "Type: " + new Type(h.Type).GoString() + ", " + "Class: " + new Class(h.Class).GoString() + ", " + "TTL: " + printUint32(h.TTL) + ", " + "Length: " + printUint16(h.Length) + "}"; }; ResourceHeader.prototype.GoString = function() { return this.$val.GoString(); }; ResourceHeader.ptr.prototype.pack = function(oldMsg, compression, compressionOff) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, compression, compressionOff, err, h, lenOff, msg, oldMsg; msg = sliceType.nil; lenOff = 0; err = $ifaceNil; h = this; msg = oldMsg; _tuple = h.Name.pack(msg, compression, compressionOff); msg = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp = oldMsg; _tmp$1 = 0; _tmp$2 = new nestedError.ptr("Name", err); msg = _tmp; lenOff = _tmp$1; err = _tmp$2; return [msg, lenOff, err]; } msg = packType(msg, h.Type); msg = packClass(msg, h.Class); msg = packUint32(msg, h.TTL); lenOff = msg.$length; msg = packUint16(msg, h.Length); _tmp$3 = msg; _tmp$4 = lenOff; _tmp$5 = $ifaceNil; msg = _tmp$3; lenOff = _tmp$4; err = _tmp$5; return [msg, lenOff, err]; }; ResourceHeader.prototype.pack = function(oldMsg, compression, compressionOff) { return this.$val.pack(oldMsg, compression, compressionOff); }; ResourceHeader.ptr.prototype.unpack = function(msg, off) { var _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, err, h, msg, newOff, off; h = this; newOff = off; err = $ifaceNil; _tuple = h.Name.unpack(msg, newOff); newOff = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [off, new nestedError.ptr("Name", err)]; } _tuple$1 = unpackType(msg, newOff); h.Type = _tuple$1[0]; newOff = _tuple$1[1]; err = _tuple$1[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [off, new nestedError.ptr("Type", err)]; } _tuple$2 = unpackClass(msg, newOff); h.Class = _tuple$2[0]; newOff = _tuple$2[1]; err = _tuple$2[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [off, new nestedError.ptr("Class", err)]; } _tuple$3 = unpackUint32(msg, newOff); h.TTL = _tuple$3[0]; newOff = _tuple$3[1]; err = _tuple$3[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [off, new nestedError.ptr("TTL", err)]; } _tuple$4 = unpackUint16(msg, newOff); h.Length = _tuple$4[0]; newOff = _tuple$4[1]; err = _tuple$4[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [off, new nestedError.ptr("Length", err)]; } return [newOff, $ifaceNil]; }; ResourceHeader.prototype.unpack = function(msg, off) { return this.$val.unpack(msg, off); }; ResourceHeader.ptr.prototype.fixLen = function(msg, lenOff, preLen) { var conLen, h, lenOff, msg, preLen; h = this; conLen = msg.$length - preLen >> 0; if (conLen > 65535) { return errResTooLong; } packUint16($subslice(msg, lenOff, lenOff), ((conLen << 16 >>> 16))); h.Length = ((conLen << 16 >>> 16)); return $ifaceNil; }; ResourceHeader.prototype.fixLen = function(msg, lenOff, preLen) { return this.$val.fixLen(msg, lenOff, preLen); }; ResourceHeader.ptr.prototype.SetEDNS0 = function(udpPayloadLen, extRCode, dnssecOK) { var dnssecOK, extRCode, h, udpPayloadLen; h = this; Name.copy(h.Name, new Name.ptr($toNativeArray($kindUint8, [46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), 1)); h.Type = 41; h.Class = ((udpPayloadLen << 16 >>> 16)); h.TTL = (((extRCode >>> 0)) >>> 4 >>> 0) << 24 >>> 0; if (dnssecOK) { h.TTL = (h.TTL | (32768)) >>> 0; } return $ifaceNil; }; ResourceHeader.prototype.SetEDNS0 = function(udpPayloadLen, extRCode, dnssecOK) { return this.$val.SetEDNS0(udpPayloadLen, extRCode, dnssecOK); }; ResourceHeader.ptr.prototype.DNSSECAllowed = function() { var h; h = this; return ((h.TTL & 16744448) >>> 0) === 32768; }; ResourceHeader.prototype.DNSSECAllowed = function() { return this.$val.DNSSECAllowed(); }; ResourceHeader.ptr.prototype.ExtendedRCode = function(rcode) { var h, rcode; h = this; if (((h.TTL & 16711680) >>> 0) === 0) { return (((((h.TTL >>> 24 >>> 0) << 4 >>> 0) << 16 >>> 16)) | rcode) >>> 0; } return rcode; }; ResourceHeader.prototype.ExtendedRCode = function(rcode) { return this.$val.ExtendedRCode(rcode); }; skipResource = function(msg, off) { var _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, err, length, msg, newOff, off; _tuple = skipName(msg, off); newOff = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [off, new nestedError.ptr("Name", err)]; } _tuple$1 = skipType(msg, newOff); newOff = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [off, new nestedError.ptr("Type", err)]; } _tuple$2 = skipClass(msg, newOff); newOff = _tuple$2[0]; err = _tuple$2[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [off, new nestedError.ptr("Class", err)]; } _tuple$3 = skipUint32(msg, newOff); newOff = _tuple$3[0]; err = _tuple$3[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [off, new nestedError.ptr("TTL", err)]; } _tuple$4 = unpackUint16(msg, newOff); length = _tuple$4[0]; newOff = _tuple$4[1]; err = _tuple$4[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [off, new nestedError.ptr("Length", err)]; } newOff = newOff + (((length >> 0))) >> 0; if (newOff > msg.$length) { return [off, errResourceLen]; } return [newOff, $ifaceNil]; }; packUint16 = function(msg, field) { var field, msg; return $append(msg, (((field >>> 8 << 16 >>> 16) << 24 >>> 24)), ((field << 24 >>> 24))); }; unpackUint16 = function(msg, off) { var msg, off, x; if ((off + 2 >> 0) > msg.$length) { return [0, off, errBaseLen]; } return [((((((off < 0 || off >= msg.$length) ? ($throwRuntimeError("index out of range"), undefined) : msg.$array[msg.$offset + off]) << 16 >>> 16)) << 8 << 16 >>> 16) | (((x = off + 1 >> 0, ((x < 0 || x >= msg.$length) ? ($throwRuntimeError("index out of range"), undefined) : msg.$array[msg.$offset + x])) << 16 >>> 16))) >>> 0, off + 2 >> 0, $ifaceNil]; }; skipUint16 = function(msg, off) { var msg, off; if ((off + 2 >> 0) > msg.$length) { return [off, errBaseLen]; } return [off + 2 >> 0, $ifaceNil]; }; packType = function(msg, field) { var field, msg; return packUint16(msg, ((field << 16 >>> 16))); }; unpackType = function(msg, off) { var _tuple, err, msg, o, off, t; _tuple = unpackUint16(msg, off); t = _tuple[0]; o = _tuple[1]; err = _tuple[2]; return [((t << 16 >>> 16)), o, err]; }; skipType = function(msg, off) { var msg, off; return skipUint16(msg, off); }; packClass = function(msg, field) { var field, msg; return packUint16(msg, ((field << 16 >>> 16))); }; unpackClass = function(msg, off) { var _tuple, c, err, msg, o, off; _tuple = unpackUint16(msg, off); c = _tuple[0]; o = _tuple[1]; err = _tuple[2]; return [((c << 16 >>> 16)), o, err]; }; skipClass = function(msg, off) { var msg, off; return skipUint16(msg, off); }; packUint32 = function(msg, field) { var field, msg; return $append(msg, (((field >>> 24 >>> 0) << 24 >>> 24)), (((field >>> 16 >>> 0) << 24 >>> 24)), (((field >>> 8 >>> 0) << 24 >>> 24)), ((field << 24 >>> 24))); }; unpackUint32 = function(msg, off) { var msg, off, v, x, x$1, x$2; if ((off + 4 >> 0) > msg.$length) { return [0, off, errBaseLen]; } v = ((((((((((off < 0 || off >= msg.$length) ? ($throwRuntimeError("index out of range"), undefined) : msg.$array[msg.$offset + off]) >>> 0)) << 24 >>> 0) | ((((x = off + 1 >> 0, ((x < 0 || x >= msg.$length) ? ($throwRuntimeError("index out of range"), undefined) : msg.$array[msg.$offset + x])) >>> 0)) << 16 >>> 0)) >>> 0) | ((((x$1 = off + 2 >> 0, ((x$1 < 0 || x$1 >= msg.$length) ? ($throwRuntimeError("index out of range"), undefined) : msg.$array[msg.$offset + x$1])) >>> 0)) << 8 >>> 0)) >>> 0) | (((x$2 = off + 3 >> 0, ((x$2 < 0 || x$2 >= msg.$length) ? ($throwRuntimeError("index out of range"), undefined) : msg.$array[msg.$offset + x$2])) >>> 0))) >>> 0; return [v, off + 4 >> 0, $ifaceNil]; }; skipUint32 = function(msg, off) { var msg, off; if ((off + 4 >> 0) > msg.$length) { return [off, errBaseLen]; } return [off + 4 >> 0, $ifaceNil]; }; packText = function(msg, field) { var field, l, msg; l = field.length; if (l > 255) { return [sliceType.nil, errStringTooLong]; } msg = $append(msg, ((l << 24 >>> 24))); msg = $appendSlice(msg, field); return [msg, $ifaceNil]; }; unpackText = function(msg, off) { var beginOff, endOff, msg, off; if (off >= msg.$length) { return ["", off, errBaseLen]; } beginOff = off + 1 >> 0; endOff = beginOff + ((((off < 0 || off >= msg.$length) ? ($throwRuntimeError("index out of range"), undefined) : msg.$array[msg.$offset + off]) >> 0)) >> 0; if (endOff > msg.$length) { return ["", off, errCalcLen]; } return [($bytesToString($subslice(msg, beginOff, endOff))), endOff, $ifaceNil]; }; packBytes = function(msg, field) { var field, msg; return $appendSlice(msg, field); }; unpackBytes = function(msg, off, field) { var field, msg, newOff, off; newOff = off + field.$length >> 0; if (newOff > msg.$length) { return [off, errBaseLen]; } $copySlice(field, $subslice(msg, off, newOff)); return [newOff, $ifaceNil]; }; NewName = function(name) { var n, name; if ((new sliceType($stringToBytes(name))).$length > 255) { return [new Name.ptr(arrayType.zero(), 0), errCalcLen]; } n = new Name.ptr(arrayType.zero(), ((name.length << 24 >>> 24))); $copySlice(new sliceType(n.Data), (new sliceType($stringToBytes(name)))); return [n, $ifaceNil]; }; $pkg.NewName = NewName; Name.ptr.prototype.String = function() { var n; n = this; return ($bytesToString($subslice(new sliceType(n.Data), 0, n.Length))); }; Name.prototype.String = function() { return this.$val.String(); }; Name.ptr.prototype.GoString = function() { var n; n = this; return "dnsmessage.MustNewName(\"" + printString($subslice(new sliceType(n.Data), 0, n.Length)) + "\")"; }; Name.prototype.GoString = function() { return this.$val.GoString(); }; Name.ptr.prototype.pack = function(msg, compression, compressionOff) { var _entry, _key, _tmp, _tmp$1, _tuple, begin, compression, compressionOff, i, j, msg, n, ok, oldMsg, ptr, x, x$1, x$2, x$3, x$4, x$5; n = this; oldMsg = msg; if ((n.Length === 0) || !(((x = n.Data, x$1 = n.Length - 1 << 24 >>> 24, ((x$1 < 0 || x$1 >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[x$1])) === 46))) { return [oldMsg, errNonCanonicalName]; } if ((n.Data[0] === 46) && (n.Length === 1)) { return [$append(msg, 0), $ifaceNil]; } _tmp = 0; _tmp$1 = 0; i = _tmp; begin = _tmp$1; while (true) { if (!(i < ((n.Length >> 0)))) { break; } if ((x$2 = n.Data, ((i < 0 || i >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i])) === 46) { if ((i - begin >> 0) >= 64) { return [oldMsg, errSegTooLong]; } if ((i - begin >> 0) === 0) { return [oldMsg, errZeroSegLen]; } msg = $append(msg, (((i - begin >> 0) << 24 >>> 24))); j = begin; while (true) { if (!(j < i)) { break; } msg = $append(msg, (x$3 = n.Data, ((j < 0 || j >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[j]))); j = j + (1) >> 0; } begin = i + 1 >> 0; i = i + (1) >> 0; continue; } if (((i === 0) || ((x$4 = n.Data, x$5 = i - 1 >> 0, ((x$5 < 0 || x$5 >= x$4.length) ? ($throwRuntimeError("index out of range"), undefined) : x$4[x$5])) === 46)) && !(compression === false)) { _tuple = (_entry = compression[$String.keyFor(($bytesToString($subslice(new sliceType(n.Data), i))))], _entry !== undefined ? [_entry.v, true] : [0, false]); ptr = _tuple[0]; ok = _tuple[1]; if (ok) { return [$append(msg, ((((ptr >> 8 >> 0) | 192) << 24 >>> 24)), ((ptr << 24 >>> 24))), $ifaceNil]; } if (msg.$length <= 16383) { _key = ($bytesToString($subslice(new sliceType(n.Data), i))); (compression || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: msg.$length - compressionOff >> 0 }; } } i = i + (1) >> 0; } return [$append(msg, 0), $ifaceNil]; }; Name.prototype.pack = function(msg, compression, compressionOff) { return this.$val.pack(msg, compression, compressionOff); }; Name.ptr.prototype.unpack = function(msg, off) { var msg, n, off; n = this; return n.unpackCompressed(msg, off, true); }; Name.prototype.unpack = function(msg, off) { return this.$val.unpack(msg, off); }; Name.ptr.prototype.unpackCompressed = function(msg, off, allowCompression) { var _1, allowCompression, c, c1, currOff, endOff, msg, n, name, newOff, off, ptr; n = this; currOff = off; newOff = off; ptr = 0; name = $subslice(new sliceType(n.Data), 0, 0); Loop: while (true) { if (currOff >= msg.$length) { return [off, errBaseLen]; } c = ((((currOff < 0 || currOff >= msg.$length) ? ($throwRuntimeError("index out of range"), undefined) : msg.$array[msg.$offset + currOff]) >> 0)); currOff = currOff + (1) >> 0; _1 = c & 192; if (_1 === (0)) { if (c === 0) { break Loop; } endOff = currOff + c >> 0; if (endOff > msg.$length) { return [off, errCalcLen]; } name = $appendSlice(name, $subslice(msg, currOff, endOff)); name = $append(name, 46); currOff = endOff; } else if (_1 === (192)) { if (!allowCompression) { return [off, errCompressedSRV]; } if (currOff >= msg.$length) { return [off, errInvalidPtr]; } c1 = ((currOff < 0 || currOff >= msg.$length) ? ($throwRuntimeError("index out of range"), undefined) : msg.$array[msg.$offset + currOff]); currOff = currOff + (1) >> 0; if (ptr === 0) { newOff = currOff; } ptr = ptr + (1) >> 0; if (ptr > 10) { return [off, errTooManyPtr]; } currOff = ((((c ^ 192) >> 0)) << 8 >> 0) | ((c1 >> 0)); } else { return [off, errReserved]; } } if (name.$length === 0) { name = $append(name, 46); } if (name.$length > 255) { return [off, errCalcLen]; } n.Length = ((name.$length << 24 >>> 24)); if (ptr === 0) { newOff = currOff; } return [newOff, $ifaceNil]; }; Name.prototype.unpackCompressed = function(msg, off, allowCompression) { return this.$val.unpackCompressed(msg, off, allowCompression); }; skipName = function(msg, off) { var _1, c, msg, newOff, off; newOff = off; Loop: while (true) { if (newOff >= msg.$length) { return [off, errBaseLen]; } c = ((((newOff < 0 || newOff >= msg.$length) ? ($throwRuntimeError("index out of range"), undefined) : msg.$array[msg.$offset + newOff]) >> 0)); newOff = newOff + (1) >> 0; _1 = c & 192; if (_1 === (0)) { if (c === 0) { break Loop; } newOff = newOff + (c) >> 0; if (newOff > msg.$length) { return [off, errCalcLen]; } } else if (_1 === (192)) { newOff = newOff + (1) >> 0; break Loop; } else { return [off, errReserved]; } } return [newOff, $ifaceNil]; }; Question.ptr.prototype.pack = function(msg, compression, compressionOff) { var _tuple, compression, compressionOff, err, msg, q; q = this; _tuple = q.Name.pack(msg, compression, compressionOff); msg = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [msg, new nestedError.ptr("Name", err)]; } msg = packType(msg, q.Type); return [packClass(msg, q.Class), $ifaceNil]; }; Question.prototype.pack = function(msg, compression, compressionOff) { return this.$val.pack(msg, compression, compressionOff); }; Question.ptr.prototype.GoString = function() { var q; q = this; return "dnsmessage.Question{Name: " + q.Name.GoString() + ", " + "Type: " + new Type(q.Type).GoString() + ", " + "Class: " + new Class(q.Class).GoString() + "}"; }; Question.prototype.GoString = function() { return this.$val.GoString(); }; unpackResourceBody = function(msg, off, hdr) { var _1, _tuple, _tuple$1, _tuple$10, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, _tuple$8, _tuple$9, err, hdr, msg, name, off, r, rb, rb$1, rb$10, rb$2, rb$3, rb$4, rb$5, rb$6, rb$7, rb$8, rb$9; r = $ifaceNil; err = $ifaceNil; name = ""; _1 = hdr.Type; if (_1 === (1)) { rb = new AResource.ptr(arrayType$1.zero()); _tuple = unpackAResource(msg, off); AResource.copy(rb, _tuple[0]); err = _tuple[1]; r = rb; name = "A"; } else if (_1 === (2)) { rb$1 = new NSResource.ptr(new Name.ptr(arrayType.zero(), 0)); _tuple$1 = unpackNSResource(msg, off); NSResource.copy(rb$1, _tuple$1[0]); err = _tuple$1[1]; r = rb$1; name = "NS"; } else if (_1 === (5)) { rb$2 = new CNAMEResource.ptr(new Name.ptr(arrayType.zero(), 0)); _tuple$2 = unpackCNAMEResource(msg, off); CNAMEResource.copy(rb$2, _tuple$2[0]); err = _tuple$2[1]; r = rb$2; name = "CNAME"; } else if (_1 === (6)) { rb$3 = new SOAResource.ptr(new Name.ptr(arrayType.zero(), 0), new Name.ptr(arrayType.zero(), 0), 0, 0, 0, 0, 0); _tuple$3 = unpackSOAResource(msg, off); SOAResource.copy(rb$3, _tuple$3[0]); err = _tuple$3[1]; r = rb$3; name = "SOA"; } else if (_1 === (12)) { rb$4 = new PTRResource.ptr(new Name.ptr(arrayType.zero(), 0)); _tuple$4 = unpackPTRResource(msg, off); PTRResource.copy(rb$4, _tuple$4[0]); err = _tuple$4[1]; r = rb$4; name = "PTR"; } else if (_1 === (15)) { rb$5 = new MXResource.ptr(0, new Name.ptr(arrayType.zero(), 0)); _tuple$5 = unpackMXResource(msg, off); MXResource.copy(rb$5, _tuple$5[0]); err = _tuple$5[1]; r = rb$5; name = "MX"; } else if (_1 === (16)) { rb$6 = new TXTResource.ptr(sliceType$3.nil); _tuple$6 = unpackTXTResource(msg, off, hdr.Length); TXTResource.copy(rb$6, _tuple$6[0]); err = _tuple$6[1]; r = rb$6; name = "TXT"; } else if (_1 === (28)) { rb$7 = new AAAAResource.ptr(arrayType$2.zero()); _tuple$7 = unpackAAAAResource(msg, off); AAAAResource.copy(rb$7, _tuple$7[0]); err = _tuple$7[1]; r = rb$7; name = "AAAA"; } else if (_1 === (33)) { rb$8 = new SRVResource.ptr(0, 0, 0, new Name.ptr(arrayType.zero(), 0)); _tuple$8 = unpackSRVResource(msg, off); SRVResource.copy(rb$8, _tuple$8[0]); err = _tuple$8[1]; r = rb$8; name = "SRV"; } else if (_1 === (41)) { rb$9 = new OPTResource.ptr(sliceType$4.nil); _tuple$9 = unpackOPTResource(msg, off, hdr.Length); OPTResource.copy(rb$9, _tuple$9[0]); err = _tuple$9[1]; r = rb$9; name = "OPT"; } else { rb$10 = new UnknownResource.ptr(0, sliceType.nil); _tuple$10 = unpackUnknownResource(hdr.Type, msg, off, hdr.Length); UnknownResource.copy(rb$10, _tuple$10[0]); err = _tuple$10[1]; r = rb$10; name = "Unknown"; } if (!($interfaceIsEqual(err, $ifaceNil))) { return [$ifaceNil, off, new nestedError.ptr(name + " record", err)]; } return [r, off + ((hdr.Length >> 0)) >> 0, $ifaceNil]; }; CNAMEResource.ptr.prototype.realType = function() { var r; r = this; return 5; }; CNAMEResource.prototype.realType = function() { return this.$val.realType(); }; CNAMEResource.ptr.prototype.pack = function(msg, compression, compressionOff) { var compression, compressionOff, msg, r; r = this; return r.CNAME.pack(msg, compression, compressionOff); }; CNAMEResource.prototype.pack = function(msg, compression, compressionOff) { return this.$val.pack(msg, compression, compressionOff); }; CNAMEResource.ptr.prototype.GoString = function() { var r; r = this; return "dnsmessage.CNAMEResource{CNAME: " + r.CNAME.GoString() + "}"; }; CNAMEResource.prototype.GoString = function() { return this.$val.GoString(); }; unpackCNAMEResource = function(msg, off) { var _tuple, cname, err, msg, off; cname = new Name.ptr(arrayType.zero(), 0); _tuple = cname.unpack(msg, off); err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new CNAMEResource.ptr(new Name.ptr(arrayType.zero(), 0)), err]; } return [new CNAMEResource.ptr($clone(cname, Name)), $ifaceNil]; }; MXResource.ptr.prototype.realType = function() { var r; r = this; return 15; }; MXResource.prototype.realType = function() { return this.$val.realType(); }; MXResource.ptr.prototype.pack = function(msg, compression, compressionOff) { var _tuple, compression, compressionOff, err, msg, oldMsg, r; r = this; oldMsg = msg; msg = packUint16(msg, r.Pref); _tuple = r.MX.pack(msg, compression, compressionOff); msg = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [oldMsg, new nestedError.ptr("MXResource.MX", err)]; } return [msg, $ifaceNil]; }; MXResource.prototype.pack = function(msg, compression, compressionOff) { return this.$val.pack(msg, compression, compressionOff); }; MXResource.ptr.prototype.GoString = function() { var r; r = this; return "dnsmessage.MXResource{Pref: " + printUint16(r.Pref) + ", " + "MX: " + r.MX.GoString() + "}"; }; MXResource.prototype.GoString = function() { return this.$val.GoString(); }; unpackMXResource = function(msg, off) { var _tuple, _tuple$1, err, err$1, msg, mx, off, pref; _tuple = unpackUint16(msg, off); pref = _tuple[0]; off = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new MXResource.ptr(0, new Name.ptr(arrayType.zero(), 0)), new nestedError.ptr("Pref", err)]; } mx = new Name.ptr(arrayType.zero(), 0); _tuple$1 = mx.unpack(msg, off); err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return [new MXResource.ptr(0, new Name.ptr(arrayType.zero(), 0)), new nestedError.ptr("MX", err$1)]; } return [new MXResource.ptr(pref, $clone(mx, Name)), $ifaceNil]; }; NSResource.ptr.prototype.realType = function() { var r; r = this; return 2; }; NSResource.prototype.realType = function() { return this.$val.realType(); }; NSResource.ptr.prototype.pack = function(msg, compression, compressionOff) { var compression, compressionOff, msg, r; r = this; return r.NS.pack(msg, compression, compressionOff); }; NSResource.prototype.pack = function(msg, compression, compressionOff) { return this.$val.pack(msg, compression, compressionOff); }; NSResource.ptr.prototype.GoString = function() { var r; r = this; return "dnsmessage.NSResource{NS: " + r.NS.GoString() + "}"; }; NSResource.prototype.GoString = function() { return this.$val.GoString(); }; unpackNSResource = function(msg, off) { var _tuple, err, msg, ns, off; ns = new Name.ptr(arrayType.zero(), 0); _tuple = ns.unpack(msg, off); err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new NSResource.ptr(new Name.ptr(arrayType.zero(), 0)), err]; } return [new NSResource.ptr($clone(ns, Name)), $ifaceNil]; }; PTRResource.ptr.prototype.realType = function() { var r; r = this; return 12; }; PTRResource.prototype.realType = function() { return this.$val.realType(); }; PTRResource.ptr.prototype.pack = function(msg, compression, compressionOff) { var compression, compressionOff, msg, r; r = this; return r.PTR.pack(msg, compression, compressionOff); }; PTRResource.prototype.pack = function(msg, compression, compressionOff) { return this.$val.pack(msg, compression, compressionOff); }; PTRResource.ptr.prototype.GoString = function() { var r; r = this; return "dnsmessage.PTRResource{PTR: " + r.PTR.GoString() + "}"; }; PTRResource.prototype.GoString = function() { return this.$val.GoString(); }; unpackPTRResource = function(msg, off) { var _tuple, err, msg, off, ptr; ptr = new Name.ptr(arrayType.zero(), 0); _tuple = ptr.unpack(msg, off); err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new PTRResource.ptr(new Name.ptr(arrayType.zero(), 0)), err]; } return [new PTRResource.ptr($clone(ptr, Name)), $ifaceNil]; }; SOAResource.ptr.prototype.realType = function() { var r; r = this; return 6; }; SOAResource.prototype.realType = function() { return this.$val.realType(); }; SOAResource.ptr.prototype.pack = function(msg, compression, compressionOff) { var _tuple, _tuple$1, compression, compressionOff, err, msg, oldMsg, r; r = this; oldMsg = msg; _tuple = r.NS.pack(msg, compression, compressionOff); msg = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [oldMsg, new nestedError.ptr("SOAResource.NS", err)]; } _tuple$1 = r.MBox.pack(msg, compression, compressionOff); msg = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [oldMsg, new nestedError.ptr("SOAResource.MBox", err)]; } msg = packUint32(msg, r.Serial); msg = packUint32(msg, r.Refresh); msg = packUint32(msg, r.Retry); msg = packUint32(msg, r.Expire); return [packUint32(msg, r.MinTTL), $ifaceNil]; }; SOAResource.prototype.pack = function(msg, compression, compressionOff) { return this.$val.pack(msg, compression, compressionOff); }; SOAResource.ptr.prototype.GoString = function() { var r; r = this; return "dnsmessage.SOAResource{NS: " + r.NS.GoString() + ", " + "MBox: " + r.MBox.GoString() + ", " + "Serial: " + printUint32(r.Serial) + ", " + "Refresh: " + printUint32(r.Refresh) + ", " + "Retry: " + printUint32(r.Retry) + ", " + "Expire: " + printUint32(r.Expire) + ", " + "MinTTL: " + printUint32(r.MinTTL) + "}"; }; SOAResource.prototype.GoString = function() { return this.$val.GoString(); }; unpackSOAResource = function(msg, off) { var _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, err, expire, mbox, minTTL, msg, ns, off, refresh, retry, serial; ns = new Name.ptr(arrayType.zero(), 0); _tuple = ns.unpack(msg, off); off = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new SOAResource.ptr(new Name.ptr(arrayType.zero(), 0), new Name.ptr(arrayType.zero(), 0), 0, 0, 0, 0, 0), new nestedError.ptr("NS", err)]; } mbox = new Name.ptr(arrayType.zero(), 0); _tuple$1 = mbox.unpack(msg, off); off = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new SOAResource.ptr(new Name.ptr(arrayType.zero(), 0), new Name.ptr(arrayType.zero(), 0), 0, 0, 0, 0, 0), new nestedError.ptr("MBox", err)]; } _tuple$2 = unpackUint32(msg, off); serial = _tuple$2[0]; off = _tuple$2[1]; err = _tuple$2[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new SOAResource.ptr(new Name.ptr(arrayType.zero(), 0), new Name.ptr(arrayType.zero(), 0), 0, 0, 0, 0, 0), new nestedError.ptr("Serial", err)]; } _tuple$3 = unpackUint32(msg, off); refresh = _tuple$3[0]; off = _tuple$3[1]; err = _tuple$3[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new SOAResource.ptr(new Name.ptr(arrayType.zero(), 0), new Name.ptr(arrayType.zero(), 0), 0, 0, 0, 0, 0), new nestedError.ptr("Refresh", err)]; } _tuple$4 = unpackUint32(msg, off); retry = _tuple$4[0]; off = _tuple$4[1]; err = _tuple$4[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new SOAResource.ptr(new Name.ptr(arrayType.zero(), 0), new Name.ptr(arrayType.zero(), 0), 0, 0, 0, 0, 0), new nestedError.ptr("Retry", err)]; } _tuple$5 = unpackUint32(msg, off); expire = _tuple$5[0]; off = _tuple$5[1]; err = _tuple$5[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new SOAResource.ptr(new Name.ptr(arrayType.zero(), 0), new Name.ptr(arrayType.zero(), 0), 0, 0, 0, 0, 0), new nestedError.ptr("Expire", err)]; } _tuple$6 = unpackUint32(msg, off); minTTL = _tuple$6[0]; err = _tuple$6[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new SOAResource.ptr(new Name.ptr(arrayType.zero(), 0), new Name.ptr(arrayType.zero(), 0), 0, 0, 0, 0, 0), new nestedError.ptr("MinTTL", err)]; } return [new SOAResource.ptr($clone(ns, Name), $clone(mbox, Name), serial, refresh, retry, expire, minTTL), $ifaceNil]; }; TXTResource.ptr.prototype.realType = function() { var r; r = this; return 16; }; TXTResource.prototype.realType = function() { return this.$val.realType(); }; TXTResource.ptr.prototype.pack = function(msg, compression, compressionOff) { var _i, _ref, _tuple, compression, compressionOff, err, msg, oldMsg, r, s; r = this; oldMsg = msg; _ref = r.TXT; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } s = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); err = $ifaceNil; _tuple = packText(msg, s); msg = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [oldMsg, err]; } _i++; } return [msg, $ifaceNil]; }; TXTResource.prototype.pack = function(msg, compression, compressionOff) { return this.$val.pack(msg, compression, compressionOff); }; TXTResource.ptr.prototype.GoString = function() { var _i, _ref, r, s, t, x; r = this; s = "dnsmessage.TXTResource{TXT: []string{"; if (r.TXT.$length === 0) { return s + "}}"; } s = s + ("\"" + printString((new sliceType($stringToBytes((x = r.TXT, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0]))))))); _ref = $subslice(r.TXT, 1); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } t = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); s = s + ("\", \"" + printString((new sliceType($stringToBytes(t))))); _i++; } return s + "\"}}"; }; TXTResource.prototype.GoString = function() { return this.$val.GoString(); }; unpackTXTResource = function(msg, off, length) { var _tuple, err, length, msg, n, off, t, txts; txts = $makeSlice(sliceType$3, 0, 1); n = 0; while (true) { if (!(n < length)) { break; } t = ""; err = $ifaceNil; _tuple = unpackText(msg, off); t = _tuple[0]; off = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new TXTResource.ptr(sliceType$3.nil), new nestedError.ptr("text", err)]; } if ((length - n << 16 >>> 16) < (((t.length << 16 >>> 16)) + 1 << 16 >>> 16)) { return [new TXTResource.ptr(sliceType$3.nil), errCalcLen]; } n = n + ((((t.length << 16 >>> 16)) + 1 << 16 >>> 16)) << 16 >>> 16; txts = $append(txts, t); } return [new TXTResource.ptr(txts), $ifaceNil]; }; SRVResource.ptr.prototype.realType = function() { var r; r = this; return 33; }; SRVResource.prototype.realType = function() { return this.$val.realType(); }; SRVResource.ptr.prototype.pack = function(msg, compression, compressionOff) { var _tuple, compression, compressionOff, err, msg, oldMsg, r; r = this; oldMsg = msg; msg = packUint16(msg, r.Priority); msg = packUint16(msg, r.Weight); msg = packUint16(msg, r.Port); _tuple = r.Target.pack(msg, false, compressionOff); msg = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [oldMsg, new nestedError.ptr("SRVResource.Target", err)]; } return [msg, $ifaceNil]; }; SRVResource.prototype.pack = function(msg, compression, compressionOff) { return this.$val.pack(msg, compression, compressionOff); }; SRVResource.ptr.prototype.GoString = function() { var r; r = this; return "dnsmessage.SRVResource{Priority: " + printUint16(r.Priority) + ", " + "Weight: " + printUint16(r.Weight) + ", " + "Port: " + printUint16(r.Port) + ", " + "Target: " + r.Target.GoString() + "}"; }; SRVResource.prototype.GoString = function() { return this.$val.GoString(); }; unpackSRVResource = function(msg, off) { var _tuple, _tuple$1, _tuple$2, _tuple$3, err, err$1, msg, off, port, priority, target, weight; _tuple = unpackUint16(msg, off); priority = _tuple[0]; off = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new SRVResource.ptr(0, 0, 0, new Name.ptr(arrayType.zero(), 0)), new nestedError.ptr("Priority", err)]; } _tuple$1 = unpackUint16(msg, off); weight = _tuple$1[0]; off = _tuple$1[1]; err = _tuple$1[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new SRVResource.ptr(0, 0, 0, new Name.ptr(arrayType.zero(), 0)), new nestedError.ptr("Weight", err)]; } _tuple$2 = unpackUint16(msg, off); port = _tuple$2[0]; off = _tuple$2[1]; err = _tuple$2[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new SRVResource.ptr(0, 0, 0, new Name.ptr(arrayType.zero(), 0)), new nestedError.ptr("Port", err)]; } target = new Name.ptr(arrayType.zero(), 0); _tuple$3 = target.unpackCompressed(msg, off, false); err$1 = _tuple$3[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return [new SRVResource.ptr(0, 0, 0, new Name.ptr(arrayType.zero(), 0)), new nestedError.ptr("Target", err$1)]; } return [new SRVResource.ptr(priority, weight, port, $clone(target, Name)), $ifaceNil]; }; AResource.ptr.prototype.realType = function() { var r; r = this; return 1; }; AResource.prototype.realType = function() { return this.$val.realType(); }; AResource.ptr.prototype.pack = function(msg, compression, compressionOff) { var compression, compressionOff, msg, r; r = this; return [packBytes(msg, new sliceType(r.A)), $ifaceNil]; }; AResource.prototype.pack = function(msg, compression, compressionOff) { return this.$val.pack(msg, compression, compressionOff); }; AResource.ptr.prototype.GoString = function() { var r; r = this; return "dnsmessage.AResource{A: [4]byte{" + printByteSlice(new sliceType(r.A)) + "}}"; }; AResource.prototype.GoString = function() { return this.$val.GoString(); }; unpackAResource = function(msg, off) { var _tuple, a, err, msg, off; a = arrayType$1.zero(); _tuple = unpackBytes(msg, off, new sliceType(a)); err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new AResource.ptr(arrayType$1.zero()), err]; } return [new AResource.ptr($clone(a, arrayType$1)), $ifaceNil]; }; AAAAResource.ptr.prototype.realType = function() { var r; r = this; return 28; }; AAAAResource.prototype.realType = function() { return this.$val.realType(); }; AAAAResource.ptr.prototype.GoString = function() { var r; r = this; return "dnsmessage.AAAAResource{AAAA: [16]byte{" + printByteSlice(new sliceType(r.AAAA)) + "}}"; }; AAAAResource.prototype.GoString = function() { return this.$val.GoString(); }; AAAAResource.ptr.prototype.pack = function(msg, compression, compressionOff) { var compression, compressionOff, msg, r; r = this; return [packBytes(msg, new sliceType(r.AAAA)), $ifaceNil]; }; AAAAResource.prototype.pack = function(msg, compression, compressionOff) { return this.$val.pack(msg, compression, compressionOff); }; unpackAAAAResource = function(msg, off) { var _tuple, aaaa, err, msg, off; aaaa = arrayType$2.zero(); _tuple = unpackBytes(msg, off, new sliceType(aaaa)); err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new AAAAResource.ptr(arrayType$2.zero()), err]; } return [new AAAAResource.ptr($clone(aaaa, arrayType$2)), $ifaceNil]; }; Option.ptr.prototype.GoString = function() { var o; o = this; return "dnsmessage.Option{Code: " + printUint16(o.Code) + ", " + "Data: []byte{" + printByteSlice(o.Data) + "}}"; }; Option.prototype.GoString = function() { return this.$val.GoString(); }; OPTResource.ptr.prototype.realType = function() { var r; r = this; return 41; }; OPTResource.prototype.realType = function() { return this.$val.realType(); }; OPTResource.ptr.prototype.pack = function(msg, compression, compressionOff) { var _i, _ref, compression, compressionOff, l, msg, opt, r; r = this; _ref = r.Options; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } opt = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), Option); msg = packUint16(msg, opt.Code); l = ((opt.Data.$length << 16 >>> 16)); msg = packUint16(msg, l); msg = packBytes(msg, opt.Data); _i++; } return [msg, $ifaceNil]; }; OPTResource.prototype.pack = function(msg, compression, compressionOff) { return this.$val.pack(msg, compression, compressionOff); }; OPTResource.ptr.prototype.GoString = function() { var _i, _ref, o, r, s, x; r = this; s = "dnsmessage.OPTResource{Options: []dnsmessage.Option{"; if (r.Options.$length === 0) { return s + "}}"; } s = s + ((x = r.Options, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])).GoString()); _ref = $subslice(r.Options, 1); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } o = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), Option); s = s + (", " + o.GoString()); _i++; } return s + "}}"; }; OPTResource.prototype.GoString = function() { return this.$val.GoString(); }; unpackOPTResource = function(msg, off, length) { var _tuple, _tuple$1, err, l, length, msg, o, off, oldOff, opts; opts = sliceType$4.nil; oldOff = off; while (true) { if (!(off < (oldOff + ((length >> 0)) >> 0))) { break; } err = $ifaceNil; o = new Option.ptr(0, sliceType.nil); _tuple = unpackUint16(msg, off); o.Code = _tuple[0]; off = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new OPTResource.ptr(sliceType$4.nil), new nestedError.ptr("Code", err)]; } l = 0; _tuple$1 = unpackUint16(msg, off); l = _tuple$1[0]; off = _tuple$1[1]; err = _tuple$1[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new OPTResource.ptr(sliceType$4.nil), new nestedError.ptr("Data", err)]; } o.Data = $makeSlice(sliceType, l); if (!(($copySlice(o.Data, $subslice(msg, off)) === ((l >> 0))))) { return [new OPTResource.ptr(sliceType$4.nil), new nestedError.ptr("Data", errCalcLen)]; } off = off + (((l >> 0))) >> 0; opts = $append(opts, o); } return [new OPTResource.ptr(opts), $ifaceNil]; }; UnknownResource.ptr.prototype.realType = function() { var r; r = this; return r.Type; }; UnknownResource.prototype.realType = function() { return this.$val.realType(); }; UnknownResource.ptr.prototype.pack = function(msg, compression, compressionOff) { var compression, compressionOff, msg, r; r = this; return [packBytes(msg, r.Data), $ifaceNil]; }; UnknownResource.prototype.pack = function(msg, compression, compressionOff) { return this.$val.pack(msg, compression, compressionOff); }; UnknownResource.ptr.prototype.GoString = function() { var r; r = this; return "dnsmessage.UnknownResource{Type: " + new Type(r.Type).GoString() + ", " + "Data: []byte{" + printByteSlice(r.Data) + "}}"; }; UnknownResource.prototype.GoString = function() { return this.$val.GoString(); }; unpackUnknownResource = function(recordType, msg, off, length) { var _tuple, err, length, msg, off, parsed, recordType; parsed = new UnknownResource.ptr(recordType, $makeSlice(sliceType, length)); _tuple = unpackBytes(msg, off, parsed.Data); err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [new UnknownResource.ptr(0, sliceType.nil), err]; } return [parsed, $ifaceNil]; }; Type.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "GoString", name: "GoString", pkg: "", typ: $funcType([], [$String], false)}]; Class.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "GoString", name: "GoString", pkg: "", typ: $funcType([], [$String], false)}]; OpCode.methods = [{prop: "GoString", name: "GoString", pkg: "", typ: $funcType([], [$String], false)}]; RCode.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "GoString", name: "GoString", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$1.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$2.methods = [{prop: "pack", name: "pack", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([], [$Uint16, $Uint16], false)}, {prop: "GoString", name: "GoString", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$4.methods = [{prop: "count", name: "count", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([section], [$Uint16], false)}, {prop: "pack", name: "pack", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([sliceType], [sliceType], false)}, {prop: "unpack", name: "unpack", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([sliceType, $Int], [$Int, $error], false)}, {prop: "header", name: "header", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([], [Header], false)}]; ptrType$5.methods = [{prop: "GoString", name: "GoString", pkg: "", typ: $funcType([], [$String], false)}, {prop: "pack", name: "pack", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([sliceType, mapType, $Int], [sliceType, $error], false)}]; ptrType$6.methods = [{prop: "Start", name: "Start", pkg: "", typ: $funcType([sliceType], [Header, $error], false)}, {prop: "checkAdvance", name: "checkAdvance", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([section], [$error], false)}, {prop: "resource", name: "resource", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([section], [Resource, $error], false)}, {prop: "resourceHeader", name: "resourceHeader", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([section], [ResourceHeader, $error], false)}, {prop: "skipResource", name: "skipResource", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([section], [$error], false)}, {prop: "Question", name: "Question", pkg: "", typ: $funcType([], [Question, $error], false)}, {prop: "AllQuestions", name: "AllQuestions", pkg: "", typ: $funcType([], [sliceType$1, $error], false)}, {prop: "SkipQuestion", name: "SkipQuestion", pkg: "", typ: $funcType([], [$error], false)}, {prop: "SkipAllQuestions", name: "SkipAllQuestions", pkg: "", typ: $funcType([], [$error], false)}, {prop: "AnswerHeader", name: "AnswerHeader", pkg: "", typ: $funcType([], [ResourceHeader, $error], false)}, {prop: "Answer", name: "Answer", pkg: "", typ: $funcType([], [Resource, $error], false)}, {prop: "AllAnswers", name: "AllAnswers", pkg: "", typ: $funcType([], [sliceType$2, $error], false)}, {prop: "SkipAnswer", name: "SkipAnswer", pkg: "", typ: $funcType([], [$error], false)}, {prop: "SkipAllAnswers", name: "SkipAllAnswers", pkg: "", typ: $funcType([], [$error], false)}, {prop: "AuthorityHeader", name: "AuthorityHeader", pkg: "", typ: $funcType([], [ResourceHeader, $error], false)}, {prop: "Authority", name: "Authority", pkg: "", typ: $funcType([], [Resource, $error], false)}, {prop: "AllAuthorities", name: "AllAuthorities", pkg: "", typ: $funcType([], [sliceType$2, $error], false)}, {prop: "SkipAuthority", name: "SkipAuthority", pkg: "", typ: $funcType([], [$error], false)}, {prop: "SkipAllAuthorities", name: "SkipAllAuthorities", pkg: "", typ: $funcType([], [$error], false)}, {prop: "AdditionalHeader", name: "AdditionalHeader", pkg: "", typ: $funcType([], [ResourceHeader, $error], false)}, {prop: "Additional", name: "Additional", pkg: "", typ: $funcType([], [Resource, $error], false)}, {prop: "AllAdditionals", name: "AllAdditionals", pkg: "", typ: $funcType([], [sliceType$2, $error], false)}, {prop: "SkipAdditional", name: "SkipAdditional", pkg: "", typ: $funcType([], [$error], false)}, {prop: "SkipAllAdditionals", name: "SkipAllAdditionals", pkg: "", typ: $funcType([], [$error], false)}, {prop: "CNAMEResource", name: "CNAMEResource", pkg: "", typ: $funcType([], [CNAMEResource, $error], false)}, {prop: "MXResource", name: "MXResource", pkg: "", typ: $funcType([], [MXResource, $error], false)}, {prop: "NSResource", name: "NSResource", pkg: "", typ: $funcType([], [NSResource, $error], false)}, {prop: "PTRResource", name: "PTRResource", pkg: "", typ: $funcType([], [PTRResource, $error], false)}, {prop: "SOAResource", name: "SOAResource", pkg: "", typ: $funcType([], [SOAResource, $error], false)}, {prop: "TXTResource", name: "TXTResource", pkg: "", typ: $funcType([], [TXTResource, $error], false)}, {prop: "SRVResource", name: "SRVResource", pkg: "", typ: $funcType([], [SRVResource, $error], false)}, {prop: "AResource", name: "AResource", pkg: "", typ: $funcType([], [AResource, $error], false)}, {prop: "AAAAResource", name: "AAAAResource", pkg: "", typ: $funcType([], [AAAAResource, $error], false)}, {prop: "OPTResource", name: "OPTResource", pkg: "", typ: $funcType([], [OPTResource, $error], false)}, {prop: "UnknownResource", name: "UnknownResource", pkg: "", typ: $funcType([], [UnknownResource, $error], false)}]; ptrType$7.methods = [{prop: "EnableCompression", name: "EnableCompression", pkg: "", typ: $funcType([], [], false)}, {prop: "startCheck", name: "startCheck", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([section], [$error], false)}, {prop: "StartQuestions", name: "StartQuestions", pkg: "", typ: $funcType([], [$error], false)}, {prop: "StartAnswers", name: "StartAnswers", pkg: "", typ: $funcType([], [$error], false)}, {prop: "StartAuthorities", name: "StartAuthorities", pkg: "", typ: $funcType([], [$error], false)}, {prop: "StartAdditionals", name: "StartAdditionals", pkg: "", typ: $funcType([], [$error], false)}, {prop: "incrementSectionCount", name: "incrementSectionCount", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([], [$error], false)}, {prop: "Question", name: "Question", pkg: "", typ: $funcType([Question], [$error], false)}, {prop: "checkResourceSection", name: "checkResourceSection", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([], [$error], false)}, {prop: "CNAMEResource", name: "CNAMEResource", pkg: "", typ: $funcType([ResourceHeader, CNAMEResource], [$error], false)}, {prop: "MXResource", name: "MXResource", pkg: "", typ: $funcType([ResourceHeader, MXResource], [$error], false)}, {prop: "NSResource", name: "NSResource", pkg: "", typ: $funcType([ResourceHeader, NSResource], [$error], false)}, {prop: "PTRResource", name: "PTRResource", pkg: "", typ: $funcType([ResourceHeader, PTRResource], [$error], false)}, {prop: "SOAResource", name: "SOAResource", pkg: "", typ: $funcType([ResourceHeader, SOAResource], [$error], false)}, {prop: "TXTResource", name: "TXTResource", pkg: "", typ: $funcType([ResourceHeader, TXTResource], [$error], false)}, {prop: "SRVResource", name: "SRVResource", pkg: "", typ: $funcType([ResourceHeader, SRVResource], [$error], false)}, {prop: "AResource", name: "AResource", pkg: "", typ: $funcType([ResourceHeader, AResource], [$error], false)}, {prop: "AAAAResource", name: "AAAAResource", pkg: "", typ: $funcType([ResourceHeader, AAAAResource], [$error], false)}, {prop: "OPTResource", name: "OPTResource", pkg: "", typ: $funcType([ResourceHeader, OPTResource], [$error], false)}, {prop: "UnknownResource", name: "UnknownResource", pkg: "", typ: $funcType([ResourceHeader, UnknownResource], [$error], false)}, {prop: "Finish", name: "Finish", pkg: "", typ: $funcType([], [sliceType, $error], false)}]; ptrType$8.methods = [{prop: "GoString", name: "GoString", pkg: "", typ: $funcType([], [$String], false)}, {prop: "pack", name: "pack", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([sliceType, mapType, $Int], [sliceType, $Int, $error], false)}, {prop: "unpack", name: "unpack", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([sliceType, $Int], [$Int, $error], false)}, {prop: "fixLen", name: "fixLen", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([sliceType, $Int, $Int], [$error], false)}, {prop: "SetEDNS0", name: "SetEDNS0", pkg: "", typ: $funcType([$Int, RCode, $Bool], [$error], false)}, {prop: "DNSSECAllowed", name: "DNSSECAllowed", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "ExtendedRCode", name: "ExtendedRCode", pkg: "", typ: $funcType([RCode], [RCode], false)}]; Name.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$9.methods = [{prop: "GoString", name: "GoString", pkg: "", typ: $funcType([], [$String], false)}, {prop: "pack", name: "pack", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([sliceType, mapType, $Int], [sliceType, $error], false)}, {prop: "unpack", name: "unpack", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([sliceType, $Int], [$Int, $error], false)}, {prop: "unpackCompressed", name: "unpackCompressed", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([sliceType, $Int, $Bool], [$Int, $error], false)}]; ptrType$10.methods = [{prop: "pack", name: "pack", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([sliceType, mapType, $Int], [sliceType, $error], false)}, {prop: "GoString", name: "GoString", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$11.methods = [{prop: "realType", name: "realType", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([], [Type], false)}, {prop: "pack", name: "pack", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([sliceType, mapType, $Int], [sliceType, $error], false)}, {prop: "GoString", name: "GoString", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$12.methods = [{prop: "realType", name: "realType", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([], [Type], false)}, {prop: "pack", name: "pack", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([sliceType, mapType, $Int], [sliceType, $error], false)}, {prop: "GoString", name: "GoString", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$13.methods = [{prop: "realType", name: "realType", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([], [Type], false)}, {prop: "pack", name: "pack", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([sliceType, mapType, $Int], [sliceType, $error], false)}, {prop: "GoString", name: "GoString", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$14.methods = [{prop: "realType", name: "realType", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([], [Type], false)}, {prop: "pack", name: "pack", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([sliceType, mapType, $Int], [sliceType, $error], false)}, {prop: "GoString", name: "GoString", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$15.methods = [{prop: "realType", name: "realType", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([], [Type], false)}, {prop: "pack", name: "pack", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([sliceType, mapType, $Int], [sliceType, $error], false)}, {prop: "GoString", name: "GoString", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$16.methods = [{prop: "realType", name: "realType", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([], [Type], false)}, {prop: "pack", name: "pack", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([sliceType, mapType, $Int], [sliceType, $error], false)}, {prop: "GoString", name: "GoString", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$17.methods = [{prop: "realType", name: "realType", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([], [Type], false)}, {prop: "pack", name: "pack", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([sliceType, mapType, $Int], [sliceType, $error], false)}, {prop: "GoString", name: "GoString", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$18.methods = [{prop: "realType", name: "realType", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([], [Type], false)}, {prop: "pack", name: "pack", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([sliceType, mapType, $Int], [sliceType, $error], false)}, {prop: "GoString", name: "GoString", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$19.methods = [{prop: "realType", name: "realType", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([], [Type], false)}, {prop: "GoString", name: "GoString", pkg: "", typ: $funcType([], [$String], false)}, {prop: "pack", name: "pack", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([sliceType, mapType, $Int], [sliceType, $error], false)}]; ptrType$20.methods = [{prop: "realType", name: "realType", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([], [Type], false)}, {prop: "pack", name: "pack", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([sliceType, mapType, $Int], [sliceType, $error], false)}, {prop: "GoString", name: "GoString", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$21.methods = [{prop: "GoString", name: "GoString", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$22.methods = [{prop: "realType", name: "realType", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([], [Type], false)}, {prop: "pack", name: "pack", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([sliceType, mapType, $Int], [sliceType, $error], false)}, {prop: "GoString", name: "GoString", pkg: "", typ: $funcType([], [$String], false)}]; nestedError.init("vendor/golang.org/x/net/dns/dnsmessage", [{prop: "s", name: "s", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}]); Header.init("", [{prop: "ID", name: "ID", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Response", name: "Response", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "OpCode", name: "OpCode", embedded: false, exported: true, typ: OpCode, tag: ""}, {prop: "Authoritative", name: "Authoritative", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "Truncated", name: "Truncated", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "RecursionDesired", name: "RecursionDesired", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "RecursionAvailable", name: "RecursionAvailable", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "RCode", name: "RCode", embedded: false, exported: true, typ: RCode, tag: ""}]); header.init("vendor/golang.org/x/net/dns/dnsmessage", [{prop: "id", name: "id", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "bits", name: "bits", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "questions", name: "questions", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "answers", name: "answers", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "authorities", name: "authorities", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "additionals", name: "additionals", embedded: false, exported: false, typ: $Uint16, tag: ""}]); Resource.init("", [{prop: "Header", name: "Header", embedded: false, exported: true, typ: ResourceHeader, tag: ""}, {prop: "Body", name: "Body", embedded: false, exported: true, typ: ResourceBody, tag: ""}]); ResourceBody.init([{prop: "GoString", name: "GoString", pkg: "", typ: $funcType([], [$String], false)}, {prop: "pack", name: "pack", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([sliceType, mapType, $Int], [sliceType, $error], false)}, {prop: "realType", name: "realType", pkg: "vendor/golang.org/x/net/dns/dnsmessage", typ: $funcType([], [Type], false)}]); Parser.init("vendor/golang.org/x/net/dns/dnsmessage", [{prop: "msg", name: "msg", embedded: false, exported: false, typ: sliceType, tag: ""}, {prop: "header", name: "header", embedded: false, exported: false, typ: header, tag: ""}, {prop: "section", name: "section", embedded: false, exported: false, typ: section, tag: ""}, {prop: "off", name: "off", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "index", name: "index", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "resHeaderValid", name: "resHeaderValid", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "resHeader", name: "resHeader", embedded: false, exported: false, typ: ResourceHeader, tag: ""}]); Builder.init("vendor/golang.org/x/net/dns/dnsmessage", [{prop: "msg", name: "msg", embedded: false, exported: false, typ: sliceType, tag: ""}, {prop: "section", name: "section", embedded: false, exported: false, typ: section, tag: ""}, {prop: "header", name: "header", embedded: false, exported: false, typ: header, tag: ""}, {prop: "start", name: "start", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "compression", name: "compression", embedded: false, exported: false, typ: mapType, tag: ""}]); ResourceHeader.init("", [{prop: "Name", name: "Name", embedded: false, exported: true, typ: Name, tag: ""}, {prop: "Type", name: "Type", embedded: false, exported: true, typ: Type, tag: ""}, {prop: "Class", name: "Class", embedded: false, exported: true, typ: Class, tag: ""}, {prop: "TTL", name: "TTL", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Length", name: "Length", embedded: false, exported: true, typ: $Uint16, tag: ""}]); Name.init("", [{prop: "Data", name: "Data", embedded: false, exported: true, typ: arrayType, tag: ""}, {prop: "Length", name: "Length", embedded: false, exported: true, typ: $Uint8, tag: ""}]); Question.init("", [{prop: "Name", name: "Name", embedded: false, exported: true, typ: Name, tag: ""}, {prop: "Type", name: "Type", embedded: false, exported: true, typ: Type, tag: ""}, {prop: "Class", name: "Class", embedded: false, exported: true, typ: Class, tag: ""}]); CNAMEResource.init("", [{prop: "CNAME", name: "CNAME", embedded: false, exported: true, typ: Name, tag: ""}]); MXResource.init("", [{prop: "Pref", name: "Pref", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "MX", name: "MX", embedded: false, exported: true, typ: Name, tag: ""}]); NSResource.init("", [{prop: "NS", name: "NS", embedded: false, exported: true, typ: Name, tag: ""}]); PTRResource.init("", [{prop: "PTR", name: "PTR", embedded: false, exported: true, typ: Name, tag: ""}]); SOAResource.init("", [{prop: "NS", name: "NS", embedded: false, exported: true, typ: Name, tag: ""}, {prop: "MBox", name: "MBox", embedded: false, exported: true, typ: Name, tag: ""}, {prop: "Serial", name: "Serial", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Refresh", name: "Refresh", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Retry", name: "Retry", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Expire", name: "Expire", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "MinTTL", name: "MinTTL", embedded: false, exported: true, typ: $Uint32, tag: ""}]); TXTResource.init("", [{prop: "TXT", name: "TXT", embedded: false, exported: true, typ: sliceType$3, tag: ""}]); SRVResource.init("", [{prop: "Priority", name: "Priority", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Weight", name: "Weight", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Port", name: "Port", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Target", name: "Target", embedded: false, exported: true, typ: Name, tag: ""}]); AResource.init("", [{prop: "A", name: "A", embedded: false, exported: true, typ: arrayType$1, tag: ""}]); AAAAResource.init("", [{prop: "AAAA", name: "AAAA", embedded: false, exported: true, typ: arrayType$2, tag: ""}]); OPTResource.init("", [{prop: "Options", name: "Options", embedded: false, exported: true, typ: sliceType$4, tag: ""}]); Option.init("", [{prop: "Code", name: "Code", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Data", name: "Data", embedded: false, exported: true, typ: sliceType, tag: ""}]); UnknownResource.init("", [{prop: "Type", name: "Type", embedded: false, exported: true, typ: Type, tag: ""}, {prop: "Data", name: "Data", embedded: false, exported: true, typ: sliceType, 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; } typeNames = $makeMap(Type.keyFor, [{ k: 1, v: "TypeA" }, { k: 2, v: "TypeNS" }, { k: 5, v: "TypeCNAME" }, { k: 6, v: "TypeSOA" }, { k: 12, v: "TypePTR" }, { k: 15, v: "TypeMX" }, { k: 16, v: "TypeTXT" }, { k: 28, v: "TypeAAAA" }, { k: 33, v: "TypeSRV" }, { k: 41, v: "TypeOPT" }, { k: 11, v: "TypeWKS" }, { k: 13, v: "TypeHINFO" }, { k: 14, v: "TypeMINFO" }, { k: 252, v: "TypeAXFR" }, { k: 255, v: "TypeALL" }]); classNames = $makeMap(Class.keyFor, [{ k: 1, v: "ClassINET" }, { k: 2, v: "ClassCSNET" }, { k: 3, v: "ClassCHAOS" }, { k: 4, v: "ClassHESIOD" }, { k: 255, v: "ClassANY" }]); rCodeNames = $makeMap(RCode.keyFor, [{ k: 0, v: "RCodeSuccess" }, { k: 1, v: "RCodeFormatError" }, { k: 2, v: "RCodeServerFailure" }, { k: 3, v: "RCodeNameError" }, { k: 4, v: "RCodeNotImplemented" }, { k: 5, v: "RCodeRefused" }]); $pkg.ErrNotStarted = errors.New("parsing/packing of this type isn't available yet"); $pkg.ErrSectionDone = errors.New("parsing/packing of this section has completed"); errBaseLen = errors.New("insufficient data for base length type"); errCalcLen = errors.New("insufficient data for calculated length type"); errReserved = errors.New("segment prefix is reserved"); errTooManyPtr = errors.New("too many pointers (>10)"); errInvalidPtr = errors.New("invalid pointer"); errNilResouceBody = errors.New("nil resource body"); errResourceLen = errors.New("insufficient data for resource body length"); errSegTooLong = errors.New("segment length too long"); errZeroSegLen = errors.New("zero length segment"); errResTooLong = errors.New("resource length too long"); errTooManyQuestions = errors.New("too many Questions to pack (>65535)"); errTooManyAnswers = errors.New("too many Answers to pack (>65535)"); errTooManyAuthorities = errors.New("too many Authorities to pack (>65535)"); errTooManyAdditionals = errors.New("too many Additionals to pack (>65535)"); errNonCanonicalName = errors.New("name is not in canonical format (it must end with a .)"); errStringTooLong = errors.New("character string exceeds maximum length (255)"); errCompressedSRV = errors.New("compressed name in SRV resource data"); sectionNames = $makeMap(section.keyFor, [{ k: 1, v: "header" }, { k: 2, v: "Question" }, { k: 3, v: "Answer" }, { k: 4, v: "Authority" }, { k: 5, v: "Additional" }]); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["net"] = (function() { var $pkg = {}, $init, context, errors, js, bytealg, itoa, nettrace, poll, singleflight, io, os, runtime, sort, sync, atomic, syscall, time, dnsmessage, UnixAddr, UnixConn, UDPAddr, UDPConn, TCPAddr, TCPConn, sockaddr, rawConn, file, nssConf, nssSource, nssCriterion, Addr, Conn, conn, PacketConn, Listener, Error, OpError, timeout, temporary, ParseError, AddrError, UnknownNetworkError, timeoutError, DNSError, writerOnly, buffersWriter, Buffers, HardwareAddr, Resolver, onlyValuesCtx, ipStackCapabilities, addrList, IPAddr, IPConn, IP, IPMask, IPNet, Interface, Flags, ipv6ZoneCache, netFD, dnsConfig, resolverConfig, hostLookupOrder, SRV, byPriorityWeight, MX, byPref, NS, Dialer, sysDialer, conf, ipAttr, byRFC6724, policyTableEntry, policyTable, byMaskLength, scope, result, dialResult, structType, arrayType, ptrType, sliceType, mapType, structType$1, ptrType$1, ptrType$2, ptrType$3, sliceType$1, ptrType$4, ptrType$5, sliceType$2, ptrType$6, ptrType$7, ptrType$8, ptrType$9, arrayType$1, ptrType$10, ptrType$11, ptrType$13, ptrType$14, ptrType$15, ptrType$16, ptrType$17, ptrType$18, ptrType$19, ptrType$20, ptrType$21, ptrType$22, ptrType$24, arrayType$2, arrayType$3, ptrType$25, ptrType$26, structType$2, ptrType$28, sliceType$3, sliceType$4, ptrType$29, ptrType$30, ptrType$31, sliceType$5, ptrType$32, sliceType$6, arrayType$6, ptrType$33, sliceType$7, ptrType$34, sliceType$8, arrayType$7, sliceType$9, ptrType$35, funcType, sliceType$10, structType$3, sliceType$11, arrayType$8, ptrType$36, sliceType$12, ptrType$37, sliceType$13, ptrType$38, sliceType$14, ptrType$39, funcType$1, ptrType$40, sliceType$15, sliceType$16, funcType$2, funcType$3, chanType, chanType$5, mapType$1, ptrType$44, ptrType$45, ptrType$47, funcType$4, ptrType$48, funcType$5, ptrType$49, ptrType$50, mapType$2, mapType$3, funcType$6, funcType$7, ptrType$51, ptrType$52, ptrType$53, ptrType$56, ptrType$57, onceReadServices, netGo, netCgo, listenerBacklogCache, errNoSuitableAddress, errMissingAddress, errCanceled, aLongTimeAgo, noDeadline, errTimeout, errNoSuchHost, errClosed, onceReadProtocols, protocols, services, dnsWaitGroup, errMalformedDNSRecordsDetail, ipStackCaps, v4InV6Prefix, classAMask, classBMask, classCMask, errInvalidInterface, errInvalidInterfaceIndex, errInvalidInterfaceName, errNoSuchInterface, errNoSuchMulticastInterface, flagNames, zoneCache, hosts, testHookCanceledDial, socketFunc, connectFunc, listenFunc, getsockoptIntFunc, testHookDialTCP, testHookHostsPath, testHookLookupIP, testHookSetKeepAlive, defaultNS, getHostname, errLameReferral, errCannotUnmarshalDNSMessage, errCannotMarshalDNSMessage, errServerMisbehaving, errInvalidDNSResponse, errNoAnswerFromDNSServer, errServerTemporarilyMisbehaving, resolvConf, lookupOrderName, confOnce, confVal, rfc6724policyTable, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, setReadMsgCloseOnExec, unixSocket, sockaddrToUnix, sockaddrToUnixgram, sockaddrToUnixpacket, sotypeToNet, ResolveUnixAddr, newUnixConn, sockaddrToUDP, newUDPConn, DialUDP, setKeepAlivePeriod, setNoDelay, sockaddrToTCP, selfConnect, spuriousENOTAVAIL, newTCPConn, roundDurationUp, splice, boolint, setReadBuffer, setWriteBuffer, setKeepAlive, setLinger, setDefaultSockopts, setDefaultListenerSockopts, setDefaultMulticastSockopts, socket, sysSocket, sendFile, newRawConn, readServices, goLookupPort, parsePort, open, stat, countAnyByte, splitAtBytes, getFields, dtoi, xtoi, xtoi2, appendHex, count, last, lowerASCIIBytes, lowerASCII, trimSpace, isSpace, removeComment, foreachLine, foreachField, stringsHasSuffix, stringsHasSuffixFold, stringsHasPrefix, stringsEqualFold, readFull, goDebugString, parseNSSConfFile, parseNSSConf, parseCriteria, listenerBacklog, mapErr, genericReadFrom, readProtocols, lookupProtocol, lookupProtocolMap, lookupPortMap, ipVersion, withUnexpiredValuesPreserved, lookupIPReturn, ipAddrsEface, favoriteAddrFamily, internetSocket, ipToSockaddr, supportsIPv4, supportsIPv4map, isIPv4, filterAddrList, ipv4only, ipv6only, SplitHostPort, splitHostZone, JoinHostPort, loopbackIP, sockaddrToIP, stripIPv4Header, newIPConn, IPv4, IPv4Mask, CIDRMask, isZeros, allFF, ubtoa, hexString, ipEmptyString, simpleMaskLength, networkNumberAndMask, parseIPv4, parseIPv6Zone, parseIPv6, ParseIP, parseIPZone, ParseCIDR, interfaceTable, newLink, linkFlags, interfaceAddrTable, addrTable, newAddr, interfaceMulticastAddrTable, parseProcNetIGMP, parseProcNetIGMP6, interfaceByIndex, parseLiteralIP, readHosts, lookupStaticHost, lookupStaticAddr, Listen, maxListenerBacklog, newFD, isConnError, wrapSyscallError, dnsReadConfig, dnsDefaultSearch, hasPrefix, ensureRooted, newRequest, checkResponse, dnsPacketRoundTrip, dnsStreamRoundTrip, checkHeader, skipToAnswer, avoidDNS, goLookupIPFiles, fastrand, randInt, randIntn, reverseaddr, equalASCIIName, isDomainName, absDomainName, minNonzeroTime, partialDeadline, parseNetwork, Dial, systemConf, initConfVal, goDebugNetDNS, isLocalhost, isGateway, init, cgoLookupHost, cgoLookupPort, cgoLookupIP, cgoLookupCNAME, cgoLookupPTR, sortByRFC6724, sortByRFC6724withSrcs, srcAddrs, ipAttrOf, init$1, mustCIDR, classifyScope, commonPrefixLen; context = $packages["context"]; errors = $packages["errors"]; js = $packages["github.com/gopherjs/gopherjs/js"]; bytealg = $packages["internal/bytealg"]; itoa = $packages["internal/itoa"]; nettrace = $packages["internal/nettrace"]; poll = $packages["internal/poll"]; singleflight = $packages["internal/singleflight"]; io = $packages["io"]; os = $packages["os"]; runtime = $packages["runtime"]; sort = $packages["sort"]; sync = $packages["sync"]; atomic = $packages["sync/atomic"]; syscall = $packages["syscall"]; time = $packages["time"]; dnsmessage = $packages["vendor/golang.org/x/net/dns/dnsmessage"]; UnixAddr = $pkg.UnixAddr = $newType(0, $kindStruct, "net.UnixAddr", true, "net", true, function(Name_, Net_) { this.$val = this; if (arguments.length === 0) { this.Name = ""; this.Net = ""; return; } this.Name = Name_; this.Net = Net_; }); UnixConn = $pkg.UnixConn = $newType(0, $kindStruct, "net.UnixConn", true, "net", true, function(conn_) { this.$val = this; if (arguments.length === 0) { this.conn = new conn.ptr(ptrType$7.nil); return; } this.conn = conn_; }); UDPAddr = $pkg.UDPAddr = $newType(0, $kindStruct, "net.UDPAddr", true, "net", true, function(IP_, Port_, Zone_) { this.$val = this; if (arguments.length === 0) { this.IP = IP.nil; this.Port = 0; this.Zone = ""; return; } this.IP = IP_; this.Port = Port_; this.Zone = Zone_; }); UDPConn = $pkg.UDPConn = $newType(0, $kindStruct, "net.UDPConn", true, "net", true, function(conn_) { this.$val = this; if (arguments.length === 0) { this.conn = new conn.ptr(ptrType$7.nil); return; } this.conn = conn_; }); TCPAddr = $pkg.TCPAddr = $newType(0, $kindStruct, "net.TCPAddr", true, "net", true, function(IP_, Port_, Zone_) { this.$val = this; if (arguments.length === 0) { this.IP = IP.nil; this.Port = 0; this.Zone = ""; return; } this.IP = IP_; this.Port = Port_; this.Zone = Zone_; }); TCPConn = $pkg.TCPConn = $newType(0, $kindStruct, "net.TCPConn", true, "net", true, function(conn_) { this.$val = this; if (arguments.length === 0) { this.conn = new conn.ptr(ptrType$7.nil); return; } this.conn = conn_; }); sockaddr = $pkg.sockaddr = $newType(8, $kindInterface, "net.sockaddr", true, "net", false, null); rawConn = $pkg.rawConn = $newType(0, $kindStruct, "net.rawConn", true, "net", false, function(fd_) { this.$val = this; if (arguments.length === 0) { this.fd = ptrType$7.nil; return; } this.fd = fd_; }); file = $pkg.file = $newType(0, $kindStruct, "net.file", true, "net", false, function(file_, data_, atEOF_) { this.$val = this; if (arguments.length === 0) { this.file = ptrType$11.nil; this.data = sliceType$1.nil; this.atEOF = false; return; } this.file = file_; this.data = data_; this.atEOF = atEOF_; }); nssConf = $pkg.nssConf = $newType(0, $kindStruct, "net.nssConf", true, "net", false, function(err_, sources_) { this.$val = this; if (arguments.length === 0) { this.err = $ifaceNil; this.sources = false; return; } this.err = err_; this.sources = sources_; }); nssSource = $pkg.nssSource = $newType(0, $kindStruct, "net.nssSource", true, "net", false, function(source_, criteria_) { this.$val = this; if (arguments.length === 0) { this.source = ""; this.criteria = sliceType$3.nil; return; } this.source = source_; this.criteria = criteria_; }); nssCriterion = $pkg.nssCriterion = $newType(0, $kindStruct, "net.nssCriterion", true, "net", false, function(negate_, status_, action_) { this.$val = this; if (arguments.length === 0) { this.negate = false; this.status = ""; this.action = ""; return; } this.negate = negate_; this.status = status_; this.action = action_; }); Addr = $pkg.Addr = $newType(8, $kindInterface, "net.Addr", true, "net", true, null); Conn = $pkg.Conn = $newType(8, $kindInterface, "net.Conn", true, "net", true, null); conn = $pkg.conn = $newType(0, $kindStruct, "net.conn", true, "net", false, function(fd_) { this.$val = this; if (arguments.length === 0) { this.fd = ptrType$7.nil; return; } this.fd = fd_; }); PacketConn = $pkg.PacketConn = $newType(8, $kindInterface, "net.PacketConn", true, "net", true, null); Listener = $pkg.Listener = $newType(8, $kindInterface, "net.Listener", true, "net", true, null); Error = $pkg.Error = $newType(8, $kindInterface, "net.Error", true, "net", true, null); OpError = $pkg.OpError = $newType(0, $kindStruct, "net.OpError", true, "net", true, function(Op_, Net_, Source_, Addr_, Err_) { this.$val = this; if (arguments.length === 0) { this.Op = ""; this.Net = ""; this.Source = $ifaceNil; this.Addr = $ifaceNil; this.Err = $ifaceNil; return; } this.Op = Op_; this.Net = Net_; this.Source = Source_; this.Addr = Addr_; this.Err = Err_; }); timeout = $pkg.timeout = $newType(8, $kindInterface, "net.timeout", true, "net", false, null); temporary = $pkg.temporary = $newType(8, $kindInterface, "net.temporary", true, "net", false, null); ParseError = $pkg.ParseError = $newType(0, $kindStruct, "net.ParseError", true, "net", true, function(Type_, Text_) { this.$val = this; if (arguments.length === 0) { this.Type = ""; this.Text = ""; return; } this.Type = Type_; this.Text = Text_; }); AddrError = $pkg.AddrError = $newType(0, $kindStruct, "net.AddrError", true, "net", true, function(Err_, Addr_) { this.$val = this; if (arguments.length === 0) { this.Err = ""; this.Addr = ""; return; } this.Err = Err_; this.Addr = Addr_; }); UnknownNetworkError = $pkg.UnknownNetworkError = $newType(8, $kindString, "net.UnknownNetworkError", true, "net", true, null); timeoutError = $pkg.timeoutError = $newType(0, $kindStruct, "net.timeoutError", true, "net", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); DNSError = $pkg.DNSError = $newType(0, $kindStruct, "net.DNSError", true, "net", true, function(Err_, Name_, Server_, IsTimeout_, IsTemporary_, IsNotFound_) { this.$val = this; if (arguments.length === 0) { this.Err = ""; this.Name = ""; this.Server = ""; this.IsTimeout = false; this.IsTemporary = false; this.IsNotFound = false; return; } this.Err = Err_; this.Name = Name_; this.Server = Server_; this.IsTimeout = IsTimeout_; this.IsTemporary = IsTemporary_; this.IsNotFound = IsNotFound_; }); writerOnly = $pkg.writerOnly = $newType(0, $kindStruct, "net.writerOnly", true, "net", false, function(Writer_) { this.$val = this; if (arguments.length === 0) { this.Writer = $ifaceNil; return; } this.Writer = Writer_; }); buffersWriter = $pkg.buffersWriter = $newType(8, $kindInterface, "net.buffersWriter", true, "net", false, null); Buffers = $pkg.Buffers = $newType(12, $kindSlice, "net.Buffers", true, "net", true, null); HardwareAddr = $pkg.HardwareAddr = $newType(12, $kindSlice, "net.HardwareAddr", true, "net", true, null); Resolver = $pkg.Resolver = $newType(0, $kindStruct, "net.Resolver", true, "net", true, function(PreferGo_, StrictErrors_, Dial_, lookupGroup_) { this.$val = this; if (arguments.length === 0) { this.PreferGo = false; this.StrictErrors = false; this.Dial = $throwNilPointerError; this.lookupGroup = new singleflight.Group.ptr(new sync.Mutex.ptr(0, 0), false); return; } this.PreferGo = PreferGo_; this.StrictErrors = StrictErrors_; this.Dial = Dial_; this.lookupGroup = lookupGroup_; }); onlyValuesCtx = $pkg.onlyValuesCtx = $newType(0, $kindStruct, "net.onlyValuesCtx", true, "net", false, function(Context_, lookupValues_) { this.$val = this; if (arguments.length === 0) { this.Context = $ifaceNil; this.lookupValues = $ifaceNil; return; } this.Context = Context_; this.lookupValues = lookupValues_; }); ipStackCapabilities = $pkg.ipStackCapabilities = $newType(0, $kindStruct, "net.ipStackCapabilities", true, "net", false, function(Once_, ipv4Enabled_, ipv6Enabled_, ipv4MappedIPv6Enabled_) { this.$val = this; if (arguments.length === 0) { this.Once = new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)); this.ipv4Enabled = false; this.ipv6Enabled = false; this.ipv4MappedIPv6Enabled = false; return; } this.Once = Once_; this.ipv4Enabled = ipv4Enabled_; this.ipv6Enabled = ipv6Enabled_; this.ipv4MappedIPv6Enabled = ipv4MappedIPv6Enabled_; }); addrList = $pkg.addrList = $newType(12, $kindSlice, "net.addrList", true, "net", false, null); IPAddr = $pkg.IPAddr = $newType(0, $kindStruct, "net.IPAddr", true, "net", true, function(IP_, Zone_) { this.$val = this; if (arguments.length === 0) { this.IP = IP.nil; this.Zone = ""; return; } this.IP = IP_; this.Zone = Zone_; }); IPConn = $pkg.IPConn = $newType(0, $kindStruct, "net.IPConn", true, "net", true, function(conn_) { this.$val = this; if (arguments.length === 0) { this.conn = new conn.ptr(ptrType$7.nil); return; } this.conn = conn_; }); IP = $pkg.IP = $newType(12, $kindSlice, "net.IP", true, "net", true, null); IPMask = $pkg.IPMask = $newType(12, $kindSlice, "net.IPMask", true, "net", true, null); IPNet = $pkg.IPNet = $newType(0, $kindStruct, "net.IPNet", true, "net", true, function(IP_, Mask_) { this.$val = this; if (arguments.length === 0) { this.IP = IP.nil; this.Mask = IPMask.nil; return; } this.IP = IP_; this.Mask = Mask_; }); Interface = $pkg.Interface = $newType(0, $kindStruct, "net.Interface", true, "net", true, function(Index_, MTU_, Name_, HardwareAddr_, Flags_) { this.$val = this; if (arguments.length === 0) { this.Index = 0; this.MTU = 0; this.Name = ""; this.HardwareAddr = HardwareAddr.nil; this.Flags = 0; return; } this.Index = Index_; this.MTU = MTU_; this.Name = Name_; this.HardwareAddr = HardwareAddr_; this.Flags = Flags_; }); Flags = $pkg.Flags = $newType(4, $kindUint, "net.Flags", true, "net", true, null); ipv6ZoneCache = $pkg.ipv6ZoneCache = $newType(0, $kindStruct, "net.ipv6ZoneCache", true, "net", false, function(RWMutex_, lastFetched_, toIndex_, toName_) { this.$val = this; if (arguments.length === 0) { this.RWMutex = new sync.RWMutex.ptr(new sync.Mutex.ptr(0, 0), 0, 0, 0, 0); this.lastFetched = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil); this.toIndex = false; this.toName = false; return; } this.RWMutex = RWMutex_; this.lastFetched = lastFetched_; this.toIndex = toIndex_; this.toName = toName_; }); netFD = $pkg.netFD = $newType(0, $kindStruct, "net.netFD", true, "net", false, function(pfd_, family_, sotype_, isConnected_, net_, laddr_, raddr_) { this.$val = this; if (arguments.length === 0) { this.pfd = new poll.FD.ptr(new poll.fdMutex.ptr(new $Uint64(0, 0), 0, 0), 0, new poll.pollDesc.ptr(false), ptrType$39.nil, 0, 0, false, false, false); this.family = 0; this.sotype = 0; this.isConnected = false; this.net = ""; this.laddr = $ifaceNil; this.raddr = $ifaceNil; return; } this.pfd = pfd_; this.family = family_; this.sotype = sotype_; this.isConnected = isConnected_; this.net = net_; this.laddr = laddr_; this.raddr = raddr_; }); dnsConfig = $pkg.dnsConfig = $newType(0, $kindStruct, "net.dnsConfig", true, "net", false, function(servers_, search_, ndots_, timeout_, attempts_, rotate_, unknownOpt_, lookup_, err_, mtime_, soffset_, singleRequest_, useTCP_) { this.$val = this; if (arguments.length === 0) { this.servers = sliceType.nil; this.search = sliceType.nil; this.ndots = 0; this.timeout = new time.Duration(0, 0); this.attempts = 0; this.rotate = false; this.unknownOpt = false; this.lookup = sliceType.nil; this.err = $ifaceNil; this.mtime = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil); this.soffset = 0; this.singleRequest = false; this.useTCP = false; return; } this.servers = servers_; this.search = search_; this.ndots = ndots_; this.timeout = timeout_; this.attempts = attempts_; this.rotate = rotate_; this.unknownOpt = unknownOpt_; this.lookup = lookup_; this.err = err_; this.mtime = mtime_; this.soffset = soffset_; this.singleRequest = singleRequest_; this.useTCP = useTCP_; }); resolverConfig = $pkg.resolverConfig = $newType(0, $kindStruct, "net.resolverConfig", true, "net", false, function(initOnce_, ch_, lastChecked_, mu_, dnsConfig_) { this.$val = this; if (arguments.length === 0) { this.initOnce = new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)); this.ch = $chanNil; this.lastChecked = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil); this.mu = new sync.RWMutex.ptr(new sync.Mutex.ptr(0, 0), 0, 0, 0, 0); this.dnsConfig = ptrType$1.nil; return; } this.initOnce = initOnce_; this.ch = ch_; this.lastChecked = lastChecked_; this.mu = mu_; this.dnsConfig = dnsConfig_; }); hostLookupOrder = $pkg.hostLookupOrder = $newType(4, $kindInt, "net.hostLookupOrder", true, "net", false, null); SRV = $pkg.SRV = $newType(0, $kindStruct, "net.SRV", true, "net", true, function(Target_, Port_, Priority_, Weight_) { this.$val = this; if (arguments.length === 0) { this.Target = ""; this.Port = 0; this.Priority = 0; this.Weight = 0; return; } this.Target = Target_; this.Port = Port_; this.Priority = Priority_; this.Weight = Weight_; }); byPriorityWeight = $pkg.byPriorityWeight = $newType(12, $kindSlice, "net.byPriorityWeight", true, "net", false, null); MX = $pkg.MX = $newType(0, $kindStruct, "net.MX", true, "net", true, function(Host_, Pref_) { this.$val = this; if (arguments.length === 0) { this.Host = ""; this.Pref = 0; return; } this.Host = Host_; this.Pref = Pref_; }); byPref = $pkg.byPref = $newType(12, $kindSlice, "net.byPref", true, "net", false, null); NS = $pkg.NS = $newType(0, $kindStruct, "net.NS", true, "net", true, function(Host_) { this.$val = this; if (arguments.length === 0) { this.Host = ""; return; } this.Host = Host_; }); Dialer = $pkg.Dialer = $newType(0, $kindStruct, "net.Dialer", true, "net", true, function(Timeout_, Deadline_, LocalAddr_, DualStack_, FallbackDelay_, KeepAlive_, Resolver_, Cancel_, Control_) { this.$val = this; if (arguments.length === 0) { this.Timeout = new time.Duration(0, 0); this.Deadline = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil); this.LocalAddr = $ifaceNil; this.DualStack = false; this.FallbackDelay = new time.Duration(0, 0); this.KeepAlive = new time.Duration(0, 0); this.Resolver = ptrType$13.nil; this.Cancel = $chanNil; this.Control = $throwNilPointerError; return; } this.Timeout = Timeout_; this.Deadline = Deadline_; this.LocalAddr = LocalAddr_; this.DualStack = DualStack_; this.FallbackDelay = FallbackDelay_; this.KeepAlive = KeepAlive_; this.Resolver = Resolver_; this.Cancel = Cancel_; this.Control = Control_; }); sysDialer = $pkg.sysDialer = $newType(0, $kindStruct, "net.sysDialer", true, "net", false, function(Dialer_, network_, address_) { this.$val = this; if (arguments.length === 0) { this.Dialer = new Dialer.ptr(new time.Duration(0, 0), new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil), $ifaceNil, false, new time.Duration(0, 0), new time.Duration(0, 0), ptrType$13.nil, $chanNil, $throwNilPointerError); this.network = ""; this.address = ""; return; } this.Dialer = Dialer_; this.network = network_; this.address = address_; }); conf = $pkg.conf = $newType(0, $kindStruct, "net.conf", true, "net", false, function(forceCgoLookupHost_, netGo_, netCgo_, hasMDNSAllow_, goos_, dnsDebugLevel_, nss_, resolv_) { this.$val = this; if (arguments.length === 0) { this.forceCgoLookupHost = false; this.netGo = false; this.netCgo = false; this.hasMDNSAllow = false; this.goos = ""; this.dnsDebugLevel = 0; this.nss = ptrType$4.nil; this.resolv = ptrType$1.nil; return; } this.forceCgoLookupHost = forceCgoLookupHost_; this.netGo = netGo_; this.netCgo = netCgo_; this.hasMDNSAllow = hasMDNSAllow_; this.goos = goos_; this.dnsDebugLevel = dnsDebugLevel_; this.nss = nss_; this.resolv = resolv_; }); ipAttr = $pkg.ipAttr = $newType(0, $kindStruct, "net.ipAttr", true, "net", false, function(Scope_, Precedence_, Label_) { this.$val = this; if (arguments.length === 0) { this.Scope = 0; this.Precedence = 0; this.Label = 0; return; } this.Scope = Scope_; this.Precedence = Precedence_; this.Label = Label_; }); byRFC6724 = $pkg.byRFC6724 = $newType(0, $kindStruct, "net.byRFC6724", true, "net", false, function(addrs_, addrAttr_, srcs_, srcAttr_) { this.$val = this; if (arguments.length === 0) { this.addrs = sliceType$5.nil; this.addrAttr = sliceType$16.nil; this.srcs = sliceType$9.nil; this.srcAttr = sliceType$16.nil; return; } this.addrs = addrs_; this.addrAttr = addrAttr_; this.srcs = srcs_; this.srcAttr = srcAttr_; }); policyTableEntry = $pkg.policyTableEntry = $newType(0, $kindStruct, "net.policyTableEntry", true, "net", false, function(Prefix_, Precedence_, Label_) { this.$val = this; if (arguments.length === 0) { this.Prefix = ptrType$5.nil; this.Precedence = 0; this.Label = 0; return; } this.Prefix = Prefix_; this.Precedence = Precedence_; this.Label = Label_; }); policyTable = $pkg.policyTable = $newType(12, $kindSlice, "net.policyTable", true, "net", false, null); byMaskLength = $pkg.byMaskLength = $newType(12, $kindSlice, "net.byMaskLength", true, "net", false, null); scope = $pkg.scope = $newType(1, $kindUint8, "net.scope", true, "net", false, null); result = $newType(0, $kindStruct, "net.result", true, "net", false, function(p_, server_, error_) { this.$val = this; if (arguments.length === 0) { this.p = new dnsmessage.Parser.ptr(sliceType$1.nil, new dnsmessage.header.ptr(0, 0, 0, 0, 0, 0), 0, 0, 0, false, new dnsmessage.ResourceHeader.ptr(new dnsmessage.Name.ptr(arrayType$6.zero(), 0), 0, 0, 0, 0)); this.server = ""; this.error = $ifaceNil; return; } this.p = p_; this.server = server_; this.error = error_; }); dialResult = $newType(0, $kindStruct, "net.dialResult", true, "net", false, function(Conn_, error_, primary_, done_) { this.$val = this; if (arguments.length === 0) { this.Conn = $ifaceNil; this.error = $ifaceNil; this.primary = false; this.done = false; return; } this.Conn = Conn_; this.error = error_; this.primary = primary_; this.done = done_; }); structType = $structType("net", [{prop: "Once", name: "Once", embedded: true, exported: true, typ: sync.Once, tag: ""}, {prop: "val", name: "val", embedded: false, exported: false, typ: $Int, tag: ""}]); arrayType = $arrayType($Uint32, 3); ptrType = $ptrType(time.Location); sliceType = $sliceType($String); mapType = $mapType($String, sliceType); structType$1 = $structType("net", [{prop: "Mutex", name: "Mutex", embedded: true, exported: true, typ: sync.Mutex, tag: ""}, {prop: "byName", name: "byName", embedded: false, exported: false, typ: mapType, tag: ""}, {prop: "byAddr", name: "byAddr", embedded: false, exported: false, typ: mapType, tag: ""}, {prop: "expire", name: "expire", embedded: false, exported: false, typ: time.Time, tag: ""}, {prop: "path", name: "path", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "mtime", name: "mtime", embedded: false, exported: false, typ: time.Time, tag: ""}, {prop: "size", name: "size", embedded: false, exported: false, typ: $Int64, tag: ""}]); ptrType$1 = $ptrType(dnsConfig); ptrType$2 = $ptrType(Buffers); ptrType$3 = $ptrType(onlyValuesCtx); sliceType$1 = $sliceType($Uint8); ptrType$4 = $ptrType(nssConf); ptrType$5 = $ptrType(IPNet); sliceType$2 = $sliceType(sliceType$1); ptrType$6 = $ptrType(sliceType$2); ptrType$7 = $ptrType(netFD); ptrType$8 = $ptrType(syscall.SockaddrUnix); ptrType$9 = $ptrType(UnixAddr); arrayType$1 = $arrayType($Int8, 108); ptrType$10 = $ptrType(UnixConn); ptrType$11 = $ptrType(os.File); ptrType$13 = $ptrType(Resolver); ptrType$14 = $ptrType(syscall.SockaddrInet4); ptrType$15 = $ptrType(syscall.SockaddrInet6); ptrType$16 = $ptrType(UDPAddr); ptrType$17 = $ptrType(UDPConn); ptrType$18 = $ptrType(Interface); ptrType$19 = $ptrType(TCPAddr); ptrType$20 = $ptrType(TCPConn); ptrType$21 = $ptrType(OpError); ptrType$22 = $ptrType(os.SyscallError); ptrType$24 = $ptrType(io.LimitedReader); arrayType$2 = $arrayType($Uint8, 4); arrayType$3 = $arrayType($Uint8, 16); ptrType$25 = $ptrType(IPAddr); ptrType$26 = $ptrType(rawConn); structType$2 = $structType("", []); ptrType$28 = $ptrType(file); sliceType$3 = $sliceType(nssCriterion); sliceType$4 = $sliceType(nssSource); ptrType$29 = $ptrType(conn); ptrType$30 = $ptrType(AddrError); ptrType$31 = $ptrType(DNSError); sliceType$5 = $sliceType(IPAddr); ptrType$32 = $ptrType(SRV); sliceType$6 = $sliceType(ptrType$32); arrayType$6 = $arrayType($Uint8, 255); ptrType$33 = $ptrType(MX); sliceType$7 = $sliceType(ptrType$33); ptrType$34 = $ptrType(NS); sliceType$8 = $sliceType(ptrType$34); arrayType$7 = $arrayType($Uint8, 25); sliceType$9 = $sliceType(IP); ptrType$35 = $ptrType(nettrace.Trace); funcType = $funcType([context.Context, $String, $String], [sliceType$5, $error], false); sliceType$10 = $sliceType($emptyInterface); structType$3 = $structType("net", [{prop: "laddr", name: "laddr", embedded: false, exported: false, typ: TCPAddr, tag: ""}, {prop: "value", name: "value", embedded: false, exported: false, typ: $Int, tag: ""}]); sliceType$11 = $sliceType(structType$3); arrayType$8 = $arrayType($Uint8, 8); ptrType$36 = $ptrType(IPConn); sliceType$12 = $sliceType(Interface); ptrType$37 = $ptrType(syscall.IfInfomsg); sliceType$13 = $sliceType(Addr); ptrType$38 = $ptrType(syscall.IfAddrmsg); sliceType$14 = $sliceType(syscall.Iovec); ptrType$39 = $ptrType(sliceType$14); funcType$1 = $funcType([ptrType$7], [$error], false); ptrType$40 = $ptrType($Uint32); sliceType$15 = $sliceType(dnsmessage.Type); sliceType$16 = $sliceType(ipAttr); funcType$2 = $funcType([$Uintptr], [], false); funcType$3 = $funcType([$Uintptr], [$Bool], false); chanType = $chanType(structType$2, false, false); chanType$5 = $chanType(structType$2, false, true); mapType$1 = $mapType($String, sliceType$4); ptrType$44 = $ptrType(ParseError); ptrType$45 = $ptrType(timeoutError); ptrType$47 = $ptrType(singleflight.Group); funcType$4 = $funcType([context.Context, $String, $String], [Conn, $error], false); ptrType$48 = $ptrType(ipStackCapabilities); funcType$5 = $funcType([Addr], [$Bool], false); ptrType$49 = $ptrType(IP); ptrType$50 = $ptrType(ipv6ZoneCache); mapType$2 = $mapType($String, $Int); mapType$3 = $mapType($Int, $String); funcType$6 = $funcType([syscall.Sockaddr], [Addr], false); funcType$7 = $funcType([$String, $String, syscall.RawConn], [$error], false); ptrType$51 = $ptrType(resolverConfig); ptrType$52 = $ptrType(Dialer); ptrType$53 = $ptrType(sysDialer); ptrType$56 = $ptrType(conf); ptrType$57 = $ptrType(byRFC6724); conn.ptr.prototype.writeBuffers = function(v) { var _r$9, _tuple, c, err, n, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tuple = $f._tuple; c = $f.c; err = $f.err; n = $f.n; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!c.ok()) { $s = -1; return [new $Int64(0, 0), new syscall.Errno(22)]; } _r$9 = c.fd.writeBuffers(v); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [n, new OpError.ptr("writev", c.fd.net, c.fd.laddr, c.fd.raddr, err)]; } $s = -1; return [n, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: conn.ptr.prototype.writeBuffers }; } $f._r$9 = _r$9; $f._tuple = _tuple; $f.c = c; $f.err = err; $f.n = n; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; conn.prototype.writeBuffers = function(v) { return this.$val.writeBuffers(v); }; netFD.ptr.prototype.writeBuffers = function(v) { var _ptr, _r$9, _tmp, _tmp$1, _tuple, err, fd, n, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _ptr = $f._ptr; _r$9 = $f._r$9; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; err = $f.err; fd = $f.fd; n = $f.n; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = new $Int64(0, 0); err = $ifaceNil; fd = this; _r$9 = fd.pfd.Writev(((_ptr = v, new ptrType$6(function() { return $convertSliceType(_ptr.$get(), sliceType$2); }, function($v) { _ptr.$set($convertSliceType($v, Buffers)); }, _ptr.$target)))); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; err = _tuple[1]; runtime.KeepAlive(fd); _tmp = n; _tmp$1 = wrapSyscallError("writev", err); n = _tmp; err = _tmp$1; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: netFD.ptr.prototype.writeBuffers }; } $f._ptr = _ptr; $f._r$9 = _r$9; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.err = err; $f.fd = fd; $f.n = n; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; netFD.prototype.writeBuffers = function(v) { return this.$val.writeBuffers(v); }; setReadMsgCloseOnExec = function(oob) { var oob; }; unixSocket = function(ctx, net, laddr, raddr, mode, ctrlFn) { var _1, _2, _r$10, _r$11, _r$9, _tuple, _v, _v$1, ctrlFn, ctx, err, fd, laddr, mode, net, raddr, sotype, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _2 = $f._2; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$9 = $f._r$9; _tuple = $f._tuple; _v = $f._v; _v$1 = $f._v$1; ctrlFn = $f.ctrlFn; ctx = $f.ctx; err = $f.err; fd = $f.fd; laddr = $f.laddr; mode = $f.mode; net = $f.net; raddr = $f.raddr; sotype = $f.sotype; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sotype = 0; _1 = net; if (_1 === ("unix")) { sotype = 1; } else if (_1 === ("unixgram")) { sotype = 2; } else if (_1 === ("unixpacket")) { sotype = 5; } else { $s = -1; return [ptrType$7.nil, new UnknownNetworkError((net))]; } _2 = mode; /* */ if (_2 === ("dial")) { $s = 2; continue; } /* */ if (_2 === ("listen")) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_2 === ("dial")) { */ case 2: if (!(!($interfaceIsEqual(laddr, $ifaceNil)))) { _v = false; $s = 8; continue s; } _r$9 = laddr.isWildcard(); /* */ $s = 9; case 9: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _v = _r$9; case 8: /* */ if (_v) { $s = 6; continue; } /* */ $s = 7; continue; /* if (_v) { */ case 6: laddr = $ifaceNil; /* } */ case 7: if (!(!($interfaceIsEqual(raddr, $ifaceNil)))) { _v$1 = false; $s = 12; continue s; } _r$10 = raddr.isWildcard(); /* */ $s = 13; case 13: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _v$1 = _r$10; case 12: /* */ if (_v$1) { $s = 10; continue; } /* */ $s = 11; continue; /* if (_v$1) { */ case 10: raddr = $ifaceNil; /* } */ case 11: if ($interfaceIsEqual(raddr, $ifaceNil) && (!((sotype === 2)) || $interfaceIsEqual(laddr, $ifaceNil))) { $s = -1; return [ptrType$7.nil, errMissingAddress]; } $s = 5; continue; /* } else if (_2 === ("listen")) { */ case 3: $s = 5; continue; /* } else { */ case 4: $s = -1; return [ptrType$7.nil, errors.New("unknown mode: " + mode)]; /* } */ case 5: case 1: _r$11 = socket(ctx, net, 1, sotype, 0, false, laddr, raddr, ctrlFn); /* */ $s = 14; case 14: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tuple = _r$11; fd = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$7.nil, err]; } $s = -1; return [fd, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: unixSocket }; } $f._1 = _1; $f._2 = _2; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$9 = _r$9; $f._tuple = _tuple; $f._v = _v; $f._v$1 = _v$1; $f.ctrlFn = ctrlFn; $f.ctx = ctx; $f.err = err; $f.fd = fd; $f.laddr = laddr; $f.mode = mode; $f.net = net; $f.raddr = raddr; $f.sotype = sotype; $f.$s = $s; $f.$r = $r; return $f; }; sockaddrToUnix = function(sa) { var _tuple, ok, s, sa; _tuple = $assertType(sa, ptrType$8, true); s = _tuple[0]; ok = _tuple[1]; if (ok) { return new UnixAddr.ptr(s.Name, "unix"); } return $ifaceNil; }; sockaddrToUnixgram = function(sa) { var _tuple, ok, s, sa; _tuple = $assertType(sa, ptrType$8, true); s = _tuple[0]; ok = _tuple[1]; if (ok) { return new UnixAddr.ptr(s.Name, "unixgram"); } return $ifaceNil; }; sockaddrToUnixpacket = function(sa) { var _tuple, ok, s, sa; _tuple = $assertType(sa, ptrType$8, true); s = _tuple[0]; ok = _tuple[1]; if (ok) { return new UnixAddr.ptr(s.Name, "unixpacket"); } return $ifaceNil; }; sotypeToNet = function(sotype) { var _1, sotype; _1 = sotype; if (_1 === (1)) { return "unix"; } else if (_1 === (2)) { return "unixgram"; } else if (_1 === (5)) { return "unixpacket"; } else { $panic(new $String("sotypeToNet unknown socket type")); } }; UnixAddr.ptr.prototype.family = function() { var a; a = this; return 1; }; UnixAddr.prototype.family = function() { return this.$val.family(); }; UnixAddr.ptr.prototype.sockaddr = function(family) { var a, family; a = this; if (a === ptrType$9.nil) { return [$ifaceNil, $ifaceNil]; } return [new syscall.SockaddrUnix.ptr(a.Name, new syscall.RawSockaddrUnix.ptr(0, arrayType$1.zero())), $ifaceNil]; }; UnixAddr.prototype.sockaddr = function(family) { return this.$val.sockaddr(family); }; UnixAddr.ptr.prototype.toLocal = function(net) { var a, net; a = this; return a; }; UnixAddr.prototype.toLocal = function(net) { return this.$val.toLocal(net); }; UnixConn.ptr.prototype.readFrom = function(b) { var _r$9, _ref, _tuple, addr, b, c, err, n, sa, sa$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _ref = $f._ref; _tuple = $f._tuple; addr = $f.addr; b = $f.b; c = $f.c; err = $f.err; n = $f.n; sa = $f.sa; sa$1 = $f.sa$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; addr = ptrType$9.nil; _r$9 = c.conn.fd.readFrom(b); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; sa = _tuple[1]; err = _tuple[2]; _ref = sa; if ($assertType(_ref, ptrType$8, true)[1]) { sa$1 = _ref.$val; if (!(sa$1.Name === "")) { addr = new UnixAddr.ptr(sa$1.Name, sotypeToNet(c.conn.fd.sotype)); } } $s = -1; return [n, addr, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: UnixConn.ptr.prototype.readFrom }; } $f._r$9 = _r$9; $f._ref = _ref; $f._tuple = _tuple; $f.addr = addr; $f.b = b; $f.c = c; $f.err = err; $f.n = n; $f.sa = sa; $f.sa$1 = sa$1; $f.$s = $s; $f.$r = $r; return $f; }; UnixConn.prototype.readFrom = function(b) { return this.$val.readFrom(b); }; UnixConn.ptr.prototype.readMsg = function(b, oob) { var _r$9, _ref, _tuple, addr, b, c, err, flags, n, oob, oobn, sa, sa$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _ref = $f._ref; _tuple = $f._tuple; addr = $f.addr; b = $f.b; c = $f.c; err = $f.err; flags = $f.flags; n = $f.n; oob = $f.oob; oobn = $f.oobn; sa = $f.sa; sa$1 = $f.sa$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; oobn = 0; flags = 0; addr = ptrType$9.nil; err = $ifaceNil; c = this; sa = $ifaceNil; _r$9 = c.conn.fd.readMsg(b, oob, 1073741824); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; oobn = _tuple[1]; flags = _tuple[2]; sa = _tuple[3]; err = _tuple[4]; if (false && $interfaceIsEqual(err, $ifaceNil) && oobn > 0) { setReadMsgCloseOnExec($subslice(oob, 0, oobn)); } _ref = sa; if ($assertType(_ref, ptrType$8, true)[1]) { sa$1 = _ref.$val; if (!(sa$1.Name === "")) { addr = new UnixAddr.ptr(sa$1.Name, sotypeToNet(c.conn.fd.sotype)); } } $s = -1; return [n, oobn, flags, addr, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: UnixConn.ptr.prototype.readMsg }; } $f._r$9 = _r$9; $f._ref = _ref; $f._tuple = _tuple; $f.addr = addr; $f.b = b; $f.c = c; $f.err = err; $f.flags = flags; $f.n = n; $f.oob = oob; $f.oobn = oobn; $f.sa = sa; $f.sa$1 = sa$1; $f.$s = $s; $f.$r = $r; return $f; }; UnixConn.prototype.readMsg = function(b, oob) { return this.$val.readMsg(b, oob); }; UnixConn.ptr.prototype.writeTo = function(b, addr) { var $24r, _r$9, addr, b, c, sa, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$9 = $f._r$9; addr = $f.addr; b = $f.b; c = $f.c; sa = $f.sa; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (c.conn.fd.isConnected) { $s = -1; return [0, $pkg.ErrWriteToConnected]; } if (addr === ptrType$9.nil) { $s = -1; return [0, errMissingAddress]; } if (!(addr.Net === sotypeToNet(c.conn.fd.sotype))) { $s = -1; return [0, new syscall.Errno(97)]; } sa = new syscall.SockaddrUnix.ptr(addr.Name, new syscall.RawSockaddrUnix.ptr(0, arrayType$1.zero())); _r$9 = c.conn.fd.writeTo(b, sa); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $24r = _r$9; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: UnixConn.ptr.prototype.writeTo }; } $f.$24r = $24r; $f._r$9 = _r$9; $f.addr = addr; $f.b = b; $f.c = c; $f.sa = sa; $f.$s = $s; $f.$r = $r; return $f; }; UnixConn.prototype.writeTo = function(b, addr) { return this.$val.writeTo(b, addr); }; UnixConn.ptr.prototype.writeMsg = function(b, oob, addr) { var $24r, _r$9, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, addr, b, c, err, n, oob, oobn, sa, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$9 = $f._r$9; _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; c = $f.c; err = $f.err; n = $f.n; oob = $f.oob; oobn = $f.oobn; sa = $f.sa; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; oobn = 0; err = $ifaceNil; c = this; if ((c.conn.fd.sotype === 2) && c.conn.fd.isConnected) { _tmp = 0; _tmp$1 = 0; _tmp$2 = $pkg.ErrWriteToConnected; n = _tmp; oobn = _tmp$1; err = _tmp$2; $s = -1; return [n, oobn, err]; } sa = $ifaceNil; if (!(addr === ptrType$9.nil)) { if (!(addr.Net === sotypeToNet(c.conn.fd.sotype))) { _tmp$3 = 0; _tmp$4 = 0; _tmp$5 = new syscall.Errno(97); n = _tmp$3; oobn = _tmp$4; err = _tmp$5; $s = -1; return [n, oobn, err]; } sa = new syscall.SockaddrUnix.ptr(addr.Name, new syscall.RawSockaddrUnix.ptr(0, arrayType$1.zero())); } _r$9 = c.conn.fd.writeMsg(b, oob, sa); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; oobn = _tuple[1]; err = _tuple[2]; $24r = [n, oobn, err]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: UnixConn.ptr.prototype.writeMsg }; } $f.$24r = $24r; $f._r$9 = _r$9; $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.c = c; $f.err = err; $f.n = n; $f.oob = oob; $f.oobn = oobn; $f.sa = sa; $f.$s = $s; $f.$r = $r; return $f; }; UnixConn.prototype.writeMsg = function(b, oob, addr) { return this.$val.writeMsg(b, oob, addr); }; sysDialer.ptr.prototype.dialUnix = function(ctx, laddr, raddr) { var _r$9, _tuple, ctx, err, fd, laddr, raddr, sd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tuple = $f._tuple; ctx = $f.ctx; err = $f.err; fd = $f.fd; laddr = $f.laddr; raddr = $f.raddr; sd = $f.sd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sd = this; _r$9 = unixSocket(ctx, sd.network, laddr, raddr, "dial", sd.Dialer.Control); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; fd = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$10.nil, err]; } $s = -1; return [newUnixConn(fd), $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: sysDialer.ptr.prototype.dialUnix }; } $f._r$9 = _r$9; $f._tuple = _tuple; $f.ctx = ctx; $f.err = err; $f.fd = fd; $f.laddr = laddr; $f.raddr = raddr; $f.sd = sd; $f.$s = $s; $f.$r = $r; return $f; }; sysDialer.prototype.dialUnix = function(ctx, laddr, raddr) { return this.$val.dialUnix(ctx, laddr, raddr); }; UnixAddr.ptr.prototype.Network = function() { var a; a = this; return a.Net; }; UnixAddr.prototype.Network = function() { return this.$val.Network(); }; UnixAddr.ptr.prototype.String = function() { var a; a = this; if (a === ptrType$9.nil) { return ""; } return a.Name; }; UnixAddr.prototype.String = function() { return this.$val.String(); }; UnixAddr.ptr.prototype.isWildcard = function() { var a; a = this; return a === ptrType$9.nil || a.Name === ""; }; UnixAddr.prototype.isWildcard = function() { return this.$val.isWildcard(); }; UnixAddr.ptr.prototype.opAddr = function() { var a; a = this; if (a === ptrType$9.nil) { return $ifaceNil; } return a; }; UnixAddr.prototype.opAddr = function() { return this.$val.opAddr(); }; ResolveUnixAddr = function(network, address) { var _1, address, network; _1 = network; if (_1 === ("unix") || _1 === ("unixgram") || _1 === ("unixpacket")) { return [new UnixAddr.ptr(address, network), $ifaceNil]; } else { return [ptrType$9.nil, new UnknownNetworkError((network))]; } }; $pkg.ResolveUnixAddr = ResolveUnixAddr; UnixConn.ptr.prototype.SyscallConn = function() { var _returncast, c; c = this; if (!c.conn.ok()) { return [$ifaceNil, new syscall.Errno(22)]; } _returncast = newRawConn(c.conn.fd); return [_returncast[0], _returncast[1]]; }; UnixConn.prototype.SyscallConn = function() { return this.$val.SyscallConn(); }; UnixConn.ptr.prototype.CloseRead = function() { var _r$9, c, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; c = $f.c; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!c.conn.ok()) { $s = -1; return new syscall.Errno(22); } _r$9 = c.conn.fd.closeRead(); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err = _r$9; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return new OpError.ptr("close", c.conn.fd.net, c.conn.fd.laddr, c.conn.fd.raddr, err); } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: UnixConn.ptr.prototype.CloseRead }; } $f._r$9 = _r$9; $f.c = c; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; UnixConn.prototype.CloseRead = function() { return this.$val.CloseRead(); }; UnixConn.ptr.prototype.CloseWrite = function() { var _r$9, c, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; c = $f.c; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!c.conn.ok()) { $s = -1; return new syscall.Errno(22); } _r$9 = c.conn.fd.closeWrite(); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err = _r$9; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return new OpError.ptr("close", c.conn.fd.net, c.conn.fd.laddr, c.conn.fd.raddr, err); } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: UnixConn.ptr.prototype.CloseWrite }; } $f._r$9 = _r$9; $f.c = c; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; UnixConn.prototype.CloseWrite = function() { return this.$val.CloseWrite(); }; UnixConn.ptr.prototype.ReadFromUnix = function(b) { var _r$9, _tuple, addr, b, c, err, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tuple = $f._tuple; addr = $f.addr; b = $f.b; c = $f.c; err = $f.err; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!c.conn.ok()) { $s = -1; return [0, ptrType$9.nil, new syscall.Errno(22)]; } _r$9 = c.readFrom(b); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; addr = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { err = new OpError.ptr("read", c.conn.fd.net, c.conn.fd.laddr, c.conn.fd.raddr, err); } $s = -1; return [n, addr, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: UnixConn.ptr.prototype.ReadFromUnix }; } $f._r$9 = _r$9; $f._tuple = _tuple; $f.addr = addr; $f.b = b; $f.c = c; $f.err = err; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; UnixConn.prototype.ReadFromUnix = function(b) { return this.$val.ReadFromUnix(b); }; UnixConn.ptr.prototype.ReadFrom = function(b) { var _r$9, _tuple, addr, b, c, err, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tuple = $f._tuple; addr = $f.addr; b = $f.b; c = $f.c; err = $f.err; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!c.conn.ok()) { $s = -1; return [0, $ifaceNil, new syscall.Errno(22)]; } _r$9 = c.readFrom(b); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; addr = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { err = new OpError.ptr("read", c.conn.fd.net, c.conn.fd.laddr, c.conn.fd.raddr, err); } if (addr === ptrType$9.nil) { $s = -1; return [n, $ifaceNil, err]; } $s = -1; return [n, addr, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: UnixConn.ptr.prototype.ReadFrom }; } $f._r$9 = _r$9; $f._tuple = _tuple; $f.addr = addr; $f.b = b; $f.c = c; $f.err = err; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; UnixConn.prototype.ReadFrom = function(b) { return this.$val.ReadFrom(b); }; UnixConn.ptr.prototype.ReadMsgUnix = function(b, oob) { var _r$9, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tuple, addr, b, c, err, flags, n, oob, oobn, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tuple = $f._tuple; addr = $f.addr; b = $f.b; c = $f.c; err = $f.err; flags = $f.flags; n = $f.n; oob = $f.oob; oobn = $f.oobn; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; oobn = 0; flags = 0; addr = ptrType$9.nil; err = $ifaceNil; c = this; if (!c.conn.ok()) { _tmp = 0; _tmp$1 = 0; _tmp$2 = 0; _tmp$3 = ptrType$9.nil; _tmp$4 = new syscall.Errno(22); n = _tmp; oobn = _tmp$1; flags = _tmp$2; addr = _tmp$3; err = _tmp$4; $s = -1; return [n, oobn, flags, addr, err]; } _r$9 = c.readMsg(b, oob); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; oobn = _tuple[1]; flags = _tuple[2]; addr = _tuple[3]; err = _tuple[4]; if (!($interfaceIsEqual(err, $ifaceNil))) { err = new OpError.ptr("read", c.conn.fd.net, c.conn.fd.laddr, c.conn.fd.raddr, err); } $s = -1; return [n, oobn, flags, addr, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: UnixConn.ptr.prototype.ReadMsgUnix }; } $f._r$9 = _r$9; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tuple = _tuple; $f.addr = addr; $f.b = b; $f.c = c; $f.err = err; $f.flags = flags; $f.n = n; $f.oob = oob; $f.oobn = oobn; $f.$s = $s; $f.$r = $r; return $f; }; UnixConn.prototype.ReadMsgUnix = function(b, oob) { return this.$val.ReadMsgUnix(b, oob); }; UnixConn.ptr.prototype.WriteToUnix = function(b, addr) { var _r$9, _tuple, addr, b, c, err, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tuple = $f._tuple; addr = $f.addr; b = $f.b; c = $f.c; err = $f.err; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!c.conn.ok()) { $s = -1; return [0, new syscall.Errno(22)]; } _r$9 = c.writeTo(b, addr); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { err = new OpError.ptr("write", c.conn.fd.net, c.conn.fd.laddr, addr.opAddr(), err); } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: UnixConn.ptr.prototype.WriteToUnix }; } $f._r$9 = _r$9; $f._tuple = _tuple; $f.addr = addr; $f.b = b; $f.c = c; $f.err = err; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; UnixConn.prototype.WriteToUnix = function(b, addr) { return this.$val.WriteToUnix(b, addr); }; UnixConn.ptr.prototype.WriteTo = function(b, addr) { var _r$9, _tuple, _tuple$1, a, addr, b, c, err, n, ok, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; a = $f.a; addr = $f.addr; b = $f.b; c = $f.c; err = $f.err; n = $f.n; ok = $f.ok; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!c.conn.ok()) { $s = -1; return [0, new syscall.Errno(22)]; } _tuple = $assertType(addr, ptrType$9, true); a = _tuple[0]; ok = _tuple[1]; if (!ok) { $s = -1; return [0, new OpError.ptr("write", c.conn.fd.net, c.conn.fd.laddr, addr, new syscall.Errno(22))]; } _r$9 = c.writeTo(b, a); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple$1 = _r$9; n = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { err = new OpError.ptr("write", c.conn.fd.net, c.conn.fd.laddr, a.opAddr(), err); } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: UnixConn.ptr.prototype.WriteTo }; } $f._r$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.a = a; $f.addr = addr; $f.b = b; $f.c = c; $f.err = err; $f.n = n; $f.ok = ok; $f.$s = $s; $f.$r = $r; return $f; }; UnixConn.prototype.WriteTo = function(b, addr) { return this.$val.WriteTo(b, addr); }; UnixConn.ptr.prototype.WriteMsgUnix = function(b, oob, addr) { var _r$9, _tmp, _tmp$1, _tmp$2, _tuple, addr, b, c, err, n, oob, oobn, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tuple = $f._tuple; addr = $f.addr; b = $f.b; c = $f.c; err = $f.err; n = $f.n; oob = $f.oob; oobn = $f.oobn; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; oobn = 0; err = $ifaceNil; c = this; if (!c.conn.ok()) { _tmp = 0; _tmp$1 = 0; _tmp$2 = new syscall.Errno(22); n = _tmp; oobn = _tmp$1; err = _tmp$2; $s = -1; return [n, oobn, err]; } _r$9 = c.writeMsg(b, oob, addr); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; oobn = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { err = new OpError.ptr("write", c.conn.fd.net, c.conn.fd.laddr, addr.opAddr(), err); } $s = -1; return [n, oobn, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: UnixConn.ptr.prototype.WriteMsgUnix }; } $f._r$9 = _r$9; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tuple = _tuple; $f.addr = addr; $f.b = b; $f.c = c; $f.err = err; $f.n = n; $f.oob = oob; $f.oobn = oobn; $f.$s = $s; $f.$r = $r; return $f; }; UnixConn.prototype.WriteMsgUnix = function(b, oob, addr) { return this.$val.WriteMsgUnix(b, oob, addr); }; newUnixConn = function(fd) { var fd; return new UnixConn.ptr(new conn.ptr(fd)); }; sockaddrToUDP = function(sa) { var $24r, _r$9, _ref, sa, sa$1, sa$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$9 = $f._r$9; _ref = $f._ref; sa = $f.sa; sa$1 = $f.sa$1; sa$2 = $f.sa$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _ref = sa; /* */ if ($assertType(_ref, ptrType$14, true)[1]) { $s = 1; continue; } /* */ if ($assertType(_ref, ptrType$15, true)[1]) { $s = 2; continue; } /* */ $s = 3; continue; /* if ($assertType(_ref, ptrType$14, true)[1]) { */ case 1: sa$1 = _ref.$val; $s = -1; return new UDPAddr.ptr($convertSliceType($subslice(new sliceType$1(sa$1.Addr), 0), IP), sa$1.Port, ""); /* } else if ($assertType(_ref, ptrType$15, true)[1]) { */ case 2: sa$2 = _ref.$val; _r$9 = zoneCache.name(((sa$2.ZoneId >> 0))); /* */ $s = 4; case 4: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $24r = new UDPAddr.ptr($convertSliceType($subslice(new sliceType$1(sa$2.Addr), 0), IP), sa$2.Port, _r$9); $s = 5; case 5: return $24r; /* } */ case 3: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: sockaddrToUDP }; } $f.$24r = $24r; $f._r$9 = _r$9; $f._ref = _ref; $f.sa = sa; $f.sa$1 = sa$1; $f.sa$2 = sa$2; $f.$s = $s; $f.$r = $r; return $f; }; UDPAddr.ptr.prototype.family = function() { var a; a = this; if (a === ptrType$16.nil || a.IP.$length <= 4) { return 2; } if (!(a.IP.To4() === IP.nil)) { return 2; } return 10; }; UDPAddr.prototype.family = function() { return this.$val.family(); }; UDPAddr.ptr.prototype.sockaddr = function(family) { var $24r, _r$9, a, family, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$9 = $f._r$9; a = $f.a; family = $f.family; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: a = this; if (a === ptrType$16.nil) { $s = -1; return [$ifaceNil, $ifaceNil]; } _r$9 = ipToSockaddr(family, a.IP, a.Port, a.Zone); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $24r = _r$9; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: UDPAddr.ptr.prototype.sockaddr }; } $f.$24r = $24r; $f._r$9 = _r$9; $f.a = a; $f.family = family; $f.$s = $s; $f.$r = $r; return $f; }; UDPAddr.prototype.sockaddr = function(family) { return this.$val.sockaddr(family); }; UDPAddr.ptr.prototype.toLocal = function(net) { var a, net; a = this; return new UDPAddr.ptr(loopbackIP(net), a.Port, a.Zone); }; UDPAddr.prototype.toLocal = function(net) { return this.$val.toLocal(net); }; UDPConn.ptr.prototype.readFrom = function(b, addr) { var _r$10, _r$9, _ref, _tuple, addr, b, c, err, n, sa, sa$1, sa$2, sa$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$10 = $f._r$10; _r$9 = $f._r$9; _ref = $f._ref; _tuple = $f._tuple; addr = $f.addr; b = $f.b; c = $f.c; err = $f.err; n = $f.n; sa = $f.sa; sa$1 = $f.sa$1; sa$2 = $f.sa$2; sa$3 = $f.sa$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r$9 = c.conn.fd.readFrom(b); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; sa = _tuple[1]; err = _tuple[2]; _ref = sa; /* */ if ($assertType(_ref, ptrType$14, true)[1]) { $s = 2; continue; } /* */ if ($assertType(_ref, ptrType$15, true)[1]) { $s = 3; continue; } /* */ $s = 4; continue; /* if ($assertType(_ref, ptrType$14, true)[1]) { */ case 2: sa$1 = _ref.$val; UDPAddr.copy(addr, new UDPAddr.ptr($convertSliceType($subslice(new sliceType$1(sa$1.Addr), 0), IP), sa$1.Port, "")); $s = 5; continue; /* } else if ($assertType(_ref, ptrType$15, true)[1]) { */ case 3: sa$2 = _ref.$val; _r$10 = zoneCache.name(((sa$2.ZoneId >> 0))); /* */ $s = 6; case 6: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } UDPAddr.copy(addr, new UDPAddr.ptr($convertSliceType($subslice(new sliceType$1(sa$2.Addr), 0), IP), sa$2.Port, _r$10)); $s = 5; continue; /* } else { */ case 4: sa$3 = _ref; addr = ptrType$16.nil; /* } */ case 5: $s = -1; return [n, addr, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: UDPConn.ptr.prototype.readFrom }; } $f._r$10 = _r$10; $f._r$9 = _r$9; $f._ref = _ref; $f._tuple = _tuple; $f.addr = addr; $f.b = b; $f.c = c; $f.err = err; $f.n = n; $f.sa = sa; $f.sa$1 = sa$1; $f.sa$2 = sa$2; $f.sa$3 = sa$3; $f.$s = $s; $f.$r = $r; return $f; }; UDPConn.prototype.readFrom = function(b, addr) { return this.$val.readFrom(b, addr); }; UDPConn.ptr.prototype.readMsg = function(b, oob) { var _r$10, _r$9, _ref, _tuple, addr, b, c, err, flags, n, oob, oobn, sa, sa$1, sa$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$10 = $f._r$10; _r$9 = $f._r$9; _ref = $f._ref; _tuple = $f._tuple; addr = $f.addr; b = $f.b; c = $f.c; err = $f.err; flags = $f.flags; n = $f.n; oob = $f.oob; oobn = $f.oobn; sa = $f.sa; sa$1 = $f.sa$1; sa$2 = $f.sa$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; oobn = 0; flags = 0; addr = ptrType$16.nil; err = $ifaceNil; c = this; sa = $ifaceNil; _r$9 = c.conn.fd.readMsg(b, oob, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; oobn = _tuple[1]; flags = _tuple[2]; sa = _tuple[3]; err = _tuple[4]; _ref = sa; /* */ if ($assertType(_ref, ptrType$14, true)[1]) { $s = 2; continue; } /* */ if ($assertType(_ref, ptrType$15, true)[1]) { $s = 3; continue; } /* */ $s = 4; continue; /* if ($assertType(_ref, ptrType$14, true)[1]) { */ case 2: sa$1 = _ref.$val; addr = new UDPAddr.ptr($convertSliceType($subslice(new sliceType$1(sa$1.Addr), 0), IP), sa$1.Port, ""); $s = 4; continue; /* } else if ($assertType(_ref, ptrType$15, true)[1]) { */ case 3: sa$2 = _ref.$val; _r$10 = zoneCache.name(((sa$2.ZoneId >> 0))); /* */ $s = 5; case 5: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } addr = new UDPAddr.ptr($convertSliceType($subslice(new sliceType$1(sa$2.Addr), 0), IP), sa$2.Port, _r$10); /* } */ case 4: $s = -1; return [n, oobn, flags, addr, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: UDPConn.ptr.prototype.readMsg }; } $f._r$10 = _r$10; $f._r$9 = _r$9; $f._ref = _ref; $f._tuple = _tuple; $f.addr = addr; $f.b = b; $f.c = c; $f.err = err; $f.flags = flags; $f.n = n; $f.oob = oob; $f.oobn = oobn; $f.sa = sa; $f.sa$1 = sa$1; $f.sa$2 = sa$2; $f.$s = $s; $f.$r = $r; return $f; }; UDPConn.prototype.readMsg = function(b, oob) { return this.$val.readMsg(b, oob); }; UDPConn.ptr.prototype.writeTo = function(b, addr) { var $24r, _r$10, _r$9, _tuple, addr, b, c, err, sa, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$10 = $f._r$10; _r$9 = $f._r$9; _tuple = $f._tuple; addr = $f.addr; b = $f.b; c = $f.c; err = $f.err; sa = $f.sa; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (c.conn.fd.isConnected) { $s = -1; return [0, $pkg.ErrWriteToConnected]; } if (addr === ptrType$16.nil) { $s = -1; return [0, errMissingAddress]; } _r$9 = addr.sockaddr(c.conn.fd.family); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; sa = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [0, err]; } _r$10 = c.conn.fd.writeTo(b, sa); /* */ $s = 2; case 2: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } $24r = _r$10; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: UDPConn.ptr.prototype.writeTo }; } $f.$24r = $24r; $f._r$10 = _r$10; $f._r$9 = _r$9; $f._tuple = _tuple; $f.addr = addr; $f.b = b; $f.c = c; $f.err = err; $f.sa = sa; $f.$s = $s; $f.$r = $r; return $f; }; UDPConn.prototype.writeTo = function(b, addr) { return this.$val.writeTo(b, addr); }; UDPConn.ptr.prototype.writeMsg = function(b, oob, addr) { var $24r, _r$10, _r$9, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tuple, _tuple$1, addr, b, c, err, n, oob, oobn, sa, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$10 = $f._r$10; _r$9 = $f._r$9; _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; _tmp$8 = $f._tmp$8; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; addr = $f.addr; b = $f.b; c = $f.c; err = $f.err; n = $f.n; oob = $f.oob; oobn = $f.oobn; sa = $f.sa; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; oobn = 0; err = $ifaceNil; c = this; if (c.conn.fd.isConnected && !(addr === ptrType$16.nil)) { _tmp = 0; _tmp$1 = 0; _tmp$2 = $pkg.ErrWriteToConnected; n = _tmp; oobn = _tmp$1; err = _tmp$2; $s = -1; return [n, oobn, err]; } if (!c.conn.fd.isConnected && addr === ptrType$16.nil) { _tmp$3 = 0; _tmp$4 = 0; _tmp$5 = errMissingAddress; n = _tmp$3; oobn = _tmp$4; err = _tmp$5; $s = -1; return [n, oobn, err]; } _r$9 = addr.sockaddr(c.conn.fd.family); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; sa = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$6 = 0; _tmp$7 = 0; _tmp$8 = err; n = _tmp$6; oobn = _tmp$7; err = _tmp$8; $s = -1; return [n, oobn, err]; } _r$10 = c.conn.fd.writeMsg(b, oob, sa); /* */ $s = 2; case 2: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$1 = _r$10; n = _tuple$1[0]; oobn = _tuple$1[1]; err = _tuple$1[2]; $24r = [n, oobn, err]; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: UDPConn.ptr.prototype.writeMsg }; } $f.$24r = $24r; $f._r$10 = _r$10; $f._r$9 = _r$9; $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._tmp$8 = _tmp$8; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.addr = addr; $f.b = b; $f.c = c; $f.err = err; $f.n = n; $f.oob = oob; $f.oobn = oobn; $f.sa = sa; $f.$s = $s; $f.$r = $r; return $f; }; UDPConn.prototype.writeMsg = function(b, oob, addr) { return this.$val.writeMsg(b, oob, addr); }; sysDialer.ptr.prototype.dialUDP = function(ctx, laddr, raddr) { var _r$9, _tuple, ctx, err, fd, laddr, raddr, sd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tuple = $f._tuple; ctx = $f.ctx; err = $f.err; fd = $f.fd; laddr = $f.laddr; raddr = $f.raddr; sd = $f.sd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sd = this; _r$9 = internetSocket(ctx, sd.network, laddr, raddr, 2, 0, "dial", sd.Dialer.Control); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; fd = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$17.nil, err]; } $s = -1; return [newUDPConn(fd), $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: sysDialer.ptr.prototype.dialUDP }; } $f._r$9 = _r$9; $f._tuple = _tuple; $f.ctx = ctx; $f.err = err; $f.fd = fd; $f.laddr = laddr; $f.raddr = raddr; $f.sd = sd; $f.$s = $s; $f.$r = $r; return $f; }; sysDialer.prototype.dialUDP = function(ctx, laddr, raddr) { return this.$val.dialUDP(ctx, laddr, raddr); }; UDPAddr.ptr.prototype.Network = function() { var a; a = this; return "udp"; }; UDPAddr.prototype.Network = function() { return this.$val.Network(); }; UDPAddr.ptr.prototype.String = function() { var a, ip; a = this; if (a === ptrType$16.nil) { return ""; } ip = ipEmptyString(a.IP); if (!(a.Zone === "")) { return JoinHostPort(ip + "%" + a.Zone, itoa.Itoa(a.Port)); } return JoinHostPort(ip, itoa.Itoa(a.Port)); }; UDPAddr.prototype.String = function() { return this.$val.String(); }; UDPAddr.ptr.prototype.isWildcard = function() { var a; a = this; if (a === ptrType$16.nil || a.IP === IP.nil) { return true; } return a.IP.IsUnspecified(); }; UDPAddr.prototype.isWildcard = function() { return this.$val.isWildcard(); }; UDPAddr.ptr.prototype.opAddr = function() { var a; a = this; if (a === ptrType$16.nil) { return $ifaceNil; } return a; }; UDPAddr.prototype.opAddr = function() { return this.$val.opAddr(); }; UDPConn.ptr.prototype.SyscallConn = function() { var _returncast, c; c = this; if (!c.conn.ok()) { return [$ifaceNil, new syscall.Errno(22)]; } _returncast = newRawConn(c.conn.fd); return [_returncast[0], _returncast[1]]; }; UDPConn.prototype.SyscallConn = function() { return this.$val.SyscallConn(); }; UDPConn.ptr.prototype.ReadFromUDP = function(b) { var $24r, _r$9, _tuple, addr, b, c, err, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$9 = $f._r$9; _tuple = $f._tuple; addr = $f.addr; b = $f.b; c = $f.c; err = $f.err; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; addr = ptrType$16.nil; err = $ifaceNil; c = this; _r$9 = c.readFromUDP(b, new UDPAddr.ptr(IP.nil, 0, "")); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; addr = _tuple[1]; err = _tuple[2]; $24r = [n, addr, err]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: UDPConn.ptr.prototype.ReadFromUDP }; } $f.$24r = $24r; $f._r$9 = _r$9; $f._tuple = _tuple; $f.addr = addr; $f.b = b; $f.c = c; $f.err = err; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; UDPConn.prototype.ReadFromUDP = function(b) { return this.$val.ReadFromUDP(b); }; UDPConn.ptr.prototype.readFromUDP = function(b, addr) { var _r$9, _tuple, addr, b, c, err, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tuple = $f._tuple; addr = $f.addr; b = $f.b; c = $f.c; err = $f.err; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!c.conn.ok()) { $s = -1; return [0, ptrType$16.nil, new syscall.Errno(22)]; } _r$9 = c.readFrom(b, addr); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; addr = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { err = new OpError.ptr("read", c.conn.fd.net, c.conn.fd.laddr, c.conn.fd.raddr, err); } $s = -1; return [n, addr, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: UDPConn.ptr.prototype.readFromUDP }; } $f._r$9 = _r$9; $f._tuple = _tuple; $f.addr = addr; $f.b = b; $f.c = c; $f.err = err; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; UDPConn.prototype.readFromUDP = function(b, addr) { return this.$val.readFromUDP(b, addr); }; UDPConn.ptr.prototype.ReadFrom = function(b) { var _r$9, _tuple, addr, b, c, err, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tuple = $f._tuple; addr = $f.addr; b = $f.b; c = $f.c; err = $f.err; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r$9 = c.readFromUDP(b, new UDPAddr.ptr(IP.nil, 0, "")); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; addr = _tuple[1]; err = _tuple[2]; if (addr === ptrType$16.nil) { $s = -1; return [n, $ifaceNil, err]; } $s = -1; return [n, addr, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: UDPConn.ptr.prototype.ReadFrom }; } $f._r$9 = _r$9; $f._tuple = _tuple; $f.addr = addr; $f.b = b; $f.c = c; $f.err = err; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; UDPConn.prototype.ReadFrom = function(b) { return this.$val.ReadFrom(b); }; UDPConn.ptr.prototype.ReadMsgUDP = function(b, oob) { var _r$9, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tuple, addr, b, c, err, flags, n, oob, oobn, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tuple = $f._tuple; addr = $f.addr; b = $f.b; c = $f.c; err = $f.err; flags = $f.flags; n = $f.n; oob = $f.oob; oobn = $f.oobn; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; oobn = 0; flags = 0; addr = ptrType$16.nil; err = $ifaceNil; c = this; if (!c.conn.ok()) { _tmp = 0; _tmp$1 = 0; _tmp$2 = 0; _tmp$3 = ptrType$16.nil; _tmp$4 = new syscall.Errno(22); n = _tmp; oobn = _tmp$1; flags = _tmp$2; addr = _tmp$3; err = _tmp$4; $s = -1; return [n, oobn, flags, addr, err]; } _r$9 = c.readMsg(b, oob); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; oobn = _tuple[1]; flags = _tuple[2]; addr = _tuple[3]; err = _tuple[4]; if (!($interfaceIsEqual(err, $ifaceNil))) { err = new OpError.ptr("read", c.conn.fd.net, c.conn.fd.laddr, c.conn.fd.raddr, err); } $s = -1; return [n, oobn, flags, addr, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: UDPConn.ptr.prototype.ReadMsgUDP }; } $f._r$9 = _r$9; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tuple = _tuple; $f.addr = addr; $f.b = b; $f.c = c; $f.err = err; $f.flags = flags; $f.n = n; $f.oob = oob; $f.oobn = oobn; $f.$s = $s; $f.$r = $r; return $f; }; UDPConn.prototype.ReadMsgUDP = function(b, oob) { return this.$val.ReadMsgUDP(b, oob); }; UDPConn.ptr.prototype.WriteToUDP = function(b, addr) { var _r$9, _tuple, addr, b, c, err, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tuple = $f._tuple; addr = $f.addr; b = $f.b; c = $f.c; err = $f.err; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!c.conn.ok()) { $s = -1; return [0, new syscall.Errno(22)]; } _r$9 = c.writeTo(b, addr); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { err = new OpError.ptr("write", c.conn.fd.net, c.conn.fd.laddr, addr.opAddr(), err); } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: UDPConn.ptr.prototype.WriteToUDP }; } $f._r$9 = _r$9; $f._tuple = _tuple; $f.addr = addr; $f.b = b; $f.c = c; $f.err = err; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; UDPConn.prototype.WriteToUDP = function(b, addr) { return this.$val.WriteToUDP(b, addr); }; UDPConn.ptr.prototype.WriteTo = function(b, addr) { var _r$9, _tuple, _tuple$1, a, addr, b, c, err, n, ok, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; a = $f.a; addr = $f.addr; b = $f.b; c = $f.c; err = $f.err; n = $f.n; ok = $f.ok; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!c.conn.ok()) { $s = -1; return [0, new syscall.Errno(22)]; } _tuple = $assertType(addr, ptrType$16, true); a = _tuple[0]; ok = _tuple[1]; if (!ok) { $s = -1; return [0, new OpError.ptr("write", c.conn.fd.net, c.conn.fd.laddr, addr, new syscall.Errno(22))]; } _r$9 = c.writeTo(b, a); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple$1 = _r$9; n = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { err = new OpError.ptr("write", c.conn.fd.net, c.conn.fd.laddr, a.opAddr(), err); } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: UDPConn.ptr.prototype.WriteTo }; } $f._r$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.a = a; $f.addr = addr; $f.b = b; $f.c = c; $f.err = err; $f.n = n; $f.ok = ok; $f.$s = $s; $f.$r = $r; return $f; }; UDPConn.prototype.WriteTo = function(b, addr) { return this.$val.WriteTo(b, addr); }; UDPConn.ptr.prototype.WriteMsgUDP = function(b, oob, addr) { var _r$9, _tmp, _tmp$1, _tmp$2, _tuple, addr, b, c, err, n, oob, oobn, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tuple = $f._tuple; addr = $f.addr; b = $f.b; c = $f.c; err = $f.err; n = $f.n; oob = $f.oob; oobn = $f.oobn; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; oobn = 0; err = $ifaceNil; c = this; if (!c.conn.ok()) { _tmp = 0; _tmp$1 = 0; _tmp$2 = new syscall.Errno(22); n = _tmp; oobn = _tmp$1; err = _tmp$2; $s = -1; return [n, oobn, err]; } _r$9 = c.writeMsg(b, oob, addr); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; oobn = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { err = new OpError.ptr("write", c.conn.fd.net, c.conn.fd.laddr, addr.opAddr(), err); } $s = -1; return [n, oobn, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: UDPConn.ptr.prototype.WriteMsgUDP }; } $f._r$9 = _r$9; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tuple = _tuple; $f.addr = addr; $f.b = b; $f.c = c; $f.err = err; $f.n = n; $f.oob = oob; $f.oobn = oobn; $f.$s = $s; $f.$r = $r; return $f; }; UDPConn.prototype.WriteMsgUDP = function(b, oob, addr) { return this.$val.WriteMsgUDP(b, oob, addr); }; newUDPConn = function(fd) { var fd; return new UDPConn.ptr(new conn.ptr(fd)); }; DialUDP = function(network, laddr, raddr) { var _1, _r$9, _tuple, c, err, laddr, network, raddr, sd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r$9 = $f._r$9; _tuple = $f._tuple; c = $f.c; err = $f.err; laddr = $f.laddr; network = $f.network; raddr = $f.raddr; sd = $f.sd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _1 = network; if (_1 === ("udp") || _1 === ("udp4") || _1 === ("udp6")) { } else { $s = -1; return [ptrType$17.nil, new OpError.ptr("dial", network, laddr.opAddr(), raddr.opAddr(), new UnknownNetworkError((network)))]; } if (raddr === ptrType$16.nil) { $s = -1; return [ptrType$17.nil, new OpError.ptr("dial", network, laddr.opAddr(), $ifaceNil, errMissingAddress)]; } sd = new sysDialer.ptr(new Dialer.ptr(new time.Duration(0, 0), new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil), $ifaceNil, false, new time.Duration(0, 0), new time.Duration(0, 0), ptrType$13.nil, $chanNil, $throwNilPointerError), network, raddr.String()); _r$9 = sd.dialUDP(context.Background(), laddr, raddr); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; c = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$17.nil, new OpError.ptr("dial", network, laddr.opAddr(), raddr.opAddr(), err)]; } $s = -1; return [c, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: DialUDP }; } $f._1 = _1; $f._r$9 = _r$9; $f._tuple = _tuple; $f.c = c; $f.err = err; $f.laddr = laddr; $f.network = network; $f.raddr = raddr; $f.sd = sd; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.DialUDP = DialUDP; setKeepAlivePeriod = function(fd, d) { var _r$10, _r$9, d, err, err$1, fd, secs, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$10 = $f._r$10; _r$9 = $f._r$9; d = $f.d; err = $f.err; err$1 = $f.err$1; fd = $f.fd; secs = $f.secs; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: secs = (((x = roundDurationUp(d, new time.Duration(0, 1000000000)), x.$low + ((x.$high >> 31) * 4294967296)) >> 0)); _r$9 = fd.pfd.SetsockoptInt(6, 5, secs); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err = _r$9; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return wrapSyscallError("setsockopt", err); } _r$10 = fd.pfd.SetsockoptInt(6, 4, secs); /* */ $s = 2; case 2: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } err$1 = _r$10; runtime.KeepAlive(fd); $s = -1; return wrapSyscallError("setsockopt", err$1); /* */ } return; } if ($f === undefined) { $f = { $blk: setKeepAlivePeriod }; } $f._r$10 = _r$10; $f._r$9 = _r$9; $f.d = d; $f.err = err; $f.err$1 = err$1; $f.fd = fd; $f.secs = secs; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; setNoDelay = function(fd, noDelay) { var _r$9, err, fd, noDelay, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; err = $f.err; fd = $f.fd; noDelay = $f.noDelay; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$9 = fd.pfd.SetsockoptInt(6, 1, boolint(noDelay)); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err = _r$9; runtime.KeepAlive(fd); $s = -1; return wrapSyscallError("setsockopt", err); /* */ } return; } if ($f === undefined) { $f = { $blk: setNoDelay }; } $f._r$9 = _r$9; $f.err = err; $f.fd = fd; $f.noDelay = noDelay; $f.$s = $s; $f.$r = $r; return $f; }; sockaddrToTCP = function(sa) { var $24r, _r$9, _ref, sa, sa$1, sa$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$9 = $f._r$9; _ref = $f._ref; sa = $f.sa; sa$1 = $f.sa$1; sa$2 = $f.sa$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _ref = sa; /* */ if ($assertType(_ref, ptrType$14, true)[1]) { $s = 1; continue; } /* */ if ($assertType(_ref, ptrType$15, true)[1]) { $s = 2; continue; } /* */ $s = 3; continue; /* if ($assertType(_ref, ptrType$14, true)[1]) { */ case 1: sa$1 = _ref.$val; $s = -1; return new TCPAddr.ptr($convertSliceType($subslice(new sliceType$1(sa$1.Addr), 0), IP), sa$1.Port, ""); /* } else if ($assertType(_ref, ptrType$15, true)[1]) { */ case 2: sa$2 = _ref.$val; _r$9 = zoneCache.name(((sa$2.ZoneId >> 0))); /* */ $s = 4; case 4: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $24r = new TCPAddr.ptr($convertSliceType($subslice(new sliceType$1(sa$2.Addr), 0), IP), sa$2.Port, _r$9); $s = 5; case 5: return $24r; /* } */ case 3: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: sockaddrToTCP }; } $f.$24r = $24r; $f._r$9 = _r$9; $f._ref = _ref; $f.sa = sa; $f.sa$1 = sa$1; $f.sa$2 = sa$2; $f.$s = $s; $f.$r = $r; return $f; }; TCPAddr.ptr.prototype.family = function() { var a; a = this; if (a === ptrType$19.nil || a.IP.$length <= 4) { return 2; } if (!(a.IP.To4() === IP.nil)) { return 2; } return 10; }; TCPAddr.prototype.family = function() { return this.$val.family(); }; TCPAddr.ptr.prototype.sockaddr = function(family) { var $24r, _r$9, a, family, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$9 = $f._r$9; a = $f.a; family = $f.family; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: a = this; if (a === ptrType$19.nil) { $s = -1; return [$ifaceNil, $ifaceNil]; } _r$9 = ipToSockaddr(family, a.IP, a.Port, a.Zone); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $24r = _r$9; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: TCPAddr.ptr.prototype.sockaddr }; } $f.$24r = $24r; $f._r$9 = _r$9; $f.a = a; $f.family = family; $f.$s = $s; $f.$r = $r; return $f; }; TCPAddr.prototype.sockaddr = function(family) { return this.$val.sockaddr(family); }; TCPAddr.ptr.prototype.toLocal = function(net) { var a, net; a = this; return new TCPAddr.ptr(loopbackIP(net), a.Port, a.Zone); }; TCPAddr.prototype.toLocal = function(net) { return this.$val.toLocal(net); }; TCPConn.ptr.prototype.readFrom = function(r) { var $24r, _r$10, _r$11, _r$9, _tuple, _tuple$1, c, err, err$1, handled, handled$1, n, n$1, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; c = $f.c; err = $f.err; err$1 = $f.err$1; handled = $f.handled; handled$1 = $f.handled$1; n = $f.n; n$1 = $f.n$1; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r$9 = splice(c.conn.fd, r); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; err = _tuple[1]; handled = _tuple[2]; if (handled) { $s = -1; return [n, err]; } _r$10 = sendFile(c.conn.fd, r); /* */ $s = 2; case 2: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$1 = _r$10; n$1 = _tuple$1[0]; err$1 = _tuple$1[1]; handled$1 = _tuple$1[2]; if (handled$1) { $s = -1; return [n$1, err$1]; } _r$11 = genericReadFrom(c, r); /* */ $s = 3; case 3: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } $24r = _r$11; $s = 4; case 4: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: TCPConn.ptr.prototype.readFrom }; } $f.$24r = $24r; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.c = c; $f.err = err; $f.err$1 = err$1; $f.handled = handled; $f.handled$1 = handled$1; $f.n = n; $f.n$1 = n$1; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; TCPConn.prototype.readFrom = function(r) { return this.$val.readFrom(r); }; sysDialer.ptr.prototype.dialTCP = function(ctx, laddr, raddr) { var $24r, $24r$1, _r$10, _r$9, ctx, laddr, raddr, sd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r$10 = $f._r$10; _r$9 = $f._r$9; ctx = $f.ctx; laddr = $f.laddr; raddr = $f.raddr; sd = $f.sd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sd = this; /* */ if (!(testHookDialTCP === $throwNilPointerError)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(testHookDialTCP === $throwNilPointerError)) { */ case 1: _r$9 = testHookDialTCP(ctx, sd.network, laddr, raddr); /* */ $s = 3; case 3: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $24r = _r$9; $s = 4; case 4: return $24r; /* } */ case 2: _r$10 = sd.doDialTCP(ctx, laddr, raddr); /* */ $s = 5; case 5: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } $24r$1 = _r$10; $s = 6; case 6: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: sysDialer.ptr.prototype.dialTCP }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r$10 = _r$10; $f._r$9 = _r$9; $f.ctx = ctx; $f.laddr = laddr; $f.raddr = raddr; $f.sd = sd; $f.$s = $s; $f.$r = $r; return $f; }; sysDialer.prototype.dialTCP = function(ctx, laddr, raddr) { return this.$val.dialTCP(ctx, laddr, raddr); }; sysDialer.ptr.prototype.doDialTCP = function(ctx, laddr, raddr) { var $24r, _r$10, _r$11, _r$12, _r$9, _tuple, _tuple$1, ctx, err, fd, i, laddr, raddr, sd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; ctx = $f.ctx; err = $f.err; fd = $f.fd; i = $f.i; laddr = $f.laddr; raddr = $f.raddr; sd = $f.sd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sd = this; _r$9 = internetSocket(ctx, sd.network, laddr, raddr, 1, 0, "dial", sd.Dialer.Control); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; fd = _tuple[0]; err = _tuple[1]; i = 0; /* while (true) { */ case 2: /* if (!(i < 2 && (laddr === ptrType$19.nil || (laddr.Port === 0)) && (selfConnect(fd, err) || spuriousENOTAVAIL(err)))) { break; } */ if(!(i < 2 && (laddr === ptrType$19.nil || (laddr.Port === 0)) && (selfConnect(fd, err) || spuriousENOTAVAIL(err)))) { $s = 3; continue; } /* */ if ($interfaceIsEqual(err, $ifaceNil)) { $s = 4; continue; } /* */ $s = 5; continue; /* if ($interfaceIsEqual(err, $ifaceNil)) { */ case 4: _r$10 = fd.Close(); /* */ $s = 6; case 6: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; /* } */ case 5: _r$11 = internetSocket(ctx, sd.network, laddr, raddr, 1, 0, "dial", sd.Dialer.Control); /* */ $s = 7; case 7: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tuple$1 = _r$11; fd = _tuple$1[0]; err = _tuple$1[1]; i = i + (1) >> 0; $s = 2; continue; case 3: if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$20.nil, err]; } _r$12 = newTCPConn(fd); /* */ $s = 8; case 8: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } $24r = [_r$12, $ifaceNil]; $s = 9; case 9: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: sysDialer.ptr.prototype.doDialTCP }; } $f.$24r = $24r; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.ctx = ctx; $f.err = err; $f.fd = fd; $f.i = i; $f.laddr = laddr; $f.raddr = raddr; $f.sd = sd; $f.$s = $s; $f.$r = $r; return $f; }; sysDialer.prototype.doDialTCP = function(ctx, laddr, raddr) { return this.$val.doDialTCP(ctx, laddr, raddr); }; selfConnect = function(fd, err) { var err, fd, l, r; if (!($interfaceIsEqual(err, $ifaceNil))) { return false; } if ($interfaceIsEqual(fd.laddr, $ifaceNil) || $interfaceIsEqual(fd.raddr, $ifaceNil)) { return true; } l = $assertType(fd.laddr, ptrType$19); r = $assertType(fd.raddr, ptrType$19); return (l.Port === r.Port) && l.IP.Equal(r.IP); }; spuriousENOTAVAIL = function(err) { var _tuple, _tuple$1, err, ok, ok$1, op, sys; _tuple = $assertType(err, ptrType$21, true); op = _tuple[0]; ok = _tuple[1]; if (ok) { err = op.Err; } _tuple$1 = $assertType(err, ptrType$22, true); sys = _tuple$1[0]; ok$1 = _tuple$1[1]; if (ok$1) { err = sys.Err; } return $interfaceIsEqual(err, new syscall.Errno(99)); }; TCPAddr.ptr.prototype.Network = function() { var a; a = this; return "tcp"; }; TCPAddr.prototype.Network = function() { return this.$val.Network(); }; TCPAddr.ptr.prototype.String = function() { var a, ip; a = this; if (a === ptrType$19.nil) { return ""; } ip = ipEmptyString(a.IP); if (!(a.Zone === "")) { return JoinHostPort(ip + "%" + a.Zone, itoa.Itoa(a.Port)); } return JoinHostPort(ip, itoa.Itoa(a.Port)); }; TCPAddr.prototype.String = function() { return this.$val.String(); }; TCPAddr.ptr.prototype.isWildcard = function() { var a; a = this; if (a === ptrType$19.nil || a.IP === IP.nil) { return true; } return a.IP.IsUnspecified(); }; TCPAddr.prototype.isWildcard = function() { return this.$val.isWildcard(); }; TCPAddr.ptr.prototype.opAddr = function() { var a; a = this; if (a === ptrType$19.nil) { return $ifaceNil; } return a; }; TCPAddr.prototype.opAddr = function() { return this.$val.opAddr(); }; TCPConn.ptr.prototype.SyscallConn = function() { var _returncast, c; c = this; if (!c.conn.ok()) { return [$ifaceNil, new syscall.Errno(22)]; } _returncast = newRawConn(c.conn.fd); return [_returncast[0], _returncast[1]]; }; TCPConn.prototype.SyscallConn = function() { return this.$val.SyscallConn(); }; TCPConn.ptr.prototype.ReadFrom = function(r) { var _r$9, _tuple, c, err, n, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tuple = $f._tuple; c = $f.c; err = $f.err; n = $f.n; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!c.conn.ok()) { $s = -1; return [new $Int64(0, 0), new syscall.Errno(22)]; } _r$9 = c.readFrom(r); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil)) && !($interfaceIsEqual(err, io.EOF))) { err = new OpError.ptr("readfrom", c.conn.fd.net, c.conn.fd.laddr, c.conn.fd.raddr, err); } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: TCPConn.ptr.prototype.ReadFrom }; } $f._r$9 = _r$9; $f._tuple = _tuple; $f.c = c; $f.err = err; $f.n = n; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; TCPConn.prototype.ReadFrom = function(r) { return this.$val.ReadFrom(r); }; TCPConn.ptr.prototype.CloseRead = function() { var _r$9, c, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; c = $f.c; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!c.conn.ok()) { $s = -1; return new syscall.Errno(22); } _r$9 = c.conn.fd.closeRead(); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err = _r$9; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return new OpError.ptr("close", c.conn.fd.net, c.conn.fd.laddr, c.conn.fd.raddr, err); } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: TCPConn.ptr.prototype.CloseRead }; } $f._r$9 = _r$9; $f.c = c; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; TCPConn.prototype.CloseRead = function() { return this.$val.CloseRead(); }; TCPConn.ptr.prototype.CloseWrite = function() { var _r$9, c, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; c = $f.c; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!c.conn.ok()) { $s = -1; return new syscall.Errno(22); } _r$9 = c.conn.fd.closeWrite(); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err = _r$9; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return new OpError.ptr("close", c.conn.fd.net, c.conn.fd.laddr, c.conn.fd.raddr, err); } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: TCPConn.ptr.prototype.CloseWrite }; } $f._r$9 = _r$9; $f.c = c; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; TCPConn.prototype.CloseWrite = function() { return this.$val.CloseWrite(); }; TCPConn.ptr.prototype.SetLinger = function(sec) { var _r$9, c, err, sec, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; c = $f.c; err = $f.err; sec = $f.sec; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!c.conn.ok()) { $s = -1; return new syscall.Errno(22); } _r$9 = setLinger(c.conn.fd, sec); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err = _r$9; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return new OpError.ptr("set", c.conn.fd.net, c.conn.fd.laddr, c.conn.fd.raddr, err); } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: TCPConn.ptr.prototype.SetLinger }; } $f._r$9 = _r$9; $f.c = c; $f.err = err; $f.sec = sec; $f.$s = $s; $f.$r = $r; return $f; }; TCPConn.prototype.SetLinger = function(sec) { return this.$val.SetLinger(sec); }; TCPConn.ptr.prototype.SetKeepAlive = function(keepalive) { var _r$9, c, err, keepalive, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; c = $f.c; err = $f.err; keepalive = $f.keepalive; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!c.conn.ok()) { $s = -1; return new syscall.Errno(22); } _r$9 = setKeepAlive(c.conn.fd, keepalive); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err = _r$9; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return new OpError.ptr("set", c.conn.fd.net, c.conn.fd.laddr, c.conn.fd.raddr, err); } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: TCPConn.ptr.prototype.SetKeepAlive }; } $f._r$9 = _r$9; $f.c = c; $f.err = err; $f.keepalive = keepalive; $f.$s = $s; $f.$r = $r; return $f; }; TCPConn.prototype.SetKeepAlive = function(keepalive) { return this.$val.SetKeepAlive(keepalive); }; TCPConn.ptr.prototype.SetKeepAlivePeriod = function(d) { var _r$9, c, d, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; c = $f.c; d = $f.d; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!c.conn.ok()) { $s = -1; return new syscall.Errno(22); } _r$9 = setKeepAlivePeriod(c.conn.fd, d); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err = _r$9; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return new OpError.ptr("set", c.conn.fd.net, c.conn.fd.laddr, c.conn.fd.raddr, err); } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: TCPConn.ptr.prototype.SetKeepAlivePeriod }; } $f._r$9 = _r$9; $f.c = c; $f.d = d; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; TCPConn.prototype.SetKeepAlivePeriod = function(d) { return this.$val.SetKeepAlivePeriod(d); }; TCPConn.ptr.prototype.SetNoDelay = function(noDelay) { var _r$9, c, err, noDelay, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; c = $f.c; err = $f.err; noDelay = $f.noDelay; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!c.conn.ok()) { $s = -1; return new syscall.Errno(22); } _r$9 = setNoDelay(c.conn.fd, noDelay); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err = _r$9; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return new OpError.ptr("set", c.conn.fd.net, c.conn.fd.laddr, c.conn.fd.raddr, err); } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: TCPConn.ptr.prototype.SetNoDelay }; } $f._r$9 = _r$9; $f.c = c; $f.err = err; $f.noDelay = noDelay; $f.$s = $s; $f.$r = $r; return $f; }; TCPConn.prototype.SetNoDelay = function(noDelay) { return this.$val.SetNoDelay(noDelay); }; newTCPConn = function(fd) { var _r$9, c, fd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; c = $f.c; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = new TCPConn.ptr(new conn.ptr(fd)); _r$9 = setNoDelay(c.conn.fd, true); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$9; $s = -1; return c; /* */ } return; } if ($f === undefined) { $f = { $blk: newTCPConn }; } $f._r$9 = _r$9; $f.c = c; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; }; roundDurationUp = function(d, to) { var d, to, x; return $div64(((x = new time.Duration(d.$high + to.$high, d.$low + to.$low), new time.Duration(x.$high - 0, x.$low - 1))), to, false); }; splice = function(c, r) { var _r$9, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, _tuple$3, c, err, handled, lr, ok, ok$1, ok$2, r, remain, s, sc, tc, uc, written, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _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$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; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; c = $f.c; err = $f.err; handled = $f.handled; lr = $f.lr; ok = $f.ok; ok$1 = $f.ok$1; ok$2 = $f.ok$2; r = $f.r; remain = $f.remain; s = $f.s; sc = $f.sc; tc = $f.tc; uc = $f.uc; written = $f.written; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: written = new $Int64(0, 0); err = $ifaceNil; handled = false; remain = new $Int64(1073741824, 0); _tuple = $assertType(r, ptrType$24, true); lr = _tuple[0]; ok = _tuple[1]; if (ok) { _tmp = lr.N; _tmp$1 = lr.R; remain = _tmp; r = _tmp$1; if ((remain.$high < 0 || (remain.$high === 0 && remain.$low <= 0))) { _tmp$2 = new $Int64(0, 0); _tmp$3 = $ifaceNil; _tmp$4 = true; written = _tmp$2; err = _tmp$3; handled = _tmp$4; $s = -1; return [written, err, handled]; } } s = ptrType$7.nil; _tuple$1 = $assertType(r, ptrType$20, true); tc = _tuple$1[0]; ok$1 = _tuple$1[1]; if (ok$1) { s = tc.conn.fd; } else { _tuple$2 = $assertType(r, ptrType$10, true); uc = _tuple$2[0]; ok$2 = _tuple$2[1]; if (ok$2) { if (!(uc.conn.fd.net === "unix")) { _tmp$5 = new $Int64(0, 0); _tmp$6 = $ifaceNil; _tmp$7 = false; written = _tmp$5; err = _tmp$6; handled = _tmp$7; $s = -1; return [written, err, handled]; } s = uc.conn.fd; } else { _tmp$8 = new $Int64(0, 0); _tmp$9 = $ifaceNil; _tmp$10 = false; written = _tmp$8; err = _tmp$9; handled = _tmp$10; $s = -1; return [written, err, handled]; } } _r$9 = poll.Splice(c.pfd, s.pfd, remain); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple$3 = _r$9; written = _tuple$3[0]; handled = _tuple$3[1]; sc = _tuple$3[2]; err = _tuple$3[3]; if (!(lr === ptrType$24.nil)) { lr.N = (x = lr.N, x$1 = written, new $Int64(x.$high - x$1.$high, x.$low - x$1.$low)); } _tmp$11 = written; _tmp$12 = wrapSyscallError(sc, err); _tmp$13 = handled; written = _tmp$11; err = _tmp$12; handled = _tmp$13; $s = -1; return [written, err, handled]; /* */ } return; } if ($f === undefined) { $f = { $blk: splice }; } $f._r$9 = _r$9; $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$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._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.c = c; $f.err = err; $f.handled = handled; $f.lr = lr; $f.ok = ok; $f.ok$1 = ok$1; $f.ok$2 = ok$2; $f.r = r; $f.remain = remain; $f.s = s; $f.sc = sc; $f.tc = tc; $f.uc = uc; $f.written = written; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; boolint = function(b) { var b; if (b) { return 1; } return 0; }; setReadBuffer = function(fd, bytes) { var _r$9, bytes, err, fd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; bytes = $f.bytes; err = $f.err; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$9 = fd.pfd.SetsockoptInt(1, 8, bytes); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err = _r$9; runtime.KeepAlive(fd); $s = -1; return wrapSyscallError("setsockopt", err); /* */ } return; } if ($f === undefined) { $f = { $blk: setReadBuffer }; } $f._r$9 = _r$9; $f.bytes = bytes; $f.err = err; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; }; setWriteBuffer = function(fd, bytes) { var _r$9, bytes, err, fd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; bytes = $f.bytes; err = $f.err; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$9 = fd.pfd.SetsockoptInt(1, 7, bytes); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err = _r$9; runtime.KeepAlive(fd); $s = -1; return wrapSyscallError("setsockopt", err); /* */ } return; } if ($f === undefined) { $f = { $blk: setWriteBuffer }; } $f._r$9 = _r$9; $f.bytes = bytes; $f.err = err; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; }; setKeepAlive = function(fd, keepalive) { var _r$9, err, fd, keepalive, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; err = $f.err; fd = $f.fd; keepalive = $f.keepalive; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$9 = fd.pfd.SetsockoptInt(1, 9, boolint(keepalive)); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err = _r$9; runtime.KeepAlive(fd); $s = -1; return wrapSyscallError("setsockopt", err); /* */ } return; } if ($f === undefined) { $f = { $blk: setKeepAlive }; } $f._r$9 = _r$9; $f.err = err; $f.fd = fd; $f.keepalive = keepalive; $f.$s = $s; $f.$r = $r; return $f; }; setLinger = function(fd, sec) { var _r$9, err, fd, l, sec, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; err = $f.err; fd = $f.fd; l = $f.l; sec = $f.sec; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: l = [l]; l[0] = new syscall.Linger.ptr(0, 0); if (sec >= 0) { l[0].Onoff = 1; l[0].Linger = ((sec >> 0)); } else { l[0].Onoff = 0; l[0].Linger = 0; } _r$9 = fd.pfd.SetsockoptLinger(1, 13, l[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err = _r$9; runtime.KeepAlive(fd); $s = -1; return wrapSyscallError("setsockopt", err); /* */ } return; } if ($f === undefined) { $f = { $blk: setLinger }; } $f._r$9 = _r$9; $f.err = err; $f.fd = fd; $f.l = l; $f.sec = sec; $f.$s = $s; $f.$r = $r; return $f; }; setDefaultSockopts = function(s, family, sotype, ipv6only$1) { var $24r, _arg, _r$10, _r$11, _r$9, family, ipv6only$1, s, sotype, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _arg = $f._arg; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$9 = $f._r$9; family = $f.family; ipv6only$1 = $f.ipv6only$1; s = $f.s; sotype = $f.sotype; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if ((family === 10) && !((sotype === 3))) { $s = 1; continue; } /* */ $s = 2; continue; /* if ((family === 10) && !((sotype === 3))) { */ case 1: _r$9 = syscall.SetsockoptInt(s, 41, 26, boolint(ipv6only$1)); /* */ $s = 3; case 3: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$9; /* } */ case 2: /* */ if (((sotype === 2) || (sotype === 3)) && !((family === 1))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (((sotype === 2) || (sotype === 3)) && !((family === 1))) { */ case 4: _r$10 = syscall.SetsockoptInt(s, 1, 6, 1); /* */ $s = 6; case 6: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _arg = _r$10; _r$11 = os.NewSyscallError("setsockopt", _arg); /* */ $s = 7; case 7: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } $24r = _r$11; $s = 8; case 8: return $24r; /* } */ case 5: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: setDefaultSockopts }; } $f.$24r = $24r; $f._arg = _arg; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$9 = _r$9; $f.family = family; $f.ipv6only$1 = ipv6only$1; $f.s = s; $f.sotype = sotype; $f.$s = $s; $f.$r = $r; return $f; }; setDefaultListenerSockopts = function(s) { var $24r, _arg, _r$10, _r$9, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _arg = $f._arg; _r$10 = $f._r$10; _r$9 = $f._r$9; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$9 = syscall.SetsockoptInt(s, 1, 2, 1); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _arg = _r$9; _r$10 = os.NewSyscallError("setsockopt", _arg); /* */ $s = 2; case 2: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } $24r = _r$10; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: setDefaultListenerSockopts }; } $f.$24r = $24r; $f._arg = _arg; $f._r$10 = _r$10; $f._r$9 = _r$9; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; setDefaultMulticastSockopts = function(s) { var $24r, _arg, _r$10, _r$9, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _arg = $f._arg; _r$10 = $f._r$10; _r$9 = $f._r$9; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$9 = syscall.SetsockoptInt(s, 1, 2, 1); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _arg = _r$9; _r$10 = os.NewSyscallError("setsockopt", _arg); /* */ $s = 2; case 2: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } $24r = _r$10; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: setDefaultMulticastSockopts }; } $f.$24r = $24r; $f._arg = _arg; $f._r$10 = _r$10; $f._r$9 = _r$9; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; socket = function(ctx, net, family, sotype, proto, ipv6only$1, laddr, raddr, ctrlFn) { var _1, _arg, _arg$1, _arg$2, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$19, _r$9, _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, ctrlFn, ctx, err, err$1, err$2, err$3, family, fd, ipv6only$1, laddr, net, proto, raddr, s, sotype, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _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$9 = $f._r$9; _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$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; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; ctrlFn = $f.ctrlFn; ctx = $f.ctx; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; family = $f.family; fd = $f.fd; ipv6only$1 = $f.ipv6only$1; laddr = $f.laddr; net = $f.net; proto = $f.proto; raddr = $f.raddr; s = $f.s; sotype = $f.sotype; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = ptrType$7.nil; err = $ifaceNil; _r$9 = sysSocket(family, sotype, proto); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; s = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp = ptrType$7.nil; _tmp$1 = err; fd = _tmp; err = _tmp$1; $s = -1; return [fd, err]; } _r$10 = setDefaultSockopts(s, family, sotype, ipv6only$1); /* */ $s = 2; case 2: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } err = _r$10; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 3: _r$11 = poll.CloseFunc(s); /* */ $s = 5; case 5: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _r$11; _tmp$2 = ptrType$7.nil; _tmp$3 = err; fd = _tmp$2; err = _tmp$3; $s = -1; return [fd, err]; /* } */ case 4: _tuple$1 = newFD(s, family, sotype, net); fd = _tuple$1[0]; err = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 6: _r$12 = poll.CloseFunc(s); /* */ $s = 8; case 8: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _r$12; _tmp$4 = ptrType$7.nil; _tmp$5 = err; fd = _tmp$4; err = _tmp$5; $s = -1; return [fd, err]; /* } */ case 7: /* */ if (!($interfaceIsEqual(laddr, $ifaceNil)) && $interfaceIsEqual(raddr, $ifaceNil)) { $s = 9; continue; } /* */ $s = 10; continue; /* if (!($interfaceIsEqual(laddr, $ifaceNil)) && $interfaceIsEqual(raddr, $ifaceNil)) { */ case 9: _1 = sotype; /* */ if ((_1 === (1)) || (_1 === (5))) { $s = 12; continue; } /* */ if (_1 === (2)) { $s = 13; continue; } /* */ $s = 14; continue; /* if ((_1 === (1)) || (_1 === (5))) { */ case 12: _arg = laddr; _r$13 = listenerBacklog(); /* */ $s = 15; case 15: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _arg$1 = _r$13; _arg$2 = ctrlFn; _r$14 = fd.listenStream(_arg, _arg$1, _arg$2); /* */ $s = 16; case 16: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } err$1 = _r$14; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 17; continue; } /* */ $s = 18; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 17: _r$15 = fd.Close(); /* */ $s = 19; case 19: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _r$15; _tmp$6 = ptrType$7.nil; _tmp$7 = err$1; fd = _tmp$6; err = _tmp$7; $s = -1; return [fd, err]; /* } */ case 18: _tmp$8 = fd; _tmp$9 = $ifaceNil; fd = _tmp$8; err = _tmp$9; $s = -1; return [fd, err]; /* } else if (_1 === (2)) { */ case 13: _r$16 = fd.listenDatagram(laddr, ctrlFn); /* */ $s = 20; case 20: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } err$2 = _r$16; /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 21; continue; } /* */ $s = 22; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 21: _r$17 = fd.Close(); /* */ $s = 23; case 23: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } _r$17; _tmp$10 = ptrType$7.nil; _tmp$11 = err$2; fd = _tmp$10; err = _tmp$11; $s = -1; return [fd, err]; /* } */ case 22: _tmp$12 = fd; _tmp$13 = $ifaceNil; fd = _tmp$12; err = _tmp$13; $s = -1; return [fd, err]; /* } */ case 14: case 11: /* } */ case 10: _r$18 = fd.dial(ctx, laddr, raddr, ctrlFn); /* */ $s = 24; case 24: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } err$3 = _r$18; /* */ if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = 25; continue; } /* */ $s = 26; continue; /* if (!($interfaceIsEqual(err$3, $ifaceNil))) { */ case 25: _r$19 = fd.Close(); /* */ $s = 27; case 27: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } _r$19; _tmp$14 = ptrType$7.nil; _tmp$15 = err$3; fd = _tmp$14; err = _tmp$15; $s = -1; return [fd, err]; /* } */ case 26: _tmp$16 = fd; _tmp$17 = $ifaceNil; fd = _tmp$16; err = _tmp$17; $s = -1; return [fd, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: socket }; } $f._1 = _1; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $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$9 = _r$9; $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$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._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.ctrlFn = ctrlFn; $f.ctx = ctx; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.family = family; $f.fd = fd; $f.ipv6only$1 = ipv6only$1; $f.laddr = laddr; $f.net = net; $f.proto = proto; $f.raddr = raddr; $f.s = s; $f.sotype = sotype; $f.$s = $s; $f.$r = $r; return $f; }; netFD.ptr.prototype.ctrlNetwork = function() { var _1, _2, fd; fd = this; _1 = fd.net; if (_1 === ("unix") || _1 === ("unixgram") || _1 === ("unixpacket")) { return fd.net; } _2 = fd.net.charCodeAt((fd.net.length - 1 >> 0)); if ((_2 === (52)) || (_2 === (54))) { return fd.net; } if (fd.family === 2) { return fd.net + "4"; } return fd.net + "6"; }; netFD.prototype.ctrlNetwork = function() { return this.$val.ctrlNetwork(); }; netFD.ptr.prototype.addrFunc = function() { var _1, _2, _3, fd; fd = this; _1 = fd.family; if ((_1 === (2)) || (_1 === (10))) { _2 = fd.sotype; if (_2 === (1)) { return sockaddrToTCP; } else if (_2 === (2)) { return sockaddrToUDP; } else if (_2 === (3)) { return sockaddrToIP; } } else if (_1 === (1)) { _3 = fd.sotype; if (_3 === (1)) { return sockaddrToUnix; } else if (_3 === (2)) { return sockaddrToUnixgram; } else if (_3 === (5)) { return sockaddrToUnixpacket; } } return (function(param) { var param; return $ifaceNil; }); }; netFD.prototype.addrFunc = function() { return this.$val.addrFunc(); }; netFD.ptr.prototype.dial = function(ctx, laddr, raddr, ctrlFn) { var _arg, _arg$1, _arg$2, _arg$3, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$19, _r$20, _r$21, _r$22, _r$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, c, crsa, ctrlAddr, ctrlFn, ctx, err, err$1, err$2, err$3, fd, laddr, lsa, raddr, rsa, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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$18 = $f._r$18; _r$19 = $f._r$19; _r$20 = $f._r$20; _r$21 = $f._r$21; _r$22 = $f._r$22; _r$9 = $f._r$9; _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; c = $f.c; crsa = $f.crsa; ctrlAddr = $f.ctrlAddr; ctrlFn = $f.ctrlFn; ctx = $f.ctx; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; fd = $f.fd; laddr = $f.laddr; lsa = $f.lsa; raddr = $f.raddr; rsa = $f.rsa; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = this; /* */ if (!(ctrlFn === $throwNilPointerError)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(ctrlFn === $throwNilPointerError)) { */ case 1: _tuple = newRawConn(fd); c = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } ctrlAddr = ""; /* */ if (!($interfaceIsEqual(raddr, $ifaceNil))) { $s = 3; continue; } /* */ if (!($interfaceIsEqual(laddr, $ifaceNil))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!($interfaceIsEqual(raddr, $ifaceNil))) { */ case 3: _r$9 = raddr.String(); /* */ $s = 6; case 6: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } ctrlAddr = _r$9; $s = 5; continue; /* } else if (!($interfaceIsEqual(laddr, $ifaceNil))) { */ case 4: _r$10 = laddr.String(); /* */ $s = 7; case 7: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } ctrlAddr = _r$10; /* } */ case 5: _r$11 = ctrlFn(fd.ctrlNetwork(), ctrlAddr, c); /* */ $s = 8; case 8: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } err$1 = _r$11; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } /* } */ case 2: err$2 = $ifaceNil; lsa = $ifaceNil; /* */ if (!($interfaceIsEqual(laddr, $ifaceNil))) { $s = 9; continue; } /* */ $s = 10; continue; /* if (!($interfaceIsEqual(laddr, $ifaceNil))) { */ case 9: _r$12 = laddr.sockaddr(fd.family); /* */ $s = 11; case 11: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _tuple$1 = _r$12; lsa = _tuple$1[0]; err$2 = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 12; continue; } /* */ if (!($interfaceIsEqual(lsa, $ifaceNil))) { $s = 13; continue; } /* */ $s = 14; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 12: $s = -1; return err$2; /* } else if (!($interfaceIsEqual(lsa, $ifaceNil))) { */ case 13: _r$13 = syscall.Bind(fd.pfd.Sysfd, lsa); /* */ $s = 15; case 15: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } err$2 = _r$13; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return os.NewSyscallError("bind", err$2); } /* } */ case 14: /* } */ case 10: rsa = $ifaceNil; crsa = $ifaceNil; /* */ if (!($interfaceIsEqual(raddr, $ifaceNil))) { $s = 16; continue; } /* */ $s = 17; continue; /* if (!($interfaceIsEqual(raddr, $ifaceNil))) { */ case 16: _r$14 = raddr.sockaddr(fd.family); /* */ $s = 19; case 19: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _tuple$2 = _r$14; rsa = _tuple$2[0]; err$2 = _tuple$2[1]; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return err$2; } _r$15 = fd.connect(ctx, lsa, rsa); /* */ $s = 20; case 20: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _tuple$3 = _r$15; crsa = _tuple$3[0]; err$2 = _tuple$3[1]; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return err$2; } fd.isConnected = true; $s = 18; continue; /* } else { */ case 17: err$3 = fd.init(); if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = -1; return err$3; } /* } */ case 18: _r$16 = syscall.Getsockname(fd.pfd.Sysfd); /* */ $s = 21; case 21: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _tuple$4 = _r$16; lsa = _tuple$4[0]; /* */ if (!($interfaceIsEqual(crsa, $ifaceNil))) { $s = 22; continue; } /* */ $s = 23; continue; /* if (!($interfaceIsEqual(crsa, $ifaceNil))) { */ case 22: _r$17 = fd.addrFunc()(lsa); /* */ $s = 25; case 25: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } _arg = _r$17; _r$18 = fd.addrFunc()(crsa); /* */ $s = 26; case 26: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } _arg$1 = _r$18; $r = fd.setAddr(_arg, _arg$1); /* */ $s = 27; case 27: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 24; continue; /* } else { */ case 23: _r$19 = syscall.Getpeername(fd.pfd.Sysfd); /* */ $s = 28; case 28: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } _tuple$5 = _r$19; rsa = _tuple$5[0]; /* */ if (!($interfaceIsEqual(rsa, $ifaceNil))) { $s = 29; continue; } /* */ $s = 30; continue; /* if (!($interfaceIsEqual(rsa, $ifaceNil))) { */ case 29: _r$20 = fd.addrFunc()(lsa); /* */ $s = 32; case 32: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } _arg$2 = _r$20; _r$21 = fd.addrFunc()(rsa); /* */ $s = 33; case 33: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } _arg$3 = _r$21; $r = fd.setAddr(_arg$2, _arg$3); /* */ $s = 34; case 34: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 31; continue; /* } else { */ case 30: _r$22 = fd.addrFunc()(lsa); /* */ $s = 35; case 35: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; } $r = fd.setAddr(_r$22, raddr); /* */ $s = 36; case 36: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 31: /* } */ case 24: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: netFD.ptr.prototype.dial }; } $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$18 = _r$18; $f._r$19 = _r$19; $f._r$20 = _r$20; $f._r$21 = _r$21; $f._r$22 = _r$22; $f._r$9 = _r$9; $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.c = c; $f.crsa = crsa; $f.ctrlAddr = ctrlAddr; $f.ctrlFn = ctrlFn; $f.ctx = ctx; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.fd = fd; $f.laddr = laddr; $f.lsa = lsa; $f.raddr = raddr; $f.rsa = rsa; $f.$s = $s; $f.$r = $r; return $f; }; netFD.prototype.dial = function(ctx, laddr, raddr, ctrlFn) { return this.$val.dial(ctx, laddr, raddr, ctrlFn); }; netFD.ptr.prototype.listenStream = function(laddr, backlog, ctrlFn) { var _arg, _arg$1, _arg$2, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$9, _tuple, _tuple$1, _tuple$2, backlog, c, ctrlFn, err, err$1, err$2, fd, laddr, lsa, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _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$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; backlog = $f.backlog; c = $f.c; ctrlFn = $f.ctrlFn; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; fd = $f.fd; laddr = $f.laddr; lsa = $f.lsa; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = this; err = $ifaceNil; _r$9 = setDefaultListenerSockopts(fd.pfd.Sysfd); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err = _r$9; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } lsa = $ifaceNil; _r$10 = laddr.sockaddr(fd.family); /* */ $s = 2; case 2: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple = _r$10; lsa = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } /* */ if (!(ctrlFn === $throwNilPointerError)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!(ctrlFn === $throwNilPointerError)) { */ case 3: _tuple$1 = newRawConn(fd); c = _tuple$1[0]; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } _arg = fd.ctrlNetwork(); _r$11 = laddr.String(); /* */ $s = 5; case 5: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _arg$1 = _r$11; _arg$2 = c; _r$12 = ctrlFn(_arg, _arg$1, _arg$2); /* */ $s = 6; case 6: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } err$2 = _r$12; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return err$2; } /* } */ case 4: _r$13 = syscall.Bind(fd.pfd.Sysfd, lsa); /* */ $s = 7; case 7: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } err = _r$13; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return os.NewSyscallError("bind", err); } _r$14 = listenFunc(fd.pfd.Sysfd, backlog); /* */ $s = 8; case 8: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } err = _r$14; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return os.NewSyscallError("listen", err); } err = fd.init(); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _r$15 = syscall.Getsockname(fd.pfd.Sysfd); /* */ $s = 9; case 9: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _tuple$2 = _r$15; lsa = _tuple$2[0]; _r$16 = fd.addrFunc()(lsa); /* */ $s = 10; case 10: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } $r = fd.setAddr(_r$16, $ifaceNil); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: netFD.ptr.prototype.listenStream }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $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$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.backlog = backlog; $f.c = c; $f.ctrlFn = ctrlFn; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.fd = fd; $f.laddr = laddr; $f.lsa = lsa; $f.$s = $s; $f.$r = $r; return $f; }; netFD.prototype.listenStream = function(laddr, backlog, ctrlFn) { return this.$val.listenStream(laddr, backlog, ctrlFn); }; netFD.ptr.prototype.listenDatagram = function(laddr, ctrlFn) { var _1, _arg, _arg$1, _arg$2, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$9, _ref, _tuple, _tuple$1, _tuple$2, addr, addr$1, c, ctrlFn, err, err$1, err$2, err$3, fd, laddr, lsa, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _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$9 = $f._r$9; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; addr = $f.addr; addr$1 = $f.addr$1; c = $f.c; ctrlFn = $f.ctrlFn; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; fd = $f.fd; laddr = $f.laddr; lsa = $f.lsa; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: addr = [addr]; fd = this; _ref = laddr; /* */ if ($assertType(_ref, ptrType$16, true)[1]) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($assertType(_ref, ptrType$16, true)[1]) { */ case 1: addr$1 = _ref.$val; /* */ if (!(addr$1.IP === IP.nil) && addr$1.IP.IsMulticast()) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!(addr$1.IP === IP.nil) && addr$1.IP.IsMulticast()) { */ case 3: _r$9 = setDefaultMulticastSockopts(fd.pfd.Sysfd); /* */ $s = 5; case 5: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err = _r$9; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } addr[0] = $clone(addr$1, UDPAddr); _1 = fd.family; if (_1 === (2)) { addr[0].IP = $pkg.IPv4zero; } else if (_1 === (10)) { addr[0].IP = $pkg.IPv6unspecified; } laddr = addr[0]; /* } */ case 4: /* } */ case 2: err$1 = $ifaceNil; lsa = $ifaceNil; _r$10 = laddr.sockaddr(fd.family); /* */ $s = 6; case 6: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple = _r$10; lsa = _tuple[0]; err$1 = _tuple[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } /* */ if (!(ctrlFn === $throwNilPointerError)) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!(ctrlFn === $throwNilPointerError)) { */ case 7: _tuple$1 = newRawConn(fd); c = _tuple$1[0]; err$2 = _tuple$1[1]; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return err$2; } _arg = fd.ctrlNetwork(); _r$11 = laddr.String(); /* */ $s = 9; case 9: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _arg$1 = _r$11; _arg$2 = c; _r$12 = ctrlFn(_arg, _arg$1, _arg$2); /* */ $s = 10; case 10: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } err$3 = _r$12; if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = -1; return err$3; } /* } */ case 8: _r$13 = syscall.Bind(fd.pfd.Sysfd, lsa); /* */ $s = 11; case 11: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } err$1 = _r$13; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return os.NewSyscallError("bind", err$1); } err$1 = fd.init(); if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } _r$14 = syscall.Getsockname(fd.pfd.Sysfd); /* */ $s = 12; case 12: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _tuple$2 = _r$14; lsa = _tuple$2[0]; _r$15 = fd.addrFunc()(lsa); /* */ $s = 13; case 13: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } $r = fd.setAddr(_r$15, $ifaceNil); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: netFD.ptr.prototype.listenDatagram }; } $f._1 = _1; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $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$9 = _r$9; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.addr = addr; $f.addr$1 = addr$1; $f.c = c; $f.ctrlFn = ctrlFn; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.fd = fd; $f.laddr = laddr; $f.lsa = lsa; $f.$s = $s; $f.$r = $r; return $f; }; netFD.prototype.listenDatagram = function(laddr, ctrlFn) { return this.$val.listenDatagram(laddr, ctrlFn); }; sysSocket = function(family, sotype, proto) { var _1, _r$10, _r$11, _r$12, _r$9, _tuple, _tuple$1, err, family, proto, s, sotype, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; err = $f.err; family = $f.family; proto = $f.proto; s = $f.s; sotype = $f.sotype; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$9 = socketFunc(family, (sotype | 2048) | 524288, proto); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; s = _tuple[0]; err = _tuple[1]; _1 = err; if ($interfaceIsEqual(_1, $ifaceNil)) { $s = -1; return [s, $ifaceNil]; } else if ($interfaceIsEqual(_1, new syscall.Errno((93))) || $interfaceIsEqual(_1, new syscall.Errno((22)))) { } else { $s = -1; return [-1, os.NewSyscallError("socket", err)]; } $r = syscall.ForkLock.RLock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$10 = socketFunc(family, sotype, proto); /* */ $s = 3; case 3: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$1 = _r$10; s = _tuple$1[0]; err = _tuple$1[1]; /* */ if ($interfaceIsEqual(err, $ifaceNil)) { $s = 4; continue; } /* */ $s = 5; continue; /* if ($interfaceIsEqual(err, $ifaceNil)) { */ case 4: $r = syscall.CloseOnExec(s); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: $r = syscall.ForkLock.RUnlock(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [-1, os.NewSyscallError("socket", err)]; } _r$11 = syscall.SetNonblock(s, true); /* */ $s = 8; case 8: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } err = _r$11; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 9; continue; } /* */ $s = 10; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 9: _r$12 = poll.CloseFunc(s); /* */ $s = 11; case 11: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _r$12; $s = -1; return [-1, os.NewSyscallError("setnonblock", err)]; /* } */ case 10: $s = -1; return [s, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: sysSocket }; } $f._1 = _1; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.err = err; $f.family = family; $f.proto = proto; $f.s = s; $f.sotype = sotype; $f.$s = $s; $f.$r = $r; return $f; }; sendFile = function(c, r) { var _r$9, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, c, err, f, handled, lr, ok, r, remain, sc, werr, written, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _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$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; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; c = $f.c; err = $f.err; f = $f.f; handled = $f.handled; lr = $f.lr; ok = $f.ok; r = $f.r; remain = $f.remain; sc = $f.sc; werr = $f.werr; written = $f.written; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = [c]; remain = [remain]; werr = [werr]; written = [written]; written[0] = new $Int64(0, 0); err = $ifaceNil; handled = false; remain[0] = new $Int64(1073741824, 0); _tuple = $assertType(r, ptrType$24, true); lr = _tuple[0]; ok = _tuple[1]; if (ok) { _tmp = lr.N; _tmp$1 = lr.R; remain[0] = _tmp; r = _tmp$1; if ((remain[0].$high < 0 || (remain[0].$high === 0 && remain[0].$low <= 0))) { _tmp$2 = new $Int64(0, 0); _tmp$3 = $ifaceNil; _tmp$4 = true; written[0] = _tmp$2; err = _tmp$3; handled = _tmp$4; $s = -1; return [written[0], err, handled]; } } _tuple$1 = $assertType(r, ptrType$11, true); f = _tuple$1[0]; ok = _tuple$1[1]; if (!ok) { _tmp$5 = new $Int64(0, 0); _tmp$6 = $ifaceNil; _tmp$7 = false; written[0] = _tmp$5; err = _tmp$6; handled = _tmp$7; $s = -1; return [written[0], err, handled]; } _tuple$2 = f.SyscallConn(); sc = _tuple$2[0]; err = _tuple$2[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$8 = new $Int64(0, 0); _tmp$9 = $ifaceNil; _tmp$10 = false; written[0] = _tmp$8; err = _tmp$9; handled = _tmp$10; $s = -1; return [written[0], err, handled]; } werr[0] = $ifaceNil; _r$9 = sc.Read((function(c, remain, werr, written) { return function $b(fd) { var _r$9, _tuple$3, fd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tuple$3 = $f._tuple$3; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$9 = poll.SendFile(c[0].pfd, ((fd >> 0)), remain[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple$3 = _r$9; written[0] = _tuple$3[0]; werr[0] = _tuple$3[1]; $s = -1; return true; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$9 = _r$9; $f._tuple$3 = _tuple$3; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; }; })(c, remain, werr, written)); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err = _r$9; if ($interfaceIsEqual(err, $ifaceNil)) { err = werr[0]; } if (!(lr === ptrType$24.nil)) { lr.N = new $Int64(remain[0].$high - written[0].$high, remain[0].$low - written[0].$low); } _tmp$11 = written[0]; _tmp$12 = wrapSyscallError("sendfile", err); _tmp$13 = (written[0].$high > 0 || (written[0].$high === 0 && written[0].$low > 0)); written[0] = _tmp$11; err = _tmp$12; handled = _tmp$13; $s = -1; return [written[0], err, handled]; /* */ } return; } if ($f === undefined) { $f = { $blk: sendFile }; } $f._r$9 = _r$9; $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$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._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.c = c; $f.err = err; $f.f = f; $f.handled = handled; $f.lr = lr; $f.ok = ok; $f.r = r; $f.remain = remain; $f.sc = sc; $f.werr = werr; $f.written = written; $f.$s = $s; $f.$r = $r; return $f; }; rawConn.ptr.prototype.ok = function() { var c; c = this; return !(c === ptrType$26.nil) && !(c.fd === ptrType$7.nil); }; rawConn.prototype.ok = function() { return this.$val.ok(); }; rawConn.ptr.prototype.Control = function(f) { var _r$9, c, err, f, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; c = $f.c; err = $f.err; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!c.ok()) { $s = -1; return new syscall.Errno(22); } _r$9 = c.fd.pfd.RawControl(f); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err = _r$9; runtime.KeepAlive(c.fd); if (!($interfaceIsEqual(err, $ifaceNil))) { err = new OpError.ptr("raw-control", c.fd.net, $ifaceNil, c.fd.laddr, err); } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: rawConn.ptr.prototype.Control }; } $f._r$9 = _r$9; $f.c = c; $f.err = err; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; }; rawConn.prototype.Control = function(f) { return this.$val.Control(f); }; rawConn.ptr.prototype.Read = function(f) { var _r$9, c, err, f, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; c = $f.c; err = $f.err; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!c.ok()) { $s = -1; return new syscall.Errno(22); } _r$9 = c.fd.pfd.RawRead(f); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err = _r$9; runtime.KeepAlive(c.fd); if (!($interfaceIsEqual(err, $ifaceNil))) { err = new OpError.ptr("raw-read", c.fd.net, c.fd.laddr, c.fd.raddr, err); } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: rawConn.ptr.prototype.Read }; } $f._r$9 = _r$9; $f.c = c; $f.err = err; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; }; rawConn.prototype.Read = function(f) { return this.$val.Read(f); }; rawConn.ptr.prototype.Write = function(f) { var _r$9, c, err, f, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; c = $f.c; err = $f.err; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!c.ok()) { $s = -1; return new syscall.Errno(22); } _r$9 = c.fd.pfd.RawWrite(f); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err = _r$9; runtime.KeepAlive(c.fd); if (!($interfaceIsEqual(err, $ifaceNil))) { err = new OpError.ptr("raw-write", c.fd.net, c.fd.laddr, c.fd.raddr, err); } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: rawConn.ptr.prototype.Write }; } $f._r$9 = _r$9; $f.c = c; $f.err = err; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; }; rawConn.prototype.Write = function(f) { return this.$val.Write(f); }; newRawConn = function(fd) { var fd; return [new rawConn.ptr(fd), $ifaceNil]; }; readServices = function() { var _entry, _key, _key$1, _r$10, _r$11, _r$12, _r$13, _r$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, err, f, file$1, i, i$1, j, line, m, netw, ok, ok$1, ok1, port, portnet, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _key = $f._key; _key$1 = $f._key$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$13 = $f._r$13; _r$9 = $f._r$9; _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; err = $f.err; f = $f.f; file$1 = $f.file$1; i = $f.i; i$1 = $f.i$1; j = $f.j; line = $f.line; m = $f.m; netw = $f.netw; ok = $f.ok; ok$1 = $f.ok$1; ok1 = $f.ok1; port = $f.port; portnet = $f.portnet; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); _r$9 = open("/etc/services"); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; file$1 = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $s = 4; case 4: return; /* } */ case 3: $deferred.push([$methodVal(file$1, "close"), []]); _r$10 = file$1.readLine(); /* */ $s = 5; case 5: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$1 = _r$10; line = _tuple$1[0]; ok = _tuple$1[1]; /* while (true) { */ case 6: /* if (!(ok)) { break; } */ if(!(ok)) { $s = 7; continue; } i = bytealg.IndexByteString(line, 35); if (i >= 0) { line = $substring(line, 0, i); } f = getFields(line); /* */ if (f.$length < 2) { $s = 8; continue; } /* */ $s = 9; continue; /* if (f.$length < 2) { */ case 8: _r$11 = file$1.readLine(); /* */ $s = 10; case 10: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tuple$2 = _r$11; line = _tuple$2[0]; ok = _tuple$2[1]; /* continue; */ $s = 6; continue; /* } */ case 9: portnet = (1 >= f.$length ? ($throwRuntimeError("index out of range"), undefined) : f.$array[f.$offset + 1]); _tuple$3 = dtoi(portnet); port = _tuple$3[0]; j = _tuple$3[1]; ok$1 = _tuple$3[2]; /* */ if (!ok$1 || port <= 0 || j >= portnet.length || !((portnet.charCodeAt(j) === 47))) { $s = 11; continue; } /* */ $s = 12; continue; /* if (!ok$1 || port <= 0 || j >= portnet.length || !((portnet.charCodeAt(j) === 47))) { */ case 11: _r$12 = file$1.readLine(); /* */ $s = 13; case 13: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _tuple$4 = _r$12; line = _tuple$4[0]; ok = _tuple$4[1]; /* continue; */ $s = 6; continue; /* } */ case 12: netw = $substring(portnet, (j + 1 >> 0)); _tuple$5 = (_entry = services[$String.keyFor(netw)], _entry !== undefined ? [_entry.v, true] : [false, false]); m = _tuple$5[0]; ok1 = _tuple$5[1]; if (!ok1) { m = {}; _key = netw; (services || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: m }; } i$1 = 0; while (true) { if (!(i$1 < f.$length)) { break; } if (!((i$1 === 1))) { _key$1 = ((i$1 < 0 || i$1 >= f.$length) ? ($throwRuntimeError("index out of range"), undefined) : f.$array[f.$offset + i$1]); (m || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key$1)] = { k: _key$1, v: port }; } i$1 = i$1 + (1) >> 0; } _r$13 = file$1.readLine(); /* */ $s = 14; case 14: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _tuple$6 = _r$13; line = _tuple$6[0]; ok = _tuple$6[1]; $s = 6; continue; case 7: $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: readServices }; } $f._entry = _entry; $f._key = _key; $f._key$1 = _key$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$13 = _r$13; $f._r$9 = _r$9; $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.err = err; $f.f = f; $f.file$1 = file$1; $f.i = i; $f.i$1 = i$1; $f.j = j; $f.line = line; $f.m = m; $f.netw = netw; $f.ok = ok; $f.ok$1 = ok$1; $f.ok1 = ok1; $f.port = port; $f.portnet = portnet; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; goLookupPort = function(network, service) { var _tuple, err, network, port, service, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; err = $f.err; network = $f.network; port = $f.port; service = $f.service; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: port = 0; err = $ifaceNil; $r = onceReadServices.Do(readServices); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tuple = lookupPortMap(network, service); port = _tuple[0]; err = _tuple[1]; $s = -1; return [port, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: goLookupPort }; } $f._tuple = _tuple; $f.err = err; $f.network = network; $f.port = port; $f.service = service; $f.$s = $s; $f.$r = $r; return $f; }; parsePort = function(service) { var _i, _ref, _rune, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, d, n, needsLookup, neg, nn, port, service; port = 0; needsLookup = false; if (service === "") { _tmp = 0; _tmp$1 = false; port = _tmp; needsLookup = _tmp$1; return [port, needsLookup]; } neg = false; if (service.charCodeAt(0) === 43) { service = $substring(service, 1); } else if (service.charCodeAt(0) === 45) { neg = true; service = $substring(service, 1); } n = 0; _ref = service; _i = 0; while (true) { if (!(_i < _ref.length)) { break; } _rune = $decodeRune(_ref, _i); d = _rune[0]; if (48 <= d && d <= 57) { d = d - (48) >> 0; } else { _tmp$2 = 0; _tmp$3 = true; port = _tmp$2; needsLookup = _tmp$3; return [port, needsLookup]; } if (n >= 1073741824) { n = 4294967295; break; } n = $imul(n, (10)) >>> 0; nn = n + ((d >>> 0)) >>> 0; if (nn < n || nn > 4294967295) { n = 4294967295; break; } n = nn; _i += _rune[1]; } if (!neg && n >= 1073741824) { port = 1073741823; } else if (neg && n > 1073741824) { port = 1073741824; } else { port = ((n >> 0)); } if (neg) { port = -port; } _tmp$4 = port; _tmp$5 = false; port = _tmp$4; needsLookup = _tmp$5; return [port, needsLookup]; }; file.ptr.prototype.close = function() { var _r$9, f, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; _r$9 = f.file.Close(); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$9; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: file.ptr.prototype.close }; } $f._r$9 = _r$9; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; }; file.prototype.close = function() { return this.$val.close(); }; file.ptr.prototype.getLineFromData = function() { var data, f, i, n, ok, s; s = ""; ok = false; f = this; data = f.data; i = 0; i = 0; while (true) { if (!(i < data.$length)) { break; } if (((i < 0 || i >= data.$length) ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + i]) === 10) { s = ($bytesToString($subslice(data, 0, i))); ok = true; i = i + (1) >> 0; n = data.$length - i >> 0; $copySlice($subslice(data, 0), $subslice(data, i)); f.data = $subslice(data, 0, n); return [s, ok]; } i = i + (1) >> 0; } if (f.atEOF && f.data.$length > 0) { s = ($bytesToString(data)); f.data = $subslice(f.data, 0, 0); ok = true; } return [s, ok]; }; file.prototype.getLineFromData = function() { return this.$val.getLineFromData(); }; file.ptr.prototype.readLine = function() { var _r$9, _tuple, _tuple$1, _tuple$2, err, f, ln, n, ok, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; err = $f.err; f = $f.f; ln = $f.ln; n = $f.n; ok = $f.ok; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = ""; ok = false; f = this; _tuple = f.getLineFromData(); s = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return [s, ok]; } /* */ if (f.data.$length < f.data.$capacity) { $s = 1; continue; } /* */ $s = 2; continue; /* if (f.data.$length < f.data.$capacity) { */ case 1: ln = f.data.$length; _r$9 = io.ReadFull(f.file, $subslice(f.data, ln, f.data.$capacity)); /* */ $s = 3; case 3: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple$1 = _r$9; n = _tuple$1[0]; err = _tuple$1[1]; if (n >= 0) { f.data = $subslice(f.data, 0, (ln + n >> 0)); } if ($interfaceIsEqual(err, io.EOF) || $interfaceIsEqual(err, io.ErrUnexpectedEOF)) { f.atEOF = true; } /* } */ case 2: _tuple$2 = f.getLineFromData(); s = _tuple$2[0]; ok = _tuple$2[1]; $s = -1; return [s, ok]; /* */ } return; } if ($f === undefined) { $f = { $blk: file.ptr.prototype.readLine }; } $f._r$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.err = err; $f.f = f; $f.ln = ln; $f.n = n; $f.ok = ok; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; file.prototype.readLine = function() { return this.$val.readLine(); }; open = function(name) { var _r$9, _tuple, err, fd, name, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tuple = $f._tuple; err = $f.err; fd = $f.fd; name = $f.name; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$9 = os.Open(name); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; fd = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$28.nil, err]; } $s = -1; return [new file.ptr(fd, $makeSlice(sliceType$1, 0, 65536), false), $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: open }; } $f._r$9 = _r$9; $f._tuple = _tuple; $f.err = err; $f.fd = fd; $f.name = name; $f.$s = $s; $f.$r = $r; return $f; }; stat = function(name) { var $24r, _r$10, _r$11, _r$9, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, err, mtime, name, size, st, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$9 = $f._r$9; _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; err = $f.err; mtime = $f.mtime; name = $f.name; size = $f.size; st = $f.st; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: mtime = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil); size = new $Int64(0, 0); err = $ifaceNil; _r$9 = os.Stat(name); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; st = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil); _tmp$1 = new $Int64(0, 0); _tmp$2 = err; time.Time.copy(mtime, _tmp); size = _tmp$1; err = _tmp$2; $s = -1; return [mtime, size, err]; } _r$10 = st.ModTime(); /* */ $s = 2; case 2: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tmp$3 = $clone(_r$10, time.Time); _r$11 = st.Size(); /* */ $s = 3; case 3: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tmp$4 = _r$11; _tmp$5 = $ifaceNil; time.Time.copy(mtime, _tmp$3); size = _tmp$4; err = _tmp$5; $24r = [mtime, size, err]; $s = 4; case 4: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: stat }; } $f.$24r = $24r; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$9 = _r$9; $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.err = err; $f.mtime = mtime; $f.name = name; $f.size = size; $f.st = st; $f.$s = $s; $f.$r = $r; return $f; }; countAnyByte = function(s, t) { var i, n, s, t; n = 0; i = 0; while (true) { if (!(i < s.length)) { break; } if (bytealg.IndexByteString(t, s.charCodeAt(i)) >= 0) { n = n + (1) >> 0; } i = i + (1) >> 0; } return n; }; splitAtBytes = function(s, t) { var a, i, last$1, n, s, t; a = $makeSlice(sliceType, (1 + countAnyByte(s, t) >> 0)); n = 0; last$1 = 0; i = 0; while (true) { if (!(i < s.length)) { break; } if (bytealg.IndexByteString(t, s.charCodeAt(i)) >= 0) { if (last$1 < i) { ((n < 0 || n >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + n] = $substring(s, last$1, i)); n = n + (1) >> 0; } last$1 = i + 1 >> 0; } i = i + (1) >> 0; } if (last$1 < s.length) { ((n < 0 || n >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + n] = $substring(s, last$1)); n = n + (1) >> 0; } return $subslice(a, 0, n); }; getFields = function(s) { var s; return splitAtBytes(s, " \r\t\n"); }; dtoi = function(s) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, i, n, ok, s; n = 0; i = 0; ok = false; n = 0; i = 0; while (true) { if (!(i < s.length && 48 <= s.charCodeAt(i) && s.charCodeAt(i) <= 57)) { break; } n = ($imul(n, 10)) + (((s.charCodeAt(i) - 48 << 24 >>> 24) >> 0)) >> 0; if (n >= 16777215) { _tmp = 16777215; _tmp$1 = i; _tmp$2 = false; n = _tmp; i = _tmp$1; ok = _tmp$2; return [n, i, ok]; } i = i + (1) >> 0; } if (i === 0) { _tmp$3 = 0; _tmp$4 = 0; _tmp$5 = false; n = _tmp$3; i = _tmp$4; ok = _tmp$5; return [n, i, ok]; } _tmp$6 = n; _tmp$7 = i; _tmp$8 = true; n = _tmp$6; i = _tmp$7; ok = _tmp$8; return [n, i, ok]; }; xtoi = function(s) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, i, n, ok, s; n = 0; i = 0; ok = false; n = 0; i = 0; while (true) { if (!(i < s.length)) { break; } if (48 <= s.charCodeAt(i) && s.charCodeAt(i) <= 57) { n = $imul(n, (16)); n = n + ((((s.charCodeAt(i) - 48 << 24 >>> 24) >> 0))) >> 0; } else if (97 <= s.charCodeAt(i) && s.charCodeAt(i) <= 102) { n = $imul(n, (16)); n = n + (((((s.charCodeAt(i) - 97 << 24 >>> 24) >> 0)) + 10 >> 0)) >> 0; } else if (65 <= s.charCodeAt(i) && s.charCodeAt(i) <= 70) { n = $imul(n, (16)); n = n + (((((s.charCodeAt(i) - 65 << 24 >>> 24) >> 0)) + 10 >> 0)) >> 0; } else { break; } if (n >= 16777215) { _tmp = 0; _tmp$1 = i; _tmp$2 = false; n = _tmp; i = _tmp$1; ok = _tmp$2; return [n, i, ok]; } i = i + (1) >> 0; } if (i === 0) { _tmp$3 = 0; _tmp$4 = i; _tmp$5 = false; n = _tmp$3; i = _tmp$4; ok = _tmp$5; return [n, i, ok]; } _tmp$6 = n; _tmp$7 = i; _tmp$8 = true; n = _tmp$6; i = _tmp$7; ok = _tmp$8; return [n, i, ok]; }; xtoi2 = function(s, e) { var _tuple, e, ei, n, ok, s; if (s.length > 2 && !((s.charCodeAt(2) === e))) { return [0, false]; } _tuple = xtoi($substring(s, 0, 2)); n = _tuple[0]; ei = _tuple[1]; ok = _tuple[2]; return [((n << 24 >>> 24)), ok && (ei === 2)]; }; appendHex = function(dst, i) { var dst, i, j, v, y; if (i === 0) { return $append(dst, 48); } j = 7; while (true) { if (!(j >= 0)) { break; } v = (y = ((($imul(j, 4)) >>> 0)), y < 32 ? (i >>> y) : 0) >>> 0; if (v > 0) { dst = $append(dst, "0123456789abcdef".charCodeAt(((v & 15) >>> 0))); } j = j - (1) >> 0; } return dst; }; count = function(s, b) { var b, i, n, s; n = 0; i = 0; while (true) { if (!(i < s.length)) { break; } if (s.charCodeAt(i) === b) { n = n + (1) >> 0; } i = i + (1) >> 0; } return n; }; last = function(s, b) { var b, i, s; i = s.length; i = i - (1) >> 0; while (true) { if (!(i >= 0)) { break; } if (s.charCodeAt(i) === b) { break; } i = i - (1) >> 0; } return i; }; lowerASCIIBytes = function(x) { var _i, _ref, b, i, x; _ref = x; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; b = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (65 <= b && b <= 90) { ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i] = (((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]) + (32) << 24 >>> 24)); } _i++; } }; lowerASCII = function(b) { var b; if (65 <= b && b <= 90) { return b + 32 << 24 >>> 24; } return b; }; trimSpace = function(x) { var x, x$1; while (true) { if (!(x.$length > 0 && isSpace((0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])))) { break; } x = $subslice(x, 1); } while (true) { if (!(x.$length > 0 && isSpace((x$1 = x.$length - 1 >> 0, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1]))))) { break; } x = $subslice(x, 0, (x.$length - 1 >> 0)); } return x; }; isSpace = function(b) { var b; return (b === 32) || (b === 9) || (b === 10) || (b === 13); }; removeComment = function(line) { var i, line; i = bytealg.IndexByte(line, 35); if (!((i === -1))) { return $subslice(line, 0, i); } return line; }; foreachLine = function(x, fn) { var $24r, _r$10, _r$9, err, fn, line, nl, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$10 = $f._r$10; _r$9 = $f._r$9; err = $f.err; fn = $f.fn; line = $f.line; nl = $f.nl; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* while (true) { */ case 1: /* if (!(x.$length > 0)) { break; } */ if(!(x.$length > 0)) { $s = 2; continue; } nl = bytealg.IndexByte(x, 10); /* */ if (nl === -1) { $s = 3; continue; } /* */ $s = 4; continue; /* if (nl === -1) { */ case 3: _r$9 = fn(x); /* */ $s = 5; case 5: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $24r = _r$9; $s = 6; case 6: return $24r; /* } */ case 4: line = $subslice(x, 0, (nl + 1 >> 0)); x = $subslice(x, (nl + 1 >> 0)); _r$10 = fn(line); /* */ $s = 7; case 7: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } err = _r$10; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $s = 1; continue; case 2: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: foreachLine }; } $f.$24r = $24r; $f._r$10 = _r$10; $f._r$9 = _r$9; $f.err = err; $f.fn = fn; $f.line = line; $f.nl = nl; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; foreachField = function(x, fn) { var $24r, _r$10, _r$9, err, field, fn, sp, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$10 = $f._r$10; _r$9 = $f._r$9; err = $f.err; field = $f.field; fn = $f.fn; sp = $f.sp; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: x = trimSpace(x); /* while (true) { */ case 1: /* if (!(x.$length > 0)) { break; } */ if(!(x.$length > 0)) { $s = 2; continue; } sp = bytealg.IndexByte(x, 32); /* */ if (sp === -1) { $s = 3; continue; } /* */ $s = 4; continue; /* if (sp === -1) { */ case 3: _r$9 = fn(x); /* */ $s = 5; case 5: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $24r = _r$9; $s = 6; case 6: return $24r; /* } */ case 4: field = trimSpace($subslice(x, 0, sp)); /* */ if (field.$length > 0) { $s = 7; continue; } /* */ $s = 8; continue; /* if (field.$length > 0) { */ case 7: _r$10 = fn(field); /* */ $s = 9; case 9: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } err = _r$10; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } /* } */ case 8: x = trimSpace($subslice(x, (sp + 1 >> 0))); $s = 1; continue; case 2: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: foreachField }; } $f.$24r = $24r; $f._r$10 = _r$10; $f._r$9 = _r$9; $f.err = err; $f.field = field; $f.fn = fn; $f.sp = sp; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; stringsHasSuffix = function(s, suffix) { var s, suffix; return s.length >= suffix.length && $substring(s, (s.length - suffix.length >> 0)) === suffix; }; stringsHasSuffixFold = function(s, suffix) { var s, suffix; return s.length >= suffix.length && stringsEqualFold($substring(s, (s.length - suffix.length >> 0)), suffix); }; stringsHasPrefix = function(s, prefix) { var prefix, s; return s.length >= prefix.length && $substring(s, 0, prefix.length) === prefix; }; stringsEqualFold = function(s, t) { var i, s, t; if (!((s.length === t.length))) { return false; } i = 0; while (true) { if (!(i < s.length)) { break; } if (!((lowerASCII(s.charCodeAt(i)) === lowerASCII(t.charCodeAt(i))))) { return false; } i = i + (1) >> 0; } return true; }; readFull = function(r) { var _r$9, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, all, buf, err, err$1, n, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; all = $f.all; buf = $f.buf; err = $f.err; err$1 = $f.err$1; n = $f.n; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: all = sliceType$1.nil; err = $ifaceNil; buf = $makeSlice(sliceType$1, 1024); /* while (true) { */ case 1: _r$9 = r.Read(buf); /* */ $s = 3; case 3: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; err$1 = _tuple[1]; all = $appendSlice(all, $subslice(buf, 0, n)); if ($interfaceIsEqual(err$1, io.EOF)) { _tmp = all; _tmp$1 = $ifaceNil; all = _tmp; err = _tmp$1; $s = -1; return [all, err]; } if (!($interfaceIsEqual(err$1, $ifaceNil))) { _tmp$2 = sliceType$1.nil; _tmp$3 = err$1; all = _tmp$2; err = _tmp$3; $s = -1; return [all, err]; } $s = 1; continue; case 2: $s = -1; return [all, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: readFull }; } $f._r$9 = _r$9; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f.all = all; $f.buf = buf; $f.err = err; $f.err$1 = err$1; $f.n = n; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; goDebugString = function(key) { var _i, _r$9, _ref, _rune, afterKey, b, i, i$1, key, s, val, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r$9 = $f._r$9; _ref = $f._ref; _rune = $f._rune; afterKey = $f.afterKey; b = $f.b; i = $f.i; i$1 = $f.i$1; key = $f.key; s = $f.s; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$9 = os.Getenv("GODEBUG"); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } s = _r$9; i = 0; while (true) { if (!(i < ((s.length - key.length >> 0) - 1 >> 0))) { break; } if (i > 0 && !((s.charCodeAt((i - 1 >> 0)) === 44))) { i = i + (1) >> 0; continue; } afterKey = $substring(s, (i + key.length >> 0)); if (!((afterKey.charCodeAt(0) === 61)) || !($substring(s, i, (i + key.length >> 0)) === key)) { i = i + (1) >> 0; continue; } val = $substring(afterKey, 1); _ref = val; _i = 0; while (true) { if (!(_i < _ref.length)) { break; } _rune = $decodeRune(_ref, _i); i$1 = _i; b = _rune[0]; if (b === 44) { $s = -1; return $substring(val, 0, i$1); } _i += _rune[1]; } $s = -1; return val; } $s = -1; return ""; /* */ } return; } if ($f === undefined) { $f = { $blk: goDebugString }; } $f._i = _i; $f._r$9 = _r$9; $f._ref = _ref; $f._rune = _rune; $f.afterKey = afterKey; $f.b = b; $f.i = i; $f.i$1 = i$1; $f.key = key; $f.s = s; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; }; nssSource.ptr.prototype.standardCriteria = function() { var _i, _ref, crit, i, s; s = this; _ref = s.criteria; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; crit = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), nssCriterion); if (!$clone(crit, nssCriterion).standardStatusAction(i === (s.criteria.$length - 1 >> 0))) { return false; } _i++; } return true; }; nssSource.prototype.standardCriteria = function() { return this.$val.standardCriteria(); }; nssCriterion.ptr.prototype.standardStatusAction = function(last$1) { var _1, c, def, last$1; c = this; if (c.negate) { return false; } def = ""; _1 = c.status; if (_1 === ("success")) { def = "return"; } else if (_1 === ("notfound") || _1 === ("unavail") || _1 === ("tryagain")) { def = "continue"; } else { return false; } if (last$1 && c.action === "return") { return true; } return c.action === def; }; nssCriterion.prototype.standardStatusAction = function(last$1) { return this.$val.standardStatusAction(last$1); }; parseNSSConfFile = function(file$1) { var $24r, $24r$1, _r$10, _r$9, _tuple, err, f, file$1, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r$10 = $f._r$10; _r$9 = $f._r$9; _tuple = $f._tuple; err = $f.err; f = $f.f; file$1 = $f.file$1; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); _r$9 = os.Open(file$1); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; f = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $24r = new nssConf.ptr(err, false); $s = 4; case 4: return $24r; /* } */ case 3: $deferred.push([$methodVal(f, "Close"), []]); _r$10 = parseNSSConf(f); /* */ $s = 5; case 5: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } $24r$1 = _r$10; $s = 6; case 6: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return ptrType$4.nil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: parseNSSConfFile }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r$10 = _r$10; $f._r$9 = _r$9; $f._tuple = _tuple; $f.err = err; $f.f = f; $f.file$1 = file$1; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; parseNSSConf = function(r) { var _r$10, _r$9, _tuple, conf$1, err, r, slurp, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$10 = $f._r$10; _r$9 = $f._r$9; _tuple = $f._tuple; conf$1 = $f.conf$1; err = $f.err; r = $f.r; slurp = $f.slurp; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: conf$1 = [conf$1]; _r$9 = readFull(r); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; slurp = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return new nssConf.ptr(err, false); } conf$1[0] = new nssConf.ptr($ifaceNil, false); _r$10 = foreachLine(slurp, (function(conf$1) { return function $b(line) { var _entry, _key, _r$10, _tuple$1, bclose, colon, criteria, db, err$1, line, sp, src, srcs, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _key = $f._key; _r$10 = $f._r$10; _tuple$1 = $f._tuple$1; bclose = $f.bclose; colon = $f.colon; criteria = $f.criteria; db = $f.db; err$1 = $f.err$1; line = $f.line; sp = $f.sp; src = $f.src; srcs = $f.srcs; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: line = trimSpace(removeComment(line)); if (line.$length === 0) { $s = -1; return $ifaceNil; } colon = bytealg.IndexByte(line, 58); if (colon === -1) { $s = -1; return errors.New("no colon on line"); } db = ($bytesToString(trimSpace($subslice(line, 0, colon)))); srcs = $subslice(line, (colon + 1 >> 0)); /* while (true) { */ case 1: srcs = trimSpace(srcs); if (srcs.$length === 0) { /* break; */ $s = 2; continue; } sp = bytealg.IndexByte(srcs, 32); src = ""; if (sp === -1) { src = ($bytesToString(srcs)); srcs = sliceType$1.nil; } else { src = ($bytesToString($subslice(srcs, 0, sp))); srcs = trimSpace($subslice(srcs, (sp + 1 >> 0))); } criteria = sliceType$3.nil; /* */ if (srcs.$length > 0 && ((0 >= srcs.$length ? ($throwRuntimeError("index out of range"), undefined) : srcs.$array[srcs.$offset + 0]) === 91)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (srcs.$length > 0 && ((0 >= srcs.$length ? ($throwRuntimeError("index out of range"), undefined) : srcs.$array[srcs.$offset + 0]) === 91)) { */ case 3: bclose = bytealg.IndexByte(srcs, 93); if (bclose === -1) { $s = -1; return errors.New("unclosed criterion bracket"); } err$1 = $ifaceNil; _r$10 = parseCriteria($subslice(srcs, 1, bclose)); /* */ $s = 5; case 5: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$1 = _r$10; criteria = _tuple$1[0]; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return errors.New("invalid criteria: " + ($bytesToString($subslice(srcs, 1, bclose)))); } srcs = $subslice(srcs, (bclose + 1 >> 0)); /* } */ case 4: if (conf$1[0].sources === false) { conf$1[0].sources = {}; } _key = db; (conf$1[0].sources || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: $append((_entry = conf$1[0].sources[$String.keyFor(db)], _entry !== undefined ? _entry.v : sliceType$4.nil), new nssSource.ptr(src, criteria)) }; $s = 1; continue; case 2: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._entry = _entry; $f._key = _key; $f._r$10 = _r$10; $f._tuple$1 = _tuple$1; $f.bclose = bclose; $f.colon = colon; $f.criteria = criteria; $f.db = db; $f.err$1 = err$1; $f.line = line; $f.sp = sp; $f.src = src; $f.srcs = srcs; $f.$s = $s; $f.$r = $r; return $f; }; })(conf$1)); /* */ $s = 2; case 2: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } conf$1[0].err = _r$10; $s = -1; return conf$1[0]; /* */ } return; } if ($f === undefined) { $f = { $blk: parseNSSConf }; } $f._r$10 = _r$10; $f._r$9 = _r$9; $f._tuple = _tuple; $f.conf$1 = conf$1; $f.err = err; $f.r = r; $f.slurp = slurp; $f.$s = $s; $f.$r = $r; return $f; }; parseCriteria = function(x) { var _r$9, c, err, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; c = $f.c; err = $f.err; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = [c]; c[0] = sliceType$3.nil; err = $ifaceNil; _r$9 = foreachField(x, (function(c) { return function(f) { var eq, f, not; not = false; if (f.$length > 0 && ((0 >= f.$length ? ($throwRuntimeError("index out of range"), undefined) : f.$array[f.$offset + 0]) === 33)) { not = true; f = $subslice(f, 1); } if (f.$length < 3) { return errors.New("criterion too short"); } eq = bytealg.IndexByte(f, 61); if (eq === -1) { return errors.New("criterion lacks equal sign"); } lowerASCIIBytes(f); c[0] = $append(c[0], new nssCriterion.ptr(not, ($bytesToString($subslice(f, 0, eq))), ($bytesToString($subslice(f, (eq + 1 >> 0)))))); return $ifaceNil; }; })(c)); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err = _r$9; $s = -1; return [c[0], err]; /* */ } return; } if ($f === undefined) { $f = { $blk: parseCriteria }; } $f._r$9 = _r$9; $f.c = c; $f.err = err; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; conn.ptr.prototype.ok = function() { var c; c = this; return !(c === ptrType$29.nil) && !(c.fd === ptrType$7.nil); }; conn.prototype.ok = function() { return this.$val.ok(); }; conn.ptr.prototype.Read = function(b) { var _r$9, _tuple, b, c, err, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tuple = $f._tuple; b = $f.b; c = $f.c; err = $f.err; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!c.ok()) { $s = -1; return [0, new syscall.Errno(22)]; } _r$9 = c.fd.Read(b); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil)) && !($interfaceIsEqual(err, io.EOF))) { err = new OpError.ptr("read", c.fd.net, c.fd.laddr, c.fd.raddr, err); } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: conn.ptr.prototype.Read }; } $f._r$9 = _r$9; $f._tuple = _tuple; $f.b = b; $f.c = c; $f.err = err; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; conn.prototype.Read = function(b) { return this.$val.Read(b); }; conn.ptr.prototype.Write = function(b) { var _r$9, _tuple, b, c, err, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tuple = $f._tuple; b = $f.b; c = $f.c; err = $f.err; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!c.ok()) { $s = -1; return [0, new syscall.Errno(22)]; } _r$9 = c.fd.Write(b); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { err = new OpError.ptr("write", c.fd.net, c.fd.laddr, c.fd.raddr, err); } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: conn.ptr.prototype.Write }; } $f._r$9 = _r$9; $f._tuple = _tuple; $f.b = b; $f.c = c; $f.err = err; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; conn.prototype.Write = function(b) { return this.$val.Write(b); }; conn.ptr.prototype.Close = function() { var _r$9, c, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; c = $f.c; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!c.ok()) { $s = -1; return new syscall.Errno(22); } _r$9 = c.fd.Close(); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err = _r$9; if (!($interfaceIsEqual(err, $ifaceNil))) { err = new OpError.ptr("close", c.fd.net, c.fd.laddr, c.fd.raddr, err); } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: conn.ptr.prototype.Close }; } $f._r$9 = _r$9; $f.c = c; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; conn.prototype.Close = function() { return this.$val.Close(); }; conn.ptr.prototype.LocalAddr = function() { var c; c = this; if (!c.ok()) { return $ifaceNil; } return c.fd.laddr; }; conn.prototype.LocalAddr = function() { return this.$val.LocalAddr(); }; conn.ptr.prototype.RemoteAddr = function() { var c; c = this; if (!c.ok()) { return $ifaceNil; } return c.fd.raddr; }; conn.prototype.RemoteAddr = function() { return this.$val.RemoteAddr(); }; conn.ptr.prototype.SetDeadline = function(t) { var c, err, t; c = this; if (!c.ok()) { return new syscall.Errno(22); } err = c.fd.SetDeadline($clone(t, time.Time)); if (!($interfaceIsEqual(err, $ifaceNil))) { return new OpError.ptr("set", c.fd.net, $ifaceNil, c.fd.laddr, err); } return $ifaceNil; }; conn.prototype.SetDeadline = function(t) { return this.$val.SetDeadline(t); }; conn.ptr.prototype.SetReadDeadline = function(t) { var c, err, t; c = this; if (!c.ok()) { return new syscall.Errno(22); } err = c.fd.SetReadDeadline($clone(t, time.Time)); if (!($interfaceIsEqual(err, $ifaceNil))) { return new OpError.ptr("set", c.fd.net, $ifaceNil, c.fd.laddr, err); } return $ifaceNil; }; conn.prototype.SetReadDeadline = function(t) { return this.$val.SetReadDeadline(t); }; conn.ptr.prototype.SetWriteDeadline = function(t) { var c, err, t; c = this; if (!c.ok()) { return new syscall.Errno(22); } err = c.fd.SetWriteDeadline($clone(t, time.Time)); if (!($interfaceIsEqual(err, $ifaceNil))) { return new OpError.ptr("set", c.fd.net, $ifaceNil, c.fd.laddr, err); } return $ifaceNil; }; conn.prototype.SetWriteDeadline = function(t) { return this.$val.SetWriteDeadline(t); }; conn.ptr.prototype.SetReadBuffer = function(bytes) { var _r$9, bytes, c, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; bytes = $f.bytes; c = $f.c; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!c.ok()) { $s = -1; return new syscall.Errno(22); } _r$9 = setReadBuffer(c.fd, bytes); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err = _r$9; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return new OpError.ptr("set", c.fd.net, $ifaceNil, c.fd.laddr, err); } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: conn.ptr.prototype.SetReadBuffer }; } $f._r$9 = _r$9; $f.bytes = bytes; $f.c = c; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; conn.prototype.SetReadBuffer = function(bytes) { return this.$val.SetReadBuffer(bytes); }; conn.ptr.prototype.SetWriteBuffer = function(bytes) { var _r$9, bytes, c, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; bytes = $f.bytes; c = $f.c; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!c.ok()) { $s = -1; return new syscall.Errno(22); } _r$9 = setWriteBuffer(c.fd, bytes); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err = _r$9; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return new OpError.ptr("set", c.fd.net, $ifaceNil, c.fd.laddr, err); } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: conn.ptr.prototype.SetWriteBuffer }; } $f._r$9 = _r$9; $f.bytes = bytes; $f.c = c; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; conn.prototype.SetWriteBuffer = function(bytes) { return this.$val.SetWriteBuffer(bytes); }; conn.ptr.prototype.File = function() { var _r$9, _tuple, c, err, f, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tuple = $f._tuple; c = $f.c; err = $f.err; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = ptrType$11.nil; err = $ifaceNil; c = this; _r$9 = c.fd.dup(); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; f = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { err = new OpError.ptr("file", c.fd.net, c.fd.laddr, c.fd.raddr, err); } $s = -1; return [f, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: conn.ptr.prototype.File }; } $f._r$9 = _r$9; $f._tuple = _tuple; $f.c = c; $f.err = err; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; }; conn.prototype.File = function() { return this.$val.File(); }; listenerBacklog = function() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = listenerBacklogCache.Once.Do((function() { listenerBacklogCache.val = maxListenerBacklog(); })); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return listenerBacklogCache.val; /* */ } return; } if ($f === undefined) { $f = { $blk: listenerBacklog }; } $f.$s = $s; $f.$r = $r; return $f; }; mapErr = function(err) { var _1, err; _1 = err; if ($interfaceIsEqual(_1, (context.Canceled))) { return errCanceled; } else if ($interfaceIsEqual(_1, (context.DeadlineExceeded))) { return errTimeout; } else { return err; } }; OpError.ptr.prototype.Unwrap = function() { var e; e = this; return e.Err; }; OpError.prototype.Unwrap = function() { return this.$val.Unwrap(); }; OpError.ptr.prototype.Error = function() { var _r$10, _r$11, _r$9, e, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$9 = $f._r$9; e = $f.e; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; if (e === ptrType$21.nil) { $s = -1; return ""; } s = e.Op; if (!(e.Net === "")) { s = s + (" " + e.Net); } /* */ if (!($interfaceIsEqual(e.Source, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(e.Source, $ifaceNil))) { */ case 1: _r$9 = e.Source.String(); /* */ $s = 3; case 3: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } s = s + (" " + _r$9); /* } */ case 2: /* */ if (!($interfaceIsEqual(e.Addr, $ifaceNil))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!($interfaceIsEqual(e.Addr, $ifaceNil))) { */ case 4: if (!($interfaceIsEqual(e.Source, $ifaceNil))) { s = s + ("->"); } else { s = s + (" "); } _r$10 = e.Addr.String(); /* */ $s = 6; case 6: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } s = s + (_r$10); /* } */ case 5: _r$11 = e.Err.Error(); /* */ $s = 7; case 7: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } s = s + (": " + _r$11); $s = -1; return s; /* */ } return; } if ($f === undefined) { $f = { $blk: OpError.ptr.prototype.Error }; } $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$9 = _r$9; $f.e = e; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; OpError.prototype.Error = function() { return this.$val.Error(); }; OpError.ptr.prototype.Timeout = function() { var $24r, $24r$1, _r$10, _r$9, _tuple, _tuple$1, _tuple$2, _v, _v$1, e, ne, ok, ok$1, ok$2, t, t$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r$10 = $f._r$10; _r$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _v = $f._v; _v$1 = $f._v$1; e = $f.e; ne = $f.ne; ok = $f.ok; ok$1 = $f.ok$1; ok$2 = $f.ok$2; t = $f.t; t$1 = $f.t$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; _tuple = $assertType(e.Err, ptrType$22, true); ne = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 1; continue; } /* */ $s = 2; continue; /* if (ok) { */ case 1: _tuple$1 = $assertType(ne.Err, timeout, true); t = _tuple$1[0]; ok$1 = _tuple$1[1]; if (!(ok$1)) { _v = false; $s = 3; continue s; } _r$9 = t.Timeout(); /* */ $s = 4; case 4: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _v = _r$9; case 3: $24r = _v; $s = 5; case 5: return $24r; /* } */ case 2: _tuple$2 = $assertType(e.Err, timeout, true); t$1 = _tuple$2[0]; ok$2 = _tuple$2[1]; if (!(ok$2)) { _v$1 = false; $s = 6; continue s; } _r$10 = t$1.Timeout(); /* */ $s = 7; case 7: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _v$1 = _r$10; case 6: $24r$1 = _v$1; $s = 8; case 8: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: OpError.ptr.prototype.Timeout }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r$10 = _r$10; $f._r$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._v = _v; $f._v$1 = _v$1; $f.e = e; $f.ne = ne; $f.ok = ok; $f.ok$1 = ok$1; $f.ok$2 = ok$2; $f.t = t; $f.t$1 = t$1; $f.$s = $s; $f.$r = $r; return $f; }; OpError.prototype.Timeout = function() { return this.$val.Timeout(); }; OpError.ptr.prototype.Temporary = function() { var $24r, $24r$1, _r$10, _r$9, _tuple, _tuple$1, _tuple$2, _v, _v$1, e, ne, ok, ok$1, ok$2, t, t$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r$10 = $f._r$10; _r$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _v = $f._v; _v$1 = $f._v$1; e = $f.e; ne = $f.ne; ok = $f.ok; ok$1 = $f.ok$1; ok$2 = $f.ok$2; t = $f.t; t$1 = $f.t$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; if (e.Op === "accept" && isConnError(e.Err)) { $s = -1; return true; } _tuple = $assertType(e.Err, ptrType$22, true); ne = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 1; continue; } /* */ $s = 2; continue; /* if (ok) { */ case 1: _tuple$1 = $assertType(ne.Err, temporary, true); t = _tuple$1[0]; ok$1 = _tuple$1[1]; if (!(ok$1)) { _v = false; $s = 3; continue s; } _r$9 = t.Temporary(); /* */ $s = 4; case 4: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _v = _r$9; case 3: $24r = _v; $s = 5; case 5: return $24r; /* } */ case 2: _tuple$2 = $assertType(e.Err, temporary, true); t$1 = _tuple$2[0]; ok$2 = _tuple$2[1]; if (!(ok$2)) { _v$1 = false; $s = 6; continue s; } _r$10 = t$1.Temporary(); /* */ $s = 7; case 7: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _v$1 = _r$10; case 6: $24r$1 = _v$1; $s = 8; case 8: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: OpError.ptr.prototype.Temporary }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r$10 = _r$10; $f._r$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._v = _v; $f._v$1 = _v$1; $f.e = e; $f.ne = ne; $f.ok = ok; $f.ok$1 = ok$1; $f.ok$2 = ok$2; $f.t = t; $f.t$1 = t$1; $f.$s = $s; $f.$r = $r; return $f; }; OpError.prototype.Temporary = function() { return this.$val.Temporary(); }; ParseError.ptr.prototype.Error = function() { var e; e = this; return "invalid " + e.Type + ": " + e.Text; }; ParseError.prototype.Error = function() { return this.$val.Error(); }; ParseError.ptr.prototype.Timeout = function() { var e; e = this; return false; }; ParseError.prototype.Timeout = function() { return this.$val.Timeout(); }; ParseError.ptr.prototype.Temporary = function() { var e; e = this; return false; }; ParseError.prototype.Temporary = function() { return this.$val.Temporary(); }; AddrError.ptr.prototype.Error = function() { var e, s; e = this; if (e === ptrType$30.nil) { return ""; } s = e.Err; if (!(e.Addr === "")) { s = "address " + e.Addr + ": " + s; } return s; }; AddrError.prototype.Error = function() { return this.$val.Error(); }; AddrError.ptr.prototype.Timeout = function() { var e; e = this; return false; }; AddrError.prototype.Timeout = function() { return this.$val.Timeout(); }; AddrError.ptr.prototype.Temporary = function() { var e; e = this; return false; }; AddrError.prototype.Temporary = function() { return this.$val.Temporary(); }; UnknownNetworkError.prototype.Error = function() { var e; e = this.$val; return "unknown network " + (e); }; $ptrType(UnknownNetworkError).prototype.Error = function() { return new UnknownNetworkError(this.$get()).Error(); }; UnknownNetworkError.prototype.Timeout = function() { var e; e = this.$val; return false; }; $ptrType(UnknownNetworkError).prototype.Timeout = function() { return new UnknownNetworkError(this.$get()).Timeout(); }; UnknownNetworkError.prototype.Temporary = function() { var e; e = this.$val; return false; }; $ptrType(UnknownNetworkError).prototype.Temporary = function() { return new UnknownNetworkError(this.$get()).Temporary(); }; timeoutError.ptr.prototype.Error = function() { var e; e = this; return "i/o timeout"; }; timeoutError.prototype.Error = function() { return this.$val.Error(); }; timeoutError.ptr.prototype.Timeout = function() { var e; e = this; return true; }; timeoutError.prototype.Timeout = function() { return this.$val.Timeout(); }; timeoutError.ptr.prototype.Temporary = function() { var e; e = this; return true; }; timeoutError.prototype.Temporary = function() { return this.$val.Temporary(); }; DNSError.ptr.prototype.Error = function() { var e, s; e = this; if (e === ptrType$31.nil) { return ""; } s = "lookup " + e.Name; if (!(e.Server === "")) { s = s + (" on " + e.Server); } s = s + (": " + e.Err); return s; }; DNSError.prototype.Error = function() { return this.$val.Error(); }; DNSError.ptr.prototype.Timeout = function() { var e; e = this; return e.IsTimeout; }; DNSError.prototype.Timeout = function() { return this.$val.Timeout(); }; DNSError.ptr.prototype.Temporary = function() { var e; e = this; return e.IsTimeout || e.IsTemporary; }; DNSError.prototype.Temporary = function() { return this.$val.Temporary(); }; genericReadFrom = function(w, r) { var $24r, _r$9, _tuple, err, n, r, w, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$9 = $f._r$9; _tuple = $f._tuple; err = $f.err; n = $f.n; r = $f.r; w = $f.w; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = new $Int64(0, 0); err = $ifaceNil; _r$9 = io.Copy((x = new writerOnly.ptr(w), new x.constructor.elem(x)), r); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; err = _tuple[1]; $24r = [n, err]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: genericReadFrom }; } $f.$24r = $24r; $f._r$9 = _r$9; $f._tuple = _tuple; $f.err = err; $f.n = n; $f.r = r; $f.w = w; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Buffers).prototype.WriteTo = function(w) { var $24r, _i, _r$10, _r$9, _ref, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, _tuple$2, b, err, err$1, n, nb, ok, v, w, wv, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _i = $f._i; _r$10 = $f._r$10; _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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; b = $f.b; err = $f.err; err$1 = $f.err$1; n = $f.n; nb = $f.nb; ok = $f.ok; v = $f.v; w = $f.w; wv = $f.wv; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = new $Int64(0, 0); err = $ifaceNil; v = this; _tuple = $assertType(w, buffersWriter, true); wv = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 1; continue; } /* */ $s = 2; continue; /* if (ok) { */ case 1: _r$9 = wv.writeBuffers(v); /* */ $s = 3; case 3: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple$1 = _r$9; n = _tuple$1[0]; err = _tuple$1[1]; $24r = [n, err]; $s = 4; case 4: return $24r; /* } */ case 2: _ref = v.$get(); _i = 0; /* while (true) { */ case 5: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 6; continue; } b = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r$10 = w.Write(b); /* */ $s = 7; case 7: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$2 = _r$10; nb = _tuple$2[0]; err$1 = _tuple$2[1]; n = (x = (new $Int64(0, nb)), new $Int64(n.$high + x.$high, n.$low + x.$low)); if (!($interfaceIsEqual(err$1, $ifaceNil))) { v.consume(n); _tmp = n; _tmp$1 = err$1; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } _i++; $s = 5; continue; case 6: v.consume(n); _tmp$2 = n; _tmp$3 = $ifaceNil; n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: $ptrType(Buffers).prototype.WriteTo }; } $f.$24r = $24r; $f._i = _i; $f._r$10 = _r$10; $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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.b = b; $f.err = err; $f.err$1 = err$1; $f.n = n; $f.nb = nb; $f.ok = ok; $f.v = v; $f.w = w; $f.wv = wv; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Buffers).prototype.Read = function(p) { var err, n, n0, p, v, x; n = 0; err = $ifaceNil; v = this; while (true) { if (!(p.$length > 0 && v.$get().$length > 0)) { break; } n0 = $copySlice(p, (x = v.$get(), (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0]))); v.consume((new $Int64(0, n0))); p = $subslice(p, n0); n = n + (n0) >> 0; } if (v.$get().$length === 0) { err = io.EOF; } return [n, err]; }; $ptrType(Buffers).prototype.consume = function(n) { var ln0, n, v, x, x$1, x$2, x$3, x$4; v = this; while (true) { if (!(v.$get().$length > 0)) { break; } ln0 = (new $Int64(0, (x = v.$get(), (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])).$length)); if ((ln0.$high > n.$high || (ln0.$high === n.$high && ln0.$low > n.$low))) { (x$2 = v.$get(), (0 >= x$2.$length ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + 0] = $subslice((x$1 = v.$get(), (0 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 0])), $flatten64(n)))); return; } n = (x$3 = ln0, new $Int64(n.$high - x$3.$high, n.$low - x$3.$low)); (x$4 = v.$get(), (0 >= x$4.$length ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + 0] = sliceType$1.nil)); v.$set($subslice((v.$get()), 1)); } }; HardwareAddr.prototype.String = function() { var _i, _ref, a, b, buf, i; a = this; if (a.$length === 0) { return ""; } buf = $makeSlice(sliceType$1, 0, (($imul(a.$length, 3)) - 1 >> 0)); _ref = a; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; b = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (i > 0) { buf = $append(buf, 58); } buf = $append(buf, "0123456789abcdef".charCodeAt((b >>> 4 << 24 >>> 24))); buf = $append(buf, "0123456789abcdef".charCodeAt(((b & 15) >>> 0))); _i++; } return ($bytesToString(buf)); }; $ptrType(HardwareAddr).prototype.String = function() { return this.$get().String(); }; readProtocols = function() { var _entry, _entry$1, _i, _key, _key$1, _r$10, _r$11, _r$12, _r$9, _ref, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, alias, err, f, file$1, i, line, ok, ok$1, ok$2, ok$3, proto, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _i = $f._i; _key = $f._key; _key$1 = $f._key$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$9 = $f._r$9; _ref = $f._ref; _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; alias = $f.alias; err = $f.err; f = $f.f; file$1 = $f.file$1; i = $f.i; line = $f.line; ok = $f.ok; ok$1 = $f.ok$1; ok$2 = $f.ok$2; ok$3 = $f.ok$3; proto = $f.proto; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); _r$9 = open("/etc/protocols"); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; file$1 = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $s = 4; case 4: return; /* } */ case 3: $deferred.push([$methodVal(file$1, "close"), []]); _r$10 = file$1.readLine(); /* */ $s = 5; case 5: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$1 = _r$10; line = _tuple$1[0]; ok = _tuple$1[1]; /* while (true) { */ case 6: /* if (!(ok)) { break; } */ if(!(ok)) { $s = 7; continue; } i = bytealg.IndexByteString(line, 35); if (i >= 0) { line = $substring(line, 0, i); } f = getFields(line); /* */ if (f.$length < 2) { $s = 8; continue; } /* */ $s = 9; continue; /* if (f.$length < 2) { */ case 8: _r$11 = file$1.readLine(); /* */ $s = 10; case 10: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tuple$2 = _r$11; line = _tuple$2[0]; ok = _tuple$2[1]; /* continue; */ $s = 6; continue; /* } */ case 9: _tuple$3 = dtoi((1 >= f.$length ? ($throwRuntimeError("index out of range"), undefined) : f.$array[f.$offset + 1])); proto = _tuple$3[0]; ok$1 = _tuple$3[2]; if (ok$1) { _tuple$4 = (_entry = protocols[$String.keyFor((0 >= f.$length ? ($throwRuntimeError("index out of range"), undefined) : f.$array[f.$offset + 0]))], _entry !== undefined ? [_entry.v, true] : [0, false]); ok$2 = _tuple$4[1]; if (!ok$2) { _key = (0 >= f.$length ? ($throwRuntimeError("index out of range"), undefined) : f.$array[f.$offset + 0]); (protocols || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: proto }; } _ref = $subslice(f, 2); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } alias = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _tuple$5 = (_entry$1 = protocols[$String.keyFor(alias)], _entry$1 !== undefined ? [_entry$1.v, true] : [0, false]); ok$3 = _tuple$5[1]; if (!ok$3) { _key$1 = alias; (protocols || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key$1)] = { k: _key$1, v: proto }; } _i++; } } _r$12 = file$1.readLine(); /* */ $s = 11; case 11: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _tuple$6 = _r$12; line = _tuple$6[0]; ok = _tuple$6[1]; $s = 6; continue; case 7: $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: readProtocols }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._i = _i; $f._key = _key; $f._key$1 = _key$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$9 = _r$9; $f._ref = _ref; $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.alias = alias; $f.err = err; $f.f = f; $f.file$1 = file$1; $f.i = i; $f.line = line; $f.ok = ok; $f.ok$1 = ok$1; $f.ok$2 = ok$2; $f.ok$3 = ok$3; $f.proto = proto; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; lookupProtocol = function(param, name) { var name, param, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; name = $f.name; param = $f.param; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = onceReadProtocols.Do(readProtocols); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return lookupProtocolMap(name); /* */ } return; } if ($f === undefined) { $f = { $blk: lookupProtocol }; } $f.name = name; $f.param = param; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.ptr.prototype.dial = function(ctx, network, server) { var _r$10, _r$9, _tuple, _tuple$1, c, ctx, d, err, network, r, server, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$10 = $f._r$10; _r$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; c = $f.c; ctx = $f.ctx; d = $f.d; err = $f.err; network = $f.network; r = $f.r; server = $f.server; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; c = $ifaceNil; err = $ifaceNil; /* */ if (!(r === ptrType$13.nil) && !(r.Dial === $throwNilPointerError)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(r === ptrType$13.nil) && !(r.Dial === $throwNilPointerError)) { */ case 1: _r$9 = r.Dial(ctx, network, server); /* */ $s = 4; case 4: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; c = _tuple[0]; err = _tuple[1]; $s = 3; continue; /* } else { */ case 2: d = new Dialer.ptr(new time.Duration(0, 0), new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil), $ifaceNil, false, new time.Duration(0, 0), new time.Duration(0, 0), ptrType$13.nil, $chanNil, $throwNilPointerError); _r$10 = d.DialContext(ctx, network, server); /* */ $s = 5; case 5: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$1 = _r$10; c = _tuple$1[0]; err = _tuple$1[1]; /* } */ case 3: if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [$ifaceNil, mapErr(err)]; } $s = -1; return [c, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Resolver.ptr.prototype.dial }; } $f._r$10 = _r$10; $f._r$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.c = c; $f.ctx = ctx; $f.d = d; $f.err = err; $f.network = network; $f.r = r; $f.server = server; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.prototype.dial = function(ctx, network, server) { return this.$val.dial(ctx, network, server); }; Resolver.ptr.prototype.lookupHost = function(ctx, host) { var $24r, _r$10, _r$11, _r$9, _tmp, _tmp$1, _tuple, _tuple$1, addrs, addrs$1, ctx, err, err$1, host, ok, order, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$9 = $f._r$9; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; addrs = $f.addrs; addrs$1 = $f.addrs$1; ctx = $f.ctx; err = $f.err; err$1 = $f.err$1; host = $f.host; ok = $f.ok; order = $f.order; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: addrs = sliceType.nil; err = $ifaceNil; r = this; _r$9 = systemConf(); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$10 = _r$9.hostLookupOrder(r, host); /* */ $s = 2; case 2: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } order = _r$10; if (!r.preferGo() && (order === 0)) { _tuple = cgoLookupHost(ctx, host); addrs$1 = _tuple[0]; err$1 = _tuple[1]; ok = _tuple[2]; if (ok) { _tmp = addrs$1; _tmp$1 = err$1; addrs = _tmp; err = _tmp$1; $s = -1; return [addrs, err]; } order = 1; } _r$11 = r.goLookupHostOrder(ctx, host, order); /* */ $s = 3; case 3: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tuple$1 = _r$11; addrs = _tuple$1[0]; err = _tuple$1[1]; $24r = [addrs, err]; $s = 4; case 4: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Resolver.ptr.prototype.lookupHost }; } $f.$24r = $24r; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$9 = _r$9; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.addrs = addrs; $f.addrs$1 = addrs$1; $f.ctx = ctx; $f.err = err; $f.err$1 = err$1; $f.host = host; $f.ok = ok; $f.order = order; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.prototype.lookupHost = function(ctx, host) { return this.$val.lookupHost(ctx, host); }; Resolver.ptr.prototype.lookupIP = function(ctx, network, host) { var $24r, _r$10, _r$11, _r$12, _r$9, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, _tuple$2, addrs, addrs$1, ctx, err, err$1, host, ips, network, ok, order, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$9 = $f._r$9; _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; _tuple$2 = $f._tuple$2; addrs = $f.addrs; addrs$1 = $f.addrs$1; ctx = $f.ctx; err = $f.err; err$1 = $f.err$1; host = $f.host; ips = $f.ips; network = $f.network; ok = $f.ok; order = $f.order; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: addrs = sliceType$5.nil; err = $ifaceNil; r = this; /* */ if (r.preferGo()) { $s = 1; continue; } /* */ $s = 2; continue; /* if (r.preferGo()) { */ case 1: _r$9 = r.goLookupIP(ctx, network, host); /* */ $s = 3; case 3: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; addrs = _tuple[0]; err = _tuple[1]; $24r = [addrs, err]; $s = 4; case 4: return $24r; /* } */ case 2: _r$10 = systemConf(); /* */ $s = 5; case 5: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$11 = _r$10.hostLookupOrder(r, host); /* */ $s = 6; case 6: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } order = _r$11; if (order === 0) { _tuple$1 = cgoLookupIP(ctx, network, host); addrs$1 = _tuple$1[0]; err$1 = _tuple$1[1]; ok = _tuple$1[2]; if (ok) { _tmp = addrs$1; _tmp$1 = err$1; addrs = _tmp; err = _tmp$1; $s = -1; return [addrs, err]; } order = 1; } _r$12 = r.goLookupIPCNAMEOrder(ctx, network, host, order); /* */ $s = 7; case 7: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _tuple$2 = _r$12; ips = _tuple$2[0]; err = _tuple$2[2]; _tmp$2 = ips; _tmp$3 = err; addrs = _tmp$2; err = _tmp$3; $s = -1; return [addrs, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Resolver.ptr.prototype.lookupIP }; } $f.$24r = $24r; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$9 = _r$9; $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._tuple$2 = _tuple$2; $f.addrs = addrs; $f.addrs$1 = addrs$1; $f.ctx = ctx; $f.err = err; $f.err$1 = err$1; $f.host = host; $f.ips = ips; $f.network = network; $f.ok = ok; $f.order = order; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.prototype.lookupIP = function(ctx, network, host) { return this.$val.lookupIP(ctx, network, host); }; Resolver.ptr.prototype.lookupPort = function(ctx, network, service) { var $24r, _r$10, _r$11, _r$12, _r$9, _tuple, _tuple$1, _v, ctx, err, err$1, network, ok, port, port$1, r, service, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _v = $f._v; ctx = $f.ctx; err = $f.err; err$1 = $f.err$1; network = $f.network; ok = $f.ok; port = $f.port; port$1 = $f.port$1; r = $f.r; service = $f.service; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; if (!(!r.preferGo())) { _v = false; $s = 3; continue s; } _r$9 = systemConf(); /* */ $s = 4; case 4: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$10 = _r$9.canUseCgo(); /* */ $s = 5; case 5: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _v = _r$10; case 3: /* */ if (_v) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v) { */ case 1: _tuple = cgoLookupPort(ctx, network, service); port = _tuple[0]; err = _tuple[1]; ok = _tuple[2]; /* */ if (ok) { $s = 6; continue; } /* */ $s = 7; continue; /* if (ok) { */ case 6: /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 8: _r$11 = goLookupPort(network, service); /* */ $s = 10; case 10: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tuple$1 = _r$11; port$1 = _tuple$1[0]; err$1 = _tuple$1[1]; if ($interfaceIsEqual(err$1, $ifaceNil)) { $s = -1; return [port$1, $ifaceNil]; } /* } */ case 9: $s = -1; return [port, err]; /* } */ case 7: /* } */ case 2: _r$12 = goLookupPort(network, service); /* */ $s = 11; case 11: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } $24r = _r$12; $s = 12; case 12: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Resolver.ptr.prototype.lookupPort }; } $f.$24r = $24r; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._v = _v; $f.ctx = ctx; $f.err = err; $f.err$1 = err$1; $f.network = network; $f.ok = ok; $f.port = port; $f.port$1 = port$1; $f.r = r; $f.service = service; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.prototype.lookupPort = function(ctx, network, service) { return this.$val.lookupPort(ctx, network, service); }; Resolver.ptr.prototype.lookupCNAME = function(ctx, name) { var $24r, _r$10, _r$11, _r$9, _tuple, _v, cname, ctx, err, name, ok, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$9 = $f._r$9; _tuple = $f._tuple; _v = $f._v; cname = $f.cname; ctx = $f.ctx; err = $f.err; name = $f.name; ok = $f.ok; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; if (!(!r.preferGo())) { _v = false; $s = 3; continue s; } _r$9 = systemConf(); /* */ $s = 4; case 4: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$10 = _r$9.canUseCgo(); /* */ $s = 5; case 5: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _v = _r$10; case 3: /* */ if (_v) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v) { */ case 1: _tuple = cgoLookupCNAME(ctx, name); cname = _tuple[0]; err = _tuple[1]; ok = _tuple[2]; if (ok) { $s = -1; return [cname, err]; } /* } */ case 2: _r$11 = r.goLookupCNAME(ctx, name); /* */ $s = 6; case 6: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } $24r = _r$11; $s = 7; case 7: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Resolver.ptr.prototype.lookupCNAME }; } $f.$24r = $24r; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$9 = _r$9; $f._tuple = _tuple; $f._v = _v; $f.cname = cname; $f.ctx = ctx; $f.err = err; $f.name = name; $f.ok = ok; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.prototype.lookupCNAME = function(ctx, name) { return this.$val.lookupCNAME(ctx, name); }; Resolver.ptr.prototype.lookupSRV = function(ctx, service, proto, name) { var _r$9, _tuple, _tuple$1, _tuple$2, cname, ctx, err, err$1, err$2, h, name, p, proto, r, server, service, srv, srvs, target, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; cname = $f.cname; ctx = $f.ctx; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; h = $f.h; name = $f.name; p = $f.p; proto = $f.proto; r = $f.r; server = $f.server; service = $f.service; srv = $f.srv; srvs = $f.srvs; target = $f.target; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; target = ""; if (service === "" && proto === "") { target = name; } else { target = "_" + service + "._" + proto + "." + name; } _r$9 = r.lookup(ctx, target, 33); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; p = $clone(_tuple[0], dnsmessage.Parser); server = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return ["", sliceType$6.nil, err]; } srvs = sliceType$6.nil; cname = new dnsmessage.Name.ptr(arrayType$6.zero(), 0); while (true) { _tuple$1 = p.AnswerHeader(); h = $clone(_tuple$1[0], dnsmessage.ResourceHeader); err$1 = _tuple$1[1]; if ($interfaceIsEqual(err$1, dnsmessage.ErrSectionDone)) { break; } if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return ["", sliceType$6.nil, new DNSError.ptr("cannot unmarshal DNS message", name, server, false, false, false)]; } if (!((h.Type === 33))) { err$2 = p.SkipAnswer(); if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return ["", sliceType$6.nil, new DNSError.ptr("cannot unmarshal DNS message", name, server, false, false, false)]; } continue; } if ((cname.Length === 0) && !((h.Name.Length === 0))) { dnsmessage.Name.copy(cname, h.Name); } _tuple$2 = p.SRVResource(); srv = $clone(_tuple$2[0], dnsmessage.SRVResource); err$1 = _tuple$2[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return ["", sliceType$6.nil, new DNSError.ptr("cannot unmarshal DNS message", name, server, false, false, false)]; } srvs = $append(srvs, new SRV.ptr($clone(srv.Target, dnsmessage.Name).String(), srv.Port, srv.Priority, srv.Weight)); } $r = ($convertSliceType(srvs, byPriorityWeight)).sort(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return [$clone(cname, dnsmessage.Name).String(), srvs, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Resolver.ptr.prototype.lookupSRV }; } $f._r$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.cname = cname; $f.ctx = ctx; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.h = h; $f.name = name; $f.p = p; $f.proto = proto; $f.r = r; $f.server = server; $f.service = service; $f.srv = srv; $f.srvs = srvs; $f.target = target; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.prototype.lookupSRV = function(ctx, service, proto, name) { return this.$val.lookupSRV(ctx, service, proto, name); }; Resolver.ptr.prototype.lookupMX = function(ctx, name) { var _r$9, _tuple, _tuple$1, _tuple$2, ctx, err, err$1, err$2, h, mx, mxs, name, p, r, server, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; ctx = $f.ctx; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; h = $f.h; mx = $f.mx; mxs = $f.mxs; name = $f.name; p = $f.p; r = $f.r; server = $f.server; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r$9 = r.lookup(ctx, name, 15); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; p = $clone(_tuple[0], dnsmessage.Parser); server = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType$7.nil, err]; } mxs = sliceType$7.nil; while (true) { _tuple$1 = p.AnswerHeader(); h = $clone(_tuple$1[0], dnsmessage.ResourceHeader); err$1 = _tuple$1[1]; if ($interfaceIsEqual(err$1, dnsmessage.ErrSectionDone)) { break; } if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [sliceType$7.nil, new DNSError.ptr("cannot unmarshal DNS message", name, server, false, false, false)]; } if (!((h.Type === 15))) { err$2 = p.SkipAnswer(); if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return [sliceType$7.nil, new DNSError.ptr("cannot unmarshal DNS message", name, server, false, false, false)]; } continue; } _tuple$2 = p.MXResource(); mx = $clone(_tuple$2[0], dnsmessage.MXResource); err$1 = _tuple$2[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [sliceType$7.nil, new DNSError.ptr("cannot unmarshal DNS message", name, server, false, false, false)]; } mxs = $append(mxs, new MX.ptr($clone(mx.MX, dnsmessage.Name).String(), mx.Pref)); } $r = ($convertSliceType(mxs, byPref)).sort(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return [mxs, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Resolver.ptr.prototype.lookupMX }; } $f._r$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.ctx = ctx; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.h = h; $f.mx = mx; $f.mxs = mxs; $f.name = name; $f.p = p; $f.r = r; $f.server = server; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.prototype.lookupMX = function(ctx, name) { return this.$val.lookupMX(ctx, name); }; Resolver.ptr.prototype.lookupNS = function(ctx, name) { var _r$9, _tuple, _tuple$1, _tuple$2, ctx, err, err$1, err$2, h, name, ns, nss, p, r, server, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; ctx = $f.ctx; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; h = $f.h; name = $f.name; ns = $f.ns; nss = $f.nss; p = $f.p; r = $f.r; server = $f.server; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r$9 = r.lookup(ctx, name, 2); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; p = $clone(_tuple[0], dnsmessage.Parser); server = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType$8.nil, err]; } nss = sliceType$8.nil; while (true) { _tuple$1 = p.AnswerHeader(); h = $clone(_tuple$1[0], dnsmessage.ResourceHeader); err$1 = _tuple$1[1]; if ($interfaceIsEqual(err$1, dnsmessage.ErrSectionDone)) { break; } if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [sliceType$8.nil, new DNSError.ptr("cannot unmarshal DNS message", name, server, false, false, false)]; } if (!((h.Type === 2))) { err$2 = p.SkipAnswer(); if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return [sliceType$8.nil, new DNSError.ptr("cannot unmarshal DNS message", name, server, false, false, false)]; } continue; } _tuple$2 = p.NSResource(); ns = $clone(_tuple$2[0], dnsmessage.NSResource); err$1 = _tuple$2[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [sliceType$8.nil, new DNSError.ptr("cannot unmarshal DNS message", name, server, false, false, false)]; } nss = $append(nss, new NS.ptr($clone(ns.NS, dnsmessage.Name).String())); } $s = -1; return [nss, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Resolver.ptr.prototype.lookupNS }; } $f._r$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.ctx = ctx; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.h = h; $f.name = name; $f.ns = ns; $f.nss = nss; $f.p = p; $f.r = r; $f.server = server; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.prototype.lookupNS = function(ctx, name) { return this.$val.lookupNS(ctx, name); }; Resolver.ptr.prototype.lookupTXT = function(ctx, name) { var _i, _i$1, _r$9, _ref, _ref$1, _tuple, _tuple$1, _tuple$2, ctx, err, err$1, err$2, h, n, name, p, r, s, s$1, server, txt, txtJoin, txts, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _i$1 = $f._i$1; _r$9 = $f._r$9; _ref = $f._ref; _ref$1 = $f._ref$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; ctx = $f.ctx; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; h = $f.h; n = $f.n; name = $f.name; p = $f.p; r = $f.r; s = $f.s; s$1 = $f.s$1; server = $f.server; txt = $f.txt; txtJoin = $f.txtJoin; txts = $f.txts; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r$9 = r.lookup(ctx, name, 16); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; p = $clone(_tuple[0], dnsmessage.Parser); server = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType.nil, err]; } txts = sliceType.nil; while (true) { _tuple$1 = p.AnswerHeader(); h = $clone(_tuple$1[0], dnsmessage.ResourceHeader); err$1 = _tuple$1[1]; if ($interfaceIsEqual(err$1, dnsmessage.ErrSectionDone)) { break; } if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [sliceType.nil, new DNSError.ptr("cannot unmarshal DNS message", name, server, false, false, false)]; } if (!((h.Type === 16))) { err$2 = p.SkipAnswer(); if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return [sliceType.nil, new DNSError.ptr("cannot unmarshal DNS message", name, server, false, false, false)]; } continue; } _tuple$2 = p.TXTResource(); txt = $clone(_tuple$2[0], dnsmessage.TXTResource); err$1 = _tuple$2[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [sliceType.nil, new DNSError.ptr("cannot unmarshal DNS message", name, server, false, false, false)]; } n = 0; _ref = txt.TXT; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } s = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); n = n + (s.length) >> 0; _i++; } txtJoin = $makeSlice(sliceType$1, 0, n); _ref$1 = txt.TXT; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } s$1 = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); txtJoin = $appendSlice(txtJoin, s$1); _i$1++; } if (txts.$length === 0) { txts = $makeSlice(sliceType, 0, 1); } txts = $append(txts, ($bytesToString(txtJoin))); } $s = -1; return [txts, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Resolver.ptr.prototype.lookupTXT }; } $f._i = _i; $f._i$1 = _i$1; $f._r$9 = _r$9; $f._ref = _ref; $f._ref$1 = _ref$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.ctx = ctx; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.h = h; $f.n = n; $f.name = name; $f.p = p; $f.r = r; $f.s = s; $f.s$1 = s$1; $f.server = server; $f.txt = txt; $f.txtJoin = txtJoin; $f.txts = txts; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.prototype.lookupTXT = function(ctx, name) { return this.$val.lookupTXT(ctx, name); }; Resolver.ptr.prototype.lookupAddr = function(ctx, addr) { var $24r, _r$10, _r$11, _r$9, _tuple, _v, addr, ctx, err, ok, ptrs, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$9 = $f._r$9; _tuple = $f._tuple; _v = $f._v; addr = $f.addr; ctx = $f.ctx; err = $f.err; ok = $f.ok; ptrs = $f.ptrs; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; if (!(!r.preferGo())) { _v = false; $s = 3; continue s; } _r$9 = systemConf(); /* */ $s = 4; case 4: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$10 = _r$9.canUseCgo(); /* */ $s = 5; case 5: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _v = _r$10; case 3: /* */ if (_v) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v) { */ case 1: _tuple = cgoLookupPTR(ctx, addr); ptrs = _tuple[0]; err = _tuple[1]; ok = _tuple[2]; if (ok) { $s = -1; return [ptrs, err]; } /* } */ case 2: _r$11 = r.goLookupPTR(ctx, addr); /* */ $s = 6; case 6: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } $24r = _r$11; $s = 7; case 7: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Resolver.ptr.prototype.lookupAddr }; } $f.$24r = $24r; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$9 = _r$9; $f._tuple = _tuple; $f._v = _v; $f.addr = addr; $f.ctx = ctx; $f.err = err; $f.ok = ok; $f.ptrs = ptrs; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.prototype.lookupAddr = function(ctx, addr) { return this.$val.lookupAddr(ctx, addr); }; lookupProtocolMap = function(name) { var _entry, _tuple, found, lowerProtocol, n, name, proto; lowerProtocol = arrayType$7.zero(); n = $copyString(new sliceType$1(lowerProtocol), name); lowerASCIIBytes($subslice(new sliceType$1(lowerProtocol), 0, n)); _tuple = (_entry = protocols[$String.keyFor(($bytesToString($subslice(new sliceType$1(lowerProtocol), 0, n))))], _entry !== undefined ? [_entry.v, true] : [0, false]); proto = _tuple[0]; found = _tuple[1]; if (!found || !((n === name.length))) { return [0, new AddrError.ptr("unknown IP protocol specified", name)]; } return [proto, $ifaceNil]; }; lookupPortMap = function(network, service) { var _1, _entry, _entry$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, error, lowerService, m, n, network, ok, ok$1, port, port$1, service; port = 0; error = $ifaceNil; _1 = network; if (_1 === ("tcp4") || _1 === ("tcp6")) { network = "tcp"; } else if (_1 === ("udp4") || _1 === ("udp6")) { network = "udp"; } _tuple = (_entry = services[$String.keyFor(network)], _entry !== undefined ? [_entry.v, true] : [false, false]); m = _tuple[0]; ok = _tuple[1]; if (ok) { lowerService = arrayType$7.zero(); n = $copyString(new sliceType$1(lowerService), service); lowerASCIIBytes($subslice(new sliceType$1(lowerService), 0, n)); _tuple$1 = (_entry$1 = m[$String.keyFor(($bytesToString($subslice(new sliceType$1(lowerService), 0, n))))], _entry$1 !== undefined ? [_entry$1.v, true] : [0, false]); port$1 = _tuple$1[0]; ok$1 = _tuple$1[1]; if (ok$1 && (n === service.length)) { _tmp = port$1; _tmp$1 = $ifaceNil; port = _tmp; error = _tmp$1; return [port, error]; } } _tmp$2 = 0; _tmp$3 = new AddrError.ptr("unknown port", network + "/" + service); port = _tmp$2; error = _tmp$3; return [port, error]; }; ipVersion = function(network) { var n, network; if (network === "") { return 0; } n = network.charCodeAt((network.length - 1 >> 0)); if (!((n === 52)) && !((n === 54))) { n = 0; } return n; }; Resolver.ptr.prototype.preferGo = function() { var r; r = this; return !(r === ptrType$13.nil) && r.PreferGo; }; Resolver.prototype.preferGo = function() { return this.$val.preferGo(); }; Resolver.ptr.prototype.strictErrors = function() { var r; r = this; return !(r === ptrType$13.nil) && r.StrictErrors; }; Resolver.prototype.strictErrors = function() { return this.$val.strictErrors(); }; Resolver.ptr.prototype.getLookupGroup = function() { var r; r = this; if (r === ptrType$13.nil) { return $pkg.DefaultResolver.lookupGroup; } return r.lookupGroup; }; Resolver.prototype.getLookupGroup = function() { return this.$val.getLookupGroup(); }; Resolver.ptr.prototype.LookupHost = function(ctx, host) { var $24r, $24r$1, _r$10, _r$9, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, addrs, ctx, err, host, ip, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r$10 = $f._r$10; _r$9 = $f._r$9; _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; addrs = $f.addrs; ctx = $f.ctx; err = $f.err; host = $f.host; ip = $f.ip; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: addrs = sliceType.nil; err = $ifaceNil; r = this; /* */ if (host === "") { $s = 1; continue; } /* */ $s = 2; continue; /* if (host === "") { */ case 1: _tmp = sliceType.nil; _r$9 = errNoSuchHost.Error(); /* */ $s = 3; case 3: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tmp$1 = new DNSError.ptr(_r$9, host, "", false, false, true); addrs = _tmp; err = _tmp$1; $24r = [addrs, err]; $s = 4; case 4: return $24r; /* } */ case 2: _tuple = parseIPZone(host); ip = _tuple[0]; if (!(ip === IP.nil)) { _tmp$2 = new sliceType([host]); _tmp$3 = $ifaceNil; addrs = _tmp$2; err = _tmp$3; $s = -1; return [addrs, err]; } _r$10 = r.lookupHost(ctx, host); /* */ $s = 5; case 5: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$1 = _r$10; addrs = _tuple$1[0]; err = _tuple$1[1]; $24r$1 = [addrs, err]; $s = 6; case 6: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: Resolver.ptr.prototype.LookupHost }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r$10 = _r$10; $f._r$9 = _r$9; $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.addrs = addrs; $f.ctx = ctx; $f.err = err; $f.host = host; $f.ip = ip; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.prototype.LookupHost = function(ctx, host) { return this.$val.LookupHost(ctx, host); }; Resolver.ptr.prototype.LookupIPAddr = function(ctx, host) { var $24r, _r$9, ctx, host, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$9 = $f._r$9; ctx = $f.ctx; host = $f.host; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r$9 = r.lookupIPAddr(ctx, "ip", host); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $24r = _r$9; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Resolver.ptr.prototype.LookupIPAddr }; } $f.$24r = $24r; $f._r$9 = _r$9; $f.ctx = ctx; $f.host = host; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.prototype.LookupIPAddr = function(ctx, host) { return this.$val.LookupIPAddr(ctx, host); }; Resolver.ptr.prototype.LookupIP = function(ctx, network, host) { var _1, _i, _r$10, _r$9, _ref, _tuple, _tuple$1, addr, addrs, afnet, ctx, err, host, ips, network, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _i = $f._i; _r$10 = $f._r$10; _r$9 = $f._r$9; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; addr = $f.addr; addrs = $f.addrs; afnet = $f.afnet; ctx = $f.ctx; err = $f.err; host = $f.host; ips = $f.ips; network = $f.network; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r$9 = parseNetwork(ctx, network, false); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; afnet = _tuple[0]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType$9.nil, err]; } _1 = afnet; if (_1 === ("ip") || _1 === ("ip4") || _1 === ("ip6")) { } else { $s = -1; return [sliceType$9.nil, new UnknownNetworkError((network))]; } _r$10 = r.internetAddrList(ctx, afnet, host); /* */ $s = 2; case 2: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$1 = _r$10; addrs = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType$9.nil, err]; } ips = $makeSlice(sliceType$9, 0, addrs.$length); _ref = addrs; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } addr = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); ips = $append(ips, $assertType(addr, ptrType$25).IP); _i++; } $s = -1; return [ips, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Resolver.ptr.prototype.LookupIP }; } $f._1 = _1; $f._i = _i; $f._r$10 = _r$10; $f._r$9 = _r$9; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.addr = addr; $f.addrs = addrs; $f.afnet = afnet; $f.ctx = ctx; $f.err = err; $f.host = host; $f.ips = ips; $f.network = network; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.prototype.LookupIP = function(ctx, network, host) { return this.$val.LookupIP(ctx, network, host); }; onlyValuesCtx.ptr.prototype.Value = function(key) { var $24r, _r$10, _r$9, _selection, key, ovc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$10 = $f._r$10; _r$9 = $f._r$9; _selection = $f._selection; key = $f.key; ovc = $f.ovc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ovc = this; _r$9 = ovc.lookupValues.Done(); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _selection = $select([[_r$9], []]); /* */ if (_selection[0] === 0) { $s = 2; continue; } /* */ if (_selection[0] === 1) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_selection[0] === 0) { */ case 2: $s = -1; return $ifaceNil; /* } else if (_selection[0] === 1) { */ case 3: _r$10 = ovc.lookupValues.Value(key); /* */ $s = 5; case 5: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } $24r = _r$10; $s = 6; case 6: return $24r; /* } */ case 4: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: onlyValuesCtx.ptr.prototype.Value }; } $f.$24r = $24r; $f._r$10 = _r$10; $f._r$9 = _r$9; $f._selection = _selection; $f.key = key; $f.ovc = ovc; $f.$s = $s; $f.$r = $r; return $f; }; onlyValuesCtx.prototype.Value = function(key) { return this.$val.Value(key); }; withUnexpiredValuesPreserved = function(lookupCtx) { var lookupCtx; return new onlyValuesCtx.ptr(context.Background(), lookupCtx); }; Resolver.ptr.prototype.lookupIPAddr = function(ctx, network, host) { var $24r, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$9, _selection, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, addrs, alt, called, ch, ctx, err, host, ip, lookupGroupCancel, lookupGroupCtx, lookupKey, network, r, r$1, resolverFunc, trace, x, x$1, zone, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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$9 = $f._r$9; _selection = $f._selection; _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; addrs = $f.addrs; alt = $f.alt; called = $f.called; ch = $f.ch; ctx = $f.ctx; err = $f.err; host = $f.host; ip = $f.ip; lookupGroupCancel = $f.lookupGroupCancel; lookupGroupCtx = $f.lookupGroupCtx; lookupKey = $f.lookupKey; network = $f.network; r = $f.r; r$1 = $f.r$1; resolverFunc = $f.resolverFunc; trace = $f.trace; x = $f.x; x$1 = $f.x$1; zone = $f.zone; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ch = [ch]; host = [host]; lookupGroupCancel = [lookupGroupCancel]; lookupGroupCtx = [lookupGroupCtx]; network = [network]; resolverFunc = [resolverFunc]; r = this; /* */ if (host[0] === "") { $s = 1; continue; } /* */ $s = 2; continue; /* if (host[0] === "") { */ case 1: _r$9 = errNoSuchHost.Error(); /* */ $s = 3; case 3: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $24r = [sliceType$5.nil, new DNSError.ptr(_r$9, host[0], "", false, false, true)]; $s = 4; case 4: return $24r; /* } */ case 2: _tuple = parseIPZone(host[0]); ip = _tuple[0]; zone = _tuple[1]; if (!(ip === IP.nil)) { $s = -1; return [new sliceType$5([new IPAddr.ptr(ip, zone)]), $ifaceNil]; } _r$10 = ctx.Value((x = new nettrace.TraceKey.ptr(), new x.constructor.elem(x))); /* */ $s = 5; case 5: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$1 = $assertType(_r$10, ptrType$35, true); trace = _tuple$1[0]; /* */ if (!(trace === ptrType$35.nil) && !(trace.DNSStart === $throwNilPointerError)) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!(trace === ptrType$35.nil) && !(trace.DNSStart === $throwNilPointerError)) { */ case 6: $r = trace.DNSStart(host[0]); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 7: resolverFunc[0] = $methodVal(r, "lookupIP"); _r$11 = ctx.Value((x$1 = new nettrace.LookupIPAltResolverKey.ptr(), new x$1.constructor.elem(x$1))); /* */ $s = 9; case 9: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tuple$2 = $assertType(_r$11, funcType, true); alt = _tuple$2[0]; if (!(alt === $throwNilPointerError)) { resolverFunc[0] = alt; } _r$12 = context.WithCancel(withUnexpiredValuesPreserved(ctx)); /* */ $s = 10; case 10: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _tuple$3 = _r$12; lookupGroupCtx[0] = _tuple$3[0]; lookupGroupCancel[0] = _tuple$3[1]; lookupKey = network[0] + "\x00" + host[0]; dnsWaitGroup.Add(1); _r$13 = r.getLookupGroup().DoChan(lookupKey, (function(ch, host, lookupGroupCancel, lookupGroupCtx, network, resolverFunc) { return function $b() { var $24r$1, _r$13, _returncast, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r$1 = $f.$24r$1; _r$13 = $f._r$13; _returncast = $f._returncast; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); $deferred.push([$methodVal(dnsWaitGroup, "Done"), []]); _r$13 = testHookLookupIP(lookupGroupCtx[0], resolverFunc[0], network[0], host[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _returncast = _r$13; $24r$1 = [_returncast[0], _returncast[1]]; $s = 2; case 2: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return [$ifaceNil, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: $b }; } $f.$24r$1 = $24r$1; $f._r$13 = _r$13; $f._returncast = _returncast; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; })(ch, host, lookupGroupCancel, lookupGroupCtx, network, resolverFunc)); /* */ $s = 11; case 11: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _tuple$4 = _r$13; ch[0] = _tuple$4[0]; called = _tuple$4[1]; if (!called) { dnsWaitGroup.Done(); } _r$14 = ctx.Done(); /* */ $s = 12; case 12: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _r$15 = $select([[_r$14], [ch[0]]]); /* */ $s = 13; case 13: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _selection = _r$15; /* */ if (_selection[0] === 0) { $s = 14; continue; } /* */ if (_selection[0] === 1) { $s = 15; continue; } /* */ $s = 16; continue; /* if (_selection[0] === 0) { */ case 14: _r$16 = r.getLookupGroup().ForgetUnshared(lookupKey); /* */ $s = 20; case 20: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } /* */ if (_r$16) { $s = 17; continue; } /* */ $s = 18; continue; /* if (_r$16) { */ case 17: $r = lookupGroupCancel[0](); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 19; continue; /* } else { */ case 18: $go((function(ch, host, lookupGroupCancel, lookupGroupCtx, network, resolverFunc) { return function $b() { var _r$17, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$17 = $f._r$17; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$17 = $recv(ch[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } _r$17[0]; $r = lookupGroupCancel[0](); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$17 = _r$17; $f.$s = $s; $f.$r = $r; return $f; }; })(ch, host, lookupGroupCancel, lookupGroupCtx, network, resolverFunc), []); /* } */ case 19: _r$17 = ctx.Err(); /* */ $s = 22; case 22: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } _r$18 = mapErr(_r$17); /* */ $s = 23; case 23: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } err = _r$18; /* */ if (!(trace === ptrType$35.nil) && !(trace.DNSDone === $throwNilPointerError)) { $s = 24; continue; } /* */ $s = 25; continue; /* if (!(trace === ptrType$35.nil) && !(trace.DNSDone === $throwNilPointerError)) { */ case 24: $r = trace.DNSDone(sliceType$10.nil, false, err); /* */ $s = 26; case 26: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 25: $s = -1; return [sliceType$5.nil, err]; /* } else if (_selection[0] === 1) { */ case 15: r$1 = $clone(_selection[1][0], singleflight.Result); $r = lookupGroupCancel[0](); /* */ $s = 27; case 27: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!(trace === ptrType$35.nil) && !(trace.DNSDone === $throwNilPointerError)) { $s = 28; continue; } /* */ $s = 29; continue; /* if (!(trace === ptrType$35.nil) && !(trace.DNSDone === $throwNilPointerError)) { */ case 28: _tuple$5 = $assertType(r$1.Val, sliceType$5, true); addrs = _tuple$5[0]; $r = trace.DNSDone(ipAddrsEface(addrs), r$1.Shared, r$1.Err); /* */ $s = 30; case 30: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 29: $s = -1; return lookupIPReturn(r$1.Val, r$1.Err, r$1.Shared); /* } */ case 16: $s = -1; return [sliceType$5.nil, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Resolver.ptr.prototype.lookupIPAddr }; } $f.$24r = $24r; $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$9 = _r$9; $f._selection = _selection; $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.addrs = addrs; $f.alt = alt; $f.called = called; $f.ch = ch; $f.ctx = ctx; $f.err = err; $f.host = host; $f.ip = ip; $f.lookupGroupCancel = lookupGroupCancel; $f.lookupGroupCtx = lookupGroupCtx; $f.lookupKey = lookupKey; $f.network = network; $f.r = r; $f.r$1 = r$1; $f.resolverFunc = resolverFunc; $f.trace = trace; $f.x = x; $f.x$1 = x$1; $f.zone = zone; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.prototype.lookupIPAddr = function(ctx, network, host) { return this.$val.lookupIPAddr(ctx, network, host); }; lookupIPReturn = function(addrsi, err, shared) { var addrs, addrsi, clone, err, shared; if (!($interfaceIsEqual(err, $ifaceNil))) { return [sliceType$5.nil, err]; } addrs = $assertType(addrsi, sliceType$5); if (shared) { clone = $makeSlice(sliceType$5, addrs.$length); $copySlice(clone, addrs); addrs = clone; } return [addrs, $ifaceNil]; }; ipAddrsEface = function(addrs) { var _i, _ref, addrs, i, s, v; s = $makeSlice(sliceType$10, addrs.$length); _ref = addrs; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; v = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), IPAddr); ((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i] = new v.constructor.elem(v)); _i++; } return s; }; Resolver.ptr.prototype.LookupPort = function(ctx, network, service) { var _1, _r$9, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, _tuple$1, ctx, err, needsLookup, network, port, r, service, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r$9 = $f._r$9; _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; _tuple$1 = $f._tuple$1; ctx = $f.ctx; err = $f.err; needsLookup = $f.needsLookup; network = $f.network; port = $f.port; r = $f.r; service = $f.service; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: port = 0; err = $ifaceNil; r = this; _tuple = parsePort(service); port = _tuple[0]; needsLookup = _tuple[1]; /* */ if (needsLookup) { $s = 1; continue; } /* */ $s = 2; continue; /* if (needsLookup) { */ case 1: _1 = network; if (_1 === ("tcp") || _1 === ("tcp4") || _1 === ("tcp6") || _1 === ("udp") || _1 === ("udp4") || _1 === ("udp6")) { } else if (_1 === ("")) { network = "ip"; } else { _tmp = 0; _tmp$1 = new AddrError.ptr("unknown network", network); port = _tmp; err = _tmp$1; $s = -1; return [port, err]; } _r$9 = r.lookupPort(ctx, network, service); /* */ $s = 3; case 3: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple$1 = _r$9; port = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$2 = 0; _tmp$3 = err; port = _tmp$2; err = _tmp$3; $s = -1; return [port, err]; } /* } */ case 2: if (0 > port || port > 65535) { _tmp$4 = 0; _tmp$5 = new AddrError.ptr("invalid port", service); port = _tmp$4; err = _tmp$5; $s = -1; return [port, err]; } _tmp$6 = port; _tmp$7 = $ifaceNil; port = _tmp$6; err = _tmp$7; $s = -1; return [port, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Resolver.ptr.prototype.LookupPort }; } $f._1 = _1; $f._r$9 = _r$9; $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._tuple$1 = _tuple$1; $f.ctx = ctx; $f.err = err; $f.needsLookup = needsLookup; $f.network = network; $f.port = port; $f.r = r; $f.service = service; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.prototype.LookupPort = function(ctx, network, service) { return this.$val.LookupPort(ctx, network, service); }; Resolver.ptr.prototype.LookupCNAME = function(ctx, host) { var _r$9, _tuple, cname, ctx, err, host, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tuple = $f._tuple; cname = $f.cname; ctx = $f.ctx; err = $f.err; host = $f.host; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r$9 = r.lookupCNAME(ctx, host); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; cname = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return ["", err]; } if (!isDomainName(cname)) { $s = -1; return ["", new DNSError.ptr(errMalformedDNSRecordsDetail, host, "", false, false, false)]; } $s = -1; return [cname, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Resolver.ptr.prototype.LookupCNAME }; } $f._r$9 = _r$9; $f._tuple = _tuple; $f.cname = cname; $f.ctx = ctx; $f.err = err; $f.host = host; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.prototype.LookupCNAME = function(ctx, host) { return this.$val.LookupCNAME(ctx, host); }; Resolver.ptr.prototype.LookupSRV = function(ctx, service, proto, name) { var _i, _r$9, _ref, _tuple, addr, addrs, cname, ctx, err, filteredAddrs, name, proto, r, service, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r$9 = $f._r$9; _ref = $f._ref; _tuple = $f._tuple; addr = $f.addr; addrs = $f.addrs; cname = $f.cname; ctx = $f.ctx; err = $f.err; filteredAddrs = $f.filteredAddrs; name = $f.name; proto = $f.proto; r = $f.r; service = $f.service; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r$9 = r.lookupSRV(ctx, service, proto, name); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; cname = _tuple[0]; addrs = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return ["", sliceType$6.nil, err]; } if (!(cname === "") && !isDomainName(cname)) { $s = -1; return ["", sliceType$6.nil, new DNSError.ptr("SRV header name is invalid", name, "", false, false, false)]; } filteredAddrs = $makeSlice(sliceType$6, 0, addrs.$length); _ref = addrs; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } addr = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (addr === ptrType$32.nil) { _i++; continue; } if (!isDomainName(addr.Target)) { _i++; continue; } filteredAddrs = $append(filteredAddrs, addr); _i++; } if (!((addrs.$length === filteredAddrs.$length))) { $s = -1; return [cname, filteredAddrs, new DNSError.ptr(errMalformedDNSRecordsDetail, name, "", false, false, false)]; } $s = -1; return [cname, filteredAddrs, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Resolver.ptr.prototype.LookupSRV }; } $f._i = _i; $f._r$9 = _r$9; $f._ref = _ref; $f._tuple = _tuple; $f.addr = addr; $f.addrs = addrs; $f.cname = cname; $f.ctx = ctx; $f.err = err; $f.filteredAddrs = filteredAddrs; $f.name = name; $f.proto = proto; $f.r = r; $f.service = service; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.prototype.LookupSRV = function(ctx, service, proto, name) { return this.$val.LookupSRV(ctx, service, proto, name); }; Resolver.ptr.prototype.LookupMX = function(ctx, name) { var _i, _r$9, _ref, _tuple, ctx, err, filteredMX, mx, name, r, records, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r$9 = $f._r$9; _ref = $f._ref; _tuple = $f._tuple; ctx = $f.ctx; err = $f.err; filteredMX = $f.filteredMX; mx = $f.mx; name = $f.name; r = $f.r; records = $f.records; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r$9 = r.lookupMX(ctx, name); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; records = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType$7.nil, err]; } filteredMX = $makeSlice(sliceType$7, 0, records.$length); _ref = records; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } mx = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (mx === ptrType$33.nil) { _i++; continue; } if (!(mx.Host === ".") && !isDomainName(mx.Host)) { _i++; continue; } filteredMX = $append(filteredMX, mx); _i++; } if (!((records.$length === filteredMX.$length))) { $s = -1; return [filteredMX, new DNSError.ptr(errMalformedDNSRecordsDetail, name, "", false, false, false)]; } $s = -1; return [filteredMX, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Resolver.ptr.prototype.LookupMX }; } $f._i = _i; $f._r$9 = _r$9; $f._ref = _ref; $f._tuple = _tuple; $f.ctx = ctx; $f.err = err; $f.filteredMX = filteredMX; $f.mx = mx; $f.name = name; $f.r = r; $f.records = records; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.prototype.LookupMX = function(ctx, name) { return this.$val.LookupMX(ctx, name); }; Resolver.ptr.prototype.LookupNS = function(ctx, name) { var _i, _r$9, _ref, _tuple, ctx, err, filteredNS, name, ns, r, records, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r$9 = $f._r$9; _ref = $f._ref; _tuple = $f._tuple; ctx = $f.ctx; err = $f.err; filteredNS = $f.filteredNS; name = $f.name; ns = $f.ns; r = $f.r; records = $f.records; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r$9 = r.lookupNS(ctx, name); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; records = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType$8.nil, err]; } filteredNS = $makeSlice(sliceType$8, 0, records.$length); _ref = records; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } ns = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (ns === ptrType$34.nil) { _i++; continue; } if (!isDomainName(ns.Host)) { _i++; continue; } filteredNS = $append(filteredNS, ns); _i++; } if (!((records.$length === filteredNS.$length))) { $s = -1; return [filteredNS, new DNSError.ptr(errMalformedDNSRecordsDetail, name, "", false, false, false)]; } $s = -1; return [filteredNS, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Resolver.ptr.prototype.LookupNS }; } $f._i = _i; $f._r$9 = _r$9; $f._ref = _ref; $f._tuple = _tuple; $f.ctx = ctx; $f.err = err; $f.filteredNS = filteredNS; $f.name = name; $f.ns = ns; $f.r = r; $f.records = records; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.prototype.LookupNS = function(ctx, name) { return this.$val.LookupNS(ctx, name); }; Resolver.ptr.prototype.LookupTXT = function(ctx, name) { var $24r, _r$9, ctx, name, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$9 = $f._r$9; ctx = $f.ctx; name = $f.name; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r$9 = r.lookupTXT(ctx, name); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $24r = _r$9; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Resolver.ptr.prototype.LookupTXT }; } $f.$24r = $24r; $f._r$9 = _r$9; $f.ctx = ctx; $f.name = name; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.prototype.LookupTXT = function(ctx, name) { return this.$val.LookupTXT(ctx, name); }; Resolver.ptr.prototype.LookupAddr = function(ctx, addr) { var _i, _r$9, _ref, _tuple, addr, ctx, err, filteredNames, name, names, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r$9 = $f._r$9; _ref = $f._ref; _tuple = $f._tuple; addr = $f.addr; ctx = $f.ctx; err = $f.err; filteredNames = $f.filteredNames; name = $f.name; names = $f.names; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r$9 = r.lookupAddr(ctx, addr); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; names = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType.nil, err]; } filteredNames = $makeSlice(sliceType, 0, names.$length); _ref = names; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } name = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (isDomainName(name)) { filteredNames = $append(filteredNames, name); } _i++; } if (!((names.$length === filteredNames.$length))) { $s = -1; return [filteredNames, new DNSError.ptr(errMalformedDNSRecordsDetail, addr, "", false, false, false)]; } $s = -1; return [filteredNames, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Resolver.ptr.prototype.LookupAddr }; } $f._i = _i; $f._r$9 = _r$9; $f._ref = _ref; $f._tuple = _tuple; $f.addr = addr; $f.ctx = ctx; $f.err = err; $f.filteredNames = filteredNames; $f.name = name; $f.names = names; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.prototype.LookupAddr = function(ctx, addr) { return this.$val.LookupAddr(ctx, addr); }; ipStackCapabilities.ptr.prototype.probe = function() { var _1, _2, _i, _r$10, _r$11, _r$12, _r$13, _r$14, _r$9, _ref, _tuple, _tuple$1, _tuple$2, err, err$1, err$2, i, p, probes, s, s$1, sa, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _2 = $f._2; _i = $f._i; _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$9 = $f._r$9; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; i = $f.i; p = $f.p; probes = $f.probes; s = $f.s; s$1 = $f.s$1; sa = $f.sa; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); p = this; _r$9 = sysSocket(2, 1, 6); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; s = _tuple[0]; err = _tuple[1]; _1 = err; /* */ if ($interfaceIsEqual(_1, new syscall.Errno((97))) || $interfaceIsEqual(_1, new syscall.Errno((93)))) { $s = 3; continue; } /* */ if ($interfaceIsEqual(_1, $ifaceNil)) { $s = 4; continue; } /* */ $s = 5; continue; /* if ($interfaceIsEqual(_1, new syscall.Errno((97))) || $interfaceIsEqual(_1, new syscall.Errno((93)))) { */ case 3: $s = 5; continue; /* } else if ($interfaceIsEqual(_1, $ifaceNil)) { */ case 4: _r$10 = poll.CloseFunc(s); /* */ $s = 6; case 6: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; p.ipv4Enabled = true; /* } */ case 5: case 2: probes = new sliceType$11([new structType$3.ptr(new TCPAddr.ptr(ParseIP("::1"), 0, ""), 1), new structType$3.ptr(new TCPAddr.ptr(IPv4(127, 0, 0, 1), 0, ""), 0)]); _2 = "linux"; if (_2 === ("dragonfly") || _2 === ("openbsd")) { probes = $subslice(probes, 0, 1); } _ref = probes; _i = 0; /* while (true) { */ case 7: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 8; continue; } i = _i; _r$11 = sysSocket(10, 1, 6); /* */ $s = 9; case 9: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tuple$1 = _r$11; s$1 = _tuple$1[0]; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { _i++; /* continue; */ $s = 7; continue; } $deferred.push([poll.CloseFunc, [s$1]]); _r$12 = syscall.SetsockoptInt(s$1, 41, 26, ((i < 0 || i >= probes.$length) ? ($throwRuntimeError("index out of range"), undefined) : probes.$array[probes.$offset + i]).value); /* */ $s = 10; case 10: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _r$12; _r$13 = ((i < 0 || i >= probes.$length) ? ($throwRuntimeError("index out of range"), undefined) : probes.$array[probes.$offset + i]).laddr.sockaddr(10); /* */ $s = 11; case 11: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _tuple$2 = _r$13; sa = _tuple$2[0]; err$1 = _tuple$2[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { _i++; /* continue; */ $s = 7; continue; } _r$14 = syscall.Bind(s$1, sa); /* */ $s = 12; case 12: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } err$2 = _r$14; if (!($interfaceIsEqual(err$2, $ifaceNil))) { _i++; /* continue; */ $s = 7; continue; } if (i === 0) { p.ipv6Enabled = true; } else { p.ipv4MappedIPv6Enabled = true; } _i++; $s = 7; continue; case 8: $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: ipStackCapabilities.ptr.prototype.probe }; } $f._1 = _1; $f._2 = _2; $f._i = _i; $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$9 = _r$9; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.i = i; $f.p = p; $f.probes = probes; $f.s = s; $f.s$1 = s$1; $f.sa = sa; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; ipStackCapabilities.prototype.probe = function() { return this.$val.probe(); }; favoriteAddrFamily = function(network, laddr, raddr, mode) { var $24r, _1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$9, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _v, _v$1, _v$2, _v$3, _v$4, _v$5, family, ipv6only$1, laddr, mode, network, raddr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _1 = $f._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$9 = $f._r$9; _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$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; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _v = $f._v; _v$1 = $f._v$1; _v$2 = $f._v$2; _v$3 = $f._v$3; _v$4 = $f._v$4; _v$5 = $f._v$5; family = $f.family; ipv6only$1 = $f.ipv6only$1; laddr = $f.laddr; mode = $f.mode; network = $f.network; raddr = $f.raddr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: family = 0; ipv6only$1 = false; _1 = network.charCodeAt((network.length - 1 >> 0)); if (_1 === (52)) { _tmp = 2; _tmp$1 = false; family = _tmp; ipv6only$1 = _tmp$1; $s = -1; return [family, ipv6only$1]; } else if (_1 === (54)) { _tmp$2 = 10; _tmp$3 = true; family = _tmp$2; ipv6only$1 = _tmp$3; $s = -1; return [family, ipv6only$1]; } if (!(mode === "listen")) { _v = false; $s = 3; continue s; } if ($interfaceIsEqual(laddr, $ifaceNil)) { _v$1 = true; $s = 4; continue s; } _r$9 = laddr.isWildcard(); /* */ $s = 5; case 5: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _v$1 = _r$9; case 4: _v = _v$1; case 3: /* */ if (_v) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v) { */ case 1: _r$10 = supportsIPv4map(); /* */ $s = 9; case 9: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } if (_r$10) { _v$2 = true; $s = 8; continue s; } _r$11 = supportsIPv4(); /* */ $s = 10; case 10: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _v$2 = !_r$11; case 8: /* */ if (_v$2) { $s = 6; continue; } /* */ $s = 7; continue; /* if (_v$2) { */ case 6: _tmp$4 = 10; _tmp$5 = false; family = _tmp$4; ipv6only$1 = _tmp$5; $s = -1; return [family, ipv6only$1]; /* } */ case 7: if ($interfaceIsEqual(laddr, $ifaceNil)) { _tmp$6 = 2; _tmp$7 = false; family = _tmp$6; ipv6only$1 = _tmp$7; $s = -1; return [family, ipv6only$1]; } _r$12 = laddr.family(); /* */ $s = 11; case 11: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _tmp$8 = _r$12; _tmp$9 = false; family = _tmp$8; ipv6only$1 = _tmp$9; $24r = [family, ipv6only$1]; $s = 12; case 12: return $24r; /* } */ case 2: if ($interfaceIsEqual(laddr, $ifaceNil)) { _v$4 = true; $s = 16; continue s; } _r$13 = laddr.family(); /* */ $s = 17; case 17: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _v$4 = _r$13 === 2; case 16: if (!(_v$4)) { _v$3 = false; $s = 15; continue s; } if ($interfaceIsEqual(raddr, $ifaceNil)) { _v$5 = true; $s = 18; continue s; } _r$14 = raddr.family(); /* */ $s = 19; case 19: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _v$5 = _r$14 === 2; case 18: _v$3 = _v$5; case 15: /* */ if (_v$3) { $s = 13; continue; } /* */ $s = 14; continue; /* if (_v$3) { */ case 13: _tmp$10 = 2; _tmp$11 = false; family = _tmp$10; ipv6only$1 = _tmp$11; $s = -1; return [family, ipv6only$1]; /* } */ case 14: _tmp$12 = 10; _tmp$13 = false; family = _tmp$12; ipv6only$1 = _tmp$13; $s = -1; return [family, ipv6only$1]; /* */ } return; } if ($f === undefined) { $f = { $blk: favoriteAddrFamily }; } $f.$24r = $24r; $f._1 = _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$9 = _r$9; $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$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._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._v = _v; $f._v$1 = _v$1; $f._v$2 = _v$2; $f._v$3 = _v$3; $f._v$4 = _v$4; $f._v$5 = _v$5; $f.family = family; $f.ipv6only$1 = ipv6only$1; $f.laddr = laddr; $f.mode = mode; $f.network = network; $f.raddr = raddr; $f.$s = $s; $f.$r = $r; return $f; }; internetSocket = function(ctx, net, laddr, raddr, sotype, proto, mode, ctrlFn) { var $24r, _r$10, _r$11, _r$12, _r$9, _tuple, _tuple$1, _v, ctrlFn, ctx, err, family, fd, ipv6only$1, laddr, mode, net, proto, raddr, sotype, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _v = $f._v; ctrlFn = $f.ctrlFn; ctx = $f.ctx; err = $f.err; family = $f.family; fd = $f.fd; ipv6only$1 = $f.ipv6only$1; laddr = $f.laddr; mode = $f.mode; net = $f.net; proto = $f.proto; raddr = $f.raddr; sotype = $f.sotype; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = ptrType$7.nil; err = $ifaceNil; if (!(false && mode === "dial")) { _v = false; $s = 3; continue s; } _r$9 = raddr.isWildcard(); /* */ $s = 4; case 4: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _v = _r$9; case 3: /* */ if (_v) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v) { */ case 1: _r$10 = raddr.toLocal(net); /* */ $s = 5; case 5: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } raddr = _r$10; /* } */ case 2: _r$11 = favoriteAddrFamily(net, laddr, raddr, mode); /* */ $s = 6; case 6: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tuple = _r$11; family = _tuple[0]; ipv6only$1 = _tuple[1]; _r$12 = socket(ctx, net, family, sotype, proto, ipv6only$1, laddr, raddr, ctrlFn); /* */ $s = 7; case 7: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _tuple$1 = _r$12; fd = _tuple$1[0]; err = _tuple$1[1]; $24r = [fd, err]; $s = 8; case 8: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: internetSocket }; } $f.$24r = $24r; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._v = _v; $f.ctrlFn = ctrlFn; $f.ctx = ctx; $f.err = err; $f.family = family; $f.fd = fd; $f.ipv6only$1 = ipv6only$1; $f.laddr = laddr; $f.mode = mode; $f.net = net; $f.proto = proto; $f.raddr = raddr; $f.sotype = sotype; $f.$s = $s; $f.$r = $r; return $f; }; ipToSockaddr = function(family, ip, port, zone) { var _1, _r$9, family, ip, ip4, ip6, port, sa, sa$1, zone, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r$9 = $f._r$9; family = $f.family; ip = $f.ip; ip4 = $f.ip4; ip6 = $f.ip6; port = $f.port; sa = $f.sa; sa$1 = $f.sa$1; zone = $f.zone; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _1 = family; /* */ if (_1 === (2)) { $s = 2; continue; } /* */ if (_1 === (10)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_1 === (2)) { */ case 2: if (ip.$length === 0) { ip = $pkg.IPv4zero; } ip4 = ip.To4(); if (ip4 === IP.nil) { $s = -1; return [$ifaceNil, new AddrError.ptr("non-IPv4 address", ip.String())]; } sa = new syscall.SockaddrInet4.ptr(port, arrayType$2.zero(), new syscall.RawSockaddrInet4.ptr(0, 0, arrayType$2.zero(), arrayType$8.zero())); $copySlice(new sliceType$1(sa.Addr), ip4); $s = -1; return [sa, $ifaceNil]; /* } else if (_1 === (10)) { */ case 3: if ((ip.$length === 0) || ip.Equal($pkg.IPv4zero)) { ip = $pkg.IPv6zero; } ip6 = ip.To16(); if (ip6 === IP.nil) { $s = -1; return [$ifaceNil, new AddrError.ptr("non-IPv6 address", ip.String())]; } _r$9 = zoneCache.index(zone); /* */ $s = 5; case 5: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } sa$1 = new syscall.SockaddrInet6.ptr(port, ((_r$9 >>> 0)), arrayType$3.zero(), new syscall.RawSockaddrInet6.ptr(0, 0, 0, arrayType$3.zero(), 0)); $copySlice(new sliceType$1(sa$1.Addr), ip6); $s = -1; return [sa$1, $ifaceNil]; /* } */ case 4: case 1: $s = -1; return [$ifaceNil, new AddrError.ptr("invalid address family", ip.String())]; /* */ } return; } if ($f === undefined) { $f = { $blk: ipToSockaddr }; } $f._1 = _1; $f._r$9 = _r$9; $f.family = family; $f.ip = ip; $f.ip4 = ip4; $f.ip6 = ip6; $f.port = port; $f.sa = sa; $f.sa$1 = sa$1; $f.zone = zone; $f.$s = $s; $f.$r = $r; return $f; }; supportsIPv4 = function() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = ipStackCaps.Once.Do($methodVal(ipStackCaps, "probe")); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return ipStackCaps.ipv4Enabled; /* */ } return; } if ($f === undefined) { $f = { $blk: supportsIPv4 }; } $f.$s = $s; $f.$r = $r; return $f; }; supportsIPv4map = function() { var _1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _1 = "linux"; if (_1 === ("dragonfly") || _1 === ("openbsd")) { $s = -1; return false; } $r = ipStackCaps.Once.Do($methodVal(ipStackCaps, "probe")); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return ipStackCaps.ipv4MappedIPv6Enabled; /* */ } return; } if ($f === undefined) { $f = { $blk: supportsIPv4map }; } $f._1 = _1; $f.$s = $s; $f.$r = $r; return $f; }; isIPv4 = function(addr) { var _ref, addr, addr$1, addr$2, addr$3; _ref = addr; if ($assertType(_ref, ptrType$19, true)[1]) { addr$1 = _ref.$val; return !(addr$1.IP.To4() === IP.nil); } else if ($assertType(_ref, ptrType$16, true)[1]) { addr$2 = _ref.$val; return !(addr$2.IP.To4() === IP.nil); } else if ($assertType(_ref, ptrType$25, true)[1]) { addr$3 = _ref.$val; return !(addr$3.IP.To4() === IP.nil); } return false; }; addrList.prototype.partition = function(strategy) { var _i, _r$9, _ref, addr, addrs, fallbacks, i, label, primaries, primaryLabel, strategy, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r$9 = $f._r$9; _ref = $f._ref; addr = $f.addr; addrs = $f.addrs; fallbacks = $f.fallbacks; i = $f.i; label = $f.label; primaries = $f.primaries; primaryLabel = $f.primaryLabel; strategy = $f.strategy; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: primaries = addrList.nil; fallbacks = addrList.nil; addrs = this; primaryLabel = false; _ref = addrs; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } i = _i; addr = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r$9 = strategy(addr); /* */ $s = 3; case 3: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } label = _r$9; if ((i === 0) || label === primaryLabel) { primaryLabel = label; primaries = $append(primaries, addr); } else { fallbacks = $append(fallbacks, addr); } _i++; $s = 1; continue; case 2: $s = -1; return [primaries, fallbacks]; /* */ } return; } if ($f === undefined) { $f = { $blk: addrList.prototype.partition }; } $f._i = _i; $f._r$9 = _r$9; $f._ref = _ref; $f.addr = addr; $f.addrs = addrs; $f.fallbacks = fallbacks; $f.i = i; $f.label = label; $f.primaries = primaries; $f.primaryLabel = primaryLabel; $f.strategy = strategy; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(addrList).prototype.partition = function(strategy) { return this.$get().partition(strategy); }; filterAddrList = function(filter, ips, inetaddr, originalAddr) { var $24r, _i, _r$10, _r$11, _r$9, _ref, _v, addrs, filter, inetaddr, ip, ips, originalAddr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _i = $f._i; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$9 = $f._r$9; _ref = $f._ref; _v = $f._v; addrs = $f.addrs; filter = $f.filter; inetaddr = $f.inetaddr; ip = $f.ip; ips = $f.ips; originalAddr = $f.originalAddr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: addrs = addrList.nil; _ref = ips; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } ip = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), IPAddr); if (filter === $throwNilPointerError) { _v = true; $s = 5; continue s; } _r$9 = filter($clone(ip, IPAddr)); /* */ $s = 6; case 6: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _v = _r$9; case 5: /* */ if (_v) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_v) { */ case 3: _r$10 = inetaddr($clone(ip, IPAddr)); /* */ $s = 7; case 7: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } addrs = $append(addrs, _r$10); /* } */ case 4: _i++; $s = 1; continue; case 2: /* */ if (addrs.$length === 0) { $s = 8; continue; } /* */ $s = 9; continue; /* if (addrs.$length === 0) { */ case 8: _r$11 = errNoSuitableAddress.Error(); /* */ $s = 10; case 10: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } $24r = [addrList.nil, new AddrError.ptr(_r$11, originalAddr)]; $s = 11; case 11: return $24r; /* } */ case 9: $s = -1; return [addrs, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: filterAddrList }; } $f.$24r = $24r; $f._i = _i; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$9 = _r$9; $f._ref = _ref; $f._v = _v; $f.addrs = addrs; $f.filter = filter; $f.inetaddr = inetaddr; $f.ip = ip; $f.ips = ips; $f.originalAddr = originalAddr; $f.$s = $s; $f.$r = $r; return $f; }; ipv4only = function(addr) { var addr; return !(addr.IP.To4() === IP.nil); }; ipv6only = function(addr) { var addr; return (addr.IP.$length === 16) && addr.IP.To4() === IP.nil; }; SplitHostPort = function(hostport) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, $24r$5, $24r$6, $24r$7, _1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$9, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, addrErr, end, err, host, hostport, i, j, k, port, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; $24r$6 = $f.$24r$6; $24r$7 = $f.$24r$7; _1 = $f._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$9 = $f._r$9; _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; _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; addrErr = $f.addrErr; end = $f.end; err = $f.err; host = $f.host; hostport = $f.hostport; i = $f.i; j = $f.j; k = $f.k; port = $f.port; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: host = ""; port = ""; err = $ifaceNil; addrErr = (function(addr, why) { var _tmp, _tmp$1, _tmp$2, addr, err$1, host$1, port$1, why; host$1 = ""; port$1 = ""; err$1 = $ifaceNil; _tmp = ""; _tmp$1 = ""; _tmp$2 = new AddrError.ptr(why, addr); host$1 = _tmp; port$1 = _tmp$1; err$1 = _tmp$2; return [host$1, port$1, err$1]; }); _tmp = 0; _tmp$1 = 0; j = _tmp; k = _tmp$1; i = last(hostport, 58); /* */ if (i < 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (i < 0) { */ case 1: _r$9 = addrErr(hostport, "missing port in address"); /* */ $s = 3; case 3: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; host = _tuple[0]; port = _tuple[1]; err = _tuple[2]; $24r = [host, port, err]; $s = 4; case 4: return $24r; /* } */ case 2: /* */ if (hostport.charCodeAt(0) === 91) { $s = 5; continue; } /* */ $s = 6; continue; /* if (hostport.charCodeAt(0) === 91) { */ case 5: end = bytealg.IndexByteString(hostport, 93); /* */ if (end < 0) { $s = 8; continue; } /* */ $s = 9; continue; /* if (end < 0) { */ case 8: _r$10 = addrErr(hostport, "missing ']' in address"); /* */ $s = 10; case 10: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$1 = _r$10; host = _tuple$1[0]; port = _tuple$1[1]; err = _tuple$1[2]; $24r$1 = [host, port, err]; $s = 11; case 11: return $24r$1; /* } */ case 9: _1 = end + 1 >> 0; /* */ if (_1 === (hostport.length)) { $s = 13; continue; } /* */ if (_1 === (i)) { $s = 14; continue; } /* */ $s = 15; continue; /* if (_1 === (hostport.length)) { */ case 13: _r$11 = addrErr(hostport, "missing port in address"); /* */ $s = 17; case 17: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tuple$2 = _r$11; host = _tuple$2[0]; port = _tuple$2[1]; err = _tuple$2[2]; $24r$2 = [host, port, err]; $s = 18; case 18: return $24r$2; /* } else if (_1 === (i)) { */ case 14: $s = 16; continue; /* } else { */ case 15: /* */ if (hostport.charCodeAt((end + 1 >> 0)) === 58) { $s = 19; continue; } /* */ $s = 20; continue; /* if (hostport.charCodeAt((end + 1 >> 0)) === 58) { */ case 19: _r$12 = addrErr(hostport, "too many colons in address"); /* */ $s = 21; case 21: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _tuple$3 = _r$12; host = _tuple$3[0]; port = _tuple$3[1]; err = _tuple$3[2]; $24r$3 = [host, port, err]; $s = 22; case 22: return $24r$3; /* } */ case 20: _r$13 = addrErr(hostport, "missing port in address"); /* */ $s = 23; case 23: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _tuple$4 = _r$13; host = _tuple$4[0]; port = _tuple$4[1]; err = _tuple$4[2]; $24r$4 = [host, port, err]; $s = 24; case 24: return $24r$4; /* } */ case 16: case 12: host = $substring(hostport, 1, end); _tmp$2 = 1; _tmp$3 = end + 1 >> 0; j = _tmp$2; k = _tmp$3; $s = 7; continue; /* } else { */ case 6: host = $substring(hostport, 0, i); /* */ if (bytealg.IndexByteString(host, 58) >= 0) { $s = 25; continue; } /* */ $s = 26; continue; /* if (bytealg.IndexByteString(host, 58) >= 0) { */ case 25: _r$14 = addrErr(hostport, "too many colons in address"); /* */ $s = 27; case 27: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _tuple$5 = _r$14; host = _tuple$5[0]; port = _tuple$5[1]; err = _tuple$5[2]; $24r$5 = [host, port, err]; $s = 28; case 28: return $24r$5; /* } */ case 26: /* } */ case 7: /* */ if (bytealg.IndexByteString($substring(hostport, j), 91) >= 0) { $s = 29; continue; } /* */ $s = 30; continue; /* if (bytealg.IndexByteString($substring(hostport, j), 91) >= 0) { */ case 29: _r$15 = addrErr(hostport, "unexpected '[' in address"); /* */ $s = 31; case 31: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _tuple$6 = _r$15; host = _tuple$6[0]; port = _tuple$6[1]; err = _tuple$6[2]; $24r$6 = [host, port, err]; $s = 32; case 32: return $24r$6; /* } */ case 30: /* */ if (bytealg.IndexByteString($substring(hostport, k), 93) >= 0) { $s = 33; continue; } /* */ $s = 34; continue; /* if (bytealg.IndexByteString($substring(hostport, k), 93) >= 0) { */ case 33: _r$16 = addrErr(hostport, "unexpected ']' in address"); /* */ $s = 35; case 35: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _tuple$7 = _r$16; host = _tuple$7[0]; port = _tuple$7[1]; err = _tuple$7[2]; $24r$7 = [host, port, err]; $s = 36; case 36: return $24r$7; /* } */ case 34: port = $substring(hostport, (i + 1 >> 0)); _tmp$4 = host; _tmp$5 = port; _tmp$6 = $ifaceNil; host = _tmp$4; port = _tmp$5; err = _tmp$6; $s = -1; return [host, port, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: SplitHostPort }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f.$24r$6 = $24r$6; $f.$24r$7 = $24r$7; $f._1 = _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$9 = _r$9; $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._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.addrErr = addrErr; $f.end = end; $f.err = err; $f.host = host; $f.hostport = hostport; $f.i = i; $f.j = j; $f.k = k; $f.port = port; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.SplitHostPort = SplitHostPort; splitHostZone = function(s) { var _tmp, _tmp$1, host, i, s, zone; host = ""; zone = ""; i = last(s, 37); if (i > 0) { _tmp = $substring(s, 0, i); _tmp$1 = $substring(s, (i + 1 >> 0)); host = _tmp; zone = _tmp$1; } else { host = s; } return [host, zone]; }; JoinHostPort = function(host, port) { var host, port; if (bytealg.IndexByteString(host, 58) >= 0) { return "[" + host + "]:" + port; } return host + ":" + port; }; $pkg.JoinHostPort = JoinHostPort; Resolver.ptr.prototype.internetAddrList = function(ctx, net, addr) { var $24r, $24r$1, _1, _r$10, _r$11, _r$12, _r$13, _r$9, _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, addr, ctx, err, filter, host, inetaddr, ips, net, port, portnum, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _1 = $f._1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$13 = $f._r$13; _r$9 = $f._r$9; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; addr = $f.addr; ctx = $f.ctx; err = $f.err; filter = $f.filter; host = $f.host; inetaddr = $f.inetaddr; ips = $f.ips; net = $f.net; port = $f.port; portnum = $f.portnum; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: net = [net]; portnum = [portnum]; r = this; err = $ifaceNil; _tmp = ""; _tmp$1 = ""; host = _tmp; port = _tmp$1; portnum[0] = 0; _1 = net[0]; /* */ if (_1 === ("tcp") || _1 === ("tcp4") || _1 === ("tcp6") || _1 === ("udp") || _1 === ("udp4") || _1 === ("udp6")) { $s = 2; continue; } /* */ if (_1 === ("ip") || _1 === ("ip4") || _1 === ("ip6")) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_1 === ("tcp") || _1 === ("tcp4") || _1 === ("tcp6") || _1 === ("udp") || _1 === ("udp4") || _1 === ("udp6")) { */ case 2: /* */ if (!(addr === "")) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!(addr === "")) { */ case 6: _r$9 = SplitHostPort(addr); /* */ $s = 8; case 8: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; host = _tuple[0]; port = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [addrList.nil, err]; } _r$10 = r.LookupPort(ctx, net[0], port); /* */ $s = 9; case 9: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$1 = _r$10; portnum[0] = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [addrList.nil, err]; } /* } */ case 7: $s = 5; continue; /* } else if (_1 === ("ip") || _1 === ("ip4") || _1 === ("ip6")) { */ case 3: if (!(addr === "")) { host = addr; } $s = 5; continue; /* } else { */ case 4: $s = -1; return [addrList.nil, new UnknownNetworkError((net[0]))]; /* } */ case 5: case 1: inetaddr = (function(net, portnum) { return function(ip) { var _2, ip; _2 = net[0]; if (_2 === ("tcp") || _2 === ("tcp4") || _2 === ("tcp6")) { return new TCPAddr.ptr(ip.IP, portnum[0], ip.Zone); } else if (_2 === ("udp") || _2 === ("udp4") || _2 === ("udp6")) { return new UDPAddr.ptr(ip.IP, portnum[0], ip.Zone); } else if (_2 === ("ip") || _2 === ("ip4") || _2 === ("ip6")) { return new IPAddr.ptr(ip.IP, ip.Zone); } else { $panic(new $String("unexpected network: " + net[0])); } }; })(net, portnum); /* */ if (host === "") { $s = 10; continue; } /* */ $s = 11; continue; /* if (host === "") { */ case 10: _r$11 = inetaddr(new IPAddr.ptr(IP.nil, "")); /* */ $s = 12; case 12: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } $24r = [new addrList([_r$11]), $ifaceNil]; $s = 13; case 13: return $24r; /* } */ case 11: _r$12 = r.lookupIPAddr(ctx, net[0], host); /* */ $s = 14; case 14: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _tuple$2 = _r$12; ips = _tuple$2[0]; err = _tuple$2[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [addrList.nil, err]; } if ((ips.$length === 1) && (0 >= ips.$length ? ($throwRuntimeError("index out of range"), undefined) : ips.$array[ips.$offset + 0]).IP.Equal($pkg.IPv6unspecified)) { ips = $append(ips, new IPAddr.ptr($pkg.IPv4zero, "")); } filter = $throwNilPointerError; if (!(net[0] === "") && (net[0].charCodeAt((net[0].length - 1 >> 0)) === 52)) { filter = ipv4only; } if (!(net[0] === "") && (net[0].charCodeAt((net[0].length - 1 >> 0)) === 54)) { filter = ipv6only; } _r$13 = filterAddrList(filter, ips, inetaddr, host); /* */ $s = 15; case 15: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } $24r$1 = _r$13; $s = 16; case 16: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: Resolver.ptr.prototype.internetAddrList }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._1 = _1; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$13 = _r$13; $f._r$9 = _r$9; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.addr = addr; $f.ctx = ctx; $f.err = err; $f.filter = filter; $f.host = host; $f.inetaddr = inetaddr; $f.ips = ips; $f.net = net; $f.port = port; $f.portnum = portnum; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.prototype.internetAddrList = function(ctx, net, addr) { return this.$val.internetAddrList(ctx, net, addr); }; loopbackIP = function(net) { var net; if (!(net === "") && (net.charCodeAt((net.length - 1 >> 0)) === 54)) { return $pkg.IPv6loopback; } return new IP([127, 0, 0, 1]); }; sockaddrToIP = function(sa) { var $24r, _r$9, _ref, sa, sa$1, sa$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$9 = $f._r$9; _ref = $f._ref; sa = $f.sa; sa$1 = $f.sa$1; sa$2 = $f.sa$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _ref = sa; /* */ if ($assertType(_ref, ptrType$14, true)[1]) { $s = 1; continue; } /* */ if ($assertType(_ref, ptrType$15, true)[1]) { $s = 2; continue; } /* */ $s = 3; continue; /* if ($assertType(_ref, ptrType$14, true)[1]) { */ case 1: sa$1 = _ref.$val; $s = -1; return new IPAddr.ptr($convertSliceType($subslice(new sliceType$1(sa$1.Addr), 0), IP), ""); /* } else if ($assertType(_ref, ptrType$15, true)[1]) { */ case 2: sa$2 = _ref.$val; _r$9 = zoneCache.name(((sa$2.ZoneId >> 0))); /* */ $s = 4; case 4: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $24r = new IPAddr.ptr($convertSliceType($subslice(new sliceType$1(sa$2.Addr), 0), IP), _r$9); $s = 5; case 5: return $24r; /* } */ case 3: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: sockaddrToIP }; } $f.$24r = $24r; $f._r$9 = _r$9; $f._ref = _ref; $f.sa = sa; $f.sa$1 = sa$1; $f.sa$2 = sa$2; $f.$s = $s; $f.$r = $r; return $f; }; IPAddr.ptr.prototype.family = function() { var a; a = this; if (a === ptrType$25.nil || a.IP.$length <= 4) { return 2; } if (!(a.IP.To4() === IP.nil)) { return 2; } return 10; }; IPAddr.prototype.family = function() { return this.$val.family(); }; IPAddr.ptr.prototype.sockaddr = function(family) { var $24r, _r$9, a, family, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$9 = $f._r$9; a = $f.a; family = $f.family; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: a = this; if (a === ptrType$25.nil) { $s = -1; return [$ifaceNil, $ifaceNil]; } _r$9 = ipToSockaddr(family, a.IP, 0, a.Zone); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $24r = _r$9; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: IPAddr.ptr.prototype.sockaddr }; } $f.$24r = $24r; $f._r$9 = _r$9; $f.a = a; $f.family = family; $f.$s = $s; $f.$r = $r; return $f; }; IPAddr.prototype.sockaddr = function(family) { return this.$val.sockaddr(family); }; IPAddr.ptr.prototype.toLocal = function(net) { var a, net; a = this; return new IPAddr.ptr(loopbackIP(net), a.Zone); }; IPAddr.prototype.toLocal = function(net) { return this.$val.toLocal(net); }; IPConn.ptr.prototype.readFrom = function(b) { var _r$10, _r$9, _ref, _tuple, addr, b, c, err, n, sa, sa$1, sa$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$10 = $f._r$10; _r$9 = $f._r$9; _ref = $f._ref; _tuple = $f._tuple; addr = $f.addr; b = $f.b; c = $f.c; err = $f.err; n = $f.n; sa = $f.sa; sa$1 = $f.sa$1; sa$2 = $f.sa$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; addr = ptrType$25.nil; _r$9 = c.conn.fd.readFrom(b); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; sa = _tuple[1]; err = _tuple[2]; _ref = sa; /* */ if ($assertType(_ref, ptrType$14, true)[1]) { $s = 2; continue; } /* */ if ($assertType(_ref, ptrType$15, true)[1]) { $s = 3; continue; } /* */ $s = 4; continue; /* if ($assertType(_ref, ptrType$14, true)[1]) { */ case 2: sa$1 = _ref.$val; addr = new IPAddr.ptr($convertSliceType($subslice(new sliceType$1(sa$1.Addr), 0), IP), ""); n = stripIPv4Header(n, b); $s = 4; continue; /* } else if ($assertType(_ref, ptrType$15, true)[1]) { */ case 3: sa$2 = _ref.$val; _r$10 = zoneCache.name(((sa$2.ZoneId >> 0))); /* */ $s = 5; case 5: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } addr = new IPAddr.ptr($convertSliceType($subslice(new sliceType$1(sa$2.Addr), 0), IP), _r$10); /* } */ case 4: $s = -1; return [n, addr, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: IPConn.ptr.prototype.readFrom }; } $f._r$10 = _r$10; $f._r$9 = _r$9; $f._ref = _ref; $f._tuple = _tuple; $f.addr = addr; $f.b = b; $f.c = c; $f.err = err; $f.n = n; $f.sa = sa; $f.sa$1 = sa$1; $f.sa$2 = sa$2; $f.$s = $s; $f.$r = $r; return $f; }; IPConn.prototype.readFrom = function(b) { return this.$val.readFrom(b); }; stripIPv4Header = function(n, b) { var b, l, n; if (b.$length < 20) { return n; } l = (((((0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]) & 15) >>> 0) >> 0)) << 2 >> 0; if (20 > l || l > b.$length) { return n; } if (!((((0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]) >>> 4 << 24 >>> 24) === 4))) { return n; } $copySlice(b, $subslice(b, l)); return n - l >> 0; }; IPConn.ptr.prototype.readMsg = function(b, oob) { var _r$10, _r$9, _ref, _tuple, addr, b, c, err, flags, n, oob, oobn, sa, sa$1, sa$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$10 = $f._r$10; _r$9 = $f._r$9; _ref = $f._ref; _tuple = $f._tuple; addr = $f.addr; b = $f.b; c = $f.c; err = $f.err; flags = $f.flags; n = $f.n; oob = $f.oob; oobn = $f.oobn; sa = $f.sa; sa$1 = $f.sa$1; sa$2 = $f.sa$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; oobn = 0; flags = 0; addr = ptrType$25.nil; err = $ifaceNil; c = this; sa = $ifaceNil; _r$9 = c.conn.fd.readMsg(b, oob, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; oobn = _tuple[1]; flags = _tuple[2]; sa = _tuple[3]; err = _tuple[4]; _ref = sa; /* */ if ($assertType(_ref, ptrType$14, true)[1]) { $s = 2; continue; } /* */ if ($assertType(_ref, ptrType$15, true)[1]) { $s = 3; continue; } /* */ $s = 4; continue; /* if ($assertType(_ref, ptrType$14, true)[1]) { */ case 2: sa$1 = _ref.$val; addr = new IPAddr.ptr($convertSliceType($subslice(new sliceType$1(sa$1.Addr), 0), IP), ""); $s = 4; continue; /* } else if ($assertType(_ref, ptrType$15, true)[1]) { */ case 3: sa$2 = _ref.$val; _r$10 = zoneCache.name(((sa$2.ZoneId >> 0))); /* */ $s = 5; case 5: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } addr = new IPAddr.ptr($convertSliceType($subslice(new sliceType$1(sa$2.Addr), 0), IP), _r$10); /* } */ case 4: $s = -1; return [n, oobn, flags, addr, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: IPConn.ptr.prototype.readMsg }; } $f._r$10 = _r$10; $f._r$9 = _r$9; $f._ref = _ref; $f._tuple = _tuple; $f.addr = addr; $f.b = b; $f.c = c; $f.err = err; $f.flags = flags; $f.n = n; $f.oob = oob; $f.oobn = oobn; $f.sa = sa; $f.sa$1 = sa$1; $f.sa$2 = sa$2; $f.$s = $s; $f.$r = $r; return $f; }; IPConn.prototype.readMsg = function(b, oob) { return this.$val.readMsg(b, oob); }; IPConn.ptr.prototype.writeTo = function(b, addr) { var $24r, _r$10, _r$9, _tuple, addr, b, c, err, sa, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$10 = $f._r$10; _r$9 = $f._r$9; _tuple = $f._tuple; addr = $f.addr; b = $f.b; c = $f.c; err = $f.err; sa = $f.sa; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (c.conn.fd.isConnected) { $s = -1; return [0, $pkg.ErrWriteToConnected]; } if (addr === ptrType$25.nil) { $s = -1; return [0, errMissingAddress]; } _r$9 = addr.sockaddr(c.conn.fd.family); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; sa = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [0, err]; } _r$10 = c.conn.fd.writeTo(b, sa); /* */ $s = 2; case 2: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } $24r = _r$10; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: IPConn.ptr.prototype.writeTo }; } $f.$24r = $24r; $f._r$10 = _r$10; $f._r$9 = _r$9; $f._tuple = _tuple; $f.addr = addr; $f.b = b; $f.c = c; $f.err = err; $f.sa = sa; $f.$s = $s; $f.$r = $r; return $f; }; IPConn.prototype.writeTo = function(b, addr) { return this.$val.writeTo(b, addr); }; IPConn.ptr.prototype.writeMsg = function(b, oob, addr) { var $24r, _r$10, _r$9, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tuple, _tuple$1, addr, b, c, err, n, oob, oobn, sa, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$10 = $f._r$10; _r$9 = $f._r$9; _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; _tmp$8 = $f._tmp$8; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; addr = $f.addr; b = $f.b; c = $f.c; err = $f.err; n = $f.n; oob = $f.oob; oobn = $f.oobn; sa = $f.sa; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; oobn = 0; err = $ifaceNil; c = this; if (c.conn.fd.isConnected) { _tmp = 0; _tmp$1 = 0; _tmp$2 = $pkg.ErrWriteToConnected; n = _tmp; oobn = _tmp$1; err = _tmp$2; $s = -1; return [n, oobn, err]; } if (addr === ptrType$25.nil) { _tmp$3 = 0; _tmp$4 = 0; _tmp$5 = errMissingAddress; n = _tmp$3; oobn = _tmp$4; err = _tmp$5; $s = -1; return [n, oobn, err]; } _r$9 = addr.sockaddr(c.conn.fd.family); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; sa = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$6 = 0; _tmp$7 = 0; _tmp$8 = err; n = _tmp$6; oobn = _tmp$7; err = _tmp$8; $s = -1; return [n, oobn, err]; } _r$10 = c.conn.fd.writeMsg(b, oob, sa); /* */ $s = 2; case 2: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$1 = _r$10; n = _tuple$1[0]; oobn = _tuple$1[1]; err = _tuple$1[2]; $24r = [n, oobn, err]; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: IPConn.ptr.prototype.writeMsg }; } $f.$24r = $24r; $f._r$10 = _r$10; $f._r$9 = _r$9; $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._tmp$8 = _tmp$8; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.addr = addr; $f.b = b; $f.c = c; $f.err = err; $f.n = n; $f.oob = oob; $f.oobn = oobn; $f.sa = sa; $f.$s = $s; $f.$r = $r; return $f; }; IPConn.prototype.writeMsg = function(b, oob, addr) { return this.$val.writeMsg(b, oob, addr); }; sysDialer.ptr.prototype.dialIP = function(ctx, laddr, raddr) { var _1, _r$10, _r$9, _tuple, _tuple$1, ctx, err, fd, laddr, network, proto, raddr, sd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r$10 = $f._r$10; _r$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; ctx = $f.ctx; err = $f.err; fd = $f.fd; laddr = $f.laddr; network = $f.network; proto = $f.proto; raddr = $f.raddr; sd = $f.sd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sd = this; _r$9 = parseNetwork(ctx, sd.network, true); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; network = _tuple[0]; proto = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$36.nil, err]; } _1 = network; if (_1 === ("ip") || _1 === ("ip4") || _1 === ("ip6")) { } else { $s = -1; return [ptrType$36.nil, new UnknownNetworkError((sd.network))]; } _r$10 = internetSocket(ctx, network, laddr, raddr, 3, proto, "dial", sd.Dialer.Control); /* */ $s = 2; case 2: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$1 = _r$10; fd = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$36.nil, err]; } $s = -1; return [newIPConn(fd), $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: sysDialer.ptr.prototype.dialIP }; } $f._1 = _1; $f._r$10 = _r$10; $f._r$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.ctx = ctx; $f.err = err; $f.fd = fd; $f.laddr = laddr; $f.network = network; $f.proto = proto; $f.raddr = raddr; $f.sd = sd; $f.$s = $s; $f.$r = $r; return $f; }; sysDialer.prototype.dialIP = function(ctx, laddr, raddr) { return this.$val.dialIP(ctx, laddr, raddr); }; IPAddr.ptr.prototype.Network = function() { var a; a = this; return "ip"; }; IPAddr.prototype.Network = function() { return this.$val.Network(); }; IPAddr.ptr.prototype.String = function() { var a, ip; a = this; if (a === ptrType$25.nil) { return ""; } ip = ipEmptyString(a.IP); if (!(a.Zone === "")) { return ip + "%" + a.Zone; } return ip; }; IPAddr.prototype.String = function() { return this.$val.String(); }; IPAddr.ptr.prototype.isWildcard = function() { var a; a = this; if (a === ptrType$25.nil || a.IP === IP.nil) { return true; } return a.IP.IsUnspecified(); }; IPAddr.prototype.isWildcard = function() { return this.$val.isWildcard(); }; IPAddr.ptr.prototype.opAddr = function() { var a; a = this; if (a === ptrType$25.nil) { return $ifaceNil; } return a; }; IPAddr.prototype.opAddr = function() { return this.$val.opAddr(); }; IPConn.ptr.prototype.SyscallConn = function() { var _returncast, c; c = this; if (!c.conn.ok()) { return [$ifaceNil, new syscall.Errno(22)]; } _returncast = newRawConn(c.conn.fd); return [_returncast[0], _returncast[1]]; }; IPConn.prototype.SyscallConn = function() { return this.$val.SyscallConn(); }; IPConn.ptr.prototype.ReadFromIP = function(b) { var _r$9, _tuple, addr, b, c, err, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tuple = $f._tuple; addr = $f.addr; b = $f.b; c = $f.c; err = $f.err; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!c.conn.ok()) { $s = -1; return [0, ptrType$25.nil, new syscall.Errno(22)]; } _r$9 = c.readFrom(b); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; addr = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { err = new OpError.ptr("read", c.conn.fd.net, c.conn.fd.laddr, c.conn.fd.raddr, err); } $s = -1; return [n, addr, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: IPConn.ptr.prototype.ReadFromIP }; } $f._r$9 = _r$9; $f._tuple = _tuple; $f.addr = addr; $f.b = b; $f.c = c; $f.err = err; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; IPConn.prototype.ReadFromIP = function(b) { return this.$val.ReadFromIP(b); }; IPConn.ptr.prototype.ReadFrom = function(b) { var _r$9, _tuple, addr, b, c, err, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tuple = $f._tuple; addr = $f.addr; b = $f.b; c = $f.c; err = $f.err; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!c.conn.ok()) { $s = -1; return [0, $ifaceNil, new syscall.Errno(22)]; } _r$9 = c.readFrom(b); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; addr = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { err = new OpError.ptr("read", c.conn.fd.net, c.conn.fd.laddr, c.conn.fd.raddr, err); } if (addr === ptrType$25.nil) { $s = -1; return [n, $ifaceNil, err]; } $s = -1; return [n, addr, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: IPConn.ptr.prototype.ReadFrom }; } $f._r$9 = _r$9; $f._tuple = _tuple; $f.addr = addr; $f.b = b; $f.c = c; $f.err = err; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; IPConn.prototype.ReadFrom = function(b) { return this.$val.ReadFrom(b); }; IPConn.ptr.prototype.ReadMsgIP = function(b, oob) { var _r$9, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tuple, addr, b, c, err, flags, n, oob, oobn, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tuple = $f._tuple; addr = $f.addr; b = $f.b; c = $f.c; err = $f.err; flags = $f.flags; n = $f.n; oob = $f.oob; oobn = $f.oobn; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; oobn = 0; flags = 0; addr = ptrType$25.nil; err = $ifaceNil; c = this; if (!c.conn.ok()) { _tmp = 0; _tmp$1 = 0; _tmp$2 = 0; _tmp$3 = ptrType$25.nil; _tmp$4 = new syscall.Errno(22); n = _tmp; oobn = _tmp$1; flags = _tmp$2; addr = _tmp$3; err = _tmp$4; $s = -1; return [n, oobn, flags, addr, err]; } _r$9 = c.readMsg(b, oob); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; oobn = _tuple[1]; flags = _tuple[2]; addr = _tuple[3]; err = _tuple[4]; if (!($interfaceIsEqual(err, $ifaceNil))) { err = new OpError.ptr("read", c.conn.fd.net, c.conn.fd.laddr, c.conn.fd.raddr, err); } $s = -1; return [n, oobn, flags, addr, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: IPConn.ptr.prototype.ReadMsgIP }; } $f._r$9 = _r$9; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tuple = _tuple; $f.addr = addr; $f.b = b; $f.c = c; $f.err = err; $f.flags = flags; $f.n = n; $f.oob = oob; $f.oobn = oobn; $f.$s = $s; $f.$r = $r; return $f; }; IPConn.prototype.ReadMsgIP = function(b, oob) { return this.$val.ReadMsgIP(b, oob); }; IPConn.ptr.prototype.WriteToIP = function(b, addr) { var _r$9, _tuple, addr, b, c, err, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tuple = $f._tuple; addr = $f.addr; b = $f.b; c = $f.c; err = $f.err; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!c.conn.ok()) { $s = -1; return [0, new syscall.Errno(22)]; } _r$9 = c.writeTo(b, addr); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { err = new OpError.ptr("write", c.conn.fd.net, c.conn.fd.laddr, addr.opAddr(), err); } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: IPConn.ptr.prototype.WriteToIP }; } $f._r$9 = _r$9; $f._tuple = _tuple; $f.addr = addr; $f.b = b; $f.c = c; $f.err = err; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; IPConn.prototype.WriteToIP = function(b, addr) { return this.$val.WriteToIP(b, addr); }; IPConn.ptr.prototype.WriteTo = function(b, addr) { var _r$9, _tuple, _tuple$1, a, addr, b, c, err, n, ok, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; a = $f.a; addr = $f.addr; b = $f.b; c = $f.c; err = $f.err; n = $f.n; ok = $f.ok; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!c.conn.ok()) { $s = -1; return [0, new syscall.Errno(22)]; } _tuple = $assertType(addr, ptrType$25, true); a = _tuple[0]; ok = _tuple[1]; if (!ok) { $s = -1; return [0, new OpError.ptr("write", c.conn.fd.net, c.conn.fd.laddr, addr, new syscall.Errno(22))]; } _r$9 = c.writeTo(b, a); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple$1 = _r$9; n = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { err = new OpError.ptr("write", c.conn.fd.net, c.conn.fd.laddr, a.opAddr(), err); } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: IPConn.ptr.prototype.WriteTo }; } $f._r$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.a = a; $f.addr = addr; $f.b = b; $f.c = c; $f.err = err; $f.n = n; $f.ok = ok; $f.$s = $s; $f.$r = $r; return $f; }; IPConn.prototype.WriteTo = function(b, addr) { return this.$val.WriteTo(b, addr); }; IPConn.ptr.prototype.WriteMsgIP = function(b, oob, addr) { var _r$9, _tmp, _tmp$1, _tmp$2, _tuple, addr, b, c, err, n, oob, oobn, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tuple = $f._tuple; addr = $f.addr; b = $f.b; c = $f.c; err = $f.err; n = $f.n; oob = $f.oob; oobn = $f.oobn; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; oobn = 0; err = $ifaceNil; c = this; if (!c.conn.ok()) { _tmp = 0; _tmp$1 = 0; _tmp$2 = new syscall.Errno(22); n = _tmp; oobn = _tmp$1; err = _tmp$2; $s = -1; return [n, oobn, err]; } _r$9 = c.writeMsg(b, oob, addr); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; oobn = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { err = new OpError.ptr("write", c.conn.fd.net, c.conn.fd.laddr, addr.opAddr(), err); } $s = -1; return [n, oobn, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: IPConn.ptr.prototype.WriteMsgIP }; } $f._r$9 = _r$9; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tuple = _tuple; $f.addr = addr; $f.b = b; $f.c = c; $f.err = err; $f.n = n; $f.oob = oob; $f.oobn = oobn; $f.$s = $s; $f.$r = $r; return $f; }; IPConn.prototype.WriteMsgIP = function(b, oob, addr) { return this.$val.WriteMsgIP(b, oob, addr); }; newIPConn = function(fd) { var fd; return new IPConn.ptr(new conn.ptr(fd)); }; IPv4 = function(a, b, c, d) { var a, b, c, d, p; p = $makeSlice(IP, 16); $copySlice(p, v4InV6Prefix); (12 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 12] = a); (13 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 13] = b); (14 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 14] = c); (15 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 15] = d); return p; }; $pkg.IPv4 = IPv4; IPv4Mask = function(a, b, c, d) { var a, b, c, d, p; p = $makeSlice(IPMask, 4); (0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0] = a); (1 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 1] = b); (2 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 2] = c); (3 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 3] = d); return p; }; $pkg.IPv4Mask = IPv4Mask; CIDRMask = function(ones, bits) { var _q, bits, i, l, m, n, ones, y; if (!((bits === 32)) && !((bits === 128))) { return IPMask.nil; } if (ones < 0 || ones > bits) { return IPMask.nil; } l = (_q = bits / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); m = $makeSlice(IPMask, l); n = ((ones >>> 0)); i = 0; while (true) { if (!(i < l)) { break; } if (n >= 8) { ((i < 0 || i >= m.$length) ? ($throwRuntimeError("index out of range"), undefined) : m.$array[m.$offset + i] = 255); n = n - (8) >>> 0; i = i + (1) >> 0; continue; } ((i < 0 || i >= m.$length) ? ($throwRuntimeError("index out of range"), undefined) : m.$array[m.$offset + i] = (~(((y = n, y < 32 ? (255 >>> y) : 0) << 24 >>> 24)) << 24 >>> 24)); n = 0; i = i + (1) >> 0; } return m; }; $pkg.CIDRMask = CIDRMask; IP.prototype.IsUnspecified = function() { var ip; ip = this; return ip.Equal($pkg.IPv4zero) || ip.Equal($pkg.IPv6unspecified); }; $ptrType(IP).prototype.IsUnspecified = function() { return this.$get().IsUnspecified(); }; IP.prototype.IsLoopback = function() { var ip, ip4; ip = this; ip4 = ip.To4(); if (!(ip4 === IP.nil)) { return (0 >= ip4.$length ? ($throwRuntimeError("index out of range"), undefined) : ip4.$array[ip4.$offset + 0]) === 127; } return ip.Equal($pkg.IPv6loopback); }; $ptrType(IP).prototype.IsLoopback = function() { return this.$get().IsLoopback(); }; IP.prototype.IsPrivate = function() { var ip, ip4; ip = this; ip4 = ip.To4(); if (!(ip4 === IP.nil)) { return ((0 >= ip4.$length ? ($throwRuntimeError("index out of range"), undefined) : ip4.$array[ip4.$offset + 0]) === 10) || (((0 >= ip4.$length ? ($throwRuntimeError("index out of range"), undefined) : ip4.$array[ip4.$offset + 0]) === 172) && ((((1 >= ip4.$length ? ($throwRuntimeError("index out of range"), undefined) : ip4.$array[ip4.$offset + 1]) & 240) >>> 0) === 16)) || (((0 >= ip4.$length ? ($throwRuntimeError("index out of range"), undefined) : ip4.$array[ip4.$offset + 0]) === 192) && ((1 >= ip4.$length ? ($throwRuntimeError("index out of range"), undefined) : ip4.$array[ip4.$offset + 1]) === 168)); } return (ip.$length === 16) && ((((0 >= ip.$length ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + 0]) & 254) >>> 0) === 252); }; $ptrType(IP).prototype.IsPrivate = function() { return this.$get().IsPrivate(); }; IP.prototype.IsMulticast = function() { var ip, ip4; ip = this; ip4 = ip.To4(); if (!(ip4 === IP.nil)) { return (((0 >= ip4.$length ? ($throwRuntimeError("index out of range"), undefined) : ip4.$array[ip4.$offset + 0]) & 240) >>> 0) === 224; } return (ip.$length === 16) && ((0 >= ip.$length ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + 0]) === 255); }; $ptrType(IP).prototype.IsMulticast = function() { return this.$get().IsMulticast(); }; IP.prototype.IsInterfaceLocalMulticast = function() { var ip; ip = this; return (ip.$length === 16) && ((0 >= ip.$length ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + 0]) === 255) && ((((1 >= ip.$length ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + 1]) & 15) >>> 0) === 1); }; $ptrType(IP).prototype.IsInterfaceLocalMulticast = function() { return this.$get().IsInterfaceLocalMulticast(); }; IP.prototype.IsLinkLocalMulticast = function() { var ip, ip4; ip = this; ip4 = ip.To4(); if (!(ip4 === IP.nil)) { return ((0 >= ip4.$length ? ($throwRuntimeError("index out of range"), undefined) : ip4.$array[ip4.$offset + 0]) === 224) && ((1 >= ip4.$length ? ($throwRuntimeError("index out of range"), undefined) : ip4.$array[ip4.$offset + 1]) === 0) && ((2 >= ip4.$length ? ($throwRuntimeError("index out of range"), undefined) : ip4.$array[ip4.$offset + 2]) === 0); } return (ip.$length === 16) && ((0 >= ip.$length ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + 0]) === 255) && ((((1 >= ip.$length ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + 1]) & 15) >>> 0) === 2); }; $ptrType(IP).prototype.IsLinkLocalMulticast = function() { return this.$get().IsLinkLocalMulticast(); }; IP.prototype.IsLinkLocalUnicast = function() { var ip, ip4; ip = this; ip4 = ip.To4(); if (!(ip4 === IP.nil)) { return ((0 >= ip4.$length ? ($throwRuntimeError("index out of range"), undefined) : ip4.$array[ip4.$offset + 0]) === 169) && ((1 >= ip4.$length ? ($throwRuntimeError("index out of range"), undefined) : ip4.$array[ip4.$offset + 1]) === 254); } return (ip.$length === 16) && ((0 >= ip.$length ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + 0]) === 254) && ((((1 >= ip.$length ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + 1]) & 192) >>> 0) === 128); }; $ptrType(IP).prototype.IsLinkLocalUnicast = function() { return this.$get().IsLinkLocalUnicast(); }; IP.prototype.IsGlobalUnicast = function() { var ip; ip = this; return ((ip.$length === 4) || (ip.$length === 16)) && !ip.Equal($pkg.IPv4bcast) && !ip.IsUnspecified() && !ip.IsLoopback() && !ip.IsMulticast() && !ip.IsLinkLocalUnicast(); }; $ptrType(IP).prototype.IsGlobalUnicast = function() { return this.$get().IsGlobalUnicast(); }; isZeros = function(p) { var i, p; i = 0; while (true) { if (!(i < p.$length)) { break; } if (!((((i < 0 || i >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + i]) === 0))) { return false; } i = i + (1) >> 0; } return true; }; IP.prototype.To4 = function() { var ip; ip = this; if (ip.$length === 4) { return ip; } if ((ip.$length === 16) && isZeros($subslice(ip, 0, 10)) && ((10 >= ip.$length ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + 10]) === 255) && ((11 >= ip.$length ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + 11]) === 255)) { return $subslice(ip, 12, 16); } return IP.nil; }; $ptrType(IP).prototype.To4 = function() { return this.$get().To4(); }; IP.prototype.To16 = function() { var ip; ip = this; if (ip.$length === 4) { return IPv4((0 >= ip.$length ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + 0]), (1 >= ip.$length ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + 1]), (2 >= ip.$length ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + 2]), (3 >= ip.$length ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + 3])); } if (ip.$length === 16) { return ip; } return IP.nil; }; $ptrType(IP).prototype.To16 = function() { return this.$get().To16(); }; IP.prototype.DefaultMask = function() { var ip; ip = this; ip = ip.To4(); if (ip === IP.nil) { return IPMask.nil; } if ((0 >= ip.$length ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + 0]) < 128) { return classAMask; } else if ((0 >= ip.$length ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + 0]) < 192) { return classBMask; } else { return classCMask; } }; $ptrType(IP).prototype.DefaultMask = function() { return this.$get().DefaultMask(); }; allFF = function(b) { var _i, _ref, b, c; _ref = b; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } c = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (!((c === 255))) { return false; } _i++; } return true; }; IP.prototype.Mask = function(mask) { var i, ip, mask, n, out; ip = this; if ((mask.$length === 16) && (ip.$length === 4) && allFF($convertSliceType($subslice(mask, 0, 12), sliceType$1))) { mask = $subslice(mask, 12); } if ((mask.$length === 4) && (ip.$length === 16) && bytealg.Equal($convertSliceType($subslice(ip, 0, 12), sliceType$1), v4InV6Prefix)) { ip = $subslice(ip, 12); } n = ip.$length; if (!((n === mask.$length))) { return IP.nil; } out = $makeSlice(IP, n); i = 0; while (true) { if (!(i < n)) { break; } ((i < 0 || i >= out.$length) ? ($throwRuntimeError("index out of range"), undefined) : out.$array[out.$offset + i] = ((((i < 0 || i >= ip.$length) ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + i]) & ((i < 0 || i >= mask.$length) ? ($throwRuntimeError("index out of range"), undefined) : mask.$array[mask.$offset + i])) >>> 0)); i = i + (1) >> 0; } return out; }; $ptrType(IP).prototype.Mask = function(mask) { return this.$get().Mask(mask); }; ubtoa = function(dst, start, v) { var _q, _q$1, _q$2, _r$10, _r$11, _r$9, dst, start, v, x, x$1, x$2; if (v < 10) { ((start < 0 || start >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + start] = (v + 48 << 24 >>> 24)); return 1; } else if (v < 100) { (x = start + 1 >> 0, ((x < 0 || x >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + x] = ((_r$9 = v % 10, _r$9 === _r$9 ? _r$9 : $throwRuntimeError("integer divide by zero")) + 48 << 24 >>> 24))); ((start < 0 || start >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + start] = ((_q = v / 10, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")) + 48 << 24 >>> 24)); return 2; } (x$1 = start + 2 >> 0, ((x$1 < 0 || x$1 >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + x$1] = ((_r$10 = v % 10, _r$10 === _r$10 ? _r$10 : $throwRuntimeError("integer divide by zero")) + 48 << 24 >>> 24))); (x$2 = start + 1 >> 0, ((x$2 < 0 || x$2 >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + x$2] = ((_r$11 = ((_q$1 = v / 10, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >>> 0 : $throwRuntimeError("integer divide by zero"))) % 10, _r$11 === _r$11 ? _r$11 : $throwRuntimeError("integer divide by zero")) + 48 << 24 >>> 24))); ((start < 0 || start >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + start] = ((_q$2 = v / 100, (_q$2 === _q$2 && _q$2 !== 1/0 && _q$2 !== -1/0) ? _q$2 >>> 0 : $throwRuntimeError("integer divide by zero")) + 48 << 24 >>> 24)); return 3; }; IP.prototype.String = function() { var b, b$1, e0, e1, i, i$1, ip, j, n, p, p4, x, x$1; ip = this; p = ip; if (ip.$length === 0) { return ""; } p4 = p.To4(); if (p4.$length === 4) { b = $makeSlice(sliceType$1, 15); n = ubtoa(b, 0, (0 >= p4.$length ? ($throwRuntimeError("index out of range"), undefined) : p4.$array[p4.$offset + 0])); ((n < 0 || n >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + n] = 46); n = n + (1) >> 0; n = n + (ubtoa(b, n, (1 >= p4.$length ? ($throwRuntimeError("index out of range"), undefined) : p4.$array[p4.$offset + 1]))) >> 0; ((n < 0 || n >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + n] = 46); n = n + (1) >> 0; n = n + (ubtoa(b, n, (2 >= p4.$length ? ($throwRuntimeError("index out of range"), undefined) : p4.$array[p4.$offset + 2]))) >> 0; ((n < 0 || n >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + n] = 46); n = n + (1) >> 0; n = n + (ubtoa(b, n, (3 >= p4.$length ? ($throwRuntimeError("index out of range"), undefined) : p4.$array[p4.$offset + 3]))) >> 0; return ($bytesToString($subslice(b, 0, n))); } if (!((p.$length === 16))) { return "?" + hexString($convertSliceType(ip, sliceType$1)); } e0 = -1; e1 = -1; i = 0; while (true) { if (!(i < 16)) { break; } j = i; while (true) { if (!(j < 16 && (((j < 0 || j >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + j]) === 0) && ((x = j + 1 >> 0, ((x < 0 || x >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + x])) === 0))) { break; } j = j + (2) >> 0; } if (j > i && (j - i >> 0) > (e1 - e0 >> 0)) { e0 = i; e1 = j; i = j; } i = i + (2) >> 0; } if ((e1 - e0 >> 0) <= 2) { e0 = -1; e1 = -1; } b$1 = $makeSlice(sliceType$1, 0, 39); i$1 = 0; while (true) { if (!(i$1 < 16)) { break; } if (i$1 === e0) { b$1 = $append(b$1, 58, 58); i$1 = e1; if (i$1 >= 16) { break; } } else if (i$1 > 0) { b$1 = $append(b$1, 58); } b$1 = appendHex(b$1, (((((((i$1 < 0 || i$1 >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + i$1]) >>> 0)) << 8 >>> 0)) | (((x$1 = i$1 + 1 >> 0, ((x$1 < 0 || x$1 >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + x$1])) >>> 0))) >>> 0); i$1 = i$1 + (2) >> 0; } return ($bytesToString(b$1)); }; $ptrType(IP).prototype.String = function() { return this.$get().String(); }; hexString = function(b) { var _i, _ref, _tmp, _tmp$1, b, i, s, tn, x, x$1; s = $makeSlice(sliceType$1, ($imul(b.$length, 2))); _ref = b; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; tn = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _tmp = "0123456789abcdef".charCodeAt((tn >>> 4 << 24 >>> 24)); _tmp$1 = "0123456789abcdef".charCodeAt(((tn & 15) >>> 0)); (x = $imul(i, 2), ((x < 0 || x >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + x] = _tmp)); (x$1 = ($imul(i, 2)) + 1 >> 0, ((x$1 < 0 || x$1 >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + x$1] = _tmp$1)); _i++; } return ($bytesToString(s)); }; ipEmptyString = function(ip) { var ip; if (ip.$length === 0) { return ""; } return ip.String(); }; IP.prototype.MarshalText = function() { var ip; ip = this; if (ip.$length === 0) { return [(new sliceType$1($stringToBytes(""))), $ifaceNil]; } if (!((ip.$length === 4)) && !((ip.$length === 16))) { return [sliceType$1.nil, new AddrError.ptr("invalid IP address", hexString($convertSliceType(ip, sliceType$1)))]; } return [(new sliceType$1($stringToBytes(ip.String()))), $ifaceNil]; }; $ptrType(IP).prototype.MarshalText = function() { return this.$get().MarshalText(); }; $ptrType(IP).prototype.UnmarshalText = function(text) { var ip, s, text, x; ip = this; if (text.$length === 0) { ip.$set(IP.nil); return $ifaceNil; } s = ($bytesToString(text)); x = ParseIP(s); if (x === IP.nil) { return new ParseError.ptr("IP address", s); } ip.$set(x); return $ifaceNil; }; IP.prototype.Equal = function(x) { var ip, x; ip = this; if (ip.$length === x.$length) { return bytealg.Equal($convertSliceType(ip, sliceType$1), $convertSliceType(x, sliceType$1)); } if ((ip.$length === 4) && (x.$length === 16)) { return bytealg.Equal($convertSliceType($subslice(x, 0, 12), sliceType$1), v4InV6Prefix) && bytealg.Equal($convertSliceType(ip, sliceType$1), $convertSliceType($subslice(x, 12), sliceType$1)); } if ((ip.$length === 16) && (x.$length === 4)) { return bytealg.Equal($convertSliceType($subslice(ip, 0, 12), sliceType$1), v4InV6Prefix) && bytealg.Equal($convertSliceType($subslice(ip, 12), sliceType$1), $convertSliceType(x, sliceType$1)); } return false; }; $ptrType(IP).prototype.Equal = function(x) { return this.$get().Equal(x); }; IP.prototype.matchAddrFamily = function(x) { var ip, x; ip = this; return !(ip.To4() === IP.nil) && !(x.To4() === IP.nil) || !(ip.To16() === IP.nil) && ip.To4() === IP.nil && !(x.To16() === IP.nil) && x.To4() === IP.nil; }; $ptrType(IP).prototype.matchAddrFamily = function(x) { return this.$get().matchAddrFamily(x); }; simpleMaskLength = function(mask) { var _i, _ref, i, mask, n, v, y; n = 0; _ref = mask; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (v === 255) { n = n + (8) >> 0; _i++; continue; } while (true) { if (!(!((((v & 128) >>> 0) === 0)))) { break; } n = n + (1) >> 0; v = (y = (1), y < 32 ? (v << y) : 0) << 24 >>> 24; } if (!((v === 0))) { return -1; } i = i + (1) >> 0; while (true) { if (!(i < mask.$length)) { break; } if (!((((i < 0 || i >= mask.$length) ? ($throwRuntimeError("index out of range"), undefined) : mask.$array[mask.$offset + i]) === 0))) { return -1; } i = i + (1) >> 0; } break; } return n; }; IPMask.prototype.Size = function() { var _tmp, _tmp$1, _tmp$2, _tmp$3, bits, m, ones; ones = 0; bits = 0; m = this; _tmp = simpleMaskLength(m); _tmp$1 = $imul(m.$length, 8); ones = _tmp; bits = _tmp$1; if (ones === -1) { _tmp$2 = 0; _tmp$3 = 0; ones = _tmp$2; bits = _tmp$3; return [ones, bits]; } return [ones, bits]; }; $ptrType(IPMask).prototype.Size = function() { return this.$get().Size(); }; IPMask.prototype.String = function() { var m; m = this; if (m.$length === 0) { return ""; } return hexString($convertSliceType(m, sliceType$1)); }; $ptrType(IPMask).prototype.String = function() { return this.$get().String(); }; networkNumberAndMask = function(n) { var _1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, ip, m, n; ip = IP.nil; m = IPMask.nil; ip = n.IP.To4(); if (ip === IP.nil) { ip = n.IP; if (!((ip.$length === 16))) { _tmp = IP.nil; _tmp$1 = IPMask.nil; ip = _tmp; m = _tmp$1; return [ip, m]; } } m = n.Mask; _1 = m.$length; if (_1 === (4)) { if (!((ip.$length === 4))) { _tmp$2 = IP.nil; _tmp$3 = IPMask.nil; ip = _tmp$2; m = _tmp$3; return [ip, m]; } } else if (_1 === (16)) { if (ip.$length === 4) { m = $subslice(m, 12); } } else { _tmp$4 = IP.nil; _tmp$5 = IPMask.nil; ip = _tmp$4; m = _tmp$5; return [ip, m]; } return [ip, m]; }; IPNet.ptr.prototype.Contains = function(ip) { var _tuple, i, ip, l, m, n, nn, x; n = this; _tuple = networkNumberAndMask(n); nn = _tuple[0]; m = _tuple[1]; x = ip.To4(); if (!(x === IP.nil)) { ip = x; } l = ip.$length; if (!((l === nn.$length))) { return false; } i = 0; while (true) { if (!(i < l)) { break; } if (!((((((i < 0 || i >= nn.$length) ? ($throwRuntimeError("index out of range"), undefined) : nn.$array[nn.$offset + i]) & ((i < 0 || i >= m.$length) ? ($throwRuntimeError("index out of range"), undefined) : m.$array[m.$offset + i])) >>> 0) === ((((i < 0 || i >= ip.$length) ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + i]) & ((i < 0 || i >= m.$length) ? ($throwRuntimeError("index out of range"), undefined) : m.$array[m.$offset + i])) >>> 0)))) { return false; } i = i + (1) >> 0; } return true; }; IPNet.prototype.Contains = function(ip) { return this.$val.Contains(ip); }; IPNet.ptr.prototype.Network = function() { var n; n = this; return "ip+net"; }; IPNet.prototype.Network = function() { return this.$val.Network(); }; IPNet.ptr.prototype.String = function() { var _tuple, l, m, n, nn; n = this; _tuple = networkNumberAndMask(n); nn = _tuple[0]; m = _tuple[1]; if (nn === IP.nil || m === IPMask.nil) { return ""; } l = simpleMaskLength(m); if (l === -1) { return nn.String() + "/" + m.String(); } return nn.String() + "/" + itoa.Uitoa(((l >>> 0))); }; IPNet.prototype.String = function() { return this.$val.String(); }; parseIPv4 = function(s) { var _tuple, c, i, n, ok, p, s; p = arrayType$2.zero(); i = 0; while (true) { if (!(i < 4)) { break; } if (s.length === 0) { return IP.nil; } if (i > 0) { if (!((s.charCodeAt(0) === 46))) { return IP.nil; } s = $substring(s, 1); } _tuple = dtoi(s); n = _tuple[0]; c = _tuple[1]; ok = _tuple[2]; if (!ok || n > 255) { return IP.nil; } if (c > 1 && (s.charCodeAt(0) === 48)) { return IP.nil; } s = $substring(s, c); ((i < 0 || i >= p.length) ? ($throwRuntimeError("index out of range"), undefined) : p[i] = ((n << 24 >>> 24))); i = i + (1) >> 0; } if (!((s.length === 0))) { return IP.nil; } return IPv4(p[0], p[1], p[2], p[3]); }; parseIPv6Zone = function(s) { var _tuple, s, zone; _tuple = splitHostZone(s); s = _tuple[0]; zone = _tuple[1]; return [parseIPv6(s), zone]; }; parseIPv6 = function(s) { var _tuple, c, ellipsis, i, ip, ip4, j, j$1, n, n$1, ok, s, x, x$1, x$2, x$3, x$4; ip = IP.nil; ip = $makeSlice(IP, 16); ellipsis = -1; if (s.length >= 2 && (s.charCodeAt(0) === 58) && (s.charCodeAt(1) === 58)) { ellipsis = 0; s = $substring(s, 2); if (s.length === 0) { ip = ip; return ip; } } i = 0; while (true) { if (!(i < 16)) { break; } _tuple = xtoi(s); n = _tuple[0]; c = _tuple[1]; ok = _tuple[2]; if (!ok || n > 65535) { ip = IP.nil; return ip; } if (c < s.length && (s.charCodeAt(c) === 46)) { if (ellipsis < 0 && !((i === 12))) { ip = IP.nil; return ip; } if ((i + 4 >> 0) > 16) { ip = IP.nil; return ip; } ip4 = parseIPv4(s); if (ip4 === IP.nil) { ip = IP.nil; return ip; } ((i < 0 || i >= ip.$length) ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + i] = (12 >= ip4.$length ? ($throwRuntimeError("index out of range"), undefined) : ip4.$array[ip4.$offset + 12])); (x = i + 1 >> 0, ((x < 0 || x >= ip.$length) ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + x] = (13 >= ip4.$length ? ($throwRuntimeError("index out of range"), undefined) : ip4.$array[ip4.$offset + 13]))); (x$1 = i + 2 >> 0, ((x$1 < 0 || x$1 >= ip.$length) ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + x$1] = (14 >= ip4.$length ? ($throwRuntimeError("index out of range"), undefined) : ip4.$array[ip4.$offset + 14]))); (x$2 = i + 3 >> 0, ((x$2 < 0 || x$2 >= ip.$length) ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + x$2] = (15 >= ip4.$length ? ($throwRuntimeError("index out of range"), undefined) : ip4.$array[ip4.$offset + 15]))); s = ""; i = i + (4) >> 0; break; } ((i < 0 || i >= ip.$length) ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + i] = (((n >> 8 >> 0) << 24 >>> 24))); (x$3 = i + 1 >> 0, ((x$3 < 0 || x$3 >= ip.$length) ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + x$3] = ((n << 24 >>> 24)))); i = i + (2) >> 0; s = $substring(s, c); if (s.length === 0) { break; } if (!((s.charCodeAt(0) === 58)) || (s.length === 1)) { ip = IP.nil; return ip; } s = $substring(s, 1); if (s.charCodeAt(0) === 58) { if (ellipsis >= 0) { ip = IP.nil; return ip; } ellipsis = i; s = $substring(s, 1); if (s.length === 0) { break; } } } if (!((s.length === 0))) { ip = IP.nil; return ip; } if (i < 16) { if (ellipsis < 0) { ip = IP.nil; return ip; } n$1 = 16 - i >> 0; j = i - 1 >> 0; while (true) { if (!(j >= ellipsis)) { break; } (x$4 = j + n$1 >> 0, ((x$4 < 0 || x$4 >= ip.$length) ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + x$4] = ((j < 0 || j >= ip.$length) ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + j]))); j = j - (1) >> 0; } j$1 = (ellipsis + n$1 >> 0) - 1 >> 0; while (true) { if (!(j$1 >= ellipsis)) { break; } ((j$1 < 0 || j$1 >= ip.$length) ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + j$1] = 0); j$1 = j$1 - (1) >> 0; } } else if (ellipsis >= 0) { ip = IP.nil; return ip; } ip = ip; return ip; }; ParseIP = function(s) { var _1, i, s; i = 0; while (true) { if (!(i < s.length)) { break; } _1 = s.charCodeAt(i); if (_1 === (46)) { return parseIPv4(s); } else if (_1 === (58)) { return parseIPv6(s); } i = i + (1) >> 0; } return IP.nil; }; $pkg.ParseIP = ParseIP; parseIPZone = function(s) { var _1, i, s; i = 0; while (true) { if (!(i < s.length)) { break; } _1 = s.charCodeAt(i); if (_1 === (46)) { return [parseIPv4(s), ""]; } else if (_1 === (58)) { return parseIPv6Zone(s); } i = i + (1) >> 0; } return [IP.nil, ""]; }; ParseCIDR = function(s) { var _tmp, _tmp$1, _tuple, addr, i, ip, iplen, m, mask, n, ok, s; i = bytealg.IndexByteString(s, 47); if (i < 0) { return [IP.nil, ptrType$5.nil, new ParseError.ptr("CIDR address", s)]; } _tmp = $substring(s, 0, i); _tmp$1 = $substring(s, (i + 1 >> 0)); addr = _tmp; mask = _tmp$1; iplen = 4; ip = parseIPv4(addr); if (ip === IP.nil) { iplen = 16; ip = parseIPv6(addr); } _tuple = dtoi(mask); n = _tuple[0]; i = _tuple[1]; ok = _tuple[2]; if (ip === IP.nil || !ok || !((i === mask.length)) || n < 0 || n > ($imul(8, iplen))) { return [IP.nil, ptrType$5.nil, new ParseError.ptr("CIDR address", s)]; } m = CIDRMask(n, $imul(8, iplen)); return [ip, new IPNet.ptr(ip.Mask(m), m), $ifaceNil]; }; $pkg.ParseCIDR = ParseCIDR; interfaceTable = function(ifindex) { var _1, _i, _r$9, _ref, _tuple, _tuple$1, _tuple$2, attrs, err, err$1, ifim, ifindex, ift, m, msgs, tab, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _i = $f._i; _r$9 = $f._r$9; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; attrs = $f.attrs; err = $f.err; err$1 = $f.err$1; ifim = $f.ifim; ifindex = $f.ifindex; ift = $f.ift; m = $f.m; msgs = $f.msgs; tab = $f.tab; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: m = [m]; _r$9 = syscall.NetlinkRIB(18, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; tab = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType$12.nil, os.NewSyscallError("netlinkrib", err)]; } _tuple$1 = syscall.ParseNetlinkMessage(tab); msgs = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType$12.nil, os.NewSyscallError("parsenetlinkmessage", err)]; } ift = sliceType$12.nil; _ref = msgs; _i = 0; loop: while (true) { if (!(_i < _ref.$length)) { break; } m[0] = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), syscall.NetlinkMessage); _1 = m[0].Header.Type; if (_1 === (3)) { break loop; } else if (_1 === (16)) { ifim = ($pointerOfStructConversion(($sliceToNativeArray(m[0].Data)), ptrType$37)); if ((ifindex === 0) || (ifindex === ((ifim.Index >> 0)))) { _tuple$2 = syscall.ParseNetlinkRouteAttr(m[0]); attrs = _tuple$2[0]; err$1 = _tuple$2[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [sliceType$12.nil, os.NewSyscallError("parsenetlinkrouteattr", err$1)]; } ift = $append(ift, newLink(ifim, attrs)); if (ifindex === ((ifim.Index >> 0))) { break loop; } } } _i++; } $s = -1; return [ift, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: interfaceTable }; } $f._1 = _1; $f._i = _i; $f._r$9 = _r$9; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.attrs = attrs; $f.err = err; $f.err$1 = err$1; $f.ifim = ifim; $f.ifindex = ifindex; $f.ift = ift; $f.m = m; $f.msgs = msgs; $f.tab = tab; $f.$s = $s; $f.$r = $r; return $f; }; newLink = function(ifim, attrs) { var _1, _2, _3, _4, _i, _i$1, _ref, _ref$1, a, attrs, b, ifi, ifim, nonzero, x; ifi = new Interface.ptr(((ifim.Index >> 0)), 0, "", HardwareAddr.nil, linkFlags(ifim.Flags)); _ref = attrs; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } a = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), syscall.NetlinkRouteAttr); _1 = a.Attr.Type; if (_1 === (1)) { _2 = a.Value.$length; if (_2 === (4)) { _3 = ifim.Type; if ((_3 === (768)) || (_3 === (778)) || (_3 === (776))) { _i++; continue; } } else if (_2 === (16)) { _4 = ifim.Type; if ((_4 === (769)) || (_4 === (823))) { _i++; continue; } } nonzero = false; _ref$1 = a.Value; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } b = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); if (!((b === 0))) { nonzero = true; break; } _i$1++; } if (nonzero) { ifi.HardwareAddr = $convertSliceType(a.Value, HardwareAddr); } } else if (_1 === (3)) { ifi.Name = ($bytesToString($subslice(a.Value, 0, (a.Value.$length - 1 >> 0)))); } else if (_1 === (4)) { ifi.MTU = (((x = $subslice(a.Value, 0, 4), (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])) >> 0)); } _i++; } return ifi; }; linkFlags = function(rawFlags) { var f, rawFlags; f = 0; if (!((((rawFlags & 1) >>> 0) === 0))) { f = (f | (1)) >>> 0; } if (!((((rawFlags & 2) >>> 0) === 0))) { f = (f | (2)) >>> 0; } if (!((((rawFlags & 8) >>> 0) === 0))) { f = (f | (4)) >>> 0; } if (!((((rawFlags & 16) >>> 0) === 0))) { f = (f | (8)) >>> 0; } if (!((((rawFlags & 4096) >>> 0) === 0))) { f = (f | (16)) >>> 0; } return f; }; interfaceAddrTable = function(ifi) { var _r$10, _r$9, _tuple, _tuple$1, _tuple$2, _tuple$3, err, err$1, ifat, ifi, ift, msgs, tab, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$10 = $f._r$10; _r$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; err = $f.err; err$1 = $f.err$1; ifat = $f.ifat; ifi = $f.ifi; ift = $f.ift; msgs = $f.msgs; tab = $f.tab; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$9 = syscall.NetlinkRIB(22, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; tab = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType$13.nil, os.NewSyscallError("netlinkrib", err)]; } _tuple$1 = syscall.ParseNetlinkMessage(tab); msgs = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType$13.nil, os.NewSyscallError("parsenetlinkmessage", err)]; } ift = sliceType$12.nil; /* */ if (ifi === ptrType$18.nil) { $s = 2; continue; } /* */ $s = 3; continue; /* if (ifi === ptrType$18.nil) { */ case 2: err$1 = $ifaceNil; _r$10 = interfaceTable(0); /* */ $s = 4; case 4: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$2 = _r$10; ift = _tuple$2[0]; err$1 = _tuple$2[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [sliceType$13.nil, err$1]; } /* } */ case 3: _tuple$3 = addrTable(ift, ifi, msgs); ifat = _tuple$3[0]; err = _tuple$3[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType$13.nil, err]; } $s = -1; return [ifat, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: interfaceAddrTable }; } $f._r$10 = _r$10; $f._r$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.err = err; $f.err$1 = err$1; $f.ifat = ifat; $f.ifi = ifi; $f.ift = ift; $f.msgs = msgs; $f.tab = tab; $f.$s = $s; $f.$r = $r; return $f; }; addrTable = function(ift, ifi, msgs) { var _1, _i, _ref, _tuple, _tuple$1, attrs, err, err$1, ifa, ifam, ifat, ifi, ift, m, msgs; ifat = sliceType$13.nil; _ref = msgs; _i = 0; loop: while (true) { if (!(_i < _ref.$length)) { break; } m = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), syscall.NetlinkMessage); _1 = m.Header.Type; if (_1 === (3)) { break loop; } else if (_1 === (20)) { ifam = ($pointerOfStructConversion(($sliceToNativeArray(m.Data)), ptrType$38)); if (!((ift.$length === 0)) || (ifi.Index === ((ifam.Index >> 0)))) { if (!((ift.$length === 0))) { err = $ifaceNil; _tuple = interfaceByIndex(ift, ((ifam.Index >> 0))); ifi = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [sliceType$13.nil, err]; } } _tuple$1 = syscall.ParseNetlinkRouteAttr(m); attrs = _tuple$1[0]; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return [sliceType$13.nil, os.NewSyscallError("parsenetlinkrouteattr", err$1)]; } ifa = newAddr(ifam, attrs); if (!($interfaceIsEqual(ifa, $ifaceNil))) { ifat = $append(ifat, ifa); } } } _i++; } return [ifat, $ifaceNil]; }; newAddr = function(ifam, attrs) { var _1, _i, _i$1, _ref, _ref$1, a, a$1, attrs, ifa, ifam, ipPointToPoint, x, x$1, x$2, x$3; ipPointToPoint = false; _ref = attrs; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } a = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), syscall.NetlinkRouteAttr); if (a.Attr.Type === 2) { ipPointToPoint = true; break; } _i++; } _ref$1 = attrs; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } a$1 = $clone(((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]), syscall.NetlinkRouteAttr); if (ipPointToPoint && (a$1.Attr.Type === 1)) { _i$1++; continue; } _1 = ifam.Family; if (_1 === (2)) { return new IPNet.ptr(IPv4((x = a$1.Value, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])), (x$1 = a$1.Value, (1 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 1])), (x$2 = a$1.Value, (2 >= x$2.$length ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + 2])), (x$3 = a$1.Value, (3 >= x$3.$length ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + 3]))), CIDRMask(((ifam.Prefixlen >> 0)), 32)); } else if (_1 === (10)) { ifa = new IPNet.ptr($makeSlice(IP, 16), CIDRMask(((ifam.Prefixlen >> 0)), 128)); $copySlice(ifa.IP, a$1.Value); return ifa; } _i$1++; } return $ifaceNil; }; interfaceMulticastAddrTable = function(ifi) { var _r$10, _r$9, ifi, ifmat4, ifmat6, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$10 = $f._r$10; _r$9 = $f._r$9; ifi = $f.ifi; ifmat4 = $f.ifmat4; ifmat6 = $f.ifmat6; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$9 = parseProcNetIGMP("/proc/net/igmp", ifi); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } ifmat4 = _r$9; _r$10 = parseProcNetIGMP6("/proc/net/igmp6", ifi); /* */ $s = 2; case 2: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } ifmat6 = _r$10; $s = -1; return [$appendSlice(ifmat4, ifmat6), $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: interfaceMulticastAddrTable }; } $f._r$10 = _r$10; $f._r$9 = _r$9; $f.ifi = ifi; $f.ifmat4 = ifmat4; $f.ifmat6 = ifmat6; $f.$s = $s; $f.$r = $r; return $f; }; parseProcNetIGMP = function(path, ifi) { var $24r, $24r$1, _q, _r$10, _r$11, _r$12, _r$13, _r$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, b, err, f, fd, i, i$1, ifi, ifma, ifmat, l, name, ok, path, x, x$1, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _q = $f._q; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$13 = $f._r$13; _r$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; b = $f.b; err = $f.err; f = $f.f; fd = $f.fd; i = $f.i; i$1 = $f.i$1; ifi = $f.ifi; ifma = $f.ifma; ifmat = $f.ifmat; l = $f.l; name = $f.name; ok = $f.ok; path = $f.path; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); _r$9 = open(path); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; fd = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $24r = sliceType$13.nil; $s = 4; case 4: return $24r; /* } */ case 3: $deferred.push([$methodVal(fd, "close"), []]); ifmat = sliceType$13.nil; name = ""; _r$10 = fd.readLine(); /* */ $s = 5; case 5: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; b = $makeSlice(sliceType$1, 4); _r$11 = fd.readLine(); /* */ $s = 6; case 6: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tuple$1 = _r$11; l = _tuple$1[0]; ok = _tuple$1[1]; /* while (true) { */ case 7: /* if (!(ok)) { break; } */ if(!(ok)) { $s = 8; continue; } f = splitAtBytes(l, " :\r\t\n"); /* */ if (f.$length < 4) { $s = 9; continue; } /* */ $s = 10; continue; /* if (f.$length < 4) { */ case 9: _r$12 = fd.readLine(); /* */ $s = 11; case 11: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _tuple$2 = _r$12; l = _tuple$2[0]; ok = _tuple$2[1]; /* continue; */ $s = 7; continue; /* } */ case 10: if (!((l.charCodeAt(0) === 32)) && !((l.charCodeAt(0) === 9))) { name = (1 >= f.$length ? ($throwRuntimeError("index out of range"), undefined) : f.$array[f.$offset + 1]); } else if (((0 >= f.$length ? ($throwRuntimeError("index out of range"), undefined) : f.$array[f.$offset + 0]).length === 8)) { if (ifi === ptrType$18.nil || name === ifi.Name) { i = 0; while (true) { if (!((i + 1 >> 0) < (0 >= f.$length ? ($throwRuntimeError("index out of range"), undefined) : f.$array[f.$offset + 0]).length)) { break; } _tuple$3 = xtoi2($substring((0 >= f.$length ? ($throwRuntimeError("index out of range"), undefined) : f.$array[f.$offset + 0]), i, (i + 2 >> 0)), 0); (x = (_q = i / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")), ((x < 0 || x >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + x] = _tuple$3[0])); i = i + (2) >> 0; } i$1 = (x$1 = $subslice(b, 0, 4), (0 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 0])); ifma = new IPAddr.ptr(IPv4((((i$1 >>> 24 >>> 0) << 24 >>> 24)), (((i$1 >>> 16 >>> 0) << 24 >>> 24)), (((i$1 >>> 8 >>> 0) << 24 >>> 24)), ((i$1 << 24 >>> 24))), ""); ifmat = $append(ifmat, ifma); } } _r$13 = fd.readLine(); /* */ $s = 12; case 12: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _tuple$4 = _r$13; l = _tuple$4[0]; ok = _tuple$4[1]; $s = 7; continue; case 8: $24r$1 = ifmat; $s = 13; case 13: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return sliceType$13.nil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: parseProcNetIGMP }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._q = _q; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$13 = _r$13; $f._r$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f.b = b; $f.err = err; $f.f = f; $f.fd = fd; $f.i = i; $f.i$1 = i$1; $f.ifi = ifi; $f.ifma = ifma; $f.ifmat = ifmat; $f.l = l; $f.name = name; $f.ok = ok; $f.path = path; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; parseProcNetIGMP6 = function(path, ifi) { var $24r, $24r$1, _q, _r$10, _r$11, _r$12, _r$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, b, err, f, fd, i, ifi, ifma, ifmat, l, ok, path, x, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _q = $f._q; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; b = $f.b; err = $f.err; f = $f.f; fd = $f.fd; i = $f.i; ifi = $f.ifi; ifma = $f.ifma; ifmat = $f.ifmat; l = $f.l; ok = $f.ok; path = $f.path; x = $f.x; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); _r$9 = open(path); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; fd = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $24r = sliceType$13.nil; $s = 4; case 4: return $24r; /* } */ case 3: $deferred.push([$methodVal(fd, "close"), []]); ifmat = sliceType$13.nil; b = $makeSlice(sliceType$1, 16); _r$10 = fd.readLine(); /* */ $s = 5; case 5: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$1 = _r$10; l = _tuple$1[0]; ok = _tuple$1[1]; /* while (true) { */ case 6: /* if (!(ok)) { break; } */ if(!(ok)) { $s = 7; continue; } f = splitAtBytes(l, " \r\t\n"); /* */ if (f.$length < 6) { $s = 8; continue; } /* */ $s = 9; continue; /* if (f.$length < 6) { */ case 8: _r$11 = fd.readLine(); /* */ $s = 10; case 10: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tuple$2 = _r$11; l = _tuple$2[0]; ok = _tuple$2[1]; /* continue; */ $s = 6; continue; /* } */ case 9: if (ifi === ptrType$18.nil || (1 >= f.$length ? ($throwRuntimeError("index out of range"), undefined) : f.$array[f.$offset + 1]) === ifi.Name) { i = 0; while (true) { if (!((i + 1 >> 0) < (2 >= f.$length ? ($throwRuntimeError("index out of range"), undefined) : f.$array[f.$offset + 2]).length)) { break; } _tuple$3 = xtoi2($substring((2 >= f.$length ? ($throwRuntimeError("index out of range"), undefined) : f.$array[f.$offset + 2]), i, (i + 2 >> 0)), 0); (x = (_q = i / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")), ((x < 0 || x >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + x] = _tuple$3[0])); i = i + (2) >> 0; } ifma = new IPAddr.ptr(new IP([(0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]), (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]), (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]), (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]), (4 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 4]), (5 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 5]), (6 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 6]), (7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7]), (8 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 8]), (9 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 9]), (10 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 10]), (11 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 11]), (12 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 12]), (13 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 13]), (14 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 14]), (15 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 15])]), ""); ifmat = $append(ifmat, ifma); } _r$12 = fd.readLine(); /* */ $s = 11; case 11: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _tuple$4 = _r$12; l = _tuple$4[0]; ok = _tuple$4[1]; $s = 6; continue; case 7: $24r$1 = ifmat; $s = 12; case 12: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return sliceType$13.nil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: parseProcNetIGMP6 }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._q = _q; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f.b = b; $f.err = err; $f.f = f; $f.fd = fd; $f.i = i; $f.ifi = ifi; $f.ifma = ifma; $f.ifmat = ifmat; $f.l = l; $f.ok = ok; $f.path = path; $f.x = x; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Flags.prototype.String = function() { var _i, _ref, f, i, name, s, y; f = this.$val; s = ""; _ref = flagNames; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; name = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (!((((f & (((y = ((i >>> 0)), y < 32 ? (1 << y) : 0) >>> 0))) >>> 0) === 0))) { if (!(s === "")) { s = s + ("|"); } s = s + (name); } _i++; } if (s === "") { s = "0"; } return s; }; $ptrType(Flags).prototype.String = function() { return new Flags(this.$get()).String(); }; Interface.ptr.prototype.Addrs = function() { var _r$9, _tuple, err, ifat, ifi, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tuple = $f._tuple; err = $f.err; ifat = $f.ifat; ifi = $f.ifi; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ifi = this; if (ifi === ptrType$18.nil) { $s = -1; return [sliceType$13.nil, new OpError.ptr("route", "ip+net", $ifaceNil, $ifaceNil, errInvalidInterface)]; } _r$9 = interfaceAddrTable(ifi); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; ifat = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { err = new OpError.ptr("route", "ip+net", $ifaceNil, $ifaceNil, err); } $s = -1; return [ifat, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Interface.ptr.prototype.Addrs }; } $f._r$9 = _r$9; $f._tuple = _tuple; $f.err = err; $f.ifat = ifat; $f.ifi = ifi; $f.$s = $s; $f.$r = $r; return $f; }; Interface.prototype.Addrs = function() { return this.$val.Addrs(); }; Interface.ptr.prototype.MulticastAddrs = function() { var _r$9, _tuple, err, ifat, ifi, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tuple = $f._tuple; err = $f.err; ifat = $f.ifat; ifi = $f.ifi; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ifi = this; if (ifi === ptrType$18.nil) { $s = -1; return [sliceType$13.nil, new OpError.ptr("route", "ip+net", $ifaceNil, $ifaceNil, errInvalidInterface)]; } _r$9 = interfaceMulticastAddrTable(ifi); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; ifat = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { err = new OpError.ptr("route", "ip+net", $ifaceNil, $ifaceNil, err); } $s = -1; return [ifat, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Interface.ptr.prototype.MulticastAddrs }; } $f._r$9 = _r$9; $f._tuple = _tuple; $f.err = err; $f.ifat = ifat; $f.ifi = ifi; $f.$s = $s; $f.$r = $r; return $f; }; Interface.prototype.MulticastAddrs = function() { return this.$val.MulticastAddrs(); }; interfaceByIndex = function(ift, index) { var _i, _ref, ifi, ift, index; _ref = ift; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } ifi = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), Interface); if (index === ifi.Index) { return [ifi, $ifaceNil]; } _i++; } return [ptrType$18.nil, errNoSuchInterface]; }; ipv6ZoneCache.ptr.prototype.update = function(ift, force) { var $24r, $24r$1, $24r$2, _entry, _i, _key, _key$1, _r$10, _r$9, _ref, _tuple, _tuple$1, err, force, ifi, ift, now, ok, updated, x, x$1, zc, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _entry = $f._entry; _i = $f._i; _key = $f._key; _key$1 = $f._key$1; _r$10 = $f._r$10; _r$9 = $f._r$9; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; err = $f.err; force = $f.force; ifi = $f.ifi; ift = $f.ift; now = $f.now; ok = $f.ok; updated = $f.updated; x = $f.x; x$1 = $f.x$1; zc = $f.zc; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); updated = false; zc = this; $r = zc.RWMutex.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(zc.RWMutex, "Unlock"), []]); _r$9 = time.Now(); /* */ $s = 2; case 2: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } now = $clone(_r$9, time.Time); /* */ if (!force && $clone(zc.lastFetched, time.Time).After($clone($clone(now, time.Time).Add(new time.Duration(-14, 129542144)), time.Time))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!force && $clone(zc.lastFetched, time.Time).After($clone($clone(now, time.Time).Add(new time.Duration(-14, 129542144)), time.Time))) { */ case 3: updated = false; $24r = updated; $s = 5; case 5: return $24r; /* } */ case 4: time.Time.copy(zc.lastFetched, now); /* */ if (ift.$length === 0) { $s = 6; continue; } /* */ $s = 7; continue; /* if (ift.$length === 0) { */ case 6: err = $ifaceNil; _r$10 = interfaceTable(0); /* */ $s = 8; case 8: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple = _r$10; ift = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 9; continue; } /* */ $s = 10; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 9: updated = false; $24r$1 = updated; $s = 11; case 11: return $24r$1; /* } */ case 10: /* } */ case 7: zc.toIndex = (x = ift.$length, ((x < 0 || x > 2147483647) ? $throwRuntimeError("makemap: size out of range") : {})); zc.toName = (x$1 = ift.$length, ((x$1 < 0 || x$1 > 2147483647) ? $throwRuntimeError("makemap: size out of range") : {})); _ref = ift; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } ifi = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), Interface); _key = ifi.Name; (zc.toIndex || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: ifi.Index }; _tuple$1 = (_entry = zc.toName[$Int.keyFor(ifi.Index)], _entry !== undefined ? [_entry.v, true] : ["", false]); ok = _tuple$1[1]; if (!ok) { _key$1 = ifi.Index; (zc.toName || $throwRuntimeError("assignment to entry in nil map"))[$Int.keyFor(_key$1)] = { k: _key$1, v: ifi.Name }; } _i++; } updated = true; $24r$2 = updated; $s = 12; case 12: return $24r$2; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return updated; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: ipv6ZoneCache.ptr.prototype.update }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._entry = _entry; $f._i = _i; $f._key = _key; $f._key$1 = _key$1; $f._r$10 = _r$10; $f._r$9 = _r$9; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.err = err; $f.force = force; $f.ifi = ifi; $f.ift = ift; $f.now = now; $f.ok = ok; $f.updated = updated; $f.x = x; $f.x$1 = x$1; $f.zc = zc; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; ipv6ZoneCache.prototype.update = function(ift, force) { return this.$val.update(ift, force); }; ipv6ZoneCache.ptr.prototype.name = function(index) { var _entry, _entry$1, _r$10, _r$9, _tuple, _tuple$1, index, name, ok, updated, zc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _r$10 = $f._r$10; _r$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; index = $f.index; name = $f.name; ok = $f.ok; updated = $f.updated; zc = $f.zc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: zc = this; if (index === 0) { $s = -1; return ""; } _r$9 = zoneCache.update(sliceType$12.nil, false); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } updated = _r$9; $r = zoneCache.RWMutex.RLock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tuple = (_entry = zoneCache.toName[$Int.keyFor(index)], _entry !== undefined ? [_entry.v, true] : ["", false]); name = _tuple[0]; ok = _tuple[1]; $r = zoneCache.RWMutex.RUnlock(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!ok && !updated) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!ok && !updated) { */ case 4: _r$10 = zoneCache.update(sliceType$12.nil, true); /* */ $s = 6; case 6: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; $r = zoneCache.RWMutex.RLock(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tuple$1 = (_entry$1 = zoneCache.toName[$Int.keyFor(index)], _entry$1 !== undefined ? [_entry$1.v, true] : ["", false]); name = _tuple$1[0]; ok = _tuple$1[1]; $r = zoneCache.RWMutex.RUnlock(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: if (!ok) { name = itoa.Uitoa(((index >>> 0))); } $s = -1; return name; /* */ } return; } if ($f === undefined) { $f = { $blk: ipv6ZoneCache.ptr.prototype.name }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._r$10 = _r$10; $f._r$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.index = index; $f.name = name; $f.ok = ok; $f.updated = updated; $f.zc = zc; $f.$s = $s; $f.$r = $r; return $f; }; ipv6ZoneCache.prototype.name = function(index) { return this.$val.name(index); }; ipv6ZoneCache.ptr.prototype.index = function(name) { var _entry, _entry$1, _r$10, _r$9, _tuple, _tuple$1, _tuple$2, index, name, ok, updated, zc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _r$10 = $f._r$10; _r$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; index = $f.index; name = $f.name; ok = $f.ok; updated = $f.updated; zc = $f.zc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: zc = this; if (name === "") { $s = -1; return 0; } _r$9 = zoneCache.update(sliceType$12.nil, false); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } updated = _r$9; $r = zoneCache.RWMutex.RLock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tuple = (_entry = zoneCache.toIndex[$String.keyFor(name)], _entry !== undefined ? [_entry.v, true] : [0, false]); index = _tuple[0]; ok = _tuple[1]; $r = zoneCache.RWMutex.RUnlock(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!ok && !updated) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!ok && !updated) { */ case 4: _r$10 = zoneCache.update(sliceType$12.nil, true); /* */ $s = 6; case 6: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; $r = zoneCache.RWMutex.RLock(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tuple$1 = (_entry$1 = zoneCache.toIndex[$String.keyFor(name)], _entry$1 !== undefined ? [_entry$1.v, true] : [0, false]); index = _tuple$1[0]; ok = _tuple$1[1]; $r = zoneCache.RWMutex.RUnlock(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: if (!ok) { _tuple$2 = dtoi(name); index = _tuple$2[0]; } $s = -1; return index; /* */ } return; } if ($f === undefined) { $f = { $blk: ipv6ZoneCache.ptr.prototype.index }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._r$10 = _r$10; $f._r$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.index = index; $f.name = name; $f.ok = ok; $f.updated = updated; $f.zc = zc; $f.$s = $s; $f.$r = $r; return $f; }; ipv6ZoneCache.prototype.index = function(name) { return this.$val.index(name); }; parseLiteralIP = function(addr) { var _tuple, addr, ip, zone; ip = IP.nil; zone = ""; ip = parseIPv4(addr); if (ip === IP.nil) { _tuple = parseIPv6Zone(addr); ip = _tuple[0]; zone = _tuple[1]; } if (ip === IP.nil) { return ""; } if (zone === "") { return ip.String(); } return ip.String() + "%" + zone; }; readHosts = function() { var _entry, _entry$1, _key, _key$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, addr, err, f, file$1, h, hp, hs, i, i$1, is, key, line, mtime, name, now, ok, size, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _key = $f._key; _key$1 = $f._key$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$9 = $f._r$9; _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; addr = $f.addr; err = $f.err; f = $f.f; file$1 = $f.file$1; h = $f.h; hp = $f.hp; hs = $f.hs; i = $f.i; i$1 = $f.i$1; is = $f.is; key = $f.key; line = $f.line; mtime = $f.mtime; name = $f.name; now = $f.now; ok = $f.ok; size = $f.size; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$9 = time.Now(); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } now = $clone(_r$9, time.Time); hp = testHookHostsPath; if ($clone(now, time.Time).Before($clone(hosts.expire, time.Time)) && hosts.path === hp && $keys(hosts.byName).length > 0) { $s = -1; return; } _r$10 = stat(hp); /* */ $s = 2; case 2: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple = _r$10; mtime = $clone(_tuple[0], time.Time); size = _tuple[1]; err = _tuple[2]; if ($interfaceIsEqual(err, $ifaceNil) && hosts.path === hp && $clone(hosts.mtime, time.Time).Equal($clone(mtime, time.Time)) && (x = hosts.size, (x.$high === size.$high && x.$low === size.$low))) { time.Time.copy(hosts.expire, $clone(now, time.Time).Add(new time.Duration(1, 705032704))); $s = -1; return; } hs = {}; is = {}; file$1 = ptrType$28.nil; _r$11 = open(hp); /* */ $s = 3; case 3: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tuple$1 = _r$11; file$1 = _tuple$1[0]; if (file$1 === ptrType$28.nil) { $s = -1; return; } _r$12 = file$1.readLine(); /* */ $s = 4; case 4: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _tuple$2 = _r$12; line = _tuple$2[0]; ok = _tuple$2[1]; /* while (true) { */ case 5: /* if (!(ok)) { break; } */ if(!(ok)) { $s = 6; continue; } i = bytealg.IndexByteString(line, 35); if (i >= 0) { line = $substring(line, 0, i); } f = getFields(line); /* */ if (f.$length < 2) { $s = 7; continue; } /* */ $s = 8; continue; /* if (f.$length < 2) { */ case 7: _r$13 = file$1.readLine(); /* */ $s = 9; case 9: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _tuple$3 = _r$13; line = _tuple$3[0]; ok = _tuple$3[1]; /* continue; */ $s = 5; continue; /* } */ case 8: addr = parseLiteralIP((0 >= f.$length ? ($throwRuntimeError("index out of range"), undefined) : f.$array[f.$offset + 0])); /* */ if (addr === "") { $s = 10; continue; } /* */ $s = 11; continue; /* if (addr === "") { */ case 10: _r$14 = file$1.readLine(); /* */ $s = 12; case 12: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _tuple$4 = _r$14; line = _tuple$4[0]; ok = _tuple$4[1]; /* continue; */ $s = 5; continue; /* } */ case 11: i$1 = 1; while (true) { if (!(i$1 < f.$length)) { break; } name = absDomainName((new sliceType$1($stringToBytes(((i$1 < 0 || i$1 >= f.$length) ? ($throwRuntimeError("index out of range"), undefined) : f.$array[f.$offset + i$1]))))); h = (new sliceType$1($stringToBytes(((i$1 < 0 || i$1 >= f.$length) ? ($throwRuntimeError("index out of range"), undefined) : f.$array[f.$offset + i$1])))); lowerASCIIBytes(h); key = absDomainName(h); _key = key; (hs || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: $append((_entry = hs[$String.keyFor(key)], _entry !== undefined ? _entry.v : sliceType.nil), addr) }; _key$1 = addr; (is || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key$1)] = { k: _key$1, v: $append((_entry$1 = is[$String.keyFor(addr)], _entry$1 !== undefined ? _entry$1.v : sliceType.nil), name) }; i$1 = i$1 + (1) >> 0; } _r$15 = file$1.readLine(); /* */ $s = 13; case 13: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _tuple$5 = _r$15; line = _tuple$5[0]; ok = _tuple$5[1]; $s = 5; continue; case 6: time.Time.copy(hosts.expire, $clone(now, time.Time).Add(new time.Duration(1, 705032704))); hosts.path = hp; hosts.byName = hs; hosts.byAddr = is; time.Time.copy(hosts.mtime, mtime); hosts.size = size; $r = file$1.close(); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: readHosts }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._key = _key; $f._key$1 = _key$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$9 = _r$9; $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.addr = addr; $f.err = err; $f.f = f; $f.file$1 = file$1; $f.h = h; $f.hp = hp; $f.hs = hs; $f.i = i; $f.i$1 = i$1; $f.is = is; $f.key = key; $f.line = line; $f.mtime = mtime; $f.name = name; $f.now = now; $f.ok = ok; $f.size = size; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; lookupStaticHost = function(host) { var $24r, $24r$1, _entry, _tuple, host, ips, ipsCp, lowerHost, ok, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _entry = $f._entry; _tuple = $f._tuple; host = $f.host; ips = $f.ips; ipsCp = $f.ipsCp; lowerHost = $f.lowerHost; ok = $f.ok; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); $r = hosts.Mutex.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(hosts.Mutex, "Unlock"), []]); $r = readHosts(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!(($keys(hosts.byName).length === 0))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!(($keys(hosts.byName).length === 0))) { */ case 3: lowerHost = (new sliceType$1($stringToBytes(host))); lowerASCIIBytes(lowerHost); _tuple = (_entry = hosts.byName[$String.keyFor(absDomainName(lowerHost))], _entry !== undefined ? [_entry.v, true] : [sliceType.nil, false]); ips = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 5; continue; } /* */ $s = 6; continue; /* if (ok) { */ case 5: ipsCp = $makeSlice(sliceType, ips.$length); $copySlice(ipsCp, ips); $24r = ipsCp; $s = 7; case 7: return $24r; /* } */ case 6: /* } */ case 4: $24r$1 = sliceType.nil; $s = 8; case 8: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return sliceType.nil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: lookupStaticHost }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._entry = _entry; $f._tuple = _tuple; $f.host = host; $f.ips = ips; $f.ipsCp = ipsCp; $f.lowerHost = lowerHost; $f.ok = ok; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; lookupStaticAddr = function(addr) { var $24r, $24r$1, $24r$2, _entry, _tuple, addr, hosts$1, hostsCp, ok, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _entry = $f._entry; _tuple = $f._tuple; addr = $f.addr; hosts$1 = $f.hosts$1; hostsCp = $f.hostsCp; ok = $f.ok; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); $r = hosts.Mutex.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(hosts.Mutex, "Unlock"), []]); $r = readHosts(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } addr = parseLiteralIP(addr); /* */ if (addr === "") { $s = 3; continue; } /* */ $s = 4; continue; /* if (addr === "") { */ case 3: $24r = sliceType.nil; $s = 5; case 5: return $24r; /* } */ case 4: /* */ if (!(($keys(hosts.byAddr).length === 0))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!(($keys(hosts.byAddr).length === 0))) { */ case 6: _tuple = (_entry = hosts.byAddr[$String.keyFor(addr)], _entry !== undefined ? [_entry.v, true] : [sliceType.nil, false]); hosts$1 = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 8; continue; } /* */ $s = 9; continue; /* if (ok) { */ case 8: hostsCp = $makeSlice(sliceType, hosts$1.$length); $copySlice(hostsCp, hosts$1); $24r$1 = hostsCp; $s = 10; case 10: return $24r$1; /* } */ case 9: /* } */ case 7: $24r$2 = sliceType.nil; $s = 11; case 11: return $24r$2; /* */ } return; } } catch(err) { $err = err; $s = -1; return sliceType.nil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: lookupStaticAddr }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._entry = _entry; $f._tuple = _tuple; $f.addr = addr; $f.hosts$1 = hosts$1; $f.hostsCp = hostsCp; $f.ok = ok; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Listen = function(net, laddr) { var laddr, net; $panic(errors.New("network access is not supported by GopherJS")); }; $pkg.Listen = Listen; Dialer.ptr.prototype.Dial = function(network, address) { var address, d, network; d = this; $panic(errors.New("network access is not supported by GopherJS")); }; Dialer.prototype.Dial = function(network, address) { return this.$val.Dial(network, address); }; maxListenerBacklog = function() { return 128; }; newFD = function(sysfd, family, sotype, net) { var family, net, ret, sotype, sysfd; ret = new netFD.ptr(new poll.FD.ptr(new poll.fdMutex.ptr(new $Uint64(0, 0), 0, 0), sysfd, new poll.pollDesc.ptr(false), ptrType$39.nil, 0, 0, sotype === 1, !((sotype === 2)) && !((sotype === 3)), false), family, sotype, false, net, $ifaceNil, $ifaceNil); return [ret, $ifaceNil]; }; netFD.ptr.prototype.init = function() { var fd; fd = this; return fd.pfd.Init(fd.net, true); }; netFD.prototype.init = function() { return this.$val.init(); }; netFD.ptr.prototype.name = function() { var _r$10, _r$9, _tmp, _tmp$1, fd, ls, rs, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$10 = $f._r$10; _r$9 = $f._r$9; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; fd = $f.fd; ls = $f.ls; rs = $f.rs; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = this; _tmp = ""; _tmp$1 = ""; ls = _tmp; rs = _tmp$1; /* */ if (!($interfaceIsEqual(fd.laddr, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(fd.laddr, $ifaceNil))) { */ case 1: _r$9 = fd.laddr.String(); /* */ $s = 3; case 3: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } ls = _r$9; /* } */ case 2: /* */ if (!($interfaceIsEqual(fd.raddr, $ifaceNil))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!($interfaceIsEqual(fd.raddr, $ifaceNil))) { */ case 4: _r$10 = fd.raddr.String(); /* */ $s = 6; case 6: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } rs = _r$10; /* } */ case 5: $s = -1; return fd.net + ":" + ls + "->" + rs; /* */ } return; } if ($f === undefined) { $f = { $blk: netFD.ptr.prototype.name }; } $f._r$10 = _r$10; $f._r$9 = _r$9; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.fd = fd; $f.ls = ls; $f.rs = rs; $f.$s = $s; $f.$r = $r; return $f; }; netFD.prototype.name = function() { return this.$val.name(); }; netFD.ptr.prototype.connect = function(ctx, la, ra) { var $24r, $24r$1, $24r$10, $24r$11, $24r$12, $24r$2, $24r$3, $24r$4, $24r$5, $24r$6, $24r$7, $24r$8, $24r$9, _1, _2, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$9, _selection, _selection$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$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, ctx, deadline, done, err, err$1, err$2, err$3, err$4, err$5, err$6, fd, hasDeadline, interruptRes, la, nerr, ra, ret, rsa, rsa$1, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$10 = $f.$24r$10; $24r$11 = $f.$24r$11; $24r$12 = $f.$24r$12; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; $24r$6 = $f.$24r$6; $24r$7 = $f.$24r$7; $24r$8 = $f.$24r$8; $24r$9 = $f.$24r$9; _1 = $f._1; _2 = $f._2; _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$9 = $f._r$9; _selection = $f._selection; _selection$1 = $f._selection$1; _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$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _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 = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; ctx = $f.ctx; deadline = $f.deadline; done = $f.done; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; err$4 = $f.err$4; err$5 = $f.err$5; err$6 = $f.err$6; fd = $f.fd; hasDeadline = $f.hasDeadline; interruptRes = $f.interruptRes; la = $f.la; nerr = $f.nerr; ra = $f.ra; ret = $f.ret; rsa = $f.rsa; rsa$1 = $f.rsa$1; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); ctx = [ctx]; done = [done]; fd = [fd]; interruptRes = [interruptRes]; ret = [ret]; rsa = $ifaceNil; ret[0] = $ifaceNil; fd[0] = this; _r$9 = connectFunc(fd[0].pfd.Sysfd, ra); /* */ $s = 2; case 2: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err = _r$9; _1 = err; /* */ if ($interfaceIsEqual(_1, new syscall.Errno((115))) || $interfaceIsEqual(_1, new syscall.Errno((114))) || $interfaceIsEqual(_1, new syscall.Errno((4)))) { $s = 3; continue; } /* */ if ($interfaceIsEqual(_1, $ifaceNil) || $interfaceIsEqual(_1, new syscall.Errno((106)))) { $s = 4; continue; } /* */ if ($interfaceIsEqual(_1, new syscall.Errno((22)))) { $s = 5; continue; } /* */ $s = 6; continue; /* if ($interfaceIsEqual(_1, new syscall.Errno((115))) || $interfaceIsEqual(_1, new syscall.Errno((114))) || $interfaceIsEqual(_1, new syscall.Errno((4)))) { */ case 3: $s = 7; continue; /* } else if ($interfaceIsEqual(_1, $ifaceNil) || $interfaceIsEqual(_1, new syscall.Errno((106)))) { */ case 4: _r$10 = ctx[0].Done(); /* */ $s = 8; case 8: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _selection = $select([[_r$10], []]); /* */ if (_selection[0] === 0) { $s = 9; continue; } /* */ if (_selection[0] === 1) { $s = 10; continue; } /* */ $s = 11; continue; /* if (_selection[0] === 0) { */ case 9: _tmp = $ifaceNil; _r$11 = ctx[0].Err(); /* */ $s = 12; case 12: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _r$12 = mapErr(_r$11); /* */ $s = 13; case 13: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _tmp$1 = _r$12; rsa = _tmp; ret[0] = _tmp$1; $24r = [rsa, ret[0]]; $s = 14; case 14: return $24r; /* } else if (_selection[0] === 1) { */ case 10: /* } */ case 11: err$1 = fd[0].pfd.Init(fd[0].net, true); /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 15; continue; } /* */ $s = 16; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 15: _tmp$2 = $ifaceNil; _tmp$3 = err$1; rsa = _tmp$2; ret[0] = _tmp$3; $24r$1 = [rsa, ret[0]]; $s = 17; case 17: return $24r$1; /* } */ case 16: runtime.KeepAlive(fd[0]); _tmp$4 = $ifaceNil; _tmp$5 = $ifaceNil; rsa = _tmp$4; ret[0] = _tmp$5; $24r$2 = [rsa, ret[0]]; $s = 18; case 18: return $24r$2; /* } else if ($interfaceIsEqual(_1, new syscall.Errno((22)))) { */ case 5: /* */ if (false) { $s = 19; continue; } /* */ $s = 20; continue; /* if (false) { */ case 19: _tmp$6 = $ifaceNil; _tmp$7 = $ifaceNil; rsa = _tmp$6; ret[0] = _tmp$7; $24r$3 = [rsa, ret[0]]; $s = 21; case 21: return $24r$3; /* } */ case 20: _tmp$8 = $ifaceNil; _tmp$9 = os.NewSyscallError("connect", err); rsa = _tmp$8; ret[0] = _tmp$9; $24r$4 = [rsa, ret[0]]; $s = 22; case 22: return $24r$4; /* } else { */ case 6: _tmp$10 = $ifaceNil; _tmp$11 = os.NewSyscallError("connect", err); rsa = _tmp$10; ret[0] = _tmp$11; $24r$5 = [rsa, ret[0]]; $s = 23; case 23: return $24r$5; /* } */ case 7: case 1: err$2 = fd[0].pfd.Init(fd[0].net, true); /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 24; continue; } /* */ $s = 25; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 24: _tmp$12 = $ifaceNil; _tmp$13 = err$2; rsa = _tmp$12; ret[0] = _tmp$13; $24r$6 = [rsa, ret[0]]; $s = 26; case 26: return $24r$6; /* } */ case 25: _r$13 = ctx[0].Deadline(); /* */ $s = 27; case 27: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _tuple = _r$13; deadline = $clone(_tuple[0], time.Time); hasDeadline = _tuple[1]; if (hasDeadline) { fd[0].pfd.SetWriteDeadline($clone(deadline, time.Time)); $deferred.push([$methodVal(fd[0].pfd, "SetWriteDeadline"), [$clone(noDeadline, time.Time)]]); } /* */ if (!($interfaceIsEqual(ctx[0], context.Background()))) { $s = 28; continue; } /* */ $s = 29; continue; /* if (!($interfaceIsEqual(ctx[0], context.Background()))) { */ case 28: done[0] = new $Chan(structType$2, 0); interruptRes[0] = new $Chan($error, 0); $deferred.push([(function(ctx, done, fd, interruptRes, ret) { return function $b() { var _r$14, _r$15, ctxErr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$14 = $f._r$14; _r$15 = $f._r$15; ctxErr = $f.ctxErr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $close(done[0]); _r$14 = $recv(interruptRes[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } ctxErr = _r$14[0]; /* */ if (!($interfaceIsEqual(ctxErr, $ifaceNil)) && $interfaceIsEqual(ret[0], $ifaceNil)) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(ctxErr, $ifaceNil)) && $interfaceIsEqual(ret[0], $ifaceNil)) { */ case 2: ret[0] = mapErr(ctxErr); _r$15 = fd[0].Close(); /* */ $s = 4; case 4: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _r$15; /* } */ case 3: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$14 = _r$14; $f._r$15 = _r$15; $f.ctxErr = ctxErr; $f.$s = $s; $f.$r = $r; return $f; }; })(ctx, done, fd, interruptRes, ret), []]); $go((function(ctx, done, fd, interruptRes, ret) { return function $b() { var _r$14, _r$15, _r$16, _selection$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$14 = $f._r$14; _r$15 = $f._r$15; _r$16 = $f._r$16; _selection$1 = $f._selection$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$14 = ctx[0].Done(); /* */ $s = 1; case 1: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _r$15 = $select([[_r$14], [done[0]]]); /* */ $s = 2; case 2: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _selection$1 = _r$15; /* */ if (_selection$1[0] === 0) { $s = 3; continue; } /* */ if (_selection$1[0] === 1) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_selection$1[0] === 0) { */ case 3: fd[0].pfd.SetWriteDeadline($clone(aLongTimeAgo, time.Time)); $r = testHookCanceledDial(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$16 = ctx[0].Err(); /* */ $s = 7; case 7: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } $r = $send(interruptRes[0], _r$16); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 5; continue; /* } else if (_selection$1[0] === 1) { */ case 4: $r = $send(interruptRes[0], $ifaceNil); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$14 = _r$14; $f._r$15 = _r$15; $f._r$16 = _r$16; $f._selection$1 = _selection$1; $f.$s = $s; $f.$r = $r; return $f; }; })(ctx, done, fd, interruptRes, ret), []); /* } */ case 29: /* while (true) { */ case 30: err$3 = fd[0].pfd.WaitWrite(); /* */ if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = 32; continue; } /* */ $s = 33; continue; /* if (!($interfaceIsEqual(err$3, $ifaceNil))) { */ case 32: _r$14 = ctx[0].Done(); /* */ $s = 34; case 34: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _selection$1 = $select([[_r$14], []]); /* */ if (_selection$1[0] === 0) { $s = 35; continue; } /* */ if (_selection$1[0] === 1) { $s = 36; continue; } /* */ $s = 37; continue; /* if (_selection$1[0] === 0) { */ case 35: _tmp$14 = $ifaceNil; _r$15 = ctx[0].Err(); /* */ $s = 38; case 38: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _r$16 = mapErr(_r$15); /* */ $s = 39; case 39: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _tmp$15 = _r$16; rsa = _tmp$14; ret[0] = _tmp$15; $24r$7 = [rsa, ret[0]]; $s = 40; case 40: return $24r$7; /* } else if (_selection$1[0] === 1) { */ case 36: /* } */ case 37: _tmp$16 = $ifaceNil; _tmp$17 = err$3; rsa = _tmp$16; ret[0] = _tmp$17; $24r$8 = [rsa, ret[0]]; $s = 41; case 41: return $24r$8; /* } */ case 33: _r$17 = getsockoptIntFunc(fd[0].pfd.Sysfd, 1, 4); /* */ $s = 42; case 42: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } _tuple$1 = _r$17; nerr = _tuple$1[0]; err$4 = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err$4, $ifaceNil))) { $s = 43; continue; } /* */ $s = 44; continue; /* if (!($interfaceIsEqual(err$4, $ifaceNil))) { */ case 43: _tmp$18 = $ifaceNil; _tmp$19 = os.NewSyscallError("getsockopt", err$4); rsa = _tmp$18; ret[0] = _tmp$19; $24r$9 = [rsa, ret[0]]; $s = 45; case 45: return $24r$9; /* } */ case 44: err$5 = ((nerr >>> 0)); _2 = err$5; /* */ if ((_2 === (115)) || (_2 === (114)) || (_2 === (4))) { $s = 47; continue; } /* */ if (_2 === (106)) { $s = 48; continue; } /* */ if (_2 === (0)) { $s = 49; continue; } /* */ $s = 50; continue; /* if ((_2 === (115)) || (_2 === (114)) || (_2 === (4))) { */ case 47: $s = 51; continue; /* } else if (_2 === (106)) { */ case 48: _tmp$20 = $ifaceNil; _tmp$21 = $ifaceNil; rsa = _tmp$20; ret[0] = _tmp$21; $24r$10 = [rsa, ret[0]]; $s = 52; case 52: return $24r$10; /* } else if (_2 === (0)) { */ case 49: _r$18 = syscall.Getpeername(fd[0].pfd.Sysfd); /* */ $s = 53; case 53: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } _tuple$2 = _r$18; rsa$1 = _tuple$2[0]; err$6 = _tuple$2[1]; /* */ if ($interfaceIsEqual(err$6, $ifaceNil)) { $s = 54; continue; } /* */ $s = 55; continue; /* if ($interfaceIsEqual(err$6, $ifaceNil)) { */ case 54: _tmp$22 = rsa$1; _tmp$23 = $ifaceNil; rsa = _tmp$22; ret[0] = _tmp$23; $24r$11 = [rsa, ret[0]]; $s = 56; case 56: return $24r$11; /* } */ case 55: $s = 51; continue; /* } else { */ case 50: _tmp$24 = $ifaceNil; _tmp$25 = os.NewSyscallError("connect", new syscall.Errno(err$5)); rsa = _tmp$24; ret[0] = _tmp$25; $24r$12 = [rsa, ret[0]]; $s = 57; case 57: return $24r$12; /* } */ case 51: case 46: runtime.KeepAlive(fd[0]); $s = 30; continue; case 31: $s = -1; return [rsa, ret[0]]; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [rsa, ret[0]]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: netFD.ptr.prototype.connect }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$10 = $24r$10; $f.$24r$11 = $24r$11; $f.$24r$12 = $24r$12; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f.$24r$6 = $24r$6; $f.$24r$7 = $24r$7; $f.$24r$8 = $24r$8; $f.$24r$9 = $24r$9; $f._1 = _1; $f._2 = _2; $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$9 = _r$9; $f._selection = _selection; $f._selection$1 = _selection$1; $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$3 = _tmp$3; $f._tmp$4 = _tmp$4; $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 = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.ctx = ctx; $f.deadline = deadline; $f.done = done; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.err$4 = err$4; $f.err$5 = err$5; $f.err$6 = err$6; $f.fd = fd; $f.hasDeadline = hasDeadline; $f.interruptRes = interruptRes; $f.la = la; $f.nerr = nerr; $f.ra = ra; $f.ret = ret; $f.rsa = rsa; $f.rsa$1 = rsa$1; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; netFD.prototype.connect = function(ctx, la, ra) { return this.$val.connect(ctx, la, ra); }; netFD.ptr.prototype.dup = function() { var $24r, _arg, _arg$1, _r$10, _r$11, _r$9, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, call, err, f, fd, ns, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _arg = $f._arg; _arg$1 = $f._arg$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$9 = $f._r$9; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; call = $f.call; err = $f.err; f = $f.f; fd = $f.fd; ns = $f.ns; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = ptrType$11.nil; err = $ifaceNil; fd = this; _r$9 = fd.pfd.Dup(); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; ns = _tuple[0]; call = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { if (!(call === "")) { err = os.NewSyscallError(call, err); } _tmp = ptrType$11.nil; _tmp$1 = err; f = _tmp; err = _tmp$1; $s = -1; return [f, err]; } _arg = ((ns >>> 0)); _r$10 = fd.name(); /* */ $s = 2; case 2: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _arg$1 = _r$10; _r$11 = os.NewFile(_arg, _arg$1); /* */ $s = 3; case 3: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tmp$2 = _r$11; _tmp$3 = $ifaceNil; f = _tmp$2; err = _tmp$3; $24r = [f, err]; $s = 4; case 4: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: netFD.ptr.prototype.dup }; } $f.$24r = $24r; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$9 = _r$9; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f.call = call; $f.err = err; $f.f = f; $f.fd = fd; $f.ns = ns; $f.$s = $s; $f.$r = $r; return $f; }; netFD.prototype.dup = function() { return this.$val.dup(); }; netFD.ptr.prototype.setAddr = function(laddr, raddr) { var fd, laddr, raddr; fd = this; fd.laddr = laddr; fd.raddr = raddr; runtime.SetFinalizer(fd, new funcType$1($methodExpr(ptrType$7, "Close"))); }; netFD.prototype.setAddr = function(laddr, raddr) { return this.$val.setAddr(laddr, raddr); }; netFD.ptr.prototype.Close = function() { var $24r, _r$9, fd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$9 = $f._r$9; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = this; runtime.SetFinalizer(fd, $ifaceNil); _r$9 = fd.pfd.Close(); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $24r = _r$9; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: netFD.ptr.prototype.Close }; } $f.$24r = $24r; $f._r$9 = _r$9; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; }; netFD.prototype.Close = function() { return this.$val.Close(); }; netFD.ptr.prototype.shutdown = function(how) { var _r$9, err, fd, how, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; err = $f.err; fd = $f.fd; how = $f.how; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = this; _r$9 = fd.pfd.Shutdown(how); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err = _r$9; runtime.KeepAlive(fd); $s = -1; return wrapSyscallError("shutdown", err); /* */ } return; } if ($f === undefined) { $f = { $blk: netFD.ptr.prototype.shutdown }; } $f._r$9 = _r$9; $f.err = err; $f.fd = fd; $f.how = how; $f.$s = $s; $f.$r = $r; return $f; }; netFD.prototype.shutdown = function(how) { return this.$val.shutdown(how); }; netFD.ptr.prototype.closeRead = function() { var $24r, _r$9, fd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$9 = $f._r$9; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = this; _r$9 = fd.shutdown(0); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $24r = _r$9; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: netFD.ptr.prototype.closeRead }; } $f.$24r = $24r; $f._r$9 = _r$9; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; }; netFD.prototype.closeRead = function() { return this.$val.closeRead(); }; netFD.ptr.prototype.closeWrite = function() { var $24r, _r$9, fd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$9 = $f._r$9; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = this; _r$9 = fd.shutdown(1); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $24r = _r$9; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: netFD.ptr.prototype.closeWrite }; } $f.$24r = $24r; $f._r$9 = _r$9; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; }; netFD.prototype.closeWrite = function() { return this.$val.closeWrite(); }; netFD.ptr.prototype.Read = function(p) { var _r$9, _tmp, _tmp$1, _tuple, err, fd, n, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; err = $f.err; fd = $f.fd; n = $f.n; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; fd = this; _r$9 = fd.pfd.Read(p); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; err = _tuple[1]; runtime.KeepAlive(fd); _tmp = n; _tmp$1 = wrapSyscallError("read", err); n = _tmp; err = _tmp$1; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: netFD.ptr.prototype.Read }; } $f._r$9 = _r$9; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.err = err; $f.fd = fd; $f.n = n; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; netFD.prototype.Read = function(p) { return this.$val.Read(p); }; netFD.ptr.prototype.readFrom = function(p) { var _r$9, _tmp, _tmp$1, _tmp$2, _tuple, err, fd, n, p, sa, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tuple = $f._tuple; err = $f.err; fd = $f.fd; n = $f.n; p = $f.p; sa = $f.sa; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; sa = $ifaceNil; err = $ifaceNil; fd = this; _r$9 = fd.pfd.ReadFrom(p); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; sa = _tuple[1]; err = _tuple[2]; runtime.KeepAlive(fd); _tmp = n; _tmp$1 = sa; _tmp$2 = wrapSyscallError("recvfrom", err); n = _tmp; sa = _tmp$1; err = _tmp$2; $s = -1; return [n, sa, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: netFD.ptr.prototype.readFrom }; } $f._r$9 = _r$9; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tuple = _tuple; $f.err = err; $f.fd = fd; $f.n = n; $f.p = p; $f.sa = sa; $f.$s = $s; $f.$r = $r; return $f; }; netFD.prototype.readFrom = function(p) { return this.$val.readFrom(p); }; netFD.ptr.prototype.readMsg = function(p, oob, flags) { var _r$9, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tuple, err, fd, flags, n, oob, oobn, p, retflags, sa, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tuple = $f._tuple; err = $f.err; fd = $f.fd; flags = $f.flags; n = $f.n; oob = $f.oob; oobn = $f.oobn; p = $f.p; retflags = $f.retflags; sa = $f.sa; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; oobn = 0; retflags = 0; sa = $ifaceNil; err = $ifaceNil; fd = this; _r$9 = fd.pfd.ReadMsg(p, oob, flags); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; oobn = _tuple[1]; retflags = _tuple[2]; sa = _tuple[3]; err = _tuple[4]; runtime.KeepAlive(fd); _tmp = n; _tmp$1 = oobn; _tmp$2 = retflags; _tmp$3 = sa; _tmp$4 = wrapSyscallError("recvmsg", err); n = _tmp; oobn = _tmp$1; retflags = _tmp$2; sa = _tmp$3; err = _tmp$4; $s = -1; return [n, oobn, retflags, sa, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: netFD.ptr.prototype.readMsg }; } $f._r$9 = _r$9; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tuple = _tuple; $f.err = err; $f.fd = fd; $f.flags = flags; $f.n = n; $f.oob = oob; $f.oobn = oobn; $f.p = p; $f.retflags = retflags; $f.sa = sa; $f.$s = $s; $f.$r = $r; return $f; }; netFD.prototype.readMsg = function(p, oob, flags) { return this.$val.readMsg(p, oob, flags); }; netFD.ptr.prototype.Write = function(p) { var _r$9, _tmp, _tmp$1, _tuple, err, fd, nn, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; err = $f.err; fd = $f.fd; nn = $f.nn; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: nn = 0; err = $ifaceNil; fd = this; _r$9 = fd.pfd.Write(p); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; nn = _tuple[0]; err = _tuple[1]; runtime.KeepAlive(fd); _tmp = nn; _tmp$1 = wrapSyscallError("write", err); nn = _tmp; err = _tmp$1; $s = -1; return [nn, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: netFD.ptr.prototype.Write }; } $f._r$9 = _r$9; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.err = err; $f.fd = fd; $f.nn = nn; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; netFD.prototype.Write = function(p) { return this.$val.Write(p); }; netFD.ptr.prototype.writeTo = function(p, sa) { var _r$9, _tmp, _tmp$1, _tuple, err, fd, n, p, sa, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; err = $f.err; fd = $f.fd; n = $f.n; p = $f.p; sa = $f.sa; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; fd = this; _r$9 = fd.pfd.WriteTo(p, sa); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; err = _tuple[1]; runtime.KeepAlive(fd); _tmp = n; _tmp$1 = wrapSyscallError("sendto", err); n = _tmp; err = _tmp$1; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: netFD.ptr.prototype.writeTo }; } $f._r$9 = _r$9; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.err = err; $f.fd = fd; $f.n = n; $f.p = p; $f.sa = sa; $f.$s = $s; $f.$r = $r; return $f; }; netFD.prototype.writeTo = function(p, sa) { return this.$val.writeTo(p, sa); }; netFD.ptr.prototype.writeMsg = function(p, oob, sa) { var _r$9, _tmp, _tmp$1, _tmp$2, _tuple, err, fd, n, oob, oobn, p, sa, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tuple = $f._tuple; err = $f.err; fd = $f.fd; n = $f.n; oob = $f.oob; oobn = $f.oobn; p = $f.p; sa = $f.sa; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; oobn = 0; err = $ifaceNil; fd = this; _r$9 = fd.pfd.WriteMsg(p, oob, sa); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; n = _tuple[0]; oobn = _tuple[1]; err = _tuple[2]; runtime.KeepAlive(fd); _tmp = n; _tmp$1 = oobn; _tmp$2 = wrapSyscallError("sendmsg", err); n = _tmp; oobn = _tmp$1; err = _tmp$2; $s = -1; return [n, oobn, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: netFD.ptr.prototype.writeMsg }; } $f._r$9 = _r$9; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tuple = _tuple; $f.err = err; $f.fd = fd; $f.n = n; $f.oob = oob; $f.oobn = oobn; $f.p = p; $f.sa = sa; $f.$s = $s; $f.$r = $r; return $f; }; netFD.prototype.writeMsg = function(p, oob, sa) { return this.$val.writeMsg(p, oob, sa); }; netFD.ptr.prototype.SetDeadline = function(t) { var fd, t; fd = this; return fd.pfd.SetDeadline($clone(t, time.Time)); }; netFD.prototype.SetDeadline = function(t) { return this.$val.SetDeadline(t); }; netFD.ptr.prototype.SetReadDeadline = function(t) { var fd, t; fd = this; return fd.pfd.SetReadDeadline($clone(t, time.Time)); }; netFD.prototype.SetReadDeadline = function(t) { return this.$val.SetReadDeadline(t); }; netFD.ptr.prototype.SetWriteDeadline = function(t) { var fd, t; fd = this; return fd.pfd.SetWriteDeadline($clone(t, time.Time)); }; netFD.prototype.SetWriteDeadline = function(t) { return this.$val.SetWriteDeadline(t); }; isConnError = function(err) { var _tuple, err, ok, se; _tuple = $assertType(err, syscall.Errno, true); se = _tuple[0]; ok = _tuple[1]; if (ok) { return (se === 104) || (se === 103); } return false; }; wrapSyscallError = function(name, err) { var _tuple, err, name, ok; _tuple = $assertType(err, syscall.Errno, true); ok = _tuple[1]; if (ok) { err = os.NewSyscallError(name, err); } return err; }; dnsReadConfig = function(filename) { var $24r, $24r$1, $24r$2, _1, _i, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$9, _ref, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, _tuple$8, _tuple$9, conf$1, err, err$1, f, fi, file$1, filename, i, ip, line, n, n$1, n$2, ok, s, x, x$1, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _1 = $f._1; _i = $f._i; _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$9 = $f._r$9; _ref = $f._ref; _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; _tuple$8 = $f._tuple$8; _tuple$9 = $f._tuple$9; conf$1 = $f.conf$1; err = $f.err; err$1 = $f.err$1; f = $f.f; fi = $f.fi; file$1 = $f.file$1; filename = $f.filename; i = $f.i; ip = $f.ip; line = $f.line; n = $f.n; n$1 = $f.n$1; n$2 = $f.n$2; ok = $f.ok; s = $f.s; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); conf$1 = new dnsConfig.ptr(sliceType.nil, sliceType.nil, 1, new time.Duration(1, 705032704), 2, false, false, sliceType.nil, $ifaceNil, new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil), 0, false, false); _r$9 = open(filename); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; file$1 = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: conf$1.servers = defaultNS; _r$10 = dnsDefaultSearch(); /* */ $s = 4; case 4: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } conf$1.search = _r$10; conf$1.err = err; $24r = conf$1; $s = 5; case 5: return $24r; /* } */ case 3: $deferred.push([$methodVal(file$1, "close"), []]); _r$11 = file$1.file.Stat(); /* */ $s = 6; case 6: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tuple$1 = _r$11; fi = _tuple$1[0]; err$1 = _tuple$1[1]; /* */ if ($interfaceIsEqual(err$1, $ifaceNil)) { $s = 7; continue; } /* */ $s = 8; continue; /* if ($interfaceIsEqual(err$1, $ifaceNil)) { */ case 7: _r$12 = fi.ModTime(); /* */ $s = 10; case 10: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } time.Time.copy(conf$1.mtime, _r$12); $s = 9; continue; /* } else { */ case 8: conf$1.servers = defaultNS; _r$13 = dnsDefaultSearch(); /* */ $s = 11; case 11: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } conf$1.search = _r$13; conf$1.err = err$1; $24r$1 = conf$1; $s = 12; case 12: return $24r$1; /* } */ case 9: _r$14 = file$1.readLine(); /* */ $s = 13; case 13: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _tuple$2 = _r$14; line = _tuple$2[0]; ok = _tuple$2[1]; /* while (true) { */ case 14: /* if (!(ok)) { break; } */ if(!(ok)) { $s = 15; continue; } /* */ if (line.length > 0 && ((line.charCodeAt(0) === 59) || (line.charCodeAt(0) === 35))) { $s = 16; continue; } /* */ $s = 17; continue; /* if (line.length > 0 && ((line.charCodeAt(0) === 59) || (line.charCodeAt(0) === 35))) { */ case 16: _r$15 = file$1.readLine(); /* */ $s = 18; case 18: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _tuple$3 = _r$15; line = _tuple$3[0]; ok = _tuple$3[1]; /* continue; */ $s = 14; continue; /* } */ case 17: f = getFields(line); /* */ if (f.$length < 1) { $s = 19; continue; } /* */ $s = 20; continue; /* if (f.$length < 1) { */ case 19: _r$16 = file$1.readLine(); /* */ $s = 21; case 21: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _tuple$4 = _r$16; line = _tuple$4[0]; ok = _tuple$4[1]; /* continue; */ $s = 14; continue; /* } */ case 20: _1 = (0 >= f.$length ? ($throwRuntimeError("index out of range"), undefined) : f.$array[f.$offset + 0]); if (_1 === ("nameserver")) { if (f.$length > 1 && conf$1.servers.$length < 3) { if (!(parseIPv4((1 >= f.$length ? ($throwRuntimeError("index out of range"), undefined) : f.$array[f.$offset + 1])) === IP.nil)) { conf$1.servers = $append(conf$1.servers, JoinHostPort((1 >= f.$length ? ($throwRuntimeError("index out of range"), undefined) : f.$array[f.$offset + 1]), "53")); } else { _tuple$5 = parseIPv6Zone((1 >= f.$length ? ($throwRuntimeError("index out of range"), undefined) : f.$array[f.$offset + 1])); ip = _tuple$5[0]; if (!(ip === IP.nil)) { conf$1.servers = $append(conf$1.servers, JoinHostPort((1 >= f.$length ? ($throwRuntimeError("index out of range"), undefined) : f.$array[f.$offset + 1]), "53")); } } } } else if (_1 === ("domain")) { if (f.$length > 1) { conf$1.search = new sliceType([ensureRooted((1 >= f.$length ? ($throwRuntimeError("index out of range"), undefined) : f.$array[f.$offset + 1]))]); } } else if (_1 === ("search")) { conf$1.search = $makeSlice(sliceType, (f.$length - 1 >> 0)); i = 0; while (true) { if (!(i < conf$1.search.$length)) { break; } (x$1 = conf$1.search, ((i < 0 || i >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + i] = ensureRooted((x = i + 1 >> 0, ((x < 0 || x >= f.$length) ? ($throwRuntimeError("index out of range"), undefined) : f.$array[f.$offset + x]))))); i = i + (1) >> 0; } } else if (_1 === ("options")) { _ref = $subslice(f, 1); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } s = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (hasPrefix(s, "ndots:")) { _tuple$6 = dtoi($substring(s, 6)); n = _tuple$6[0]; if (n < 0) { n = 0; } else if (n > 15) { n = 15; } conf$1.ndots = n; } else if (hasPrefix(s, "timeout:")) { _tuple$7 = dtoi($substring(s, 8)); n$1 = _tuple$7[0]; if (n$1 < 1) { n$1 = 1; } conf$1.timeout = $mul64((new time.Duration(0, n$1)), new time.Duration(0, 1000000000)); } else if (hasPrefix(s, "attempts:")) { _tuple$8 = dtoi($substring(s, 9)); n$2 = _tuple$8[0]; if (n$2 < 1) { n$2 = 1; } conf$1.attempts = n$2; } else if (s === "rotate") { conf$1.rotate = true; } else if (s === "single-request" || s === "single-request-reopen") { conf$1.singleRequest = true; } else if (s === "use-vc" || s === "usevc" || s === "tcp") { conf$1.useTCP = true; } else { conf$1.unknownOpt = true; } _i++; } } else if (_1 === ("lookup")) { conf$1.lookup = $subslice(f, 1); } else { conf$1.unknownOpt = true; } _r$17 = file$1.readLine(); /* */ $s = 22; case 22: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } _tuple$9 = _r$17; line = _tuple$9[0]; ok = _tuple$9[1]; $s = 14; continue; case 15: if (conf$1.servers.$length === 0) { conf$1.servers = defaultNS; } /* */ if (conf$1.search.$length === 0) { $s = 23; continue; } /* */ $s = 24; continue; /* if (conf$1.search.$length === 0) { */ case 23: _r$18 = dnsDefaultSearch(); /* */ $s = 25; case 25: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } conf$1.search = _r$18; /* } */ case 24: $24r$2 = conf$1; $s = 26; case 26: return $24r$2; /* */ } return; } } catch(err) { $err = err; $s = -1; return ptrType$1.nil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: dnsReadConfig }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._1 = _1; $f._i = _i; $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$9 = _r$9; $f._ref = _ref; $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._tuple$8 = _tuple$8; $f._tuple$9 = _tuple$9; $f.conf$1 = conf$1; $f.err = err; $f.err$1 = err$1; $f.f = f; $f.fi = fi; $f.file$1 = file$1; $f.filename = filename; $f.i = i; $f.ip = ip; $f.line = line; $f.n = n; $f.n$1 = n$1; $f.n$2 = n$2; $f.ok = ok; $f.s = s; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; dnsConfig.ptr.prototype.serverOffset = function() { var c; c = this; if (c.rotate) { return atomic.AddUint32((c.$ptr_soffset || (c.$ptr_soffset = new ptrType$40(function() { return this.$target.soffset; }, function($v) { this.$target.soffset = $v; }, c))), 1) - 1 >>> 0; } return 0; }; dnsConfig.prototype.serverOffset = function() { return this.$val.serverOffset(); }; dnsDefaultSearch = function() { var _r$9, _tuple, err, hn, i, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tuple = $f._tuple; err = $f.err; hn = $f.hn; i = $f.i; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$9 = getHostname(); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; hn = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return sliceType.nil; } i = bytealg.IndexByteString(hn, 46); if (i >= 0 && i < (hn.length - 1 >> 0)) { $s = -1; return new sliceType([ensureRooted($substring(hn, (i + 1 >> 0)))]); } $s = -1; return sliceType.nil; /* */ } return; } if ($f === undefined) { $f = { $blk: dnsDefaultSearch }; } $f._r$9 = _r$9; $f._tuple = _tuple; $f.err = err; $f.hn = hn; $f.i = i; $f.$s = $s; $f.$r = $r; return $f; }; hasPrefix = function(s, prefix) { var prefix, s; return s.length >= prefix.length && $substring(s, 0, prefix.length) === prefix; }; ensureRooted = function(s) { var s; if (s.length > 0 && (s.charCodeAt((s.length - 1 >> 0)) === 46)) { return s; } return s + "."; }; newRequest = function(q) { var _r$9, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, b, err, err$1, err$2, id, l, q, tcpReq, udpReq, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$10 = $f._tmp$10; _tmp$11 = $f._tmp$11; _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; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; b = $f.b; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; id = $f.id; l = $f.l; q = $f.q; tcpReq = $f.tcpReq; udpReq = $f.udpReq; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: id = 0; udpReq = sliceType$1.nil; tcpReq = sliceType$1.nil; err = $ifaceNil; _r$9 = randInt(); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } id = ((_r$9 << 16 >>> 16)); b = $clone(dnsmessage.NewBuilder($makeSlice(sliceType$1, 2, 514), new dnsmessage.Header.ptr(id, false, 0, false, false, true, false, 0)), dnsmessage.Builder); b.EnableCompression(); err$1 = b.StartQuestions(); if (!($interfaceIsEqual(err$1, $ifaceNil))) { _tmp = 0; _tmp$1 = sliceType$1.nil; _tmp$2 = sliceType$1.nil; _tmp$3 = err$1; id = _tmp; udpReq = _tmp$1; tcpReq = _tmp$2; err = _tmp$3; $s = -1; return [id, udpReq, tcpReq, err]; } err$2 = b.Question($clone(q, dnsmessage.Question)); if (!($interfaceIsEqual(err$2, $ifaceNil))) { _tmp$4 = 0; _tmp$5 = sliceType$1.nil; _tmp$6 = sliceType$1.nil; _tmp$7 = err$2; id = _tmp$4; udpReq = _tmp$5; tcpReq = _tmp$6; err = _tmp$7; $s = -1; return [id, udpReq, tcpReq, err]; } _tuple = b.Finish(); tcpReq = _tuple[0]; err = _tuple[1]; udpReq = $subslice(tcpReq, 2); l = tcpReq.$length - 2 >> 0; (0 >= tcpReq.$length ? ($throwRuntimeError("index out of range"), undefined) : tcpReq.$array[tcpReq.$offset + 0] = (((l >> 8 >> 0) << 24 >>> 24))); (1 >= tcpReq.$length ? ($throwRuntimeError("index out of range"), undefined) : tcpReq.$array[tcpReq.$offset + 1] = ((l << 24 >>> 24))); _tmp$8 = id; _tmp$9 = udpReq; _tmp$10 = tcpReq; _tmp$11 = err; id = _tmp$8; udpReq = _tmp$9; tcpReq = _tmp$10; err = _tmp$11; $s = -1; return [id, udpReq, tcpReq, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: newRequest }; } $f._r$9 = _r$9; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$10 = _tmp$10; $f._tmp$11 = _tmp$11; $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._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.id = id; $f.l = l; $f.q = q; $f.tcpReq = tcpReq; $f.udpReq = udpReq; $f.$s = $s; $f.$r = $r; return $f; }; checkResponse = function(reqID, reqQues, respHdr, respQues) { var reqID, reqQues, respHdr, respQues; if (!respHdr.Response) { return false; } if (!((reqID === respHdr.ID))) { return false; } if (!((reqQues.Type === respQues.Type)) || !((reqQues.Class === respQues.Class)) || !equalASCIIName($clone(reqQues.Name, dnsmessage.Name), $clone(respQues.Name, dnsmessage.Name))) { return false; } return true; }; dnsPacketRoundTrip = function(c, id, query, b) { var _r$10, _r$9, _tuple, _tuple$1, _tuple$2, _tuple$3, b, c, err, err$1, h, id, n, p, q, query, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$10 = $f._r$10; _r$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; b = $f.b; c = $f.c; err = $f.err; err$1 = $f.err$1; h = $f.h; id = $f.id; n = $f.n; p = $f.p; q = $f.q; query = $f.query; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$9 = c.Write(b); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [new dnsmessage.Parser.ptr(sliceType$1.nil, new dnsmessage.header.ptr(0, 0, 0, 0, 0, 0), 0, 0, 0, false, new dnsmessage.ResourceHeader.ptr(new dnsmessage.Name.ptr(arrayType$6.zero(), 0), 0, 0, 0, 0)), new dnsmessage.Header.ptr(0, false, 0, false, false, false, false, 0), err]; } b = $makeSlice(sliceType$1, 512); /* while (true) { */ case 2: _r$10 = c.Read(b); /* */ $s = 4; case 4: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$1 = _r$10; n = _tuple$1[0]; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [new dnsmessage.Parser.ptr(sliceType$1.nil, new dnsmessage.header.ptr(0, 0, 0, 0, 0, 0), 0, 0, 0, false, new dnsmessage.ResourceHeader.ptr(new dnsmessage.Name.ptr(arrayType$6.zero(), 0), 0, 0, 0, 0)), new dnsmessage.Header.ptr(0, false, 0, false, false, false, false, 0), err$1]; } p = new dnsmessage.Parser.ptr(sliceType$1.nil, new dnsmessage.header.ptr(0, 0, 0, 0, 0, 0), 0, 0, 0, false, new dnsmessage.ResourceHeader.ptr(new dnsmessage.Name.ptr(arrayType$6.zero(), 0), 0, 0, 0, 0)); _tuple$2 = p.Start($subslice(b, 0, n)); h = $clone(_tuple$2[0], dnsmessage.Header); err$1 = _tuple$2[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { /* continue; */ $s = 2; continue; } _tuple$3 = p.Question(); q = $clone(_tuple$3[0], dnsmessage.Question); err$1 = _tuple$3[1]; if (!($interfaceIsEqual(err$1, $ifaceNil)) || !checkResponse(id, $clone(query, dnsmessage.Question), $clone(h, dnsmessage.Header), $clone(q, dnsmessage.Question))) { /* continue; */ $s = 2; continue; } $s = -1; return [p, h, $ifaceNil]; case 3: $s = -1; return [new dnsmessage.Parser.ptr(sliceType$1.nil, new dnsmessage.header.ptr(0, 0, 0, 0, 0, 0), 0, 0, 0, false, new dnsmessage.ResourceHeader.ptr(new dnsmessage.Name.ptr(arrayType$6.zero(), 0), 0, 0, 0, 0)), new dnsmessage.Header.ptr(0, false, 0, false, false, false, false, 0), $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: dnsPacketRoundTrip }; } $f._r$10 = _r$10; $f._r$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.b = b; $f.c = c; $f.err = err; $f.err$1 = err$1; $f.h = h; $f.id = id; $f.n = n; $f.p = p; $f.q = q; $f.query = query; $f.$s = $s; $f.$r = $r; return $f; }; dnsStreamRoundTrip = function(c, id, query, b) { var _r$10, _r$11, _r$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, b, c, err, err$1, err$2, h, id, l, n, p, q, query, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; b = $f.b; c = $f.c; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; h = $f.h; id = $f.id; l = $f.l; n = $f.n; p = $f.p; q = $f.q; query = $f.query; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$9 = c.Write(b); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [new dnsmessage.Parser.ptr(sliceType$1.nil, new dnsmessage.header.ptr(0, 0, 0, 0, 0, 0), 0, 0, 0, false, new dnsmessage.ResourceHeader.ptr(new dnsmessage.Name.ptr(arrayType$6.zero(), 0), 0, 0, 0, 0)), new dnsmessage.Header.ptr(0, false, 0, false, false, false, false, 0), err]; } b = $makeSlice(sliceType$1, 1280); _r$10 = io.ReadFull(c, $subslice(b, 0, 2)); /* */ $s = 2; case 2: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$1 = _r$10; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [new dnsmessage.Parser.ptr(sliceType$1.nil, new dnsmessage.header.ptr(0, 0, 0, 0, 0, 0), 0, 0, 0, false, new dnsmessage.ResourceHeader.ptr(new dnsmessage.Name.ptr(arrayType$6.zero(), 0), 0, 0, 0, 0)), new dnsmessage.Header.ptr(0, false, 0, false, false, false, false, 0), err$1]; } l = ((((0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]) >> 0)) << 8 >> 0) | (((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]) >> 0)); if (l > b.$length) { b = $makeSlice(sliceType$1, l); } _r$11 = io.ReadFull(c, $subslice(b, 0, l)); /* */ $s = 3; case 3: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tuple$2 = _r$11; n = _tuple$2[0]; err$2 = _tuple$2[1]; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return [new dnsmessage.Parser.ptr(sliceType$1.nil, new dnsmessage.header.ptr(0, 0, 0, 0, 0, 0), 0, 0, 0, false, new dnsmessage.ResourceHeader.ptr(new dnsmessage.Name.ptr(arrayType$6.zero(), 0), 0, 0, 0, 0)), new dnsmessage.Header.ptr(0, false, 0, false, false, false, false, 0), err$2]; } p = new dnsmessage.Parser.ptr(sliceType$1.nil, new dnsmessage.header.ptr(0, 0, 0, 0, 0, 0), 0, 0, 0, false, new dnsmessage.ResourceHeader.ptr(new dnsmessage.Name.ptr(arrayType$6.zero(), 0), 0, 0, 0, 0)); _tuple$3 = p.Start($subslice(b, 0, n)); h = $clone(_tuple$3[0], dnsmessage.Header); err$2 = _tuple$3[1]; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return [new dnsmessage.Parser.ptr(sliceType$1.nil, new dnsmessage.header.ptr(0, 0, 0, 0, 0, 0), 0, 0, 0, false, new dnsmessage.ResourceHeader.ptr(new dnsmessage.Name.ptr(arrayType$6.zero(), 0), 0, 0, 0, 0)), new dnsmessage.Header.ptr(0, false, 0, false, false, false, false, 0), errCannotUnmarshalDNSMessage]; } _tuple$4 = p.Question(); q = $clone(_tuple$4[0], dnsmessage.Question); err$2 = _tuple$4[1]; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return [new dnsmessage.Parser.ptr(sliceType$1.nil, new dnsmessage.header.ptr(0, 0, 0, 0, 0, 0), 0, 0, 0, false, new dnsmessage.ResourceHeader.ptr(new dnsmessage.Name.ptr(arrayType$6.zero(), 0), 0, 0, 0, 0)), new dnsmessage.Header.ptr(0, false, 0, false, false, false, false, 0), errCannotUnmarshalDNSMessage]; } if (!checkResponse(id, $clone(query, dnsmessage.Question), $clone(h, dnsmessage.Header), $clone(q, dnsmessage.Question))) { $s = -1; return [new dnsmessage.Parser.ptr(sliceType$1.nil, new dnsmessage.header.ptr(0, 0, 0, 0, 0, 0), 0, 0, 0, false, new dnsmessage.ResourceHeader.ptr(new dnsmessage.Name.ptr(arrayType$6.zero(), 0), 0, 0, 0, 0)), new dnsmessage.Header.ptr(0, false, 0, false, false, false, false, 0), errInvalidDNSResponse]; } $s = -1; return [p, h, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: dnsStreamRoundTrip }; } $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f.b = b; $f.c = c; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.h = h; $f.id = id; $f.l = l; $f.n = n; $f.p = p; $f.q = q; $f.query = query; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.ptr.prototype.exchange = function(ctx, server, q, timeout$1, useTCP) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, $24r$5, _arg, _arg$1, _i, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$9, _ref, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, c, cancel, ctx, ctx$1, d, err, err$1, err$2, h, id, network, networks, ok, ok$1, p, q, r, server, tcpReq, timeout$1, udpReq, useTCP, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; _arg = $f._arg; _arg$1 = $f._arg$1; _i = $f._i; _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$9 = $f._r$9; _ref = $f._ref; _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; c = $f.c; cancel = $f.cancel; ctx = $f.ctx; ctx$1 = $f.ctx$1; d = $f.d; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; h = $f.h; id = $f.id; network = $f.network; networks = $f.networks; ok = $f.ok; ok$1 = $f.ok$1; p = $f.p; q = $f.q; r = $f.r; server = $f.server; tcpReq = $f.tcpReq; timeout$1 = $f.timeout$1; udpReq = $f.udpReq; useTCP = $f.useTCP; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); r = this; q.Class = 1; _r$9 = newRequest($clone(q, dnsmessage.Question)); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; id = _tuple[0]; udpReq = _tuple[1]; tcpReq = _tuple[2]; err = _tuple[3]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $24r = [new dnsmessage.Parser.ptr(sliceType$1.nil, new dnsmessage.header.ptr(0, 0, 0, 0, 0, 0), 0, 0, 0, false, new dnsmessage.ResourceHeader.ptr(new dnsmessage.Name.ptr(arrayType$6.zero(), 0), 0, 0, 0, 0)), new dnsmessage.Header.ptr(0, false, 0, false, false, false, false, 0), errCannotMarshalDNSMessage]; $s = 4; case 4: return $24r; /* } */ case 3: networks = sliceType.nil; if (useTCP) { networks = new sliceType(["tcp"]); } else { networks = new sliceType(["udp", "tcp"]); } _ref = networks; _i = 0; /* while (true) { */ case 5: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 6; continue; } network = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _arg = ctx; _r$10 = time.Now(); /* */ $s = 7; case 7: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$11 = $clone(_r$10, time.Time).Add(timeout$1); /* */ $s = 8; case 8: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _arg$1 = $clone(_r$11, time.Time); _r$12 = context.WithDeadline(_arg, _arg$1); /* */ $s = 9; case 9: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _tuple$1 = _r$12; ctx$1 = _tuple$1[0]; cancel = _tuple$1[1]; $deferred.push([cancel, []]); _r$13 = r.dial(ctx$1, network, server); /* */ $s = 10; case 10: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _tuple$2 = _r$13; c = _tuple$2[0]; err$1 = _tuple$2[1]; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 11; continue; } /* */ $s = 12; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 11: $24r$1 = [new dnsmessage.Parser.ptr(sliceType$1.nil, new dnsmessage.header.ptr(0, 0, 0, 0, 0, 0), 0, 0, 0, false, new dnsmessage.ResourceHeader.ptr(new dnsmessage.Name.ptr(arrayType$6.zero(), 0), 0, 0, 0, 0)), new dnsmessage.Header.ptr(0, false, 0, false, false, false, false, 0), err$1]; $s = 13; case 13: return $24r$1; /* } */ case 12: _r$14 = ctx$1.Deadline(); /* */ $s = 14; case 14: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _tuple$3 = _r$14; d = $clone(_tuple$3[0], time.Time); ok = _tuple$3[1]; /* */ if (ok && !$clone(d, time.Time).IsZero()) { $s = 15; continue; } /* */ $s = 16; continue; /* if (ok && !$clone(d, time.Time).IsZero()) { */ case 15: _r$15 = c.SetDeadline($clone(d, time.Time)); /* */ $s = 17; case 17: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _r$15; /* } */ case 16: p = new dnsmessage.Parser.ptr(sliceType$1.nil, new dnsmessage.header.ptr(0, 0, 0, 0, 0, 0), 0, 0, 0, false, new dnsmessage.ResourceHeader.ptr(new dnsmessage.Name.ptr(arrayType$6.zero(), 0), 0, 0, 0, 0)); h = new dnsmessage.Header.ptr(0, false, 0, false, false, false, false, 0); _tuple$4 = $assertType(c, PacketConn, true); ok$1 = _tuple$4[1]; /* */ if (ok$1) { $s = 18; continue; } /* */ $s = 19; continue; /* if (ok$1) { */ case 18: _r$16 = dnsPacketRoundTrip(c, id, $clone(q, dnsmessage.Question), udpReq); /* */ $s = 21; case 21: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _tuple$5 = _r$16; dnsmessage.Parser.copy(p, _tuple$5[0]); dnsmessage.Header.copy(h, _tuple$5[1]); err$1 = _tuple$5[2]; $s = 20; continue; /* } else { */ case 19: _r$17 = dnsStreamRoundTrip(c, id, $clone(q, dnsmessage.Question), tcpReq); /* */ $s = 22; case 22: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } _tuple$6 = _r$17; dnsmessage.Parser.copy(p, _tuple$6[0]); dnsmessage.Header.copy(h, _tuple$6[1]); err$1 = _tuple$6[2]; /* } */ case 20: _r$18 = c.Close(); /* */ $s = 23; case 23: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } _r$18; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 24; continue; } /* */ $s = 25; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 24: $24r$2 = [new dnsmessage.Parser.ptr(sliceType$1.nil, new dnsmessage.header.ptr(0, 0, 0, 0, 0, 0), 0, 0, 0, false, new dnsmessage.ResourceHeader.ptr(new dnsmessage.Name.ptr(arrayType$6.zero(), 0), 0, 0, 0, 0)), new dnsmessage.Header.ptr(0, false, 0, false, false, false, false, 0), mapErr(err$1)]; $s = 26; case 26: return $24r$2; /* } */ case 25: err$2 = p.SkipQuestion(); /* */ if (!($interfaceIsEqual(err$2, dnsmessage.ErrSectionDone))) { $s = 27; continue; } /* */ $s = 28; continue; /* if (!($interfaceIsEqual(err$2, dnsmessage.ErrSectionDone))) { */ case 27: $24r$3 = [new dnsmessage.Parser.ptr(sliceType$1.nil, new dnsmessage.header.ptr(0, 0, 0, 0, 0, 0), 0, 0, 0, false, new dnsmessage.ResourceHeader.ptr(new dnsmessage.Name.ptr(arrayType$6.zero(), 0), 0, 0, 0, 0)), new dnsmessage.Header.ptr(0, false, 0, false, false, false, false, 0), errInvalidDNSResponse]; $s = 29; case 29: return $24r$3; /* } */ case 28: if (h.Truncated) { _i++; /* continue; */ $s = 5; continue; } $24r$4 = [p, h, $ifaceNil]; $s = 30; case 30: return $24r$4; case 6: $24r$5 = [new dnsmessage.Parser.ptr(sliceType$1.nil, new dnsmessage.header.ptr(0, 0, 0, 0, 0, 0), 0, 0, 0, false, new dnsmessage.ResourceHeader.ptr(new dnsmessage.Name.ptr(arrayType$6.zero(), 0), 0, 0, 0, 0)), new dnsmessage.Header.ptr(0, false, 0, false, false, false, false, 0), errNoAnswerFromDNSServer]; $s = 31; case 31: return $24r$5; /* */ } return; } } catch(err) { $err = err; $s = -1; return [new dnsmessage.Parser.ptr(sliceType$1.nil, new dnsmessage.header.ptr(0, 0, 0, 0, 0, 0), 0, 0, 0, false, new dnsmessage.ResourceHeader.ptr(new dnsmessage.Name.ptr(arrayType$6.zero(), 0), 0, 0, 0, 0)), new dnsmessage.Header.ptr(0, false, 0, false, false, false, false, 0), $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Resolver.ptr.prototype.exchange }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f._arg = _arg; $f._arg$1 = _arg$1; $f._i = _i; $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$9 = _r$9; $f._ref = _ref; $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.c = c; $f.cancel = cancel; $f.ctx = ctx; $f.ctx$1 = ctx$1; $f.d = d; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.h = h; $f.id = id; $f.network = network; $f.networks = networks; $f.ok = ok; $f.ok$1 = ok$1; $f.p = p; $f.q = q; $f.r = r; $f.server = server; $f.tcpReq = tcpReq; $f.timeout$1 = timeout$1; $f.udpReq = udpReq; $f.useTCP = useTCP; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Resolver.prototype.exchange = function(ctx, server, q, timeout$1, useTCP) { return this.$val.exchange(ctx, server, q, timeout$1, useTCP); }; checkHeader = function(p, h) { var _tuple, err, h, p; if (h.RCode === 3) { return errNoSuchHost; } _tuple = p.AnswerHeader(); err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil)) && !($interfaceIsEqual(err, dnsmessage.ErrSectionDone))) { return errCannotUnmarshalDNSMessage; } if ((h.RCode === 0) && !h.Authoritative && !h.RecursionAvailable && $interfaceIsEqual(err, dnsmessage.ErrSectionDone)) { return errLameReferral; } if (!((h.RCode === 0)) && !((h.RCode === 3))) { if (h.RCode === 2) { return errServerTemporarilyMisbehaving; } return errServerMisbehaving; } return $ifaceNil; }; skipToAnswer = function(p, qtype) { var _tuple, err, err$1, h, p, qtype; while (true) { _tuple = p.AnswerHeader(); h = $clone(_tuple[0], dnsmessage.ResourceHeader); err = _tuple[1]; if ($interfaceIsEqual(err, dnsmessage.ErrSectionDone)) { return errNoSuchHost; } if (!($interfaceIsEqual(err, $ifaceNil))) { return errCannotUnmarshalDNSMessage; } if (h.Type === qtype) { return $ifaceNil; } err$1 = p.SkipAnswer(); if (!($interfaceIsEqual(err$1, $ifaceNil))) { return errCannotUnmarshalDNSMessage; } } }; Resolver.ptr.prototype.tryOneName = function(ctx, cfg, name, qtype) { var _r$10, _r$11, _r$12, _r$13, _r$14, _r$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _v, cfg, ctx, dnsErr, dnsErr$1, err, err$1, err$2, h, i, j, lastErr, n, name, nerr, ok, ok$1, p, q, qtype, r, sLen, server, serverOffset, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _v = $f._v; cfg = $f.cfg; ctx = $f.ctx; dnsErr = $f.dnsErr; dnsErr$1 = $f.dnsErr$1; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; h = $f.h; i = $f.i; j = $f.j; lastErr = $f.lastErr; n = $f.n; name = $f.name; nerr = $f.nerr; ok = $f.ok; ok$1 = $f.ok$1; p = $f.p; q = $f.q; qtype = $f.qtype; r = $f.r; sLen = $f.sLen; server = $f.server; serverOffset = $f.serverOffset; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; lastErr = $ifaceNil; serverOffset = cfg.serverOffset(); sLen = ((cfg.servers.$length >>> 0)); _tuple = dnsmessage.NewName(name); n = $clone(_tuple[0], dnsmessage.Name); err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [new dnsmessage.Parser.ptr(sliceType$1.nil, new dnsmessage.header.ptr(0, 0, 0, 0, 0, 0), 0, 0, 0, false, new dnsmessage.ResourceHeader.ptr(new dnsmessage.Name.ptr(arrayType$6.zero(), 0), 0, 0, 0, 0)), "", errCannotMarshalDNSMessage]; } q = new dnsmessage.Question.ptr($clone(n, dnsmessage.Name), qtype, 1); i = 0; /* while (true) { */ case 1: /* if (!(i < cfg.attempts)) { break; } */ if(!(i < cfg.attempts)) { $s = 2; continue; } j = 0; /* while (true) { */ case 3: /* if (!(j < sLen)) { break; } */ if(!(j < sLen)) { $s = 4; continue; } p = [p]; server = (x = cfg.servers, x$1 = (_r$9 = ((serverOffset + j >>> 0)) % sLen, _r$9 === _r$9 ? _r$9 : $throwRuntimeError("integer divide by zero")), ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])); _r$10 = r.exchange(ctx, server, $clone(q, dnsmessage.Question), cfg.timeout, cfg.useTCP); /* */ $s = 5; case 5: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$1 = _r$10; p[0] = $clone(_tuple$1[0], dnsmessage.Parser); h = $clone(_tuple$1[1], dnsmessage.Header); err$1 = _tuple$1[2]; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 6: _r$11 = err$1.Error(); /* */ $s = 8; case 8: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } dnsErr = new DNSError.ptr(_r$11, name, server, false, false, false); _tuple$2 = $assertType(err$1, Error, true); nerr = _tuple$2[0]; ok = _tuple$2[1]; if (!(ok)) { _v = false; $s = 11; continue s; } _r$12 = nerr.Timeout(); /* */ $s = 12; case 12: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _v = _r$12; case 11: /* */ if (_v) { $s = 9; continue; } /* */ $s = 10; continue; /* if (_v) { */ case 9: dnsErr.IsTimeout = true; /* } */ case 10: _tuple$3 = $assertType(err$1, ptrType$21, true); ok$1 = _tuple$3[1]; if (ok$1) { dnsErr.IsTemporary = true; } lastErr = dnsErr; j = j + (1) >>> 0; /* continue; */ $s = 3; continue; /* } */ case 7: err$2 = checkHeader(p[0], $clone(h, dnsmessage.Header)); /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 13; continue; } /* */ $s = 14; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 13: _r$13 = err$2.Error(); /* */ $s = 15; case 15: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } dnsErr$1 = new DNSError.ptr(_r$13, name, server, false, false, false); if ($interfaceIsEqual(err$2, errServerTemporarilyMisbehaving)) { dnsErr$1.IsTemporary = true; } if ($interfaceIsEqual(err$2, errNoSuchHost)) { dnsErr$1.IsNotFound = true; $s = -1; return [p[0], server, dnsErr$1]; } lastErr = dnsErr$1; j = j + (1) >>> 0; /* continue; */ $s = 3; continue; /* } */ case 14: err$1 = skipToAnswer(p[0], qtype); if ($interfaceIsEqual(err$1, $ifaceNil)) { $s = -1; return [p[0], server, $ifaceNil]; } _r$14 = err$1.Error(); /* */ $s = 16; case 16: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } lastErr = new DNSError.ptr(_r$14, name, server, false, false, false); if ($interfaceIsEqual(err$1, errNoSuchHost)) { $assertType(lastErr, ptrType$31).IsNotFound = true; $s = -1; return [p[0], server, lastErr]; } j = j + (1) >>> 0; $s = 3; continue; case 4: i = i + (1) >> 0; $s = 1; continue; case 2: $s = -1; return [new dnsmessage.Parser.ptr(sliceType$1.nil, new dnsmessage.header.ptr(0, 0, 0, 0, 0, 0), 0, 0, 0, false, new dnsmessage.ResourceHeader.ptr(new dnsmessage.Name.ptr(arrayType$6.zero(), 0), 0, 0, 0, 0)), "", lastErr]; /* */ } return; } if ($f === undefined) { $f = { $blk: Resolver.ptr.prototype.tryOneName }; } $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$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._v = _v; $f.cfg = cfg; $f.ctx = ctx; $f.dnsErr = dnsErr; $f.dnsErr$1 = dnsErr$1; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.h = h; $f.i = i; $f.j = j; $f.lastErr = lastErr; $f.n = n; $f.name = name; $f.nerr = nerr; $f.ok = ok; $f.ok$1 = ok$1; $f.p = p; $f.q = q; $f.qtype = qtype; $f.r = r; $f.sLen = sLen; $f.server = server; $f.serverOffset = serverOffset; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.prototype.tryOneName = function(ctx, cfg, name, qtype) { return this.$val.tryOneName(ctx, cfg, name, qtype); }; resolverConfig.ptr.prototype.init = function() { var _r$10, _r$11, _r$9, conf$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$9 = $f._r$9; conf$1 = $f.conf$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: conf$1 = this; _r$9 = systemConf(); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } conf$1.dnsConfig = _r$9.resolv; /* */ if (conf$1.dnsConfig === ptrType$1.nil) { $s = 2; continue; } /* */ $s = 3; continue; /* if (conf$1.dnsConfig === ptrType$1.nil) { */ case 2: _r$10 = dnsReadConfig("/etc/resolv.conf"); /* */ $s = 4; case 4: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } conf$1.dnsConfig = _r$10; /* } */ case 3: _r$11 = time.Now(); /* */ $s = 5; case 5: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } time.Time.copy(conf$1.lastChecked, _r$11); conf$1.ch = new $Chan(structType$2, 1); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: resolverConfig.ptr.prototype.init }; } $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$9 = _r$9; $f.conf$1 = conf$1; $f.$s = $s; $f.$r = $r; return $f; }; resolverConfig.prototype.init = function() { return this.$val.init(); }; resolverConfig.ptr.prototype.tryUpdate = function(name) { var _r$10, _r$11, _r$12, _r$9, _tuple, conf$1, dnsConf, err, fi, mtime, name, now, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$9 = $f._r$9; _tuple = $f._tuple; conf$1 = $f.conf$1; dnsConf = $f.dnsConf; err = $f.err; fi = $f.fi; mtime = $f.mtime; name = $f.name; now = $f.now; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); conf$1 = this; $r = conf$1.initOnce.Do($methodVal(conf$1, "init")); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!conf$1.tryAcquireSema()) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!conf$1.tryAcquireSema()) { */ case 2: $s = 4; case 4: return; /* } */ case 3: $deferred.push([$methodVal(conf$1, "releaseSema"), []]); _r$9 = time.Now(); /* */ $s = 5; case 5: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } now = $clone(_r$9, time.Time); /* */ if ($clone(conf$1.lastChecked, time.Time).After($clone($clone(now, time.Time).Add(new time.Duration(-2, 3589934592)), time.Time))) { $s = 6; continue; } /* */ $s = 7; continue; /* if ($clone(conf$1.lastChecked, time.Time).After($clone($clone(now, time.Time).Add(new time.Duration(-2, 3589934592)), time.Time))) { */ case 6: $s = 8; case 8: return; /* } */ case 7: time.Time.copy(conf$1.lastChecked, now); mtime = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil); _r$10 = os.Stat(name); /* */ $s = 9; case 9: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple = _r$10; fi = _tuple[0]; err = _tuple[1]; /* */ if ($interfaceIsEqual(err, $ifaceNil)) { $s = 10; continue; } /* */ $s = 11; continue; /* if ($interfaceIsEqual(err, $ifaceNil)) { */ case 10: _r$11 = fi.ModTime(); /* */ $s = 12; case 12: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } time.Time.copy(mtime, _r$11); /* } */ case 11: /* */ if ($clone(mtime, time.Time).Equal($clone(conf$1.dnsConfig.mtime, time.Time))) { $s = 13; continue; } /* */ $s = 14; continue; /* if ($clone(mtime, time.Time).Equal($clone(conf$1.dnsConfig.mtime, time.Time))) { */ case 13: $s = 15; case 15: return; /* } */ case 14: _r$12 = dnsReadConfig(name); /* */ $s = 16; case 16: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } dnsConf = _r$12; $r = conf$1.mu.Lock(); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } conf$1.dnsConfig = dnsConf; $r = conf$1.mu.Unlock(); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: resolverConfig.ptr.prototype.tryUpdate }; } $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$9 = _r$9; $f._tuple = _tuple; $f.conf$1 = conf$1; $f.dnsConf = dnsConf; $f.err = err; $f.fi = fi; $f.mtime = mtime; $f.name = name; $f.now = now; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; resolverConfig.prototype.tryUpdate = function(name) { return this.$val.tryUpdate(name); }; resolverConfig.ptr.prototype.tryAcquireSema = function() { var _selection, conf$1; conf$1 = this; _selection = $select([[conf$1.ch, new structType$2.ptr()], []]); if (_selection[0] === 0) { return true; } else if (_selection[0] === 1) { return false; } }; resolverConfig.prototype.tryAcquireSema = function() { return this.$val.tryAcquireSema(); }; resolverConfig.ptr.prototype.releaseSema = function() { var _r$9, conf$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; conf$1 = $f.conf$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: conf$1 = this; _r$9 = $recv(conf$1.ch); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$9[0]; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: resolverConfig.ptr.prototype.releaseSema }; } $f._r$9 = _r$9; $f.conf$1 = conf$1; $f.$s = $s; $f.$r = $r; return $f; }; resolverConfig.prototype.releaseSema = function() { return this.$val.releaseSema(); }; Resolver.ptr.prototype.lookup = function(ctx, name, qtype) { var $24r, _i, _r$10, _r$11, _r$9, _ref, _tuple, _tuple$1, _tuple$2, _v, conf$1, ctx, err, err$1, fqdn, name, nerr, ok, ok$1, p, qtype, r, server, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _i = $f._i; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$9 = $f._r$9; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _v = $f._v; conf$1 = $f.conf$1; ctx = $f.ctx; err = $f.err; err$1 = $f.err$1; fqdn = $f.fqdn; name = $f.name; nerr = $f.nerr; ok = $f.ok; ok$1 = $f.ok$1; p = $f.p; qtype = $f.qtype; r = $f.r; server = $f.server; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; /* */ if (!isDomainName(name)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!isDomainName(name)) { */ case 1: _r$9 = errNoSuchHost.Error(); /* */ $s = 3; case 3: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $24r = [new dnsmessage.Parser.ptr(sliceType$1.nil, new dnsmessage.header.ptr(0, 0, 0, 0, 0, 0), 0, 0, 0, false, new dnsmessage.ResourceHeader.ptr(new dnsmessage.Name.ptr(arrayType$6.zero(), 0), 0, 0, 0, 0)), "", new DNSError.ptr(_r$9, name, "", false, false, true)]; $s = 4; case 4: return $24r; /* } */ case 2: $r = resolvConf.tryUpdate("/etc/resolv.conf"); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = resolvConf.mu.RLock(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } conf$1 = resolvConf.dnsConfig; $r = resolvConf.mu.RUnlock(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } p = new dnsmessage.Parser.ptr(sliceType$1.nil, new dnsmessage.header.ptr(0, 0, 0, 0, 0, 0), 0, 0, 0, false, new dnsmessage.ResourceHeader.ptr(new dnsmessage.Name.ptr(arrayType$6.zero(), 0), 0, 0, 0, 0)); server = ""; err = $ifaceNil; _ref = conf$1.nameList(name); _i = 0; /* while (true) { */ case 8: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 9; continue; } fqdn = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r$10 = r.tryOneName(ctx, conf$1, fqdn, qtype); /* */ $s = 10; case 10: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple = _r$10; dnsmessage.Parser.copy(p, _tuple[0]); server = _tuple[1]; err = _tuple[2]; if ($interfaceIsEqual(err, $ifaceNil)) { /* break; */ $s = 9; continue; } _tuple$1 = $assertType(err, Error, true); nerr = _tuple$1[0]; ok = _tuple$1[1]; if (!(ok)) { _v = false; $s = 13; continue s; } _r$11 = nerr.Temporary(); /* */ $s = 14; case 14: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _v = _r$11; case 13: /* */ if (_v && r.strictErrors()) { $s = 11; continue; } /* */ $s = 12; continue; /* if (_v && r.strictErrors()) { */ case 11: /* break; */ $s = 9; continue; /* } */ case 12: _i++; $s = 8; continue; case 9: if ($interfaceIsEqual(err, $ifaceNil)) { $s = -1; return [p, server, $ifaceNil]; } _tuple$2 = $assertType(err, ptrType$31, true); err$1 = _tuple$2[0]; ok$1 = _tuple$2[1]; if (ok$1) { err$1.Name = name; } $s = -1; return [new dnsmessage.Parser.ptr(sliceType$1.nil, new dnsmessage.header.ptr(0, 0, 0, 0, 0, 0), 0, 0, 0, false, new dnsmessage.ResourceHeader.ptr(new dnsmessage.Name.ptr(arrayType$6.zero(), 0), 0, 0, 0, 0)), "", err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Resolver.ptr.prototype.lookup }; } $f.$24r = $24r; $f._i = _i; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$9 = _r$9; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._v = _v; $f.conf$1 = conf$1; $f.ctx = ctx; $f.err = err; $f.err$1 = err$1; $f.fqdn = fqdn; $f.name = name; $f.nerr = nerr; $f.ok = ok; $f.ok$1 = ok$1; $f.p = p; $f.qtype = qtype; $f.r = r; $f.server = server; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.prototype.lookup = function(ctx, name, qtype) { return this.$val.lookup(ctx, name, qtype); }; avoidDNS = function(name) { var name; if (name === "") { return true; } if (name.charCodeAt((name.length - 1 >> 0)) === 46) { name = $substring(name, 0, (name.length - 1 >> 0)); } return stringsHasSuffixFold(name, ".onion"); }; dnsConfig.ptr.prototype.nameList = function(name) { var _i, _ref, conf$1, hasNdots, l, name, names, rooted, suffix; conf$1 = this; if (avoidDNS(name)) { return sliceType.nil; } l = name.length; rooted = l > 0 && (name.charCodeAt((l - 1 >> 0)) === 46); if (l > 254 || (l === 254) && rooted) { return sliceType.nil; } if (rooted) { return new sliceType([name]); } hasNdots = count(name, 46) >= conf$1.ndots; name = name + ("."); l = l + (1) >> 0; names = $makeSlice(sliceType, 0, (1 + conf$1.search.$length >> 0)); if (hasNdots) { names = $append(names, name); } _ref = conf$1.search; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } suffix = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if ((l + suffix.length >> 0) <= 254) { names = $append(names, name + suffix); } _i++; } if (!hasNdots) { names = $append(names, name); } return names; }; dnsConfig.prototype.nameList = function(name) { return this.$val.nameList(name); }; hostLookupOrder.prototype.String = function() { var _entry, _tuple, o, ok, s; o = this.$val; _tuple = (_entry = lookupOrderName[hostLookupOrder.keyFor(o)], _entry !== undefined ? [_entry.v, true] : ["", false]); s = _tuple[0]; ok = _tuple[1]; if (ok) { return s; } return "hostLookupOrder=" + itoa.Itoa(((o >> 0))) + "??"; }; $ptrType(hostLookupOrder).prototype.String = function() { return new hostLookupOrder(this.$get()).String(); }; Resolver.ptr.prototype.goLookupHostOrder = function(ctx, name, order) { var _i, _r$10, _r$9, _ref, _tuple, addrs, ctx, err, ip, ips, name, order, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r$10 = $f._r$10; _r$9 = $f._r$9; _ref = $f._ref; _tuple = $f._tuple; addrs = $f.addrs; ctx = $f.ctx; err = $f.err; ip = $f.ip; ips = $f.ips; name = $f.name; order = $f.order; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: addrs = sliceType.nil; err = $ifaceNil; r = this; /* */ if ((order === 1) || (order === 3)) { $s = 1; continue; } /* */ $s = 2; continue; /* if ((order === 1) || (order === 3)) { */ case 1: _r$9 = lookupStaticHost(name); /* */ $s = 3; case 3: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } addrs = _r$9; if (addrs.$length > 0 || (order === 3)) { $s = -1; return [addrs, err]; } /* } */ case 2: _r$10 = r.goLookupIPCNAMEOrder(ctx, "ip", name, order); /* */ $s = 4; case 4: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple = _r$10; ips = _tuple[0]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [addrs, err]; } addrs = $makeSlice(sliceType, 0, ips.$length); _ref = ips; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } ip = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), IPAddr); addrs = $append(addrs, ip.String()); _i++; } $s = -1; return [addrs, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Resolver.ptr.prototype.goLookupHostOrder }; } $f._i = _i; $f._r$10 = _r$10; $f._r$9 = _r$9; $f._ref = _ref; $f._tuple = _tuple; $f.addrs = addrs; $f.ctx = ctx; $f.err = err; $f.ip = ip; $f.ips = ips; $f.name = name; $f.order = order; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.prototype.goLookupHostOrder = function(ctx, name, order) { return this.$val.goLookupHostOrder(ctx, name, order); }; goLookupIPFiles = function(name) { var _i, _r$9, _ref, _tuple, addr, addrs, haddr, haddr$1, ip, name, zone, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r$9 = $f._r$9; _ref = $f._ref; _tuple = $f._tuple; addr = $f.addr; addrs = $f.addrs; haddr = $f.haddr; haddr$1 = $f.haddr$1; ip = $f.ip; name = $f.name; zone = $f.zone; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: addrs = sliceType$5.nil; _r$9 = lookupStaticHost(name); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _ref = _r$9; _i = 0; /* while (true) { */ case 2: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 3; continue; } haddr = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _tuple = splitHostZone(haddr); haddr$1 = _tuple[0]; zone = _tuple[1]; ip = ParseIP(haddr$1); if (!(ip === IP.nil)) { addr = new IPAddr.ptr(ip, zone); addrs = $append(addrs, addr); } _i++; $s = 2; continue; case 3: $r = sortByRFC6724(addrs); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return addrs; /* */ } return; } if ($f === undefined) { $f = { $blk: goLookupIPFiles }; } $f._i = _i; $f._r$9 = _r$9; $f._ref = _ref; $f._tuple = _tuple; $f.addr = addr; $f.addrs = addrs; $f.haddr = haddr; $f.haddr$1 = haddr$1; $f.ip = ip; $f.name = name; $f.zone = zone; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.ptr.prototype.goLookupIP = function(ctx, network, host) { var _r$10, _r$11, _r$9, _tuple, addrs, ctx, err, host, network, order, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$9 = $f._r$9; _tuple = $f._tuple; addrs = $f.addrs; ctx = $f.ctx; err = $f.err; host = $f.host; network = $f.network; order = $f.order; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: addrs = sliceType$5.nil; err = $ifaceNil; r = this; _r$9 = systemConf(); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$10 = _r$9.hostLookupOrder(r, host); /* */ $s = 2; case 2: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } order = _r$10; _r$11 = r.goLookupIPCNAMEOrder(ctx, network, host, order); /* */ $s = 3; case 3: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tuple = _r$11; addrs = _tuple[0]; err = _tuple[2]; $s = -1; return [addrs, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Resolver.ptr.prototype.goLookupIP }; } $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$9 = _r$9; $f._tuple = _tuple; $f.addrs = addrs; $f.ctx = ctx; $f.err = err; $f.host = host; $f.network = network; $f.order = order; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.prototype.goLookupIP = function(ctx, network, host) { return this.$val.goLookupIP(ctx, network, host); }; Resolver.ptr.prototype.goLookupIPCNAMEOrder = function(ctx, network, name, order) { var $24r, _1, _2, _i, _i$1, _i$2, _r$10, _r$11, _r$12, _r$13, _r$9, _ref, _ref$1, _ref$2, _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, _tuple$2, _tuple$3, _tuple$4, _v, a, aaaa, addrs, cname, conf$1, ctx, err, err$1, err$2, err$3, err$4, fqdn, h, hitStrictError, lane, lastErr, lastErr$1, name, nerr, network, ok, ok$1, order, qtype, qtype$1, qtypes, queryFn, r, responseFn, result$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _1 = $f._1; _2 = $f._2; _i = $f._i; _i$1 = $f._i$1; _i$2 = $f._i$2; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$13 = $f._r$13; _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; _tmp$10 = $f._tmp$10; _tmp$11 = $f._tmp$11; _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; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; _v = $f._v; a = $f.a; aaaa = $f.aaaa; addrs = $f.addrs; cname = $f.cname; conf$1 = $f.conf$1; ctx = $f.ctx; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; err$4 = $f.err$4; fqdn = $f.fqdn; h = $f.h; hitStrictError = $f.hitStrictError; lane = $f.lane; lastErr = $f.lastErr; lastErr$1 = $f.lastErr$1; name = $f.name; nerr = $f.nerr; network = $f.network; ok = $f.ok; ok$1 = $f.ok$1; order = $f.order; qtype = $f.qtype; qtype$1 = $f.qtype$1; qtypes = $f.qtypes; queryFn = $f.queryFn; r = $f.r; responseFn = $f.responseFn; result$1 = $f.result$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: conf$1 = [conf$1]; ctx = [ctx]; lane = [lane]; r = [r]; addrs = sliceType$5.nil; cname = new dnsmessage.Name.ptr(arrayType$6.zero(), 0); err = $ifaceNil; r[0] = this; /* */ if ((order === 1) || (order === 3)) { $s = 1; continue; } /* */ $s = 2; continue; /* if ((order === 1) || (order === 3)) { */ case 1: _r$9 = goLookupIPFiles(name); /* */ $s = 3; case 3: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } addrs = _r$9; if (addrs.$length > 0 || (order === 3)) { _tmp = addrs; _tmp$1 = new dnsmessage.Name.ptr(arrayType$6.zero(), 0); _tmp$2 = $ifaceNil; addrs = _tmp; dnsmessage.Name.copy(cname, _tmp$1); err = _tmp$2; $s = -1; return [addrs, cname, err]; } /* } */ case 2: /* */ if (!isDomainName(name)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!isDomainName(name)) { */ case 4: _tmp$3 = sliceType$5.nil; _tmp$4 = new dnsmessage.Name.ptr(arrayType$6.zero(), 0); _r$10 = errNoSuchHost.Error(); /* */ $s = 6; case 6: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tmp$5 = new DNSError.ptr(_r$10, name, "", false, false, true); addrs = _tmp$3; dnsmessage.Name.copy(cname, _tmp$4); err = _tmp$5; $24r = [addrs, cname, err]; $s = 7; case 7: return $24r; /* } */ case 5: $r = resolvConf.tryUpdate("/etc/resolv.conf"); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = resolvConf.mu.RLock(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } conf$1[0] = resolvConf.dnsConfig; $r = resolvConf.mu.RUnlock(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } lane[0] = new $Chan(result, 1); qtypes = new sliceType$15([1, 28]); _1 = ipVersion(network); if (_1 === (52)) { qtypes = new sliceType$15([1]); } else if (_1 === (54)) { qtypes = new sliceType$15([28]); } queryFn = $throwNilPointerError; responseFn = $throwNilPointerError; /* */ if (conf$1[0].singleRequest) { $s = 11; continue; } /* */ $s = 12; continue; /* if (conf$1[0].singleRequest) { */ case 11: queryFn = (function(conf$1, ctx, lane, r) { return function(fqdn, qtype) { var fqdn, qtype; }; })(conf$1, ctx, lane, r); responseFn = (function(conf$1, ctx, lane, r) { return function $b(fqdn, qtype) { var $24r$1, _r$11, _tuple, err$1, fqdn, p, qtype, server, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r$1 = $f.$24r$1; _r$11 = $f._r$11; _tuple = $f._tuple; err$1 = $f.err$1; fqdn = $f.fqdn; p = $f.p; qtype = $f.qtype; server = $f.server; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); dnsWaitGroup.Add(1); $deferred.push([$methodVal(dnsWaitGroup, "Done"), []]); _r$11 = r[0].tryOneName(ctx[0], conf$1[0], fqdn, qtype); /* */ $s = 1; case 1: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tuple = _r$11; p = $clone(_tuple[0], dnsmessage.Parser); server = _tuple[1]; err$1 = _tuple[2]; $24r$1 = new result.ptr($clone(p, dnsmessage.Parser), server, err$1); $s = 2; case 2: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return new result.ptr(new dnsmessage.Parser.ptr(sliceType$1.nil, new dnsmessage.header.ptr(0, 0, 0, 0, 0, 0), 0, 0, 0, false, new dnsmessage.ResourceHeader.ptr(new dnsmessage.Name.ptr(arrayType$6.zero(), 0), 0, 0, 0, 0)), "", $ifaceNil); } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: $b }; } $f.$24r$1 = $24r$1; $f._r$11 = _r$11; $f._tuple = _tuple; $f.err$1 = err$1; $f.fqdn = fqdn; $f.p = p; $f.qtype = qtype; $f.server = server; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; })(conf$1, ctx, lane, r); $s = 13; continue; /* } else { */ case 12: queryFn = (function(conf$1, ctx, lane, r) { return function(fqdn, qtype) { var fqdn, qtype; dnsWaitGroup.Add(1); $go((function(conf$1, ctx, lane, r) { return function $b(qtype$1) { var _r$11, _tuple, err$1, p, qtype$1, server, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$11 = $f._r$11; _tuple = $f._tuple; err$1 = $f.err$1; p = $f.p; qtype$1 = $f.qtype$1; server = $f.server; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$11 = r[0].tryOneName(ctx[0], conf$1[0], fqdn, qtype$1); /* */ $s = 1; case 1: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tuple = _r$11; p = $clone(_tuple[0], dnsmessage.Parser); server = _tuple[1]; err$1 = _tuple[2]; $r = $send(lane[0], $clone(new result.ptr($clone(p, dnsmessage.Parser), server, err$1), result)); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } dnsWaitGroup.Done(); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$11 = _r$11; $f._tuple = _tuple; $f.err$1 = err$1; $f.p = p; $f.qtype$1 = qtype$1; $f.server = server; $f.$s = $s; $f.$r = $r; return $f; }; })(conf$1, ctx, lane, r), [qtype]); }; })(conf$1, ctx, lane, r); responseFn = (function(conf$1, ctx, lane, r) { return function $b(fqdn, qtype) { var $24r$1, _r$11, fqdn, qtype, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r$1 = $f.$24r$1; _r$11 = $f._r$11; fqdn = $f.fqdn; qtype = $f.qtype; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$11 = $recv(lane[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } $24r$1 = _r$11[0]; $s = 2; case 2: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$24r$1 = $24r$1; $f._r$11 = _r$11; $f.fqdn = fqdn; $f.qtype = qtype; $f.$s = $s; $f.$r = $r; return $f; }; })(conf$1, ctx, lane, r); /* } */ case 13: lastErr = $ifaceNil; _ref = conf$1[0].nameList(name); _i = 0; /* while (true) { */ case 14: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 15; continue; } fqdn = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _ref$1 = qtypes; _i$1 = 0; /* while (true) { */ case 16: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 17; continue; } qtype = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); $r = queryFn(fqdn, qtype); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i$1++; $s = 16; continue; case 17: hitStrictError = false; _ref$2 = qtypes; _i$2 = 0; /* while (true) { */ case 19: /* if (!(_i$2 < _ref$2.$length)) { break; } */ if(!(_i$2 < _ref$2.$length)) { $s = 20; continue; } qtype$1 = ((_i$2 < 0 || _i$2 >= _ref$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$2.$array[_ref$2.$offset + _i$2]); _r$11 = responseFn(fqdn, qtype$1); /* */ $s = 21; case 21: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } result$1 = $clone(_r$11, result); /* */ if (!($interfaceIsEqual(result$1.error, $ifaceNil))) { $s = 22; continue; } /* */ $s = 23; continue; /* if (!($interfaceIsEqual(result$1.error, $ifaceNil))) { */ case 22: _tuple = $assertType(result$1.error, Error, true); nerr = _tuple[0]; ok = _tuple[1]; if (!(ok)) { _v = false; $s = 27; continue s; } _r$12 = nerr.Temporary(); /* */ $s = 28; case 28: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _v = _r$12; case 27: /* */ if (_v && r[0].strictErrors()) { $s = 24; continue; } /* */ if ($interfaceIsEqual(lastErr, $ifaceNil) || fqdn === name + ".") { $s = 25; continue; } /* */ $s = 26; continue; /* if (_v && r[0].strictErrors()) { */ case 24: hitStrictError = true; lastErr = result$1.error; $s = 26; continue; /* } else if ($interfaceIsEqual(lastErr, $ifaceNil) || fqdn === name + ".") { */ case 25: lastErr = result$1.error; /* } */ case 26: _i$2++; /* continue; */ $s = 19; continue; /* } */ case 23: loop: while (true) { _tuple$1 = result$1.p.AnswerHeader(); h = $clone(_tuple$1[0], dnsmessage.ResourceHeader); err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil)) && !($interfaceIsEqual(err$1, dnsmessage.ErrSectionDone))) { lastErr = new DNSError.ptr("cannot marshal DNS message", name, result$1.server, false, false, false); } if (!($interfaceIsEqual(err$1, $ifaceNil))) { break; } _2 = h.Type; if (_2 === (1)) { _tuple$2 = result$1.p.AResource(); a = $clone(_tuple$2[0], dnsmessage.AResource); err$2 = _tuple$2[1]; if (!($interfaceIsEqual(err$2, $ifaceNil))) { lastErr = new DNSError.ptr("cannot marshal DNS message", name, result$1.server, false, false, false); break loop; } addrs = $append(addrs, new IPAddr.ptr(($convertSliceType(new sliceType$1(a.A), IP)), "")); } else if (_2 === (28)) { _tuple$3 = result$1.p.AAAAResource(); aaaa = $clone(_tuple$3[0], dnsmessage.AAAAResource); err$3 = _tuple$3[1]; if (!($interfaceIsEqual(err$3, $ifaceNil))) { lastErr = new DNSError.ptr("cannot marshal DNS message", name, result$1.server, false, false, false); break loop; } addrs = $append(addrs, new IPAddr.ptr(($convertSliceType(new sliceType$1(aaaa.AAAA), IP)), "")); } else { err$4 = result$1.p.SkipAnswer(); if (!($interfaceIsEqual(err$4, $ifaceNil))) { lastErr = new DNSError.ptr("cannot marshal DNS message", name, result$1.server, false, false, false); break loop; } continue; } if ((cname.Length === 0) && !((h.Name.Length === 0))) { dnsmessage.Name.copy(cname, h.Name); } } _i$2++; $s = 19; continue; case 20: if (hitStrictError) { addrs = sliceType$5.nil; /* break; */ $s = 15; continue; } if (addrs.$length > 0) { /* break; */ $s = 15; continue; } _i++; $s = 14; continue; case 15: _tuple$4 = $assertType(lastErr, ptrType$31, true); lastErr$1 = _tuple$4[0]; ok$1 = _tuple$4[1]; if (ok$1) { lastErr$1.Name = name; } $r = sortByRFC6724(addrs); /* */ $s = 29; case 29: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (addrs.$length === 0) { $s = 30; continue; } /* */ $s = 31; continue; /* if (addrs.$length === 0) { */ case 30: /* */ if (order === 2) { $s = 32; continue; } /* */ $s = 33; continue; /* if (order === 2) { */ case 32: _r$13 = goLookupIPFiles(name); /* */ $s = 34; case 34: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } addrs = _r$13; /* } */ case 33: if ((addrs.$length === 0) && !($interfaceIsEqual(lastErr, $ifaceNil))) { _tmp$6 = sliceType$5.nil; _tmp$7 = new dnsmessage.Name.ptr(arrayType$6.zero(), 0); _tmp$8 = lastErr; addrs = _tmp$6; dnsmessage.Name.copy(cname, _tmp$7); err = _tmp$8; $s = -1; return [addrs, cname, err]; } /* } */ case 31: _tmp$9 = addrs; _tmp$10 = $clone(cname, dnsmessage.Name); _tmp$11 = $ifaceNil; addrs = _tmp$9; dnsmessage.Name.copy(cname, _tmp$10); err = _tmp$11; $s = -1; return [addrs, cname, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Resolver.ptr.prototype.goLookupIPCNAMEOrder }; } $f.$24r = $24r; $f._1 = _1; $f._2 = _2; $f._i = _i; $f._i$1 = _i$1; $f._i$2 = _i$2; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$13 = _r$13; $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._tmp$10 = _tmp$10; $f._tmp$11 = _tmp$11; $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._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f._v = _v; $f.a = a; $f.aaaa = aaaa; $f.addrs = addrs; $f.cname = cname; $f.conf$1 = conf$1; $f.ctx = ctx; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.err$4 = err$4; $f.fqdn = fqdn; $f.h = h; $f.hitStrictError = hitStrictError; $f.lane = lane; $f.lastErr = lastErr; $f.lastErr$1 = lastErr$1; $f.name = name; $f.nerr = nerr; $f.network = network; $f.ok = ok; $f.ok$1 = ok$1; $f.order = order; $f.qtype = qtype; $f.qtype$1 = qtype$1; $f.qtypes = qtypes; $f.queryFn = queryFn; $f.r = r; $f.responseFn = responseFn; $f.result$1 = result$1; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.prototype.goLookupIPCNAMEOrder = function(ctx, network, name, order) { return this.$val.goLookupIPCNAMEOrder(ctx, network, name, order); }; Resolver.ptr.prototype.goLookupCNAME = function(ctx, host) { var _r$10, _r$11, _r$9, _tuple, cname, ctx, err, host, order, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$9 = $f._r$9; _tuple = $f._tuple; cname = $f.cname; ctx = $f.ctx; err = $f.err; host = $f.host; order = $f.order; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r$9 = systemConf(); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$10 = _r$9.hostLookupOrder(r, host); /* */ $s = 2; case 2: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } order = _r$10; _r$11 = r.goLookupIPCNAMEOrder(ctx, "ip", host, order); /* */ $s = 3; case 3: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tuple = _r$11; cname = $clone(_tuple[1], dnsmessage.Name); err = _tuple[2]; $s = -1; return [$clone(cname, dnsmessage.Name).String(), err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Resolver.ptr.prototype.goLookupCNAME }; } $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$9 = _r$9; $f._tuple = _tuple; $f.cname = cname; $f.ctx = ctx; $f.err = err; $f.host = host; $f.order = order; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.prototype.goLookupCNAME = function(ctx, host) { return this.$val.goLookupCNAME(ctx, host); }; Resolver.ptr.prototype.goLookupPTR = function(ctx, addr) { var _r$10, _r$9, _tuple, _tuple$1, _tuple$2, _tuple$3, addr, arpa, ctx, err, err$1, err$2, h, names, p, ptr, ptrs, r, server, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$10 = $f._r$10; _r$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; addr = $f.addr; arpa = $f.arpa; ctx = $f.ctx; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; h = $f.h; names = $f.names; p = $f.p; ptr = $f.ptr; ptrs = $f.ptrs; r = $f.r; server = $f.server; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r$9 = lookupStaticAddr(addr); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } names = _r$9; if (names.$length > 0) { $s = -1; return [names, $ifaceNil]; } _tuple = reverseaddr(addr); arpa = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType.nil, err]; } _r$10 = r.lookup(ctx, arpa, 12); /* */ $s = 2; case 2: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$1 = _r$10; p = $clone(_tuple$1[0], dnsmessage.Parser); server = _tuple$1[1]; err = _tuple$1[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType.nil, err]; } ptrs = sliceType.nil; while (true) { _tuple$2 = p.AnswerHeader(); h = $clone(_tuple$2[0], dnsmessage.ResourceHeader); err$1 = _tuple$2[1]; if ($interfaceIsEqual(err$1, dnsmessage.ErrSectionDone)) { break; } if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [sliceType.nil, new DNSError.ptr("cannot marshal DNS message", addr, server, false, false, false)]; } if (!((h.Type === 12))) { err$2 = p.SkipAnswer(); if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return [sliceType.nil, new DNSError.ptr("cannot marshal DNS message", addr, server, false, false, false)]; } continue; } _tuple$3 = p.PTRResource(); ptr = $clone(_tuple$3[0], dnsmessage.PTRResource); err$1 = _tuple$3[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [sliceType.nil, new DNSError.ptr("cannot marshal DNS message", addr, server, false, false, false)]; } ptrs = $append(ptrs, $clone(ptr.PTR, dnsmessage.Name).String()); } $s = -1; return [ptrs, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Resolver.ptr.prototype.goLookupPTR }; } $f._r$10 = _r$10; $f._r$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.addr = addr; $f.arpa = arpa; $f.ctx = ctx; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.h = h; $f.names = names; $f.p = p; $f.ptr = ptr; $f.ptrs = ptrs; $f.r = r; $f.server = server; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.prototype.goLookupPTR = function(ctx, addr) { return this.$val.goLookupPTR(ctx, addr); }; fastrand = function() { $throwRuntimeError("native function not implemented: net.fastrand"); }; randInt = function() { var _r$10, _r$9, _tmp, _tmp$1, i, u, x, y, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$10 = $f._r$10; _r$9 = $f._r$9; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; i = $f.i; u = $f.u; x = $f.x; y = $f.y; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$9 = fastrand(); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tmp = _r$9; _r$10 = fastrand(); /* */ $s = 2; case 2: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tmp$1 = _r$10; x = _tmp; y = _tmp$1; u = ((((x >>> 0)) << 31 >>> 0) ^ ((((y >> 0)) >>> 0))) >>> 0; i = (((u >>> 1 >>> 0) >> 0)); $s = -1; return i; /* */ } return; } if ($f === undefined) { $f = { $blk: randInt }; } $f._r$10 = _r$10; $f._r$9 = _r$9; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.i = i; $f.u = u; $f.x = x; $f.y = y; $f.$s = $s; $f.$r = $r; return $f; }; randIntn = function(n) { var $24r, _r$10, _r$9, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$10 = $f._r$10; _r$9 = $f._r$9; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$10 = randInt(); /* */ $s = 1; case 1: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } $24r = (_r$9 = _r$10 % n, _r$9 === _r$9 ? _r$9 : $throwRuntimeError("integer divide by zero")); $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: randIntn }; } $f.$24r = $24r; $f._r$10 = _r$10; $f._r$9 = _r$9; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; reverseaddr = function(addr) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, addr, arpa, buf, err, i, ip, v; arpa = ""; err = $ifaceNil; ip = ParseIP(addr); if (ip === IP.nil) { _tmp = ""; _tmp$1 = new DNSError.ptr("unrecognized address", addr, "", false, false, false); arpa = _tmp; err = _tmp$1; return [arpa, err]; } if (!(ip.To4() === IP.nil)) { _tmp$2 = itoa.Uitoa((((15 >= ip.$length ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + 15]) >>> 0))) + "." + itoa.Uitoa((((14 >= ip.$length ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + 14]) >>> 0))) + "." + itoa.Uitoa((((13 >= ip.$length ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + 13]) >>> 0))) + "." + itoa.Uitoa((((12 >= ip.$length ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + 12]) >>> 0))) + ".in-addr.arpa."; _tmp$3 = $ifaceNil; arpa = _tmp$2; err = _tmp$3; return [arpa, err]; } buf = $makeSlice(sliceType$1, 0, (($imul(ip.$length, 4)) + 9 >> 0)); i = ip.$length - 1 >> 0; while (true) { if (!(i >= 0)) { break; } v = ((i < 0 || i >= ip.$length) ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + i]); buf = $append(buf, "0123456789abcdef".charCodeAt(((v & 15) >>> 0)), 46, "0123456789abcdef".charCodeAt((v >>> 4 << 24 >>> 24)), 46); i = i - (1) >> 0; } buf = $appendSlice(buf, "ip6.arpa."); _tmp$4 = ($bytesToString(buf)); _tmp$5 = $ifaceNil; arpa = _tmp$4; err = _tmp$5; return [arpa, err]; }; equalASCIIName = function(x, y) { var a, b, i, x, x$1, x$2, y; if (!((x.Length === y.Length))) { return false; } i = 0; while (true) { if (!(i < ((x.Length >> 0)))) { break; } a = (x$1 = x.Data, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i])); b = (x$2 = y.Data, ((i < 0 || i >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i])); if (65 <= a && a <= 90) { a = a + (32) << 24 >>> 24; } if (65 <= b && b <= 90) { b = b + (32) << 24 >>> 24; } if (!((a === b))) { return false; } i = i + (1) >> 0; } return true; }; isDomainName = function(s) { var c, i, l, last$1, nonNumeric, partlen, s; l = s.length; if ((l === 0) || l > 254 || (l === 254) && !((s.charCodeAt((l - 1 >> 0)) === 46))) { return false; } last$1 = 46; nonNumeric = false; partlen = 0; i = 0; while (true) { if (!(i < s.length)) { break; } c = s.charCodeAt(i); if (97 <= c && c <= 122 || 65 <= c && c <= 90 || (c === 95)) { nonNumeric = true; partlen = partlen + (1) >> 0; } else if (48 <= c && c <= 57) { partlen = partlen + (1) >> 0; } else if ((c === 45)) { if (last$1 === 46) { return false; } partlen = partlen + (1) >> 0; nonNumeric = true; } else if ((c === 46)) { if ((last$1 === 46) || (last$1 === 45)) { return false; } if (partlen > 63 || (partlen === 0)) { return false; } partlen = 0; } else { return false; } last$1 = c; i = i + (1) >> 0; } if ((last$1 === 45) || partlen > 63) { return false; } return nonNumeric; }; absDomainName = function(b) { var _i, _ref, b, hasDots, x, x$1; hasDots = false; _ref = b; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } x = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (x === 46) { hasDots = true; break; } _i++; } if (hasDots && !(((x$1 = b.$length - 1 >> 0, ((x$1 < 0 || x$1 >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + x$1])) === 46))) { b = $append(b, 46); } return ($bytesToString(b)); }; byPriorityWeight.prototype.Len = function() { var s; s = this; return s.$length; }; $ptrType(byPriorityWeight).prototype.Len = function() { return this.$get().Len(); }; byPriorityWeight.prototype.Less = function(i, j) { var i, j, s; s = this; return ((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]).Priority < ((j < 0 || j >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + j]).Priority || ((((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]).Priority === ((j < 0 || j >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + j]).Priority) && ((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]).Weight < ((j < 0 || j >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + j]).Weight); }; $ptrType(byPriorityWeight).prototype.Less = function(i, j) { return this.$get().Less(i, j); }; byPriorityWeight.prototype.Swap = function(i, j) { var _tmp, _tmp$1, i, j, s; s = this; _tmp = ((j < 0 || j >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + j]); _tmp$1 = ((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]); ((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i] = _tmp); ((j < 0 || j >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + j] = _tmp$1); }; $ptrType(byPriorityWeight).prototype.Swap = function(i, j) { return this.$get().Swap(i, j); }; byPriorityWeight.prototype.shuffleByWeight = function() { var _i, _i$1, _r$9, _ref, _ref$1, _tmp, _tmp$1, addr, addrs, i, n, s, sum, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _i$1 = $f._i$1; _r$9 = $f._r$9; _ref = $f._ref; _ref$1 = $f._ref$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; addr = $f.addr; addrs = $f.addrs; i = $f.i; n = $f.n; s = $f.s; sum = $f.sum; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: addrs = this; sum = 0; _ref = addrs; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } addr = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); sum = sum + (((addr.Weight >> 0))) >> 0; _i++; } /* while (true) { */ case 1: /* if (!(sum > 0 && addrs.$length > 1)) { break; } */ if(!(sum > 0 && addrs.$length > 1)) { $s = 2; continue; } s = 0; _r$9 = randIntn(sum); /* */ $s = 3; case 3: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } n = _r$9; _ref$1 = addrs; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } i = _i$1; s = s + (((((i < 0 || i >= addrs.$length) ? ($throwRuntimeError("index out of range"), undefined) : addrs.$array[addrs.$offset + i]).Weight >> 0))) >> 0; if (s > n) { if (i > 0) { _tmp = ((i < 0 || i >= addrs.$length) ? ($throwRuntimeError("index out of range"), undefined) : addrs.$array[addrs.$offset + i]); _tmp$1 = (0 >= addrs.$length ? ($throwRuntimeError("index out of range"), undefined) : addrs.$array[addrs.$offset + 0]); (0 >= addrs.$length ? ($throwRuntimeError("index out of range"), undefined) : addrs.$array[addrs.$offset + 0] = _tmp); ((i < 0 || i >= addrs.$length) ? ($throwRuntimeError("index out of range"), undefined) : addrs.$array[addrs.$offset + i] = _tmp$1); } break; } _i$1++; } sum = sum - ((((0 >= addrs.$length ? ($throwRuntimeError("index out of range"), undefined) : addrs.$array[addrs.$offset + 0]).Weight >> 0))) >> 0; addrs = $subslice(addrs, 1); $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: byPriorityWeight.prototype.shuffleByWeight }; } $f._i = _i; $f._i$1 = _i$1; $f._r$9 = _r$9; $f._ref = _ref; $f._ref$1 = _ref$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.addr = addr; $f.addrs = addrs; $f.i = i; $f.n = n; $f.s = s; $f.sum = sum; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(byPriorityWeight).prototype.shuffleByWeight = function() { return this.$get().shuffleByWeight(); }; byPriorityWeight.prototype.sort = function() { var addrs, i, j, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; addrs = $f.addrs; i = $f.i; j = $f.j; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: addrs = this; $r = sort.Sort(addrs); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i = 0; j = 1; /* while (true) { */ case 2: /* if (!(j < addrs.$length)) { break; } */ if(!(j < addrs.$length)) { $s = 3; continue; } /* */ if (!((((i < 0 || i >= addrs.$length) ? ($throwRuntimeError("index out of range"), undefined) : addrs.$array[addrs.$offset + i]).Priority === ((j < 0 || j >= addrs.$length) ? ($throwRuntimeError("index out of range"), undefined) : addrs.$array[addrs.$offset + j]).Priority))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!((((i < 0 || i >= addrs.$length) ? ($throwRuntimeError("index out of range"), undefined) : addrs.$array[addrs.$offset + i]).Priority === ((j < 0 || j >= addrs.$length) ? ($throwRuntimeError("index out of range"), undefined) : addrs.$array[addrs.$offset + j]).Priority))) { */ case 4: $r = $subslice(addrs, i, j).shuffleByWeight(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i = j; /* } */ case 5: j = j + (1) >> 0; $s = 2; continue; case 3: $r = $subslice(addrs, i).shuffleByWeight(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: byPriorityWeight.prototype.sort }; } $f.addrs = addrs; $f.i = i; $f.j = j; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(byPriorityWeight).prototype.sort = function() { return this.$get().sort(); }; byPref.prototype.Len = function() { var s; s = this; return s.$length; }; $ptrType(byPref).prototype.Len = function() { return this.$get().Len(); }; byPref.prototype.Less = function(i, j) { var i, j, s; s = this; return ((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]).Pref < ((j < 0 || j >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + j]).Pref; }; $ptrType(byPref).prototype.Less = function(i, j) { return this.$get().Less(i, j); }; byPref.prototype.Swap = function(i, j) { var _tmp, _tmp$1, i, j, s; s = this; _tmp = ((j < 0 || j >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + j]); _tmp$1 = ((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]); ((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i] = _tmp); ((j < 0 || j >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + j] = _tmp$1); }; $ptrType(byPref).prototype.Swap = function(i, j) { return this.$get().Swap(i, j); }; byPref.prototype.sort = function() { var _i, _r$9, _ref, _tmp, _tmp$1, i, j, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r$9 = $f._r$9; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; i = $f.i; j = $f.j; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; _ref = s; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } i = _i; _r$9 = randIntn(i + 1 >> 0); /* */ $s = 3; case 3: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } j = _r$9; _tmp = ((j < 0 || j >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + j]); _tmp$1 = ((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]); ((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i] = _tmp); ((j < 0 || j >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + j] = _tmp$1); _i++; $s = 1; continue; case 2: $r = sort.Sort(s); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: byPref.prototype.sort }; } $f._i = _i; $f._r$9 = _r$9; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.i = i; $f.j = j; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(byPref).prototype.sort = function() { return this.$get().sort(); }; Dialer.ptr.prototype.dualStack = function() { var d, x; d = this; return (x = d.FallbackDelay, (x.$high > 0 || (x.$high === 0 && x.$low >= 0))); }; Dialer.prototype.dualStack = function() { return this.$val.dualStack(); }; minNonzeroTime = function(a, b) { var a, b; if ($clone(a, time.Time).IsZero()) { return b; } if ($clone(b, time.Time).IsZero() || $clone(a, time.Time).Before($clone(b, time.Time))) { return a; } return b; }; Dialer.ptr.prototype.deadline = function(ctx, now) { var _r$9, _tuple, ctx, d, d$1, earliest, now, ok, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tuple = $f._tuple; ctx = $f.ctx; d = $f.d; d$1 = $f.d$1; earliest = $f.earliest; now = $f.now; ok = $f.ok; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: earliest = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil); d = this; if (!((x = d.Timeout, (x.$high === 0 && x.$low === 0)))) { time.Time.copy(earliest, $clone(now, time.Time).Add(d.Timeout)); } _r$9 = ctx.Deadline(); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; d$1 = $clone(_tuple[0], time.Time); ok = _tuple[1]; if (ok) { time.Time.copy(earliest, minNonzeroTime($clone(earliest, time.Time), $clone(d$1, time.Time))); } time.Time.copy(earliest, minNonzeroTime($clone(earliest, time.Time), $clone(d.Deadline, time.Time))); $s = -1; return earliest; /* */ } return; } if ($f === undefined) { $f = { $blk: Dialer.ptr.prototype.deadline }; } $f._r$9 = _r$9; $f._tuple = _tuple; $f.ctx = ctx; $f.d = d; $f.d$1 = d$1; $f.earliest = earliest; $f.now = now; $f.ok = ok; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Dialer.prototype.deadline = function(ctx, now) { return this.$val.deadline(ctx, now); }; Dialer.ptr.prototype.resolver = function() { var d; d = this; if (!(d.Resolver === ptrType$13.nil)) { return d.Resolver; } return $pkg.DefaultResolver; }; Dialer.prototype.resolver = function() { return this.$val.resolver(); }; partialDeadline = function(now, deadline, addrsRemaining) { var addrsRemaining, deadline, now, timeRemaining, timeout$1; if ($clone(deadline, time.Time).IsZero()) { return [deadline, $ifaceNil]; } timeRemaining = $clone(deadline, time.Time).Sub($clone(now, time.Time)); if ((timeRemaining.$high < 0 || (timeRemaining.$high === 0 && timeRemaining.$low <= 0))) { return [new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil), errTimeout]; } timeout$1 = $div64(timeRemaining, (new time.Duration(0, addrsRemaining)), false); if ((timeout$1.$high < 0 || (timeout$1.$high === 0 && timeout$1.$low < 2000000000))) { if ((timeRemaining.$high < 0 || (timeRemaining.$high === 0 && timeRemaining.$low < 2000000000))) { timeout$1 = timeRemaining; } else { timeout$1 = new time.Duration(0, 2000000000); } } return [$clone(now, time.Time).Add(timeout$1), $ifaceNil]; }; Dialer.ptr.prototype.fallbackDelay = function() { var d, x; d = this; if ((x = d.FallbackDelay, (x.$high > 0 || (x.$high === 0 && x.$low > 0)))) { return d.FallbackDelay; } else { return new time.Duration(0, 300000000); } }; Dialer.prototype.fallbackDelay = function() { return this.$val.fallbackDelay(); }; parseNetwork = function(ctx, network, needsProto) { var _1, _2, _r$9, _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, afnet, ctx, err, i, i$1, needsProto, network, ok, proto, proto$1, protostr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _2 = $f._2; _r$9 = $f._r$9; _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$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; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; afnet = $f.afnet; ctx = $f.ctx; err = $f.err; i = $f.i; i$1 = $f.i$1; needsProto = $f.needsProto; network = $f.network; ok = $f.ok; proto = $f.proto; proto$1 = $f.proto$1; protostr = $f.protostr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: afnet = ""; proto = 0; err = $ifaceNil; i = last(network, 58); if (i < 0) { _1 = network; if (_1 === ("tcp") || _1 === ("tcp4") || _1 === ("tcp6")) { } else if (_1 === ("udp") || _1 === ("udp4") || _1 === ("udp6")) { } else if (_1 === ("ip") || _1 === ("ip4") || _1 === ("ip6")) { if (needsProto) { _tmp = ""; _tmp$1 = 0; _tmp$2 = new UnknownNetworkError((network)); afnet = _tmp; proto = _tmp$1; err = _tmp$2; $s = -1; return [afnet, proto, err]; } } else if (_1 === ("unix") || _1 === ("unixgram") || _1 === ("unixpacket")) { } else { _tmp$3 = ""; _tmp$4 = 0; _tmp$5 = new UnknownNetworkError((network)); afnet = _tmp$3; proto = _tmp$4; err = _tmp$5; $s = -1; return [afnet, proto, err]; } _tmp$6 = network; _tmp$7 = 0; _tmp$8 = $ifaceNil; afnet = _tmp$6; proto = _tmp$7; err = _tmp$8; $s = -1; return [afnet, proto, err]; } afnet = $substring(network, 0, i); _2 = afnet; /* */ if (_2 === ("ip") || _2 === ("ip4") || _2 === ("ip6")) { $s = 2; continue; } /* */ $s = 3; continue; /* if (_2 === ("ip") || _2 === ("ip4") || _2 === ("ip6")) { */ case 2: protostr = $substring(network, (i + 1 >> 0)); _tuple = dtoi(protostr); proto$1 = _tuple[0]; i$1 = _tuple[1]; ok = _tuple[2]; /* */ if (!ok || !((i$1 === protostr.length))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!ok || !((i$1 === protostr.length))) { */ case 4: _r$9 = lookupProtocol(ctx, protostr); /* */ $s = 6; case 6: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple$1 = _r$9; proto$1 = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$9 = ""; _tmp$10 = 0; _tmp$11 = err; afnet = _tmp$9; proto = _tmp$10; err = _tmp$11; $s = -1; return [afnet, proto, err]; } /* } */ case 5: _tmp$12 = afnet; _tmp$13 = proto$1; _tmp$14 = $ifaceNil; afnet = _tmp$12; proto = _tmp$13; err = _tmp$14; $s = -1; return [afnet, proto, err]; /* } */ case 3: case 1: _tmp$15 = ""; _tmp$16 = 0; _tmp$17 = new UnknownNetworkError((network)); afnet = _tmp$15; proto = _tmp$16; err = _tmp$17; $s = -1; return [afnet, proto, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: parseNetwork }; } $f._1 = _1; $f._2 = _2; $f._r$9 = _r$9; $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$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._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.afnet = afnet; $f.ctx = ctx; $f.err = err; $f.i = i; $f.i$1 = i$1; $f.needsProto = needsProto; $f.network = network; $f.ok = ok; $f.proto = proto; $f.proto$1 = proto$1; $f.protostr = protostr; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.ptr.prototype.resolveAddrList = function(ctx, op, network, addr, hint) { var $24r, $24r$1, $24r$2, _1, _i, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$9, _ref, _ref$1, _ref$2, _tuple, _tuple$1, _tuple$2, _v, addr, addr$1, addr$2, addr$3, addr$4, addr$5, addrs, afnet, ctx, err, err$1, hint, hint$1, hint$2, hint$3, ip, naddrs, network, op, r, tcp, udp, wildcard, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _1 = $f._1; _i = $f._i; _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$9 = $f._r$9; _ref = $f._ref; _ref$1 = $f._ref$1; _ref$2 = $f._ref$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _v = $f._v; addr = $f.addr; addr$1 = $f.addr$1; addr$2 = $f.addr$2; addr$3 = $f.addr$3; addr$4 = $f.addr$4; addr$5 = $f.addr$5; addrs = $f.addrs; afnet = $f.afnet; ctx = $f.ctx; err = $f.err; err$1 = $f.err$1; hint = $f.hint; hint$1 = $f.hint$1; hint$2 = $f.hint$2; hint$3 = $f.hint$3; ip = $f.ip; naddrs = $f.naddrs; network = $f.network; op = $f.op; r = $f.r; tcp = $f.tcp; udp = $f.udp; wildcard = $f.wildcard; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r$9 = parseNetwork(ctx, network, true); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; afnet = _tuple[0]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [addrList.nil, err]; } if (op === "dial" && addr === "") { $s = -1; return [addrList.nil, errMissingAddress]; } _1 = afnet; /* */ if (_1 === ("unix") || _1 === ("unixgram") || _1 === ("unixpacket")) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_1 === ("unix") || _1 === ("unixgram") || _1 === ("unixpacket")) { */ case 3: _tuple$1 = ResolveUnixAddr(afnet, addr); addr$1 = _tuple$1[0]; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [addrList.nil, err$1]; } if (!(op === "dial" && !($interfaceIsEqual(hint, $ifaceNil)))) { _v = false; $s = 7; continue s; } _r$10 = hint.Network(); /* */ $s = 8; case 8: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _v = !(addr$1.Network() === _r$10); case 7: /* */ if (_v) { $s = 5; continue; } /* */ $s = 6; continue; /* if (_v) { */ case 5: _r$11 = hint.String(); /* */ $s = 9; case 9: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } $24r = [addrList.nil, new AddrError.ptr("mismatched local address type", _r$11)]; $s = 10; case 10: return $24r; /* } */ case 6: $s = -1; return [new addrList([addr$1]), $ifaceNil]; /* } */ case 4: case 2: _r$12 = r.internetAddrList(ctx, afnet, addr); /* */ $s = 11; case 11: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _tuple$2 = _r$12; addrs = _tuple$2[0]; err = _tuple$2[1]; if (!($interfaceIsEqual(err, $ifaceNil)) || !(op === "dial") || $interfaceIsEqual(hint, $ifaceNil)) { $s = -1; return [addrs, err]; } tcp = ptrType$19.nil; udp = ptrType$16.nil; ip = ptrType$25.nil; wildcard = false; _ref = hint; if ($assertType(_ref, ptrType$19, true)[1]) { hint$1 = _ref.$val; tcp = hint$1; wildcard = tcp.isWildcard(); } else if ($assertType(_ref, ptrType$16, true)[1]) { hint$2 = _ref.$val; udp = hint$2; wildcard = udp.isWildcard(); } else if ($assertType(_ref, ptrType$25, true)[1]) { hint$3 = _ref.$val; ip = hint$3; wildcard = ip.isWildcard(); } naddrs = $subslice(addrs, 0, 0); _ref$1 = addrs; _i = 0; /* while (true) { */ case 12: /* if (!(_i < _ref$1.$length)) { break; } */ if(!(_i < _ref$1.$length)) { $s = 13; continue; } addr$2 = ((_i < 0 || _i >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i]); _r$13 = addr$2.Network(); /* */ $s = 16; case 16: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _r$14 = hint.Network(); /* */ $s = 17; case 17: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } /* */ if (!(_r$13 === _r$14)) { $s = 14; continue; } /* */ $s = 15; continue; /* if (!(_r$13 === _r$14)) { */ case 14: _r$15 = hint.String(); /* */ $s = 18; case 18: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } $24r$1 = [addrList.nil, new AddrError.ptr("mismatched local address type", _r$15)]; $s = 19; case 19: return $24r$1; /* } */ case 15: _ref$2 = addr$2; if ($assertType(_ref$2, ptrType$19, true)[1]) { addr$3 = _ref$2.$val; if (!wildcard && !addr$3.isWildcard() && !addr$3.IP.matchAddrFamily(tcp.IP)) { _i++; /* continue; */ $s = 12; continue; } naddrs = $append(naddrs, addr$3); } else if ($assertType(_ref$2, ptrType$16, true)[1]) { addr$4 = _ref$2.$val; if (!wildcard && !addr$4.isWildcard() && !addr$4.IP.matchAddrFamily(udp.IP)) { _i++; /* continue; */ $s = 12; continue; } naddrs = $append(naddrs, addr$4); } else if ($assertType(_ref$2, ptrType$25, true)[1]) { addr$5 = _ref$2.$val; if (!wildcard && !addr$5.isWildcard() && !addr$5.IP.matchAddrFamily(ip.IP)) { _i++; /* continue; */ $s = 12; continue; } naddrs = $append(naddrs, addr$5); } _i++; $s = 12; continue; case 13: /* */ if (naddrs.$length === 0) { $s = 20; continue; } /* */ $s = 21; continue; /* if (naddrs.$length === 0) { */ case 20: _r$16 = errNoSuitableAddress.Error(); /* */ $s = 22; case 22: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _r$17 = hint.String(); /* */ $s = 23; case 23: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } $24r$2 = [addrList.nil, new AddrError.ptr(_r$16, _r$17)]; $s = 24; case 24: return $24r$2; /* } */ case 21: $s = -1; return [naddrs, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Resolver.ptr.prototype.resolveAddrList }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._1 = _1; $f._i = _i; $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$9 = _r$9; $f._ref = _ref; $f._ref$1 = _ref$1; $f._ref$2 = _ref$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._v = _v; $f.addr = addr; $f.addr$1 = addr$1; $f.addr$2 = addr$2; $f.addr$3 = addr$3; $f.addr$4 = addr$4; $f.addr$5 = addr$5; $f.addrs = addrs; $f.afnet = afnet; $f.ctx = ctx; $f.err = err; $f.err$1 = err$1; $f.hint = hint; $f.hint$1 = hint$1; $f.hint$2 = hint$2; $f.hint$3 = hint$3; $f.ip = ip; $f.naddrs = naddrs; $f.network = network; $f.op = op; $f.r = r; $f.tcp = tcp; $f.udp = udp; $f.wildcard = wildcard; $f.$s = $s; $f.$r = $r; return $f; }; Resolver.prototype.resolveAddrList = function(ctx, op, network, addr, hint) { return this.$val.resolveAddrList(ctx, op, network, addr, hint); }; Dial = function(network, address) { var address, d, network; d = new Dialer.ptr(new time.Duration(0, 0), new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil), $ifaceNil, false, new time.Duration(0, 0), new time.Duration(0, 0), ptrType$13.nil, $chanNil, $throwNilPointerError); return d.Dial(network, address); }; $pkg.Dial = Dial; Dialer.ptr.prototype.DialContext = function(ctx, network, address) { var $24r, $24r$1, $24r$2, _arg, _arg$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$19, _r$20, _r$21, _r$9, _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, _tuple$8, address, addrs, c, cancel, cancel$1, ctx, d, d$1, deadline, err, fallbacks, ka, network, ok, ok$1, oldCancel, primaries, resolveCtx, sd, shadow, subCtx, subCtx$1, tc, trace, x, x$1, x$2, x$3, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _arg = $f._arg; _arg$1 = $f._arg$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$20 = $f._r$20; _r$21 = $f._r$21; _r$9 = $f._r$9; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _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; _tuple$8 = $f._tuple$8; address = $f.address; addrs = $f.addrs; c = $f.c; cancel = $f.cancel; cancel$1 = $f.cancel$1; ctx = $f.ctx; d = $f.d; d$1 = $f.d$1; deadline = $f.deadline; err = $f.err; fallbacks = $f.fallbacks; ka = $f.ka; network = $f.network; ok = $f.ok; ok$1 = $f.ok$1; oldCancel = $f.oldCancel; primaries = $f.primaries; resolveCtx = $f.resolveCtx; sd = $f.sd; shadow = $f.shadow; subCtx = $f.subCtx; subCtx$1 = $f.subCtx$1; tc = $f.tc; trace = $f.trace; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); cancel = [cancel]; oldCancel = [oldCancel]; shadow = [shadow]; subCtx = [subCtx]; d = this; if ($interfaceIsEqual(ctx, $ifaceNil)) { $panic(new $String("nil context")); } _arg = ctx; _r$9 = time.Now(); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _arg$1 = $clone(_r$9, time.Time); _r$10 = d.deadline(_arg, _arg$1); /* */ $s = 2; case 2: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } deadline = $clone(_r$10, time.Time); /* */ if (!$clone(deadline, time.Time).IsZero()) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!$clone(deadline, time.Time).IsZero()) { */ case 3: _r$11 = ctx.Deadline(); /* */ $s = 5; case 5: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tuple = _r$11; d$1 = $clone(_tuple[0], time.Time); ok = _tuple[1]; /* */ if (!ok || $clone(deadline, time.Time).Before($clone(d$1, time.Time))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!ok || $clone(deadline, time.Time).Before($clone(d$1, time.Time))) { */ case 6: _r$12 = context.WithDeadline(ctx, $clone(deadline, time.Time)); /* */ $s = 8; case 8: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _tuple$1 = _r$12; subCtx$1 = _tuple$1[0]; cancel$1 = _tuple$1[1]; $deferred.push([cancel$1, []]); ctx = subCtx$1; /* } */ case 7: /* } */ case 4: oldCancel[0] = d.Cancel; /* */ if (!(oldCancel[0] === $chanNil)) { $s = 9; continue; } /* */ $s = 10; continue; /* if (!(oldCancel[0] === $chanNil)) { */ case 9: _r$13 = context.WithCancel(ctx); /* */ $s = 11; case 11: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _tuple$2 = _r$13; subCtx[0] = _tuple$2[0]; cancel[0] = _tuple$2[1]; $deferred.push([cancel[0], []]); $go((function(cancel, oldCancel, shadow, subCtx) { return function $b() { var _r$14, _r$15, _selection, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$14 = $f._r$14; _r$15 = $f._r$15; _selection = $f._selection; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$14 = subCtx[0].Done(); /* */ $s = 1; case 1: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _r$15 = $select([[oldCancel[0]], [_r$14]]); /* */ $s = 2; case 2: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _selection = _r$15; /* */ if (_selection[0] === 0) { $s = 3; continue; } /* */ if (_selection[0] === 1) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_selection[0] === 0) { */ case 3: $r = cancel[0](); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 5; continue; /* } else if (_selection[0] === 1) { */ case 4: /* } */ case 5: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$14 = _r$14; $f._r$15 = _r$15; $f._selection = _selection; $f.$s = $s; $f.$r = $r; return $f; }; })(cancel, oldCancel, shadow, subCtx), []); ctx = subCtx[0]; /* } */ case 10: resolveCtx = ctx; _r$14 = ctx.Value((x = new nettrace.TraceKey.ptr(), new x.constructor.elem(x))); /* */ $s = 12; case 12: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _tuple$3 = $assertType(_r$14, ptrType$35, true); trace = _tuple$3[0]; /* */ if (!(trace === ptrType$35.nil)) { $s = 13; continue; } /* */ $s = 14; continue; /* if (!(trace === ptrType$35.nil)) { */ case 13: shadow[0] = $clone(trace, nettrace.Trace); shadow[0].ConnectStart = $throwNilPointerError; shadow[0].ConnectDone = $throwNilPointerError; _r$15 = context.WithValue(resolveCtx, (x$1 = new nettrace.TraceKey.ptr(), new x$1.constructor.elem(x$1)), shadow[0]); /* */ $s = 15; case 15: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } resolveCtx = _r$15; /* } */ case 14: _r$16 = d.resolver().resolveAddrList(resolveCtx, "dial", network, address, d.LocalAddr); /* */ $s = 16; case 16: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _tuple$4 = _r$16; addrs = _tuple$4[0]; err = _tuple$4[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 17; continue; } /* */ $s = 18; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 17: $24r = [$ifaceNil, new OpError.ptr("dial", network, $ifaceNil, $ifaceNil, err)]; $s = 19; case 19: return $24r; /* } */ case 18: sd = new sysDialer.ptr($clone(d, Dialer), network, address); _tmp = addrList.nil; _tmp$1 = addrList.nil; primaries = _tmp; fallbacks = _tmp$1; /* */ if (d.dualStack() && network === "tcp") { $s = 20; continue; } /* */ $s = 21; continue; /* if (d.dualStack() && network === "tcp") { */ case 20: _r$17 = addrs.partition(isIPv4); /* */ $s = 23; case 23: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } _tuple$5 = _r$17; primaries = _tuple$5[0]; fallbacks = _tuple$5[1]; $s = 22; continue; /* } else { */ case 21: primaries = addrs; /* } */ case 22: c = $ifaceNil; /* */ if (fallbacks.$length > 0) { $s = 24; continue; } /* */ $s = 25; continue; /* if (fallbacks.$length > 0) { */ case 24: _r$18 = sd.dialParallel(ctx, primaries, fallbacks); /* */ $s = 27; case 27: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } _tuple$6 = _r$18; c = _tuple$6[0]; err = _tuple$6[1]; $s = 26; continue; /* } else { */ case 25: _r$19 = sd.dialSerial(ctx, primaries); /* */ $s = 28; case 28: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } _tuple$7 = _r$19; c = _tuple$7[0]; err = _tuple$7[1]; /* } */ case 26: /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 29; continue; } /* */ $s = 30; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 29: $24r$1 = [$ifaceNil, err]; $s = 31; case 31: return $24r$1; /* } */ case 30: _tuple$8 = $assertType(c, ptrType$20, true); tc = _tuple$8[0]; ok$1 = _tuple$8[1]; /* */ if (ok$1 && (x$2 = d.KeepAlive, (x$2.$high > 0 || (x$2.$high === 0 && x$2.$low >= 0)))) { $s = 32; continue; } /* */ $s = 33; continue; /* if (ok$1 && (x$2 = d.KeepAlive, (x$2.$high > 0 || (x$2.$high === 0 && x$2.$low >= 0)))) { */ case 32: _r$20 = setKeepAlive(tc.conn.fd, true); /* */ $s = 34; case 34: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } _r$20; ka = d.KeepAlive; if ((x$3 = d.KeepAlive, (x$3.$high === 0 && x$3.$low === 0))) { ka = new time.Duration(3, 2115098112); } _r$21 = setKeepAlivePeriod(tc.conn.fd, ka); /* */ $s = 35; case 35: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } _r$21; $r = testHookSetKeepAlive(ka); /* */ $s = 36; case 36: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 33: $24r$2 = [c, $ifaceNil]; $s = 37; case 37: return $24r$2; /* */ } return; } } catch(err) { $err = err; $s = -1; return [$ifaceNil, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Dialer.ptr.prototype.DialContext }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._arg = _arg; $f._arg$1 = _arg$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$20 = _r$20; $f._r$21 = _r$21; $f._r$9 = _r$9; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $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._tuple$8 = _tuple$8; $f.address = address; $f.addrs = addrs; $f.c = c; $f.cancel = cancel; $f.cancel$1 = cancel$1; $f.ctx = ctx; $f.d = d; $f.d$1 = d$1; $f.deadline = deadline; $f.err = err; $f.fallbacks = fallbacks; $f.ka = ka; $f.network = network; $f.ok = ok; $f.ok$1 = ok$1; $f.oldCancel = oldCancel; $f.primaries = primaries; $f.resolveCtx = resolveCtx; $f.sd = sd; $f.shadow = shadow; $f.subCtx = subCtx; $f.subCtx$1 = subCtx$1; $f.tc = tc; $f.trace = trace; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Dialer.prototype.DialContext = function(ctx, network, address) { return this.$val.DialContext(ctx, network, address); }; sysDialer.ptr.prototype.dialParallel = function(ctx, primaries, fallbacks) { var $24r, $24r$1, $24r$2, _arg, _r$10, _r$11, _r$12, _r$13, _r$14, _r$9, _selection, _tmp, _tmp$1, _tuple, _tuple$1, ctx, fallback, fallbackCancel, fallbackCtx, fallbackTimer, fallbacks, primaries, primary, primaryCancel, primaryCtx, res, results, returned, sd, startRacer, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _arg = $f._arg; _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$9 = $f._r$9; _selection = $f._selection; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; ctx = $f.ctx; fallback = $f.fallback; fallbackCancel = $f.fallbackCancel; fallbackCtx = $f.fallbackCtx; fallbackTimer = $f.fallbackTimer; fallbacks = $f.fallbacks; primaries = $f.primaries; primary = $f.primary; primaryCancel = $f.primaryCancel; primaryCtx = $f.primaryCtx; res = $f.res; results = $f.results; returned = $f.returned; sd = $f.sd; startRacer = $f.startRacer; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fallbacks = [fallbacks]; primaries = [primaries]; results = [results]; returned = [returned]; sd = [sd]; sd[0] = this; /* */ if (fallbacks[0].$length === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (fallbacks[0].$length === 0) { */ case 1: _r$9 = sd[0].dialSerial(ctx, primaries[0]); /* */ $s = 3; case 3: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $24r = _r$9; $s = 4; case 4: return $24r; /* } */ case 2: returned[0] = new $Chan(structType$2, 0); $deferred.push([function(_arg) { $close(_arg); }, [returned[0]]]); results[0] = new $Chan(dialResult, 0); startRacer = (function(fallbacks, primaries, results, returned, sd) { return function $b(ctx$1, primary) { var _r$10, _r$11, _r$12, _selection, _tuple, c, ctx$1, err, primary, ras, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _selection = $f._selection; _tuple = $f._tuple; c = $f.c; ctx$1 = $f.ctx$1; err = $f.err; primary = $f.primary; ras = $f.ras; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ras = primaries[0]; if (!primary) { ras = fallbacks[0]; } _r$10 = sd[0].dialSerial(ctx$1, ras); /* */ $s = 1; case 1: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple = _r$10; c = _tuple[0]; err = _tuple[1]; _r$11 = $select([[results[0], new dialResult.ptr(c, err, primary, true)], [returned[0]]]); /* */ $s = 2; case 2: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _selection = _r$11; /* */ if (_selection[0] === 0) { $s = 3; continue; } /* */ if (_selection[0] === 1) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_selection[0] === 0) { */ case 3: $s = 5; continue; /* } else if (_selection[0] === 1) { */ case 4: /* */ if (!($interfaceIsEqual(c, $ifaceNil))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!($interfaceIsEqual(c, $ifaceNil))) { */ case 6: _r$12 = c.Close(); /* */ $s = 8; case 8: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _r$12; /* } */ case 7: /* } */ case 5: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._selection = _selection; $f._tuple = _tuple; $f.c = c; $f.ctx$1 = ctx$1; $f.err = err; $f.primary = primary; $f.ras = ras; $f.$s = $s; $f.$r = $r; return $f; }; })(fallbacks, primaries, results, returned, sd); _tmp = new dialResult.ptr($ifaceNil, $ifaceNil, false, false); _tmp$1 = new dialResult.ptr($ifaceNil, $ifaceNil, false, false); primary = $clone(_tmp, dialResult); fallback = $clone(_tmp$1, dialResult); _r$10 = context.WithCancel(ctx); /* */ $s = 5; case 5: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple = _r$10; primaryCtx = _tuple[0]; primaryCancel = _tuple[1]; $deferred.push([primaryCancel, []]); $go(startRacer, [primaryCtx, true]); _r$11 = time.NewTimer(sd[0].Dialer.fallbackDelay()); /* */ $s = 6; case 6: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } fallbackTimer = _r$11; $deferred.push([$methodVal(fallbackTimer, "Stop"), []]); /* while (true) { */ case 7: _r$12 = $select([[fallbackTimer.C], [results[0]]]); /* */ $s = 9; case 9: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _selection = _r$12; /* */ if (_selection[0] === 0) { $s = 10; continue; } /* */ if (_selection[0] === 1) { $s = 11; continue; } /* */ $s = 12; continue; /* if (_selection[0] === 0) { */ case 10: _r$13 = context.WithCancel(ctx); /* */ $s = 13; case 13: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _tuple$1 = _r$13; fallbackCtx = _tuple$1[0]; fallbackCancel = _tuple$1[1]; $deferred.push([fallbackCancel, []]); $go(startRacer, [fallbackCtx, false]); $s = 12; continue; /* } else if (_selection[0] === 1) { */ case 11: res = $clone(_selection[1][0], dialResult); /* */ if ($interfaceIsEqual(res.error, $ifaceNil)) { $s = 14; continue; } /* */ $s = 15; continue; /* if ($interfaceIsEqual(res.error, $ifaceNil)) { */ case 14: $24r$1 = [res.Conn, $ifaceNil]; $s = 16; case 16: return $24r$1; /* } */ case 15: if (res.primary) { dialResult.copy(primary, res); } else { dialResult.copy(fallback, res); } /* */ if (primary.done && fallback.done) { $s = 17; continue; } /* */ $s = 18; continue; /* if (primary.done && fallback.done) { */ case 17: $24r$2 = [$ifaceNil, primary.error]; $s = 19; case 19: return $24r$2; /* } */ case 18: /* */ if (res.primary && fallbackTimer.Stop()) { $s = 20; continue; } /* */ $s = 21; continue; /* if (res.primary && fallbackTimer.Stop()) { */ case 20: _r$14 = fallbackTimer.Reset(new time.Duration(0, 0)); /* */ $s = 22; case 22: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _r$14; /* } */ case 21: /* } */ case 12: $s = 7; continue; case 8: $s = -1; return [$ifaceNil, $ifaceNil]; /* */ } return; } } catch(err) { $err = err; $s = -1; return [$ifaceNil, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: sysDialer.ptr.prototype.dialParallel }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._arg = _arg; $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$9 = _r$9; $f._selection = _selection; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.ctx = ctx; $f.fallback = fallback; $f.fallbackCancel = fallbackCancel; $f.fallbackCtx = fallbackCtx; $f.fallbackTimer = fallbackTimer; $f.fallbacks = fallbacks; $f.primaries = primaries; $f.primary = primary; $f.primaryCancel = primaryCancel; $f.primaryCtx = primaryCtx; $f.res = res; $f.results = results; $f.returned = returned; $f.sd = sd; $f.startRacer = startRacer; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; sysDialer.prototype.dialParallel = function(ctx, primaries, fallbacks) { return this.$val.dialParallel(ctx, primaries, fallbacks); }; sysDialer.ptr.prototype.dialSerial = function(ctx, ras) { var $24r, $24r$1, $24r$2, _i, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$9, _ref, _selection, _tuple, _tuple$1, _tuple$2, _tuple$3, c, cancel, ctx, deadline, dialCtx, err, err$1, firstErr, hasDeadline, i, partialDeadline$1, ra, ras, sd, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _i = $f._i; _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$9 = $f._r$9; _ref = $f._ref; _selection = $f._selection; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; c = $f.c; cancel = $f.cancel; ctx = $f.ctx; deadline = $f.deadline; dialCtx = $f.dialCtx; err = $f.err; err$1 = $f.err$1; firstErr = $f.firstErr; hasDeadline = $f.hasDeadline; i = $f.i; partialDeadline$1 = $f.partialDeadline$1; ra = $f.ra; ras = $f.ras; sd = $f.sd; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); sd = this; firstErr = $ifaceNil; _ref = ras; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } i = _i; ra = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r$9 = ctx.Done(); /* */ $s = 3; case 3: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _selection = $select([[_r$9], []]); /* */ if (_selection[0] === 0) { $s = 4; continue; } /* */ if (_selection[0] === 1) { $s = 5; continue; } /* */ $s = 6; continue; /* if (_selection[0] === 0) { */ case 4: _r$10 = ctx.Err(); /* */ $s = 7; case 7: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$11 = mapErr(_r$10); /* */ $s = 8; case 8: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } $24r = [$ifaceNil, new OpError.ptr("dial", sd.network, sd.Dialer.LocalAddr, ra, _r$11)]; $s = 9; case 9: return $24r; /* } else if (_selection[0] === 1) { */ case 5: /* } */ case 6: dialCtx = ctx; _r$12 = ctx.Deadline(); /* */ $s = 10; case 10: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _tuple = _r$12; deadline = $clone(_tuple[0], time.Time); hasDeadline = _tuple[1]; /* */ if (hasDeadline) { $s = 11; continue; } /* */ $s = 12; continue; /* if (hasDeadline) { */ case 11: _r$13 = time.Now(); /* */ $s = 13; case 13: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _r$14 = partialDeadline($clone(_r$13, time.Time), $clone(deadline, time.Time), ras.$length - i >> 0); /* */ $s = 14; case 14: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _tuple$1 = _r$14; partialDeadline$1 = $clone(_tuple$1[0], time.Time); err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { if ($interfaceIsEqual(firstErr, $ifaceNil)) { firstErr = new OpError.ptr("dial", sd.network, sd.Dialer.LocalAddr, ra, err); } /* break; */ $s = 2; continue; } /* */ if ($clone(partialDeadline$1, time.Time).Before($clone(deadline, time.Time))) { $s = 15; continue; } /* */ $s = 16; continue; /* if ($clone(partialDeadline$1, time.Time).Before($clone(deadline, time.Time))) { */ case 15: cancel = $throwNilPointerError; _r$15 = context.WithDeadline(ctx, $clone(partialDeadline$1, time.Time)); /* */ $s = 17; case 17: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _tuple$2 = _r$15; dialCtx = _tuple$2[0]; cancel = _tuple$2[1]; $deferred.push([cancel, []]); /* } */ case 16: /* } */ case 12: _r$16 = sd.dialSingle(dialCtx, ra); /* */ $s = 18; case 18: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _tuple$3 = _r$16; c = _tuple$3[0]; err$1 = _tuple$3[1]; /* */ if ($interfaceIsEqual(err$1, $ifaceNil)) { $s = 19; continue; } /* */ $s = 20; continue; /* if ($interfaceIsEqual(err$1, $ifaceNil)) { */ case 19: $24r$1 = [c, $ifaceNil]; $s = 21; case 21: return $24r$1; /* } */ case 20: if ($interfaceIsEqual(firstErr, $ifaceNil)) { firstErr = err$1; } _i++; $s = 1; continue; case 2: if ($interfaceIsEqual(firstErr, $ifaceNil)) { firstErr = new OpError.ptr("dial", sd.network, $ifaceNil, $ifaceNil, errMissingAddress); } $24r$2 = [$ifaceNil, firstErr]; $s = 22; case 22: return $24r$2; /* */ } return; } } catch(err) { $err = err; $s = -1; return [$ifaceNil, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: sysDialer.ptr.prototype.dialSerial }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._i = _i; $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$9 = _r$9; $f._ref = _ref; $f._selection = _selection; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.c = c; $f.cancel = cancel; $f.ctx = ctx; $f.deadline = deadline; $f.dialCtx = dialCtx; $f.err = err; $f.err$1 = err$1; $f.firstErr = firstErr; $f.hasDeadline = hasDeadline; $f.i = i; $f.partialDeadline$1 = partialDeadline$1; $f.ra = ra; $f.ras = ras; $f.sd = sd; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; sysDialer.prototype.dialSerial = function(ctx, ras) { return this.$val.dialSerial(ctx, ras); }; sysDialer.ptr.prototype.dialSingle = function(ctx, ra) { var $24r, $24r$1, $24r$2, _r$10, _r$11, _r$12, _r$13, _r$14, _r$9, _ref, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, _tuple$8, c, ctx, err, la, la$1, la$2, la$3, la$4, ra, ra$1, ra$2, ra$3, ra$4, ra$5, raStr, sd, trace, x, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _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$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; _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; c = $f.c; ctx = $f.ctx; err = $f.err; la = $f.la; la$1 = $f.la$1; la$2 = $f.la$2; la$3 = $f.la$3; la$4 = $f.la$4; ra = $f.ra; ra$1 = $f.ra$1; ra$2 = $f.ra$2; ra$3 = $f.ra$3; ra$4 = $f.ra$4; ra$5 = $f.ra$5; raStr = $f.raStr; sd = $f.sd; trace = $f.trace; x = $f.x; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); err = [err]; raStr = [raStr]; sd = [sd]; trace = [trace]; c = $ifaceNil; err[0] = $ifaceNil; sd[0] = this; _r$9 = ctx.Value((x = new nettrace.TraceKey.ptr(), new x.constructor.elem(x))); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = $assertType(_r$9, ptrType$35, true); trace[0] = _tuple[0]; /* */ if (!(trace[0] === ptrType$35.nil)) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!(trace[0] === ptrType$35.nil)) { */ case 2: _r$10 = ra.String(); /* */ $s = 4; case 4: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } raStr[0] = _r$10; /* */ if (!(trace[0].ConnectStart === $throwNilPointerError)) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!(trace[0].ConnectStart === $throwNilPointerError)) { */ case 5: $r = trace[0].ConnectStart(sd[0].network, raStr[0]); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 6: /* */ if (!(trace[0].ConnectDone === $throwNilPointerError)) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!(trace[0].ConnectDone === $throwNilPointerError)) { */ case 8: $deferred.push([(function(err, raStr, sd, trace) { return function $b() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = trace[0].ConnectDone(sd[0].network, raStr[0], err[0]); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$s = $s; $f.$r = $r; return $f; }; })(err, raStr, sd, trace), []]); /* } */ case 9: /* } */ case 3: la = sd[0].Dialer.LocalAddr; _ref = ra; /* */ if ($assertType(_ref, ptrType$19, true)[1]) { $s = 10; continue; } /* */ if ($assertType(_ref, ptrType$16, true)[1]) { $s = 11; continue; } /* */ if ($assertType(_ref, ptrType$25, true)[1]) { $s = 12; continue; } /* */ if ($assertType(_ref, ptrType$9, true)[1]) { $s = 13; continue; } /* */ $s = 14; continue; /* if ($assertType(_ref, ptrType$19, true)[1]) { */ case 10: ra$1 = _ref.$val; _tuple$1 = $assertType(la, ptrType$19, true); la$1 = _tuple$1[0]; _r$11 = sd[0].dialTCP(ctx, la$1, ra$1); /* */ $s = 16; case 16: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tuple$2 = _r$11; c = _tuple$2[0]; err[0] = _tuple$2[1]; $s = 15; continue; /* } else if ($assertType(_ref, ptrType$16, true)[1]) { */ case 11: ra$2 = _ref.$val; _tuple$3 = $assertType(la, ptrType$16, true); la$2 = _tuple$3[0]; _r$12 = sd[0].dialUDP(ctx, la$2, ra$2); /* */ $s = 17; case 17: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _tuple$4 = _r$12; c = _tuple$4[0]; err[0] = _tuple$4[1]; $s = 15; continue; /* } else if ($assertType(_ref, ptrType$25, true)[1]) { */ case 12: ra$3 = _ref.$val; _tuple$5 = $assertType(la, ptrType$25, true); la$3 = _tuple$5[0]; _r$13 = sd[0].dialIP(ctx, la$3, ra$3); /* */ $s = 18; case 18: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _tuple$6 = _r$13; c = _tuple$6[0]; err[0] = _tuple$6[1]; $s = 15; continue; /* } else if ($assertType(_ref, ptrType$9, true)[1]) { */ case 13: ra$4 = _ref.$val; _tuple$7 = $assertType(la, ptrType$9, true); la$4 = _tuple$7[0]; _r$14 = sd[0].dialUnix(ctx, la$4, ra$4); /* */ $s = 19; case 19: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _tuple$8 = _r$14; c = _tuple$8[0]; err[0] = _tuple$8[1]; $s = 15; continue; /* } else { */ case 14: ra$5 = _ref; _tmp = $ifaceNil; _tmp$1 = new OpError.ptr("dial", sd[0].network, la, ra$5, new AddrError.ptr("unexpected address type", sd[0].address)); c = _tmp; err[0] = _tmp$1; $24r = [c, err[0]]; $s = 20; case 20: return $24r; /* } */ case 15: /* */ if (!($interfaceIsEqual(err[0], $ifaceNil))) { $s = 21; continue; } /* */ $s = 22; continue; /* if (!($interfaceIsEqual(err[0], $ifaceNil))) { */ case 21: _tmp$2 = $ifaceNil; _tmp$3 = new OpError.ptr("dial", sd[0].network, la, ra, err[0]); c = _tmp$2; err[0] = _tmp$3; $24r$1 = [c, err[0]]; $s = 23; case 23: return $24r$1; /* } */ case 22: _tmp$4 = c; _tmp$5 = $ifaceNil; c = _tmp$4; err[0] = _tmp$5; $24r$2 = [c, err[0]]; $s = 24; case 24: return $24r$2; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [c, err[0]]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: sysDialer.ptr.prototype.dialSingle }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $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$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._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.c = c; $f.ctx = ctx; $f.err = err; $f.la = la; $f.la$1 = la$1; $f.la$2 = la$2; $f.la$3 = la$3; $f.la$4 = la$4; $f.ra = ra; $f.ra$1 = ra$1; $f.ra$2 = ra$2; $f.ra$3 = ra$3; $f.ra$4 = ra$4; $f.ra$5 = ra$5; $f.raStr = raStr; $f.sd = sd; $f.trace = trace; $f.x = x; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; sysDialer.prototype.dialSingle = function(ctx, ra) { return this.$val.dialSingle(ctx, ra); }; systemConf = function() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = confOnce.Do(initConfVal); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return confVal; /* */ } return; } if ($f === undefined) { $f = { $blk: systemConf }; } $f.$s = $s; $f.$r = $r; return $f; }; initConfVal = function() { var _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$9, _tuple, _tuple$1, _tuple$2, _v, _v$1, debugLevel, dnsMode, err, localDomainDefined, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _v = $f._v; _v$1 = $f._v$1; debugLevel = $f.debugLevel; dnsMode = $f.dnsMode; err = $f.err; localDomainDefined = $f.localDomainDefined; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); _r$9 = goDebugNetDNS(); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; dnsMode = _tuple[0]; debugLevel = _tuple[1]; confVal.dnsDebugLevel = debugLevel; confVal.netGo = netGo || dnsMode === "go"; confVal.netCgo = netCgo || dnsMode === "cgo"; /* */ if (confVal.dnsDebugLevel > 0) { $s = 2; continue; } /* */ $s = 3; continue; /* if (confVal.dnsDebugLevel > 0) { */ case 2: $deferred.push([(function() { if (confVal.netGo) { if (netGo) { console.log("go package net: built with netgo build tag; using Go's DNS resolver"); } else { console.log("go package net: GODEBUG setting forcing use of Go's resolver"); } } else if (confVal.forceCgoLookupHost) { console.log("go package net: using cgo DNS resolver"); } else { console.log("go package net: dynamic selection of DNS resolver"); } }), []]); /* } */ case 3: /* */ if (false) { $s = 4; continue; } /* */ $s = 5; continue; /* if (false) { */ case 4: confVal.forceCgoLookupHost = true; $s = 6; case 6: return; /* } */ case 5: _r$10 = syscall.Getenv("LOCALDOMAIN"); /* */ $s = 7; case 7: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$1 = _r$10; localDomainDefined = _tuple$1[1]; _r$11 = os.Getenv("RES_OPTIONS"); /* */ $s = 11; case 11: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } if (!(_r$11 === "")) { _v = true; $s = 10; continue s; } _r$12 = os.Getenv("HOSTALIASES"); /* */ $s = 12; case 12: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _v = !(_r$12 === ""); case 10: /* */ if (_v || confVal.netCgo || localDomainDefined) { $s = 8; continue; } /* */ $s = 9; continue; /* if (_v || confVal.netCgo || localDomainDefined) { */ case 8: confVal.forceCgoLookupHost = true; $s = 13; case 13: return; /* } */ case 9: if (!(false)) { _v$1 = false; $s = 16; continue s; } _r$13 = os.Getenv("ASR_CONFIG"); /* */ $s = 17; case 17: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _v$1 = !(_r$13 === ""); case 16: /* */ if (_v$1) { $s = 14; continue; } /* */ $s = 15; continue; /* if (_v$1) { */ case 14: confVal.forceCgoLookupHost = true; $s = 18; case 18: return; /* } */ case 15: /* */ if (true) { $s = 19; continue; } /* */ $s = 20; continue; /* if (true) { */ case 19: _r$14 = parseNSSConfFile("/etc/nsswitch.conf"); /* */ $s = 21; case 21: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } confVal.nss = _r$14; /* } */ case 20: _r$15 = dnsReadConfig("/etc/resolv.conf"); /* */ $s = 22; case 22: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } confVal.resolv = _r$15; if (!($interfaceIsEqual(confVal.resolv.err, $ifaceNil)) && !os.IsNotExist(confVal.resolv.err) && !os.IsPermission(confVal.resolv.err)) { confVal.forceCgoLookupHost = true; } _r$16 = os.Stat("/etc/mdns.allow"); /* */ $s = 23; case 23: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _tuple$2 = _r$16; err = _tuple$2[1]; if ($interfaceIsEqual(err, $ifaceNil)) { confVal.hasMDNSAllow = true; } $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: initConfVal }; } $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$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._v = _v; $f._v$1 = _v$1; $f.debugLevel = debugLevel; $f.dnsMode = dnsMode; $f.err = err; $f.localDomainDefined = localDomainDefined; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; conf.ptr.prototype.canUseCgo = function() { var $24r, _r$9, c, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$9 = $f._r$9; c = $f.c; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r$9 = c.hostLookupOrder(ptrType$13.nil, ""); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $24r = _r$9 === 0; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: conf.ptr.prototype.canUseCgo }; } $f.$24r = $24r; $f._r$9 = _r$9; $f.c = c; $f.$s = $s; $f.$r = $r; return $f; }; conf.prototype.canUseCgo = function() { return this.$val.canUseCgo(); }; conf.ptr.prototype.hostLookupOrder = function(r, hostname) { var $24r, $24r$1, $24r$10, $24r$11, $24r$12, $24r$13, $24r$14, $24r$15, $24r$16, $24r$17, $24r$18, $24r$19, $24r$2, $24r$20, $24r$21, $24r$22, $24r$23, $24r$24, $24r$25, $24r$3, $24r$4, $24r$5, $24r$6, $24r$7, $24r$8, $24r$9, _1, _entry, _i, _r$9, _ref, _tmp, _tmp$1, _tmp$2, _tuple, c, dnsSource, err, fallbackOrder, filesSource, first, hn, hostname, lookup, mdnsSource, nss, r, ret, src, srcs, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$10 = $f.$24r$10; $24r$11 = $f.$24r$11; $24r$12 = $f.$24r$12; $24r$13 = $f.$24r$13; $24r$14 = $f.$24r$14; $24r$15 = $f.$24r$15; $24r$16 = $f.$24r$16; $24r$17 = $f.$24r$17; $24r$18 = $f.$24r$18; $24r$19 = $f.$24r$19; $24r$2 = $f.$24r$2; $24r$20 = $f.$24r$20; $24r$21 = $f.$24r$21; $24r$22 = $f.$24r$22; $24r$23 = $f.$24r$23; $24r$24 = $f.$24r$24; $24r$25 = $f.$24r$25; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; $24r$6 = $f.$24r$6; $24r$7 = $f.$24r$7; $24r$8 = $f.$24r$8; $24r$9 = $f.$24r$9; _1 = $f._1; _entry = $f._entry; _i = $f._i; _r$9 = $f._r$9; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tuple = $f._tuple; c = $f.c; dnsSource = $f.dnsSource; err = $f.err; fallbackOrder = $f.fallbackOrder; filesSource = $f.filesSource; first = $f.first; hn = $f.hn; hostname = $f.hostname; lookup = $f.lookup; mdnsSource = $f.mdnsSource; nss = $f.nss; r = $f.r; ret = $f.ret; src = $f.src; srcs = $f.srcs; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); hostname = [hostname]; ret = [ret]; ret[0] = 0; c = this; /* */ if (c.dnsDebugLevel > 1) { $s = 1; continue; } /* */ $s = 2; continue; /* if (c.dnsDebugLevel > 1) { */ case 1: $deferred.push([(function(hostname, ret) { return function() { $print("go package net: hostLookupOrder(", hostname[0], ") = ", new hostLookupOrder(ret[0]).String(), "\n"); }; })(hostname, ret), []]); /* } */ case 2: fallbackOrder = 0; if (c.netGo || r.preferGo()) { fallbackOrder = 1; } /* */ if (c.forceCgoLookupHost || c.resolv.unknownOpt || c.goos === "android") { $s = 3; continue; } /* */ $s = 4; continue; /* if (c.forceCgoLookupHost || c.resolv.unknownOpt || c.goos === "android") { */ case 3: ret[0] = fallbackOrder; $24r = ret[0]; $s = 5; case 5: return $24r; /* } */ case 4: /* */ if (!((bytealg.IndexByteString(hostname[0], 92) === -1)) || !((bytealg.IndexByteString(hostname[0], 37) === -1))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!((bytealg.IndexByteString(hostname[0], 92) === -1)) || !((bytealg.IndexByteString(hostname[0], 37) === -1))) { */ case 6: ret[0] = fallbackOrder; $24r$1 = ret[0]; $s = 8; case 8: return $24r$1; /* } */ case 7: /* */ if (c.goos === "openbsd") { $s = 9; continue; } /* */ $s = 10; continue; /* if (c.goos === "openbsd") { */ case 9: /* */ if (os.IsNotExist(c.resolv.err)) { $s = 11; continue; } /* */ $s = 12; continue; /* if (os.IsNotExist(c.resolv.err)) { */ case 11: ret[0] = 3; $24r$2 = ret[0]; $s = 13; case 13: return $24r$2; /* } */ case 12: lookup = c.resolv.lookup; /* */ if (lookup.$length === 0) { $s = 14; continue; } /* */ $s = 15; continue; /* if (lookup.$length === 0) { */ case 14: ret[0] = 2; $24r$3 = ret[0]; $s = 16; case 16: return $24r$3; /* } */ case 15: /* */ if (lookup.$length < 1 || lookup.$length > 2) { $s = 17; continue; } /* */ $s = 18; continue; /* if (lookup.$length < 1 || lookup.$length > 2) { */ case 17: ret[0] = fallbackOrder; $24r$4 = ret[0]; $s = 19; case 19: return $24r$4; /* } */ case 18: _1 = (0 >= lookup.$length ? ($throwRuntimeError("index out of range"), undefined) : lookup.$array[lookup.$offset + 0]); /* */ if (_1 === ("bind")) { $s = 21; continue; } /* */ if (_1 === ("file")) { $s = 22; continue; } /* */ $s = 23; continue; /* if (_1 === ("bind")) { */ case 21: /* */ if (lookup.$length === 2) { $s = 25; continue; } /* */ $s = 26; continue; /* if (lookup.$length === 2) { */ case 25: /* */ if ((1 >= lookup.$length ? ($throwRuntimeError("index out of range"), undefined) : lookup.$array[lookup.$offset + 1]) === "file") { $s = 27; continue; } /* */ $s = 28; continue; /* if ((1 >= lookup.$length ? ($throwRuntimeError("index out of range"), undefined) : lookup.$array[lookup.$offset + 1]) === "file") { */ case 27: ret[0] = 2; $24r$5 = ret[0]; $s = 29; case 29: return $24r$5; /* } */ case 28: ret[0] = fallbackOrder; $24r$6 = ret[0]; $s = 30; case 30: return $24r$6; /* } */ case 26: ret[0] = 4; $24r$7 = ret[0]; $s = 31; case 31: return $24r$7; /* } else if (_1 === ("file")) { */ case 22: /* */ if (lookup.$length === 2) { $s = 32; continue; } /* */ $s = 33; continue; /* if (lookup.$length === 2) { */ case 32: /* */ if ((1 >= lookup.$length ? ($throwRuntimeError("index out of range"), undefined) : lookup.$array[lookup.$offset + 1]) === "bind") { $s = 34; continue; } /* */ $s = 35; continue; /* if ((1 >= lookup.$length ? ($throwRuntimeError("index out of range"), undefined) : lookup.$array[lookup.$offset + 1]) === "bind") { */ case 34: ret[0] = 1; $24r$8 = ret[0]; $s = 36; case 36: return $24r$8; /* } */ case 35: ret[0] = fallbackOrder; $24r$9 = ret[0]; $s = 37; case 37: return $24r$9; /* } */ case 33: ret[0] = 3; $24r$10 = ret[0]; $s = 38; case 38: return $24r$10; /* } else { */ case 23: ret[0] = fallbackOrder; $24r$11 = ret[0]; $s = 39; case 39: return $24r$11; /* } */ case 24: case 20: /* } */ case 10: if (stringsHasSuffix(hostname[0], ".")) { hostname[0] = $substring(hostname[0], 0, (hostname[0].length - 1 >> 0)); } /* */ if (stringsHasSuffixFold(hostname[0], ".local")) { $s = 40; continue; } /* */ $s = 41; continue; /* if (stringsHasSuffixFold(hostname[0], ".local")) { */ case 40: ret[0] = fallbackOrder; $24r$12 = ret[0]; $s = 42; case 42: return $24r$12; /* } */ case 41: nss = c.nss; srcs = (_entry = nss.sources[$String.keyFor("hosts")], _entry !== undefined ? _entry.v : sliceType$4.nil); /* */ if (os.IsNotExist(nss.err) || ($interfaceIsEqual(nss.err, $ifaceNil) && (srcs.$length === 0))) { $s = 43; continue; } /* */ $s = 44; continue; /* if (os.IsNotExist(nss.err) || ($interfaceIsEqual(nss.err, $ifaceNil) && (srcs.$length === 0))) { */ case 43: /* */ if (c.goos === "solaris") { $s = 45; continue; } /* */ $s = 46; continue; /* if (c.goos === "solaris") { */ case 45: ret[0] = fallbackOrder; $24r$13 = ret[0]; $s = 47; case 47: return $24r$13; /* } */ case 46: ret[0] = 1; $24r$14 = ret[0]; $s = 48; case 48: return $24r$14; /* } */ case 44: /* */ if (!($interfaceIsEqual(nss.err, $ifaceNil))) { $s = 49; continue; } /* */ $s = 50; continue; /* if (!($interfaceIsEqual(nss.err, $ifaceNil))) { */ case 49: ret[0] = fallbackOrder; $24r$15 = ret[0]; $s = 51; case 51: return $24r$15; /* } */ case 50: _tmp = false; _tmp$1 = false; _tmp$2 = false; mdnsSource = _tmp; filesSource = _tmp$1; dnsSource = _tmp$2; first = ""; _ref = srcs; _i = 0; /* while (true) { */ case 52: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 53; continue; } src = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), nssSource); /* */ if (src.source === "myhostname") { $s = 54; continue; } /* */ $s = 55; continue; /* if (src.source === "myhostname") { */ case 54: /* */ if (isLocalhost(hostname[0]) || isGateway(hostname[0])) { $s = 56; continue; } /* */ $s = 57; continue; /* if (isLocalhost(hostname[0]) || isGateway(hostname[0])) { */ case 56: ret[0] = fallbackOrder; $24r$16 = ret[0]; $s = 58; case 58: return $24r$16; /* } */ case 57: _r$9 = getHostname(); /* */ $s = 59; case 59: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; hn = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil)) || stringsEqualFold(hostname[0], hn)) { $s = 60; continue; } /* */ $s = 61; continue; /* if (!($interfaceIsEqual(err, $ifaceNil)) || stringsEqualFold(hostname[0], hn)) { */ case 60: ret[0] = fallbackOrder; $24r$17 = ret[0]; $s = 62; case 62: return $24r$17; /* } */ case 61: _i++; /* continue; */ $s = 52; continue; /* } */ case 55: /* */ if (src.source === "files" || src.source === "dns") { $s = 63; continue; } /* */ $s = 64; continue; /* if (src.source === "files" || src.source === "dns") { */ case 63: /* */ if (!$clone(src, nssSource).standardCriteria()) { $s = 65; continue; } /* */ $s = 66; continue; /* if (!$clone(src, nssSource).standardCriteria()) { */ case 65: ret[0] = fallbackOrder; $24r$18 = ret[0]; $s = 67; case 67: return $24r$18; /* } */ case 66: if (src.source === "files") { filesSource = true; } else if (src.source === "dns") { dnsSource = true; } if (first === "") { first = src.source; } _i++; /* continue; */ $s = 52; continue; /* } */ case 64: if (stringsHasPrefix(src.source, "mdns")) { mdnsSource = true; _i++; /* continue; */ $s = 52; continue; } ret[0] = fallbackOrder; $24r$19 = ret[0]; $s = 68; case 68: return $24r$19; case 53: /* */ if (mdnsSource && c.hasMDNSAllow) { $s = 69; continue; } /* */ $s = 70; continue; /* if (mdnsSource && c.hasMDNSAllow) { */ case 69: ret[0] = fallbackOrder; $24r$20 = ret[0]; $s = 71; case 71: return $24r$20; /* } */ case 70: /* */ if (filesSource && dnsSource) { $s = 73; continue; } /* */ if (filesSource) { $s = 74; continue; } /* */ if (dnsSource) { $s = 75; continue; } /* */ $s = 76; continue; /* if (filesSource && dnsSource) { */ case 73: /* */ if (first === "files") { $s = 77; continue; } /* */ $s = 78; continue; /* if (first === "files") { */ case 77: ret[0] = 1; $24r$21 = ret[0]; $s = 80; case 80: return $24r$21; /* } else { */ case 78: ret[0] = 2; $24r$22 = ret[0]; $s = 81; case 81: return $24r$22; /* } */ case 79: $s = 76; continue; /* } else if (filesSource) { */ case 74: ret[0] = 3; $24r$23 = ret[0]; $s = 82; case 82: return $24r$23; /* } else if (dnsSource) { */ case 75: ret[0] = 4; $24r$24 = ret[0]; $s = 83; case 83: return $24r$24; /* } */ case 76: case 72: ret[0] = fallbackOrder; $24r$25 = ret[0]; $s = 84; case 84: return $24r$25; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return ret[0]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: conf.ptr.prototype.hostLookupOrder }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$10 = $24r$10; $f.$24r$11 = $24r$11; $f.$24r$12 = $24r$12; $f.$24r$13 = $24r$13; $f.$24r$14 = $24r$14; $f.$24r$15 = $24r$15; $f.$24r$16 = $24r$16; $f.$24r$17 = $24r$17; $f.$24r$18 = $24r$18; $f.$24r$19 = $24r$19; $f.$24r$2 = $24r$2; $f.$24r$20 = $24r$20; $f.$24r$21 = $24r$21; $f.$24r$22 = $24r$22; $f.$24r$23 = $24r$23; $f.$24r$24 = $24r$24; $f.$24r$25 = $24r$25; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f.$24r$6 = $24r$6; $f.$24r$7 = $24r$7; $f.$24r$8 = $24r$8; $f.$24r$9 = $24r$9; $f._1 = _1; $f._entry = _entry; $f._i = _i; $f._r$9 = _r$9; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tuple = _tuple; $f.c = c; $f.dnsSource = dnsSource; $f.err = err; $f.fallbackOrder = fallbackOrder; $f.filesSource = filesSource; $f.first = first; $f.hn = hn; $f.hostname = hostname; $f.lookup = lookup; $f.mdnsSource = mdnsSource; $f.nss = nss; $f.r = r; $f.ret = ret; $f.src = src; $f.srcs = srcs; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; conf.prototype.hostLookupOrder = function(r, hostname) { return this.$val.hostLookupOrder(r, hostname); }; goDebugNetDNS = function() { var _r$9, debugLevel, dnsMode, goDebug, i, parsePart, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; debugLevel = $f.debugLevel; dnsMode = $f.dnsMode; goDebug = $f.goDebug; i = $f.i; parsePart = $f.parsePart; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: debugLevel = [debugLevel]; dnsMode = [dnsMode]; dnsMode[0] = ""; debugLevel[0] = 0; _r$9 = goDebugString("netdns"); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } goDebug = _r$9; parsePart = (function(debugLevel, dnsMode) { return function(s) { var _tuple, s; if (s === "") { return; } if (48 <= s.charCodeAt(0) && s.charCodeAt(0) <= 57) { _tuple = dtoi(s); debugLevel[0] = _tuple[0]; } else { dnsMode[0] = s; } }; })(debugLevel, dnsMode); i = bytealg.IndexByteString(goDebug, 43); /* */ if (!((i === -1))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!((i === -1))) { */ case 2: $r = parsePart($substring(goDebug, 0, i)); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = parsePart($substring(goDebug, (i + 1 >> 0))); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return [dnsMode[0], debugLevel[0]]; /* } */ case 3: $r = parsePart(goDebug); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return [dnsMode[0], debugLevel[0]]; /* */ } return; } if ($f === undefined) { $f = { $blk: goDebugNetDNS }; } $f._r$9 = _r$9; $f.debugLevel = debugLevel; $f.dnsMode = dnsMode; $f.goDebug = goDebug; $f.i = i; $f.parsePart = parsePart; $f.$s = $s; $f.$r = $r; return $f; }; isLocalhost = function(h) { var h; return stringsEqualFold(h, "localhost") || stringsEqualFold(h, "localhost.localdomain") || stringsHasSuffixFold(h, ".localhost") || stringsHasSuffixFold(h, ".localhost.localdomain"); }; isGateway = function(h) { var h; return stringsEqualFold(h, "gateway"); }; init = function() { netGo = true; }; cgoLookupHost = function(ctx, name) { var _tmp, _tmp$1, _tmp$2, addrs, completed, ctx, err, name; addrs = sliceType.nil; err = $ifaceNil; completed = false; _tmp = sliceType.nil; _tmp$1 = $ifaceNil; _tmp$2 = false; addrs = _tmp; err = _tmp$1; completed = _tmp$2; return [addrs, err, completed]; }; cgoLookupPort = function(ctx, network, service) { var _tmp, _tmp$1, _tmp$2, completed, ctx, err, network, port, service; port = 0; err = $ifaceNil; completed = false; _tmp = 0; _tmp$1 = $ifaceNil; _tmp$2 = false; port = _tmp; err = _tmp$1; completed = _tmp$2; return [port, err, completed]; }; cgoLookupIP = function(ctx, network, name) { var _tmp, _tmp$1, _tmp$2, addrs, completed, ctx, err, name, network; addrs = sliceType$5.nil; err = $ifaceNil; completed = false; _tmp = sliceType$5.nil; _tmp$1 = $ifaceNil; _tmp$2 = false; addrs = _tmp; err = _tmp$1; completed = _tmp$2; return [addrs, err, completed]; }; cgoLookupCNAME = function(ctx, name) { var _tmp, _tmp$1, _tmp$2, cname, completed, ctx, err, name; cname = ""; err = $ifaceNil; completed = false; _tmp = ""; _tmp$1 = $ifaceNil; _tmp$2 = false; cname = _tmp; err = _tmp$1; completed = _tmp$2; return [cname, err, completed]; }; cgoLookupPTR = function(ctx, addr) { var _tmp, _tmp$1, _tmp$2, addr, completed, ctx, err, ptrs; ptrs = sliceType.nil; err = $ifaceNil; completed = false; _tmp = sliceType.nil; _tmp$1 = $ifaceNil; _tmp$2 = false; ptrs = _tmp; err = _tmp$1; completed = _tmp$2; return [ptrs, err, completed]; }; sortByRFC6724 = function(addrs) { var _arg, _arg$1, _r$9, addrs, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _r$9 = $f._r$9; addrs = $f.addrs; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (addrs.$length < 2) { $s = -1; return; } _arg = addrs; _r$9 = srcAddrs(addrs); /* */ $s = 1; case 1: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _arg$1 = _r$9; $r = sortByRFC6724withSrcs(_arg, _arg$1); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: sortByRFC6724 }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._r$9 = _r$9; $f.addrs = addrs; $f.$s = $s; $f.$r = $r; return $f; }; sortByRFC6724withSrcs = function(addrs, srcs) { var _i, _ref, addrAttr, addrs, i, srcAttr, srcs, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _ref = $f._ref; addrAttr = $f.addrAttr; addrs = $f.addrs; i = $f.i; srcAttr = $f.srcAttr; srcs = $f.srcs; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (!((addrs.$length === srcs.$length))) { $panic(new $String("internal error")); } addrAttr = $makeSlice(sliceType$16, addrs.$length); srcAttr = $makeSlice(sliceType$16, srcs.$length); _ref = addrs; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; v = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), IPAddr); ipAttr.copy(((i < 0 || i >= addrAttr.$length) ? ($throwRuntimeError("index out of range"), undefined) : addrAttr.$array[addrAttr.$offset + i]), ipAttrOf(v.IP)); ipAttr.copy(((i < 0 || i >= srcAttr.$length) ? ($throwRuntimeError("index out of range"), undefined) : srcAttr.$array[srcAttr.$offset + i]), ipAttrOf(((i < 0 || i >= srcs.$length) ? ($throwRuntimeError("index out of range"), undefined) : srcs.$array[srcs.$offset + i]))); _i++; } $r = sort.Stable(new byRFC6724.ptr(addrs, addrAttr, srcs, srcAttr)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: sortByRFC6724withSrcs }; } $f._i = _i; $f._ref = _ref; $f.addrAttr = addrAttr; $f.addrs = addrs; $f.i = i; $f.srcAttr = srcAttr; $f.srcs = srcs; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; srcAddrs = function(addrs) { var _i, _r$10, _r$9, _ref, _tuple, _tuple$1, addrs, c, dst, err, i, ok, src, srcs, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r$10 = $f._r$10; _r$9 = $f._r$9; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; addrs = $f.addrs; c = $f.c; dst = $f.dst; err = $f.err; i = $f.i; ok = $f.ok; src = $f.src; srcs = $f.srcs; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: dst = [dst]; srcs = $makeSlice(sliceType$9, addrs.$length); dst[0] = new UDPAddr.ptr(IP.nil, 9, ""); _ref = addrs; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } i = _i; dst[0].IP = ((i < 0 || i >= addrs.$length) ? ($throwRuntimeError("index out of range"), undefined) : addrs.$array[addrs.$offset + i]).IP; dst[0].Zone = ((i < 0 || i >= addrs.$length) ? ($throwRuntimeError("index out of range"), undefined) : addrs.$array[addrs.$offset + i]).Zone; _r$9 = DialUDP("udp", ptrType$16.nil, dst[0]); /* */ $s = 3; case 3: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; c = _tuple[0]; err = _tuple[1]; /* */ if ($interfaceIsEqual(err, $ifaceNil)) { $s = 4; continue; } /* */ $s = 5; continue; /* if ($interfaceIsEqual(err, $ifaceNil)) { */ case 4: _tuple$1 = $assertType(c.conn.LocalAddr(), ptrType$16, true); src = _tuple$1[0]; ok = _tuple$1[1]; if (ok) { ((i < 0 || i >= srcs.$length) ? ($throwRuntimeError("index out of range"), undefined) : srcs.$array[srcs.$offset + i] = src.IP); } _r$10 = c.conn.Close(); /* */ $s = 6; case 6: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; /* } */ case 5: _i++; $s = 1; continue; case 2: $s = -1; return srcs; /* */ } return; } if ($f === undefined) { $f = { $blk: srcAddrs }; } $f._i = _i; $f._r$10 = _r$10; $f._r$9 = _r$9; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.addrs = addrs; $f.c = c; $f.dst = dst; $f.err = err; $f.i = i; $f.ok = ok; $f.src = src; $f.srcs = srcs; $f.$s = $s; $f.$r = $r; return $f; }; ipAttrOf = function(ip) { var ip, match; if (ip === IP.nil) { return new ipAttr.ptr(0, 0, 0); } match = $clone(rfc6724policyTable.Classify(ip), policyTableEntry); return new ipAttr.ptr(classifyScope(ip), match.Precedence, match.Label); }; byRFC6724.ptr.prototype.Len = function() { var s; s = this; return s.addrs.$length; }; byRFC6724.prototype.Len = function() { return this.$val.Len(); }; byRFC6724.ptr.prototype.Swap = function(i, j) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, i, j, s, 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; s = this; _tmp = $clone((x = s.addrs, ((j < 0 || j >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + j])), IPAddr); _tmp$1 = $clone((x$1 = s.addrs, ((i < 0 || i >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + i])), IPAddr); IPAddr.copy((x$2 = s.addrs, ((i < 0 || i >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + i])), _tmp); IPAddr.copy((x$3 = s.addrs, ((j < 0 || j >= x$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + j])), _tmp$1); _tmp$2 = (x$4 = s.srcs, ((j < 0 || j >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + j])); _tmp$3 = (x$5 = s.srcs, ((i < 0 || i >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + i])); (x$6 = s.srcs, ((i < 0 || i >= x$6.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$6.$array[x$6.$offset + i] = _tmp$2)); (x$7 = s.srcs, ((j < 0 || j >= x$7.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$7.$array[x$7.$offset + j] = _tmp$3)); _tmp$4 = $clone((x$8 = s.addrAttr, ((j < 0 || j >= x$8.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$8.$array[x$8.$offset + j])), ipAttr); _tmp$5 = $clone((x$9 = s.addrAttr, ((i < 0 || i >= x$9.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$9.$array[x$9.$offset + i])), ipAttr); ipAttr.copy((x$10 = s.addrAttr, ((i < 0 || i >= x$10.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$10.$array[x$10.$offset + i])), _tmp$4); ipAttr.copy((x$11 = s.addrAttr, ((j < 0 || j >= x$11.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$11.$array[x$11.$offset + j])), _tmp$5); _tmp$6 = $clone((x$12 = s.srcAttr, ((j < 0 || j >= x$12.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$12.$array[x$12.$offset + j])), ipAttr); _tmp$7 = $clone((x$13 = s.srcAttr, ((i < 0 || i >= x$13.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$13.$array[x$13.$offset + i])), ipAttr); ipAttr.copy((x$14 = s.srcAttr, ((i < 0 || i >= x$14.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$14.$array[x$14.$offset + i])), _tmp$6); ipAttr.copy((x$15 = s.srcAttr, ((j < 0 || j >= x$15.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$15.$array[x$15.$offset + j])), _tmp$7); }; byRFC6724.prototype.Swap = function(i, j) { return this.$val.Swap(i, j); }; byRFC6724.ptr.prototype.Less = function(i, j) { var DA, DB, SourceDA, SourceDB, attrDA, attrDB, attrSourceDA, attrSourceDB, commonA, commonB, i, j, s, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7; s = this; DA = (x = s.addrs, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])).IP; DB = (x$1 = s.addrs, ((j < 0 || j >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + j])).IP; SourceDA = (x$2 = s.srcs, ((i < 0 || i >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + i])); SourceDB = (x$3 = s.srcs, ((j < 0 || j >= x$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + j])); attrDA = (x$4 = s.addrAttr, ((i < 0 || i >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + i])); attrDB = (x$5 = s.addrAttr, ((j < 0 || j >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + j])); attrSourceDA = (x$6 = s.srcAttr, ((i < 0 || i >= x$6.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$6.$array[x$6.$offset + i])); attrSourceDB = (x$7 = s.srcAttr, ((j < 0 || j >= x$7.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$7.$array[x$7.$offset + j])); if (SourceDA === IP.nil && SourceDB === IP.nil) { return false; } if (SourceDB === IP.nil) { return true; } if (SourceDA === IP.nil) { return false; } if ((attrDA.Scope === attrSourceDA.Scope) && !((attrDB.Scope === attrSourceDB.Scope))) { return true; } if (!((attrDA.Scope === attrSourceDA.Scope)) && (attrDB.Scope === attrSourceDB.Scope)) { return false; } if ((attrSourceDA.Label === attrDA.Label) && !((attrSourceDB.Label === attrDB.Label))) { return true; } if (!((attrSourceDA.Label === attrDA.Label)) && (attrSourceDB.Label === attrDB.Label)) { return false; } if (attrDA.Precedence > attrDB.Precedence) { return true; } if (attrDA.Precedence < attrDB.Precedence) { return false; } if (attrDA.Scope < attrDB.Scope) { return true; } if (attrDA.Scope > attrDB.Scope) { return false; } if (DA.To4() === IP.nil && DB.To4() === IP.nil) { commonA = commonPrefixLen(SourceDA, DA); commonB = commonPrefixLen(SourceDB, DB); if (commonA > commonB) { return true; } if (commonA < commonB) { return false; } } return false; }; byRFC6724.prototype.Less = function(i, j) { return this.$val.Less(i, j); }; init$1 = function() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = sort.Sort(sort.Reverse(($convertSliceType(rfc6724policyTable, byMaskLength)))); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: init$1 }; } $f.$s = $s; $f.$r = $r; return $f; }; byMaskLength.prototype.Len = function() { var s; s = this; return s.$length; }; $ptrType(byMaskLength).prototype.Len = function() { return this.$get().Len(); }; byMaskLength.prototype.Swap = function(i, j) { var _tmp, _tmp$1, i, j, s; s = this; _tmp = $clone(((j < 0 || j >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + j]), policyTableEntry); _tmp$1 = $clone(((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]), policyTableEntry); policyTableEntry.copy(((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]), _tmp); policyTableEntry.copy(((j < 0 || j >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + j]), _tmp$1); }; $ptrType(byMaskLength).prototype.Swap = function(i, j) { return this.$get().Swap(i, j); }; byMaskLength.prototype.Less = function(i, j) { var _tuple, _tuple$1, i, isize, j, jsize, s; s = this; _tuple = ((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]).Prefix.Mask.Size(); isize = _tuple[0]; _tuple$1 = ((j < 0 || j >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + j]).Prefix.Mask.Size(); jsize = _tuple$1[0]; return isize < jsize; }; $ptrType(byMaskLength).prototype.Less = function(i, j) { return this.$get().Less(i, j); }; mustCIDR = function(s) { var _r$9, _tuple, err, ip, ipNet, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; _tuple = $f._tuple; err = $f.err; ip = $f.ip; ipNet = $f.ipNet; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _tuple = ParseCIDR(s); ip = _tuple[0]; ipNet = _tuple[1]; err = _tuple[2]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: _r$9 = err.Error(); /* */ $s = 3; case 3: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $panic(new $String(_r$9)); /* } */ case 2: if (!((ip.$length === 16))) { $panic(new $String("unexpected IP length")); } $s = -1; return ipNet; /* */ } return; } if ($f === undefined) { $f = { $blk: mustCIDR }; } $f._r$9 = _r$9; $f._tuple = _tuple; $f.err = err; $f.ip = ip; $f.ipNet = ipNet; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; policyTable.prototype.Classify = function(ip) { var _i, _ref, ent, ip, t; t = this; _ref = t; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } ent = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), policyTableEntry); if (ent.Prefix.Contains(ip)) { return ent; } _i++; } return new policyTableEntry.ptr(ptrType$5.nil, 0, 0); }; $ptrType(policyTable).prototype.Classify = function(ip) { return this.$get().Classify(ip); }; classifyScope = function(ip) { var ip, ipv6; if (ip.IsLoopback() || ip.IsLinkLocalUnicast()) { return 2; } ipv6 = (ip.$length === 16) && ip.To4() === IP.nil; if (ipv6 && ip.IsMulticast()) { return (((((1 >= ip.$length ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + 1]) & 15) >>> 0) << 24 >>> 24)); } if (ipv6 && ((0 >= ip.$length ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + 0]) === 254) && ((((1 >= ip.$length ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + 1]) & 192) >>> 0) === 192)) { return 5; } return 14; }; commonPrefixLen = function(a, b) { var _tmp, _tmp$1, a, a4, ab, b, b4, bb, bits, cpl, y, y$1; cpl = 0; a4 = a.To4(); if (!(a4 === IP.nil)) { a = a4; } b4 = b.To4(); if (!(b4 === IP.nil)) { b = b4; } if (!((a.$length === b.$length))) { cpl = 0; return cpl; } if (a.$length > 8) { a = $subslice(a, 0, 8); b = $subslice(b, 0, 8); } while (true) { if (!(a.$length > 0)) { break; } if ((0 >= a.$length ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + 0]) === (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0])) { cpl = cpl + (8) >> 0; a = $subslice(a, 1); b = $subslice(b, 1); continue; } bits = 8; _tmp = (0 >= a.$length ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + 0]); _tmp$1 = (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]); ab = _tmp; bb = _tmp$1; while (true) { ab = (y = (1), y < 32 ? (ab >>> y) : 0) << 24 >>> 24; bb = (y$1 = (1), y$1 < 32 ? (bb >>> y$1) : 0) << 24 >>> 24; bits = bits - (1) >> 0; if (ab === bb) { cpl = cpl + (bits) >> 0; return cpl; } } } return cpl; }; ptrType$9.methods = [{prop: "family", name: "family", pkg: "net", typ: $funcType([], [$Int], false)}, {prop: "sockaddr", name: "sockaddr", pkg: "net", typ: $funcType([$Int], [syscall.Sockaddr, $error], false)}, {prop: "toLocal", name: "toLocal", pkg: "net", typ: $funcType([$String], [sockaddr], false)}, {prop: "Network", name: "Network", pkg: "", typ: $funcType([], [$String], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "isWildcard", name: "isWildcard", pkg: "net", typ: $funcType([], [$Bool], false)}, {prop: "opAddr", name: "opAddr", pkg: "net", typ: $funcType([], [Addr], false)}]; ptrType$10.methods = [{prop: "readFrom", name: "readFrom", pkg: "net", typ: $funcType([sliceType$1], [$Int, ptrType$9, $error], false)}, {prop: "readMsg", name: "readMsg", pkg: "net", typ: $funcType([sliceType$1, sliceType$1], [$Int, $Int, $Int, ptrType$9, $error], false)}, {prop: "writeTo", name: "writeTo", pkg: "net", typ: $funcType([sliceType$1, ptrType$9], [$Int, $error], false)}, {prop: "writeMsg", name: "writeMsg", pkg: "net", typ: $funcType([sliceType$1, sliceType$1, ptrType$9], [$Int, $Int, $error], false)}, {prop: "SyscallConn", name: "SyscallConn", pkg: "", typ: $funcType([], [syscall.RawConn, $error], false)}, {prop: "CloseRead", name: "CloseRead", pkg: "", typ: $funcType([], [$error], false)}, {prop: "CloseWrite", name: "CloseWrite", pkg: "", typ: $funcType([], [$error], false)}, {prop: "ReadFromUnix", name: "ReadFromUnix", pkg: "", typ: $funcType([sliceType$1], [$Int, ptrType$9, $error], false)}, {prop: "ReadFrom", name: "ReadFrom", pkg: "", typ: $funcType([sliceType$1], [$Int, Addr, $error], false)}, {prop: "ReadMsgUnix", name: "ReadMsgUnix", pkg: "", typ: $funcType([sliceType$1, sliceType$1], [$Int, $Int, $Int, ptrType$9, $error], false)}, {prop: "WriteToUnix", name: "WriteToUnix", pkg: "", typ: $funcType([sliceType$1, ptrType$9], [$Int, $error], false)}, {prop: "WriteTo", name: "WriteTo", pkg: "", typ: $funcType([sliceType$1, Addr], [$Int, $error], false)}, {prop: "WriteMsgUnix", name: "WriteMsgUnix", pkg: "", typ: $funcType([sliceType$1, sliceType$1, ptrType$9], [$Int, $Int, $error], false)}]; ptrType$16.methods = [{prop: "family", name: "family", pkg: "net", typ: $funcType([], [$Int], false)}, {prop: "sockaddr", name: "sockaddr", pkg: "net", typ: $funcType([$Int], [syscall.Sockaddr, $error], false)}, {prop: "toLocal", name: "toLocal", pkg: "net", typ: $funcType([$String], [sockaddr], false)}, {prop: "Network", name: "Network", pkg: "", typ: $funcType([], [$String], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "isWildcard", name: "isWildcard", pkg: "net", typ: $funcType([], [$Bool], false)}, {prop: "opAddr", name: "opAddr", pkg: "net", typ: $funcType([], [Addr], false)}]; ptrType$17.methods = [{prop: "readFrom", name: "readFrom", pkg: "net", typ: $funcType([sliceType$1, ptrType$16], [$Int, ptrType$16, $error], false)}, {prop: "readMsg", name: "readMsg", pkg: "net", typ: $funcType([sliceType$1, sliceType$1], [$Int, $Int, $Int, ptrType$16, $error], false)}, {prop: "writeTo", name: "writeTo", pkg: "net", typ: $funcType([sliceType$1, ptrType$16], [$Int, $error], false)}, {prop: "writeMsg", name: "writeMsg", pkg: "net", typ: $funcType([sliceType$1, sliceType$1, ptrType$16], [$Int, $Int, $error], false)}, {prop: "SyscallConn", name: "SyscallConn", pkg: "", typ: $funcType([], [syscall.RawConn, $error], false)}, {prop: "ReadFromUDP", name: "ReadFromUDP", pkg: "", typ: $funcType([sliceType$1], [$Int, ptrType$16, $error], false)}, {prop: "readFromUDP", name: "readFromUDP", pkg: "net", typ: $funcType([sliceType$1, ptrType$16], [$Int, ptrType$16, $error], false)}, {prop: "ReadFrom", name: "ReadFrom", pkg: "", typ: $funcType([sliceType$1], [$Int, Addr, $error], false)}, {prop: "ReadMsgUDP", name: "ReadMsgUDP", pkg: "", typ: $funcType([sliceType$1, sliceType$1], [$Int, $Int, $Int, ptrType$16, $error], false)}, {prop: "WriteToUDP", name: "WriteToUDP", pkg: "", typ: $funcType([sliceType$1, ptrType$16], [$Int, $error], false)}, {prop: "WriteTo", name: "WriteTo", pkg: "", typ: $funcType([sliceType$1, Addr], [$Int, $error], false)}, {prop: "WriteMsgUDP", name: "WriteMsgUDP", pkg: "", typ: $funcType([sliceType$1, sliceType$1, ptrType$16], [$Int, $Int, $error], false)}]; ptrType$19.methods = [{prop: "family", name: "family", pkg: "net", typ: $funcType([], [$Int], false)}, {prop: "sockaddr", name: "sockaddr", pkg: "net", typ: $funcType([$Int], [syscall.Sockaddr, $error], false)}, {prop: "toLocal", name: "toLocal", pkg: "net", typ: $funcType([$String], [sockaddr], false)}, {prop: "Network", name: "Network", pkg: "", typ: $funcType([], [$String], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "isWildcard", name: "isWildcard", pkg: "net", typ: $funcType([], [$Bool], false)}, {prop: "opAddr", name: "opAddr", pkg: "net", typ: $funcType([], [Addr], false)}]; ptrType$20.methods = [{prop: "readFrom", name: "readFrom", pkg: "net", typ: $funcType([io.Reader], [$Int64, $error], false)}, {prop: "SyscallConn", name: "SyscallConn", pkg: "", typ: $funcType([], [syscall.RawConn, $error], false)}, {prop: "ReadFrom", name: "ReadFrom", pkg: "", typ: $funcType([io.Reader], [$Int64, $error], false)}, {prop: "CloseRead", name: "CloseRead", pkg: "", typ: $funcType([], [$error], false)}, {prop: "CloseWrite", name: "CloseWrite", pkg: "", typ: $funcType([], [$error], false)}, {prop: "SetLinger", name: "SetLinger", pkg: "", typ: $funcType([$Int], [$error], false)}, {prop: "SetKeepAlive", name: "SetKeepAlive", pkg: "", typ: $funcType([$Bool], [$error], false)}, {prop: "SetKeepAlivePeriod", name: "SetKeepAlivePeriod", pkg: "", typ: $funcType([time.Duration], [$error], false)}, {prop: "SetNoDelay", name: "SetNoDelay", pkg: "", typ: $funcType([$Bool], [$error], false)}]; ptrType$26.methods = [{prop: "ok", name: "ok", pkg: "net", typ: $funcType([], [$Bool], false)}, {prop: "Control", name: "Control", pkg: "", typ: $funcType([funcType$2], [$error], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([funcType$3], [$error], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([funcType$3], [$error], false)}]; ptrType$28.methods = [{prop: "close", name: "close", pkg: "net", typ: $funcType([], [], false)}, {prop: "getLineFromData", name: "getLineFromData", pkg: "net", typ: $funcType([], [$String, $Bool], false)}, {prop: "readLine", name: "readLine", pkg: "net", typ: $funcType([], [$String, $Bool], false)}]; nssSource.methods = [{prop: "standardCriteria", name: "standardCriteria", pkg: "net", typ: $funcType([], [$Bool], false)}]; nssCriterion.methods = [{prop: "standardStatusAction", name: "standardStatusAction", pkg: "net", typ: $funcType([$Bool], [$Bool], false)}]; ptrType$29.methods = [{prop: "writeBuffers", name: "writeBuffers", pkg: "net", typ: $funcType([ptrType$2], [$Int64, $error], false)}, {prop: "ok", name: "ok", pkg: "net", typ: $funcType([], [$Bool], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "LocalAddr", name: "LocalAddr", pkg: "", typ: $funcType([], [Addr], false)}, {prop: "RemoteAddr", name: "RemoteAddr", pkg: "", typ: $funcType([], [Addr], false)}, {prop: "SetDeadline", name: "SetDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "SetReadDeadline", name: "SetReadDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "SetWriteDeadline", name: "SetWriteDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "SetReadBuffer", name: "SetReadBuffer", pkg: "", typ: $funcType([$Int], [$error], false)}, {prop: "SetWriteBuffer", name: "SetWriteBuffer", pkg: "", typ: $funcType([$Int], [$error], false)}, {prop: "File", name: "File", pkg: "", typ: $funcType([], [ptrType$11, $error], false)}]; ptrType$21.methods = [{prop: "Unwrap", name: "Unwrap", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Temporary", name: "Temporary", pkg: "", typ: $funcType([], [$Bool], false)}]; ptrType$44.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Temporary", name: "Temporary", pkg: "", typ: $funcType([], [$Bool], false)}]; ptrType$30.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Temporary", name: "Temporary", pkg: "", typ: $funcType([], [$Bool], false)}]; UnknownNetworkError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Temporary", name: "Temporary", pkg: "", typ: $funcType([], [$Bool], false)}]; ptrType$45.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Temporary", name: "Temporary", pkg: "", typ: $funcType([], [$Bool], false)}]; ptrType$31.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Temporary", name: "Temporary", pkg: "", typ: $funcType([], [$Bool], false)}]; ptrType$2.methods = [{prop: "WriteTo", name: "WriteTo", pkg: "", typ: $funcType([io.Writer], [$Int64, $error], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}, {prop: "consume", name: "consume", pkg: "net", typ: $funcType([$Int64], [], false)}]; HardwareAddr.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$13.methods = [{prop: "dial", name: "dial", pkg: "net", typ: $funcType([context.Context, $String, $String], [Conn, $error], false)}, {prop: "lookupHost", name: "lookupHost", pkg: "net", typ: $funcType([context.Context, $String], [sliceType, $error], false)}, {prop: "lookupIP", name: "lookupIP", pkg: "net", typ: $funcType([context.Context, $String, $String], [sliceType$5, $error], false)}, {prop: "lookupPort", name: "lookupPort", pkg: "net", typ: $funcType([context.Context, $String, $String], [$Int, $error], false)}, {prop: "lookupCNAME", name: "lookupCNAME", pkg: "net", typ: $funcType([context.Context, $String], [$String, $error], false)}, {prop: "lookupSRV", name: "lookupSRV", pkg: "net", typ: $funcType([context.Context, $String, $String, $String], [$String, sliceType$6, $error], false)}, {prop: "lookupMX", name: "lookupMX", pkg: "net", typ: $funcType([context.Context, $String], [sliceType$7, $error], false)}, {prop: "lookupNS", name: "lookupNS", pkg: "net", typ: $funcType([context.Context, $String], [sliceType$8, $error], false)}, {prop: "lookupTXT", name: "lookupTXT", pkg: "net", typ: $funcType([context.Context, $String], [sliceType, $error], false)}, {prop: "lookupAddr", name: "lookupAddr", pkg: "net", typ: $funcType([context.Context, $String], [sliceType, $error], false)}, {prop: "preferGo", name: "preferGo", pkg: "net", typ: $funcType([], [$Bool], false)}, {prop: "strictErrors", name: "strictErrors", pkg: "net", typ: $funcType([], [$Bool], false)}, {prop: "getLookupGroup", name: "getLookupGroup", pkg: "net", typ: $funcType([], [ptrType$47], false)}, {prop: "LookupHost", name: "LookupHost", pkg: "", typ: $funcType([context.Context, $String], [sliceType, $error], false)}, {prop: "LookupIPAddr", name: "LookupIPAddr", pkg: "", typ: $funcType([context.Context, $String], [sliceType$5, $error], false)}, {prop: "LookupIP", name: "LookupIP", pkg: "", typ: $funcType([context.Context, $String, $String], [sliceType$9, $error], false)}, {prop: "lookupIPAddr", name: "lookupIPAddr", pkg: "net", typ: $funcType([context.Context, $String, $String], [sliceType$5, $error], false)}, {prop: "LookupPort", name: "LookupPort", pkg: "", typ: $funcType([context.Context, $String, $String], [$Int, $error], false)}, {prop: "LookupCNAME", name: "LookupCNAME", pkg: "", typ: $funcType([context.Context, $String], [$String, $error], false)}, {prop: "LookupSRV", name: "LookupSRV", pkg: "", typ: $funcType([context.Context, $String, $String, $String], [$String, sliceType$6, $error], false)}, {prop: "LookupMX", name: "LookupMX", pkg: "", typ: $funcType([context.Context, $String], [sliceType$7, $error], false)}, {prop: "LookupNS", name: "LookupNS", pkg: "", typ: $funcType([context.Context, $String], [sliceType$8, $error], false)}, {prop: "LookupTXT", name: "LookupTXT", pkg: "", typ: $funcType([context.Context, $String], [sliceType, $error], false)}, {prop: "LookupAddr", name: "LookupAddr", pkg: "", typ: $funcType([context.Context, $String], [sliceType, $error], false)}, {prop: "internetAddrList", name: "internetAddrList", pkg: "net", typ: $funcType([context.Context, $String, $String], [addrList, $error], false)}, {prop: "exchange", name: "exchange", pkg: "net", typ: $funcType([context.Context, $String, dnsmessage.Question, time.Duration, $Bool], [dnsmessage.Parser, dnsmessage.Header, $error], false)}, {prop: "tryOneName", name: "tryOneName", pkg: "net", typ: $funcType([context.Context, ptrType$1, $String, dnsmessage.Type], [dnsmessage.Parser, $String, $error], false)}, {prop: "lookup", name: "lookup", pkg: "net", typ: $funcType([context.Context, $String, dnsmessage.Type], [dnsmessage.Parser, $String, $error], false)}, {prop: "goLookupHost", name: "goLookupHost", pkg: "net", typ: $funcType([context.Context, $String], [sliceType, $error], false)}, {prop: "goLookupHostOrder", name: "goLookupHostOrder", pkg: "net", typ: $funcType([context.Context, $String, hostLookupOrder], [sliceType, $error], false)}, {prop: "goLookupIP", name: "goLookupIP", pkg: "net", typ: $funcType([context.Context, $String, $String], [sliceType$5, $error], false)}, {prop: "goLookupIPCNAMEOrder", name: "goLookupIPCNAMEOrder", pkg: "net", typ: $funcType([context.Context, $String, $String, hostLookupOrder], [sliceType$5, dnsmessage.Name, $error], false)}, {prop: "goLookupCNAME", name: "goLookupCNAME", pkg: "net", typ: $funcType([context.Context, $String], [$String, $error], false)}, {prop: "goLookupPTR", name: "goLookupPTR", pkg: "net", typ: $funcType([context.Context, $String], [sliceType, $error], false)}, {prop: "resolveAddrList", name: "resolveAddrList", pkg: "net", typ: $funcType([context.Context, $String, $String, $String, Addr], [addrList, $error], false)}]; ptrType$3.methods = [{prop: "Value", name: "Value", pkg: "", typ: $funcType([$emptyInterface], [$emptyInterface], false)}]; ptrType$48.methods = [{prop: "probe", name: "probe", pkg: "net", typ: $funcType([], [], false)}]; addrList.methods = [{prop: "forResolve", name: "forResolve", pkg: "net", typ: $funcType([$String, $String], [Addr], false)}, {prop: "first", name: "first", pkg: "net", typ: $funcType([funcType$5], [Addr], false)}, {prop: "partition", name: "partition", pkg: "net", typ: $funcType([funcType$5], [addrList, addrList], false)}]; ptrType$25.methods = [{prop: "family", name: "family", pkg: "net", typ: $funcType([], [$Int], false)}, {prop: "sockaddr", name: "sockaddr", pkg: "net", typ: $funcType([$Int], [syscall.Sockaddr, $error], false)}, {prop: "toLocal", name: "toLocal", pkg: "net", typ: $funcType([$String], [sockaddr], false)}, {prop: "Network", name: "Network", pkg: "", typ: $funcType([], [$String], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "isWildcard", name: "isWildcard", pkg: "net", typ: $funcType([], [$Bool], false)}, {prop: "opAddr", name: "opAddr", pkg: "net", typ: $funcType([], [Addr], false)}]; ptrType$36.methods = [{prop: "readFrom", name: "readFrom", pkg: "net", typ: $funcType([sliceType$1], [$Int, ptrType$25, $error], false)}, {prop: "readMsg", name: "readMsg", pkg: "net", typ: $funcType([sliceType$1, sliceType$1], [$Int, $Int, $Int, ptrType$25, $error], false)}, {prop: "writeTo", name: "writeTo", pkg: "net", typ: $funcType([sliceType$1, ptrType$25], [$Int, $error], false)}, {prop: "writeMsg", name: "writeMsg", pkg: "net", typ: $funcType([sliceType$1, sliceType$1, ptrType$25], [$Int, $Int, $error], false)}, {prop: "SyscallConn", name: "SyscallConn", pkg: "", typ: $funcType([], [syscall.RawConn, $error], false)}, {prop: "ReadFromIP", name: "ReadFromIP", pkg: "", typ: $funcType([sliceType$1], [$Int, ptrType$25, $error], false)}, {prop: "ReadFrom", name: "ReadFrom", pkg: "", typ: $funcType([sliceType$1], [$Int, Addr, $error], false)}, {prop: "ReadMsgIP", name: "ReadMsgIP", pkg: "", typ: $funcType([sliceType$1, sliceType$1], [$Int, $Int, $Int, ptrType$25, $error], false)}, {prop: "WriteToIP", name: "WriteToIP", pkg: "", typ: $funcType([sliceType$1, ptrType$25], [$Int, $error], false)}, {prop: "WriteTo", name: "WriteTo", pkg: "", typ: $funcType([sliceType$1, Addr], [$Int, $error], false)}, {prop: "WriteMsgIP", name: "WriteMsgIP", pkg: "", typ: $funcType([sliceType$1, sliceType$1, ptrType$25], [$Int, $Int, $error], false)}]; IP.methods = [{prop: "IsUnspecified", name: "IsUnspecified", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "IsLoopback", name: "IsLoopback", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "IsPrivate", name: "IsPrivate", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "IsMulticast", name: "IsMulticast", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "IsInterfaceLocalMulticast", name: "IsInterfaceLocalMulticast", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "IsLinkLocalMulticast", name: "IsLinkLocalMulticast", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "IsLinkLocalUnicast", name: "IsLinkLocalUnicast", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "IsGlobalUnicast", name: "IsGlobalUnicast", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "To4", name: "To4", pkg: "", typ: $funcType([], [IP], false)}, {prop: "To16", name: "To16", pkg: "", typ: $funcType([], [IP], false)}, {prop: "DefaultMask", name: "DefaultMask", pkg: "", typ: $funcType([], [IPMask], false)}, {prop: "Mask", name: "Mask", pkg: "", typ: $funcType([IPMask], [IP], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "MarshalText", name: "MarshalText", pkg: "", typ: $funcType([], [sliceType$1, $error], false)}, {prop: "Equal", name: "Equal", pkg: "", typ: $funcType([IP], [$Bool], false)}, {prop: "matchAddrFamily", name: "matchAddrFamily", pkg: "net", typ: $funcType([IP], [$Bool], false)}]; ptrType$49.methods = [{prop: "UnmarshalText", name: "UnmarshalText", pkg: "", typ: $funcType([sliceType$1], [$error], false)}]; IPMask.methods = [{prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int, $Int], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$5.methods = [{prop: "Contains", name: "Contains", pkg: "", typ: $funcType([IP], [$Bool], false)}, {prop: "Network", name: "Network", pkg: "", typ: $funcType([], [$String], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$18.methods = [{prop: "Addrs", name: "Addrs", pkg: "", typ: $funcType([], [sliceType$13, $error], false)}, {prop: "MulticastAddrs", name: "MulticastAddrs", pkg: "", typ: $funcType([], [sliceType$13, $error], false)}]; Flags.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$50.methods = [{prop: "update", name: "update", pkg: "net", typ: $funcType([sliceType$12, $Bool], [$Bool], false)}, {prop: "name", name: "name", pkg: "net", typ: $funcType([$Int], [$String], false)}, {prop: "index", name: "index", pkg: "net", typ: $funcType([$String], [$Int], false)}]; ptrType$7.methods = [{prop: "writeBuffers", name: "writeBuffers", pkg: "net", typ: $funcType([ptrType$2], [$Int64, $error], false)}, {prop: "ctrlNetwork", name: "ctrlNetwork", pkg: "net", typ: $funcType([], [$String], false)}, {prop: "addrFunc", name: "addrFunc", pkg: "net", typ: $funcType([], [funcType$6], false)}, {prop: "dial", name: "dial", pkg: "net", typ: $funcType([context.Context, sockaddr, sockaddr, funcType$7], [$error], false)}, {prop: "listenStream", name: "listenStream", pkg: "net", typ: $funcType([sockaddr, $Int, funcType$7], [$error], false)}, {prop: "listenDatagram", name: "listenDatagram", pkg: "net", typ: $funcType([sockaddr, funcType$7], [$error], false)}, {prop: "init", name: "init", pkg: "net", typ: $funcType([], [$error], false)}, {prop: "name", name: "name", pkg: "net", typ: $funcType([], [$String], false)}, {prop: "connect", name: "connect", pkg: "net", typ: $funcType([context.Context, syscall.Sockaddr, syscall.Sockaddr], [syscall.Sockaddr, $error], false)}, {prop: "accept", name: "accept", pkg: "net", typ: $funcType([], [ptrType$7, $error], false)}, {prop: "dup", name: "dup", pkg: "net", typ: $funcType([], [ptrType$11, $error], false)}, {prop: "setAddr", name: "setAddr", pkg: "net", typ: $funcType([Addr, Addr], [], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "shutdown", name: "shutdown", pkg: "net", typ: $funcType([$Int], [$error], false)}, {prop: "closeRead", name: "closeRead", pkg: "net", typ: $funcType([], [$error], false)}, {prop: "closeWrite", name: "closeWrite", pkg: "net", typ: $funcType([], [$error], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}, {prop: "readFrom", name: "readFrom", pkg: "net", typ: $funcType([sliceType$1], [$Int, syscall.Sockaddr, $error], false)}, {prop: "readMsg", name: "readMsg", pkg: "net", typ: $funcType([sliceType$1, sliceType$1, $Int], [$Int, $Int, $Int, syscall.Sockaddr, $error], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}, {prop: "writeTo", name: "writeTo", pkg: "net", typ: $funcType([sliceType$1, syscall.Sockaddr], [$Int, $error], false)}, {prop: "writeMsg", name: "writeMsg", pkg: "net", typ: $funcType([sliceType$1, sliceType$1, syscall.Sockaddr], [$Int, $Int, $error], false)}, {prop: "SetDeadline", name: "SetDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "SetReadDeadline", name: "SetReadDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "SetWriteDeadline", name: "SetWriteDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}]; ptrType$1.methods = [{prop: "serverOffset", name: "serverOffset", pkg: "net", typ: $funcType([], [$Uint32], false)}, {prop: "nameList", name: "nameList", pkg: "net", typ: $funcType([$String], [sliceType], false)}]; ptrType$51.methods = [{prop: "init", name: "init", pkg: "net", typ: $funcType([], [], false)}, {prop: "tryUpdate", name: "tryUpdate", pkg: "net", typ: $funcType([$String], [], false)}, {prop: "tryAcquireSema", name: "tryAcquireSema", pkg: "net", typ: $funcType([], [$Bool], false)}, {prop: "releaseSema", name: "releaseSema", pkg: "net", typ: $funcType([], [], false)}]; hostLookupOrder.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; byPriorityWeight.methods = [{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: "shuffleByWeight", name: "shuffleByWeight", pkg: "net", typ: $funcType([], [], false)}, {prop: "sort", name: "sort", pkg: "net", typ: $funcType([], [], false)}]; byPref.methods = [{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: "net", typ: $funcType([], [], false)}]; ptrType$52.methods = [{prop: "Dial", name: "Dial", pkg: "", typ: $funcType([$String, $String], [Conn, $error], false)}, {prop: "dualStack", name: "dualStack", pkg: "net", typ: $funcType([], [$Bool], false)}, {prop: "deadline", name: "deadline", pkg: "net", typ: $funcType([context.Context, time.Time], [time.Time], false)}, {prop: "resolver", name: "resolver", pkg: "net", typ: $funcType([], [ptrType$13], false)}, {prop: "fallbackDelay", name: "fallbackDelay", pkg: "net", typ: $funcType([], [time.Duration], false)}, {prop: "DialContext", name: "DialContext", pkg: "", typ: $funcType([context.Context, $String, $String], [Conn, $error], false)}]; ptrType$53.methods = [{prop: "dialUnix", name: "dialUnix", pkg: "net", typ: $funcType([context.Context, ptrType$9, ptrType$9], [ptrType$10, $error], false)}, {prop: "dialUDP", name: "dialUDP", pkg: "net", typ: $funcType([context.Context, ptrType$16, ptrType$16], [ptrType$17, $error], false)}, {prop: "dialTCP", name: "dialTCP", pkg: "net", typ: $funcType([context.Context, ptrType$19, ptrType$19], [ptrType$20, $error], false)}, {prop: "doDialTCP", name: "doDialTCP", pkg: "net", typ: $funcType([context.Context, ptrType$19, ptrType$19], [ptrType$20, $error], false)}, {prop: "dialIP", name: "dialIP", pkg: "net", typ: $funcType([context.Context, ptrType$25, ptrType$25], [ptrType$36, $error], false)}, {prop: "dialParallel", name: "dialParallel", pkg: "net", typ: $funcType([context.Context, addrList, addrList], [Conn, $error], false)}, {prop: "dialSerial", name: "dialSerial", pkg: "net", typ: $funcType([context.Context, addrList], [Conn, $error], false)}, {prop: "dialSingle", name: "dialSingle", pkg: "net", typ: $funcType([context.Context, Addr], [Conn, $error], false)}]; ptrType$56.methods = [{prop: "canUseCgo", name: "canUseCgo", pkg: "net", typ: $funcType([], [$Bool], false)}, {prop: "hostLookupOrder", name: "hostLookupOrder", pkg: "net", typ: $funcType([ptrType$13, $String], [hostLookupOrder], false)}]; ptrType$57.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)}]; policyTable.methods = [{prop: "Classify", name: "Classify", pkg: "", typ: $funcType([IP], [policyTableEntry], false)}]; byMaskLength.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)}]; UnixAddr.init("", [{prop: "Name", name: "Name", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Net", name: "Net", embedded: false, exported: true, typ: $String, tag: ""}]); UnixConn.init("net", [{prop: "conn", name: "conn", embedded: true, exported: false, typ: conn, tag: ""}]); UDPAddr.init("", [{prop: "IP", name: "IP", embedded: false, exported: true, typ: IP, tag: ""}, {prop: "Port", name: "Port", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Zone", name: "Zone", embedded: false, exported: true, typ: $String, tag: ""}]); UDPConn.init("net", [{prop: "conn", name: "conn", embedded: true, exported: false, typ: conn, tag: ""}]); TCPAddr.init("", [{prop: "IP", name: "IP", embedded: false, exported: true, typ: IP, tag: ""}, {prop: "Port", name: "Port", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Zone", name: "Zone", embedded: false, exported: true, typ: $String, tag: ""}]); TCPConn.init("net", [{prop: "conn", name: "conn", embedded: true, exported: false, typ: conn, tag: ""}]); sockaddr.init([{prop: "Network", name: "Network", pkg: "", typ: $funcType([], [$String], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "family", name: "family", pkg: "net", typ: $funcType([], [$Int], false)}, {prop: "isWildcard", name: "isWildcard", pkg: "net", typ: $funcType([], [$Bool], false)}, {prop: "sockaddr", name: "sockaddr", pkg: "net", typ: $funcType([$Int], [syscall.Sockaddr, $error], false)}, {prop: "toLocal", name: "toLocal", pkg: "net", typ: $funcType([$String], [sockaddr], false)}]); rawConn.init("net", [{prop: "fd", name: "fd", embedded: false, exported: false, typ: ptrType$7, tag: ""}]); file.init("net", [{prop: "file", name: "file", embedded: false, exported: false, typ: ptrType$11, tag: ""}, {prop: "data", name: "data", embedded: false, exported: false, typ: sliceType$1, tag: ""}, {prop: "atEOF", name: "atEOF", embedded: false, exported: false, typ: $Bool, tag: ""}]); nssConf.init("net", [{prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "sources", name: "sources", embedded: false, exported: false, typ: mapType$1, tag: ""}]); nssSource.init("net", [{prop: "source", name: "source", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "criteria", name: "criteria", embedded: false, exported: false, typ: sliceType$3, tag: ""}]); nssCriterion.init("net", [{prop: "negate", name: "negate", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "status", name: "status", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "action", name: "action", embedded: false, exported: false, typ: $String, tag: ""}]); Addr.init([{prop: "Network", name: "Network", pkg: "", typ: $funcType([], [$String], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]); Conn.init([{prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "LocalAddr", name: "LocalAddr", pkg: "", typ: $funcType([], [Addr], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}, {prop: "RemoteAddr", name: "RemoteAddr", pkg: "", typ: $funcType([], [Addr], false)}, {prop: "SetDeadline", name: "SetDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "SetReadDeadline", name: "SetReadDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "SetWriteDeadline", name: "SetWriteDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}]); conn.init("net", [{prop: "fd", name: "fd", embedded: false, exported: false, typ: ptrType$7, tag: ""}]); PacketConn.init([{prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "LocalAddr", name: "LocalAddr", pkg: "", typ: $funcType([], [Addr], false)}, {prop: "ReadFrom", name: "ReadFrom", pkg: "", typ: $funcType([sliceType$1], [$Int, Addr, $error], false)}, {prop: "SetDeadline", name: "SetDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "SetReadDeadline", name: "SetReadDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "SetWriteDeadline", name: "SetWriteDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "WriteTo", name: "WriteTo", pkg: "", typ: $funcType([sliceType$1, Addr], [$Int, $error], false)}]); Listener.init([{prop: "Accept", name: "Accept", pkg: "", typ: $funcType([], [Conn, $error], false)}, {prop: "Addr", name: "Addr", pkg: "", typ: $funcType([], [Addr], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}]); Error.init([{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)}]); OpError.init("", [{prop: "Op", name: "Op", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Net", name: "Net", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Source", name: "Source", embedded: false, exported: true, typ: Addr, tag: ""}, {prop: "Addr", name: "Addr", embedded: false, exported: true, typ: Addr, tag: ""}, {prop: "Err", name: "Err", embedded: false, exported: true, typ: $error, tag: ""}]); timeout.init([{prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}]); temporary.init([{prop: "Temporary", name: "Temporary", pkg: "", typ: $funcType([], [$Bool], false)}]); ParseError.init("", [{prop: "Type", name: "Type", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Text", name: "Text", embedded: false, exported: true, typ: $String, tag: ""}]); AddrError.init("", [{prop: "Err", name: "Err", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Addr", name: "Addr", embedded: false, exported: true, typ: $String, tag: ""}]); timeoutError.init("", []); DNSError.init("", [{prop: "Err", name: "Err", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Name", name: "Name", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Server", name: "Server", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "IsTimeout", name: "IsTimeout", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "IsTemporary", name: "IsTemporary", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "IsNotFound", name: "IsNotFound", embedded: false, exported: true, typ: $Bool, tag: ""}]); writerOnly.init("", [{prop: "Writer", name: "Writer", embedded: true, exported: true, typ: io.Writer, tag: ""}]); buffersWriter.init([{prop: "writeBuffers", name: "writeBuffers", pkg: "net", typ: $funcType([ptrType$2], [$Int64, $error], false)}]); Buffers.init(sliceType$1); HardwareAddr.init($Uint8); Resolver.init("net", [{prop: "PreferGo", name: "PreferGo", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "StrictErrors", name: "StrictErrors", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "Dial", name: "Dial", embedded: false, exported: true, typ: funcType$4, tag: ""}, {prop: "lookupGroup", name: "lookupGroup", embedded: false, exported: false, typ: singleflight.Group, tag: ""}]); onlyValuesCtx.init("net", [{prop: "Context", name: "Context", embedded: true, exported: true, typ: context.Context, tag: ""}, {prop: "lookupValues", name: "lookupValues", embedded: false, exported: false, typ: context.Context, tag: ""}]); ipStackCapabilities.init("net", [{prop: "Once", name: "Once", embedded: true, exported: true, typ: sync.Once, tag: ""}, {prop: "ipv4Enabled", name: "ipv4Enabled", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "ipv6Enabled", name: "ipv6Enabled", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "ipv4MappedIPv6Enabled", name: "ipv4MappedIPv6Enabled", embedded: false, exported: false, typ: $Bool, tag: ""}]); addrList.init(Addr); IPAddr.init("", [{prop: "IP", name: "IP", embedded: false, exported: true, typ: IP, tag: ""}, {prop: "Zone", name: "Zone", embedded: false, exported: true, typ: $String, tag: ""}]); IPConn.init("net", [{prop: "conn", name: "conn", embedded: true, exported: false, typ: conn, tag: ""}]); IP.init($Uint8); IPMask.init($Uint8); IPNet.init("", [{prop: "IP", name: "IP", embedded: false, exported: true, typ: IP, tag: ""}, {prop: "Mask", name: "Mask", embedded: false, exported: true, typ: IPMask, tag: ""}]); Interface.init("", [{prop: "Index", name: "Index", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "MTU", name: "MTU", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Name", name: "Name", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "HardwareAddr", name: "HardwareAddr", embedded: false, exported: true, typ: HardwareAddr, tag: ""}, {prop: "Flags", name: "Flags", embedded: false, exported: true, typ: Flags, tag: ""}]); ipv6ZoneCache.init("net", [{prop: "RWMutex", name: "RWMutex", embedded: true, exported: true, typ: sync.RWMutex, tag: ""}, {prop: "lastFetched", name: "lastFetched", embedded: false, exported: false, typ: time.Time, tag: ""}, {prop: "toIndex", name: "toIndex", embedded: false, exported: false, typ: mapType$2, tag: ""}, {prop: "toName", name: "toName", embedded: false, exported: false, typ: mapType$3, tag: ""}]); netFD.init("net", [{prop: "pfd", name: "pfd", embedded: false, exported: false, typ: poll.FD, tag: ""}, {prop: "family", name: "family", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "sotype", name: "sotype", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "isConnected", name: "isConnected", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "net", name: "net", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "laddr", name: "laddr", embedded: false, exported: false, typ: Addr, tag: ""}, {prop: "raddr", name: "raddr", embedded: false, exported: false, typ: Addr, tag: ""}]); dnsConfig.init("net", [{prop: "servers", name: "servers", embedded: false, exported: false, typ: sliceType, tag: ""}, {prop: "search", name: "search", embedded: false, exported: false, typ: sliceType, tag: ""}, {prop: "ndots", name: "ndots", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "timeout", name: "timeout", embedded: false, exported: false, typ: time.Duration, tag: ""}, {prop: "attempts", name: "attempts", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "rotate", name: "rotate", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "unknownOpt", name: "unknownOpt", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "lookup", name: "lookup", embedded: false, exported: false, typ: sliceType, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "mtime", name: "mtime", embedded: false, exported: false, typ: time.Time, tag: ""}, {prop: "soffset", name: "soffset", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "singleRequest", name: "singleRequest", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "useTCP", name: "useTCP", embedded: false, exported: false, typ: $Bool, tag: ""}]); resolverConfig.init("net", [{prop: "initOnce", name: "initOnce", embedded: false, exported: false, typ: sync.Once, tag: ""}, {prop: "ch", name: "ch", embedded: false, exported: false, typ: chanType, tag: ""}, {prop: "lastChecked", name: "lastChecked", embedded: false, exported: false, typ: time.Time, tag: ""}, {prop: "mu", name: "mu", embedded: false, exported: false, typ: sync.RWMutex, tag: ""}, {prop: "dnsConfig", name: "dnsConfig", embedded: false, exported: false, typ: ptrType$1, tag: ""}]); SRV.init("", [{prop: "Target", name: "Target", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Port", name: "Port", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Priority", name: "Priority", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Weight", name: "Weight", embedded: false, exported: true, typ: $Uint16, tag: ""}]); byPriorityWeight.init(ptrType$32); MX.init("", [{prop: "Host", name: "Host", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Pref", name: "Pref", embedded: false, exported: true, typ: $Uint16, tag: ""}]); byPref.init(ptrType$33); NS.init("", [{prop: "Host", name: "Host", embedded: false, exported: true, typ: $String, tag: ""}]); Dialer.init("", [{prop: "Timeout", name: "Timeout", embedded: false, exported: true, typ: time.Duration, tag: ""}, {prop: "Deadline", name: "Deadline", embedded: false, exported: true, typ: time.Time, tag: ""}, {prop: "LocalAddr", name: "LocalAddr", embedded: false, exported: true, typ: Addr, tag: ""}, {prop: "DualStack", name: "DualStack", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "FallbackDelay", name: "FallbackDelay", embedded: false, exported: true, typ: time.Duration, tag: ""}, {prop: "KeepAlive", name: "KeepAlive", embedded: false, exported: true, typ: time.Duration, tag: ""}, {prop: "Resolver", name: "Resolver", embedded: false, exported: true, typ: ptrType$13, tag: ""}, {prop: "Cancel", name: "Cancel", embedded: false, exported: true, typ: chanType$5, tag: ""}, {prop: "Control", name: "Control", embedded: false, exported: true, typ: funcType$7, tag: ""}]); sysDialer.init("net", [{prop: "Dialer", name: "Dialer", embedded: true, exported: true, typ: Dialer, tag: ""}, {prop: "network", name: "network", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "address", name: "address", embedded: false, exported: false, typ: $String, tag: ""}]); conf.init("net", [{prop: "forceCgoLookupHost", name: "forceCgoLookupHost", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "netGo", name: "netGo", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "netCgo", name: "netCgo", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "hasMDNSAllow", name: "hasMDNSAllow", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "goos", name: "goos", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "dnsDebugLevel", name: "dnsDebugLevel", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "nss", name: "nss", embedded: false, exported: false, typ: ptrType$4, tag: ""}, {prop: "resolv", name: "resolv", embedded: false, exported: false, typ: ptrType$1, tag: ""}]); ipAttr.init("", [{prop: "Scope", name: "Scope", embedded: false, exported: true, typ: scope, tag: ""}, {prop: "Precedence", name: "Precedence", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Label", name: "Label", embedded: false, exported: true, typ: $Uint8, tag: ""}]); byRFC6724.init("net", [{prop: "addrs", name: "addrs", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "addrAttr", name: "addrAttr", embedded: false, exported: false, typ: sliceType$16, tag: ""}, {prop: "srcs", name: "srcs", embedded: false, exported: false, typ: sliceType$9, tag: ""}, {prop: "srcAttr", name: "srcAttr", embedded: false, exported: false, typ: sliceType$16, tag: ""}]); policyTableEntry.init("", [{prop: "Prefix", name: "Prefix", embedded: false, exported: true, typ: ptrType$5, tag: ""}, {prop: "Precedence", name: "Precedence", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Label", name: "Label", embedded: false, exported: true, typ: $Uint8, tag: ""}]); policyTable.init(policyTableEntry); byMaskLength.init(policyTableEntry); result.init("net", [{prop: "p", name: "p", embedded: false, exported: false, typ: dnsmessage.Parser, tag: ""}, {prop: "server", name: "server", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "error", name: "error", embedded: true, exported: false, typ: $error, tag: ""}]); dialResult.init("net", [{prop: "Conn", name: "Conn", embedded: true, exported: true, typ: Conn, tag: ""}, {prop: "error", name: "error", embedded: true, exported: false, typ: $error, tag: ""}, {prop: "primary", name: "primary", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "done", name: "done", embedded: false, exported: false, 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 = context.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = errors.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = js.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = bytealg.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = itoa.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = nettrace.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = poll.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = singleflight.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = io.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = os.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = runtime.$init(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sort.$init(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sync.$init(); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = atomic.$init(); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = syscall.$init(); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = time.$init(); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = dnsmessage.$init(); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } onceReadServices = new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)); netGo = false; netCgo = false; listenerBacklogCache = new structType.ptr(new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)), 0); onceReadProtocols = new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)); dnsWaitGroup = new sync.WaitGroup.ptr(0, $chanNil, arrayType.zero()); ipStackCaps = new ipStackCapabilities.ptr(new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)), false, false, false); hosts = new structType$1.ptr(new sync.Mutex.ptr(0, 0), false, false, new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil), "", new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil), new $Int64(0, 0)); testHookDialTCP = $throwNilPointerError; resolvConf = new resolverConfig.ptr(new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)), $chanNil, new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil), new sync.RWMutex.ptr(new sync.Mutex.ptr(0, 0), 0, 0, 0, 0), ptrType$1.nil); confOnce = new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)); errNoSuitableAddress = errors.New("no suitable address found"); errMissingAddress = errors.New("missing address"); errCanceled = errors.New("operation was canceled"); $pkg.ErrWriteToConnected = errors.New("use of WriteTo with pre-connected connection"); aLongTimeAgo = $clone(time.Unix(new $Int64(0, 1), new $Int64(0, 0)), time.Time); noDeadline = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil); errTimeout = new timeoutError.ptr(); errNoSuchHost = errors.New("no such host"); errClosed = $clone(poll.ErrNetClosing, poll.errNetClosing); $pkg.ErrClosed = new errClosed.constructor.elem(errClosed); protocols = $makeMap($String.keyFor, [{ k: "icmp", v: 1 }, { k: "igmp", v: 2 }, { k: "tcp", v: 6 }, { k: "udp", v: 17 }, { k: "ipv6-icmp", v: 58 }]); services = $makeMap($String.keyFor, [{ k: "udp", v: $makeMap($String.keyFor, [{ k: "domain", v: 53 }]) }, { k: "tcp", v: $makeMap($String.keyFor, [{ k: "ftp", v: 21 }, { k: "ftps", v: 990 }, { k: "gopher", v: 70 }, { k: "http", v: 80 }, { k: "https", v: 443 }, { k: "imap2", v: 143 }, { k: "imap3", v: 220 }, { k: "imaps", v: 993 }, { k: "pop3", v: 110 }, { k: "pop3s", v: 995 }, { k: "smtp", v: 25 }, { k: "ssh", v: 22 }, { k: "telnet", v: 23 }]) }]); $pkg.DefaultResolver = new Resolver.ptr(false, false, $throwNilPointerError, new singleflight.Group.ptr(new sync.Mutex.ptr(0, 0), false)); errMalformedDNSRecordsDetail = "DNS response contained records which contain invalid names"; v4InV6Prefix = new sliceType$1([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255]); $pkg.IPv4bcast = IPv4(255, 255, 255, 255); $pkg.IPv4allsys = IPv4(224, 0, 0, 1); $pkg.IPv4allrouter = IPv4(224, 0, 0, 2); $pkg.IPv4zero = IPv4(0, 0, 0, 0); $pkg.IPv6zero = new IP([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); $pkg.IPv6unspecified = new IP([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); $pkg.IPv6loopback = new IP([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]); classAMask = IPv4Mask(255, 0, 0, 0); classBMask = IPv4Mask(255, 255, 0, 0); classCMask = IPv4Mask(255, 255, 255, 0); errInvalidInterface = errors.New("invalid network interface"); errInvalidInterfaceIndex = errors.New("invalid network interface index"); errInvalidInterfaceName = errors.New("invalid network interface name"); errNoSuchInterface = errors.New("no such network interface"); errNoSuchMulticastInterface = errors.New("no such multicast network interface"); flagNames = new sliceType(["up", "broadcast", "loopback", "pointtopoint", "multicast"]); zoneCache = new ipv6ZoneCache.ptr(new sync.RWMutex.ptr(new sync.Mutex.ptr(0, 0), 0, 0, 0, 0), new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil), {}, {}); testHookCanceledDial = (function() { }); socketFunc = syscall.Socket; connectFunc = syscall.Connect; listenFunc = syscall.Listen; getsockoptIntFunc = syscall.GetsockoptInt; testHookHostsPath = "/etc/hosts"; testHookLookupIP = (function $b(ctx, fn, network, host) { var $24r, _r, ctx, fn, host, network, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; ctx = $f.ctx; fn = $f.fn; host = $f.host; network = $f.network; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = fn(ctx, network, host); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$24r = $24r; $f._r = _r; $f.ctx = ctx; $f.fn = fn; $f.host = host; $f.network = network; $f.$s = $s; $f.$r = $r; return $f; }); testHookSetKeepAlive = (function(param) { var param; }); defaultNS = new sliceType(["127.0.0.1:53", "[::1]:53"]); getHostname = os.Hostname; errLameReferral = errors.New("lame referral"); errCannotUnmarshalDNSMessage = errors.New("cannot unmarshal DNS message"); errCannotMarshalDNSMessage = errors.New("cannot marshal DNS message"); errServerMisbehaving = errors.New("server misbehaving"); errInvalidDNSResponse = errors.New("invalid DNS response"); errNoAnswerFromDNSServer = errors.New("no answer from DNS server"); errServerTemporarilyMisbehaving = errors.New("server misbehaving"); lookupOrderName = $makeMap(hostLookupOrder.keyFor, [{ k: 0, v: "cgo" }, { k: 1, v: "files,dns" }, { k: 2, v: "dns,files" }, { k: 3, v: "files" }, { k: 4, v: "dns" }]); confVal = new conf.ptr(false, false, false, false, "linux", 0, ptrType$4.nil, ptrType$1.nil); _r = mustCIDR("::1/128"); /* */ $s = 18; case 18: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = mustCIDR("::/0"); /* */ $s = 19; case 19: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = mustCIDR("::ffff:0:0/96"); /* */ $s = 20; case 20: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = mustCIDR("2002::/16"); /* */ $s = 21; case 21: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = mustCIDR("2001::/32"); /* */ $s = 22; case 22: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = mustCIDR("fc00::/7"); /* */ $s = 23; case 23: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$6 = mustCIDR("::/96"); /* */ $s = 24; case 24: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$7 = mustCIDR("fec0::/10"); /* */ $s = 25; case 25: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$8 = mustCIDR("3ffe::/16"); /* */ $s = 26; case 26: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } rfc6724policyTable = new policyTable([new policyTableEntry.ptr(_r, 50, 0), new policyTableEntry.ptr(_r$1, 40, 1), new policyTableEntry.ptr(_r$2, 35, 4), new policyTableEntry.ptr(_r$3, 30, 2), new policyTableEntry.ptr(_r$4, 5, 5), new policyTableEntry.ptr(_r$5, 3, 13), new policyTableEntry.ptr(_r$6, 1, 3), new policyTableEntry.ptr(_r$7, 1, 11), new policyTableEntry.ptr(_r$8, 1, 12)]); init(); $r = init$1(); /* */ $s = 27; case 27: 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/StackExchange/dnscontrol/v4/pkg/spflib"] = (function() { var $pkg = {}, $init, bytes, json, fmt, io, ioutil, net, os, strings, SPFRecord, SPFPart, sliceType, sliceType$1, ptrType$2, ptrType$3, sliceType$3, sliceType$4, sliceType$5, mapType$1, qualifiers, Parse, dump, Chunks, matchesFlatSpec; bytes = $packages["bytes"]; json = $packages["encoding/json"]; fmt = $packages["fmt"]; io = $packages["io"]; ioutil = $packages["io/ioutil"]; net = $packages["net"]; os = $packages["os"]; strings = $packages["strings"]; SPFRecord = $pkg.SPFRecord = $newType(0, $kindStruct, "spflib.SPFRecord", true, "github.com/StackExchange/dnscontrol/v4/pkg/spflib", true, function(Parts_) { this.$val = this; if (arguments.length === 0) { this.Parts = sliceType$3.nil; return; } this.Parts = Parts_; }); SPFPart = $pkg.SPFPart = $newType(0, $kindStruct, "spflib.SPFPart", true, "github.com/StackExchange/dnscontrol/v4/pkg/spflib", true, function(Text_, IsLookup_, IncludeRecord_, IncludeDomain_) { this.$val = this; if (arguments.length === 0) { this.Text = ""; this.IsLookup = false; this.IncludeRecord = ptrType$2.nil; this.IncludeDomain = ""; return; } this.Text = Text_; this.IsLookup = IsLookup_; this.IncludeRecord = IncludeRecord_; this.IncludeDomain = IncludeDomain_; }); sliceType = $sliceType($emptyInterface); sliceType$1 = $sliceType($String); ptrType$2 = $ptrType(SPFRecord); ptrType$3 = $ptrType(SPFPart); sliceType$3 = $sliceType(ptrType$3); sliceType$4 = $sliceType($Uint8); sliceType$5 = $sliceType($Int32); mapType$1 = $mapType($String, sliceType$1); SPFRecord.ptr.prototype.Lookups = function() { var _i, _ref, count, p, s; s = this; count = 0; _ref = s.Parts; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } p = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (p.IsLookup) { count = count + (1) >> 0; } if (!(p.IncludeRecord === ptrType$2.nil)) { count = count + (p.IncludeRecord.Lookups()) >> 0; } _i++; } return count; }; SPFRecord.prototype.Lookups = function() { return this.$val.Lookups(); }; Parse = function(text, dnsres) { var $24r, $24r$1, $24r$2, $24r$3, _entry, _i, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _ref, _tuple, _tuple$1, dnsres, err, p, part, parts, pi, rec, subRecord, text, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; _entry = $f._entry; _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; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; dnsres = $f.dnsres; err = $f.err; p = $f.p; part = $f.part; parts = $f.parts; pi = $f.pi; rec = $f.rec; subRecord = $f.subRecord; text = $f.text; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (!strings.HasPrefix(text, "v=spf1 ")) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!strings.HasPrefix(text, "v=spf1 ")) { */ case 1: _r = fmt.Errorf("not an SPF record", new sliceType([])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = [ptrType$2.nil, _r]; $s = 4; case 4: return $24r; /* } */ case 2: parts = strings.Split(text, " "); rec = new SPFRecord.ptr(sliceType$3.nil); _ref = $subslice(parts, 1); _i = 0; /* while (true) { */ case 5: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 6; continue; } pi = _i; part = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (part === "") { _i++; /* continue; */ $s = 5; continue; } p = new SPFPart.ptr(part, false, ptrType$2.nil, ""); if ((_entry = qualifiers[$Uint8.keyFor(part.charCodeAt(0))], _entry !== undefined ? _entry.v : false)) { part = $substring(part, 1); } rec.Parts = $append(rec.Parts, p); /* */ if (part === "all") { $s = 7; continue; } /* */ if (strings.HasPrefix(part, "a") || strings.HasPrefix(part, "mx")) { $s = 8; continue; } /* */ if (strings.HasPrefix(part, "ip4:") || strings.HasPrefix(part, "ip6:")) { $s = 9; continue; } /* */ if (strings.HasPrefix(part, "include:") || strings.HasPrefix(part, "redirect=")) { $s = 10; continue; } /* */ if (strings.HasPrefix(part, "exists:") || strings.HasPrefix(part, "ptr:")) { $s = 11; continue; } /* */ $s = 12; continue; /* if (part === "all") { */ case 7: /* break; */ $s = 6; continue; $s = 13; continue; /* } else if (strings.HasPrefix(part, "a") || strings.HasPrefix(part, "mx")) { */ case 8: p.IsLookup = true; $s = 13; continue; /* } else if (strings.HasPrefix(part, "ip4:") || strings.HasPrefix(part, "ip6:")) { */ case 9: _i++; /* continue; */ $s = 5; continue; $s = 13; continue; /* } else if (strings.HasPrefix(part, "include:") || strings.HasPrefix(part, "redirect=")) { */ case 10: /* */ if (strings.HasPrefix(part, "redirect=")) { $s = 14; continue; } /* */ $s = 15; continue; /* if (strings.HasPrefix(part, "redirect=")) { */ case 14: /* */ if (!((((pi + 2 >> 0)) === parts.$length))) { $s = 17; continue; } /* */ $s = 18; continue; /* if (!((((pi + 2 >> 0)) === parts.$length))) { */ case 17: _r$1 = fmt.Errorf("%s must be last item", new sliceType([new $String(part)])); /* */ $s = 19; case 19: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r$1 = [ptrType$2.nil, _r$1]; $s = 20; case 20: return $24r$1; /* } */ case 18: p.IncludeDomain = strings.TrimPrefix(part, "redirect="); $s = 16; continue; /* } else { */ case 15: p.IncludeDomain = strings.TrimPrefix(part, "include:"); /* } */ case 16: p.IsLookup = true; /* */ if (!($interfaceIsEqual(dnsres, $ifaceNil))) { $s = 21; continue; } /* */ $s = 22; continue; /* if (!($interfaceIsEqual(dnsres, $ifaceNil))) { */ case 21: _r$2 = dnsres.GetSPF(p.IncludeDomain); /* */ $s = 23; case 23: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; subRecord = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$2.nil, err]; } _r$3 = Parse(subRecord, dnsres); /* */ $s = 24; case 24: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$1 = _r$3; p.IncludeRecord = _tuple$1[0]; err = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 25; continue; } /* */ $s = 26; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 25: _r$4 = fmt.Errorf("in included SPF: %s", new sliceType([err])); /* */ $s = 27; case 27: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r$2 = [ptrType$2.nil, _r$4]; $s = 28; case 28: return $24r$2; /* } */ case 26: /* } */ case 22: $s = 13; continue; /* } else if (strings.HasPrefix(part, "exists:") || strings.HasPrefix(part, "ptr:")) { */ case 11: p.IsLookup = true; $s = 13; continue; /* } else { */ case 12: _r$5 = fmt.Errorf("unsupported SPF part %s", new sliceType([new $String(part)])); /* */ $s = 29; case 29: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $24r$3 = [ptrType$2.nil, _r$5]; $s = 30; case 30: return $24r$3; /* } */ case 13: _i++; $s = 5; continue; case 6: $s = -1; return [rec, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Parse }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f._entry = _entry; $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._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.dnsres = dnsres; $f.err = err; $f.p = p; $f.part = part; $f.parts = parts; $f.pi = pi; $f.rec = rec; $f.subRecord = subRecord; $f.text = text; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Parse = Parse; dump = function(rec, indent, w) { var _i, _i$1, _r, _r$1, _r$2, _r$3, _r$4, _ref, _ref$1, indent, p, p$1, rec, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _i$1 = $f._i$1; _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; _ref$1 = $f._ref$1; indent = $f.indent; p = $f.p; p$1 = $f.p$1; rec = $f.rec; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = fmt.Fprintf(w, "%sTotal Lookups: %d\n", new sliceType([new $String(indent), new $Int(rec.Lookups())])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; _r$1 = fmt.Fprint(w, new sliceType([new $String(indent + "v=spf1")])); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _ref = rec.Parts; _i = 0; /* while (true) { */ case 3: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 4; continue; } p = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r$2 = fmt.Fprint(w, new sliceType([new $String(" " + p.Text)])); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; _i++; $s = 3; continue; case 4: _r$3 = fmt.Fprintln(w, new sliceType([])); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; indent = indent + ("\t"); _ref$1 = rec.Parts; _i$1 = 0; /* while (true) { */ case 7: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 8; continue; } p$1 = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); /* */ if (p$1.IsLookup) { $s = 9; continue; } /* */ $s = 10; continue; /* if (p$1.IsLookup) { */ case 9: _r$4 = fmt.Fprintln(w, new sliceType([new $String(indent + p$1.Text)])); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; /* } */ case 10: /* */ if (!(p$1.IncludeRecord === ptrType$2.nil)) { $s = 12; continue; } /* */ $s = 13; continue; /* if (!(p$1.IncludeRecord === ptrType$2.nil)) { */ case 12: $r = dump(p$1.IncludeRecord, indent + "\t", w); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 13: _i$1++; $s = 7; continue; case 8: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: dump }; } $f._i = _i; $f._i$1 = _i$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._ref = _ref; $f._ref$1 = _ref$1; $f.indent = indent; $f.p = p; $f.p$1 = p$1; $f.rec = rec; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; SPFRecord.ptr.prototype.Print = function() { var s, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; s = $f.s; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; w = new bytes.Buffer.ptr(sliceType$4.nil, 0, 0); $r = dump(s, "", w); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return w.String(); /* */ } return; } if ($f === undefined) { $f = { $blk: SPFRecord.ptr.prototype.Print }; } $f.s = s; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; SPFRecord.prototype.Print = function() { return this.$val.Print(); }; Chunks = function(s, chunkSize) { var _i, _ref, _rune, chunk, chunkSize, chunks, len, r, s; if (chunkSize >= s.length) { return new sliceType$1([s]); } chunks = sliceType$1.nil; chunk = $makeSlice(sliceType$5, chunkSize); len = 0; _ref = s; _i = 0; while (true) { if (!(_i < _ref.length)) { break; } _rune = $decodeRune(_ref, _i); r = _rune[0]; ((len < 0 || len >= chunk.$length) ? ($throwRuntimeError("index out of range"), undefined) : chunk.$array[chunk.$offset + len] = r); len = len + (1) >> 0; if (len === chunkSize) { chunks = $append(chunks, ($runesToString(chunk))); len = 0; } _i += _rune[1]; } if (len > 0) { chunks = $append(chunks, ($runesToString($subslice(chunk, 0, len)))); } return chunks; }; $pkg.Chunks = Chunks; SPFRecord.ptr.prototype.TXT = function() { var _i, _ref, p, s, text; s = this; text = "v=spf1"; _ref = s.Parts; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } p = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); text = text + (" " + p.Text); _i++; } return text; }; SPFRecord.prototype.TXT = function() { return this.$val.TXT(); }; SPFRecord.ptr.prototype.TXTSplit = function(pattern, overhead, txtMaxSize) { var m, overhead, pattern, s, txtMaxSize, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; m = $f.m; overhead = $f.overhead; pattern = $f.pattern; s = $f.s; txtMaxSize = $f.txtMaxSize; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; m = $makeMap($String.keyFor, []); $r = s.split("@", pattern, 1, m, overhead, txtMaxSize); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return m; /* */ } return; } if ($f === undefined) { $f = { $blk: SPFRecord.ptr.prototype.TXTSplit }; } $f.m = m; $f.overhead = overhead; $f.pattern = pattern; $f.s = s; $f.txtMaxSize = txtMaxSize; $f.$s = $s; $f.$r = $r; return $f; }; SPFRecord.prototype.TXTSplit = function(pattern, overhead, txtMaxSize) { return this.$val.TXTSplit(pattern, overhead, txtMaxSize); }; SPFRecord.ptr.prototype.split = function(thisfqdn, pattern, nextIdx, m, overhead, txtMaxSize) { var _i, _key, _key$1, _key$2, _r, _ref, addedCount, base, lastPart, m, maxLen, newRec, nextFQDN, nextIdx, over, overhead, part, pattern, s, tail, thisText, thisfqdn, txtMaxSize, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _key = $f._key; _key$1 = $f._key$1; _key$2 = $f._key$2; _r = $f._r; _ref = $f._ref; addedCount = $f.addedCount; base = $f.base; lastPart = $f.lastPart; m = $f.m; maxLen = $f.maxLen; newRec = $f.newRec; nextFQDN = $f.nextFQDN; nextIdx = $f.nextIdx; over = $f.over; overhead = $f.overhead; part = $f.part; pattern = $f.pattern; s = $f.s; tail = $f.tail; thisText = $f.thisText; thisfqdn = $f.thisfqdn; txtMaxSize = $f.txtMaxSize; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; maxLen = txtMaxSize - overhead >> 0; base = s.TXT(); if (base.length <= maxLen) { _key = thisfqdn; (m || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: Chunks(base, 255) }; $s = -1; return; } _r = fmt.Sprintf(pattern, new sliceType([new $Int(nextIdx)])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } nextFQDN = _r; lastPart = (x = s.Parts, x$1 = s.Parts.$length - 1 >> 0, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])); tail = " include:" + nextFQDN + " " + lastPart.Text; thisText = "v=spf1"; newRec = new SPFRecord.ptr(sliceType$3.nil); over = false; addedCount = 0; _ref = s.Parts; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } part = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (!over) { if ((((thisText.length + 1 >> 0) + part.Text.length >> 0) + tail.length >> 0) <= maxLen) { thisText = thisText + (" " + part.Text); addedCount = addedCount + (1) >> 0; } else { over = true; if (addedCount === 0) { _key$1 = thisfqdn; (m || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key$1)] = { k: _key$1, v: new sliceType$1([base]) }; $s = -1; return; } } } if (over) { newRec.Parts = $append(newRec.Parts, part); } _i++; } _key$2 = thisfqdn; (m || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key$2)] = { k: _key$2, v: Chunks(thisText + tail, 255) }; $r = newRec.split(nextFQDN, pattern, nextIdx + 1 >> 0, m, 0, txtMaxSize); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: SPFRecord.ptr.prototype.split }; } $f._i = _i; $f._key = _key; $f._key$1 = _key$1; $f._key$2 = _key$2; $f._r = _r; $f._ref = _ref; $f.addedCount = addedCount; $f.base = base; $f.lastPart = lastPart; $f.m = m; $f.maxLen = maxLen; $f.newRec = newRec; $f.nextFQDN = nextFQDN; $f.nextIdx = nextIdx; $f.over = over; $f.overhead = overhead; $f.part = part; $f.pattern = pattern; $f.s = s; $f.tail = tail; $f.thisText = thisText; $f.thisfqdn = thisfqdn; $f.txtMaxSize = txtMaxSize; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; SPFRecord.prototype.split = function(thisfqdn, pattern, nextIdx, m, overhead, txtMaxSize) { return this.$val.split(thisfqdn, pattern, nextIdx, m, overhead, txtMaxSize); }; SPFRecord.ptr.prototype.Flatten = function(spec) { var _i, _ref, flattenedChild, newRec, p, s, spec; s = this; newRec = new SPFRecord.ptr(sliceType$3.nil); _ref = s.Parts; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } p = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (p.IncludeRecord === ptrType$2.nil) { newRec.Parts = $append(newRec.Parts, p); } else if (!matchesFlatSpec(spec, p.IncludeDomain)) { newRec.Parts = $append(newRec.Parts, p); } else { flattenedChild = p.IncludeRecord.Flatten(spec); newRec.Parts = $appendSlice(newRec.Parts, $subslice(flattenedChild.Parts, 0, (flattenedChild.Parts.$length - 1 >> 0))); } _i++; } return newRec; }; SPFRecord.prototype.Flatten = function(spec) { return this.$val.Flatten(spec); }; matchesFlatSpec = function(spec, fqdn) { var _i, _ref, fqdn, p, spec; if (spec === "*") { return true; } _ref = strings.Split(spec, ","); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } p = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (p === fqdn) { return true; } _i++; } return false; }; ptrType$2.methods = [{prop: "Lookups", name: "Lookups", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Print", name: "Print", pkg: "", typ: $funcType([], [$String], false)}, {prop: "TXT", name: "TXT", pkg: "", typ: $funcType([], [$String], false)}, {prop: "TXTSplit", name: "TXTSplit", pkg: "", typ: $funcType([$String, $Int, $Int], [mapType$1], false)}, {prop: "split", name: "split", pkg: "github.com/StackExchange/dnscontrol/v4/pkg/spflib", typ: $funcType([$String, $String, $Int, mapType$1, $Int, $Int], [], false)}, {prop: "Flatten", name: "Flatten", pkg: "", typ: $funcType([$String], [ptrType$2], false)}]; SPFRecord.init("", [{prop: "Parts", name: "Parts", embedded: false, exported: true, typ: sliceType$3, tag: ""}]); SPFPart.init("", [{prop: "Text", name: "Text", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "IsLookup", name: "IsLookup", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "IncludeRecord", name: "IncludeRecord", embedded: false, exported: true, typ: ptrType$2, tag: ""}, {prop: "IncludeDomain", name: "IncludeDomain", embedded: false, exported: true, 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 = bytes.$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; } $r = fmt.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = io.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = ioutil.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = net.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = os.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strings.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } qualifiers = $makeMap($Uint8.keyFor, [{ k: 63, v: true }, { k: 126, v: true }, { k: 45, v: true }, { k: 43, v: true }]); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["github.com/gopherjs/jquery"] = (function() { var $pkg = {}, $init, js, JQuery, Event, JQueryCoordinates, sliceType, funcType$1, mapType, sliceType$1, funcType$2, funcType$3, ptrType, sliceType$2, ptrType$1, NewJQuery; js = $packages["github.com/gopherjs/gopherjs/js"]; JQuery = $pkg.JQuery = $newType(0, $kindStruct, "jquery.JQuery", true, "github.com/gopherjs/jquery", true, function(o_, Jquery_, Selector_, Length_, Context_) { this.$val = this; if (arguments.length === 0) { this.o = null; this.Jquery = ""; this.Selector = ""; this.Length = 0; this.Context = ""; return; } this.o = o_; this.Jquery = Jquery_; this.Selector = Selector_; this.Length = Length_; this.Context = Context_; }); Event = $pkg.Event = $newType(0, $kindStruct, "jquery.Event", true, "github.com/gopherjs/jquery", true, function(Object_, KeyCode_, Target_, CurrentTarget_, DelegateTarget_, RelatedTarget_, Data_, Result_, Which_, Namespace_, MetaKey_, ShiftKey_, CtrlKey_, PageX_, PageY_, Type_) { this.$val = this; if (arguments.length === 0) { this.Object = null; this.KeyCode = 0; this.Target = null; this.CurrentTarget = null; this.DelegateTarget = null; this.RelatedTarget = null; this.Data = null; this.Result = null; this.Which = 0; this.Namespace = ""; this.MetaKey = false; this.ShiftKey = false; this.CtrlKey = false; this.PageX = 0; this.PageY = 0; this.Type = ""; return; } this.Object = Object_; this.KeyCode = KeyCode_; this.Target = Target_; this.CurrentTarget = CurrentTarget_; this.DelegateTarget = DelegateTarget_; this.RelatedTarget = RelatedTarget_; this.Data = Data_; this.Result = Result_; this.Which = Which_; this.Namespace = Namespace_; this.MetaKey = MetaKey_; this.ShiftKey = ShiftKey_; this.CtrlKey = CtrlKey_; this.PageX = PageX_; this.PageY = PageY_; this.Type = Type_; }); JQueryCoordinates = $pkg.JQueryCoordinates = $newType(0, $kindStruct, "jquery.JQueryCoordinates", true, "github.com/gopherjs/jquery", true, function(Left_, Top_) { this.$val = this; if (arguments.length === 0) { this.Left = 0; this.Top = 0; return; } this.Left = Left_; this.Top = Top_; }); sliceType = $sliceType($emptyInterface); funcType$1 = $funcType([$Int, $emptyInterface], [], false); mapType = $mapType($String, $emptyInterface); sliceType$1 = $sliceType($String); funcType$2 = $funcType([$Int, $String], [$String], false); funcType$3 = $funcType([], [], false); ptrType = $ptrType(js.Object); sliceType$2 = $sliceType($Bool); ptrType$1 = $ptrType(Event); Event.ptr.prototype.PreventDefault = function() { var event; event = this; event.Object.preventDefault(); }; Event.prototype.PreventDefault = function() { return this.$val.PreventDefault(); }; Event.ptr.prototype.IsDefaultPrevented = function() { var event; event = this; return !!(event.Object.isDefaultPrevented()); }; Event.prototype.IsDefaultPrevented = function() { return this.$val.IsDefaultPrevented(); }; Event.ptr.prototype.IsImmediatePropogationStopped = function() { var event; event = this; return !!(event.Object.isImmediatePropogationStopped()); }; Event.prototype.IsImmediatePropogationStopped = function() { return this.$val.IsImmediatePropogationStopped(); }; Event.ptr.prototype.IsPropagationStopped = function() { var event; event = this; return !!(event.Object.isPropagationStopped()); }; Event.prototype.IsPropagationStopped = function() { return this.$val.IsPropagationStopped(); }; Event.ptr.prototype.StopImmediatePropagation = function() { var event; event = this; event.Object.stopImmediatePropagation(); }; Event.prototype.StopImmediatePropagation = function() { return this.$val.StopImmediatePropagation(); }; Event.ptr.prototype.StopPropagation = function() { var event; event = this; event.Object.stopPropagation(); }; Event.prototype.StopPropagation = function() { return this.$val.StopPropagation(); }; NewJQuery = function(args) { var args; return new JQuery.ptr(new ($global.Function.prototype.bind.apply($global.jQuery, [undefined].concat($externalize(args, sliceType)))), "", "", 0, ""); }; $pkg.NewJQuery = NewJQuery; JQuery.ptr.prototype.Each = function(fn) { var fn, j; j = this; j.o = j.o.each($externalize(fn, funcType$1)); return j; }; JQuery.prototype.Each = function(fn) { return this.$val.Each(fn); }; JQuery.ptr.prototype.Call = function(name, args) { var args, j, name, obj; j = this; return NewJQuery(new sliceType([new $jsObjectPtr((obj = j.o, obj[$externalize(name, $String)].apply(obj, $externalize(args, sliceType))))])); }; JQuery.prototype.Call = function(name, args) { return this.$val.Call(name, args); }; JQuery.ptr.prototype.Underlying = function() { var j; j = this; return j.o; }; JQuery.prototype.Underlying = function() { return this.$val.Underlying(); }; JQuery.ptr.prototype.Get = function(i) { var i, j, obj; j = this; return (obj = j.o, obj.get.apply(obj, $externalize(i, sliceType))); }; JQuery.prototype.Get = function(i) { return this.$val.Get(i); }; JQuery.ptr.prototype.Append = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.append.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.Append = function(i) { return this.$val.Append(i); }; JQuery.ptr.prototype.Empty = function() { var j; j = this; j.o = j.o.empty(); return j; }; JQuery.prototype.Empty = function() { return this.$val.Empty(); }; JQuery.ptr.prototype.Detach = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.detach.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.Detach = function(i) { return this.$val.Detach(i); }; JQuery.ptr.prototype.Eq = function(idx) { var idx, j; j = this; j.o = j.o.eq(idx); return j; }; JQuery.prototype.Eq = function(idx) { return this.$val.Eq(idx); }; JQuery.ptr.prototype.FadeIn = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.fadeIn.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.FadeIn = function(i) { return this.$val.FadeIn(i); }; JQuery.ptr.prototype.Delay = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.delay.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.Delay = function(i) { return this.$val.Delay(i); }; JQuery.ptr.prototype.ToArray = function() { var j; j = this; return $assertType($internalize(j.o.toArray(), $emptyInterface), sliceType); }; JQuery.prototype.ToArray = function() { return this.$val.ToArray(); }; JQuery.ptr.prototype.Remove = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.remove.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.Remove = function(i) { return this.$val.Remove(i); }; JQuery.ptr.prototype.Stop = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.stop.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.Stop = function(i) { return this.$val.Stop(i); }; JQuery.ptr.prototype.AddBack = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.addBack.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.AddBack = function(i) { return this.$val.AddBack(i); }; JQuery.ptr.prototype.Css = function(name) { var j, name; j = this; return $internalize(j.o.css($externalize(name, $String)), $String); }; JQuery.prototype.Css = function(name) { return this.$val.Css(name); }; JQuery.ptr.prototype.CssArray = function(arr) { var arr, j; j = this; return $assertType($internalize(j.o.css($externalize(arr, sliceType$1)), $emptyInterface), mapType); }; JQuery.prototype.CssArray = function(arr) { return this.$val.CssArray(arr); }; JQuery.ptr.prototype.SetCss = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.css.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.SetCss = function(i) { return this.$val.SetCss(i); }; JQuery.ptr.prototype.Text = function() { var j; j = this; return $internalize(j.o.text(), $String); }; JQuery.prototype.Text = function() { return this.$val.Text(); }; JQuery.ptr.prototype.SetText = function(i) { var _ref, i, j; j = this; _ref = i; if ($assertType(_ref, funcType$2, true)[1] || $assertType(_ref, $String, true)[1]) { } else { $print("SetText Argument should be 'string' or 'func(int, string) string'"); } j.o = j.o.text($externalize(i, $emptyInterface)); return j; }; JQuery.prototype.SetText = function(i) { return this.$val.SetText(i); }; JQuery.ptr.prototype.Val = function() { var j; j = this; return $internalize(j.o.val(), $String); }; JQuery.prototype.Val = function() { return this.$val.Val(); }; JQuery.ptr.prototype.SetVal = function(i) { var i, j; j = this; j.o.val($externalize(i, $emptyInterface)); return j; }; JQuery.prototype.SetVal = function(i) { return this.$val.SetVal(i); }; JQuery.ptr.prototype.Prop = function(property) { var j, property; j = this; return $internalize(j.o.prop($externalize(property, $String)), $emptyInterface); }; JQuery.prototype.Prop = function(property) { return this.$val.Prop(property); }; JQuery.ptr.prototype.SetProp = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.prop.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.SetProp = function(i) { return this.$val.SetProp(i); }; JQuery.ptr.prototype.RemoveProp = function(property) { var j, property; j = this; j.o = j.o.removeProp($externalize(property, $String)); return j; }; JQuery.prototype.RemoveProp = function(property) { return this.$val.RemoveProp(property); }; JQuery.ptr.prototype.Attr = function(property) { var attr, j, property; j = this; attr = j.o.attr($externalize(property, $String)); if (attr === undefined) { return ""; } return $internalize(attr, $String); }; JQuery.prototype.Attr = function(property) { return this.$val.Attr(property); }; JQuery.ptr.prototype.SetAttr = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.attr.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.SetAttr = function(i) { return this.$val.SetAttr(i); }; JQuery.ptr.prototype.RemoveAttr = function(property) { var j, property; j = this; j.o = j.o.removeAttr($externalize(property, $String)); return j; }; JQuery.prototype.RemoveAttr = function(property) { return this.$val.RemoveAttr(property); }; JQuery.ptr.prototype.HasClass = function(class$1) { var class$1, j; j = this; return !!(j.o.hasClass($externalize(class$1, $String))); }; JQuery.prototype.HasClass = function(class$1) { return this.$val.HasClass(class$1); }; JQuery.ptr.prototype.AddClass = function(i) { var _ref, i, j; j = this; _ref = i; if ($assertType(_ref, funcType$2, true)[1] || $assertType(_ref, $String, true)[1]) { } else { $print("addClass Argument should be 'string' or 'func(int, string) string'"); } j.o = j.o.addClass($externalize(i, $emptyInterface)); return j; }; JQuery.prototype.AddClass = function(i) { return this.$val.AddClass(i); }; JQuery.ptr.prototype.RemoveClass = function(property) { var j, property; j = this; j.o = j.o.removeClass($externalize(property, $String)); return j; }; JQuery.prototype.RemoveClass = function(property) { return this.$val.RemoveClass(property); }; JQuery.ptr.prototype.ToggleClass = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.toggleClass.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.ToggleClass = function(i) { return this.$val.ToggleClass(i); }; JQuery.ptr.prototype.Focus = function() { var j; j = this; j.o = j.o.focus(); return j; }; JQuery.prototype.Focus = function() { return this.$val.Focus(); }; JQuery.ptr.prototype.Blur = function() { var j; j = this; j.o = j.o.blur(); return j; }; JQuery.prototype.Blur = function() { return this.$val.Blur(); }; JQuery.ptr.prototype.ReplaceAll = function(i) { var i, j; j = this; j.o = j.o.replaceAll($externalize(i, $emptyInterface)); return j; }; JQuery.prototype.ReplaceAll = function(i) { return this.$val.ReplaceAll(i); }; JQuery.ptr.prototype.ReplaceWith = function(i) { var i, j; j = this; j.o = j.o.replaceWith($externalize(i, $emptyInterface)); return j; }; JQuery.prototype.ReplaceWith = function(i) { return this.$val.ReplaceWith(i); }; JQuery.ptr.prototype.After = function(i) { var i, j; j = this; j.o = j.o.after($externalize(i, sliceType)); return j; }; JQuery.prototype.After = function(i) { return this.$val.After(i); }; JQuery.ptr.prototype.Before = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.before.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.Before = function(i) { return this.$val.Before(i); }; JQuery.ptr.prototype.Prepend = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.prepend.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.Prepend = function(i) { return this.$val.Prepend(i); }; JQuery.ptr.prototype.PrependTo = function(i) { var i, j; j = this; j.o = j.o.prependTo($externalize(i, $emptyInterface)); return j; }; JQuery.prototype.PrependTo = function(i) { return this.$val.PrependTo(i); }; JQuery.ptr.prototype.AppendTo = function(i) { var i, j; j = this; j.o = j.o.appendTo($externalize(i, $emptyInterface)); return j; }; JQuery.prototype.AppendTo = function(i) { return this.$val.AppendTo(i); }; JQuery.ptr.prototype.InsertAfter = function(i) { var i, j; j = this; j.o = j.o.insertAfter($externalize(i, $emptyInterface)); return j; }; JQuery.prototype.InsertAfter = function(i) { return this.$val.InsertAfter(i); }; JQuery.ptr.prototype.InsertBefore = function(i) { var i, j; j = this; j.o = j.o.insertBefore($externalize(i, $emptyInterface)); return j; }; JQuery.prototype.InsertBefore = function(i) { return this.$val.InsertBefore(i); }; JQuery.ptr.prototype.Show = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.show.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.Show = function(i) { return this.$val.Show(i); }; JQuery.ptr.prototype.Hide = function(i) { var i, j, obj; j = this; (obj = j.o, obj.hide.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.Hide = function(i) { return this.$val.Hide(i); }; JQuery.ptr.prototype.Toggle = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.toggle.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.Toggle = function(i) { return this.$val.Toggle(i); }; JQuery.ptr.prototype.Contents = function() { var j; j = this; j.o = j.o.contents(); return j; }; JQuery.prototype.Contents = function() { return this.$val.Contents(); }; JQuery.ptr.prototype.Html = function() { var j; j = this; return $internalize(j.o.html(), $String); }; JQuery.prototype.Html = function() { return this.$val.Html(); }; JQuery.ptr.prototype.SetHtml = function(i) { var _ref, i, j; j = this; _ref = i; if ($assertType(_ref, funcType$2, true)[1] || $assertType(_ref, $String, true)[1]) { } else { $print("SetHtml Argument should be 'string' or 'func(int, string) string'"); } j.o = j.o.html($externalize(i, $emptyInterface)); return j; }; JQuery.prototype.SetHtml = function(i) { return this.$val.SetHtml(i); }; JQuery.ptr.prototype.Closest = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.closest.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.Closest = function(i) { return this.$val.Closest(i); }; JQuery.ptr.prototype.End = function() { var j; j = this; j.o = j.o.end(); return j; }; JQuery.prototype.End = function() { return this.$val.End(); }; JQuery.ptr.prototype.Add = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.add.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.Add = function(i) { return this.$val.Add(i); }; JQuery.ptr.prototype.Clone = function(b) { var b, j, obj; j = this; j.o = (obj = j.o, obj.clone.apply(obj, $externalize(b, sliceType))); return j; }; JQuery.prototype.Clone = function(b) { return this.$val.Clone(b); }; JQuery.ptr.prototype.Height = function() { var j; j = this; return $parseInt(j.o.height()) >> 0; }; JQuery.prototype.Height = function() { return this.$val.Height(); }; JQuery.ptr.prototype.SetHeight = function(value) { var j, value; j = this; j.o = j.o.height($externalize(value, $String)); return j; }; JQuery.prototype.SetHeight = function(value) { return this.$val.SetHeight(value); }; JQuery.ptr.prototype.Width = function() { var j; j = this; return $parseInt(j.o.width()) >> 0; }; JQuery.prototype.Width = function() { return this.$val.Width(); }; JQuery.ptr.prototype.SetWidth = function(i) { var _ref, i, j; j = this; _ref = i; if ($assertType(_ref, funcType$2, true)[1] || $assertType(_ref, $String, true)[1]) { } else { $print("SetWidth Argument should be 'string' or 'func(int, string) string'"); } j.o = j.o.width($externalize(i, $emptyInterface)); return j; }; JQuery.prototype.SetWidth = function(i) { return this.$val.SetWidth(i); }; JQuery.ptr.prototype.Index = function(i) { var i, j; j = this; return $parseInt(j.o.index($externalize(i, $emptyInterface))) >> 0; }; JQuery.prototype.Index = function(i) { return this.$val.Index(i); }; JQuery.ptr.prototype.InnerHeight = function() { var j; j = this; return $parseInt(j.o.innerHeight()) >> 0; }; JQuery.prototype.InnerHeight = function() { return this.$val.InnerHeight(); }; JQuery.ptr.prototype.InnerWidth = function() { var j; j = this; return $parseInt(j.o.innerWidth()) >> 0; }; JQuery.prototype.InnerWidth = function() { return this.$val.InnerWidth(); }; JQuery.ptr.prototype.Offset = function() { var j, obj; j = this; obj = j.o.offset(); return new JQueryCoordinates.ptr($parseInt(obj.left) >> 0, $parseInt(obj.top) >> 0); }; JQuery.prototype.Offset = function() { return this.$val.Offset(); }; JQuery.ptr.prototype.SetOffset = function(jc) { var j, jc; j = this; j.o = j.o.offset($externalize(jc, JQueryCoordinates)); return j; }; JQuery.prototype.SetOffset = function(jc) { return this.$val.SetOffset(jc); }; JQuery.ptr.prototype.OuterHeight = function(includeMargin) { var includeMargin, j; j = this; if (includeMargin.$length === 0) { return $parseInt(j.o.outerHeight()) >> 0; } return $parseInt(j.o.outerHeight($externalize((0 >= includeMargin.$length ? ($throwRuntimeError("index out of range"), undefined) : includeMargin.$array[includeMargin.$offset + 0]), $Bool))) >> 0; }; JQuery.prototype.OuterHeight = function(includeMargin) { return this.$val.OuterHeight(includeMargin); }; JQuery.ptr.prototype.OuterWidth = function(includeMargin) { var includeMargin, j; j = this; if (includeMargin.$length === 0) { return $parseInt(j.o.outerWidth()) >> 0; } return $parseInt(j.o.outerWidth($externalize((0 >= includeMargin.$length ? ($throwRuntimeError("index out of range"), undefined) : includeMargin.$array[includeMargin.$offset + 0]), $Bool))) >> 0; }; JQuery.prototype.OuterWidth = function(includeMargin) { return this.$val.OuterWidth(includeMargin); }; JQuery.ptr.prototype.Position = function() { var j, obj; j = this; obj = j.o.position(); return new JQueryCoordinates.ptr($parseInt(obj.left) >> 0, $parseInt(obj.top) >> 0); }; JQuery.prototype.Position = function() { return this.$val.Position(); }; JQuery.ptr.prototype.ScrollLeft = function() { var j; j = this; return $parseInt(j.o.scrollLeft()) >> 0; }; JQuery.prototype.ScrollLeft = function() { return this.$val.ScrollLeft(); }; JQuery.ptr.prototype.SetScrollLeft = function(value) { var j, value; j = this; j.o = j.o.scrollLeft(value); return j; }; JQuery.prototype.SetScrollLeft = function(value) { return this.$val.SetScrollLeft(value); }; JQuery.ptr.prototype.ScrollTop = function() { var j; j = this; return $parseInt(j.o.scrollTop()) >> 0; }; JQuery.prototype.ScrollTop = function() { return this.$val.ScrollTop(); }; JQuery.ptr.prototype.SetScrollTop = function(value) { var j, value; j = this; j.o = j.o.scrollTop(value); return j; }; JQuery.prototype.SetScrollTop = function(value) { return this.$val.SetScrollTop(value); }; JQuery.ptr.prototype.ClearQueue = function(queueName) { var j, queueName; j = this; j.o = j.o.clearQueue($externalize(queueName, $String)); return j; }; JQuery.prototype.ClearQueue = function(queueName) { return this.$val.ClearQueue(queueName); }; JQuery.ptr.prototype.SetData = function(key, value) { var j, key, value; j = this; j.o = j.o.data($externalize(key, $String), $externalize(value, $emptyInterface)); return j; }; JQuery.prototype.SetData = function(key, value) { return this.$val.SetData(key, value); }; JQuery.ptr.prototype.Data = function(key) { var j, key, result; j = this; result = j.o.data($externalize(key, $String)); if (result === undefined) { return $ifaceNil; } return $internalize(result, $emptyInterface); }; JQuery.prototype.Data = function(key) { return this.$val.Data(key); }; JQuery.ptr.prototype.Dequeue = function(queueName) { var j, queueName; j = this; j.o = j.o.dequeue($externalize(queueName, $String)); return j; }; JQuery.prototype.Dequeue = function(queueName) { return this.$val.Dequeue(queueName); }; JQuery.ptr.prototype.RemoveData = function(name) { var j, name; j = this; j.o = j.o.removeData($externalize(name, $String)); return j; }; JQuery.prototype.RemoveData = function(name) { return this.$val.RemoveData(name); }; JQuery.ptr.prototype.OffsetParent = function() { var j; j = this; j.o = j.o.offsetParent(); return j; }; JQuery.prototype.OffsetParent = function() { return this.$val.OffsetParent(); }; JQuery.ptr.prototype.Parent = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.parent.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.Parent = function(i) { return this.$val.Parent(i); }; JQuery.ptr.prototype.Parents = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.parents.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.Parents = function(i) { return this.$val.Parents(i); }; JQuery.ptr.prototype.ParentsUntil = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.parentsUntil.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.ParentsUntil = function(i) { return this.$val.ParentsUntil(i); }; JQuery.ptr.prototype.Prev = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.prev.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.Prev = function(i) { return this.$val.Prev(i); }; JQuery.ptr.prototype.PrevAll = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.prevAll.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.PrevAll = function(i) { return this.$val.PrevAll(i); }; JQuery.ptr.prototype.PrevUntil = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.prevUntil.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.PrevUntil = function(i) { return this.$val.PrevUntil(i); }; JQuery.ptr.prototype.Siblings = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.siblings.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.Siblings = function(i) { return this.$val.Siblings(i); }; JQuery.ptr.prototype.Slice = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.slice.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.Slice = function(i) { return this.$val.Slice(i); }; JQuery.ptr.prototype.Children = function(selector) { var j, selector; j = this; j.o = j.o.children($externalize(selector, $emptyInterface)); return j; }; JQuery.prototype.Children = function(selector) { return this.$val.Children(selector); }; JQuery.ptr.prototype.Unwrap = function() { var j; j = this; j.o = j.o.unwrap(); return j; }; JQuery.prototype.Unwrap = function() { return this.$val.Unwrap(); }; JQuery.ptr.prototype.Wrap = function(obj) { var j, obj; j = this; j.o = j.o.wrap($externalize(obj, $emptyInterface)); return j; }; JQuery.prototype.Wrap = function(obj) { return this.$val.Wrap(obj); }; JQuery.ptr.prototype.WrapAll = function(i) { var i, j; j = this; j.o = j.o.wrapAll($externalize(i, $emptyInterface)); return j; }; JQuery.prototype.WrapAll = function(i) { return this.$val.WrapAll(i); }; JQuery.ptr.prototype.WrapInner = function(i) { var i, j; j = this; j.o = j.o.wrapInner($externalize(i, $emptyInterface)); return j; }; JQuery.prototype.WrapInner = function(i) { return this.$val.WrapInner(i); }; JQuery.ptr.prototype.Next = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.next.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.Next = function(i) { return this.$val.Next(i); }; JQuery.ptr.prototype.NextAll = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.nextAll.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.NextAll = function(i) { return this.$val.NextAll(i); }; JQuery.ptr.prototype.NextUntil = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.nextUntil.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.NextUntil = function(i) { return this.$val.NextUntil(i); }; JQuery.ptr.prototype.Not = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.not.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.Not = function(i) { return this.$val.Not(i); }; JQuery.ptr.prototype.Filter = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.filter.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.Filter = function(i) { return this.$val.Filter(i); }; JQuery.ptr.prototype.Find = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.find.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.Find = function(i) { return this.$val.Find(i); }; JQuery.ptr.prototype.First = function() { var j; j = this; j.o = j.o.first(); return j; }; JQuery.prototype.First = function() { return this.$val.First(); }; JQuery.ptr.prototype.Has = function(selector) { var j, selector; j = this; j.o = j.o.has($externalize(selector, $String)); return j; }; JQuery.prototype.Has = function(selector) { return this.$val.Has(selector); }; JQuery.ptr.prototype.Is = function(i) { var i, j, obj; j = this; return !!((obj = j.o, obj.is.apply(obj, $externalize(i, sliceType)))); }; JQuery.prototype.Is = function(i) { return this.$val.Is(i); }; JQuery.ptr.prototype.Last = function() { var j; j = this; j.o = j.o.last(); return j; }; JQuery.prototype.Last = function() { return this.$val.Last(); }; JQuery.ptr.prototype.Ready = function(handler) { var handler, j; j = this; j.o = j.o.ready($externalize(handler, funcType$3)); return j; }; JQuery.prototype.Ready = function(handler) { return this.$val.Ready(handler); }; JQuery.ptr.prototype.Resize = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.resize.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.Resize = function(i) { return this.$val.Resize(i); }; JQuery.ptr.prototype.Scroll = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.scroll.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.Scroll = function(i) { return this.$val.Scroll(i); }; JQuery.ptr.prototype.FadeOut = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.fadeOut.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.FadeOut = function(i) { return this.$val.FadeOut(i); }; JQuery.ptr.prototype.FadeToggle = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.fadeToggle.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.FadeToggle = function(i) { return this.$val.FadeToggle(i); }; JQuery.ptr.prototype.SlideDown = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.slideDown.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.SlideDown = function(i) { return this.$val.SlideDown(i); }; JQuery.ptr.prototype.SlideToggle = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.slideToggle.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.SlideToggle = function(i) { return this.$val.SlideToggle(i); }; JQuery.ptr.prototype.SlideUp = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.slideUp.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.SlideUp = function(i) { return this.$val.SlideUp(i); }; JQuery.ptr.prototype.Select = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.select.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.Select = function(i) { return this.$val.Select(i); }; JQuery.ptr.prototype.Submit = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.submit.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.Submit = function(i) { return this.$val.Submit(i); }; JQuery.ptr.prototype.Trigger = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.trigger.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.Trigger = function(i) { return this.$val.Trigger(i); }; JQuery.ptr.prototype.On = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.on.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.On = function(i) { return this.$val.On(i); }; JQuery.ptr.prototype.One = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.one.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.One = function(i) { return this.$val.One(i); }; JQuery.ptr.prototype.Off = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.off.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.Off = function(i) { return this.$val.Off(i); }; JQuery.ptr.prototype.Load = function(i) { var i, j, obj; j = this; j.o = (obj = j.o, obj.load.apply(obj, $externalize(i, sliceType))); return j; }; JQuery.prototype.Load = function(i) { return this.$val.Load(i); }; JQuery.ptr.prototype.Serialize = function() { var j; j = this; return $internalize(j.o.serialize(), $String); }; JQuery.prototype.Serialize = function() { return this.$val.Serialize(); }; JQuery.ptr.prototype.SerializeArray = function() { var j; j = this; return j.o.serializeArray(); }; JQuery.prototype.SerializeArray = function() { return this.$val.SerializeArray(); }; JQuery.methods = [{prop: "Each", name: "Each", pkg: "", typ: $funcType([funcType$1], [JQuery], false)}, {prop: "Call", name: "Call", pkg: "", typ: $funcType([$String, sliceType], [JQuery], true)}, {prop: "Underlying", name: "Underlying", pkg: "", typ: $funcType([], [ptrType], false)}, {prop: "Get", name: "Get", pkg: "", typ: $funcType([sliceType], [ptrType], true)}, {prop: "Append", name: "Append", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "Empty", name: "Empty", pkg: "", typ: $funcType([], [JQuery], false)}, {prop: "Detach", name: "Detach", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "Eq", name: "Eq", pkg: "", typ: $funcType([$Int], [JQuery], false)}, {prop: "FadeIn", name: "FadeIn", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "Delay", name: "Delay", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "ToArray", name: "ToArray", pkg: "", typ: $funcType([], [sliceType], false)}, {prop: "Remove", name: "Remove", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "Stop", name: "Stop", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "AddBack", name: "AddBack", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "Css", name: "Css", pkg: "", typ: $funcType([$String], [$String], false)}, {prop: "CssArray", name: "CssArray", pkg: "", typ: $funcType([sliceType$1], [mapType], true)}, {prop: "SetCss", name: "SetCss", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "Text", name: "Text", pkg: "", typ: $funcType([], [$String], false)}, {prop: "SetText", name: "SetText", pkg: "", typ: $funcType([$emptyInterface], [JQuery], false)}, {prop: "Val", name: "Val", pkg: "", typ: $funcType([], [$String], false)}, {prop: "SetVal", name: "SetVal", pkg: "", typ: $funcType([$emptyInterface], [JQuery], false)}, {prop: "Prop", name: "Prop", pkg: "", typ: $funcType([$String], [$emptyInterface], false)}, {prop: "SetProp", name: "SetProp", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "RemoveProp", name: "RemoveProp", pkg: "", typ: $funcType([$String], [JQuery], false)}, {prop: "Attr", name: "Attr", pkg: "", typ: $funcType([$String], [$String], false)}, {prop: "SetAttr", name: "SetAttr", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "RemoveAttr", name: "RemoveAttr", pkg: "", typ: $funcType([$String], [JQuery], false)}, {prop: "HasClass", name: "HasClass", pkg: "", typ: $funcType([$String], [$Bool], false)}, {prop: "AddClass", name: "AddClass", pkg: "", typ: $funcType([$emptyInterface], [JQuery], false)}, {prop: "RemoveClass", name: "RemoveClass", pkg: "", typ: $funcType([$String], [JQuery], false)}, {prop: "ToggleClass", name: "ToggleClass", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "Focus", name: "Focus", pkg: "", typ: $funcType([], [JQuery], false)}, {prop: "Blur", name: "Blur", pkg: "", typ: $funcType([], [JQuery], false)}, {prop: "ReplaceAll", name: "ReplaceAll", pkg: "", typ: $funcType([$emptyInterface], [JQuery], false)}, {prop: "ReplaceWith", name: "ReplaceWith", pkg: "", typ: $funcType([$emptyInterface], [JQuery], false)}, {prop: "After", name: "After", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "Before", name: "Before", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "Prepend", name: "Prepend", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "PrependTo", name: "PrependTo", pkg: "", typ: $funcType([$emptyInterface], [JQuery], false)}, {prop: "AppendTo", name: "AppendTo", pkg: "", typ: $funcType([$emptyInterface], [JQuery], false)}, {prop: "InsertAfter", name: "InsertAfter", pkg: "", typ: $funcType([$emptyInterface], [JQuery], false)}, {prop: "InsertBefore", name: "InsertBefore", pkg: "", typ: $funcType([$emptyInterface], [JQuery], false)}, {prop: "Show", name: "Show", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "Hide", name: "Hide", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "Toggle", name: "Toggle", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "Contents", name: "Contents", pkg: "", typ: $funcType([], [JQuery], false)}, {prop: "Html", name: "Html", pkg: "", typ: $funcType([], [$String], false)}, {prop: "SetHtml", name: "SetHtml", pkg: "", typ: $funcType([$emptyInterface], [JQuery], false)}, {prop: "Closest", name: "Closest", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "End", name: "End", pkg: "", typ: $funcType([], [JQuery], false)}, {prop: "Add", name: "Add", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "Clone", name: "Clone", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "Height", name: "Height", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "SetHeight", name: "SetHeight", pkg: "", typ: $funcType([$String], [JQuery], false)}, {prop: "Width", name: "Width", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "SetWidth", name: "SetWidth", pkg: "", typ: $funcType([$emptyInterface], [JQuery], false)}, {prop: "Index", name: "Index", pkg: "", typ: $funcType([$emptyInterface], [$Int], false)}, {prop: "InnerHeight", name: "InnerHeight", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "InnerWidth", name: "InnerWidth", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Offset", name: "Offset", pkg: "", typ: $funcType([], [JQueryCoordinates], false)}, {prop: "SetOffset", name: "SetOffset", pkg: "", typ: $funcType([JQueryCoordinates], [JQuery], false)}, {prop: "OuterHeight", name: "OuterHeight", pkg: "", typ: $funcType([sliceType$2], [$Int], true)}, {prop: "OuterWidth", name: "OuterWidth", pkg: "", typ: $funcType([sliceType$2], [$Int], true)}, {prop: "Position", name: "Position", pkg: "", typ: $funcType([], [JQueryCoordinates], false)}, {prop: "ScrollLeft", name: "ScrollLeft", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "SetScrollLeft", name: "SetScrollLeft", pkg: "", typ: $funcType([$Int], [JQuery], false)}, {prop: "ScrollTop", name: "ScrollTop", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "SetScrollTop", name: "SetScrollTop", pkg: "", typ: $funcType([$Int], [JQuery], false)}, {prop: "ClearQueue", name: "ClearQueue", pkg: "", typ: $funcType([$String], [JQuery], false)}, {prop: "SetData", name: "SetData", pkg: "", typ: $funcType([$String, $emptyInterface], [JQuery], false)}, {prop: "Data", name: "Data", pkg: "", typ: $funcType([$String], [$emptyInterface], false)}, {prop: "Dequeue", name: "Dequeue", pkg: "", typ: $funcType([$String], [JQuery], false)}, {prop: "RemoveData", name: "RemoveData", pkg: "", typ: $funcType([$String], [JQuery], false)}, {prop: "OffsetParent", name: "OffsetParent", pkg: "", typ: $funcType([], [JQuery], false)}, {prop: "Parent", name: "Parent", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "Parents", name: "Parents", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "ParentsUntil", name: "ParentsUntil", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "Prev", name: "Prev", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "PrevAll", name: "PrevAll", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "PrevUntil", name: "PrevUntil", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "Siblings", name: "Siblings", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "Slice", name: "Slice", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "Children", name: "Children", pkg: "", typ: $funcType([$emptyInterface], [JQuery], false)}, {prop: "Unwrap", name: "Unwrap", pkg: "", typ: $funcType([], [JQuery], false)}, {prop: "Wrap", name: "Wrap", pkg: "", typ: $funcType([$emptyInterface], [JQuery], false)}, {prop: "WrapAll", name: "WrapAll", pkg: "", typ: $funcType([$emptyInterface], [JQuery], false)}, {prop: "WrapInner", name: "WrapInner", pkg: "", typ: $funcType([$emptyInterface], [JQuery], false)}, {prop: "Next", name: "Next", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "NextAll", name: "NextAll", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "NextUntil", name: "NextUntil", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "Not", name: "Not", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "Filter", name: "Filter", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "Find", name: "Find", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "First", name: "First", pkg: "", typ: $funcType([], [JQuery], false)}, {prop: "Has", name: "Has", pkg: "", typ: $funcType([$String], [JQuery], false)}, {prop: "Is", name: "Is", pkg: "", typ: $funcType([sliceType], [$Bool], true)}, {prop: "Last", name: "Last", pkg: "", typ: $funcType([], [JQuery], false)}, {prop: "Ready", name: "Ready", pkg: "", typ: $funcType([funcType$3], [JQuery], false)}, {prop: "Resize", name: "Resize", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "Scroll", name: "Scroll", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "FadeOut", name: "FadeOut", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "FadeToggle", name: "FadeToggle", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "SlideDown", name: "SlideDown", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "SlideToggle", name: "SlideToggle", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "SlideUp", name: "SlideUp", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "Select", name: "Select", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "Submit", name: "Submit", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "Trigger", name: "Trigger", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "On", name: "On", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "One", name: "One", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "Off", name: "Off", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "Load", name: "Load", pkg: "", typ: $funcType([sliceType], [JQuery], true)}, {prop: "Serialize", name: "Serialize", pkg: "", typ: $funcType([], [$String], false)}, {prop: "SerializeArray", name: "SerializeArray", pkg: "", typ: $funcType([], [ptrType], false)}]; ptrType$1.methods = [{prop: "PreventDefault", name: "PreventDefault", pkg: "", typ: $funcType([], [], false)}, {prop: "IsDefaultPrevented", name: "IsDefaultPrevented", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "IsImmediatePropogationStopped", name: "IsImmediatePropogationStopped", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "IsPropagationStopped", name: "IsPropagationStopped", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "StopImmediatePropagation", name: "StopImmediatePropagation", pkg: "", typ: $funcType([], [], false)}, {prop: "StopPropagation", name: "StopPropagation", pkg: "", typ: $funcType([], [], false)}]; JQuery.init("github.com/gopherjs/jquery", [{prop: "o", name: "o", embedded: false, exported: false, typ: ptrType, tag: ""}, {prop: "Jquery", name: "Jquery", embedded: false, exported: true, typ: $String, tag: "js:\"jquery\""}, {prop: "Selector", name: "Selector", embedded: false, exported: true, typ: $String, tag: "js:\"selector\""}, {prop: "Length", name: "Length", embedded: false, exported: true, typ: $Int, tag: "js:\"length\""}, {prop: "Context", name: "Context", embedded: false, exported: true, typ: $String, tag: "js:\"context\""}]); Event.init("", [{prop: "Object", name: "Object", embedded: true, exported: true, typ: ptrType, tag: ""}, {prop: "KeyCode", name: "KeyCode", embedded: false, exported: true, typ: $Int, tag: "js:\"keyCode\""}, {prop: "Target", name: "Target", embedded: false, exported: true, typ: ptrType, tag: "js:\"target\""}, {prop: "CurrentTarget", name: "CurrentTarget", embedded: false, exported: true, typ: ptrType, tag: "js:\"currentTarget\""}, {prop: "DelegateTarget", name: "DelegateTarget", embedded: false, exported: true, typ: ptrType, tag: "js:\"delegateTarget\""}, {prop: "RelatedTarget", name: "RelatedTarget", embedded: false, exported: true, typ: ptrType, tag: "js:\"relatedTarget\""}, {prop: "Data", name: "Data", embedded: false, exported: true, typ: ptrType, tag: "js:\"data\""}, {prop: "Result", name: "Result", embedded: false, exported: true, typ: ptrType, tag: "js:\"result\""}, {prop: "Which", name: "Which", embedded: false, exported: true, typ: $Int, tag: "js:\"which\""}, {prop: "Namespace", name: "Namespace", embedded: false, exported: true, typ: $String, tag: "js:\"namespace\""}, {prop: "MetaKey", name: "MetaKey", embedded: false, exported: true, typ: $Bool, tag: "js:\"metaKey\""}, {prop: "ShiftKey", name: "ShiftKey", embedded: false, exported: true, typ: $Bool, tag: "js:\"shiftKey\""}, {prop: "CtrlKey", name: "CtrlKey", embedded: false, exported: true, typ: $Bool, tag: "js:\"ctrlKey\""}, {prop: "PageX", name: "PageX", embedded: false, exported: true, typ: $Int, tag: "js:\"pageX\""}, {prop: "PageY", name: "PageY", embedded: false, exported: true, typ: $Int, tag: "js:\"pageY\""}, {prop: "Type", name: "Type", embedded: false, exported: true, typ: $String, tag: "js:\"type\""}]); JQueryCoordinates.init("", [{prop: "Left", name: "Left", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Top", name: "Top", embedded: false, exported: true, 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 = 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["bufio"] = (function() { var $pkg = {}, $init, bytes, errors, io, strings, utf8, Scanner, SplitFunc, Reader, Writer, ReadWriter, sliceType, ptrType, sliceType$1, ptrType$1, ptrType$2, ptrType$3, errNegativeRead, errNegativeWrite, NewScanner, dropCR, ScanLines, NewReaderSize, NewReader, NewWriterSize, NewWriter, NewReadWriter; bytes = $packages["bytes"]; errors = $packages["errors"]; io = $packages["io"]; strings = $packages["strings"]; utf8 = $packages["unicode/utf8"]; Scanner = $pkg.Scanner = $newType(0, $kindStruct, "bufio.Scanner", true, "bufio", true, function(r_, split_, maxTokenSize_, token_, buf_, start_, end_, err_, empties_, scanCalled_, done_) { this.$val = this; if (arguments.length === 0) { this.r = $ifaceNil; this.split = $throwNilPointerError; this.maxTokenSize = 0; this.token = sliceType.nil; this.buf = sliceType.nil; this.start = 0; this.end = 0; this.err = $ifaceNil; this.empties = 0; this.scanCalled = false; this.done = false; return; } this.r = r_; this.split = split_; this.maxTokenSize = maxTokenSize_; this.token = token_; this.buf = buf_; this.start = start_; this.end = end_; this.err = err_; this.empties = empties_; this.scanCalled = scanCalled_; this.done = done_; }); SplitFunc = $pkg.SplitFunc = $newType(4, $kindFunc, "bufio.SplitFunc", true, "bufio", true, null); Reader = $pkg.Reader = $newType(0, $kindStruct, "bufio.Reader", true, "bufio", true, function(buf_, rd_, r_, w_, err_, lastByte_, lastRuneSize_) { this.$val = this; if (arguments.length === 0) { this.buf = sliceType.nil; this.rd = $ifaceNil; this.r = 0; this.w = 0; this.err = $ifaceNil; this.lastByte = 0; this.lastRuneSize = 0; return; } this.buf = buf_; this.rd = rd_; this.r = r_; this.w = w_; this.err = err_; this.lastByte = lastByte_; this.lastRuneSize = lastRuneSize_; }); Writer = $pkg.Writer = $newType(0, $kindStruct, "bufio.Writer", true, "bufio", true, function(err_, buf_, n_, wr_) { this.$val = this; if (arguments.length === 0) { this.err = $ifaceNil; this.buf = sliceType.nil; this.n = 0; this.wr = $ifaceNil; return; } this.err = err_; this.buf = buf_; this.n = n_; this.wr = wr_; }); ReadWriter = $pkg.ReadWriter = $newType(0, $kindStruct, "bufio.ReadWriter", true, "bufio", true, function(Reader_, Writer_) { this.$val = this; if (arguments.length === 0) { this.Reader = ptrType.nil; this.Writer = ptrType$2.nil; return; } this.Reader = Reader_; this.Writer = Writer_; }); sliceType = $sliceType($Uint8); ptrType = $ptrType(Reader); sliceType$1 = $sliceType(sliceType); ptrType$1 = $ptrType(strings.Builder); ptrType$2 = $ptrType(Writer); ptrType$3 = $ptrType(Scanner); NewScanner = function(r) { var r; return new Scanner.ptr(r, ScanLines, 65536, sliceType.nil, sliceType.nil, 0, 0, $ifaceNil, 0, false, false); }; $pkg.NewScanner = NewScanner; Scanner.ptr.prototype.Err = function() { var s; s = this; if ($interfaceIsEqual(s.err, io.EOF)) { return $ifaceNil; } return s.err; }; Scanner.prototype.Err = function() { return this.$val.Err(); }; Scanner.ptr.prototype.Bytes = function() { var s; s = this; return s.token; }; Scanner.prototype.Bytes = function() { return this.$val.Bytes(); }; Scanner.ptr.prototype.Text = function() { var s; s = this; return ($bytesToString(s.token)); }; Scanner.prototype.Text = function() { return this.$val.Text(); }; Scanner.ptr.prototype.Scan = function() { var _q, _r, _r$1, _tuple, _tuple$1, advance, err, err$1, loop, n, newBuf, newSize, s, token, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _q = $f._q; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; advance = $f.advance; err = $f.err; err$1 = $f.err$1; loop = $f.loop; n = $f.n; newBuf = $f.newBuf; newSize = $f.newSize; s = $f.s; token = $f.token; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; if (s.done) { $s = -1; return false; } s.scanCalled = true; /* while (true) { */ case 1: /* */ if (s.end > s.start || !($interfaceIsEqual(s.err, $ifaceNil))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (s.end > s.start || !($interfaceIsEqual(s.err, $ifaceNil))) { */ case 3: _r = s.split($subslice(s.buf, s.start, s.end), !($interfaceIsEqual(s.err, $ifaceNil))); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; advance = _tuple[0]; token = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { if ($interfaceIsEqual(err, $pkg.ErrFinalToken)) { s.token = token; s.done = true; $s = -1; return true; } s.setErr(err); $s = -1; return false; } if (!s.advance(advance)) { $s = -1; return false; } s.token = token; if (!(token === sliceType.nil)) { if ($interfaceIsEqual(s.err, $ifaceNil) || advance > 0) { s.empties = 0; } else { s.empties = s.empties + (1) >> 0; if (s.empties > 100) { $panic(new $String("bufio.Scan: too many empty tokens without progressing")); } } $s = -1; return true; } /* } */ case 4: if (!($interfaceIsEqual(s.err, $ifaceNil))) { s.start = 0; s.end = 0; $s = -1; return false; } if (s.start > 0 && ((s.end === s.buf.$length) || s.start > (_q = s.buf.$length / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")))) { $copySlice(s.buf, $subslice(s.buf, s.start, s.end)); s.end = s.end - (s.start) >> 0; s.start = 0; } if (s.end === s.buf.$length) { if (s.buf.$length >= s.maxTokenSize || s.buf.$length > 1073741823) { s.setErr($pkg.ErrTooLong); $s = -1; return false; } newSize = $imul(s.buf.$length, 2); if (newSize === 0) { newSize = 4096; } if (newSize > s.maxTokenSize) { newSize = s.maxTokenSize; } newBuf = $makeSlice(sliceType, newSize); $copySlice(newBuf, $subslice(s.buf, s.start, s.end)); s.buf = newBuf; s.end = s.end - (s.start) >> 0; s.start = 0; } loop = 0; /* while (true) { */ case 6: _r$1 = s.r.Read($subslice(s.buf, s.end, s.buf.$length)); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; n = _tuple$1[0]; err$1 = _tuple$1[1]; if (n < 0 || (s.buf.$length - s.end >> 0) < n) { s.setErr($pkg.ErrBadReadCount); /* break; */ $s = 7; continue; } s.end = s.end + (n) >> 0; if (!($interfaceIsEqual(err$1, $ifaceNil))) { s.setErr(err$1); /* break; */ $s = 7; continue; } if (n > 0) { s.empties = 0; /* break; */ $s = 7; continue; } loop = loop + (1) >> 0; if (loop > 100) { s.setErr(io.ErrNoProgress); /* break; */ $s = 7; continue; } $s = 6; continue; case 7: $s = 1; continue; case 2: $s = -1; return false; /* */ } return; } if ($f === undefined) { $f = { $blk: Scanner.ptr.prototype.Scan }; } $f._q = _q; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.advance = advance; $f.err = err; $f.err$1 = err$1; $f.loop = loop; $f.n = n; $f.newBuf = newBuf; $f.newSize = newSize; $f.s = s; $f.token = token; $f.$s = $s; $f.$r = $r; return $f; }; Scanner.prototype.Scan = function() { return this.$val.Scan(); }; Scanner.ptr.prototype.advance = function(n) { var n, s; s = this; if (n < 0) { s.setErr($pkg.ErrNegativeAdvance); return false; } if (n > (s.end - s.start >> 0)) { s.setErr($pkg.ErrAdvanceTooFar); return false; } s.start = s.start + (n) >> 0; return true; }; Scanner.prototype.advance = function(n) { return this.$val.advance(n); }; Scanner.ptr.prototype.setErr = function(err) { var err, s; s = this; if ($interfaceIsEqual(s.err, $ifaceNil) || $interfaceIsEqual(s.err, io.EOF)) { s.err = err; } }; Scanner.prototype.setErr = function(err) { return this.$val.setErr(err); }; Scanner.ptr.prototype.Buffer = function(buf, max) { var buf, max, s; s = this; if (s.scanCalled) { $panic(new $String("Buffer called after Scan")); } s.buf = $subslice(buf, 0, buf.$capacity); s.maxTokenSize = max; }; Scanner.prototype.Buffer = function(buf, max) { return this.$val.Buffer(buf, max); }; Scanner.ptr.prototype.Split = function(split) { var s, split; s = this; if (s.scanCalled) { $panic(new $String("Split called after Scan")); } s.split = split; }; Scanner.prototype.Split = function(split) { return this.$val.Split(split); }; dropCR = function(data) { var data, x; if (data.$length > 0 && ((x = data.$length - 1 >> 0, ((x < 0 || x >= data.$length) ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + x])) === 13)) { return $subslice(data, 0, (data.$length - 1 >> 0)); } return data; }; ScanLines = function(data, atEOF) { var _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, advance, atEOF, data, err, i, token; advance = 0; token = sliceType.nil; err = $ifaceNil; if (atEOF && (data.$length === 0)) { _tmp = 0; _tmp$1 = sliceType.nil; _tmp$2 = $ifaceNil; advance = _tmp; token = _tmp$1; err = _tmp$2; return [advance, token, err]; } i = bytes.IndexByte(data, 10); if (i >= 0) { _tmp$3 = i + 1 >> 0; _tmp$4 = dropCR($subslice(data, 0, i)); _tmp$5 = $ifaceNil; advance = _tmp$3; token = _tmp$4; err = _tmp$5; return [advance, token, err]; } if (atEOF) { _tmp$6 = data.$length; _tmp$7 = dropCR(data); _tmp$8 = $ifaceNil; advance = _tmp$6; token = _tmp$7; err = _tmp$8; return [advance, token, err]; } _tmp$9 = 0; _tmp$10 = sliceType.nil; _tmp$11 = $ifaceNil; advance = _tmp$9; token = _tmp$10; err = _tmp$11; return [advance, token, err]; }; $pkg.ScanLines = ScanLines; NewReaderSize = function(rd, size) { var _tuple, b, ok, r, rd, size; _tuple = $assertType(rd, ptrType, true); b = _tuple[0]; ok = _tuple[1]; if (ok && b.buf.$length >= size) { return b; } if (size < 16) { size = 16; } r = new Reader.ptr(sliceType.nil, $ifaceNil, 0, 0, $ifaceNil, 0, 0); r.reset($makeSlice(sliceType, size), rd); return r; }; $pkg.NewReaderSize = NewReaderSize; NewReader = function(rd) { var rd; return NewReaderSize(rd, 4096); }; $pkg.NewReader = NewReader; Reader.ptr.prototype.Size = function() { var b; b = this; return b.buf.$length; }; Reader.prototype.Size = function() { return this.$val.Size(); }; Reader.ptr.prototype.Reset = function(r) { var b, r; b = this; b.reset(b.buf, r); }; Reader.prototype.Reset = function(r) { return this.$val.Reset(r); }; Reader.ptr.prototype.reset = function(buf, r) { var b, buf, r; b = this; Reader.copy(b, new Reader.ptr(buf, r, 0, 0, $ifaceNil, -1, -1)); }; Reader.prototype.reset = function(buf, r) { return this.$val.reset(buf, r); }; Reader.ptr.prototype.fill = function() { var _r, _tuple, b, err, i, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; b = $f.b; err = $f.err; i = $f.i; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; if (b.r > 0) { $copySlice(b.buf, $subslice(b.buf, b.r, b.w)); b.w = b.w - (b.r) >> 0; b.r = 0; } if (b.w >= b.buf.$length) { $panic(new $String("bufio: tried to fill full buffer")); } i = 100; /* while (true) { */ case 1: /* if (!(i > 0)) { break; } */ if(!(i > 0)) { $s = 2; continue; } _r = b.rd.Read($subslice(b.buf, b.w)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; err = _tuple[1]; if (n < 0) { $panic(errNegativeRead); } b.w = b.w + (n) >> 0; if (!($interfaceIsEqual(err, $ifaceNil))) { b.err = err; $s = -1; return; } if (n > 0) { $s = -1; return; } i = i - (1) >> 0; $s = 1; continue; case 2: b.err = io.ErrNoProgress; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.fill }; } $f._r = _r; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.i = i; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.fill = function() { return this.$val.fill(); }; Reader.ptr.prototype.readErr = function() { var b, err; b = this; err = b.err; b.err = $ifaceNil; return err; }; Reader.prototype.readErr = function() { return this.$val.readErr(); }; Reader.ptr.prototype.Peek = function(n) { var avail, b, err, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; avail = $f.avail; b = $f.b; err = $f.err; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; if (n < 0) { $s = -1; return [sliceType.nil, $pkg.ErrNegativeCount]; } b.lastByte = -1; b.lastRuneSize = -1; /* while (true) { */ case 1: /* if (!((b.w - b.r >> 0) < n && (b.w - b.r >> 0) < b.buf.$length && $interfaceIsEqual(b.err, $ifaceNil))) { break; } */ if(!((b.w - b.r >> 0) < n && (b.w - b.r >> 0) < b.buf.$length && $interfaceIsEqual(b.err, $ifaceNil))) { $s = 2; continue; } $r = b.fill(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 1; continue; case 2: if (n > b.buf.$length) { $s = -1; return [$subslice(b.buf, b.r, b.w), $pkg.ErrBufferFull]; } err = $ifaceNil; avail = b.w - b.r >> 0; if (avail < n) { n = avail; err = b.readErr(); if ($interfaceIsEqual(err, $ifaceNil)) { err = $pkg.ErrBufferFull; } } $s = -1; return [$subslice(b.buf, b.r, (b.r + n >> 0)), err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.Peek }; } $f.avail = avail; $f.b = b; $f.err = err; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.Peek = function(n) { return this.$val.Peek(n); }; Reader.ptr.prototype.Discard = function(n) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, b, discarded, err, n, remain, skip, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; b = $f.b; discarded = $f.discarded; err = $f.err; n = $f.n; remain = $f.remain; skip = $f.skip; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: discarded = 0; err = $ifaceNil; b = this; if (n < 0) { _tmp = 0; _tmp$1 = $pkg.ErrNegativeCount; discarded = _tmp; err = _tmp$1; $s = -1; return [discarded, err]; } if (n === 0) { $s = -1; return [discarded, err]; } remain = n; /* while (true) { */ case 1: skip = b.Buffered(); /* */ if (skip === 0) { $s = 3; continue; } /* */ $s = 4; continue; /* if (skip === 0) { */ case 3: $r = b.fill(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } skip = b.Buffered(); /* } */ case 4: if (skip > remain) { skip = remain; } b.r = b.r + (skip) >> 0; remain = remain - (skip) >> 0; if (remain === 0) { _tmp$2 = n; _tmp$3 = $ifaceNil; discarded = _tmp$2; err = _tmp$3; $s = -1; return [discarded, err]; } if (!($interfaceIsEqual(b.err, $ifaceNil))) { _tmp$4 = n - remain >> 0; _tmp$5 = b.readErr(); discarded = _tmp$4; err = _tmp$5; $s = -1; return [discarded, err]; } $s = 1; continue; case 2: $s = -1; return [discarded, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.Discard }; } $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.b = b; $f.discarded = discarded; $f.err = err; $f.n = n; $f.remain = remain; $f.skip = skip; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.Discard = function(n) { return this.$val.Discard(n); }; Reader.ptr.prototype.Read = function(p) { var _r, _r$1, _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, b, err, n, p, x, x$1, x$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$10 = $f._tmp$10; _tmp$11 = $f._tmp$11; _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; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; b = $f.b; err = $f.err; n = $f.n; 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; b = this; n = p.$length; if (n === 0) { if (b.Buffered() > 0) { _tmp = 0; _tmp$1 = $ifaceNil; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } _tmp$2 = 0; _tmp$3 = b.readErr(); n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; } /* */ if (b.r === b.w) { $s = 1; continue; } /* */ $s = 2; continue; /* if (b.r === b.w) { */ case 1: if (!($interfaceIsEqual(b.err, $ifaceNil))) { _tmp$4 = 0; _tmp$5 = b.readErr(); n = _tmp$4; err = _tmp$5; $s = -1; return [n, err]; } /* */ if (p.$length >= b.buf.$length) { $s = 3; continue; } /* */ $s = 4; continue; /* if (p.$length >= b.buf.$length) { */ case 3: _r = b.rd.Read(p); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; b.err = _tuple[1]; if (n < 0) { $panic(errNegativeRead); } if (n > 0) { b.lastByte = (((x = n - 1 >> 0, ((x < 0 || x >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + x])) >> 0)); b.lastRuneSize = -1; } _tmp$6 = n; _tmp$7 = b.readErr(); n = _tmp$6; err = _tmp$7; $s = -1; return [n, err]; /* } */ case 4: b.r = 0; b.w = 0; _r$1 = b.rd.Read(b.buf); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; n = _tuple$1[0]; b.err = _tuple$1[1]; if (n < 0) { $panic(errNegativeRead); } if (n === 0) { _tmp$8 = 0; _tmp$9 = b.readErr(); n = _tmp$8; err = _tmp$9; $s = -1; return [n, err]; } b.w = b.w + (n) >> 0; /* } */ case 2: n = $copySlice(p, $subslice(b.buf, b.r, b.w)); b.r = b.r + (n) >> 0; b.lastByte = (((x$1 = b.buf, x$2 = b.r - 1 >> 0, ((x$2 < 0 || x$2 >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + x$2])) >> 0)); b.lastRuneSize = -1; _tmp$10 = n; _tmp$11 = $ifaceNil; n = _tmp$10; err = _tmp$11; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.Read }; } $f._r = _r; $f._r$1 = _r$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$10 = _tmp$10; $f._tmp$11 = _tmp$11; $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._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.b = b; $f.err = err; $f.n = n; $f.p = p; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.Read = function(p) { return this.$val.Read(p); }; Reader.ptr.prototype.ReadByte = function() { var b, c, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; c = $f.c; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; b.lastRuneSize = -1; /* while (true) { */ case 1: /* if (!(b.r === b.w)) { break; } */ if(!(b.r === b.w)) { $s = 2; continue; } if (!($interfaceIsEqual(b.err, $ifaceNil))) { $s = -1; return [0, b.readErr()]; } $r = b.fill(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 1; continue; case 2: c = (x = b.buf, x$1 = b.r, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])); b.r = b.r + (1) >> 0; b.lastByte = ((c >> 0)); $s = -1; return [c, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.ReadByte }; } $f.b = b; $f.c = c; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.ReadByte = function() { return this.$val.ReadByte(); }; Reader.ptr.prototype.UnreadByte = function() { var b, x, x$1; b = this; if (b.lastByte < 0 || (b.r === 0) && b.w > 0) { return $pkg.ErrInvalidUnreadByte; } if (b.r > 0) { b.r = b.r - (1) >> 0; } else { b.w = 1; } (x = b.buf, x$1 = b.r, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1] = ((b.lastByte << 24 >>> 24)))); b.lastByte = -1; b.lastRuneSize = -1; return $ifaceNil; }; Reader.prototype.UnreadByte = function() { return this.$val.UnreadByte(); }; Reader.ptr.prototype.ReadRune = function() { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, b, err, r, size, 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; _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; b = $f.b; err = $f.err; r = $f.r; size = $f.size; 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: r = 0; size = 0; err = $ifaceNil; b = this; /* while (true) { */ case 1: /* if (!((b.r + 4 >> 0) > b.w && !utf8.FullRune($subslice(b.buf, b.r, b.w)) && $interfaceIsEqual(b.err, $ifaceNil) && (b.w - b.r >> 0) < b.buf.$length)) { break; } */ if(!((b.r + 4 >> 0) > b.w && !utf8.FullRune($subslice(b.buf, b.r, b.w)) && $interfaceIsEqual(b.err, $ifaceNil) && (b.w - b.r >> 0) < b.buf.$length)) { $s = 2; continue; } $r = b.fill(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 1; continue; case 2: b.lastRuneSize = -1; if (b.r === b.w) { _tmp = 0; _tmp$1 = 0; _tmp$2 = b.readErr(); r = _tmp; size = _tmp$1; err = _tmp$2; $s = -1; return [r, size, err]; } _tmp$3 = (((x = b.buf, x$1 = b.r, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])) >> 0)); _tmp$4 = 1; r = _tmp$3; size = _tmp$4; if (r >= 128) { _tuple = utf8.DecodeRune($subslice(b.buf, b.r, b.w)); r = _tuple[0]; size = _tuple[1]; } b.r = b.r + (size) >> 0; b.lastByte = (((x$2 = b.buf, x$3 = b.r - 1 >> 0, ((x$3 < 0 || x$3 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + x$3])) >> 0)); b.lastRuneSize = size; _tmp$5 = r; _tmp$6 = size; _tmp$7 = $ifaceNil; r = _tmp$5; size = _tmp$6; err = _tmp$7; $s = -1; return [r, size, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.ReadRune }; } $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.b = b; $f.err = err; $f.r = r; $f.size = size; $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.ReadRune = function() { return this.$val.ReadRune(); }; Reader.ptr.prototype.UnreadRune = function() { var b; b = this; if (b.lastRuneSize < 0 || b.r < b.lastRuneSize) { return $pkg.ErrInvalidUnreadRune; } b.r = b.r - (b.lastRuneSize) >> 0; b.lastByte = -1; b.lastRuneSize = -1; return $ifaceNil; }; Reader.prototype.UnreadRune = function() { return this.$val.UnreadRune(); }; Reader.ptr.prototype.Buffered = function() { var b; b = this; return b.w - b.r >> 0; }; Reader.prototype.Buffered = function() { return this.$val.Buffered(); }; Reader.ptr.prototype.ReadSlice = function(delim) { var b, delim, err, i, i$1, line, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; delim = $f.delim; err = $f.err; i = $f.i; i$1 = $f.i$1; line = $f.line; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: line = sliceType.nil; err = $ifaceNil; b = this; s = 0; /* while (true) { */ case 1: i = bytes.IndexByte($subslice(b.buf, (b.r + s >> 0), b.w), delim); if (i >= 0) { i = i + (s) >> 0; line = $subslice(b.buf, b.r, ((b.r + i >> 0) + 1 >> 0)); b.r = b.r + ((i + 1 >> 0)) >> 0; /* break; */ $s = 2; continue; } if (!($interfaceIsEqual(b.err, $ifaceNil))) { line = $subslice(b.buf, b.r, b.w); b.r = b.w; err = b.readErr(); /* break; */ $s = 2; continue; } if (b.Buffered() >= b.buf.$length) { b.r = b.w; line = b.buf; err = $pkg.ErrBufferFull; /* break; */ $s = 2; continue; } s = b.w - b.r >> 0; $r = b.fill(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 1; continue; case 2: i$1 = line.$length - 1 >> 0; if (i$1 >= 0) { b.lastByte = ((((i$1 < 0 || i$1 >= line.$length) ? ($throwRuntimeError("index out of range"), undefined) : line.$array[line.$offset + i$1]) >> 0)); b.lastRuneSize = -1; } $s = -1; return [line, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.ReadSlice }; } $f.b = b; $f.delim = delim; $f.err = err; $f.i = i; $f.i$1 = i$1; $f.line = line; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.ReadSlice = function(delim) { return this.$val.ReadSlice(delim); }; Reader.ptr.prototype.ReadLine = function() { var _r, _tmp, _tmp$1, _tmp$2, _tuple, b, drop, err, isPrefix, line, x, x$1, x$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tuple = $f._tuple; b = $f.b; drop = $f.drop; err = $f.err; isPrefix = $f.isPrefix; line = $f.line; 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: line = sliceType.nil; isPrefix = false; err = $ifaceNil; b = this; _r = b.ReadSlice(10); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; line = _tuple[0]; err = _tuple[1]; if ($interfaceIsEqual(err, $pkg.ErrBufferFull)) { if (line.$length > 0 && ((x = line.$length - 1 >> 0, ((x < 0 || x >= line.$length) ? ($throwRuntimeError("index out of range"), undefined) : line.$array[line.$offset + x])) === 13)) { if (b.r === 0) { $panic(new $String("bufio: tried to rewind past start of buffer")); } b.r = b.r - (1) >> 0; line = $subslice(line, 0, (line.$length - 1 >> 0)); } _tmp = line; _tmp$1 = true; _tmp$2 = $ifaceNil; line = _tmp; isPrefix = _tmp$1; err = _tmp$2; $s = -1; return [line, isPrefix, err]; } if (line.$length === 0) { if (!($interfaceIsEqual(err, $ifaceNil))) { line = sliceType.nil; } $s = -1; return [line, isPrefix, err]; } err = $ifaceNil; if ((x$1 = line.$length - 1 >> 0, ((x$1 < 0 || x$1 >= line.$length) ? ($throwRuntimeError("index out of range"), undefined) : line.$array[line.$offset + x$1])) === 10) { drop = 1; if (line.$length > 1 && ((x$2 = line.$length - 2 >> 0, ((x$2 < 0 || x$2 >= line.$length) ? ($throwRuntimeError("index out of range"), undefined) : line.$array[line.$offset + x$2])) === 13)) { drop = 2; } line = $subslice(line, 0, (line.$length - drop >> 0)); } $s = -1; return [line, isPrefix, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.ReadLine }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tuple = _tuple; $f.b = b; $f.drop = drop; $f.err = err; $f.isPrefix = isPrefix; $f.line = line; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.ReadLine = function() { return this.$val.ReadLine(); }; Reader.ptr.prototype.collectFragments = function(delim) { var _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, buf, delim, e, err, finalFragment, frag, fullBuffers, totalLen, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; buf = $f.buf; delim = $f.delim; e = $f.e; err = $f.err; finalFragment = $f.finalFragment; frag = $f.frag; fullBuffers = $f.fullBuffers; totalLen = $f.totalLen; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fullBuffers = sliceType$1.nil; finalFragment = sliceType.nil; totalLen = 0; err = $ifaceNil; b = this; frag = sliceType.nil; /* while (true) { */ case 1: e = $ifaceNil; _r = b.ReadSlice(delim); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; frag = _tuple[0]; e = _tuple[1]; if ($interfaceIsEqual(e, $ifaceNil)) { /* break; */ $s = 2; continue; } if (!($interfaceIsEqual(e, $pkg.ErrBufferFull))) { err = e; /* break; */ $s = 2; continue; } buf = $makeSlice(sliceType, frag.$length); $copySlice(buf, frag); fullBuffers = $append(fullBuffers, buf); totalLen = totalLen + (buf.$length) >> 0; $s = 1; continue; case 2: totalLen = totalLen + (frag.$length) >> 0; _tmp = fullBuffers; _tmp$1 = frag; _tmp$2 = totalLen; _tmp$3 = err; fullBuffers = _tmp; finalFragment = _tmp$1; totalLen = _tmp$2; err = _tmp$3; $s = -1; return [fullBuffers, finalFragment, totalLen, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.collectFragments }; } $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.buf = buf; $f.delim = delim; $f.e = e; $f.err = err; $f.finalFragment = finalFragment; $f.frag = frag; $f.fullBuffers = fullBuffers; $f.totalLen = totalLen; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.collectFragments = function(delim) { return this.$val.collectFragments(delim); }; Reader.ptr.prototype.ReadBytes = function(delim) { var _i, _r, _ref, _tuple, b, buf, delim, err, frag, full, i, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _ref = $f._ref; _tuple = $f._tuple; b = $f.b; buf = $f.buf; delim = $f.delim; err = $f.err; frag = $f.frag; full = $f.full; i = $f.i; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; _r = b.collectFragments(delim); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; full = _tuple[0]; frag = _tuple[1]; n = _tuple[2]; err = _tuple[3]; buf = $makeSlice(sliceType, n); n = 0; _ref = full; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; n = n + ($copySlice($subslice(buf, n), ((i < 0 || i >= full.$length) ? ($throwRuntimeError("index out of range"), undefined) : full.$array[full.$offset + i]))) >> 0; _i++; } $copySlice($subslice(buf, n), frag); $s = -1; return [buf, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.ReadBytes }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f._tuple = _tuple; $f.b = b; $f.buf = buf; $f.delim = delim; $f.err = err; $f.frag = frag; $f.full = full; $f.i = i; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.ReadBytes = function(delim) { return this.$val.ReadBytes(delim); }; Reader.ptr.prototype.ReadString = function(delim) { var _i, _r, _ref, _tuple, b, buf, delim, err, fb, frag, full, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _ref = $f._ref; _tuple = $f._tuple; b = $f.b; buf = $f.buf; delim = $f.delim; err = $f.err; fb = $f.fb; frag = $f.frag; full = $f.full; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; _r = b.collectFragments(delim); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; full = _tuple[0]; frag = _tuple[1]; n = _tuple[2]; err = _tuple[3]; buf = new strings.Builder.ptr(ptrType$1.nil, sliceType.nil); buf.Grow(n); _ref = full; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } fb = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); buf.Write(fb); _i++; } buf.Write(frag); $s = -1; return [buf.String(), err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.ReadString }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f._tuple = _tuple; $f.b = b; $f.buf = buf; $f.delim = delim; $f.err = err; $f.fb = fb; $f.frag = frag; $f.full = full; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.ReadString = function(delim) { return this.$val.ReadString(delim); }; Reader.ptr.prototype.WriteTo = function(w) { var _r, _r$1, _r$2, _r$3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, b, err, err$1, err$2, err$3, m, m$1, m$2, n, ok, ok$1, r, w, w$1, x, x$1, x$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _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; _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; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; m = $f.m; m$1 = $f.m$1; m$2 = $f.m$2; n = $f.n; ok = $f.ok; ok$1 = $f.ok$1; r = $f.r; w = $f.w; w$1 = $f.w$1; 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 = new $Int64(0, 0); err = $ifaceNil; b = this; _r = b.writeBuf(w); /* */ $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]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [n, err]; } _tuple$1 = $assertType(b.rd, io.WriterTo, true); r = _tuple$1[0]; ok = _tuple$1[1]; /* */ if (ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (ok) { */ case 2: _r$1 = r.WriteTo(w); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$2 = _r$1; m = _tuple$2[0]; err$1 = _tuple$2[1]; n = (x = m, new $Int64(n.$high + x.$high, n.$low + x.$low)); _tmp = n; _tmp$1 = err$1; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; /* } */ case 3: _tuple$3 = $assertType(w, io.ReaderFrom, true); w$1 = _tuple$3[0]; ok$1 = _tuple$3[1]; /* */ if (ok$1) { $s = 5; continue; } /* */ $s = 6; continue; /* if (ok$1) { */ case 5: _r$2 = w$1.ReadFrom(b.rd); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$4 = _r$2; m$1 = _tuple$4[0]; err$2 = _tuple$4[1]; n = (x$1 = m$1, new $Int64(n.$high + x$1.$high, n.$low + x$1.$low)); _tmp$2 = n; _tmp$3 = err$2; n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; /* } */ case 6: /* */ if ((b.w - b.r >> 0) < b.buf.$length) { $s = 8; continue; } /* */ $s = 9; continue; /* if ((b.w - b.r >> 0) < b.buf.$length) { */ case 8: $r = b.fill(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 9: /* while (true) { */ case 11: /* if (!(b.r < b.w)) { break; } */ if(!(b.r < b.w)) { $s = 12; continue; } _r$3 = b.writeBuf(w); /* */ $s = 13; case 13: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$5 = _r$3; m$2 = _tuple$5[0]; err$3 = _tuple$5[1]; n = (x$2 = m$2, new $Int64(n.$high + x$2.$high, n.$low + x$2.$low)); if (!($interfaceIsEqual(err$3, $ifaceNil))) { _tmp$4 = n; _tmp$5 = err$3; n = _tmp$4; err = _tmp$5; $s = -1; return [n, err]; } $r = b.fill(); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 11; continue; case 12: if ($interfaceIsEqual(b.err, io.EOF)) { b.err = $ifaceNil; } _tmp$6 = n; _tmp$7 = b.readErr(); n = _tmp$6; err = _tmp$7; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.WriteTo }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $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._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.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.m = m; $f.m$1 = m$1; $f.m$2 = m$2; $f.n = n; $f.ok = ok; $f.ok$1 = ok$1; $f.r = r; $f.w = w; $f.w$1 = w$1; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.WriteTo = function(w) { return this.$val.WriteTo(w); }; Reader.ptr.prototype.writeBuf = function(w) { var _r, _tuple, b, err, n, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; b = $f.b; err = $f.err; n = $f.n; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; _r = w.Write($subslice(b.buf, b.r, b.w)); /* */ $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]; if (n < 0) { $panic(errNegativeWrite); } b.r = b.r + (n) >> 0; $s = -1; return [(new $Int64(0, n)), err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.writeBuf }; } $f._r = _r; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.n = n; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.writeBuf = function(w) { return this.$val.writeBuf(w); }; NewWriterSize = function(w, size) { var _tuple, b, ok, size, w; _tuple = $assertType(w, ptrType$2, true); b = _tuple[0]; ok = _tuple[1]; if (ok && b.buf.$length >= size) { return b; } if (size <= 0) { size = 4096; } return new Writer.ptr($ifaceNil, $makeSlice(sliceType, size), 0, w); }; $pkg.NewWriterSize = NewWriterSize; NewWriter = function(w) { var w; return NewWriterSize(w, 4096); }; $pkg.NewWriter = NewWriter; Writer.ptr.prototype.Size = function() { var b; b = this; return b.buf.$length; }; Writer.prototype.Size = function() { return this.$val.Size(); }; Writer.ptr.prototype.Reset = function(w) { var b, w; b = this; b.err = $ifaceNil; b.n = 0; b.wr = w; }; Writer.prototype.Reset = function(w) { return this.$val.Reset(w); }; Writer.ptr.prototype.Flush = function() { var _r, _tuple, b, err, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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: b = this; if (!($interfaceIsEqual(b.err, $ifaceNil))) { $s = -1; return b.err; } if (b.n === 0) { $s = -1; return $ifaceNil; } _r = b.wr.Write($subslice(b.buf, 0, b.n)); /* */ $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]; if (n < b.n && $interfaceIsEqual(err, $ifaceNil)) { err = io.ErrShortWrite; } if (!($interfaceIsEqual(err, $ifaceNil))) { if (n > 0 && n < b.n) { $copySlice($subslice(b.buf, 0, (b.n - n >> 0)), $subslice(b.buf, n, b.n)); } b.n = b.n - (n) >> 0; b.err = err; $s = -1; return err; } b.n = 0; $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Writer.ptr.prototype.Flush }; } $f._r = _r; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; Writer.prototype.Flush = function() { return this.$val.Flush(); }; Writer.ptr.prototype.Available = function() { var b; b = this; return b.buf.$length - b.n >> 0; }; Writer.prototype.Available = function() { return this.$val.Available(); }; Writer.ptr.prototype.Buffered = function() { var b; b = this; return b.n; }; Writer.prototype.Buffered = function() { return this.$val.Buffered(); }; Writer.ptr.prototype.Write = function(p) { var _r, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, err, n, n$1, nn, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; b = $f.b; err = $f.err; n = $f.n; n$1 = $f.n$1; nn = $f.nn; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: nn = 0; err = $ifaceNil; b = this; /* while (true) { */ case 1: /* if (!(p.$length > b.Available() && $interfaceIsEqual(b.err, $ifaceNil))) { break; } */ if(!(p.$length > b.Available() && $interfaceIsEqual(b.err, $ifaceNil))) { $s = 2; continue; } n = 0; /* */ if (b.Buffered() === 0) { $s = 3; continue; } /* */ $s = 4; continue; /* if (b.Buffered() === 0) { */ case 3: _r = b.wr.Write(p); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; b.err = _tuple[1]; $s = 5; continue; /* } else { */ case 4: n = $copySlice($subslice(b.buf, b.n), p); b.n = b.n + (n) >> 0; _r$1 = b.Flush(); /* */ $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 5: nn = nn + (n) >> 0; p = $subslice(p, n); $s = 1; continue; case 2: if (!($interfaceIsEqual(b.err, $ifaceNil))) { _tmp = nn; _tmp$1 = b.err; nn = _tmp; err = _tmp$1; $s = -1; return [nn, err]; } n$1 = $copySlice($subslice(b.buf, b.n), p); b.n = b.n + (n$1) >> 0; nn = nn + (n$1) >> 0; _tmp$2 = nn; _tmp$3 = $ifaceNil; nn = _tmp$2; err = _tmp$3; $s = -1; return [nn, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Writer.ptr.prototype.Write }; } $f._r = _r; $f._r$1 = _r$1; $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.err = err; $f.n = n; $f.n$1 = n$1; $f.nn = nn; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; Writer.prototype.Write = function(p) { return this.$val.Write(p); }; Writer.ptr.prototype.WriteByte = function(c) { var _r, _v, b, c, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _v = $f._v; b = $f.b; c = $f.c; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; if (!($interfaceIsEqual(b.err, $ifaceNil))) { $s = -1; return b.err; } if (!(b.Available() <= 0)) { _v = false; $s = 3; continue s; } _r = b.Flush(); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _v = !($interfaceIsEqual(_r, $ifaceNil)); case 3: /* */ if (_v) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v) { */ case 1: $s = -1; return b.err; /* } */ case 2: (x = b.buf, x$1 = b.n, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1] = c)); b.n = b.n + (1) >> 0; $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Writer.ptr.prototype.WriteByte }; } $f._r = _r; $f._v = _v; $f.b = b; $f.c = c; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; Writer.prototype.WriteByte = function(c) { return this.$val.WriteByte(c); }; Writer.ptr.prototype.WriteRune = function(r) { var $24r, _r, _r$1, _r$2, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, b, err, n, r, size, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; b = $f.b; err = $f.err; n = $f.n; r = $f.r; size = $f.size; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: size = 0; err = $ifaceNil; b = this; /* */ if (((r >>> 0)) < 128) { $s = 1; continue; } /* */ $s = 2; continue; /* if (((r >>> 0)) < 128) { */ case 1: _r = b.WriteByte(((r << 24 >>> 24))); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp = 0; _tmp$1 = err; size = _tmp; err = _tmp$1; $s = -1; return [size, err]; } _tmp$2 = 1; _tmp$3 = $ifaceNil; size = _tmp$2; err = _tmp$3; $s = -1; return [size, err]; /* } */ case 2: if (!($interfaceIsEqual(b.err, $ifaceNil))) { _tmp$4 = 0; _tmp$5 = b.err; size = _tmp$4; err = _tmp$5; $s = -1; return [size, err]; } n = b.Available(); /* */ if (n < 4) { $s = 4; continue; } /* */ $s = 5; continue; /* if (n < 4) { */ case 4: _r$1 = b.Flush(); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; if (!($interfaceIsEqual(b.err, $ifaceNil))) { _tmp$6 = 0; _tmp$7 = b.err; size = _tmp$6; err = _tmp$7; $s = -1; return [size, err]; } n = b.Available(); /* */ if (n < 4) { $s = 7; continue; } /* */ $s = 8; continue; /* if (n < 4) { */ case 7: _r$2 = b.WriteString(($encodeRune(r))); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; size = _tuple[0]; err = _tuple[1]; $24r = [size, err]; $s = 10; case 10: return $24r; /* } */ case 8: /* } */ case 5: size = utf8.EncodeRune($subslice(b.buf, b.n), r); b.n = b.n + (size) >> 0; _tmp$8 = size; _tmp$9 = $ifaceNil; size = _tmp$8; err = _tmp$9; $s = -1; return [size, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Writer.ptr.prototype.WriteRune }; } $f.$24r = $24r; $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._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.n = n; $f.r = r; $f.size = size; $f.$s = $s; $f.$r = $r; return $f; }; Writer.prototype.WriteRune = function(r) { return this.$val.WriteRune(r); }; Writer.ptr.prototype.WriteString = function(s) { var _r, b, n, n$1, nn, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; b = $f.b; n = $f.n; n$1 = $f.n$1; nn = $f.nn; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; nn = 0; /* while (true) { */ case 1: /* if (!(s.length > b.Available() && $interfaceIsEqual(b.err, $ifaceNil))) { break; } */ if(!(s.length > b.Available() && $interfaceIsEqual(b.err, $ifaceNil))) { $s = 2; continue; } n = $copyString($subslice(b.buf, b.n), s); b.n = b.n + (n) >> 0; nn = nn + (n) >> 0; s = $substring(s, n); _r = b.Flush(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; $s = 1; continue; case 2: if (!($interfaceIsEqual(b.err, $ifaceNil))) { $s = -1; return [nn, b.err]; } n$1 = $copyString($subslice(b.buf, b.n), s); b.n = b.n + (n$1) >> 0; nn = nn + (n$1) >> 0; $s = -1; return [nn, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Writer.ptr.prototype.WriteString }; } $f._r = _r; $f.b = b; $f.n = n; $f.n$1 = n$1; $f.nn = nn; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; Writer.prototype.WriteString = function(s) { return this.$val.WriteString(s); }; Writer.ptr.prototype.ReadFrom = function(r) { var _r, _r$1, _r$2, _r$3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, b, err, err1, m, n, nr, ok, r, w, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _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; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; b = $f.b; err = $f.err; err1 = $f.err1; m = $f.m; n = $f.n; nr = $f.nr; ok = $f.ok; r = $f.r; w = $f.w; 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; if (!($interfaceIsEqual(b.err, $ifaceNil))) { _tmp = new $Int64(0, 0); _tmp$1 = b.err; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } /* */ if (b.Buffered() === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (b.Buffered() === 0) { */ case 1: _tuple = $assertType(b.wr, io.ReaderFrom, true); w = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 3; continue; } /* */ $s = 4; continue; /* if (ok) { */ case 3: _r = w.ReadFrom(r); /* */ $s = 5; case 5: 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]; b.err = err; _tmp$2 = n; _tmp$3 = err; n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; /* } */ case 4: /* } */ case 2: m = 0; /* while (true) { */ case 6: /* */ if (b.Available() === 0) { $s = 8; continue; } /* */ $s = 9; continue; /* if (b.Available() === 0) { */ case 8: _r$1 = b.Flush(); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err1 = _r$1; if (!($interfaceIsEqual(err1, $ifaceNil))) { _tmp$4 = n; _tmp$5 = err1; n = _tmp$4; err = _tmp$5; $s = -1; return [n, err]; } /* } */ case 9: nr = 0; /* while (true) { */ case 11: /* if (!(nr < 100)) { break; } */ if(!(nr < 100)) { $s = 12; continue; } _r$2 = r.Read($subslice(b.buf, b.n)); /* */ $s = 13; case 13: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$2 = _r$2; m = _tuple$2[0]; err = _tuple$2[1]; if (!((m === 0)) || !($interfaceIsEqual(err, $ifaceNil))) { /* break; */ $s = 12; continue; } nr = nr + (1) >> 0; $s = 11; continue; case 12: if (nr === 100) { _tmp$6 = n; _tmp$7 = io.ErrNoProgress; n = _tmp$6; err = _tmp$7; $s = -1; return [n, err]; } b.n = b.n + (m) >> 0; n = (x = (new $Int64(0, m)), new $Int64(n.$high + x.$high, n.$low + x.$low)); if (!($interfaceIsEqual(err, $ifaceNil))) { /* break; */ $s = 7; continue; } $s = 6; continue; case 7: /* */ if ($interfaceIsEqual(err, io.EOF)) { $s = 14; continue; } /* */ $s = 15; continue; /* if ($interfaceIsEqual(err, io.EOF)) { */ case 14: /* */ if (b.Available() === 0) { $s = 16; continue; } /* */ $s = 17; continue; /* if (b.Available() === 0) { */ case 16: _r$3 = b.Flush(); /* */ $s = 19; case 19: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } err = _r$3; $s = 18; continue; /* } else { */ case 17: err = $ifaceNil; /* } */ case 18: /* } */ case 15: _tmp$8 = n; _tmp$9 = err; n = _tmp$8; err = _tmp$9; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Writer.ptr.prototype.ReadFrom }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $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._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.b = b; $f.err = err; $f.err1 = err1; $f.m = m; $f.n = n; $f.nr = nr; $f.ok = ok; $f.r = r; $f.w = w; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Writer.prototype.ReadFrom = function(r) { return this.$val.ReadFrom(r); }; NewReadWriter = function(r, w) { var r, w; return new ReadWriter.ptr(r, w); }; $pkg.NewReadWriter = NewReadWriter; ptrType$3.methods = [{prop: "Err", name: "Err", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Bytes", name: "Bytes", pkg: "", typ: $funcType([], [sliceType], false)}, {prop: "Text", name: "Text", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Scan", name: "Scan", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "advance", name: "advance", pkg: "bufio", typ: $funcType([$Int], [$Bool], false)}, {prop: "setErr", name: "setErr", pkg: "bufio", typ: $funcType([$error], [], false)}, {prop: "Buffer", name: "Buffer", pkg: "", typ: $funcType([sliceType, $Int], [], false)}, {prop: "Split", name: "Split", pkg: "", typ: $funcType([SplitFunc], [], false)}]; ptrType.methods = [{prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Reset", name: "Reset", pkg: "", typ: $funcType([io.Reader], [], false)}, {prop: "reset", name: "reset", pkg: "bufio", typ: $funcType([sliceType, io.Reader], [], false)}, {prop: "fill", name: "fill", pkg: "bufio", typ: $funcType([], [], false)}, {prop: "readErr", name: "readErr", pkg: "bufio", typ: $funcType([], [$error], false)}, {prop: "Peek", name: "Peek", pkg: "", typ: $funcType([$Int], [sliceType, $error], false)}, {prop: "Discard", name: "Discard", pkg: "", typ: $funcType([$Int], [$Int, $error], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType], [$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: "Buffered", name: "Buffered", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "ReadSlice", name: "ReadSlice", pkg: "", typ: $funcType([$Uint8], [sliceType, $error], false)}, {prop: "ReadLine", name: "ReadLine", pkg: "", typ: $funcType([], [sliceType, $Bool, $error], false)}, {prop: "collectFragments", name: "collectFragments", pkg: "bufio", typ: $funcType([$Uint8], [sliceType$1, sliceType, $Int, $error], false)}, {prop: "ReadBytes", name: "ReadBytes", pkg: "", typ: $funcType([$Uint8], [sliceType, $error], false)}, {prop: "ReadString", name: "ReadString", pkg: "", typ: $funcType([$Uint8], [$String, $error], false)}, {prop: "WriteTo", name: "WriteTo", pkg: "", typ: $funcType([io.Writer], [$Int64, $error], false)}, {prop: "writeBuf", name: "writeBuf", pkg: "bufio", typ: $funcType([io.Writer], [$Int64, $error], false)}]; ptrType$2.methods = [{prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Reset", name: "Reset", pkg: "", typ: $funcType([io.Writer], [], false)}, {prop: "Flush", name: "Flush", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Available", name: "Available", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Buffered", name: "Buffered", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}, {prop: "WriteByte", name: "WriteByte", pkg: "", typ: $funcType([$Uint8], [$error], false)}, {prop: "WriteRune", name: "WriteRune", pkg: "", typ: $funcType([$Int32], [$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)}]; Scanner.init("bufio", [{prop: "r", name: "r", embedded: false, exported: false, typ: io.Reader, tag: ""}, {prop: "split", name: "split", embedded: false, exported: false, typ: SplitFunc, tag: ""}, {prop: "maxTokenSize", name: "maxTokenSize", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "token", name: "token", embedded: false, exported: false, typ: sliceType, tag: ""}, {prop: "buf", name: "buf", embedded: false, exported: false, typ: sliceType, tag: ""}, {prop: "start", name: "start", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "end", name: "end", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "empties", name: "empties", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "scanCalled", name: "scanCalled", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "done", name: "done", embedded: false, exported: false, typ: $Bool, tag: ""}]); SplitFunc.init([sliceType, $Bool], [$Int, sliceType, $error], false); Reader.init("bufio", [{prop: "buf", name: "buf", embedded: false, exported: false, typ: sliceType, tag: ""}, {prop: "rd", name: "rd", embedded: false, exported: false, typ: io.Reader, tag: ""}, {prop: "r", name: "r", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "w", name: "w", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "lastByte", name: "lastByte", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "lastRuneSize", name: "lastRuneSize", embedded: false, exported: false, typ: $Int, tag: ""}]); Writer.init("bufio", [{prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "buf", name: "buf", embedded: false, exported: false, typ: sliceType, tag: ""}, {prop: "n", name: "n", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "wr", name: "wr", embedded: false, exported: false, typ: io.Writer, tag: ""}]); ReadWriter.init("", [{prop: "Reader", name: "Reader", embedded: true, exported: true, typ: ptrType, tag: ""}, {prop: "Writer", name: "Writer", embedded: true, exported: true, typ: ptrType$2, 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 = errors.$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 = strings.$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; } $pkg.ErrTooLong = errors.New("bufio.Scanner: token too long"); $pkg.ErrNegativeAdvance = errors.New("bufio.Scanner: SplitFunc returns negative advance count"); $pkg.ErrAdvanceTooFar = errors.New("bufio.Scanner: SplitFunc returns advance count beyond input"); $pkg.ErrBadReadCount = errors.New("bufio.Scanner: Read returned impossible count"); $pkg.ErrFinalToken = errors.New("final token"); $pkg.ErrInvalidUnreadByte = errors.New("bufio: invalid use of UnreadByte"); $pkg.ErrInvalidUnreadRune = errors.New("bufio: invalid use of UnreadRune"); $pkg.ErrBufferFull = errors.New("bufio: buffer full"); $pkg.ErrNegativeCount = errors.New("bufio: negative count"); errNegativeRead = errors.New("bufio: reader returned negative count from Read"); errNegativeWrite = errors.New("bufio: writer returned negative count from Write"); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["compress/flate"] = (function() { var $pkg = {}, $init, bufio, fmt, io, math, bits, sort, strconv, sync, CorruptInputError, InternalError, Resetter, huffmanDecoder, Reader, decompressor, hcode, huffmanEncoder, literalNode, levelInfo, byLiteral, byFreq, dictDecoder, arrayType, sliceType, sliceType$1, ptrType, arrayType$1, ptrType$1, sliceType$4, ptrType$2, sliceType$5, arrayType$2, arrayType$3, ptrType$3, arrayType$4, ptrType$4, arrayType$5, sliceType$6, sliceType$7, arrayType$6, arrayType$7, arrayType$8, arrayType$9, sliceType$8, ptrType$5, ptrType$6, funcType, ptrType$15, ptrType$16, fixedOnce, fixedHuffmanDecoder, fixedHuffmanDecoder$24ptr, codeOrder, fixedLiteralEncoding, fixedOffsetEncoding, huffOffset, noEOF, makeReader, fixedHuffmanDecoderInit, NewReader, maxNode, newHuffmanEncoder, generateFixedLiteralEncoding, generateFixedOffsetEncoding, reverseBits, init; bufio = $packages["bufio"]; fmt = $packages["fmt"]; io = $packages["io"]; math = $packages["math"]; bits = $packages["math/bits"]; sort = $packages["sort"]; strconv = $packages["strconv"]; sync = $packages["sync"]; CorruptInputError = $pkg.CorruptInputError = $newType(8, $kindInt64, "flate.CorruptInputError", true, "compress/flate", true, null); InternalError = $pkg.InternalError = $newType(8, $kindString, "flate.InternalError", true, "compress/flate", true, null); Resetter = $pkg.Resetter = $newType(8, $kindInterface, "flate.Resetter", true, "compress/flate", true, null); huffmanDecoder = $pkg.huffmanDecoder = $newType(0, $kindStruct, "flate.huffmanDecoder", true, "compress/flate", false, function(min_, chunks_, links_, linkMask_) { this.$val = this; if (arguments.length === 0) { this.min = 0; this.chunks = arrayType.zero(); this.links = sliceType$1.nil; this.linkMask = 0; return; } this.min = min_; this.chunks = chunks_; this.links = links_; this.linkMask = linkMask_; }); Reader = $pkg.Reader = $newType(8, $kindInterface, "flate.Reader", true, "compress/flate", true, null); decompressor = $pkg.decompressor = $newType(0, $kindStruct, "flate.decompressor", true, "compress/flate", false, function(r_, roffset_, b_, nb_, h1_, h2_, bits_, codebits_, dict_, buf_, step_, stepState_, final$12_, err_, toRead_, hl_, hd_, copyLen_, copyDist_) { this.$val = this; if (arguments.length === 0) { this.r = $ifaceNil; this.roffset = new $Int64(0, 0); this.b = 0; this.nb = 0; this.h1 = new huffmanDecoder.ptr(0, arrayType.zero(), sliceType$1.nil, 0); this.h2 = new huffmanDecoder.ptr(0, arrayType.zero(), sliceType$1.nil, 0); this.bits = ptrType$3.nil; this.codebits = ptrType$4.nil; this.dict = new dictDecoder.ptr(sliceType$5.nil, 0, 0, false); this.buf = arrayType$5.zero(); this.step = $throwNilPointerError; this.stepState = 0; this.final$12 = false; this.err = $ifaceNil; this.toRead = sliceType$5.nil; this.hl = ptrType$1.nil; this.hd = ptrType$1.nil; this.copyLen = 0; this.copyDist = 0; return; } this.r = r_; this.roffset = roffset_; this.b = b_; this.nb = nb_; this.h1 = h1_; this.h2 = h2_; this.bits = bits_; this.codebits = codebits_; this.dict = dict_; this.buf = buf_; this.step = step_; this.stepState = stepState_; this.final$12 = final$12_; this.err = err_; this.toRead = toRead_; this.hl = hl_; this.hd = hd_; this.copyLen = copyLen_; this.copyDist = copyDist_; }); hcode = $pkg.hcode = $newType(0, $kindStruct, "flate.hcode", true, "compress/flate", false, function(code_, len_) { this.$val = this; if (arguments.length === 0) { this.code = 0; this.len = 0; return; } this.code = code_; this.len = len_; }); huffmanEncoder = $pkg.huffmanEncoder = $newType(0, $kindStruct, "flate.huffmanEncoder", true, "compress/flate", false, function(codes_, freqcache_, bitCount_, lns_, lfs_) { this.$val = this; if (arguments.length === 0) { this.codes = sliceType$6.nil; this.freqcache = sliceType$7.nil; this.bitCount = arrayType$6.zero(); this.lns = byLiteral.nil; this.lfs = byFreq.nil; return; } this.codes = codes_; this.freqcache = freqcache_; this.bitCount = bitCount_; this.lns = lns_; this.lfs = lfs_; }); literalNode = $pkg.literalNode = $newType(0, $kindStruct, "flate.literalNode", true, "compress/flate", false, function(literal_, freq_) { this.$val = this; if (arguments.length === 0) { this.literal = 0; this.freq = 0; return; } this.literal = literal_; this.freq = freq_; }); levelInfo = $pkg.levelInfo = $newType(0, $kindStruct, "flate.levelInfo", true, "compress/flate", false, function(level_, lastFreq_, nextCharFreq_, nextPairFreq_, needed_) { this.$val = this; if (arguments.length === 0) { this.level = 0; this.lastFreq = 0; this.nextCharFreq = 0; this.nextPairFreq = 0; this.needed = 0; return; } this.level = level_; this.lastFreq = lastFreq_; this.nextCharFreq = nextCharFreq_; this.nextPairFreq = nextPairFreq_; this.needed = needed_; }); byLiteral = $pkg.byLiteral = $newType(12, $kindSlice, "flate.byLiteral", true, "compress/flate", false, null); byFreq = $pkg.byFreq = $newType(12, $kindSlice, "flate.byFreq", true, "compress/flate", false, null); dictDecoder = $pkg.dictDecoder = $newType(0, $kindStruct, "flate.dictDecoder", true, "compress/flate", false, function(hist_, wrPos_, rdPos_, full_) { this.$val = this; if (arguments.length === 0) { this.hist = sliceType$5.nil; this.wrPos = 0; this.rdPos = 0; this.full = false; return; } this.hist = hist_; this.wrPos = wrPos_; this.rdPos = rdPos_; this.full = full_; }); arrayType = $arrayType($Uint32, 512); sliceType = $sliceType($Uint32); sliceType$1 = $sliceType(sliceType); ptrType = $ptrType(huffmanEncoder); arrayType$1 = $arrayType($Int, 16); ptrType$1 = $ptrType(huffmanDecoder); sliceType$4 = $sliceType($Int); ptrType$2 = $ptrType(decompressor); sliceType$5 = $sliceType($Uint8); arrayType$2 = $arrayType($Int, 288); arrayType$3 = $arrayType($Int, 316); ptrType$3 = $ptrType(arrayType$3); arrayType$4 = $arrayType($Int, 19); ptrType$4 = $ptrType(arrayType$4); arrayType$5 = $arrayType($Uint8, 4); sliceType$6 = $sliceType(hcode); sliceType$7 = $sliceType(literalNode); arrayType$6 = $arrayType($Int32, 17); arrayType$7 = $arrayType(levelInfo, 16); arrayType$8 = $arrayType($Int32, 16); arrayType$9 = $arrayType(arrayType$8, 16); sliceType$8 = $sliceType($Int32); ptrType$5 = $ptrType(byLiteral); ptrType$6 = $ptrType(byFreq); funcType = $funcType([ptrType$2], [], false); ptrType$15 = $ptrType(hcode); ptrType$16 = $ptrType(dictDecoder); CorruptInputError.prototype.Error = function() { var e; e = this; return "flate: corrupt input before offset " + strconv.FormatInt((new $Int64(e.$high, e.$low)), 10); }; $ptrType(CorruptInputError).prototype.Error = function() { return this.$get().Error(); }; InternalError.prototype.Error = function() { var e; e = this.$val; return "flate: internal error: " + (e); }; $ptrType(InternalError).prototype.Error = function() { return new InternalError(this.$get()).Error(); }; huffmanDecoder.ptr.prototype.init = function(lengths) { var _i, _i$1, _i$2, _i$3, _i$4, _r, _ref, _ref$1, _ref$2, _ref$3, _ref$4, _tmp, _tmp$1, chunk, chunk$1, chunk$2, code, code$1, count, h, i, i$1, i$2, j, j$1, lengths, link, linktab, linktab$1, max, min, n, n$1, nextcode, numLinks, off, off$1, off$2, reverse, reverse$1, value, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, y, y$1, y$2, y$3, y$4; h = this; if (!((h.min === 0))) { huffmanDecoder.copy(h, new huffmanDecoder.ptr(0, arrayType.zero(), sliceType$1.nil, 0)); } count = arrayType$1.zero(); _tmp = 0; _tmp$1 = 0; min = _tmp; max = _tmp$1; _ref = lengths; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } n = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (n === 0) { _i++; continue; } if ((min === 0) || n < min) { min = n; } if (n > max) { max = n; } ((n < 0 || n >= count.length) ? ($throwRuntimeError("index out of range"), undefined) : count[n] = (((n < 0 || n >= count.length) ? ($throwRuntimeError("index out of range"), undefined) : count[n]) + (1) >> 0)); _i++; } if (max === 0) { return true; } code = 0; nextcode = arrayType$1.zero(); i = min; while (true) { if (!(i <= max)) { break; } code = (y = (1), y < 32 ? (code << y) : 0) >> 0; ((i < 0 || i >= nextcode.length) ? ($throwRuntimeError("index out of range"), undefined) : nextcode[i] = code); code = code + (((i < 0 || i >= count.length) ? ($throwRuntimeError("index out of range"), undefined) : count[i])) >> 0; i = i + (1) >> 0; } if (!((code === ((y$1 = ((max >>> 0)), y$1 < 32 ? (1 << y$1) : 0) >> 0))) && !((code === 1) && (max === 1))) { return false; } h.min = min; if (max > 9) { numLinks = (y$2 = ((((max >>> 0)) - 9 >>> 0)), y$2 < 32 ? (1 << y$2) : 0) >> 0; h.linkMask = (((numLinks - 1 >> 0) >>> 0)); link = nextcode[10] >> 1 >> 0; h.links = $makeSlice(sliceType$1, (512 - link >> 0)); j = ((link >>> 0)); while (true) { if (!(j < 512)) { break; } reverse = ((bits.Reverse16(((j << 16 >>> 16))) >> 0)); reverse = (reverse >> $min((7), 31)) >> 0; off = j - ((link >>> 0)) >>> 0; if (false && !(((x = h.chunks, ((reverse < 0 || reverse >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[reverse])) === 0))) { $panic(new $String("impossible: overwriting existing chunk")); } (x$1 = h.chunks, ((reverse < 0 || reverse >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[reverse] = (((((off << 4 >>> 0) | 10) >>> 0) >>> 0)))); (x$2 = h.links, ((off < 0 || off >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + off] = $makeSlice(sliceType, numLinks))); j = j + (1) >>> 0; } } _ref$1 = lengths; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } i$1 = _i$1; n$1 = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); if (n$1 === 0) { _i$1++; continue; } code$1 = ((n$1 < 0 || n$1 >= nextcode.length) ? ($throwRuntimeError("index out of range"), undefined) : nextcode[n$1]); ((n$1 < 0 || n$1 >= nextcode.length) ? ($throwRuntimeError("index out of range"), undefined) : nextcode[n$1] = (((n$1 < 0 || n$1 >= nextcode.length) ? ($throwRuntimeError("index out of range"), undefined) : nextcode[n$1]) + (1) >> 0)); chunk = ((((i$1 << 4 >> 0) | n$1) >>> 0)); reverse$1 = ((bits.Reverse16(((code$1 << 16 >>> 16))) >> 0)); reverse$1 = (reverse$1 >> $min(((((16 - n$1 >> 0) >>> 0))), 31)) >> 0; if (n$1 <= 9) { off$1 = reverse$1; while (true) { if (!(off$1 < 512)) { break; } if (false && !(((x$3 = h.chunks, ((off$1 < 0 || off$1 >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[off$1])) === 0))) { $panic(new $String("impossible: overwriting existing chunk")); } (x$4 = h.chunks, ((off$1 < 0 || off$1 >= x$4.length) ? ($throwRuntimeError("index out of range"), undefined) : x$4[off$1] = chunk)); off$1 = off$1 + (((y$3 = ((n$1 >>> 0)), y$3 < 32 ? (1 << y$3) : 0) >> 0)) >> 0; } } else { j$1 = reverse$1 & 511; if (false && !(((((x$5 = h.chunks, ((j$1 < 0 || j$1 >= x$5.length) ? ($throwRuntimeError("index out of range"), undefined) : x$5[j$1])) & 15) >>> 0) === 10))) { $panic(new $String("impossible: not an indirect chunk")); } value = (x$6 = h.chunks, ((j$1 < 0 || j$1 >= x$6.length) ? ($throwRuntimeError("index out of range"), undefined) : x$6[j$1])) >>> 4 >>> 0; linktab = (x$7 = h.links, ((value < 0 || value >= x$7.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$7.$array[x$7.$offset + value])); reverse$1 = (reverse$1 >> $min((9), 31)) >> 0; off$2 = reverse$1; while (true) { if (!(off$2 < linktab.$length)) { break; } if (false && !((((off$2 < 0 || off$2 >= linktab.$length) ? ($throwRuntimeError("index out of range"), undefined) : linktab.$array[linktab.$offset + off$2]) === 0))) { $panic(new $String("impossible: overwriting existing chunk")); } ((off$2 < 0 || off$2 >= linktab.$length) ? ($throwRuntimeError("index out of range"), undefined) : linktab.$array[linktab.$offset + off$2] = chunk); off$2 = off$2 + (((y$4 = (((n$1 - 9 >> 0) >>> 0)), y$4 < 32 ? (1 << y$4) : 0) >> 0)) >> 0; } } _i$1++; } if (false) { _ref$2 = h.chunks; _i$2 = 0; while (true) { if (!(_i$2 < 512)) { break; } i$2 = _i$2; chunk$1 = ((_i$2 < 0 || _i$2 >= _ref$2.length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$2[_i$2]); if (chunk$1 === 0) { if ((code === 1) && ((_r = i$2 % 2, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) === 1)) { _i$2++; continue; } $panic(new $String("impossible: missing chunk")); } _i$2++; } _ref$3 = h.links; _i$3 = 0; while (true) { if (!(_i$3 < _ref$3.$length)) { break; } linktab$1 = ((_i$3 < 0 || _i$3 >= _ref$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$3.$array[_ref$3.$offset + _i$3]); _ref$4 = linktab$1; _i$4 = 0; while (true) { if (!(_i$4 < _ref$4.$length)) { break; } chunk$2 = ((_i$4 < 0 || _i$4 >= _ref$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$4.$array[_ref$4.$offset + _i$4]); if (chunk$2 === 0) { $panic(new $String("impossible: missing chunk")); } _i$4++; } _i$3++; } } return true; }; huffmanDecoder.prototype.init = function(lengths) { return this.$val.init(lengths); }; decompressor.ptr.prototype.nextBlock = function() { var _1, _r, _r$1, f, typ, x, y, y$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; f = $f.f; typ = $f.typ; x = $f.x; y = $f.y; y$1 = $f.y$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; /* while (true) { */ case 1: /* if (!(f.nb < 3)) { break; } */ if(!(f.nb < 3)) { $s = 2; continue; } _r = f.moreBits(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } f.err = _r; if (!($interfaceIsEqual(f.err, $ifaceNil))) { $s = -1; return; } $s = 1; continue; case 2: f.final$12 = ((f.b & 1) >>> 0) === 1; f.b = (y = (1), y < 32 ? (f.b >>> y) : 0) >>> 0; typ = (f.b & 3) >>> 0; f.b = (y$1 = (2), y$1 < 32 ? (f.b >>> y$1) : 0) >>> 0; f.nb = f.nb - (3) >>> 0; _1 = typ; /* */ if (_1 === (0)) { $s = 5; continue; } /* */ if (_1 === (1)) { $s = 6; continue; } /* */ if (_1 === (2)) { $s = 7; continue; } /* */ $s = 8; continue; /* if (_1 === (0)) { */ case 5: $r = f.dataBlock(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 9; continue; /* } else if (_1 === (1)) { */ case 6: f.hl = fixedHuffmanDecoder; f.hd = ptrType$1.nil; $r = f.huffmanBlock(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 9; continue; /* } else if (_1 === (2)) { */ case 7: _r$1 = f.readHuffman(); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } f.err = _r$1; if (!($interfaceIsEqual(f.err, $ifaceNil))) { /* break; */ $s = 4; continue; } f.hl = f.h1; f.hd = f.h2; $r = f.huffmanBlock(); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 9; continue; /* } else { */ case 8: f.err = ((x = f.roffset, new CorruptInputError(x.$high, x.$low))); /* } */ case 9: case 4: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: decompressor.ptr.prototype.nextBlock }; } $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f.f = f; $f.typ = typ; $f.x = x; $f.y = y; $f.y$1 = y$1; $f.$s = $s; $f.$r = $r; return $f; }; decompressor.prototype.nextBlock = function() { return this.$val.nextBlock(); }; decompressor.ptr.prototype.Read = function(b) { var b, f, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; f = $f.f; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; /* while (true) { */ case 1: if (f.toRead.$length > 0) { n = $copySlice(b, f.toRead); f.toRead = $subslice(f.toRead, n); if (f.toRead.$length === 0) { $s = -1; return [n, f.err]; } $s = -1; return [n, $ifaceNil]; } if (!($interfaceIsEqual(f.err, $ifaceNil))) { $s = -1; return [0, f.err]; } $r = f.step(f); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (!($interfaceIsEqual(f.err, $ifaceNil)) && (f.toRead.$length === 0)) { f.toRead = f.dict.readFlush(); } $s = 1; continue; case 2: $s = -1; return [0, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: decompressor.ptr.prototype.Read }; } $f.b = b; $f.f = f; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; decompressor.prototype.Read = function(b) { return this.$val.Read(b); }; decompressor.ptr.prototype.Close = function() { var f; f = this; if ($interfaceIsEqual(f.err, io.EOF)) { return $ifaceNil; } return f.err; }; decompressor.prototype.Close = function() { return this.$val.Close(); }; decompressor.ptr.prototype.readHuffman = function() { var _1, _r, _r$1, _r$2, _r$3, _tmp, _tmp$1, _tuple, b, err, err$1, err$2, err$3, f, i, i$1, i$2, j, n, nb, nclen, ndist, nlit, rep, 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, y, y$1, y$2, y$3, y$4, y$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; b = $f.b; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; f = $f.f; i = $f.i; i$1 = $f.i$1; i$2 = $f.i$2; j = $f.j; n = $f.n; nb = $f.nb; nclen = $f.nclen; ndist = $f.ndist; nlit = $f.nlit; rep = $f.rep; 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; y = $f.y; y$1 = $f.y$1; y$2 = $f.y$2; y$3 = $f.y$3; y$4 = $f.y$4; y$5 = $f.y$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; /* while (true) { */ case 1: /* if (!(f.nb < 14)) { break; } */ if(!(f.nb < 14)) { $s = 2; continue; } _r = f.moreBits(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $s = 1; continue; case 2: nlit = ((((f.b & 31) >>> 0) >> 0)) + 257 >> 0; if (nlit > 286) { $s = -1; return ((x = f.roffset, new CorruptInputError(x.$high, x.$low))); } f.b = (y = (5), y < 32 ? (f.b >>> y) : 0) >>> 0; ndist = ((((f.b & 31) >>> 0) >> 0)) + 1 >> 0; if (ndist > 30) { $s = -1; return ((x$1 = f.roffset, new CorruptInputError(x$1.$high, x$1.$low))); } f.b = (y$1 = (5), y$1 < 32 ? (f.b >>> y$1) : 0) >>> 0; nclen = ((((f.b & 15) >>> 0) >> 0)) + 4 >> 0; f.b = (y$2 = (4), y$2 < 32 ? (f.b >>> y$2) : 0) >>> 0; f.nb = f.nb - (14) >>> 0; i = 0; /* while (true) { */ case 4: /* if (!(i < nclen)) { break; } */ if(!(i < nclen)) { $s = 5; continue; } /* while (true) { */ case 6: /* if (!(f.nb < 3)) { break; } */ if(!(f.nb < 3)) { $s = 7; continue; } _r$1 = f.moreBits(); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err$1 = _r$1; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } $s = 6; continue; case 7: (x$2 = f.codebits, x$3 = ((i < 0 || i >= codeOrder.length) ? ($throwRuntimeError("index out of range"), undefined) : codeOrder[i]), x$2.nilCheck, ((x$3 < 0 || x$3 >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[x$3] = ((((f.b & 7) >>> 0) >> 0)))); f.b = (y$3 = (3), y$3 < 32 ? (f.b >>> y$3) : 0) >>> 0; f.nb = f.nb - (3) >>> 0; i = i + (1) >> 0; $s = 4; continue; case 5: i$1 = nclen; while (true) { if (!(i$1 < 19)) { break; } (x$4 = f.codebits, x$5 = ((i$1 < 0 || i$1 >= codeOrder.length) ? ($throwRuntimeError("index out of range"), undefined) : codeOrder[i$1]), x$4.nilCheck, ((x$5 < 0 || x$5 >= x$4.length) ? ($throwRuntimeError("index out of range"), undefined) : x$4[x$5] = 0)); i$1 = i$1 + (1) >> 0; } if (!f.h1.init($subslice(new sliceType$4(f.codebits), 0))) { $s = -1; return ((x$6 = f.roffset, new CorruptInputError(x$6.$high, x$6.$low))); } _tmp = 0; _tmp$1 = nlit + ndist >> 0; i$2 = _tmp; n = _tmp$1; /* while (true) { */ case 9: /* if (!(i$2 < n)) { break; } */ if(!(i$2 < n)) { $s = 10; continue; } _r$2 = f.huffSym(f.h1); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; x$7 = _tuple[0]; err$2 = _tuple[1]; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return err$2; } if (x$7 < 16) { (x$8 = f.bits, x$8.nilCheck, ((i$2 < 0 || i$2 >= x$8.length) ? ($throwRuntimeError("index out of range"), undefined) : x$8[i$2] = x$7)); i$2 = i$2 + (1) >> 0; /* continue; */ $s = 9; continue; } rep = 0; nb = 0; b = 0; _1 = x$7; if (_1 === (16)) { rep = 3; nb = 2; if (i$2 === 0) { $s = -1; return ((x$9 = f.roffset, new CorruptInputError(x$9.$high, x$9.$low))); } b = (x$10 = f.bits, x$11 = i$2 - 1 >> 0, ((x$11 < 0 || x$11 >= x$10.length) ? ($throwRuntimeError("index out of range"), undefined) : x$10[x$11])); } else if (_1 === (17)) { rep = 3; nb = 3; b = 0; } else if (_1 === (18)) { rep = 11; nb = 7; b = 0; } else { $s = -1; return new InternalError("unexpected length code"); } /* while (true) { */ case 12: /* if (!(f.nb < nb)) { break; } */ if(!(f.nb < nb)) { $s = 13; continue; } _r$3 = f.moreBits(); /* */ $s = 14; case 14: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } err$3 = _r$3; if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = -1; return err$3; } $s = 12; continue; case 13: rep = rep + (((((f.b & ((((y$4 = nb, y$4 < 32 ? (1 << y$4) : 0) >>> 0) - 1 >>> 0))) >>> 0) >> 0))) >> 0; f.b = (y$5 = (nb), y$5 < 32 ? (f.b >>> y$5) : 0) >>> 0; f.nb = f.nb - (nb) >>> 0; if ((i$2 + rep >> 0) > n) { $s = -1; return ((x$12 = f.roffset, new CorruptInputError(x$12.$high, x$12.$low))); } j = 0; while (true) { if (!(j < rep)) { break; } (x$13 = f.bits, x$13.nilCheck, ((i$2 < 0 || i$2 >= x$13.length) ? ($throwRuntimeError("index out of range"), undefined) : x$13[i$2] = b)); i$2 = i$2 + (1) >> 0; j = j + (1) >> 0; } $s = 9; continue; case 10: if (!f.h1.init($subslice(new sliceType$4(f.bits), 0, nlit)) || !f.h2.init($subslice(new sliceType$4(f.bits), nlit, (nlit + ndist >> 0)))) { $s = -1; return ((x$14 = f.roffset, new CorruptInputError(x$14.$high, x$14.$low))); } if (f.h1.min < f.bits[256]) { f.h1.min = f.bits[256]; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: decompressor.ptr.prototype.readHuffman }; } $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.f = f; $f.i = i; $f.i$1 = i$1; $f.i$2 = i$2; $f.j = j; $f.n = n; $f.nb = nb; $f.nclen = nclen; $f.ndist = ndist; $f.nlit = nlit; $f.rep = rep; $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.y = y; $f.y$1 = y$1; $f.y$2 = y$2; $f.y$3 = y$3; $f.y$4 = y$4; $f.y$5 = y$5; $f.$s = $s; $f.$r = $r; return $f; }; decompressor.prototype.readHuffman = function() { return this.$val.readHuffman(); }; decompressor.ptr.prototype.huffmanBlock = function() { var _1, _r, _r$1, _r$2, _r$3, _r$4, _tmp, _tmp$1, _tuple, _tuple$1, cnt, dist, err, extra, f, length, n, nb, v, x, x$1, x$2, y, y$1, y$2, y$3, y$4, y$5, y$6, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; cnt = $f.cnt; dist = $f.dist; err = $f.err; extra = $f.extra; f = $f.f; length = $f.length; n = $f.n; nb = $f.nb; v = $f.v; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; y = $f.y; y$1 = $f.y$1; y$2 = $f.y$2; y$3 = $f.y$3; y$4 = $f.y$4; y$5 = $f.y$5; y$6 = $f.y$6; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; _1 = f.stepState; /* */ if (_1 === (0)) { $s = 2; continue; } /* */ if (_1 === (1)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_1 === (0)) { */ case 2: /* goto readLiteral */ $s = 5; continue; $s = 4; continue; /* } else if (_1 === (1)) { */ case 3: /* goto copyHistory */ $s = 6; continue; /* } */ case 4: case 1: /* readLiteral: */ case 5: _r = f.huffSym(f.hl); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; v = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { f.err = err; $s = -1; return; } n = 0; length = 0; /* */ if (v < 256) { $s = 9; continue; } /* */ if ((v === 256)) { $s = 10; continue; } /* */ if (v < 265) { $s = 11; continue; } /* */ if (v < 269) { $s = 12; continue; } /* */ if (v < 273) { $s = 13; continue; } /* */ if (v < 277) { $s = 14; continue; } /* */ if (v < 281) { $s = 15; continue; } /* */ if (v < 285) { $s = 16; continue; } /* */ if (v < 286) { $s = 17; continue; } /* */ $s = 18; continue; /* if (v < 256) { */ case 9: f.dict.writeByte(((v << 24 >>> 24))); if (f.dict.availWrite() === 0) { f.toRead = f.dict.readFlush(); f.step = $methodExpr(ptrType$2, "huffmanBlock"); f.stepState = 0; $s = -1; return; } /* goto readLiteral */ $s = 5; continue; $s = 19; continue; /* } else if ((v === 256)) { */ case 10: f.finishBlock(); $s = -1; return; /* } else if (v < 265) { */ case 11: length = v - 254 >> 0; n = 0; $s = 19; continue; /* } else if (v < 269) { */ case 12: length = ($imul(v, 2)) - 519 >> 0; n = 1; $s = 19; continue; /* } else if (v < 273) { */ case 13: length = ($imul(v, 4)) - 1057 >> 0; n = 2; $s = 19; continue; /* } else if (v < 277) { */ case 14: length = ($imul(v, 8)) - 2149 >> 0; n = 3; $s = 19; continue; /* } else if (v < 281) { */ case 15: length = ($imul(v, 16)) - 4365 >> 0; n = 4; $s = 19; continue; /* } else if (v < 285) { */ case 16: length = ($imul(v, 32)) - 8861 >> 0; n = 5; $s = 19; continue; /* } else if (v < 286) { */ case 17: length = 258; n = 0; $s = 19; continue; /* } else { */ case 18: f.err = ((x = f.roffset, new CorruptInputError(x.$high, x.$low))); $s = -1; return; /* } */ case 19: case 8: /* */ if (n > 0) { $s = 20; continue; } /* */ $s = 21; continue; /* if (n > 0) { */ case 20: /* while (true) { */ case 22: /* if (!(f.nb < n)) { break; } */ if(!(f.nb < n)) { $s = 23; continue; } _r$1 = f.moreBits(); /* */ $s = 24; case 24: 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))) { f.err = err; $s = -1; return; } $s = 22; continue; case 23: length = length + (((((f.b & ((((y = n, y < 32 ? (1 << y) : 0) >>> 0) - 1 >>> 0))) >>> 0) >> 0))) >> 0; f.b = (y$1 = (n), y$1 < 32 ? (f.b >>> y$1) : 0) >>> 0; f.nb = f.nb - (n) >>> 0; /* } */ case 21: dist = 0; /* */ if (f.hd === ptrType$1.nil) { $s = 25; continue; } /* */ $s = 26; continue; /* if (f.hd === ptrType$1.nil) { */ case 25: /* while (true) { */ case 28: /* if (!(f.nb < 5)) { break; } */ if(!(f.nb < 5)) { $s = 29; continue; } _r$2 = f.moreBits(); /* */ $s = 30; case 30: 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))) { f.err = err; $s = -1; return; } $s = 28; continue; case 29: dist = ((bits.Reverse8((((((f.b & 31) >>> 0) << 3 >>> 0) << 24 >>> 24))) >> 0)); f.b = (y$2 = (5), y$2 < 32 ? (f.b >>> y$2) : 0) >>> 0; f.nb = f.nb - (5) >>> 0; $s = 27; continue; /* } else { */ case 26: _r$3 = f.huffSym(f.hd); /* */ $s = 31; case 31: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$1 = _r$3; dist = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { f.err = err; $s = -1; return; } /* } */ case 27: /* */ if (dist < 4) { $s = 33; continue; } /* */ if (dist < 30) { $s = 34; continue; } /* */ $s = 35; continue; /* if (dist < 4) { */ case 33: dist = dist + (1) >> 0; $s = 36; continue; /* } else if (dist < 30) { */ case 34: nb = (((dist - 2 >> 0) >>> 0)) >>> 1 >>> 0; extra = (y$3 = nb, y$3 < 32 ? (((dist & 1)) << y$3) : 0) >> 0; /* while (true) { */ case 37: /* if (!(f.nb < nb)) { break; } */ if(!(f.nb < nb)) { $s = 38; continue; } _r$4 = f.moreBits(); /* */ $s = 39; case 39: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } err = _r$4; if (!($interfaceIsEqual(err, $ifaceNil))) { f.err = err; $s = -1; return; } $s = 37; continue; case 38: extra = extra | (((((f.b & ((((y$4 = nb, y$4 < 32 ? (1 << y$4) : 0) >>> 0) - 1 >>> 0))) >>> 0) >> 0))); f.b = (y$5 = (nb), y$5 < 32 ? (f.b >>> y$5) : 0) >>> 0; f.nb = f.nb - (nb) >>> 0; dist = (((y$6 = ((nb + 1 >>> 0)), y$6 < 32 ? (1 << y$6) : 0) >> 0) + 1 >> 0) + extra >> 0; $s = 36; continue; /* } else { */ case 35: f.err = ((x$1 = f.roffset, new CorruptInputError(x$1.$high, x$1.$low))); $s = -1; return; /* } */ case 36: case 32: if (dist > f.dict.histSize()) { f.err = ((x$2 = f.roffset, new CorruptInputError(x$2.$high, x$2.$low))); $s = -1; return; } _tmp = length; _tmp$1 = dist; f.copyLen = _tmp; f.copyDist = _tmp$1; /* goto copyHistory */ $s = 6; continue; /* copyHistory: */ case 6: cnt = f.dict.tryWriteCopy(f.copyDist, f.copyLen); if (cnt === 0) { cnt = f.dict.writeCopy(f.copyDist, f.copyLen); } f.copyLen = f.copyLen - (cnt) >> 0; if ((f.dict.availWrite() === 0) || f.copyLen > 0) { f.toRead = f.dict.readFlush(); f.step = $methodExpr(ptrType$2, "huffmanBlock"); f.stepState = 1; $s = -1; return; } /* goto readLiteral */ $s = 5; continue; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: decompressor.ptr.prototype.huffmanBlock }; } $f._1 = _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._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.cnt = cnt; $f.dist = dist; $f.err = err; $f.extra = extra; $f.f = f; $f.length = length; $f.n = n; $f.nb = nb; $f.v = v; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.y = y; $f.y$1 = y$1; $f.y$2 = y$2; $f.y$3 = y$3; $f.y$4 = y$4; $f.y$5 = y$5; $f.y$6 = y$6; $f.$s = $s; $f.$r = $r; return $f; }; decompressor.prototype.huffmanBlock = function() { return this.$val.huffmanBlock(); }; decompressor.ptr.prototype.dataBlock = function() { var _r, _tuple, err, f, n, nn, nr, x, x$1, x$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; f = $f.f; n = $f.n; nn = $f.nn; nr = $f.nr; 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: f = this; f.nb = 0; f.b = 0; _r = io.ReadFull(f.r, $subslice(new sliceType$5(f.buf), 0, 4)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; nr = _tuple[0]; err = _tuple[1]; f.roffset = (x = f.roffset, x$1 = (new $Int64(0, nr)), new $Int64(x.$high + x$1.$high, x.$low + x$1.$low)); if (!($interfaceIsEqual(err, $ifaceNil))) { f.err = noEOF(err); $s = -1; return; } n = ((f.buf[0] >> 0)) | (((f.buf[1] >> 0)) << 8 >> 0); nn = ((f.buf[2] >> 0)) | (((f.buf[3] >> 0)) << 8 >> 0); if (!((((nn << 16 >>> 16)) === (((~n >> 0) << 16 >>> 16))))) { f.err = ((x$2 = f.roffset, new CorruptInputError(x$2.$high, x$2.$low))); $s = -1; return; } if (n === 0) { f.toRead = f.dict.readFlush(); f.finishBlock(); $s = -1; return; } f.copyLen = n; $r = f.copyData(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: decompressor.ptr.prototype.dataBlock }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.f = f; $f.n = n; $f.nn = nn; $f.nr = nr; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; }; decompressor.prototype.dataBlock = function() { return this.$val.dataBlock(); }; decompressor.ptr.prototype.copyData = function() { var _r, _tuple, buf, cnt, err, f, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; buf = $f.buf; cnt = $f.cnt; err = $f.err; f = $f.f; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; buf = f.dict.writeSlice(); if (buf.$length > f.copyLen) { buf = $subslice(buf, 0, f.copyLen); } _r = io.ReadFull(f.r, buf); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; cnt = _tuple[0]; err = _tuple[1]; f.roffset = (x = f.roffset, x$1 = (new $Int64(0, cnt)), new $Int64(x.$high + x$1.$high, x.$low + x$1.$low)); f.copyLen = f.copyLen - (cnt) >> 0; f.dict.writeMark(cnt); if (!($interfaceIsEqual(err, $ifaceNil))) { f.err = noEOF(err); $s = -1; return; } if ((f.dict.availWrite() === 0) || f.copyLen > 0) { f.toRead = f.dict.readFlush(); f.step = $methodExpr(ptrType$2, "copyData"); $s = -1; return; } f.finishBlock(); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: decompressor.ptr.prototype.copyData }; } $f._r = _r; $f._tuple = _tuple; $f.buf = buf; $f.cnt = cnt; $f.err = err; $f.f = f; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; decompressor.prototype.copyData = function() { return this.$val.copyData(); }; decompressor.ptr.prototype.finishBlock = function() { var f; f = this; if (f.final$12) { if (f.dict.availRead() > 0) { f.toRead = f.dict.readFlush(); } f.err = io.EOF; } f.step = $methodExpr(ptrType$2, "nextBlock"); }; decompressor.prototype.finishBlock = function() { return this.$val.finishBlock(); }; noEOF = function(e) { var e; if ($interfaceIsEqual(e, io.EOF)) { return io.ErrUnexpectedEOF; } return e; }; decompressor.ptr.prototype.moreBits = function() { var _r, _tuple, c, err, f, x, x$1, y, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; c = $f.c; err = $f.err; f = $f.f; x = $f.x; x$1 = $f.x$1; y = $f.y; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; _r = f.r.ReadByte(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; c = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return noEOF(err); } f.roffset = (x = f.roffset, x$1 = new $Int64(0, 1), new $Int64(x.$high + x$1.$high, x.$low + x$1.$low)); f.b = (f.b | (((y = f.nb, y < 32 ? (((c >>> 0)) << y) : 0) >>> 0))) >>> 0; f.nb = f.nb + (8) >>> 0; $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: decompressor.ptr.prototype.moreBits }; } $f._r = _r; $f._tuple = _tuple; $f.c = c; $f.err = err; $f.f = f; $f.x = x; $f.x$1 = x$1; $f.y = y; $f.$s = $s; $f.$r = $r; return $f; }; decompressor.prototype.moreBits = function() { return this.$val.moreBits(); }; decompressor.ptr.prototype.huffSym = function(h) { var _r, _tmp, _tmp$1, _tuple, b, c, chunk, err, f, h, n, nb, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, y, y$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; b = $f.b; c = $f.c; chunk = $f.chunk; err = $f.err; f = $f.f; h = $f.h; n = $f.n; nb = $f.nb; 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; y = $f.y; y$1 = $f.y$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; n = ((h.min >>> 0)); _tmp = f.nb; _tmp$1 = f.b; nb = _tmp; b = _tmp$1; /* while (true) { */ case 1: /* while (true) { */ case 3: /* if (!(nb < n)) { break; } */ if(!(nb < n)) { $s = 4; continue; } _r = f.r.ReadByte(); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; c = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { f.b = b; f.nb = nb; $s = -1; return [0, noEOF(err)]; } f.roffset = (x = f.roffset, x$1 = new $Int64(0, 1), new $Int64(x.$high + x$1.$high, x.$low + x$1.$low)); b = (b | (((y = (((nb & 31) >>> 0)), y < 32 ? (((c >>> 0)) << y) : 0) >>> 0))) >>> 0; nb = nb + (8) >>> 0; $s = 3; continue; case 4: chunk = (x$2 = h.chunks, x$3 = (b & 511) >>> 0, ((x$3 < 0 || x$3 >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[x$3])); n = ((((chunk & 15) >>> 0) >>> 0)); if (n > 9) { chunk = (x$4 = (x$5 = h.links, x$6 = chunk >>> 4 >>> 0, ((x$6 < 0 || x$6 >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + x$6])), x$7 = (((b >>> 9 >>> 0)) & h.linkMask) >>> 0, ((x$7 < 0 || x$7 >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + x$7])); n = ((((chunk & 15) >>> 0) >>> 0)); } if (n <= nb) { if (n === 0) { f.b = b; f.nb = nb; f.err = ((x$8 = f.roffset, new CorruptInputError(x$8.$high, x$8.$low))); $s = -1; return [0, f.err]; } f.b = (y$1 = (((n & 31) >>> 0)), y$1 < 32 ? (b >>> y$1) : 0) >>> 0; f.nb = nb - n >>> 0; $s = -1; return [(((chunk >>> 4 >>> 0) >> 0)), $ifaceNil]; } $s = 1; continue; case 2: $s = -1; return [0, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: decompressor.ptr.prototype.huffSym }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.b = b; $f.c = c; $f.chunk = chunk; $f.err = err; $f.f = f; $f.h = h; $f.n = n; $f.nb = nb; $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.y = y; $f.y$1 = y$1; $f.$s = $s; $f.$r = $r; return $f; }; decompressor.prototype.huffSym = function(h) { return this.$val.huffSym(h); }; makeReader = function(r) { var _tuple, ok, r, rr; _tuple = $assertType(r, Reader, true); rr = _tuple[0]; ok = _tuple[1]; if (ok) { return rr; } return bufio.NewReader(r); }; fixedHuffmanDecoderInit = function() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = fixedOnce.Do((function() { var bits$1, i, i$1, i$2, i$3; bits$1 = arrayType$2.zero(); i = 0; while (true) { if (!(i < 144)) { break; } ((i < 0 || i >= bits$1.length) ? ($throwRuntimeError("index out of range"), undefined) : bits$1[i] = 8); i = i + (1) >> 0; } i$1 = 144; while (true) { if (!(i$1 < 256)) { break; } ((i$1 < 0 || i$1 >= bits$1.length) ? ($throwRuntimeError("index out of range"), undefined) : bits$1[i$1] = 9); i$1 = i$1 + (1) >> 0; } i$2 = 256; while (true) { if (!(i$2 < 280)) { break; } ((i$2 < 0 || i$2 >= bits$1.length) ? ($throwRuntimeError("index out of range"), undefined) : bits$1[i$2] = 7); i$2 = i$2 + (1) >> 0; } i$3 = 280; while (true) { if (!(i$3 < 288)) { break; } ((i$3 < 0 || i$3 >= bits$1.length) ? ($throwRuntimeError("index out of range"), undefined) : bits$1[i$3] = 8); i$3 = i$3 + (1) >> 0; } fixedHuffmanDecoder.init(new sliceType$4(bits$1)); })); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: fixedHuffmanDecoderInit }; } $f.$s = $s; $f.$r = $r; return $f; }; decompressor.ptr.prototype.Reset = function(r, dict) { var dict, f, r; f = this; decompressor.copy(f, new decompressor.ptr(makeReader(r), new $Int64(0, 0), 0, 0, new huffmanDecoder.ptr(0, arrayType.zero(), sliceType$1.nil, 0), new huffmanDecoder.ptr(0, arrayType.zero(), sliceType$1.nil, 0), f.bits, f.codebits, $clone(f.dict, dictDecoder), arrayType$5.zero(), $methodExpr(ptrType$2, "nextBlock"), 0, false, $ifaceNil, sliceType$5.nil, ptrType$1.nil, ptrType$1.nil, 0, 0)); f.dict.init(32768, dict); return $ifaceNil; }; decompressor.prototype.Reset = function(r, dict) { return this.$val.Reset(r, dict); }; NewReader = function(r) { var f, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; f = $f.f; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = [f]; $r = fixedHuffmanDecoderInit(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } f[0] = new decompressor.ptr($ifaceNil, new $Int64(0, 0), 0, 0, new huffmanDecoder.ptr(0, arrayType.zero(), sliceType$1.nil, 0), new huffmanDecoder.ptr(0, arrayType.zero(), sliceType$1.nil, 0), ptrType$3.nil, ptrType$4.nil, new dictDecoder.ptr(sliceType$5.nil, 0, 0, false), arrayType$5.zero(), $throwNilPointerError, 0, false, $ifaceNil, sliceType$5.nil, ptrType$1.nil, ptrType$1.nil, 0, 0); f[0].r = makeReader(r); f[0].bits = arrayType$3.zero(); f[0].codebits = arrayType$4.zero(); f[0].step = $methodExpr(ptrType$2, "nextBlock"); f[0].dict.init(32768, sliceType$5.nil); $s = -1; return f[0]; /* */ } return; } if ($f === undefined) { $f = { $blk: NewReader }; } $f.f = f; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.NewReader = NewReader; hcode.ptr.prototype.set = function(code, length) { var code, h, length; h = this; h.len = length; h.code = code; }; hcode.prototype.set = function(code, length) { return this.$val.set(code, length); }; maxNode = function() { return new literalNode.ptr(65535, 2147483647); }; newHuffmanEncoder = function(size) { var size; return new huffmanEncoder.ptr($makeSlice(sliceType$6, size), sliceType$7.nil, arrayType$6.zero(), byLiteral.nil, byFreq.nil); }; generateFixedLiteralEncoding = function() { var bits$1, ch, codes, h, size; h = newHuffmanEncoder(286); codes = h.codes; ch = 0; ch = 0; while (true) { if (!(ch < 286)) { break; } bits$1 = 0; size = 0; switch (0) { default: if (ch < 144) { bits$1 = ch + 48 << 16 >>> 16; size = 8; break; } else if (ch < 256) { bits$1 = (ch + 400 << 16 >>> 16) - 144 << 16 >>> 16; size = 9; break; } else if (ch < 280) { bits$1 = ch - 256 << 16 >>> 16; size = 7; break; } else { bits$1 = (ch + 192 << 16 >>> 16) - 280 << 16 >>> 16; size = 8; } } hcode.copy(((ch < 0 || ch >= codes.$length) ? ($throwRuntimeError("index out of range"), undefined) : codes.$array[codes.$offset + ch]), new hcode.ptr(reverseBits(bits$1, ((size << 24 >>> 24))), size)); ch = ch + (1) << 16 >>> 16; } return h; }; generateFixedOffsetEncoding = function() { var _i, _ref, ch, codes, h; h = newHuffmanEncoder(30); codes = h.codes; _ref = codes; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } ch = _i; hcode.copy(((ch < 0 || ch >= codes.$length) ? ($throwRuntimeError("index out of range"), undefined) : codes.$array[codes.$offset + ch]), new hcode.ptr(reverseBits(((ch << 16 >>> 16)), 5), 5)); _i++; } return h; }; huffmanEncoder.ptr.prototype.bitCounts = function(list, maxBits) { var bitCount, bits$1, counts, h, l, leafCounts, level, level$1, level$2, levels$1, list, maxBits, n, n$1, prevFreq, x, x$1, x$10, x$11, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; h = this; if (maxBits >= 16) { $panic(new $String("flate: maxBits too large")); } n = ((list.$length >> 0)); list = $subslice(list, 0, (n + 1 >> 0)); literalNode.copy(((n < 0 || n >= list.$length) ? ($throwRuntimeError("index out of range"), undefined) : list.$array[list.$offset + n]), maxNode()); if (maxBits > (n - 1 >> 0)) { maxBits = n - 1 >> 0; } levels$1 = arrayType$7.zero(); leafCounts = arrayType$9.zero(); level = 1; while (true) { if (!(level <= maxBits)) { break; } levelInfo.copy(((level < 0 || level >= levels$1.length) ? ($throwRuntimeError("index out of range"), undefined) : levels$1[level]), new levelInfo.ptr(level, (1 >= list.$length ? ($throwRuntimeError("index out of range"), undefined) : list.$array[list.$offset + 1]).freq, (2 >= list.$length ? ($throwRuntimeError("index out of range"), undefined) : list.$array[list.$offset + 2]).freq, (0 >= list.$length ? ($throwRuntimeError("index out of range"), undefined) : list.$array[list.$offset + 0]).freq + (1 >= list.$length ? ($throwRuntimeError("index out of range"), undefined) : list.$array[list.$offset + 1]).freq >> 0, 0)); (x = ((level < 0 || level >= leafCounts.length) ? ($throwRuntimeError("index out of range"), undefined) : leafCounts[level]), ((level < 0 || level >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[level] = 2)); if (level === 1) { ((level < 0 || level >= levels$1.length) ? ($throwRuntimeError("index out of range"), undefined) : levels$1[level]).nextPairFreq = 2147483647; } level = level + (1) >> 0; } ((maxBits < 0 || maxBits >= levels$1.length) ? ($throwRuntimeError("index out of range"), undefined) : levels$1[maxBits]).needed = ($imul(2, n)) - 4 >> 0; level$1 = maxBits; while (true) { l = ((level$1 < 0 || level$1 >= levels$1.length) ? ($throwRuntimeError("index out of range"), undefined) : levels$1[level$1]); if ((l.nextPairFreq === 2147483647) && (l.nextCharFreq === 2147483647)) { l.needed = 0; (x$1 = level$1 + 1 >> 0, ((x$1 < 0 || x$1 >= levels$1.length) ? ($throwRuntimeError("index out of range"), undefined) : levels$1[x$1])).nextPairFreq = 2147483647; level$1 = level$1 + (1) >> 0; continue; } prevFreq = l.lastFreq; if (l.nextCharFreq < l.nextPairFreq) { n$1 = (x$2 = ((level$1 < 0 || level$1 >= leafCounts.length) ? ($throwRuntimeError("index out of range"), undefined) : leafCounts[level$1]), ((level$1 < 0 || level$1 >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[level$1])) + 1 >> 0; l.lastFreq = l.nextCharFreq; (x$3 = ((level$1 < 0 || level$1 >= leafCounts.length) ? ($throwRuntimeError("index out of range"), undefined) : leafCounts[level$1]), ((level$1 < 0 || level$1 >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[level$1] = n$1)); l.nextCharFreq = ((n$1 < 0 || n$1 >= list.$length) ? ($throwRuntimeError("index out of range"), undefined) : list.$array[list.$offset + n$1]).freq; } else { l.lastFreq = l.nextPairFreq; $copySlice($subslice(new sliceType$8(((level$1 < 0 || level$1 >= leafCounts.length) ? ($throwRuntimeError("index out of range"), undefined) : leafCounts[level$1])), 0, level$1), $subslice(new sliceType$8((x$4 = level$1 - 1 >> 0, ((x$4 < 0 || x$4 >= leafCounts.length) ? ($throwRuntimeError("index out of range"), undefined) : leafCounts[x$4]))), 0, level$1)); (x$5 = l.level - 1 >> 0, ((x$5 < 0 || x$5 >= levels$1.length) ? ($throwRuntimeError("index out of range"), undefined) : levels$1[x$5])).needed = 2; } l.needed = l.needed - (1) >> 0; if (l.needed === 0) { if (l.level === maxBits) { break; } (x$6 = l.level + 1 >> 0, ((x$6 < 0 || x$6 >= levels$1.length) ? ($throwRuntimeError("index out of range"), undefined) : levels$1[x$6])).nextPairFreq = prevFreq + l.lastFreq >> 0; level$1 = level$1 + (1) >> 0; } else { while (true) { if (!((x$7 = level$1 - 1 >> 0, ((x$7 < 0 || x$7 >= levels$1.length) ? ($throwRuntimeError("index out of range"), undefined) : levels$1[x$7])).needed > 0)) { break; } level$1 = level$1 - (1) >> 0; } } } if (!(((x$8 = ((maxBits < 0 || maxBits >= leafCounts.length) ? ($throwRuntimeError("index out of range"), undefined) : leafCounts[maxBits]), ((maxBits < 0 || maxBits >= x$8.length) ? ($throwRuntimeError("index out of range"), undefined) : x$8[maxBits])) === n))) { $panic(new $String("leafCounts[maxBits][maxBits] != n")); } bitCount = $subslice(new sliceType$8(h.bitCount), 0, (maxBits + 1 >> 0)); bits$1 = 1; counts = ((maxBits < 0 || maxBits >= leafCounts.length) ? ($throwRuntimeError("index out of range"), undefined) : leafCounts[maxBits]); level$2 = maxBits; while (true) { if (!(level$2 > 0)) { break; } ((bits$1 < 0 || bits$1 >= bitCount.$length) ? ($throwRuntimeError("index out of range"), undefined) : bitCount.$array[bitCount.$offset + bits$1] = ((x$9 = counts, ((level$2 < 0 || level$2 >= x$9.length) ? ($throwRuntimeError("index out of range"), undefined) : x$9[level$2])) - (x$10 = counts, x$11 = level$2 - 1 >> 0, ((x$11 < 0 || x$11 >= x$10.length) ? ($throwRuntimeError("index out of range"), undefined) : x$10[x$11])) >> 0)); bits$1 = bits$1 + (1) >> 0; level$2 = level$2 - (1) >> 0; } return bitCount; }; huffmanEncoder.prototype.bitCounts = function(list, maxBits) { return this.$val.bitCounts(list, maxBits); }; huffmanEncoder.ptr.prototype.assignEncodingAndSize = function(bitCount, list) { var _i, _i$1, _ref, _ref$1, bitCount, bits$1, chunk, code, h, list, n, node, x, x$1, y, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _i$1 = $f._i$1; _ref = $f._ref; _ref$1 = $f._ref$1; bitCount = $f.bitCount; bits$1 = $f.bits$1; chunk = $f.chunk; code = $f.code; h = $f.h; list = $f.list; n = $f.n; node = $f.node; x = $f.x; x$1 = $f.x$1; y = $f.y; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: h = this; code = 0; _ref = bitCount; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } n = _i; bits$1 = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); code = (y = (1), y < 32 ? (code << y) : 0) << 16 >>> 16; if ((n === 0) || (bits$1 === 0)) { _i++; /* continue; */ $s = 1; continue; } chunk = $subslice(list, (list.$length - ((bits$1 >> 0)) >> 0)); $r = (h.$ptr_lns || (h.$ptr_lns = new ptrType$5(function() { return this.$target.lns; }, function($v) { this.$target.lns = $v; }, h))).sort(chunk); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _ref$1 = chunk; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } node = $clone(((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]), literalNode); hcode.copy((x = h.codes, x$1 = node.literal, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])), new hcode.ptr(reverseBits(code, ((n << 24 >>> 24))), ((n << 16 >>> 16)))); code = code + (1) << 16 >>> 16; _i$1++; } list = $subslice(list, 0, (list.$length - ((bits$1 >> 0)) >> 0)); _i++; $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: huffmanEncoder.ptr.prototype.assignEncodingAndSize }; } $f._i = _i; $f._i$1 = _i$1; $f._ref = _ref; $f._ref$1 = _ref$1; $f.bitCount = bitCount; $f.bits$1 = bits$1; $f.chunk = chunk; $f.code = code; $f.h = h; $f.list = list; $f.n = n; $f.node = node; $f.x = x; $f.x$1 = x$1; $f.y = y; $f.$s = $s; $f.$r = $r; return $f; }; huffmanEncoder.prototype.assignEncodingAndSize = function(bitCount, list) { return this.$val.assignEncodingAndSize(bitCount, list); }; huffmanEncoder.ptr.prototype.generate = function(freq, maxBits) { var _i, _i$1, _ref, _ref$1, bitCount, count, f, freq, h, i, i$1, list, maxBits, node, 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; _i = $f._i; _i$1 = $f._i$1; _ref = $f._ref; _ref$1 = $f._ref$1; bitCount = $f.bitCount; count = $f.count; f = $f.f; freq = $f.freq; h = $f.h; i = $f.i; i$1 = $f.i$1; list = $f.list; maxBits = $f.maxBits; node = $f.node; 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: h = this; if (h.freqcache === sliceType$7.nil) { h.freqcache = $makeSlice(sliceType$7, 287); } list = $subslice(h.freqcache, 0, (freq.$length + 1 >> 0)); count = 0; _ref = freq; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; f = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (!((f === 0))) { literalNode.copy(((count < 0 || count >= list.$length) ? ($throwRuntimeError("index out of range"), undefined) : list.$array[list.$offset + count]), new literalNode.ptr(((i << 16 >>> 16)), f)); count = count + (1) >> 0; } else { literalNode.copy(((count < 0 || count >= list.$length) ? ($throwRuntimeError("index out of range"), undefined) : list.$array[list.$offset + count]), new literalNode.ptr(0, 0)); (x = h.codes, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])).len = 0; } _i++; } literalNode.copy((x$1 = freq.$length, ((x$1 < 0 || x$1 >= list.$length) ? ($throwRuntimeError("index out of range"), undefined) : list.$array[list.$offset + x$1])), new literalNode.ptr(0, 0)); list = $subslice(list, 0, count); if (count <= 2) { _ref$1 = list; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } i$1 = _i$1; node = $clone(((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]), literalNode); (x$2 = h.codes, x$3 = node.literal, ((x$3 < 0 || x$3 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + x$3])).set(((i$1 << 16 >>> 16)), 1); _i$1++; } $s = -1; return; } $r = (h.$ptr_lfs || (h.$ptr_lfs = new ptrType$6(function() { return this.$target.lfs; }, function($v) { this.$target.lfs = $v; }, h))).sort(list); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } bitCount = h.bitCounts(list, maxBits); $r = h.assignEncodingAndSize(bitCount, list); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: huffmanEncoder.ptr.prototype.generate }; } $f._i = _i; $f._i$1 = _i$1; $f._ref = _ref; $f._ref$1 = _ref$1; $f.bitCount = bitCount; $f.count = count; $f.f = f; $f.freq = freq; $f.h = h; $f.i = i; $f.i$1 = i$1; $f.list = list; $f.maxBits = maxBits; $f.node = node; $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; }; huffmanEncoder.prototype.generate = function(freq, maxBits) { return this.$val.generate(freq, maxBits); }; $ptrType(byLiteral).prototype.sort = function(a) { var a, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; a = $f.a; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; s.$set(($convertSliceType(a, byLiteral))); $r = sort.Sort(s); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $ptrType(byLiteral).prototype.sort }; } $f.a = a; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; byLiteral.prototype.Len = function() { var s; s = this; return s.$length; }; $ptrType(byLiteral).prototype.Len = function() { return this.$get().Len(); }; byLiteral.prototype.Less = function(i, j) { var i, j, s; s = this; return ((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]).literal < ((j < 0 || j >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + j]).literal; }; $ptrType(byLiteral).prototype.Less = function(i, j) { return this.$get().Less(i, j); }; byLiteral.prototype.Swap = function(i, j) { var _tmp, _tmp$1, i, j, s; s = this; _tmp = $clone(((j < 0 || j >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + j]), literalNode); _tmp$1 = $clone(((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]), literalNode); literalNode.copy(((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]), _tmp); literalNode.copy(((j < 0 || j >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + j]), _tmp$1); }; $ptrType(byLiteral).prototype.Swap = function(i, j) { return this.$get().Swap(i, j); }; $ptrType(byFreq).prototype.sort = function(a) { var a, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; a = $f.a; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; s.$set(($convertSliceType(a, byFreq))); $r = sort.Sort(s); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $ptrType(byFreq).prototype.sort }; } $f.a = a; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; byFreq.prototype.Len = function() { var s; s = this; return s.$length; }; $ptrType(byFreq).prototype.Len = function() { return this.$get().Len(); }; byFreq.prototype.Less = function(i, j) { var i, j, s; s = this; if (((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]).freq === ((j < 0 || j >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + j]).freq) { return ((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]).literal < ((j < 0 || j >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + j]).literal; } return ((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]).freq < ((j < 0 || j >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + j]).freq; }; $ptrType(byFreq).prototype.Less = function(i, j) { return this.$get().Less(i, j); }; byFreq.prototype.Swap = function(i, j) { var _tmp, _tmp$1, i, j, s; s = this; _tmp = $clone(((j < 0 || j >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + j]), literalNode); _tmp$1 = $clone(((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]), literalNode); literalNode.copy(((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]), _tmp); literalNode.copy(((j < 0 || j >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + j]), _tmp$1); }; $ptrType(byFreq).prototype.Swap = function(i, j) { return this.$get().Swap(i, j); }; reverseBits = function(number, bitLength) { var bitLength, number, y; return bits.Reverse16((y = ((16 - bitLength << 24 >>> 24)), y < 32 ? (number << y) : 0) << 16 >>> 16); }; init = function() { var offsetFreq, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; offsetFreq = $f.offsetFreq; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: offsetFreq = $makeSlice(sliceType$8, 30); (0 >= offsetFreq.$length ? ($throwRuntimeError("index out of range"), undefined) : offsetFreq.$array[offsetFreq.$offset + 0] = 1); huffOffset = newHuffmanEncoder(30); $r = huffOffset.generate(offsetFreq, 15); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: init }; } $f.offsetFreq = offsetFreq; $f.$s = $s; $f.$r = $r; return $f; }; dictDecoder.ptr.prototype.init = function(size, dict) { var dd, dict, size; dd = this; dictDecoder.copy(dd, new dictDecoder.ptr(dd.hist, 0, 0, false)); if (dd.hist.$capacity < size) { dd.hist = $makeSlice(sliceType$5, size); } dd.hist = $subslice(dd.hist, 0, size); if (dict.$length > dd.hist.$length) { dict = $subslice(dict, (dict.$length - dd.hist.$length >> 0)); } dd.wrPos = $copySlice(dd.hist, dict); if (dd.wrPos === dd.hist.$length) { dd.wrPos = 0; dd.full = true; } dd.rdPos = dd.wrPos; }; dictDecoder.prototype.init = function(size, dict) { return this.$val.init(size, dict); }; dictDecoder.ptr.prototype.histSize = function() { var dd; dd = this; if (dd.full) { return dd.hist.$length; } return dd.wrPos; }; dictDecoder.prototype.histSize = function() { return this.$val.histSize(); }; dictDecoder.ptr.prototype.availRead = function() { var dd; dd = this; return dd.wrPos - dd.rdPos >> 0; }; dictDecoder.prototype.availRead = function() { return this.$val.availRead(); }; dictDecoder.ptr.prototype.availWrite = function() { var dd; dd = this; return dd.hist.$length - dd.wrPos >> 0; }; dictDecoder.prototype.availWrite = function() { return this.$val.availWrite(); }; dictDecoder.ptr.prototype.writeSlice = function() { var dd; dd = this; return $subslice(dd.hist, dd.wrPos); }; dictDecoder.prototype.writeSlice = function() { return this.$val.writeSlice(); }; dictDecoder.ptr.prototype.writeMark = function(cnt) { var cnt, dd; dd = this; dd.wrPos = dd.wrPos + (cnt) >> 0; }; dictDecoder.prototype.writeMark = function(cnt) { return this.$val.writeMark(cnt); }; dictDecoder.ptr.prototype.writeByte = function(c) { var c, dd, x, x$1; dd = this; (x = dd.hist, x$1 = dd.wrPos, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1] = c)); dd.wrPos = dd.wrPos + (1) >> 0; }; dictDecoder.prototype.writeByte = function(c) { return this.$val.writeByte(c); }; dictDecoder.ptr.prototype.writeCopy = function(dist, length) { var dd, dist, dstBase, dstPos, endPos, length, srcPos; dd = this; dstBase = dd.wrPos; dstPos = dstBase; srcPos = dstPos - dist >> 0; endPos = dstPos + length >> 0; if (endPos > dd.hist.$length) { endPos = dd.hist.$length; } if (srcPos < 0) { srcPos = srcPos + (dd.hist.$length) >> 0; dstPos = dstPos + ($copySlice($subslice(dd.hist, dstPos, endPos), $subslice(dd.hist, srcPos))) >> 0; srcPos = 0; } while (true) { if (!(dstPos < endPos)) { break; } dstPos = dstPos + ($copySlice($subslice(dd.hist, dstPos, endPos), $subslice(dd.hist, srcPos, dstPos))) >> 0; } dd.wrPos = dstPos; return dstPos - dstBase >> 0; }; dictDecoder.prototype.writeCopy = function(dist, length) { return this.$val.writeCopy(dist, length); }; dictDecoder.ptr.prototype.tryWriteCopy = function(dist, length) { var dd, dist, dstBase, dstPos, endPos, length, srcPos; dd = this; dstPos = dd.wrPos; endPos = dstPos + length >> 0; if (dstPos < dist || endPos > dd.hist.$length) { return 0; } dstBase = dstPos; srcPos = dstPos - dist >> 0; while (true) { if (!(dstPos < endPos)) { break; } dstPos = dstPos + ($copySlice($subslice(dd.hist, dstPos, endPos), $subslice(dd.hist, srcPos, dstPos))) >> 0; } dd.wrPos = dstPos; return dstPos - dstBase >> 0; }; dictDecoder.prototype.tryWriteCopy = function(dist, length) { return this.$val.tryWriteCopy(dist, length); }; dictDecoder.ptr.prototype.readFlush = function() { var _tmp, _tmp$1, dd, toRead; dd = this; toRead = $subslice(dd.hist, dd.rdPos, dd.wrPos); dd.rdPos = dd.wrPos; if (dd.wrPos === dd.hist.$length) { _tmp = 0; _tmp$1 = 0; dd.wrPos = _tmp; dd.rdPos = _tmp$1; dd.full = true; } return toRead; }; dictDecoder.prototype.readFlush = function() { return this.$val.readFlush(); }; CorruptInputError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; InternalError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$1.methods = [{prop: "init", name: "init", pkg: "compress/flate", typ: $funcType([sliceType$4], [$Bool], false)}]; ptrType$2.methods = [{prop: "nextBlock", name: "nextBlock", pkg: "compress/flate", typ: $funcType([], [], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$5], [$Int, $error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "readHuffman", name: "readHuffman", pkg: "compress/flate", typ: $funcType([], [$error], false)}, {prop: "huffmanBlock", name: "huffmanBlock", pkg: "compress/flate", typ: $funcType([], [], false)}, {prop: "dataBlock", name: "dataBlock", pkg: "compress/flate", typ: $funcType([], [], false)}, {prop: "copyData", name: "copyData", pkg: "compress/flate", typ: $funcType([], [], false)}, {prop: "finishBlock", name: "finishBlock", pkg: "compress/flate", typ: $funcType([], [], false)}, {prop: "moreBits", name: "moreBits", pkg: "compress/flate", typ: $funcType([], [$error], false)}, {prop: "huffSym", name: "huffSym", pkg: "compress/flate", typ: $funcType([ptrType$1], [$Int, $error], false)}, {prop: "Reset", name: "Reset", pkg: "", typ: $funcType([io.Reader, sliceType$5], [$error], false)}]; ptrType$15.methods = [{prop: "set", name: "set", pkg: "compress/flate", typ: $funcType([$Uint16, $Uint16], [], false)}]; ptrType.methods = [{prop: "bitLength", name: "bitLength", pkg: "compress/flate", typ: $funcType([sliceType$8], [$Int], false)}, {prop: "bitCounts", name: "bitCounts", pkg: "compress/flate", typ: $funcType([sliceType$7, $Int32], [sliceType$8], false)}, {prop: "assignEncodingAndSize", name: "assignEncodingAndSize", pkg: "compress/flate", typ: $funcType([sliceType$8, sliceType$7], [], false)}, {prop: "generate", name: "generate", pkg: "compress/flate", typ: $funcType([sliceType$8, $Int32], [], false)}]; byLiteral.methods = [{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)}]; ptrType$5.methods = [{prop: "sort", name: "sort", pkg: "compress/flate", typ: $funcType([sliceType$7], [], false)}]; byFreq.methods = [{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)}]; ptrType$6.methods = [{prop: "sort", name: "sort", pkg: "compress/flate", typ: $funcType([sliceType$7], [], false)}]; ptrType$16.methods = [{prop: "init", name: "init", pkg: "compress/flate", typ: $funcType([$Int, sliceType$5], [], false)}, {prop: "histSize", name: "histSize", pkg: "compress/flate", typ: $funcType([], [$Int], false)}, {prop: "availRead", name: "availRead", pkg: "compress/flate", typ: $funcType([], [$Int], false)}, {prop: "availWrite", name: "availWrite", pkg: "compress/flate", typ: $funcType([], [$Int], false)}, {prop: "writeSlice", name: "writeSlice", pkg: "compress/flate", typ: $funcType([], [sliceType$5], false)}, {prop: "writeMark", name: "writeMark", pkg: "compress/flate", typ: $funcType([$Int], [], false)}, {prop: "writeByte", name: "writeByte", pkg: "compress/flate", typ: $funcType([$Uint8], [], false)}, {prop: "writeCopy", name: "writeCopy", pkg: "compress/flate", typ: $funcType([$Int, $Int], [$Int], false)}, {prop: "tryWriteCopy", name: "tryWriteCopy", pkg: "compress/flate", typ: $funcType([$Int, $Int], [$Int], false)}, {prop: "readFlush", name: "readFlush", pkg: "compress/flate", typ: $funcType([], [sliceType$5], false)}]; Resetter.init([{prop: "Reset", name: "Reset", pkg: "", typ: $funcType([io.Reader, sliceType$5], [$error], false)}]); huffmanDecoder.init("compress/flate", [{prop: "min", name: "min", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "chunks", name: "chunks", embedded: false, exported: false, typ: arrayType, tag: ""}, {prop: "links", name: "links", embedded: false, exported: false, typ: sliceType$1, tag: ""}, {prop: "linkMask", name: "linkMask", embedded: false, exported: false, typ: $Uint32, tag: ""}]); Reader.init([{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$5], [$Int, $error], false)}, {prop: "ReadByte", name: "ReadByte", pkg: "", typ: $funcType([], [$Uint8, $error], false)}]); decompressor.init("compress/flate", [{prop: "r", name: "r", embedded: false, exported: false, typ: Reader, tag: ""}, {prop: "roffset", name: "roffset", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "b", name: "b", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "nb", name: "nb", embedded: false, exported: false, typ: $Uint, tag: ""}, {prop: "h1", name: "h1", embedded: false, exported: false, typ: huffmanDecoder, tag: ""}, {prop: "h2", name: "h2", embedded: false, exported: false, typ: huffmanDecoder, tag: ""}, {prop: "bits", name: "bits", embedded: false, exported: false, typ: ptrType$3, tag: ""}, {prop: "codebits", name: "codebits", embedded: false, exported: false, typ: ptrType$4, tag: ""}, {prop: "dict", name: "dict", embedded: false, exported: false, typ: dictDecoder, tag: ""}, {prop: "buf", name: "buf", embedded: false, exported: false, typ: arrayType$5, tag: ""}, {prop: "step", name: "step", embedded: false, exported: false, typ: funcType, tag: ""}, {prop: "stepState", name: "stepState", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "final$12", name: "final", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "toRead", name: "toRead", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "hl", name: "hl", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "hd", name: "hd", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "copyLen", name: "copyLen", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "copyDist", name: "copyDist", embedded: false, exported: false, typ: $Int, tag: ""}]); hcode.init("compress/flate", [{prop: "code", name: "code", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "len", name: "len", embedded: false, exported: false, typ: $Uint16, tag: ""}]); huffmanEncoder.init("compress/flate", [{prop: "codes", name: "codes", embedded: false, exported: false, typ: sliceType$6, tag: ""}, {prop: "freqcache", name: "freqcache", embedded: false, exported: false, typ: sliceType$7, tag: ""}, {prop: "bitCount", name: "bitCount", embedded: false, exported: false, typ: arrayType$6, tag: ""}, {prop: "lns", name: "lns", embedded: false, exported: false, typ: byLiteral, tag: ""}, {prop: "lfs", name: "lfs", embedded: false, exported: false, typ: byFreq, tag: ""}]); literalNode.init("compress/flate", [{prop: "literal", name: "literal", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "freq", name: "freq", embedded: false, exported: false, typ: $Int32, tag: ""}]); levelInfo.init("compress/flate", [{prop: "level", name: "level", embedded: false, exported: false, typ: $Int32, tag: ""}, {prop: "lastFreq", name: "lastFreq", embedded: false, exported: false, typ: $Int32, tag: ""}, {prop: "nextCharFreq", name: "nextCharFreq", embedded: false, exported: false, typ: $Int32, tag: ""}, {prop: "nextPairFreq", name: "nextPairFreq", embedded: false, exported: false, typ: $Int32, tag: ""}, {prop: "needed", name: "needed", embedded: false, exported: false, typ: $Int32, tag: ""}]); byLiteral.init(literalNode); byFreq.init(literalNode); dictDecoder.init("compress/flate", [{prop: "hist", name: "hist", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "wrPos", name: "wrPos", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "rdPos", name: "rdPos", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "full", name: "full", embedded: false, exported: false, 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 = bufio.$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 = math.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = bits.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sort.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strconv.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sync.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } fixedOnce = new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)); fixedHuffmanDecoder = new huffmanDecoder.ptr(0, arrayType.zero(), sliceType$1.nil, 0); huffOffset = ptrType.nil; codeOrder = $toNativeArray($kindInt, [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]); fixedLiteralEncoding = generateFixedLiteralEncoding(); fixedOffsetEncoding = generateFixedOffsetEncoding(); $r = init(); /* */ $s = 9; case 9: 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["hash"] = (function() { var $pkg = {}, $init, io, Hash, sliceType; io = $packages["io"]; Hash = $pkg.Hash = $newType(8, $kindInterface, "hash.Hash", true, "hash", true, 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["hash/crc32"] = (function() { var $pkg = {}, $init, errors, hash, sync, atomic, slicing8Table, Table, ptrType, ptrType$1, arrayType, arrayType$1, ptrType$2, castagnoliTable, updateCastagnoli, haveCastagnoli, haveCastagnoli$24ptr, ieeeTable8, ieeeArchImpl, updateIEEE, ieeeOnce, archAvailableIEEE, archInitIEEE, archUpdateIEEE, simpleMakeTable, simplePopulateTable, simpleUpdate, slicingMakeTable, slicingUpdate, ieeeInit, Update, ChecksumIEEE; errors = $packages["errors"]; hash = $packages["hash"]; sync = $packages["sync"]; atomic = $packages["sync/atomic"]; slicing8Table = $pkg.slicing8Table = $newType(8192, $kindArray, "crc32.slicing8Table", true, "hash/crc32", false, null); Table = $pkg.Table = $newType(1024, $kindArray, "crc32.Table", true, "hash/crc32", true, null); ptrType = $ptrType(Table); ptrType$1 = $ptrType(slicing8Table); arrayType = $arrayType($Uint32, 256); arrayType$1 = $arrayType(Table, 8); ptrType$2 = $ptrType($Uint32); archAvailableIEEE = function() { return false; }; archInitIEEE = function() { $panic(new $String("not available")); }; archUpdateIEEE = function(crc, p) { var crc, p; $panic(new $String("not available")); }; simpleMakeTable = function(poly) { var poly, t; t = arrayType.zero(); simplePopulateTable(poly, t); return t; }; simplePopulateTable = function(poly, t) { var crc, i, j, poly, t, y; i = 0; while (true) { if (!(i < 256)) { break; } crc = ((i >>> 0)); j = 0; while (true) { if (!(j < 8)) { break; } if (((crc & 1) >>> 0) === 1) { crc = (((crc >>> 1 >>> 0)) ^ poly) >>> 0; } else { crc = (y = (1), y < 32 ? (crc >>> y) : 0) >>> 0; } j = j + (1) >> 0; } t.nilCheck, ((i < 0 || i >= t.length) ? ($throwRuntimeError("index out of range"), undefined) : t[i] = crc); i = i + (1) >> 0; } }; simpleUpdate = function(crc, tab, p) { var _i, _ref, crc, p, tab, v, x, x$1; crc = ~crc >>> 0; _ref = p; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); crc = ((x = tab, x$1 = (((crc << 24 >>> 24)) ^ v) << 24 >>> 24, ((x$1 < 0 || x$1 >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[x$1])) ^ ((crc >>> 8 >>> 0))) >>> 0; _i++; } return ~crc >>> 0; }; slicingMakeTable = function(poly) { var crc, i, j, poly, t, x, x$1, x$2, x$3, x$4; t = arrayType$1.zero(); simplePopulateTable(poly, t[0]); i = 0; while (true) { if (!(i < 256)) { break; } crc = (x = t[0], ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i])); j = 1; while (true) { if (!(j < 8)) { break; } crc = ((x$1 = t[0], x$2 = (crc & 255) >>> 0, ((x$2 < 0 || x$2 >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[x$2])) ^ ((crc >>> 8 >>> 0))) >>> 0; (x$3 = (x$4 = t, ((j < 0 || j >= x$4.length) ? ($throwRuntimeError("index out of range"), undefined) : x$4[j])), ((i < 0 || i >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[i] = crc)); j = j + (1) >> 0; } i = i + (1) >> 0; } return t; }; slicingUpdate = function(crc, tab, p) { var crc, p, tab, 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; if (p.$length >= 16) { crc = ~crc >>> 0; while (true) { if (!(p.$length > 8)) { break; } crc = (crc ^ ((((((((((0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0]) >>> 0)) | ((((1 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 1]) >>> 0)) << 8 >>> 0)) >>> 0) | ((((2 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 2]) >>> 0)) << 16 >>> 0)) >>> 0) | ((((3 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 3]) >>> 0)) << 24 >>> 0)) >>> 0))) >>> 0; crc = ((((((((((((((x = tab[0], x$1 = (7 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 7]), ((x$1 < 0 || x$1 >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[x$1])) ^ (x$2 = tab[1], x$3 = (6 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 6]), ((x$3 < 0 || x$3 >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[x$3]))) >>> 0) ^ (x$4 = tab[2], x$5 = (5 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 5]), ((x$5 < 0 || x$5 >= x$4.length) ? ($throwRuntimeError("index out of range"), undefined) : x$4[x$5]))) >>> 0) ^ (x$6 = tab[3], x$7 = (4 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 4]), ((x$7 < 0 || x$7 >= x$6.length) ? ($throwRuntimeError("index out of range"), undefined) : x$6[x$7]))) >>> 0) ^ (x$8 = tab[4], x$9 = crc >>> 24 >>> 0, ((x$9 < 0 || x$9 >= x$8.length) ? ($throwRuntimeError("index out of range"), undefined) : x$8[x$9]))) >>> 0) ^ (x$10 = tab[5], x$11 = (((crc >>> 16 >>> 0)) & 255) >>> 0, ((x$11 < 0 || x$11 >= x$10.length) ? ($throwRuntimeError("index out of range"), undefined) : x$10[x$11]))) >>> 0) ^ (x$12 = tab[6], x$13 = (((crc >>> 8 >>> 0)) & 255) >>> 0, ((x$13 < 0 || x$13 >= x$12.length) ? ($throwRuntimeError("index out of range"), undefined) : x$12[x$13]))) >>> 0) ^ (x$14 = tab[7], x$15 = (crc & 255) >>> 0, ((x$15 < 0 || x$15 >= x$14.length) ? ($throwRuntimeError("index out of range"), undefined) : x$14[x$15]))) >>> 0; p = $subslice(p, 8); } crc = ~crc >>> 0; } if (p.$length === 0) { return crc; } return simpleUpdate(crc, tab[0], p); }; ieeeInit = function() { ieeeArchImpl = archAvailableIEEE(); if (ieeeArchImpl) { archInitIEEE(); updateIEEE = archUpdateIEEE; } else { ieeeTable8 = slicingMakeTable(3988292384); updateIEEE = (function(crc, p) { var crc, p; return slicingUpdate(crc, ieeeTable8, p); }); } }; Update = function(crc, tab, p) { var $24r, $24r$1, _r, _r$1, crc, p, tab, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; _r$1 = $f._r$1; crc = $f.crc; p = $f.p; tab = $f.tab; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (!((atomic.LoadUint32((haveCastagnoli$24ptr || (haveCastagnoli$24ptr = new ptrType$2(function() { return haveCastagnoli; }, function($v) { haveCastagnoli = $v; })))) === 0)) && tab === castagnoliTable) { $s = 2; continue; } /* */ if (tab === $pkg.IEEETable) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!((atomic.LoadUint32((haveCastagnoli$24ptr || (haveCastagnoli$24ptr = new ptrType$2(function() { return haveCastagnoli; }, function($v) { haveCastagnoli = $v; })))) === 0)) && tab === castagnoliTable) { */ case 2: _r = updateCastagnoli(crc, p); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 7; case 7: return $24r; /* } else if (tab === $pkg.IEEETable) { */ case 3: $r = ieeeOnce.Do(ieeeInit); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = updateIEEE(crc, p); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r$1 = _r$1; $s = 10; case 10: return $24r$1; /* } else { */ case 4: $s = -1; return simpleUpdate(crc, tab, p); /* } */ case 5: case 1: $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: Update }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f._r$1 = _r$1; $f.crc = crc; $f.p = p; $f.tab = tab; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Update = Update; ChecksumIEEE = function(data) { var $24r, _r, data, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; data = $f.data; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = ieeeOnce.Do(ieeeInit); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r = updateIEEE(0, data); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: ChecksumIEEE }; } $f.$24r = $24r; $f._r = _r; $f.data = data; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.ChecksumIEEE = ChecksumIEEE; slicing8Table.init(Table, 8); Table.init($Uint32, 256); $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 = hash.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sync.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = atomic.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } castagnoliTable = ptrType.nil; updateCastagnoli = $throwNilPointerError; haveCastagnoli = 0; ieeeTable8 = ptrType$1.nil; ieeeArchImpl = false; updateIEEE = $throwNilPointerError; ieeeOnce = new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)); $pkg.IEEETable = simpleMakeTable(3988292384); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["compress/gzip"] = (function() { var $pkg = {}, $init, bufio, flate, binary, errors, fmt, crc32, io, time, Header, Reader, sliceType$1, ptrType$1, arrayType$1, ptrType$3, sliceType$2, le, noEOF, NewReader; bufio = $packages["bufio"]; flate = $packages["compress/flate"]; binary = $packages["encoding/binary"]; errors = $packages["errors"]; fmt = $packages["fmt"]; crc32 = $packages["hash/crc32"]; io = $packages["io"]; time = $packages["time"]; Header = $pkg.Header = $newType(0, $kindStruct, "gzip.Header", true, "compress/gzip", true, function(Comment_, Extra_, ModTime_, Name_, OS_) { this.$val = this; if (arguments.length === 0) { this.Comment = ""; this.Extra = sliceType$1.nil; this.ModTime = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$1.nil); this.Name = ""; this.OS = 0; return; } this.Comment = Comment_; this.Extra = Extra_; this.ModTime = ModTime_; this.Name = Name_; this.OS = OS_; }); Reader = $pkg.Reader = $newType(0, $kindStruct, "gzip.Reader", true, "compress/gzip", true, function(Header_, r_, decompressor_, digest_, size_, buf_, err_, multistream_) { this.$val = this; if (arguments.length === 0) { this.Header = new Header.ptr("", sliceType$1.nil, new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$1.nil), "", 0); this.r = $ifaceNil; this.decompressor = $ifaceNil; this.digest = 0; this.size = 0; this.buf = arrayType$1.zero(); this.err = $ifaceNil; this.multistream = false; return; } this.Header = Header_; this.r = r_; this.decompressor = decompressor_; this.digest = digest_; this.size = size_; this.buf = buf_; this.err = err_; this.multistream = multistream_; }); sliceType$1 = $sliceType($Uint8); ptrType$1 = $ptrType(time.Location); arrayType$1 = $arrayType($Uint8, 512); ptrType$3 = $ptrType(Reader); sliceType$2 = $sliceType($Int32); noEOF = function(err) { var err; if ($interfaceIsEqual(err, io.EOF)) { return io.ErrUnexpectedEOF; } return err; }; NewReader = function(r) { var _r, err, r, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; err = $f.err; r = $f.r; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = new Reader.ptr(new Header.ptr("", sliceType$1.nil, new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$1.nil), "", 0), $ifaceNil, $ifaceNil, 0, 0, arrayType$1.zero(), $ifaceNil, false); _r = z.Reset(r); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$3.nil, err]; } $s = -1; return [z, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: NewReader }; } $f._r = _r; $f.err = err; $f.r = r; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.NewReader = NewReader; Reader.ptr.prototype.Reset = function(r) { var _r, _tuple, _tuple$1, ok, r, rr, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; ok = $f.ok; r = $f.r; rr = $f.rr; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; Reader.copy(z, new Reader.ptr(new Header.ptr("", sliceType$1.nil, new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$1.nil), "", 0), $ifaceNil, z.decompressor, 0, 0, arrayType$1.zero(), $ifaceNil, true)); _tuple = $assertType(r, flate.Reader, true); rr = _tuple[0]; ok = _tuple[1]; if (ok) { z.r = rr; } else { z.r = bufio.NewReader(r); } _r = z.readHeader(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple$1 = _r; Header.copy(z.Header, _tuple$1[0]); z.err = _tuple$1[1]; $s = -1; return z.err; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.Reset }; } $f._r = _r; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.ok = ok; $f.r = r; $f.rr = rr; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.Reset = function(r) { return this.$val.Reset(r); }; Reader.ptr.prototype.Multistream = function(ok) { var ok, z; z = this; z.multistream = ok; }; Reader.prototype.Multistream = function(ok) { return this.$val.Multistream(ok); }; Reader.ptr.prototype.readString = function() { var _i, _r, _r$1, _ref, _tuple, err, i, needConv, s, v, x, x$1, x$2, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; _tuple = $f._tuple; err = $f.err; i = $f.i; needConv = $f.needConv; s = $f.s; v = $f.v; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; err = $ifaceNil; needConv = false; i = 0; /* while (true) { */ case 1: if (i >= 512) { $s = -1; return ["", $pkg.ErrHeader]; } _r = z.r.ReadByte(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; (x = z.buf, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i] = _tuple[0])); err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return ["", err]; } if ((x$1 = z.buf, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i])) > 127) { needConv = true; } /* */ if ((x$2 = z.buf, ((i < 0 || i >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i])) === 0) { $s = 4; continue; } /* */ $s = 5; continue; /* if ((x$2 = z.buf, ((i < 0 || i >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i])) === 0) { */ case 4: _r$1 = crc32.Update(z.digest, crc32.IEEETable, $subslice(new sliceType$1(z.buf), 0, (i + 1 >> 0))); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } z.digest = _r$1; if (needConv) { s = $makeSlice(sliceType$2, 0, i); _ref = $subslice(new sliceType$1(z.buf), 0, i); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); s = $append(s, ((v >> 0))); _i++; } $s = -1; return [($runesToString(s)), $ifaceNil]; } $s = -1; return [($bytesToString($subslice(new sliceType$1(z.buf), 0, i))), $ifaceNil]; /* } */ case 5: i = i + (1) >> 0; $s = 1; continue; case 2: $s = -1; return ["", $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.readString }; } $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f._tuple = _tuple; $f.err = err; $f.i = i; $f.needConv = needConv; $f.s = s; $f.v = v; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.readString = function() { return this.$val.readString(); }; Reader.ptr.prototype.readHeader = function() { var _r, _r$1, _r$10, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _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, _tuple$3, _tuple$4, _tuple$5, data, digest, err, flg, hdr, s, t, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$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; _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$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; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _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; data = $f.data; digest = $f.digest; err = $f.err; flg = $f.flg; hdr = $f.hdr; s = $f.s; t = $f.t; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hdr = new Header.ptr("", sliceType$1.nil, new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$1.nil), "", 0); err = $ifaceNil; z = this; _r = io.ReadFull(z.r, $subslice(new sliceType$1(z.buf), 0, 10)); /* */ $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))) { _tmp = $clone(hdr, Header); _tmp$1 = err; Header.copy(hdr, _tmp); err = _tmp$1; $s = -1; return [hdr, err]; } if (!((z.buf[0] === 31)) || !((z.buf[1] === 139)) || !((z.buf[2] === 8))) { _tmp$2 = $clone(hdr, Header); _tmp$3 = $pkg.ErrHeader; Header.copy(hdr, _tmp$2); err = _tmp$3; $s = -1; return [hdr, err]; } flg = z.buf[3]; t = (new $Int64(0, $clone(le, binary.littleEndian).Uint32($subslice(new sliceType$1(z.buf), 4, 8)))); if ((t.$high > 0 || (t.$high === 0 && t.$low > 0))) { time.Time.copy(hdr.ModTime, time.Unix(t, new $Int64(0, 0))); } hdr.OS = z.buf[9]; _r$1 = crc32.ChecksumIEEE($subslice(new sliceType$1(z.buf), 0, 10)); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } z.digest = _r$1; /* */ if (!((((flg & 4) >>> 0) === 0))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!((((flg & 4) >>> 0) === 0))) { */ case 3: _r$2 = io.ReadFull(z.r, $subslice(new sliceType$1(z.buf), 0, 2)); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$4 = $clone(hdr, Header); _tmp$5 = noEOF(err); Header.copy(hdr, _tmp$4); err = _tmp$5; $s = -1; return [hdr, err]; } _r$3 = crc32.Update(z.digest, crc32.IEEETable, $subslice(new sliceType$1(z.buf), 0, 2)); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } z.digest = _r$3; data = $makeSlice(sliceType$1, $clone(le, binary.littleEndian).Uint16($subslice(new sliceType$1(z.buf), 0, 2))); _r$4 = io.ReadFull(z.r, data); /* */ $s = 7; case 7: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$2 = _r$4; err = _tuple$2[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$6 = $clone(hdr, Header); _tmp$7 = noEOF(err); Header.copy(hdr, _tmp$6); err = _tmp$7; $s = -1; return [hdr, err]; } _r$5 = crc32.Update(z.digest, crc32.IEEETable, data); /* */ $s = 8; case 8: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } z.digest = _r$5; hdr.Extra = data; /* } */ case 4: s = ""; /* */ if (!((((flg & 8) >>> 0) === 0))) { $s = 9; continue; } /* */ $s = 10; continue; /* if (!((((flg & 8) >>> 0) === 0))) { */ case 9: _r$6 = z.readString(); /* */ $s = 11; case 11: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tuple$3 = _r$6; s = _tuple$3[0]; err = _tuple$3[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$8 = $clone(hdr, Header); _tmp$9 = err; Header.copy(hdr, _tmp$8); err = _tmp$9; $s = -1; return [hdr, err]; } hdr.Name = s; /* } */ case 10: /* */ if (!((((flg & 16) >>> 0) === 0))) { $s = 12; continue; } /* */ $s = 13; continue; /* if (!((((flg & 16) >>> 0) === 0))) { */ case 12: _r$7 = z.readString(); /* */ $s = 14; case 14: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _tuple$4 = _r$7; s = _tuple$4[0]; err = _tuple$4[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$10 = $clone(hdr, Header); _tmp$11 = err; Header.copy(hdr, _tmp$10); err = _tmp$11; $s = -1; return [hdr, err]; } hdr.Comment = s; /* } */ case 13: /* */ if (!((((flg & 2) >>> 0) === 0))) { $s = 15; continue; } /* */ $s = 16; continue; /* if (!((((flg & 2) >>> 0) === 0))) { */ case 15: _r$8 = io.ReadFull(z.r, $subslice(new sliceType$1(z.buf), 0, 2)); /* */ $s = 17; case 17: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _tuple$5 = _r$8; err = _tuple$5[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$12 = $clone(hdr, Header); _tmp$13 = noEOF(err); Header.copy(hdr, _tmp$12); err = _tmp$13; $s = -1; return [hdr, err]; } digest = $clone(le, binary.littleEndian).Uint16($subslice(new sliceType$1(z.buf), 0, 2)); if (!((digest === ((z.digest << 16 >>> 16))))) { _tmp$14 = $clone(hdr, Header); _tmp$15 = $pkg.ErrHeader; Header.copy(hdr, _tmp$14); err = _tmp$15; $s = -1; return [hdr, err]; } /* } */ case 16: z.digest = 0; /* */ if ($interfaceIsEqual(z.decompressor, $ifaceNil)) { $s = 18; continue; } /* */ $s = 19; continue; /* if ($interfaceIsEqual(z.decompressor, $ifaceNil)) { */ case 18: _r$9 = flate.NewReader(z.r); /* */ $s = 21; case 21: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } z.decompressor = _r$9; $s = 20; continue; /* } else { */ case 19: _r$10 = $assertType(z.decompressor, flate.Resetter).Reset(z.r, sliceType$1.nil); /* */ $s = 22; case 22: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; /* } */ case 20: _tmp$16 = $clone(hdr, Header); _tmp$17 = $ifaceNil; Header.copy(hdr, _tmp$16); err = _tmp$17; $s = -1; return [hdr, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.readHeader }; } $f._r = _r; $f._r$1 = _r$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._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$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._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $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.data = data; $f.digest = digest; $f.err = err; $f.flg = flg; $f.hdr = hdr; $f.s = s; $f.t = t; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.readHeader = function() { return this.$val.readHeader(); }; Reader.ptr.prototype.Read = function(p) { var $24r, _r, _r$1, _r$2, _r$3, _r$4, _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, _tuple, _tuple$1, _tuple$2, _tuple$3, digest, err, err$1, n, p, size, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _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$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; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; digest = $f.digest; err = $f.err; err$1 = $f.err$1; n = $f.n; p = $f.p; size = $f.size; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; z = this; if (!($interfaceIsEqual(z.err, $ifaceNil))) { _tmp = 0; _tmp$1 = z.err; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } _r = z.decompressor.Read(p); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; z.err = _tuple[1]; _r$1 = crc32.Update(z.digest, crc32.IEEETable, $subslice(p, 0, n)); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } z.digest = _r$1; z.size = z.size + (((n >>> 0))) >>> 0; if (!($interfaceIsEqual(z.err, io.EOF))) { _tmp$2 = n; _tmp$3 = z.err; n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; } _r$2 = io.ReadFull(z.r, $subslice(new sliceType$1(z.buf), 0, 8)); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { z.err = noEOF(err$1); _tmp$4 = n; _tmp$5 = z.err; n = _tmp$4; err = _tmp$5; $s = -1; return [n, err]; } digest = $clone(le, binary.littleEndian).Uint32($subslice(new sliceType$1(z.buf), 0, 4)); size = $clone(le, binary.littleEndian).Uint32($subslice(new sliceType$1(z.buf), 4, 8)); if (!((digest === z.digest)) || !((size === z.size))) { z.err = $pkg.ErrChecksum; _tmp$6 = n; _tmp$7 = z.err; n = _tmp$6; err = _tmp$7; $s = -1; return [n, err]; } _tmp$8 = 0; _tmp$9 = 0; z.digest = _tmp$8; z.size = _tmp$9; if (!z.multistream) { _tmp$10 = n; _tmp$11 = io.EOF; n = _tmp$10; err = _tmp$11; $s = -1; return [n, err]; } z.err = $ifaceNil; _r$3 = z.readHeader(); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$2 = _r$3; z.err = _tuple$2[1]; if (!($interfaceIsEqual(z.err, $ifaceNil))) { _tmp$12 = n; _tmp$13 = z.err; n = _tmp$12; err = _tmp$13; $s = -1; return [n, err]; } if (n > 0) { _tmp$14 = n; _tmp$15 = $ifaceNil; n = _tmp$14; err = _tmp$15; $s = -1; return [n, err]; } _r$4 = z.Read(p); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$3 = _r$4; n = _tuple$3[0]; err = _tuple$3[1]; $24r = [n, err]; $s = 6; case 6: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.Read }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $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$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._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.digest = digest; $f.err = err; $f.err$1 = err$1; $f.n = n; $f.p = p; $f.size = size; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.Read = function(p) { return this.$val.Read(p); }; Reader.ptr.prototype.Close = function() { var $24r, _r, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; _r = z.decompressor.Close(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.Close }; } $f.$24r = $24r; $f._r = _r; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.Close = function() { return this.$val.Close(); }; ptrType$3.methods = [{prop: "Reset", name: "Reset", pkg: "", typ: $funcType([io.Reader], [$error], false)}, {prop: "Multistream", name: "Multistream", pkg: "", typ: $funcType([$Bool], [], false)}, {prop: "readString", name: "readString", pkg: "compress/gzip", typ: $funcType([], [$String, $error], false)}, {prop: "readHeader", name: "readHeader", pkg: "compress/gzip", typ: $funcType([], [Header, $error], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}]; Header.init("", [{prop: "Comment", name: "Comment", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Extra", name: "Extra", embedded: false, exported: true, typ: sliceType$1, tag: ""}, {prop: "ModTime", name: "ModTime", embedded: false, exported: true, typ: time.Time, tag: ""}, {prop: "Name", name: "Name", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "OS", name: "OS", embedded: false, exported: true, typ: $Uint8, tag: ""}]); Reader.init("compress/gzip", [{prop: "Header", name: "Header", embedded: true, exported: true, typ: Header, tag: ""}, {prop: "r", name: "r", embedded: false, exported: false, typ: flate.Reader, tag: ""}, {prop: "decompressor", name: "decompressor", embedded: false, exported: false, typ: io.ReadCloser, tag: ""}, {prop: "digest", name: "digest", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "size", name: "size", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "buf", name: "buf", embedded: false, exported: false, typ: arrayType$1, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "multistream", name: "multistream", embedded: false, exported: false, 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 = bufio.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = flate.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = binary.$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 = crc32.$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 = time.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $pkg.ErrChecksum = errors.New("gzip: invalid checksum"); $pkg.ErrHeader = errors.New("gzip: invalid header"); le = $clone(binary.LittleEndian, binary.littleEndian); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["container/list"] = (function() { var $pkg = {}, $init, Element, List, ptrType, ptrType$1, New; Element = $pkg.Element = $newType(0, $kindStruct, "list.Element", true, "container/list", true, function(next_, prev_, list_, Value_) { this.$val = this; if (arguments.length === 0) { this.next = ptrType$1.nil; this.prev = ptrType$1.nil; this.list = ptrType.nil; this.Value = $ifaceNil; return; } this.next = next_; this.prev = prev_; this.list = list_; this.Value = Value_; }); List = $pkg.List = $newType(0, $kindStruct, "list.List", true, "container/list", true, function(root_, len_) { this.$val = this; if (arguments.length === 0) { this.root = new Element.ptr(ptrType$1.nil, ptrType$1.nil, ptrType.nil, $ifaceNil); this.len = 0; return; } this.root = root_; this.len = len_; }); ptrType = $ptrType(List); ptrType$1 = $ptrType(Element); Element.ptr.prototype.Next = function() { var e, p; e = this; p = e.next; if (!(e.list === ptrType.nil) && !(p === e.list.root)) { return p; } return ptrType$1.nil; }; Element.prototype.Next = function() { return this.$val.Next(); }; Element.ptr.prototype.Prev = function() { var e, p; e = this; p = e.prev; if (!(e.list === ptrType.nil) && !(p === e.list.root)) { return p; } return ptrType$1.nil; }; Element.prototype.Prev = function() { return this.$val.Prev(); }; List.ptr.prototype.Init = function() { var l; l = this; l.root.next = l.root; l.root.prev = l.root; l.len = 0; return l; }; List.prototype.Init = function() { return this.$val.Init(); }; New = function() { return new List.ptr(new Element.ptr(ptrType$1.nil, ptrType$1.nil, ptrType.nil, $ifaceNil), 0).Init(); }; $pkg.New = New; List.ptr.prototype.Len = function() { var l; l = this; return l.len; }; List.prototype.Len = function() { return this.$val.Len(); }; List.ptr.prototype.Front = function() { var l; l = this; if (l.len === 0) { return ptrType$1.nil; } return l.root.next; }; List.prototype.Front = function() { return this.$val.Front(); }; List.ptr.prototype.Back = function() { var l; l = this; if (l.len === 0) { return ptrType$1.nil; } return l.root.prev; }; List.prototype.Back = function() { return this.$val.Back(); }; List.ptr.prototype.lazyInit = function() { var l; l = this; if (l.root.next === ptrType$1.nil) { l.Init(); } }; List.prototype.lazyInit = function() { return this.$val.lazyInit(); }; List.ptr.prototype.insert = function(e, at) { var at, e, l; l = this; e.prev = at; e.next = at.next; e.prev.next = e; e.next.prev = e; e.list = l; l.len = l.len + (1) >> 0; return e; }; List.prototype.insert = function(e, at) { return this.$val.insert(e, at); }; List.ptr.prototype.insertValue = function(v, at) { var at, l, v; l = this; return l.insert(new Element.ptr(ptrType$1.nil, ptrType$1.nil, ptrType.nil, v), at); }; List.prototype.insertValue = function(v, at) { return this.$val.insertValue(v, at); }; List.ptr.prototype.remove = function(e) { var e, l; l = this; e.prev.next = e.next; e.next.prev = e.prev; e.next = ptrType$1.nil; e.prev = ptrType$1.nil; e.list = ptrType.nil; l.len = l.len - (1) >> 0; return e; }; List.prototype.remove = function(e) { return this.$val.remove(e); }; List.ptr.prototype.move = function(e, at) { var at, e, l; l = this; if (e === at) { return e; } e.prev.next = e.next; e.next.prev = e.prev; e.prev = at; e.next = at.next; e.prev.next = e; e.next.prev = e; return e; }; List.prototype.move = function(e, at) { return this.$val.move(e, at); }; List.ptr.prototype.Remove = function(e) { var e, l; l = this; if (e.list === l) { l.remove(e); } return e.Value; }; List.prototype.Remove = function(e) { return this.$val.Remove(e); }; List.ptr.prototype.PushFront = function(v) { var l, v; l = this; l.lazyInit(); return l.insertValue(v, l.root); }; List.prototype.PushFront = function(v) { return this.$val.PushFront(v); }; List.ptr.prototype.PushBack = function(v) { var l, v; l = this; l.lazyInit(); return l.insertValue(v, l.root.prev); }; List.prototype.PushBack = function(v) { return this.$val.PushBack(v); }; List.ptr.prototype.InsertBefore = function(v, mark) { var l, mark, v; l = this; if (!(mark.list === l)) { return ptrType$1.nil; } return l.insertValue(v, mark.prev); }; List.prototype.InsertBefore = function(v, mark) { return this.$val.InsertBefore(v, mark); }; List.ptr.prototype.InsertAfter = function(v, mark) { var l, mark, v; l = this; if (!(mark.list === l)) { return ptrType$1.nil; } return l.insertValue(v, mark); }; List.prototype.InsertAfter = function(v, mark) { return this.$val.InsertAfter(v, mark); }; List.ptr.prototype.MoveToFront = function(e) { var e, l; l = this; if (!(e.list === l) || l.root.next === e) { return; } l.move(e, l.root); }; List.prototype.MoveToFront = function(e) { return this.$val.MoveToFront(e); }; List.ptr.prototype.MoveToBack = function(e) { var e, l; l = this; if (!(e.list === l) || l.root.prev === e) { return; } l.move(e, l.root.prev); }; List.prototype.MoveToBack = function(e) { return this.$val.MoveToBack(e); }; List.ptr.prototype.MoveBefore = function(e, mark) { var e, l, mark; l = this; if (!(e.list === l) || e === mark || !(mark.list === l)) { return; } l.move(e, mark.prev); }; List.prototype.MoveBefore = function(e, mark) { return this.$val.MoveBefore(e, mark); }; List.ptr.prototype.MoveAfter = function(e, mark) { var e, l, mark; l = this; if (!(e.list === l) || e === mark || !(mark.list === l)) { return; } l.move(e, mark); }; List.prototype.MoveAfter = function(e, mark) { return this.$val.MoveAfter(e, mark); }; List.ptr.prototype.PushBackList = function(other) { var _tmp, _tmp$1, _tmp$2, _tmp$3, e, i, l, other; l = this; l.lazyInit(); _tmp = other.Len(); _tmp$1 = other.Front(); i = _tmp; e = _tmp$1; while (true) { if (!(i > 0)) { break; } l.insertValue(e.Value, l.root.prev); _tmp$2 = i - 1 >> 0; _tmp$3 = e.Next(); i = _tmp$2; e = _tmp$3; } }; List.prototype.PushBackList = function(other) { return this.$val.PushBackList(other); }; List.ptr.prototype.PushFrontList = function(other) { var _tmp, _tmp$1, _tmp$2, _tmp$3, e, i, l, other; l = this; l.lazyInit(); _tmp = other.Len(); _tmp$1 = other.Back(); i = _tmp; e = _tmp$1; while (true) { if (!(i > 0)) { break; } l.insertValue(e.Value, l.root); _tmp$2 = i - 1 >> 0; _tmp$3 = e.Prev(); i = _tmp$2; e = _tmp$3; } }; List.prototype.PushFrontList = function(other) { return this.$val.PushFrontList(other); }; ptrType$1.methods = [{prop: "Next", name: "Next", pkg: "", typ: $funcType([], [ptrType$1], false)}, {prop: "Prev", name: "Prev", pkg: "", typ: $funcType([], [ptrType$1], false)}]; ptrType.methods = [{prop: "Init", name: "Init", pkg: "", typ: $funcType([], [ptrType], false)}, {prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Front", name: "Front", pkg: "", typ: $funcType([], [ptrType$1], false)}, {prop: "Back", name: "Back", pkg: "", typ: $funcType([], [ptrType$1], false)}, {prop: "lazyInit", name: "lazyInit", pkg: "container/list", typ: $funcType([], [], false)}, {prop: "insert", name: "insert", pkg: "container/list", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "insertValue", name: "insertValue", pkg: "container/list", typ: $funcType([$emptyInterface, ptrType$1], [ptrType$1], false)}, {prop: "remove", name: "remove", pkg: "container/list", typ: $funcType([ptrType$1], [ptrType$1], false)}, {prop: "move", name: "move", pkg: "container/list", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "Remove", name: "Remove", pkg: "", typ: $funcType([ptrType$1], [$emptyInterface], false)}, {prop: "PushFront", name: "PushFront", pkg: "", typ: $funcType([$emptyInterface], [ptrType$1], false)}, {prop: "PushBack", name: "PushBack", pkg: "", typ: $funcType([$emptyInterface], [ptrType$1], false)}, {prop: "InsertBefore", name: "InsertBefore", pkg: "", typ: $funcType([$emptyInterface, ptrType$1], [ptrType$1], false)}, {prop: "InsertAfter", name: "InsertAfter", pkg: "", typ: $funcType([$emptyInterface, ptrType$1], [ptrType$1], false)}, {prop: "MoveToFront", name: "MoveToFront", pkg: "", typ: $funcType([ptrType$1], [], false)}, {prop: "MoveToBack", name: "MoveToBack", pkg: "", typ: $funcType([ptrType$1], [], false)}, {prop: "MoveBefore", name: "MoveBefore", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [], false)}, {prop: "MoveAfter", name: "MoveAfter", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [], false)}, {prop: "PushBackList", name: "PushBackList", pkg: "", typ: $funcType([ptrType], [], false)}, {prop: "PushFrontList", name: "PushFrontList", pkg: "", typ: $funcType([ptrType], [], false)}]; Element.init("container/list", [{prop: "next", name: "next", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "prev", name: "prev", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "list", name: "list", embedded: false, exported: false, typ: ptrType, tag: ""}, {prop: "Value", name: "Value", embedded: false, exported: true, typ: $emptyInterface, tag: ""}]); List.init("container/list", [{prop: "root", name: "root", embedded: false, exported: false, typ: Element, tag: ""}, {prop: "len", name: "len", embedded: false, exported: false, 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: /* */ } 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, rngSource, Source, Source64, Rand, lockedSource, ptrType, ptrType$1, ptrType$2, arrayType, ptrType$4, sliceType, ptrType$5, funcType, sliceType$1, rngCooked, globalRand, kn, wn, fn, ke, we, fe, seedrand, NewSource, New, read, Intn, Float64, absInt32; nosync = $packages["github.com/gopherjs/gopherjs/nosync"]; math = $packages["math"]; rngSource = $pkg.rngSource = $newType(0, $kindStruct, "rand.rngSource", true, "math/rand", false, 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_; }); Source = $pkg.Source = $newType(8, $kindInterface, "rand.Source", true, "math/rand", true, null); Source64 = $pkg.Source64 = $newType(8, $kindInterface, "rand.Source64", true, "math/rand", true, null); Rand = $pkg.Rand = $newType(0, $kindStruct, "rand.Rand", true, "math/rand", true, function(src_, s64_, readVal_, readPos_) { this.$val = this; if (arguments.length === 0) { this.src = $ifaceNil; this.s64 = $ifaceNil; this.readVal = new $Int64(0, 0); this.readPos = 0; return; } this.src = src_; this.s64 = s64_; this.readVal = readVal_; this.readPos = readPos_; }); lockedSource = $pkg.lockedSource = $newType(0, $kindStruct, "rand.lockedSource", true, "math/rand", false, function(lk_, src_) { this.$val = this; if (arguments.length === 0) { this.lk = new nosync.Mutex.ptr(false); this.src = ptrType.nil; return; } this.lk = lk_; this.src = src_; }); ptrType = $ptrType(rngSource); ptrType$1 = $ptrType(lockedSource); ptrType$2 = $ptrType(Rand); arrayType = $arrayType($Int64, 607); ptrType$4 = $ptrType($Int8); sliceType = $sliceType($Int); ptrType$5 = $ptrType($Int64); funcType = $funcType([$Int, $Int], [], false); sliceType$1 = $sliceType($Uint8); seedrand = function(x) { var _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 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 >= rngCooked.length) ? ($throwRuntimeError("index out of range"), undefined) : rngCooked[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"), undefined) : x$5[i] = u)); } i = i + (1) >> 0; } }; rngSource.prototype.Seed = function(seed) { return this.$val.Seed(seed); }; rngSource.ptr.prototype.Int63 = function() { var rng, x, x$1; rng = this; return ((x = (x$1 = rng.Uint64(), new $Uint64(x$1.$high & 2147483647, (x$1.$low & 4294967295) >>> 0)), new $Int64(x.$high, x.$low))); }; rngSource.prototype.Int63 = function() { return this.$val.Int63(); }; rngSource.ptr.prototype.Uint64 = function() { var rng, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8; 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$6 = (x = (x$1 = rng.vec, x$2 = rng.feed, ((x$2 < 0 || x$2 >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[x$2])), x$3 = (x$4 = rng.vec, x$5 = rng.tap, ((x$5 < 0 || x$5 >= x$4.length) ? ($throwRuntimeError("index out of range"), undefined) : x$4[x$5])), new $Int64(x.$high + x$3.$high, x.$low + x$3.$low)); (x$7 = rng.vec, x$8 = rng.feed, ((x$8 < 0 || x$8 >= x$7.length) ? ($throwRuntimeError("index out of range"), undefined) : x$7[x$8] = x$6)); return (new $Uint64(x$6.$high, x$6.$low)); }; rngSource.prototype.Uint64 = function() { return this.$val.Uint64(); }; NewSource = function(seed) { var rng, seed; rng = new rngSource.ptr(0, 0, arrayType.zero()); rng.Seed(seed); return rng; }; $pkg.NewSource = NewSource; New = function(src) { var _tuple, s64, src; _tuple = $assertType(src, Source64, true); s64 = _tuple[0]; return new Rand.ptr(src, s64, new $Int64(0, 0), 0); }; $pkg.New = New; Rand.ptr.prototype.Seed = function(seed) { var _tuple, lk, ok, r, seed, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; lk = $f.lk; ok = $f.ok; r = $f.r; seed = $f.seed; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _tuple = $assertType(r.src, ptrType$1, true); lk = _tuple[0]; ok = _tuple[1]; if (ok) { lk.seedPos(seed, (r.$ptr_readPos || (r.$ptr_readPos = new ptrType$4(function() { return this.$target.readPos; }, function($v) { this.$target.readPos = $v; }, r)))); $s = -1; return; } $r = r.src.Seed(seed); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } r.readPos = 0; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Seed }; } $f._tuple = _tuple; $f.lk = lk; $f.ok = ok; $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 $24r, _r, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Int63 }; } $f.$24r = $24r; $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 $24r, _r, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; } $24r = (($shiftRightInt64(_r, 31).$low >>> 0)); $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Uint32 }; } $f.$24r = $24r; $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.Uint64 = function() { var $24r, $24r$1, _r, _r$1, _r$2, r, 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; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; r = $f.r; 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: r = this; /* */ if (!($interfaceIsEqual(r.s64, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(r.s64, $ifaceNil))) { */ case 1: _r = r.s64.Uint64(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 4; case 4: return $24r; /* } */ case 2: _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; } _r$2 = r.Int63(); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r$1 = (x = $shiftRightUint64(((x$1 = _r$1, new $Uint64(x$1.$high, x$1.$low))), 31), x$2 = $shiftLeft64(((x$3 = _r$2, new $Uint64(x$3.$high, x$3.$low))), 32), new $Uint64(x.$high | x$2.$high, (x.$low | x$2.$low) >>> 0)); $s = 7; case 7: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Uint64 }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.r = r; $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; }; Rand.prototype.Uint64 = function() { return this.$val.Uint64(); }; Rand.ptr.prototype.Int31 = function() { var $24r, _r, r, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; } $24r = (((x = $shiftRightInt64(_r, 32), x.$low + ((x.$high >> 31) * 4294967296)) >> 0)); $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Int31 }; } $f.$24r = $24r; $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 _r, r, u, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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)); $s = -1; return ((((u << 1 >>> 0) >>> 1 >>> 0) >> 0)); /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Int }; } $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 $24r, _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; $24r = $f.$24r; _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; } $24r = (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)); $s = 4; case 4: return $24r; /* } */ 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: $s = -1; return $div64(v, n, true); /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Int63n }; } $f.$24r = $24r; $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 $24r, _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; $24r = $f.$24r; _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; } $24r = _r & ((n - 1 >> 0)); $s = 4; case 4: return $24r; /* } */ 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: $s = -1; 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.$24r = $24r; $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.int31n = function(n) { var _r, _r$1, _r$2, low, n, prod, r, thresh, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; low = $f.low; n = $f.n; prod = $f.prod; r = $f.r; thresh = $f.thresh; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r = r.Uint32(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } v = _r; prod = $mul64((new $Uint64(0, v)), (new $Uint64(0, n))); low = ((prod.$low >>> 0)); /* */ if (low < ((n >>> 0))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (low < ((n >>> 0))) { */ case 2: thresh = (_r$1 = ((-n >>> 0)) % ((n >>> 0)), _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")); /* while (true) { */ case 4: /* if (!(low < thresh)) { break; } */ if(!(low < thresh)) { $s = 5; continue; } _r$2 = r.Uint32(); /* */ $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; prod = $mul64((new $Uint64(0, v)), (new $Uint64(0, n))); low = ((prod.$low >>> 0)); $s = 4; continue; case 5: /* } */ case 3: $s = -1; return (($shiftRightUint64(prod, 32).$low >> 0)); /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.int31n }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.low = low; $f.n = n; $f.prod = prod; $f.r = r; $f.thresh = thresh; $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 $24r, $24r$1, _r, _r$1, n, r, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _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; } $24r = ((_r >> 0)); $s = 4; case 4: return $24r; /* } */ 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; } $24r$1 = (((x = _r$1, x.$low + ((x.$high >> 31) * 4294967296)) >> 0)); $s = 6; case 6: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Intn }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $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 _r, f, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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: $s = -1; return f; /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Float64 }; } $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 _r, f, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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: $s = -1; return f; /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Float32 }; } $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 _r, i, j, m, n, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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"), undefined) : m.$array[m.$offset + i] = ((j < 0 || j >= m.$length) ? ($throwRuntimeError("index out of range"), undefined) : m.$array[m.$offset + j])); ((j < 0 || j >= m.$length) ? ($throwRuntimeError("index out of range"), undefined) : m.$array[m.$offset + j] = i); i = i + (1) >> 0; $s = 1; continue; case 2: $s = -1; return m; /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Perm }; } $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.Shuffle = function(n, swap) { var _r, _r$1, i, j, j$1, n, r, swap, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; i = $f.i; j = $f.j; j$1 = $f.j$1; n = $f.n; r = $f.r; swap = $f.swap; 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 Shuffle")); } i = n - 1 >> 0; /* while (true) { */ case 1: /* if (!(i > 2147483646)) { break; } */ if(!(i > 2147483646)) { $s = 2; continue; } _r = r.Int63n((new $Int64(0, (i + 1 >> 0)))); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } j = (((x = _r, x.$low + ((x.$high >> 31) * 4294967296)) >> 0)); $r = swap(i, j); /* */ $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: /* while (true) { */ case 5: /* if (!(i > 0)) { break; } */ if(!(i > 0)) { $s = 6; continue; } _r$1 = r.int31n((((i + 1 >> 0) >> 0))); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } j$1 = ((_r$1 >> 0)); $r = swap(i, j$1); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i = i - (1) >> 0; $s = 5; continue; case 6: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Shuffle }; } $f._r = _r; $f._r$1 = _r$1; $f.i = i; $f.j = j; $f.j$1 = j$1; $f.n = n; $f.r = r; $f.swap = swap; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Rand.prototype.Shuffle = function(n, swap) { return this.$val.Shuffle(n, swap); }; Rand.ptr.prototype.Read = function(p) { var $24r, $24r$1, _r, _r$1, _tuple, _tuple$1, _tuple$2, err, lk, n, ok, p, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; err = $f.err; lk = $f.lk; n = $f.n; ok = $f.ok; p = $f.p; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; r = this; _tuple = $assertType(r.src, ptrType$1, true); lk = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 1; continue; } /* */ $s = 2; continue; /* if (ok) { */ case 1: _r = lk.read(p, (r.$ptr_readVal || (r.$ptr_readVal = new ptrType$5(function() { return this.$target.readVal; }, function($v) { this.$target.readVal = $v; }, r))), (r.$ptr_readPos || (r.$ptr_readPos = new ptrType$4(function() { return this.$target.readPos; }, function($v) { this.$target.readPos = $v; }, r)))); /* */ $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]; $24r = [n, err]; $s = 4; case 4: return $24r; /* } */ case 2: _r$1 = read(p, r.src, (r.$ptr_readVal || (r.$ptr_readVal = new ptrType$5(function() { return this.$target.readVal; }, function($v) { this.$target.readVal = $v; }, r))), (r.$ptr_readPos || (r.$ptr_readPos = new ptrType$4(function() { return this.$target.readPos; }, function($v) { this.$target.readPos = $v; }, r)))); /* */ $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]; $24r$1 = [n, err]; $s = 6; case 6: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Read }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $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.lk = lk; $f.n = n; $f.ok = ok; $f.p = p; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Rand.prototype.Read = function(p) { return this.$val.Read(p); }; read = function(p, src, readVal, readPos) { var _r, _tuple, err, n, p, pos, readPos, readVal, rng, src, val, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; n = $f.n; p = $f.p; pos = $f.pos; readPos = $f.readPos; readVal = $f.readVal; rng = $f.rng; src = $f.src; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; pos = readPos.$get(); val = readVal.$get(); _tuple = $assertType(src, ptrType, true); rng = _tuple[0]; n = 0; /* while (true) { */ case 1: /* if (!(n < p.$length)) { break; } */ if(!(n < p.$length)) { $s = 2; continue; } /* */ if (pos === 0) { $s = 3; continue; } /* */ $s = 4; continue; /* if (pos === 0) { */ case 3: /* */ if (!(rng === ptrType.nil)) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!(rng === ptrType.nil)) { */ case 5: val = rng.Int63(); $s = 7; continue; /* } else { */ case 6: _r = src.Int63(); /* */ $s = 8; case 8: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } val = _r; /* } */ case 7: pos = 7; /* } */ case 4: ((n < 0 || n >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + n] = ((val.$low << 24 >>> 24))); val = $shiftRightInt64(val, (8)); pos = pos - (1) << 24 >> 24; n = n + (1) >> 0; $s = 1; continue; case 2: readPos.$set(pos); readVal.$set(val); $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: read }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.n = n; $f.p = p; $f.pos = pos; $f.readPos = readPos; $f.readVal = readVal; $f.rng = rng; $f.src = src; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; }; Intn = function(n) { var $24r, _r, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = globalRand.Intn(n); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Intn }; } $f.$24r = $24r; $f._r = _r; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Intn = Intn; Float64 = function() { var $24r, _r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = globalRand.Float64(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Float64 }; } $f.$24r = $24r; $f._r = _r; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Float64 = Float64; lockedSource.ptr.prototype.Int63 = function() { var n, r; n = new $Int64(0, 0); r = this; r.lk.Lock(); n = r.src.Int63(); r.lk.Unlock(); return n; }; lockedSource.prototype.Int63 = function() { return this.$val.Int63(); }; lockedSource.ptr.prototype.Uint64 = function() { var n, r; n = new $Uint64(0, 0); r = this; r.lk.Lock(); n = r.src.Uint64(); r.lk.Unlock(); return n; }; lockedSource.prototype.Uint64 = function() { return this.$val.Uint64(); }; lockedSource.ptr.prototype.Seed = function(seed) { var r, seed; r = this; r.lk.Lock(); r.src.Seed(seed); r.lk.Unlock(); }; lockedSource.prototype.Seed = function(seed) { return this.$val.Seed(seed); }; lockedSource.ptr.prototype.seedPos = function(seed, readPos) { var r, readPos, seed; r = this; r.lk.Lock(); r.src.Seed(seed); readPos.$set(0); r.lk.Unlock(); }; lockedSource.prototype.seedPos = function(seed, readPos) { return this.$val.seedPos(seed, readPos); }; lockedSource.ptr.prototype.read = function(p, readVal, readPos) { var _r, _tuple, err, n, p, r, readPos, readVal, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; n = $f.n; p = $f.p; r = $f.r; readPos = $f.readPos; readVal = $f.readVal; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; r = this; r.lk.Lock(); _r = read(p, r.src, readVal, readPos); /* */ $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]; r.lk.Unlock(); $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: lockedSource.ptr.prototype.read }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.n = n; $f.p = p; $f.r = r; $f.readPos = readPos; $f.readVal = readVal; $f.$s = $s; $f.$r = $r; return $f; }; lockedSource.prototype.read = function(p, readVal, readPos) { return this.$val.read(p, readVal, readPos); }; absInt32 = function(i) { var i; if (i < 0) { return ((-i >>> 0)); } return ((i >>> 0)); }; Rand.ptr.prototype.NormFloat64 = function() { var _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; _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"), undefined) : wn[i])); if (absInt32(j) < ((i < 0 || i >= kn.length) ? ($throwRuntimeError("index out of range"), undefined) : kn[i])) { $s = -1; 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) { $s = -1; return 3.442619855899 + x; } $s = -1; 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"), undefined) : fn[i]) + $fround(($fround(_r$5)) * ($fround((x$1 = i - 1 >> 0, ((x$1 < 0 || x$1 >= fn.length) ? ($throwRuntimeError("index out of range"), undefined) : fn[x$1])) - ((i < 0 || i >= fn.length) ? ($throwRuntimeError("index out of range"), undefined) : 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"), undefined) : fn[i]) + $fround(($fround(_r$5)) * ($fround((x$1 = i - 1 >> 0, ((x$1 < 0 || x$1 >= fn.length) ? ($throwRuntimeError("index out of range"), undefined) : fn[x$1])) - ((i < 0 || i >= fn.length) ? ($throwRuntimeError("index out of range"), undefined) : fn[i]))))) < ($fround(math.Exp(-0.5 * x * x)))) { */ case 12: $s = -1; return x; /* } */ case 13: $s = 1; continue; case 2: $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.NormFloat64 }; } $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(); }; Rand.ptr.prototype.ExpFloat64 = function() { var $24r, _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; $24r = $f.$24r; _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"), undefined) : we[i])); if (j < ((i < 0 || i >= ke.length) ? ($throwRuntimeError("index out of range"), undefined) : ke[i])) { $s = -1; 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; } $24r = 7.69711747013105 - _r$2; $s = 8; case 8: return $24r; /* } */ 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"), undefined) : fe[i]) + $fround(($fround(_r$3)) * ($fround((x$1 = i - 1 >>> 0, ((x$1 < 0 || x$1 >= fe.length) ? ($throwRuntimeError("index out of range"), undefined) : fe[x$1])) - ((i < 0 || i >= fe.length) ? ($throwRuntimeError("index out of range"), undefined) : fe[i]))))) < ($fround(math.Exp(-x)))) { $s = 9; continue; } /* */ $s = 10; continue; /* if ($fround(((i < 0 || i >= fe.length) ? ($throwRuntimeError("index out of range"), undefined) : fe[i]) + $fround(($fround(_r$3)) * ($fround((x$1 = i - 1 >>> 0, ((x$1 < 0 || x$1 >= fe.length) ? ($throwRuntimeError("index out of range"), undefined) : fe[x$1])) - ((i < 0 || i >= fe.length) ? ($throwRuntimeError("index out of range"), undefined) : fe[i]))))) < ($fround(math.Exp(-x)))) { */ case 9: $s = -1; return x; /* } */ case 10: $s = 1; continue; case 2: $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.ExpFloat64 }; } $f.$24r = $24r; $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(); }; ptrType.methods = [{prop: "Seed", name: "Seed", pkg: "", typ: $funcType([$Int64], [], false)}, {prop: "Int63", name: "Int63", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Uint64", name: "Uint64", pkg: "", typ: $funcType([], [$Uint64], false)}]; ptrType$2.methods = [{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: "Uint64", name: "Uint64", pkg: "", typ: $funcType([], [$Uint64], 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: "int31n", name: "int31n", pkg: "math/rand", 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: "Shuffle", name: "Shuffle", pkg: "", typ: $funcType([$Int, funcType], [], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}, {prop: "NormFloat64", name: "NormFloat64", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "ExpFloat64", name: "ExpFloat64", pkg: "", typ: $funcType([], [$Float64], false)}]; ptrType$1.methods = [{prop: "Int63", name: "Int63", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Uint64", name: "Uint64", pkg: "", typ: $funcType([], [$Uint64], false)}, {prop: "Seed", name: "Seed", pkg: "", typ: $funcType([$Int64], [], false)}, {prop: "seedPos", name: "seedPos", pkg: "math/rand", typ: $funcType([$Int64, ptrType$4], [], false)}, {prop: "read", name: "read", pkg: "math/rand", typ: $funcType([sliceType$1, ptrType$5, ptrType$4], [$Int, $error], false)}]; rngSource.init("math/rand", [{prop: "tap", name: "tap", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "feed", name: "feed", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "vec", name: "vec", embedded: false, exported: false, typ: arrayType, tag: ""}]); Source.init([{prop: "Int63", name: "Int63", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Seed", name: "Seed", pkg: "", typ: $funcType([$Int64], [], false)}]); Source64.init([{prop: "Int63", name: "Int63", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Seed", name: "Seed", pkg: "", typ: $funcType([$Int64], [], false)}, {prop: "Uint64", name: "Uint64", pkg: "", typ: $funcType([], [$Uint64], false)}]); Rand.init("math/rand", [{prop: "src", name: "src", embedded: false, exported: false, typ: Source, tag: ""}, {prop: "s64", name: "s64", embedded: false, exported: false, typ: Source64, tag: ""}, {prop: "readVal", name: "readVal", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "readPos", name: "readPos", embedded: false, exported: false, typ: $Int8, tag: ""}]); lockedSource.init("math/rand", [{prop: "lk", name: "lk", embedded: false, exported: false, typ: nosync.Mutex, tag: ""}, {prop: "src", name: "src", embedded: false, exported: false, 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: $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; } rngCooked = $toNativeArray($kindInt64, [new $Int64(-973649357, 3952672746), new $Int64(-1065661887, 3130416987), new $Int64(324977939, 3414273807), new $Int64(1241840476, 2806224363), new $Int64(-1477934308, 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(-1654874170, 1609182556), new $Int64(1069394745, 1241596776), new $Int64(1895445337, 1771189259), new $Int64(-1374618802, 3467012610), new $Int64(-140526423, 2344407434), new $Int64(-1745367887, 782467244), new $Int64(26335124, 3404933915), new $Int64(1063924276, 618867887), new $Int64(-968700782, 520164395), new $Int64(-1591572833, 1341358184), new $Int64(-1515085039, 665794848), new $Int64(1527227641, 3183648150), new $Int64(1781176124, 696329606), new $Int64(1789146075, 4151988961), new $Int64(-2087444114, 998951326), new $Int64(-612324923, 1364957564), new $Int64(63173359, 4090230633), new $Int64(-1498029007, 4009697548), new $Int64(248009524, 2569622517), new $Int64(778703922, 3742421481), new $Int64(-1109106023, 1506914633), new $Int64(1738099768, 1983412561), new $Int64(236311649, 1436266083), new $Int64(-1111517500, 3922894967), new $Int64(-1336974714, 1792680179), new $Int64(563141142, 1188796351), new $Int64(1349617468, 405968250), new $Int64(1044074554, 433754187), new $Int64(870549669, 4073162024), new $Int64(-1094251604, 433121399), new $Int64(2451824, 4162580594), new $Int64(-137262572, 4132415622), new $Int64(-1536231048, 3033822028), new $Int64(2016407895, 824682382), new $Int64(2366218, 3583765414), new $Int64(-624604839, 535386927), new $Int64(1637219058, 2286693689), new $Int64(1453075389, 2968466525), new $Int64(193683513, 1351410206), new $Int64(-283806096, 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(-2067810156, 3430061722), new $Int64(-1484435135, 3820169661), new $Int64(-1665985194, 2981816134), new $Int64(1017155588, 4184371017), new $Int64(206574701, 2119206761), new $Int64(-852109057, 2472200560), new $Int64(-560457548, 2853524696), new $Int64(1307803389, 1681119904), new $Int64(-174986835, 95608918), new $Int64(392686347, 3690479145), new $Int64(-1205570926, 1397922290), new $Int64(-1159314025, 1516129515), new $Int64(-320178155, 1547420459), new $Int64(1311333971, 1470949486), new $Int64(-1953469798, 1336785672), new $Int64(-45086614, 4131677129), new $Int64(-1392278100, 4246329084), new $Int64(-1142500187, 3788585631), new $Int64(-66478285, 3080389532), new $Int64(-646438364, 2215402037), new $Int64(391002300, 1171593935), new $Int64(1408774047, 1423855166), new $Int64(-519177718, 2276716302), new $Int64(-368453140, 2068027241), new $Int64(1369359303, 3427553297), new $Int64(189241615, 3289637845), new $Int64(1057480830, 3486407650), new $Int64(-1512910664, 3071877822), new $Int64(1159653919, 3363620705), new $Int64(-934256930, 4159821533), new $Int64(-76621938, 1894661), new $Int64(-674493898, 1156868282), new $Int64(348271067, 776219088), new $Int64(-501428838, 2425634259), new $Int64(1716021749, 680510161), new $Int64(-574263456, 1310101429), new $Int64(1095885995, 2964454134), new $Int64(-325695512, 3467098407), new $Int64(1990672920, 2109628894), new $Int64(-2139648704, 1232604732), new $Int64(-1838070714, 3261916179), new $Int64(1699175360, 434597899), new $Int64(235436061, 1624796439), new $Int64(-1626402839, 3589632480), new $Int64(1198416575, 864579159), new $Int64(-1938748161, 1380889830), new $Int64(619206309, 2654509477), new $Int64(1419738251, 1468209306), new $Int64(-1744284772, 100794388), new $Int64(-1191421458, 2991674471), new $Int64(-208666741, 2224662036), new $Int64(-173659161, 977097250), new $Int64(1351320195, 726419512), new $Int64(-183459897, 1747974366), new $Int64(-753095183, 1556430604), new $Int64(-1049492215, 1080776742), new $Int64(-385846958, 280794874), new $Int64(117767733, 919835643), new $Int64(-967009426, 3434019658), new $Int64(-1951414480, 2461941785), new $Int64(133215641, 3615001066), new $Int64(417204809, 3103414427), new $Int64(790056561, 3380809712), new $Int64(-1267681408, 2724693469), new $Int64(547796833, 598827710), new $Int64(-1846559452, 3452273442), new $Int64(-75778224, 649274915), new $Int64(-801301329, 2585724112), new $Int64(-1510934263, 3165579553), new $Int64(1185578221, 2635894283), new $Int64(-52910178, 2053289721), new $Int64(985976581, 3169337108), new $Int64(1170569632, 144717764), new $Int64(1079216270, 1383666384), new $Int64(-124804942, 681540375), new $Int64(1375448925, 537050586), new $Int64(-1964768344, 315246468), new $Int64(226402871, 849323088), new $Int64(-885062465, 45543944), new $Int64(-946445250, 2319052083), new $Int64(-40708194, 3613090841), new $Int64(560472520, 2992171180), new $Int64(-381863169, 2068244785), new $Int64(917538188, 4239862634), new $Int64(-1369555809, 3892253031), new $Int64(720683925, 958186149), new $Int64(-423297785, 1877702262), new $Int64(1357886971, 837674867), new $Int64(1837048883, 1507589294), new $Int64(1905518400, 873336795), new $Int64(-1879761037, 2764496274), new $Int64(-1806480530, 4196182374), new $Int64(-1066765755, 550964545), new $Int64(818747069, 420611474), new $Int64(-1924830376, 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(-1367475956, 2099949527), new $Int64(1424094358, 338442522), new $Int64(490737398, 637158004), new $Int64(-1727621530, 281976339), new $Int64(574970164, 3619802330), new $Int64(-431930823, 3084554784), new $Int64(-1264611183, 4129772886), new $Int64(-2104399043, 1680378557), new $Int64(-1621962591, 3339087776), new $Int64(1680500332, 4220317857), new $Int64(-1935828963, 2959322499), new $Int64(1675600481, 1488354890), new $Int64(-834863562, 3958162143), new $Int64(-1226511573, 2773705983), new $Int64(1876039582, 225908689), new $Int64(-1183735113, 908216283), new $Int64(-605696219, 3574646075), new $Int64(-1827723091, 1936937569), new $Int64(1519770881, 75492235), new $Int64(816689472, 1935193178), new $Int64(2142521206, 2018250883), new $Int64(455141620, 3943126022), new $Int64(-601399488, 3066544345), new $Int64(1932392669, 2793082663), new $Int64(-1239009361, 3297036421), new $Int64(1640597065, 2206987825), new $Int64(-553246738, 807894872), new $Int64(-1781325307, 766252117), new $Int64(2060649606, 3833114345), new $Int64(845619743, 1255067973), new $Int64(1201145605, 741697208), new $Int64(-1476242608, 2810093753), new $Int64(1109032642, 4229340371), new $Int64(1462188720, 1361684224), new $Int64(-1159399429, 1906263026), new $Int64(475781207, 3904421704), new $Int64(-623537128, 1769075545), new $Int64(1062308525, 2621599764), new $Int64(1279509432, 3431891480), new $Int64(-1742751146, 1871896503), new $Int64(128756421, 1412808876), new $Int64(1605404688, 952876175), new $Int64(-230443691, 1824438899), new $Int64(1662295856, 1005035476), new $Int64(-156574141, 527508597), new $Int64(1288873303, 3066806859), new $Int64(565995893, 3244940914), new $Int64(-889746188, 209092916), new $Int64(-247669406, 1242699167), new $Int64(-713830396, 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(-1197583895, 3803658212), new $Int64(1883670356, 479946959), new $Int64(685713571, 1562982345), new $Int64(-1946242443, 1766109365), new $Int64(700596547, 3257093788), new $Int64(-184714929, 2365720207), new $Int64(93384808, 3742754173), new $Int64(-458385235, 2878193673), new $Int64(1096135042, 2174002182), new $Int64(-834260953, 3573511231), new $Int64(-754572527, 1760299077), new $Int64(-1375627191, 2260779833), new $Int64(-866019274, 1452805722), new $Int64(-1229671918, 2940011802), new $Int64(1890251082, 1886183802), new $Int64(893897673, 2514369088), new $Int64(1644345561, 3924317791), new $Int64(-1974867432, 500935732), new $Int64(1403501753, 676580929), new $Int64(-1565912283, 1184984890), new $Int64(-691968413, 1271474274), new $Int64(-1828754738, 3163791473), new $Int64(2051027584, 2842487377), new $Int64(1511537551, 2170968612), new $Int64(573262976, 3535856740), new $Int64(-2053227187, 1488599718), new $Int64(-1180531831, 3408913763), new $Int64(-2086531912, 2501050084), new $Int64(-875130448, 1639124157), new $Int64(-2009482504, 4088176393), new $Int64(1574896563, 3989947576), new $Int64(-165243708, 3414355209), new $Int64(-792329287, 2275136352), new $Int64(-2057774345, 2151835223), new $Int64(-931144933, 1654534827), new $Int64(-679921451, 377892833), new $Int64(-482716010, 660204544), new $Int64(85706799, 390828249), new $Int64(-1422172693, 3402783878), new $Int64(-1468634160, 3717936603), new $Int64(1113532086, 2211058823), new $Int64(1564224320, 2692150867), new $Int64(1952770442, 1928910388), new $Int64(788716862, 3931011137), new $Int64(1083670504, 1112701047), new $Int64(-68150572, 2452299106), new $Int64(-896164822, 2337204777), new $Int64(1774877857, 273889282), new $Int64(1798719843, 1462008793), new $Int64(2138834788, 1554494002), new $Int64(-1194967131, 182675323), new $Int64(-1598554764, 1882802136), new $Int64(589279648, 3700220025), new $Int64(381039426, 3083431543), new $Int64(-851859191, 3622207527), new $Int64(338126939, 432729309), new $Int64(-1667470126, 2391914317), new $Int64(-1849558151, 235747924), new $Int64(2120733629, 3088823825), new $Int64(-745079795, 2314658321), new $Int64(1165929723, 2957634338), new $Int64(501323675, 4117056981), new $Int64(1564699815, 1482500298), new $Int64(-740826490, 840489337), new $Int64(799522364, 3483178565), new $Int64(532129761, 2074004656), new $Int64(724246478, 3643392642), new $Int64(-665153481, 1583624461), new $Int64(-885822954, 287473085), new $Int64(1667835381, 3136843981), new $Int64(1138806821, 1266970974), new $Int64(135185781, 1998688839), new $Int64(392094735, 1492900209), new $Int64(1031326774, 1538112737), new $Int64(-2070568842, 2207265429), new $Int64(-1886797613, 963263315), new $Int64(1671145500, 2295892134), new $Int64(1068469660, 2002560897), new $Int64(-356250305, 1369254035), new $Int64(33436120, 3353312708), new $Int64(57507843, 947771099), new $Int64(-1945755145, 1747061399), new $Int64(1507240140, 2047354631), new $Int64(720000810, 4165367136), new $Int64(479265078, 3388864963), new $Int64(-952181250, 286492130), new $Int64(2045622690, 2795735007), new $Int64(-715730566, 3703961339), new $Int64(-148436487, 1797825479), new $Int64(1429039600, 1116589674), new $Int64(-1665420098, 2593309206), new $Int64(1329049334, 3404995677), new $Int64(-750579440, 3453462936), new $Int64(1014767077, 3016498634), new $Int64(75698599, 1650371545), new $Int64(1592007860, 212344364), new $Int64(1127766888, 3843932156), new $Int64(-748019856, 3573129983), new $Int64(-890581831, 665897820), new $Int64(1071492673, 1675628772), new $Int64(243225682, 2831752928), new $Int64(2120298836, 1486294219), new $Int64(-1954407413, 268782709), new $Int64(-1002123503, 4186179080), new $Int64(624342951, 1613720397), new $Int64(857179861, 2703686015), new $Int64(-911618704, 2205342611), new $Int64(-672703993, 1411666394), new $Int64(-1528454899, 677744900), new $Int64(-1876628533, 4172867247), new $Int64(135494707, 2163418403), new $Int64(849547544, 2841526879), new $Int64(-1117516959, 1082141470), new $Int64(-1770111792, 4046134367), new $Int64(51415528, 2142943655), new $Int64(-249824333, 3124627521), new $Int64(998228909, 219992939), new $Int64(-1078790951, 1756846531), new $Int64(1283749206, 1225118210), new $Int64(-525858006, 1647770243), new $Int64(-2035959705, 444807907), new $Int64(2036369448, 3952076173), new $Int64(53201823, 1461839639), new $Int64(315761893, 3699250910), new $Int64(702974850, 1373688981), new $Int64(734022261, 147523747), new $Int64(-2047330906, 1211276581), new $Int64(1294440951, 2548832680), new $Int64(1144696256, 1995631888), new $Int64(-1992983070, 2011457303), new $Int64(-1351022674, 3057425772), new $Int64(667839456, 81484597), new $Int64(-1681980888, 3646681560), new $Int64(-1372462725, 635548515), new $Int64(602489502, 2508044581), new $Int64(-1794220117, 1014917157), new $Int64(719992433, 3214891315), new $Int64(-1294799037, 959582252), new $Int64(226415134, 3347040449), new $Int64(-362868096, 4102971975), new $Int64(397887437, 4078022210), new $Int64(-536803826, 2851767182), new $Int64(-1398321012, 1540160644), new $Int64(-1549098876, 1057290595), new $Int64(-112592988, 3907769253), new $Int64(579300318, 4248952684), new $Int64(-1054576049, 132554364), new $Int64(-1085862414, 1029351092), new $Int64(697840928, 2583007416), new $Int64(298619124, 1486185789), new $Int64(55905697, 2871589073), new $Int64(2017643612, 723203291), new $Int64(146250550, 2494333952), new $Int64(-1082993397, 2230939180), new $Int64(-1804568072, 3943232912), new $Int64(1768732449, 2181367922), new $Int64(-729261111, 2889274791), new $Int64(1824032949, 2046728161), new $Int64(1653899792, 1376052477), new $Int64(1022327048, 381236993), new $Int64(-1113097690, 3188942166), new $Int64(-74480109, 350070824), new $Int64(144881592, 61758415), new $Int64(-741824226, 3492950336), new $Int64(-2030042720, 3093818430), new $Int64(-453590535, 2962480613), new $Int64(-1912050708, 3154871160), new $Int64(-1636478569, 3228564679), new $Int64(610731502, 888276216), new $Int64(-946702974, 3574998604), new $Int64(-1277068380, 1967526716), new $Int64(-1556147941, 1554691298), new $Int64(-1573024234, 339944798), new $Int64(1223764147, 1154515356), new $Int64(1825645307, 967516237), new $Int64(1546195135, 596588202), new $Int64(-1867600880, 3764362170), new $Int64(-1655392592, 266611402), new $Int64(-393255880, 2047856075), new $Int64(-1000726433, 21444105), new $Int64(-949424754, 3065563181), new $Int64(-232418803, 1140663212), new $Int64(633187674, 2323741028), new $Int64(2126290159, 3103873707), new $Int64(1008658319, 2766828349), new $Int64(-485587503, 1970872996), new $Int64(1628585413, 3766615585), new $Int64(-595148528, 2036813414), new $Int64(-1994877121, 3105536507), new $Int64(13954645, 3396176938), new $Int64(-721402003, 1377154485), new $Int64(-61839181, 3807014186), new $Int64(543009040, 3710110597), new $Int64(-1751425519, 916420443), new $Int64(734556788, 2103831255), new $Int64(-1766161494, 717331943), new $Int64(-1574598896, 3550505941), new $Int64(45939673, 378749927), new $Int64(-1997615719, 611017331), new $Int64(592130075, 758907650), new $Int64(1012992349, 154266815), new $Int64(-1040454942, 1407468696), new $Int64(-1678191250, 970098704), new $Int64(-285057486, 1971660656), new $Int64(998365243, 3332747885), new $Int64(1947089649, 1935189867), new $Int64(1510248801, 203520055), new $Int64(-1305165746, 3916463034), new $Int64(-388598655, 3474113316), new $Int64(1036101639, 316544223), new $Int64(-1773744891, 1650844677), new $Int64(-907191419, 4267565603), new $Int64(-1070275024, 2501167616), new $Int64(-1520651863, 3929401789), new $Int64(-2091360852, 337170252), new $Int64(-960502090, 2061966842), new $Int64(-304190848, 2508461464), new $Int64(-1941471116, 2791377107), new $Int64(1240791848, 1227227588), new $Int64(1813978778, 1709681848), new $Int64(1153692192, 3768820575), new $Int64(-1002297449, 2887126398), new $Int64(-1447111334, 296561685), new $Int64(700300844, 3729960077), new $Int64(-1572311344, 372833036), new $Int64(2078875613, 2409779288), new $Int64(1829161290, 555274064), new $Int64(-1105595719, 4239804901), new $Int64(1839403216, 3723486978), new $Int64(-1649093095, 2145871984), new $Int64(-1582765715, 3565480803), new $Int64(-1568653827, 2197313814), new $Int64(974785092, 3613674566), new $Int64(438638731, 3042093666), new $Int64(-96556264, 3324034321), new $Int64(869420878, 3708873369), new $Int64(946682149, 1698090092), new $Int64(1618900382, 4213940712), new $Int64(-1843479747, 2087477361), new $Int64(-1766167800, 2407950639), new $Int64(-1296225558, 3942568569), new $Int64(-1223900450, 4088074412), new $Int64(723260036, 2964773675), new $Int64(-673921829, 1539178386), new $Int64(1062961552, 2694849566), new $Int64(460977733, 2120273838), new $Int64(-1604570740, 2484608657), new $Int64(880846449, 2956190677), new $Int64(1970902366, 4223313749), new $Int64(662161910, 3502682327), new $Int64(705634754, 4133891139), new $Int64(-1031359300, 1166449596), new $Int64(1038247601, 3362705993), new $Int64(93734798, 3892921029), new $Int64(1876124043, 786869787), new $Int64(1057490746, 1046342263), new $Int64(242763728, 493777327), new $Int64(-853573201, 3304827646), new $Int64(616460742, 125356352), new $Int64(499300063, 74094113), new $Int64(-795586925, 2500816079), new $Int64(-490248444, 514015239), new $Int64(1377565129, 543520454), new $Int64(-2039776725, 3614531153), new $Int64(2056746300, 2356753985), new $Int64(1390062617, 2018141668), new $Int64(131272971, 2087974891), new $Int64(-1502927041, 3166972343), new $Int64(372256200, 1517638666), new $Int64(-935275664, 173466846), new $Int64(-695774461, 4241513471), new $Int64(-1413550842, 2783126920), new $Int64(1972004134, 4167264826), new $Int64(29260506, 3907395640), new $Int64(-910901561, 1539634186), new $Int64(-595957298, 178241987), new $Int64(-113277636, 182168164), new $Int64(-1102530459, 2386154934), new $Int64(1379126408, 4077374341), new $Int64(-2114679722, 1732699140), new $Int64(-421057745, 1041306002), new $Int64(1860414813, 2068001749), new $Int64(1005320202, 3208962910), new $Int64(844054010, 697710380), new $Int64(-1509359403, 2228431183), new $Int64(-810313977, 3554678728), new $Int64(-750989047, 173470263), new $Int64(-85886265, 3848297795), new $Int64(-926936977, 246236185), new $Int64(-1984190461, 2066374846), new $Int64(1771673660, 312890749), new $Int64(703378057, 3573310289), new $Int64(-598851901, 143166754), new $Int64(613554316, 2081511079), new $Int64(1197802104, 486038032), new $Int64(-1906483789, 2982218564), new $Int64(364901986, 1000939191), new $Int64(1902782651, 2750454885), new $Int64(-671844857, 3375313137), new $Int64(-1643868040, 881302957), new $Int64(-1508784745, 2514186393), new $Int64(-1703622845, 360024739), new $Int64(1399671872, 292500025), new $Int64(1381210821, 2276300752), new $Int64(521803381, 4069087683), new $Int64(-1938982667, 1637778212), new $Int64(720490469, 1676670893), new $Int64(1067262482, 3855174429), new $Int64(2114075974, 2067248671), new $Int64(-89426259, 2884561259), new $Int64(-805741095, 2456511185), new $Int64(983726246, 561175414), new $Int64(-1719489563, 432588903), new $Int64(885133709, 4059399550), new $Int64(-93096266, 1075014784), new $Int64(-1733832628, 2728058415), new $Int64(1839142064, 1299703678), new $Int64(1262333188, 2347583393), new $Int64(1285481956, 2468164145), new $Int64(-1158354011, 1140014346), new $Int64(2033889184, 1936972070), new $Int64(-1737578993, 3870530098), new $Int64(-484494257, 1717789158), new $Int64(-232997156, 1153452491), new $Int64(-990424416, 3948827651), new $Int64(-1357145630, 2101413152), new $Int64(1495744672, 3854091229), new $Int64(83644069, 4215565463), new $Int64(-1385277313, 1202710438), new $Int64(-564909037, 2072216740), new $Int64(705690639, 2066751068), new $Int64(-2113583312, 173902580), new $Int64(-741983806, 142459001), new $Int64(172391592, 1889151926), new $Int64(-498943125, 3034199774), new $Int64(1618587731, 516490102), new $Int64(93114264, 3692577783), new $Int64(-2078821353, 2953948865), new $Int64(-320938673, 4041040923), new $Int64(-1942517976, 592046130), new $Int64(-705643640, 384297211), new $Int64(-2051649464, 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(-1703423246, 4013676611), new $Int64(1718532237, 2265047407), new $Int64(1433593806, 875071080), new $Int64(-343047503, 1418843655), new $Int64(2009228711, 451657300), new $Int64(1229446621, 1866374663), new $Int64(1653472867, 1551455622), new $Int64(577191481, 3560962459), new $Int64(1669204077, 3347903778), new $Int64(-298327194, 2675874918), new $Int64(-1831355577, 2762991672), new $Int64(530492383, 3689068477), new $Int64(844089962, 4071997905), new $Int64(1508155730, 1381702441), new $Int64(2089931018, 2373284878), new $Int64(-864267462, 2143983064), new $Int64(308739063, 1938207195), new $Int64(1754949306, 1188152253), new $Int64(1272345009, 615870490), new $Int64(742653194, 2662252621), new $Int64(1477718295, 3839976789), new $Int64(-2091334213, 306752547), new $Int64(-1426688067, 2162363077), new $Int64(-57052633, 2767224719), new $Int64(-1471624099, 2628837712), new $Int64(1678405918, 2967771969), new $Int64(1694285728, 499792248), new $Int64(-1744131281, 4285253508), new $Int64(962357072, 2856511070), new $Int64(679471692, 2526409716), new $Int64(-1793706473, 1240875658), new $Int64(-914893422, 2577342868), new $Int64(-1001298215, 4136853496), new $Int64(-1477114974, 2403540137), new $Int64(1372824515, 1371410668), new $Int64(-176562048, 371758825), new $Int64(-441063112, 1528834084), new $Int64(-71688630, 1504757260), new $Int64(-1461820072, 699052551), new $Int64(-505543539, 3347789870), new $Int64(1951619734, 3430604759), new $Int64(2119672219, 1935601723), new $Int64(966789690, 834676166)]); globalRand = New(new lockedSource.ptr(new nosync.Mutex.ptr(false), $assertType(NewSource(new $Int64(0, 1)), ptrType))); 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]); 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]); /* */ } 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, bits, rand, strconv, strings, divisor, nat, byteReader, Int, Word, arrayType, structType$1, sliceType, sliceType$1, ptrType$2, sliceType$2, ptrType$3, sliceType$3, sliceType$4, ptrType$4, arrayType$1, ptrType$5, errNoDigits, errInvalSep, leafSize, cacheBase10, natOne, natTwo, karatsubaThreshold, basicSqrThreshold, karatsubaSqrThreshold, natPool, intOne, divWVW, greaterThan, maxPow, pow, divisors, basicMul, karatsubaAdd, karatsubaSub, karatsuba, alias, addAt, max, karatsubaLen, basicSqr, karatsubaSqr, getNat, putNat, same, bigEndianWord, writeMultiple, scanSign, NewInt, low64, lehmerSimulate, lehmerUpdate, euclidUpdate, Jacobi, mulWW, addVV, subVV, addVW, subVW, shlVU, shrVU, mulAddVWW, addMulVVW, mulWW_g, mulAddWWW_g, nlz, addVV_g, subVV_g, addVW_g, addVWlarge, subVW_g, subVWlarge, shlVU_g, shrVU_g, mulAddVWW_g, addMulVVW_g, divWW, reciprocalWord; 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"]; bits = $packages["math/bits"]; rand = $packages["math/rand"]; strconv = $packages["strconv"]; strings = $packages["strings"]; divisor = $pkg.divisor = $newType(0, $kindStruct, "big.divisor", true, "math/big", false, 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_; }); nat = $pkg.nat = $newType(12, $kindSlice, "big.nat", true, "math/big", false, null); byteReader = $pkg.byteReader = $newType(0, $kindStruct, "big.byteReader", true, "math/big", false, function(ScanState_) { this.$val = this; if (arguments.length === 0) { this.ScanState = $ifaceNil; return; } this.ScanState = ScanState_; }); Int = $pkg.Int = $newType(0, $kindStruct, "big.Int", true, "math/big", true, function(neg_, abs_) { this.$val = this; if (arguments.length === 0) { this.neg = false; this.abs = nat.nil; return; } this.neg = neg_; this.abs = abs_; }); Word = $pkg.Word = $newType(4, $kindUintptr, "big.Word", true, "math/big", true, null); arrayType = $arrayType(divisor, 64); structType$1 = $structType("math/big", [{prop: "Mutex", name: "Mutex", embedded: true, exported: true, typ: nosync.Mutex, tag: ""}, {prop: "table", name: "table", embedded: false, exported: false, typ: arrayType, tag: ""}]); sliceType = $sliceType($emptyInterface); sliceType$1 = $sliceType($Uint8); ptrType$2 = $ptrType(Int); sliceType$2 = $sliceType(Word); ptrType$3 = $ptrType(nat); sliceType$3 = $sliceType(ptrType$3); sliceType$4 = $sliceType(divisor); ptrType$4 = $ptrType(Word); arrayType$1 = $arrayType(nat, 16); ptrType$5 = $ptrType(rand.Rand); Int.ptr.prototype.ProbablyPrime = function(n) { var $24r, _1, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tmp, _tmp$1, _v, n, r, rA, rB, 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; $24r = $f.$24r; _1 = $f._1; _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$17 = $f._r$17; _r$18 = $f._r$18; _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; _v = $f._v; n = $f.n; r = $f.r; rA = $f.rA; rB = $f.rB; 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: x = this; if (n < 0) { $panic(new $String("negative n for ProbablyPrime")); } if (x.neg || (x.abs.$length === 0)) { $s = -1; return false; } w = (x$1 = x.abs, (0 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 0])); if ((x.abs.$length === 1) && w < 64) { $s = -1; return !((x$2 = (x$3 = $shiftLeft64(new $Uint64(0, 1), w), new $Uint64(673221152 & x$3.$high, (2693408940 & x$3.$low) >>> 0)), (x$2.$high === 0 && x$2.$low === 0))); } if (((w & 1) >>> 0) === 0) { $s = -1; return false; } _tmp = 0; _tmp$1 = 0; rA = _tmp; rB = _tmp$1; _1 = 32; if (_1 === (32)) { rA = ((x.abs.modW(4127218095) >>> 0)); rB = ((x.abs.modW(3948078067) >>> 0)); } else if (_1 === (64)) { r = x.abs.modW(820596253); rA = (((_r = r % 4127218095, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) >>> 0)); rB = (((_r$1 = r % 3948078067, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) >>> 0)); } else { $panic(new $String("math/big: invalid word size")); } if (((_r$2 = rA % 3, _r$2 === _r$2 ? _r$2 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$3 = rA % 5, _r$3 === _r$3 ? _r$3 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$4 = rA % 7, _r$4 === _r$4 ? _r$4 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$5 = rA % 11, _r$5 === _r$5 ? _r$5 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$6 = rA % 13, _r$6 === _r$6 ? _r$6 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$7 = rA % 17, _r$7 === _r$7 ? _r$7 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$8 = rA % 19, _r$8 === _r$8 ? _r$8 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$9 = rA % 23, _r$9 === _r$9 ? _r$9 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$10 = rA % 37, _r$10 === _r$10 ? _r$10 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$11 = rB % 29, _r$11 === _r$11 ? _r$11 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$12 = rB % 31, _r$12 === _r$12 ? _r$12 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$13 = rB % 41, _r$13 === _r$13 ? _r$13 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$14 = rB % 43, _r$14 === _r$14 ? _r$14 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$15 = rB % 47, _r$15 === _r$15 ? _r$15 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$16 = rB % 53, _r$16 === _r$16 ? _r$16 : $throwRuntimeError("integer divide by zero")) === 0)) { $s = -1; return false; } _r$17 = x.abs.probablyPrimeMillerRabin(n + 1 >> 0, true); /* */ $s = 2; case 2: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } if (!(_r$17)) { _v = false; $s = 1; continue s; } _r$18 = x.abs.probablyPrimeLucas(); /* */ $s = 3; case 3: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } _v = _r$18; case 1: $24r = _v; $s = 4; case 4: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.ProbablyPrime }; } $f.$24r = $24r; $f._1 = _1; $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$17 = _r$17; $f._r$18 = _r$18; $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._v = _v; $f.n = n; $f.r = r; $f.rA = rA; $f.rB = rB; $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; }; Int.prototype.ProbablyPrime = function(n) { return this.$val.ProbablyPrime(n); }; nat.prototype.probablyPrimeMillerRabin = function(reps, force2) { var _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _tmp, _tmp$1, _tmp$2, _tuple, force2, i, j, k, n, nm1, nm3, nm3Len, q, quotient, 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; _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; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tuple = $f._tuple; force2 = $f.force2; 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; 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; _r = (nat.nil).sub(n, natOne); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } nm1 = _r; k = nm1.trailingZeroBits(); q = (nat.nil).shr(nm1, k); _r$1 = (nat.nil).sub(nm1, natTwo); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } nm3 = _r$1; rand$1 = rand.New(rand.NewSource(((x = (0 >= n.$length ? ($throwRuntimeError("index out of range"), undefined) : 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 3: /* if (!(i < reps)) { break; } */ if(!(i < reps)) { $s = 4; continue; } /* */ if ((i === (reps - 1 >> 0)) && force2) { $s = 5; continue; } /* */ $s = 6; continue; /* if ((i === (reps - 1 >> 0)) && force2) { */ case 5: x$1 = x$1.set(natTwo); $s = 7; continue; /* } else { */ case 6: _r$2 = x$1.random(rand$1, nm3, nm3Len); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } x$1 = _r$2; _r$3 = x$1.add(x$1, natTwo); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } x$1 = _r$3; /* } */ case 7: _r$4 = y.expNN(x$1, q, n); /* */ $s = 10; case 10: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } y = _r$4; if ((y.cmp(natOne) === 0) || (y.cmp(nm1) === 0)) { i = i + (1) >> 0; /* continue; */ $s = 3; continue; } j = 1; /* while (true) { */ case 11: /* if (!(j < k)) { break; } */ if(!(j < k)) { $s = 12; continue; } _r$5 = y.sqr(y); /* */ $s = 13; case 13: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } y = _r$5; _r$6 = quotient.div(y, y, n); /* */ $s = 14; case 14: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tuple = _r$6; quotient = _tuple[0]; y = _tuple[1]; if (y.cmp(nm1) === 0) { i = i + (1) >> 0; /* continue NextRandom; */ $s = 3; continue s; } if (y.cmp(natOne) === 0) { $s = -1; return false; } j = j + (1) >>> 0; $s = 11; continue; case 12: $s = -1; return false; case 4: $s = -1; return true; /* */ } return; } if ($f === undefined) { $f = { $blk: nat.prototype.probablyPrimeMillerRabin }; } $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._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tuple = _tuple; $f.force2 = force2; $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.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.probablyPrimeMillerRabin = function(reps, force2) { return this.$get().probablyPrimeMillerRabin(reps, force2); }; nat.prototype.probablyPrimeLucas = function() { var _r, _r$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$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, d, i, intD, intN, j, n, natP, nm2, p, r, s, t, t1, t1$1, t2, t2$1, t3, vk, vk1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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$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$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; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; _tuple$5 = $f._tuple$5; d = $f.d; i = $f.i; intD = $f.intD; intN = $f.intN; j = $f.j; n = $f.n; natP = $f.natP; nm2 = $f.nm2; p = $f.p; r = $f.r; s = $f.s; t = $f.t; t1 = $f.t1; t1$1 = $f.t1$1; t2 = $f.t2; t2$1 = $f.t2$1; t3 = $f.t3; vk = $f.vk; vk1 = $f.vk1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = this; if ((n.$length === 0) || (n.cmp(natOne) === 0)) { $s = -1; return false; } if ((((0 >= n.$length ? ($throwRuntimeError("index out of range"), undefined) : n.$array[n.$offset + 0]) & 1) >>> 0) === 0) { $s = -1; return n.cmp(natTwo) === 0; } p = 3; d = new nat([1]); t1 = (nat.nil); intD = new Int.ptr(false, d); intN = new Int.ptr(false, n); /* while (true) { */ case 1: /* */ if (p > 10000) { $s = 3; continue; } /* */ $s = 4; continue; /* if (p > 10000) { */ case 3: _r = intN.String(); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $panic(new $String("math/big: internal error: cannot find (D/n) = -1 for " + _r)); /* } */ case 4: (0 >= d.$length ? ($throwRuntimeError("index out of range"), undefined) : d.$array[d.$offset + 0] = (($imul(p, p) >>> 0) - 4 >>> 0)); _r$1 = Jacobi(intD, intN); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } j = _r$1; if (j === -1) { /* break; */ $s = 2; continue; } if (j === 0) { $s = -1; return (n.$length === 1) && ((0 >= n.$length ? ($throwRuntimeError("index out of range"), undefined) : n.$array[n.$offset + 0]) === (p + 2 >>> 0)); } /* */ if (p === 40) { $s = 7; continue; } /* */ $s = 8; continue; /* if (p === 40) { */ case 7: _r$2 = t1.sqrt(n); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } t1 = _r$2; _r$3 = t1.sqr(t1); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } t1 = _r$3; if (t1.cmp(n) === 0) { $s = -1; return false; } /* } */ case 8: p = p + (1) >>> 0; $s = 1; continue; case 2: _r$4 = (nat.nil).add(n, natOne); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } s = _r$4; r = ((s.trailingZeroBits() >> 0)); s = s.shr(s, ((r >>> 0))); _r$5 = (nat.nil).sub(n, natTwo); /* */ $s = 12; case 12: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } nm2 = _r$5; natP = (nat.nil).setWord(p); vk = (nat.nil).setWord(2); vk1 = (nat.nil).setWord(p); t2 = (nat.nil); i = (s.bitLen()); /* while (true) { */ case 13: /* if (!(i >= 0)) { break; } */ if(!(i >= 0)) { $s = 14; continue; } /* */ if (!((s.bit(((i >>> 0))) === 0))) { $s = 15; continue; } /* */ $s = 16; continue; /* if (!((s.bit(((i >>> 0))) === 0))) { */ case 15: _r$6 = t1.mul(vk, vk1); /* */ $s = 18; case 18: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } t1 = _r$6; _r$7 = t1.add(t1, n); /* */ $s = 19; case 19: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } t1 = _r$7; _r$8 = t1.sub(t1, natP); /* */ $s = 20; case 20: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } t1 = _r$8; _r$9 = t2.div(vk, t1, n); /* */ $s = 21; case 21: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; t2 = _tuple[0]; vk = _tuple[1]; _r$10 = t1.sqr(vk1); /* */ $s = 22; case 22: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } t1 = _r$10; _r$11 = t1.add(t1, nm2); /* */ $s = 23; case 23: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } t1 = _r$11; _r$12 = t2.div(vk1, t1, n); /* */ $s = 24; case 24: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _tuple$1 = _r$12; t2 = _tuple$1[0]; vk1 = _tuple$1[1]; $s = 17; continue; /* } else { */ case 16: _r$13 = t1.mul(vk, vk1); /* */ $s = 25; case 25: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } t1 = _r$13; _r$14 = t1.add(t1, n); /* */ $s = 26; case 26: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } t1 = _r$14; _r$15 = t1.sub(t1, natP); /* */ $s = 27; case 27: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } t1 = _r$15; _r$16 = t2.div(vk1, t1, n); /* */ $s = 28; case 28: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _tuple$2 = _r$16; t2 = _tuple$2[0]; vk1 = _tuple$2[1]; _r$17 = t1.sqr(vk); /* */ $s = 29; case 29: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } t1 = _r$17; _r$18 = t1.add(t1, nm2); /* */ $s = 30; case 30: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } t1 = _r$18; _r$19 = t2.div(vk, t1, n); /* */ $s = 31; case 31: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } _tuple$3 = _r$19; t2 = _tuple$3[0]; vk = _tuple$3[1]; /* } */ case 17: i = i - (1) >> 0; $s = 13; continue; case 14: /* */ if ((vk.cmp(natTwo) === 0) || (vk.cmp(nm2) === 0)) { $s = 32; continue; } /* */ $s = 33; continue; /* if ((vk.cmp(natTwo) === 0) || (vk.cmp(nm2) === 0)) { */ case 32: _r$20 = t1.mul(vk, natP); /* */ $s = 34; case 34: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } t1$1 = _r$20; t2$1 = t2.shl(vk1, 1); if (t1$1.cmp(t2$1) < 0) { _tmp = t2$1; _tmp$1 = t1$1; t1$1 = _tmp; t2$1 = _tmp$1; } _r$21 = t1$1.sub(t1$1, t2$1); /* */ $s = 35; case 35: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } t1$1 = _r$21; t3 = vk1; vk1 = nat.nil; $unused(vk1); _r$22 = t2$1.div(t3, t1$1, n); /* */ $s = 36; case 36: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; } _tuple$4 = _r$22; t2$1 = _tuple$4[0]; t3 = _tuple$4[1]; if (t3.$length === 0) { $s = -1; return true; } /* } */ case 33: t = 0; /* while (true) { */ case 37: /* if (!(t < (r - 1 >> 0))) { break; } */ if(!(t < (r - 1 >> 0))) { $s = 38; continue; } if (vk.$length === 0) { $s = -1; return true; } if ((vk.$length === 1) && ((0 >= vk.$length ? ($throwRuntimeError("index out of range"), undefined) : vk.$array[vk.$offset + 0]) === 2)) { $s = -1; return false; } _r$23 = t1.sqr(vk); /* */ $s = 39; case 39: if($c) { $c = false; _r$23 = _r$23.$blk(); } if (_r$23 && _r$23.$blk !== undefined) { break s; } t1 = _r$23; _r$24 = t1.sub(t1, natTwo); /* */ $s = 40; case 40: if($c) { $c = false; _r$24 = _r$24.$blk(); } if (_r$24 && _r$24.$blk !== undefined) { break s; } t1 = _r$24; _r$25 = t2.div(vk, t1, n); /* */ $s = 41; case 41: if($c) { $c = false; _r$25 = _r$25.$blk(); } if (_r$25 && _r$25.$blk !== undefined) { break s; } _tuple$5 = _r$25; t2 = _tuple$5[0]; vk = _tuple$5[1]; t = t + (1) >> 0; $s = 37; continue; case 38: $s = -1; return false; /* */ } return; } if ($f === undefined) { $f = { $blk: nat.prototype.probablyPrimeLucas }; } $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$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$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._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f._tuple$5 = _tuple$5; $f.d = d; $f.i = i; $f.intD = intD; $f.intN = intN; $f.j = j; $f.n = n; $f.natP = natP; $f.nm2 = nm2; $f.p = p; $f.r = r; $f.s = s; $f.t = t; $f.t1 = t1; $f.t1$1 = t1$1; $f.t2 = t2; $f.t2$1 = t2$1; $f.t3 = t3; $f.vk = vk; $f.vk1 = vk1; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(nat).prototype.probablyPrimeLucas = function() { return this.$get().probablyPrimeLucas(); }; nat.prototype.div = function(z2, u, v) { var _r, _tuple, _tuple$1, q, r, r2, u, v, z, z2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; q = $f.q; r = $f.r; r2 = $f.r2; u = $f.u; v = $f.v; z = $f.z; z2 = $f.z2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: 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); $s = -1; return [q, r]; } if (v.$length === 1) { r2 = 0; _tuple = z.divW(u, (0 >= v.$length ? ($throwRuntimeError("index out of range"), undefined) : v.$array[v.$offset + 0])); q = _tuple[0]; r2 = _tuple[1]; r = z2.setWord(r2); $s = -1; return [q, r]; } _r = z.divLarge(z2, u, v); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple$1 = _r; q = _tuple$1[0]; r = _tuple$1[1]; $s = -1; return [q, r]; /* */ } return; } if ($f === undefined) { $f = { $blk: nat.prototype.div }; } $f._r = _r; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.q = q; $f.r = r; $f.r2 = r2; $f.u = u; $f.v = v; $f.z = z; $f.z2 = z2; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(nat).prototype.div = function(z2, u, v) { return this.$get().div(z2, u, v); }; nat.prototype.divW = function(x, y) { var 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($convertSliceType(z, sliceType$2), 0, $convertSliceType(x, sliceType$2), y); q = z.norm(); return [q, r]; }; $ptrType(nat).prototype.divW = function(x, y) { return this.$get().divW(x, y); }; nat.prototype.modW = function(d) { var d, q, r, x; r = 0; x = this; q = nat.nil; q = q.make(x.$length); r = divWVW($convertSliceType(q, sliceType$2), 0, $convertSliceType(x, sliceType$2), d); return r; }; $ptrType(nat).prototype.modW = function(d) { return this.$get().modW(d); }; divWVW = function(z, xn, x, y) { var _tuple, _tuple$1, i, qq, r, rec, rr, x, xn, y, z; r = 0; r = xn; if (x.$length === 1) { _tuple = bits.Div(((r >>> 0)), (((0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0]) >>> 0)), ((y >>> 0))); qq = _tuple[0]; rr = _tuple[1]; (0 >= z.$length ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + 0] = ((qq >>> 0))); r = ((rr >>> 0)); return r; } rec = reciprocalWord(y); i = z.$length - 1 >> 0; while (true) { if (!(i >= 0)) { break; } _tuple$1 = divWW(r, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]), y, rec); ((i < 0 || i >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + i] = _tuple$1[0]); r = _tuple$1[1]; i = i - (1) >> 0; } r = r; return r; }; nat.prototype.divLarge = function(u, uIn, vIn) { var _r, _tmp, _tmp$1, m, n, q, r, shift, u, uIn, v, vIn, vp, x, x$1, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; m = $f.m; n = $f.n; q = $f.q; r = $f.r; shift = $f.shift; u = $f.u; uIn = $f.uIn; v = $f.v; vIn = $f.vIn; vp = $f.vp; x = $f.x; x$1 = $f.x$1; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: q = nat.nil; r = nat.nil; z = this; n = vIn.$length; m = uIn.$length - n >> 0; shift = nlz((x = n - 1 >> 0, ((x < 0 || x >= vIn.$length) ? ($throwRuntimeError("index out of range"), undefined) : vIn.$array[vIn.$offset + x]))); _r = getNat(n); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } vp = _r; v = vp.$get(); shlVU($convertSliceType(v, sliceType$2), $convertSliceType(vIn, sliceType$2), shift); u = u.make(uIn.$length + 1 >> 0); (x$1 = uIn.$length, ((x$1 < 0 || x$1 >= u.$length) ? ($throwRuntimeError("index out of range"), undefined) : u.$array[u.$offset + x$1] = shlVU($convertSliceType($subslice(u, 0, uIn.$length), sliceType$2), $convertSliceType(uIn, sliceType$2), shift))); if (alias(z, u)) { z = nat.nil; } q = z.make(m + 1 >> 0); /* */ if (n < 100) { $s = 2; continue; } /* */ $s = 3; continue; /* if (n < 100) { */ case 2: $r = q.divBasic(u, v); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 4; continue; /* } else { */ case 3: $r = q.divRecursive(u, v); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: putNat(vp); q = q.norm(); shrVU($convertSliceType(u, sliceType$2), $convertSliceType(u, sliceType$2), shift); r = u.norm(); _tmp = q; _tmp$1 = r; q = _tmp; r = _tmp$1; $s = -1; return [q, r]; /* */ } return; } if ($f === undefined) { $f = { $blk: nat.prototype.divLarge }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.m = m; $f.n = n; $f.q = q; $f.r = r; $f.shift = shift; $f.u = u; $f.uIn = uIn; $f.v = v; $f.vIn = vIn; $f.vp = vp; $f.x = x; $f.x$1 = x$1; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(nat).prototype.divLarge = function(u, uIn, vIn) { return this.$get().divLarge(u, uIn, vIn); }; nat.prototype.divBasic = function(u, v) { var _index, _r, _tuple, _tuple$1, _tuple$2, c, c$1, j, m, n, prevRhat, q, qhat, qhatv, qhatvp, qhl, rec, rhat, u, ujn, ujn2, v, vn1, vn2, x, x$1, x$2, x$3, x$4, x1, x2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _index = $f._index; _r = $f._r; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; c = $f.c; c$1 = $f.c$1; j = $f.j; m = $f.m; n = $f.n; prevRhat = $f.prevRhat; q = $f.q; qhat = $f.qhat; qhatv = $f.qhatv; qhatvp = $f.qhatvp; qhl = $f.qhl; rec = $f.rec; rhat = $f.rhat; u = $f.u; ujn = $f.ujn; ujn2 = $f.ujn2; v = $f.v; vn1 = $f.vn1; vn2 = $f.vn2; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x1 = $f.x1; x2 = $f.x2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: q = this; n = v.$length; m = u.$length - n >> 0; _r = getNat(n + 1 >> 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } qhatvp = _r; qhatv = qhatvp.$get(); vn1 = (x = n - 1 >> 0, ((x < 0 || x >= v.$length) ? ($throwRuntimeError("index out of range"), undefined) : v.$array[v.$offset + x])); rec = reciprocalWord(vn1); j = m; while (true) { if (!(j >= 0)) { break; } qhat = 4294967295; ujn = 0; if ((j + n >> 0) < u.$length) { ujn = (x$1 = j + n >> 0, ((x$1 < 0 || x$1 >= u.$length) ? ($throwRuntimeError("index out of range"), undefined) : u.$array[u.$offset + x$1])); } if (!((ujn === vn1))) { rhat = 0; _tuple = divWW(ujn, (x$2 = (j + n >> 0) - 1 >> 0, ((x$2 < 0 || x$2 >= u.$length) ? ($throwRuntimeError("index out of range"), undefined) : u.$array[u.$offset + x$2])), vn1, rec); qhat = _tuple[0]; rhat = _tuple[1]; vn2 = (x$3 = n - 2 >> 0, ((x$3 < 0 || x$3 >= v.$length) ? ($throwRuntimeError("index out of range"), undefined) : v.$array[v.$offset + x$3])); _tuple$1 = mulWW(qhat, vn2); x1 = _tuple$1[0]; x2 = _tuple$1[1]; ujn2 = (x$4 = (j + n >> 0) - 2 >> 0, ((x$4 < 0 || x$4 >= u.$length) ? ($throwRuntimeError("index out of range"), undefined) : u.$array[u.$offset + x$4])); while (true) { if (!(greaterThan(x1, x2, rhat, ujn2))) { break; } qhat = qhat - (1) >>> 0; prevRhat = rhat; rhat = rhat + (vn1) >>> 0; if (rhat < prevRhat) { break; } _tuple$2 = mulWW(qhat, vn2); x1 = _tuple$2[0]; x2 = _tuple$2[1]; } } ((n < 0 || n >= qhatv.$length) ? ($throwRuntimeError("index out of range"), undefined) : qhatv.$array[qhatv.$offset + n] = mulAddVWW($convertSliceType($subslice(qhatv, 0, n), sliceType$2), $convertSliceType(v, sliceType$2), qhat, 0)); qhl = qhatv.$length; if ((j + qhl >> 0) > u.$length && (((n < 0 || n >= qhatv.$length) ? ($throwRuntimeError("index out of range"), undefined) : qhatv.$array[qhatv.$offset + n]) === 0)) { qhl = qhl - (1) >> 0; } c = subVV($convertSliceType($subslice(u, j, (j + qhl >> 0)), sliceType$2), $convertSliceType($subslice(u, j), sliceType$2), $convertSliceType(qhatv, sliceType$2)); if (!((c === 0))) { c$1 = addVV($convertSliceType($subslice(u, j, (j + n >> 0)), sliceType$2), $convertSliceType($subslice(u, j), sliceType$2), $convertSliceType(v, sliceType$2)); if (n < qhl) { _index = j + n >> 0; ((_index < 0 || _index >= u.$length) ? ($throwRuntimeError("index out of range"), undefined) : u.$array[u.$offset + _index] = (((_index < 0 || _index >= u.$length) ? ($throwRuntimeError("index out of range"), undefined) : u.$array[u.$offset + _index]) + (c$1) >>> 0)); } qhat = qhat - (1) >>> 0; } if ((j === m) && (m === q.$length) && (qhat === 0)) { j = j - (1) >> 0; continue; } ((j < 0 || j >= q.$length) ? ($throwRuntimeError("index out of range"), undefined) : q.$array[q.$offset + j] = qhat); j = j - (1) >> 0; } putNat(qhatvp); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: nat.prototype.divBasic }; } $f._index = _index; $f._r = _r; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.c = c; $f.c$1 = c$1; $f.j = j; $f.m = m; $f.n = n; $f.prevRhat = prevRhat; $f.q = q; $f.qhat = qhat; $f.qhatv = qhatv; $f.qhatvp = qhatvp; $f.qhl = qhl; $f.rec = rec; $f.rhat = rhat; $f.u = u; $f.ujn = ujn; $f.ujn2 = ujn2; $f.v = v; $f.vn1 = vn1; $f.vn2 = vn2; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x1 = x1; $f.x2 = x2; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(nat).prototype.divBasic = function(u, v) { return this.$get().divBasic(u, v); }; greaterThan = function(x1, x2, y1, y2) { var x1, x2, y1, y2; return x1 > y1 || (x1 === y1) && x2 > y2; }; nat.prototype.divRecursive = function(u, v) { var _i, _r, _ref, n, recDepth, temps, tmp, u, v, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _ref = $f._ref; n = $f.n; recDepth = $f.recDepth; temps = $f.temps; tmp = $f.tmp; u = $f.u; v = $f.v; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; recDepth = $imul(2, bits.Len(((v.$length >>> 0)))); _r = getNat($imul(3, v.$length)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } tmp = _r; temps = $makeSlice(sliceType$3, recDepth); z.clear(); $r = z.divRecursiveStep(u, v, 0, tmp, temps); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _ref = temps; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } n = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (!(n === ptrType$3.nil)) { putNat(n); } _i++; } putNat(tmp); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: nat.prototype.divRecursive }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f.n = n; $f.recDepth = recDepth; $f.temps = temps; $f.tmp = tmp; $f.u = u; $f.v = v; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(nat).prototype.divRecursive = function(u, v) { return this.$get().divRecursive(u, v); }; nat.prototype.divRecursiveStep = function(u, v, depth, tmp, temps) { var B, _q, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, c, c$1, c$2, c$3, depth, e, e$1, i, i$1, j, m, n, qhat, qhat$1, qhatv, qhatv$1, s, s$1, temps, tmp, u, uu, v, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; B = $f.B; _q = $f._q; _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; c = $f.c; c$1 = $f.c$1; c$2 = $f.c$2; c$3 = $f.c$3; depth = $f.depth; e = $f.e; e$1 = $f.e$1; i = $f.i; i$1 = $f.i$1; j = $f.j; m = $f.m; n = $f.n; qhat = $f.qhat; qhat$1 = $f.qhat$1; qhatv = $f.qhatv; qhatv$1 = $f.qhatv$1; s = $f.s; s$1 = $f.s$1; temps = $f.temps; tmp = $f.tmp; u = $f.u; uu = $f.uu; v = $f.v; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; u = u.norm(); v = v.norm(); if (u.$length === 0) { z.clear(); $s = -1; return; } n = v.$length; /* */ if (n < 100) { $s = 1; continue; } /* */ $s = 2; continue; /* if (n < 100) { */ case 1: $r = z.divBasic(u, v); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 2: m = u.$length - n >> 0; if (m < 0) { $s = -1; return; } B = (_q = n / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); /* */ if (((depth < 0 || depth >= temps.$length) ? ($throwRuntimeError("index out of range"), undefined) : temps.$array[temps.$offset + depth]) === ptrType$3.nil) { $s = 4; continue; } /* */ $s = 5; continue; /* if (((depth < 0 || depth >= temps.$length) ? ($throwRuntimeError("index out of range"), undefined) : temps.$array[temps.$offset + depth]) === ptrType$3.nil) { */ case 4: _r = getNat(n); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } ((depth < 0 || depth >= temps.$length) ? ($throwRuntimeError("index out of range"), undefined) : temps.$array[temps.$offset + depth] = _r); $s = 6; continue; /* } else { */ case 5: ((depth < 0 || depth >= temps.$length) ? ($throwRuntimeError("index out of range"), undefined) : temps.$array[temps.$offset + depth]).$set(((depth < 0 || depth >= temps.$length) ? ($throwRuntimeError("index out of range"), undefined) : temps.$array[temps.$offset + depth]).make(B + 1 >> 0)); /* } */ case 6: j = m; /* while (true) { */ case 8: /* if (!(j > B)) { break; } */ if(!(j > B)) { $s = 9; continue; } s = (B - 1 >> 0); uu = $subslice(u, (j - B >> 0)); qhat = ((depth < 0 || depth >= temps.$length) ? ($throwRuntimeError("index out of range"), undefined) : temps.$array[temps.$offset + depth]).$get(); qhat.clear(); $r = qhat.divRecursiveStep($subslice(uu, s, (B + n >> 0)), $subslice(v, s), depth + 1 >> 0, tmp, temps); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } qhat = qhat.norm(); qhatv = tmp.make($imul(3, n)); qhatv.clear(); _r$1 = qhatv.mul(qhat, $subslice(v, 0, s)); /* */ $s = 11; case 11: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } qhatv = _r$1; i = 0; /* while (true) { */ case 12: /* if (!(i < 2)) { break; } */ if(!(i < 2)) { $s = 13; continue; } e = qhatv.cmp(uu.norm()); if (e <= 0) { /* break; */ $s = 13; continue; } _r$2 = subVW($convertSliceType(qhat, sliceType$2), $convertSliceType(qhat, sliceType$2), 1); /* */ $s = 14; case 14: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; c = subVV($convertSliceType($subslice(qhatv, 0, s), sliceType$2), $convertSliceType($subslice(qhatv, 0, s), sliceType$2), $convertSliceType($subslice(v, 0, s), sliceType$2)); /* */ if (qhatv.$length > s) { $s = 15; continue; } /* */ $s = 16; continue; /* if (qhatv.$length > s) { */ case 15: _r$3 = subVW($convertSliceType($subslice(qhatv, s), sliceType$2), $convertSliceType($subslice(qhatv, s), sliceType$2), c); /* */ $s = 17; case 17: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; /* } */ case 16: $r = addAt($subslice(uu, s), $subslice(v, s), 0); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i = i + (1) >> 0; $s = 12; continue; case 13: if (qhatv.cmp(uu.norm()) > 0) { $panic(new $String("impossible")); } c$1 = subVV($convertSliceType($subslice(uu, 0, qhatv.$length), sliceType$2), $convertSliceType($subslice(uu, 0, qhatv.$length), sliceType$2), $convertSliceType(qhatv, sliceType$2)); /* */ if (c$1 > 0) { $s = 19; continue; } /* */ $s = 20; continue; /* if (c$1 > 0) { */ case 19: _r$4 = subVW($convertSliceType($subslice(uu, qhatv.$length), sliceType$2), $convertSliceType($subslice(uu, qhatv.$length), sliceType$2), c$1); /* */ $s = 21; case 21: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; /* } */ case 20: $r = addAt(z, qhat, j - B >> 0); /* */ $s = 22; case 22: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } j = j - (B) >> 0; $s = 8; continue; case 9: s$1 = B - 1 >> 0; qhat$1 = ((depth < 0 || depth >= temps.$length) ? ($throwRuntimeError("index out of range"), undefined) : temps.$array[temps.$offset + depth]).$get(); qhat$1.clear(); $r = qhat$1.divRecursiveStep($subslice(u, s$1).norm(), $subslice(v, s$1), depth + 1 >> 0, tmp, temps); /* */ $s = 23; case 23: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } qhat$1 = qhat$1.norm(); qhatv$1 = tmp.make($imul(3, n)); qhatv$1.clear(); _r$5 = qhatv$1.mul(qhat$1, $subslice(v, 0, s$1)); /* */ $s = 24; case 24: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } qhatv$1 = _r$5; i$1 = 0; /* while (true) { */ case 25: /* if (!(i$1 < 2)) { break; } */ if(!(i$1 < 2)) { $s = 26; continue; } e$1 = qhatv$1.cmp(u.norm()); /* */ if (e$1 > 0) { $s = 27; continue; } /* */ $s = 28; continue; /* if (e$1 > 0) { */ case 27: _r$6 = subVW($convertSliceType(qhat$1, sliceType$2), $convertSliceType(qhat$1, sliceType$2), 1); /* */ $s = 29; case 29: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; c$2 = subVV($convertSliceType($subslice(qhatv$1, 0, s$1), sliceType$2), $convertSliceType($subslice(qhatv$1, 0, s$1), sliceType$2), $convertSliceType($subslice(v, 0, s$1), sliceType$2)); /* */ if (qhatv$1.$length > s$1) { $s = 30; continue; } /* */ $s = 31; continue; /* if (qhatv$1.$length > s$1) { */ case 30: _r$7 = subVW($convertSliceType($subslice(qhatv$1, s$1), sliceType$2), $convertSliceType($subslice(qhatv$1, s$1), sliceType$2), c$2); /* */ $s = 32; case 32: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$7; /* } */ case 31: $r = addAt($subslice(u, s$1), $subslice(v, s$1), 0); /* */ $s = 33; case 33: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 28: i$1 = i$1 + (1) >> 0; $s = 25; continue; case 26: if (qhatv$1.cmp(u.norm()) > 0) { $panic(new $String("impossible")); } c$3 = subVV($convertSliceType($subslice(u, 0, qhatv$1.$length), sliceType$2), $convertSliceType($subslice(u, 0, qhatv$1.$length), sliceType$2), $convertSliceType(qhatv$1, sliceType$2)); /* */ if (c$3 > 0) { $s = 34; continue; } /* */ $s = 35; continue; /* if (c$3 > 0) { */ case 34: _r$8 = subVW($convertSliceType($subslice(u, qhatv$1.$length), sliceType$2), $convertSliceType($subslice(u, qhatv$1.$length), sliceType$2), c$3); /* */ $s = 36; case 36: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } c$3 = _r$8; /* } */ case 35: if (c$3 > 0) { $panic(new $String("impossible")); } $r = addAt(z, qhat$1.norm(), 0); /* */ $s = 37; case 37: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: nat.prototype.divRecursiveStep }; } $f.B = B; $f._q = _q; $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.c = c; $f.c$1 = c$1; $f.c$2 = c$2; $f.c$3 = c$3; $f.depth = depth; $f.e = e; $f.e$1 = e$1; $f.i = i; $f.i$1 = i$1; $f.j = j; $f.m = m; $f.n = n; $f.qhat = qhat; $f.qhat$1 = qhat$1; $f.qhatv = qhatv; $f.qhatv$1 = qhatv$1; $f.s = s; $f.s$1 = s$1; $f.temps = temps; $f.tmp = tmp; $f.u = u; $f.uu = uu; $f.v = v; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(nat).prototype.divRecursiveStep = function(u, v, depth, tmp, temps) { return this.$get().divRecursiveStep(u, v, depth, tmp, temps); }; maxPow = function(b) { var _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 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 _1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _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, b1, base, baseOk, bn, ch, count, d1, di, dp, err, fracOk, i, invalSep, n, prefix, prev, r, res, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._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; _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$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; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; 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; invalSep = $f.invalSep; n = $f.n; prefix = $f.prefix; prev = $f.prev; 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 <= 62 || fracOk && ((base === 2) || (base === 8) || (base === 10) || (base === 16)); /* */ if (!baseOk) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!baseOk) { */ case 1: _r = fmt.Sprintf("invalid number base %d", new sliceType([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: prev = 46; invalSep = false; _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]; _tmp = base; _tmp$1 = 0; b = _tmp; prefix = _tmp$1; /* */ if (base === 0) { $s = 5; continue; } /* */ $s = 6; continue; /* if (base === 0) { */ case 5: b = 10; /* */ if ($interfaceIsEqual(err, $ifaceNil) && (ch === 48)) { $s = 7; continue; } /* */ $s = 8; continue; /* if ($interfaceIsEqual(err, $ifaceNil) && (ch === 48)) { */ case 7: prev = 48; count = 1; _r$2 = r.ReadByte(); /* */ $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; ch = _tuple$1[0]; err = _tuple$1[1]; /* */ if ($interfaceIsEqual(err, $ifaceNil)) { $s = 10; continue; } /* */ $s = 11; continue; /* if ($interfaceIsEqual(err, $ifaceNil)) { */ case 10: _1 = ch; if ((_1 === (98)) || (_1 === (66))) { _tmp$2 = 2; _tmp$3 = 98; b = _tmp$2; prefix = _tmp$3; } else if ((_1 === (111)) || (_1 === (79))) { _tmp$4 = 8; _tmp$5 = 111; b = _tmp$4; prefix = _tmp$5; } else if ((_1 === (120)) || (_1 === (88))) { _tmp$6 = 16; _tmp$7 = 120; b = _tmp$6; prefix = _tmp$7; } else if (!fracOk) { _tmp$8 = 8; _tmp$9 = 48; b = _tmp$8; prefix = _tmp$9; } /* */ if (!((prefix === 0))) { $s = 12; continue; } /* */ $s = 13; continue; /* if (!((prefix === 0))) { */ case 12: count = 0; /* */ if (!((prefix === 48))) { $s = 14; continue; } /* */ $s = 15; continue; /* if (!((prefix === 48))) { */ case 14: _r$3 = r.ReadByte(); /* */ $s = 16; case 16: 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]; /* } */ case 15: /* } */ case 13: /* } */ case 11: /* } */ 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 17: /* if (!($interfaceIsEqual(err, $ifaceNil))) { break; } */ if(!($interfaceIsEqual(err, $ifaceNil))) { $s = 18; continue; } /* */ if ((ch === 46) && fracOk) { $s = 19; continue; } /* */ if ((ch === 95) && (base === 0)) { $s = 20; continue; } /* */ $s = 21; continue; /* if ((ch === 46) && fracOk) { */ case 19: fracOk = false; if (prev === 95) { invalSep = true; } prev = 46; dp = count; $s = 22; continue; /* } else if ((ch === 95) && (base === 0)) { */ case 20: if (!((prev === 48))) { invalSep = true; } prev = 95; $s = 22; continue; /* } else { */ case 21: 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) { if (b <= 36) { d1 = ((((ch - 65 << 24 >>> 24) + 10 << 24 >>> 24) >>> 0)); } else { d1 = ((((ch - 65 << 24 >>> 24) + 36 << 24 >>> 24) >>> 0)); } } else { d1 = 63; } /* */ if (d1 >= b1) { $s = 23; continue; } /* */ $s = 24; continue; /* if (d1 >= b1) { */ case 23: _r$4 = r.UnreadByte(); /* */ $s = 25; case 25: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; /* break; */ $s = 18; continue; /* } */ case 24: prev = 48; 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; } /* } */ case 22: _r$5 = r.ReadByte(); /* */ $s = 26; case 26: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$4 = _r$5; ch = _tuple$4[0]; err = _tuple$4[1]; $s = 17; continue; case 18: if ($interfaceIsEqual(err, io.EOF)) { err = $ifaceNil; } if ($interfaceIsEqual(err, $ifaceNil) && (invalSep || (prev === 95))) { err = errInvalSep; } if (count === 0) { if (prefix === 48) { _tmp$10 = $subslice(z, 0, 0); _tmp$11 = 10; _tmp$12 = 1; _tmp$13 = err; res = _tmp$10; b = _tmp$11; count = _tmp$12; err = _tmp$13; $s = -1; return [res, b, count, err]; } err = errNoDigits; } if (i > 0) { z = z.mulAddWW(z, pow(b1, i), di); } res = z.norm(); if (dp >= 0) { count = dp - count >> 0; } $s = -1; return [res, b, count, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: nat.prototype.scan }; } $f._1 = _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._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$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._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $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.invalSep = invalSep; $f.n = n; $f.prefix = prefix; $f.prev = prev; $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 $24r, _r, base, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; base = $f.base; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: x = this; _r = x.itoa(false, base); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: nat.prototype.utoa }; } $f.$24r = $24r; $f._r = _r; $f.base = base; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(nat).prototype.utoa = function(base) { return this.$get().utoa(base); }; nat.prototype.itoa = function(neg, base) { var _r, _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, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; b = $f.b; base = $f.base; bb = $f.bb; i = $f.i; k = $f.k; mask = $f.mask; nbits = $f.nbits; ndigits = $f.ndigits; neg = $f.neg; q = $f.q; s = $f.s; shift = $f.shift; table = $f.table; w = $f.w; x = $f.x; y = $f.y; y$1 = $f.y$1; y$2 = $f.y$2; y$3 = $f.y$3; y$4 = $f.y$4; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: x = this; if (base < 2 || base > 62) { $panic(new $String("invalid base")); } if (x.$length === 0) { $s = -1; return (new sliceType$1($stringToBytes("0"))); } i = (((x.bitLen()) / math.Log2((base)) >> 0)) + 1 >> 0; if (neg) { i = i + (1) >> 0; } s = $makeSlice(sliceType$1, i); b = ((base >>> 0)); /* */ if (b === ((b & (-b >>> 0)) >>> 0)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (b === ((b & (-b >>> 0)) >>> 0)) { */ case 1: shift = ((bits.TrailingZeros(((b >>> 0))) >>> 0)); mask = ((((y = shift, y < 32 ? (1 << y) : 0) >>> 0) - 1 >>> 0)); w = (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : 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"), undefined) : s.$array[s.$offset + i] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".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"), undefined) : 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"), undefined) : x.$array[x.$offset + k]) << y$2) : 0) >>> 0))) >>> 0; i = i - (1) >> 0; ((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charCodeAt(((w & mask) >>> 0))); w = (y$3 = ((shift - nbits >>> 0)), y$3 < 32 ? (((k < 0 || k >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : 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"), undefined) : s.$array[s.$offset + i] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charCodeAt(((w & mask) >>> 0))); w = (y$4 = (shift), y$4 < 32 ? (w >>> y$4) : 0) >>> 0; } $s = 3; continue; /* } else { */ case 2: _tuple = maxPow(b); bb = _tuple[0]; ndigits = _tuple[1]; _r = divisors(x.$length, b, ndigits, bb); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } table = _r; q = (nat.nil).set(x); $r = q.convertWords(s, b, ndigits, bb, table); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i = 0; while (true) { if (!(((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]) === 48)) { break; } i = i + (1) >> 0; } /* } */ case 3: if (neg) { i = i - (1) >> 0; ((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i] = 45); } $s = -1; return $subslice(s, i); /* */ } return; } if ($f === undefined) { $f = { $blk: nat.prototype.itoa }; } $f._r = _r; $f._tuple = _tuple; $f.b = b; $f.base = base; $f.bb = bb; $f.i = i; $f.k = k; $f.mask = mask; $f.nbits = nbits; $f.ndigits = ndigits; $f.neg = neg; $f.q = q; $f.s = s; $f.shift = shift; $f.table = table; $f.w = w; $f.x = x; $f.y = y; $f.y$1 = y$1; $f.y$2 = y$2; $f.y$3 = y$3; $f.y$4 = y$4; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(nat).prototype.itoa = function(neg, base) { return this.$get().itoa(neg, base); }; nat.prototype.convertWords = function(s, b, ndigits, bb, table) { var _q, _q$1, _r, _r$1, _tuple, _tuple$1, _tuple$2, b, bb, h, i, index, j, j$1, maxLength, minLength, ndigits, q, r, r$1, s, t, table, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _q = $f._q; _q$1 = $f._q$1; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; b = $f.b; bb = $f.bb; h = $f.h; i = $f.i; index = $f.index; j = $f.j; j$1 = $f.j$1; maxLength = $f.maxLength; minLength = $f.minLength; ndigits = $f.ndigits; q = $f.q; r = $f.r; r$1 = $f.r$1; s = $f.s; t = $f.t; table = $f.table; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: q = this; /* */ if (!(table === sliceType$4.nil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(table === sliceType$4.nil)) { */ case 1: r = nat.nil; index = table.$length - 1 >> 0; /* while (true) { */ case 3: /* if (!(q.$length > leafSize)) { break; } */ if(!(q.$length > leafSize)) { $s = 4; continue; } 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"), undefined) : table.$array[table.$offset + x])).nbits > minLength)) { break; } index = index - (1) >> 0; } if (((index < 0 || index >= table.$length) ? ($throwRuntimeError("index out of range"), undefined) : table.$array[table.$offset + index]).nbits >= maxLength && ((index < 0 || index >= table.$length) ? ($throwRuntimeError("index out of range"), undefined) : table.$array[table.$offset + index]).bbb.cmp(q) >= 0) { index = index - (1) >> 0; if (index < 0) { $panic(new $String("internal inconsistency")); } } _r = q.div(r, q, ((index < 0 || index >= table.$length) ? ($throwRuntimeError("index out of range"), undefined) : table.$array[table.$offset + index]).bbb); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; q = _tuple[0]; r = _tuple[1]; h = s.$length - ((index < 0 || index >= table.$length) ? ($throwRuntimeError("index out of range"), undefined) : table.$array[table.$offset + index]).ndigits >> 0; $r = r.convertWords($subslice(s, h), b, ndigits, bb, $subslice(table, 0, index)); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } s = $subslice(s, 0, h); $s = 3; continue; case 4: /* } */ case 2: 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"), undefined) : s.$array[s.$offset + i] = (48 + (((r$1 - ($imul(t, 10) >>> 0) >>> 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"), undefined) : s.$array[s.$offset + i] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charCodeAt((_r$1 = r$1 % b, _r$1 === _r$1 ? _r$1 : $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"), undefined) : s.$array[s.$offset + i] = 48); } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: nat.prototype.convertWords }; } $f._q = _q; $f._q$1 = _q$1; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.b = b; $f.bb = bb; $f.h = h; $f.i = i; $f.index = index; $f.j = j; $f.j$1 = j$1; $f.maxLength = maxLength; $f.minLength = minLength; $f.ndigits = ndigits; $f.q = q; $f.r = r; $f.r$1 = r$1; $f.s = s; $f.t = t; $f.table = table; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; $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 $24r, _r, x, y, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; x = $f.x; y = $f.y; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; _r = z.expNN((nat.nil).setWord(x), (nat.nil).setWord(y), nat.nil); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: nat.prototype.expWW }; } $f.$24r = $24r; $f._r = _r; $f.x = x; $f.y = y; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(nat).prototype.expWW = function(x, y) { return this.$get().expWW(x, y); }; divisors = function(m, b, ndigits, bb) { var _r, _r$1, b, bb, i, k, larger, m, ndigits, table, words, x, x$1, x$2, y, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; b = $f.b; bb = $f.bb; i = $f.i; k = $f.k; larger = $f.larger; m = $f.m; ndigits = $f.ndigits; table = $f.table; words = $f.words; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; y = $f.y; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if ((leafSize === 0) || m <= leafSize) { $s = -1; return sliceType$4.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$4.nil; if (b === 10) { cacheBase10.Mutex.Lock(); table = $subslice(new sliceType$4(cacheBase10.table), 0, k); } else { table = $makeSlice(sliceType$4, k); } /* */ if ((x = k - 1 >> 0, ((x < 0 || x >= table.$length) ? ($throwRuntimeError("index out of range"), undefined) : table.$array[table.$offset + x])).ndigits === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if ((x = k - 1 >> 0, ((x < 0 || x >= table.$length) ? ($throwRuntimeError("index out of range"), undefined) : table.$array[table.$offset + x])).ndigits === 0) { */ case 1: larger = nat.nil; i = 0; /* while (true) { */ case 3: /* if (!(i < k)) { break; } */ if(!(i < k)) { $s = 4; continue; } /* */ if (((i < 0 || i >= table.$length) ? ($throwRuntimeError("index out of range"), undefined) : table.$array[table.$offset + i]).ndigits === 0) { $s = 5; continue; } /* */ $s = 6; continue; /* if (((i < 0 || i >= table.$length) ? ($throwRuntimeError("index out of range"), undefined) : table.$array[table.$offset + i]).ndigits === 0) { */ case 5: /* */ if (i === 0) { $s = 7; continue; } /* */ $s = 8; continue; /* if (i === 0) { */ case 7: _r = (nat.nil).expWW(bb, ((leafSize >>> 0))); /* */ $s = 10; case 10: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } (0 >= table.$length ? ($throwRuntimeError("index out of range"), undefined) : table.$array[table.$offset + 0]).bbb = _r; (0 >= table.$length ? ($throwRuntimeError("index out of range"), undefined) : table.$array[table.$offset + 0]).ndigits = $imul(ndigits, leafSize); $s = 9; continue; /* } else { */ case 8: _r$1 = (nat.nil).sqr((x$1 = i - 1 >> 0, ((x$1 < 0 || x$1 >= table.$length) ? ($throwRuntimeError("index out of range"), undefined) : table.$array[table.$offset + x$1])).bbb); /* */ $s = 11; case 11: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } ((i < 0 || i >= table.$length) ? ($throwRuntimeError("index out of range"), undefined) : table.$array[table.$offset + i]).bbb = _r$1; ((i < 0 || i >= table.$length) ? ($throwRuntimeError("index out of range"), undefined) : table.$array[table.$offset + i]).ndigits = $imul(2, (x$2 = i - 1 >> 0, ((x$2 < 0 || x$2 >= table.$length) ? ($throwRuntimeError("index out of range"), undefined) : table.$array[table.$offset + x$2])).ndigits); /* } */ case 9: larger = (nat.nil).set(((i < 0 || i >= table.$length) ? ($throwRuntimeError("index out of range"), undefined) : table.$array[table.$offset + i]).bbb); while (true) { if (!(mulAddVWW($convertSliceType(larger, sliceType$2), $convertSliceType(larger, sliceType$2), b, 0) === 0)) { break; } ((i < 0 || i >= table.$length) ? ($throwRuntimeError("index out of range"), undefined) : table.$array[table.$offset + i]).bbb = ((i < 0 || i >= table.$length) ? ($throwRuntimeError("index out of range"), undefined) : table.$array[table.$offset + i]).bbb.set(larger); ((i < 0 || i >= table.$length) ? ($throwRuntimeError("index out of range"), undefined) : table.$array[table.$offset + i]).ndigits = ((i < 0 || i >= table.$length) ? ($throwRuntimeError("index out of range"), undefined) : table.$array[table.$offset + i]).ndigits + (1) >> 0; } ((i < 0 || i >= table.$length) ? ($throwRuntimeError("index out of range"), undefined) : table.$array[table.$offset + i]).nbits = ((i < 0 || i >= table.$length) ? ($throwRuntimeError("index out of range"), undefined) : table.$array[table.$offset + i]).bbb.bitLen(); /* } */ case 6: i = i + (1) >> 0; $s = 3; continue; case 4: /* } */ case 2: if (b === 10) { cacheBase10.Mutex.Unlock(); } $s = -1; return table; /* */ } return; } if ($f === undefined) { $f = { $blk: divisors }; } $f._r = _r; $f._r$1 = _r$1; $f.b = b; $f.bb = bb; $f.i = i; $f.k = k; $f.larger = larger; $f.m = m; $f.ndigits = ndigits; $f.table = table; $f.words = words; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.y = y; $f.$s = $s; $f.$r = $r; return $f; }; nat.prototype.clear = function() { var _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"), undefined) : z.$array[z.$offset + i] = 0); _i++; } }; $ptrType(nat).prototype.clear = function() { return this.$get().clear(); }; nat.prototype.norm = function() { var 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"), undefined) : 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 n, z; z = this; if (n <= z.$capacity) { return $subslice(z, 0, n); } if (n === 1) { return $makeSlice(nat, 1); } return $makeSlice(nat, n, (n + 4 >> 0)); }; $ptrType(nat).prototype.make = function(n) { return this.$get().make(n); }; nat.prototype.setWord = function(x) { var x, z; z = this; if (x === 0) { return $subslice(z, 0, 0); } z = z.make(1); (0 >= z.$length ? ($throwRuntimeError("index out of range"), undefined) : 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 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); } z = z.make(2); (1 >= z.$length ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + 1] = (($shiftRightUint64(x, 32).$low >>> 0))); (0 >= z.$length ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + 0] = ((x.$low >>> 0))); return z; }; $ptrType(nat).prototype.setUint64 = function(x) { return this.$get().setUint64(x); }; nat.prototype.set = function(x) { var 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 $24r, _r, _r$1, c, m, n, x, y, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; c = $f.c; m = $f.m; n = $f.n; x = $f.x; y = $f.y; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; m = x.$length; n = y.$length; /* */ if (m < n) { $s = 2; continue; } /* */ if ((m === 0)) { $s = 3; continue; } /* */ if ((n === 0)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (m < n) { */ case 2: _r = z.add(y, x); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 7; case 7: return $24r; /* } else if ((m === 0)) { */ case 3: $s = -1; return $subslice(z, 0, 0); /* } else if ((n === 0)) { */ case 4: $s = -1; return z.set(x); /* } */ case 5: case 1: z = z.make(m + 1 >> 0); c = addVV($convertSliceType($subslice(z, 0, n), sliceType$2), $convertSliceType(x, sliceType$2), $convertSliceType(y, sliceType$2)); /* */ if (m > n) { $s = 8; continue; } /* */ $s = 9; continue; /* if (m > n) { */ case 8: _r$1 = addVW($convertSliceType($subslice(z, n, m), sliceType$2), $convertSliceType($subslice(x, n), sliceType$2), c); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } c = _r$1; /* } */ case 9: ((m < 0 || m >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + m] = c); $s = -1; return z.norm(); /* */ } return; } if ($f === undefined) { $f = { $blk: nat.prototype.add }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f.c = c; $f.m = m; $f.n = n; $f.x = x; $f.y = y; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(nat).prototype.add = function(x, y) { return this.$get().add(x, y); }; nat.prototype.sub = function(x, y) { var _r, c, m, n, x, y, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; c = $f.c; m = $f.m; n = $f.n; x = $f.x; y = $f.y; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; m = x.$length; n = y.$length; if (m < n) { $panic(new $String("underflow")); } else if ((m === 0)) { $s = -1; return $subslice(z, 0, 0); } else if ((n === 0)) { $s = -1; return z.set(x); } z = z.make(m); c = subVV($convertSliceType($subslice(z, 0, n), sliceType$2), $convertSliceType(x, sliceType$2), $convertSliceType(y, sliceType$2)); /* */ if (m > n) { $s = 1; continue; } /* */ $s = 2; continue; /* if (m > n) { */ case 1: _r = subVW($convertSliceType($subslice(z, n), sliceType$2), $convertSliceType($subslice(x, n), sliceType$2), c); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } c = _r; /* } */ case 2: if (!((c === 0))) { $panic(new $String("underflow")); } $s = -1; return z.norm(); /* */ } return; } if ($f === undefined) { $f = { $blk: nat.prototype.sub }; } $f._r = _r; $f.c = c; $f.m = m; $f.n = n; $f.x = x; $f.y = y; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(nat).prototype.sub = function(x, y) { return this.$get().sub(x, y); }; nat.prototype.cmp = function(y) { var 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"), undefined) : x.$array[x.$offset + i]) === ((i < 0 || i >= y.$length) ? ($throwRuntimeError("index out of range"), undefined) : y.$array[y.$offset + i])))) { break; } i = i - (1) >> 0; } if (((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]) < ((i < 0 || i >= y.$length) ? ($throwRuntimeError("index out of range"), undefined) : y.$array[y.$offset + i])) { r = -1; } else if (((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]) > ((i < 0 || i >= y.$length) ? ($throwRuntimeError("index out of range"), undefined) : 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 m, r, x, 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"), undefined) : z.$array[z.$offset + m] = mulAddVWW($convertSliceType($subslice(z, 0, m), sliceType$2), $convertSliceType(x, sliceType$2), 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 _i, _ref, d, i, x, x$1, 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"), undefined) : _ref.$array[_ref.$offset + _i]); if (!((d === 0))) { (x$1 = x.$length + i >> 0, ((x$1 < 0 || x$1 >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + x$1] = addMulVVW($convertSliceType($subslice(z, i, (i + x.$length >> 0)), sliceType$2), $convertSliceType(x, sliceType$2), d))); } _i++; } }; nat.prototype.montgomery = function(x, y, m, k, n) { var 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($imul(n, 2)); z.clear(); c = 0; i = 0; while (true) { if (!(i < n)) { break; } d = ((i < 0 || i >= y.$length) ? ($throwRuntimeError("index out of range"), undefined) : y.$array[y.$offset + i]); c2 = addMulVVW($convertSliceType($subslice(z, i, (n + i >> 0)), sliceType$2), $convertSliceType(x, sliceType$2), d); t = $imul(((i < 0 || i >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + i]), k) >>> 0; c3 = addMulVVW($convertSliceType($subslice(z, i, (n + i >> 0)), sliceType$2), $convertSliceType(m, sliceType$2), t); cx = c + c2 >>> 0; cy = cx + c3 >>> 0; (x$1 = n + i >> 0, ((x$1 < 0 || x$1 >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : 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($convertSliceType($subslice(z, 0, n), sliceType$2), $convertSliceType($subslice(z, n), sliceType$2), $convertSliceType(m, sliceType$2)); } else { $copySlice($subslice(z, 0, n), $subslice(z, n)); } return $subslice(z, 0, n); }; $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 _r, c, n, x, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; c = $f.c; n = $f.n; x = $f.x; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = addVV($convertSliceType($subslice(z, 0, n), sliceType$2), $convertSliceType(z, sliceType$2), $convertSliceType(x, sliceType$2)); /* */ if (!((c === 0))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((c === 0))) { */ case 1: _r = addVW($convertSliceType($subslice(z, n, (n + (n >> 1 >> 0) >> 0)), sliceType$2), $convertSliceType($subslice(z, n), sliceType$2), c); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: karatsubaAdd }; } $f._r = _r; $f.c = c; $f.n = n; $f.x = x; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; karatsubaSub = function(z, x, n) { var _r, c, n, x, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; c = $f.c; n = $f.n; x = $f.x; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = subVV($convertSliceType($subslice(z, 0, n), sliceType$2), $convertSliceType(z, sliceType$2), $convertSliceType(x, sliceType$2)); /* */ if (!((c === 0))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((c === 0))) { */ case 1: _r = subVW($convertSliceType($subslice(z, n, (n + (n >> 1 >> 0) >> 0)), sliceType$2), $convertSliceType($subslice(z, n), sliceType$2), c); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: karatsubaSub }; } $f._r = _r; $f.c = c; $f.n = n; $f.x = x; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; karatsuba = function(z, x, y) { var _tmp, _tmp$1, _tmp$2, _tmp$3, n, n2, p, r, s, x, x0, x1, xd, y, y0, y1, yd, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; n = $f.n; n2 = $f.n2; p = $f.p; r = $f.r; s = $f.s; x = $f.x; x0 = $f.x0; x1 = $f.x1; xd = $f.xd; y = $f.y; y0 = $f.y0; y1 = $f.y1; yd = $f.yd; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = y.$length; if (!(((n & 1) === 0)) || n < karatsubaThreshold || n < 2) { basicMul(z, x, y); $s = -1; 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; $r = karatsuba(z, x0, y0); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = karatsuba($subslice(z, n), x1, y1); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } s = 1; xd = $subslice(z, ($imul(2, n)), (($imul(2, n)) + n2 >> 0)); if (!((subVV($convertSliceType(xd, sliceType$2), $convertSliceType(x1, sliceType$2), $convertSliceType(x0, sliceType$2)) === 0))) { s = -s; subVV($convertSliceType(xd, sliceType$2), $convertSliceType(x0, sliceType$2), $convertSliceType(x1, sliceType$2)); } yd = $subslice(z, (($imul(2, n)) + n2 >> 0), ($imul(3, n))); if (!((subVV($convertSliceType(yd, sliceType$2), $convertSliceType(y0, sliceType$2), $convertSliceType(y1, sliceType$2)) === 0))) { s = -s; subVV($convertSliceType(yd, sliceType$2), $convertSliceType(y1, sliceType$2), $convertSliceType(y0, sliceType$2)); } p = $subslice(z, ($imul(n, 3))); $r = karatsuba(p, xd, yd); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } r = $subslice(z, ($imul(n, 4))); $copySlice(r, $subslice(z, 0, ($imul(n, 2)))); $r = karatsubaAdd($subslice(z, n2), r, n); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = karatsubaAdd($subslice(z, n2), $subslice(r, n), n); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (s > 0) { $s = 6; continue; } /* */ $s = 7; continue; /* if (s > 0) { */ case 6: $r = karatsubaAdd($subslice(z, n2), p, n); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 8; continue; /* } else { */ case 7: $r = karatsubaSub($subslice(z, n2), p, n); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 8: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: karatsuba }; } $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f.n = n; $f.n2 = n2; $f.p = p; $f.r = r; $f.s = s; $f.x = x; $f.x0 = x0; $f.x1 = x1; $f.xd = xd; $f.y = y; $f.y0 = y0; $f.y1 = y1; $f.yd = yd; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; alias = function(x, y) { var 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$4)) === (x$2 = $subslice(y, 0, y.$capacity), $indexPtr(x$2.$array, x$2.$offset + (y.$capacity - 1 >> 0), ptrType$4)); }; addAt = function(z, x, i) { var _r, c, i, j, n, x, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; c = $f.c; i = $f.i; j = $f.j; n = $f.n; x = $f.x; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = x.$length; /* */ if (n > 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (n > 0) { */ case 1: c = addVV($convertSliceType($subslice(z, i, (i + n >> 0)), sliceType$2), $convertSliceType($subslice(z, i), sliceType$2), $convertSliceType(x, sliceType$2)); /* */ if (!((c === 0))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!((c === 0))) { */ case 3: j = i + n >> 0; /* */ if (j < z.$length) { $s = 5; continue; } /* */ $s = 6; continue; /* if (j < z.$length) { */ case 5: _r = addVW($convertSliceType($subslice(z, j), sliceType$2), $convertSliceType($subslice(z, j), sliceType$2), c); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; /* } */ case 6: /* } */ case 4: /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: addAt }; } $f._r = _r; $f.c = c; $f.i = i; $f.j = j; $f.n = n; $f.x = x; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; max = function(x, y) { var x, y; if (x > y) { return x; } return y; }; karatsubaLen = function(n, threshold) { var i, n, threshold, y; i = 0; while (true) { if (!(n > threshold)) { 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 $24r, _r, _r$1, _r$2, _r$3, _r$4, i, k, m, n, t, tp, x, x0, x0$1, xi, y, y0, y0$1, y1, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; i = $f.i; k = $f.k; m = $f.m; n = $f.n; t = $f.t; tp = $f.tp; x = $f.x; x0 = $f.x0; x0$1 = $f.x0$1; xi = $f.xi; y = $f.y; y0 = $f.y0; y0$1 = $f.y0$1; y1 = $f.y1; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; m = x.$length; n = y.$length; /* */ if (m < n) { $s = 2; continue; } /* */ if ((m === 0) || (n === 0)) { $s = 3; continue; } /* */ if ((n === 1)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (m < n) { */ case 2: _r = z.mul(y, x); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 7; case 7: return $24r; /* } else if ((m === 0) || (n === 0)) { */ case 3: $s = -1; return $subslice(z, 0, 0); /* } else if ((n === 1)) { */ case 4: $s = -1; return z.mulAddWW(x, (0 >= y.$length ? ($throwRuntimeError("index out of range"), undefined) : y.$array[y.$offset + 0]), 0); /* } */ case 5: case 1: if (alias(z, x) || alias(z, y)) { z = nat.nil; } if (n < karatsubaThreshold) { z = z.make(m + n >> 0); basicMul(z, x, y); $s = -1; return z.norm(); } k = karatsubaLen(n, karatsubaThreshold); x0 = $subslice(x, 0, k); y0 = $subslice(y, 0, k); z = z.make(max($imul(6, k), m + n >> 0)); $r = karatsuba(z, x0, y0); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } z = $subslice(z, 0, (m + n >> 0)); $subslice(z, ($imul(2, k))).clear(); /* */ if (k < n || !((m === n))) { $s = 9; continue; } /* */ $s = 10; continue; /* if (k < n || !((m === n))) { */ case 9: _r$1 = getNat($imul(3, k)); /* */ $s = 11; case 11: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } tp = _r$1; t = tp.$get(); x0$1 = x0.norm(); y1 = $subslice(y, k); _r$2 = t.mul(x0$1, y1); /* */ $s = 12; case 12: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } t = _r$2; $r = addAt(z, t, k); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } y0$1 = y0.norm(); i = k; /* while (true) { */ case 14: /* if (!(i < x.$length)) { break; } */ if(!(i < x.$length)) { $s = 15; continue; } xi = $subslice(x, i); if (xi.$length > k) { xi = $subslice(xi, 0, k); } xi = xi.norm(); _r$3 = t.mul(xi, y0$1); /* */ $s = 16; case 16: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } t = _r$3; $r = addAt(z, t, i); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$4 = t.mul(xi, y1); /* */ $s = 18; case 18: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } t = _r$4; $r = addAt(z, t, i + k >> 0); /* */ $s = 19; case 19: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i = i + (k) >> 0; $s = 14; continue; case 15: putNat(tp); /* } */ case 10: $s = -1; return z.norm(); /* */ } return; } if ($f === undefined) { $f = { $blk: nat.prototype.mul }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.i = i; $f.k = k; $f.m = m; $f.n = n; $f.t = t; $f.tp = tp; $f.x = x; $f.x0 = x0; $f.x0$1 = x0$1; $f.xi = xi; $f.y = y; $f.y0 = y0; $f.y0$1 = y0$1; $f.y1 = y1; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(nat).prototype.mul = function(x, y) { return this.$get().mul(x, y); }; basicSqr = function(z, x) { var _r, _tuple, _tuple$1, d, i, n, t, tp, x, x$1, x$2, x$3, x$4, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; d = $f.d; i = $f.i; n = $f.n; t = $f.t; tp = $f.tp; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = x.$length; _r = getNat($imul(2, n)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } tp = _r; t = tp.$get(); t.clear(); _tuple = mulWW((0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0]), (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])); (1 >= z.$length ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + 1] = _tuple[0]); (0 >= z.$length ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + 0] = _tuple[1]); i = 1; while (true) { if (!(i < n)) { break; } d = ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]); _tuple$1 = mulWW(d, d); (x$1 = ($imul(2, i)) + 1 >> 0, ((x$1 < 0 || x$1 >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + x$1] = _tuple$1[0])); (x$2 = $imul(2, i), ((x$2 < 0 || x$2 >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + x$2] = _tuple$1[1])); (x$3 = $imul(2, i), ((x$3 < 0 || x$3 >= t.$length) ? ($throwRuntimeError("index out of range"), undefined) : t.$array[t.$offset + x$3] = addMulVVW($convertSliceType($subslice(t, i, ($imul(2, i))), sliceType$2), $convertSliceType($subslice(x, 0, i), sliceType$2), d))); i = i + (1) >> 0; } (x$4 = ($imul(2, n)) - 1 >> 0, ((x$4 < 0 || x$4 >= t.$length) ? ($throwRuntimeError("index out of range"), undefined) : t.$array[t.$offset + x$4] = shlVU($convertSliceType($subslice(t, 1, (($imul(2, n)) - 1 >> 0)), sliceType$2), $convertSliceType($subslice(t, 1, (($imul(2, n)) - 1 >> 0)), sliceType$2), 1))); addVV($convertSliceType(z, sliceType$2), $convertSliceType(z, sliceType$2), $convertSliceType(t, sliceType$2)); putNat(tp); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: basicSqr }; } $f._r = _r; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.d = d; $f.i = i; $f.n = n; $f.t = t; $f.tp = tp; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; karatsubaSqr = function(z, x) { var _tmp, _tmp$1, n, n2, p, r, x, x0, x1, xd, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; n = $f.n; n2 = $f.n2; p = $f.p; r = $f.r; x = $f.x; x0 = $f.x0; x1 = $f.x1; xd = $f.xd; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = x.$length; /* */ if (!(((n & 1) === 0)) || n < karatsubaSqrThreshold || n < 2) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(((n & 1) === 0)) || n < karatsubaSqrThreshold || n < 2) { */ case 1: $r = basicSqr($subslice(z, 0, ($imul(2, n))), x); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 2: n2 = n >> 1 >> 0; _tmp = $subslice(x, n2); _tmp$1 = $subslice(x, 0, n2); x1 = _tmp; x0 = _tmp$1; $r = karatsubaSqr(z, x0); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = karatsubaSqr($subslice(z, n), x1); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } xd = $subslice(z, ($imul(2, n)), (($imul(2, n)) + n2 >> 0)); if (!((subVV($convertSliceType(xd, sliceType$2), $convertSliceType(x1, sliceType$2), $convertSliceType(x0, sliceType$2)) === 0))) { subVV($convertSliceType(xd, sliceType$2), $convertSliceType(x0, sliceType$2), $convertSliceType(x1, sliceType$2)); } p = $subslice(z, ($imul(n, 3))); $r = karatsubaSqr(p, xd); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } r = $subslice(z, ($imul(n, 4))); $copySlice(r, $subslice(z, 0, ($imul(n, 2)))); $r = karatsubaAdd($subslice(z, n2), r, n); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = karatsubaAdd($subslice(z, n2), $subslice(r, n), n); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = karatsubaSub($subslice(z, n2), p, n); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: karatsubaSqr }; } $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.n = n; $f.n2 = n2; $f.p = p; $f.r = r; $f.x = x; $f.x0 = x0; $f.x1 = x1; $f.xd = xd; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; nat.prototype.sqr = function(x) { var _r, _r$1, _r$2, _tuple, d, k, n, t, tp, x, x0, x0$1, x1, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; d = $f.d; k = $f.k; n = $f.n; t = $f.t; tp = $f.tp; x = $f.x; x0 = $f.x0; x0$1 = $f.x0$1; x1 = $f.x1; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; n = x.$length; if ((n === 0)) { $s = -1; return $subslice(z, 0, 0); } else if ((n === 1)) { d = (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0]); z = z.make(2); _tuple = mulWW(d, d); (1 >= z.$length ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + 1] = _tuple[0]); (0 >= z.$length ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + 0] = _tuple[1]); $s = -1; return z.norm(); } if (alias(z, x)) { z = nat.nil; } if (n < basicSqrThreshold) { z = z.make($imul(2, n)); basicMul(z, x, x); $s = -1; return z.norm(); } /* */ if (n < karatsubaSqrThreshold) { $s = 1; continue; } /* */ $s = 2; continue; /* if (n < karatsubaSqrThreshold) { */ case 1: z = z.make($imul(2, n)); $r = basicSqr(z, x); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return z.norm(); /* } */ case 2: k = karatsubaLen(n, karatsubaSqrThreshold); x0 = $subslice(x, 0, k); z = z.make(max($imul(6, k), $imul(2, n))); $r = karatsubaSqr(z, x0); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } z = $subslice(z, 0, ($imul(2, n))); $subslice(z, ($imul(2, k))).clear(); /* */ if (k < n) { $s = 5; continue; } /* */ $s = 6; continue; /* if (k < n) { */ case 5: _r = getNat($imul(2, k)); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } tp = _r; t = tp.$get(); x0$1 = x0.norm(); x1 = $subslice(x, k); _r$1 = t.mul(x0$1, x1); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } t = _r$1; $r = addAt(z, t, k); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = addAt(z, t, k); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$2 = t.sqr(x1); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } t = _r$2; $r = addAt(z, t, $imul(2, k)); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } putNat(tp); /* } */ case 6: $s = -1; return z.norm(); /* */ } return; } if ($f === undefined) { $f = { $blk: nat.prototype.sqr }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.d = d; $f.k = k; $f.n = n; $f.t = t; $f.tp = tp; $f.x = x; $f.x0 = x0; $f.x0$1 = x0$1; $f.x1 = x1; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(nat).prototype.sqr = function(x) { return this.$get().sqr(x); }; nat.prototype.mulRange = function(a, b) { var $24r, $24r$1, _arg, _arg$1, _r, _r$1, _r$2, _r$3, a, b, m, x, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _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; a = $f.a; b = $f.b; m = $f.m; x = $f.x; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; /* */ if ((a.$high === 0 && a.$low === 0)) { $s = 2; continue; } /* */ if ((a.$high > b.$high || (a.$high === b.$high && a.$low > b.$low))) { $s = 3; continue; } /* */ if ((a.$high === b.$high && a.$low === b.$low)) { $s = 4; continue; } /* */ if ((x = new $Uint64(a.$high + 0, a.$low + 1), (x.$high === b.$high && x.$low === b.$low))) { $s = 5; continue; } /* */ $s = 6; continue; /* if ((a.$high === 0 && a.$low === 0)) { */ case 2: $s = -1; return z.setUint64(new $Uint64(0, 0)); /* } else if ((a.$high > b.$high || (a.$high === b.$high && a.$low > b.$low))) { */ case 3: $s = -1; return z.setUint64(new $Uint64(0, 1)); /* } else if ((a.$high === b.$high && a.$low === b.$low)) { */ case 4: $s = -1; return z.setUint64(a); /* } else if ((x = new $Uint64(a.$high + 0, a.$low + 1), (x.$high === b.$high && x.$low === b.$low))) { */ case 5: _r = z.mul((nat.nil).setUint64(a), (nat.nil).setUint64(b)); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 8; case 8: return $24r; /* } */ case 6: case 1: m = $div64((new $Uint64(a.$high + b.$high, a.$low + b.$low)), new $Uint64(0, 2), false); _r$1 = (nat.nil).mulRange(a, m); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg = _r$1; _r$2 = (nat.nil).mulRange(new $Uint64(m.$high + 0, m.$low + 1), b); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg$1 = _r$2; _r$3 = z.mul(_arg, _arg$1); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r$1 = _r$3; $s = 12; case 12: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: nat.prototype.mulRange }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $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.a = a; $f.b = b; $f.m = m; $f.x = x; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(nat).prototype.mulRange = function(a, b) { return this.$get().mulRange(a, b); }; getNat = function(n) { var _r, n, v, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; n = $f.n; v = $f.v; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = ptrType$3.nil; _r = natPool.Get(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } v = _r; if (!($interfaceIsEqual(v, $ifaceNil))) { z = $assertType(v, ptrType$3); } if (z === ptrType$3.nil) { z = $newDataPointer(nat.nil, ptrType$3); } z.$set(z.make(n)); $s = -1; return z; /* */ } return; } if ($f === undefined) { $f = { $blk: getNat }; } $f._r = _r; $f.n = n; $f.v = v; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; putNat = function(x) { var x; natPool.Put(x); }; nat.prototype.bitLen = function() { var i, x; x = this; i = x.$length - 1 >> 0; if (i >= 0) { return ($imul(i, 32)) + bits.Len(((((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]) >>> 0))) >> 0; } return 0; }; $ptrType(nat).prototype.bitLen = function() { return this.$get().bitLen(); }; nat.prototype.trailingZeroBits = function() { var 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"), undefined) : x.$array[x.$offset + i]) === 0)) { break; } i = i + (1) >>> 0; } return (i * 32 >>> 0) + ((bits.TrailingZeros(((((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]) >>> 0))) >>> 0)) >>> 0; }; $ptrType(nat).prototype.trailingZeroBits = function() { return this.$get().trailingZeroBits(); }; same = function(x, y) { var x, y; return (x.$length === y.$length) && x.$length > 0 && $indexPtr(x.$array, x.$offset + 0, ptrType$4) === $indexPtr(y.$array, y.$offset + 0, ptrType$4); }; nat.prototype.shl = function(x, s) { var _q, _r, m, n, s, x, z; z = this; if (s === 0) { if (same(z, x)) { return z; } if (!alias(z, x)) { return z.set(x); } } 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"), undefined) : z.$array[z.$offset + n] = shlVU($convertSliceType($subslice(z, (n - m >> 0), n), sliceType$2), $convertSliceType(x, sliceType$2), (_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 _q, _r, m, n, s, x, z; z = this; if (s === 0) { if (same(z, x)) { return z; } if (!alias(z, x)) { return z.set(x); } } 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($convertSliceType(z, sliceType$2), $convertSliceType($subslice(x, (m - n >> 0)), sliceType$2), (_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 _1, _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; _1 = b; if (_1 === (0)) { z = z.make(n); $copySlice(z, x); if (j >= n) { return z; } ((j < 0 || j >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + j] = ((((j < 0 || j >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + j]) & ~(m)) >>> 0)); return z.norm(); } else if (_1 === (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"), undefined) : z.$array[z.$offset + j] = ((((j < 0 || j >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : 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 _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"), undefined) : 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 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"), undefined) : z.$array[z.$offset + i] = ((((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]) & ((i < 0 || i >= y.$length) ? ($throwRuntimeError("index out of range"), undefined) : 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 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"), undefined) : z.$array[z.$offset + i] = ((((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]) & ~((i < 0 || i >= y.$length) ? ($throwRuntimeError("index out of range"), undefined) : 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 _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"), undefined) : z.$array[z.$offset + i] = ((((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]) | ((i < 0 || i >= y.$length) ? ($throwRuntimeError("index out of range"), undefined) : 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 _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"), undefined) : z.$array[z.$offset + i] = ((((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]) ^ ((i < 0 || i >= y.$length) ? ($throwRuntimeError("index out of range"), undefined) : 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); }; nat.prototype.random = function(rand$1, limit, n) { var _1, _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; _1 = $f._1; _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: _1 = 32; /* */ if (_1 === (32)) { $s = 4; continue; } /* */ if (_1 === (64)) { $s = 5; continue; } /* */ $s = 6; continue; /* if (_1 === (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"), undefined) : z.$array[z.$offset + i] = ((_r$1 >>> 0))); _i++; $s = 8; continue; case 9: $s = 7; continue; /* } else if (_1 === (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"), undefined) : 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"), undefined) : z.$array[z.$offset + _index] = ((((_index < 0 || _index >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + _index]) & (mask)) >>> 0)); if (z.cmp(limit) < 0) { /* break; */ $s = 2; continue; } $s = 1; continue; case 2: $s = -1; return z.norm(); /* */ } return; } if ($f === undefined) { $f = { $blk: nat.prototype.random }; } $f._1 = _1; $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 $24r, $24r$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _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, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$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; _r$7 = $f._r$7; _r$8 = $f._r$8; _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$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; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; i = $f.i; j = $f.j; j$1 = $f.j$1; m = $f.m; q = $f.q; r = $f.r; shift = $f.shift; v = $f.v; w = $f.w; x = $f.x; x$1 = $f.x$1; y = $f.y; y$1 = $f.y$1; y$2 = $f.y$2; y$3 = $f.y$3; z = $f.z; zz = $f.zz; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; if (alias(z, x) || alias(z, y)) { z = nat.nil; } if ((m.$length === 1) && ((0 >= m.$length ? ($throwRuntimeError("index out of range"), undefined) : m.$array[m.$offset + 0]) === 1)) { $s = -1; return z.setWord(0); } if (y.$length === 0) { $s = -1; return z.setWord(1); } /* */ if ((y.$length === 1) && ((0 >= y.$length ? ($throwRuntimeError("index out of range"), undefined) : y.$array[y.$offset + 0]) === 1) && !((m.$length === 0))) { $s = 1; continue; } /* */ $s = 2; continue; /* if ((y.$length === 1) && ((0 >= y.$length ? ($throwRuntimeError("index out of range"), undefined) : y.$array[y.$offset + 0]) === 1) && !((m.$length === 0))) { */ case 1: _r = (nat.nil).div(z, x, m); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; z = _tuple[1]; $s = -1; return z; /* } */ case 2: if (!((m.$length === 0))) { z = z.make(m.$length); } z = z.set(x); /* */ if (x.cmp(natOne) > 0 && y.$length > 1 && m.$length > 0) { $s = 4; continue; } /* */ $s = 5; continue; /* if (x.cmp(natOne) > 0 && y.$length > 1 && m.$length > 0) { */ case 4: /* */ if ((((0 >= m.$length ? ($throwRuntimeError("index out of range"), undefined) : m.$array[m.$offset + 0]) & 1) >>> 0) === 1) { $s = 6; continue; } /* */ $s = 7; continue; /* if ((((0 >= m.$length ? ($throwRuntimeError("index out of range"), undefined) : m.$array[m.$offset + 0]) & 1) >>> 0) === 1) { */ case 6: _r$1 = z.expNNMontgomery(x, y, m); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 9; case 9: return $24r; /* } */ case 7: _r$2 = z.expNNWindowed(x, y, m); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r$1 = _r$2; $s = 11; case 11: return $24r$1; /* } */ case 5: v = (x$1 = y.$length - 1 >> 0, ((x$1 < 0 || x$1 >= y.$length) ? ($throwRuntimeError("index out of range"), undefined) : 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) { */ case 12: /* if (!(j < w)) { break; } */ if(!(j < w)) { $s = 13; continue; } _r$3 = zz.sqr(z); /* */ $s = 14; case 14: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } zz = _r$3; _tmp$2 = z; _tmp$3 = zz; zz = _tmp$2; z = _tmp$3; /* */ if (!((((v & 2147483648) >>> 0) === 0))) { $s = 15; continue; } /* */ $s = 16; continue; /* if (!((((v & 2147483648) >>> 0) === 0))) { */ case 15: _r$4 = zz.mul(z, x); /* */ $s = 17; case 17: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } zz = _r$4; _tmp$4 = z; _tmp$5 = zz; zz = _tmp$4; z = _tmp$5; /* } */ case 16: /* */ if (!((m.$length === 0))) { $s = 18; continue; } /* */ $s = 19; continue; /* if (!((m.$length === 0))) { */ case 18: _r$5 = zz.div(r, z, m); /* */ $s = 20; case 20: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$1 = _r$5; 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; /* } */ case 19: v = (y$2 = (1), y$2 < 32 ? (v << y$2) : 0) >>> 0; j = j + (1) >> 0; $s = 12; continue; case 13: i = y.$length - 2 >> 0; /* while (true) { */ case 21: /* if (!(i >= 0)) { break; } */ if(!(i >= 0)) { $s = 22; continue; } v = ((i < 0 || i >= y.$length) ? ($throwRuntimeError("index out of range"), undefined) : y.$array[y.$offset + i]); j$1 = 0; /* while (true) { */ case 23: /* if (!(j$1 < 32)) { break; } */ if(!(j$1 < 32)) { $s = 24; continue; } _r$6 = zz.sqr(z); /* */ $s = 25; case 25: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } zz = _r$6; _tmp$10 = z; _tmp$11 = zz; zz = _tmp$10; z = _tmp$11; /* */ if (!((((v & 2147483648) >>> 0) === 0))) { $s = 26; continue; } /* */ $s = 27; continue; /* if (!((((v & 2147483648) >>> 0) === 0))) { */ case 26: _r$7 = zz.mul(z, x); /* */ $s = 28; case 28: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } zz = _r$7; _tmp$12 = z; _tmp$13 = zz; zz = _tmp$12; z = _tmp$13; /* } */ case 27: /* */ if (!((m.$length === 0))) { $s = 29; continue; } /* */ $s = 30; continue; /* if (!((m.$length === 0))) { */ case 29: _r$8 = zz.div(r, z, m); /* */ $s = 31; case 31: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _tuple$2 = _r$8; 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; /* } */ case 30: v = (y$3 = (1), y$3 < 32 ? (v << y$3) : 0) >>> 0; j$1 = j$1 + (1) >> 0; $s = 23; continue; case 24: i = i - (1) >> 0; $s = 21; continue; case 22: $s = -1; return z.norm(); /* */ } return; } if ($f === undefined) { $f = { $blk: nat.prototype.expNN }; } $f.$24r = $24r; $f.$24r$1 = $24r$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._r$7 = _r$7; $f._r$8 = _r$8; $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$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._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.i = i; $f.j = j; $f.j$1 = j$1; $f.m = m; $f.q = q; $f.r = r; $f.shift = shift; $f.v = v; $f.w = w; $f.x = x; $f.x$1 = x$1; $f.y = y; $f.y$1 = y$1; $f.y$2 = y$2; $f.y$3 = y$3; $f.z = z; $f.zz = zz; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(nat).prototype.expNN = function(x, y, m) { return this.$get().expNN(x, y, m); }; nat.prototype.expNNWindowed = function(x, y, m) { var _q, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _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, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _q = $f._q; _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$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$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$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _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 = $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; i = $f.i; i$1 = $f.i$1; j = $f.j; m = $f.m; p = $f.p; p1 = $f.p1; p2 = $f.p2; powers = $f.powers; r = $f.r; x = $f.x; x$1 = $f.x$1; y = $f.y; y$1 = $f.y$1; yi = $f.yi; z = $f.z; zz = $f.zz; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: 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) { */ case 1: /* if (!(i < 16)) { break; } */ if(!(i < 16)) { $s = 2; continue; } _tmp$2 = $indexPtr(powers, (_q = i / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")), ptrType$3); _tmp$3 = $indexPtr(powers, i, ptrType$3); _tmp$4 = $indexPtr(powers, (i + 1 >> 0), ptrType$3); p2 = _tmp$2; p = _tmp$3; p1 = _tmp$4; _r = p.sqr(p2.$get()); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } p.$set(_r); _r$1 = zz.div(r, p.$get(), m); /* */ $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; zz = _tuple[0]; r = _tuple[1]; _tmp$5 = r; _tmp$6 = p.$get(); p.$set(_tmp$5); r = _tmp$6; _r$2 = p1.mul(p.$get(), x); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } p1.$set(_r$2); _r$3 = zz.div(r, p1.$get(), m); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$1 = _r$3; 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; $s = 1; continue; case 2: z = z.setWord(1); i$1 = y.$length - 1 >> 0; /* while (true) { */ case 7: /* if (!(i$1 >= 0)) { break; } */ if(!(i$1 >= 0)) { $s = 8; continue; } yi = ((i$1 < 0 || i$1 >= y.$length) ? ($throwRuntimeError("index out of range"), undefined) : y.$array[y.$offset + i$1]); j = 0; /* while (true) { */ case 9: /* if (!(j < 32)) { break; } */ if(!(j < 32)) { $s = 10; continue; } /* */ if (!((i$1 === (y.$length - 1 >> 0))) || !((j === 0))) { $s = 11; continue; } /* */ $s = 12; continue; /* if (!((i$1 === (y.$length - 1 >> 0))) || !((j === 0))) { */ case 11: _r$4 = zz.sqr(z); /* */ $s = 13; case 13: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } zz = _r$4; _tmp$9 = z; _tmp$10 = zz; zz = _tmp$9; z = _tmp$10; _r$5 = zz.div(r, z, m); /* */ $s = 14; case 14: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$2 = _r$5; zz = _tuple$2[0]; r = _tuple$2[1]; _tmp$11 = r; _tmp$12 = z; z = _tmp$11; r = _tmp$12; _r$6 = zz.sqr(z); /* */ $s = 15; case 15: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } zz = _r$6; _tmp$13 = z; _tmp$14 = zz; zz = _tmp$13; z = _tmp$14; _r$7 = zz.div(r, z, m); /* */ $s = 16; case 16: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _tuple$3 = _r$7; zz = _tuple$3[0]; r = _tuple$3[1]; _tmp$15 = r; _tmp$16 = z; z = _tmp$15; r = _tmp$16; _r$8 = zz.sqr(z); /* */ $s = 17; case 17: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } zz = _r$8; _tmp$17 = z; _tmp$18 = zz; zz = _tmp$17; z = _tmp$18; _r$9 = zz.div(r, z, m); /* */ $s = 18; case 18: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple$4 = _r$9; zz = _tuple$4[0]; r = _tuple$4[1]; _tmp$19 = r; _tmp$20 = z; z = _tmp$19; r = _tmp$20; _r$10 = zz.sqr(z); /* */ $s = 19; case 19: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } zz = _r$10; _tmp$21 = z; _tmp$22 = zz; zz = _tmp$21; z = _tmp$22; _r$11 = zz.div(r, z, m); /* */ $s = 20; case 20: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tuple$5 = _r$11; zz = _tuple$5[0]; r = _tuple$5[1]; _tmp$23 = r; _tmp$24 = z; z = _tmp$23; r = _tmp$24; /* } */ case 12: _r$12 = zz.mul(z, (x$1 = yi >>> 28 >>> 0, ((x$1 < 0 || x$1 >= powers.length) ? ($throwRuntimeError("index out of range"), undefined) : powers[x$1]))); /* */ $s = 21; case 21: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } zz = _r$12; _tmp$25 = z; _tmp$26 = zz; zz = _tmp$25; z = _tmp$26; _r$13 = zz.div(r, z, m); /* */ $s = 22; case 22: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _tuple$6 = _r$13; 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; $s = 9; continue; case 10: i$1 = i$1 - (1) >> 0; $s = 7; continue; case 8: $s = -1; return z.norm(); /* */ } return; } if ($f === undefined) { $f = { $blk: nat.prototype.expNNWindowed }; } $f._q = _q; $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$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$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$3 = _tmp$3; $f._tmp$4 = _tmp$4; $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 = _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.i = i; $f.i$1 = i$1; $f.j = j; $f.m = m; $f.p = p; $f.p1 = p1; $f.p2 = p2; $f.powers = powers; $f.r = r; $f.x = x; $f.x$1 = x$1; $f.y = y; $f.y$1 = y$1; $f.yi = yi; $f.z = z; $f.zz = zz; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(nat).prototype.expNNWindowed = function(x, y, m) { return this.$get().expNNWindowed(x, y, m); }; nat.prototype.expNNMontgomery = function(x, y, m) { var RR, _r, _r$1, _r$2, _r$3, _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, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; RR = $f.RR; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; i = $f.i; i$1 = $f.i$1; i$2 = $f.i$2; j = $f.j; k0 = $f.k0; m = $f.m; numWords = $f.numWords; one = $f.one; powers = $f.powers; rr = $f.rr; t = $f.t; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; y = $f.y; y$1 = $f.y$1; y$2 = $f.y$2; yi = $f.yi; z = $f.z; zz = $f.zz; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; numWords = m.$length; /* */ if (x.$length > numWords) { $s = 1; continue; } /* */ $s = 2; continue; /* if (x.$length > numWords) { */ case 1: _r = (nat.nil).div(nat.nil, x, m); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; x = _tuple[1]; /* } */ case 2: if (x.$length < numWords) { rr = $makeSlice(nat, numWords); $copySlice(rr, x); x = rr; } k0 = 2 - (0 >= m.$length ? ($throwRuntimeError("index out of range"), undefined) : m.$array[m.$offset + 0]) >>> 0; t = (0 >= m.$length ? ($throwRuntimeError("index out of range"), undefined) : 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))); _r$1 = (nat.nil).div(RR, zz, m); /* */ $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; 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"), undefined) : 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"), undefined) : powers[i$1] = ((i$1 < 0 || i$1 >= powers.length) ? ($throwRuntimeError("index out of range"), undefined) : powers[i$1]).montgomery((x$1 = i$1 - 1 >> 0, ((x$1 < 0 || x$1 >= powers.length) ? ($throwRuntimeError("index out of range"), undefined) : 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"), undefined) : 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"), undefined) : 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) { $s = 5; continue; } /* */ $s = 6; continue; /* if (zz.cmp(m) >= 0) { */ case 5: _r$2 = zz.sub(zz, m); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } zz = _r$2; /* */ if (zz.cmp(m) >= 0) { $s = 8; continue; } /* */ $s = 9; continue; /* if (zz.cmp(m) >= 0) { */ case 8: _r$3 = (nat.nil).div(nat.nil, zz, m); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$2 = _r$3; zz = _tuple$2[1]; /* } */ case 9: /* } */ case 6: $s = -1; return zz.norm(); /* */ } return; } if ($f === undefined) { $f = { $blk: nat.prototype.expNNMontgomery }; } $f.RR = RR; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.i = i; $f.i$1 = i$1; $f.i$2 = i$2; $f.j = j; $f.k0 = k0; $f.m = m; $f.numWords = numWords; $f.one = one; $f.powers = powers; $f.rr = rr; $f.t = t; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.y = y; $f.y$1 = y$1; $f.y$2 = y$2; $f.yi = yi; $f.z = z; $f.zz = zz; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(nat).prototype.expNNMontgomery = function(x, y, m) { return this.$get().expNNMontgomery(x, y, m); }; nat.prototype.bytes = function(buf) { var _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"), undefined) : _ref.$array[_ref.$offset + _i]); j = 0; while (true) { if (!(j < 4)) { break; } i = i - (1) >> 0; if (i >= 0) { ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = ((d << 24 >>> 24))); } else if (!((((d << 24 >>> 24)) === 0))) { $panic(new $String("math/big: buffer too small to fit value")); } d = (y = (8), y < 32 ? (d >>> y) : 0) >>> 0; j = j + (1) >> 0; } _i++; } if (i < 0) { i = 0; } while (true) { if (!(i < buf.$length && (((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i]) === 0))) { break; } i = i + (1) >> 0; } return i; }; $ptrType(nat).prototype.bytes = function(buf) { return this.$get().bytes(buf); }; bigEndianWord = function(buf) { var buf; if (false) { return (($clone(binary.BigEndian, binary.bigEndian).Uint64(buf).$low >>> 0)); } return (($clone(binary.BigEndian, binary.bigEndian).Uint32(buf) >>> 0)); }; nat.prototype.setBytes = function(buf) { var _q, buf, d, i, k, s, x, x$1, 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"))); i = buf.$length; k = 0; while (true) { if (!(i >= 4)) { break; } ((k < 0 || k >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + k] = bigEndianWord($subslice(buf, (i - 4 >> 0), i))); i = i - (4) >> 0; k = k + (1) >> 0; } if (i > 0) { d = 0; s = 0; 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"), undefined) : buf.$array[buf.$offset + x])) >>> 0)) << y) : 0) >>> 0))) >>> 0; i = i - (1) >> 0; s = s + (8) >>> 0; } (x$1 = z.$length - 1 >> 0, ((x$1 < 0 || x$1 >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + x$1] = d)); } return z.norm(); }; $ptrType(nat).prototype.setBytes = function(buf) { return this.$get().setBytes(buf); }; nat.prototype.sqrt = function(x) { var _q, _r, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, n, x, z, z1, z2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _q = $f._q; _r = $f._r; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; n = $f.n; x = $f.x; z = $f.z; z1 = $f.z1; z2 = $f.z2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; if (x.cmp(natOne) <= 0) { $s = -1; return z.set(x); } if (alias(z, x)) { z = nat.nil; } _tmp = nat.nil; _tmp$1 = nat.nil; z1 = _tmp; z2 = _tmp$1; z1 = z; z1 = z1.setUint64(new $Uint64(0, 1)); z1 = z1.shl(z1, (_q = (((x.bitLen() + 1 >> 0) >>> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero"))); n = 0; /* while (true) { */ case 1: _r = z2.div(nat.nil, x, z1); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; z2 = _tuple[0]; _r$1 = z2.add(z2, z1); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } z2 = _r$1; z2 = z2.shr(z2, 1); if (z2.cmp(z1) >= 0) { if ((n & 1) === 0) { $s = -1; return z1; } $s = -1; return z.set(z1); } _tmp$2 = z2; _tmp$3 = z1; z1 = _tmp$2; z2 = _tmp$3; n = n + (1) >> 0; $s = 1; continue; case 2: $s = -1; return nat.nil; /* */ } return; } if ($f === undefined) { $f = { $blk: nat.prototype.sqrt }; } $f._q = _q; $f._r = _r; $f._r$1 = _r$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f.n = n; $f.x = x; $f.z = z; $f.z1 = z1; $f.z2 = z2; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(nat).prototype.sqrt = function(x) { return this.$get().sqrt(x); }; Int.ptr.prototype.GobEncode = function() { var b, buf, i, x; x = this; if (x === ptrType$2.nil) { return [sliceType$1.nil, $ifaceNil]; } buf = $makeSlice(sliceType$1, (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"), undefined) : 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 $24r, _r, b, buf, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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)); $s = -1; return $ifaceNil; } b = (0 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : 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([new $Uint8((b >>> 1 << 24 >>> 24))])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 4; case 4: return $24r; /* } */ case 2: z.neg = !((((b & 1) >>> 0) === 0)); z.abs = z.abs.setBytes($subslice(buf, 1)); $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.GobDecode }; } $f.$24r = $24r; $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 $24r, _r, _tmp, _tmp$1, _tmp$2, _tmp$3, err, text, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; err = $f.err; text = $f.text; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: text = sliceType$1.nil; err = $ifaceNil; x = this; if (x === ptrType$2.nil) { _tmp = (new sliceType$1($stringToBytes(""))); _tmp$1 = $ifaceNil; text = _tmp; err = _tmp$1; $s = -1; return [text, err]; } _r = x.abs.itoa(x.neg, 10); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tmp$2 = _r; _tmp$3 = $ifaceNil; text = _tmp$2; err = _tmp$3; $24r = [text, err]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.MarshalText }; } $f.$24r = $24r; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f.err = err; $f.text = text; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.MarshalText = function() { return this.$val.MarshalText(); }; Int.ptr.prototype.UnmarshalText = function(text) { var $24r, _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; $24r = $f.$24r; _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.setFromScanner(bytes.NewReader(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([text])); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 5; case 5: return $24r; /* } */ case 3: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.UnmarshalText }; } $f.$24r = $24r; $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 $24r, _r, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: x = this; _r = x.MarshalText(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.MarshalJSON }; } $f.$24r = $24r; $f._r = _r; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.MarshalJSON = function() { return this.$val.MarshalJSON(); }; Int.ptr.prototype.UnmarshalJSON = function(text) { var $24r, _r, text, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; text = $f.text; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; if (($bytesToString(text)) === "null") { $s = -1; return $ifaceNil; } _r = z.UnmarshalText(text); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.UnmarshalJSON }; } $f.$24r = $24r; $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); }; Int.ptr.prototype.Text = function(base) { var $24r, _r, base, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; base = $f.base; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: x = this; if (x === ptrType$2.nil) { $s = -1; return ""; } _r = x.abs.itoa(x.neg, base); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = ($bytesToString(_r)); $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.Text }; } $f.$24r = $24r; $f._r = _r; $f.base = base; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.Text = function(base) { return this.$val.Text(base); }; Int.ptr.prototype.Append = function(buf, base) { var $24r, _arg, _arg$1, _r, base, buf, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; base = $f.base; buf = $f.buf; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: x = this; if (x === ptrType$2.nil) { $s = -1; return $appendSlice(buf, ""); } _arg = buf; _r = x.abs.itoa(x.neg, base); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = _r; $24r = $appendSlice(_arg, _arg$1); $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.Append }; } $f.$24r = $24r; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f.base = base; $f.buf = buf; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.Append = function(buf, base) { return this.$val.Append(buf, base); }; Int.ptr.prototype.String = function() { var $24r, _r, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: x = this; _r = x.Text(10); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.String }; } $f.$24r = $24r; $f._r = _r; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.String = function() { return this.$val.String(); }; writeMultiple = function(s, text, count) { var _r, b, count, s, text, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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$1($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; return; /* */ } return; } if ($f === undefined) { $f = { $blk: writeMultiple }; } $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 _1, _2, _arg, _arg$1, _arg$2, _i, _r, _r$1, _r$10, _r$11, _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; _1 = $f._1; _2 = $f._2; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _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)) || (_1 === (79))) { $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)) || (_1 === (79))) { */ 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: _arg = s; _arg$1 = new $Int32(ch); _r = x.String(); /* */ $s = 8; case 8: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$2 = new $String(_r); _r$1 = fmt.Fprintf(_arg, "%%!%c(big.Int=%s)", new sliceType([_arg$1, _arg$2])); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = -1; return; /* } */ case 7: case 1: /* */ if (x === ptrType$2.nil) { $s = 10; continue; } /* */ $s = 11; continue; /* if (x === ptrType$2.nil) { */ case 10: _r$2 = fmt.Fprint(s, new sliceType([new $String("")])); /* */ $s = 12; case 12: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; $s = -1; return; /* } */ case 11: sign = ""; /* */ if (x.neg) { $s = 14; continue; } _r$3 = s.Flag(43); /* */ $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; } _r$4 = s.Flag(32); /* */ $s = 19; case 19: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } /* */ if (_r$4) { $s = 16; continue; } /* */ $s = 17; continue; /* if (x.neg) { */ case 14: sign = "-"; $s = 17; continue; /* } else if (_r$3) { */ case 15: sign = "+"; $s = 17; continue; /* } else if (_r$4) { */ case 16: sign = " "; /* } */ case 17: case 13: prefix = ""; _r$5 = s.Flag(35); /* */ $s = 22; case 22: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } /* */ if (_r$5) { $s = 20; continue; } /* */ $s = 21; continue; /* if (_r$5) { */ case 20: _2 = ch; if (_2 === (98)) { prefix = "0b"; } else if (_2 === (111)) { prefix = "0"; } else if (_2 === (120)) { prefix = "0x"; } else if (_2 === (88)) { prefix = "0X"; } /* } */ case 21: if (ch === 79) { prefix = "0o"; } _r$6 = x.abs.utoa(base); /* */ $s = 23; case 23: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } digits = _r$6; 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"), undefined) : _ref.$array[_ref.$offset + _i]); if (97 <= d && d <= 122) { ((i < 0 || i >= digits.$length) ? ($throwRuntimeError("index out of range"), undefined) : digits.$array[digits.$offset + i] = (65 + ((d - 97 << 24 >>> 24)) << 24 >>> 24)); } _i++; } } left = 0; zeros = 0; right = 0; _r$7 = s.Precision(); /* */ $s = 24; case 24: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _tuple = _r$7; 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"), undefined) : digits.$array[digits.$offset + 0]) === 48) && (precision === 0)) { $s = -1; return; } } length = ((sign.length + prefix.length >> 0) + zeros >> 0) + digits.$length >> 0; _r$8 = s.Width(); /* */ $s = 25; case 25: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _tuple$1 = _r$8; width = _tuple$1[0]; widthSet = _tuple$1[1]; /* */ if (widthSet && length < width) { $s = 26; continue; } /* */ $s = 27; continue; /* if (widthSet && length < width) { */ case 26: d$1 = width - length >> 0; _r$9 = s.Flag(45); /* */ $s = 33; case 33: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } /* */ if (_r$9) { $s = 29; continue; } _r$10 = s.Flag(48); /* */ $s = 34; case 34: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } /* */ if (_r$10 && !precisionSet) { $s = 30; continue; } /* */ $s = 31; continue; /* if (_r$9) { */ case 29: right = d$1; $s = 32; continue; /* } else if (_r$10 && !precisionSet) { */ case 30: zeros = d$1; $s = 32; continue; /* } else { */ case 31: left = d$1; /* } */ case 32: case 28: /* } */ case 27: $r = writeMultiple(s, " ", left); /* */ $s = 35; case 35: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = writeMultiple(s, sign, 1); /* */ $s = 36; case 36: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = writeMultiple(s, prefix, 1); /* */ $s = 37; case 37: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = writeMultiple(s, "0", zeros); /* */ $s = 38; case 38: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$11 = s.Write(digits); /* */ $s = 39; case 39: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _r$11; $r = writeMultiple(s, " ", right); /* */ $s = 40; case 40: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.Format }; } $f._1 = _1; $f._2 = _2; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $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 _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; _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))) { $s = -1; return [ptrType$2.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))) { $s = -1; return [ptrType$2.nil, base, err]; } z.neg = z.abs.$length > 0 && neg; $s = -1; return [z, base, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.scan }; } $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 _1, _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; _1 = $f._1; _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; $s = -1; return [neg, err]; } _1 = ch; /* */ if (_1 === (45)) { $s = 3; continue; } /* */ if (_1 === (43)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_1 === (45)) { */ case 3: neg = true; $s = 6; continue; /* } else if (_1 === (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: $s = -1; return [neg, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: scanSign }; } $f._1 = _1; $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 _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; _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 = this; _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([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: $s = -1; return [((ch << 24 >>> 24)), err]; /* */ } return; } if ($f === undefined) { $f = { $blk: byteReader.ptr.prototype.ReadByte }; } $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 $24r, _r, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r = r.ScanState.UnreadRune(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: byteReader.ptr.prototype.UnreadByte }; } $f.$24r = $24r; $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 _1, _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; _1 = $f._1; _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; _1 = ch; if (_1 === (98)) { base = 2; } else if (_1 === (111)) { base = 8; } else if (_1 === (100)) { base = 10; } else if ((_1 === (120)) || (_1 === (88))) { base = 16; } else if ((_1 === (115)) || (_1 === (118))) { } else { $s = -1; 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]; $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.Scan }; } $f._1 = _1; $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.Sign = function() { var 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 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 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); }; NewInt = function(x) { var x; return new Int.ptr(false, nat.nil).SetInt64(x); }; $pkg.NewInt = NewInt; Int.ptr.prototype.Set = function(x) { var 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 x; x = this; return $convertSliceType(x.abs, sliceType$2); }; Int.prototype.Bits = function() { return this.$val.Bits(); }; Int.ptr.prototype.SetBits = function(abs) { var abs, z; z = this; z.abs = ($convertSliceType(abs, nat)).norm(); z.neg = false; return z; }; Int.prototype.SetBits = function(abs) { return this.$val.SetBits(abs); }; Int.ptr.prototype.Abs = function(x) { var 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 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 _r, _r$1, _r$2, neg, x, y, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; neg = $f.neg; x = $f.x; y = $f.y; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; neg = x.neg; /* */ if (x.neg === y.neg) { $s = 1; continue; } /* */ $s = 2; continue; /* if (x.neg === y.neg) { */ case 1: _r = z.abs.add(x.abs, y.abs); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } z.abs = _r; $s = 3; continue; /* } else { */ case 2: /* */ if (x.abs.cmp(y.abs) >= 0) { $s = 5; continue; } /* */ $s = 6; continue; /* if (x.abs.cmp(y.abs) >= 0) { */ case 5: _r$1 = z.abs.sub(x.abs, y.abs); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } z.abs = _r$1; $s = 7; continue; /* } else { */ case 6: neg = !neg; _r$2 = z.abs.sub(y.abs, x.abs); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } z.abs = _r$2; /* } */ case 7: /* } */ case 3: z.neg = z.abs.$length > 0 && neg; $s = -1; return z; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.Add }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.neg = neg; $f.x = x; $f.y = y; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.Add = function(x, y) { return this.$val.Add(x, y); }; Int.ptr.prototype.Sub = function(x, y) { var _r, _r$1, _r$2, neg, x, y, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; neg = $f.neg; x = $f.x; y = $f.y; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; neg = x.neg; /* */ if (!(x.neg === y.neg)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(x.neg === y.neg)) { */ case 1: _r = z.abs.add(x.abs, y.abs); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } z.abs = _r; $s = 3; continue; /* } else { */ case 2: /* */ if (x.abs.cmp(y.abs) >= 0) { $s = 5; continue; } /* */ $s = 6; continue; /* if (x.abs.cmp(y.abs) >= 0) { */ case 5: _r$1 = z.abs.sub(x.abs, y.abs); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } z.abs = _r$1; $s = 7; continue; /* } else { */ case 6: neg = !neg; _r$2 = z.abs.sub(y.abs, x.abs); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } z.abs = _r$2; /* } */ case 7: /* } */ case 3: z.neg = z.abs.$length > 0 && neg; $s = -1; return z; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.Sub }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.neg = neg; $f.x = x; $f.y = y; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.Sub = function(x, y) { return this.$val.Sub(x, y); }; Int.ptr.prototype.Mul = function(x, y) { var _r, _r$1, x, y, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; x = $f.x; y = $f.y; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; /* */ if (x === y) { $s = 1; continue; } /* */ $s = 2; continue; /* if (x === y) { */ case 1: _r = z.abs.sqr(x.abs); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } z.abs = _r; z.neg = false; $s = -1; return z; /* } */ case 2: _r$1 = z.abs.mul(x.abs, y.abs); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } z.abs = _r$1; z.neg = z.abs.$length > 0 && !(x.neg === y.neg); $s = -1; return z; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.Mul }; } $f._r = _r; $f._r$1 = _r$1; $f.x = x; $f.y = y; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.Mul = function(x, y) { return this.$val.Mul(x, y); }; Int.ptr.prototype.MulRange = function(a, b) { var _r, _tmp, _tmp$1, a, b, neg, x, x$1, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; a = $f.a; b = $f.b; neg = $f.neg; 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; if ((a.$high > b.$high || (a.$high === b.$high && a.$low > b.$low))) { $s = -1; 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))) { $s = -1; 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; } _r = z.abs.mulRange((new $Uint64(a.$high, a.$low)), (new $Uint64(b.$high, b.$low))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } z.abs = _r; z.neg = neg; $s = -1; return z; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.MulRange }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.a = a; $f.b = b; $f.neg = neg; $f.x = x; $f.x$1 = x$1; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.MulRange = function(a, b) { return this.$val.MulRange(a, b); }; Int.ptr.prototype.Binomial = function(n, k) { var $24r, _r, _r$1, _r$2, _tmp, _tmp$1, a, b, k, n, x, x$1, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; a = $f.a; b = $f.b; k = $f.k; n = $f.n; x = $f.x; x$1 = $f.x$1; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: a = [a]; b = [b]; 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[0] = $clone(_tmp, Int); b[0] = $clone(_tmp$1, Int); _r = a[0].MulRange((x$1 = new $Int64(n.$high - k.$high, n.$low - k.$low), new $Int64(x$1.$high + 0, x$1.$low + 1)), n); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; _r$1 = b[0].MulRange(new $Int64(0, 1), k); /* */ $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$2 = z.Quo(a[0], b[0]); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 4; case 4: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.Binomial }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.a = a; $f.b = b; $f.k = k; $f.n = n; $f.x = x; $f.x$1 = x$1; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.Binomial = function(n, k) { return this.$val.Binomial(n, k); }; Int.ptr.prototype.Quo = function(x, y) { var _r, _tuple, x, y, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; x = $f.x; y = $f.y; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; _r = z.abs.div(nat.nil, x.abs, y.abs); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; z.abs = _tuple[0]; z.neg = z.abs.$length > 0 && !(x.neg === y.neg); $s = -1; return z; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.Quo }; } $f._r = _r; $f._tuple = _tuple; $f.x = x; $f.y = y; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.Quo = function(x, y) { return this.$val.Quo(x, y); }; Int.ptr.prototype.Rem = function(x, y) { var _r, _tuple, x, y, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; x = $f.x; y = $f.y; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; _r = (nat.nil).div(z.abs, x.abs, y.abs); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; z.abs = _tuple[1]; z.neg = z.abs.$length > 0 && x.neg; $s = -1; return z; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.Rem }; } $f._r = _r; $f._tuple = _tuple; $f.x = x; $f.y = y; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.Rem = function(x, y) { return this.$val.Rem(x, y); }; Int.ptr.prototype.QuoRem = function(x, y, r) { var _r, _tmp, _tmp$1, _tuple, r, x, y, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; r = $f.r; x = $f.x; y = $f.y; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; _r = z.abs.div(r.abs, x.abs, y.abs); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; 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; $s = -1; return [z, r]; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.QuoRem }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.r = r; $f.x = x; $f.y = y; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.QuoRem = function(x, y, r) { return this.$val.QuoRem(x, y, r); }; Int.ptr.prototype.Div = function(x, y) { var _r, _r$1, _r$2, r, x, y, y_neg, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; r = $f.r; x = $f.x; y = $f.y; y_neg = $f.y_neg; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = [r]; z = this; y_neg = y.neg; r[0] = new Int.ptr(false, nat.nil); _r = z.QuoRem(x, y, r[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; /* */ if (r[0].neg) { $s = 2; continue; } /* */ $s = 3; continue; /* if (r[0].neg) { */ case 2: /* */ if (y_neg) { $s = 4; continue; } /* */ $s = 5; continue; /* if (y_neg) { */ case 4: _r$1 = z.Add(z, intOne); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = 6; continue; /* } else { */ case 5: _r$2 = z.Sub(z, intOne); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; /* } */ case 6: /* } */ case 3: $s = -1; return z; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.Div }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.r = r; $f.x = x; $f.y = y; $f.y_neg = y_neg; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.Div = function(x, y) { return this.$val.Div(x, y); }; Int.ptr.prototype.Mod = function(x, y) { var _r, _r$1, _r$2, q, x, y, y0, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; q = $f.q; x = $f.x; y = $f.y; y0 = $f.y0; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: 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); _r = q.QuoRem(x, y, z); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; /* */ if (z.neg) { $s = 2; continue; } /* */ $s = 3; continue; /* if (z.neg) { */ case 2: /* */ if (y0.neg) { $s = 4; continue; } /* */ $s = 5; continue; /* if (y0.neg) { */ case 4: _r$1 = z.Sub(z, y0); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = 6; continue; /* } else { */ case 5: _r$2 = z.Add(z, y0); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; /* } */ case 6: /* } */ case 3: $s = -1; return z; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.Mod }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.q = q; $f.x = x; $f.y = y; $f.y0 = y0; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.Mod = function(x, y) { return this.$val.Mod(x, y); }; Int.ptr.prototype.DivMod = function(x, y, m) { var _r, _r$1, _r$2, _r$3, _r$4, m, x, y, y0, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; m = $f.m; x = $f.x; y = $f.y; y0 = $f.y0; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; y0 = y; if (z === y || alias(z.abs, y.abs)) { y0 = new Int.ptr(false, nat.nil).Set(y); } _r = z.QuoRem(x, y, m); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; /* */ if (m.neg) { $s = 2; continue; } /* */ $s = 3; continue; /* if (m.neg) { */ case 2: /* */ if (y0.neg) { $s = 4; continue; } /* */ $s = 5; continue; /* if (y0.neg) { */ case 4: _r$1 = z.Add(z, intOne); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _r$2 = m.Sub(m, y0); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; $s = 6; continue; /* } else { */ case 5: _r$3 = z.Sub(z, intOne); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _r$4 = m.Add(m, y0); /* */ $s = 10; case 10: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; /* } */ case 6: /* } */ case 3: $s = -1; return [z, m]; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.DivMod }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.m = m; $f.x = x; $f.y = y; $f.y0 = y0; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.DivMod = function(x, y, m) { return this.$val.DivMod(x, y, m); }; Int.ptr.prototype.Cmp = function(y) { var r, x, y; r = 0; x = this; if (x === y) { } else 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); }; Int.ptr.prototype.CmpAbs = function(y) { var x, y; x = this; return x.abs.cmp(y.abs); }; Int.prototype.CmpAbs = function(y) { return this.$val.CmpAbs(y); }; low64 = function(x) { var v, x, x$1, x$2, x$3; if (x.$length === 0) { return new $Uint64(0, 0); } v = ((x$1 = (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0]), new $Uint64(0, x$1.constructor === Number ? x$1 : 1))); if (true && x.$length > 1) { return (x$2 = $shiftLeft64(((x$3 = (1 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 1]), new $Uint64(0, x$3.constructor === Number ? x$3 : 1))), 32), new $Uint64(x$2.$high | v.$high, (x$2.$low | v.$low) >>> 0)); } return v; }; Int.ptr.prototype.Int64 = function() { var 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 x; x = this; return low64(x.abs); }; Int.prototype.Uint64 = function() { return this.$val.Uint64(); }; Int.ptr.prototype.IsInt64 = function() { var w, x, x$1, x$2; x = this; if (x.abs.$length <= 2) { w = ((x$1 = low64(x.abs), new $Int64(x$1.$high, x$1.$low))); return (w.$high > 0 || (w.$high === 0 && w.$low >= 0)) || x.neg && (x$2 = new $Int64(-w.$high, -w.$low), (w.$high === x$2.$high && w.$low === x$2.$low)); } return false; }; Int.prototype.IsInt64 = function() { return this.$val.IsInt64(); }; Int.ptr.prototype.IsUint64 = function() { var x; x = this; return !x.neg && x.abs.$length <= 2; }; Int.prototype.IsUint64 = function() { return this.$val.IsUint64(); }; Int.ptr.prototype.SetString = function(s, base) { var $24r, _r, base, s, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; base = $f.base; s = $f.s; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; _r = z.setFromScanner(strings.NewReader(s), base); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.SetString }; } $f.$24r = $24r; $f._r = _r; $f.base = base; $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.setFromScanner = function(r, base) { var _r, _r$1, _tuple, _tuple$1, base, err, err$1, r, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; base = $f.base; err = $f.err; err$1 = $f.err$1; r = $f.r; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; _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))) { $s = -1; return [ptrType$2.nil, false]; } _r$1 = r.ReadByte(); /* */ $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; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, io.EOF))) { $s = -1; return [ptrType$2.nil, false]; } $s = -1; return [z, true]; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.setFromScanner }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.base = base; $f.err = err; $f.err$1 = err$1; $f.r = r; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.setFromScanner = function(r, base) { return this.$val.setFromScanner(r, base); }; Int.ptr.prototype.SetBytes = function(buf) { var 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 buf, x; x = this; buf = $makeSlice(sliceType$1, ($imul(x.abs.$length, 4))); return $subslice(buf, x.abs.bytes(buf)); }; Int.prototype.Bytes = function() { return this.$val.Bytes(); }; Int.ptr.prototype.FillBytes = function(buf) { var _i, _ref, buf, i, x; x = this; _ref = buf; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 0); _i++; } x.abs.bytes(buf); return buf; }; Int.prototype.FillBytes = function(buf) { return this.$val.FillBytes(buf); }; Int.ptr.prototype.BitLen = function() { var x; x = this; return x.abs.bitLen(); }; Int.prototype.BitLen = function() { return this.$val.BitLen(); }; Int.ptr.prototype.TrailingZeroBits = function() { var x; x = this; return x.abs.trailingZeroBits(); }; Int.prototype.TrailingZeroBits = function() { return this.$val.TrailingZeroBits(); }; Int.ptr.prototype.Exp = function(x, y, m) { var _r, _r$1, _r$2, inverse, m, mWords, x, xWords, y, yWords, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; inverse = $f.inverse; m = $f.m; mWords = $f.mWords; x = $f.x; xWords = $f.xWords; y = $f.y; yWords = $f.yWords; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; xWords = x.abs; /* */ if (y.neg) { $s = 1; continue; } /* */ $s = 2; continue; /* if (y.neg) { */ case 1: if (m === ptrType$2.nil || (m.abs.$length === 0)) { $s = -1; return z.SetInt64(new $Int64(0, 1)); } _r = new Int.ptr(false, nat.nil).ModInverse(x, m); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } inverse = _r; if (inverse === ptrType$2.nil) { $s = -1; return ptrType$2.nil; } xWords = inverse.abs; /* } */ case 2: yWords = y.abs; mWords = nat.nil; if (!(m === ptrType$2.nil)) { mWords = m.abs; } _r$1 = z.abs.expNN(xWords, yWords, mWords); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } z.abs = _r$1; z.neg = z.abs.$length > 0 && x.neg && yWords.$length > 0 && ((((0 >= yWords.$length ? ($throwRuntimeError("index out of range"), undefined) : yWords.$array[yWords.$offset + 0]) & 1) >>> 0) === 1); /* */ if (z.neg && mWords.$length > 0) { $s = 5; continue; } /* */ $s = 6; continue; /* if (z.neg && mWords.$length > 0) { */ case 5: _r$2 = z.abs.sub(mWords, z.abs); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } z.abs = _r$2; z.neg = false; /* } */ case 6: $s = -1; return z; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.Exp }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.inverse = inverse; $f.m = m; $f.mWords = mWords; $f.x = x; $f.xWords = xWords; $f.y = y; $f.yWords = yWords; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.Exp = function(x, y, m) { return this.$val.Exp(x, y, m); }; Int.ptr.prototype.GCD = function(x, y, a, b) { var $24r, _r, _tmp, _tmp$1, _tmp$2, _tmp$3, a, b, lenA, lenB, negA, negB, x, y, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; a = $f.a; b = $f.b; lenA = $f.lenA; lenB = $f.lenB; negA = $f.negA; negB = $f.negB; x = $f.x; y = $f.y; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; if ((a.abs.$length === 0) || (b.abs.$length === 0)) { _tmp = a.abs.$length; _tmp$1 = b.abs.$length; _tmp$2 = a.neg; _tmp$3 = b.neg; lenA = _tmp; lenB = _tmp$1; negA = _tmp$2; negB = _tmp$3; if (lenA === 0) { z.Set(b); } else { z.Set(a); } z.neg = false; if (!(x === ptrType$2.nil)) { if (lenA === 0) { x.SetUint64(new $Uint64(0, 0)); } else { x.SetUint64(new $Uint64(0, 1)); x.neg = negA; } } if (!(y === ptrType$2.nil)) { if (lenB === 0) { y.SetUint64(new $Uint64(0, 0)); } else { y.SetUint64(new $Uint64(0, 1)); y.neg = negB; } } $s = -1; return z; } _r = z.lehmerGCD(x, y, a, b); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.GCD }; } $f.$24r = $24r; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f.a = a; $f.b = b; $f.lenA = lenA; $f.lenB = lenB; $f.negA = negA; $f.negB = negB; $f.x = x; $f.y = y; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.GCD = function(x, y, a, b) { return this.$val.GCD(x, y, a, b); }; lehmerSimulate = function(A, B) { var A, B, _q, _r, _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$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, a1, a2, even, h, m, n, q, r, u0, u1, u2, v0, v1, v2, x, x$1, x$10, x$11, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, y, y$1, y$2, y$3, y$4; u0 = 0; u1 = 0; v0 = 0; v1 = 0; even = false; _tmp = 0; _tmp$1 = 0; _tmp$2 = 0; _tmp$3 = 0; a1 = _tmp; a2 = _tmp$1; u2 = _tmp$2; v2 = _tmp$3; m = B.abs.$length; n = A.abs.$length; h = nlz((x = A.abs, x$1 = n - 1 >> 0, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1]))); a1 = (((y = h, y < 32 ? ((x$2 = A.abs, x$3 = n - 1 >> 0, ((x$3 < 0 || x$3 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + x$3])) << y) : 0) >>> 0) | ((y$1 = ((32 - h >>> 0)), y$1 < 32 ? ((x$4 = A.abs, x$5 = n - 2 >> 0, ((x$5 < 0 || x$5 >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + x$5])) >>> y$1) : 0) >>> 0)) >>> 0; if ((n === m)) { a2 = (((y$2 = h, y$2 < 32 ? ((x$6 = B.abs, x$7 = n - 1 >> 0, ((x$7 < 0 || x$7 >= x$6.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$6.$array[x$6.$offset + x$7])) << y$2) : 0) >>> 0) | ((y$3 = ((32 - h >>> 0)), y$3 < 32 ? ((x$8 = B.abs, x$9 = n - 2 >> 0, ((x$9 < 0 || x$9 >= x$8.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$8.$array[x$8.$offset + x$9])) >>> y$3) : 0) >>> 0)) >>> 0; } else if ((n === (m + 1 >> 0))) { a2 = (y$4 = ((32 - h >>> 0)), y$4 < 32 ? ((x$10 = B.abs, x$11 = n - 2 >> 0, ((x$11 < 0 || x$11 >= x$10.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$10.$array[x$10.$offset + x$11])) >>> y$4) : 0) >>> 0; } else { a2 = 0; } even = false; _tmp$4 = 0; _tmp$5 = 1; _tmp$6 = 0; u0 = _tmp$4; u1 = _tmp$5; u2 = _tmp$6; _tmp$7 = 0; _tmp$8 = 0; _tmp$9 = 1; v0 = _tmp$7; v1 = _tmp$8; v2 = _tmp$9; while (true) { if (!(a2 >= v2 && (a1 - a2 >>> 0) >= (v1 + v2 >>> 0))) { break; } _tmp$10 = (_q = a1 / a2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); _tmp$11 = (_r = a1 % a2, _r === _r ? _r : $throwRuntimeError("integer divide by zero")); q = _tmp$10; r = _tmp$11; _tmp$12 = a2; _tmp$13 = r; a1 = _tmp$12; a2 = _tmp$13; _tmp$14 = u1; _tmp$15 = u2; _tmp$16 = u1 + ($imul(q, u2) >>> 0) >>> 0; u0 = _tmp$14; u1 = _tmp$15; u2 = _tmp$16; _tmp$17 = v1; _tmp$18 = v2; _tmp$19 = v1 + ($imul(q, v2) >>> 0) >>> 0; v0 = _tmp$17; v1 = _tmp$18; v2 = _tmp$19; even = !even; } return [u0, u1, v0, v1, even]; }; lehmerUpdate = function(A, B, q, r, s, t, u0, u1, v0, v1, even) { var A, B, _r, _r$1, _r$2, _r$3, _r$4, _r$5, even, q, r, s, t, u0, u1, v0, v1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; A = $f.A; B = $f.B; _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; even = $f.even; q = $f.q; r = $f.r; s = $f.s; t = $f.t; u0 = $f.u0; u1 = $f.u1; v0 = $f.v0; v1 = $f.v1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t.abs = t.abs.setWord(u0); s.abs = s.abs.setWord(v0); t.neg = !even; s.neg = even; _r = t.Mul(A, t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; _r$1 = s.Mul(B, s); /* */ $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.abs = r.abs.setWord(u1); q.abs = q.abs.setWord(v1); r.neg = even; q.neg = !even; _r$2 = r.Mul(A, r); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; _r$3 = q.Mul(B, q); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _r$4 = A.Add(t, s); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; _r$5 = B.Add(r, q); /* */ $s = 6; case 6: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: lehmerUpdate }; } $f.A = A; $f.B = B; $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.even = even; $f.q = q; $f.r = r; $f.s = s; $f.t = t; $f.u0 = u0; $f.u1 = u1; $f.v0 = v0; $f.v1 = v1; $f.$s = $s; $f.$r = $r; return $f; }; euclidUpdate = function(A, B, Ua, Ub, q, r, s, t, extended) { var A, B, Ua, Ub, _r, _r$1, _r$2, _tmp, _tmp$1, _tmp$2, _tuple, extended, q, r, s, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; A = $f.A; B = $f.B; Ua = $f.Ua; Ub = $f.Ub; _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; _tuple = $f._tuple; extended = $f.extended; 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: _r = q.QuoRem(A, B, r); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; q = _tuple[0]; r = _tuple[1]; _tmp = $clone(B, Int); _tmp$1 = $clone(r, Int); _tmp$2 = $clone(A, Int); Int.copy(A, _tmp); Int.copy(B, _tmp$1); Int.copy(r, _tmp$2); /* */ if (extended) { $s = 2; continue; } /* */ $s = 3; continue; /* if (extended) { */ case 2: t.Set(Ub); _r$1 = s.Mul(Ub, q); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _r$2 = Ub.Sub(Ua, s); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; Ua.Set(t); /* } */ case 3: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: euclidUpdate }; } $f.A = A; $f.B = B; $f.Ua = Ua; $f.Ub = Ub; $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._tuple = _tuple; $f.extended = extended; $f.q = q; $f.r = r; $f.s = s; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Int.ptr.prototype.lehmerGCD = function(x, y, a, b) { var A, B, Ua, Ub, _q, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _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$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, a, aWord, b, bWord, even, even$1, extended, negA, q, q$1, r, r$1, s, t, u0, u1, ua, ub, v0, v1, va, vb, x, x$1, x$2, x$3, y, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; A = $f.A; B = $f.B; Ua = $f.Ua; Ub = $f.Ub; _q = $f._q; _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$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$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _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 = $f._tuple; a = $f.a; aWord = $f.aWord; b = $f.b; bWord = $f.bWord; even = $f.even; even$1 = $f.even$1; extended = $f.extended; negA = $f.negA; q = $f.q; q$1 = $f.q$1; r = $f.r; r$1 = $f.r$1; s = $f.s; t = $f.t; u0 = $f.u0; u1 = $f.u1; ua = $f.ua; ub = $f.ub; v0 = $f.v0; v1 = $f.v1; va = $f.va; vb = $f.vb; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; y = $f.y; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; _tmp = ptrType$2.nil; _tmp$1 = ptrType$2.nil; _tmp$2 = ptrType$2.nil; _tmp$3 = ptrType$2.nil; A = _tmp; B = _tmp$1; Ua = _tmp$2; Ub = _tmp$3; A = new Int.ptr(false, nat.nil).Abs(a); B = new Int.ptr(false, nat.nil).Abs(b); extended = !(x === ptrType$2.nil) || !(y === ptrType$2.nil); if (extended) { Ua = new Int.ptr(false, nat.nil).SetInt64(new $Int64(0, 1)); Ub = new Int.ptr(false, nat.nil); } q = new Int.ptr(false, nat.nil); r = new Int.ptr(false, nat.nil); s = new Int.ptr(false, nat.nil); t = new Int.ptr(false, nat.nil); if (A.abs.cmp(B.abs) < 0) { _tmp$4 = B; _tmp$5 = A; A = _tmp$4; B = _tmp$5; _tmp$6 = Ua; _tmp$7 = Ub; Ub = _tmp$6; Ua = _tmp$7; } /* while (true) { */ case 1: /* if (!(B.abs.$length > 1)) { break; } */ if(!(B.abs.$length > 1)) { $s = 2; continue; } _tuple = lehmerSimulate(A, B); u0 = _tuple[0]; u1 = _tuple[1]; v0 = _tuple[2]; v1 = _tuple[3]; even = _tuple[4]; /* */ if (!((v0 === 0))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!((v0 === 0))) { */ case 3: $r = lehmerUpdate(A, B, q, r, s, t, u0, u1, v0, v1, even); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (extended) { $s = 7; continue; } /* */ $s = 8; continue; /* if (extended) { */ case 7: $r = lehmerUpdate(Ua, Ub, q, r, s, t, u0, u1, v0, v1, even); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 8: $s = 5; continue; /* } else { */ case 4: $r = euclidUpdate(A, B, Ua, Ub, q, r, s, t, extended); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: $s = 1; continue; case 2: /* */ if (B.abs.$length > 0) { $s = 11; continue; } /* */ $s = 12; continue; /* if (B.abs.$length > 0) { */ case 11: /* */ if (A.abs.$length > 1) { $s = 13; continue; } /* */ $s = 14; continue; /* if (A.abs.$length > 1) { */ case 13: $r = euclidUpdate(A, B, Ua, Ub, q, r, s, t, extended); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 14: /* */ if (B.abs.$length > 0) { $s = 16; continue; } /* */ $s = 17; continue; /* if (B.abs.$length > 0) { */ case 16: _tmp$8 = (x$1 = A.abs, (0 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 0])); _tmp$9 = (x$2 = B.abs, (0 >= x$2.$length ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + 0])); aWord = _tmp$8; bWord = _tmp$9; /* */ if (extended) { $s = 18; continue; } /* */ $s = 19; continue; /* if (extended) { */ case 18: _tmp$10 = 0; _tmp$11 = 0; _tmp$12 = 0; _tmp$13 = 0; ua = _tmp$10; ub = _tmp$11; va = _tmp$12; vb = _tmp$13; _tmp$14 = 1; _tmp$15 = 0; ua = _tmp$14; ub = _tmp$15; _tmp$16 = 0; _tmp$17 = 1; va = _tmp$16; vb = _tmp$17; even$1 = true; while (true) { if (!(!((bWord === 0)))) { break; } _tmp$18 = (_q = aWord / bWord, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); _tmp$19 = (_r = aWord % bWord, _r === _r ? _r : $throwRuntimeError("integer divide by zero")); q$1 = _tmp$18; r$1 = _tmp$19; _tmp$20 = bWord; _tmp$21 = r$1; aWord = _tmp$20; bWord = _tmp$21; _tmp$22 = ub; _tmp$23 = ua + ($imul(q$1, ub) >>> 0) >>> 0; ua = _tmp$22; ub = _tmp$23; _tmp$24 = vb; _tmp$25 = va + ($imul(q$1, vb) >>> 0) >>> 0; va = _tmp$24; vb = _tmp$25; even$1 = !even$1; } t.abs = t.abs.setWord(ua); s.abs = s.abs.setWord(va); t.neg = !even$1; s.neg = even$1; _r$1 = t.Mul(Ua, t); /* */ $s = 21; case 21: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _r$2 = s.Mul(Ub, s); /* */ $s = 22; case 22: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; _r$3 = Ua.Add(t, s); /* */ $s = 23; case 23: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $s = 20; continue; /* } else { */ case 19: while (true) { if (!(!((bWord === 0)))) { break; } _tmp$26 = bWord; _tmp$27 = (_r$4 = aWord % bWord, _r$4 === _r$4 ? _r$4 : $throwRuntimeError("integer divide by zero")); aWord = _tmp$26; bWord = _tmp$27; } /* } */ case 20: (x$3 = A.abs, (0 >= x$3.$length ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + 0] = aWord)); /* } */ case 17: /* } */ case 12: negA = a.neg; /* */ if (!(y === ptrType$2.nil)) { $s = 24; continue; } /* */ $s = 25; continue; /* if (!(y === ptrType$2.nil)) { */ case 24: if (y === b) { B.Set(b); } else { B = b; } _r$5 = y.Mul(a, Ua); /* */ $s = 26; case 26: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; if (negA) { y.neg = !y.neg; } _r$6 = y.Sub(A, y); /* */ $s = 27; case 27: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; _r$7 = y.Div(y, B); /* */ $s = 28; case 28: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$7; /* } */ case 25: if (!(x === ptrType$2.nil)) { Int.copy(x, Ua); if (negA) { x.neg = !x.neg; } } Int.copy(z, A); $s = -1; return z; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.lehmerGCD }; } $f.A = A; $f.B = B; $f.Ua = Ua; $f.Ub = Ub; $f._q = _q; $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$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$3 = _tmp$3; $f._tmp$4 = _tmp$4; $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 = _tuple; $f.a = a; $f.aWord = aWord; $f.b = b; $f.bWord = bWord; $f.even = even; $f.even$1 = even$1; $f.extended = extended; $f.negA = negA; $f.q = q; $f.q$1 = q$1; $f.r = r; $f.r$1 = r$1; $f.s = s; $f.t = t; $f.u0 = u0; $f.u1 = u1; $f.ua = ua; $f.ub = ub; $f.v0 = v0; $f.v1 = v1; $f.va = va; $f.vb = vb; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.y = y; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.lehmerGCD = function(x, y, a, b) { return this.$val.lehmerGCD(x, y, a, b); }; Int.ptr.prototype.Rand = function(rnd, n) { var _r, n, rnd, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; $s = -1; 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; $s = -1; return z; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.Rand }; } $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 _r, _r$1, _r$2, _tmp, _tmp$1, d, g, g2, n, n2, x, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; d = $f.d; g = $f.g; g2 = $f.g2; n = $f.n; n2 = $f.n2; x = $f.x; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: x = [x]; z = this; if (n.neg) { n2 = new Int.ptr(false, nat.nil); n = n2.Neg(n); } /* */ if (g.neg) { $s = 1; continue; } /* */ $s = 2; continue; /* if (g.neg) { */ case 1: g2 = new Int.ptr(false, nat.nil); _r = g2.Mod(g, n); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } g = _r; /* } */ case 2: _tmp = new Int.ptr(false, nat.nil); _tmp$1 = new Int.ptr(false, nat.nil); d = $clone(_tmp, Int); x[0] = $clone(_tmp$1, Int); _r$1 = d.GCD(x[0], ptrType$2.nil, g, n); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; if (!((d.Cmp(intOne) === 0))) { $s = -1; return ptrType$2.nil; } /* */ if (x[0].neg) { $s = 5; continue; } /* */ $s = 6; continue; /* if (x[0].neg) { */ case 5: _r$2 = z.Add(x[0], n); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; $s = 7; continue; /* } else { */ case 6: z.Set(x[0]); /* } */ case 7: $s = -1; return z; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.ModInverse }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.d = d; $f.g = g; $f.g2 = g2; $f.n = n; $f.n2 = n2; $f.x = x; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.ModInverse = function(g, n) { return this.$val.ModInverse(g, n); }; Jacobi = function(x, y) { var _r, _r$1, _r$2, _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; _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; 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"), undefined) : 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"), undefined) : 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([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) { */ case 4: if (b[0].Cmp(intOne) === 0) { $s = -1; return j; } if (a[0].abs.$length === 0) { $s = -1; return 0; } _r$1 = a[0].Mod(a[0], b[0]); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; if (a[0].abs.$length === 0) { $s = -1; 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"), undefined) : x$2.$array[x$2.$offset + 0])) & 7) >>> 0; if ((bmod8 === 3) || (bmod8 === 5)) { j = -j; } } _r$2 = c[0].Rsh(a[0], s); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; if (((((x$3 = b[0].abs, (0 >= x$3.$length ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + 0])) & 3) >>> 0) === 3) && ((((x$4 = c[0].abs, (0 >= x$4.$length ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + 0])) & 3) >>> 0) === 3)) { j = -j; } a[0].Set(b[0]); b[0].Set(c[0]); $s = 4; continue; case 5: $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: Jacobi }; } $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.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 _r, _r$1, _r$2, e, p, x, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; e = $f.e; p = $f.p; x = $f.x; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; _r = new Int.ptr(false, nat.nil).Add(p, intOne); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } e = _r; _r$1 = e.Rsh(e, 2); /* */ $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$2 = z.Exp(x, e, p); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; $s = -1; return z; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.modSqrt3Mod4Prime }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.e = e; $f.p = p; $f.x = x; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.modSqrt3Mod4Prime = function(x, p) { return this.$val.modSqrt3Mod4Prime(x, p); }; Int.ptr.prototype.modSqrt5Mod8Prime = function(x, p) { var _r, _r$1, _r$10, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, alpha, beta, e, p, tx, x, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$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; alpha = $f.alpha; beta = $f.beta; e = $f.e; p = $f.p; tx = $f.tx; x = $f.x; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; _r = new Int.ptr(false, nat.nil).Rsh(p, 3); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } e = _r; tx = new Int.ptr(false, nat.nil).Lsh(x, 1); _r$1 = new Int.ptr(false, nat.nil).Exp(tx, e, p); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } alpha = _r$1; _r$2 = new Int.ptr(false, nat.nil).Mul(alpha, alpha); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } beta = _r$2; _r$3 = beta.Mod(beta, p); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _r$4 = beta.Mul(beta, tx); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; _r$5 = beta.Mod(beta, p); /* */ $s = 6; case 6: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; _r$6 = beta.Sub(beta, intOne); /* */ $s = 7; case 7: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; _r$7 = beta.Mul(beta, x); /* */ $s = 8; case 8: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$7; _r$8 = beta.Mod(beta, p); /* */ $s = 9; case 9: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$8; _r$9 = beta.Mul(beta, alpha); /* */ $s = 10; case 10: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$9; _r$10 = z.Mod(beta, p); /* */ $s = 11; case 11: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; $s = -1; return z; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.modSqrt5Mod8Prime }; } $f._r = _r; $f._r$1 = _r$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.alpha = alpha; $f.beta = beta; $f.e = e; $f.p = p; $f.tx = tx; $f.x = x; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.modSqrt5Mod8Prime = function(x, p) { return this.$val.modSqrt5Mod8Prime(x, p); }; Int.ptr.prototype.modSqrtTonelliShanks = function(x, p) { var _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _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; _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$17 = $f._r$17; _r$18 = $f._r$18; _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; _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); _r = s[0].Sub(p, intOne); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; e = s[0].abs.trailingZeroBits(); _r$1 = s[0].Rsh(s[0], e); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; n[0] = new Int.ptr(false, nat.nil); n[0].SetInt64(new $Int64(0, 2)); /* while (true) { */ case 3: _r$2 = Jacobi(n[0], p); /* */ $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 === -1)))) { break; } */ if(!(!((_r$2 === -1)))) { $s = 4; continue; } _r$3 = n[0].Add(n[0], intOne); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $s = 3; continue; case 4: _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); _r$4 = y[0].Add(s[0], intOne); /* */ $s = 7; case 7: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; _r$5 = y[0].Rsh(y[0], 1); /* */ $s = 8; case 8: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; _r$6 = y[0].Exp(x, y[0], p); /* */ $s = 9; case 9: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; _r$7 = b[0].Exp(x, s[0], p); /* */ $s = 10; case 10: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$7; _r$8 = g[0].Exp(n[0], s[0], p); /* */ $s = 11; case 11: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$8; r = e; /* while (true) { */ case 12: m = 0; t[0].Set(b[0]); /* while (true) { */ case 14: /* if (!(!((t[0].Cmp(intOne) === 0)))) { break; } */ if(!(!((t[0].Cmp(intOne) === 0)))) { $s = 15; continue; } _r$9 = t[0].Mul(t[0], t[0]); /* */ $s = 16; case 16: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$10 = _r$9.Mod(t[0], p); /* */ $s = 17; case 17: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; m = m + (1) >>> 0; $s = 14; continue; case 15: if (m === 0) { $s = -1; return z.Set(y[0]); } _r$11 = t[0].SetInt64(new $Int64(0, 0)).SetBit(t[0], ((((r - m >>> 0) - 1 >>> 0) >> 0)), 1); /* */ $s = 18; case 18: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _r$12 = _r$11.Exp(g[0], t[0], p); /* */ $s = 19; case 19: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _r$12; _r$13 = g[0].Mul(t[0], t[0]); /* */ $s = 20; case 20: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _r$14 = _r$13.Mod(g[0], p); /* */ $s = 21; case 21: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _r$14; _r$15 = y[0].Mul(y[0], t[0]); /* */ $s = 22; case 22: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _r$16 = _r$15.Mod(y[0], p); /* */ $s = 23; case 23: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _r$16; _r$17 = b[0].Mul(b[0], g[0]); /* */ $s = 24; case 24: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } _r$18 = _r$17.Mod(b[0], p); /* */ $s = 25; case 25: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } _r$18; r = m; $s = 12; continue; case 13: $s = -1; return ptrType$2.nil; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.modSqrtTonelliShanks }; } $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$17 = _r$17; $f._r$18 = _r$18; $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._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 $24r, $24r$1, $24r$2, _1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, p, x, x$1, x$2, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _1 = $f._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; p = $f.p; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; 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)) { $s = -1; return ptrType$2.nil; } else if (_1 === (0)) { $s = -1; return z.SetInt64(new $Int64(0, 0)); } else if (_1 === (1)) { /* break; */ $s = 1; continue; } case 1: /* */ if (x.neg || x.Cmp(p) >= 0) { $s = 3; continue; } /* */ $s = 4; continue; /* if (x.neg || x.Cmp(p) >= 0) { */ case 3: _r$1 = new Int.ptr(false, nat.nil).Mod(x, p); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } x = _r$1; /* } */ case 4: /* */ if (((_r$2 = (x$1 = p.abs, (0 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 0])) % 4, _r$2 === _r$2 ? _r$2 : $throwRuntimeError("integer divide by zero")) === 3)) { $s = 7; continue; } /* */ if (((_r$3 = (x$2 = p.abs, (0 >= x$2.$length ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + 0])) % 8, _r$3 === _r$3 ? _r$3 : $throwRuntimeError("integer divide by zero")) === 5)) { $s = 8; continue; } /* */ $s = 9; continue; /* if (((_r$2 = (x$1 = p.abs, (0 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 0])) % 4, _r$2 === _r$2 ? _r$2 : $throwRuntimeError("integer divide by zero")) === 3)) { */ case 7: _r$4 = z.modSqrt3Mod4Prime(x, p); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r = _r$4; $s = 12; case 12: return $24r; /* } else if (((_r$3 = (x$2 = p.abs, (0 >= x$2.$length ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + 0])) % 8, _r$3 === _r$3 ? _r$3 : $throwRuntimeError("integer divide by zero")) === 5)) { */ case 8: _r$5 = z.modSqrt5Mod8Prime(x, p); /* */ $s = 13; case 13: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $24r$1 = _r$5; $s = 14; case 14: return $24r$1; /* } else { */ case 9: _r$6 = z.modSqrtTonelliShanks(x, p); /* */ $s = 15; case 15: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } $24r$2 = _r$6; $s = 16; case 16: return $24r$2; /* } */ case 10: case 6: $s = -1; return ptrType$2.nil; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.ModSqrt }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._1 = _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.p = p; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $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 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 _r, _r$1, n, t, x, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; n = $f.n; t = $f.t; x = $f.x; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; /* */ if (x.neg) { $s = 1; continue; } /* */ $s = 2; continue; /* if (x.neg) { */ case 1: _r = z.abs.sub(x.abs, natOne); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } t = _r; t = t.shr(t, n); _r$1 = t.add(t, natOne); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } z.abs = _r$1; z.neg = true; $s = -1; return z; /* } */ case 2: z.abs = z.abs.shr(x.abs, n); z.neg = false; $s = -1; return z; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.Rsh }; } $f._r = _r; $f._r$1 = _r$1; $f.n = n; $f.t = t; $f.x = x; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.Rsh = function(x, n) { return this.$val.Rsh(x, n); }; Int.ptr.prototype.Bit = function(i) { var _r, i, t, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; i = $f.i; t = $f.t; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: x = this; if (i === 0) { if (x.abs.$length > 0) { $s = -1; return (((((x$1 = x.abs, (0 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 0])) & 1) >>> 0) >>> 0)); } $s = -1; return 0; } if (i < 0) { $panic(new $String("negative bit index")); } /* */ if (x.neg) { $s = 1; continue; } /* */ $s = 2; continue; /* if (x.neg) { */ case 1: _r = (nat.nil).sub(x.abs, natOne); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } t = _r; $s = -1; return (t.bit(((i >>> 0))) ^ 1) >>> 0; /* } */ case 2: $s = -1; return x.abs.bit(((i >>> 0))); /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.Bit }; } $f._r = _r; $f.i = i; $f.t = t; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.Bit = function(i) { return this.$val.Bit(i); }; Int.ptr.prototype.SetBit = function(x, i, b) { var _r, _r$1, b, i, t, x, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; b = $f.b; i = $f.i; t = $f.t; x = $f.x; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; if (i < 0) { $panic(new $String("negative bit index")); } /* */ if (x.neg) { $s = 1; continue; } /* */ $s = 2; continue; /* if (x.neg) { */ case 1: _r = z.abs.sub(x.abs, natOne); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } t = _r; t = t.setBit(t, ((i >>> 0)), (b ^ 1) >>> 0); _r$1 = t.add(t, natOne); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } z.abs = _r$1; z.neg = z.abs.$length > 0; $s = -1; return z; /* } */ case 2: z.abs = z.abs.setBit(x.abs, ((i >>> 0)), b); z.neg = false; $s = -1; return z; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.SetBit }; } $f._r = _r; $f._r$1 = _r$1; $f.b = b; $f.i = i; $f.t = t; $f.x = x; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.SetBit = function(x, i, b) { return this.$val.SetBit(x, i, b); }; Int.ptr.prototype.And = function(x, y) { var _r, _r$1, _r$2, _r$3, _tmp, _tmp$1, x, x1, y, y1, y1$1, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; x = $f.x; x1 = $f.x1; y = $f.y; y1 = $f.y1; y1$1 = $f.y1$1; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; /* */ if (x.neg === y.neg) { $s = 1; continue; } /* */ $s = 2; continue; /* if (x.neg === y.neg) { */ case 1: /* */ if (x.neg) { $s = 3; continue; } /* */ $s = 4; continue; /* if (x.neg) { */ case 3: _r = (nat.nil).sub(x.abs, natOne); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } x1 = _r; _r$1 = (nat.nil).sub(y.abs, natOne); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } y1 = _r$1; _r$2 = z.abs.add(z.abs.or(x1, y1), natOne); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } z.abs = _r$2; z.neg = true; $s = -1; return z; /* } */ case 4: z.abs = z.abs.and(x.abs, y.abs); z.neg = false; $s = -1; return z; /* } */ case 2: if (x.neg) { _tmp = y; _tmp$1 = x; x = _tmp; y = _tmp$1; } _r$3 = (nat.nil).sub(y.abs, natOne); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } y1$1 = _r$3; z.abs = z.abs.andNot(x.abs, y1$1); z.neg = false; $s = -1; return z; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.And }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.x = x; $f.x1 = x1; $f.y = y; $f.y1 = y1; $f.y1$1 = y1$1; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.And = function(x, y) { return this.$val.And(x, y); }; Int.ptr.prototype.AndNot = function(x, y) { var _r, _r$1, _r$2, _r$3, _r$4, x, x1, x1$1, y, y1, y1$1, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; x = $f.x; x1 = $f.x1; x1$1 = $f.x1$1; y = $f.y; y1 = $f.y1; y1$1 = $f.y1$1; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; /* */ if (x.neg === y.neg) { $s = 1; continue; } /* */ $s = 2; continue; /* if (x.neg === y.neg) { */ case 1: /* */ if (x.neg) { $s = 3; continue; } /* */ $s = 4; continue; /* if (x.neg) { */ case 3: _r = (nat.nil).sub(x.abs, natOne); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } x1 = _r; _r$1 = (nat.nil).sub(y.abs, natOne); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } y1 = _r$1; z.abs = z.abs.andNot(y1, x1); z.neg = false; $s = -1; return z; /* } */ case 4: z.abs = z.abs.andNot(x.abs, y.abs); z.neg = false; $s = -1; return z; /* } */ case 2: /* */ if (x.neg) { $s = 7; continue; } /* */ $s = 8; continue; /* if (x.neg) { */ case 7: _r$2 = (nat.nil).sub(x.abs, natOne); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } x1$1 = _r$2; _r$3 = z.abs.add(z.abs.or(x1$1, y.abs), natOne); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } z.abs = _r$3; z.neg = true; $s = -1; return z; /* } */ case 8: _r$4 = (nat.nil).sub(y.abs, natOne); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } y1$1 = _r$4; z.abs = z.abs.and(x.abs, y1$1); z.neg = false; $s = -1; return z; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.AndNot }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.x = x; $f.x1 = x1; $f.x1$1 = x1$1; $f.y = y; $f.y1 = y1; $f.y1$1 = y1$1; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.AndNot = function(x, y) { return this.$val.AndNot(x, y); }; Int.ptr.prototype.Or = function(x, y) { var _r, _r$1, _r$2, _r$3, _r$4, _tmp, _tmp$1, x, x1, y, y1, y1$1, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; x = $f.x; x1 = $f.x1; y = $f.y; y1 = $f.y1; y1$1 = $f.y1$1; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; /* */ if (x.neg === y.neg) { $s = 1; continue; } /* */ $s = 2; continue; /* if (x.neg === y.neg) { */ case 1: /* */ if (x.neg) { $s = 3; continue; } /* */ $s = 4; continue; /* if (x.neg) { */ case 3: _r = (nat.nil).sub(x.abs, natOne); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } x1 = _r; _r$1 = (nat.nil).sub(y.abs, natOne); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } y1 = _r$1; _r$2 = z.abs.add(z.abs.and(x1, y1), natOne); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } z.abs = _r$2; z.neg = true; $s = -1; return z; /* } */ case 4: z.abs = z.abs.or(x.abs, y.abs); z.neg = false; $s = -1; return z; /* } */ case 2: if (x.neg) { _tmp = y; _tmp$1 = x; x = _tmp; y = _tmp$1; } _r$3 = (nat.nil).sub(y.abs, natOne); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } y1$1 = _r$3; _r$4 = z.abs.add(z.abs.andNot(y1$1, x.abs), natOne); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } z.abs = _r$4; z.neg = true; $s = -1; return z; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.Or }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.x = x; $f.x1 = x1; $f.y = y; $f.y1 = y1; $f.y1$1 = y1$1; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.Or = function(x, y) { return this.$val.Or(x, y); }; Int.ptr.prototype.Xor = function(x, y) { var _r, _r$1, _r$2, _r$3, _tmp, _tmp$1, x, x1, y, y1, y1$1, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; x = $f.x; x1 = $f.x1; y = $f.y; y1 = $f.y1; y1$1 = $f.y1$1; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; /* */ if (x.neg === y.neg) { $s = 1; continue; } /* */ $s = 2; continue; /* if (x.neg === y.neg) { */ case 1: /* */ if (x.neg) { $s = 3; continue; } /* */ $s = 4; continue; /* if (x.neg) { */ case 3: _r = (nat.nil).sub(x.abs, natOne); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } x1 = _r; _r$1 = (nat.nil).sub(y.abs, natOne); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } y1 = _r$1; z.abs = z.abs.xor(x1, y1); z.neg = false; $s = -1; return z; /* } */ case 4: z.abs = z.abs.xor(x.abs, y.abs); z.neg = false; $s = -1; return z; /* } */ case 2: if (x.neg) { _tmp = y; _tmp$1 = x; x = _tmp; y = _tmp$1; } _r$2 = (nat.nil).sub(y.abs, natOne); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } y1$1 = _r$2; _r$3 = z.abs.add(z.abs.xor(x.abs, y1$1), natOne); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } z.abs = _r$3; z.neg = true; $s = -1; return z; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.Xor }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.x = x; $f.x1 = x1; $f.y = y; $f.y1 = y1; $f.y1$1 = y1$1; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.Xor = function(x, y) { return this.$val.Xor(x, y); }; Int.ptr.prototype.Not = function(x) { var _r, _r$1, x, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; x = $f.x; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; /* */ if (x.neg) { $s = 1; continue; } /* */ $s = 2; continue; /* if (x.neg) { */ case 1: _r = z.abs.sub(x.abs, natOne); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } z.abs = _r; z.neg = false; $s = -1; return z; /* } */ case 2: _r$1 = z.abs.add(x.abs, natOne); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } z.abs = _r$1; z.neg = true; $s = -1; return z; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.Not }; } $f._r = _r; $f._r$1 = _r$1; $f.x = x; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.Not = function(x) { return this.$val.Not(x); }; Int.ptr.prototype.Sqrt = function(x) { var _r, x, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; x = $f.x; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: z = this; if (x.neg) { $panic(new $String("square root of negative number")); } z.neg = false; _r = z.abs.sqrt(x.abs); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } z.abs = _r; $s = -1; return z; /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.Sqrt }; } $f._r = _r; $f.x = x; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; Int.prototype.Sqrt = function(x) { return this.$val.Sqrt(x); }; mulWW = function(x, y) { var _tuple, x, y, z0, z1; z1 = 0; z0 = 0; _tuple = mulWW_g(x, y); z1 = _tuple[0]; z0 = _tuple[1]; return [z1, z0]; }; addVV = function(z, x, y) { var c, x, y, z; c = 0; c = addVV_g(z, x, y); return c; }; subVV = function(z, x, y) { var c, x, y, z; c = 0; c = subVV_g(z, x, y); return c; }; addVW = function(z, x, y) { var $24r, _r, c, fn, x, y, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; c = $f.c; fn = $f.fn; x = $f.x; y = $f.y; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = 0; fn = addVW_g; if (z.$length > 32) { fn = addVWlarge; } _r = fn(z, x, y); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } c = _r; $24r = c; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: addVW }; } $f.$24r = $24r; $f._r = _r; $f.c = c; $f.fn = fn; $f.x = x; $f.y = y; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; subVW = function(z, x, y) { var $24r, _r, c, fn, x, y, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; c = $f.c; fn = $f.fn; x = $f.x; y = $f.y; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = 0; fn = subVW_g; if (z.$length > 32) { fn = subVWlarge; } _r = fn(z, x, y); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } c = _r; $24r = c; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: subVW }; } $f.$24r = $24r; $f._r = _r; $f.c = c; $f.fn = fn; $f.x = x; $f.y = y; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; shlVU = function(z, x, s) { var c, s, x, z; c = 0; c = shlVU_g(z, x, s); return c; }; shrVU = function(z, x, s) { var c, s, x, z; c = 0; c = shrVU_g(z, x, s); return c; }; mulAddVWW = function(z, x, y, r) { var c, r, x, y, z; c = 0; c = mulAddVWW_g(z, x, y, r); return c; }; addMulVVW = function(z, x, y) { var c, x, y, z; c = 0; c = addMulVVW_g(z, x, y); return c; }; mulWW_g = function(x, y) { var _tmp, _tmp$1, _tuple, hi, lo, x, y, z0, z1; z1 = 0; z0 = 0; _tuple = bits.Mul(((x >>> 0)), ((y >>> 0))); hi = _tuple[0]; lo = _tuple[1]; _tmp = ((hi >>> 0)); _tmp$1 = ((lo >>> 0)); z1 = _tmp; z0 = _tmp$1; return [z1, z0]; }; mulAddWWW_g = function(x, y, c) { var _tmp, _tmp$1, _tuple, _tuple$1, c, cc, hi, lo, x, y, z0, z1; z1 = 0; z0 = 0; _tuple = bits.Mul(((x >>> 0)), ((y >>> 0))); hi = _tuple[0]; lo = _tuple[1]; cc = 0; _tuple$1 = bits.Add(lo, ((c >>> 0)), 0); lo = _tuple$1[0]; cc = _tuple$1[1]; _tmp = (((hi + cc >>> 0) >>> 0)); _tmp$1 = ((lo >>> 0)); z1 = _tmp; z0 = _tmp$1; return [z1, z0]; }; nlz = function(x) { var x; return ((bits.LeadingZeros(((x >>> 0))) >>> 0)); }; addVV_g = function(z, x, y) { var _tuple, c, cc, i, x, y, z, zi; c = 0; i = 0; while (true) { if (!(i < z.$length && i < x.$length && i < y.$length)) { break; } _tuple = bits.Add(((((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]) >>> 0)), ((((i < 0 || i >= y.$length) ? ($throwRuntimeError("index out of range"), undefined) : y.$array[y.$offset + i]) >>> 0)), ((c >>> 0))); zi = _tuple[0]; cc = _tuple[1]; ((i < 0 || i >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + i] = ((zi >>> 0))); c = ((cc >>> 0)); i = i + (1) >> 0; } return c; }; subVV_g = function(z, x, y) { var _tuple, c, cc, i, x, y, z, zi; c = 0; i = 0; while (true) { if (!(i < z.$length && i < x.$length && i < y.$length)) { break; } _tuple = bits.Sub(((((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]) >>> 0)), ((((i < 0 || i >= y.$length) ? ($throwRuntimeError("index out of range"), undefined) : y.$array[y.$offset + i]) >>> 0)), ((c >>> 0))); zi = _tuple[0]; cc = _tuple[1]; ((i < 0 || i >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + i] = ((zi >>> 0))); c = ((cc >>> 0)); i = i + (1) >> 0; } return c; }; addVW_g = function(z, x, y) { var _tuple, c, cc, i, x, y, z, zi; c = 0; c = y; i = 0; while (true) { if (!(i < z.$length && i < x.$length)) { break; } _tuple = bits.Add(((((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]) >>> 0)), ((c >>> 0)), 0); zi = _tuple[0]; cc = _tuple[1]; ((i < 0 || i >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + i] = ((zi >>> 0))); c = ((cc >>> 0)); i = i + (1) >> 0; } return c; }; addVWlarge = function(z, x, y) { var _tuple, c, cc, i, x, y, z, zi; c = 0; c = y; i = 0; while (true) { if (!(i < z.$length && i < x.$length)) { break; } if (c === 0) { $copySlice($subslice(z, i), $subslice(x, i)); return c; } _tuple = bits.Add(((((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]) >>> 0)), ((c >>> 0)), 0); zi = _tuple[0]; cc = _tuple[1]; ((i < 0 || i >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + i] = ((zi >>> 0))); c = ((cc >>> 0)); i = i + (1) >> 0; } return c; }; subVW_g = function(z, x, y) { var _tuple, c, cc, i, x, y, z, zi; c = 0; c = y; i = 0; while (true) { if (!(i < z.$length && i < x.$length)) { break; } _tuple = bits.Sub(((((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]) >>> 0)), ((c >>> 0)), 0); zi = _tuple[0]; cc = _tuple[1]; ((i < 0 || i >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + i] = ((zi >>> 0))); c = ((cc >>> 0)); i = i + (1) >> 0; } return c; }; subVWlarge = function(z, x, y) { var _tuple, c, cc, i, x, y, z, zi; c = 0; c = y; i = 0; while (true) { if (!(i < z.$length && i < x.$length)) { break; } if (c === 0) { $copySlice($subslice(z, i), $subslice(x, i)); return c; } _tuple = bits.Sub(((((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]) >>> 0)), ((c >>> 0)), 0); zi = _tuple[0]; cc = _tuple[1]; ((i < 0 || i >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + i] = ((zi >>> 0))); c = ((cc >>> 0)); i = i + (1) >> 0; } return c; }; shlVU_g = function(z, x, s) { var $C5$9D, c, i, s, x, x$1, x$2, y, y$1, y$2, y$3, z; c = 0; if (s === 0) { $copySlice(z, x); return c; } if (z.$length === 0) { return c; } s = (s & (31)) >>> 0; $C5$9D = 32 - s >>> 0; $C5$9D = ($C5$9D & (31)) >>> 0; c = (y = $C5$9D, y < 32 ? ((x$1 = z.$length - 1 >> 0, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])) >>> y) : 0) >>> 0; i = z.$length - 1 >> 0; while (true) { if (!(i > 0)) { break; } ((i < 0 || i >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + i] = ((((y$1 = s, y$1 < 32 ? (((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]) << y$1) : 0) >>> 0) | ((y$2 = $C5$9D, y$2 < 32 ? ((x$2 = i - 1 >> 0, ((x$2 < 0 || x$2 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$2])) >>> y$2) : 0) >>> 0)) >>> 0)); i = i - (1) >> 0; } (0 >= z.$length ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + 0] = ((y$3 = s, y$3 < 32 ? ((0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0]) << y$3) : 0) >>> 0)); return c; }; shrVU_g = function(z, x, s) { var $C5$9D, c, i, s, x, x$1, x$2, x$3, x$4, y, y$1, y$2, y$3, z; c = 0; if (s === 0) { $copySlice(z, x); return c; } if (z.$length === 0) { return c; } if (!((x.$length === z.$length))) { $panic(new $String("len(x) != len(z)")); } s = (s & (31)) >>> 0; $C5$9D = 32 - s >>> 0; $C5$9D = ($C5$9D & (31)) >>> 0; c = (y = $C5$9D, y < 32 ? ((0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0]) << y) : 0) >>> 0; i = 1; while (true) { if (!(i < z.$length)) { break; } (x$2 = i - 1 >> 0, ((x$2 < 0 || x$2 >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + x$2] = ((((y$1 = s, y$1 < 32 ? ((x$1 = i - 1 >> 0, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])) >>> y$1) : 0) >>> 0) | ((y$2 = $C5$9D, y$2 < 32 ? (((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]) << y$2) : 0) >>> 0)) >>> 0))); i = i + (1) >> 0; } (x$4 = z.$length - 1 >> 0, ((x$4 < 0 || x$4 >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + x$4] = ((y$3 = s, y$3 < 32 ? ((x$3 = z.$length - 1 >> 0, ((x$3 < 0 || x$3 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$3])) >>> y$3) : 0) >>> 0))); return c; }; mulAddVWW_g = function(z, x, y, r) { var _tuple, c, i, r, x, y, z; c = 0; c = r; i = 0; while (true) { if (!(i < z.$length && i < x.$length)) { break; } _tuple = mulAddWWW_g(((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]), y, c); c = _tuple[0]; ((i < 0 || i >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + i] = _tuple[1]); i = i + (1) >> 0; } return c; }; addMulVVW_g = function(z, x, y) { var _tmp, _tmp$1, _tuple, _tuple$1, c, cc, i, lo, x, y, z, z0, z1; c = 0; i = 0; while (true) { if (!(i < z.$length && i < x.$length)) { break; } _tuple = mulAddWWW_g(((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]), y, ((i < 0 || i >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + i])); z1 = _tuple[0]; z0 = _tuple[1]; _tuple$1 = bits.Add(((z0 >>> 0)), ((c >>> 0)), 0); lo = _tuple$1[0]; cc = _tuple$1[1]; _tmp = ((cc >>> 0)); _tmp$1 = ((lo >>> 0)); c = _tmp; ((i < 0 || i >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + i] = _tmp$1); c = c + (z1) >>> 0; i = i + (1) >> 0; } return c; }; divWW = function(x1, x0, y, m) { var _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, b, c, d, dq0, dq1, m, q, qq, r, r0, r1, s, t0, t1, x0, x1, y, y$1, y$2, y$3, y$4, y$5; q = 0; r = 0; s = nlz(y); if (!((s === 0))) { x1 = (((y$1 = s, y$1 < 32 ? (x1 << y$1) : 0) >>> 0) | ((y$2 = ((32 - s >>> 0)), y$2 < 32 ? (x0 >>> y$2) : 0) >>> 0)) >>> 0; x0 = (y$3 = (s), y$3 < 32 ? (x0 << y$3) : 0) >>> 0; y = (y$4 = (s), y$4 < 32 ? (y << y$4) : 0) >>> 0; } d = ((y >>> 0)); _tuple = bits.Mul(((m >>> 0)), ((x1 >>> 0))); t1 = _tuple[0]; t0 = _tuple[1]; _tuple$1 = bits.Add(t0, ((x0 >>> 0)), 0); c = _tuple$1[1]; _tuple$2 = bits.Add(t1, ((x1 >>> 0)), c); t1 = _tuple$2[0]; qq = t1; _tuple$3 = bits.Mul(d, qq); dq1 = _tuple$3[0]; dq0 = _tuple$3[1]; _tuple$4 = bits.Sub(((x0 >>> 0)), dq0, 0); r0 = _tuple$4[0]; b = _tuple$4[1]; _tuple$5 = bits.Sub(((x1 >>> 0)), dq1, b); r1 = _tuple$5[0]; if (!((r1 === 0))) { qq = qq + (1) >>> 0; r0 = r0 - (d) >>> 0; } if (r0 >= d) { qq = qq + (1) >>> 0; r0 = r0 - (d) >>> 0; } _tmp = ((qq >>> 0)); _tmp$1 = ((((y$5 = s, y$5 < 32 ? (r0 >>> y$5) : 0) >>> 0) >>> 0)); q = _tmp; r = _tmp$1; return [q, r]; }; reciprocalWord = function(d1) { var _tuple, d1, rec, u, x0, x1, y; u = ((((y = nlz(d1), y < 32 ? (d1 << y) : 0) >>> 0) >>> 0)); x1 = ~u >>> 0; x0 = 4294967295; _tuple = bits.Div(x1, x0, u); rec = _tuple[0]; return ((rec >>> 0)); }; nat.methods = [{prop: "probablyPrimeMillerRabin", name: "probablyPrimeMillerRabin", pkg: "math/big", typ: $funcType([$Int, $Bool], [$Bool], false)}, {prop: "probablyPrimeLucas", name: "probablyPrimeLucas", pkg: "math/big", typ: $funcType([], [$Bool], false)}, {prop: "div", name: "div", pkg: "math/big", typ: $funcType([nat, nat, nat], [nat, nat], false)}, {prop: "divW", name: "divW", pkg: "math/big", typ: $funcType([nat, Word], [nat, Word], false)}, {prop: "modW", name: "modW", pkg: "math/big", typ: $funcType([Word], [Word], false)}, {prop: "divLarge", name: "divLarge", pkg: "math/big", typ: $funcType([nat, nat, nat], [nat, nat], false)}, {prop: "divBasic", name: "divBasic", pkg: "math/big", typ: $funcType([nat, nat], [], false)}, {prop: "divRecursive", name: "divRecursive", pkg: "math/big", typ: $funcType([nat, nat], [], false)}, {prop: "divRecursiveStep", name: "divRecursiveStep", pkg: "math/big", typ: $funcType([nat, nat, $Int, ptrType$3, sliceType$3], [], 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$1], false)}, {prop: "itoa", name: "itoa", pkg: "math/big", typ: $funcType([$Bool, $Int], [sliceType$1], false)}, {prop: "convertWords", name: "convertWords", pkg: "math/big", typ: $funcType([sliceType$1, Word, $Int, Word, sliceType$4], [], false)}, {prop: "expWW", name: "expWW", pkg: "math/big", typ: $funcType([Word, Word], [nat], false)}, {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: "sqr", name: "sqr", pkg: "math/big", typ: $funcType([nat], [nat], false)}, {prop: "mulRange", name: "mulRange", pkg: "math/big", typ: $funcType([$Uint64, $Uint64], [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: "random", name: "random", pkg: "math/big", typ: $funcType([ptrType$5, 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: "bytes", name: "bytes", pkg: "math/big", typ: $funcType([sliceType$1], [$Int], false)}, {prop: "setBytes", name: "setBytes", pkg: "math/big", typ: $funcType([sliceType$1], [nat], false)}, {prop: "sqrt", name: "sqrt", pkg: "math/big", typ: $funcType([nat], [nat], false)}]; byteReader.methods = [{prop: "ReadByte", name: "ReadByte", pkg: "", typ: $funcType([], [$Uint8, $error], false)}, {prop: "UnreadByte", name: "UnreadByte", pkg: "", typ: $funcType([], [$error], false)}]; ptrType$2.methods = [{prop: "scaleDenom", name: "scaleDenom", pkg: "math/big", typ: $funcType([ptrType$2, nat], [], false)}, {prop: "ProbablyPrime", name: "ProbablyPrime", pkg: "", typ: $funcType([$Int], [$Bool], false)}, {prop: "GobEncode", name: "GobEncode", pkg: "", typ: $funcType([], [sliceType$1, $error], false)}, {prop: "GobDecode", name: "GobDecode", pkg: "", typ: $funcType([sliceType$1], [$error], false)}, {prop: "MarshalText", name: "MarshalText", pkg: "", typ: $funcType([], [sliceType$1, $error], false)}, {prop: "UnmarshalText", name: "UnmarshalText", pkg: "", typ: $funcType([sliceType$1], [$error], false)}, {prop: "MarshalJSON", name: "MarshalJSON", pkg: "", typ: $funcType([], [sliceType$1, $error], false)}, {prop: "UnmarshalJSON", name: "UnmarshalJSON", pkg: "", typ: $funcType([sliceType$1], [$error], false)}, {prop: "Text", name: "Text", pkg: "", typ: $funcType([$Int], [$String], false)}, {prop: "Append", name: "Append", pkg: "", typ: $funcType([sliceType$1, $Int], [sliceType$1], 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$2, $Int, $error], false)}, {prop: "Scan", name: "Scan", pkg: "", typ: $funcType([fmt.ScanState, $Int32], [$error], false)}, {prop: "Sign", name: "Sign", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "SetInt64", name: "SetInt64", pkg: "", typ: $funcType([$Int64], [ptrType$2], false)}, {prop: "SetUint64", name: "SetUint64", pkg: "", typ: $funcType([$Uint64], [ptrType$2], false)}, {prop: "Set", name: "Set", pkg: "", typ: $funcType([ptrType$2], [ptrType$2], false)}, {prop: "Bits", name: "Bits", pkg: "", typ: $funcType([], [sliceType$2], false)}, {prop: "SetBits", name: "SetBits", pkg: "", typ: $funcType([sliceType$2], [ptrType$2], false)}, {prop: "Abs", name: "Abs", pkg: "", typ: $funcType([ptrType$2], [ptrType$2], false)}, {prop: "Neg", name: "Neg", pkg: "", typ: $funcType([ptrType$2], [ptrType$2], false)}, {prop: "Add", name: "Add", pkg: "", typ: $funcType([ptrType$2, ptrType$2], [ptrType$2], false)}, {prop: "Sub", name: "Sub", pkg: "", typ: $funcType([ptrType$2, ptrType$2], [ptrType$2], false)}, {prop: "Mul", name: "Mul", pkg: "", typ: $funcType([ptrType$2, ptrType$2], [ptrType$2], false)}, {prop: "MulRange", name: "MulRange", pkg: "", typ: $funcType([$Int64, $Int64], [ptrType$2], false)}, {prop: "Binomial", name: "Binomial", pkg: "", typ: $funcType([$Int64, $Int64], [ptrType$2], false)}, {prop: "Quo", name: "Quo", pkg: "", typ: $funcType([ptrType$2, ptrType$2], [ptrType$2], false)}, {prop: "Rem", name: "Rem", pkg: "", typ: $funcType([ptrType$2, ptrType$2], [ptrType$2], false)}, {prop: "QuoRem", name: "QuoRem", pkg: "", typ: $funcType([ptrType$2, ptrType$2, ptrType$2], [ptrType$2, ptrType$2], false)}, {prop: "Div", name: "Div", pkg: "", typ: $funcType([ptrType$2, ptrType$2], [ptrType$2], false)}, {prop: "Mod", name: "Mod", pkg: "", typ: $funcType([ptrType$2, ptrType$2], [ptrType$2], false)}, {prop: "DivMod", name: "DivMod", pkg: "", typ: $funcType([ptrType$2, ptrType$2, ptrType$2], [ptrType$2, ptrType$2], false)}, {prop: "Cmp", name: "Cmp", pkg: "", typ: $funcType([ptrType$2], [$Int], false)}, {prop: "CmpAbs", name: "CmpAbs", pkg: "", typ: $funcType([ptrType$2], [$Int], false)}, {prop: "Int64", name: "Int64", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Uint64", name: "Uint64", pkg: "", typ: $funcType([], [$Uint64], false)}, {prop: "IsInt64", name: "IsInt64", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "IsUint64", name: "IsUint64", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "SetString", name: "SetString", pkg: "", typ: $funcType([$String, $Int], [ptrType$2, $Bool], false)}, {prop: "setFromScanner", name: "setFromScanner", pkg: "math/big", typ: $funcType([io.ByteScanner, $Int], [ptrType$2, $Bool], false)}, {prop: "SetBytes", name: "SetBytes", pkg: "", typ: $funcType([sliceType$1], [ptrType$2], false)}, {prop: "Bytes", name: "Bytes", pkg: "", typ: $funcType([], [sliceType$1], false)}, {prop: "FillBytes", name: "FillBytes", pkg: "", typ: $funcType([sliceType$1], [sliceType$1], false)}, {prop: "BitLen", name: "BitLen", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "TrailingZeroBits", name: "TrailingZeroBits", pkg: "", typ: $funcType([], [$Uint], false)}, {prop: "Exp", name: "Exp", pkg: "", typ: $funcType([ptrType$2, ptrType$2, ptrType$2], [ptrType$2], false)}, {prop: "GCD", name: "GCD", pkg: "", typ: $funcType([ptrType$2, ptrType$2, ptrType$2, ptrType$2], [ptrType$2], false)}, {prop: "lehmerGCD", name: "lehmerGCD", pkg: "math/big", typ: $funcType([ptrType$2, ptrType$2, ptrType$2, ptrType$2], [ptrType$2], false)}, {prop: "Rand", name: "Rand", pkg: "", typ: $funcType([ptrType$5, ptrType$2], [ptrType$2], false)}, {prop: "ModInverse", name: "ModInverse", pkg: "", typ: $funcType([ptrType$2, ptrType$2], [ptrType$2], false)}, {prop: "modSqrt3Mod4Prime", name: "modSqrt3Mod4Prime", pkg: "math/big", typ: $funcType([ptrType$2, ptrType$2], [ptrType$2], false)}, {prop: "modSqrt5Mod8Prime", name: "modSqrt5Mod8Prime", pkg: "math/big", typ: $funcType([ptrType$2, ptrType$2], [ptrType$2], false)}, {prop: "modSqrtTonelliShanks", name: "modSqrtTonelliShanks", pkg: "math/big", typ: $funcType([ptrType$2, ptrType$2], [ptrType$2], false)}, {prop: "ModSqrt", name: "ModSqrt", pkg: "", typ: $funcType([ptrType$2, ptrType$2], [ptrType$2], false)}, {prop: "Lsh", name: "Lsh", pkg: "", typ: $funcType([ptrType$2, $Uint], [ptrType$2], false)}, {prop: "Rsh", name: "Rsh", pkg: "", typ: $funcType([ptrType$2, $Uint], [ptrType$2], false)}, {prop: "Bit", name: "Bit", pkg: "", typ: $funcType([$Int], [$Uint], false)}, {prop: "SetBit", name: "SetBit", pkg: "", typ: $funcType([ptrType$2, $Int, $Uint], [ptrType$2], false)}, {prop: "And", name: "And", pkg: "", typ: $funcType([ptrType$2, ptrType$2], [ptrType$2], false)}, {prop: "AndNot", name: "AndNot", pkg: "", typ: $funcType([ptrType$2, ptrType$2], [ptrType$2], false)}, {prop: "Or", name: "Or", pkg: "", typ: $funcType([ptrType$2, ptrType$2], [ptrType$2], false)}, {prop: "Xor", name: "Xor", pkg: "", typ: $funcType([ptrType$2, ptrType$2], [ptrType$2], false)}, {prop: "Not", name: "Not", pkg: "", typ: $funcType([ptrType$2], [ptrType$2], false)}, {prop: "Sqrt", name: "Sqrt", pkg: "", typ: $funcType([ptrType$2], [ptrType$2], false)}]; divisor.init("math/big", [{prop: "bbb", name: "bbb", embedded: false, exported: false, typ: nat, tag: ""}, {prop: "nbits", name: "nbits", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "ndigits", name: "ndigits", embedded: false, exported: false, typ: $Int, tag: ""}]); nat.init(Word); byteReader.init("", [{prop: "ScanState", name: "ScanState", embedded: true, exported: true, typ: fmt.ScanState, tag: ""}]); Int.init("math/big", [{prop: "neg", name: "neg", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "abs", name: "abs", embedded: false, exported: false, typ: nat, 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 = bits.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = rand.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strconv.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strings.$init(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } cacheBase10 = new structType$1.ptr(new nosync.Mutex.ptr(false), arrayType.zero()); natPool = new nosync.Pool.ptr(sliceType.nil, $throwNilPointerError); errNoDigits = errors.New("number has no digits"); errInvalSep = errors.New("'_' must separate successive digits"); leafSize = 8; natOne = new nat([1]); natTwo = new nat([2]); karatsubaThreshold = 40; basicSqrThreshold = 20; karatsubaSqrThreshold = 260; intOne = new Int.ptr(false, natOne); /* */ } 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, ptrType$1, smallPrimesProduct, Int, Read, init; 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", true, "crypto/rand", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); sliceType = $sliceType($Uint8); ptrType = $ptrType(big.Int); ptrType$1 = $ptrType(rngReader); Int = function(rand, max) { var _q, _r, _r$1, _r$2, _tmp, _tmp$1, _tuple, b, bitLen, bytes, err, k, max, n, rand, y, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _q = $f._q; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; b = $f.b; bitLen = $f.bitLen; bytes = $f.bytes; err = $f.err; k = $f.k; max = $f.max; n = $f.n; rand = $f.rand; y = $f.y; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = ptrType.nil; err = $ifaceNil; if (max.Sign() <= 0) { $panic(new $String("crypto/rand: argument to Int is <= 0")); } n = new big.Int.ptr(false, big.nat.nil); _r = n.Sub(max, n.SetUint64(new $Uint64(0, 1))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; bitLen = n.BitLen(); if (bitLen === 0) { $s = -1; return [n, err]; } k = (_q = ((bitLen + 7 >> 0)) / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); b = (((_r$1 = bitLen % 8, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) >>> 0)); if (b === 0) { b = 8; } bytes = $makeSlice(sliceType, k); /* while (true) { */ case 2: _r$2 = io.ReadFull(rand, bytes); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp = ptrType.nil; _tmp$1 = err; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } (0 >= bytes.$length ? ($throwRuntimeError("index out of range"), undefined) : bytes.$array[bytes.$offset + 0] = (((0 >= bytes.$length ? ($throwRuntimeError("index out of range"), undefined) : bytes.$array[bytes.$offset + 0]) & (((((((y = b, y < 32 ? (1 << y) : 0) >> 0)) - 1 >> 0) << 24 >>> 24)))) >>> 0)); n.SetBytes(bytes); if (n.Cmp(max) < 0) { $s = -1; return [n, err]; } $s = 2; continue; case 3: $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Int }; } $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._tuple = _tuple; $f.b = b; $f.bitLen = bitLen; $f.bytes = bytes; $f.err = err; $f.k = k; $f.max = max; $f.n = n; $f.rand = rand; $f.y = y; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Int = Int; Read = function(b) { var $24r, _r, _tuple, b, err, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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]; $24r = [n, err]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Read }; } $f.$24r = $24r; $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; init = function() { $pkg.Reader = new rngReader.ptr(); }; rngReader.ptr.prototype.Read = function(b) { var _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); }; 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["crypto"] = (function() { var $pkg = {}, $init, hash, io, strconv, Hash, PublicKey, PrivateKey, Signer, SignerOpts, Decrypter, DecrypterOpts, sliceType, funcType, sliceType$1, digestSizes, hashes, RegisterHash; hash = $packages["hash"]; io = $packages["io"]; strconv = $packages["strconv"]; Hash = $pkg.Hash = $newType(4, $kindUint, "crypto.Hash", true, "crypto", true, null); PublicKey = $pkg.PublicKey = $newType(8, $kindInterface, "crypto.PublicKey", true, "crypto", true, null); PrivateKey = $pkg.PrivateKey = $newType(8, $kindInterface, "crypto.PrivateKey", true, "crypto", true, null); Signer = $pkg.Signer = $newType(8, $kindInterface, "crypto.Signer", true, "crypto", true, null); SignerOpts = $pkg.SignerOpts = $newType(8, $kindInterface, "crypto.SignerOpts", true, "crypto", true, null); Decrypter = $pkg.Decrypter = $newType(8, $kindInterface, "crypto.Decrypter", true, "crypto", true, null); DecrypterOpts = $pkg.DecrypterOpts = $newType(8, $kindInterface, "crypto.DecrypterOpts", true, "crypto", true, null); sliceType = $sliceType($Uint8); funcType = $funcType([], [hash.Hash], false); sliceType$1 = $sliceType(funcType); Hash.prototype.HashFunc = function() { var h; h = this.$val; return h; }; $ptrType(Hash).prototype.HashFunc = function() { return new Hash(this.$get()).HashFunc(); }; Hash.prototype.String = function() { var _1, h; h = this.$val; _1 = h; if (_1 === (1)) { return "MD4"; } else if (_1 === (2)) { return "MD5"; } else if (_1 === (3)) { return "SHA-1"; } else if (_1 === (4)) { return "SHA-224"; } else if (_1 === (5)) { return "SHA-256"; } else if (_1 === (6)) { return "SHA-384"; } else if (_1 === (7)) { return "SHA-512"; } else if (_1 === (8)) { return "MD5+SHA1"; } else if (_1 === (9)) { return "RIPEMD-160"; } else if (_1 === (10)) { return "SHA3-224"; } else if (_1 === (11)) { return "SHA3-256"; } else if (_1 === (12)) { return "SHA3-384"; } else if (_1 === (13)) { return "SHA3-512"; } else if (_1 === (14)) { return "SHA-512/224"; } else if (_1 === (15)) { return "SHA-512/256"; } else if (_1 === (16)) { return "BLAKE2s-256"; } else if (_1 === (17)) { return "BLAKE2b-256"; } else if (_1 === (18)) { return "BLAKE2b-384"; } else if (_1 === (19)) { return "BLAKE2b-512"; } else { return "unknown hash value " + strconv.Itoa(((h >> 0))); } }; $ptrType(Hash).prototype.String = function() { return new Hash(this.$get()).String(); }; Hash.prototype.Size = function() { var h; h = this.$val; if (h > 0 && h < 20) { return ((((h < 0 || h >= digestSizes.$length) ? ($throwRuntimeError("index out of range"), undefined) : digestSizes.$array[digestSizes.$offset + h]) >> 0)); } $panic(new $String("crypto: Size of unknown hash function")); }; $ptrType(Hash).prototype.Size = function() { return new Hash(this.$get()).Size(); }; Hash.prototype.New = function() { var $24r, _r, f, h, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; f = $f.f; h = $f.h; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: h = this.$val; /* */ if (h > 0 && h < 20) { $s = 1; continue; } /* */ $s = 2; continue; /* if (h > 0 && h < 20) { */ case 1: f = ((h < 0 || h >= hashes.$length) ? ($throwRuntimeError("index out of range"), undefined) : hashes.$array[hashes.$offset + h]); /* */ if (!(f === $throwNilPointerError)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!(f === $throwNilPointerError)) { */ case 3: _r = f(); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 6; case 6: return $24r; /* } */ case 4: /* } */ case 2: $panic(new $String("crypto: requested hash function #" + strconv.Itoa(((h >> 0))) + " is unavailable")); $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Hash.prototype.New }; } $f.$24r = $24r; $f._r = _r; $f.f = f; $f.h = h; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Hash).prototype.New = function() { return new Hash(this.$get()).New(); }; Hash.prototype.Available = function() { var h; h = this.$val; return h < 20 && !(((h < 0 || h >= hashes.$length) ? ($throwRuntimeError("index out of range"), undefined) : hashes.$array[hashes.$offset + h]) === $throwNilPointerError); }; $ptrType(Hash).prototype.Available = function() { return new Hash(this.$get()).Available(); }; RegisterHash = function(h, f) { var f, h; if (h >= 20) { $panic(new $String("crypto: RegisterHash of unknown hash function")); } ((h < 0 || h >= hashes.$length) ? ($throwRuntimeError("index out of range"), undefined) : hashes.$array[hashes.$offset + h] = f); }; $pkg.RegisterHash = RegisterHash; Hash.methods = [{prop: "HashFunc", name: "HashFunc", pkg: "", typ: $funcType([], [Hash], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "New", name: "New", pkg: "", typ: $funcType([], [hash.Hash], false)}, {prop: "Available", name: "Available", pkg: "", typ: $funcType([], [$Bool], false)}]; PublicKey.init([]); PrivateKey.init([]); Signer.init([{prop: "Public", name: "Public", pkg: "", typ: $funcType([], [PublicKey], false)}, {prop: "Sign", name: "Sign", pkg: "", typ: $funcType([io.Reader, sliceType, SignerOpts], [sliceType, $error], false)}]); SignerOpts.init([{prop: "HashFunc", name: "HashFunc", pkg: "", typ: $funcType([], [Hash], false)}]); Decrypter.init([{prop: "Decrypt", name: "Decrypt", pkg: "", typ: $funcType([io.Reader, sliceType, DecrypterOpts], [sliceType, $error], false)}, {prop: "Public", name: "Public", pkg: "", typ: $funcType([], [PublicKey], false)}]); DecrypterOpts.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 = 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; } digestSizes = new sliceType([0, 16, 16, 20, 28, 32, 48, 64, 36, 20, 28, 32, 48, 64, 28, 32, 32, 32, 48, 64]); hashes = $makeSlice(sliceType$1, 20); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["crypto/internal/subtle"] = (function() { var $pkg = {}, $init, js, ptrType, AnyOverlap, InexactOverlap; js = $packages["github.com/gopherjs/gopherjs/js"]; ptrType = $ptrType($Uint8); AnyOverlap = function(x, y) { var x, y; return x.$length > 0 && y.$length > 0 && x.$array === y.$array && ($parseInt(x.$offset) >> 0) <= ((($parseInt(y.$offset) >> 0) + y.$length >> 0) - 1 >> 0) && ($parseInt(y.$offset) >> 0) <= ((($parseInt(x.$offset) >> 0) + x.$length >> 0) - 1 >> 0); }; $pkg.AnyOverlap = AnyOverlap; InexactOverlap = function(x, y) { var x, y; if ((x.$length === 0) || (y.$length === 0) || $indexPtr(x.$array, x.$offset + 0, ptrType) === $indexPtr(y.$array, y.$offset + 0, ptrType)) { return false; } return AnyOverlap(x, y); }; $pkg.InexactOverlap = InexactOverlap; $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["crypto/subtle"] = (function() { var $pkg = {}, $init, ConstantTimeCompare, ConstantTimeSelect, ConstantTimeByteEq, ConstantTimeEq, ConstantTimeCopy, ConstantTimeLessOrEq; ConstantTimeCompare = function(x, y) { var i, v, x, y; if (!((x.$length === y.$length))) { return 0; } v = 0; i = 0; while (true) { if (!(i < x.$length)) { break; } v = (v | (((((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]) ^ ((i < 0 || i >= y.$length) ? ($throwRuntimeError("index out of range"), undefined) : y.$array[y.$offset + i])) << 24 >>> 24))) >>> 0; i = i + (1) >> 0; } return ConstantTimeByteEq(v, 0); }; $pkg.ConstantTimeCompare = ConstantTimeCompare; ConstantTimeSelect = function(v, x, y) { var v, x, y; return ((~((v - 1 >> 0)) >> 0) & x) | (((v - 1 >> 0)) & y); }; $pkg.ConstantTimeSelect = ConstantTimeSelect; ConstantTimeByteEq = function(x, y) { var x, y; return (((((((((x ^ y) << 24 >>> 24) >>> 0)) - 1 >>> 0)) >>> 31 >>> 0) >> 0)); }; $pkg.ConstantTimeByteEq = ConstantTimeByteEq; ConstantTimeEq = function(x, y) { var x, x$1, y; return (($shiftRightUint64(((x$1 = (new $Uint64(0, ((((x ^ y) >> 0) >>> 0)))), new $Uint64(x$1.$high - 0, x$1.$low - 1))), 63).$low >> 0)); }; $pkg.ConstantTimeEq = ConstantTimeEq; ConstantTimeCopy = function(v, x, y) { var i, v, x, xmask, y, ymask; if (!((x.$length === y.$length))) { $panic(new $String("subtle: slices have different lengths")); } xmask = (((v - 1 >> 0) << 24 >>> 24)); ymask = (((~((v - 1 >> 0)) >> 0) << 24 >>> 24)); i = 0; while (true) { if (!(i < x.$length)) { break; } ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i] = ((((((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]) & xmask) >>> 0) | ((((i < 0 || i >= y.$length) ? ($throwRuntimeError("index out of range"), undefined) : y.$array[y.$offset + i]) & ymask) >>> 0)) >>> 0)); i = i + (1) >> 0; } }; $pkg.ConstantTimeCopy = ConstantTimeCopy; ConstantTimeLessOrEq = function(x, y) { var x, x32, y, y32; x32 = ((x >> 0)); y32 = ((y >> 0)); return ((((((((x32 - y32 >> 0) - 1 >> 0)) >> 31 >> 0)) & 1) >> 0)); }; $pkg.ConstantTimeLessOrEq = ConstantTimeLessOrEq; $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["crypto/cipher"] = (function() { var $pkg = {}, $init, subtle, subtle$1, binary, errors, io, runtime, StreamReader, AEAD, gcmAble, gcmFieldElement, gcm, ctr, ctrAble, Block, Stream, BlockMode, cbc, cbcEncrypter, cbcEncAble, cbcDecrypter, cbcDecAble, sliceType, sliceType$1, arrayType, arrayType$1, ptrType, ptrType$1, ptrType$3, ptrType$4, ptrType$5, ptrType$6, errOpen, gcmReductionTable, xorBytes, fastXORBytes, safeXORBytes, fastXORWords, xorWords, NewGCM, newGCMWithNonceAndTagSize, reverseBits, gcmAdd, gcmDouble, gcmInc32, sliceForAppend, NewCTR, dup, newCBC, NewCBCEncrypter, NewCBCDecrypter; subtle = $packages["crypto/internal/subtle"]; subtle$1 = $packages["crypto/subtle"]; binary = $packages["encoding/binary"]; errors = $packages["errors"]; io = $packages["io"]; runtime = $packages["runtime"]; StreamReader = $pkg.StreamReader = $newType(0, $kindStruct, "cipher.StreamReader", true, "crypto/cipher", true, function(S_, R_) { this.$val = this; if (arguments.length === 0) { this.S = $ifaceNil; this.R = $ifaceNil; return; } this.S = S_; this.R = R_; }); AEAD = $pkg.AEAD = $newType(8, $kindInterface, "cipher.AEAD", true, "crypto/cipher", true, null); gcmAble = $pkg.gcmAble = $newType(8, $kindInterface, "cipher.gcmAble", true, "crypto/cipher", false, null); gcmFieldElement = $pkg.gcmFieldElement = $newType(0, $kindStruct, "cipher.gcmFieldElement", true, "crypto/cipher", false, function(low_, high_) { this.$val = this; if (arguments.length === 0) { this.low = new $Uint64(0, 0); this.high = new $Uint64(0, 0); return; } this.low = low_; this.high = high_; }); gcm = $pkg.gcm = $newType(0, $kindStruct, "cipher.gcm", true, "crypto/cipher", false, function(cipher_, nonceSize_, tagSize_, productTable_) { this.$val = this; if (arguments.length === 0) { this.cipher = $ifaceNil; this.nonceSize = 0; this.tagSize = 0; this.productTable = arrayType$1.zero(); return; } this.cipher = cipher_; this.nonceSize = nonceSize_; this.tagSize = tagSize_; this.productTable = productTable_; }); ctr = $pkg.ctr = $newType(0, $kindStruct, "cipher.ctr", true, "crypto/cipher", false, function(b_, ctr_, out_, outUsed_) { this.$val = this; if (arguments.length === 0) { this.b = $ifaceNil; this.ctr = sliceType$1.nil; this.out = sliceType$1.nil; this.outUsed = 0; return; } this.b = b_; this.ctr = ctr_; this.out = out_; this.outUsed = outUsed_; }); ctrAble = $pkg.ctrAble = $newType(8, $kindInterface, "cipher.ctrAble", true, "crypto/cipher", false, null); Block = $pkg.Block = $newType(8, $kindInterface, "cipher.Block", true, "crypto/cipher", true, null); Stream = $pkg.Stream = $newType(8, $kindInterface, "cipher.Stream", true, "crypto/cipher", true, null); BlockMode = $pkg.BlockMode = $newType(8, $kindInterface, "cipher.BlockMode", true, "crypto/cipher", true, null); cbc = $pkg.cbc = $newType(0, $kindStruct, "cipher.cbc", true, "crypto/cipher", false, function(b_, blockSize_, iv_, tmp_) { this.$val = this; if (arguments.length === 0) { this.b = $ifaceNil; this.blockSize = 0; this.iv = sliceType$1.nil; this.tmp = sliceType$1.nil; return; } this.b = b_; this.blockSize = blockSize_; this.iv = iv_; this.tmp = tmp_; }); cbcEncrypter = $pkg.cbcEncrypter = $newType(0, $kindStruct, "cipher.cbcEncrypter", true, "crypto/cipher", false, function(b_, blockSize_, iv_, tmp_) { this.$val = this; if (arguments.length === 0) { this.b = $ifaceNil; this.blockSize = 0; this.iv = sliceType$1.nil; this.tmp = sliceType$1.nil; return; } this.b = b_; this.blockSize = blockSize_; this.iv = iv_; this.tmp = tmp_; }); cbcEncAble = $pkg.cbcEncAble = $newType(8, $kindInterface, "cipher.cbcEncAble", true, "crypto/cipher", false, null); cbcDecrypter = $pkg.cbcDecrypter = $newType(0, $kindStruct, "cipher.cbcDecrypter", true, "crypto/cipher", false, function(b_, blockSize_, iv_, tmp_) { this.$val = this; if (arguments.length === 0) { this.b = $ifaceNil; this.blockSize = 0; this.iv = sliceType$1.nil; this.tmp = sliceType$1.nil; return; } this.b = b_; this.blockSize = blockSize_; this.iv = iv_; this.tmp = tmp_; }); cbcDecAble = $pkg.cbcDecAble = $newType(8, $kindInterface, "cipher.cbcDecAble", true, "crypto/cipher", false, null); sliceType = $sliceType($Uint16); sliceType$1 = $sliceType($Uint8); arrayType = $arrayType($Uint8, 16); arrayType$1 = $arrayType(gcmFieldElement, 16); ptrType = $ptrType(cbcEncrypter); ptrType$1 = $ptrType(cbcDecrypter); ptrType$3 = $ptrType(gcmFieldElement); ptrType$4 = $ptrType(arrayType); ptrType$5 = $ptrType(gcm); ptrType$6 = $ptrType(ctr); xorBytes = function(dst, a, b) { var a, b, dst, n; n = a.$length; if (b.$length < n) { n = b.$length; } if (n === 0) { return 0; } if (false) { fastXORBytes(dst, a, b, n); } else { safeXORBytes(dst, a, b, n); } return n; }; fastXORBytes = function(dst, a, b, n) { var _q, _r, a, aw, b, bw, dst, dw, i, i$1, n, w, x; $unused((x = n - 1 >> 0, ((x < 0 || x >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + x]))); w = (_q = n / 4, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); if (w > 0) { dw = dst; aw = a; bw = b; i = 0; while (true) { if (!(i < w)) { break; } ((i < 0 || i >= dw.$length) ? ($throwRuntimeError("index out of range"), undefined) : dw.$array[dw.$offset + i] = ((((i < 0 || i >= aw.$length) ? ($throwRuntimeError("index out of range"), undefined) : aw.$array[aw.$offset + i]) ^ ((i < 0 || i >= bw.$length) ? ($throwRuntimeError("index out of range"), undefined) : bw.$array[bw.$offset + i])) >>> 0)); i = i + (1) >> 0; } } i$1 = (n - (_r = n % 4, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) >> 0); while (true) { if (!(i$1 < n)) { break; } ((i$1 < 0 || i$1 >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + i$1] = ((((i$1 < 0 || i$1 >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i$1]) ^ ((i$1 < 0 || i$1 >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + i$1])) << 24 >>> 24)); i$1 = i$1 + (1) >> 0; } }; safeXORBytes = function(dst, a, b, n) { var a, b, dst, i, n; i = 0; while (true) { if (!(i < n)) { break; } ((i < 0 || i >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + i] = ((((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i]) ^ ((i < 0 || i >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + i])) << 24 >>> 24)); i = i + (1) >> 0; } }; fastXORWords = function(dst, a, b) { var _q, a, aw, b, bw, dst, dw, i, n; dw = dst; aw = a; bw = b; n = (_q = b.$length / 4, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); i = 0; while (true) { if (!(i < n)) { break; } ((i < 0 || i >= dw.$length) ? ($throwRuntimeError("index out of range"), undefined) : dw.$array[dw.$offset + i] = ((((i < 0 || i >= aw.$length) ? ($throwRuntimeError("index out of range"), undefined) : aw.$array[aw.$offset + i]) ^ ((i < 0 || i >= bw.$length) ? ($throwRuntimeError("index out of range"), undefined) : bw.$array[bw.$offset + i])) >>> 0)); i = i + (1) >> 0; } }; xorWords = function(dst, a, b) { var a, b, dst; if (false) { fastXORWords(dst, a, b); } else { safeXORBytes(dst, a, b, b.$length); } }; StreamReader.ptr.prototype.Read = function(dst) { var _r, _tuple, dst, err, n, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; dst = $f.dst; 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 = this; _r = r.R.Read(dst); /* */ $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]; $r = r.S.XORKeyStream($subslice(dst, 0, n), $subslice(dst, 0, n)); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: StreamReader.ptr.prototype.Read }; } $f._r = _r; $f._tuple = _tuple; $f.dst = dst; $f.err = err; $f.n = n; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; StreamReader.prototype.Read = function(dst) { return this.$val.Read(dst); }; NewGCM = function(cipher) { var $24r, _r, cipher, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; cipher = $f.cipher; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = newGCMWithNonceAndTagSize(cipher, 12, 16); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: NewGCM }; } $f.$24r = $24r; $f._r = _r; $f.cipher = cipher; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.NewGCM = NewGCM; newGCMWithNonceAndTagSize = function(cipher, nonceSize, tagSize) { var $24r, _q, _r, _r$1, _tuple, cipher, cipher$1, g, i, key, nonceSize, ok, tagSize, x, x$1, x$10, 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; $24r = $f.$24r; _q = $f._q; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; cipher = $f.cipher; cipher$1 = $f.cipher$1; g = $f.g; i = $f.i; key = $f.key; nonceSize = $f.nonceSize; ok = $f.ok; tagSize = $f.tagSize; x = $f.x; x$1 = $f.x$1; x$10 = $f.x$10; 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: x = [x]; if (tagSize < 12 || tagSize > 16) { $s = -1; return [$ifaceNil, errors.New("cipher: incorrect tag size given to GCM")]; } if (nonceSize <= 0) { $s = -1; return [$ifaceNil, errors.New("cipher: the nonce can't have zero length, or the security of the key will be immediately compromised")]; } _tuple = $assertType(cipher, gcmAble, true); cipher$1 = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 1; continue; } /* */ $s = 2; continue; /* if (ok) { */ case 1: _r = cipher$1.NewGCM(nonceSize, tagSize); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 4; case 4: return $24r; /* } */ case 2: _r$1 = cipher.BlockSize(); /* */ $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 === 16))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!((_r$1 === 16))) { */ case 5: $s = -1; return [$ifaceNil, errors.New("cipher: NewGCM requires 128-bit block cipher")]; /* } */ case 6: key = arrayType.zero(); $r = cipher.Encrypt(new sliceType$1(key), new sliceType$1(key)); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } g = new gcm.ptr(cipher, nonceSize, tagSize, arrayType$1.zero()); x[0] = new gcmFieldElement.ptr($clone(binary.BigEndian, binary.bigEndian).Uint64($subslice(new sliceType$1(key), 0, 8)), $clone(binary.BigEndian, binary.bigEndian).Uint64($subslice(new sliceType$1(key), 8))); gcmFieldElement.copy((x$1 = g.productTable, x$2 = reverseBits(1), ((x$2 < 0 || x$2 >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[x$2])), x[0]); i = 2; while (true) { if (!(i < 16)) { break; } gcmFieldElement.copy((x$5 = g.productTable, x$6 = reverseBits(i), ((x$6 < 0 || x$6 >= x$5.length) ? ($throwRuntimeError("index out of range"), undefined) : x$5[x$6])), gcmDouble((x$3 = g.productTable, x$4 = reverseBits((_q = i / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))), ((x$4 < 0 || x$4 >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[x$4])))); gcmFieldElement.copy((x$9 = g.productTable, x$10 = reverseBits(i + 1 >> 0), ((x$10 < 0 || x$10 >= x$9.length) ? ($throwRuntimeError("index out of range"), undefined) : x$9[x$10])), gcmAdd((x$7 = g.productTable, x$8 = reverseBits(i), ((x$8 < 0 || x$8 >= x$7.length) ? ($throwRuntimeError("index out of range"), undefined) : x$7[x$8])), x[0])); i = i + (2) >> 0; } $s = -1; return [g, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: newGCMWithNonceAndTagSize }; } $f.$24r = $24r; $f._q = _q; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.cipher = cipher; $f.cipher$1 = cipher$1; $f.g = g; $f.i = i; $f.key = key; $f.nonceSize = nonceSize; $f.ok = ok; $f.tagSize = tagSize; $f.x = x; $f.x$1 = x$1; $f.x$10 = x$10; $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; }; gcm.ptr.prototype.NonceSize = function() { var g; g = this; return g.nonceSize; }; gcm.prototype.NonceSize = function() { return this.$val.NonceSize(); }; gcm.ptr.prototype.Overhead = function() { var g; g = this; return g.tagSize; }; gcm.prototype.Overhead = function() { return this.$val.Overhead(); }; gcm.ptr.prototype.Seal = function(dst, nonce, plaintext, data) { var _r, _tmp, _tmp$1, _tuple, counter, data, dst, g, nonce, out, plaintext, ret, tag, tagMask, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; counter = $f.counter; data = $f.data; dst = $f.dst; g = $f.g; nonce = $f.nonce; out = $f.out; plaintext = $f.plaintext; ret = $f.ret; tag = $f.tag; tagMask = $f.tagMask; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: counter = [counter]; tagMask = [tagMask]; g = this; if (!((nonce.$length === g.nonceSize))) { $panic(new $String("crypto/cipher: incorrect nonce length given to GCM")); } _r = g.cipher.BlockSize(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if ((x = (new $Uint64(0, plaintext.$length)), x$1 = $mul64(new $Uint64(0, 4294967294), (new $Uint64(0, _r))), (x.$high > x$1.$high || (x.$high === x$1.$high && x.$low > x$1.$low)))) { $s = 1; continue; } /* */ $s = 2; continue; /* if ((x = (new $Uint64(0, plaintext.$length)), x$1 = $mul64(new $Uint64(0, 4294967294), (new $Uint64(0, _r))), (x.$high > x$1.$high || (x.$high === x$1.$high && x.$low > x$1.$low)))) { */ case 1: $panic(new $String("crypto/cipher: message too large for GCM")); /* } */ case 2: _tuple = sliceForAppend(dst, plaintext.$length + g.tagSize >> 0); ret = _tuple[0]; out = _tuple[1]; if (subtle.InexactOverlap(out, plaintext)) { $panic(new $String("crypto/cipher: invalid buffer overlap")); } _tmp = arrayType.zero(); _tmp$1 = arrayType.zero(); counter[0] = $clone(_tmp, arrayType); tagMask[0] = $clone(_tmp$1, arrayType); g.deriveCounter(counter[0], nonce); $r = g.cipher.Encrypt(new sliceType$1(tagMask[0]), new sliceType$1(counter[0])); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } gcmInc32(counter[0]); $r = g.counterCrypt(out, plaintext, counter[0]); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } tag = arrayType.zero(); g.auth(new sliceType$1(tag), $subslice(out, 0, plaintext.$length), data, tagMask[0]); $copySlice($subslice(out, plaintext.$length), new sliceType$1(tag)); $s = -1; return ret; /* */ } return; } if ($f === undefined) { $f = { $blk: gcm.ptr.prototype.Seal }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.counter = counter; $f.data = data; $f.dst = dst; $f.g = g; $f.nonce = nonce; $f.out = out; $f.plaintext = plaintext; $f.ret = ret; $f.tag = tag; $f.tagMask = tagMask; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; gcm.prototype.Seal = function(dst, nonce, plaintext, data) { return this.$val.Seal(dst, nonce, plaintext, data); }; gcm.ptr.prototype.Open = function(dst, nonce, ciphertext, data) { var _i, _r, _ref, _tmp, _tmp$1, _tuple, ciphertext, counter, data, dst, expectedTag, g, i, nonce, out, ret, tag, tagMask, 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; _i = $f._i; _r = $f._r; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; ciphertext = $f.ciphertext; counter = $f.counter; data = $f.data; dst = $f.dst; expectedTag = $f.expectedTag; g = $f.g; i = $f.i; nonce = $f.nonce; out = $f.out; ret = $f.ret; tag = $f.tag; tagMask = $f.tagMask; 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: counter = [counter]; tagMask = [tagMask]; g = this; if (!((nonce.$length === g.nonceSize))) { $panic(new $String("crypto/cipher: incorrect nonce length given to GCM")); } if (g.tagSize < 12) { $panic(new $String("crypto/cipher: incorrect GCM tag size")); } if (ciphertext.$length < g.tagSize) { $s = -1; return [sliceType$1.nil, errOpen]; } _r = g.cipher.BlockSize(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if ((x = (new $Uint64(0, ciphertext.$length)), x$1 = (x$2 = $mul64(new $Uint64(0, 4294967294), (new $Uint64(0, _r))), x$3 = (new $Uint64(0, g.tagSize)), new $Uint64(x$2.$high + x$3.$high, x$2.$low + x$3.$low)), (x.$high > x$1.$high || (x.$high === x$1.$high && x.$low > x$1.$low)))) { $s = 1; continue; } /* */ $s = 2; continue; /* if ((x = (new $Uint64(0, ciphertext.$length)), x$1 = (x$2 = $mul64(new $Uint64(0, 4294967294), (new $Uint64(0, _r))), x$3 = (new $Uint64(0, g.tagSize)), new $Uint64(x$2.$high + x$3.$high, x$2.$low + x$3.$low)), (x.$high > x$1.$high || (x.$high === x$1.$high && x.$low > x$1.$low)))) { */ case 1: $s = -1; return [sliceType$1.nil, errOpen]; /* } */ case 2: tag = $subslice(ciphertext, (ciphertext.$length - g.tagSize >> 0)); ciphertext = $subslice(ciphertext, 0, (ciphertext.$length - g.tagSize >> 0)); _tmp = arrayType.zero(); _tmp$1 = arrayType.zero(); counter[0] = $clone(_tmp, arrayType); tagMask[0] = $clone(_tmp$1, arrayType); g.deriveCounter(counter[0], nonce); $r = g.cipher.Encrypt(new sliceType$1(tagMask[0]), new sliceType$1(counter[0])); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } gcmInc32(counter[0]); expectedTag = arrayType.zero(); g.auth(new sliceType$1(expectedTag), ciphertext, data, tagMask[0]); _tuple = sliceForAppend(dst, ciphertext.$length); ret = _tuple[0]; out = _tuple[1]; if (subtle.InexactOverlap(out, ciphertext)) { $panic(new $String("crypto/cipher: invalid buffer overlap")); } if (!((subtle$1.ConstantTimeCompare($subslice(new sliceType$1(expectedTag), 0, g.tagSize), tag) === 1))) { _ref = out; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; ((i < 0 || i >= out.$length) ? ($throwRuntimeError("index out of range"), undefined) : out.$array[out.$offset + i] = 0); _i++; } $s = -1; return [sliceType$1.nil, errOpen]; } $r = g.counterCrypt(out, ciphertext, counter[0]); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return [ret, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: gcm.ptr.prototype.Open }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.ciphertext = ciphertext; $f.counter = counter; $f.data = data; $f.dst = dst; $f.expectedTag = expectedTag; $f.g = g; $f.i = i; $f.nonce = nonce; $f.out = out; $f.ret = ret; $f.tag = tag; $f.tagMask = tagMask; $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; }; gcm.prototype.Open = function(dst, nonce, ciphertext, data) { return this.$val.Open(dst, nonce, ciphertext, data); }; reverseBits = function(i) { var i; i = ((((i << 2 >> 0)) & 12)) | ((((i >> 2 >> 0)) & 3)); i = ((((i << 1 >> 0)) & 10)) | ((((i >> 1 >> 0)) & 5)); return i; }; gcmAdd = function(x, y) { var x, x$1, x$2, x$3, x$4, y; return new gcmFieldElement.ptr((x$1 = x.low, x$2 = y.low, new $Uint64(x$1.$high ^ x$2.$high, (x$1.$low ^ x$2.$low) >>> 0)), (x$3 = x.high, x$4 = y.high, new $Uint64(x$3.$high ^ x$4.$high, (x$3.$low ^ x$4.$low) >>> 0))); }; gcmDouble = function(x) { var double$1, msbSet, x, x$1, x$2, x$3, x$4, x$5, x$6; double$1 = new gcmFieldElement.ptr(new $Uint64(0, 0), new $Uint64(0, 0)); msbSet = (x$1 = (x$2 = x.high, new $Uint64(x$2.$high & 0, (x$2.$low & 1) >>> 0)), (x$1.$high === 0 && x$1.$low === 1)); double$1.high = $shiftRightUint64(x.high, 1); double$1.high = (x$3 = double$1.high, x$4 = $shiftLeft64(x.low, 63), new $Uint64(x$3.$high | x$4.$high, (x$3.$low | x$4.$low) >>> 0)); double$1.low = $shiftRightUint64(x.low, 1); if (msbSet) { double$1.low = (x$5 = double$1.low, x$6 = new $Uint64(3774873600, 0), new $Uint64(x$5.$high ^ x$6.$high, (x$5.$low ^ x$6.$low) >>> 0)); } return double$1; }; gcm.ptr.prototype.mul = function(y) { var g, i, j, msw, t, word, x, x$1, x$10, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, y, z; g = this; z = new gcmFieldElement.ptr(new $Uint64(0, 0), new $Uint64(0, 0)); i = 0; while (true) { if (!(i < 2)) { break; } word = y.high; if (i === 1) { word = y.low; } j = 0; while (true) { if (!(j < 64)) { break; } msw = (x = z.high, new $Uint64(x.$high & 0, (x.$low & 15) >>> 0)); z.high = $shiftRightUint64(z.high, (4)); z.high = (x$1 = z.high, x$2 = $shiftLeft64(z.low, 60), new $Uint64(x$1.$high | x$2.$high, (x$1.$low | x$2.$low) >>> 0)); z.low = $shiftRightUint64(z.low, (4)); z.low = (x$3 = z.low, x$4 = $shiftLeft64((new $Uint64(0, (($flatten64(msw) < 0 || $flatten64(msw) >= gcmReductionTable.$length) ? ($throwRuntimeError("index out of range"), undefined) : gcmReductionTable.$array[gcmReductionTable.$offset + $flatten64(msw)]))), 48), new $Uint64(x$3.$high ^ x$4.$high, (x$3.$low ^ x$4.$low) >>> 0)); t = (x$5 = g.productTable, x$6 = new $Uint64(word.$high & 0, (word.$low & 15) >>> 0), (($flatten64(x$6) < 0 || $flatten64(x$6) >= x$5.length) ? ($throwRuntimeError("index out of range"), undefined) : x$5[$flatten64(x$6)])); z.low = (x$7 = z.low, x$8 = t.low, new $Uint64(x$7.$high ^ x$8.$high, (x$7.$low ^ x$8.$low) >>> 0)); z.high = (x$9 = z.high, x$10 = t.high, new $Uint64(x$9.$high ^ x$10.$high, (x$9.$low ^ x$10.$low) >>> 0)); word = $shiftRightUint64(word, (4)); j = j + (4) >> 0; } i = i + (1) >> 0; } gcmFieldElement.copy(y, z); }; gcm.prototype.mul = function(y) { return this.$val.mul(y); }; gcm.ptr.prototype.updateBlocks = function(y, blocks) { var blocks, g, x, x$1, x$2, x$3, y; g = this; while (true) { if (!(blocks.$length > 0)) { break; } y.low = (x = y.low, x$1 = $clone(binary.BigEndian, binary.bigEndian).Uint64(blocks), new $Uint64(x.$high ^ x$1.$high, (x.$low ^ x$1.$low) >>> 0)); y.high = (x$2 = y.high, x$3 = $clone(binary.BigEndian, binary.bigEndian).Uint64($subslice(blocks, 8)), new $Uint64(x$2.$high ^ x$3.$high, (x$2.$low ^ x$3.$low) >>> 0)); g.mul(y); blocks = $subslice(blocks, 16); } }; gcm.prototype.updateBlocks = function(y, blocks) { return this.$val.updateBlocks(y, blocks); }; gcm.ptr.prototype.update = function(y, data) { var data, fullBlocks, g, partialBlock, y; g = this; fullBlocks = ((data.$length >> 4 >> 0)) << 4 >> 0; g.updateBlocks(y, $subslice(data, 0, fullBlocks)); if (!((data.$length === fullBlocks))) { partialBlock = arrayType.zero(); $copySlice(new sliceType$1(partialBlock), $subslice(data, fullBlocks)); g.updateBlocks(y, new sliceType$1(partialBlock)); } }; gcm.prototype.update = function(y, data) { return this.$val.update(y, data); }; gcmInc32 = function(counterBlock) { var counterBlock, ctr$1; ctr$1 = $subslice(new sliceType$1(counterBlock), 12); $clone(binary.BigEndian, binary.bigEndian).PutUint32(ctr$1, $clone(binary.BigEndian, binary.bigEndian).Uint32(ctr$1) + 1 >>> 0); }; sliceForAppend = function(in$1, n) { var head, in$1, n, tail, total; head = sliceType$1.nil; tail = sliceType$1.nil; total = in$1.$length + n >> 0; if (in$1.$capacity >= total) { head = $subslice(in$1, 0, total); } else { head = $makeSlice(sliceType$1, total); $copySlice(head, in$1); } tail = $subslice(head, in$1.$length); return [head, tail]; }; gcm.ptr.prototype.counterCrypt = function(out, in$1, counter) { var counter, g, in$1, mask, out, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; counter = $f.counter; g = $f.g; in$1 = $f.in$1; mask = $f.mask; out = $f.out; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: g = this; mask = arrayType.zero(); /* while (true) { */ case 1: /* if (!(in$1.$length >= 16)) { break; } */ if(!(in$1.$length >= 16)) { $s = 2; continue; } $r = g.cipher.Encrypt(new sliceType$1(mask), new sliceType$1(counter)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } gcmInc32(counter); xorWords(out, in$1, new sliceType$1(mask)); out = $subslice(out, 16); in$1 = $subslice(in$1, 16); $s = 1; continue; case 2: /* */ if (in$1.$length > 0) { $s = 4; continue; } /* */ $s = 5; continue; /* if (in$1.$length > 0) { */ case 4: $r = g.cipher.Encrypt(new sliceType$1(mask), new sliceType$1(counter)); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } gcmInc32(counter); xorBytes(out, in$1, new sliceType$1(mask)); /* } */ case 5: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: gcm.ptr.prototype.counterCrypt }; } $f.counter = counter; $f.g = g; $f.in$1 = in$1; $f.mask = mask; $f.out = out; $f.$s = $s; $f.$r = $r; return $f; }; gcm.prototype.counterCrypt = function(out, in$1, counter) { return this.$val.counterCrypt(out, in$1, counter); }; gcm.ptr.prototype.deriveCounter = function(counter, nonce) { var counter, g, nonce, x, x$1, y; g = this; if (nonce.$length === 12) { $copySlice(new sliceType$1(counter), nonce); counter.nilCheck, counter[15] = 1; } else { y = new gcmFieldElement.ptr(new $Uint64(0, 0), new $Uint64(0, 0)); g.update(y, nonce); y.high = (x = y.high, x$1 = $mul64((new $Uint64(0, nonce.$length)), new $Uint64(0, 8)), new $Uint64(x.$high ^ x$1.$high, (x.$low ^ x$1.$low) >>> 0)); g.mul(y); $clone(binary.BigEndian, binary.bigEndian).PutUint64($subslice(new sliceType$1(counter), 0, 8), y.low); $clone(binary.BigEndian, binary.bigEndian).PutUint64($subslice(new sliceType$1(counter), 8), y.high); } }; gcm.prototype.deriveCounter = function(counter, nonce) { return this.$val.deriveCounter(counter, nonce); }; gcm.ptr.prototype.auth = function(out, ciphertext, additionalData, tagMask) { var additionalData, ciphertext, g, out, tagMask, x, x$1, x$2, x$3, y; g = this; y = new gcmFieldElement.ptr(new $Uint64(0, 0), new $Uint64(0, 0)); g.update(y, additionalData); g.update(y, ciphertext); y.low = (x = y.low, x$1 = $mul64((new $Uint64(0, additionalData.$length)), new $Uint64(0, 8)), new $Uint64(x.$high ^ x$1.$high, (x.$low ^ x$1.$low) >>> 0)); y.high = (x$2 = y.high, x$3 = $mul64((new $Uint64(0, ciphertext.$length)), new $Uint64(0, 8)), new $Uint64(x$2.$high ^ x$3.$high, (x$2.$low ^ x$3.$low) >>> 0)); g.mul(y); $clone(binary.BigEndian, binary.bigEndian).PutUint64(out, y.low); $clone(binary.BigEndian, binary.bigEndian).PutUint64($subslice(out, 8), y.high); xorWords(out, out, new sliceType$1(tagMask)); }; gcm.prototype.auth = function(out, ciphertext, additionalData, tagMask) { return this.$val.auth(out, ciphertext, additionalData, tagMask); }; NewCTR = function(block, iv) { var $24r, _r, _r$1, _r$2, _r$3, _tuple, block, bufSize, ctr$1, iv, ok, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; block = $f.block; bufSize = $f.bufSize; ctr$1 = $f.ctr$1; iv = $f.iv; ok = $f.ok; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _tuple = $assertType(block, ctrAble, true); ctr$1 = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 1; continue; } /* */ $s = 2; continue; /* if (ok) { */ case 1: _r = ctr$1.NewCTR(iv); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 4; case 4: return $24r; /* } */ case 2: _r$1 = block.BlockSize(); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (!((iv.$length === _r$1))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!((iv.$length === _r$1))) { */ case 5: $panic(new $String("cipher.NewCTR: IV length must equal block size")); /* } */ case 6: bufSize = 512; _r$2 = block.BlockSize(); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } /* */ if (bufSize < _r$2) { $s = 8; continue; } /* */ $s = 9; continue; /* if (bufSize < _r$2) { */ case 8: _r$3 = block.BlockSize(); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } bufSize = _r$3; /* } */ case 9: $s = -1; return new ctr.ptr(block, dup(iv), $makeSlice(sliceType$1, 0, bufSize), 0); /* */ } return; } if ($f === undefined) { $f = { $blk: NewCTR }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.block = block; $f.bufSize = bufSize; $f.ctr$1 = ctr$1; $f.iv = iv; $f.ok = ok; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.NewCTR = NewCTR; ctr.ptr.prototype.refill = function() { var _r, bs, i, remain, 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; _r = $f._r; bs = $f.bs; i = $f.i; remain = $f.remain; 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: x = this; remain = x.out.$length - x.outUsed >> 0; $copySlice(x.out, $subslice(x.out, x.outUsed)); x.out = $subslice(x.out, 0, x.out.$capacity); _r = x.b.BlockSize(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } bs = _r; /* while (true) { */ case 2: /* if (!(remain <= (x.out.$length - bs >> 0))) { break; } */ if(!(remain <= (x.out.$length - bs >> 0))) { $s = 3; continue; } $r = x.b.Encrypt($subslice(x.out, remain), x.ctr); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } remain = remain + (bs) >> 0; i = x.ctr.$length - 1 >> 0; while (true) { if (!(i >= 0)) { break; } (x$2 = x.ctr, ((i < 0 || i >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + i] = ((x$1 = x.ctr, ((i < 0 || i >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + i])) + (1) << 24 >>> 24))); if (!(((x$3 = x.ctr, ((i < 0 || i >= x$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + i])) === 0))) { break; } i = i - (1) >> 0; } $s = 2; continue; case 3: x.out = $subslice(x.out, 0, remain); x.outUsed = 0; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: ctr.ptr.prototype.refill }; } $f._r = _r; $f.bs = bs; $f.i = i; $f.remain = remain; $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; }; ctr.prototype.refill = function() { return this.$val.refill(); }; ctr.ptr.prototype.XORKeyStream = function(dst, src) { var _r, dst, n, src, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; dst = $f.dst; n = $f.n; src = $f.src; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: x = this; if (dst.$length < src.$length) { $panic(new $String("crypto/cipher: output smaller than input")); } if (subtle.InexactOverlap($subslice(dst, 0, src.$length), src)) { $panic(new $String("crypto/cipher: invalid buffer overlap")); } /* while (true) { */ case 1: /* if (!(src.$length > 0)) { break; } */ if(!(src.$length > 0)) { $s = 2; continue; } _r = x.b.BlockSize(); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (x.outUsed >= (x.out.$length - _r >> 0)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (x.outUsed >= (x.out.$length - _r >> 0)) { */ case 3: $r = x.refill(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: n = xorBytes(dst, src, $subslice(x.out, x.outUsed)); dst = $subslice(dst, n); src = $subslice(src, n); x.outUsed = x.outUsed + (n) >> 0; $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: ctr.ptr.prototype.XORKeyStream }; } $f._r = _r; $f.dst = dst; $f.n = n; $f.src = src; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; ctr.prototype.XORKeyStream = function(dst, src) { return this.$val.XORKeyStream(dst, src); }; dup = function(p) { var p, q; q = $makeSlice(sliceType$1, p.$length); $copySlice(q, p); return q; }; newCBC = function(b, iv) { var $24r, _r, _r$1, b, iv, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; b = $f.b; iv = $f.iv; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = b.BlockSize(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = b.BlockSize(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = new cbc.ptr(b, _r, dup(iv), $makeSlice(sliceType$1, _r$1)); $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: newCBC }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f.b = b; $f.iv = iv; $f.$s = $s; $f.$r = $r; return $f; }; NewCBCEncrypter = function(b, iv) { var $24r, $24r$1, _r, _r$1, _r$2, _tuple, b, cbc$1, iv, ok, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; b = $f.b; cbc$1 = $f.cbc$1; iv = $f.iv; ok = $f.ok; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = b.BlockSize(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (!((iv.$length === _r))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((iv.$length === _r))) { */ case 1: $panic(new $String("cipher.NewCBCEncrypter: IV length must equal block size")); /* } */ case 2: _tuple = $assertType(b, cbcEncAble, true); cbc$1 = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 4; continue; } /* */ $s = 5; continue; /* if (ok) { */ case 4: _r$1 = cbc$1.NewCBCEncrypter(iv); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 7; case 7: return $24r; /* } */ case 5: _r$2 = newCBC(b, iv); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r$1 = ($pointerOfStructConversion(_r$2, ptrType)); $s = 9; case 9: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: NewCBCEncrypter }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.b = b; $f.cbc$1 = cbc$1; $f.iv = iv; $f.ok = ok; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.NewCBCEncrypter = NewCBCEncrypter; cbcEncrypter.ptr.prototype.BlockSize = function() { var x; x = this; return x.blockSize; }; cbcEncrypter.prototype.BlockSize = function() { return this.$val.BlockSize(); }; cbcEncrypter.ptr.prototype.CryptBlocks = function(dst, src) { var _r, dst, iv, src, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; dst = $f.dst; iv = $f.iv; src = $f.src; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: x = this; if (!(((_r = src.$length % x.blockSize, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) === 0))) { $panic(new $String("crypto/cipher: input not full blocks")); } if (dst.$length < src.$length) { $panic(new $String("crypto/cipher: output smaller than input")); } if (subtle.InexactOverlap($subslice(dst, 0, src.$length), src)) { $panic(new $String("crypto/cipher: invalid buffer overlap")); } iv = x.iv; /* while (true) { */ case 1: /* if (!(src.$length > 0)) { break; } */ if(!(src.$length > 0)) { $s = 2; continue; } xorBytes($subslice(dst, 0, x.blockSize), $subslice(src, 0, x.blockSize), iv); $r = x.b.Encrypt($subslice(dst, 0, x.blockSize), $subslice(dst, 0, x.blockSize)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } iv = $subslice(dst, 0, x.blockSize); src = $subslice(src, x.blockSize); dst = $subslice(dst, x.blockSize); $s = 1; continue; case 2: $copySlice(x.iv, iv); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: cbcEncrypter.ptr.prototype.CryptBlocks }; } $f._r = _r; $f.dst = dst; $f.iv = iv; $f.src = src; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; cbcEncrypter.prototype.CryptBlocks = function(dst, src) { return this.$val.CryptBlocks(dst, src); }; cbcEncrypter.ptr.prototype.SetIV = function(iv) { var iv, x; x = this; if (!((iv.$length === x.iv.$length))) { $panic(new $String("cipher: incorrect length IV")); } $copySlice(x.iv, iv); }; cbcEncrypter.prototype.SetIV = function(iv) { return this.$val.SetIV(iv); }; NewCBCDecrypter = function(b, iv) { var $24r, $24r$1, _r, _r$1, _r$2, _tuple, b, cbc$1, iv, ok, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; b = $f.b; cbc$1 = $f.cbc$1; iv = $f.iv; ok = $f.ok; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = b.BlockSize(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (!((iv.$length === _r))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((iv.$length === _r))) { */ case 1: $panic(new $String("cipher.NewCBCDecrypter: IV length must equal block size")); /* } */ case 2: _tuple = $assertType(b, cbcDecAble, true); cbc$1 = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 4; continue; } /* */ $s = 5; continue; /* if (ok) { */ case 4: _r$1 = cbc$1.NewCBCDecrypter(iv); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 7; case 7: return $24r; /* } */ case 5: _r$2 = newCBC(b, iv); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r$1 = ($pointerOfStructConversion(_r$2, ptrType$1)); $s = 9; case 9: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: NewCBCDecrypter }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.b = b; $f.cbc$1 = cbc$1; $f.iv = iv; $f.ok = ok; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.NewCBCDecrypter = NewCBCDecrypter; cbcDecrypter.ptr.prototype.BlockSize = function() { var x; x = this; return x.blockSize; }; cbcDecrypter.prototype.BlockSize = function() { return this.$val.BlockSize(); }; cbcDecrypter.ptr.prototype.CryptBlocks = function(dst, src) { var _r, _tmp, _tmp$1, dst, end, prev, src, start, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; dst = $f.dst; end = $f.end; prev = $f.prev; src = $f.src; start = $f.start; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: x = this; if (!(((_r = src.$length % x.blockSize, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) === 0))) { $panic(new $String("crypto/cipher: input not full blocks")); } if (dst.$length < src.$length) { $panic(new $String("crypto/cipher: output smaller than input")); } if (subtle.InexactOverlap($subslice(dst, 0, src.$length), src)) { $panic(new $String("crypto/cipher: invalid buffer overlap")); } if (src.$length === 0) { $s = -1; return; } end = src.$length; start = end - x.blockSize >> 0; prev = start - x.blockSize >> 0; $copySlice(x.tmp, $subslice(src, start, end)); /* while (true) { */ case 1: /* if (!(start > 0)) { break; } */ if(!(start > 0)) { $s = 2; continue; } $r = x.b.Decrypt($subslice(dst, start, end), $subslice(src, start, end)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } xorBytes($subslice(dst, start, end), $subslice(dst, start, end), $subslice(src, prev, start)); end = start; start = prev; prev = prev - (x.blockSize) >> 0; $s = 1; continue; case 2: $r = x.b.Decrypt($subslice(dst, start, end), $subslice(src, start, end)); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } xorBytes($subslice(dst, start, end), $subslice(dst, start, end), x.iv); _tmp = x.tmp; _tmp$1 = x.iv; x.iv = _tmp; x.tmp = _tmp$1; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: cbcDecrypter.ptr.prototype.CryptBlocks }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.dst = dst; $f.end = end; $f.prev = prev; $f.src = src; $f.start = start; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; cbcDecrypter.prototype.CryptBlocks = function(dst, src) { return this.$val.CryptBlocks(dst, src); }; cbcDecrypter.ptr.prototype.SetIV = function(iv) { var iv, x; x = this; if (!((iv.$length === x.iv.$length))) { $panic(new $String("cipher: incorrect length IV")); } $copySlice(x.iv, iv); }; cbcDecrypter.prototype.SetIV = function(iv) { return this.$val.SetIV(iv); }; StreamReader.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}]; ptrType$5.methods = [{prop: "NonceSize", name: "NonceSize", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Overhead", name: "Overhead", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Seal", name: "Seal", pkg: "", typ: $funcType([sliceType$1, sliceType$1, sliceType$1, sliceType$1], [sliceType$1], false)}, {prop: "Open", name: "Open", pkg: "", typ: $funcType([sliceType$1, sliceType$1, sliceType$1, sliceType$1], [sliceType$1, $error], false)}, {prop: "mul", name: "mul", pkg: "crypto/cipher", typ: $funcType([ptrType$3], [], false)}, {prop: "updateBlocks", name: "updateBlocks", pkg: "crypto/cipher", typ: $funcType([ptrType$3, sliceType$1], [], false)}, {prop: "update", name: "update", pkg: "crypto/cipher", typ: $funcType([ptrType$3, sliceType$1], [], false)}, {prop: "counterCrypt", name: "counterCrypt", pkg: "crypto/cipher", typ: $funcType([sliceType$1, sliceType$1, ptrType$4], [], false)}, {prop: "deriveCounter", name: "deriveCounter", pkg: "crypto/cipher", typ: $funcType([ptrType$4, sliceType$1], [], false)}, {prop: "auth", name: "auth", pkg: "crypto/cipher", typ: $funcType([sliceType$1, sliceType$1, sliceType$1, ptrType$4], [], false)}]; ptrType$6.methods = [{prop: "refill", name: "refill", pkg: "crypto/cipher", typ: $funcType([], [], false)}, {prop: "XORKeyStream", name: "XORKeyStream", pkg: "", typ: $funcType([sliceType$1, sliceType$1], [], false)}]; ptrType.methods = [{prop: "BlockSize", name: "BlockSize", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "CryptBlocks", name: "CryptBlocks", pkg: "", typ: $funcType([sliceType$1, sliceType$1], [], false)}, {prop: "SetIV", name: "SetIV", pkg: "", typ: $funcType([sliceType$1], [], false)}]; ptrType$1.methods = [{prop: "BlockSize", name: "BlockSize", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "CryptBlocks", name: "CryptBlocks", pkg: "", typ: $funcType([sliceType$1, sliceType$1], [], false)}, {prop: "SetIV", name: "SetIV", pkg: "", typ: $funcType([sliceType$1], [], false)}]; StreamReader.init("", [{prop: "S", name: "S", embedded: false, exported: true, typ: Stream, tag: ""}, {prop: "R", name: "R", embedded: false, exported: true, typ: io.Reader, tag: ""}]); AEAD.init([{prop: "NonceSize", name: "NonceSize", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Open", name: "Open", pkg: "", typ: $funcType([sliceType$1, sliceType$1, sliceType$1, sliceType$1], [sliceType$1, $error], false)}, {prop: "Overhead", name: "Overhead", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Seal", name: "Seal", pkg: "", typ: $funcType([sliceType$1, sliceType$1, sliceType$1, sliceType$1], [sliceType$1], false)}]); gcmAble.init([{prop: "NewGCM", name: "NewGCM", pkg: "", typ: $funcType([$Int, $Int], [AEAD, $error], false)}]); gcmFieldElement.init("crypto/cipher", [{prop: "low", name: "low", embedded: false, exported: false, typ: $Uint64, tag: ""}, {prop: "high", name: "high", embedded: false, exported: false, typ: $Uint64, tag: ""}]); gcm.init("crypto/cipher", [{prop: "cipher", name: "cipher", embedded: false, exported: false, typ: Block, tag: ""}, {prop: "nonceSize", name: "nonceSize", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "tagSize", name: "tagSize", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "productTable", name: "productTable", embedded: false, exported: false, typ: arrayType$1, tag: ""}]); ctr.init("crypto/cipher", [{prop: "b", name: "b", embedded: false, exported: false, typ: Block, tag: ""}, {prop: "ctr", name: "ctr", embedded: false, exported: false, typ: sliceType$1, tag: ""}, {prop: "out", name: "out", embedded: false, exported: false, typ: sliceType$1, tag: ""}, {prop: "outUsed", name: "outUsed", embedded: false, exported: false, typ: $Int, tag: ""}]); ctrAble.init([{prop: "NewCTR", name: "NewCTR", pkg: "", typ: $funcType([sliceType$1], [Stream], false)}]); Block.init([{prop: "BlockSize", name: "BlockSize", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Decrypt", name: "Decrypt", pkg: "", typ: $funcType([sliceType$1, sliceType$1], [], false)}, {prop: "Encrypt", name: "Encrypt", pkg: "", typ: $funcType([sliceType$1, sliceType$1], [], false)}]); Stream.init([{prop: "XORKeyStream", name: "XORKeyStream", pkg: "", typ: $funcType([sliceType$1, sliceType$1], [], false)}]); BlockMode.init([{prop: "BlockSize", name: "BlockSize", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "CryptBlocks", name: "CryptBlocks", pkg: "", typ: $funcType([sliceType$1, sliceType$1], [], false)}]); cbc.init("crypto/cipher", [{prop: "b", name: "b", embedded: false, exported: false, typ: Block, tag: ""}, {prop: "blockSize", name: "blockSize", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "iv", name: "iv", embedded: false, exported: false, typ: sliceType$1, tag: ""}, {prop: "tmp", name: "tmp", embedded: false, exported: false, typ: sliceType$1, tag: ""}]); cbcEncrypter.init("crypto/cipher", [{prop: "b", name: "b", embedded: false, exported: false, typ: Block, tag: ""}, {prop: "blockSize", name: "blockSize", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "iv", name: "iv", embedded: false, exported: false, typ: sliceType$1, tag: ""}, {prop: "tmp", name: "tmp", embedded: false, exported: false, typ: sliceType$1, tag: ""}]); cbcEncAble.init([{prop: "NewCBCEncrypter", name: "NewCBCEncrypter", pkg: "", typ: $funcType([sliceType$1], [BlockMode], false)}]); cbcDecrypter.init("crypto/cipher", [{prop: "b", name: "b", embedded: false, exported: false, typ: Block, tag: ""}, {prop: "blockSize", name: "blockSize", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "iv", name: "iv", embedded: false, exported: false, typ: sliceType$1, tag: ""}, {prop: "tmp", name: "tmp", embedded: false, exported: false, typ: sliceType$1, tag: ""}]); cbcDecAble.init([{prop: "NewCBCDecrypter", name: "NewCBCDecrypter", pkg: "", typ: $funcType([sliceType$1], [BlockMode], 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 = subtle.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = subtle$1.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = binary.$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 = io.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = runtime.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } errOpen = errors.New("cipher: message authentication failed"); gcmReductionTable = new sliceType([0, 7200, 14400, 9312, 28800, 27808, 18624, 21728, 57600, 64800, 55616, 50528, 37248, 36256, 43456, 46560]); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["crypto/aes"] = (function() { var $pkg = {}, $init, cipher, subtle, binary, strconv, aesCipher, KeySizeError, sliceType, sliceType$1, ptrType, powx, sbox0, sbox1, te0, te1, te2, te3, td0, td1, td2, td3, newCipher, NewCipher, newCipherGeneric, encryptBlockGo, decryptBlockGo, subw, rotw, expandKeyGo; cipher = $packages["crypto/cipher"]; subtle = $packages["crypto/internal/subtle"]; binary = $packages["encoding/binary"]; strconv = $packages["strconv"]; aesCipher = $pkg.aesCipher = $newType(0, $kindStruct, "aes.aesCipher", true, "crypto/aes", false, function(enc_, dec_) { this.$val = this; if (arguments.length === 0) { this.enc = sliceType.nil; this.dec = sliceType.nil; return; } this.enc = enc_; this.dec = dec_; }); KeySizeError = $pkg.KeySizeError = $newType(4, $kindInt, "aes.KeySizeError", true, "crypto/aes", true, null); sliceType = $sliceType($Uint32); sliceType$1 = $sliceType($Uint8); ptrType = $ptrType(aesCipher); newCipher = function(key) { var key; return newCipherGeneric(key); }; KeySizeError.prototype.Error = function() { var k; k = this.$val; return "crypto/aes: invalid key size " + strconv.Itoa(((k >> 0))); }; $ptrType(KeySizeError).prototype.Error = function() { return new KeySizeError(this.$get()).Error(); }; NewCipher = function(key) { var _1, k, key; k = key.$length; switch (0) { default: _1 = k; if ((_1 === (16)) || (_1 === (24)) || (_1 === (32))) { break; } else { return [$ifaceNil, new KeySizeError(((k >> 0)))]; } } return newCipher(key); }; $pkg.NewCipher = NewCipher; newCipherGeneric = function(key) { var c, key, n; n = key.$length + 28 >> 0; c = new aesCipher.ptr($makeSlice(sliceType, n), $makeSlice(sliceType, n)); expandKeyGo(key, c.enc, c.dec); return [c, $ifaceNil]; }; aesCipher.ptr.prototype.BlockSize = function() { var c; c = this; return 16; }; aesCipher.prototype.BlockSize = function() { return this.$val.BlockSize(); }; aesCipher.ptr.prototype.Encrypt = function(dst, src) { var c, dst, src; c = this; if (src.$length < 16) { $panic(new $String("crypto/aes: input not full block")); } if (dst.$length < 16) { $panic(new $String("crypto/aes: output not full block")); } if (subtle.InexactOverlap($subslice(dst, 0, 16), $subslice(src, 0, 16))) { $panic(new $String("crypto/aes: invalid buffer overlap")); } encryptBlockGo(c.enc, dst, src); }; aesCipher.prototype.Encrypt = function(dst, src) { return this.$val.Encrypt(dst, src); }; aesCipher.ptr.prototype.Decrypt = function(dst, src) { var c, dst, src; c = this; if (src.$length < 16) { $panic(new $String("crypto/aes: input not full block")); } if (dst.$length < 16) { $panic(new $String("crypto/aes: output not full block")); } if (subtle.InexactOverlap($subslice(dst, 0, 16), $subslice(src, 0, 16))) { $panic(new $String("crypto/aes: invalid buffer overlap")); } decryptBlockGo(c.dec, dst, src); }; aesCipher.prototype.Decrypt = function(dst, src) { return this.$val.Decrypt(dst, src); }; encryptBlockGo = function(xk, dst, src) { var _q, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, dst, k, nr, r, s0, s1, s2, s3, src, t0, t1, t2, t3, 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$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$5, x$6, x$7, x$8, x$9, xk; $unused((15 >= src.$length ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + 15])); s0 = $clone(binary.BigEndian, binary.bigEndian).Uint32($subslice(src, 0, 4)); s1 = $clone(binary.BigEndian, binary.bigEndian).Uint32($subslice(src, 4, 8)); s2 = $clone(binary.BigEndian, binary.bigEndian).Uint32($subslice(src, 8, 12)); s3 = $clone(binary.BigEndian, binary.bigEndian).Uint32($subslice(src, 12, 16)); s0 = (s0 ^ ((0 >= xk.$length ? ($throwRuntimeError("index out of range"), undefined) : xk.$array[xk.$offset + 0]))) >>> 0; s1 = (s1 ^ ((1 >= xk.$length ? ($throwRuntimeError("index out of range"), undefined) : xk.$array[xk.$offset + 1]))) >>> 0; s2 = (s2 ^ ((2 >= xk.$length ? ($throwRuntimeError("index out of range"), undefined) : xk.$array[xk.$offset + 2]))) >>> 0; s3 = (s3 ^ ((3 >= xk.$length ? ($throwRuntimeError("index out of range"), undefined) : xk.$array[xk.$offset + 3]))) >>> 0; nr = (_q = xk.$length / 4, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) - 2 >> 0; k = 4; _tmp = 0; _tmp$1 = 0; _tmp$2 = 0; _tmp$3 = 0; t0 = _tmp; t1 = _tmp$1; t2 = _tmp$2; t3 = _tmp$3; r = 0; while (true) { if (!(r < nr)) { break; } t0 = ((((((((x = k + 0 >> 0, ((x < 0 || x >= xk.$length) ? ($throwRuntimeError("index out of range"), undefined) : xk.$array[xk.$offset + x])) ^ (x$1 = (((s0 >>> 24 >>> 0) << 24 >>> 24)), ((x$1 < 0 || x$1 >= te0.length) ? ($throwRuntimeError("index out of range"), undefined) : te0[x$1]))) >>> 0) ^ (x$2 = (((s1 >>> 16 >>> 0) << 24 >>> 24)), ((x$2 < 0 || x$2 >= te1.length) ? ($throwRuntimeError("index out of range"), undefined) : te1[x$2]))) >>> 0) ^ (x$3 = (((s2 >>> 8 >>> 0) << 24 >>> 24)), ((x$3 < 0 || x$3 >= te2.length) ? ($throwRuntimeError("index out of range"), undefined) : te2[x$3]))) >>> 0) ^ (x$4 = ((s3 << 24 >>> 24)), ((x$4 < 0 || x$4 >= te3.length) ? ($throwRuntimeError("index out of range"), undefined) : te3[x$4]))) >>> 0; t1 = ((((((((x$5 = k + 1 >> 0, ((x$5 < 0 || x$5 >= xk.$length) ? ($throwRuntimeError("index out of range"), undefined) : xk.$array[xk.$offset + x$5])) ^ (x$6 = (((s1 >>> 24 >>> 0) << 24 >>> 24)), ((x$6 < 0 || x$6 >= te0.length) ? ($throwRuntimeError("index out of range"), undefined) : te0[x$6]))) >>> 0) ^ (x$7 = (((s2 >>> 16 >>> 0) << 24 >>> 24)), ((x$7 < 0 || x$7 >= te1.length) ? ($throwRuntimeError("index out of range"), undefined) : te1[x$7]))) >>> 0) ^ (x$8 = (((s3 >>> 8 >>> 0) << 24 >>> 24)), ((x$8 < 0 || x$8 >= te2.length) ? ($throwRuntimeError("index out of range"), undefined) : te2[x$8]))) >>> 0) ^ (x$9 = ((s0 << 24 >>> 24)), ((x$9 < 0 || x$9 >= te3.length) ? ($throwRuntimeError("index out of range"), undefined) : te3[x$9]))) >>> 0; t2 = ((((((((x$10 = k + 2 >> 0, ((x$10 < 0 || x$10 >= xk.$length) ? ($throwRuntimeError("index out of range"), undefined) : xk.$array[xk.$offset + x$10])) ^ (x$11 = (((s2 >>> 24 >>> 0) << 24 >>> 24)), ((x$11 < 0 || x$11 >= te0.length) ? ($throwRuntimeError("index out of range"), undefined) : te0[x$11]))) >>> 0) ^ (x$12 = (((s3 >>> 16 >>> 0) << 24 >>> 24)), ((x$12 < 0 || x$12 >= te1.length) ? ($throwRuntimeError("index out of range"), undefined) : te1[x$12]))) >>> 0) ^ (x$13 = (((s0 >>> 8 >>> 0) << 24 >>> 24)), ((x$13 < 0 || x$13 >= te2.length) ? ($throwRuntimeError("index out of range"), undefined) : te2[x$13]))) >>> 0) ^ (x$14 = ((s1 << 24 >>> 24)), ((x$14 < 0 || x$14 >= te3.length) ? ($throwRuntimeError("index out of range"), undefined) : te3[x$14]))) >>> 0; t3 = ((((((((x$15 = k + 3 >> 0, ((x$15 < 0 || x$15 >= xk.$length) ? ($throwRuntimeError("index out of range"), undefined) : xk.$array[xk.$offset + x$15])) ^ (x$16 = (((s3 >>> 24 >>> 0) << 24 >>> 24)), ((x$16 < 0 || x$16 >= te0.length) ? ($throwRuntimeError("index out of range"), undefined) : te0[x$16]))) >>> 0) ^ (x$17 = (((s0 >>> 16 >>> 0) << 24 >>> 24)), ((x$17 < 0 || x$17 >= te1.length) ? ($throwRuntimeError("index out of range"), undefined) : te1[x$17]))) >>> 0) ^ (x$18 = (((s1 >>> 8 >>> 0) << 24 >>> 24)), ((x$18 < 0 || x$18 >= te2.length) ? ($throwRuntimeError("index out of range"), undefined) : te2[x$18]))) >>> 0) ^ (x$19 = ((s2 << 24 >>> 24)), ((x$19 < 0 || x$19 >= te3.length) ? ($throwRuntimeError("index out of range"), undefined) : te3[x$19]))) >>> 0; k = k + (4) >> 0; _tmp$4 = t0; _tmp$5 = t1; _tmp$6 = t2; _tmp$7 = t3; s0 = _tmp$4; s1 = _tmp$5; s2 = _tmp$6; s3 = _tmp$7; r = r + (1) >> 0; } s0 = (((((((((x$20 = t0 >>> 24 >>> 0, ((x$20 < 0 || x$20 >= sbox0.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox0[x$20])) >>> 0)) << 24 >>> 0) | ((((x$21 = ((t1 >>> 16 >>> 0) & 255) >>> 0, ((x$21 < 0 || x$21 >= sbox0.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox0[x$21])) >>> 0)) << 16 >>> 0)) >>> 0) | ((((x$22 = ((t2 >>> 8 >>> 0) & 255) >>> 0, ((x$22 < 0 || x$22 >= sbox0.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox0[x$22])) >>> 0)) << 8 >>> 0)) >>> 0) | (((x$23 = (t3 & 255) >>> 0, ((x$23 < 0 || x$23 >= sbox0.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox0[x$23])) >>> 0))) >>> 0; s1 = (((((((((x$24 = t1 >>> 24 >>> 0, ((x$24 < 0 || x$24 >= sbox0.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox0[x$24])) >>> 0)) << 24 >>> 0) | ((((x$25 = ((t2 >>> 16 >>> 0) & 255) >>> 0, ((x$25 < 0 || x$25 >= sbox0.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox0[x$25])) >>> 0)) << 16 >>> 0)) >>> 0) | ((((x$26 = ((t3 >>> 8 >>> 0) & 255) >>> 0, ((x$26 < 0 || x$26 >= sbox0.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox0[x$26])) >>> 0)) << 8 >>> 0)) >>> 0) | (((x$27 = (t0 & 255) >>> 0, ((x$27 < 0 || x$27 >= sbox0.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox0[x$27])) >>> 0))) >>> 0; s2 = (((((((((x$28 = t2 >>> 24 >>> 0, ((x$28 < 0 || x$28 >= sbox0.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox0[x$28])) >>> 0)) << 24 >>> 0) | ((((x$29 = ((t3 >>> 16 >>> 0) & 255) >>> 0, ((x$29 < 0 || x$29 >= sbox0.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox0[x$29])) >>> 0)) << 16 >>> 0)) >>> 0) | ((((x$30 = ((t0 >>> 8 >>> 0) & 255) >>> 0, ((x$30 < 0 || x$30 >= sbox0.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox0[x$30])) >>> 0)) << 8 >>> 0)) >>> 0) | (((x$31 = (t1 & 255) >>> 0, ((x$31 < 0 || x$31 >= sbox0.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox0[x$31])) >>> 0))) >>> 0; s3 = (((((((((x$32 = t3 >>> 24 >>> 0, ((x$32 < 0 || x$32 >= sbox0.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox0[x$32])) >>> 0)) << 24 >>> 0) | ((((x$33 = ((t0 >>> 16 >>> 0) & 255) >>> 0, ((x$33 < 0 || x$33 >= sbox0.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox0[x$33])) >>> 0)) << 16 >>> 0)) >>> 0) | ((((x$34 = ((t1 >>> 8 >>> 0) & 255) >>> 0, ((x$34 < 0 || x$34 >= sbox0.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox0[x$34])) >>> 0)) << 8 >>> 0)) >>> 0) | (((x$35 = (t2 & 255) >>> 0, ((x$35 < 0 || x$35 >= sbox0.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox0[x$35])) >>> 0))) >>> 0; s0 = (s0 ^ ((x$36 = k + 0 >> 0, ((x$36 < 0 || x$36 >= xk.$length) ? ($throwRuntimeError("index out of range"), undefined) : xk.$array[xk.$offset + x$36])))) >>> 0; s1 = (s1 ^ ((x$37 = k + 1 >> 0, ((x$37 < 0 || x$37 >= xk.$length) ? ($throwRuntimeError("index out of range"), undefined) : xk.$array[xk.$offset + x$37])))) >>> 0; s2 = (s2 ^ ((x$38 = k + 2 >> 0, ((x$38 < 0 || x$38 >= xk.$length) ? ($throwRuntimeError("index out of range"), undefined) : xk.$array[xk.$offset + x$38])))) >>> 0; s3 = (s3 ^ ((x$39 = k + 3 >> 0, ((x$39 < 0 || x$39 >= xk.$length) ? ($throwRuntimeError("index out of range"), undefined) : xk.$array[xk.$offset + x$39])))) >>> 0; $unused((15 >= dst.$length ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + 15])); $clone(binary.BigEndian, binary.bigEndian).PutUint32($subslice(dst, 0, 4), s0); $clone(binary.BigEndian, binary.bigEndian).PutUint32($subslice(dst, 4, 8), s1); $clone(binary.BigEndian, binary.bigEndian).PutUint32($subslice(dst, 8, 12), s2); $clone(binary.BigEndian, binary.bigEndian).PutUint32($subslice(dst, 12, 16), s3); }; decryptBlockGo = function(xk, dst, src) { var _q, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, dst, k, nr, r, s0, s1, s2, s3, src, t0, t1, t2, t3, 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$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$5, x$6, x$7, x$8, x$9, xk; $unused((15 >= src.$length ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + 15])); s0 = $clone(binary.BigEndian, binary.bigEndian).Uint32($subslice(src, 0, 4)); s1 = $clone(binary.BigEndian, binary.bigEndian).Uint32($subslice(src, 4, 8)); s2 = $clone(binary.BigEndian, binary.bigEndian).Uint32($subslice(src, 8, 12)); s3 = $clone(binary.BigEndian, binary.bigEndian).Uint32($subslice(src, 12, 16)); s0 = (s0 ^ ((0 >= xk.$length ? ($throwRuntimeError("index out of range"), undefined) : xk.$array[xk.$offset + 0]))) >>> 0; s1 = (s1 ^ ((1 >= xk.$length ? ($throwRuntimeError("index out of range"), undefined) : xk.$array[xk.$offset + 1]))) >>> 0; s2 = (s2 ^ ((2 >= xk.$length ? ($throwRuntimeError("index out of range"), undefined) : xk.$array[xk.$offset + 2]))) >>> 0; s3 = (s3 ^ ((3 >= xk.$length ? ($throwRuntimeError("index out of range"), undefined) : xk.$array[xk.$offset + 3]))) >>> 0; nr = (_q = xk.$length / 4, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) - 2 >> 0; k = 4; _tmp = 0; _tmp$1 = 0; _tmp$2 = 0; _tmp$3 = 0; t0 = _tmp; t1 = _tmp$1; t2 = _tmp$2; t3 = _tmp$3; r = 0; while (true) { if (!(r < nr)) { break; } t0 = ((((((((x = k + 0 >> 0, ((x < 0 || x >= xk.$length) ? ($throwRuntimeError("index out of range"), undefined) : xk.$array[xk.$offset + x])) ^ (x$1 = (((s0 >>> 24 >>> 0) << 24 >>> 24)), ((x$1 < 0 || x$1 >= td0.length) ? ($throwRuntimeError("index out of range"), undefined) : td0[x$1]))) >>> 0) ^ (x$2 = (((s3 >>> 16 >>> 0) << 24 >>> 24)), ((x$2 < 0 || x$2 >= td1.length) ? ($throwRuntimeError("index out of range"), undefined) : td1[x$2]))) >>> 0) ^ (x$3 = (((s2 >>> 8 >>> 0) << 24 >>> 24)), ((x$3 < 0 || x$3 >= td2.length) ? ($throwRuntimeError("index out of range"), undefined) : td2[x$3]))) >>> 0) ^ (x$4 = ((s1 << 24 >>> 24)), ((x$4 < 0 || x$4 >= td3.length) ? ($throwRuntimeError("index out of range"), undefined) : td3[x$4]))) >>> 0; t1 = ((((((((x$5 = k + 1 >> 0, ((x$5 < 0 || x$5 >= xk.$length) ? ($throwRuntimeError("index out of range"), undefined) : xk.$array[xk.$offset + x$5])) ^ (x$6 = (((s1 >>> 24 >>> 0) << 24 >>> 24)), ((x$6 < 0 || x$6 >= td0.length) ? ($throwRuntimeError("index out of range"), undefined) : td0[x$6]))) >>> 0) ^ (x$7 = (((s0 >>> 16 >>> 0) << 24 >>> 24)), ((x$7 < 0 || x$7 >= td1.length) ? ($throwRuntimeError("index out of range"), undefined) : td1[x$7]))) >>> 0) ^ (x$8 = (((s3 >>> 8 >>> 0) << 24 >>> 24)), ((x$8 < 0 || x$8 >= td2.length) ? ($throwRuntimeError("index out of range"), undefined) : td2[x$8]))) >>> 0) ^ (x$9 = ((s2 << 24 >>> 24)), ((x$9 < 0 || x$9 >= td3.length) ? ($throwRuntimeError("index out of range"), undefined) : td3[x$9]))) >>> 0; t2 = ((((((((x$10 = k + 2 >> 0, ((x$10 < 0 || x$10 >= xk.$length) ? ($throwRuntimeError("index out of range"), undefined) : xk.$array[xk.$offset + x$10])) ^ (x$11 = (((s2 >>> 24 >>> 0) << 24 >>> 24)), ((x$11 < 0 || x$11 >= td0.length) ? ($throwRuntimeError("index out of range"), undefined) : td0[x$11]))) >>> 0) ^ (x$12 = (((s1 >>> 16 >>> 0) << 24 >>> 24)), ((x$12 < 0 || x$12 >= td1.length) ? ($throwRuntimeError("index out of range"), undefined) : td1[x$12]))) >>> 0) ^ (x$13 = (((s0 >>> 8 >>> 0) << 24 >>> 24)), ((x$13 < 0 || x$13 >= td2.length) ? ($throwRuntimeError("index out of range"), undefined) : td2[x$13]))) >>> 0) ^ (x$14 = ((s3 << 24 >>> 24)), ((x$14 < 0 || x$14 >= td3.length) ? ($throwRuntimeError("index out of range"), undefined) : td3[x$14]))) >>> 0; t3 = ((((((((x$15 = k + 3 >> 0, ((x$15 < 0 || x$15 >= xk.$length) ? ($throwRuntimeError("index out of range"), undefined) : xk.$array[xk.$offset + x$15])) ^ (x$16 = (((s3 >>> 24 >>> 0) << 24 >>> 24)), ((x$16 < 0 || x$16 >= td0.length) ? ($throwRuntimeError("index out of range"), undefined) : td0[x$16]))) >>> 0) ^ (x$17 = (((s2 >>> 16 >>> 0) << 24 >>> 24)), ((x$17 < 0 || x$17 >= td1.length) ? ($throwRuntimeError("index out of range"), undefined) : td1[x$17]))) >>> 0) ^ (x$18 = (((s1 >>> 8 >>> 0) << 24 >>> 24)), ((x$18 < 0 || x$18 >= td2.length) ? ($throwRuntimeError("index out of range"), undefined) : td2[x$18]))) >>> 0) ^ (x$19 = ((s0 << 24 >>> 24)), ((x$19 < 0 || x$19 >= td3.length) ? ($throwRuntimeError("index out of range"), undefined) : td3[x$19]))) >>> 0; k = k + (4) >> 0; _tmp$4 = t0; _tmp$5 = t1; _tmp$6 = t2; _tmp$7 = t3; s0 = _tmp$4; s1 = _tmp$5; s2 = _tmp$6; s3 = _tmp$7; r = r + (1) >> 0; } s0 = (((((((((x$20 = t0 >>> 24 >>> 0, ((x$20 < 0 || x$20 >= sbox1.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox1[x$20])) >>> 0)) << 24 >>> 0) | ((((x$21 = ((t3 >>> 16 >>> 0) & 255) >>> 0, ((x$21 < 0 || x$21 >= sbox1.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox1[x$21])) >>> 0)) << 16 >>> 0)) >>> 0) | ((((x$22 = ((t2 >>> 8 >>> 0) & 255) >>> 0, ((x$22 < 0 || x$22 >= sbox1.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox1[x$22])) >>> 0)) << 8 >>> 0)) >>> 0) | (((x$23 = (t1 & 255) >>> 0, ((x$23 < 0 || x$23 >= sbox1.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox1[x$23])) >>> 0))) >>> 0; s1 = (((((((((x$24 = t1 >>> 24 >>> 0, ((x$24 < 0 || x$24 >= sbox1.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox1[x$24])) >>> 0)) << 24 >>> 0) | ((((x$25 = ((t0 >>> 16 >>> 0) & 255) >>> 0, ((x$25 < 0 || x$25 >= sbox1.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox1[x$25])) >>> 0)) << 16 >>> 0)) >>> 0) | ((((x$26 = ((t3 >>> 8 >>> 0) & 255) >>> 0, ((x$26 < 0 || x$26 >= sbox1.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox1[x$26])) >>> 0)) << 8 >>> 0)) >>> 0) | (((x$27 = (t2 & 255) >>> 0, ((x$27 < 0 || x$27 >= sbox1.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox1[x$27])) >>> 0))) >>> 0; s2 = (((((((((x$28 = t2 >>> 24 >>> 0, ((x$28 < 0 || x$28 >= sbox1.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox1[x$28])) >>> 0)) << 24 >>> 0) | ((((x$29 = ((t1 >>> 16 >>> 0) & 255) >>> 0, ((x$29 < 0 || x$29 >= sbox1.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox1[x$29])) >>> 0)) << 16 >>> 0)) >>> 0) | ((((x$30 = ((t0 >>> 8 >>> 0) & 255) >>> 0, ((x$30 < 0 || x$30 >= sbox1.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox1[x$30])) >>> 0)) << 8 >>> 0)) >>> 0) | (((x$31 = (t3 & 255) >>> 0, ((x$31 < 0 || x$31 >= sbox1.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox1[x$31])) >>> 0))) >>> 0; s3 = (((((((((x$32 = t3 >>> 24 >>> 0, ((x$32 < 0 || x$32 >= sbox1.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox1[x$32])) >>> 0)) << 24 >>> 0) | ((((x$33 = ((t2 >>> 16 >>> 0) & 255) >>> 0, ((x$33 < 0 || x$33 >= sbox1.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox1[x$33])) >>> 0)) << 16 >>> 0)) >>> 0) | ((((x$34 = ((t1 >>> 8 >>> 0) & 255) >>> 0, ((x$34 < 0 || x$34 >= sbox1.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox1[x$34])) >>> 0)) << 8 >>> 0)) >>> 0) | (((x$35 = (t0 & 255) >>> 0, ((x$35 < 0 || x$35 >= sbox1.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox1[x$35])) >>> 0))) >>> 0; s0 = (s0 ^ ((x$36 = k + 0 >> 0, ((x$36 < 0 || x$36 >= xk.$length) ? ($throwRuntimeError("index out of range"), undefined) : xk.$array[xk.$offset + x$36])))) >>> 0; s1 = (s1 ^ ((x$37 = k + 1 >> 0, ((x$37 < 0 || x$37 >= xk.$length) ? ($throwRuntimeError("index out of range"), undefined) : xk.$array[xk.$offset + x$37])))) >>> 0; s2 = (s2 ^ ((x$38 = k + 2 >> 0, ((x$38 < 0 || x$38 >= xk.$length) ? ($throwRuntimeError("index out of range"), undefined) : xk.$array[xk.$offset + x$38])))) >>> 0; s3 = (s3 ^ ((x$39 = k + 3 >> 0, ((x$39 < 0 || x$39 >= xk.$length) ? ($throwRuntimeError("index out of range"), undefined) : xk.$array[xk.$offset + x$39])))) >>> 0; $unused((15 >= dst.$length ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + 15])); $clone(binary.BigEndian, binary.bigEndian).PutUint32($subslice(dst, 0, 4), s0); $clone(binary.BigEndian, binary.bigEndian).PutUint32($subslice(dst, 4, 8), s1); $clone(binary.BigEndian, binary.bigEndian).PutUint32($subslice(dst, 8, 12), s2); $clone(binary.BigEndian, binary.bigEndian).PutUint32($subslice(dst, 12, 16), s3); }; subw = function(w) { var w, x, x$1, x$2, x$3; return (((((((((x = w >>> 24 >>> 0, ((x < 0 || x >= sbox0.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox0[x])) >>> 0)) << 24 >>> 0) | ((((x$1 = ((w >>> 16 >>> 0) & 255) >>> 0, ((x$1 < 0 || x$1 >= sbox0.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox0[x$1])) >>> 0)) << 16 >>> 0)) >>> 0) | ((((x$2 = ((w >>> 8 >>> 0) & 255) >>> 0, ((x$2 < 0 || x$2 >= sbox0.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox0[x$2])) >>> 0)) << 8 >>> 0)) >>> 0) | (((x$3 = (w & 255) >>> 0, ((x$3 < 0 || x$3 >= sbox0.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox0[x$3])) >>> 0))) >>> 0; }; rotw = function(w) { var w; return ((w << 8 >>> 0) | (w >>> 24 >>> 0)) >>> 0; }; expandKeyGo = function(key, enc, dec) { var _q, _q$1, _r, _r$1, dec, ei, enc, i, i$1, j, key, n, nk, t, x, x$1, x$10, x$11, x$12, x$13, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; i = 0; nk = (_q = key.$length / 4, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); i = 0; while (true) { if (!(i < nk)) { break; } ((i < 0 || i >= enc.$length) ? ($throwRuntimeError("index out of range"), undefined) : enc.$array[enc.$offset + i] = $clone(binary.BigEndian, binary.bigEndian).Uint32($subslice(key, ($imul(4, i))))); i = i + (1) >> 0; } while (true) { if (!(i < enc.$length)) { break; } t = (x = i - 1 >> 0, ((x < 0 || x >= enc.$length) ? ($throwRuntimeError("index out of range"), undefined) : enc.$array[enc.$offset + x])); if ((_r = i % nk, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) === 0) { t = (subw(rotw(t)) ^ (((((x$1 = (_q$1 = i / nk, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")) - 1 >> 0, ((x$1 < 0 || x$1 >= powx.length) ? ($throwRuntimeError("index out of range"), undefined) : powx[x$1])) >>> 0)) << 24 >>> 0))) >>> 0; } else if (nk > 6 && ((_r$1 = i % nk, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) === 4)) { t = subw(t); } ((i < 0 || i >= enc.$length) ? ($throwRuntimeError("index out of range"), undefined) : enc.$array[enc.$offset + i] = (((x$2 = i - nk >> 0, ((x$2 < 0 || x$2 >= enc.$length) ? ($throwRuntimeError("index out of range"), undefined) : enc.$array[enc.$offset + x$2])) ^ t) >>> 0)); i = i + (1) >> 0; } if (dec === sliceType.nil) { return; } n = enc.$length; i$1 = 0; while (true) { if (!(i$1 < n)) { break; } ei = (n - i$1 >> 0) - 4 >> 0; j = 0; while (true) { if (!(j < 4)) { break; } x$4 = (x$3 = ei + j >> 0, ((x$3 < 0 || x$3 >= enc.$length) ? ($throwRuntimeError("index out of range"), undefined) : enc.$array[enc.$offset + x$3])); if (i$1 > 0 && (i$1 + 4 >> 0) < n) { x$4 = ((((((x$5 = (x$6 = x$4 >>> 24 >>> 0, ((x$6 < 0 || x$6 >= sbox0.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox0[x$6])), ((x$5 < 0 || x$5 >= td0.length) ? ($throwRuntimeError("index out of range"), undefined) : td0[x$5])) ^ (x$7 = (x$8 = ((x$4 >>> 16 >>> 0) & 255) >>> 0, ((x$8 < 0 || x$8 >= sbox0.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox0[x$8])), ((x$7 < 0 || x$7 >= td1.length) ? ($throwRuntimeError("index out of range"), undefined) : td1[x$7]))) >>> 0) ^ (x$9 = (x$10 = ((x$4 >>> 8 >>> 0) & 255) >>> 0, ((x$10 < 0 || x$10 >= sbox0.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox0[x$10])), ((x$9 < 0 || x$9 >= td2.length) ? ($throwRuntimeError("index out of range"), undefined) : td2[x$9]))) >>> 0) ^ (x$11 = (x$12 = (x$4 & 255) >>> 0, ((x$12 < 0 || x$12 >= sbox0.length) ? ($throwRuntimeError("index out of range"), undefined) : sbox0[x$12])), ((x$11 < 0 || x$11 >= td3.length) ? ($throwRuntimeError("index out of range"), undefined) : td3[x$11]))) >>> 0; } (x$13 = i$1 + j >> 0, ((x$13 < 0 || x$13 >= dec.$length) ? ($throwRuntimeError("index out of range"), undefined) : dec.$array[dec.$offset + x$13] = x$4)); j = j + (1) >> 0; } i$1 = i$1 + (4) >> 0; } }; ptrType.methods = [{prop: "BlockSize", name: "BlockSize", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Encrypt", name: "Encrypt", pkg: "", typ: $funcType([sliceType$1, sliceType$1], [], false)}, {prop: "Decrypt", name: "Decrypt", pkg: "", typ: $funcType([sliceType$1, sliceType$1], [], false)}]; KeySizeError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; aesCipher.init("crypto/aes", [{prop: "enc", name: "enc", embedded: false, exported: false, typ: sliceType, tag: ""}, {prop: "dec", name: "dec", embedded: false, exported: false, typ: sliceType, 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 = cipher.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = subtle.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = binary.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strconv.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } powx = $toNativeArray($kindUint8, [1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154, 47]); sbox0 = $toNativeArray($kindUint8, [99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22]); sbox1 = $toNativeArray($kindUint8, [82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129, 243, 215, 251, 124, 227, 57, 130, 155, 47, 255, 135, 52, 142, 67, 68, 196, 222, 233, 203, 84, 123, 148, 50, 166, 194, 35, 61, 238, 76, 149, 11, 66, 250, 195, 78, 8, 46, 161, 102, 40, 217, 36, 178, 118, 91, 162, 73, 109, 139, 209, 37, 114, 248, 246, 100, 134, 104, 152, 22, 212, 164, 92, 204, 93, 101, 182, 146, 108, 112, 72, 80, 253, 237, 185, 218, 94, 21, 70, 87, 167, 141, 157, 132, 144, 216, 171, 0, 140, 188, 211, 10, 247, 228, 88, 5, 184, 179, 69, 6, 208, 44, 30, 143, 202, 63, 15, 2, 193, 175, 189, 3, 1, 19, 138, 107, 58, 145, 17, 65, 79, 103, 220, 234, 151, 242, 207, 206, 240, 180, 230, 115, 150, 172, 116, 34, 231, 173, 53, 133, 226, 249, 55, 232, 28, 117, 223, 110, 71, 241, 26, 113, 29, 41, 197, 137, 111, 183, 98, 14, 170, 24, 190, 27, 252, 86, 62, 75, 198, 210, 121, 32, 154, 219, 192, 254, 120, 205, 90, 244, 31, 221, 168, 51, 136, 7, 199, 49, 177, 18, 16, 89, 39, 128, 236, 95, 96, 81, 127, 169, 25, 181, 74, 13, 45, 229, 122, 159, 147, 201, 156, 239, 160, 224, 59, 77, 174, 42, 245, 176, 200, 235, 187, 60, 131, 83, 153, 97, 23, 43, 4, 126, 186, 119, 214, 38, 225, 105, 20, 99, 85, 33, 12, 125]); te0 = $toNativeArray($kindUint32, [3328402341, 4168907908, 4000806809, 4135287693, 4294111757, 3597364157, 3731845041, 2445657428, 1613770832, 33620227, 3462883241, 1445669757, 3892248089, 3050821474, 1303096294, 3967186586, 2412431941, 528646813, 2311702848, 4202528135, 4026202645, 2992200171, 2387036105, 4226871307, 1101901292, 3017069671, 1604494077, 1169141738, 597466303, 1403299063, 3832705686, 2613100635, 1974974402, 3791519004, 1033081774, 1277568618, 1815492186, 2118074177, 4126668546, 2211236943, 1748251740, 1369810420, 3521504564, 4193382664, 3799085459, 2883115123, 1647391059, 706024767, 134480908, 2512897874, 1176707941, 2646852446, 806885416, 932615841, 168101135, 798661301, 235341577, 605164086, 461406363, 3756188221, 3454790438, 1311188841, 2142417613, 3933566367, 302582043, 495158174, 1479289972, 874125870, 907746093, 3698224818, 3025820398, 1537253627, 2756858614, 1983593293, 3084310113, 2108928974, 1378429307, 3722699582, 1580150641, 327451799, 2790478837, 3117535592, 0, 3253595436, 1075847264, 3825007647, 2041688520, 3059440621, 3563743934, 2378943302, 1740553945, 1916352843, 2487896798, 2555137236, 2958579944, 2244988746, 3151024235, 3320835882, 1336584933, 3992714006, 2252555205, 2588757463, 1714631509, 293963156, 2319795663, 3925473552, 67240454, 4269768577, 2689618160, 2017213508, 631218106, 1269344483, 2723238387, 1571005438, 2151694528, 93294474, 1066570413, 563977660, 1882732616, 4059428100, 1673313503, 2008463041, 2950355573, 1109467491, 537923632, 3858759450, 4260623118, 3218264685, 2177748300, 403442708, 638784309, 3287084079, 3193921505, 899127202, 2286175436, 773265209, 2479146071, 1437050866, 4236148354, 2050833735, 3362022572, 3126681063, 840505643, 3866325909, 3227541664, 427917720, 2655997905, 2749160575, 1143087718, 1412049534, 999329963, 193497219, 2353415882, 3354324521, 1807268051, 672404540, 2816401017, 3160301282, 369822493, 2916866934, 3688947771, 1681011286, 1949973070, 336202270, 2454276571, 201721354, 1210328172, 3093060836, 2680341085, 3184776046, 1135389935, 3294782118, 965841320, 831886756, 3554993207, 4068047243, 3588745010, 2345191491, 1849112409, 3664604599, 26054028, 2983581028, 2622377682, 1235855840, 3630984372, 2891339514, 4092916743, 3488279077, 3395642799, 4101667470, 1202630377, 268961816, 1874508501, 4034427016, 1243948399, 1546530418, 941366308, 1470539505, 1941222599, 2546386513, 3421038627, 2715671932, 3899946140, 1042226977, 2521517021, 1639824860, 227249030, 260737669, 3765465232, 2084453954, 1907733956, 3429263018, 2420656344, 100860677, 4160157185, 470683154, 3261161891, 1781871967, 2924959737, 1773779408, 394692241, 2579611992, 974986535, 664706745, 3655459128, 3958962195, 731420851, 571543859, 3530123707, 2849626480, 126783113, 865375399, 765172662, 1008606754, 361203602, 3387549984, 2278477385, 2857719295, 1344809080, 2782912378, 59542671, 1503764984, 160008576, 437062935, 1707065306, 3622233649, 2218934982, 3496503480, 2185314755, 697932208, 1512910199, 504303377, 2075177163, 2824099068, 1841019862, 739644986]); te1 = $toNativeArray($kindUint32, [2781242211, 2230877308, 2582542199, 2381740923, 234877682, 3184946027, 2984144751, 1418839493, 1348481072, 50462977, 2848876391, 2102799147, 434634494, 1656084439, 3863849899, 2599188086, 1167051466, 2636087938, 1082771913, 2281340285, 368048890, 3954334041, 3381544775, 201060592, 3963727277, 1739838676, 4250903202, 3930435503, 3206782108, 4149453988, 2531553906, 1536934080, 3262494647, 484572669, 2923271059, 1783375398, 1517041206, 1098792767, 49674231, 1334037708, 1550332980, 4098991525, 886171109, 150598129, 2481090929, 1940642008, 1398944049, 1059722517, 201851908, 1385547719, 1699095331, 1587397571, 674240536, 2704774806, 252314885, 3039795866, 151914247, 908333586, 2602270848, 1038082786, 651029483, 1766729511, 3447698098, 2682942837, 454166793, 2652734339, 1951935532, 775166490, 758520603, 3000790638, 4004797018, 4217086112, 4137964114, 1299594043, 1639438038, 3464344499, 2068982057, 1054729187, 1901997871, 2534638724, 4121318227, 1757008337, 0, 750906861, 1614815264, 535035132, 3363418545, 3988151131, 3201591914, 1183697867, 3647454910, 1265776953, 3734260298, 3566750796, 3903871064, 1250283471, 1807470800, 717615087, 3847203498, 384695291, 3313910595, 3617213773, 1432761139, 2484176261, 3481945413, 283769337, 100925954, 2180939647, 4037038160, 1148730428, 3123027871, 3813386408, 4087501137, 4267549603, 3229630528, 2315620239, 2906624658, 3156319645, 1215313976, 82966005, 3747855548, 3245848246, 1974459098, 1665278241, 807407632, 451280895, 251524083, 1841287890, 1283575245, 337120268, 891687699, 801369324, 3787349855, 2721421207, 3431482436, 959321879, 1469301956, 4065699751, 2197585534, 1199193405, 2898814052, 3887750493, 724703513, 2514908019, 2696962144, 2551808385, 3516813135, 2141445340, 1715741218, 2119445034, 2872807568, 2198571144, 3398190662, 700968686, 3547052216, 1009259540, 2041044702, 3803995742, 487983883, 1991105499, 1004265696, 1449407026, 1316239930, 504629770, 3683797321, 168560134, 1816667172, 3837287516, 1570751170, 1857934291, 4014189740, 2797888098, 2822345105, 2754712981, 936633572, 2347923833, 852879335, 1133234376, 1500395319, 3084545389, 2348912013, 1689376213, 3533459022, 3762923945, 3034082412, 4205598294, 133428468, 634383082, 2949277029, 2398386810, 3913789102, 403703816, 3580869306, 2297460856, 1867130149, 1918643758, 607656988, 4049053350, 3346248884, 1368901318, 600565992, 2090982877, 2632479860, 557719327, 3717614411, 3697393085, 2249034635, 2232388234, 2430627952, 1115438654, 3295786421, 2865522278, 3633334344, 84280067, 33027830, 303828494, 2747425121, 1600795957, 4188952407, 3496589753, 2434238086, 1486471617, 658119965, 3106381470, 953803233, 334231800, 3005978776, 857870609, 3151128937, 1890179545, 2298973838, 2805175444, 3056442267, 574365214, 2450884487, 550103529, 1233637070, 4289353045, 2018519080, 2057691103, 2399374476, 4166623649, 2148108681, 387583245, 3664101311, 836232934, 3330556482, 3100665960, 3280093505, 2955516313, 2002398509, 287182607, 3413881008, 4238890068, 3597515707, 975967766]); te2 = $toNativeArray($kindUint32, [1671808611, 2089089148, 2006576759, 2072901243, 4061003762, 1807603307, 1873927791, 3310653893, 810573872, 16974337, 1739181671, 729634347, 4263110654, 3613570519, 2883997099, 1989864566, 3393556426, 2191335298, 3376449993, 2106063485, 4195741690, 1508618841, 1204391495, 4027317232, 2917941677, 3563566036, 2734514082, 2951366063, 2629772188, 2767672228, 1922491506, 3227229120, 3082974647, 4246528509, 2477669779, 644500518, 911895606, 1061256767, 4144166391, 3427763148, 878471220, 2784252325, 3845444069, 4043897329, 1905517169, 3631459288, 827548209, 356461077, 67897348, 3344078279, 593839651, 3277757891, 405286936, 2527147926, 84871685, 2595565466, 118033927, 305538066, 2157648768, 3795705826, 3945188843, 661212711, 2999812018, 1973414517, 152769033, 2208177539, 745822252, 439235610, 455947803, 1857215598, 1525593178, 2700827552, 1391895634, 994932283, 3596728278, 3016654259, 695947817, 3812548067, 795958831, 2224493444, 1408607827, 3513301457, 0, 3979133421, 543178784, 4229948412, 2982705585, 1542305371, 1790891114, 3410398667, 3201918910, 961245753, 1256100938, 1289001036, 1491644504, 3477767631, 3496721360, 4012557807, 2867154858, 4212583931, 1137018435, 1305975373, 861234739, 2241073541, 1171229253, 4178635257, 33948674, 2139225727, 1357946960, 1011120188, 2679776671, 2833468328, 1374921297, 2751356323, 1086357568, 2408187279, 2460827538, 2646352285, 944271416, 4110742005, 3168756668, 3066132406, 3665145818, 560153121, 271589392, 4279952895, 4077846003, 3530407890, 3444343245, 202643468, 322250259, 3962553324, 1608629855, 2543990167, 1154254916, 389623319, 3294073796, 2817676711, 2122513534, 1028094525, 1689045092, 1575467613, 422261273, 1939203699, 1621147744, 2174228865, 1339137615, 3699352540, 577127458, 712922154, 2427141008, 2290289544, 1187679302, 3995715566, 3100863416, 339486740, 3732514782, 1591917662, 186455563, 3681988059, 3762019296, 844522546, 978220090, 169743370, 1239126601, 101321734, 611076132, 1558493276, 3260915650, 3547250131, 2901361580, 1655096418, 2443721105, 2510565781, 3828863972, 2039214713, 3878868455, 3359869896, 928607799, 1840765549, 2374762893, 3580146133, 1322425422, 2850048425, 1823791212, 1459268694, 4094161908, 3928346602, 1706019429, 2056189050, 2934523822, 135794696, 3134549946, 2022240376, 628050469, 779246638, 472135708, 2800834470, 3032970164, 3327236038, 3894660072, 3715932637, 1956440180, 522272287, 1272813131, 3185336765, 2340818315, 2323976074, 1888542832, 1044544574, 3049550261, 1722469478, 1222152264, 50660867, 4127324150, 236067854, 1638122081, 895445557, 1475980887, 3117443513, 2257655686, 3243809217, 489110045, 2662934430, 3778599393, 4162055160, 2561878936, 288563729, 1773916777, 3648039385, 2391345038, 2493985684, 2612407707, 505560094, 2274497927, 3911240169, 3460925390, 1442818645, 678973480, 3749357023, 2358182796, 2717407649, 2306869641, 219617805, 3218761151, 3862026214, 1120306242, 1756942440, 1103331905, 2578459033, 762796589, 252780047, 2966125488, 1425844308, 3151392187, 372911126]); te3 = $toNativeArray($kindUint32, [1667474886, 2088535288, 2004326894, 2071694838, 4075949567, 1802223062, 1869591006, 3318043793, 808472672, 16843522, 1734846926, 724270422, 4278065639, 3621216949, 2880169549, 1987484396, 3402253711, 2189597983, 3385409673, 2105378810, 4210693615, 1499065266, 1195886990, 4042263547, 2913856577, 3570689971, 2728590687, 2947541573, 2627518243, 2762274643, 1920112356, 3233831835, 3082273397, 4261223649, 2475929149, 640051788, 909531756, 1061110142, 4160160501, 3435941763, 875846760, 2779116625, 3857003729, 4059105529, 1903268834, 3638064043, 825316194, 353713962, 67374088, 3351728789, 589522246, 3284360861, 404236336, 2526454071, 84217610, 2593830191, 117901582, 303183396, 2155911963, 3806477791, 3958056653, 656894286, 2998062463, 1970642922, 151591698, 2206440989, 741110872, 437923380, 454765878, 1852748508, 1515908788, 2694904667, 1381168804, 993742198, 3604373943, 3014905469, 690584402, 3823320797, 791638366, 2223281939, 1398011302, 3520161977, 0, 3991743681, 538992704, 4244381667, 2981218425, 1532751286, 1785380564, 3419096717, 3200178535, 960056178, 1246420628, 1280103576, 1482221744, 3486468741, 3503319995, 4025428677, 2863326543, 4227536621, 1128514950, 1296947098, 859002214, 2240123921, 1162203018, 4193849577, 33687044, 2139062782, 1347481760, 1010582648, 2678045221, 2829640523, 1364325282, 2745433693, 1077985408, 2408548869, 2459086143, 2644360225, 943212656, 4126475505, 3166494563, 3065430391, 3671750063, 555836226, 269496352, 4294908645, 4092792573, 3537006015, 3452783745, 202118168, 320025894, 3974901699, 1600119230, 2543297077, 1145359496, 387397934, 3301201811, 2812801621, 2122220284, 1027426170, 1684319432, 1566435258, 421079858, 1936954854, 1616945344, 2172753945, 1330631070, 3705438115, 572679748, 707427924, 2425400123, 2290647819, 1179044492, 4008585671, 3099120491, 336870440, 3739122087, 1583276732, 185277718, 3688593069, 3772791771, 842159716, 976899700, 168435220, 1229577106, 101059084, 606366792, 1549591736, 3267517855, 3553849021, 2897014595, 1650632388, 2442242105, 2509612081, 3840161747, 2038008818, 3890688725, 3368567691, 926374254, 1835907034, 2374863873, 3587531953, 1313788572, 2846482505, 1819063512, 1448540844, 4109633523, 3941213647, 1701162954, 2054852340, 2930698567, 134748176, 3132806511, 2021165296, 623210314, 774795868, 471606328, 2795958615, 3031746419, 3334885783, 3907527627, 3722280097, 1953799400, 522133822, 1263263126, 3183336545, 2341176845, 2324333839, 1886425312, 1044267644, 3048588401, 1718004428, 1212733584, 50529542, 4143317495, 235803164, 1633788866, 892690282, 1465383342, 3115962473, 2256965911, 3250673817, 488449850, 2661202215, 3789633753, 4177007595, 2560144171, 286339874, 1768537042, 3654906025, 2391705863, 2492770099, 2610673197, 505291324, 2273808917, 3924369609, 3469625735, 1431699370, 673740880, 3755965093, 2358021891, 2711746649, 2307489801, 218961690, 3217021541, 3873845719, 1111672452, 1751693520, 1094828930, 2576986153, 757954394, 252645662, 2964376443, 1414855848, 3149649517, 370555436]); td0 = $toNativeArray($kindUint32, [1374988112, 2118214995, 437757123, 975658646, 1001089995, 530400753, 2902087851, 1273168787, 540080725, 2910219766, 2295101073, 4110568485, 1340463100, 3307916247, 641025152, 3043140495, 3736164937, 632953703, 1172967064, 1576976609, 3274667266, 2169303058, 2370213795, 1809054150, 59727847, 361929877, 3211623147, 2505202138, 3569255213, 1484005843, 1239443753, 2395588676, 1975683434, 4102977912, 2572697195, 666464733, 3202437046, 4035489047, 3374361702, 2110667444, 1675577880, 3843699074, 2538681184, 1649639237, 2976151520, 3144396420, 4269907996, 4178062228, 1883793496, 2403728665, 2497604743, 1383856311, 2876494627, 1917518562, 3810496343, 1716890410, 3001755655, 800440835, 2261089178, 3543599269, 807962610, 599762354, 33778362, 3977675356, 2328828971, 2809771154, 4077384432, 1315562145, 1708848333, 101039829, 3509871135, 3299278474, 875451293, 2733856160, 92987698, 2767645557, 193195065, 1080094634, 1584504582, 3178106961, 1042385657, 2531067453, 3711829422, 1306967366, 2438237621, 1908694277, 67556463, 1615861247, 429456164, 3602770327, 2302690252, 1742315127, 2968011453, 126454664, 3877198648, 2043211483, 2709260871, 2084704233, 4169408201, 0, 159417987, 841739592, 504459436, 1817866830, 4245618683, 260388950, 1034867998, 908933415, 168810852, 1750902305, 2606453969, 607530554, 202008497, 2472011535, 3035535058, 463180190, 2160117071, 1641816226, 1517767529, 470948374, 3801332234, 3231722213, 1008918595, 303765277, 235474187, 4069246893, 766945465, 337553864, 1475418501, 2943682380, 4003061179, 2743034109, 4144047775, 1551037884, 1147550661, 1543208500, 2336434550, 3408119516, 3069049960, 3102011747, 3610369226, 1113818384, 328671808, 2227573024, 2236228733, 3535486456, 2935566865, 3341394285, 496906059, 3702665459, 226906860, 2009195472, 733156972, 2842737049, 294930682, 1206477858, 2835123396, 2700099354, 1451044056, 573804783, 2269728455, 3644379585, 2362090238, 2564033334, 2801107407, 2776292904, 3669462566, 1068351396, 742039012, 1350078989, 1784663195, 1417561698, 4136440770, 2430122216, 775550814, 2193862645, 2673705150, 1775276924, 1876241833, 3475313331, 3366754619, 270040487, 3902563182, 3678124923, 3441850377, 1851332852, 3969562369, 2203032232, 3868552805, 2868897406, 566021896, 4011190502, 3135740889, 1248802510, 3936291284, 699432150, 832877231, 708780849, 3332740144, 899835584, 1951317047, 4236429990, 3767586992, 866637845, 4043610186, 1106041591, 2144161806, 395441711, 1984812685, 1139781709, 3433712980, 3835036895, 2664543715, 1282050075, 3240894392, 1181045119, 2640243204, 25965917, 4203181171, 4211818798, 3009879386, 2463879762, 3910161971, 1842759443, 2597806476, 933301370, 1509430414, 3943906441, 3467192302, 3076639029, 3776767469, 2051518780, 2631065433, 1441952575, 404016761, 1942435775, 1408749034, 1610459739, 3745345300, 2017778566, 3400528769, 3110650942, 941896748, 3265478751, 371049330, 3168937228, 675039627, 4279080257, 967311729, 135050206, 3635733660, 1683407248, 2076935265, 3576870512, 1215061108, 3501741890]); td1 = $toNativeArray($kindUint32, [1347548327, 1400783205, 3273267108, 2520393566, 3409685355, 4045380933, 2880240216, 2471224067, 1428173050, 4138563181, 2441661558, 636813900, 4233094615, 3620022987, 2149987652, 2411029155, 1239331162, 1730525723, 2554718734, 3781033664, 46346101, 310463728, 2743944855, 3328955385, 3875770207, 2501218972, 3955191162, 3667219033, 768917123, 3545789473, 692707433, 1150208456, 1786102409, 2029293177, 1805211710, 3710368113, 3065962831, 401639597, 1724457132, 3028143674, 409198410, 2196052529, 1620529459, 1164071807, 3769721975, 2226875310, 486441376, 2499348523, 1483753576, 428819965, 2274680428, 3075636216, 598438867, 3799141122, 1474502543, 711349675, 129166120, 53458370, 2592523643, 2782082824, 4063242375, 2988687269, 3120694122, 1559041666, 730517276, 2460449204, 4042459122, 2706270690, 3446004468, 3573941694, 533804130, 2328143614, 2637442643, 2695033685, 839224033, 1973745387, 957055980, 2856345839, 106852767, 1371368976, 4181598602, 1033297158, 2933734917, 1179510461, 3046200461, 91341917, 1862534868, 4284502037, 605657339, 2547432937, 3431546947, 2003294622, 3182487618, 2282195339, 954669403, 3682191598, 1201765386, 3917234703, 3388507166, 0, 2198438022, 1211247597, 2887651696, 1315723890, 4227665663, 1443857720, 507358933, 657861945, 1678381017, 560487590, 3516619604, 975451694, 2970356327, 261314535, 3535072918, 2652609425, 1333838021, 2724322336, 1767536459, 370938394, 182621114, 3854606378, 1128014560, 487725847, 185469197, 2918353863, 3106780840, 3356761769, 2237133081, 1286567175, 3152976349, 4255350624, 2683765030, 3160175349, 3309594171, 878443390, 1988838185, 3704300486, 1756818940, 1673061617, 3403100636, 272786309, 1075025698, 545572369, 2105887268, 4174560061, 296679730, 1841768865, 1260232239, 4091327024, 3960309330, 3497509347, 1814803222, 2578018489, 4195456072, 575138148, 3299409036, 446754879, 3629546796, 4011996048, 3347532110, 3252238545, 4270639778, 915985419, 3483825537, 681933534, 651868046, 2755636671, 3828103837, 223377554, 2607439820, 1649704518, 3270937875, 3901806776, 1580087799, 4118987695, 3198115200, 2087309459, 2842678573, 3016697106, 1003007129, 2802849917, 1860738147, 2077965243, 164439672, 4100872472, 32283319, 2827177882, 1709610350, 2125135846, 136428751, 3874428392, 3652904859, 3460984630, 3572145929, 3593056380, 2939266226, 824852259, 818324884, 3224740454, 930369212, 2801566410, 2967507152, 355706840, 1257309336, 4148292826, 243256656, 790073846, 2373340630, 1296297904, 1422699085, 3756299780, 3818836405, 457992840, 3099667487, 2135319889, 77422314, 1560382517, 1945798516, 788204353, 1521706781, 1385356242, 870912086, 325965383, 2358957921, 2050466060, 2388260884, 2313884476, 4006521127, 901210569, 3990953189, 1014646705, 1503449823, 1062597235, 2031621326, 3212035895, 3931371469, 1533017514, 350174575, 2256028891, 2177544179, 1052338372, 741876788, 1606591296, 1914052035, 213705253, 2334669897, 1107234197, 1899603969, 3725069491, 2631447780, 2422494913, 1635502980, 1893020342, 1950903388, 1120974935]); td2 = $toNativeArray($kindUint32, [2807058932, 1699970625, 2764249623, 1586903591, 1808481195, 1173430173, 1487645946, 59984867, 4199882800, 1844882806, 1989249228, 1277555970, 3623636965, 3419915562, 1149249077, 2744104290, 1514790577, 459744698, 244860394, 3235995134, 1963115311, 4027744588, 2544078150, 4190530515, 1608975247, 2627016082, 2062270317, 1507497298, 2200818878, 567498868, 1764313568, 3359936201, 2305455554, 2037970062, 1047239000, 1910319033, 1337376481, 2904027272, 2892417312, 984907214, 1243112415, 830661914, 861968209, 2135253587, 2011214180, 2927934315, 2686254721, 731183368, 1750626376, 4246310725, 1820824798, 4172763771, 3542330227, 48394827, 2404901663, 2871682645, 671593195, 3254988725, 2073724613, 145085239, 2280796200, 2779915199, 1790575107, 2187128086, 472615631, 3029510009, 4075877127, 3802222185, 4107101658, 3201631749, 1646252340, 4270507174, 1402811438, 1436590835, 3778151818, 3950355702, 3963161475, 4020912224, 2667994737, 273792366, 2331590177, 104699613, 95345982, 3175501286, 2377486676, 1560637892, 3564045318, 369057872, 4213447064, 3919042237, 1137477952, 2658625497, 1119727848, 2340947849, 1530455833, 4007360968, 172466556, 266959938, 516552836, 0, 2256734592, 3980931627, 1890328081, 1917742170, 4294704398, 945164165, 3575528878, 958871085, 3647212047, 2787207260, 1423022939, 775562294, 1739656202, 3876557655, 2530391278, 2443058075, 3310321856, 547512796, 1265195639, 437656594, 3121275539, 719700128, 3762502690, 387781147, 218828297, 3350065803, 2830708150, 2848461854, 428169201, 122466165, 3720081049, 1627235199, 648017665, 4122762354, 1002783846, 2117360635, 695634755, 3336358691, 4234721005, 4049844452, 3704280881, 2232435299, 574624663, 287343814, 612205898, 1039717051, 840019705, 2708326185, 793451934, 821288114, 1391201670, 3822090177, 376187827, 3113855344, 1224348052, 1679968233, 2361698556, 1058709744, 752375421, 2431590963, 1321699145, 3519142200, 2734591178, 188127444, 2177869557, 3727205754, 2384911031, 3215212461, 2648976442, 2450346104, 3432737375, 1180849278, 331544205, 3102249176, 4150144569, 2952102595, 2159976285, 2474404304, 766078933, 313773861, 2570832044, 2108100632, 1668212892, 3145456443, 2013908262, 418672217, 3070356634, 2594734927, 1852171925, 3867060991, 3473416636, 3907448597, 2614737639, 919489135, 164948639, 2094410160, 2997825956, 590424639, 2486224549, 1723872674, 3157750862, 3399941250, 3501252752, 3625268135, 2555048196, 3673637356, 1343127501, 4130281361, 3599595085, 2957853679, 1297403050, 81781910, 3051593425, 2283490410, 532201772, 1367295589, 3926170974, 895287692, 1953757831, 1093597963, 492483431, 3528626907, 1446242576, 1192455638, 1636604631, 209336225, 344873464, 1015671571, 669961897, 3375740769, 3857572124, 2973530695, 3747192018, 1933530610, 3464042516, 935293895, 3454686199, 2858115069, 1863638845, 3683022916, 4085369519, 3292445032, 875313188, 1080017571, 3279033885, 621591778, 1233856572, 2504130317, 24197544, 3017672716, 3835484340, 3247465558, 2220981195, 3060847922, 1551124588, 1463996600]); td3 = $toNativeArray($kindUint32, [4104605777, 1097159550, 396673818, 660510266, 2875968315, 2638606623, 4200115116, 3808662347, 821712160, 1986918061, 3430322568, 38544885, 3856137295, 718002117, 893681702, 1654886325, 2975484382, 3122358053, 3926825029, 4274053469, 796197571, 1290801793, 1184342925, 3556361835, 2405426947, 2459735317, 1836772287, 1381620373, 3196267988, 1948373848, 3764988233, 3385345166, 3263785589, 2390325492, 1480485785, 3111247143, 3780097726, 2293045232, 548169417, 3459953789, 3746175075, 439452389, 1362321559, 1400849762, 1685577905, 1806599355, 2174754046, 137073913, 1214797936, 1174215055, 3731654548, 2079897426, 1943217067, 1258480242, 529487843, 1437280870, 3945269170, 3049390895, 3313212038, 923313619, 679998000, 3215307299, 57326082, 377642221, 3474729866, 2041877159, 133361907, 1776460110, 3673476453, 96392454, 878845905, 2801699524, 777231668, 4082475170, 2330014213, 4142626212, 2213296395, 1626319424, 1906247262, 1846563261, 562755902, 3708173718, 1040559837, 3871163981, 1418573201, 3294430577, 114585348, 1343618912, 2566595609, 3186202582, 1078185097, 3651041127, 3896688048, 2307622919, 425408743, 3371096953, 2081048481, 1108339068, 2216610296, 0, 2156299017, 736970802, 292596766, 1517440620, 251657213, 2235061775, 2933202493, 758720310, 265905162, 1554391400, 1532285339, 908999204, 174567692, 1474760595, 4002861748, 2610011675, 3234156416, 3693126241, 2001430874, 303699484, 2478443234, 2687165888, 585122620, 454499602, 151849742, 2345119218, 3064510765, 514443284, 4044981591, 1963412655, 2581445614, 2137062819, 19308535, 1928707164, 1715193156, 4219352155, 1126790795, 600235211, 3992742070, 3841024952, 836553431, 1669664834, 2535604243, 3323011204, 1243905413, 3141400786, 4180808110, 698445255, 2653899549, 2989552604, 2253581325, 3252932727, 3004591147, 1891211689, 2487810577, 3915653703, 4237083816, 4030667424, 2100090966, 865136418, 1229899655, 953270745, 3399679628, 3557504664, 4118925222, 2061379749, 3079546586, 2915017791, 983426092, 2022837584, 1607244650, 2118541908, 2366882550, 3635996816, 972512814, 3283088770, 1568718495, 3499326569, 3576539503, 621982671, 2895723464, 410887952, 2623762152, 1002142683, 645401037, 1494807662, 2595684844, 1335535747, 2507040230, 4293295786, 3167684641, 367585007, 3885750714, 1865862730, 2668221674, 2960971305, 2763173681, 1059270954, 2777952454, 2724642869, 1320957812, 2194319100, 2429595872, 2815956275, 77089521, 3973773121, 3444575871, 2448830231, 1305906550, 4021308739, 2857194700, 2516901860, 3518358430, 1787304780, 740276417, 1699839814, 1592394909, 2352307457, 2272556026, 188821243, 1729977011, 3687994002, 274084841, 3594982253, 3613494426, 2701949495, 4162096729, 322734571, 2837966542, 1640576439, 484830689, 1202797690, 3537852828, 4067639125, 349075736, 3342319475, 4157467219, 4255800159, 1030690015, 1155237496, 2951971274, 1757691577, 607398968, 2738905026, 499347990, 3794078908, 1011452712, 227885567, 2818666809, 213114376, 3034881240, 1455525988, 3414450555, 850817237, 1817998408, 3092726480]); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["crypto/des"] = (function() { var $pkg = {}, $init, cipher, subtle, binary, strconv, sync, KeySizeError, desCipher, tripleDESCipher, arrayType, arrayType$1, arrayType$2, arrayType$3, arrayType$4, sliceType, sliceType$1, sliceType$2, ptrType, ptrType$1, permutationFunction, permutedChoice1, permutedChoice2, sBoxes, ksRotations, feistelBox, feistelBoxOnce, NewTripleDESCipher, cryptBlock, encryptBlock, decryptBlock, feistel, permuteBlock, initFeistelBox, permuteInitialBlock, permuteFinalBlock, ksRotate, unpack; cipher = $packages["crypto/cipher"]; subtle = $packages["crypto/internal/subtle"]; binary = $packages["encoding/binary"]; strconv = $packages["strconv"]; sync = $packages["sync"]; KeySizeError = $pkg.KeySizeError = $newType(4, $kindInt, "des.KeySizeError", true, "crypto/des", true, null); desCipher = $pkg.desCipher = $newType(0, $kindStruct, "des.desCipher", true, "crypto/des", false, function(subkeys_) { this.$val = this; if (arguments.length === 0) { this.subkeys = arrayType$4.zero(); return; } this.subkeys = subkeys_; }); tripleDESCipher = $pkg.tripleDESCipher = $newType(0, $kindStruct, "des.tripleDESCipher", true, "crypto/des", false, function(cipher1_, cipher2_, cipher3_) { this.$val = this; if (arguments.length === 0) { this.cipher1 = new desCipher.ptr(arrayType$4.zero()); this.cipher2 = new desCipher.ptr(arrayType$4.zero()); this.cipher3 = new desCipher.ptr(arrayType$4.zero()); return; } this.cipher1 = cipher1_; this.cipher2 = cipher2_; this.cipher3 = cipher3_; }); arrayType = $arrayType($Uint32, 64); arrayType$1 = $arrayType(arrayType, 8); arrayType$2 = $arrayType($Uint8, 16); arrayType$3 = $arrayType(arrayType$2, 4); arrayType$4 = $arrayType($Uint64, 16); sliceType = $sliceType($Uint64); sliceType$1 = $sliceType($Uint8); sliceType$2 = $sliceType($Uint32); ptrType = $ptrType(desCipher); ptrType$1 = $ptrType(tripleDESCipher); KeySizeError.prototype.Error = function() { var k; k = this.$val; return "crypto/des: invalid key size " + strconv.Itoa(((k >> 0))); }; $ptrType(KeySizeError).prototype.Error = function() { return new KeySizeError(this.$get()).Error(); }; desCipher.ptr.prototype.BlockSize = function() { var c; c = this; return 8; }; desCipher.prototype.BlockSize = function() { return this.$val.BlockSize(); }; desCipher.ptr.prototype.Encrypt = function(dst, src) { var c, dst, src; c = this; if (src.$length < 8) { $panic(new $String("crypto/des: input not full block")); } if (dst.$length < 8) { $panic(new $String("crypto/des: output not full block")); } if (subtle.InexactOverlap($subslice(dst, 0, 8), $subslice(src, 0, 8))) { $panic(new $String("crypto/des: invalid buffer overlap")); } encryptBlock(new sliceType(c.subkeys), dst, src); }; desCipher.prototype.Encrypt = function(dst, src) { return this.$val.Encrypt(dst, src); }; desCipher.ptr.prototype.Decrypt = function(dst, src) { var c, dst, src; c = this; if (src.$length < 8) { $panic(new $String("crypto/des: input not full block")); } if (dst.$length < 8) { $panic(new $String("crypto/des: output not full block")); } if (subtle.InexactOverlap($subslice(dst, 0, 8), $subslice(src, 0, 8))) { $panic(new $String("crypto/des: invalid buffer overlap")); } decryptBlock(new sliceType(c.subkeys), dst, src); }; desCipher.prototype.Decrypt = function(dst, src) { return this.$val.Decrypt(dst, src); }; NewTripleDESCipher = function(key) { var c, key, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; c = $f.c; key = $f.key; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (!((key.$length === 24))) { $s = -1; return [$ifaceNil, new KeySizeError(((key.$length >> 0)))]; } c = new tripleDESCipher.ptr(new desCipher.ptr(arrayType$4.zero()), new desCipher.ptr(arrayType$4.zero()), new desCipher.ptr(arrayType$4.zero())); $r = c.cipher1.generateSubkeys($subslice(key, 0, 8)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = c.cipher2.generateSubkeys($subslice(key, 8, 16)); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = c.cipher3.generateSubkeys($subslice(key, 16)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return [c, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: NewTripleDESCipher }; } $f.c = c; $f.key = key; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.NewTripleDESCipher = NewTripleDESCipher; tripleDESCipher.ptr.prototype.BlockSize = function() { var c; c = this; return 8; }; tripleDESCipher.prototype.BlockSize = function() { return this.$val.BlockSize(); }; tripleDESCipher.ptr.prototype.Encrypt = function(dst, src) { var _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, b, c, dst, i, i$1, i$2, left, preOutput, right, src, x, x$1, x$10, x$11, x$12, x$13, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; c = this; if (src.$length < 8) { $panic(new $String("crypto/des: input not full block")); } if (dst.$length < 8) { $panic(new $String("crypto/des: output not full block")); } if (subtle.InexactOverlap($subslice(dst, 0, 8), $subslice(src, 0, 8))) { $panic(new $String("crypto/des: invalid buffer overlap")); } b = $clone(binary.BigEndian, binary.bigEndian).Uint64(src); b = permuteInitialBlock(b); _tmp = (($shiftRightUint64(b, 32).$low >>> 0)); _tmp$1 = ((b.$low >>> 0)); left = _tmp; right = _tmp$1; left = (((left << 1 >>> 0)) | ((left >>> 31 >>> 0))) >>> 0; right = (((right << 1 >>> 0)) | ((right >>> 31 >>> 0))) >>> 0; i = 0; while (true) { if (!(i < 8)) { break; } _tuple = feistel(left, right, (x = c.cipher1.subkeys, x$1 = $imul(2, i), ((x$1 < 0 || x$1 >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[x$1])), (x$2 = c.cipher1.subkeys, x$3 = ($imul(2, i)) + 1 >> 0, ((x$3 < 0 || x$3 >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[x$3]))); left = _tuple[0]; right = _tuple[1]; i = i + (1) >> 0; } i$1 = 0; while (true) { if (!(i$1 < 8)) { break; } _tuple$1 = feistel(right, left, (x$4 = c.cipher2.subkeys, x$5 = 15 - ($imul(2, i$1)) >> 0, ((x$5 < 0 || x$5 >= x$4.length) ? ($throwRuntimeError("index out of range"), undefined) : x$4[x$5])), (x$6 = c.cipher2.subkeys, x$7 = 15 - ((($imul(2, i$1)) + 1 >> 0)) >> 0, ((x$7 < 0 || x$7 >= x$6.length) ? ($throwRuntimeError("index out of range"), undefined) : x$6[x$7]))); right = _tuple$1[0]; left = _tuple$1[1]; i$1 = i$1 + (1) >> 0; } i$2 = 0; while (true) { if (!(i$2 < 8)) { break; } _tuple$2 = feistel(left, right, (x$8 = c.cipher3.subkeys, x$9 = $imul(2, i$2), ((x$9 < 0 || x$9 >= x$8.length) ? ($throwRuntimeError("index out of range"), undefined) : x$8[x$9])), (x$10 = c.cipher3.subkeys, x$11 = ($imul(2, i$2)) + 1 >> 0, ((x$11 < 0 || x$11 >= x$10.length) ? ($throwRuntimeError("index out of range"), undefined) : x$10[x$11]))); left = _tuple$2[0]; right = _tuple$2[1]; i$2 = i$2 + (1) >> 0; } left = (((left << 31 >>> 0)) | ((left >>> 1 >>> 0))) >>> 0; right = (((right << 31 >>> 0)) | ((right >>> 1 >>> 0))) >>> 0; preOutput = (x$12 = $shiftLeft64((new $Uint64(0, right)), 32), x$13 = (new $Uint64(0, left)), new $Uint64(x$12.$high | x$13.$high, (x$12.$low | x$13.$low) >>> 0)); $clone(binary.BigEndian, binary.bigEndian).PutUint64(dst, permuteFinalBlock(preOutput)); }; tripleDESCipher.prototype.Encrypt = function(dst, src) { return this.$val.Encrypt(dst, src); }; tripleDESCipher.ptr.prototype.Decrypt = function(dst, src) { var _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, b, c, dst, i, i$1, i$2, left, preOutput, right, src, x, x$1, x$10, x$11, x$12, x$13, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; c = this; if (src.$length < 8) { $panic(new $String("crypto/des: input not full block")); } if (dst.$length < 8) { $panic(new $String("crypto/des: output not full block")); } if (subtle.InexactOverlap($subslice(dst, 0, 8), $subslice(src, 0, 8))) { $panic(new $String("crypto/des: invalid buffer overlap")); } b = $clone(binary.BigEndian, binary.bigEndian).Uint64(src); b = permuteInitialBlock(b); _tmp = (($shiftRightUint64(b, 32).$low >>> 0)); _tmp$1 = ((b.$low >>> 0)); left = _tmp; right = _tmp$1; left = (((left << 1 >>> 0)) | ((left >>> 31 >>> 0))) >>> 0; right = (((right << 1 >>> 0)) | ((right >>> 31 >>> 0))) >>> 0; i = 0; while (true) { if (!(i < 8)) { break; } _tuple = feistel(left, right, (x = c.cipher3.subkeys, x$1 = 15 - ($imul(2, i)) >> 0, ((x$1 < 0 || x$1 >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[x$1])), (x$2 = c.cipher3.subkeys, x$3 = 15 - ((($imul(2, i)) + 1 >> 0)) >> 0, ((x$3 < 0 || x$3 >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[x$3]))); left = _tuple[0]; right = _tuple[1]; i = i + (1) >> 0; } i$1 = 0; while (true) { if (!(i$1 < 8)) { break; } _tuple$1 = feistel(right, left, (x$4 = c.cipher2.subkeys, x$5 = $imul(2, i$1), ((x$5 < 0 || x$5 >= x$4.length) ? ($throwRuntimeError("index out of range"), undefined) : x$4[x$5])), (x$6 = c.cipher2.subkeys, x$7 = ($imul(2, i$1)) + 1 >> 0, ((x$7 < 0 || x$7 >= x$6.length) ? ($throwRuntimeError("index out of range"), undefined) : x$6[x$7]))); right = _tuple$1[0]; left = _tuple$1[1]; i$1 = i$1 + (1) >> 0; } i$2 = 0; while (true) { if (!(i$2 < 8)) { break; } _tuple$2 = feistel(left, right, (x$8 = c.cipher1.subkeys, x$9 = 15 - ($imul(2, i$2)) >> 0, ((x$9 < 0 || x$9 >= x$8.length) ? ($throwRuntimeError("index out of range"), undefined) : x$8[x$9])), (x$10 = c.cipher1.subkeys, x$11 = 15 - ((($imul(2, i$2)) + 1 >> 0)) >> 0, ((x$11 < 0 || x$11 >= x$10.length) ? ($throwRuntimeError("index out of range"), undefined) : x$10[x$11]))); left = _tuple$2[0]; right = _tuple$2[1]; i$2 = i$2 + (1) >> 0; } left = (((left << 31 >>> 0)) | ((left >>> 1 >>> 0))) >>> 0; right = (((right << 31 >>> 0)) | ((right >>> 1 >>> 0))) >>> 0; preOutput = (x$12 = $shiftLeft64((new $Uint64(0, right)), 32), x$13 = (new $Uint64(0, left)), new $Uint64(x$12.$high | x$13.$high, (x$12.$low | x$13.$low) >>> 0)); $clone(binary.BigEndian, binary.bigEndian).PutUint64(dst, permuteFinalBlock(preOutput)); }; tripleDESCipher.prototype.Decrypt = function(dst, src) { return this.$val.Decrypt(dst, src); }; cryptBlock = function(subkeys, dst, src, decrypt) { var _tmp, _tmp$1, _tuple, _tuple$1, b, decrypt, dst, i, i$1, left, preOutput, right, src, subkeys, x, x$1, x$2, x$3, x$4, x$5; b = $clone(binary.BigEndian, binary.bigEndian).Uint64(src); b = permuteInitialBlock(b); _tmp = (($shiftRightUint64(b, 32).$low >>> 0)); _tmp$1 = ((b.$low >>> 0)); left = _tmp; right = _tmp$1; left = (((left << 1 >>> 0)) | ((left >>> 31 >>> 0))) >>> 0; right = (((right << 1 >>> 0)) | ((right >>> 31 >>> 0))) >>> 0; if (decrypt) { i = 0; while (true) { if (!(i < 8)) { break; } _tuple = feistel(left, right, (x = 15 - ($imul(2, i)) >> 0, ((x < 0 || x >= subkeys.$length) ? ($throwRuntimeError("index out of range"), undefined) : subkeys.$array[subkeys.$offset + x])), (x$1 = 15 - ((($imul(2, i)) + 1 >> 0)) >> 0, ((x$1 < 0 || x$1 >= subkeys.$length) ? ($throwRuntimeError("index out of range"), undefined) : subkeys.$array[subkeys.$offset + x$1]))); left = _tuple[0]; right = _tuple[1]; i = i + (1) >> 0; } } else { i$1 = 0; while (true) { if (!(i$1 < 8)) { break; } _tuple$1 = feistel(left, right, (x$2 = $imul(2, i$1), ((x$2 < 0 || x$2 >= subkeys.$length) ? ($throwRuntimeError("index out of range"), undefined) : subkeys.$array[subkeys.$offset + x$2])), (x$3 = ($imul(2, i$1)) + 1 >> 0, ((x$3 < 0 || x$3 >= subkeys.$length) ? ($throwRuntimeError("index out of range"), undefined) : subkeys.$array[subkeys.$offset + x$3]))); left = _tuple$1[0]; right = _tuple$1[1]; i$1 = i$1 + (1) >> 0; } } left = (((left << 31 >>> 0)) | ((left >>> 1 >>> 0))) >>> 0; right = (((right << 31 >>> 0)) | ((right >>> 1 >>> 0))) >>> 0; preOutput = (x$4 = $shiftLeft64((new $Uint64(0, right)), 32), x$5 = (new $Uint64(0, left)), new $Uint64(x$4.$high | x$5.$high, (x$4.$low | x$5.$low) >>> 0)); $clone(binary.BigEndian, binary.bigEndian).PutUint64(dst, permuteFinalBlock(preOutput)); }; encryptBlock = function(subkeys, dst, src) { var dst, src, subkeys; cryptBlock(subkeys, dst, src, false); }; decryptBlock = function(subkeys, dst, src) { var dst, src, subkeys; cryptBlock(subkeys, dst, src, true); }; feistel = function(l, r, k0, k1) { var _tmp, _tmp$1, k0, k1, l, lout, r, rout, t, 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$29, x$3, x$30, x$31, x$4, x$5, x$6, x$7, x$8, x$9; lout = 0; rout = 0; t = 0; t = (r ^ (($shiftRightUint64(k0, 32).$low >>> 0))) >>> 0; l = (l ^ ((((((((x = feistelBox[7], x$1 = (t & 63) >>> 0, ((x$1 < 0 || x$1 >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[x$1])) ^ (x$2 = feistelBox[5], x$3 = (((t >>> 8 >>> 0)) & 63) >>> 0, ((x$3 < 0 || x$3 >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[x$3]))) >>> 0) ^ (x$4 = feistelBox[3], x$5 = (((t >>> 16 >>> 0)) & 63) >>> 0, ((x$5 < 0 || x$5 >= x$4.length) ? ($throwRuntimeError("index out of range"), undefined) : x$4[x$5]))) >>> 0) ^ (x$6 = feistelBox[1], x$7 = (((t >>> 24 >>> 0)) & 63) >>> 0, ((x$7 < 0 || x$7 >= x$6.length) ? ($throwRuntimeError("index out of range"), undefined) : x$6[x$7]))) >>> 0))) >>> 0; t = ((((((r << 28 >>> 0)) | ((r >>> 4 >>> 0))) >>> 0)) ^ ((k0.$low >>> 0))) >>> 0; l = (l ^ ((((((((x$8 = feistelBox[6], x$9 = ((t) & 63) >>> 0, ((x$9 < 0 || x$9 >= x$8.length) ? ($throwRuntimeError("index out of range"), undefined) : x$8[x$9])) ^ (x$10 = feistelBox[4], x$11 = (((t >>> 8 >>> 0)) & 63) >>> 0, ((x$11 < 0 || x$11 >= x$10.length) ? ($throwRuntimeError("index out of range"), undefined) : x$10[x$11]))) >>> 0) ^ (x$12 = feistelBox[2], x$13 = (((t >>> 16 >>> 0)) & 63) >>> 0, ((x$13 < 0 || x$13 >= x$12.length) ? ($throwRuntimeError("index out of range"), undefined) : x$12[x$13]))) >>> 0) ^ (x$14 = feistelBox[0], x$15 = (((t >>> 24 >>> 0)) & 63) >>> 0, ((x$15 < 0 || x$15 >= x$14.length) ? ($throwRuntimeError("index out of range"), undefined) : x$14[x$15]))) >>> 0))) >>> 0; t = (l ^ (($shiftRightUint64(k1, 32).$low >>> 0))) >>> 0; r = (r ^ ((((((((x$16 = feistelBox[7], x$17 = (t & 63) >>> 0, ((x$17 < 0 || x$17 >= x$16.length) ? ($throwRuntimeError("index out of range"), undefined) : x$16[x$17])) ^ (x$18 = feistelBox[5], x$19 = (((t >>> 8 >>> 0)) & 63) >>> 0, ((x$19 < 0 || x$19 >= x$18.length) ? ($throwRuntimeError("index out of range"), undefined) : x$18[x$19]))) >>> 0) ^ (x$20 = feistelBox[3], x$21 = (((t >>> 16 >>> 0)) & 63) >>> 0, ((x$21 < 0 || x$21 >= x$20.length) ? ($throwRuntimeError("index out of range"), undefined) : x$20[x$21]))) >>> 0) ^ (x$22 = feistelBox[1], x$23 = (((t >>> 24 >>> 0)) & 63) >>> 0, ((x$23 < 0 || x$23 >= x$22.length) ? ($throwRuntimeError("index out of range"), undefined) : x$22[x$23]))) >>> 0))) >>> 0; t = ((((((l << 28 >>> 0)) | ((l >>> 4 >>> 0))) >>> 0)) ^ ((k1.$low >>> 0))) >>> 0; r = (r ^ ((((((((x$24 = feistelBox[6], x$25 = ((t) & 63) >>> 0, ((x$25 < 0 || x$25 >= x$24.length) ? ($throwRuntimeError("index out of range"), undefined) : x$24[x$25])) ^ (x$26 = feistelBox[4], x$27 = (((t >>> 8 >>> 0)) & 63) >>> 0, ((x$27 < 0 || x$27 >= x$26.length) ? ($throwRuntimeError("index out of range"), undefined) : x$26[x$27]))) >>> 0) ^ (x$28 = feistelBox[2], x$29 = (((t >>> 16 >>> 0)) & 63) >>> 0, ((x$29 < 0 || x$29 >= x$28.length) ? ($throwRuntimeError("index out of range"), undefined) : x$28[x$29]))) >>> 0) ^ (x$30 = feistelBox[0], x$31 = (((t >>> 24 >>> 0)) & 63) >>> 0, ((x$31 < 0 || x$31 >= x$30.length) ? ($throwRuntimeError("index out of range"), undefined) : x$30[x$31]))) >>> 0))) >>> 0; _tmp = l; _tmp$1 = r; lout = _tmp; rout = _tmp$1; return [lout, rout]; }; permuteBlock = function(src, permutation) { var _i, _ref, bit, block, n, permutation, position, src, x, x$1; block = new $Uint64(0, 0); _ref = permutation; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } position = _i; n = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); bit = (x = $shiftRightUint64(src, n), new $Uint64(x.$high & 0, (x.$low & 1) >>> 0)); block = (x$1 = $shiftLeft64(bit, (((((permutation.$length - 1 >> 0)) - position >> 0) >>> 0))), new $Uint64(block.$high | x$1.$high, (block.$low | x$1.$low) >>> 0)); _i++; } return block; }; initFeistelBox = function() { var _i, _ref, col, f, i, j, row, s, t, x, x$1, x$2, x$3, x$4; _ref = sBoxes; _i = 0; while (true) { if (!(_i < 8)) { break; } s = _i; i = 0; while (true) { if (!(i < 4)) { break; } j = 0; while (true) { if (!(j < 16)) { break; } f = $shiftLeft64((new $Uint64(0, (x = (x$1 = ((s < 0 || s >= sBoxes.length) ? ($throwRuntimeError("index out of range"), undefined) : sBoxes[s]), ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i])), ((j < 0 || j >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[j])))), ((4 * ((7 - ((s >>> 0)) >>> 0)) >>> 0))); f = permuteBlock(f, new sliceType$1(permutationFunction)); row = (((((((i & 2)) << 4 >> 0)) | (i & 1)) << 24 >>> 24)); col = (((j << 1 >> 0) << 24 >>> 24)); t = (row | col) >>> 0; f = (x$2 = $shiftLeft64(f, 1), x$3 = $shiftRightUint64(f, 31), new $Uint64(x$2.$high | x$3.$high, (x$2.$low | x$3.$low) >>> 0)); (x$4 = ((s < 0 || s >= feistelBox.length) ? ($throwRuntimeError("index out of range"), undefined) : feistelBox[s]), ((t < 0 || t >= x$4.length) ? ($throwRuntimeError("index out of range"), undefined) : x$4[t] = ((f.$low >>> 0)))); j = j + (1) >> 0; } i = i + (1) >> 0; } _i++; } }; permuteInitialBlock = function(block) { var b1, b2, block, 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$3, x$4, x$5, x$6, x$7, x$8, x$9; b1 = $shiftRightUint64(block, 48); b2 = $shiftLeft64(block, 48); block = (x = (x$1 = (x$2 = new $Uint64(b1.$high ^ b2.$high, (b1.$low ^ b2.$low) >>> 0), x$3 = $shiftLeft64(b1, 48), new $Uint64(x$2.$high ^ x$3.$high, (x$2.$low ^ x$3.$low) >>> 0)), x$4 = $shiftRightUint64(b2, 48), new $Uint64(x$1.$high ^ x$4.$high, (x$1.$low ^ x$4.$low) >>> 0)), new $Uint64(block.$high ^ x.$high, (block.$low ^ x.$low) >>> 0)); b1 = (x$5 = $shiftRightUint64(block, 32), new $Uint64(x$5.$high & 0, (x$5.$low & 16711935) >>> 0)); b2 = new $Uint64(block.$high & 0, (block.$low & 4278255360) >>> 0); block = (x$6 = (x$7 = (x$8 = (x$9 = $shiftLeft64(b1, 32), new $Uint64(x$9.$high ^ b2.$high, (x$9.$low ^ b2.$low) >>> 0)), x$10 = $shiftLeft64(b1, 8), new $Uint64(x$8.$high ^ x$10.$high, (x$8.$low ^ x$10.$low) >>> 0)), x$11 = $shiftLeft64(b2, 24), new $Uint64(x$7.$high ^ x$11.$high, (x$7.$low ^ x$11.$low) >>> 0)), new $Uint64(block.$high ^ x$6.$high, (block.$low ^ x$6.$low) >>> 0)); b1 = new $Uint64(block.$high & 252641280, (block.$low & 252641280) >>> 0); b2 = new $Uint64(block.$high & 61680, (block.$low & 61680) >>> 0); block = (x$12 = (x$13 = (x$14 = new $Uint64(b1.$high ^ b2.$high, (b1.$low ^ b2.$low) >>> 0), x$15 = $shiftRightUint64(b1, 12), new $Uint64(x$14.$high ^ x$15.$high, (x$14.$low ^ x$15.$low) >>> 0)), x$16 = $shiftLeft64(b2, 12), new $Uint64(x$13.$high ^ x$16.$high, (x$13.$low ^ x$16.$low) >>> 0)), new $Uint64(block.$high ^ x$12.$high, (block.$low ^ x$12.$low) >>> 0)); b1 = new $Uint64(block.$high & 855651072, (block.$low & 855651072) >>> 0); b2 = new $Uint64(block.$high & 13369548, (block.$low & 13369548) >>> 0); block = (x$17 = (x$18 = (x$19 = new $Uint64(b1.$high ^ b2.$high, (b1.$low ^ b2.$low) >>> 0), x$20 = $shiftRightUint64(b1, 6), new $Uint64(x$19.$high ^ x$20.$high, (x$19.$low ^ x$20.$low) >>> 0)), x$21 = $shiftLeft64(b2, 6), new $Uint64(x$18.$high ^ x$21.$high, (x$18.$low ^ x$21.$low) >>> 0)), new $Uint64(block.$high ^ x$17.$high, (block.$low ^ x$17.$low) >>> 0)); b1 = new $Uint64(block.$high & 2863311530, (block.$low & 1431655765) >>> 0); block = (x$22 = (x$23 = (x$24 = $shiftRightUint64(b1, 33), new $Uint64(b1.$high ^ x$24.$high, (b1.$low ^ x$24.$low) >>> 0)), x$25 = $shiftLeft64(b1, 33), new $Uint64(x$23.$high ^ x$25.$high, (x$23.$low ^ x$25.$low) >>> 0)), new $Uint64(block.$high ^ x$22.$high, (block.$low ^ x$22.$low) >>> 0)); return block; }; permuteFinalBlock = function(block) { var b1, b2, block, 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$3, x$4, x$5, x$6, x$7, x$8, x$9; b1 = new $Uint64(block.$high & 2863311530, (block.$low & 1431655765) >>> 0); block = (x = (x$1 = (x$2 = $shiftRightUint64(b1, 33), new $Uint64(b1.$high ^ x$2.$high, (b1.$low ^ x$2.$low) >>> 0)), x$3 = $shiftLeft64(b1, 33), new $Uint64(x$1.$high ^ x$3.$high, (x$1.$low ^ x$3.$low) >>> 0)), new $Uint64(block.$high ^ x.$high, (block.$low ^ x.$low) >>> 0)); b1 = new $Uint64(block.$high & 855651072, (block.$low & 855651072) >>> 0); b2 = new $Uint64(block.$high & 13369548, (block.$low & 13369548) >>> 0); block = (x$4 = (x$5 = (x$6 = new $Uint64(b1.$high ^ b2.$high, (b1.$low ^ b2.$low) >>> 0), x$7 = $shiftRightUint64(b1, 6), new $Uint64(x$6.$high ^ x$7.$high, (x$6.$low ^ x$7.$low) >>> 0)), x$8 = $shiftLeft64(b2, 6), new $Uint64(x$5.$high ^ x$8.$high, (x$5.$low ^ x$8.$low) >>> 0)), new $Uint64(block.$high ^ x$4.$high, (block.$low ^ x$4.$low) >>> 0)); b1 = new $Uint64(block.$high & 252641280, (block.$low & 252641280) >>> 0); b2 = new $Uint64(block.$high & 61680, (block.$low & 61680) >>> 0); block = (x$9 = (x$10 = (x$11 = new $Uint64(b1.$high ^ b2.$high, (b1.$low ^ b2.$low) >>> 0), x$12 = $shiftRightUint64(b1, 12), new $Uint64(x$11.$high ^ x$12.$high, (x$11.$low ^ x$12.$low) >>> 0)), x$13 = $shiftLeft64(b2, 12), new $Uint64(x$10.$high ^ x$13.$high, (x$10.$low ^ x$13.$low) >>> 0)), new $Uint64(block.$high ^ x$9.$high, (block.$low ^ x$9.$low) >>> 0)); b1 = (x$14 = $shiftRightUint64(block, 32), new $Uint64(x$14.$high & 0, (x$14.$low & 16711935) >>> 0)); b2 = new $Uint64(block.$high & 0, (block.$low & 4278255360) >>> 0); block = (x$15 = (x$16 = (x$17 = (x$18 = $shiftLeft64(b1, 32), new $Uint64(x$18.$high ^ b2.$high, (x$18.$low ^ b2.$low) >>> 0)), x$19 = $shiftLeft64(b1, 8), new $Uint64(x$17.$high ^ x$19.$high, (x$17.$low ^ x$19.$low) >>> 0)), x$20 = $shiftLeft64(b2, 24), new $Uint64(x$16.$high ^ x$20.$high, (x$16.$low ^ x$20.$low) >>> 0)), new $Uint64(block.$high ^ x$15.$high, (block.$low ^ x$15.$low) >>> 0)); b1 = $shiftRightUint64(block, 48); b2 = $shiftLeft64(block, 48); block = (x$21 = (x$22 = (x$23 = new $Uint64(b1.$high ^ b2.$high, (b1.$low ^ b2.$low) >>> 0), x$24 = $shiftLeft64(b1, 48), new $Uint64(x$23.$high ^ x$24.$high, (x$23.$low ^ x$24.$low) >>> 0)), x$25 = $shiftRightUint64(b2, 48), new $Uint64(x$22.$high ^ x$25.$high, (x$22.$low ^ x$25.$low) >>> 0)), new $Uint64(block.$high ^ x$21.$high, (block.$low ^ x$21.$low) >>> 0)); return block; }; ksRotate = function(in$1) { var i, in$1, last, left, out, right, y, y$1; out = sliceType$2.nil; out = $makeSlice(sliceType$2, 16); last = in$1; i = 0; while (true) { if (!(i < 16)) { break; } left = (((y = ((4 + ((i < 0 || i >= ksRotations.length) ? ($throwRuntimeError("index out of range"), undefined) : ksRotations[i]) << 24 >>> 24)), y < 32 ? (last << y) : 0) >>> 0)) >>> 4 >>> 0; right = (y$1 = ((32 - ((i < 0 || i >= ksRotations.length) ? ($throwRuntimeError("index out of range"), undefined) : ksRotations[i]) << 24 >>> 24)), y$1 < 32 ? (((last << 4 >>> 0)) >>> y$1) : 0) >>> 0; ((i < 0 || i >= out.$length) ? ($throwRuntimeError("index out of range"), undefined) : out.$array[out.$offset + i] = ((left | right) >>> 0)); last = ((i < 0 || i >= out.$length) ? ($throwRuntimeError("index out of range"), undefined) : out.$array[out.$offset + i]); i = i + (1) >> 0; } return out; }; desCipher.ptr.prototype.generateSubkeys = function(keyBytes) { var c, i, key, keyBytes, leftRotations, pc2Input, permutedKey, rightRotations, x, x$1, x$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; c = $f.c; i = $f.i; key = $f.key; keyBytes = $f.keyBytes; leftRotations = $f.leftRotations; pc2Input = $f.pc2Input; permutedKey = $f.permutedKey; rightRotations = $f.rightRotations; 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: c = this; $r = feistelBoxOnce.Do(initFeistelBox); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } key = $clone(binary.BigEndian, binary.bigEndian).Uint64(keyBytes); permutedKey = permuteBlock(key, new sliceType$1(permutedChoice1)); leftRotations = ksRotate((($shiftRightUint64(permutedKey, 28).$low >>> 0))); rightRotations = ksRotate((($shiftLeft64(permutedKey, 4).$low >>> 0)) >>> 4 >>> 0); i = 0; while (true) { if (!(i < 16)) { break; } pc2Input = (x = $shiftLeft64((new $Uint64(0, ((i < 0 || i >= leftRotations.$length) ? ($throwRuntimeError("index out of range"), undefined) : leftRotations.$array[leftRotations.$offset + i]))), 28), x$1 = (new $Uint64(0, ((i < 0 || i >= rightRotations.$length) ? ($throwRuntimeError("index out of range"), undefined) : rightRotations.$array[rightRotations.$offset + i]))), new $Uint64(x.$high | x$1.$high, (x.$low | x$1.$low) >>> 0)); (x$2 = c.subkeys, ((i < 0 || i >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i] = unpack(permuteBlock(pc2Input, new sliceType$1(permutedChoice2))))); i = i + (1) >> 0; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: desCipher.ptr.prototype.generateSubkeys }; } $f.c = c; $f.i = i; $f.key = key; $f.keyBytes = keyBytes; $f.leftRotations = leftRotations; $f.pc2Input = pc2Input; $f.permutedKey = permutedKey; $f.rightRotations = rightRotations; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; }; desCipher.prototype.generateSubkeys = function(keyBytes) { return this.$val.generateSubkeys(keyBytes); }; unpack = function(x) { var result, 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$3, x$4, x$5, x$6, x$7, x$8, x$9; result = new $Uint64(0, 0); result = (x$1 = (x$2 = (x$3 = (x$4 = (x$5 = (x$6 = (x$7 = $shiftLeft64(((x$8 = $shiftRightUint64(x, 6), new $Uint64(x$8.$high & 0, (x$8.$low & 255) >>> 0))), 0), x$9 = $shiftLeft64(((x$10 = $shiftRightUint64(x, 18), new $Uint64(x$10.$high & 0, (x$10.$low & 255) >>> 0))), 8), new $Uint64(x$7.$high | x$9.$high, (x$7.$low | x$9.$low) >>> 0)), x$11 = $shiftLeft64(((x$12 = $shiftRightUint64(x, 30), new $Uint64(x$12.$high & 0, (x$12.$low & 255) >>> 0))), 16), new $Uint64(x$6.$high | x$11.$high, (x$6.$low | x$11.$low) >>> 0)), x$13 = $shiftLeft64(((x$14 = $shiftRightUint64(x, 42), new $Uint64(x$14.$high & 0, (x$14.$low & 255) >>> 0))), 24), new $Uint64(x$5.$high | x$13.$high, (x$5.$low | x$13.$low) >>> 0)), x$15 = $shiftLeft64(((x$16 = $shiftRightUint64(x, 0), new $Uint64(x$16.$high & 0, (x$16.$low & 255) >>> 0))), 32), new $Uint64(x$4.$high | x$15.$high, (x$4.$low | x$15.$low) >>> 0)), x$17 = $shiftLeft64(((x$18 = $shiftRightUint64(x, 12), new $Uint64(x$18.$high & 0, (x$18.$low & 255) >>> 0))), 40), new $Uint64(x$3.$high | x$17.$high, (x$3.$low | x$17.$low) >>> 0)), x$19 = $shiftLeft64(((x$20 = $shiftRightUint64(x, 24), new $Uint64(x$20.$high & 0, (x$20.$low & 255) >>> 0))), 48), new $Uint64(x$2.$high | x$19.$high, (x$2.$low | x$19.$low) >>> 0)), x$21 = $shiftLeft64(((x$22 = $shiftRightUint64(x, 36), new $Uint64(x$22.$high & 0, (x$22.$low & 255) >>> 0))), 56), new $Uint64(x$1.$high | x$21.$high, (x$1.$low | x$21.$low) >>> 0)); return result; }; KeySizeError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; ptrType.methods = [{prop: "BlockSize", name: "BlockSize", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Encrypt", name: "Encrypt", pkg: "", typ: $funcType([sliceType$1, sliceType$1], [], false)}, {prop: "Decrypt", name: "Decrypt", pkg: "", typ: $funcType([sliceType$1, sliceType$1], [], false)}, {prop: "generateSubkeys", name: "generateSubkeys", pkg: "crypto/des", typ: $funcType([sliceType$1], [], false)}]; ptrType$1.methods = [{prop: "BlockSize", name: "BlockSize", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Encrypt", name: "Encrypt", pkg: "", typ: $funcType([sliceType$1, sliceType$1], [], false)}, {prop: "Decrypt", name: "Decrypt", pkg: "", typ: $funcType([sliceType$1, sliceType$1], [], false)}]; desCipher.init("crypto/des", [{prop: "subkeys", name: "subkeys", embedded: false, exported: false, typ: arrayType$4, tag: ""}]); tripleDESCipher.init("crypto/des", [{prop: "cipher1", name: "cipher1", embedded: false, exported: false, typ: desCipher, tag: ""}, {prop: "cipher2", name: "cipher2", embedded: false, exported: false, typ: desCipher, tag: ""}, {prop: "cipher3", name: "cipher3", embedded: false, exported: false, typ: desCipher, 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 = cipher.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = subtle.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = binary.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strconv.$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; } feistelBox = arrayType$1.zero(); feistelBoxOnce = new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)); permutationFunction = $toNativeArray($kindUint8, [16, 25, 12, 11, 3, 20, 4, 15, 31, 17, 9, 6, 27, 14, 1, 22, 30, 24, 8, 18, 0, 5, 29, 23, 13, 19, 2, 26, 10, 21, 28, 7]); permutedChoice1 = $toNativeArray($kindUint8, [7, 15, 23, 31, 39, 47, 55, 63, 6, 14, 22, 30, 38, 46, 54, 62, 5, 13, 21, 29, 37, 45, 53, 61, 4, 12, 20, 28, 1, 9, 17, 25, 33, 41, 49, 57, 2, 10, 18, 26, 34, 42, 50, 58, 3, 11, 19, 27, 35, 43, 51, 59, 36, 44, 52, 60]); permutedChoice2 = $toNativeArray($kindUint8, [42, 39, 45, 32, 55, 51, 53, 28, 41, 50, 35, 46, 33, 37, 44, 52, 30, 48, 40, 49, 29, 36, 43, 54, 15, 4, 25, 19, 9, 1, 26, 16, 5, 11, 23, 8, 12, 7, 17, 0, 22, 3, 10, 14, 6, 20, 27, 24]); sBoxes = $toNativeArray($kindArray, [$toNativeArray($kindArray, [$toNativeArray($kindUint8, [14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7]), $toNativeArray($kindUint8, [0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8]), $toNativeArray($kindUint8, [4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0]), $toNativeArray($kindUint8, [15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13])]), $toNativeArray($kindArray, [$toNativeArray($kindUint8, [15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10]), $toNativeArray($kindUint8, [3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5]), $toNativeArray($kindUint8, [0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15]), $toNativeArray($kindUint8, [13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9])]), $toNativeArray($kindArray, [$toNativeArray($kindUint8, [10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8]), $toNativeArray($kindUint8, [13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1]), $toNativeArray($kindUint8, [13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7]), $toNativeArray($kindUint8, [1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12])]), $toNativeArray($kindArray, [$toNativeArray($kindUint8, [7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15]), $toNativeArray($kindUint8, [13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9]), $toNativeArray($kindUint8, [10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4]), $toNativeArray($kindUint8, [3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14])]), $toNativeArray($kindArray, [$toNativeArray($kindUint8, [2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9]), $toNativeArray($kindUint8, [14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6]), $toNativeArray($kindUint8, [4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14]), $toNativeArray($kindUint8, [11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3])]), $toNativeArray($kindArray, [$toNativeArray($kindUint8, [12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11]), $toNativeArray($kindUint8, [10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8]), $toNativeArray($kindUint8, [9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6]), $toNativeArray($kindUint8, [4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13])]), $toNativeArray($kindArray, [$toNativeArray($kindUint8, [4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1]), $toNativeArray($kindUint8, [13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6]), $toNativeArray($kindUint8, [1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2]), $toNativeArray($kindUint8, [6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12])]), $toNativeArray($kindArray, [$toNativeArray($kindUint8, [13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7]), $toNativeArray($kindUint8, [1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2]), $toNativeArray($kindUint8, [7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8]), $toNativeArray($kindUint8, [2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11])])]); ksRotations = $toNativeArray($kindUint8, [1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1]); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["crypto/elliptic/internal/fiat"] = (function() { var $pkg = {}, $init, subtle, errors, bits, p521Uint1, P521Element, arrayType, ptrType, ptrType$1, arrayType$1, sliceType, ptrType$2, p521ZeroEncoding, p521AddcarryxU64, p521AddcarryxU58, p521SubborrowxU58, p521AddcarryxU57, p521SubborrowxU57, p521CmovznzU64, p521CarryMul, p521CarrySquare, p521Carry, p521Add, p521Sub, p521ToBytes, p521FromBytes, p521Selectznz; subtle = $packages["crypto/subtle"]; errors = $packages["errors"]; bits = $packages["math/bits"]; p521Uint1 = $pkg.p521Uint1 = $newType(1, $kindUint8, "fiat.p521Uint1", true, "crypto/elliptic/internal/fiat", false, null); P521Element = $pkg.P521Element = $newType(0, $kindStruct, "fiat.P521Element", true, "crypto/elliptic/internal/fiat", true, function(x_) { this.$val = this; if (arguments.length === 0) { this.x = arrayType.zero(); return; } this.x = x_; }); arrayType = $arrayType($Uint64, 9); ptrType = $ptrType($Uint64); ptrType$1 = $ptrType(p521Uint1); arrayType$1 = $arrayType($Uint8, 66); sliceType = $sliceType($Uint8); ptrType$2 = $ptrType(P521Element); p521AddcarryxU64 = function(x, y, carry) { var _tuple, carry, carryOut, sum, x, y; _tuple = bits.Add64(x, y, (new $Uint64(0, carry))); sum = _tuple[0]; carryOut = _tuple[1]; return [sum, ((carryOut.$low << 24 >>> 24))]; }; p521AddcarryxU58 = function(out1, out2, arg1, arg2, arg3) { var arg1, arg2, arg3, out1, out2, x, x$1, x1, x2, x3; x1 = (x = (x$1 = (new $Uint64(0, arg1)), new $Uint64(x$1.$high + arg2.$high, x$1.$low + arg2.$low)), new $Uint64(x.$high + arg3.$high, x.$low + arg3.$low)); x2 = new $Uint64(x1.$high & 67108863, (x1.$low & 4294967295) >>> 0); x3 = ((($shiftRightUint64(x1, 58)).$low << 24 >>> 24)); out1.$set(x2); out2.$set(x3); }; p521SubborrowxU58 = function(out1, out2, arg1, arg2, arg3) { var arg1, arg2, arg3, out1, out2, x, x$1, x$2, x$3, x$4, x$5, x1, x2, x3; x1 = (x = (x$1 = (new $Int64(arg2.$high, arg2.$low)), x$2 = (new $Int64(0, arg1)), new $Int64(x$1.$high - x$2.$high, x$1.$low - x$2.$low)), x$3 = (new $Int64(arg3.$high, arg3.$low)), new $Int64(x.$high - x$3.$high, x.$low - x$3.$low)); x2 = (((x$4 = $shiftRightInt64(x1, 58), x$4.$low + ((x$4.$high >> 31) * 4294967296)) << 24 >> 24)); x3 = (x$5 = (new $Uint64(x1.$high, x1.$low)), new $Uint64(x$5.$high & 67108863, (x$5.$low & 4294967295) >>> 0)); out1.$set(x3); out2.$set((0 - ((x2 << 24 >>> 24)) << 24 >>> 24)); }; p521AddcarryxU57 = function(out1, out2, arg1, arg2, arg3) { var arg1, arg2, arg3, out1, out2, x, x$1, x1, x2, x3; x1 = (x = (x$1 = (new $Uint64(0, arg1)), new $Uint64(x$1.$high + arg2.$high, x$1.$low + arg2.$low)), new $Uint64(x.$high + arg3.$high, x.$low + arg3.$low)); x2 = new $Uint64(x1.$high & 33554431, (x1.$low & 4294967295) >>> 0); x3 = ((($shiftRightUint64(x1, 57)).$low << 24 >>> 24)); out1.$set(x2); out2.$set(x3); }; p521SubborrowxU57 = function(out1, out2, arg1, arg2, arg3) { var arg1, arg2, arg3, out1, out2, x, x$1, x$2, x$3, x$4, x$5, x1, x2, x3; x1 = (x = (x$1 = (new $Int64(arg2.$high, arg2.$low)), x$2 = (new $Int64(0, arg1)), new $Int64(x$1.$high - x$2.$high, x$1.$low - x$2.$low)), x$3 = (new $Int64(arg3.$high, arg3.$low)), new $Int64(x.$high - x$3.$high, x.$low - x$3.$low)); x2 = (((x$4 = $shiftRightInt64(x1, 57), x$4.$low + ((x$4.$high >> 31) * 4294967296)) << 24 >> 24)); x3 = (x$5 = (new $Uint64(x1.$high, x1.$low)), new $Uint64(x$5.$high & 33554431, (x$5.$low & 4294967295) >>> 0)); out1.$set(x3); out2.$set((0 - ((x2 << 24 >>> 24)) << 24 >>> 24)); }; p521CmovznzU64 = function(out1, arg1, arg2, arg3) { var arg1, arg2, arg3, out1, x, x$1, x$2, x1, x2; x1 = $mul64((new $Uint64(0, arg1)), new $Uint64(4294967295, 4294967295)); x2 = (x = new $Uint64(x1.$high & arg3.$high, (x1.$low & arg3.$low) >>> 0), x$1 = (x$2 = new $Uint64(~x1.$high, ~x1.$low >>> 0), new $Uint64(x$2.$high & arg2.$high, (x$2.$low & arg2.$low) >>> 0)), new $Uint64(x.$high | x$1.$high, (x.$low | x$1.$low) >>> 0)); out1.$set(x2); }; p521CarryMul = function(out1, arg1, arg2) { var _tuple, _tuple$1, _tuple$10, _tuple$100, _tuple$101, _tuple$102, _tuple$103, _tuple$104, _tuple$105, _tuple$106, _tuple$107, _tuple$108, _tuple$109, _tuple$11, _tuple$110, _tuple$111, _tuple$112, _tuple$113, _tuple$114, _tuple$115, _tuple$116, _tuple$117, _tuple$118, _tuple$119, _tuple$12, _tuple$120, _tuple$121, _tuple$122, _tuple$123, _tuple$124, _tuple$125, _tuple$126, _tuple$127, _tuple$128, _tuple$129, _tuple$13, _tuple$130, _tuple$131, _tuple$132, _tuple$133, _tuple$134, _tuple$135, _tuple$136, _tuple$137, _tuple$138, _tuple$139, _tuple$14, _tuple$140, _tuple$141, _tuple$142, _tuple$143, _tuple$144, _tuple$145, _tuple$146, _tuple$147, _tuple$148, _tuple$149, _tuple$15, _tuple$150, _tuple$151, _tuple$152, _tuple$153, _tuple$154, _tuple$155, _tuple$156, _tuple$157, _tuple$158, _tuple$159, _tuple$16, _tuple$160, _tuple$161, _tuple$162, _tuple$163, _tuple$164, _tuple$165, _tuple$166, _tuple$167, _tuple$168, _tuple$169, _tuple$17, _tuple$170, _tuple$171, _tuple$172, _tuple$173, _tuple$174, _tuple$175, _tuple$176, _tuple$177, _tuple$178, _tuple$179, _tuple$18, _tuple$180, _tuple$181, _tuple$182, _tuple$183, _tuple$184, _tuple$185, _tuple$186, _tuple$187, _tuple$188, _tuple$189, _tuple$19, _tuple$190, _tuple$191, _tuple$192, _tuple$193, _tuple$194, _tuple$195, _tuple$196, _tuple$197, _tuple$198, _tuple$199, _tuple$2, _tuple$20, _tuple$200, _tuple$201, _tuple$202, _tuple$203, _tuple$204, _tuple$205, _tuple$206, _tuple$207, _tuple$208, _tuple$209, _tuple$21, _tuple$210, _tuple$211, _tuple$212, _tuple$213, _tuple$214, _tuple$215, _tuple$216, _tuple$217, _tuple$218, _tuple$219, _tuple$22, _tuple$220, _tuple$221, _tuple$222, _tuple$223, _tuple$224, _tuple$225, _tuple$226, _tuple$227, _tuple$228, _tuple$229, _tuple$23, _tuple$230, _tuple$231, _tuple$232, _tuple$233, _tuple$234, _tuple$235, _tuple$236, _tuple$237, _tuple$238, _tuple$239, _tuple$24, _tuple$240, _tuple$241, _tuple$25, _tuple$26, _tuple$27, _tuple$28, _tuple$29, _tuple$3, _tuple$30, _tuple$31, _tuple$32, _tuple$33, _tuple$34, _tuple$35, _tuple$36, _tuple$37, _tuple$38, _tuple$39, _tuple$4, _tuple$40, _tuple$41, _tuple$42, _tuple$43, _tuple$44, _tuple$45, _tuple$46, _tuple$47, _tuple$48, _tuple$49, _tuple$5, _tuple$50, _tuple$51, _tuple$52, _tuple$53, _tuple$54, _tuple$55, _tuple$56, _tuple$57, _tuple$58, _tuple$59, _tuple$6, _tuple$60, _tuple$61, _tuple$62, _tuple$63, _tuple$64, _tuple$65, _tuple$66, _tuple$67, _tuple$68, _tuple$69, _tuple$7, _tuple$70, _tuple$71, _tuple$72, _tuple$73, _tuple$74, _tuple$75, _tuple$76, _tuple$77, _tuple$78, _tuple$79, _tuple$8, _tuple$80, _tuple$81, _tuple$82, _tuple$83, _tuple$84, _tuple$85, _tuple$86, _tuple$87, _tuple$88, _tuple$89, _tuple$9, _tuple$90, _tuple$91, _tuple$92, _tuple$93, _tuple$94, _tuple$95, _tuple$96, _tuple$97, _tuple$98, _tuple$99, arg1, arg2, out1, 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$29, x$3, x$30, x$31, x$4, x$5, x$6, x$7, x$8, x$9, x1, x10, x100, x101, x102, x103, x104, x105, x106, x107, x108, x109, x11, x110, x111, x112, x113, x114, x115, x116, x117, x118, x119, x12, x120, x121, x122, x123, x124, x125, x126, x127, x128, x129, x13, x130, x131, x132, x133, x134, x135, x136, x137, x138, x139, x14, x140, x141, x142, x143, x144, x145, x146, x147, x148, x149, x15, x150, x151, x152, x153, x154, x155, x156, x157, x158, x159, x16, x160, x161, x162, x163, x164, x165, x167, x168, x169, x17, x171, x172, x173, x175, x176, x177, x179, x18, x180, x181, x183, x184, x185, x187, x188, x189, x19, x191, x192, x193, x195, x196, x197, x198, x199, x2, x20, x200, x202, x203, x204, x206, x207, x208, x21, x210, x211, x212, x214, x215, x216, x218, x219, x22, x220, x222, x223, x224, x226, x227, x228, x23, x230, x231, x232, x234, x235, x236, x238, x239, x24, x240, x242, x243, x244, x246, x247, x248, x25, x250, x251, x252, x254, x255, x256, x258, x259, x26, x260, x262, x263, x264, x266, x267, x268, x27, x270, x271, x272, x274, x275, x276, x278, x279, x28, x280, x282, x283, x284, x286, x287, x288, x29, x290, x291, x292, x294, x295, x296, x298, x299, x3, x30, x300, x302, x303, x304, x306, x307, x308, x31, x310, x311, x312, x314, x315, x316, x318, x319, x32, x320, x322, x323, x324, x326, x327, x328, x33, x330, x331, x332, x334, x335, x336, x338, x339, x34, x340, x342, x343, x344, x346, x347, x348, x35, x350, x351, x352, x354, x355, x356, x358, x359, x36, x360, x362, x363, x364, x366, x367, x368, x37, x370, x371, x372, x374, x375, x376, x378, x379, x38, x380, x382, x383, x384, x386, x387, x388, x39, x390, x391, x392, x394, x395, x396, x398, x399, x4, x40, x400, x402, x403, x404, x406, x407, x408, x41, x410, x411, x412, x414, x415, x416, x418, x419, x42, x420, x422, x423, x424, x426, x427, x428, x43, x430, x431, x432, x434, x435, x436, x438, x439, x44, x440, x442, x443, x444, x446, x447, x448, x45, x450, x451, x452, x454, x455, x456, x458, x459, x46, x460, x461, x462, x463, x465, x466, x467, x468, x469, x47, x470, x472, x473, x474, x475, x476, x477, x479, x48, x480, x481, x482, x483, x484, x486, x487, x488, x489, x49, x490, x491, x493, x494, x495, x496, x497, x498, x5, x50, x500, x501, x502, x503, x504, x505, x507, x508, x509, x51, x510, x511, x512, x513, x514, x515, x516, x517, x518, x52, x53, x54, x55, x56, x57, x58, x59, x6, x60, x61, x62, x63, x64, x65, x66, x67, x68, x69, x7, x70, x71, x72, x73, x74, x75, x76, x77, x78, x79, x8, x80, x81, x82, x83, x84, x85, x86, x87, x88, x89, x9, x90, x91, x92, x93, x94, x95, x96, x97, x98, x99; x1 = new $Uint64(0, 0); x2 = new $Uint64(0, 0); _tuple = bits.Mul64(arg1[8], $mul64(arg2[8], new $Uint64(0, 2))); x2 = _tuple[0]; x1 = _tuple[1]; x3 = new $Uint64(0, 0); x4 = new $Uint64(0, 0); _tuple$1 = bits.Mul64(arg1[8], $mul64(arg2[7], new $Uint64(0, 2))); x4 = _tuple$1[0]; x3 = _tuple$1[1]; x5 = new $Uint64(0, 0); x6 = new $Uint64(0, 0); _tuple$2 = bits.Mul64(arg1[8], $mul64(arg2[6], new $Uint64(0, 2))); x6 = _tuple$2[0]; x5 = _tuple$2[1]; x7 = new $Uint64(0, 0); x8 = new $Uint64(0, 0); _tuple$3 = bits.Mul64(arg1[8], $mul64(arg2[5], new $Uint64(0, 2))); x8 = _tuple$3[0]; x7 = _tuple$3[1]; x9 = new $Uint64(0, 0); x10 = new $Uint64(0, 0); _tuple$4 = bits.Mul64(arg1[8], $mul64(arg2[4], new $Uint64(0, 2))); x10 = _tuple$4[0]; x9 = _tuple$4[1]; x11 = new $Uint64(0, 0); x12 = new $Uint64(0, 0); _tuple$5 = bits.Mul64(arg1[8], $mul64(arg2[3], new $Uint64(0, 2))); x12 = _tuple$5[0]; x11 = _tuple$5[1]; x13 = new $Uint64(0, 0); x14 = new $Uint64(0, 0); _tuple$6 = bits.Mul64(arg1[8], $mul64(arg2[2], new $Uint64(0, 2))); x14 = _tuple$6[0]; x13 = _tuple$6[1]; x15 = new $Uint64(0, 0); x16 = new $Uint64(0, 0); _tuple$7 = bits.Mul64(arg1[8], $mul64(arg2[1], new $Uint64(0, 2))); x16 = _tuple$7[0]; x15 = _tuple$7[1]; x17 = new $Uint64(0, 0); x18 = new $Uint64(0, 0); _tuple$8 = bits.Mul64(arg1[7], $mul64(arg2[8], new $Uint64(0, 2))); x18 = _tuple$8[0]; x17 = _tuple$8[1]; x19 = new $Uint64(0, 0); x20 = new $Uint64(0, 0); _tuple$9 = bits.Mul64(arg1[7], $mul64(arg2[7], new $Uint64(0, 2))); x20 = _tuple$9[0]; x19 = _tuple$9[1]; x21 = new $Uint64(0, 0); x22 = new $Uint64(0, 0); _tuple$10 = bits.Mul64(arg1[7], $mul64(arg2[6], new $Uint64(0, 2))); x22 = _tuple$10[0]; x21 = _tuple$10[1]; x23 = new $Uint64(0, 0); x24 = new $Uint64(0, 0); _tuple$11 = bits.Mul64(arg1[7], $mul64(arg2[5], new $Uint64(0, 2))); x24 = _tuple$11[0]; x23 = _tuple$11[1]; x25 = new $Uint64(0, 0); x26 = new $Uint64(0, 0); _tuple$12 = bits.Mul64(arg1[7], $mul64(arg2[4], new $Uint64(0, 2))); x26 = _tuple$12[0]; x25 = _tuple$12[1]; x27 = new $Uint64(0, 0); x28 = new $Uint64(0, 0); _tuple$13 = bits.Mul64(arg1[7], $mul64(arg2[3], new $Uint64(0, 2))); x28 = _tuple$13[0]; x27 = _tuple$13[1]; x29 = new $Uint64(0, 0); x30 = new $Uint64(0, 0); _tuple$14 = bits.Mul64(arg1[7], $mul64(arg2[2], new $Uint64(0, 2))); x30 = _tuple$14[0]; x29 = _tuple$14[1]; x31 = new $Uint64(0, 0); x32 = new $Uint64(0, 0); _tuple$15 = bits.Mul64(arg1[6], $mul64(arg2[8], new $Uint64(0, 2))); x32 = _tuple$15[0]; x31 = _tuple$15[1]; x33 = new $Uint64(0, 0); x34 = new $Uint64(0, 0); _tuple$16 = bits.Mul64(arg1[6], $mul64(arg2[7], new $Uint64(0, 2))); x34 = _tuple$16[0]; x33 = _tuple$16[1]; x35 = new $Uint64(0, 0); x36 = new $Uint64(0, 0); _tuple$17 = bits.Mul64(arg1[6], $mul64(arg2[6], new $Uint64(0, 2))); x36 = _tuple$17[0]; x35 = _tuple$17[1]; x37 = new $Uint64(0, 0); x38 = new $Uint64(0, 0); _tuple$18 = bits.Mul64(arg1[6], $mul64(arg2[5], new $Uint64(0, 2))); x38 = _tuple$18[0]; x37 = _tuple$18[1]; x39 = new $Uint64(0, 0); x40 = new $Uint64(0, 0); _tuple$19 = bits.Mul64(arg1[6], $mul64(arg2[4], new $Uint64(0, 2))); x40 = _tuple$19[0]; x39 = _tuple$19[1]; x41 = new $Uint64(0, 0); x42 = new $Uint64(0, 0); _tuple$20 = bits.Mul64(arg1[6], $mul64(arg2[3], new $Uint64(0, 2))); x42 = _tuple$20[0]; x41 = _tuple$20[1]; x43 = new $Uint64(0, 0); x44 = new $Uint64(0, 0); _tuple$21 = bits.Mul64(arg1[5], $mul64(arg2[8], new $Uint64(0, 2))); x44 = _tuple$21[0]; x43 = _tuple$21[1]; x45 = new $Uint64(0, 0); x46 = new $Uint64(0, 0); _tuple$22 = bits.Mul64(arg1[5], $mul64(arg2[7], new $Uint64(0, 2))); x46 = _tuple$22[0]; x45 = _tuple$22[1]; x47 = new $Uint64(0, 0); x48 = new $Uint64(0, 0); _tuple$23 = bits.Mul64(arg1[5], $mul64(arg2[6], new $Uint64(0, 2))); x48 = _tuple$23[0]; x47 = _tuple$23[1]; x49 = new $Uint64(0, 0); x50 = new $Uint64(0, 0); _tuple$24 = bits.Mul64(arg1[5], $mul64(arg2[5], new $Uint64(0, 2))); x50 = _tuple$24[0]; x49 = _tuple$24[1]; x51 = new $Uint64(0, 0); x52 = new $Uint64(0, 0); _tuple$25 = bits.Mul64(arg1[5], $mul64(arg2[4], new $Uint64(0, 2))); x52 = _tuple$25[0]; x51 = _tuple$25[1]; x53 = new $Uint64(0, 0); x54 = new $Uint64(0, 0); _tuple$26 = bits.Mul64(arg1[4], $mul64(arg2[8], new $Uint64(0, 2))); x54 = _tuple$26[0]; x53 = _tuple$26[1]; x55 = new $Uint64(0, 0); x56 = new $Uint64(0, 0); _tuple$27 = bits.Mul64(arg1[4], $mul64(arg2[7], new $Uint64(0, 2))); x56 = _tuple$27[0]; x55 = _tuple$27[1]; x57 = new $Uint64(0, 0); x58 = new $Uint64(0, 0); _tuple$28 = bits.Mul64(arg1[4], $mul64(arg2[6], new $Uint64(0, 2))); x58 = _tuple$28[0]; x57 = _tuple$28[1]; x59 = new $Uint64(0, 0); x60 = new $Uint64(0, 0); _tuple$29 = bits.Mul64(arg1[4], $mul64(arg2[5], new $Uint64(0, 2))); x60 = _tuple$29[0]; x59 = _tuple$29[1]; x61 = new $Uint64(0, 0); x62 = new $Uint64(0, 0); _tuple$30 = bits.Mul64(arg1[3], $mul64(arg2[8], new $Uint64(0, 2))); x62 = _tuple$30[0]; x61 = _tuple$30[1]; x63 = new $Uint64(0, 0); x64 = new $Uint64(0, 0); _tuple$31 = bits.Mul64(arg1[3], $mul64(arg2[7], new $Uint64(0, 2))); x64 = _tuple$31[0]; x63 = _tuple$31[1]; x65 = new $Uint64(0, 0); x66 = new $Uint64(0, 0); _tuple$32 = bits.Mul64(arg1[3], $mul64(arg2[6], new $Uint64(0, 2))); x66 = _tuple$32[0]; x65 = _tuple$32[1]; x67 = new $Uint64(0, 0); x68 = new $Uint64(0, 0); _tuple$33 = bits.Mul64(arg1[2], $mul64(arg2[8], new $Uint64(0, 2))); x68 = _tuple$33[0]; x67 = _tuple$33[1]; x69 = new $Uint64(0, 0); x70 = new $Uint64(0, 0); _tuple$34 = bits.Mul64(arg1[2], $mul64(arg2[7], new $Uint64(0, 2))); x70 = _tuple$34[0]; x69 = _tuple$34[1]; x71 = new $Uint64(0, 0); x72 = new $Uint64(0, 0); _tuple$35 = bits.Mul64(arg1[1], $mul64(arg2[8], new $Uint64(0, 2))); x72 = _tuple$35[0]; x71 = _tuple$35[1]; x73 = new $Uint64(0, 0); x74 = new $Uint64(0, 0); _tuple$36 = bits.Mul64(arg1[8], arg2[0]); x74 = _tuple$36[0]; x73 = _tuple$36[1]; x75 = new $Uint64(0, 0); x76 = new $Uint64(0, 0); _tuple$37 = bits.Mul64(arg1[7], arg2[1]); x76 = _tuple$37[0]; x75 = _tuple$37[1]; x77 = new $Uint64(0, 0); x78 = new $Uint64(0, 0); _tuple$38 = bits.Mul64(arg1[7], arg2[0]); x78 = _tuple$38[0]; x77 = _tuple$38[1]; x79 = new $Uint64(0, 0); x80 = new $Uint64(0, 0); _tuple$39 = bits.Mul64(arg1[6], arg2[2]); x80 = _tuple$39[0]; x79 = _tuple$39[1]; x81 = new $Uint64(0, 0); x82 = new $Uint64(0, 0); _tuple$40 = bits.Mul64(arg1[6], arg2[1]); x82 = _tuple$40[0]; x81 = _tuple$40[1]; x83 = new $Uint64(0, 0); x84 = new $Uint64(0, 0); _tuple$41 = bits.Mul64(arg1[6], arg2[0]); x84 = _tuple$41[0]; x83 = _tuple$41[1]; x85 = new $Uint64(0, 0); x86 = new $Uint64(0, 0); _tuple$42 = bits.Mul64(arg1[5], arg2[3]); x86 = _tuple$42[0]; x85 = _tuple$42[1]; x87 = new $Uint64(0, 0); x88 = new $Uint64(0, 0); _tuple$43 = bits.Mul64(arg1[5], arg2[2]); x88 = _tuple$43[0]; x87 = _tuple$43[1]; x89 = new $Uint64(0, 0); x90 = new $Uint64(0, 0); _tuple$44 = bits.Mul64(arg1[5], arg2[1]); x90 = _tuple$44[0]; x89 = _tuple$44[1]; x91 = new $Uint64(0, 0); x92 = new $Uint64(0, 0); _tuple$45 = bits.Mul64(arg1[5], arg2[0]); x92 = _tuple$45[0]; x91 = _tuple$45[1]; x93 = new $Uint64(0, 0); x94 = new $Uint64(0, 0); _tuple$46 = bits.Mul64(arg1[4], arg2[4]); x94 = _tuple$46[0]; x93 = _tuple$46[1]; x95 = new $Uint64(0, 0); x96 = new $Uint64(0, 0); _tuple$47 = bits.Mul64(arg1[4], arg2[3]); x96 = _tuple$47[0]; x95 = _tuple$47[1]; x97 = new $Uint64(0, 0); x98 = new $Uint64(0, 0); _tuple$48 = bits.Mul64(arg1[4], arg2[2]); x98 = _tuple$48[0]; x97 = _tuple$48[1]; x99 = new $Uint64(0, 0); x100 = new $Uint64(0, 0); _tuple$49 = bits.Mul64(arg1[4], arg2[1]); x100 = _tuple$49[0]; x99 = _tuple$49[1]; x101 = new $Uint64(0, 0); x102 = new $Uint64(0, 0); _tuple$50 = bits.Mul64(arg1[4], arg2[0]); x102 = _tuple$50[0]; x101 = _tuple$50[1]; x103 = new $Uint64(0, 0); x104 = new $Uint64(0, 0); _tuple$51 = bits.Mul64(arg1[3], arg2[5]); x104 = _tuple$51[0]; x103 = _tuple$51[1]; x105 = new $Uint64(0, 0); x106 = new $Uint64(0, 0); _tuple$52 = bits.Mul64(arg1[3], arg2[4]); x106 = _tuple$52[0]; x105 = _tuple$52[1]; x107 = new $Uint64(0, 0); x108 = new $Uint64(0, 0); _tuple$53 = bits.Mul64(arg1[3], arg2[3]); x108 = _tuple$53[0]; x107 = _tuple$53[1]; x109 = new $Uint64(0, 0); x110 = new $Uint64(0, 0); _tuple$54 = bits.Mul64(arg1[3], arg2[2]); x110 = _tuple$54[0]; x109 = _tuple$54[1]; x111 = new $Uint64(0, 0); x112 = new $Uint64(0, 0); _tuple$55 = bits.Mul64(arg1[3], arg2[1]); x112 = _tuple$55[0]; x111 = _tuple$55[1]; x113 = new $Uint64(0, 0); x114 = new $Uint64(0, 0); _tuple$56 = bits.Mul64(arg1[3], arg2[0]); x114 = _tuple$56[0]; x113 = _tuple$56[1]; x115 = new $Uint64(0, 0); x116 = new $Uint64(0, 0); _tuple$57 = bits.Mul64(arg1[2], arg2[6]); x116 = _tuple$57[0]; x115 = _tuple$57[1]; x117 = new $Uint64(0, 0); x118 = new $Uint64(0, 0); _tuple$58 = bits.Mul64(arg1[2], arg2[5]); x118 = _tuple$58[0]; x117 = _tuple$58[1]; x119 = new $Uint64(0, 0); x120 = new $Uint64(0, 0); _tuple$59 = bits.Mul64(arg1[2], arg2[4]); x120 = _tuple$59[0]; x119 = _tuple$59[1]; x121 = new $Uint64(0, 0); x122 = new $Uint64(0, 0); _tuple$60 = bits.Mul64(arg1[2], arg2[3]); x122 = _tuple$60[0]; x121 = _tuple$60[1]; x123 = new $Uint64(0, 0); x124 = new $Uint64(0, 0); _tuple$61 = bits.Mul64(arg1[2], arg2[2]); x124 = _tuple$61[0]; x123 = _tuple$61[1]; x125 = new $Uint64(0, 0); x126 = new $Uint64(0, 0); _tuple$62 = bits.Mul64(arg1[2], arg2[1]); x126 = _tuple$62[0]; x125 = _tuple$62[1]; x127 = new $Uint64(0, 0); x128 = new $Uint64(0, 0); _tuple$63 = bits.Mul64(arg1[2], arg2[0]); x128 = _tuple$63[0]; x127 = _tuple$63[1]; x129 = new $Uint64(0, 0); x130 = new $Uint64(0, 0); _tuple$64 = bits.Mul64(arg1[1], arg2[7]); x130 = _tuple$64[0]; x129 = _tuple$64[1]; x131 = new $Uint64(0, 0); x132 = new $Uint64(0, 0); _tuple$65 = bits.Mul64(arg1[1], arg2[6]); x132 = _tuple$65[0]; x131 = _tuple$65[1]; x133 = new $Uint64(0, 0); x134 = new $Uint64(0, 0); _tuple$66 = bits.Mul64(arg1[1], arg2[5]); x134 = _tuple$66[0]; x133 = _tuple$66[1]; x135 = new $Uint64(0, 0); x136 = new $Uint64(0, 0); _tuple$67 = bits.Mul64(arg1[1], arg2[4]); x136 = _tuple$67[0]; x135 = _tuple$67[1]; x137 = new $Uint64(0, 0); x138 = new $Uint64(0, 0); _tuple$68 = bits.Mul64(arg1[1], arg2[3]); x138 = _tuple$68[0]; x137 = _tuple$68[1]; x139 = new $Uint64(0, 0); x140 = new $Uint64(0, 0); _tuple$69 = bits.Mul64(arg1[1], arg2[2]); x140 = _tuple$69[0]; x139 = _tuple$69[1]; x141 = new $Uint64(0, 0); x142 = new $Uint64(0, 0); _tuple$70 = bits.Mul64(arg1[1], arg2[1]); x142 = _tuple$70[0]; x141 = _tuple$70[1]; x143 = new $Uint64(0, 0); x144 = new $Uint64(0, 0); _tuple$71 = bits.Mul64(arg1[1], arg2[0]); x144 = _tuple$71[0]; x143 = _tuple$71[1]; x145 = new $Uint64(0, 0); x146 = new $Uint64(0, 0); _tuple$72 = bits.Mul64(arg1[0], arg2[8]); x146 = _tuple$72[0]; x145 = _tuple$72[1]; x147 = new $Uint64(0, 0); x148 = new $Uint64(0, 0); _tuple$73 = bits.Mul64(arg1[0], arg2[7]); x148 = _tuple$73[0]; x147 = _tuple$73[1]; x149 = new $Uint64(0, 0); x150 = new $Uint64(0, 0); _tuple$74 = bits.Mul64(arg1[0], arg2[6]); x150 = _tuple$74[0]; x149 = _tuple$74[1]; x151 = new $Uint64(0, 0); x152 = new $Uint64(0, 0); _tuple$75 = bits.Mul64(arg1[0], arg2[5]); x152 = _tuple$75[0]; x151 = _tuple$75[1]; x153 = new $Uint64(0, 0); x154 = new $Uint64(0, 0); _tuple$76 = bits.Mul64(arg1[0], arg2[4]); x154 = _tuple$76[0]; x153 = _tuple$76[1]; x155 = new $Uint64(0, 0); x156 = new $Uint64(0, 0); _tuple$77 = bits.Mul64(arg1[0], arg2[3]); x156 = _tuple$77[0]; x155 = _tuple$77[1]; x157 = new $Uint64(0, 0); x158 = new $Uint64(0, 0); _tuple$78 = bits.Mul64(arg1[0], arg2[2]); x158 = _tuple$78[0]; x157 = _tuple$78[1]; x159 = new $Uint64(0, 0); x160 = new $Uint64(0, 0); _tuple$79 = bits.Mul64(arg1[0], arg2[1]); x160 = _tuple$79[0]; x159 = _tuple$79[1]; x161 = new $Uint64(0, 0); x162 = new $Uint64(0, 0); _tuple$80 = bits.Mul64(arg1[0], arg2[0]); x162 = _tuple$80[0]; x161 = _tuple$80[1]; x163 = new $Uint64(0, 0); x164 = 0; _tuple$81 = p521AddcarryxU64(x29, x15, 0); x163 = _tuple$81[0]; x164 = _tuple$81[1]; x165 = new $Uint64(0, 0); _tuple$82 = p521AddcarryxU64(x30, x16, x164); x165 = _tuple$82[0]; x167 = new $Uint64(0, 0); x168 = 0; _tuple$83 = p521AddcarryxU64(x41, x163, 0); x167 = _tuple$83[0]; x168 = _tuple$83[1]; x169 = new $Uint64(0, 0); _tuple$84 = p521AddcarryxU64(x42, x165, x168); x169 = _tuple$84[0]; x171 = new $Uint64(0, 0); x172 = 0; _tuple$85 = p521AddcarryxU64(x51, x167, 0); x171 = _tuple$85[0]; x172 = _tuple$85[1]; x173 = new $Uint64(0, 0); _tuple$86 = p521AddcarryxU64(x52, x169, x172); x173 = _tuple$86[0]; x175 = new $Uint64(0, 0); x176 = 0; _tuple$87 = p521AddcarryxU64(x59, x171, 0); x175 = _tuple$87[0]; x176 = _tuple$87[1]; x177 = new $Uint64(0, 0); _tuple$88 = p521AddcarryxU64(x60, x173, x176); x177 = _tuple$88[0]; x179 = new $Uint64(0, 0); x180 = 0; _tuple$89 = p521AddcarryxU64(x65, x175, 0); x179 = _tuple$89[0]; x180 = _tuple$89[1]; x181 = new $Uint64(0, 0); _tuple$90 = p521AddcarryxU64(x66, x177, x180); x181 = _tuple$90[0]; x183 = new $Uint64(0, 0); x184 = 0; _tuple$91 = p521AddcarryxU64(x69, x179, 0); x183 = _tuple$91[0]; x184 = _tuple$91[1]; x185 = new $Uint64(0, 0); _tuple$92 = p521AddcarryxU64(x70, x181, x184); x185 = _tuple$92[0]; x187 = new $Uint64(0, 0); x188 = 0; _tuple$93 = p521AddcarryxU64(x71, x183, 0); x187 = _tuple$93[0]; x188 = _tuple$93[1]; x189 = new $Uint64(0, 0); _tuple$94 = p521AddcarryxU64(x72, x185, x188); x189 = _tuple$94[0]; x191 = new $Uint64(0, 0); x192 = 0; _tuple$95 = p521AddcarryxU64(x161, x187, 0); x191 = _tuple$95[0]; x192 = _tuple$95[1]; x193 = new $Uint64(0, 0); _tuple$96 = p521AddcarryxU64(x162, x189, x192); x193 = _tuple$96[0]; x195 = (x = $shiftRightUint64(x191, 58), x$1 = (x$2 = $shiftLeft64(x193, 6), new $Uint64(x$2.$high & 4294967295, (x$2.$low & 4294967295) >>> 0)), new $Uint64(x.$high | x$1.$high, (x.$low | x$1.$low) >>> 0)); x196 = $shiftRightUint64(x193, 58); x197 = new $Uint64(x191.$high & 67108863, (x191.$low & 4294967295) >>> 0); x198 = new $Uint64(0, 0); x199 = 0; _tuple$97 = p521AddcarryxU64(x75, x73, 0); x198 = _tuple$97[0]; x199 = _tuple$97[1]; x200 = new $Uint64(0, 0); _tuple$98 = p521AddcarryxU64(x76, x74, x199); x200 = _tuple$98[0]; x202 = new $Uint64(0, 0); x203 = 0; _tuple$99 = p521AddcarryxU64(x79, x198, 0); x202 = _tuple$99[0]; x203 = _tuple$99[1]; x204 = new $Uint64(0, 0); _tuple$100 = p521AddcarryxU64(x80, x200, x203); x204 = _tuple$100[0]; x206 = new $Uint64(0, 0); x207 = 0; _tuple$101 = p521AddcarryxU64(x85, x202, 0); x206 = _tuple$101[0]; x207 = _tuple$101[1]; x208 = new $Uint64(0, 0); _tuple$102 = p521AddcarryxU64(x86, x204, x207); x208 = _tuple$102[0]; x210 = new $Uint64(0, 0); x211 = 0; _tuple$103 = p521AddcarryxU64(x93, x206, 0); x210 = _tuple$103[0]; x211 = _tuple$103[1]; x212 = new $Uint64(0, 0); _tuple$104 = p521AddcarryxU64(x94, x208, x211); x212 = _tuple$104[0]; x214 = new $Uint64(0, 0); x215 = 0; _tuple$105 = p521AddcarryxU64(x103, x210, 0); x214 = _tuple$105[0]; x215 = _tuple$105[1]; x216 = new $Uint64(0, 0); _tuple$106 = p521AddcarryxU64(x104, x212, x215); x216 = _tuple$106[0]; x218 = new $Uint64(0, 0); x219 = 0; _tuple$107 = p521AddcarryxU64(x115, x214, 0); x218 = _tuple$107[0]; x219 = _tuple$107[1]; x220 = new $Uint64(0, 0); _tuple$108 = p521AddcarryxU64(x116, x216, x219); x220 = _tuple$108[0]; x222 = new $Uint64(0, 0); x223 = 0; _tuple$109 = p521AddcarryxU64(x129, x218, 0); x222 = _tuple$109[0]; x223 = _tuple$109[1]; x224 = new $Uint64(0, 0); _tuple$110 = p521AddcarryxU64(x130, x220, x223); x224 = _tuple$110[0]; x226 = new $Uint64(0, 0); x227 = 0; _tuple$111 = p521AddcarryxU64(x145, x222, 0); x226 = _tuple$111[0]; x227 = _tuple$111[1]; x228 = new $Uint64(0, 0); _tuple$112 = p521AddcarryxU64(x146, x224, x227); x228 = _tuple$112[0]; x230 = new $Uint64(0, 0); x231 = 0; _tuple$113 = p521AddcarryxU64(x77, x1, 0); x230 = _tuple$113[0]; x231 = _tuple$113[1]; x232 = new $Uint64(0, 0); _tuple$114 = p521AddcarryxU64(x78, x2, x231); x232 = _tuple$114[0]; x234 = new $Uint64(0, 0); x235 = 0; _tuple$115 = p521AddcarryxU64(x81, x230, 0); x234 = _tuple$115[0]; x235 = _tuple$115[1]; x236 = new $Uint64(0, 0); _tuple$116 = p521AddcarryxU64(x82, x232, x235); x236 = _tuple$116[0]; x238 = new $Uint64(0, 0); x239 = 0; _tuple$117 = p521AddcarryxU64(x87, x234, 0); x238 = _tuple$117[0]; x239 = _tuple$117[1]; x240 = new $Uint64(0, 0); _tuple$118 = p521AddcarryxU64(x88, x236, x239); x240 = _tuple$118[0]; x242 = new $Uint64(0, 0); x243 = 0; _tuple$119 = p521AddcarryxU64(x95, x238, 0); x242 = _tuple$119[0]; x243 = _tuple$119[1]; x244 = new $Uint64(0, 0); _tuple$120 = p521AddcarryxU64(x96, x240, x243); x244 = _tuple$120[0]; x246 = new $Uint64(0, 0); x247 = 0; _tuple$121 = p521AddcarryxU64(x105, x242, 0); x246 = _tuple$121[0]; x247 = _tuple$121[1]; x248 = new $Uint64(0, 0); _tuple$122 = p521AddcarryxU64(x106, x244, x247); x248 = _tuple$122[0]; x250 = new $Uint64(0, 0); x251 = 0; _tuple$123 = p521AddcarryxU64(x117, x246, 0); x250 = _tuple$123[0]; x251 = _tuple$123[1]; x252 = new $Uint64(0, 0); _tuple$124 = p521AddcarryxU64(x118, x248, x251); x252 = _tuple$124[0]; x254 = new $Uint64(0, 0); x255 = 0; _tuple$125 = p521AddcarryxU64(x131, x250, 0); x254 = _tuple$125[0]; x255 = _tuple$125[1]; x256 = new $Uint64(0, 0); _tuple$126 = p521AddcarryxU64(x132, x252, x255); x256 = _tuple$126[0]; x258 = new $Uint64(0, 0); x259 = 0; _tuple$127 = p521AddcarryxU64(x147, x254, 0); x258 = _tuple$127[0]; x259 = _tuple$127[1]; x260 = new $Uint64(0, 0); _tuple$128 = p521AddcarryxU64(x148, x256, x259); x260 = _tuple$128[0]; x262 = new $Uint64(0, 0); x263 = 0; _tuple$129 = p521AddcarryxU64(x17, x3, 0); x262 = _tuple$129[0]; x263 = _tuple$129[1]; x264 = new $Uint64(0, 0); _tuple$130 = p521AddcarryxU64(x18, x4, x263); x264 = _tuple$130[0]; x266 = new $Uint64(0, 0); x267 = 0; _tuple$131 = p521AddcarryxU64(x83, x262, 0); x266 = _tuple$131[0]; x267 = _tuple$131[1]; x268 = new $Uint64(0, 0); _tuple$132 = p521AddcarryxU64(x84, x264, x267); x268 = _tuple$132[0]; x270 = new $Uint64(0, 0); x271 = 0; _tuple$133 = p521AddcarryxU64(x89, x266, 0); x270 = _tuple$133[0]; x271 = _tuple$133[1]; x272 = new $Uint64(0, 0); _tuple$134 = p521AddcarryxU64(x90, x268, x271); x272 = _tuple$134[0]; x274 = new $Uint64(0, 0); x275 = 0; _tuple$135 = p521AddcarryxU64(x97, x270, 0); x274 = _tuple$135[0]; x275 = _tuple$135[1]; x276 = new $Uint64(0, 0); _tuple$136 = p521AddcarryxU64(x98, x272, x275); x276 = _tuple$136[0]; x278 = new $Uint64(0, 0); x279 = 0; _tuple$137 = p521AddcarryxU64(x107, x274, 0); x278 = _tuple$137[0]; x279 = _tuple$137[1]; x280 = new $Uint64(0, 0); _tuple$138 = p521AddcarryxU64(x108, x276, x279); x280 = _tuple$138[0]; x282 = new $Uint64(0, 0); x283 = 0; _tuple$139 = p521AddcarryxU64(x119, x278, 0); x282 = _tuple$139[0]; x283 = _tuple$139[1]; x284 = new $Uint64(0, 0); _tuple$140 = p521AddcarryxU64(x120, x280, x283); x284 = _tuple$140[0]; x286 = new $Uint64(0, 0); x287 = 0; _tuple$141 = p521AddcarryxU64(x133, x282, 0); x286 = _tuple$141[0]; x287 = _tuple$141[1]; x288 = new $Uint64(0, 0); _tuple$142 = p521AddcarryxU64(x134, x284, x287); x288 = _tuple$142[0]; x290 = new $Uint64(0, 0); x291 = 0; _tuple$143 = p521AddcarryxU64(x149, x286, 0); x290 = _tuple$143[0]; x291 = _tuple$143[1]; x292 = new $Uint64(0, 0); _tuple$144 = p521AddcarryxU64(x150, x288, x291); x292 = _tuple$144[0]; x294 = new $Uint64(0, 0); x295 = 0; _tuple$145 = p521AddcarryxU64(x19, x5, 0); x294 = _tuple$145[0]; x295 = _tuple$145[1]; x296 = new $Uint64(0, 0); _tuple$146 = p521AddcarryxU64(x20, x6, x295); x296 = _tuple$146[0]; x298 = new $Uint64(0, 0); x299 = 0; _tuple$147 = p521AddcarryxU64(x31, x294, 0); x298 = _tuple$147[0]; x299 = _tuple$147[1]; x300 = new $Uint64(0, 0); _tuple$148 = p521AddcarryxU64(x32, x296, x299); x300 = _tuple$148[0]; x302 = new $Uint64(0, 0); x303 = 0; _tuple$149 = p521AddcarryxU64(x91, x298, 0); x302 = _tuple$149[0]; x303 = _tuple$149[1]; x304 = new $Uint64(0, 0); _tuple$150 = p521AddcarryxU64(x92, x300, x303); x304 = _tuple$150[0]; x306 = new $Uint64(0, 0); x307 = 0; _tuple$151 = p521AddcarryxU64(x99, x302, 0); x306 = _tuple$151[0]; x307 = _tuple$151[1]; x308 = new $Uint64(0, 0); _tuple$152 = p521AddcarryxU64(x100, x304, x307); x308 = _tuple$152[0]; x310 = new $Uint64(0, 0); x311 = 0; _tuple$153 = p521AddcarryxU64(x109, x306, 0); x310 = _tuple$153[0]; x311 = _tuple$153[1]; x312 = new $Uint64(0, 0); _tuple$154 = p521AddcarryxU64(x110, x308, x311); x312 = _tuple$154[0]; x314 = new $Uint64(0, 0); x315 = 0; _tuple$155 = p521AddcarryxU64(x121, x310, 0); x314 = _tuple$155[0]; x315 = _tuple$155[1]; x316 = new $Uint64(0, 0); _tuple$156 = p521AddcarryxU64(x122, x312, x315); x316 = _tuple$156[0]; x318 = new $Uint64(0, 0); x319 = 0; _tuple$157 = p521AddcarryxU64(x135, x314, 0); x318 = _tuple$157[0]; x319 = _tuple$157[1]; x320 = new $Uint64(0, 0); _tuple$158 = p521AddcarryxU64(x136, x316, x319); x320 = _tuple$158[0]; x322 = new $Uint64(0, 0); x323 = 0; _tuple$159 = p521AddcarryxU64(x151, x318, 0); x322 = _tuple$159[0]; x323 = _tuple$159[1]; x324 = new $Uint64(0, 0); _tuple$160 = p521AddcarryxU64(x152, x320, x323); x324 = _tuple$160[0]; x326 = new $Uint64(0, 0); x327 = 0; _tuple$161 = p521AddcarryxU64(x21, x7, 0); x326 = _tuple$161[0]; x327 = _tuple$161[1]; x328 = new $Uint64(0, 0); _tuple$162 = p521AddcarryxU64(x22, x8, x327); x328 = _tuple$162[0]; x330 = new $Uint64(0, 0); x331 = 0; _tuple$163 = p521AddcarryxU64(x33, x326, 0); x330 = _tuple$163[0]; x331 = _tuple$163[1]; x332 = new $Uint64(0, 0); _tuple$164 = p521AddcarryxU64(x34, x328, x331); x332 = _tuple$164[0]; x334 = new $Uint64(0, 0); x335 = 0; _tuple$165 = p521AddcarryxU64(x43, x330, 0); x334 = _tuple$165[0]; x335 = _tuple$165[1]; x336 = new $Uint64(0, 0); _tuple$166 = p521AddcarryxU64(x44, x332, x335); x336 = _tuple$166[0]; x338 = new $Uint64(0, 0); x339 = 0; _tuple$167 = p521AddcarryxU64(x101, x334, 0); x338 = _tuple$167[0]; x339 = _tuple$167[1]; x340 = new $Uint64(0, 0); _tuple$168 = p521AddcarryxU64(x102, x336, x339); x340 = _tuple$168[0]; x342 = new $Uint64(0, 0); x343 = 0; _tuple$169 = p521AddcarryxU64(x111, x338, 0); x342 = _tuple$169[0]; x343 = _tuple$169[1]; x344 = new $Uint64(0, 0); _tuple$170 = p521AddcarryxU64(x112, x340, x343); x344 = _tuple$170[0]; x346 = new $Uint64(0, 0); x347 = 0; _tuple$171 = p521AddcarryxU64(x123, x342, 0); x346 = _tuple$171[0]; x347 = _tuple$171[1]; x348 = new $Uint64(0, 0); _tuple$172 = p521AddcarryxU64(x124, x344, x347); x348 = _tuple$172[0]; x350 = new $Uint64(0, 0); x351 = 0; _tuple$173 = p521AddcarryxU64(x137, x346, 0); x350 = _tuple$173[0]; x351 = _tuple$173[1]; x352 = new $Uint64(0, 0); _tuple$174 = p521AddcarryxU64(x138, x348, x351); x352 = _tuple$174[0]; x354 = new $Uint64(0, 0); x355 = 0; _tuple$175 = p521AddcarryxU64(x153, x350, 0); x354 = _tuple$175[0]; x355 = _tuple$175[1]; x356 = new $Uint64(0, 0); _tuple$176 = p521AddcarryxU64(x154, x352, x355); x356 = _tuple$176[0]; x358 = new $Uint64(0, 0); x359 = 0; _tuple$177 = p521AddcarryxU64(x23, x9, 0); x358 = _tuple$177[0]; x359 = _tuple$177[1]; x360 = new $Uint64(0, 0); _tuple$178 = p521AddcarryxU64(x24, x10, x359); x360 = _tuple$178[0]; x362 = new $Uint64(0, 0); x363 = 0; _tuple$179 = p521AddcarryxU64(x35, x358, 0); x362 = _tuple$179[0]; x363 = _tuple$179[1]; x364 = new $Uint64(0, 0); _tuple$180 = p521AddcarryxU64(x36, x360, x363); x364 = _tuple$180[0]; x366 = new $Uint64(0, 0); x367 = 0; _tuple$181 = p521AddcarryxU64(x45, x362, 0); x366 = _tuple$181[0]; x367 = _tuple$181[1]; x368 = new $Uint64(0, 0); _tuple$182 = p521AddcarryxU64(x46, x364, x367); x368 = _tuple$182[0]; x370 = new $Uint64(0, 0); x371 = 0; _tuple$183 = p521AddcarryxU64(x53, x366, 0); x370 = _tuple$183[0]; x371 = _tuple$183[1]; x372 = new $Uint64(0, 0); _tuple$184 = p521AddcarryxU64(x54, x368, x371); x372 = _tuple$184[0]; x374 = new $Uint64(0, 0); x375 = 0; _tuple$185 = p521AddcarryxU64(x113, x370, 0); x374 = _tuple$185[0]; x375 = _tuple$185[1]; x376 = new $Uint64(0, 0); _tuple$186 = p521AddcarryxU64(x114, x372, x375); x376 = _tuple$186[0]; x378 = new $Uint64(0, 0); x379 = 0; _tuple$187 = p521AddcarryxU64(x125, x374, 0); x378 = _tuple$187[0]; x379 = _tuple$187[1]; x380 = new $Uint64(0, 0); _tuple$188 = p521AddcarryxU64(x126, x376, x379); x380 = _tuple$188[0]; x382 = new $Uint64(0, 0); x383 = 0; _tuple$189 = p521AddcarryxU64(x139, x378, 0); x382 = _tuple$189[0]; x383 = _tuple$189[1]; x384 = new $Uint64(0, 0); _tuple$190 = p521AddcarryxU64(x140, x380, x383); x384 = _tuple$190[0]; x386 = new $Uint64(0, 0); x387 = 0; _tuple$191 = p521AddcarryxU64(x155, x382, 0); x386 = _tuple$191[0]; x387 = _tuple$191[1]; x388 = new $Uint64(0, 0); _tuple$192 = p521AddcarryxU64(x156, x384, x387); x388 = _tuple$192[0]; x390 = new $Uint64(0, 0); x391 = 0; _tuple$193 = p521AddcarryxU64(x25, x11, 0); x390 = _tuple$193[0]; x391 = _tuple$193[1]; x392 = new $Uint64(0, 0); _tuple$194 = p521AddcarryxU64(x26, x12, x391); x392 = _tuple$194[0]; x394 = new $Uint64(0, 0); x395 = 0; _tuple$195 = p521AddcarryxU64(x37, x390, 0); x394 = _tuple$195[0]; x395 = _tuple$195[1]; x396 = new $Uint64(0, 0); _tuple$196 = p521AddcarryxU64(x38, x392, x395); x396 = _tuple$196[0]; x398 = new $Uint64(0, 0); x399 = 0; _tuple$197 = p521AddcarryxU64(x47, x394, 0); x398 = _tuple$197[0]; x399 = _tuple$197[1]; x400 = new $Uint64(0, 0); _tuple$198 = p521AddcarryxU64(x48, x396, x399); x400 = _tuple$198[0]; x402 = new $Uint64(0, 0); x403 = 0; _tuple$199 = p521AddcarryxU64(x55, x398, 0); x402 = _tuple$199[0]; x403 = _tuple$199[1]; x404 = new $Uint64(0, 0); _tuple$200 = p521AddcarryxU64(x56, x400, x403); x404 = _tuple$200[0]; x406 = new $Uint64(0, 0); x407 = 0; _tuple$201 = p521AddcarryxU64(x61, x402, 0); x406 = _tuple$201[0]; x407 = _tuple$201[1]; x408 = new $Uint64(0, 0); _tuple$202 = p521AddcarryxU64(x62, x404, x407); x408 = _tuple$202[0]; x410 = new $Uint64(0, 0); x411 = 0; _tuple$203 = p521AddcarryxU64(x127, x406, 0); x410 = _tuple$203[0]; x411 = _tuple$203[1]; x412 = new $Uint64(0, 0); _tuple$204 = p521AddcarryxU64(x128, x408, x411); x412 = _tuple$204[0]; x414 = new $Uint64(0, 0); x415 = 0; _tuple$205 = p521AddcarryxU64(x141, x410, 0); x414 = _tuple$205[0]; x415 = _tuple$205[1]; x416 = new $Uint64(0, 0); _tuple$206 = p521AddcarryxU64(x142, x412, x415); x416 = _tuple$206[0]; x418 = new $Uint64(0, 0); x419 = 0; _tuple$207 = p521AddcarryxU64(x157, x414, 0); x418 = _tuple$207[0]; x419 = _tuple$207[1]; x420 = new $Uint64(0, 0); _tuple$208 = p521AddcarryxU64(x158, x416, x419); x420 = _tuple$208[0]; x422 = new $Uint64(0, 0); x423 = 0; _tuple$209 = p521AddcarryxU64(x27, x13, 0); x422 = _tuple$209[0]; x423 = _tuple$209[1]; x424 = new $Uint64(0, 0); _tuple$210 = p521AddcarryxU64(x28, x14, x423); x424 = _tuple$210[0]; x426 = new $Uint64(0, 0); x427 = 0; _tuple$211 = p521AddcarryxU64(x39, x422, 0); x426 = _tuple$211[0]; x427 = _tuple$211[1]; x428 = new $Uint64(0, 0); _tuple$212 = p521AddcarryxU64(x40, x424, x427); x428 = _tuple$212[0]; x430 = new $Uint64(0, 0); x431 = 0; _tuple$213 = p521AddcarryxU64(x49, x426, 0); x430 = _tuple$213[0]; x431 = _tuple$213[1]; x432 = new $Uint64(0, 0); _tuple$214 = p521AddcarryxU64(x50, x428, x431); x432 = _tuple$214[0]; x434 = new $Uint64(0, 0); x435 = 0; _tuple$215 = p521AddcarryxU64(x57, x430, 0); x434 = _tuple$215[0]; x435 = _tuple$215[1]; x436 = new $Uint64(0, 0); _tuple$216 = p521AddcarryxU64(x58, x432, x435); x436 = _tuple$216[0]; x438 = new $Uint64(0, 0); x439 = 0; _tuple$217 = p521AddcarryxU64(x63, x434, 0); x438 = _tuple$217[0]; x439 = _tuple$217[1]; x440 = new $Uint64(0, 0); _tuple$218 = p521AddcarryxU64(x64, x436, x439); x440 = _tuple$218[0]; x442 = new $Uint64(0, 0); x443 = 0; _tuple$219 = p521AddcarryxU64(x67, x438, 0); x442 = _tuple$219[0]; x443 = _tuple$219[1]; x444 = new $Uint64(0, 0); _tuple$220 = p521AddcarryxU64(x68, x440, x443); x444 = _tuple$220[0]; x446 = new $Uint64(0, 0); x447 = 0; _tuple$221 = p521AddcarryxU64(x143, x442, 0); x446 = _tuple$221[0]; x447 = _tuple$221[1]; x448 = new $Uint64(0, 0); _tuple$222 = p521AddcarryxU64(x144, x444, x447); x448 = _tuple$222[0]; x450 = new $Uint64(0, 0); x451 = 0; _tuple$223 = p521AddcarryxU64(x159, x446, 0); x450 = _tuple$223[0]; x451 = _tuple$223[1]; x452 = new $Uint64(0, 0); _tuple$224 = p521AddcarryxU64(x160, x448, x451); x452 = _tuple$224[0]; x454 = new $Uint64(0, 0); x455 = 0; _tuple$225 = p521AddcarryxU64(x195, x450, 0); x454 = _tuple$225[0]; x455 = _tuple$225[1]; x456 = new $Uint64(0, 0); _tuple$226 = p521AddcarryxU64(x196, x452, x455); x456 = _tuple$226[0]; x458 = (x$3 = $shiftRightUint64(x454, 58), x$4 = (x$5 = $shiftLeft64(x456, 6), new $Uint64(x$5.$high & 4294967295, (x$5.$low & 4294967295) >>> 0)), new $Uint64(x$3.$high | x$4.$high, (x$3.$low | x$4.$low) >>> 0)); x459 = $shiftRightUint64(x456, 58); x460 = new $Uint64(x454.$high & 67108863, (x454.$low & 4294967295) >>> 0); x461 = new $Uint64(0, 0); x462 = 0; _tuple$227 = p521AddcarryxU64(x458, x418, 0); x461 = _tuple$227[0]; x462 = _tuple$227[1]; x463 = new $Uint64(0, 0); _tuple$228 = p521AddcarryxU64(x459, x420, x462); x463 = _tuple$228[0]; x465 = (x$6 = $shiftRightUint64(x461, 58), x$7 = (x$8 = $shiftLeft64(x463, 6), new $Uint64(x$8.$high & 4294967295, (x$8.$low & 4294967295) >>> 0)), new $Uint64(x$6.$high | x$7.$high, (x$6.$low | x$7.$low) >>> 0)); x466 = $shiftRightUint64(x463, 58); x467 = new $Uint64(x461.$high & 67108863, (x461.$low & 4294967295) >>> 0); x468 = new $Uint64(0, 0); x469 = 0; _tuple$229 = p521AddcarryxU64(x465, x386, 0); x468 = _tuple$229[0]; x469 = _tuple$229[1]; x470 = new $Uint64(0, 0); _tuple$230 = p521AddcarryxU64(x466, x388, x469); x470 = _tuple$230[0]; x472 = (x$9 = $shiftRightUint64(x468, 58), x$10 = (x$11 = $shiftLeft64(x470, 6), new $Uint64(x$11.$high & 4294967295, (x$11.$low & 4294967295) >>> 0)), new $Uint64(x$9.$high | x$10.$high, (x$9.$low | x$10.$low) >>> 0)); x473 = $shiftRightUint64(x470, 58); x474 = new $Uint64(x468.$high & 67108863, (x468.$low & 4294967295) >>> 0); x475 = new $Uint64(0, 0); x476 = 0; _tuple$231 = p521AddcarryxU64(x472, x354, 0); x475 = _tuple$231[0]; x476 = _tuple$231[1]; x477 = new $Uint64(0, 0); _tuple$232 = p521AddcarryxU64(x473, x356, x476); x477 = _tuple$232[0]; x479 = (x$12 = $shiftRightUint64(x475, 58), x$13 = (x$14 = $shiftLeft64(x477, 6), new $Uint64(x$14.$high & 4294967295, (x$14.$low & 4294967295) >>> 0)), new $Uint64(x$12.$high | x$13.$high, (x$12.$low | x$13.$low) >>> 0)); x480 = $shiftRightUint64(x477, 58); x481 = new $Uint64(x475.$high & 67108863, (x475.$low & 4294967295) >>> 0); x482 = new $Uint64(0, 0); x483 = 0; _tuple$233 = p521AddcarryxU64(x479, x322, 0); x482 = _tuple$233[0]; x483 = _tuple$233[1]; x484 = new $Uint64(0, 0); _tuple$234 = p521AddcarryxU64(x480, x324, x483); x484 = _tuple$234[0]; x486 = (x$15 = $shiftRightUint64(x482, 58), x$16 = (x$17 = $shiftLeft64(x484, 6), new $Uint64(x$17.$high & 4294967295, (x$17.$low & 4294967295) >>> 0)), new $Uint64(x$15.$high | x$16.$high, (x$15.$low | x$16.$low) >>> 0)); x487 = $shiftRightUint64(x484, 58); x488 = new $Uint64(x482.$high & 67108863, (x482.$low & 4294967295) >>> 0); x489 = new $Uint64(0, 0); x490 = 0; _tuple$235 = p521AddcarryxU64(x486, x290, 0); x489 = _tuple$235[0]; x490 = _tuple$235[1]; x491 = new $Uint64(0, 0); _tuple$236 = p521AddcarryxU64(x487, x292, x490); x491 = _tuple$236[0]; x493 = (x$18 = $shiftRightUint64(x489, 58), x$19 = (x$20 = $shiftLeft64(x491, 6), new $Uint64(x$20.$high & 4294967295, (x$20.$low & 4294967295) >>> 0)), new $Uint64(x$18.$high | x$19.$high, (x$18.$low | x$19.$low) >>> 0)); x494 = $shiftRightUint64(x491, 58); x495 = new $Uint64(x489.$high & 67108863, (x489.$low & 4294967295) >>> 0); x496 = new $Uint64(0, 0); x497 = 0; _tuple$237 = p521AddcarryxU64(x493, x258, 0); x496 = _tuple$237[0]; x497 = _tuple$237[1]; x498 = new $Uint64(0, 0); _tuple$238 = p521AddcarryxU64(x494, x260, x497); x498 = _tuple$238[0]; x500 = (x$21 = $shiftRightUint64(x496, 58), x$22 = (x$23 = $shiftLeft64(x498, 6), new $Uint64(x$23.$high & 4294967295, (x$23.$low & 4294967295) >>> 0)), new $Uint64(x$21.$high | x$22.$high, (x$21.$low | x$22.$low) >>> 0)); x501 = $shiftRightUint64(x498, 58); x502 = new $Uint64(x496.$high & 67108863, (x496.$low & 4294967295) >>> 0); x503 = new $Uint64(0, 0); x504 = 0; _tuple$239 = p521AddcarryxU64(x500, x226, 0); x503 = _tuple$239[0]; x504 = _tuple$239[1]; x505 = new $Uint64(0, 0); _tuple$240 = p521AddcarryxU64(x501, x228, x504); x505 = _tuple$240[0]; x507 = (x$24 = $shiftRightUint64(x503, 57), x$25 = (x$26 = $shiftLeft64(x505, 7), new $Uint64(x$26.$high & 4294967295, (x$26.$low & 4294967295) >>> 0)), new $Uint64(x$24.$high | x$25.$high, (x$24.$low | x$25.$low) >>> 0)); x508 = $shiftRightUint64(x505, 57); x509 = new $Uint64(x503.$high & 33554431, (x503.$low & 4294967295) >>> 0); x510 = new $Uint64(0, 0); x511 = 0; _tuple$241 = p521AddcarryxU64(x197, x507, 0); x510 = _tuple$241[0]; x511 = _tuple$241[1]; x512 = (x$27 = (new $Uint64(0, x511)), new $Uint64(x$27.$high + x508.$high, x$27.$low + x508.$low)); x513 = (x$28 = $shiftRightUint64(x510, 58), x$29 = (x$30 = $shiftLeft64(x512, 6), new $Uint64(x$30.$high & 4294967295, (x$30.$low & 4294967295) >>> 0)), new $Uint64(x$28.$high | x$29.$high, (x$28.$low | x$29.$low) >>> 0)); x514 = new $Uint64(x510.$high & 67108863, (x510.$low & 4294967295) >>> 0); x515 = new $Uint64(x513.$high + x460.$high, x513.$low + x460.$low); x516 = ((($shiftRightUint64(x515, 58)).$low << 24 >>> 24)); x517 = new $Uint64(x515.$high & 67108863, (x515.$low & 4294967295) >>> 0); x518 = (x$31 = (new $Uint64(0, x516)), new $Uint64(x$31.$high + x467.$high, x$31.$low + x467.$low)); out1.nilCheck, out1[0] = x514; out1.nilCheck, out1[1] = x517; out1.nilCheck, out1[2] = x518; out1.nilCheck, out1[3] = x474; out1.nilCheck, out1[4] = x481; out1.nilCheck, out1[5] = x488; out1.nilCheck, out1[6] = x495; out1.nilCheck, out1[7] = x502; out1.nilCheck, out1[8] = x509; }; p521CarrySquare = function(out1, arg1) { var _tuple, _tuple$1, _tuple$10, _tuple$100, _tuple$101, _tuple$102, _tuple$103, _tuple$104, _tuple$105, _tuple$106, _tuple$107, _tuple$108, _tuple$109, _tuple$11, _tuple$110, _tuple$111, _tuple$112, _tuple$113, _tuple$114, _tuple$115, _tuple$116, _tuple$117, _tuple$118, _tuple$119, _tuple$12, _tuple$120, _tuple$121, _tuple$122, _tuple$123, _tuple$124, _tuple$125, _tuple$126, _tuple$127, _tuple$128, _tuple$129, _tuple$13, _tuple$130, _tuple$131, _tuple$132, _tuple$133, _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$26, _tuple$27, _tuple$28, _tuple$29, _tuple$3, _tuple$30, _tuple$31, _tuple$32, _tuple$33, _tuple$34, _tuple$35, _tuple$36, _tuple$37, _tuple$38, _tuple$39, _tuple$4, _tuple$40, _tuple$41, _tuple$42, _tuple$43, _tuple$44, _tuple$45, _tuple$46, _tuple$47, _tuple$48, _tuple$49, _tuple$5, _tuple$50, _tuple$51, _tuple$52, _tuple$53, _tuple$54, _tuple$55, _tuple$56, _tuple$57, _tuple$58, _tuple$59, _tuple$6, _tuple$60, _tuple$61, _tuple$62, _tuple$63, _tuple$64, _tuple$65, _tuple$66, _tuple$67, _tuple$68, _tuple$69, _tuple$7, _tuple$70, _tuple$71, _tuple$72, _tuple$73, _tuple$74, _tuple$75, _tuple$76, _tuple$77, _tuple$78, _tuple$79, _tuple$8, _tuple$80, _tuple$81, _tuple$82, _tuple$83, _tuple$84, _tuple$85, _tuple$86, _tuple$87, _tuple$88, _tuple$89, _tuple$9, _tuple$90, _tuple$91, _tuple$92, _tuple$93, _tuple$94, _tuple$95, _tuple$96, _tuple$97, _tuple$98, _tuple$99, arg1, out1, 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$29, x$3, x$30, x$31, x$4, x$5, x$6, x$7, x$8, x$9, x1, x10, x100, x101, x102, x103, x104, x105, x106, x107, x108, x109, x11, x111, x112, x113, x115, x116, x117, x119, x12, x120, x121, x123, x124, x125, x126, x127, x128, x13, x130, x131, x132, x134, x135, x136, x138, x139, x14, x140, x142, x143, x144, x146, x147, x148, x15, x150, x151, x152, x154, x155, x156, x158, x159, x16, x160, x162, x163, x164, x166, x167, x168, x17, x170, x171, x172, x174, x175, x176, x178, x179, x18, x180, x182, x183, x184, x186, x187, x188, x19, x190, x191, x192, x194, x195, x196, x198, x199, x2, x20, x200, x202, x203, x204, x206, x207, x208, x21, x210, x211, x212, x214, x215, x216, x218, x219, x22, x220, x222, x223, x224, x226, x227, x228, x23, x230, x231, x232, x234, x235, x236, x238, x239, x24, x240, x242, x243, x244, x246, x247, x248, x25, x250, x251, x252, x254, x255, x256, x258, x259, x26, x260, x261, x262, x263, x265, x266, x267, x268, x269, x27, x270, x272, x273, x274, x275, x276, x277, x279, x28, x280, x281, x282, x283, x284, x286, x287, x288, x289, x29, x290, x291, x293, x294, x295, x296, x297, x298, x3, x30, x300, x301, x302, x303, x304, x305, x307, x308, x309, x31, x310, x311, x312, x313, x314, x315, x316, x317, x318, x32, x33, x34, x35, x36, x37, x38, x39, x4, x40, x41, x42, x43, x44, x45, x46, x47, x48, x49, x5, x50, x51, x52, x53, x54, x55, x56, x57, x58, x59, x6, x60, x61, x62, x63, x64, x65, x66, x67, x68, x69, x7, x70, x71, x72, x73, x74, x75, x76, x77, x78, x79, x8, x80, x81, x82, x83, x84, x85, x86, x87, x88, x89, x9, x90, x91, x92, x93, x94, x95, x96, x97, x98, x99; x1 = arg1[8]; x2 = $mul64(x1, new $Uint64(0, 2)); x3 = $mul64(arg1[8], new $Uint64(0, 2)); x4 = arg1[7]; x5 = $mul64(x4, new $Uint64(0, 2)); x6 = $mul64(arg1[7], new $Uint64(0, 2)); x7 = arg1[6]; x8 = $mul64(x7, new $Uint64(0, 2)); x9 = $mul64(arg1[6], new $Uint64(0, 2)); x10 = arg1[5]; x11 = $mul64(x10, new $Uint64(0, 2)); x12 = $mul64(arg1[5], new $Uint64(0, 2)); x13 = $mul64(arg1[4], new $Uint64(0, 2)); x14 = $mul64(arg1[3], new $Uint64(0, 2)); x15 = $mul64(arg1[2], new $Uint64(0, 2)); x16 = $mul64(arg1[1], new $Uint64(0, 2)); x17 = new $Uint64(0, 0); x18 = new $Uint64(0, 0); _tuple = bits.Mul64(arg1[8], $mul64(x1, new $Uint64(0, 2))); x18 = _tuple[0]; x17 = _tuple[1]; x19 = new $Uint64(0, 0); x20 = new $Uint64(0, 0); _tuple$1 = bits.Mul64(arg1[7], $mul64(x2, new $Uint64(0, 2))); x20 = _tuple$1[0]; x19 = _tuple$1[1]; x21 = new $Uint64(0, 0); x22 = new $Uint64(0, 0); _tuple$2 = bits.Mul64(arg1[7], $mul64(x4, new $Uint64(0, 2))); x22 = _tuple$2[0]; x21 = _tuple$2[1]; x23 = new $Uint64(0, 0); x24 = new $Uint64(0, 0); _tuple$3 = bits.Mul64(arg1[6], $mul64(x2, new $Uint64(0, 2))); x24 = _tuple$3[0]; x23 = _tuple$3[1]; x25 = new $Uint64(0, 0); x26 = new $Uint64(0, 0); _tuple$4 = bits.Mul64(arg1[6], $mul64(x5, new $Uint64(0, 2))); x26 = _tuple$4[0]; x25 = _tuple$4[1]; x27 = new $Uint64(0, 0); x28 = new $Uint64(0, 0); _tuple$5 = bits.Mul64(arg1[6], $mul64(x7, new $Uint64(0, 2))); x28 = _tuple$5[0]; x27 = _tuple$5[1]; x29 = new $Uint64(0, 0); x30 = new $Uint64(0, 0); _tuple$6 = bits.Mul64(arg1[5], $mul64(x2, new $Uint64(0, 2))); x30 = _tuple$6[0]; x29 = _tuple$6[1]; x31 = new $Uint64(0, 0); x32 = new $Uint64(0, 0); _tuple$7 = bits.Mul64(arg1[5], $mul64(x5, new $Uint64(0, 2))); x32 = _tuple$7[0]; x31 = _tuple$7[1]; x33 = new $Uint64(0, 0); x34 = new $Uint64(0, 0); _tuple$8 = bits.Mul64(arg1[5], $mul64(x8, new $Uint64(0, 2))); x34 = _tuple$8[0]; x33 = _tuple$8[1]; x35 = new $Uint64(0, 0); x36 = new $Uint64(0, 0); _tuple$9 = bits.Mul64(arg1[5], $mul64(x10, new $Uint64(0, 2))); x36 = _tuple$9[0]; x35 = _tuple$9[1]; x37 = new $Uint64(0, 0); x38 = new $Uint64(0, 0); _tuple$10 = bits.Mul64(arg1[4], $mul64(x2, new $Uint64(0, 2))); x38 = _tuple$10[0]; x37 = _tuple$10[1]; x39 = new $Uint64(0, 0); x40 = new $Uint64(0, 0); _tuple$11 = bits.Mul64(arg1[4], $mul64(x5, new $Uint64(0, 2))); x40 = _tuple$11[0]; x39 = _tuple$11[1]; x41 = new $Uint64(0, 0); x42 = new $Uint64(0, 0); _tuple$12 = bits.Mul64(arg1[4], $mul64(x8, new $Uint64(0, 2))); x42 = _tuple$12[0]; x41 = _tuple$12[1]; x43 = new $Uint64(0, 0); x44 = new $Uint64(0, 0); _tuple$13 = bits.Mul64(arg1[4], $mul64(x11, new $Uint64(0, 2))); x44 = _tuple$13[0]; x43 = _tuple$13[1]; x45 = new $Uint64(0, 0); x46 = new $Uint64(0, 0); _tuple$14 = bits.Mul64(arg1[4], arg1[4]); x46 = _tuple$14[0]; x45 = _tuple$14[1]; x47 = new $Uint64(0, 0); x48 = new $Uint64(0, 0); _tuple$15 = bits.Mul64(arg1[3], $mul64(x2, new $Uint64(0, 2))); x48 = _tuple$15[0]; x47 = _tuple$15[1]; x49 = new $Uint64(0, 0); x50 = new $Uint64(0, 0); _tuple$16 = bits.Mul64(arg1[3], $mul64(x5, new $Uint64(0, 2))); x50 = _tuple$16[0]; x49 = _tuple$16[1]; x51 = new $Uint64(0, 0); x52 = new $Uint64(0, 0); _tuple$17 = bits.Mul64(arg1[3], $mul64(x8, new $Uint64(0, 2))); x52 = _tuple$17[0]; x51 = _tuple$17[1]; x53 = new $Uint64(0, 0); x54 = new $Uint64(0, 0); _tuple$18 = bits.Mul64(arg1[3], x12); x54 = _tuple$18[0]; x53 = _tuple$18[1]; x55 = new $Uint64(0, 0); x56 = new $Uint64(0, 0); _tuple$19 = bits.Mul64(arg1[3], x13); x56 = _tuple$19[0]; x55 = _tuple$19[1]; x57 = new $Uint64(0, 0); x58 = new $Uint64(0, 0); _tuple$20 = bits.Mul64(arg1[3], arg1[3]); x58 = _tuple$20[0]; x57 = _tuple$20[1]; x59 = new $Uint64(0, 0); x60 = new $Uint64(0, 0); _tuple$21 = bits.Mul64(arg1[2], $mul64(x2, new $Uint64(0, 2))); x60 = _tuple$21[0]; x59 = _tuple$21[1]; x61 = new $Uint64(0, 0); x62 = new $Uint64(0, 0); _tuple$22 = bits.Mul64(arg1[2], $mul64(x5, new $Uint64(0, 2))); x62 = _tuple$22[0]; x61 = _tuple$22[1]; x63 = new $Uint64(0, 0); x64 = new $Uint64(0, 0); _tuple$23 = bits.Mul64(arg1[2], x9); x64 = _tuple$23[0]; x63 = _tuple$23[1]; x65 = new $Uint64(0, 0); x66 = new $Uint64(0, 0); _tuple$24 = bits.Mul64(arg1[2], x12); x66 = _tuple$24[0]; x65 = _tuple$24[1]; x67 = new $Uint64(0, 0); x68 = new $Uint64(0, 0); _tuple$25 = bits.Mul64(arg1[2], x13); x68 = _tuple$25[0]; x67 = _tuple$25[1]; x69 = new $Uint64(0, 0); x70 = new $Uint64(0, 0); _tuple$26 = bits.Mul64(arg1[2], x14); x70 = _tuple$26[0]; x69 = _tuple$26[1]; x71 = new $Uint64(0, 0); x72 = new $Uint64(0, 0); _tuple$27 = bits.Mul64(arg1[2], arg1[2]); x72 = _tuple$27[0]; x71 = _tuple$27[1]; x73 = new $Uint64(0, 0); x74 = new $Uint64(0, 0); _tuple$28 = bits.Mul64(arg1[1], $mul64(x2, new $Uint64(0, 2))); x74 = _tuple$28[0]; x73 = _tuple$28[1]; x75 = new $Uint64(0, 0); x76 = new $Uint64(0, 0); _tuple$29 = bits.Mul64(arg1[1], x6); x76 = _tuple$29[0]; x75 = _tuple$29[1]; x77 = new $Uint64(0, 0); x78 = new $Uint64(0, 0); _tuple$30 = bits.Mul64(arg1[1], x9); x78 = _tuple$30[0]; x77 = _tuple$30[1]; x79 = new $Uint64(0, 0); x80 = new $Uint64(0, 0); _tuple$31 = bits.Mul64(arg1[1], x12); x80 = _tuple$31[0]; x79 = _tuple$31[1]; x81 = new $Uint64(0, 0); x82 = new $Uint64(0, 0); _tuple$32 = bits.Mul64(arg1[1], x13); x82 = _tuple$32[0]; x81 = _tuple$32[1]; x83 = new $Uint64(0, 0); x84 = new $Uint64(0, 0); _tuple$33 = bits.Mul64(arg1[1], x14); x84 = _tuple$33[0]; x83 = _tuple$33[1]; x85 = new $Uint64(0, 0); x86 = new $Uint64(0, 0); _tuple$34 = bits.Mul64(arg1[1], x15); x86 = _tuple$34[0]; x85 = _tuple$34[1]; x87 = new $Uint64(0, 0); x88 = new $Uint64(0, 0); _tuple$35 = bits.Mul64(arg1[1], arg1[1]); x88 = _tuple$35[0]; x87 = _tuple$35[1]; x89 = new $Uint64(0, 0); x90 = new $Uint64(0, 0); _tuple$36 = bits.Mul64(arg1[0], x3); x90 = _tuple$36[0]; x89 = _tuple$36[1]; x91 = new $Uint64(0, 0); x92 = new $Uint64(0, 0); _tuple$37 = bits.Mul64(arg1[0], x6); x92 = _tuple$37[0]; x91 = _tuple$37[1]; x93 = new $Uint64(0, 0); x94 = new $Uint64(0, 0); _tuple$38 = bits.Mul64(arg1[0], x9); x94 = _tuple$38[0]; x93 = _tuple$38[1]; x95 = new $Uint64(0, 0); x96 = new $Uint64(0, 0); _tuple$39 = bits.Mul64(arg1[0], x12); x96 = _tuple$39[0]; x95 = _tuple$39[1]; x97 = new $Uint64(0, 0); x98 = new $Uint64(0, 0); _tuple$40 = bits.Mul64(arg1[0], x13); x98 = _tuple$40[0]; x97 = _tuple$40[1]; x99 = new $Uint64(0, 0); x100 = new $Uint64(0, 0); _tuple$41 = bits.Mul64(arg1[0], x14); x100 = _tuple$41[0]; x99 = _tuple$41[1]; x101 = new $Uint64(0, 0); x102 = new $Uint64(0, 0); _tuple$42 = bits.Mul64(arg1[0], x15); x102 = _tuple$42[0]; x101 = _tuple$42[1]; x103 = new $Uint64(0, 0); x104 = new $Uint64(0, 0); _tuple$43 = bits.Mul64(arg1[0], x16); x104 = _tuple$43[0]; x103 = _tuple$43[1]; x105 = new $Uint64(0, 0); x106 = new $Uint64(0, 0); _tuple$44 = bits.Mul64(arg1[0], arg1[0]); x106 = _tuple$44[0]; x105 = _tuple$44[1]; x107 = new $Uint64(0, 0); x108 = 0; _tuple$45 = p521AddcarryxU64(x51, x43, 0); x107 = _tuple$45[0]; x108 = _tuple$45[1]; x109 = new $Uint64(0, 0); _tuple$46 = p521AddcarryxU64(x52, x44, x108); x109 = _tuple$46[0]; x111 = new $Uint64(0, 0); x112 = 0; _tuple$47 = p521AddcarryxU64(x61, x107, 0); x111 = _tuple$47[0]; x112 = _tuple$47[1]; x113 = new $Uint64(0, 0); _tuple$48 = p521AddcarryxU64(x62, x109, x112); x113 = _tuple$48[0]; x115 = new $Uint64(0, 0); x116 = 0; _tuple$49 = p521AddcarryxU64(x73, x111, 0); x115 = _tuple$49[0]; x116 = _tuple$49[1]; x117 = new $Uint64(0, 0); _tuple$50 = p521AddcarryxU64(x74, x113, x116); x117 = _tuple$50[0]; x119 = new $Uint64(0, 0); x120 = 0; _tuple$51 = p521AddcarryxU64(x105, x115, 0); x119 = _tuple$51[0]; x120 = _tuple$51[1]; x121 = new $Uint64(0, 0); _tuple$52 = p521AddcarryxU64(x106, x117, x120); x121 = _tuple$52[0]; x123 = (x = $shiftRightUint64(x119, 58), x$1 = (x$2 = $shiftLeft64(x121, 6), new $Uint64(x$2.$high & 4294967295, (x$2.$low & 4294967295) >>> 0)), new $Uint64(x.$high | x$1.$high, (x.$low | x$1.$low) >>> 0)); x124 = $shiftRightUint64(x121, 58); x125 = new $Uint64(x119.$high & 67108863, (x119.$low & 4294967295) >>> 0); x126 = new $Uint64(0, 0); x127 = 0; _tuple$53 = p521AddcarryxU64(x53, x45, 0); x126 = _tuple$53[0]; x127 = _tuple$53[1]; x128 = new $Uint64(0, 0); _tuple$54 = p521AddcarryxU64(x54, x46, x127); x128 = _tuple$54[0]; x130 = new $Uint64(0, 0); x131 = 0; _tuple$55 = p521AddcarryxU64(x63, x126, 0); x130 = _tuple$55[0]; x131 = _tuple$55[1]; x132 = new $Uint64(0, 0); _tuple$56 = p521AddcarryxU64(x64, x128, x131); x132 = _tuple$56[0]; x134 = new $Uint64(0, 0); x135 = 0; _tuple$57 = p521AddcarryxU64(x75, x130, 0); x134 = _tuple$57[0]; x135 = _tuple$57[1]; x136 = new $Uint64(0, 0); _tuple$58 = p521AddcarryxU64(x76, x132, x135); x136 = _tuple$58[0]; x138 = new $Uint64(0, 0); x139 = 0; _tuple$59 = p521AddcarryxU64(x89, x134, 0); x138 = _tuple$59[0]; x139 = _tuple$59[1]; x140 = new $Uint64(0, 0); _tuple$60 = p521AddcarryxU64(x90, x136, x139); x140 = _tuple$60[0]; x142 = new $Uint64(0, 0); x143 = 0; _tuple$61 = p521AddcarryxU64(x55, x17, 0); x142 = _tuple$61[0]; x143 = _tuple$61[1]; x144 = new $Uint64(0, 0); _tuple$62 = p521AddcarryxU64(x56, x18, x143); x144 = _tuple$62[0]; x146 = new $Uint64(0, 0); x147 = 0; _tuple$63 = p521AddcarryxU64(x65, x142, 0); x146 = _tuple$63[0]; x147 = _tuple$63[1]; x148 = new $Uint64(0, 0); _tuple$64 = p521AddcarryxU64(x66, x144, x147); x148 = _tuple$64[0]; x150 = new $Uint64(0, 0); x151 = 0; _tuple$65 = p521AddcarryxU64(x77, x146, 0); x150 = _tuple$65[0]; x151 = _tuple$65[1]; x152 = new $Uint64(0, 0); _tuple$66 = p521AddcarryxU64(x78, x148, x151); x152 = _tuple$66[0]; x154 = new $Uint64(0, 0); x155 = 0; _tuple$67 = p521AddcarryxU64(x91, x150, 0); x154 = _tuple$67[0]; x155 = _tuple$67[1]; x156 = new $Uint64(0, 0); _tuple$68 = p521AddcarryxU64(x92, x152, x155); x156 = _tuple$68[0]; x158 = new $Uint64(0, 0); x159 = 0; _tuple$69 = p521AddcarryxU64(x57, x19, 0); x158 = _tuple$69[0]; x159 = _tuple$69[1]; x160 = new $Uint64(0, 0); _tuple$70 = p521AddcarryxU64(x58, x20, x159); x160 = _tuple$70[0]; x162 = new $Uint64(0, 0); x163 = 0; _tuple$71 = p521AddcarryxU64(x67, x158, 0); x162 = _tuple$71[0]; x163 = _tuple$71[1]; x164 = new $Uint64(0, 0); _tuple$72 = p521AddcarryxU64(x68, x160, x163); x164 = _tuple$72[0]; x166 = new $Uint64(0, 0); x167 = 0; _tuple$73 = p521AddcarryxU64(x79, x162, 0); x166 = _tuple$73[0]; x167 = _tuple$73[1]; x168 = new $Uint64(0, 0); _tuple$74 = p521AddcarryxU64(x80, x164, x167); x168 = _tuple$74[0]; x170 = new $Uint64(0, 0); x171 = 0; _tuple$75 = p521AddcarryxU64(x93, x166, 0); x170 = _tuple$75[0]; x171 = _tuple$75[1]; x172 = new $Uint64(0, 0); _tuple$76 = p521AddcarryxU64(x94, x168, x171); x172 = _tuple$76[0]; x174 = new $Uint64(0, 0); x175 = 0; _tuple$77 = p521AddcarryxU64(x23, x21, 0); x174 = _tuple$77[0]; x175 = _tuple$77[1]; x176 = new $Uint64(0, 0); _tuple$78 = p521AddcarryxU64(x24, x22, x175); x176 = _tuple$78[0]; x178 = new $Uint64(0, 0); x179 = 0; _tuple$79 = p521AddcarryxU64(x69, x174, 0); x178 = _tuple$79[0]; x179 = _tuple$79[1]; x180 = new $Uint64(0, 0); _tuple$80 = p521AddcarryxU64(x70, x176, x179); x180 = _tuple$80[0]; x182 = new $Uint64(0, 0); x183 = 0; _tuple$81 = p521AddcarryxU64(x81, x178, 0); x182 = _tuple$81[0]; x183 = _tuple$81[1]; x184 = new $Uint64(0, 0); _tuple$82 = p521AddcarryxU64(x82, x180, x183); x184 = _tuple$82[0]; x186 = new $Uint64(0, 0); x187 = 0; _tuple$83 = p521AddcarryxU64(x95, x182, 0); x186 = _tuple$83[0]; x187 = _tuple$83[1]; x188 = new $Uint64(0, 0); _tuple$84 = p521AddcarryxU64(x96, x184, x187); x188 = _tuple$84[0]; x190 = new $Uint64(0, 0); x191 = 0; _tuple$85 = p521AddcarryxU64(x29, x25, 0); x190 = _tuple$85[0]; x191 = _tuple$85[1]; x192 = new $Uint64(0, 0); _tuple$86 = p521AddcarryxU64(x30, x26, x191); x192 = _tuple$86[0]; x194 = new $Uint64(0, 0); x195 = 0; _tuple$87 = p521AddcarryxU64(x71, x190, 0); x194 = _tuple$87[0]; x195 = _tuple$87[1]; x196 = new $Uint64(0, 0); _tuple$88 = p521AddcarryxU64(x72, x192, x195); x196 = _tuple$88[0]; x198 = new $Uint64(0, 0); x199 = 0; _tuple$89 = p521AddcarryxU64(x83, x194, 0); x198 = _tuple$89[0]; x199 = _tuple$89[1]; x200 = new $Uint64(0, 0); _tuple$90 = p521AddcarryxU64(x84, x196, x199); x200 = _tuple$90[0]; x202 = new $Uint64(0, 0); x203 = 0; _tuple$91 = p521AddcarryxU64(x97, x198, 0); x202 = _tuple$91[0]; x203 = _tuple$91[1]; x204 = new $Uint64(0, 0); _tuple$92 = p521AddcarryxU64(x98, x200, x203); x204 = _tuple$92[0]; x206 = new $Uint64(0, 0); x207 = 0; _tuple$93 = p521AddcarryxU64(x31, x27, 0); x206 = _tuple$93[0]; x207 = _tuple$93[1]; x208 = new $Uint64(0, 0); _tuple$94 = p521AddcarryxU64(x32, x28, x207); x208 = _tuple$94[0]; x210 = new $Uint64(0, 0); x211 = 0; _tuple$95 = p521AddcarryxU64(x37, x206, 0); x210 = _tuple$95[0]; x211 = _tuple$95[1]; x212 = new $Uint64(0, 0); _tuple$96 = p521AddcarryxU64(x38, x208, x211); x212 = _tuple$96[0]; x214 = new $Uint64(0, 0); x215 = 0; _tuple$97 = p521AddcarryxU64(x85, x210, 0); x214 = _tuple$97[0]; x215 = _tuple$97[1]; x216 = new $Uint64(0, 0); _tuple$98 = p521AddcarryxU64(x86, x212, x215); x216 = _tuple$98[0]; x218 = new $Uint64(0, 0); x219 = 0; _tuple$99 = p521AddcarryxU64(x99, x214, 0); x218 = _tuple$99[0]; x219 = _tuple$99[1]; x220 = new $Uint64(0, 0); _tuple$100 = p521AddcarryxU64(x100, x216, x219); x220 = _tuple$100[0]; x222 = new $Uint64(0, 0); x223 = 0; _tuple$101 = p521AddcarryxU64(x39, x33, 0); x222 = _tuple$101[0]; x223 = _tuple$101[1]; x224 = new $Uint64(0, 0); _tuple$102 = p521AddcarryxU64(x40, x34, x223); x224 = _tuple$102[0]; x226 = new $Uint64(0, 0); x227 = 0; _tuple$103 = p521AddcarryxU64(x47, x222, 0); x226 = _tuple$103[0]; x227 = _tuple$103[1]; x228 = new $Uint64(0, 0); _tuple$104 = p521AddcarryxU64(x48, x224, x227); x228 = _tuple$104[0]; x230 = new $Uint64(0, 0); x231 = 0; _tuple$105 = p521AddcarryxU64(x87, x226, 0); x230 = _tuple$105[0]; x231 = _tuple$105[1]; x232 = new $Uint64(0, 0); _tuple$106 = p521AddcarryxU64(x88, x228, x231); x232 = _tuple$106[0]; x234 = new $Uint64(0, 0); x235 = 0; _tuple$107 = p521AddcarryxU64(x101, x230, 0); x234 = _tuple$107[0]; x235 = _tuple$107[1]; x236 = new $Uint64(0, 0); _tuple$108 = p521AddcarryxU64(x102, x232, x235); x236 = _tuple$108[0]; x238 = new $Uint64(0, 0); x239 = 0; _tuple$109 = p521AddcarryxU64(x41, x35, 0); x238 = _tuple$109[0]; x239 = _tuple$109[1]; x240 = new $Uint64(0, 0); _tuple$110 = p521AddcarryxU64(x42, x36, x239); x240 = _tuple$110[0]; x242 = new $Uint64(0, 0); x243 = 0; _tuple$111 = p521AddcarryxU64(x49, x238, 0); x242 = _tuple$111[0]; x243 = _tuple$111[1]; x244 = new $Uint64(0, 0); _tuple$112 = p521AddcarryxU64(x50, x240, x243); x244 = _tuple$112[0]; x246 = new $Uint64(0, 0); x247 = 0; _tuple$113 = p521AddcarryxU64(x59, x242, 0); x246 = _tuple$113[0]; x247 = _tuple$113[1]; x248 = new $Uint64(0, 0); _tuple$114 = p521AddcarryxU64(x60, x244, x247); x248 = _tuple$114[0]; x250 = new $Uint64(0, 0); x251 = 0; _tuple$115 = p521AddcarryxU64(x103, x246, 0); x250 = _tuple$115[0]; x251 = _tuple$115[1]; x252 = new $Uint64(0, 0); _tuple$116 = p521AddcarryxU64(x104, x248, x251); x252 = _tuple$116[0]; x254 = new $Uint64(0, 0); x255 = 0; _tuple$117 = p521AddcarryxU64(x123, x250, 0); x254 = _tuple$117[0]; x255 = _tuple$117[1]; x256 = new $Uint64(0, 0); _tuple$118 = p521AddcarryxU64(x124, x252, x255); x256 = _tuple$118[0]; x258 = (x$3 = $shiftRightUint64(x254, 58), x$4 = (x$5 = $shiftLeft64(x256, 6), new $Uint64(x$5.$high & 4294967295, (x$5.$low & 4294967295) >>> 0)), new $Uint64(x$3.$high | x$4.$high, (x$3.$low | x$4.$low) >>> 0)); x259 = $shiftRightUint64(x256, 58); x260 = new $Uint64(x254.$high & 67108863, (x254.$low & 4294967295) >>> 0); x261 = new $Uint64(0, 0); x262 = 0; _tuple$119 = p521AddcarryxU64(x258, x234, 0); x261 = _tuple$119[0]; x262 = _tuple$119[1]; x263 = new $Uint64(0, 0); _tuple$120 = p521AddcarryxU64(x259, x236, x262); x263 = _tuple$120[0]; x265 = (x$6 = $shiftRightUint64(x261, 58), x$7 = (x$8 = $shiftLeft64(x263, 6), new $Uint64(x$8.$high & 4294967295, (x$8.$low & 4294967295) >>> 0)), new $Uint64(x$6.$high | x$7.$high, (x$6.$low | x$7.$low) >>> 0)); x266 = $shiftRightUint64(x263, 58); x267 = new $Uint64(x261.$high & 67108863, (x261.$low & 4294967295) >>> 0); x268 = new $Uint64(0, 0); x269 = 0; _tuple$121 = p521AddcarryxU64(x265, x218, 0); x268 = _tuple$121[0]; x269 = _tuple$121[1]; x270 = new $Uint64(0, 0); _tuple$122 = p521AddcarryxU64(x266, x220, x269); x270 = _tuple$122[0]; x272 = (x$9 = $shiftRightUint64(x268, 58), x$10 = (x$11 = $shiftLeft64(x270, 6), new $Uint64(x$11.$high & 4294967295, (x$11.$low & 4294967295) >>> 0)), new $Uint64(x$9.$high | x$10.$high, (x$9.$low | x$10.$low) >>> 0)); x273 = $shiftRightUint64(x270, 58); x274 = new $Uint64(x268.$high & 67108863, (x268.$low & 4294967295) >>> 0); x275 = new $Uint64(0, 0); x276 = 0; _tuple$123 = p521AddcarryxU64(x272, x202, 0); x275 = _tuple$123[0]; x276 = _tuple$123[1]; x277 = new $Uint64(0, 0); _tuple$124 = p521AddcarryxU64(x273, x204, x276); x277 = _tuple$124[0]; x279 = (x$12 = $shiftRightUint64(x275, 58), x$13 = (x$14 = $shiftLeft64(x277, 6), new $Uint64(x$14.$high & 4294967295, (x$14.$low & 4294967295) >>> 0)), new $Uint64(x$12.$high | x$13.$high, (x$12.$low | x$13.$low) >>> 0)); x280 = $shiftRightUint64(x277, 58); x281 = new $Uint64(x275.$high & 67108863, (x275.$low & 4294967295) >>> 0); x282 = new $Uint64(0, 0); x283 = 0; _tuple$125 = p521AddcarryxU64(x279, x186, 0); x282 = _tuple$125[0]; x283 = _tuple$125[1]; x284 = new $Uint64(0, 0); _tuple$126 = p521AddcarryxU64(x280, x188, x283); x284 = _tuple$126[0]; x286 = (x$15 = $shiftRightUint64(x282, 58), x$16 = (x$17 = $shiftLeft64(x284, 6), new $Uint64(x$17.$high & 4294967295, (x$17.$low & 4294967295) >>> 0)), new $Uint64(x$15.$high | x$16.$high, (x$15.$low | x$16.$low) >>> 0)); x287 = $shiftRightUint64(x284, 58); x288 = new $Uint64(x282.$high & 67108863, (x282.$low & 4294967295) >>> 0); x289 = new $Uint64(0, 0); x290 = 0; _tuple$127 = p521AddcarryxU64(x286, x170, 0); x289 = _tuple$127[0]; x290 = _tuple$127[1]; x291 = new $Uint64(0, 0); _tuple$128 = p521AddcarryxU64(x287, x172, x290); x291 = _tuple$128[0]; x293 = (x$18 = $shiftRightUint64(x289, 58), x$19 = (x$20 = $shiftLeft64(x291, 6), new $Uint64(x$20.$high & 4294967295, (x$20.$low & 4294967295) >>> 0)), new $Uint64(x$18.$high | x$19.$high, (x$18.$low | x$19.$low) >>> 0)); x294 = $shiftRightUint64(x291, 58); x295 = new $Uint64(x289.$high & 67108863, (x289.$low & 4294967295) >>> 0); x296 = new $Uint64(0, 0); x297 = 0; _tuple$129 = p521AddcarryxU64(x293, x154, 0); x296 = _tuple$129[0]; x297 = _tuple$129[1]; x298 = new $Uint64(0, 0); _tuple$130 = p521AddcarryxU64(x294, x156, x297); x298 = _tuple$130[0]; x300 = (x$21 = $shiftRightUint64(x296, 58), x$22 = (x$23 = $shiftLeft64(x298, 6), new $Uint64(x$23.$high & 4294967295, (x$23.$low & 4294967295) >>> 0)), new $Uint64(x$21.$high | x$22.$high, (x$21.$low | x$22.$low) >>> 0)); x301 = $shiftRightUint64(x298, 58); x302 = new $Uint64(x296.$high & 67108863, (x296.$low & 4294967295) >>> 0); x303 = new $Uint64(0, 0); x304 = 0; _tuple$131 = p521AddcarryxU64(x300, x138, 0); x303 = _tuple$131[0]; x304 = _tuple$131[1]; x305 = new $Uint64(0, 0); _tuple$132 = p521AddcarryxU64(x301, x140, x304); x305 = _tuple$132[0]; x307 = (x$24 = $shiftRightUint64(x303, 57), x$25 = (x$26 = $shiftLeft64(x305, 7), new $Uint64(x$26.$high & 4294967295, (x$26.$low & 4294967295) >>> 0)), new $Uint64(x$24.$high | x$25.$high, (x$24.$low | x$25.$low) >>> 0)); x308 = $shiftRightUint64(x305, 57); x309 = new $Uint64(x303.$high & 33554431, (x303.$low & 4294967295) >>> 0); x310 = new $Uint64(0, 0); x311 = 0; _tuple$133 = p521AddcarryxU64(x125, x307, 0); x310 = _tuple$133[0]; x311 = _tuple$133[1]; x312 = (x$27 = (new $Uint64(0, x311)), new $Uint64(x$27.$high + x308.$high, x$27.$low + x308.$low)); x313 = (x$28 = $shiftRightUint64(x310, 58), x$29 = (x$30 = $shiftLeft64(x312, 6), new $Uint64(x$30.$high & 4294967295, (x$30.$low & 4294967295) >>> 0)), new $Uint64(x$28.$high | x$29.$high, (x$28.$low | x$29.$low) >>> 0)); x314 = new $Uint64(x310.$high & 67108863, (x310.$low & 4294967295) >>> 0); x315 = new $Uint64(x313.$high + x260.$high, x313.$low + x260.$low); x316 = ((($shiftRightUint64(x315, 58)).$low << 24 >>> 24)); x317 = new $Uint64(x315.$high & 67108863, (x315.$low & 4294967295) >>> 0); x318 = (x$31 = (new $Uint64(0, x316)), new $Uint64(x$31.$high + x267.$high, x$31.$low + x267.$low)); out1.nilCheck, out1[0] = x314; out1.nilCheck, out1[1] = x317; out1.nilCheck, out1[2] = x318; out1.nilCheck, out1[3] = x274; out1.nilCheck, out1[4] = x281; out1.nilCheck, out1[5] = x288; out1.nilCheck, out1[6] = x295; out1.nilCheck, out1[7] = x302; out1.nilCheck, out1[8] = x309; }; p521Carry = function(out1, arg1) { var arg1, out1, 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$3, x$4, x$5, x$6, x$7, x$8, x$9, x1, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x2, x20, x3, x4, x5, x6, x7, x8, x9; x1 = arg1[0]; x2 = (x = $shiftRightUint64(x1, 58), x$1 = arg1[1], new $Uint64(x.$high + x$1.$high, x.$low + x$1.$low)); x3 = (x$2 = $shiftRightUint64(x2, 58), x$3 = arg1[2], new $Uint64(x$2.$high + x$3.$high, x$2.$low + x$3.$low)); x4 = (x$4 = $shiftRightUint64(x3, 58), x$5 = arg1[3], new $Uint64(x$4.$high + x$5.$high, x$4.$low + x$5.$low)); x5 = (x$6 = $shiftRightUint64(x4, 58), x$7 = arg1[4], new $Uint64(x$6.$high + x$7.$high, x$6.$low + x$7.$low)); x6 = (x$8 = $shiftRightUint64(x5, 58), x$9 = arg1[5], new $Uint64(x$8.$high + x$9.$high, x$8.$low + x$9.$low)); x7 = (x$10 = $shiftRightUint64(x6, 58), x$11 = arg1[6], new $Uint64(x$10.$high + x$11.$high, x$10.$low + x$11.$low)); x8 = (x$12 = $shiftRightUint64(x7, 58), x$13 = arg1[7], new $Uint64(x$12.$high + x$13.$high, x$12.$low + x$13.$low)); x9 = (x$14 = $shiftRightUint64(x8, 58), x$15 = arg1[8], new $Uint64(x$14.$high + x$15.$high, x$14.$low + x$15.$low)); x10 = (x$16 = new $Uint64(x1.$high & 67108863, (x1.$low & 4294967295) >>> 0), x$17 = $shiftRightUint64(x9, 57), new $Uint64(x$16.$high + x$17.$high, x$16.$low + x$17.$low)); x11 = (x$18 = (new $Uint64(0, ((($shiftRightUint64(x10, 58)).$low << 24 >>> 24)))), x$19 = new $Uint64(x2.$high & 67108863, (x2.$low & 4294967295) >>> 0), new $Uint64(x$18.$high + x$19.$high, x$18.$low + x$19.$low)); x12 = new $Uint64(x10.$high & 67108863, (x10.$low & 4294967295) >>> 0); x13 = new $Uint64(x11.$high & 67108863, (x11.$low & 4294967295) >>> 0); x14 = (x$20 = (new $Uint64(0, ((($shiftRightUint64(x11, 58)).$low << 24 >>> 24)))), x$21 = new $Uint64(x3.$high & 67108863, (x3.$low & 4294967295) >>> 0), new $Uint64(x$20.$high + x$21.$high, x$20.$low + x$21.$low)); x15 = new $Uint64(x4.$high & 67108863, (x4.$low & 4294967295) >>> 0); x16 = new $Uint64(x5.$high & 67108863, (x5.$low & 4294967295) >>> 0); x17 = new $Uint64(x6.$high & 67108863, (x6.$low & 4294967295) >>> 0); x18 = new $Uint64(x7.$high & 67108863, (x7.$low & 4294967295) >>> 0); x19 = new $Uint64(x8.$high & 67108863, (x8.$low & 4294967295) >>> 0); x20 = new $Uint64(x9.$high & 33554431, (x9.$low & 4294967295) >>> 0); out1.nilCheck, out1[0] = x12; out1.nilCheck, out1[1] = x13; out1.nilCheck, out1[2] = x14; out1.nilCheck, out1[3] = x15; out1.nilCheck, out1[4] = x16; out1.nilCheck, out1[5] = x17; out1.nilCheck, out1[6] = x18; out1.nilCheck, out1[7] = x19; out1.nilCheck, out1[8] = x20; }; p521Add = function(out1, arg1, arg2) { var arg1, arg2, out1, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$16, x$17, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, x1, x2, x3, x4, x5, x6, x7, x8, x9; x1 = (x = arg1[0], x$1 = arg2[0], new $Uint64(x.$high + x$1.$high, x.$low + x$1.$low)); x2 = (x$2 = arg1[1], x$3 = arg2[1], new $Uint64(x$2.$high + x$3.$high, x$2.$low + x$3.$low)); x3 = (x$4 = arg1[2], x$5 = arg2[2], new $Uint64(x$4.$high + x$5.$high, x$4.$low + x$5.$low)); x4 = (x$6 = arg1[3], x$7 = arg2[3], new $Uint64(x$6.$high + x$7.$high, x$6.$low + x$7.$low)); x5 = (x$8 = arg1[4], x$9 = arg2[4], new $Uint64(x$8.$high + x$9.$high, x$8.$low + x$9.$low)); x6 = (x$10 = arg1[5], x$11 = arg2[5], new $Uint64(x$10.$high + x$11.$high, x$10.$low + x$11.$low)); x7 = (x$12 = arg1[6], x$13 = arg2[6], new $Uint64(x$12.$high + x$13.$high, x$12.$low + x$13.$low)); x8 = (x$14 = arg1[7], x$15 = arg2[7], new $Uint64(x$14.$high + x$15.$high, x$14.$low + x$15.$low)); x9 = (x$16 = arg1[8], x$17 = arg2[8], new $Uint64(x$16.$high + x$17.$high, x$16.$low + x$17.$low)); out1.nilCheck, out1[0] = x1; out1.nilCheck, out1[1] = x2; out1.nilCheck, out1[2] = x3; out1.nilCheck, out1[3] = x4; out1.nilCheck, out1[4] = x5; out1.nilCheck, out1[5] = x6; out1.nilCheck, out1[6] = x7; out1.nilCheck, out1[7] = x8; out1.nilCheck, out1[8] = x9; }; p521Sub = function(out1, arg1, arg2) { var arg1, arg2, out1, 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$3, x$4, x$5, x$6, x$7, x$8, x$9, x1, x2, x3, x4, x5, x6, x7, x8, x9; x1 = (x = (x$1 = arg1[0], new $Uint64(134217727 + x$1.$high, 4294967294 + x$1.$low)), x$2 = arg2[0], new $Uint64(x.$high - x$2.$high, x.$low - x$2.$low)); x2 = (x$3 = (x$4 = arg1[1], new $Uint64(134217727 + x$4.$high, 4294967294 + x$4.$low)), x$5 = arg2[1], new $Uint64(x$3.$high - x$5.$high, x$3.$low - x$5.$low)); x3 = (x$6 = (x$7 = arg1[2], new $Uint64(134217727 + x$7.$high, 4294967294 + x$7.$low)), x$8 = arg2[2], new $Uint64(x$6.$high - x$8.$high, x$6.$low - x$8.$low)); x4 = (x$9 = (x$10 = arg1[3], new $Uint64(134217727 + x$10.$high, 4294967294 + x$10.$low)), x$11 = arg2[3], new $Uint64(x$9.$high - x$11.$high, x$9.$low - x$11.$low)); x5 = (x$12 = (x$13 = arg1[4], new $Uint64(134217727 + x$13.$high, 4294967294 + x$13.$low)), x$14 = arg2[4], new $Uint64(x$12.$high - x$14.$high, x$12.$low - x$14.$low)); x6 = (x$15 = (x$16 = arg1[5], new $Uint64(134217727 + x$16.$high, 4294967294 + x$16.$low)), x$17 = arg2[5], new $Uint64(x$15.$high - x$17.$high, x$15.$low - x$17.$low)); x7 = (x$18 = (x$19 = arg1[6], new $Uint64(134217727 + x$19.$high, 4294967294 + x$19.$low)), x$20 = arg2[6], new $Uint64(x$18.$high - x$20.$high, x$18.$low - x$20.$low)); x8 = (x$21 = (x$22 = arg1[7], new $Uint64(134217727 + x$22.$high, 4294967294 + x$22.$low)), x$23 = arg2[7], new $Uint64(x$21.$high - x$23.$high, x$21.$low - x$23.$low)); x9 = (x$24 = (x$25 = arg1[8], new $Uint64(67108863 + x$25.$high, 4294967294 + x$25.$low)), x$26 = arg2[8], new $Uint64(x$24.$high - x$26.$high, x$24.$low - x$26.$low)); out1.nilCheck, out1[0] = x1; out1.nilCheck, out1[1] = x2; out1.nilCheck, out1[2] = x3; out1.nilCheck, out1[3] = x4; out1.nilCheck, out1[4] = x5; out1.nilCheck, out1[5] = x6; out1.nilCheck, out1[6] = x7; out1.nilCheck, out1[7] = x8; out1.nilCheck, out1[8] = x9; }; p521ToBytes = function(out1, arg1) { var arg1, out1, x, x$1, x$2, x$3, x$4, x$5, x1, x1$24ptr, x10, x10$24ptr, x100, x101, x102, x103, x104, x105, x106, x107, x108, x109, x11, x11$24ptr, x110, x111, x112, x113, x114, x115, x116, x117, x118, x119, x12, x12$24ptr, x120, x121, x122, x123, x124, x125, x126, x127, x128, x129, x13, x13$24ptr, x130, x131, x132, x133, x134, x135, x136, x137, x138, x139, x14, x14$24ptr, x140, x141, x142, x143, x144, x145, x146, x147, x148, x149, x15, x15$24ptr, x150, x151, x152, x153, x154, x155, x156, x157, x158, x159, x16, x16$24ptr, x160, x161, x162, x163, x164, x165, x166, x167, x168, x169, x17, x17$24ptr, x170, x171, x172, x173, x174, x175, x18, x18$24ptr, x19, x19$24ptr, x2, x2$24ptr, x20, x20$24ptr, x21, x21$24ptr, x22, x22$24ptr, x23, x23$24ptr, x24, x24$24ptr, x25, x25$24ptr, x26, x26$24ptr, x27, x27$24ptr, x28, x28$24ptr, x29, x29$24ptr, x3, x3$24ptr, x30, x30$24ptr, x31, x31$24ptr, x32, x32$24ptr, x33, x33$24ptr, x34, x34$24ptr, x35, x35$24ptr, x36, x36$24ptr, x37, x37$24ptr, x38, x39, x4, x4$24ptr, x40, x41, x42, x43, x44, x45, x46, x47, x48, x49, x5, x5$24ptr, x50, x51, x52, x53, x54, x55, x56, x57, x58, x59, x6, x6$24ptr, x60, x61, x62, x63, x64, x65, x66, x67, x68, x69, x7, x7$24ptr, x70, x71, x72, x73, x74, x75, x76, x77, x78, x79, x8, x8$24ptr, x80, x81, x82, x83, x84, x85, x86, x87, x88, x89, x9, x9$24ptr, x90, x91, x92, x93, x94, x95, x96, x97, x98, x99; x1 = new $Uint64(0, 0); x2 = 0; p521SubborrowxU58((x1$24ptr || (x1$24ptr = new ptrType(function() { return x1; }, function($v) { x1 = $v; }))), (x2$24ptr || (x2$24ptr = new ptrType$1(function() { return x2; }, function($v) { x2 = $v; }))), 0, arg1[0], new $Uint64(67108863, 4294967295)); x3 = new $Uint64(0, 0); x4 = 0; p521SubborrowxU58((x3$24ptr || (x3$24ptr = new ptrType(function() { return x3; }, function($v) { x3 = $v; }))), (x4$24ptr || (x4$24ptr = new ptrType$1(function() { return x4; }, function($v) { x4 = $v; }))), x2, arg1[1], new $Uint64(67108863, 4294967295)); x5 = new $Uint64(0, 0); x6 = 0; p521SubborrowxU58((x5$24ptr || (x5$24ptr = new ptrType(function() { return x5; }, function($v) { x5 = $v; }))), (x6$24ptr || (x6$24ptr = new ptrType$1(function() { return x6; }, function($v) { x6 = $v; }))), x4, arg1[2], new $Uint64(67108863, 4294967295)); x7 = new $Uint64(0, 0); x8 = 0; p521SubborrowxU58((x7$24ptr || (x7$24ptr = new ptrType(function() { return x7; }, function($v) { x7 = $v; }))), (x8$24ptr || (x8$24ptr = new ptrType$1(function() { return x8; }, function($v) { x8 = $v; }))), x6, arg1[3], new $Uint64(67108863, 4294967295)); x9 = new $Uint64(0, 0); x10 = 0; p521SubborrowxU58((x9$24ptr || (x9$24ptr = new ptrType(function() { return x9; }, function($v) { x9 = $v; }))), (x10$24ptr || (x10$24ptr = new ptrType$1(function() { return x10; }, function($v) { x10 = $v; }))), x8, arg1[4], new $Uint64(67108863, 4294967295)); x11 = new $Uint64(0, 0); x12 = 0; p521SubborrowxU58((x11$24ptr || (x11$24ptr = new ptrType(function() { return x11; }, function($v) { x11 = $v; }))), (x12$24ptr || (x12$24ptr = new ptrType$1(function() { return x12; }, function($v) { x12 = $v; }))), x10, arg1[5], new $Uint64(67108863, 4294967295)); x13 = new $Uint64(0, 0); x14 = 0; p521SubborrowxU58((x13$24ptr || (x13$24ptr = new ptrType(function() { return x13; }, function($v) { x13 = $v; }))), (x14$24ptr || (x14$24ptr = new ptrType$1(function() { return x14; }, function($v) { x14 = $v; }))), x12, arg1[6], new $Uint64(67108863, 4294967295)); x15 = new $Uint64(0, 0); x16 = 0; p521SubborrowxU58((x15$24ptr || (x15$24ptr = new ptrType(function() { return x15; }, function($v) { x15 = $v; }))), (x16$24ptr || (x16$24ptr = new ptrType$1(function() { return x16; }, function($v) { x16 = $v; }))), x14, arg1[7], new $Uint64(67108863, 4294967295)); x17 = new $Uint64(0, 0); x18 = 0; p521SubborrowxU57((x17$24ptr || (x17$24ptr = new ptrType(function() { return x17; }, function($v) { x17 = $v; }))), (x18$24ptr || (x18$24ptr = new ptrType$1(function() { return x18; }, function($v) { x18 = $v; }))), x16, arg1[8], new $Uint64(33554431, 4294967295)); x19 = new $Uint64(0, 0); p521CmovznzU64((x19$24ptr || (x19$24ptr = new ptrType(function() { return x19; }, function($v) { x19 = $v; }))), x18, new $Uint64(0, 0), new $Uint64(4294967295, 4294967295)); x20 = new $Uint64(0, 0); x21 = 0; p521AddcarryxU58((x20$24ptr || (x20$24ptr = new ptrType(function() { return x20; }, function($v) { x20 = $v; }))), (x21$24ptr || (x21$24ptr = new ptrType$1(function() { return x21; }, function($v) { x21 = $v; }))), 0, x1, new $Uint64(x19.$high & 67108863, (x19.$low & 4294967295) >>> 0)); x22 = new $Uint64(0, 0); x23 = 0; p521AddcarryxU58((x22$24ptr || (x22$24ptr = new ptrType(function() { return x22; }, function($v) { x22 = $v; }))), (x23$24ptr || (x23$24ptr = new ptrType$1(function() { return x23; }, function($v) { x23 = $v; }))), x21, x3, new $Uint64(x19.$high & 67108863, (x19.$low & 4294967295) >>> 0)); x24 = new $Uint64(0, 0); x25 = 0; p521AddcarryxU58((x24$24ptr || (x24$24ptr = new ptrType(function() { return x24; }, function($v) { x24 = $v; }))), (x25$24ptr || (x25$24ptr = new ptrType$1(function() { return x25; }, function($v) { x25 = $v; }))), x23, x5, new $Uint64(x19.$high & 67108863, (x19.$low & 4294967295) >>> 0)); x26 = new $Uint64(0, 0); x27 = 0; p521AddcarryxU58((x26$24ptr || (x26$24ptr = new ptrType(function() { return x26; }, function($v) { x26 = $v; }))), (x27$24ptr || (x27$24ptr = new ptrType$1(function() { return x27; }, function($v) { x27 = $v; }))), x25, x7, new $Uint64(x19.$high & 67108863, (x19.$low & 4294967295) >>> 0)); x28 = new $Uint64(0, 0); x29 = 0; p521AddcarryxU58((x28$24ptr || (x28$24ptr = new ptrType(function() { return x28; }, function($v) { x28 = $v; }))), (x29$24ptr || (x29$24ptr = new ptrType$1(function() { return x29; }, function($v) { x29 = $v; }))), x27, x9, new $Uint64(x19.$high & 67108863, (x19.$low & 4294967295) >>> 0)); x30 = new $Uint64(0, 0); x31 = 0; p521AddcarryxU58((x30$24ptr || (x30$24ptr = new ptrType(function() { return x30; }, function($v) { x30 = $v; }))), (x31$24ptr || (x31$24ptr = new ptrType$1(function() { return x31; }, function($v) { x31 = $v; }))), x29, x11, new $Uint64(x19.$high & 67108863, (x19.$low & 4294967295) >>> 0)); x32 = new $Uint64(0, 0); x33 = 0; p521AddcarryxU58((x32$24ptr || (x32$24ptr = new ptrType(function() { return x32; }, function($v) { x32 = $v; }))), (x33$24ptr || (x33$24ptr = new ptrType$1(function() { return x33; }, function($v) { x33 = $v; }))), x31, x13, new $Uint64(x19.$high & 67108863, (x19.$low & 4294967295) >>> 0)); x34 = new $Uint64(0, 0); x35 = 0; p521AddcarryxU58((x34$24ptr || (x34$24ptr = new ptrType(function() { return x34; }, function($v) { x34 = $v; }))), (x35$24ptr || (x35$24ptr = new ptrType$1(function() { return x35; }, function($v) { x35 = $v; }))), x33, x15, new $Uint64(x19.$high & 67108863, (x19.$low & 4294967295) >>> 0)); x36 = new $Uint64(0, 0); x37 = 0; p521AddcarryxU57((x36$24ptr || (x36$24ptr = new ptrType(function() { return x36; }, function($v) { x36 = $v; }))), (x37$24ptr || (x37$24ptr = new ptrType$1(function() { return x37; }, function($v) { x37 = $v; }))), x35, x17, new $Uint64(x19.$high & 33554431, (x19.$low & 4294967295) >>> 0)); x38 = $shiftLeft64(x34, 6); x39 = $shiftLeft64(x32, 4); x40 = $shiftLeft64(x30, 2); x41 = $shiftLeft64(x26, 6); x42 = $shiftLeft64(x24, 4); x43 = $shiftLeft64(x22, 2); x44 = ((((x20.$low << 24 >>> 24)) & 255) >>> 0); x45 = $shiftRightUint64(x20, 8); x46 = ((((x45.$low << 24 >>> 24)) & 255) >>> 0); x47 = $shiftRightUint64(x45, 8); x48 = ((((x47.$low << 24 >>> 24)) & 255) >>> 0); x49 = $shiftRightUint64(x47, 8); x50 = ((((x49.$low << 24 >>> 24)) & 255) >>> 0); x51 = $shiftRightUint64(x49, 8); x52 = ((((x51.$low << 24 >>> 24)) & 255) >>> 0); x53 = $shiftRightUint64(x51, 8); x54 = ((((x53.$low << 24 >>> 24)) & 255) >>> 0); x55 = $shiftRightUint64(x53, 8); x56 = ((((x55.$low << 24 >>> 24)) & 255) >>> 0); x57 = ((($shiftRightUint64(x55, 8)).$low << 24 >>> 24)); x58 = (x = (new $Uint64(0, x57)), new $Uint64(x43.$high + x.$high, x43.$low + x.$low)); x59 = ((((x58.$low << 24 >>> 24)) & 255) >>> 0); x60 = $shiftRightUint64(x58, 8); x61 = ((((x60.$low << 24 >>> 24)) & 255) >>> 0); x62 = $shiftRightUint64(x60, 8); x63 = ((((x62.$low << 24 >>> 24)) & 255) >>> 0); x64 = $shiftRightUint64(x62, 8); x65 = ((((x64.$low << 24 >>> 24)) & 255) >>> 0); x66 = $shiftRightUint64(x64, 8); x67 = ((((x66.$low << 24 >>> 24)) & 255) >>> 0); x68 = $shiftRightUint64(x66, 8); x69 = ((((x68.$low << 24 >>> 24)) & 255) >>> 0); x70 = $shiftRightUint64(x68, 8); x71 = ((((x70.$low << 24 >>> 24)) & 255) >>> 0); x72 = ((($shiftRightUint64(x70, 8)).$low << 24 >>> 24)); x73 = (x$1 = (new $Uint64(0, x72)), new $Uint64(x42.$high + x$1.$high, x42.$low + x$1.$low)); x74 = ((((x73.$low << 24 >>> 24)) & 255) >>> 0); x75 = $shiftRightUint64(x73, 8); x76 = ((((x75.$low << 24 >>> 24)) & 255) >>> 0); x77 = $shiftRightUint64(x75, 8); x78 = ((((x77.$low << 24 >>> 24)) & 255) >>> 0); x79 = $shiftRightUint64(x77, 8); x80 = ((((x79.$low << 24 >>> 24)) & 255) >>> 0); x81 = $shiftRightUint64(x79, 8); x82 = ((((x81.$low << 24 >>> 24)) & 255) >>> 0); x83 = $shiftRightUint64(x81, 8); x84 = ((((x83.$low << 24 >>> 24)) & 255) >>> 0); x85 = $shiftRightUint64(x83, 8); x86 = ((((x85.$low << 24 >>> 24)) & 255) >>> 0); x87 = ((($shiftRightUint64(x85, 8)).$low << 24 >>> 24)); x88 = (x$2 = (new $Uint64(0, x87)), new $Uint64(x41.$high + x$2.$high, x41.$low + x$2.$low)); x89 = ((((x88.$low << 24 >>> 24)) & 255) >>> 0); x90 = $shiftRightUint64(x88, 8); x91 = ((((x90.$low << 24 >>> 24)) & 255) >>> 0); x92 = $shiftRightUint64(x90, 8); x93 = ((((x92.$low << 24 >>> 24)) & 255) >>> 0); x94 = $shiftRightUint64(x92, 8); x95 = ((((x94.$low << 24 >>> 24)) & 255) >>> 0); x96 = $shiftRightUint64(x94, 8); x97 = ((((x96.$low << 24 >>> 24)) & 255) >>> 0); x98 = $shiftRightUint64(x96, 8); x99 = ((((x98.$low << 24 >>> 24)) & 255) >>> 0); x100 = $shiftRightUint64(x98, 8); x101 = ((((x100.$low << 24 >>> 24)) & 255) >>> 0); x102 = ((($shiftRightUint64(x100, 8)).$low << 24 >>> 24)); x103 = ((((x28.$low << 24 >>> 24)) & 255) >>> 0); x104 = $shiftRightUint64(x28, 8); x105 = ((((x104.$low << 24 >>> 24)) & 255) >>> 0); x106 = $shiftRightUint64(x104, 8); x107 = ((((x106.$low << 24 >>> 24)) & 255) >>> 0); x108 = $shiftRightUint64(x106, 8); x109 = ((((x108.$low << 24 >>> 24)) & 255) >>> 0); x110 = $shiftRightUint64(x108, 8); x111 = ((((x110.$low << 24 >>> 24)) & 255) >>> 0); x112 = $shiftRightUint64(x110, 8); x113 = ((((x112.$low << 24 >>> 24)) & 255) >>> 0); x114 = $shiftRightUint64(x112, 8); x115 = ((((x114.$low << 24 >>> 24)) & 255) >>> 0); x116 = ((($shiftRightUint64(x114, 8)).$low << 24 >>> 24)); x117 = (x$3 = (new $Uint64(0, x116)), new $Uint64(x40.$high + x$3.$high, x40.$low + x$3.$low)); x118 = ((((x117.$low << 24 >>> 24)) & 255) >>> 0); x119 = $shiftRightUint64(x117, 8); x120 = ((((x119.$low << 24 >>> 24)) & 255) >>> 0); x121 = $shiftRightUint64(x119, 8); x122 = ((((x121.$low << 24 >>> 24)) & 255) >>> 0); x123 = $shiftRightUint64(x121, 8); x124 = ((((x123.$low << 24 >>> 24)) & 255) >>> 0); x125 = $shiftRightUint64(x123, 8); x126 = ((((x125.$low << 24 >>> 24)) & 255) >>> 0); x127 = $shiftRightUint64(x125, 8); x128 = ((((x127.$low << 24 >>> 24)) & 255) >>> 0); x129 = $shiftRightUint64(x127, 8); x130 = ((((x129.$low << 24 >>> 24)) & 255) >>> 0); x131 = ((($shiftRightUint64(x129, 8)).$low << 24 >>> 24)); x132 = (x$4 = (new $Uint64(0, x131)), new $Uint64(x39.$high + x$4.$high, x39.$low + x$4.$low)); x133 = ((((x132.$low << 24 >>> 24)) & 255) >>> 0); x134 = $shiftRightUint64(x132, 8); x135 = ((((x134.$low << 24 >>> 24)) & 255) >>> 0); x136 = $shiftRightUint64(x134, 8); x137 = ((((x136.$low << 24 >>> 24)) & 255) >>> 0); x138 = $shiftRightUint64(x136, 8); x139 = ((((x138.$low << 24 >>> 24)) & 255) >>> 0); x140 = $shiftRightUint64(x138, 8); x141 = ((((x140.$low << 24 >>> 24)) & 255) >>> 0); x142 = $shiftRightUint64(x140, 8); x143 = ((((x142.$low << 24 >>> 24)) & 255) >>> 0); x144 = $shiftRightUint64(x142, 8); x145 = ((((x144.$low << 24 >>> 24)) & 255) >>> 0); x146 = ((($shiftRightUint64(x144, 8)).$low << 24 >>> 24)); x147 = (x$5 = (new $Uint64(0, x146)), new $Uint64(x38.$high + x$5.$high, x38.$low + x$5.$low)); x148 = ((((x147.$low << 24 >>> 24)) & 255) >>> 0); x149 = $shiftRightUint64(x147, 8); x150 = ((((x149.$low << 24 >>> 24)) & 255) >>> 0); x151 = $shiftRightUint64(x149, 8); x152 = ((((x151.$low << 24 >>> 24)) & 255) >>> 0); x153 = $shiftRightUint64(x151, 8); x154 = ((((x153.$low << 24 >>> 24)) & 255) >>> 0); x155 = $shiftRightUint64(x153, 8); x156 = ((((x155.$low << 24 >>> 24)) & 255) >>> 0); x157 = $shiftRightUint64(x155, 8); x158 = ((((x157.$low << 24 >>> 24)) & 255) >>> 0); x159 = $shiftRightUint64(x157, 8); x160 = ((((x159.$low << 24 >>> 24)) & 255) >>> 0); x161 = ((($shiftRightUint64(x159, 8)).$low << 24 >>> 24)); x162 = ((((x36.$low << 24 >>> 24)) & 255) >>> 0); x163 = $shiftRightUint64(x36, 8); x164 = ((((x163.$low << 24 >>> 24)) & 255) >>> 0); x165 = $shiftRightUint64(x163, 8); x166 = ((((x165.$low << 24 >>> 24)) & 255) >>> 0); x167 = $shiftRightUint64(x165, 8); x168 = ((((x167.$low << 24 >>> 24)) & 255) >>> 0); x169 = $shiftRightUint64(x167, 8); x170 = ((((x169.$low << 24 >>> 24)) & 255) >>> 0); x171 = $shiftRightUint64(x169, 8); x172 = ((((x171.$low << 24 >>> 24)) & 255) >>> 0); x173 = $shiftRightUint64(x171, 8); x174 = ((((x173.$low << 24 >>> 24)) & 255) >>> 0); x175 = ((($shiftRightUint64(x173, 8)).$low << 24 >>> 24)); out1.nilCheck, out1[0] = x44; out1.nilCheck, out1[1] = x46; out1.nilCheck, out1[2] = x48; out1.nilCheck, out1[3] = x50; out1.nilCheck, out1[4] = x52; out1.nilCheck, out1[5] = x54; out1.nilCheck, out1[6] = x56; out1.nilCheck, out1[7] = x59; out1.nilCheck, out1[8] = x61; out1.nilCheck, out1[9] = x63; out1.nilCheck, out1[10] = x65; out1.nilCheck, out1[11] = x67; out1.nilCheck, out1[12] = x69; out1.nilCheck, out1[13] = x71; out1.nilCheck, out1[14] = x74; out1.nilCheck, out1[15] = x76; out1.nilCheck, out1[16] = x78; out1.nilCheck, out1[17] = x80; out1.nilCheck, out1[18] = x82; out1.nilCheck, out1[19] = x84; out1.nilCheck, out1[20] = x86; out1.nilCheck, out1[21] = x89; out1.nilCheck, out1[22] = x91; out1.nilCheck, out1[23] = x93; out1.nilCheck, out1[24] = x95; out1.nilCheck, out1[25] = x97; out1.nilCheck, out1[26] = x99; out1.nilCheck, out1[27] = x101; out1.nilCheck, out1[28] = x102; out1.nilCheck, out1[29] = x103; out1.nilCheck, out1[30] = x105; out1.nilCheck, out1[31] = x107; out1.nilCheck, out1[32] = x109; out1.nilCheck, out1[33] = x111; out1.nilCheck, out1[34] = x113; out1.nilCheck, out1[35] = x115; out1.nilCheck, out1[36] = x118; out1.nilCheck, out1[37] = x120; out1.nilCheck, out1[38] = x122; out1.nilCheck, out1[39] = x124; out1.nilCheck, out1[40] = x126; out1.nilCheck, out1[41] = x128; out1.nilCheck, out1[42] = x130; out1.nilCheck, out1[43] = x133; out1.nilCheck, out1[44] = x135; out1.nilCheck, out1[45] = x137; out1.nilCheck, out1[46] = x139; out1.nilCheck, out1[47] = x141; out1.nilCheck, out1[48] = x143; out1.nilCheck, out1[49] = x145; out1.nilCheck, out1[50] = x148; out1.nilCheck, out1[51] = x150; out1.nilCheck, out1[52] = x152; out1.nilCheck, out1[53] = x154; out1.nilCheck, out1[54] = x156; out1.nilCheck, out1[55] = x158; out1.nilCheck, out1[56] = x160; out1.nilCheck, out1[57] = x161; out1.nilCheck, out1[58] = x162; out1.nilCheck, out1[59] = x164; out1.nilCheck, out1[60] = x166; out1.nilCheck, out1[61] = x168; out1.nilCheck, out1[62] = x170; out1.nilCheck, out1[63] = x172; out1.nilCheck, out1[64] = x174; out1.nilCheck, out1[65] = ((x175 << 24 >>> 24)); }; p521FromBytes = function(out1, arg1) { var arg1, out1, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x1, x10, x100, x101, x102, x103, x104, x105, x106, x107, x108, x109, x11, x110, x111, x112, x113, x114, x115, x116, x117, x118, x119, x12, x120, x121, x122, x123, x124, x125, x126, x127, x128, x129, x13, x130, x131, x132, x133, x134, x135, x136, x137, x138, x139, x14, x140, x141, x15, x16, x17, x18, x19, x2, x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x3, x30, x31, x32, x33, x34, x35, x36, x37, x38, x39, x4, x40, x41, x42, x43, x44, x45, x46, x47, x48, x49, x5, x50, x51, x52, x53, x54, x55, x56, x57, x58, x59, x6, x60, x61, x62, x63, x64, x65, x66, x67, x68, x69, x7, x70, x71, x72, x73, x74, x75, x76, x77, x78, x79, x8, x80, x81, x82, x83, x84, x85, x86, x87, x88, x89, x9, x90, x91, x92, x93, x94, x95, x96, x97, x98, x99; x1 = $shiftLeft64((new $Uint64(0, ((arg1[65] << 24 >>> 24)))), 56); x2 = $shiftLeft64((new $Uint64(0, arg1[64])), 48); x3 = $shiftLeft64((new $Uint64(0, arg1[63])), 40); x4 = $shiftLeft64((new $Uint64(0, arg1[62])), 32); x5 = $shiftLeft64((new $Uint64(0, arg1[61])), 24); x6 = $shiftLeft64((new $Uint64(0, arg1[60])), 16); x7 = $shiftLeft64((new $Uint64(0, arg1[59])), 8); x8 = arg1[58]; x9 = $shiftLeft64((new $Uint64(0, arg1[57])), 50); x10 = $shiftLeft64((new $Uint64(0, arg1[56])), 42); x11 = $shiftLeft64((new $Uint64(0, arg1[55])), 34); x12 = $shiftLeft64((new $Uint64(0, arg1[54])), 26); x13 = $shiftLeft64((new $Uint64(0, arg1[53])), 18); x14 = $shiftLeft64((new $Uint64(0, arg1[52])), 10); x15 = $shiftLeft64((new $Uint64(0, arg1[51])), 2); x16 = $shiftLeft64((new $Uint64(0, arg1[50])), 52); x17 = $shiftLeft64((new $Uint64(0, arg1[49])), 44); x18 = $shiftLeft64((new $Uint64(0, arg1[48])), 36); x19 = $shiftLeft64((new $Uint64(0, arg1[47])), 28); x20 = $shiftLeft64((new $Uint64(0, arg1[46])), 20); x21 = $shiftLeft64((new $Uint64(0, arg1[45])), 12); x22 = $shiftLeft64((new $Uint64(0, arg1[44])), 4); x23 = $shiftLeft64((new $Uint64(0, arg1[43])), 54); x24 = $shiftLeft64((new $Uint64(0, arg1[42])), 46); x25 = $shiftLeft64((new $Uint64(0, arg1[41])), 38); x26 = $shiftLeft64((new $Uint64(0, arg1[40])), 30); x27 = $shiftLeft64((new $Uint64(0, arg1[39])), 22); x28 = $shiftLeft64((new $Uint64(0, arg1[38])), 14); x29 = $shiftLeft64((new $Uint64(0, arg1[37])), 6); x30 = $shiftLeft64((new $Uint64(0, arg1[36])), 56); x31 = $shiftLeft64((new $Uint64(0, arg1[35])), 48); x32 = $shiftLeft64((new $Uint64(0, arg1[34])), 40); x33 = $shiftLeft64((new $Uint64(0, arg1[33])), 32); x34 = $shiftLeft64((new $Uint64(0, arg1[32])), 24); x35 = $shiftLeft64((new $Uint64(0, arg1[31])), 16); x36 = $shiftLeft64((new $Uint64(0, arg1[30])), 8); x37 = arg1[29]; x38 = $shiftLeft64((new $Uint64(0, arg1[28])), 50); x39 = $shiftLeft64((new $Uint64(0, arg1[27])), 42); x40 = $shiftLeft64((new $Uint64(0, arg1[26])), 34); x41 = $shiftLeft64((new $Uint64(0, arg1[25])), 26); x42 = $shiftLeft64((new $Uint64(0, arg1[24])), 18); x43 = $shiftLeft64((new $Uint64(0, arg1[23])), 10); x44 = $shiftLeft64((new $Uint64(0, arg1[22])), 2); x45 = $shiftLeft64((new $Uint64(0, arg1[21])), 52); x46 = $shiftLeft64((new $Uint64(0, arg1[20])), 44); x47 = $shiftLeft64((new $Uint64(0, arg1[19])), 36); x48 = $shiftLeft64((new $Uint64(0, arg1[18])), 28); x49 = $shiftLeft64((new $Uint64(0, arg1[17])), 20); x50 = $shiftLeft64((new $Uint64(0, arg1[16])), 12); x51 = $shiftLeft64((new $Uint64(0, arg1[15])), 4); x52 = $shiftLeft64((new $Uint64(0, arg1[14])), 54); x53 = $shiftLeft64((new $Uint64(0, arg1[13])), 46); x54 = $shiftLeft64((new $Uint64(0, arg1[12])), 38); x55 = $shiftLeft64((new $Uint64(0, arg1[11])), 30); x56 = $shiftLeft64((new $Uint64(0, arg1[10])), 22); x57 = $shiftLeft64((new $Uint64(0, arg1[9])), 14); x58 = $shiftLeft64((new $Uint64(0, arg1[8])), 6); x59 = $shiftLeft64((new $Uint64(0, arg1[7])), 56); x60 = $shiftLeft64((new $Uint64(0, arg1[6])), 48); x61 = $shiftLeft64((new $Uint64(0, arg1[5])), 40); x62 = $shiftLeft64((new $Uint64(0, arg1[4])), 32); x63 = $shiftLeft64((new $Uint64(0, arg1[3])), 24); x64 = $shiftLeft64((new $Uint64(0, arg1[2])), 16); x65 = $shiftLeft64((new $Uint64(0, arg1[1])), 8); x66 = arg1[0]; x67 = (x = (new $Uint64(0, x66)), new $Uint64(x65.$high + x.$high, x65.$low + x.$low)); x68 = new $Uint64(x64.$high + x67.$high, x64.$low + x67.$low); x69 = new $Uint64(x63.$high + x68.$high, x63.$low + x68.$low); x70 = new $Uint64(x62.$high + x69.$high, x62.$low + x69.$low); x71 = new $Uint64(x61.$high + x70.$high, x61.$low + x70.$low); x72 = new $Uint64(x60.$high + x71.$high, x60.$low + x71.$low); x73 = new $Uint64(x59.$high + x72.$high, x59.$low + x72.$low); x74 = new $Uint64(x73.$high & 67108863, (x73.$low & 4294967295) >>> 0); x75 = ((($shiftRightUint64(x73, 58)).$low << 24 >>> 24)); x76 = (x$1 = (new $Uint64(0, x75)), new $Uint64(x58.$high + x$1.$high, x58.$low + x$1.$low)); x77 = new $Uint64(x57.$high + x76.$high, x57.$low + x76.$low); x78 = new $Uint64(x56.$high + x77.$high, x56.$low + x77.$low); x79 = new $Uint64(x55.$high + x78.$high, x55.$low + x78.$low); x80 = new $Uint64(x54.$high + x79.$high, x54.$low + x79.$low); x81 = new $Uint64(x53.$high + x80.$high, x53.$low + x80.$low); x82 = new $Uint64(x52.$high + x81.$high, x52.$low + x81.$low); x83 = new $Uint64(x82.$high & 67108863, (x82.$low & 4294967295) >>> 0); x84 = ((($shiftRightUint64(x82, 58)).$low << 24 >>> 24)); x85 = (x$2 = (new $Uint64(0, x84)), new $Uint64(x51.$high + x$2.$high, x51.$low + x$2.$low)); x86 = new $Uint64(x50.$high + x85.$high, x50.$low + x85.$low); x87 = new $Uint64(x49.$high + x86.$high, x49.$low + x86.$low); x88 = new $Uint64(x48.$high + x87.$high, x48.$low + x87.$low); x89 = new $Uint64(x47.$high + x88.$high, x47.$low + x88.$low); x90 = new $Uint64(x46.$high + x89.$high, x46.$low + x89.$low); x91 = new $Uint64(x45.$high + x90.$high, x45.$low + x90.$low); x92 = new $Uint64(x91.$high & 67108863, (x91.$low & 4294967295) >>> 0); x93 = ((($shiftRightUint64(x91, 58)).$low << 24 >>> 24)); x94 = (x$3 = (new $Uint64(0, x93)), new $Uint64(x44.$high + x$3.$high, x44.$low + x$3.$low)); x95 = new $Uint64(x43.$high + x94.$high, x43.$low + x94.$low); x96 = new $Uint64(x42.$high + x95.$high, x42.$low + x95.$low); x97 = new $Uint64(x41.$high + x96.$high, x41.$low + x96.$low); x98 = new $Uint64(x40.$high + x97.$high, x40.$low + x97.$low); x99 = new $Uint64(x39.$high + x98.$high, x39.$low + x98.$low); x100 = new $Uint64(x38.$high + x99.$high, x38.$low + x99.$low); x101 = (x$4 = (new $Uint64(0, x37)), new $Uint64(x36.$high + x$4.$high, x36.$low + x$4.$low)); x102 = new $Uint64(x35.$high + x101.$high, x35.$low + x101.$low); x103 = new $Uint64(x34.$high + x102.$high, x34.$low + x102.$low); x104 = new $Uint64(x33.$high + x103.$high, x33.$low + x103.$low); x105 = new $Uint64(x32.$high + x104.$high, x32.$low + x104.$low); x106 = new $Uint64(x31.$high + x105.$high, x31.$low + x105.$low); x107 = new $Uint64(x30.$high + x106.$high, x30.$low + x106.$low); x108 = new $Uint64(x107.$high & 67108863, (x107.$low & 4294967295) >>> 0); x109 = ((($shiftRightUint64(x107, 58)).$low << 24 >>> 24)); x110 = (x$5 = (new $Uint64(0, x109)), new $Uint64(x29.$high + x$5.$high, x29.$low + x$5.$low)); x111 = new $Uint64(x28.$high + x110.$high, x28.$low + x110.$low); x112 = new $Uint64(x27.$high + x111.$high, x27.$low + x111.$low); x113 = new $Uint64(x26.$high + x112.$high, x26.$low + x112.$low); x114 = new $Uint64(x25.$high + x113.$high, x25.$low + x113.$low); x115 = new $Uint64(x24.$high + x114.$high, x24.$low + x114.$low); x116 = new $Uint64(x23.$high + x115.$high, x23.$low + x115.$low); x117 = new $Uint64(x116.$high & 67108863, (x116.$low & 4294967295) >>> 0); x118 = ((($shiftRightUint64(x116, 58)).$low << 24 >>> 24)); x119 = (x$6 = (new $Uint64(0, x118)), new $Uint64(x22.$high + x$6.$high, x22.$low + x$6.$low)); x120 = new $Uint64(x21.$high + x119.$high, x21.$low + x119.$low); x121 = new $Uint64(x20.$high + x120.$high, x20.$low + x120.$low); x122 = new $Uint64(x19.$high + x121.$high, x19.$low + x121.$low); x123 = new $Uint64(x18.$high + x122.$high, x18.$low + x122.$low); x124 = new $Uint64(x17.$high + x123.$high, x17.$low + x123.$low); x125 = new $Uint64(x16.$high + x124.$high, x16.$low + x124.$low); x126 = new $Uint64(x125.$high & 67108863, (x125.$low & 4294967295) >>> 0); x127 = ((($shiftRightUint64(x125, 58)).$low << 24 >>> 24)); x128 = (x$7 = (new $Uint64(0, x127)), new $Uint64(x15.$high + x$7.$high, x15.$low + x$7.$low)); x129 = new $Uint64(x14.$high + x128.$high, x14.$low + x128.$low); x130 = new $Uint64(x13.$high + x129.$high, x13.$low + x129.$low); x131 = new $Uint64(x12.$high + x130.$high, x12.$low + x130.$low); x132 = new $Uint64(x11.$high + x131.$high, x11.$low + x131.$low); x133 = new $Uint64(x10.$high + x132.$high, x10.$low + x132.$low); x134 = new $Uint64(x9.$high + x133.$high, x9.$low + x133.$low); x135 = (x$8 = (new $Uint64(0, x8)), new $Uint64(x7.$high + x$8.$high, x7.$low + x$8.$low)); x136 = new $Uint64(x6.$high + x135.$high, x6.$low + x135.$low); x137 = new $Uint64(x5.$high + x136.$high, x5.$low + x136.$low); x138 = new $Uint64(x4.$high + x137.$high, x4.$low + x137.$low); x139 = new $Uint64(x3.$high + x138.$high, x3.$low + x138.$low); x140 = new $Uint64(x2.$high + x139.$high, x2.$low + x139.$low); x141 = new $Uint64(x1.$high + x140.$high, x1.$low + x140.$low); out1.nilCheck, out1[0] = x74; out1.nilCheck, out1[1] = x83; out1.nilCheck, out1[2] = x92; out1.nilCheck, out1[3] = x100; out1.nilCheck, out1[4] = x108; out1.nilCheck, out1[5] = x117; out1.nilCheck, out1[6] = x126; out1.nilCheck, out1[7] = x134; out1.nilCheck, out1[8] = x141; }; p521Selectznz = function(out1, arg1, arg2, arg3) { var arg1, arg2, arg3, out1, x1, x1$24ptr, x2, x2$24ptr, x3, x3$24ptr, x4, x4$24ptr, x5, x5$24ptr, x6, x6$24ptr, x7, x7$24ptr, x8, x8$24ptr, x9, x9$24ptr; x1 = new $Uint64(0, 0); p521CmovznzU64((x1$24ptr || (x1$24ptr = new ptrType(function() { return x1; }, function($v) { x1 = $v; }))), arg1, arg2[0], arg3[0]); x2 = new $Uint64(0, 0); p521CmovznzU64((x2$24ptr || (x2$24ptr = new ptrType(function() { return x2; }, function($v) { x2 = $v; }))), arg1, arg2[1], arg3[1]); x3 = new $Uint64(0, 0); p521CmovznzU64((x3$24ptr || (x3$24ptr = new ptrType(function() { return x3; }, function($v) { x3 = $v; }))), arg1, arg2[2], arg3[2]); x4 = new $Uint64(0, 0); p521CmovznzU64((x4$24ptr || (x4$24ptr = new ptrType(function() { return x4; }, function($v) { x4 = $v; }))), arg1, arg2[3], arg3[3]); x5 = new $Uint64(0, 0); p521CmovznzU64((x5$24ptr || (x5$24ptr = new ptrType(function() { return x5; }, function($v) { x5 = $v; }))), arg1, arg2[4], arg3[4]); x6 = new $Uint64(0, 0); p521CmovznzU64((x6$24ptr || (x6$24ptr = new ptrType(function() { return x6; }, function($v) { x6 = $v; }))), arg1, arg2[5], arg3[5]); x7 = new $Uint64(0, 0); p521CmovznzU64((x7$24ptr || (x7$24ptr = new ptrType(function() { return x7; }, function($v) { x7 = $v; }))), arg1, arg2[6], arg3[6]); x8 = new $Uint64(0, 0); p521CmovznzU64((x8$24ptr || (x8$24ptr = new ptrType(function() { return x8; }, function($v) { x8 = $v; }))), arg1, arg2[7], arg3[7]); x9 = new $Uint64(0, 0); p521CmovznzU64((x9$24ptr || (x9$24ptr = new ptrType(function() { return x9; }, function($v) { x9 = $v; }))), arg1, arg2[8], arg3[8]); out1.nilCheck, out1[0] = x1; out1.nilCheck, out1[1] = x2; out1.nilCheck, out1[2] = x3; out1.nilCheck, out1[3] = x4; out1.nilCheck, out1[4] = x5; out1.nilCheck, out1[5] = x6; out1.nilCheck, out1[6] = x7; out1.nilCheck, out1[7] = x8; out1.nilCheck, out1[8] = x9; }; P521Element.ptr.prototype.One = function() { var e; e = this; P521Element.copy(e, new P521Element.ptr(arrayType.zero())); e.x[0] = new $Uint64(0, 1); return e; }; P521Element.prototype.One = function() { return this.$val.One(); }; P521Element.ptr.prototype.Equal = function(t) { var e, eBytes, t, tBytes; e = this; eBytes = e.Bytes(); tBytes = t.Bytes(); return subtle.ConstantTimeCompare(eBytes, tBytes); }; P521Element.prototype.Equal = function(t) { return this.$val.Equal(t); }; P521Element.ptr.prototype.IsZero = function() { var e, eBytes; e = this; eBytes = e.Bytes(); return subtle.ConstantTimeCompare(eBytes, p521ZeroEncoding); }; P521Element.prototype.IsZero = function() { return this.$val.IsZero(); }; P521Element.ptr.prototype.Set = function(t) { var e, t; e = this; arrayType.copy(e.x, t.x); return e; }; P521Element.prototype.Set = function(t) { return this.$val.Set(t); }; P521Element.ptr.prototype.Bytes = function() { var e, out; e = this; out = arrayType$1.zero(); p521ToBytes(out, e.x); return new sliceType(out); }; P521Element.prototype.Bytes = function() { return this.$val.Bytes(); }; P521Element.ptr.prototype.SetBytes = function(v) { var e, in$1, v; e = this; if (!((v.$length === 66)) || (65 >= v.$length ? ($throwRuntimeError("index out of range"), undefined) : v.$array[v.$offset + 65]) > 1) { return [ptrType$2.nil, errors.New("invalid P-521 field encoding")]; } in$1 = arrayType$1.zero(); $copySlice(new sliceType(in$1), v); p521FromBytes(e.x, in$1); return [e, $ifaceNil]; }; P521Element.prototype.SetBytes = function(v) { return this.$val.SetBytes(v); }; P521Element.ptr.prototype.Add = function(t1, t2) { var e, t1, t2; e = this; p521Add(e.x, t1.x, t2.x); p521Carry(e.x, e.x); return e; }; P521Element.prototype.Add = function(t1, t2) { return this.$val.Add(t1, t2); }; P521Element.ptr.prototype.Sub = function(t1, t2) { var e, t1, t2; e = this; p521Sub(e.x, t1.x, t2.x); p521Carry(e.x, e.x); return e; }; P521Element.prototype.Sub = function(t1, t2) { return this.$val.Sub(t1, t2); }; P521Element.ptr.prototype.Mul = function(t1, t2) { var e, t1, t2; e = this; p521CarryMul(e.x, t1.x, t2.x); return e; }; P521Element.prototype.Mul = function(t1, t2) { return this.$val.Mul(t1, t2); }; P521Element.ptr.prototype.Square = function(t) { var e, t; e = this; p521CarrySquare(e.x, t.x); return e; }; P521Element.prototype.Square = function(t) { return this.$val.Square(t); }; P521Element.ptr.prototype.Select = function(a, b, cond) { var a, b, cond, v; v = this; p521Selectznz(v.x, ((cond << 24 >>> 24)), b.x, a.x); return v; }; P521Element.prototype.Select = function(a, b, cond) { return this.$val.Select(a, b, cond); }; P521Element.ptr.prototype.Invert = function(t) { var _tmp, _tmp$1, e, i, i$1, i$2, i$3, i$4, i$5, i$6, t, t1, t2; e = this; _tmp = new P521Element.ptr(arrayType.zero()); _tmp$1 = new P521Element.ptr(arrayType.zero()); t1 = _tmp; t2 = _tmp$1; t1.Square(t); t1.Mul(t, t1); t2.Square(t1); t2.Square(t2); t1.Mul(t1, t2); t2.Square(t1); i = 0; while (true) { if (!(i < 3)) { break; } t2.Square(t2); i = i + (1) >> 0; } t1.Mul(t1, t2); t2.Square(t1); i$1 = 0; while (true) { if (!(i$1 < 7)) { break; } t2.Square(t2); i$1 = i$1 + (1) >> 0; } t1.Mul(t1, t2); t2.Square(t1); i$2 = 0; while (true) { if (!(i$2 < 15)) { break; } t2.Square(t2); i$2 = i$2 + (1) >> 0; } t1.Mul(t1, t2); t2.Square(t1); i$3 = 0; while (true) { if (!(i$3 < 31)) { break; } t2.Square(t2); i$3 = i$3 + (1) >> 0; } t1.Mul(t1, t2); t2.Square(t1); t2.Mul(t2, t); i$4 = 0; while (true) { if (!(i$4 < 64)) { break; } t2.Square(t2); i$4 = i$4 + (1) >> 0; } t1.Mul(t1, t2); t2.Square(t1); t2.Mul(t2, t); i$5 = 0; while (true) { if (!(i$5 < 129)) { break; } t2.Square(t2); i$5 = i$5 + (1) >> 0; } t1.Mul(t1, t2); t2.Square(t1); t2.Mul(t2, t); i$6 = 0; while (true) { if (!(i$6 < 259)) { break; } t2.Square(t2); i$6 = i$6 + (1) >> 0; } t1.Mul(t1, t2); t1.Square(t1); t1.Square(t1); return e.Mul(t1, t); }; P521Element.prototype.Invert = function(t) { return this.$val.Invert(t); }; ptrType$2.methods = [{prop: "One", name: "One", pkg: "", typ: $funcType([], [ptrType$2], false)}, {prop: "Equal", name: "Equal", pkg: "", typ: $funcType([ptrType$2], [$Int], false)}, {prop: "IsZero", name: "IsZero", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Set", name: "Set", pkg: "", typ: $funcType([ptrType$2], [ptrType$2], false)}, {prop: "Bytes", name: "Bytes", pkg: "", typ: $funcType([], [sliceType], false)}, {prop: "SetBytes", name: "SetBytes", pkg: "", typ: $funcType([sliceType], [ptrType$2, $error], false)}, {prop: "Add", name: "Add", pkg: "", typ: $funcType([ptrType$2, ptrType$2], [ptrType$2], false)}, {prop: "Sub", name: "Sub", pkg: "", typ: $funcType([ptrType$2, ptrType$2], [ptrType$2], false)}, {prop: "Mul", name: "Mul", pkg: "", typ: $funcType([ptrType$2, ptrType$2], [ptrType$2], false)}, {prop: "Square", name: "Square", pkg: "", typ: $funcType([ptrType$2], [ptrType$2], false)}, {prop: "Select", name: "Select", pkg: "", typ: $funcType([ptrType$2, ptrType$2, $Int], [ptrType$2], false)}, {prop: "Invert", name: "Invert", pkg: "", typ: $funcType([ptrType$2], [ptrType$2], false)}]; P521Element.init("crypto/elliptic/internal/fiat", [{prop: "x", name: "x", embedded: false, exported: false, 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 = subtle.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = errors.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = bits.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } p521ZeroEncoding = new P521Element.ptr(arrayType.zero()).Bytes(); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["crypto/elliptic"] = (function() { var $pkg = {}, $init, fiat, io, big, sync, p521Curve, p521Point, p256Curve, p224Curve, p224FieldElement, Curve, CurveParams, ptrType, ptrType$1, arrayType, sliceType, sliceType$1, arrayType$1, ptrType$2, arrayType$2, arrayType$3, arrayType$4, arrayType$5, arrayType$6, arrayType$7, arrayType$8, arrayType$9, sliceType$2, ptrType$3, p521, p256, p256Params, p256RInverse, p256One, p256One$24ptr, p256Precomputed, p256Zero31, p224, p224P, p224ZeroModP31, p224ZeroModP63, mask, initonce, p384, initP521, fiatP521ToBigInt, bigIntToFiatP521, initP256Arch, initP256, p256GetScalar, nonZeroToAllOnes, p256ReduceCarry, p256Sum, p256Diff, p256ReduceDegree, p256Square, p256Mul, p256Assign, p256Invert, p256Scalar3, p256Scalar4, p256Scalar8, p256PointDouble, p256PointAddMixed, p256PointAdd, p256CopyConditional, p256SelectAffinePoint, p256SelectJacobianPoint, p256GetBit, p256ScalarBaseMult, p256PointToAffine, p256ToAffine, p256ScalarMult, p256FromBig, p256ToBig, initP224, P224, p224IsZero, p224Add, p224Sub, p224Mul, p224Square, p224ReduceLarge, p224Reduce, p224Invert, p224Contract, p224AddJacobian, p224DoubleJacobian, p224CopyConditional, p224ScalarMult, p224ToAffine, get28BitsFromEnd, p224FromBig, p224ToBig, matchesSpecificCurve, zForAffine, GenerateKey, Marshal, Unmarshal, initAll, initP384, P256, P384, P521; fiat = $packages["crypto/elliptic/internal/fiat"]; io = $packages["io"]; big = $packages["math/big"]; sync = $packages["sync"]; p521Curve = $pkg.p521Curve = $newType(0, $kindStruct, "elliptic.p521Curve", true, "crypto/elliptic", false, function(CurveParams_) { this.$val = this; if (arguments.length === 0) { this.CurveParams = ptrType.nil; return; } this.CurveParams = CurveParams_; }); p521Point = $pkg.p521Point = $newType(0, $kindStruct, "elliptic.p521Point", true, "crypto/elliptic", false, function(x_, y_, z_) { this.$val = this; if (arguments.length === 0) { this.x = ptrType$2.nil; this.y = ptrType$2.nil; this.z = ptrType$2.nil; return; } this.x = x_; this.y = y_; this.z = z_; }); p256Curve = $pkg.p256Curve = $newType(0, $kindStruct, "elliptic.p256Curve", true, "crypto/elliptic", false, function(CurveParams_) { this.$val = this; if (arguments.length === 0) { this.CurveParams = ptrType.nil; return; } this.CurveParams = CurveParams_; }); p224Curve = $pkg.p224Curve = $newType(0, $kindStruct, "elliptic.p224Curve", true, "crypto/elliptic", false, function(CurveParams_, gx_, gy_, b_) { this.$val = this; if (arguments.length === 0) { this.CurveParams = ptrType.nil; this.gx = arrayType.zero(); this.gy = arrayType.zero(); this.b = arrayType.zero(); return; } this.CurveParams = CurveParams_; this.gx = gx_; this.gy = gy_; this.b = b_; }); p224FieldElement = $pkg.p224FieldElement = $newType(32, $kindArray, "elliptic.p224FieldElement", true, "crypto/elliptic", false, null); Curve = $pkg.Curve = $newType(8, $kindInterface, "elliptic.Curve", true, "crypto/elliptic", true, null); CurveParams = $pkg.CurveParams = $newType(0, $kindStruct, "elliptic.CurveParams", true, "crypto/elliptic", true, function(P_, N_, B_, Gx_, Gy_, BitSize_, Name_) { this.$val = this; if (arguments.length === 0) { this.P = ptrType$1.nil; this.N = ptrType$1.nil; this.B = ptrType$1.nil; this.Gx = ptrType$1.nil; this.Gy = ptrType$1.nil; this.BitSize = 0; this.Name = ""; return; } this.P = P_; this.N = N_; this.B = B_; this.Gx = Gx_; this.Gy = Gy_; this.BitSize = BitSize_; this.Name = Name_; }); ptrType = $ptrType(CurveParams); ptrType$1 = $ptrType(big.Int); arrayType = $arrayType($Uint32, 8); sliceType = $sliceType($Uint32); sliceType$1 = $sliceType($Uint8); arrayType$1 = $arrayType($Uint64, 9); ptrType$2 = $ptrType(fiat.P521Element); arrayType$2 = $arrayType($Uint8, 32); arrayType$3 = $arrayType($Uint32, 9); arrayType$4 = $arrayType($Uint32, 18); arrayType$5 = $arrayType($Uint64, 17); arrayType$6 = $arrayType(arrayType$3, 3); arrayType$7 = $arrayType(arrayType$6, 16); arrayType$8 = $arrayType($Uint64, 15); arrayType$9 = $arrayType($Uint8, 28); sliceType$2 = $sliceType(Curve); ptrType$3 = $ptrType(p521Point); initP521 = function() { var _r, _r$1, _r$2, _r$3, _r$4, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p521.CurveParams = new CurveParams.ptr(ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, 0, "P-521"); _r = new big.Int.ptr(false, big.nat.nil).SetString("6864797660130609714981900799081393217269435300143305409394463459185543183397656052122559640661454554977296311391480858037121987999716643812574028291115057151", 10); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; p521.CurveParams.P = _tuple[0]; _r$1 = new big.Int.ptr(false, big.nat.nil).SetString("6864797660130609714981900799081393217269435300143305409394463459185543183397655394245057746333217197532963996371363321113864768612440380340372808892707005449", 10); /* */ $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; p521.CurveParams.N = _tuple$1[0]; _r$2 = new big.Int.ptr(false, big.nat.nil).SetString("051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00", 16); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$2 = _r$2; p521.CurveParams.B = _tuple$2[0]; _r$3 = new big.Int.ptr(false, big.nat.nil).SetString("c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66", 16); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$3 = _r$3; p521.CurveParams.Gx = _tuple$3[0]; _r$4 = new big.Int.ptr(false, big.nat.nil).SetString("11839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650", 16); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$4 = _r$4; p521.CurveParams.Gy = _tuple$4[0]; p521.CurveParams.BitSize = 521; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: initP521 }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f.$s = $s; $f.$r = $r; return $f; }; p521Curve.ptr.prototype.Params = function() { var curve; curve = this; return curve.CurveParams; }; p521Curve.prototype.Params = function() { return this.$val.Params(); }; p521Curve.ptr.prototype.IsOnCurve = function(x, y) { var _r, _r$1, _r$2, b, curve, threeX, x, x1, x3, y, y1, y2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; b = $f.b; curve = $f.curve; threeX = $f.threeX; x = $f.x; x1 = $f.x1; x3 = $f.x3; y = $f.y; y1 = $f.y1; y2 = $f.y2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: curve = this; _r = bigIntToFiatP521(x); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } x1 = _r; _r$1 = bigIntToFiatP521(y); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } y1 = _r$1; _r$2 = bigIntToFiatP521(curve.CurveParams.B); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } b = _r$2; x3 = new fiat.P521Element.ptr(arrayType$1.zero()).Square(x1); x3.Mul(x3, x1); threeX = new fiat.P521Element.ptr(arrayType$1.zero()).Add(x1, x1); threeX.Add(threeX, x1); x3.Sub(x3, threeX); x3.Add(x3, b); y2 = new fiat.P521Element.ptr(arrayType$1.zero()).Square(y1); $s = -1; return x3.Equal(y2) === 1; /* */ } return; } if ($f === undefined) { $f = { $blk: p521Curve.ptr.prototype.IsOnCurve }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.b = b; $f.curve = curve; $f.threeX = threeX; $f.x = x; $f.x1 = x1; $f.x3 = x3; $f.y = y; $f.y1 = y1; $f.y2 = y2; $f.$s = $s; $f.$r = $r; return $f; }; p521Curve.prototype.IsOnCurve = function(x, y) { return this.$val.IsOnCurve(x, y); }; fiatP521ToBigInt = function(x) { var _i, _q, _ref, _tmp, _tmp$1, i, x, x$1, x$2, xBytes; xBytes = x.Bytes(); _ref = $subslice(xBytes, 0, (_q = xBytes.$length / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; _tmp = (x$1 = (xBytes.$length - i >> 0) - 1 >> 0, ((x$1 < 0 || x$1 >= xBytes.$length) ? ($throwRuntimeError("index out of range"), undefined) : xBytes.$array[xBytes.$offset + x$1])); _tmp$1 = ((i < 0 || i >= xBytes.$length) ? ($throwRuntimeError("index out of range"), undefined) : xBytes.$array[xBytes.$offset + i]); ((i < 0 || i >= xBytes.$length) ? ($throwRuntimeError("index out of range"), undefined) : xBytes.$array[xBytes.$offset + i] = _tmp); (x$2 = (xBytes.$length - i >> 0) - 1 >> 0, ((x$2 < 0 || x$2 >= xBytes.$length) ? ($throwRuntimeError("index out of range"), undefined) : xBytes.$array[xBytes.$offset + x$2] = _tmp$1)); _i++; } return new big.Int.ptr(false, big.nat.nil).SetBytes(xBytes); }; p521Curve.ptr.prototype.affineFromJacobian = function(p) { var _tmp, _tmp$1, _tmp$2, _tmp$3, curve, p, x, xx, y, yy, zinv, zinvsq; x = ptrType$1.nil; y = ptrType$1.nil; curve = this; if (p.z.IsZero() === 1) { _tmp = new big.Int.ptr(false, big.nat.nil); _tmp$1 = new big.Int.ptr(false, big.nat.nil); x = _tmp; y = _tmp$1; return [x, y]; } zinv = new fiat.P521Element.ptr(arrayType$1.zero()).Invert(p.z); zinvsq = new fiat.P521Element.ptr(arrayType$1.zero()).Mul(zinv, zinv); xx = new fiat.P521Element.ptr(arrayType$1.zero()).Mul(p.x, zinvsq); zinvsq.Mul(zinvsq, zinv); yy = new fiat.P521Element.ptr(arrayType$1.zero()).Mul(p.y, zinvsq); _tmp$2 = fiatP521ToBigInt(xx); _tmp$3 = fiatP521ToBigInt(yy); x = _tmp$2; y = _tmp$3; return [x, y]; }; p521Curve.prototype.affineFromJacobian = function(p) { return this.$val.affineFromJacobian(p); }; bigIntToFiatP521 = function(x) { var _i, _q, _r, _r$1, _ref, _tmp, _tmp$1, _tuple, err, i, x, x$1, x$2, x1, xBytes, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _q = $f._q; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; err = $f.err; i = $f.i; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x1 = $f.x1; xBytes = $f.xBytes; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = new big.Int.ptr(false, big.nat.nil).Mod(x, p521.CurveParams.P); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = _r.FillBytes($makeSlice(sliceType$1, 66)); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } xBytes = _r$1; _ref = $subslice(xBytes, 0, (_q = xBytes.$length / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; _tmp = (x$1 = (xBytes.$length - i >> 0) - 1 >> 0, ((x$1 < 0 || x$1 >= xBytes.$length) ? ($throwRuntimeError("index out of range"), undefined) : xBytes.$array[xBytes.$offset + x$1])); _tmp$1 = ((i < 0 || i >= xBytes.$length) ? ($throwRuntimeError("index out of range"), undefined) : xBytes.$array[xBytes.$offset + i]); ((i < 0 || i >= xBytes.$length) ? ($throwRuntimeError("index out of range"), undefined) : xBytes.$array[xBytes.$offset + i] = _tmp); (x$2 = (xBytes.$length - i >> 0) - 1 >> 0, ((x$2 < 0 || x$2 >= xBytes.$length) ? ($throwRuntimeError("index out of range"), undefined) : xBytes.$array[xBytes.$offset + x$2] = _tmp$1)); _i++; } _tuple = new fiat.P521Element.ptr(arrayType$1.zero()).SetBytes(xBytes); x1 = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $panic(new $String("internal error: bigIntToFiatP521")); } $s = -1; return x1; /* */ } return; } if ($f === undefined) { $f = { $blk: bigIntToFiatP521 }; } $f._i = _i; $f._q = _q; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.err = err; $f.i = i; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x1 = x1; $f.xBytes = xBytes; $f.$s = $s; $f.$r = $r; return $f; }; p521Curve.ptr.prototype.jacobianFromAffine = function(x, y) { var $24r, _r, _r$1, curve, x, y, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; curve = $f.curve; x = $f.x; y = $f.y; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: curve = this; if ((x.Sign() === 0) && (y.Sign() === 0)) { $s = -1; return new p521Point.ptr(new fiat.P521Element.ptr(arrayType$1.zero()), new fiat.P521Element.ptr(arrayType$1.zero()), new fiat.P521Element.ptr(arrayType$1.zero())); } _r = bigIntToFiatP521(x); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = bigIntToFiatP521(y); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = new p521Point.ptr(_r, _r$1, new fiat.P521Element.ptr(arrayType$1.zero()).One()); $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: p521Curve.ptr.prototype.jacobianFromAffine }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f.curve = curve; $f.x = x; $f.y = y; $f.$s = $s; $f.$r = $r; return $f; }; p521Curve.prototype.jacobianFromAffine = function(x, y) { return this.$val.jacobianFromAffine(x, y); }; p521Curve.ptr.prototype.Add = function(x1, y1, x2, y2) { var _r, _r$1, curve, p1, p2, x1, x2, y1, y2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; curve = $f.curve; p1 = $f.p1; p2 = $f.p2; x1 = $f.x1; x2 = $f.x2; y1 = $f.y1; y2 = $f.y2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: curve = this; _r = $clone(curve, p521Curve).jacobianFromAffine(x1, y1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } p1 = _r; _r$1 = $clone(curve, p521Curve).jacobianFromAffine(x2, y2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } p2 = _r$1; $s = -1; return $clone(curve, p521Curve).affineFromJacobian(p1.addJacobian(p1, p2)); /* */ } return; } if ($f === undefined) { $f = { $blk: p521Curve.ptr.prototype.Add }; } $f._r = _r; $f._r$1 = _r$1; $f.curve = curve; $f.p1 = p1; $f.p2 = p2; $f.x1 = x1; $f.x2 = x2; $f.y1 = y1; $f.y2 = y2; $f.$s = $s; $f.$r = $r; return $f; }; p521Curve.prototype.Add = function(x1, y1, x2, y2) { return this.$val.Add(x1, y1, x2, y2); }; p521Point.ptr.prototype.addJacobian = function(p1, p2) { var h, i, j, p1, p2, q, r, s1, s2, u1, u2, v, x, xEqual, y, yEqual, z, z1IsZero, z1z1, z2IsZero, z2z2; q = this; z1IsZero = p1.z.IsZero(); z2IsZero = p2.z.IsZero(); z1z1 = new fiat.P521Element.ptr(arrayType$1.zero()).Square(p1.z); z2z2 = new fiat.P521Element.ptr(arrayType$1.zero()).Square(p2.z); u1 = new fiat.P521Element.ptr(arrayType$1.zero()).Mul(p1.x, z2z2); u2 = new fiat.P521Element.ptr(arrayType$1.zero()).Mul(p2.x, z1z1); h = new fiat.P521Element.ptr(arrayType$1.zero()).Sub(u2, u1); xEqual = h.IsZero() === 1; i = new fiat.P521Element.ptr(arrayType$1.zero()).Add(h, h); i.Square(i); j = new fiat.P521Element.ptr(arrayType$1.zero()).Mul(h, i); s1 = new fiat.P521Element.ptr(arrayType$1.zero()).Mul(p1.y, p2.z); s1.Mul(s1, z2z2); s2 = new fiat.P521Element.ptr(arrayType$1.zero()).Mul(p2.y, p1.z); s2.Mul(s2, z1z1); r = new fiat.P521Element.ptr(arrayType$1.zero()).Sub(s2, s1); yEqual = r.IsZero() === 1; if (xEqual && yEqual && (z1IsZero === 0) && (z2IsZero === 0)) { return q.doubleJacobian(p1); } r.Add(r, r); v = new fiat.P521Element.ptr(arrayType$1.zero()).Mul(u1, i); x = new fiat.P521Element.ptr(arrayType$1.zero()).Set(r); x.Square(x); x.Sub(x, j); x.Sub(x, v); x.Sub(x, v); y = new fiat.P521Element.ptr(arrayType$1.zero()).Set(r); v.Sub(v, x); y.Mul(y, v); s1.Mul(s1, j); s1.Add(s1, s1); y.Sub(y, s1); z = new fiat.P521Element.ptr(arrayType$1.zero()).Add(p1.z, p2.z); z.Square(z); z.Sub(z, z1z1); z.Sub(z, z2z2); z.Mul(z, h); x.Select(p2.x, x, z1IsZero); x.Select(p1.x, x, z2IsZero); y.Select(p2.y, y, z1IsZero); y.Select(p1.y, y, z2IsZero); z.Select(p2.z, z, z1IsZero); z.Select(p1.z, z, z2IsZero); q.x.Set(x); q.y.Set(y); q.z.Set(z); return q; }; p521Point.prototype.addJacobian = function(p1, p2) { return this.$val.addJacobian(p1, p2); }; p521Curve.ptr.prototype.Double = function(x1, y1) { var _r, curve, p, x1, y1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; curve = $f.curve; p = $f.p; x1 = $f.x1; y1 = $f.y1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: curve = this; _r = $clone(curve, p521Curve).jacobianFromAffine(x1, y1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } p = _r; $s = -1; return $clone(curve, p521Curve).affineFromJacobian(p.doubleJacobian(p)); /* */ } return; } if ($f === undefined) { $f = { $blk: p521Curve.ptr.prototype.Double }; } $f._r = _r; $f.curve = curve; $f.p = p; $f.x1 = x1; $f.y1 = y1; $f.$s = $s; $f.$r = $r; return $f; }; p521Curve.prototype.Double = function(x1, y1) { return this.$val.Double(x1, y1); }; p521Point.ptr.prototype.doubleJacobian = function(p) { var alpha, alpha2, beta, beta8, delta, gamma, p, q; q = this; delta = new fiat.P521Element.ptr(arrayType$1.zero()).Square(p.z); gamma = new fiat.P521Element.ptr(arrayType$1.zero()).Square(p.y); alpha = new fiat.P521Element.ptr(arrayType$1.zero()).Sub(p.x, delta); alpha2 = new fiat.P521Element.ptr(arrayType$1.zero()).Add(p.x, delta); alpha.Mul(alpha, alpha2); alpha2.Set(alpha); alpha.Add(alpha, alpha); alpha.Add(alpha, alpha2); beta = alpha2.Mul(p.x, gamma); q.x.Square(alpha); beta8 = new fiat.P521Element.ptr(arrayType$1.zero()).Add(beta, beta); beta8.Add(beta8, beta8); beta8.Add(beta8, beta8); q.x.Sub(q.x, beta8); q.z.Add(p.y, p.z); q.z.Square(q.z); q.z.Sub(q.z, gamma); q.z.Sub(q.z, delta); beta.Add(beta, beta); beta.Add(beta, beta); beta.Sub(beta, q.x); q.y.Mul(alpha, beta); gamma.Square(gamma); gamma.Add(gamma, gamma); gamma.Add(gamma, gamma); gamma.Add(gamma, gamma); q.y.Sub(q.y, gamma); return q; }; p521Point.prototype.doubleJacobian = function(p) { return this.$val.doubleJacobian(p); }; p521Curve.ptr.prototype.ScalarMult = function(Bx, By, scalar) { var B, Bx, By, _i, _r, _ref, _tmp, _tmp$1, bit, bitNum, byte$1, curve, p, scalar, t, y, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; B = $f.B; Bx = $f.Bx; By = $f.By; _i = $f._i; _r = $f._r; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; bit = $f.bit; bitNum = $f.bitNum; byte$1 = $f.byte$1; curve = $f.curve; p = $f.p; scalar = $f.scalar; t = $f.t; y = $f.y; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: curve = this; _r = $clone(curve, p521Curve).jacobianFromAffine(Bx, By); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } B = _r; _tmp = new p521Point.ptr(new fiat.P521Element.ptr(arrayType$1.zero()), new fiat.P521Element.ptr(arrayType$1.zero()), new fiat.P521Element.ptr(arrayType$1.zero())); _tmp$1 = new p521Point.ptr(new fiat.P521Element.ptr(arrayType$1.zero()), new fiat.P521Element.ptr(arrayType$1.zero()), new fiat.P521Element.ptr(arrayType$1.zero())); p = _tmp; t = _tmp$1; _ref = scalar; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } byte$1 = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); bitNum = 0; while (true) { if (!(bitNum < 8)) { break; } p.doubleJacobian(p); bit = ((((y = ((7 - bitNum >> 0)), y < 32 ? (byte$1 >>> y) : 0) << 24 >>> 24)) & 1) >>> 0; t.addJacobian(p, B); p.x.Select(t.x, p.x, ((bit >> 0))); p.y.Select(t.y, p.y, ((bit >> 0))); p.z.Select(t.z, p.z, ((bit >> 0))); bitNum = bitNum + (1) >> 0; } _i++; } $s = -1; return $clone(curve, p521Curve).affineFromJacobian(p); /* */ } return; } if ($f === undefined) { $f = { $blk: p521Curve.ptr.prototype.ScalarMult }; } $f.B = B; $f.Bx = Bx; $f.By = By; $f._i = _i; $f._r = _r; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.bit = bit; $f.bitNum = bitNum; $f.byte$1 = byte$1; $f.curve = curve; $f.p = p; $f.scalar = scalar; $f.t = t; $f.y = y; $f.$s = $s; $f.$r = $r; return $f; }; p521Curve.prototype.ScalarMult = function(Bx, By, scalar) { return this.$val.ScalarMult(Bx, By, scalar); }; p521Curve.ptr.prototype.ScalarBaseMult = function(k) { var $24r, _r, curve, k, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; curve = $f.curve; k = $f.k; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: curve = this; _r = $clone(curve, p521Curve).ScalarMult(curve.CurveParams.Gx, curve.CurveParams.Gy, k); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: p521Curve.ptr.prototype.ScalarBaseMult }; } $f.$24r = $24r; $f._r = _r; $f.curve = curve; $f.k = k; $f.$s = $s; $f.$r = $r; return $f; }; p521Curve.prototype.ScalarBaseMult = function(k) { return this.$val.ScalarBaseMult(k); }; initP256Arch = function() { p256Curve.copy(p256, new p256Curve.ptr(p256Params)); }; initP256 = function() { var _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; _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; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p256Params = new CurveParams.ptr(ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, 0, "P-256"); _r = new big.Int.ptr(false, big.nat.nil).SetString("115792089210356248762697446949407573530086143415290314195533631308867097853951", 10); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; p256Params.P = _tuple[0]; _r$1 = new big.Int.ptr(false, big.nat.nil).SetString("115792089210356248762697446949407573529996955224135760342422259061068512044369", 10); /* */ $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; p256Params.N = _tuple$1[0]; _r$2 = new big.Int.ptr(false, big.nat.nil).SetString("5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b", 16); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$2 = _r$2; p256Params.B = _tuple$2[0]; _r$3 = new big.Int.ptr(false, big.nat.nil).SetString("6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296", 16); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$3 = _r$3; p256Params.Gx = _tuple$3[0]; _r$4 = new big.Int.ptr(false, big.nat.nil).SetString("4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5", 16); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$4 = _r$4; p256Params.Gy = _tuple$4[0]; p256Params.BitSize = 256; _r$5 = new big.Int.ptr(false, big.nat.nil).SetString("7fffffff00000001fffffffe8000000100000000ffffffff0000000180000000", 16); /* */ $s = 6; case 6: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$5 = _r$5; p256RInverse = _tuple$5[0]; initP256Arch(); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: initP256 }; } $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._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.$s = $s; $f.$r = $r; return $f; }; p256Curve.ptr.prototype.Params = function() { var curve; curve = this; return curve.CurveParams; }; p256Curve.prototype.Params = function() { return this.$val.Params(); }; p256GetScalar = function(out, in$1) { var _i, _r, _ref, i, in$1, n, out, scalarBytes, v, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _ref = $f._ref; i = $f.i; in$1 = $f.in$1; n = $f.n; out = $f.out; scalarBytes = $f.scalarBytes; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = new big.Int.ptr(false, big.nat.nil).SetBytes(in$1); scalarBytes = sliceType$1.nil; /* */ if (n.Cmp(p256Params.N) >= 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (n.Cmp(p256Params.N) >= 0) { */ case 1: _r = n.Mod(n, p256Params.N); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; scalarBytes = n.Bytes(); $s = 3; continue; /* } else { */ case 2: scalarBytes = in$1; /* } */ case 3: _ref = scalarBytes; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); (x = scalarBytes.$length - ((1 + i >> 0)) >> 0, out.nilCheck, ((x < 0 || x >= out.length) ? ($throwRuntimeError("index out of range"), undefined) : out[x] = v)); _i++; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: p256GetScalar }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f.i = i; $f.in$1 = in$1; $f.n = n; $f.out = out; $f.scalarBytes = scalarBytes; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; p256Curve.ptr.prototype.ScalarBaseMult = function(scalar) { var $24r, _r, _tmp, _tmp$1, _tmp$2, _tuple, scalar, scalarReversed, x, x1, y, y1, z1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tuple = $f._tuple; scalar = $f.scalar; scalarReversed = $f.scalarReversed; x = $f.x; x1 = $f.x1; y = $f.y; y1 = $f.y1; z1 = $f.z1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: scalarReversed = [scalarReversed]; x1 = [x1]; y1 = [y1]; z1 = [z1]; x = ptrType$1.nil; y = ptrType$1.nil; scalarReversed[0] = arrayType$2.zero(); $r = p256GetScalar(scalarReversed[0], scalar); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp = arrayType$3.zero(); _tmp$1 = arrayType$3.zero(); _tmp$2 = arrayType$3.zero(); x1[0] = $clone(_tmp, arrayType$3); y1[0] = $clone(_tmp$1, arrayType$3); z1[0] = $clone(_tmp$2, arrayType$3); p256ScalarBaseMult(x1[0], y1[0], z1[0], scalarReversed[0]); _r = p256ToAffine(x1[0], y1[0], z1[0]); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; x = _tuple[0]; y = _tuple[1]; $24r = [x, y]; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: p256Curve.ptr.prototype.ScalarBaseMult }; } $f.$24r = $24r; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tuple = _tuple; $f.scalar = scalar; $f.scalarReversed = scalarReversed; $f.x = x; $f.x1 = x1; $f.y = y; $f.y1 = y1; $f.z1 = z1; $f.$s = $s; $f.$r = $r; return $f; }; p256Curve.prototype.ScalarBaseMult = function(scalar) { return this.$val.ScalarBaseMult(scalar); }; p256Curve.ptr.prototype.ScalarMult = function(bigX, bigY, scalar) { var $24r, _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tuple, bigX, bigY, px, py, scalar, scalarReversed, x, x1, y, y1, z1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; _tuple = $f._tuple; bigX = $f.bigX; bigY = $f.bigY; px = $f.px; py = $f.py; scalar = $f.scalar; scalarReversed = $f.scalarReversed; x = $f.x; x1 = $f.x1; y = $f.y; y1 = $f.y1; z1 = $f.z1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: px = [px]; py = [py]; scalarReversed = [scalarReversed]; x1 = [x1]; y1 = [y1]; z1 = [z1]; x = ptrType$1.nil; y = ptrType$1.nil; scalarReversed[0] = arrayType$2.zero(); $r = p256GetScalar(scalarReversed[0], scalar); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp = arrayType$3.zero(); _tmp$1 = arrayType$3.zero(); _tmp$2 = arrayType$3.zero(); _tmp$3 = arrayType$3.zero(); _tmp$4 = arrayType$3.zero(); px[0] = $clone(_tmp, arrayType$3); py[0] = $clone(_tmp$1, arrayType$3); x1[0] = $clone(_tmp$2, arrayType$3); y1[0] = $clone(_tmp$3, arrayType$3); z1[0] = $clone(_tmp$4, arrayType$3); $r = p256FromBig(px[0], bigX); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = p256FromBig(py[0], bigY); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } p256ScalarMult(x1[0], y1[0], z1[0], px[0], py[0], scalarReversed[0]); _r = p256ToAffine(x1[0], y1[0], z1[0]); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; x = _tuple[0]; y = _tuple[1]; $24r = [x, y]; $s = 5; case 5: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: p256Curve.ptr.prototype.ScalarMult }; } $f.$24r = $24r; $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._tuple = _tuple; $f.bigX = bigX; $f.bigY = bigY; $f.px = px; $f.py = py; $f.scalar = scalar; $f.scalarReversed = scalarReversed; $f.x = x; $f.x1 = x1; $f.y = y; $f.y1 = y1; $f.z1 = z1; $f.$s = $s; $f.$r = $r; return $f; }; p256Curve.prototype.ScalarMult = function(bigX, bigY, scalar) { return this.$val.ScalarMult(bigX, bigY, scalar); }; nonZeroToAllOnes = function(x) { var x; return ((((x - 1 >>> 0)) >>> 31 >>> 0)) - 1 >>> 0; }; p256ReduceCarry = function(inout, carry) { var carry, carry_mask, inout; carry_mask = nonZeroToAllOnes(carry); inout[0] = (inout[0] + ((carry << 1 >>> 0)) >>> 0); inout[3] = (inout[3] + (((268435456 & carry_mask) >>> 0)) >>> 0); inout[3] = (inout[3] - ((carry << 11 >>> 0)) >>> 0); inout[4] = (inout[4] + (((536870911 & carry_mask) >>> 0)) >>> 0); inout[5] = (inout[5] + (((268435455 & carry_mask) >>> 0)) >>> 0); inout[6] = (inout[6] + (((536870911 & carry_mask) >>> 0)) >>> 0); inout[6] = (inout[6] - ((carry << 22 >>> 0)) >>> 0); inout[7] = (inout[7] - (((1 & carry_mask) >>> 0)) >>> 0); inout[7] = (inout[7] + ((carry << 25 >>> 0)) >>> 0); }; p256Sum = function(out, in$1, in2) { var carry, i, in$1, in2, out, x, x$1, x$10, x$11, x$12, x$13, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; carry = 0; i = 0; while (true) { out.nilCheck, ((i < 0 || i >= out.length) ? ($throwRuntimeError("index out of range"), undefined) : out[i] = ((x = in$1, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i])) + (x$1 = in2, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i])) >>> 0)); (x$3 = out, ((i < 0 || i >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[i] = ((x$2 = out, ((i < 0 || i >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i])) + (carry) >>> 0))); carry = (x$4 = out, ((i < 0 || i >= x$4.length) ? ($throwRuntimeError("index out of range"), undefined) : x$4[i])) >>> 29 >>> 0; (x$6 = out, ((i < 0 || i >= x$6.length) ? ($throwRuntimeError("index out of range"), undefined) : x$6[i] = (((x$5 = out, ((i < 0 || i >= x$5.length) ? ($throwRuntimeError("index out of range"), undefined) : x$5[i])) & (536870911)) >>> 0))); i = i + (1) >> 0; if (i === 9) { break; } out.nilCheck, ((i < 0 || i >= out.length) ? ($throwRuntimeError("index out of range"), undefined) : out[i] = ((x$7 = in$1, ((i < 0 || i >= x$7.length) ? ($throwRuntimeError("index out of range"), undefined) : x$7[i])) + (x$8 = in2, ((i < 0 || i >= x$8.length) ? ($throwRuntimeError("index out of range"), undefined) : x$8[i])) >>> 0)); (x$10 = out, ((i < 0 || i >= x$10.length) ? ($throwRuntimeError("index out of range"), undefined) : x$10[i] = ((x$9 = out, ((i < 0 || i >= x$9.length) ? ($throwRuntimeError("index out of range"), undefined) : x$9[i])) + (carry) >>> 0))); carry = (x$11 = out, ((i < 0 || i >= x$11.length) ? ($throwRuntimeError("index out of range"), undefined) : x$11[i])) >>> 28 >>> 0; (x$13 = out, ((i < 0 || i >= x$13.length) ? ($throwRuntimeError("index out of range"), undefined) : x$13[i] = (((x$12 = out, ((i < 0 || i >= x$12.length) ? ($throwRuntimeError("index out of range"), undefined) : x$12[i])) & (268435455)) >>> 0))); i = i + (1) >> 0; } p256ReduceCarry(out, carry); }; p256Diff = function(out, in$1, in2) { var carry, i, in$1, in2, out, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$16, x$17, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; carry = 0; i = 0; while (true) { out.nilCheck, ((i < 0 || i >= out.length) ? ($throwRuntimeError("index out of range"), undefined) : out[i] = ((x = in$1, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i])) - (x$1 = in2, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i])) >>> 0)); (x$3 = out, ((i < 0 || i >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[i] = ((x$2 = out, ((i < 0 || i >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i])) + (((i < 0 || i >= p256Zero31.length) ? ($throwRuntimeError("index out of range"), undefined) : p256Zero31[i])) >>> 0))); (x$5 = out, ((i < 0 || i >= x$5.length) ? ($throwRuntimeError("index out of range"), undefined) : x$5[i] = ((x$4 = out, ((i < 0 || i >= x$4.length) ? ($throwRuntimeError("index out of range"), undefined) : x$4[i])) + (carry) >>> 0))); carry = (x$6 = out, ((i < 0 || i >= x$6.length) ? ($throwRuntimeError("index out of range"), undefined) : x$6[i])) >>> 29 >>> 0; (x$8 = out, ((i < 0 || i >= x$8.length) ? ($throwRuntimeError("index out of range"), undefined) : x$8[i] = (((x$7 = out, ((i < 0 || i >= x$7.length) ? ($throwRuntimeError("index out of range"), undefined) : x$7[i])) & (536870911)) >>> 0))); i = i + (1) >> 0; if (i === 9) { break; } out.nilCheck, ((i < 0 || i >= out.length) ? ($throwRuntimeError("index out of range"), undefined) : out[i] = ((x$9 = in$1, ((i < 0 || i >= x$9.length) ? ($throwRuntimeError("index out of range"), undefined) : x$9[i])) - (x$10 = in2, ((i < 0 || i >= x$10.length) ? ($throwRuntimeError("index out of range"), undefined) : x$10[i])) >>> 0)); (x$12 = out, ((i < 0 || i >= x$12.length) ? ($throwRuntimeError("index out of range"), undefined) : x$12[i] = ((x$11 = out, ((i < 0 || i >= x$11.length) ? ($throwRuntimeError("index out of range"), undefined) : x$11[i])) + (((i < 0 || i >= p256Zero31.length) ? ($throwRuntimeError("index out of range"), undefined) : p256Zero31[i])) >>> 0))); (x$14 = out, ((i < 0 || i >= x$14.length) ? ($throwRuntimeError("index out of range"), undefined) : x$14[i] = ((x$13 = out, ((i < 0 || i >= x$13.length) ? ($throwRuntimeError("index out of range"), undefined) : x$13[i])) + (carry) >>> 0))); carry = (x$15 = out, ((i < 0 || i >= x$15.length) ? ($throwRuntimeError("index out of range"), undefined) : x$15[i])) >>> 28 >>> 0; (x$17 = out, ((i < 0 || i >= x$17.length) ? ($throwRuntimeError("index out of range"), undefined) : x$17[i] = (((x$16 = out, ((i < 0 || i >= x$16.length) ? ($throwRuntimeError("index out of range"), undefined) : x$16[i])) & (268435455)) >>> 0))); i = i + (1) >> 0; } p256ReduceCarry(out, carry); }; p256ReduceDegree = function(out, tmp) { var _index, _index$1, _index$10, _index$11, _index$12, _index$13, _index$14, _index$15, _index$16, _index$17, _index$18, _index$19, _index$2, _index$20, _index$21, _index$22, _index$23, _index$24, _index$3, _index$4, _index$5, _index$6, _index$7, _index$8, _index$9, _tmp, _tmp$1, _tmp$2, carry, i, i$1, i$2, out, tmp, tmp2, 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$3, x$4, x$5, x$6, x$7, x$8, x$9, xMask; tmp2 = arrayType$4.zero(); _tmp = 0; _tmp$1 = 0; _tmp$2 = 0; carry = _tmp; x = _tmp$1; xMask = _tmp$2; tmp2[0] = ((((tmp[0].$low >>> 0)) & 536870911) >>> 0); tmp2[1] = (((tmp[0].$low >>> 0)) >>> 29 >>> 0); tmp2[1] = ((tmp2[1] | ((((((($shiftRightUint64(tmp[0], 32).$low >>> 0)) << 3 >>> 0)) & 268435455) >>> 0))) >>> 0); tmp2[1] = (tmp2[1] + (((((tmp[1].$low >>> 0)) & 268435455) >>> 0)) >>> 0); carry = tmp2[1] >>> 28 >>> 0; tmp2[1] = ((tmp2[1] & (268435455)) >>> 0); i = 2; while (true) { if (!(i < 17)) { break; } ((i < 0 || i >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[i] = (((($shiftRightUint64((x$1 = i - 2 >> 0, ((x$1 < 0 || x$1 >= tmp.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp[x$1])), 32).$low >>> 0))) >>> 25 >>> 0)); ((i < 0 || i >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[i] = (((i < 0 || i >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[i]) + ((((((x$2 = i - 1 >> 0, ((x$2 < 0 || x$2 >= tmp.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp[x$2])).$low >>> 0))) >>> 28 >>> 0)) >>> 0)); ((i < 0 || i >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[i] = (((i < 0 || i >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[i]) + ((((((($shiftRightUint64((x$3 = i - 1 >> 0, ((x$3 < 0 || x$3 >= tmp.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp[x$3])), 32).$low >>> 0)) << 4 >>> 0)) & 536870911) >>> 0)) >>> 0)); ((i < 0 || i >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[i] = (((i < 0 || i >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[i]) + (((((((i < 0 || i >= tmp.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp[i]).$low >>> 0)) & 536870911) >>> 0)) >>> 0)); ((i < 0 || i >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[i] = (((i < 0 || i >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[i]) + (carry) >>> 0)); carry = ((i < 0 || i >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[i]) >>> 29 >>> 0; ((i < 0 || i >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[i] = ((((i < 0 || i >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[i]) & (536870911)) >>> 0)); i = i + (1) >> 0; if (i === 17) { break; } ((i < 0 || i >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[i] = ((($shiftRightUint64((x$4 = i - 2 >> 0, ((x$4 < 0 || x$4 >= tmp.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp[x$4])), 32).$low >>> 0)) >>> 25 >>> 0)); ((i < 0 || i >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[i] = (((i < 0 || i >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[i]) + (((((x$5 = i - 1 >> 0, ((x$5 < 0 || x$5 >= tmp.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp[x$5])).$low >>> 0)) >>> 29 >>> 0)) >>> 0)); ((i < 0 || i >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[i] = (((i < 0 || i >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[i]) + (((((((($shiftRightUint64((x$6 = i - 1 >> 0, ((x$6 < 0 || x$6 >= tmp.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp[x$6])), 32).$low >>> 0))) << 3 >>> 0)) & 268435455) >>> 0)) >>> 0)); ((i < 0 || i >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[i] = (((i < 0 || i >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[i]) + (((((((i < 0 || i >= tmp.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp[i]).$low >>> 0)) & 268435455) >>> 0)) >>> 0)); ((i < 0 || i >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[i] = (((i < 0 || i >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[i]) + (carry) >>> 0)); carry = ((i < 0 || i >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[i]) >>> 28 >>> 0; ((i < 0 || i >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[i] = ((((i < 0 || i >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[i]) & (268435455)) >>> 0)); i = i + (1) >> 0; } tmp2[17] = ((($shiftRightUint64(tmp[15], 32).$low >>> 0)) >>> 25 >>> 0); tmp2[17] = (tmp2[17] + ((((tmp[16].$low >>> 0)) >>> 29 >>> 0)) >>> 0); tmp2[17] = (tmp2[17] + (((($shiftRightUint64(tmp[16], 32).$low >>> 0)) << 3 >>> 0)) >>> 0); tmp2[17] = (tmp2[17] + (carry) >>> 0); i$1 = 0; while (true) { _index = i$1 + 1 >> 0; ((_index < 0 || _index >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index] = (((_index < 0 || _index >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index]) + ((((i$1 < 0 || i$1 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[i$1]) >>> 29 >>> 0)) >>> 0)); x = (((i$1 < 0 || i$1 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[i$1]) & 536870911) >>> 0; xMask = nonZeroToAllOnes(x); ((i$1 < 0 || i$1 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[i$1] = 0); _index$1 = i$1 + 3 >> 0; ((_index$1 < 0 || _index$1 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$1] = (((_index$1 < 0 || _index$1 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$1]) + (((((x << 10 >>> 0)) & 268435455) >>> 0)) >>> 0)); _index$2 = i$1 + 4 >> 0; ((_index$2 < 0 || _index$2 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$2] = (((_index$2 < 0 || _index$2 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$2]) + (((x >>> 18 >>> 0))) >>> 0)); _index$3 = i$1 + 6 >> 0; ((_index$3 < 0 || _index$3 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$3] = (((_index$3 < 0 || _index$3 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$3]) + (((((x << 21 >>> 0)) & 536870911) >>> 0)) >>> 0)); _index$4 = i$1 + 7 >> 0; ((_index$4 < 0 || _index$4 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$4] = (((_index$4 < 0 || _index$4 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$4]) + ((x >>> 8 >>> 0)) >>> 0)); _index$5 = i$1 + 7 >> 0; ((_index$5 < 0 || _index$5 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$5] = (((_index$5 < 0 || _index$5 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$5]) + (((268435456 & xMask) >>> 0)) >>> 0)); _index$6 = i$1 + 8 >> 0; ((_index$6 < 0 || _index$6 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$6] = (((_index$6 < 0 || _index$6 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$6]) + (((((x - 1 >>> 0)) & xMask) >>> 0)) >>> 0)); _index$7 = i$1 + 7 >> 0; ((_index$7 < 0 || _index$7 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$7] = (((_index$7 < 0 || _index$7 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$7]) - (((((x << 24 >>> 0)) & 268435455) >>> 0)) >>> 0)); _index$8 = i$1 + 8 >> 0; ((_index$8 < 0 || _index$8 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$8] = (((_index$8 < 0 || _index$8 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$8]) - ((x >>> 4 >>> 0)) >>> 0)); _index$9 = i$1 + 8 >> 0; ((_index$9 < 0 || _index$9 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$9] = (((_index$9 < 0 || _index$9 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$9]) + (((536870912 & xMask) >>> 0)) >>> 0)); _index$10 = i$1 + 8 >> 0; ((_index$10 < 0 || _index$10 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$10] = (((_index$10 < 0 || _index$10 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$10]) - (x) >>> 0)); _index$11 = i$1 + 8 >> 0; ((_index$11 < 0 || _index$11 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$11] = (((_index$11 < 0 || _index$11 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$11]) + (((((x << 28 >>> 0)) & 536870911) >>> 0)) >>> 0)); _index$12 = i$1 + 9 >> 0; ((_index$12 < 0 || _index$12 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$12] = (((_index$12 < 0 || _index$12 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$12]) + (((((((x >>> 1 >>> 0)) - 1 >>> 0)) & xMask) >>> 0)) >>> 0)); if ((i$1 + 1 >> 0) === 9) { break; } _index$13 = i$1 + 2 >> 0; ((_index$13 < 0 || _index$13 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$13] = (((_index$13 < 0 || _index$13 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$13]) + (((x$7 = i$1 + 1 >> 0, ((x$7 < 0 || x$7 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[x$7])) >>> 28 >>> 0)) >>> 0)); x = ((x$8 = i$1 + 1 >> 0, ((x$8 < 0 || x$8 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[x$8])) & 268435455) >>> 0; xMask = nonZeroToAllOnes(x); (x$9 = i$1 + 1 >> 0, ((x$9 < 0 || x$9 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[x$9] = 0)); _index$14 = i$1 + 4 >> 0; ((_index$14 < 0 || _index$14 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$14] = (((_index$14 < 0 || _index$14 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$14]) + (((((x << 11 >>> 0)) & 536870911) >>> 0)) >>> 0)); _index$15 = i$1 + 5 >> 0; ((_index$15 < 0 || _index$15 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$15] = (((_index$15 < 0 || _index$15 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$15]) + (((x >>> 18 >>> 0))) >>> 0)); _index$16 = i$1 + 7 >> 0; ((_index$16 < 0 || _index$16 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$16] = (((_index$16 < 0 || _index$16 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$16]) + (((((x << 21 >>> 0)) & 268435455) >>> 0)) >>> 0)); _index$17 = i$1 + 8 >> 0; ((_index$17 < 0 || _index$17 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$17] = (((_index$17 < 0 || _index$17 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$17]) + ((x >>> 7 >>> 0)) >>> 0)); _index$18 = i$1 + 8 >> 0; ((_index$18 < 0 || _index$18 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$18] = (((_index$18 < 0 || _index$18 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$18]) + (((536870912 & xMask) >>> 0)) >>> 0)); _index$19 = i$1 + 9 >> 0; ((_index$19 < 0 || _index$19 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$19] = (((_index$19 < 0 || _index$19 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$19]) + (((((x - 1 >>> 0)) & xMask) >>> 0)) >>> 0)); _index$20 = i$1 + 8 >> 0; ((_index$20 < 0 || _index$20 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$20] = (((_index$20 < 0 || _index$20 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$20]) - (((((x << 25 >>> 0)) & 536870911) >>> 0)) >>> 0)); _index$21 = i$1 + 9 >> 0; ((_index$21 < 0 || _index$21 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$21] = (((_index$21 < 0 || _index$21 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$21]) - ((x >>> 4 >>> 0)) >>> 0)); _index$22 = i$1 + 9 >> 0; ((_index$22 < 0 || _index$22 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$22] = (((_index$22 < 0 || _index$22 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$22]) + (((268435456 & xMask) >>> 0)) >>> 0)); _index$23 = i$1 + 9 >> 0; ((_index$23 < 0 || _index$23 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$23] = (((_index$23 < 0 || _index$23 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$23]) - (x) >>> 0)); _index$24 = i$1 + 10 >> 0; ((_index$24 < 0 || _index$24 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$24] = (((_index$24 < 0 || _index$24 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[_index$24]) + (((((x - 1 >>> 0)) & xMask) >>> 0)) >>> 0)); i$1 = i$1 + (2) >> 0; } carry = 0; i$2 = 0; while (true) { if (!(i$2 < 8)) { break; } out.nilCheck, ((i$2 < 0 || i$2 >= out.length) ? ($throwRuntimeError("index out of range"), undefined) : out[i$2] = (x$10 = i$2 + 9 >> 0, ((x$10 < 0 || x$10 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[x$10]))); (x$12 = out, ((i$2 < 0 || i$2 >= x$12.length) ? ($throwRuntimeError("index out of range"), undefined) : x$12[i$2] = ((x$11 = out, ((i$2 < 0 || i$2 >= x$11.length) ? ($throwRuntimeError("index out of range"), undefined) : x$11[i$2])) + (carry) >>> 0))); (x$15 = out, ((i$2 < 0 || i$2 >= x$15.length) ? ($throwRuntimeError("index out of range"), undefined) : x$15[i$2] = ((x$13 = out, ((i$2 < 0 || i$2 >= x$13.length) ? ($throwRuntimeError("index out of range"), undefined) : x$13[i$2])) + ((((((x$14 = i$2 + 10 >> 0, ((x$14 < 0 || x$14 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[x$14])) << 28 >>> 0)) & 536870911) >>> 0)) >>> 0))); carry = (x$16 = out, ((i$2 < 0 || i$2 >= x$16.length) ? ($throwRuntimeError("index out of range"), undefined) : x$16[i$2])) >>> 29 >>> 0; (x$18 = out, ((i$2 < 0 || i$2 >= x$18.length) ? ($throwRuntimeError("index out of range"), undefined) : x$18[i$2] = (((x$17 = out, ((i$2 < 0 || i$2 >= x$17.length) ? ($throwRuntimeError("index out of range"), undefined) : x$17[i$2])) & (536870911)) >>> 0))); i$2 = i$2 + (1) >> 0; out.nilCheck, ((i$2 < 0 || i$2 >= out.length) ? ($throwRuntimeError("index out of range"), undefined) : out[i$2] = ((x$19 = i$2 + 9 >> 0, ((x$19 < 0 || x$19 >= tmp2.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp2[x$19])) >>> 1 >>> 0)); (x$21 = out, ((i$2 < 0 || i$2 >= x$21.length) ? ($throwRuntimeError("index out of range"), undefined) : x$21[i$2] = ((x$20 = out, ((i$2 < 0 || i$2 >= x$20.length) ? ($throwRuntimeError("index out of range"), undefined) : x$20[i$2])) + (carry) >>> 0))); carry = (x$22 = out, ((i$2 < 0 || i$2 >= x$22.length) ? ($throwRuntimeError("index out of range"), undefined) : x$22[i$2])) >>> 28 >>> 0; (x$24 = out, ((i$2 < 0 || i$2 >= x$24.length) ? ($throwRuntimeError("index out of range"), undefined) : x$24[i$2] = (((x$23 = out, ((i$2 < 0 || i$2 >= x$23.length) ? ($throwRuntimeError("index out of range"), undefined) : x$23[i$2])) & (268435455)) >>> 0))); i$2 = i$2 + (1) >> 0; } out.nilCheck, out[8] = tmp2[17]; out[8] = (out[8] + (carry) >>> 0); carry = out[8] >>> 29 >>> 0; out[8] = ((out[8] & (536870911)) >>> 0); p256ReduceCarry(out, carry); }; p256Square = function(out, in$1) { var in$1, out, tmp, 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$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$6, x$7, x$8, x$9; tmp = arrayType$5.zero(); tmp[0] = $mul64((new $Uint64(0, in$1[0])), (new $Uint64(0, in$1[0]))); tmp[1] = $mul64((new $Uint64(0, in$1[0])), ($shiftLeft64((new $Uint64(0, in$1[1])), 1))); tmp[2] = (x = $mul64((new $Uint64(0, in$1[0])), ($shiftLeft64((new $Uint64(0, in$1[2])), 1))), x$1 = $mul64((new $Uint64(0, in$1[1])), ($shiftLeft64((new $Uint64(0, in$1[1])), 1))), new $Uint64(x.$high + x$1.$high, x.$low + x$1.$low)); tmp[3] = (x$2 = $mul64((new $Uint64(0, in$1[0])), ($shiftLeft64((new $Uint64(0, in$1[3])), 1))), x$3 = $mul64((new $Uint64(0, in$1[1])), ($shiftLeft64((new $Uint64(0, in$1[2])), 1))), new $Uint64(x$2.$high + x$3.$high, x$2.$low + x$3.$low)); tmp[4] = (x$4 = (x$5 = $mul64((new $Uint64(0, in$1[0])), ($shiftLeft64((new $Uint64(0, in$1[4])), 1))), x$6 = $mul64((new $Uint64(0, in$1[1])), ($shiftLeft64((new $Uint64(0, in$1[3])), 2))), new $Uint64(x$5.$high + x$6.$high, x$5.$low + x$6.$low)), x$7 = $mul64((new $Uint64(0, in$1[2])), (new $Uint64(0, in$1[2]))), new $Uint64(x$4.$high + x$7.$high, x$4.$low + x$7.$low)); tmp[5] = (x$8 = (x$9 = $mul64((new $Uint64(0, in$1[0])), ($shiftLeft64((new $Uint64(0, in$1[5])), 1))), x$10 = $mul64((new $Uint64(0, in$1[1])), ($shiftLeft64((new $Uint64(0, in$1[4])), 1))), new $Uint64(x$9.$high + x$10.$high, x$9.$low + x$10.$low)), x$11 = $mul64((new $Uint64(0, in$1[2])), ($shiftLeft64((new $Uint64(0, in$1[3])), 1))), new $Uint64(x$8.$high + x$11.$high, x$8.$low + x$11.$low)); tmp[6] = (x$12 = (x$13 = (x$14 = $mul64((new $Uint64(0, in$1[0])), ($shiftLeft64((new $Uint64(0, in$1[6])), 1))), x$15 = $mul64((new $Uint64(0, in$1[1])), ($shiftLeft64((new $Uint64(0, in$1[5])), 2))), new $Uint64(x$14.$high + x$15.$high, x$14.$low + x$15.$low)), x$16 = $mul64((new $Uint64(0, in$1[2])), ($shiftLeft64((new $Uint64(0, in$1[4])), 1))), new $Uint64(x$13.$high + x$16.$high, x$13.$low + x$16.$low)), x$17 = $mul64((new $Uint64(0, in$1[3])), ($shiftLeft64((new $Uint64(0, in$1[3])), 1))), new $Uint64(x$12.$high + x$17.$high, x$12.$low + x$17.$low)); tmp[7] = (x$18 = (x$19 = (x$20 = $mul64((new $Uint64(0, in$1[0])), ($shiftLeft64((new $Uint64(0, in$1[7])), 1))), x$21 = $mul64((new $Uint64(0, in$1[1])), ($shiftLeft64((new $Uint64(0, in$1[6])), 1))), new $Uint64(x$20.$high + x$21.$high, x$20.$low + x$21.$low)), x$22 = $mul64((new $Uint64(0, in$1[2])), ($shiftLeft64((new $Uint64(0, in$1[5])), 1))), new $Uint64(x$19.$high + x$22.$high, x$19.$low + x$22.$low)), x$23 = $mul64((new $Uint64(0, in$1[3])), ($shiftLeft64((new $Uint64(0, in$1[4])), 1))), new $Uint64(x$18.$high + x$23.$high, x$18.$low + x$23.$low)); tmp[8] = (x$24 = (x$25 = (x$26 = (x$27 = $mul64((new $Uint64(0, in$1[0])), ($shiftLeft64((new $Uint64(0, in$1[8])), 1))), x$28 = $mul64((new $Uint64(0, in$1[1])), ($shiftLeft64((new $Uint64(0, in$1[7])), 2))), new $Uint64(x$27.$high + x$28.$high, x$27.$low + x$28.$low)), x$29 = $mul64((new $Uint64(0, in$1[2])), ($shiftLeft64((new $Uint64(0, in$1[6])), 1))), new $Uint64(x$26.$high + x$29.$high, x$26.$low + x$29.$low)), x$30 = $mul64((new $Uint64(0, in$1[3])), ($shiftLeft64((new $Uint64(0, in$1[5])), 2))), new $Uint64(x$25.$high + x$30.$high, x$25.$low + x$30.$low)), x$31 = $mul64((new $Uint64(0, in$1[4])), (new $Uint64(0, in$1[4]))), new $Uint64(x$24.$high + x$31.$high, x$24.$low + x$31.$low)); tmp[9] = (x$32 = (x$33 = (x$34 = $mul64((new $Uint64(0, in$1[1])), ($shiftLeft64((new $Uint64(0, in$1[8])), 1))), x$35 = $mul64((new $Uint64(0, in$1[2])), ($shiftLeft64((new $Uint64(0, in$1[7])), 1))), new $Uint64(x$34.$high + x$35.$high, x$34.$low + x$35.$low)), x$36 = $mul64((new $Uint64(0, in$1[3])), ($shiftLeft64((new $Uint64(0, in$1[6])), 1))), new $Uint64(x$33.$high + x$36.$high, x$33.$low + x$36.$low)), x$37 = $mul64((new $Uint64(0, in$1[4])), ($shiftLeft64((new $Uint64(0, in$1[5])), 1))), new $Uint64(x$32.$high + x$37.$high, x$32.$low + x$37.$low)); tmp[10] = (x$38 = (x$39 = (x$40 = $mul64((new $Uint64(0, in$1[2])), ($shiftLeft64((new $Uint64(0, in$1[8])), 1))), x$41 = $mul64((new $Uint64(0, in$1[3])), ($shiftLeft64((new $Uint64(0, in$1[7])), 2))), new $Uint64(x$40.$high + x$41.$high, x$40.$low + x$41.$low)), x$42 = $mul64((new $Uint64(0, in$1[4])), ($shiftLeft64((new $Uint64(0, in$1[6])), 1))), new $Uint64(x$39.$high + x$42.$high, x$39.$low + x$42.$low)), x$43 = $mul64((new $Uint64(0, in$1[5])), ($shiftLeft64((new $Uint64(0, in$1[5])), 1))), new $Uint64(x$38.$high + x$43.$high, x$38.$low + x$43.$low)); tmp[11] = (x$44 = (x$45 = $mul64((new $Uint64(0, in$1[3])), ($shiftLeft64((new $Uint64(0, in$1[8])), 1))), x$46 = $mul64((new $Uint64(0, in$1[4])), ($shiftLeft64((new $Uint64(0, in$1[7])), 1))), new $Uint64(x$45.$high + x$46.$high, x$45.$low + x$46.$low)), x$47 = $mul64((new $Uint64(0, in$1[5])), ($shiftLeft64((new $Uint64(0, in$1[6])), 1))), new $Uint64(x$44.$high + x$47.$high, x$44.$low + x$47.$low)); tmp[12] = (x$48 = (x$49 = $mul64((new $Uint64(0, in$1[4])), ($shiftLeft64((new $Uint64(0, in$1[8])), 1))), x$50 = $mul64((new $Uint64(0, in$1[5])), ($shiftLeft64((new $Uint64(0, in$1[7])), 2))), new $Uint64(x$49.$high + x$50.$high, x$49.$low + x$50.$low)), x$51 = $mul64((new $Uint64(0, in$1[6])), (new $Uint64(0, in$1[6]))), new $Uint64(x$48.$high + x$51.$high, x$48.$low + x$51.$low)); tmp[13] = (x$52 = $mul64((new $Uint64(0, in$1[5])), ($shiftLeft64((new $Uint64(0, in$1[8])), 1))), x$53 = $mul64((new $Uint64(0, in$1[6])), ($shiftLeft64((new $Uint64(0, in$1[7])), 1))), new $Uint64(x$52.$high + x$53.$high, x$52.$low + x$53.$low)); tmp[14] = (x$54 = $mul64((new $Uint64(0, in$1[6])), ($shiftLeft64((new $Uint64(0, in$1[8])), 1))), x$55 = $mul64((new $Uint64(0, in$1[7])), ($shiftLeft64((new $Uint64(0, in$1[7])), 1))), new $Uint64(x$54.$high + x$55.$high, x$54.$low + x$55.$low)); tmp[15] = $mul64((new $Uint64(0, in$1[7])), ($shiftLeft64((new $Uint64(0, in$1[8])), 1))); tmp[16] = $mul64((new $Uint64(0, in$1[8])), (new $Uint64(0, in$1[8]))); p256ReduceDegree(out, $clone(tmp, arrayType$5)); }; p256Mul = function(out, in$1, in2) { var in$1, in2, out, tmp, 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$125, x$126, x$127, 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; tmp = arrayType$5.zero(); tmp[0] = $mul64((new $Uint64(0, in$1[0])), (new $Uint64(0, in2[0]))); tmp[1] = (x = $mul64((new $Uint64(0, in$1[0])), ($shiftLeft64((new $Uint64(0, in2[1])), 0))), x$1 = $mul64((new $Uint64(0, in$1[1])), ($shiftLeft64((new $Uint64(0, in2[0])), 0))), new $Uint64(x.$high + x$1.$high, x.$low + x$1.$low)); tmp[2] = (x$2 = (x$3 = $mul64((new $Uint64(0, in$1[0])), ($shiftLeft64((new $Uint64(0, in2[2])), 0))), x$4 = $mul64((new $Uint64(0, in$1[1])), ($shiftLeft64((new $Uint64(0, in2[1])), 1))), new $Uint64(x$3.$high + x$4.$high, x$3.$low + x$4.$low)), x$5 = $mul64((new $Uint64(0, in$1[2])), ($shiftLeft64((new $Uint64(0, in2[0])), 0))), new $Uint64(x$2.$high + x$5.$high, x$2.$low + x$5.$low)); tmp[3] = (x$6 = (x$7 = (x$8 = $mul64((new $Uint64(0, in$1[0])), ($shiftLeft64((new $Uint64(0, in2[3])), 0))), x$9 = $mul64((new $Uint64(0, in$1[1])), ($shiftLeft64((new $Uint64(0, in2[2])), 0))), new $Uint64(x$8.$high + x$9.$high, x$8.$low + x$9.$low)), x$10 = $mul64((new $Uint64(0, in$1[2])), ($shiftLeft64((new $Uint64(0, in2[1])), 0))), new $Uint64(x$7.$high + x$10.$high, x$7.$low + x$10.$low)), x$11 = $mul64((new $Uint64(0, in$1[3])), ($shiftLeft64((new $Uint64(0, in2[0])), 0))), new $Uint64(x$6.$high + x$11.$high, x$6.$low + x$11.$low)); tmp[4] = (x$12 = (x$13 = (x$14 = (x$15 = $mul64((new $Uint64(0, in$1[0])), ($shiftLeft64((new $Uint64(0, in2[4])), 0))), x$16 = $mul64((new $Uint64(0, in$1[1])), ($shiftLeft64((new $Uint64(0, in2[3])), 1))), new $Uint64(x$15.$high + x$16.$high, x$15.$low + x$16.$low)), x$17 = $mul64((new $Uint64(0, in$1[2])), ($shiftLeft64((new $Uint64(0, in2[2])), 0))), new $Uint64(x$14.$high + x$17.$high, x$14.$low + x$17.$low)), x$18 = $mul64((new $Uint64(0, in$1[3])), ($shiftLeft64((new $Uint64(0, in2[1])), 1))), new $Uint64(x$13.$high + x$18.$high, x$13.$low + x$18.$low)), x$19 = $mul64((new $Uint64(0, in$1[4])), ($shiftLeft64((new $Uint64(0, in2[0])), 0))), new $Uint64(x$12.$high + x$19.$high, x$12.$low + x$19.$low)); tmp[5] = (x$20 = (x$21 = (x$22 = (x$23 = (x$24 = $mul64((new $Uint64(0, in$1[0])), ($shiftLeft64((new $Uint64(0, in2[5])), 0))), x$25 = $mul64((new $Uint64(0, in$1[1])), ($shiftLeft64((new $Uint64(0, in2[4])), 0))), new $Uint64(x$24.$high + x$25.$high, x$24.$low + x$25.$low)), x$26 = $mul64((new $Uint64(0, in$1[2])), ($shiftLeft64((new $Uint64(0, in2[3])), 0))), new $Uint64(x$23.$high + x$26.$high, x$23.$low + x$26.$low)), x$27 = $mul64((new $Uint64(0, in$1[3])), ($shiftLeft64((new $Uint64(0, in2[2])), 0))), new $Uint64(x$22.$high + x$27.$high, x$22.$low + x$27.$low)), x$28 = $mul64((new $Uint64(0, in$1[4])), ($shiftLeft64((new $Uint64(0, in2[1])), 0))), new $Uint64(x$21.$high + x$28.$high, x$21.$low + x$28.$low)), x$29 = $mul64((new $Uint64(0, in$1[5])), ($shiftLeft64((new $Uint64(0, in2[0])), 0))), new $Uint64(x$20.$high + x$29.$high, x$20.$low + x$29.$low)); tmp[6] = (x$30 = (x$31 = (x$32 = (x$33 = (x$34 = (x$35 = $mul64((new $Uint64(0, in$1[0])), ($shiftLeft64((new $Uint64(0, in2[6])), 0))), x$36 = $mul64((new $Uint64(0, in$1[1])), ($shiftLeft64((new $Uint64(0, in2[5])), 1))), new $Uint64(x$35.$high + x$36.$high, x$35.$low + x$36.$low)), x$37 = $mul64((new $Uint64(0, in$1[2])), ($shiftLeft64((new $Uint64(0, in2[4])), 0))), new $Uint64(x$34.$high + x$37.$high, x$34.$low + x$37.$low)), x$38 = $mul64((new $Uint64(0, in$1[3])), ($shiftLeft64((new $Uint64(0, in2[3])), 1))), new $Uint64(x$33.$high + x$38.$high, x$33.$low + x$38.$low)), x$39 = $mul64((new $Uint64(0, in$1[4])), ($shiftLeft64((new $Uint64(0, in2[2])), 0))), new $Uint64(x$32.$high + x$39.$high, x$32.$low + x$39.$low)), x$40 = $mul64((new $Uint64(0, in$1[5])), ($shiftLeft64((new $Uint64(0, in2[1])), 1))), new $Uint64(x$31.$high + x$40.$high, x$31.$low + x$40.$low)), x$41 = $mul64((new $Uint64(0, in$1[6])), ($shiftLeft64((new $Uint64(0, in2[0])), 0))), new $Uint64(x$30.$high + x$41.$high, x$30.$low + x$41.$low)); tmp[7] = (x$42 = (x$43 = (x$44 = (x$45 = (x$46 = (x$47 = (x$48 = $mul64((new $Uint64(0, in$1[0])), ($shiftLeft64((new $Uint64(0, in2[7])), 0))), x$49 = $mul64((new $Uint64(0, in$1[1])), ($shiftLeft64((new $Uint64(0, in2[6])), 0))), new $Uint64(x$48.$high + x$49.$high, x$48.$low + x$49.$low)), x$50 = $mul64((new $Uint64(0, in$1[2])), ($shiftLeft64((new $Uint64(0, in2[5])), 0))), new $Uint64(x$47.$high + x$50.$high, x$47.$low + x$50.$low)), x$51 = $mul64((new $Uint64(0, in$1[3])), ($shiftLeft64((new $Uint64(0, in2[4])), 0))), new $Uint64(x$46.$high + x$51.$high, x$46.$low + x$51.$low)), x$52 = $mul64((new $Uint64(0, in$1[4])), ($shiftLeft64((new $Uint64(0, in2[3])), 0))), new $Uint64(x$45.$high + x$52.$high, x$45.$low + x$52.$low)), x$53 = $mul64((new $Uint64(0, in$1[5])), ($shiftLeft64((new $Uint64(0, in2[2])), 0))), new $Uint64(x$44.$high + x$53.$high, x$44.$low + x$53.$low)), x$54 = $mul64((new $Uint64(0, in$1[6])), ($shiftLeft64((new $Uint64(0, in2[1])), 0))), new $Uint64(x$43.$high + x$54.$high, x$43.$low + x$54.$low)), x$55 = $mul64((new $Uint64(0, in$1[7])), ($shiftLeft64((new $Uint64(0, in2[0])), 0))), new $Uint64(x$42.$high + x$55.$high, x$42.$low + x$55.$low)); tmp[8] = (x$56 = (x$57 = (x$58 = (x$59 = (x$60 = (x$61 = (x$62 = (x$63 = $mul64((new $Uint64(0, in$1[0])), ($shiftLeft64((new $Uint64(0, in2[8])), 0))), x$64 = $mul64((new $Uint64(0, in$1[1])), ($shiftLeft64((new $Uint64(0, in2[7])), 1))), new $Uint64(x$63.$high + x$64.$high, x$63.$low + x$64.$low)), x$65 = $mul64((new $Uint64(0, in$1[2])), ($shiftLeft64((new $Uint64(0, in2[6])), 0))), new $Uint64(x$62.$high + x$65.$high, x$62.$low + x$65.$low)), x$66 = $mul64((new $Uint64(0, in$1[3])), ($shiftLeft64((new $Uint64(0, in2[5])), 1))), new $Uint64(x$61.$high + x$66.$high, x$61.$low + x$66.$low)), x$67 = $mul64((new $Uint64(0, in$1[4])), ($shiftLeft64((new $Uint64(0, in2[4])), 0))), new $Uint64(x$60.$high + x$67.$high, x$60.$low + x$67.$low)), x$68 = $mul64((new $Uint64(0, in$1[5])), ($shiftLeft64((new $Uint64(0, in2[3])), 1))), new $Uint64(x$59.$high + x$68.$high, x$59.$low + x$68.$low)), x$69 = $mul64((new $Uint64(0, in$1[6])), ($shiftLeft64((new $Uint64(0, in2[2])), 0))), new $Uint64(x$58.$high + x$69.$high, x$58.$low + x$69.$low)), x$70 = $mul64((new $Uint64(0, in$1[7])), ($shiftLeft64((new $Uint64(0, in2[1])), 1))), new $Uint64(x$57.$high + x$70.$high, x$57.$low + x$70.$low)), x$71 = $mul64((new $Uint64(0, in$1[8])), ($shiftLeft64((new $Uint64(0, in2[0])), 0))), new $Uint64(x$56.$high + x$71.$high, x$56.$low + x$71.$low)); tmp[9] = (x$72 = (x$73 = (x$74 = (x$75 = (x$76 = (x$77 = (x$78 = $mul64((new $Uint64(0, in$1[1])), ($shiftLeft64((new $Uint64(0, in2[8])), 0))), x$79 = $mul64((new $Uint64(0, in$1[2])), ($shiftLeft64((new $Uint64(0, in2[7])), 0))), new $Uint64(x$78.$high + x$79.$high, x$78.$low + x$79.$low)), x$80 = $mul64((new $Uint64(0, in$1[3])), ($shiftLeft64((new $Uint64(0, in2[6])), 0))), new $Uint64(x$77.$high + x$80.$high, x$77.$low + x$80.$low)), x$81 = $mul64((new $Uint64(0, in$1[4])), ($shiftLeft64((new $Uint64(0, in2[5])), 0))), new $Uint64(x$76.$high + x$81.$high, x$76.$low + x$81.$low)), x$82 = $mul64((new $Uint64(0, in$1[5])), ($shiftLeft64((new $Uint64(0, in2[4])), 0))), new $Uint64(x$75.$high + x$82.$high, x$75.$low + x$82.$low)), x$83 = $mul64((new $Uint64(0, in$1[6])), ($shiftLeft64((new $Uint64(0, in2[3])), 0))), new $Uint64(x$74.$high + x$83.$high, x$74.$low + x$83.$low)), x$84 = $mul64((new $Uint64(0, in$1[7])), ($shiftLeft64((new $Uint64(0, in2[2])), 0))), new $Uint64(x$73.$high + x$84.$high, x$73.$low + x$84.$low)), x$85 = $mul64((new $Uint64(0, in$1[8])), ($shiftLeft64((new $Uint64(0, in2[1])), 0))), new $Uint64(x$72.$high + x$85.$high, x$72.$low + x$85.$low)); tmp[10] = (x$86 = (x$87 = (x$88 = (x$89 = (x$90 = (x$91 = $mul64((new $Uint64(0, in$1[2])), ($shiftLeft64((new $Uint64(0, in2[8])), 0))), x$92 = $mul64((new $Uint64(0, in$1[3])), ($shiftLeft64((new $Uint64(0, in2[7])), 1))), new $Uint64(x$91.$high + x$92.$high, x$91.$low + x$92.$low)), x$93 = $mul64((new $Uint64(0, in$1[4])), ($shiftLeft64((new $Uint64(0, in2[6])), 0))), new $Uint64(x$90.$high + x$93.$high, x$90.$low + x$93.$low)), x$94 = $mul64((new $Uint64(0, in$1[5])), ($shiftLeft64((new $Uint64(0, in2[5])), 1))), new $Uint64(x$89.$high + x$94.$high, x$89.$low + x$94.$low)), x$95 = $mul64((new $Uint64(0, in$1[6])), ($shiftLeft64((new $Uint64(0, in2[4])), 0))), new $Uint64(x$88.$high + x$95.$high, x$88.$low + x$95.$low)), x$96 = $mul64((new $Uint64(0, in$1[7])), ($shiftLeft64((new $Uint64(0, in2[3])), 1))), new $Uint64(x$87.$high + x$96.$high, x$87.$low + x$96.$low)), x$97 = $mul64((new $Uint64(0, in$1[8])), ($shiftLeft64((new $Uint64(0, in2[2])), 0))), new $Uint64(x$86.$high + x$97.$high, x$86.$low + x$97.$low)); tmp[11] = (x$98 = (x$99 = (x$100 = (x$101 = (x$102 = $mul64((new $Uint64(0, in$1[3])), ($shiftLeft64((new $Uint64(0, in2[8])), 0))), x$103 = $mul64((new $Uint64(0, in$1[4])), ($shiftLeft64((new $Uint64(0, in2[7])), 0))), new $Uint64(x$102.$high + x$103.$high, x$102.$low + x$103.$low)), x$104 = $mul64((new $Uint64(0, in$1[5])), ($shiftLeft64((new $Uint64(0, in2[6])), 0))), new $Uint64(x$101.$high + x$104.$high, x$101.$low + x$104.$low)), x$105 = $mul64((new $Uint64(0, in$1[6])), ($shiftLeft64((new $Uint64(0, in2[5])), 0))), new $Uint64(x$100.$high + x$105.$high, x$100.$low + x$105.$low)), x$106 = $mul64((new $Uint64(0, in$1[7])), ($shiftLeft64((new $Uint64(0, in2[4])), 0))), new $Uint64(x$99.$high + x$106.$high, x$99.$low + x$106.$low)), x$107 = $mul64((new $Uint64(0, in$1[8])), ($shiftLeft64((new $Uint64(0, in2[3])), 0))), new $Uint64(x$98.$high + x$107.$high, x$98.$low + x$107.$low)); tmp[12] = (x$108 = (x$109 = (x$110 = (x$111 = $mul64((new $Uint64(0, in$1[4])), ($shiftLeft64((new $Uint64(0, in2[8])), 0))), x$112 = $mul64((new $Uint64(0, in$1[5])), ($shiftLeft64((new $Uint64(0, in2[7])), 1))), new $Uint64(x$111.$high + x$112.$high, x$111.$low + x$112.$low)), x$113 = $mul64((new $Uint64(0, in$1[6])), ($shiftLeft64((new $Uint64(0, in2[6])), 0))), new $Uint64(x$110.$high + x$113.$high, x$110.$low + x$113.$low)), x$114 = $mul64((new $Uint64(0, in$1[7])), ($shiftLeft64((new $Uint64(0, in2[5])), 1))), new $Uint64(x$109.$high + x$114.$high, x$109.$low + x$114.$low)), x$115 = $mul64((new $Uint64(0, in$1[8])), ($shiftLeft64((new $Uint64(0, in2[4])), 0))), new $Uint64(x$108.$high + x$115.$high, x$108.$low + x$115.$low)); tmp[13] = (x$116 = (x$117 = (x$118 = $mul64((new $Uint64(0, in$1[5])), ($shiftLeft64((new $Uint64(0, in2[8])), 0))), x$119 = $mul64((new $Uint64(0, in$1[6])), ($shiftLeft64((new $Uint64(0, in2[7])), 0))), new $Uint64(x$118.$high + x$119.$high, x$118.$low + x$119.$low)), x$120 = $mul64((new $Uint64(0, in$1[7])), ($shiftLeft64((new $Uint64(0, in2[6])), 0))), new $Uint64(x$117.$high + x$120.$high, x$117.$low + x$120.$low)), x$121 = $mul64((new $Uint64(0, in$1[8])), ($shiftLeft64((new $Uint64(0, in2[5])), 0))), new $Uint64(x$116.$high + x$121.$high, x$116.$low + x$121.$low)); tmp[14] = (x$122 = (x$123 = $mul64((new $Uint64(0, in$1[6])), ($shiftLeft64((new $Uint64(0, in2[8])), 0))), x$124 = $mul64((new $Uint64(0, in$1[7])), ($shiftLeft64((new $Uint64(0, in2[7])), 1))), new $Uint64(x$123.$high + x$124.$high, x$123.$low + x$124.$low)), x$125 = $mul64((new $Uint64(0, in$1[8])), ($shiftLeft64((new $Uint64(0, in2[6])), 0))), new $Uint64(x$122.$high + x$125.$high, x$122.$low + x$125.$low)); tmp[15] = (x$126 = $mul64((new $Uint64(0, in$1[7])), ($shiftLeft64((new $Uint64(0, in2[8])), 0))), x$127 = $mul64((new $Uint64(0, in$1[8])), ($shiftLeft64((new $Uint64(0, in2[7])), 0))), new $Uint64(x$126.$high + x$127.$high, x$126.$low + x$127.$low)); tmp[16] = $mul64((new $Uint64(0, in$1[8])), ($shiftLeft64((new $Uint64(0, in2[8])), 0))); p256ReduceDegree(out, $clone(tmp, arrayType$5)); }; p256Assign = function(out, in$1) { var in$1, out; arrayType$3.copy(out, in$1); }; p256Invert = function(out, in$1) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, e16, e2, e32, e4, e64, e8, ftmp, ftmp2, i, i$1, i$2, i$3, i$4, i$5, i$6, in$1, out; _tmp = arrayType$3.zero(); _tmp$1 = arrayType$3.zero(); ftmp = $clone(_tmp, arrayType$3); ftmp2 = $clone(_tmp$1, arrayType$3); _tmp$2 = arrayType$3.zero(); _tmp$3 = arrayType$3.zero(); _tmp$4 = arrayType$3.zero(); _tmp$5 = arrayType$3.zero(); _tmp$6 = arrayType$3.zero(); _tmp$7 = arrayType$3.zero(); e2 = $clone(_tmp$2, arrayType$3); e4 = $clone(_tmp$3, arrayType$3); e8 = $clone(_tmp$4, arrayType$3); e16 = $clone(_tmp$5, arrayType$3); e32 = $clone(_tmp$6, arrayType$3); e64 = $clone(_tmp$7, arrayType$3); p256Square(ftmp, in$1); p256Mul(ftmp, in$1, ftmp); p256Assign(e2, ftmp); p256Square(ftmp, ftmp); p256Square(ftmp, ftmp); p256Mul(ftmp, ftmp, e2); p256Assign(e4, ftmp); p256Square(ftmp, ftmp); p256Square(ftmp, ftmp); p256Square(ftmp, ftmp); p256Square(ftmp, ftmp); p256Mul(ftmp, ftmp, e4); p256Assign(e8, ftmp); i = 0; while (true) { if (!(i < 8)) { break; } p256Square(ftmp, ftmp); i = i + (1) >> 0; } p256Mul(ftmp, ftmp, e8); p256Assign(e16, ftmp); i$1 = 0; while (true) { if (!(i$1 < 16)) { break; } p256Square(ftmp, ftmp); i$1 = i$1 + (1) >> 0; } p256Mul(ftmp, ftmp, e16); p256Assign(e32, ftmp); i$2 = 0; while (true) { if (!(i$2 < 32)) { break; } p256Square(ftmp, ftmp); i$2 = i$2 + (1) >> 0; } p256Assign(e64, ftmp); p256Mul(ftmp, ftmp, in$1); i$3 = 0; while (true) { if (!(i$3 < 192)) { break; } p256Square(ftmp, ftmp); i$3 = i$3 + (1) >> 0; } p256Mul(ftmp2, e64, e32); i$4 = 0; while (true) { if (!(i$4 < 16)) { break; } p256Square(ftmp2, ftmp2); i$4 = i$4 + (1) >> 0; } p256Mul(ftmp2, ftmp2, e16); i$5 = 0; while (true) { if (!(i$5 < 8)) { break; } p256Square(ftmp2, ftmp2); i$5 = i$5 + (1) >> 0; } p256Mul(ftmp2, ftmp2, e8); i$6 = 0; while (true) { if (!(i$6 < 4)) { break; } p256Square(ftmp2, ftmp2); i$6 = i$6 + (1) >> 0; } p256Mul(ftmp2, ftmp2, e4); p256Square(ftmp2, ftmp2); p256Square(ftmp2, ftmp2); p256Mul(ftmp2, ftmp2, e2); p256Square(ftmp2, ftmp2); p256Square(ftmp2, ftmp2); p256Mul(ftmp2, ftmp2, in$1); p256Mul(out, ftmp2, ftmp); }; p256Scalar3 = function(out) { var carry, i, out, x, x$1, x$10, x$11, x$12, x$13, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; carry = 0; i = 0; while (true) { (x$1 = out, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i] = ($imul((x = out, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i])), (3)) >>> 0))); (x$3 = out, ((i < 0 || i >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[i] = ((x$2 = out, ((i < 0 || i >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i])) + (carry) >>> 0))); carry = (x$4 = out, ((i < 0 || i >= x$4.length) ? ($throwRuntimeError("index out of range"), undefined) : x$4[i])) >>> 29 >>> 0; (x$6 = out, ((i < 0 || i >= x$6.length) ? ($throwRuntimeError("index out of range"), undefined) : x$6[i] = (((x$5 = out, ((i < 0 || i >= x$5.length) ? ($throwRuntimeError("index out of range"), undefined) : x$5[i])) & (536870911)) >>> 0))); i = i + (1) >> 0; if (i === 9) { break; } (x$8 = out, ((i < 0 || i >= x$8.length) ? ($throwRuntimeError("index out of range"), undefined) : x$8[i] = ($imul((x$7 = out, ((i < 0 || i >= x$7.length) ? ($throwRuntimeError("index out of range"), undefined) : x$7[i])), (3)) >>> 0))); (x$10 = out, ((i < 0 || i >= x$10.length) ? ($throwRuntimeError("index out of range"), undefined) : x$10[i] = ((x$9 = out, ((i < 0 || i >= x$9.length) ? ($throwRuntimeError("index out of range"), undefined) : x$9[i])) + (carry) >>> 0))); carry = (x$11 = out, ((i < 0 || i >= x$11.length) ? ($throwRuntimeError("index out of range"), undefined) : x$11[i])) >>> 28 >>> 0; (x$13 = out, ((i < 0 || i >= x$13.length) ? ($throwRuntimeError("index out of range"), undefined) : x$13[i] = (((x$12 = out, ((i < 0 || i >= x$12.length) ? ($throwRuntimeError("index out of range"), undefined) : x$12[i])) & (268435455)) >>> 0))); i = i + (1) >> 0; } p256ReduceCarry(out, carry); }; p256Scalar4 = function(out) { var _tmp, _tmp$1, carry, i, nextCarry, out, 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, y, y$1; _tmp = 0; _tmp$1 = 0; carry = _tmp; nextCarry = _tmp$1; i = 0; while (true) { nextCarry = (x = out, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i])) >>> 27 >>> 0; (x$2 = out, ((i < 0 || i >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i] = ((y = (2), y < 32 ? ((x$1 = out, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i])) << y) : 0) >>> 0))); (x$4 = out, ((i < 0 || i >= x$4.length) ? ($throwRuntimeError("index out of range"), undefined) : x$4[i] = (((x$3 = out, ((i < 0 || i >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[i])) & (536870911)) >>> 0))); (x$6 = out, ((i < 0 || i >= x$6.length) ? ($throwRuntimeError("index out of range"), undefined) : x$6[i] = ((x$5 = out, ((i < 0 || i >= x$5.length) ? ($throwRuntimeError("index out of range"), undefined) : x$5[i])) + (carry) >>> 0))); carry = nextCarry + (((x$7 = out, ((i < 0 || i >= x$7.length) ? ($throwRuntimeError("index out of range"), undefined) : x$7[i])) >>> 29 >>> 0)) >>> 0; (x$9 = out, ((i < 0 || i >= x$9.length) ? ($throwRuntimeError("index out of range"), undefined) : x$9[i] = (((x$8 = out, ((i < 0 || i >= x$8.length) ? ($throwRuntimeError("index out of range"), undefined) : x$8[i])) & (536870911)) >>> 0))); i = i + (1) >> 0; if (i === 9) { break; } nextCarry = (x$10 = out, ((i < 0 || i >= x$10.length) ? ($throwRuntimeError("index out of range"), undefined) : x$10[i])) >>> 26 >>> 0; (x$12 = out, ((i < 0 || i >= x$12.length) ? ($throwRuntimeError("index out of range"), undefined) : x$12[i] = ((y$1 = (2), y$1 < 32 ? ((x$11 = out, ((i < 0 || i >= x$11.length) ? ($throwRuntimeError("index out of range"), undefined) : x$11[i])) << y$1) : 0) >>> 0))); (x$14 = out, ((i < 0 || i >= x$14.length) ? ($throwRuntimeError("index out of range"), undefined) : x$14[i] = (((x$13 = out, ((i < 0 || i >= x$13.length) ? ($throwRuntimeError("index out of range"), undefined) : x$13[i])) & (268435455)) >>> 0))); (x$16 = out, ((i < 0 || i >= x$16.length) ? ($throwRuntimeError("index out of range"), undefined) : x$16[i] = ((x$15 = out, ((i < 0 || i >= x$15.length) ? ($throwRuntimeError("index out of range"), undefined) : x$15[i])) + (carry) >>> 0))); carry = nextCarry + (((x$17 = out, ((i < 0 || i >= x$17.length) ? ($throwRuntimeError("index out of range"), undefined) : x$17[i])) >>> 28 >>> 0)) >>> 0; (x$19 = out, ((i < 0 || i >= x$19.length) ? ($throwRuntimeError("index out of range"), undefined) : x$19[i] = (((x$18 = out, ((i < 0 || i >= x$18.length) ? ($throwRuntimeError("index out of range"), undefined) : x$18[i])) & (268435455)) >>> 0))); i = i + (1) >> 0; } p256ReduceCarry(out, carry); }; p256Scalar8 = function(out) { var _tmp, _tmp$1, carry, i, nextCarry, out, 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, y, y$1; _tmp = 0; _tmp$1 = 0; carry = _tmp; nextCarry = _tmp$1; i = 0; while (true) { nextCarry = (x = out, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i])) >>> 26 >>> 0; (x$2 = out, ((i < 0 || i >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i] = ((y = (3), y < 32 ? ((x$1 = out, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i])) << y) : 0) >>> 0))); (x$4 = out, ((i < 0 || i >= x$4.length) ? ($throwRuntimeError("index out of range"), undefined) : x$4[i] = (((x$3 = out, ((i < 0 || i >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[i])) & (536870911)) >>> 0))); (x$6 = out, ((i < 0 || i >= x$6.length) ? ($throwRuntimeError("index out of range"), undefined) : x$6[i] = ((x$5 = out, ((i < 0 || i >= x$5.length) ? ($throwRuntimeError("index out of range"), undefined) : x$5[i])) + (carry) >>> 0))); carry = nextCarry + (((x$7 = out, ((i < 0 || i >= x$7.length) ? ($throwRuntimeError("index out of range"), undefined) : x$7[i])) >>> 29 >>> 0)) >>> 0; (x$9 = out, ((i < 0 || i >= x$9.length) ? ($throwRuntimeError("index out of range"), undefined) : x$9[i] = (((x$8 = out, ((i < 0 || i >= x$8.length) ? ($throwRuntimeError("index out of range"), undefined) : x$8[i])) & (536870911)) >>> 0))); i = i + (1) >> 0; if (i === 9) { break; } nextCarry = (x$10 = out, ((i < 0 || i >= x$10.length) ? ($throwRuntimeError("index out of range"), undefined) : x$10[i])) >>> 25 >>> 0; (x$12 = out, ((i < 0 || i >= x$12.length) ? ($throwRuntimeError("index out of range"), undefined) : x$12[i] = ((y$1 = (3), y$1 < 32 ? ((x$11 = out, ((i < 0 || i >= x$11.length) ? ($throwRuntimeError("index out of range"), undefined) : x$11[i])) << y$1) : 0) >>> 0))); (x$14 = out, ((i < 0 || i >= x$14.length) ? ($throwRuntimeError("index out of range"), undefined) : x$14[i] = (((x$13 = out, ((i < 0 || i >= x$13.length) ? ($throwRuntimeError("index out of range"), undefined) : x$13[i])) & (268435455)) >>> 0))); (x$16 = out, ((i < 0 || i >= x$16.length) ? ($throwRuntimeError("index out of range"), undefined) : x$16[i] = ((x$15 = out, ((i < 0 || i >= x$15.length) ? ($throwRuntimeError("index out of range"), undefined) : x$15[i])) + (carry) >>> 0))); carry = nextCarry + (((x$17 = out, ((i < 0 || i >= x$17.length) ? ($throwRuntimeError("index out of range"), undefined) : x$17[i])) >>> 28 >>> 0)) >>> 0; (x$19 = out, ((i < 0 || i >= x$19.length) ? ($throwRuntimeError("index out of range"), undefined) : x$19[i] = (((x$18 = out, ((i < 0 || i >= x$18.length) ? ($throwRuntimeError("index out of range"), undefined) : x$18[i])) & (268435455)) >>> 0))); i = i + (1) >> 0; } p256ReduceCarry(out, carry); }; p256PointDouble = function(xOut, yOut, zOut, x, y, z) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, alpha, beta, delta, gamma, tmp, tmp2, x, xOut, y, yOut, z, zOut; _tmp = arrayType$3.zero(); _tmp$1 = arrayType$3.zero(); _tmp$2 = arrayType$3.zero(); _tmp$3 = arrayType$3.zero(); _tmp$4 = arrayType$3.zero(); _tmp$5 = arrayType$3.zero(); delta = $clone(_tmp, arrayType$3); gamma = $clone(_tmp$1, arrayType$3); alpha = $clone(_tmp$2, arrayType$3); beta = $clone(_tmp$3, arrayType$3); tmp = $clone(_tmp$4, arrayType$3); tmp2 = $clone(_tmp$5, arrayType$3); p256Square(delta, z); p256Square(gamma, y); p256Mul(beta, x, gamma); p256Sum(tmp, x, delta); p256Diff(tmp2, x, delta); p256Mul(alpha, tmp, tmp2); p256Scalar3(alpha); p256Sum(tmp, y, z); p256Square(tmp, tmp); p256Diff(tmp, tmp, gamma); p256Diff(zOut, tmp, delta); p256Scalar4(beta); p256Square(xOut, alpha); p256Diff(xOut, xOut, beta); p256Diff(xOut, xOut, beta); p256Diff(tmp, beta, xOut); p256Mul(tmp, alpha, tmp); p256Square(tmp2, gamma); p256Scalar8(tmp2); p256Diff(yOut, tmp, tmp2); }; p256PointAddMixed = function(xOut, yOut, zOut, x1, y1, z1, x2, y2) { var _tmp, _tmp$1, _tmp$10, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, h, i, j, r, rr, s2, tmp, u2, v, x1, x2, xOut, y1, y2, yOut, z1, z1z1, z1z1z1, zOut; _tmp = arrayType$3.zero(); _tmp$1 = arrayType$3.zero(); _tmp$2 = arrayType$3.zero(); _tmp$3 = arrayType$3.zero(); _tmp$4 = arrayType$3.zero(); _tmp$5 = arrayType$3.zero(); _tmp$6 = arrayType$3.zero(); _tmp$7 = arrayType$3.zero(); _tmp$8 = arrayType$3.zero(); _tmp$9 = arrayType$3.zero(); _tmp$10 = arrayType$3.zero(); z1z1 = $clone(_tmp, arrayType$3); z1z1z1 = $clone(_tmp$1, arrayType$3); s2 = $clone(_tmp$2, arrayType$3); u2 = $clone(_tmp$3, arrayType$3); h = $clone(_tmp$4, arrayType$3); i = $clone(_tmp$5, arrayType$3); j = $clone(_tmp$6, arrayType$3); r = $clone(_tmp$7, arrayType$3); rr = $clone(_tmp$8, arrayType$3); v = $clone(_tmp$9, arrayType$3); tmp = $clone(_tmp$10, arrayType$3); p256Square(z1z1, z1); p256Sum(tmp, z1, z1); p256Mul(u2, x2, z1z1); p256Mul(z1z1z1, z1, z1z1); p256Mul(s2, y2, z1z1z1); p256Diff(h, u2, x1); p256Sum(i, h, h); p256Square(i, i); p256Mul(j, h, i); p256Diff(r, s2, y1); p256Sum(r, r, r); p256Mul(v, x1, i); p256Mul(zOut, tmp, h); p256Square(rr, r); p256Diff(xOut, rr, j); p256Diff(xOut, xOut, v); p256Diff(xOut, xOut, v); p256Diff(tmp, v, xOut); p256Mul(yOut, tmp, r); p256Mul(tmp, y1, j); p256Diff(yOut, yOut, tmp); p256Diff(yOut, yOut, tmp); }; p256PointAdd = function(xOut, yOut, zOut, x1, y1, z1, x2, y2, z2) { var _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, h, i, j, r, rr, s1, s2, tmp, u1, u2, v, x1, x2, xOut, y1, y2, yOut, z1, z1z1, z1z1z1, z2, z2z2, z2z2z2, zOut; _tmp = arrayType$3.zero(); _tmp$1 = arrayType$3.zero(); _tmp$2 = arrayType$3.zero(); _tmp$3 = arrayType$3.zero(); _tmp$4 = arrayType$3.zero(); _tmp$5 = arrayType$3.zero(); _tmp$6 = arrayType$3.zero(); _tmp$7 = arrayType$3.zero(); _tmp$8 = arrayType$3.zero(); _tmp$9 = arrayType$3.zero(); _tmp$10 = arrayType$3.zero(); _tmp$11 = arrayType$3.zero(); _tmp$12 = arrayType$3.zero(); _tmp$13 = arrayType$3.zero(); _tmp$14 = arrayType$3.zero(); z1z1 = $clone(_tmp, arrayType$3); z1z1z1 = $clone(_tmp$1, arrayType$3); z2z2 = $clone(_tmp$2, arrayType$3); z2z2z2 = $clone(_tmp$3, arrayType$3); s1 = $clone(_tmp$4, arrayType$3); s2 = $clone(_tmp$5, arrayType$3); u1 = $clone(_tmp$6, arrayType$3); u2 = $clone(_tmp$7, arrayType$3); h = $clone(_tmp$8, arrayType$3); i = $clone(_tmp$9, arrayType$3); j = $clone(_tmp$10, arrayType$3); r = $clone(_tmp$11, arrayType$3); rr = $clone(_tmp$12, arrayType$3); v = $clone(_tmp$13, arrayType$3); tmp = $clone(_tmp$14, arrayType$3); p256Square(z1z1, z1); p256Square(z2z2, z2); p256Mul(u1, x1, z2z2); p256Sum(tmp, z1, z2); p256Square(tmp, tmp); p256Diff(tmp, tmp, z1z1); p256Diff(tmp, tmp, z2z2); p256Mul(z2z2z2, z2, z2z2); p256Mul(s1, y1, z2z2z2); p256Mul(u2, x2, z1z1); p256Mul(z1z1z1, z1, z1z1); p256Mul(s2, y2, z1z1z1); p256Diff(h, u2, u1); p256Sum(i, h, h); p256Square(i, i); p256Mul(j, h, i); p256Diff(r, s2, s1); p256Sum(r, r, r); p256Mul(v, u1, i); p256Mul(zOut, tmp, h); p256Square(rr, r); p256Diff(xOut, rr, j); p256Diff(xOut, xOut, v); p256Diff(xOut, xOut, v); p256Diff(tmp, v, xOut); p256Mul(yOut, tmp, r); p256Mul(tmp, s1, j); p256Diff(yOut, yOut, tmp); p256Diff(yOut, yOut, tmp); }; p256CopyConditional = function(out, in$1, mask$1) { var i, in$1, mask$1, out, tmp, x, x$1, x$2, x$3; i = 0; while (true) { if (!(i < 9)) { break; } tmp = (mask$1 & ((((x = in$1, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i])) ^ (x$1 = out, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i]))) >>> 0))) >>> 0; (x$3 = out, ((i < 0 || i >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[i] = (((x$2 = out, ((i < 0 || i >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i])) ^ (tmp)) >>> 0))); i = i + (1) >> 0; } }; p256SelectAffinePoint = function(xOut, yOut, table, index) { var _i, _i$1, _i$2, _i$3, _ref, _ref$1, _ref$2, _ref$3, i, i$1, i$2, index, j, j$1, mask$1, table, x, x$1, x$2, x$3, xOut, yOut; _ref = xOut; _i = 0; while (true) { if (!(_i < 9)) { break; } i = _i; xOut.nilCheck, ((i < 0 || i >= xOut.length) ? ($throwRuntimeError("index out of range"), undefined) : xOut[i] = 0); _i++; } _ref$1 = yOut; _i$1 = 0; while (true) { if (!(_i$1 < 9)) { break; } i$1 = _i$1; yOut.nilCheck, ((i$1 < 0 || i$1 >= yOut.length) ? ($throwRuntimeError("index out of range"), undefined) : yOut[i$1] = 0); _i$1++; } i$2 = 1; while (true) { if (!(i$2 < 16)) { break; } mask$1 = (i$2 ^ index) >>> 0; mask$1 = (mask$1 | ((mask$1 >>> 2 >>> 0))) >>> 0; mask$1 = (mask$1 | ((mask$1 >>> 1 >>> 0))) >>> 0; mask$1 = (mask$1 & (1)) >>> 0; mask$1 = mask$1 - (1) >>> 0; _ref$2 = xOut; _i$2 = 0; while (true) { if (!(_i$2 < 9)) { break; } j = _i$2; (x$1 = xOut, ((j < 0 || j >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[j] = (((x = xOut, ((j < 0 || j >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[j])) | ((((0 >= table.$length ? ($throwRuntimeError("index out of range"), undefined) : table.$array[table.$offset + 0]) & mask$1) >>> 0))) >>> 0))); table = $subslice(table, 1); _i$2++; } _ref$3 = yOut; _i$3 = 0; while (true) { if (!(_i$3 < 9)) { break; } j$1 = _i$3; (x$3 = yOut, ((j$1 < 0 || j$1 >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[j$1] = (((x$2 = yOut, ((j$1 < 0 || j$1 >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[j$1])) | ((((0 >= table.$length ? ($throwRuntimeError("index out of range"), undefined) : table.$array[table.$offset + 0]) & mask$1) >>> 0))) >>> 0))); table = $subslice(table, 1); _i$3++; } i$2 = i$2 + (1) >>> 0; } }; p256SelectJacobianPoint = function(xOut, yOut, zOut, table, index) { var _i, _i$1, _i$2, _i$3, _i$4, _i$5, _ref, _ref$1, _ref$2, _ref$3, _ref$4, _ref$5, i, i$1, i$2, i$3, index, j, j$1, j$2, mask$1, table, x, x$1, x$10, x$11, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, xOut, yOut, zOut; _ref = xOut; _i = 0; while (true) { if (!(_i < 9)) { break; } i = _i; xOut.nilCheck, ((i < 0 || i >= xOut.length) ? ($throwRuntimeError("index out of range"), undefined) : xOut[i] = 0); _i++; } _ref$1 = yOut; _i$1 = 0; while (true) { if (!(_i$1 < 9)) { break; } i$1 = _i$1; yOut.nilCheck, ((i$1 < 0 || i$1 >= yOut.length) ? ($throwRuntimeError("index out of range"), undefined) : yOut[i$1] = 0); _i$1++; } _ref$2 = zOut; _i$2 = 0; while (true) { if (!(_i$2 < 9)) { break; } i$2 = _i$2; zOut.nilCheck, ((i$2 < 0 || i$2 >= zOut.length) ? ($throwRuntimeError("index out of range"), undefined) : zOut[i$2] = 0); _i$2++; } i$3 = 1; while (true) { if (!(i$3 < 16)) { break; } mask$1 = (i$3 ^ index) >>> 0; mask$1 = (mask$1 | ((mask$1 >>> 2 >>> 0))) >>> 0; mask$1 = (mask$1 | ((mask$1 >>> 1 >>> 0))) >>> 0; mask$1 = (mask$1 & (1)) >>> 0; mask$1 = mask$1 - (1) >>> 0; _ref$3 = xOut; _i$3 = 0; while (true) { if (!(_i$3 < 9)) { break; } j = _i$3; (x$3 = xOut, ((j < 0 || j >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[j] = (((x = xOut, ((j < 0 || j >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[j])) | ((((x$1 = (x$2 = table, ((i$3 < 0 || i$3 >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i$3]))[0], ((j < 0 || j >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[j])) & mask$1) >>> 0))) >>> 0))); _i$3++; } _ref$4 = yOut; _i$4 = 0; while (true) { if (!(_i$4 < 9)) { break; } j$1 = _i$4; (x$7 = yOut, ((j$1 < 0 || j$1 >= x$7.length) ? ($throwRuntimeError("index out of range"), undefined) : x$7[j$1] = (((x$4 = yOut, ((j$1 < 0 || j$1 >= x$4.length) ? ($throwRuntimeError("index out of range"), undefined) : x$4[j$1])) | ((((x$5 = (x$6 = table, ((i$3 < 0 || i$3 >= x$6.length) ? ($throwRuntimeError("index out of range"), undefined) : x$6[i$3]))[1], ((j$1 < 0 || j$1 >= x$5.length) ? ($throwRuntimeError("index out of range"), undefined) : x$5[j$1])) & mask$1) >>> 0))) >>> 0))); _i$4++; } _ref$5 = zOut; _i$5 = 0; while (true) { if (!(_i$5 < 9)) { break; } j$2 = _i$5; (x$11 = zOut, ((j$2 < 0 || j$2 >= x$11.length) ? ($throwRuntimeError("index out of range"), undefined) : x$11[j$2] = (((x$8 = zOut, ((j$2 < 0 || j$2 >= x$8.length) ? ($throwRuntimeError("index out of range"), undefined) : x$8[j$2])) | ((((x$9 = (x$10 = table, ((i$3 < 0 || i$3 >= x$10.length) ? ($throwRuntimeError("index out of range"), undefined) : x$10[i$3]))[2], ((j$2 < 0 || j$2 >= x$9.length) ? ($throwRuntimeError("index out of range"), undefined) : x$9[j$2])) & mask$1) >>> 0))) >>> 0))); _i$5++; } i$3 = i$3 + (1) >>> 0; } }; p256GetBit = function(scalar, bit) { var bit, scalar, x, x$1, y; return (((((((y = (((bit & 7) >>> 0)), y < 32 ? (((x = scalar, x$1 = bit >>> 3 >>> 0, ((x$1 < 0 || x$1 >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[x$1]))) >>> y) : 0) << 24 >>> 24)) & 1) >>> 0) >>> 0)); }; p256ScalarBaseMult = function(xOut, yOut, zOut, scalar) { var _i, _i$1, _i$2, _ref, _ref$1, _ref$2, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, bit0, bit1, bit2, bit3, i, i$1, i$2, i$3, index, j, mask$1, nIsInfinityMask, pIsNoninfiniteMask, px, py, scalar, tableOffset, tx, ty, tz, xOut, yOut, zOut; nIsInfinityMask = 4294967295; _tmp = 0; _tmp$1 = 0; _tmp$2 = 0; pIsNoninfiniteMask = _tmp; mask$1 = _tmp$1; tableOffset = _tmp$2; _tmp$3 = arrayType$3.zero(); _tmp$4 = arrayType$3.zero(); _tmp$5 = arrayType$3.zero(); _tmp$6 = arrayType$3.zero(); _tmp$7 = arrayType$3.zero(); px = $clone(_tmp$3, arrayType$3); py = $clone(_tmp$4, arrayType$3); tx = $clone(_tmp$5, arrayType$3); ty = $clone(_tmp$6, arrayType$3); tz = $clone(_tmp$7, arrayType$3); _ref = xOut; _i = 0; while (true) { if (!(_i < 9)) { break; } i = _i; xOut.nilCheck, ((i < 0 || i >= xOut.length) ? ($throwRuntimeError("index out of range"), undefined) : xOut[i] = 0); _i++; } _ref$1 = yOut; _i$1 = 0; while (true) { if (!(_i$1 < 9)) { break; } i$1 = _i$1; yOut.nilCheck, ((i$1 < 0 || i$1 >= yOut.length) ? ($throwRuntimeError("index out of range"), undefined) : yOut[i$1] = 0); _i$1++; } _ref$2 = zOut; _i$2 = 0; while (true) { if (!(_i$2 < 9)) { break; } i$2 = _i$2; zOut.nilCheck, ((i$2 < 0 || i$2 >= zOut.length) ? ($throwRuntimeError("index out of range"), undefined) : zOut[i$2] = 0); _i$2++; } i$3 = 0; while (true) { if (!(i$3 < 32)) { break; } if (!((i$3 === 0))) { p256PointDouble(xOut, yOut, zOut, xOut, yOut, zOut); } tableOffset = 0; j = 0; while (true) { if (!(j <= 32)) { break; } bit0 = p256GetBit(scalar, (31 - i$3 >>> 0) + j >>> 0); bit1 = p256GetBit(scalar, (95 - i$3 >>> 0) + j >>> 0); bit2 = p256GetBit(scalar, (159 - i$3 >>> 0) + j >>> 0); bit3 = p256GetBit(scalar, (223 - i$3 >>> 0) + j >>> 0); index = (((((bit0 | ((bit1 << 1 >>> 0))) >>> 0) | ((bit2 << 2 >>> 0))) >>> 0) | ((bit3 << 3 >>> 0))) >>> 0; p256SelectAffinePoint(px, py, $subslice(new sliceType(p256Precomputed), tableOffset), index); tableOffset = tableOffset + (270) >>> 0; p256PointAddMixed(tx, ty, tz, xOut, yOut, zOut, px, py); p256CopyConditional(xOut, px, nIsInfinityMask); p256CopyConditional(yOut, py, nIsInfinityMask); p256CopyConditional(zOut, p256One, nIsInfinityMask); pIsNoninfiniteMask = nonZeroToAllOnes(index); mask$1 = (pIsNoninfiniteMask & (~nIsInfinityMask >>> 0)) >>> 0; p256CopyConditional(xOut, tx, mask$1); p256CopyConditional(yOut, ty, mask$1); p256CopyConditional(zOut, tz, mask$1); nIsInfinityMask = (nIsInfinityMask & ~(pIsNoninfiniteMask)) >>> 0; j = j + (32) >>> 0; } i$3 = i$3 + (1) >>> 0; } }; p256PointToAffine = function(xOut, yOut, x, y, z) { var _tmp, _tmp$1, x, xOut, y, yOut, z, zInv, zInvSq; _tmp = arrayType$3.zero(); _tmp$1 = arrayType$3.zero(); zInv = $clone(_tmp, arrayType$3); zInvSq = $clone(_tmp$1, arrayType$3); p256Invert(zInv, z); p256Square(zInvSq, zInv); p256Mul(xOut, x, zInvSq); p256Mul(zInv, zInv, zInvSq); p256Mul(yOut, y, zInv); }; p256ToAffine = function(x, y, z) { var $24r, _r, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, x, xOut, xx, y, yOut, yy, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; x = $f.x; xOut = $f.xOut; xx = $f.xx; y = $f.y; yOut = $f.yOut; yy = $f.yy; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: xx = [xx]; yy = [yy]; xOut = ptrType$1.nil; yOut = ptrType$1.nil; _tmp = arrayType$3.zero(); _tmp$1 = arrayType$3.zero(); xx[0] = $clone(_tmp, arrayType$3); yy[0] = $clone(_tmp$1, arrayType$3); p256PointToAffine(xx[0], yy[0], x, y, z); _r = p256ToBig(xx[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tmp$2 = _r; _r$1 = p256ToBig(yy[0]); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tmp$3 = _r$1; xOut = _tmp$2; yOut = _tmp$3; $24r = [xOut, yOut]; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: p256ToAffine }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f.x = x; $f.xOut = xOut; $f.xx = xx; $f.y = y; $f.yOut = yOut; $f.yy = yy; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; p256ScalarMult = function(xOut, yOut, zOut, x, y, scalar) { var _i, _i$1, _i$2, _q, _q$1, _q$2, _q$3, _ref, _ref$1, _ref$2, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, i, i$1, i$2, i$3, i$4, index, mask$1, nIsInfinityMask, pIsNoninfiniteMask, precomp, px, py, pz, scalar, tx, ty, tz, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, xOut, y, y$1, yOut, zOut; _tmp = arrayType$3.zero(); _tmp$1 = arrayType$3.zero(); _tmp$2 = arrayType$3.zero(); _tmp$3 = arrayType$3.zero(); _tmp$4 = arrayType$3.zero(); _tmp$5 = arrayType$3.zero(); px = $clone(_tmp, arrayType$3); py = $clone(_tmp$1, arrayType$3); pz = $clone(_tmp$2, arrayType$3); tx = $clone(_tmp$3, arrayType$3); ty = $clone(_tmp$4, arrayType$3); tz = $clone(_tmp$5, arrayType$3); precomp = arrayType$7.zero(); _tmp$6 = 0; _tmp$7 = 0; _tmp$8 = 0; _tmp$9 = 0; nIsInfinityMask = _tmp$6; index = _tmp$7; pIsNoninfiniteMask = _tmp$8; mask$1 = _tmp$9; arrayType$3.copy(precomp[1][0], x); arrayType$3.copy(precomp[1][1], y); arrayType$3.copy(precomp[1][2], p256One); i = 2; while (true) { if (!(i < 16)) { break; } p256PointDouble(((i < 0 || i >= precomp.length) ? ($throwRuntimeError("index out of range"), undefined) : precomp[i])[0], ((i < 0 || i >= precomp.length) ? ($throwRuntimeError("index out of range"), undefined) : precomp[i])[1], ((i < 0 || i >= precomp.length) ? ($throwRuntimeError("index out of range"), undefined) : precomp[i])[2], (x$1 = (_q = i / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")), ((x$1 < 0 || x$1 >= precomp.length) ? ($throwRuntimeError("index out of range"), undefined) : precomp[x$1]))[0], (x$2 = (_q$1 = i / 2, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")), ((x$2 < 0 || x$2 >= precomp.length) ? ($throwRuntimeError("index out of range"), undefined) : precomp[x$2]))[1], (x$3 = (_q$2 = i / 2, (_q$2 === _q$2 && _q$2 !== 1/0 && _q$2 !== -1/0) ? _q$2 >> 0 : $throwRuntimeError("integer divide by zero")), ((x$3 < 0 || x$3 >= precomp.length) ? ($throwRuntimeError("index out of range"), undefined) : precomp[x$3]))[2]); p256PointAddMixed((x$4 = i + 1 >> 0, ((x$4 < 0 || x$4 >= precomp.length) ? ($throwRuntimeError("index out of range"), undefined) : precomp[x$4]))[0], (x$5 = i + 1 >> 0, ((x$5 < 0 || x$5 >= precomp.length) ? ($throwRuntimeError("index out of range"), undefined) : precomp[x$5]))[1], (x$6 = i + 1 >> 0, ((x$6 < 0 || x$6 >= precomp.length) ? ($throwRuntimeError("index out of range"), undefined) : precomp[x$6]))[2], ((i < 0 || i >= precomp.length) ? ($throwRuntimeError("index out of range"), undefined) : precomp[i])[0], ((i < 0 || i >= precomp.length) ? ($throwRuntimeError("index out of range"), undefined) : precomp[i])[1], ((i < 0 || i >= precomp.length) ? ($throwRuntimeError("index out of range"), undefined) : precomp[i])[2], x, y); i = i + (2) >> 0; } _ref = xOut; _i = 0; while (true) { if (!(_i < 9)) { break; } i$1 = _i; xOut.nilCheck, ((i$1 < 0 || i$1 >= xOut.length) ? ($throwRuntimeError("index out of range"), undefined) : xOut[i$1] = 0); _i++; } _ref$1 = yOut; _i$1 = 0; while (true) { if (!(_i$1 < 9)) { break; } i$2 = _i$1; yOut.nilCheck, ((i$2 < 0 || i$2 >= yOut.length) ? ($throwRuntimeError("index out of range"), undefined) : yOut[i$2] = 0); _i$1++; } _ref$2 = zOut; _i$2 = 0; while (true) { if (!(_i$2 < 9)) { break; } i$3 = _i$2; zOut.nilCheck, ((i$3 < 0 || i$3 >= zOut.length) ? ($throwRuntimeError("index out of range"), undefined) : zOut[i$3] = 0); _i$2++; } nIsInfinityMask = 4294967295; i$4 = 0; while (true) { if (!(i$4 < 64)) { break; } if (!((i$4 === 0))) { p256PointDouble(xOut, yOut, zOut, xOut, yOut, zOut); p256PointDouble(xOut, yOut, zOut, xOut, yOut, zOut); p256PointDouble(xOut, yOut, zOut, xOut, yOut, zOut); p256PointDouble(xOut, yOut, zOut, xOut, yOut, zOut); } index = (((x$7 = scalar, x$8 = 31 - (_q$3 = i$4 / 2, (_q$3 === _q$3 && _q$3 !== 1/0 && _q$3 !== -1/0) ? _q$3 >> 0 : $throwRuntimeError("integer divide by zero")) >> 0, ((x$8 < 0 || x$8 >= x$7.length) ? ($throwRuntimeError("index out of range"), undefined) : x$7[x$8])) >>> 0)); if (((i$4 & 1)) === 1) { index = (index & (15)) >>> 0; } else { index = (y$1 = (4), y$1 < 32 ? (index >>> y$1) : 0) >>> 0; } p256SelectJacobianPoint(px, py, pz, precomp, index); p256PointAdd(tx, ty, tz, xOut, yOut, zOut, px, py, pz); p256CopyConditional(xOut, px, nIsInfinityMask); p256CopyConditional(yOut, py, nIsInfinityMask); p256CopyConditional(zOut, pz, nIsInfinityMask); pIsNoninfiniteMask = nonZeroToAllOnes(index); mask$1 = (pIsNoninfiniteMask & (~nIsInfinityMask >>> 0)) >>> 0; p256CopyConditional(xOut, tx, mask$1); p256CopyConditional(yOut, ty, mask$1); p256CopyConditional(zOut, tz, mask$1); nIsInfinityMask = (nIsInfinityMask & ~(pIsNoninfiniteMask)) >>> 0; i$4 = i$4 + (1) >> 0; } }; p256FromBig = function(out, in$1) { var _r, _r$1, _r$2, bits, bits$1, i, in$1, out, tmp, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; bits = $f.bits; bits$1 = $f.bits$1; i = $f.i; in$1 = $f.in$1; out = $f.out; tmp = $f.tmp; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: tmp = new big.Int.ptr(false, big.nat.nil).Lsh(in$1, 257); _r = tmp.Mod(tmp, p256Params.P); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; i = 0; /* while (true) { */ case 2: /* if (!(i < 9)) { break; } */ if(!(i < 9)) { $s = 3; continue; } bits = tmp.Bits(); if (bits.$length > 0) { out.nilCheck, ((i < 0 || i >= out.length) ? ($throwRuntimeError("index out of range"), undefined) : out[i] = (((((0 >= bits.$length ? ($throwRuntimeError("index out of range"), undefined) : bits.$array[bits.$offset + 0]) >>> 0)) & 536870911) >>> 0)); } else { out.nilCheck, ((i < 0 || i >= out.length) ? ($throwRuntimeError("index out of range"), undefined) : out[i] = 0); } _r$1 = tmp.Rsh(tmp, 29); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; i = i + (1) >> 0; if (i === 9) { /* break; */ $s = 3; continue; } bits$1 = tmp.Bits(); if (bits$1.$length > 0) { out.nilCheck, ((i < 0 || i >= out.length) ? ($throwRuntimeError("index out of range"), undefined) : out[i] = (((((0 >= bits$1.$length ? ($throwRuntimeError("index out of range"), undefined) : bits$1.$array[bits$1.$offset + 0]) >>> 0)) & 268435455) >>> 0)); } else { out.nilCheck, ((i < 0 || i >= out.length) ? ($throwRuntimeError("index out of range"), undefined) : out[i] = 0); } _r$2 = tmp.Rsh(tmp, 28); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; i = i + (1) >> 0; $s = 2; continue; case 3: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: p256FromBig }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.bits = bits; $f.bits$1 = bits$1; $f.i = i; $f.in$1 = in$1; $f.out = out; $f.tmp = tmp; $f.$s = $s; $f.$r = $r; return $f; }; p256ToBig = function(in$1) { var _r, _r$1, _r$2, _tmp, _tmp$1, i, in$1, result, tmp, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; i = $f.i; in$1 = $f.in$1; result = $f.result; tmp = $f.tmp; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _tmp = new big.Int.ptr(false, big.nat.nil); _tmp$1 = new big.Int.ptr(false, big.nat.nil); result = _tmp; tmp = _tmp$1; result.SetInt64((new $Int64(0, in$1[8]))); i = 7; /* while (true) { */ case 1: /* if (!(i >= 0)) { break; } */ if(!(i >= 0)) { $s = 2; continue; } if (((i & 1)) === 0) { result.Lsh(result, 29); } else { result.Lsh(result, 28); } tmp.SetInt64((new $Int64(0, (x = in$1, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i]))))); _r = result.Add(result, tmp); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; i = i - (1) >> 0; $s = 1; continue; case 2: _r$1 = result.Mul(result, p256RInverse); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _r$2 = result.Mod(result, p256Params.P); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; $s = -1; return result; /* */ } return; } if ($f === undefined) { $f = { $blk: p256ToBig }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.i = i; $f.in$1 = in$1; $f.result = result; $f.tmp = tmp; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; initP224 = function() { var _r, _r$1, _r$2, _r$3, _r$4, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p224.CurveParams = new CurveParams.ptr(ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, 0, "P-224"); _r = new big.Int.ptr(false, big.nat.nil).SetString("26959946667150639794667015087019630673557916260026308143510066298881", 10); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; p224.CurveParams.P = _tuple[0]; _r$1 = new big.Int.ptr(false, big.nat.nil).SetString("26959946667150639794667015087019625940457807714424391721682722368061", 10); /* */ $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; p224.CurveParams.N = _tuple$1[0]; _r$2 = new big.Int.ptr(false, big.nat.nil).SetString("b4050a850c04b3abf54132565044b0b7d7bfd8ba270b39432355ffb4", 16); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$2 = _r$2; p224.CurveParams.B = _tuple$2[0]; _r$3 = new big.Int.ptr(false, big.nat.nil).SetString("b70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21", 16); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$3 = _r$3; p224.CurveParams.Gx = _tuple$3[0]; _r$4 = new big.Int.ptr(false, big.nat.nil).SetString("bd376388b5f723fb4c22dfe6cd4375a05a07476444d5819985007e34", 16); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$4 = _r$4; p224.CurveParams.Gy = _tuple$4[0]; p224.CurveParams.BitSize = 224; p224FromBig(p224.gx, p224.CurveParams.Gx); p224FromBig(p224.gy, p224.CurveParams.Gy); p224FromBig(p224.b, p224.CurveParams.B); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: initP224 }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f.$s = $s; $f.$r = $r; return $f; }; P224 = function() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = initonce.Do(initAll); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return new p224.constructor.elem(p224); /* */ } return; } if ($f === undefined) { $f = { $blk: P224 }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.P224 = P224; p224Curve.ptr.prototype.Params = function() { var curve; curve = this; return curve.CurveParams; }; p224Curve.prototype.Params = function() { return this.$val.Params(); }; p224Curve.ptr.prototype.IsOnCurve = function(bigX, bigY) { var _tmp, _tmp$1, bigX, bigY, curve, i, i$1, tmp, x, x3, y; curve = this; _tmp = arrayType.zero(); _tmp$1 = arrayType.zero(); x = $clone(_tmp, p224FieldElement); y = $clone(_tmp$1, p224FieldElement); p224FromBig(x, bigX); p224FromBig(y, bigY); tmp = arrayType$8.zero(); x3 = arrayType.zero(); p224Square(x3, x, tmp); p224Mul(x3, x3, x, tmp); i = 0; while (true) { if (!(i < 8)) { break; } ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i] = ($imul(((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i]), (3)) >>> 0)); i = i + (1) >> 0; } p224Sub(x3, x3, x); p224Reduce(x3); p224Add(x3, x3, curve.b); p224Contract(x3, x3); p224Square(y, y, tmp); p224Contract(y, y); i$1 = 0; while (true) { if (!(i$1 < 8)) { break; } if (!((((i$1 < 0 || i$1 >= y.length) ? ($throwRuntimeError("index out of range"), undefined) : y[i$1]) === ((i$1 < 0 || i$1 >= x3.length) ? ($throwRuntimeError("index out of range"), undefined) : x3[i$1])))) { return false; } i$1 = i$1 + (1) >> 0; } return true; }; p224Curve.prototype.IsOnCurve = function(bigX, bigY) { return this.$val.IsOnCurve(bigX, bigY); }; p224Curve.ptr.prototype.Add = function(bigX1, bigY1, bigX2, bigY2) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tuple, bigX1, bigX2, bigY1, bigY2, x, x1, x2, x3, y, y1, y2, y3, z1, z2, z3; x = ptrType$1.nil; y = ptrType$1.nil; _tmp = arrayType.zero(); _tmp$1 = arrayType.zero(); _tmp$2 = arrayType.zero(); _tmp$3 = arrayType.zero(); _tmp$4 = arrayType.zero(); _tmp$5 = arrayType.zero(); _tmp$6 = arrayType.zero(); _tmp$7 = arrayType.zero(); _tmp$8 = arrayType.zero(); x1 = $clone(_tmp, p224FieldElement); y1 = $clone(_tmp$1, p224FieldElement); z1 = $clone(_tmp$2, p224FieldElement); x2 = $clone(_tmp$3, p224FieldElement); y2 = $clone(_tmp$4, p224FieldElement); z2 = $clone(_tmp$5, p224FieldElement); x3 = $clone(_tmp$6, p224FieldElement); y3 = $clone(_tmp$7, p224FieldElement); z3 = $clone(_tmp$8, p224FieldElement); p224FromBig(x1, bigX1); p224FromBig(y1, bigY1); if (!((bigX1.Sign() === 0)) || !((bigY1.Sign() === 0))) { z1[0] = 1; } p224FromBig(x2, bigX2); p224FromBig(y2, bigY2); if (!((bigX2.Sign() === 0)) || !((bigY2.Sign() === 0))) { z2[0] = 1; } p224AddJacobian(x3, y3, z3, x1, y1, z1, x2, y2, z2); _tuple = p224ToAffine(x3, y3, z3); x = _tuple[0]; y = _tuple[1]; return [x, y]; }; p224Curve.prototype.Add = function(bigX1, bigY1, bigX2, bigY2) { return this.$val.Add(bigX1, bigY1, bigX2, bigY2); }; p224Curve.ptr.prototype.Double = function(bigX1, bigY1) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, bigX1, bigY1, x, x1, x2, y, y1, y2, z1, z2; x = ptrType$1.nil; y = ptrType$1.nil; _tmp = arrayType.zero(); _tmp$1 = arrayType.zero(); _tmp$2 = arrayType.zero(); _tmp$3 = arrayType.zero(); _tmp$4 = arrayType.zero(); _tmp$5 = arrayType.zero(); x1 = $clone(_tmp, p224FieldElement); y1 = $clone(_tmp$1, p224FieldElement); z1 = $clone(_tmp$2, p224FieldElement); x2 = $clone(_tmp$3, p224FieldElement); y2 = $clone(_tmp$4, p224FieldElement); z2 = $clone(_tmp$5, p224FieldElement); p224FromBig(x1, bigX1); p224FromBig(y1, bigY1); z1[0] = 1; p224DoubleJacobian(x2, y2, z2, x1, y1, z1); _tuple = p224ToAffine(x2, y2, z2); x = _tuple[0]; y = _tuple[1]; return [x, y]; }; p224Curve.prototype.Double = function(bigX1, bigY1) { return this.$val.Double(bigX1, bigY1); }; p224Curve.ptr.prototype.ScalarMult = function(bigX1, bigY1, scalar) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, bigX1, bigY1, scalar, x, x1, x2, y, y1, y2, z1, z2; x = ptrType$1.nil; y = ptrType$1.nil; _tmp = arrayType.zero(); _tmp$1 = arrayType.zero(); _tmp$2 = arrayType.zero(); _tmp$3 = arrayType.zero(); _tmp$4 = arrayType.zero(); _tmp$5 = arrayType.zero(); x1 = $clone(_tmp, p224FieldElement); y1 = $clone(_tmp$1, p224FieldElement); z1 = $clone(_tmp$2, p224FieldElement); x2 = $clone(_tmp$3, p224FieldElement); y2 = $clone(_tmp$4, p224FieldElement); z2 = $clone(_tmp$5, p224FieldElement); p224FromBig(x1, bigX1); p224FromBig(y1, bigY1); z1[0] = 1; p224ScalarMult(x2, y2, z2, x1, y1, z1, scalar); _tuple = p224ToAffine(x2, y2, z2); x = _tuple[0]; y = _tuple[1]; return [x, y]; }; p224Curve.prototype.ScalarMult = function(bigX1, bigY1, scalar) { return this.$val.ScalarMult(bigX1, bigY1, scalar); }; p224Curve.ptr.prototype.ScalarBaseMult = function(scalar) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, curve, scalar, x, x2, y, y2, z1, z2; x = ptrType$1.nil; y = ptrType$1.nil; curve = this; _tmp = arrayType.zero(); _tmp$1 = arrayType.zero(); _tmp$2 = arrayType.zero(); _tmp$3 = arrayType.zero(); z1 = $clone(_tmp, p224FieldElement); x2 = $clone(_tmp$1, p224FieldElement); y2 = $clone(_tmp$2, p224FieldElement); z2 = $clone(_tmp$3, p224FieldElement); z1[0] = 1; p224ScalarMult(x2, y2, z2, curve.gx, curve.gy, z1, scalar); _tuple = p224ToAffine(x2, y2, z2); x = _tuple[0]; y = _tuple[1]; return [x, y]; }; p224Curve.prototype.ScalarBaseMult = function(scalar) { return this.$val.ScalarBaseMult(scalar); }; p224IsZero = function(a) { var _i, _ref, _tmp, _tmp$1, a, i, isP, isZero, minimal, result, v; minimal = arrayType.zero(); p224Contract(minimal, a); _tmp = 0; _tmp$1 = 0; isZero = _tmp; isP = _tmp$1; _ref = minimal; _i = 0; while (true) { if (!(_i < 8)) { break; } i = _i; v = ((_i < 0 || _i >= _ref.length) ? ($throwRuntimeError("index out of range"), undefined) : _ref[_i]); isZero = (isZero | (v)) >>> 0; isP = (isP | ((v - ((i < 0 || i >= p224P.length) ? ($throwRuntimeError("index out of range"), undefined) : p224P[i]) >>> 0))) >>> 0; _i++; } isZero = (isZero | ((isZero >>> 16 >>> 0))) >>> 0; isZero = (isZero | ((isZero >>> 8 >>> 0))) >>> 0; isZero = (isZero | ((isZero >>> 4 >>> 0))) >>> 0; isZero = (isZero | ((isZero >>> 2 >>> 0))) >>> 0; isZero = (isZero | ((isZero >>> 1 >>> 0))) >>> 0; isP = (isP | ((isP >>> 16 >>> 0))) >>> 0; isP = (isP | ((isP >>> 8 >>> 0))) >>> 0; isP = (isP | ((isP >>> 4 >>> 0))) >>> 0; isP = (isP | ((isP >>> 2 >>> 0))) >>> 0; isP = (isP | ((isP >>> 1 >>> 0))) >>> 0; result = (isZero & isP) >>> 0; result = (((~result >>> 0)) & 1) >>> 0; return result; }; p224Add = function(out, a, b) { var a, b, i, out, x, x$1; i = 0; while (true) { if (!(i < 8)) { break; } out.nilCheck, ((i < 0 || i >= out.length) ? ($throwRuntimeError("index out of range"), undefined) : out[i] = ((x = a, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i])) + (x$1 = b, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i])) >>> 0)); i = i + (1) >> 0; } }; p224Sub = function(out, a, b) { var a, b, i, out, x, x$1; i = 0; while (true) { if (!(i < 8)) { break; } out.nilCheck, ((i < 0 || i >= out.length) ? ($throwRuntimeError("index out of range"), undefined) : out[i] = (((x = a, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i])) + ((i < 0 || i >= p224ZeroModP31.$length) ? ($throwRuntimeError("index out of range"), undefined) : p224ZeroModP31.$array[p224ZeroModP31.$offset + i]) >>> 0) - (x$1 = b, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i])) >>> 0)); i = i + (1) >> 0; } }; p224Mul = function(out, a, b, tmp) { var _index, a, b, i, i$1, j, out, tmp, x, x$1, x$2, x$3, x$4, x$5; i = 0; while (true) { if (!(i < 15)) { break; } tmp.nilCheck, ((i < 0 || i >= tmp.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp[i] = new $Uint64(0, 0)); i = i + (1) >> 0; } i$1 = 0; while (true) { if (!(i$1 < 8)) { break; } j = 0; while (true) { if (!(j < 8)) { break; } _index = i$1 + j >> 0; (x$5 = tmp, ((_index < 0 || _index >= x$5.length) ? ($throwRuntimeError("index out of range"), undefined) : x$5[_index] = (x = (x$1 = tmp, ((_index < 0 || _index >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[_index])), x$2 = $mul64((new $Uint64(0, (x$3 = a, ((i$1 < 0 || i$1 >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[i$1])))), (new $Uint64(0, (x$4 = b, ((j < 0 || j >= x$4.length) ? ($throwRuntimeError("index out of range"), undefined) : x$4[j]))))), new $Uint64(x.$high + x$2.$high, x.$low + x$2.$low)))); j = j + (1) >> 0; } i$1 = i$1 + (1) >> 0; } p224ReduceLarge(out, tmp); }; p224Square = function(out, a, tmp) { var _index, _index$1, a, i, i$1, j, out, r, tmp, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; i = 0; while (true) { if (!(i < 15)) { break; } tmp.nilCheck, ((i < 0 || i >= tmp.length) ? ($throwRuntimeError("index out of range"), undefined) : tmp[i] = new $Uint64(0, 0)); i = i + (1) >> 0; } i$1 = 0; while (true) { if (!(i$1 < 8)) { break; } j = 0; while (true) { if (!(j <= i$1)) { break; } r = $mul64((new $Uint64(0, (x = a, ((i$1 < 0 || i$1 >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i$1])))), (new $Uint64(0, (x$1 = a, ((j < 0 || j >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[j]))))); if (i$1 === j) { _index = i$1 + j >> 0; (x$5 = tmp, ((_index < 0 || _index >= x$5.length) ? ($throwRuntimeError("index out of range"), undefined) : x$5[_index] = (x$2 = (x$3 = tmp, ((_index < 0 || _index >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[_index])), x$4 = r, new $Uint64(x$2.$high + x$4.$high, x$2.$low + x$4.$low)))); } else { _index$1 = i$1 + j >> 0; (x$9 = tmp, ((_index$1 < 0 || _index$1 >= x$9.length) ? ($throwRuntimeError("index out of range"), undefined) : x$9[_index$1] = (x$6 = (x$7 = tmp, ((_index$1 < 0 || _index$1 >= x$7.length) ? ($throwRuntimeError("index out of range"), undefined) : x$7[_index$1])), x$8 = $shiftLeft64(r, 1), new $Uint64(x$6.$high + x$8.$high, x$6.$low + x$8.$low)))); } j = j + (1) >> 0; } i$1 = i$1 + (1) >> 0; } p224ReduceLarge(out, tmp); }; p224ReduceLarge = function(out, in$1) { var _index, _index$1, _index$2, _index$3, i, i$1, i$2, in$1, out, 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$29, x$3, x$30, x$31, x$4, x$5, x$6, x$7, x$8, x$9; i = 0; while (true) { if (!(i < 8)) { break; } (x$3 = in$1, ((i < 0 || i >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[i] = (x = (x$1 = in$1, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i])), x$2 = ((i < 0 || i >= p224ZeroModP63.length) ? ($throwRuntimeError("index out of range"), undefined) : p224ZeroModP63[i]), new $Uint64(x.$high + x$2.$high, x.$low + x$2.$low)))); i = i + (1) >> 0; } i$1 = 14; while (true) { if (!(i$1 >= 8)) { break; } _index = i$1 - 8 >> 0; (x$8 = in$1, ((_index < 0 || _index >= x$8.length) ? ($throwRuntimeError("index out of range"), undefined) : x$8[_index] = (x$4 = (x$5 = in$1, ((_index < 0 || _index >= x$5.length) ? ($throwRuntimeError("index out of range"), undefined) : x$5[_index])), x$6 = (x$7 = in$1, ((i$1 < 0 || i$1 >= x$7.length) ? ($throwRuntimeError("index out of range"), undefined) : x$7[i$1])), new $Uint64(x$4.$high - x$6.$high, x$4.$low - x$6.$low)))); _index$1 = i$1 - 5 >> 0; (x$14 = in$1, ((_index$1 < 0 || _index$1 >= x$14.length) ? ($throwRuntimeError("index out of range"), undefined) : x$14[_index$1] = (x$9 = (x$10 = in$1, ((_index$1 < 0 || _index$1 >= x$10.length) ? ($throwRuntimeError("index out of range"), undefined) : x$10[_index$1])), x$11 = $shiftLeft64(((x$12 = (x$13 = in$1, ((i$1 < 0 || i$1 >= x$13.length) ? ($throwRuntimeError("index out of range"), undefined) : x$13[i$1])), new $Uint64(x$12.$high & 0, (x$12.$low & 65535) >>> 0))), 12), new $Uint64(x$9.$high + x$11.$high, x$9.$low + x$11.$low)))); _index$2 = i$1 - 4 >> 0; (x$19 = in$1, ((_index$2 < 0 || _index$2 >= x$19.length) ? ($throwRuntimeError("index out of range"), undefined) : x$19[_index$2] = (x$15 = (x$16 = in$1, ((_index$2 < 0 || _index$2 >= x$16.length) ? ($throwRuntimeError("index out of range"), undefined) : x$16[_index$2])), x$17 = $shiftRightUint64((x$18 = in$1, ((i$1 < 0 || i$1 >= x$18.length) ? ($throwRuntimeError("index out of range"), undefined) : x$18[i$1])), 16), new $Uint64(x$15.$high + x$17.$high, x$15.$low + x$17.$low)))); i$1 = i$1 - (1) >> 0; } in$1.nilCheck, in$1[8] = new $Uint64(0, 0); i$2 = 1; while (true) { if (!(i$2 < 8)) { break; } _index$3 = i$2 + 1 >> 0; (x$24 = in$1, ((_index$3 < 0 || _index$3 >= x$24.length) ? ($throwRuntimeError("index out of range"), undefined) : x$24[_index$3] = (x$20 = (x$21 = in$1, ((_index$3 < 0 || _index$3 >= x$21.length) ? ($throwRuntimeError("index out of range"), undefined) : x$21[_index$3])), x$22 = $shiftRightUint64((x$23 = in$1, ((i$2 < 0 || i$2 >= x$23.length) ? ($throwRuntimeError("index out of range"), undefined) : x$23[i$2])), 28), new $Uint64(x$20.$high + x$22.$high, x$20.$low + x$22.$low)))); out.nilCheck, ((i$2 < 0 || i$2 >= out.length) ? ($throwRuntimeError("index out of range"), undefined) : out[i$2] = (((x$25 = (x$26 = in$1, ((i$2 < 0 || i$2 >= x$26.length) ? ($throwRuntimeError("index out of range"), undefined) : x$26[i$2])), new $Uint64(x$25.$high & 0, (x$25.$low & 268435455) >>> 0)).$low >>> 0))); i$2 = i$2 + (1) >> 0; } in$1[0] = (x$27 = in$1[0], x$28 = in$1[8], new $Uint64(x$27.$high - x$28.$high, x$27.$low - x$28.$low)); out[3] = (out[3] + (((((x$29 = in$1[8], new $Uint64(x$29.$high & 0, (x$29.$low & 65535) >>> 0)).$low >>> 0)) << 12 >>> 0)) >>> 0); out[4] = (out[4] + ((($shiftRightUint64(in$1[8], 16).$low >>> 0))) >>> 0); out.nilCheck, out[0] = (((x$30 = in$1[0], new $Uint64(x$30.$high & 0, (x$30.$low & 268435455) >>> 0)).$low >>> 0)); out[1] = (out[1] + ((((x$31 = $shiftRightUint64(in$1[0], 28), new $Uint64(x$31.$high & 0, (x$31.$low & 268435455) >>> 0)).$low >>> 0))) >>> 0); out[2] = (out[2] + ((($shiftRightUint64(in$1[0], 56).$low >>> 0))) >>> 0); }; p224Reduce = function(a) { var _index, a, i, mask$1, top, x, x$1, x$2, x$3, x$4, y; i = 0; while (true) { if (!(i < 7)) { break; } _index = i + 1 >> 0; (x$2 = a, ((_index < 0 || _index >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[_index] = ((x = a, ((_index < 0 || _index >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[_index])) + (((x$1 = a, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i])) >>> 28 >>> 0)) >>> 0))); (x$4 = a, ((i < 0 || i >= x$4.length) ? ($throwRuntimeError("index out of range"), undefined) : x$4[i] = (((x$3 = a, ((i < 0 || i >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[i])) & (268435455)) >>> 0))); i = i + (1) >> 0; } top = a[7] >>> 28 >>> 0; a[7] = ((a[7] & (268435455)) >>> 0); mask$1 = top; mask$1 = (mask$1 | ((mask$1 >>> 2 >>> 0))) >>> 0; mask$1 = (mask$1 | ((mask$1 >>> 1 >>> 0))) >>> 0; mask$1 = (y = (31), y < 32 ? (mask$1 << y) : 0) >>> 0; mask$1 = (((((mask$1 >> 0)) >> 31 >> 0) >>> 0)); a[0] = (a[0] - (top) >>> 0); a[3] = (a[3] + ((top << 12 >>> 0)) >>> 0); a[3] = (a[3] - (((1 & mask$1) >>> 0)) >>> 0); a[2] = (a[2] + (((mask$1 & 268435455) >>> 0)) >>> 0); a[1] = (a[1] + (((mask$1 & 268435455) >>> 0)) >>> 0); a[0] = (a[0] + (((mask$1 & 268435456) >>> 0)) >>> 0); }; p224Invert = function(out, in$1) { var _tmp, _tmp$1, _tmp$2, _tmp$3, c, f1, f2, f3, f4, i, i$1, i$2, i$3, i$4, i$5, i$6, in$1, out; _tmp = arrayType.zero(); _tmp$1 = arrayType.zero(); _tmp$2 = arrayType.zero(); _tmp$3 = arrayType.zero(); f1 = $clone(_tmp, p224FieldElement); f2 = $clone(_tmp$1, p224FieldElement); f3 = $clone(_tmp$2, p224FieldElement); f4 = $clone(_tmp$3, p224FieldElement); c = arrayType$8.zero(); p224Square(f1, in$1, c); p224Mul(f1, f1, in$1, c); p224Square(f1, f1, c); p224Mul(f1, f1, in$1, c); p224Square(f2, f1, c); p224Square(f2, f2, c); p224Square(f2, f2, c); p224Mul(f1, f1, f2, c); p224Square(f2, f1, c); i = 0; while (true) { if (!(i < 5)) { break; } p224Square(f2, f2, c); i = i + (1) >> 0; } p224Mul(f2, f2, f1, c); p224Square(f3, f2, c); i$1 = 0; while (true) { if (!(i$1 < 11)) { break; } p224Square(f3, f3, c); i$1 = i$1 + (1) >> 0; } p224Mul(f2, f3, f2, c); p224Square(f3, f2, c); i$2 = 0; while (true) { if (!(i$2 < 23)) { break; } p224Square(f3, f3, c); i$2 = i$2 + (1) >> 0; } p224Mul(f3, f3, f2, c); p224Square(f4, f3, c); i$3 = 0; while (true) { if (!(i$3 < 47)) { break; } p224Square(f4, f4, c); i$3 = i$3 + (1) >> 0; } p224Mul(f3, f3, f4, c); p224Square(f4, f3, c); i$4 = 0; while (true) { if (!(i$4 < 23)) { break; } p224Square(f4, f4, c); i$4 = i$4 + (1) >> 0; } p224Mul(f2, f4, f2, c); i$5 = 0; while (true) { if (!(i$5 < 6)) { break; } p224Square(f2, f2, c); i$5 = i$5 + (1) >> 0; } p224Mul(f1, f1, f2, c); p224Square(f1, f1, c); p224Mul(f1, f1, in$1, c); i$6 = 0; while (true) { if (!(i$6 < 97)) { break; } p224Square(f1, f1, c); i$6 = i$6 + (1) >> 0; } p224Mul(out, f1, f3, c); }; p224Contract = function(out, in$1) { var _index, _index$1, _index$2, _index$3, _index$4, bottom3NonZero, i, i$1, i$2, i$3, i$4, i$5, in$1, mask$1, mask$2, mask$3, mask$4, n, out, out3Equal, out3GT, top, top4AllOnes, 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$3, x$4, x$5, x$6, x$7, x$8, x$9; $copySlice(new sliceType(out), new sliceType(in$1)); i = 0; while (true) { if (!(i < 7)) { break; } _index = i + 1 >> 0; (x$2 = out, ((_index < 0 || _index >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[_index] = ((x = out, ((_index < 0 || _index >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[_index])) + (((x$1 = out, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i])) >>> 28 >>> 0)) >>> 0))); (x$4 = out, ((i < 0 || i >= x$4.length) ? ($throwRuntimeError("index out of range"), undefined) : x$4[i] = (((x$3 = out, ((i < 0 || i >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[i])) & (268435455)) >>> 0))); i = i + (1) >> 0; } top = out[7] >>> 28 >>> 0; out[7] = ((out[7] & (268435455)) >>> 0); out[0] = (out[0] - (top) >>> 0); out[3] = (out[3] + ((top << 12 >>> 0)) >>> 0); i$1 = 0; while (true) { if (!(i$1 < 3)) { break; } mask$1 = ((((((x$5 = out, ((i$1 < 0 || i$1 >= x$5.length) ? ($throwRuntimeError("index out of range"), undefined) : x$5[i$1])) >> 0)) >> 31 >> 0) >>> 0)); (x$7 = out, ((i$1 < 0 || i$1 >= x$7.length) ? ($throwRuntimeError("index out of range"), undefined) : x$7[i$1] = ((x$6 = out, ((i$1 < 0 || i$1 >= x$6.length) ? ($throwRuntimeError("index out of range"), undefined) : x$6[i$1])) + (((268435456 & mask$1) >>> 0)) >>> 0))); _index$1 = i$1 + 1 >> 0; (x$9 = out, ((_index$1 < 0 || _index$1 >= x$9.length) ? ($throwRuntimeError("index out of range"), undefined) : x$9[_index$1] = ((x$8 = out, ((_index$1 < 0 || _index$1 >= x$8.length) ? ($throwRuntimeError("index out of range"), undefined) : x$8[_index$1])) - (((1 & mask$1) >>> 0)) >>> 0))); i$1 = i$1 + (1) >> 0; } i$2 = 3; while (true) { if (!(i$2 < 7)) { break; } _index$2 = i$2 + 1 >> 0; (x$12 = out, ((_index$2 < 0 || _index$2 >= x$12.length) ? ($throwRuntimeError("index out of range"), undefined) : x$12[_index$2] = ((x$10 = out, ((_index$2 < 0 || _index$2 >= x$10.length) ? ($throwRuntimeError("index out of range"), undefined) : x$10[_index$2])) + (((x$11 = out, ((i$2 < 0 || i$2 >= x$11.length) ? ($throwRuntimeError("index out of range"), undefined) : x$11[i$2])) >>> 28 >>> 0)) >>> 0))); (x$14 = out, ((i$2 < 0 || i$2 >= x$14.length) ? ($throwRuntimeError("index out of range"), undefined) : x$14[i$2] = (((x$13 = out, ((i$2 < 0 || i$2 >= x$13.length) ? ($throwRuntimeError("index out of range"), undefined) : x$13[i$2])) & (268435455)) >>> 0))); i$2 = i$2 + (1) >> 0; } top = out[7] >>> 28 >>> 0; out[7] = ((out[7] & (268435455)) >>> 0); out[0] = (out[0] - (top) >>> 0); out[3] = (out[3] + ((top << 12 >>> 0)) >>> 0); i$3 = 0; while (true) { if (!(i$3 < 3)) { break; } mask$2 = ((((((x$15 = out, ((i$3 < 0 || i$3 >= x$15.length) ? ($throwRuntimeError("index out of range"), undefined) : x$15[i$3])) >> 0)) >> 31 >> 0) >>> 0)); (x$17 = out, ((i$3 < 0 || i$3 >= x$17.length) ? ($throwRuntimeError("index out of range"), undefined) : x$17[i$3] = ((x$16 = out, ((i$3 < 0 || i$3 >= x$16.length) ? ($throwRuntimeError("index out of range"), undefined) : x$16[i$3])) + (((268435456 & mask$2) >>> 0)) >>> 0))); _index$3 = i$3 + 1 >> 0; (x$19 = out, ((_index$3 < 0 || _index$3 >= x$19.length) ? ($throwRuntimeError("index out of range"), undefined) : x$19[_index$3] = ((x$18 = out, ((_index$3 < 0 || _index$3 >= x$18.length) ? ($throwRuntimeError("index out of range"), undefined) : x$18[_index$3])) - (((1 & mask$2) >>> 0)) >>> 0))); i$3 = i$3 + (1) >> 0; } top4AllOnes = 4294967295; i$4 = 4; while (true) { if (!(i$4 < 8)) { break; } top4AllOnes = (top4AllOnes & ((x$20 = out, ((i$4 < 0 || i$4 >= x$20.length) ? ($throwRuntimeError("index out of range"), undefined) : x$20[i$4])))) >>> 0; i$4 = i$4 + (1) >> 0; } top4AllOnes = (top4AllOnes | (4026531840)) >>> 0; top4AllOnes = (top4AllOnes & ((top4AllOnes >>> 16 >>> 0))) >>> 0; top4AllOnes = (top4AllOnes & ((top4AllOnes >>> 8 >>> 0))) >>> 0; top4AllOnes = (top4AllOnes & ((top4AllOnes >>> 4 >>> 0))) >>> 0; top4AllOnes = (top4AllOnes & ((top4AllOnes >>> 2 >>> 0))) >>> 0; top4AllOnes = (top4AllOnes & ((top4AllOnes >>> 1 >>> 0))) >>> 0; top4AllOnes = ((((((top4AllOnes << 31 >>> 0) >> 0)) >> 31 >> 0) >>> 0)); bottom3NonZero = (((out[0] | out[1]) >>> 0) | out[2]) >>> 0; bottom3NonZero = (bottom3NonZero | ((bottom3NonZero >>> 16 >>> 0))) >>> 0; bottom3NonZero = (bottom3NonZero | ((bottom3NonZero >>> 8 >>> 0))) >>> 0; bottom3NonZero = (bottom3NonZero | ((bottom3NonZero >>> 4 >>> 0))) >>> 0; bottom3NonZero = (bottom3NonZero | ((bottom3NonZero >>> 2 >>> 0))) >>> 0; bottom3NonZero = (bottom3NonZero | ((bottom3NonZero >>> 1 >>> 0))) >>> 0; bottom3NonZero = ((((((bottom3NonZero << 31 >>> 0) >> 0)) >> 31 >> 0) >>> 0)); n = 268431360 - out[3] >>> 0; out3Equal = n; out3Equal = (out3Equal | ((out3Equal >>> 16 >>> 0))) >>> 0; out3Equal = (out3Equal | ((out3Equal >>> 8 >>> 0))) >>> 0; out3Equal = (out3Equal | ((out3Equal >>> 4 >>> 0))) >>> 0; out3Equal = (out3Equal | ((out3Equal >>> 2 >>> 0))) >>> 0; out3Equal = (out3Equal | ((out3Equal >>> 1 >>> 0))) >>> 0; out3Equal = ~((((((out3Equal << 31 >>> 0) >> 0)) >> 31 >> 0) >>> 0)) >>> 0; out3GT = (((((n >> 0)) >> 31 >> 0) >>> 0)); mask$3 = (top4AllOnes & ((((((out3Equal & bottom3NonZero) >>> 0)) | out3GT) >>> 0))) >>> 0; out[0] = (out[0] - (((1 & mask$3) >>> 0)) >>> 0); out[3] = (out[3] - (((268431360 & mask$3) >>> 0)) >>> 0); out[4] = (out[4] - (((268435455 & mask$3) >>> 0)) >>> 0); out[5] = (out[5] - (((268435455 & mask$3) >>> 0)) >>> 0); out[6] = (out[6] - (((268435455 & mask$3) >>> 0)) >>> 0); out[7] = (out[7] - (((268435455 & mask$3) >>> 0)) >>> 0); i$5 = 0; while (true) { if (!(i$5 < 3)) { break; } mask$4 = ((((((x$21 = out, ((i$5 < 0 || i$5 >= x$21.length) ? ($throwRuntimeError("index out of range"), undefined) : x$21[i$5])) >> 0)) >> 31 >> 0) >>> 0)); (x$23 = out, ((i$5 < 0 || i$5 >= x$23.length) ? ($throwRuntimeError("index out of range"), undefined) : x$23[i$5] = ((x$22 = out, ((i$5 < 0 || i$5 >= x$22.length) ? ($throwRuntimeError("index out of range"), undefined) : x$22[i$5])) + (((268435456 & mask$4) >>> 0)) >>> 0))); _index$4 = i$5 + 1 >> 0; (x$25 = out, ((_index$4 < 0 || _index$4 >= x$25.length) ? ($throwRuntimeError("index out of range"), undefined) : x$25[_index$4] = ((x$24 = out, ((_index$4 < 0 || _index$4 >= x$24.length) ? ($throwRuntimeError("index out of range"), undefined) : x$24[_index$4])) - (((1 & mask$4) >>> 0)) >>> 0))); i$5 = i$5 + (1) >> 0; } }; p224AddJacobian = function(x3, y3, z3, x1, y1, z1, x2, y2, z2) { var _tmp, _tmp$1, _tmp$10, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, c, h, i, i$1, i$2, i$3, j, j$1, r, s1, s2, u1, u2, v, x1, x2, x3, xEqual, y, y$1, y1, y2, y3, yEqual, z1, z1IsZero, z1z1, z2, z2IsZero, z2z2, z3; _tmp = arrayType.zero(); _tmp$1 = arrayType.zero(); _tmp$2 = arrayType.zero(); _tmp$3 = arrayType.zero(); _tmp$4 = arrayType.zero(); _tmp$5 = arrayType.zero(); _tmp$6 = arrayType.zero(); _tmp$7 = arrayType.zero(); _tmp$8 = arrayType.zero(); _tmp$9 = arrayType.zero(); _tmp$10 = arrayType.zero(); z1z1 = $clone(_tmp, p224FieldElement); z2z2 = $clone(_tmp$1, p224FieldElement); u1 = $clone(_tmp$2, p224FieldElement); u2 = $clone(_tmp$3, p224FieldElement); s1 = $clone(_tmp$4, p224FieldElement); s2 = $clone(_tmp$5, p224FieldElement); h = $clone(_tmp$6, p224FieldElement); i = $clone(_tmp$7, p224FieldElement); j = $clone(_tmp$8, p224FieldElement); r = $clone(_tmp$9, p224FieldElement); v = $clone(_tmp$10, p224FieldElement); c = arrayType$8.zero(); z1IsZero = p224IsZero(z1); z2IsZero = p224IsZero(z2); p224Square(z1z1, z1, c); p224Square(z2z2, z2, c); p224Mul(u1, x1, z2z2, c); p224Mul(u2, x2, z1z1, c); p224Mul(s1, z2, z2z2, c); p224Mul(s1, y1, s1, c); p224Mul(s2, z1, z1z1, c); p224Mul(s2, y2, s2, c); p224Sub(h, u2, u1); p224Reduce(h); xEqual = p224IsZero(h); j$1 = 0; while (true) { if (!(j$1 < 8)) { break; } ((j$1 < 0 || j$1 >= i.length) ? ($throwRuntimeError("index out of range"), undefined) : i[j$1] = (((j$1 < 0 || j$1 >= h.length) ? ($throwRuntimeError("index out of range"), undefined) : h[j$1]) << 1 >>> 0)); j$1 = j$1 + (1) >> 0; } p224Reduce(i); p224Square(i, i, c); p224Mul(j, h, i, c); p224Sub(r, s2, s1); p224Reduce(r); yEqual = p224IsZero(r); if ((xEqual === 1) && (yEqual === 1) && (z1IsZero === 0) && (z2IsZero === 0)) { p224DoubleJacobian(x3, y3, z3, x1, y1, z1); return; } i$1 = 0; while (true) { if (!(i$1 < 8)) { break; } ((i$1 < 0 || i$1 >= r.length) ? ($throwRuntimeError("index out of range"), undefined) : r[i$1] = ((y = (1), y < 32 ? (((i$1 < 0 || i$1 >= r.length) ? ($throwRuntimeError("index out of range"), undefined) : r[i$1]) << y) : 0) >>> 0)); i$1 = i$1 + (1) >> 0; } p224Reduce(r); p224Mul(v, u1, i, c); p224Add(z1z1, z1z1, z2z2); p224Add(z2z2, z1, z2); p224Reduce(z2z2); p224Square(z2z2, z2z2, c); p224Sub(z3, z2z2, z1z1); p224Reduce(z3); p224Mul(z3, z3, h, c); i$2 = 0; while (true) { if (!(i$2 < 8)) { break; } ((i$2 < 0 || i$2 >= z1z1.length) ? ($throwRuntimeError("index out of range"), undefined) : z1z1[i$2] = (((i$2 < 0 || i$2 >= v.length) ? ($throwRuntimeError("index out of range"), undefined) : v[i$2]) << 1 >>> 0)); i$2 = i$2 + (1) >> 0; } p224Add(z1z1, j, z1z1); p224Reduce(z1z1); p224Square(x3, r, c); p224Sub(x3, x3, z1z1); p224Reduce(x3); i$3 = 0; while (true) { if (!(i$3 < 8)) { break; } ((i$3 < 0 || i$3 >= s1.length) ? ($throwRuntimeError("index out of range"), undefined) : s1[i$3] = ((y$1 = (1), y$1 < 32 ? (((i$3 < 0 || i$3 >= s1.length) ? ($throwRuntimeError("index out of range"), undefined) : s1[i$3]) << y$1) : 0) >>> 0)); i$3 = i$3 + (1) >> 0; } p224Mul(s1, s1, j, c); p224Sub(z1z1, v, x3); p224Reduce(z1z1); p224Mul(z1z1, z1z1, r, c); p224Sub(y3, z1z1, s1); p224Reduce(y3); p224CopyConditional(x3, x2, z1IsZero); p224CopyConditional(x3, x1, z2IsZero); p224CopyConditional(y3, y2, z1IsZero); p224CopyConditional(y3, y1, z2IsZero); p224CopyConditional(z3, z2, z1IsZero); p224CopyConditional(z3, z1, z2IsZero); }; p224DoubleJacobian = function(x3, y3, z3, x1, y1, z1) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, alpha, beta, c, delta, gamma, i, i$1, i$2, i$3, t, x1, x3, y, y$1, y1, y3, z1, z3; _tmp = arrayType.zero(); _tmp$1 = arrayType.zero(); _tmp$2 = arrayType.zero(); _tmp$3 = arrayType.zero(); _tmp$4 = arrayType.zero(); delta = $clone(_tmp, p224FieldElement); gamma = $clone(_tmp$1, p224FieldElement); beta = $clone(_tmp$2, p224FieldElement); alpha = $clone(_tmp$3, p224FieldElement); t = $clone(_tmp$4, p224FieldElement); c = arrayType$8.zero(); p224Square(delta, z1, c); p224Square(gamma, y1, c); p224Mul(beta, x1, gamma, c); p224Add(t, x1, delta); i = 0; while (true) { if (!(i < 8)) { break; } ((i < 0 || i >= t.length) ? ($throwRuntimeError("index out of range"), undefined) : t[i] = (((i < 0 || i >= t.length) ? ($throwRuntimeError("index out of range"), undefined) : t[i]) + ((((i < 0 || i >= t.length) ? ($throwRuntimeError("index out of range"), undefined) : t[i]) << 1 >>> 0)) >>> 0)); i = i + (1) >> 0; } p224Reduce(t); p224Sub(alpha, x1, delta); p224Reduce(alpha); p224Mul(alpha, alpha, t, c); p224Add(z3, y1, z1); p224Reduce(z3); p224Square(z3, z3, c); p224Sub(z3, z3, gamma); p224Reduce(z3); p224Sub(z3, z3, delta); p224Reduce(z3); i$1 = 0; while (true) { if (!(i$1 < 8)) { break; } ((i$1 < 0 || i$1 >= delta.length) ? ($throwRuntimeError("index out of range"), undefined) : delta[i$1] = (((i$1 < 0 || i$1 >= beta.length) ? ($throwRuntimeError("index out of range"), undefined) : beta[i$1]) << 3 >>> 0)); i$1 = i$1 + (1) >> 0; } p224Reduce(delta); p224Square(x3, alpha, c); p224Sub(x3, x3, delta); p224Reduce(x3); i$2 = 0; while (true) { if (!(i$2 < 8)) { break; } ((i$2 < 0 || i$2 >= beta.length) ? ($throwRuntimeError("index out of range"), undefined) : beta[i$2] = ((y = (2), y < 32 ? (((i$2 < 0 || i$2 >= beta.length) ? ($throwRuntimeError("index out of range"), undefined) : beta[i$2]) << y) : 0) >>> 0)); i$2 = i$2 + (1) >> 0; } p224Sub(beta, beta, x3); p224Reduce(beta); p224Square(gamma, gamma, c); i$3 = 0; while (true) { if (!(i$3 < 8)) { break; } ((i$3 < 0 || i$3 >= gamma.length) ? ($throwRuntimeError("index out of range"), undefined) : gamma[i$3] = ((y$1 = (3), y$1 < 32 ? (((i$3 < 0 || i$3 >= gamma.length) ? ($throwRuntimeError("index out of range"), undefined) : gamma[i$3]) << y$1) : 0) >>> 0)); i$3 = i$3 + (1) >> 0; } p224Reduce(gamma); p224Mul(y3, alpha, beta, c); p224Sub(y3, y3, gamma); p224Reduce(y3); }; p224CopyConditional = function(out, in$1, control) { var control, i, in$1, out, x, x$1, x$2, x$3, y; control = (y = (31), y < 32 ? (control << y) : 0) >>> 0; control = (((((control >> 0)) >> 31 >> 0) >>> 0)); i = 0; while (true) { if (!(i < 8)) { break; } (x$3 = out, ((i < 0 || i >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[i] = (((x = out, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i])) ^ (((((((x$1 = out, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i])) ^ (x$2 = in$1, ((i < 0 || i >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i]))) >>> 0)) & control) >>> 0))) >>> 0))); i = i + (1) >> 0; } }; p224ScalarMult = function(outX, outY, outZ, inX, inY, inZ, scalar) { var _i, _ref, _tmp, _tmp$1, _tmp$2, bit, bitNum, byte$1, i, inX, inY, inZ, outX, outY, outZ, scalar, xx, y, yy, zz; _tmp = arrayType.zero(); _tmp$1 = arrayType.zero(); _tmp$2 = arrayType.zero(); xx = $clone(_tmp, p224FieldElement); yy = $clone(_tmp$1, p224FieldElement); zz = $clone(_tmp$2, p224FieldElement); i = 0; while (true) { if (!(i < 8)) { break; } outX.nilCheck, ((i < 0 || i >= outX.length) ? ($throwRuntimeError("index out of range"), undefined) : outX[i] = 0); outY.nilCheck, ((i < 0 || i >= outY.length) ? ($throwRuntimeError("index out of range"), undefined) : outY[i] = 0); outZ.nilCheck, ((i < 0 || i >= outZ.length) ? ($throwRuntimeError("index out of range"), undefined) : outZ[i] = 0); i = i + (1) >> 0; } _ref = scalar; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } byte$1 = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); bitNum = 0; while (true) { if (!(bitNum < 8)) { break; } p224DoubleJacobian(outX, outY, outZ, outX, outY, outZ); bit = (((((((y = ((7 - bitNum >>> 0)), y < 32 ? (byte$1 >>> y) : 0) << 24 >>> 24)) & 1) >>> 0) >>> 0)); p224AddJacobian(xx, yy, zz, inX, inY, inZ, outX, outY, outZ); p224CopyConditional(outX, xx, bit); p224CopyConditional(outY, yy, bit); p224CopyConditional(outZ, zz, bit); bitNum = bitNum + (1) >>> 0; } _i++; } }; p224ToAffine = function(x, y, z) { var _tmp, _tmp$1, _tmp$2, _tmp$3, isPointAtInfinity, outx, outy, tmp, x, y, z, zinv, zinvsq; _tmp = arrayType.zero(); _tmp$1 = arrayType.zero(); _tmp$2 = arrayType.zero(); _tmp$3 = arrayType.zero(); zinv = $clone(_tmp, p224FieldElement); zinvsq = $clone(_tmp$1, p224FieldElement); outx = $clone(_tmp$2, p224FieldElement); outy = $clone(_tmp$3, p224FieldElement); tmp = arrayType$8.zero(); isPointAtInfinity = p224IsZero(z); if (isPointAtInfinity === 1) { return [new big.Int.ptr(false, big.nat.nil), new big.Int.ptr(false, big.nat.nil)]; } p224Invert(zinv, z); p224Square(zinvsq, zinv, tmp); p224Mul(x, x, zinvsq, tmp); p224Mul(zinvsq, zinvsq, zinv, tmp); p224Mul(y, y, zinvsq, tmp); p224Contract(outx, x); p224Contract(outy, y); return [p224ToBig(outx), p224ToBig(outy)]; }; get28BitsFromEnd = function(buf, shift) { var b, buf, i, l, ret, shift, x, y, y$1; ret = 0; i = 0; while (true) { if (!(i < 4)) { break; } b = 0; l = buf.$length; if (l > 0) { b = (x = l - 1 >> 0, ((x < 0 || x >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + x])); if (!((i === 3)) || (shift === 4)) { buf = $subslice(buf, 0, (l - 1 >> 0)); } } ret = (ret | (((y = shift, y < 32 ? (((y$1 = ((8 * i >>> 0)), y$1 < 32 ? (((b >>> 0)) << y$1) : 0) >>> 0) >>> y) : 0) >>> 0))) >>> 0; i = i + (1) >>> 0; } ret = (ret & (268435455)) >>> 0; return [ret, buf]; }; p224FromBig = function(out, in$1) { var _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, bytes, in$1, out; bytes = in$1.Bytes(); _tuple = get28BitsFromEnd(bytes, 0); out.nilCheck, out[0] = _tuple[0]; bytes = _tuple[1]; _tuple$1 = get28BitsFromEnd(bytes, 4); out.nilCheck, out[1] = _tuple$1[0]; bytes = _tuple$1[1]; _tuple$2 = get28BitsFromEnd(bytes, 0); out.nilCheck, out[2] = _tuple$2[0]; bytes = _tuple$2[1]; _tuple$3 = get28BitsFromEnd(bytes, 4); out.nilCheck, out[3] = _tuple$3[0]; bytes = _tuple$3[1]; _tuple$4 = get28BitsFromEnd(bytes, 0); out.nilCheck, out[4] = _tuple$4[0]; bytes = _tuple$4[1]; _tuple$5 = get28BitsFromEnd(bytes, 4); out.nilCheck, out[5] = _tuple$5[0]; bytes = _tuple$5[1]; _tuple$6 = get28BitsFromEnd(bytes, 0); out.nilCheck, out[6] = _tuple$6[0]; bytes = _tuple$6[1]; _tuple$7 = get28BitsFromEnd(bytes, 4); out.nilCheck, out[7] = _tuple$7[0]; bytes = _tuple$7[1]; }; p224ToBig = function(in$1) { var buf, in$1; buf = arrayType$9.zero(); buf[27] = ((in$1[0] << 24 >>> 24)); buf[26] = (((in$1[0] >>> 8 >>> 0) << 24 >>> 24)); buf[25] = (((in$1[0] >>> 16 >>> 0) << 24 >>> 24)); buf[24] = (((((((((in$1[0] >>> 24 >>> 0)) & 15) >>> 0)) | ((((in$1[1] << 4 >>> 0)) & 240) >>> 0)) >>> 0) << 24 >>> 24)); buf[23] = (((in$1[1] >>> 4 >>> 0) << 24 >>> 24)); buf[22] = (((in$1[1] >>> 12 >>> 0) << 24 >>> 24)); buf[21] = (((in$1[1] >>> 20 >>> 0) << 24 >>> 24)); buf[20] = ((in$1[2] << 24 >>> 24)); buf[19] = (((in$1[2] >>> 8 >>> 0) << 24 >>> 24)); buf[18] = (((in$1[2] >>> 16 >>> 0) << 24 >>> 24)); buf[17] = (((((((((in$1[2] >>> 24 >>> 0)) & 15) >>> 0)) | ((((in$1[3] << 4 >>> 0)) & 240) >>> 0)) >>> 0) << 24 >>> 24)); buf[16] = (((in$1[3] >>> 4 >>> 0) << 24 >>> 24)); buf[15] = (((in$1[3] >>> 12 >>> 0) << 24 >>> 24)); buf[14] = (((in$1[3] >>> 20 >>> 0) << 24 >>> 24)); buf[13] = ((in$1[4] << 24 >>> 24)); buf[12] = (((in$1[4] >>> 8 >>> 0) << 24 >>> 24)); buf[11] = (((in$1[4] >>> 16 >>> 0) << 24 >>> 24)); buf[10] = (((((((((in$1[4] >>> 24 >>> 0)) & 15) >>> 0)) | ((((in$1[5] << 4 >>> 0)) & 240) >>> 0)) >>> 0) << 24 >>> 24)); buf[9] = (((in$1[5] >>> 4 >>> 0) << 24 >>> 24)); buf[8] = (((in$1[5] >>> 12 >>> 0) << 24 >>> 24)); buf[7] = (((in$1[5] >>> 20 >>> 0) << 24 >>> 24)); buf[6] = ((in$1[6] << 24 >>> 24)); buf[5] = (((in$1[6] >>> 8 >>> 0) << 24 >>> 24)); buf[4] = (((in$1[6] >>> 16 >>> 0) << 24 >>> 24)); buf[3] = (((((((((in$1[6] >>> 24 >>> 0)) & 15) >>> 0)) | ((((in$1[7] << 4 >>> 0)) & 240) >>> 0)) >>> 0) << 24 >>> 24)); buf[2] = (((in$1[7] >>> 4 >>> 0) << 24 >>> 24)); buf[1] = (((in$1[7] >>> 12 >>> 0) << 24 >>> 24)); buf[0] = (((in$1[7] >>> 20 >>> 0) << 24 >>> 24)); return new big.Int.ptr(false, big.nat.nil).SetBytes(new sliceType$1(buf)); }; matchesSpecificCurve = function(params, available) { var _i, _r, _ref, available, c, params, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _ref = $f._ref; available = $f.available; c = $f.c; params = $f.params; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _ref = available; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } c = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r = c.Params(); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (params === _r) { $s = 3; continue; } /* */ $s = 4; continue; /* if (params === _r) { */ case 3: $s = -1; return [c, true]; /* } */ case 4: _i++; $s = 1; continue; case 2: $s = -1; return [$ifaceNil, false]; /* */ } return; } if ($f === undefined) { $f = { $blk: matchesSpecificCurve }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f.available = available; $f.c = c; $f.params = params; $f.$s = $s; $f.$r = $r; return $f; }; CurveParams.ptr.prototype.Params = function() { var curve; curve = this; return curve; }; CurveParams.prototype.Params = function() { return this.$val.Params(); }; CurveParams.ptr.prototype.polynomial = function(x) { var _r, _r$1, _r$2, _r$3, _r$4, _r$5, curve, threeX, x, x3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; curve = $f.curve; threeX = $f.threeX; x = $f.x; x3 = $f.x3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: curve = this; _r = new big.Int.ptr(false, big.nat.nil).Mul(x, x); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } x3 = _r; _r$1 = x3.Mul(x3, x); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; threeX = new big.Int.ptr(false, big.nat.nil).Lsh(x, 1); _r$2 = threeX.Add(threeX, x); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; _r$3 = x3.Sub(x3, threeX); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _r$4 = x3.Add(x3, curve.B); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; _r$5 = x3.Mod(x3, curve.P); /* */ $s = 6; case 6: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; $s = -1; return x3; /* */ } return; } if ($f === undefined) { $f = { $blk: CurveParams.ptr.prototype.polynomial }; } $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.curve = curve; $f.threeX = threeX; $f.x = x; $f.x3 = x3; $f.$s = $s; $f.$r = $r; return $f; }; CurveParams.prototype.polynomial = function(x) { return this.$val.polynomial(x); }; CurveParams.ptr.prototype.IsOnCurve = function(x, y) { var $24r, $24r$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, curve, ok, specific, x, y, y2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$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; _tuple = $f._tuple; curve = $f.curve; ok = $f.ok; specific = $f.specific; x = $f.x; y = $f.y; y2 = $f.y2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: curve = this; _r = matchesSpecificCurve(curve, new sliceType$2([new p224.constructor.elem(p224), new p521.constructor.elem(p521)])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; specific = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (ok) { */ case 2: _r$1 = specific.IsOnCurve(x, y); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 5; case 5: return $24r; /* } */ case 3: _r$2 = new big.Int.ptr(false, big.nat.nil).Mul(y, y); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } y2 = _r$2; _r$3 = y2.Mod(y2, curve.P); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _r$4 = curve.polynomial(x); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = _r$4.Cmp(y2); /* */ $s = 9; case 9: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $24r$1 = _r$5 === 0; $s = 10; case 10: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: CurveParams.ptr.prototype.IsOnCurve }; } $f.$24r = $24r; $f.$24r$1 = $24r$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._tuple = _tuple; $f.curve = curve; $f.ok = ok; $f.specific = specific; $f.x = x; $f.y = y; $f.y2 = y2; $f.$s = $s; $f.$r = $r; return $f; }; CurveParams.prototype.IsOnCurve = function(x, y) { return this.$val.IsOnCurve(x, y); }; zForAffine = function(x, y) { var x, y, z; z = new big.Int.ptr(false, big.nat.nil); if (!((x.Sign() === 0)) || !((y.Sign() === 0))) { z.SetInt64(new $Int64(0, 1)); } return z; }; CurveParams.ptr.prototype.affineFromJacobian = function(x, y, z) { var _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _tmp, _tmp$1, curve, x, xOut, y, yOut, z, zinv, zinvsq, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; curve = $f.curve; x = $f.x; xOut = $f.xOut; y = $f.y; yOut = $f.yOut; z = $f.z; zinv = $f.zinv; zinvsq = $f.zinvsq; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: xOut = ptrType$1.nil; yOut = ptrType$1.nil; curve = this; if (z.Sign() === 0) { _tmp = new big.Int.ptr(false, big.nat.nil); _tmp$1 = new big.Int.ptr(false, big.nat.nil); xOut = _tmp; yOut = _tmp$1; $s = -1; return [xOut, yOut]; } _r = new big.Int.ptr(false, big.nat.nil).ModInverse(z, curve.P); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } zinv = _r; _r$1 = new big.Int.ptr(false, big.nat.nil).Mul(zinv, zinv); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } zinvsq = _r$1; _r$2 = new big.Int.ptr(false, big.nat.nil).Mul(x, zinvsq); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } xOut = _r$2; _r$3 = xOut.Mod(xOut, curve.P); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _r$4 = zinvsq.Mul(zinvsq, zinv); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; _r$5 = new big.Int.ptr(false, big.nat.nil).Mul(y, zinvsq); /* */ $s = 6; case 6: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } yOut = _r$5; _r$6 = yOut.Mod(yOut, curve.P); /* */ $s = 7; case 7: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; $s = -1; return [xOut, yOut]; /* */ } return; } if ($f === undefined) { $f = { $blk: CurveParams.ptr.prototype.affineFromJacobian }; } $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._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.curve = curve; $f.x = x; $f.xOut = xOut; $f.y = y; $f.yOut = yOut; $f.z = z; $f.zinv = zinv; $f.zinvsq = zinvsq; $f.$s = $s; $f.$r = $r; return $f; }; CurveParams.prototype.affineFromJacobian = function(x, y, z) { return this.$val.affineFromJacobian(x, y, z); }; CurveParams.ptr.prototype.Add = function(x1, y1, x2, y2) { var $24r, $24r$1, _r, _r$1, _r$2, _r$3, _tuple, _tuple$1, curve, ok, specific, x1, x2, y1, y2, z1, z2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _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; curve = $f.curve; ok = $f.ok; specific = $f.specific; x1 = $f.x1; x2 = $f.x2; y1 = $f.y1; y2 = $f.y2; z1 = $f.z1; z2 = $f.z2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: curve = this; _r = matchesSpecificCurve(curve, new sliceType$2([new p224.constructor.elem(p224), new p521.constructor.elem(p521)])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; specific = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (ok) { */ case 2: _r$1 = specific.Add(x1, y1, x2, y2); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 5; case 5: return $24r; /* } */ case 3: z1 = zForAffine(x1, y1); z2 = zForAffine(x2, y2); _r$2 = curve.addJacobian(x1, y1, z1, x2, y2, z2); /* */ $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; _r$3 = curve.affineFromJacobian(_tuple$1[0], _tuple$1[1], _tuple$1[2]); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r$1 = _r$3; $s = 8; case 8: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: CurveParams.ptr.prototype.Add }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $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.curve = curve; $f.ok = ok; $f.specific = specific; $f.x1 = x1; $f.x2 = x2; $f.y1 = y1; $f.y2 = y2; $f.z1 = z1; $f.z2 = z2; $f.$s = $s; $f.$r = $r; return $f; }; CurveParams.prototype.Add = function(x1, y1, x2, y2) { return this.$val.Add(x1, y1, x2, y2); }; CurveParams.ptr.prototype.addJacobian = function(x1, y1, z1, x2, y2, z2) { var $24r, _r, _r$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$36, _r$37, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tmp, _tmp$1, _tmp$2, curve, h, i, j, r, s1, s2, u1, u2, v, x1, x2, x3, xEqual, y1, y2, y3, yEqual, z1, z1z1, z2, z2z2, z3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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$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$36 = $f._r$36; _r$37 = $f._r$37; _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; curve = $f.curve; h = $f.h; i = $f.i; j = $f.j; r = $f.r; s1 = $f.s1; s2 = $f.s2; u1 = $f.u1; u2 = $f.u2; v = $f.v; x1 = $f.x1; x2 = $f.x2; x3 = $f.x3; xEqual = $f.xEqual; y1 = $f.y1; y2 = $f.y2; y3 = $f.y3; yEqual = $f.yEqual; z1 = $f.z1; z1z1 = $f.z1z1; z2 = $f.z2; z2z2 = $f.z2z2; z3 = $f.z3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: curve = this; _tmp = new big.Int.ptr(false, big.nat.nil); _tmp$1 = new big.Int.ptr(false, big.nat.nil); _tmp$2 = new big.Int.ptr(false, big.nat.nil); x3 = _tmp; y3 = _tmp$1; z3 = _tmp$2; if (z1.Sign() === 0) { x3.Set(x2); y3.Set(y2); z3.Set(z2); $s = -1; return [x3, y3, z3]; } if (z2.Sign() === 0) { x3.Set(x1); y3.Set(y1); z3.Set(z1); $s = -1; return [x3, y3, z3]; } _r = new big.Int.ptr(false, big.nat.nil).Mul(z1, z1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } z1z1 = _r; _r$1 = z1z1.Mod(z1z1, curve.P); /* */ $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$2 = new big.Int.ptr(false, big.nat.nil).Mul(z2, z2); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } z2z2 = _r$2; _r$3 = z2z2.Mod(z2z2, curve.P); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _r$4 = new big.Int.ptr(false, big.nat.nil).Mul(x1, z2z2); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } u1 = _r$4; _r$5 = u1.Mod(u1, curve.P); /* */ $s = 6; case 6: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; _r$6 = new big.Int.ptr(false, big.nat.nil).Mul(x2, z1z1); /* */ $s = 7; case 7: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } u2 = _r$6; _r$7 = u2.Mod(u2, curve.P); /* */ $s = 8; case 8: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$7; _r$8 = new big.Int.ptr(false, big.nat.nil).Sub(u2, u1); /* */ $s = 9; case 9: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } h = _r$8; xEqual = h.Sign() === 0; /* */ if (h.Sign() === -1) { $s = 10; continue; } /* */ $s = 11; continue; /* if (h.Sign() === -1) { */ case 10: _r$9 = h.Add(h, curve.P); /* */ $s = 12; case 12: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$9; /* } */ case 11: i = new big.Int.ptr(false, big.nat.nil).Lsh(h, 1); _r$10 = i.Mul(i, i); /* */ $s = 13; case 13: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; _r$11 = new big.Int.ptr(false, big.nat.nil).Mul(h, i); /* */ $s = 14; case 14: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } j = _r$11; _r$12 = new big.Int.ptr(false, big.nat.nil).Mul(y1, z2); /* */ $s = 15; case 15: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } s1 = _r$12; _r$13 = s1.Mul(s1, z2z2); /* */ $s = 16; case 16: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _r$13; _r$14 = s1.Mod(s1, curve.P); /* */ $s = 17; case 17: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _r$14; _r$15 = new big.Int.ptr(false, big.nat.nil).Mul(y2, z1); /* */ $s = 18; case 18: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } s2 = _r$15; _r$16 = s2.Mul(s2, z1z1); /* */ $s = 19; case 19: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _r$16; _r$17 = s2.Mod(s2, curve.P); /* */ $s = 20; case 20: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } _r$17; _r$18 = new big.Int.ptr(false, big.nat.nil).Sub(s2, s1); /* */ $s = 21; case 21: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } r = _r$18; /* */ if (r.Sign() === -1) { $s = 22; continue; } /* */ $s = 23; continue; /* if (r.Sign() === -1) { */ case 22: _r$19 = r.Add(r, curve.P); /* */ $s = 24; case 24: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } _r$19; /* } */ case 23: yEqual = r.Sign() === 0; /* */ if (xEqual && yEqual) { $s = 25; continue; } /* */ $s = 26; continue; /* if (xEqual && yEqual) { */ case 25: _r$20 = curve.doubleJacobian(x1, y1, z1); /* */ $s = 27; case 27: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } $24r = _r$20; $s = 28; case 28: return $24r; /* } */ case 26: r.Lsh(r, 1); _r$21 = new big.Int.ptr(false, big.nat.nil).Mul(u1, i); /* */ $s = 29; case 29: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } v = _r$21; x3.Set(r); _r$22 = x3.Mul(x3, x3); /* */ $s = 30; case 30: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; } _r$22; _r$23 = x3.Sub(x3, j); /* */ $s = 31; case 31: if($c) { $c = false; _r$23 = _r$23.$blk(); } if (_r$23 && _r$23.$blk !== undefined) { break s; } _r$23; _r$24 = x3.Sub(x3, v); /* */ $s = 32; case 32: if($c) { $c = false; _r$24 = _r$24.$blk(); } if (_r$24 && _r$24.$blk !== undefined) { break s; } _r$24; _r$25 = x3.Sub(x3, v); /* */ $s = 33; case 33: if($c) { $c = false; _r$25 = _r$25.$blk(); } if (_r$25 && _r$25.$blk !== undefined) { break s; } _r$25; _r$26 = x3.Mod(x3, curve.P); /* */ $s = 34; case 34: if($c) { $c = false; _r$26 = _r$26.$blk(); } if (_r$26 && _r$26.$blk !== undefined) { break s; } _r$26; y3.Set(r); _r$27 = v.Sub(v, x3); /* */ $s = 35; case 35: if($c) { $c = false; _r$27 = _r$27.$blk(); } if (_r$27 && _r$27.$blk !== undefined) { break s; } _r$27; _r$28 = y3.Mul(y3, v); /* */ $s = 36; case 36: if($c) { $c = false; _r$28 = _r$28.$blk(); } if (_r$28 && _r$28.$blk !== undefined) { break s; } _r$28; _r$29 = s1.Mul(s1, j); /* */ $s = 37; case 37: if($c) { $c = false; _r$29 = _r$29.$blk(); } if (_r$29 && _r$29.$blk !== undefined) { break s; } _r$29; s1.Lsh(s1, 1); _r$30 = y3.Sub(y3, s1); /* */ $s = 38; case 38: if($c) { $c = false; _r$30 = _r$30.$blk(); } if (_r$30 && _r$30.$blk !== undefined) { break s; } _r$30; _r$31 = y3.Mod(y3, curve.P); /* */ $s = 39; case 39: if($c) { $c = false; _r$31 = _r$31.$blk(); } if (_r$31 && _r$31.$blk !== undefined) { break s; } _r$31; _r$32 = z3.Add(z1, z2); /* */ $s = 40; case 40: if($c) { $c = false; _r$32 = _r$32.$blk(); } if (_r$32 && _r$32.$blk !== undefined) { break s; } _r$32; _r$33 = z3.Mul(z3, z3); /* */ $s = 41; case 41: if($c) { $c = false; _r$33 = _r$33.$blk(); } if (_r$33 && _r$33.$blk !== undefined) { break s; } _r$33; _r$34 = z3.Sub(z3, z1z1); /* */ $s = 42; case 42: if($c) { $c = false; _r$34 = _r$34.$blk(); } if (_r$34 && _r$34.$blk !== undefined) { break s; } _r$34; _r$35 = z3.Sub(z3, z2z2); /* */ $s = 43; case 43: if($c) { $c = false; _r$35 = _r$35.$blk(); } if (_r$35 && _r$35.$blk !== undefined) { break s; } _r$35; _r$36 = z3.Mul(z3, h); /* */ $s = 44; case 44: if($c) { $c = false; _r$36 = _r$36.$blk(); } if (_r$36 && _r$36.$blk !== undefined) { break s; } _r$36; _r$37 = z3.Mod(z3, curve.P); /* */ $s = 45; case 45: if($c) { $c = false; _r$37 = _r$37.$blk(); } if (_r$37 && _r$37.$blk !== undefined) { break s; } _r$37; $s = -1; return [x3, y3, z3]; /* */ } return; } if ($f === undefined) { $f = { $blk: CurveParams.ptr.prototype.addJacobian }; } $f.$24r = $24r; $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$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$36 = _r$36; $f._r$37 = _r$37; $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.curve = curve; $f.h = h; $f.i = i; $f.j = j; $f.r = r; $f.s1 = s1; $f.s2 = s2; $f.u1 = u1; $f.u2 = u2; $f.v = v; $f.x1 = x1; $f.x2 = x2; $f.x3 = x3; $f.xEqual = xEqual; $f.y1 = y1; $f.y2 = y2; $f.y3 = y3; $f.yEqual = yEqual; $f.z1 = z1; $f.z1z1 = z1z1; $f.z2 = z2; $f.z2z2 = z2z2; $f.z3 = z3; $f.$s = $s; $f.$r = $r; return $f; }; CurveParams.prototype.addJacobian = function(x1, y1, z1, x2, y2, z2) { return this.$val.addJacobian(x1, y1, z1, x2, y2, z2); }; CurveParams.ptr.prototype.Double = function(x1, y1) { var $24r, $24r$1, _r, _r$1, _r$2, _r$3, _tuple, _tuple$1, curve, ok, specific, x1, y1, z1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _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; curve = $f.curve; ok = $f.ok; specific = $f.specific; x1 = $f.x1; y1 = $f.y1; z1 = $f.z1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: curve = this; _r = matchesSpecificCurve(curve, new sliceType$2([new p224.constructor.elem(p224), new p521.constructor.elem(p521)])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; specific = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (ok) { */ case 2: _r$1 = specific.Double(x1, y1); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 5; case 5: return $24r; /* } */ case 3: z1 = zForAffine(x1, y1); _r$2 = curve.doubleJacobian(x1, y1, z1); /* */ $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; _r$3 = curve.affineFromJacobian(_tuple$1[0], _tuple$1[1], _tuple$1[2]); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r$1 = _r$3; $s = 8; case 8: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: CurveParams.ptr.prototype.Double }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $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.curve = curve; $f.ok = ok; $f.specific = specific; $f.x1 = x1; $f.y1 = y1; $f.z1 = z1; $f.$s = $s; $f.$r = $r; return $f; }; CurveParams.prototype.Double = function(x1, y1) { return this.$val.Double(x1, y1); }; CurveParams.ptr.prototype.doubleJacobian = function(x, y, z) { var _r, _r$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$4, _r$5, _r$6, _r$7, _r$8, _r$9, alpha, alpha2, beta, beta8, curve, delta, gamma, x, x3, y, y3, z, z3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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$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$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; alpha = $f.alpha; alpha2 = $f.alpha2; beta = $f.beta; beta8 = $f.beta8; curve = $f.curve; delta = $f.delta; gamma = $f.gamma; x = $f.x; x3 = $f.x3; y = $f.y; y3 = $f.y3; z = $f.z; z3 = $f.z3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: curve = this; _r = new big.Int.ptr(false, big.nat.nil).Mul(z, z); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } delta = _r; _r$1 = delta.Mod(delta, curve.P); /* */ $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$2 = new big.Int.ptr(false, big.nat.nil).Mul(y, y); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } gamma = _r$2; _r$3 = gamma.Mod(gamma, curve.P); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _r$4 = new big.Int.ptr(false, big.nat.nil).Sub(x, delta); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } alpha = _r$4; /* */ if (alpha.Sign() === -1) { $s = 6; continue; } /* */ $s = 7; continue; /* if (alpha.Sign() === -1) { */ case 6: _r$5 = alpha.Add(alpha, curve.P); /* */ $s = 8; case 8: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; /* } */ case 7: _r$6 = new big.Int.ptr(false, big.nat.nil).Add(x, delta); /* */ $s = 9; case 9: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } alpha2 = _r$6; _r$7 = alpha.Mul(alpha, alpha2); /* */ $s = 10; case 10: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$7; alpha2.Set(alpha); alpha.Lsh(alpha, 1); _r$8 = alpha.Add(alpha, alpha2); /* */ $s = 11; case 11: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$8; _r$9 = alpha2.Mul(x, gamma); /* */ $s = 12; case 12: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } beta = _r$9; _r$10 = new big.Int.ptr(false, big.nat.nil).Mul(alpha, alpha); /* */ $s = 13; case 13: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } x3 = _r$10; beta8 = new big.Int.ptr(false, big.nat.nil).Lsh(beta, 3); _r$11 = beta8.Mod(beta8, curve.P); /* */ $s = 14; case 14: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _r$11; _r$12 = x3.Sub(x3, beta8); /* */ $s = 15; case 15: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _r$12; /* */ if (x3.Sign() === -1) { $s = 16; continue; } /* */ $s = 17; continue; /* if (x3.Sign() === -1) { */ case 16: _r$13 = x3.Add(x3, curve.P); /* */ $s = 18; case 18: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _r$13; /* } */ case 17: _r$14 = x3.Mod(x3, curve.P); /* */ $s = 19; case 19: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _r$14; _r$15 = new big.Int.ptr(false, big.nat.nil).Add(y, z); /* */ $s = 20; case 20: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } z3 = _r$15; _r$16 = z3.Mul(z3, z3); /* */ $s = 21; case 21: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _r$16; _r$17 = z3.Sub(z3, gamma); /* */ $s = 22; case 22: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } _r$17; /* */ if (z3.Sign() === -1) { $s = 23; continue; } /* */ $s = 24; continue; /* if (z3.Sign() === -1) { */ case 23: _r$18 = z3.Add(z3, curve.P); /* */ $s = 25; case 25: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } _r$18; /* } */ case 24: _r$19 = z3.Sub(z3, delta); /* */ $s = 26; case 26: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } _r$19; /* */ if (z3.Sign() === -1) { $s = 27; continue; } /* */ $s = 28; continue; /* if (z3.Sign() === -1) { */ case 27: _r$20 = z3.Add(z3, curve.P); /* */ $s = 29; case 29: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } _r$20; /* } */ case 28: _r$21 = z3.Mod(z3, curve.P); /* */ $s = 30; case 30: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } _r$21; beta.Lsh(beta, 2); _r$22 = beta.Sub(beta, x3); /* */ $s = 31; case 31: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; } _r$22; /* */ if (beta.Sign() === -1) { $s = 32; continue; } /* */ $s = 33; continue; /* if (beta.Sign() === -1) { */ case 32: _r$23 = beta.Add(beta, curve.P); /* */ $s = 34; case 34: if($c) { $c = false; _r$23 = _r$23.$blk(); } if (_r$23 && _r$23.$blk !== undefined) { break s; } _r$23; /* } */ case 33: _r$24 = alpha.Mul(alpha, beta); /* */ $s = 35; case 35: if($c) { $c = false; _r$24 = _r$24.$blk(); } if (_r$24 && _r$24.$blk !== undefined) { break s; } y3 = _r$24; _r$25 = gamma.Mul(gamma, gamma); /* */ $s = 36; case 36: if($c) { $c = false; _r$25 = _r$25.$blk(); } if (_r$25 && _r$25.$blk !== undefined) { break s; } _r$25; gamma.Lsh(gamma, 3); _r$26 = gamma.Mod(gamma, curve.P); /* */ $s = 37; case 37: if($c) { $c = false; _r$26 = _r$26.$blk(); } if (_r$26 && _r$26.$blk !== undefined) { break s; } _r$26; _r$27 = y3.Sub(y3, gamma); /* */ $s = 38; case 38: if($c) { $c = false; _r$27 = _r$27.$blk(); } if (_r$27 && _r$27.$blk !== undefined) { break s; } _r$27; /* */ if (y3.Sign() === -1) { $s = 39; continue; } /* */ $s = 40; continue; /* if (y3.Sign() === -1) { */ case 39: _r$28 = y3.Add(y3, curve.P); /* */ $s = 41; case 41: if($c) { $c = false; _r$28 = _r$28.$blk(); } if (_r$28 && _r$28.$blk !== undefined) { break s; } _r$28; /* } */ case 40: _r$29 = y3.Mod(y3, curve.P); /* */ $s = 42; case 42: if($c) { $c = false; _r$29 = _r$29.$blk(); } if (_r$29 && _r$29.$blk !== undefined) { break s; } _r$29; $s = -1; return [x3, y3, z3]; /* */ } return; } if ($f === undefined) { $f = { $blk: CurveParams.ptr.prototype.doubleJacobian }; } $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$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$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.alpha = alpha; $f.alpha2 = alpha2; $f.beta = beta; $f.beta8 = beta8; $f.curve = curve; $f.delta = delta; $f.gamma = gamma; $f.x = x; $f.x3 = x3; $f.y = y; $f.y3 = y3; $f.z = z; $f.z3 = z3; $f.$s = $s; $f.$r = $r; return $f; }; CurveParams.prototype.doubleJacobian = function(x, y, z) { return this.$val.doubleJacobian(x, y, z); }; CurveParams.ptr.prototype.ScalarMult = function(Bx, By, k) { var $24r, $24r$1, Bx, By, Bz, _i, _r, _r$1, _r$2, _r$3, _r$4, _ref, _tmp, _tmp$1, _tmp$2, _tuple, _tuple$1, _tuple$2, bitNum, byte$1, curve, k, ok, specific, x, y, y$1, z, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; Bx = $f.Bx; By = $f.By; Bz = $f.Bz; _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; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; bitNum = $f.bitNum; byte$1 = $f.byte$1; curve = $f.curve; k = $f.k; ok = $f.ok; specific = $f.specific; x = $f.x; y = $f.y; y$1 = $f.y$1; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: curve = this; _r = matchesSpecificCurve(curve, new sliceType$2([new p224.constructor.elem(p224), new p256.constructor.elem(p256), new p521.constructor.elem(p521)])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; specific = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (ok) { */ case 2: _r$1 = specific.ScalarMult(Bx, By, k); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 5; case 5: return $24r; /* } */ case 3: Bz = new big.Int.ptr(false, big.nat.nil).SetInt64(new $Int64(0, 1)); _tmp = new big.Int.ptr(false, big.nat.nil); _tmp$1 = new big.Int.ptr(false, big.nat.nil); _tmp$2 = new big.Int.ptr(false, big.nat.nil); x = _tmp; y = _tmp$1; z = _tmp$2; _ref = k; _i = 0; /* while (true) { */ case 6: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 7; continue; } byte$1 = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); bitNum = 0; /* while (true) { */ case 8: /* if (!(bitNum < 8)) { break; } */ if(!(bitNum < 8)) { $s = 9; continue; } _r$2 = curve.doubleJacobian(x, y, z); /* */ $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; x = _tuple$1[0]; y = _tuple$1[1]; z = _tuple$1[2]; /* */ if (((byte$1 & 128) >>> 0) === 128) { $s = 11; continue; } /* */ $s = 12; continue; /* if (((byte$1 & 128) >>> 0) === 128) { */ case 11: _r$3 = curve.addJacobian(Bx, By, Bz, x, y, z); /* */ $s = 13; case 13: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$2 = _r$3; x = _tuple$2[0]; y = _tuple$2[1]; z = _tuple$2[2]; /* } */ case 12: byte$1 = (y$1 = (1), y$1 < 32 ? (byte$1 << y$1) : 0) << 24 >>> 24; bitNum = bitNum + (1) >> 0; $s = 8; continue; case 9: _i++; $s = 6; continue; case 7: _r$4 = curve.affineFromJacobian(x, y, z); /* */ $s = 14; case 14: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r$1 = _r$4; $s = 15; case 15: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: CurveParams.ptr.prototype.ScalarMult }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.Bx = Bx; $f.By = By; $f.Bz = Bz; $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._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.bitNum = bitNum; $f.byte$1 = byte$1; $f.curve = curve; $f.k = k; $f.ok = ok; $f.specific = specific; $f.x = x; $f.y = y; $f.y$1 = y$1; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; }; CurveParams.prototype.ScalarMult = function(Bx, By, k) { return this.$val.ScalarMult(Bx, By, k); }; CurveParams.ptr.prototype.ScalarBaseMult = function(k) { var $24r, $24r$1, _r, _r$1, _r$2, _tuple, curve, k, ok, specific, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; curve = $f.curve; k = $f.k; ok = $f.ok; specific = $f.specific; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: curve = this; _r = matchesSpecificCurve(curve, new sliceType$2([new p224.constructor.elem(p224), new p256.constructor.elem(p256), new p521.constructor.elem(p521)])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; specific = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (ok) { */ case 2: _r$1 = specific.ScalarBaseMult(k); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 5; case 5: return $24r; /* } */ case 3: _r$2 = curve.ScalarMult(curve.Gx, curve.Gy, k); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r$1 = _r$2; $s = 7; case 7: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: CurveParams.ptr.prototype.ScalarBaseMult }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.curve = curve; $f.k = k; $f.ok = ok; $f.specific = specific; $f.$s = $s; $f.$r = $r; return $f; }; CurveParams.prototype.ScalarBaseMult = function(k) { return this.$val.ScalarBaseMult(k); }; GenerateKey = function(curve, rand) { var N, _q, _r, _r$1, _r$2, _r$3, _tuple, _tuple$1, bitSize, byteLen, curve, err, priv, rand, x, x$1, y, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; N = $f.N; _q = $f._q; _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; bitSize = $f.bitSize; byteLen = $f.byteLen; curve = $f.curve; err = $f.err; priv = $f.priv; rand = $f.rand; x = $f.x; x$1 = $f.x$1; y = $f.y; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: priv = sliceType$1.nil; x = ptrType$1.nil; y = ptrType$1.nil; err = $ifaceNil; _r = curve.Params(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } N = _r.N; bitSize = N.BitLen(); byteLen = (_q = ((bitSize + 7 >> 0)) / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); priv = $makeSlice(sliceType$1, byteLen); /* while (true) { */ case 2: /* if (!(x === ptrType$1.nil)) { break; } */ if(!(x === ptrType$1.nil)) { $s = 3; continue; } _r$1 = io.ReadFull(rand, priv); /* */ $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; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [priv, x, y, err]; } (0 >= priv.$length ? ($throwRuntimeError("index out of range"), undefined) : priv.$array[priv.$offset + 0] = (((0 >= priv.$length ? ($throwRuntimeError("index out of range"), undefined) : priv.$array[priv.$offset + 0]) & ((x$1 = (_r$2 = bitSize % 8, _r$2 === _r$2 ? _r$2 : $throwRuntimeError("integer divide by zero")), ((x$1 < 0 || x$1 >= mask.$length) ? ($throwRuntimeError("index out of range"), undefined) : mask.$array[mask.$offset + x$1])))) >>> 0)); (1 >= priv.$length ? ($throwRuntimeError("index out of range"), undefined) : priv.$array[priv.$offset + 1] = (((1 >= priv.$length ? ($throwRuntimeError("index out of range"), undefined) : priv.$array[priv.$offset + 1]) ^ (66)) << 24 >>> 24)); if (new big.Int.ptr(false, big.nat.nil).SetBytes(priv).Cmp(N) >= 0) { /* continue; */ $s = 2; continue; } _r$3 = curve.ScalarBaseMult(priv); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$1 = _r$3; x = _tuple$1[0]; y = _tuple$1[1]; $s = 2; continue; case 3: $s = -1; return [priv, x, y, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: GenerateKey }; } $f.N = N; $f._q = _q; $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.bitSize = bitSize; $f.byteLen = byteLen; $f.curve = curve; $f.err = err; $f.priv = priv; $f.rand = rand; $f.x = x; $f.x$1 = x$1; $f.y = y; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.GenerateKey = GenerateKey; Marshal = function(curve, x, y) { var _q, _r, byteLen, curve, ret, x, y, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _q = $f._q; _r = $f._r; byteLen = $f.byteLen; curve = $f.curve; ret = $f.ret; x = $f.x; y = $f.y; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = curve.Params(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } byteLen = (_q = ((_r.BitSize + 7 >> 0)) / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); ret = $makeSlice(sliceType$1, (1 + ($imul(2, byteLen)) >> 0)); (0 >= ret.$length ? ($throwRuntimeError("index out of range"), undefined) : ret.$array[ret.$offset + 0] = 4); x.FillBytes($subslice(ret, 1, (1 + byteLen >> 0))); y.FillBytes($subslice(ret, (1 + byteLen >> 0), (1 + ($imul(2, byteLen)) >> 0))); $s = -1; return ret; /* */ } return; } if ($f === undefined) { $f = { $blk: Marshal }; } $f._q = _q; $f._r = _r; $f.byteLen = byteLen; $f.curve = curve; $f.ret = ret; $f.x = x; $f.y = y; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Marshal = Marshal; Unmarshal = function(curve, data) { var _q, _r, _r$1, _r$2, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, byteLen, curve, data, p, x, y, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; byteLen = $f.byteLen; curve = $f.curve; data = $f.data; p = $f.p; x = $f.x; y = $f.y; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: x = ptrType$1.nil; y = ptrType$1.nil; _r = curve.Params(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } byteLen = (_q = ((_r.BitSize + 7 >> 0)) / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); if (!((data.$length === (1 + ($imul(2, byteLen)) >> 0)))) { _tmp = ptrType$1.nil; _tmp$1 = ptrType$1.nil; x = _tmp; y = _tmp$1; $s = -1; return [x, y]; } if (!(((0 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 0]) === 4))) { _tmp$2 = ptrType$1.nil; _tmp$3 = ptrType$1.nil; x = _tmp$2; y = _tmp$3; $s = -1; return [x, y]; } _r$1 = curve.Params(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } p = _r$1.P; x = new big.Int.ptr(false, big.nat.nil).SetBytes($subslice(data, 1, (1 + byteLen >> 0))); y = new big.Int.ptr(false, big.nat.nil).SetBytes($subslice(data, (1 + byteLen >> 0))); if (x.Cmp(p) >= 0 || y.Cmp(p) >= 0) { _tmp$4 = ptrType$1.nil; _tmp$5 = ptrType$1.nil; x = _tmp$4; y = _tmp$5; $s = -1; return [x, y]; } _r$2 = curve.IsOnCurve(x, y); /* */ $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) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!_r$2) { */ case 3: _tmp$6 = ptrType$1.nil; _tmp$7 = ptrType$1.nil; x = _tmp$6; y = _tmp$7; $s = -1; return [x, y]; /* } */ case 4: $s = -1; return [x, y]; /* */ } return; } if ($f === undefined) { $f = { $blk: Unmarshal }; } $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._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f.byteLen = byteLen; $f.curve = curve; $f.data = data; $f.p = p; $f.x = x; $f.y = y; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Unmarshal = Unmarshal; initAll = function() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = initP224(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = initP256(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = initP384(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = initP521(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: initAll }; } $f.$s = $s; $f.$r = $r; return $f; }; initP384 = function() { var _r, _r$1, _r$2, _r$3, _r$4, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p384 = new CurveParams.ptr(ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, 0, "P-384"); _r = new big.Int.ptr(false, big.nat.nil).SetString("39402006196394479212279040100143613805079739270465446667948293404245721771496870329047266088258938001861606973112319", 10); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; p384.P = _tuple[0]; _r$1 = new big.Int.ptr(false, big.nat.nil).SetString("39402006196394479212279040100143613805079739270465446667946905279627659399113263569398956308152294913554433653942643", 10); /* */ $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; p384.N = _tuple$1[0]; _r$2 = new big.Int.ptr(false, big.nat.nil).SetString("b3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef", 16); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$2 = _r$2; p384.B = _tuple$2[0]; _r$3 = new big.Int.ptr(false, big.nat.nil).SetString("aa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7", 16); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$3 = _r$3; p384.Gx = _tuple$3[0]; _r$4 = new big.Int.ptr(false, big.nat.nil).SetString("3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f", 16); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$4 = _r$4; p384.Gy = _tuple$4[0]; p384.BitSize = 384; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: initP384 }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f.$s = $s; $f.$r = $r; return $f; }; P256 = function() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = initonce.Do(initAll); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return new p256.constructor.elem(p256); /* */ } return; } if ($f === undefined) { $f = { $blk: P256 }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.P256 = P256; P384 = function() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = initonce.Do(initAll); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return p384; /* */ } return; } if ($f === undefined) { $f = { $blk: P384 }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.P384 = P384; P521 = function() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = initonce.Do(initAll); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return new p521.constructor.elem(p521); /* */ } return; } if ($f === undefined) { $f = { $blk: P521 }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.P521 = P521; p521Curve.methods = [{prop: "Params", name: "Params", pkg: "", typ: $funcType([], [ptrType], false)}, {prop: "IsOnCurve", name: "IsOnCurve", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [$Bool], false)}, {prop: "affineFromJacobian", name: "affineFromJacobian", pkg: "crypto/elliptic", typ: $funcType([ptrType$3], [ptrType$1, ptrType$1], false)}, {prop: "jacobianFromAffine", name: "jacobianFromAffine", pkg: "crypto/elliptic", typ: $funcType([ptrType$1, ptrType$1], [ptrType$3], false)}, {prop: "Add", name: "Add", pkg: "", typ: $funcType([ptrType$1, ptrType$1, ptrType$1, ptrType$1], [ptrType$1, ptrType$1], false)}, {prop: "Double", name: "Double", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1, ptrType$1], false)}, {prop: "ScalarMult", name: "ScalarMult", pkg: "", typ: $funcType([ptrType$1, ptrType$1, sliceType$1], [ptrType$1, ptrType$1], false)}, {prop: "ScalarBaseMult", name: "ScalarBaseMult", pkg: "", typ: $funcType([sliceType$1], [ptrType$1, ptrType$1], false)}]; ptrType$3.methods = [{prop: "addJacobian", name: "addJacobian", pkg: "crypto/elliptic", typ: $funcType([ptrType$3, ptrType$3], [ptrType$3], false)}, {prop: "doubleJacobian", name: "doubleJacobian", pkg: "crypto/elliptic", typ: $funcType([ptrType$3], [ptrType$3], false)}]; p256Curve.methods = [{prop: "Params", name: "Params", pkg: "", typ: $funcType([], [ptrType], false)}, {prop: "ScalarBaseMult", name: "ScalarBaseMult", pkg: "", typ: $funcType([sliceType$1], [ptrType$1, ptrType$1], false)}, {prop: "ScalarMult", name: "ScalarMult", pkg: "", typ: $funcType([ptrType$1, ptrType$1, sliceType$1], [ptrType$1, ptrType$1], false)}]; p224Curve.methods = [{prop: "Params", name: "Params", pkg: "", typ: $funcType([], [ptrType], false)}, {prop: "IsOnCurve", name: "IsOnCurve", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [$Bool], false)}, {prop: "Add", name: "Add", pkg: "", typ: $funcType([ptrType$1, ptrType$1, ptrType$1, ptrType$1], [ptrType$1, ptrType$1], false)}, {prop: "Double", name: "Double", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1, ptrType$1], false)}, {prop: "ScalarMult", name: "ScalarMult", pkg: "", typ: $funcType([ptrType$1, ptrType$1, sliceType$1], [ptrType$1, ptrType$1], false)}, {prop: "ScalarBaseMult", name: "ScalarBaseMult", pkg: "", typ: $funcType([sliceType$1], [ptrType$1, ptrType$1], false)}]; ptrType.methods = [{prop: "Params", name: "Params", pkg: "", typ: $funcType([], [ptrType], false)}, {prop: "polynomial", name: "polynomial", pkg: "crypto/elliptic", typ: $funcType([ptrType$1], [ptrType$1], false)}, {prop: "IsOnCurve", name: "IsOnCurve", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [$Bool], false)}, {prop: "affineFromJacobian", name: "affineFromJacobian", pkg: "crypto/elliptic", typ: $funcType([ptrType$1, ptrType$1, ptrType$1], [ptrType$1, ptrType$1], false)}, {prop: "Add", name: "Add", pkg: "", typ: $funcType([ptrType$1, ptrType$1, ptrType$1, ptrType$1], [ptrType$1, ptrType$1], false)}, {prop: "addJacobian", name: "addJacobian", pkg: "crypto/elliptic", typ: $funcType([ptrType$1, ptrType$1, ptrType$1, ptrType$1, ptrType$1, ptrType$1], [ptrType$1, ptrType$1, ptrType$1], false)}, {prop: "Double", name: "Double", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1, ptrType$1], false)}, {prop: "doubleJacobian", name: "doubleJacobian", pkg: "crypto/elliptic", typ: $funcType([ptrType$1, ptrType$1, ptrType$1], [ptrType$1, ptrType$1, ptrType$1], false)}, {prop: "ScalarMult", name: "ScalarMult", pkg: "", typ: $funcType([ptrType$1, ptrType$1, sliceType$1], [ptrType$1, ptrType$1], false)}, {prop: "ScalarBaseMult", name: "ScalarBaseMult", pkg: "", typ: $funcType([sliceType$1], [ptrType$1, ptrType$1], false)}]; p521Curve.init("", [{prop: "CurveParams", name: "CurveParams", embedded: true, exported: true, typ: ptrType, tag: ""}]); p521Point.init("crypto/elliptic", [{prop: "x", name: "x", embedded: false, exported: false, typ: ptrType$2, tag: ""}, {prop: "y", name: "y", embedded: false, exported: false, typ: ptrType$2, tag: ""}, {prop: "z", name: "z", embedded: false, exported: false, typ: ptrType$2, tag: ""}]); p256Curve.init("", [{prop: "CurveParams", name: "CurveParams", embedded: true, exported: true, typ: ptrType, tag: ""}]); p224Curve.init("crypto/elliptic", [{prop: "CurveParams", name: "CurveParams", embedded: true, exported: true, typ: ptrType, tag: ""}, {prop: "gx", name: "gx", embedded: false, exported: false, typ: p224FieldElement, tag: ""}, {prop: "gy", name: "gy", embedded: false, exported: false, typ: p224FieldElement, tag: ""}, {prop: "b", name: "b", embedded: false, exported: false, typ: p224FieldElement, tag: ""}]); p224FieldElement.init($Uint32, 8); Curve.init([{prop: "Add", name: "Add", pkg: "", typ: $funcType([ptrType$1, ptrType$1, ptrType$1, ptrType$1], [ptrType$1, ptrType$1], false)}, {prop: "Double", name: "Double", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1, ptrType$1], false)}, {prop: "IsOnCurve", name: "IsOnCurve", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [$Bool], false)}, {prop: "Params", name: "Params", pkg: "", typ: $funcType([], [ptrType], false)}, {prop: "ScalarBaseMult", name: "ScalarBaseMult", pkg: "", typ: $funcType([sliceType$1], [ptrType$1, ptrType$1], false)}, {prop: "ScalarMult", name: "ScalarMult", pkg: "", typ: $funcType([ptrType$1, ptrType$1, sliceType$1], [ptrType$1, ptrType$1], false)}]); CurveParams.init("", [{prop: "P", name: "P", embedded: false, exported: true, typ: ptrType$1, tag: ""}, {prop: "N", name: "N", embedded: false, exported: true, typ: ptrType$1, tag: ""}, {prop: "B", name: "B", embedded: false, exported: true, typ: ptrType$1, tag: ""}, {prop: "Gx", name: "Gx", embedded: false, exported: true, typ: ptrType$1, tag: ""}, {prop: "Gy", name: "Gy", embedded: false, exported: true, typ: ptrType$1, tag: ""}, {prop: "BitSize", name: "BitSize", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Name", name: "Name", embedded: false, exported: true, 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 = fiat.$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 = big.$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; } p521 = new p521Curve.ptr(ptrType.nil); p256 = new p256Curve.ptr(ptrType.nil); p256Params = ptrType.nil; p256RInverse = ptrType$1.nil; p224 = new p224Curve.ptr(ptrType.nil, arrayType.zero(), arrayType.zero(), arrayType.zero()); initonce = new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)); p384 = ptrType.nil; p256One = $toNativeArray($kindUint32, [2, 0, 0, 268433408, 536870911, 268435455, 532676607, 33554431, 0]); p256Precomputed = $toNativeArray($kindUint32, [290596984, 242421057, 230031737, 78635775, 310917853, 212721032, 295599836, 222981803, 51514350, 489335829, 254096764, 434396381, 96936400, 429049253, 170095751, 22329889, 21696699, 11419619, 222406006, 153287761, 37001551, 101408979, 373655214, 216620824, 535072883, 66729676, 99339564, 188755759, 22835391, 358715996, 94529284, 229187216, 215751807, 513877062, 236641822, 248061730, 40859512, 90604670, 168553630, 37024851, 439480858, 226879324, 90992905, 170293760, 190300240, 10025815, 178796492, 101451666, 217734681, 102476702, 92922779, 10691781, 131522279, 43478603, 532943434, 176956491, 484992866, 215358590, 405915872, 123172065, 496412073, 138651209, 205172986, 115533781, 124205610, 395011560, 67124891, 438243778, 7870186, 258227729, 93078495, 255999938, 425934842, 143782578, 305931036, 74112396, 88539357, 94251799, 388871183, 138291069, 185456137, 265411090, 56389202, 435020300, 219799744, 159190848, 184638233, 71951349, 14748830, 54179201, 90859435, 91714381, 501071970, 207073549, 21607325, 40541819, 204857247, 75982029, 124632266, 212120422, 244515755, 443842791, 92184193, 504621904, 256273651, 116484896, 79311219, 202804275, 365646905, 111382033, 121002173, 187258447, 66509915, 5486974, 321045696, 106813439, 60941558, 350622890, 153379607, 466107082, 182025965, 221826634, 260222982, 54653047, 174775689, 76106445, 166814421, 260313327, 455502422, 14152227, 65063826, 238663282, 111317018, 110789974, 518080, 163043539, 3185280, 449863551, 204453341, 213898269, 164542008, 273777244, 228642651, 135456897, 116610665, 111505196, 502845828, 3430432, 343397495, 23354801, 199756881, 203603518, 238413402, 451639968, 204952341, 258456729, 134076345, 421511614, 6366045, 46236905, 29730873, 75111974, 192722006, 155066973, 351520493, 214702793, 402536435, 77105545, 445695234, 49487938, 169309851, 184388732, 135863406, 500019767, 23199936, 276509345, 107743451, 282094082, 261267, 90308643, 376580903, 109796441, 40959228, 262999756, 241033666, 246105707, 50090300, 67630940, 195735859, 158359529, 193509607, 120899987, 31588239, 420833648, 180162304, 273063591, 53033664, 215783594, 30950397, 236240872, 364806751, 9130514, 246676327, 136101161, 197537558, 45546695, 257576489, 324406118, 202074818, 85649040, 222421617, 255761364, 30870187, 16949106, 121510965, 250023868, 181935023, 166511770, 141325342, 266780208, 392647399, 2348054, 528735877, 41804168, 107966648, 404542751, 158035532, 412033845, 173930329, 396852918, 267062899, 357230868, 49540177, 58878809, 194113917, 29829449, 325238538, 237239775, 173413552, 1015183, 495713, 136567250, 136396601, 287878667, 218717445, 193315010, 32289519, 38657156, 238414081, 406919754, 257809469, 58222217, 86139112, 95303012, 88256781, 148453957, 429206180, 160877633, 273786665, 79574169, 86713258, 278868094, 116766395, 528802279, 125439226, 281337663, 39453418, 184844341, 238149222, 208587427, 42902325, 42491940, 326299680, 16080181, 367290444, 254451223, 441087273, 213368497, 187332769, 447880991, 104209615, 113842077, 185816615, 308787572, 71338925, 482342488, 238904593, 13096815, 30177897, 243196699, 89107279, 2855247, 450001456, 215177118, 206574156, 84781712, 11616114, 184986229, 118447302, 373941674, 139088658, 53019708, 68960273, 332604433, 184854584, 225840429, 387167538, 195693571, 138420907, 113046977, 49566585, 25878640, 415883550, 34327194, 107956587, 65991316, 108331218, 226451772, 2997227, 192155704, 235148095, 360879757, 199853559, 28097562, 443192223, 54415606, 224812756, 189496278, 509228953, 112408647, 402282239, 106887472, 2219082, 45315673, 72416791, 188054373, 234221484, 356088815, 164846207, 288014687, 103081518, 177253935, 276753618, 32938942, 125660110, 91493268, 331777276, 156289296, 119886379, 231179651, 68086459, 534655626, 198581654, 220775303, 166165897, 307563584, 123325309, 57143092, 182626656, 152800220, 154428073, 16017903, 187603695, 221030257, 89005890, 8038985, 103901883, 37829774, 88235001, 468532794, 254222964, 526283558, 104949015, 245526642, 164552359, 7239219, 130619730, 226520526, 149071841, 239214106, 68733409, 31180944, 456743990, 169722229, 499445619, 144011060, 239820018, 453851672, 51989046, 113402911, 239342156, 170872490, 176956858, 261258967, 103265812, 121052362, 195126932, 68664323, 130066403, 163798041, 292069893, 146190349, 283373001, 163683314, 92807721, 455819618, 173862682, 356737579, 163398462, 56942669, 122161042, 97105331, 243662629, 67694423, 404017060, 18986011, 220498447, 61887010, 60535146, 209032813, 168001811, 172627817, 18857068, 152560910, 250363304, 379416236, 17569433, 172056915, 259148050, 365781175, 78428889, 99599866, 253038295, 1190737, 285520906, 213382210, 263923967, 111956938, 425804492, 129961897, 9795153, 81850901, 248789496, 66350037, 95217711, 285808310, 7188600, 268270935, 254724780, 212364780, 366392026, 157674697, 479376578, 2045969, 481329397, 47757316, 433176877, 253803846, 26550183, 171333315, 86221861, 265094802, 222617032, 320802651, 184028746, 215612532, 161199640, 47944780, 174534800, 29495521, 395087139, 21447555, 280523837, 159753563, 48711545, 5726520, 156793127, 321990906, 199251222, 167040537, 196486512, 161400209, 227830014, 487028781, 264711691, 117551768, 409175611, 140072120, 303696950, 166199007, 258257961, 163174174, 350418392, 260410682, 155381416, 228964197, 116240383, 178067660, 208004282, 477396614, 240036117, 427939745, 137975385, 86955234, 142427063, 58372379, 433230542, 260916882, 415434047, 143015443, 79775424, 113112410, 82068861, 370483849, 180850370, 442090914, 33721239, 119287041, 43353375, 67400827, 142103949, 131242660, 332936223, 148565975, 329029421, 112716405, 222993886, 267477976, 136140247, 173797224, 192622808, 199703919, 178815297, 228027521, 132622796, 415151985, 225918141, 334829905, 164675959, 29661816]); p224P = $toNativeArray($kindUint32, [1, 0, 0, 268431360, 268435455, 268435455, 268435455, 268435455]); p256Zero31 = $toNativeArray($kindUint32, [2147483640, 1073741820, 2147483644, 1073750012, 2147483644, 1073741820, 2164260860, 939524092, 2147483644]); p224ZeroModP31 = new sliceType([2147483656, 2147483640, 2147483640, 2147450872, 2147483640, 2147483640, 2147483640, 2147483640]); p224ZeroModP63 = $toNativeArray($kindUint64, [new $Uint64(2147483656, 0), new $Uint64(2147483640, 0), new $Uint64(2147483640, 0), new $Uint64(2147483640, 0), new $Uint64(2147483639, 4294443008), new $Uint64(2147483640, 0), new $Uint64(2147483640, 0), new $Uint64(2147483640, 0)]); mask = new sliceType$1([255, 1, 3, 7, 15, 31, 63, 127]); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["crypto/internal/randutil"] = (function() { var $pkg = {}, $init, io, sync, structType, arrayType, sliceType, closedChanOnce, closedChan, MaybeReadByte; io = $packages["io"]; sync = $packages["sync"]; structType = $structType("", []); arrayType = $arrayType($Uint8, 1); sliceType = $sliceType($Uint8); MaybeReadByte = function(r) { var _r, _r$1, _selection, buf, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _selection = $f._selection; buf = $f.buf; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = closedChanOnce.Do((function() { closedChan = new $Chan(structType, 0); $close(closedChan); })); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r = $select([[closedChan], [closedChan]]); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _selection = _r; /* */ if (_selection[0] === 0) { $s = 3; continue; } /* */ if (_selection[0] === 1) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_selection[0] === 0) { */ case 3: $s = -1; return; /* } else if (_selection[0] === 1) { */ case 4: buf = arrayType.zero(); _r$1 = r.Read(new sliceType(buf)); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; /* } */ case 5: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: MaybeReadByte }; } $f._r = _r; $f._r$1 = _r$1; $f._selection = _selection; $f.buf = buf; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.MaybeReadByte = MaybeReadByte; $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; } closedChanOnce = new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)); closedChan = $chanNil; /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["crypto/sha512"] = (function() { var $pkg = {}, $init, crypto, binary, errors, hash, bits, digest, sliceType, arrayType, sliceType$1, arrayType$1, arrayType$2, arrayType$3, arrayType$4, ptrType, _K, block, blockGeneric, init, appendUint64, consumeUint64, New, New512_224, New512_256, New384, Sum512; crypto = $packages["crypto"]; binary = $packages["encoding/binary"]; errors = $packages["errors"]; hash = $packages["hash"]; bits = $packages["math/bits"]; digest = $pkg.digest = $newType(0, $kindStruct, "sha512.digest", true, "crypto/sha512", false, function(h_, x_, nx_, len_, function$4_) { this.$val = this; if (arguments.length === 0) { this.h = arrayType$2.zero(); this.x = arrayType$3.zero(); this.nx = 0; this.len = new $Uint64(0, 0); this.function$4 = 0; return; } this.h = h_; this.x = x_; this.nx = nx_; this.len = len_; this.function$4 = function$4_; }); sliceType = $sliceType($Uint64); arrayType = $arrayType($Uint64, 80); sliceType$1 = $sliceType($Uint8); arrayType$1 = $arrayType($Uint8, 8); arrayType$2 = $arrayType($Uint64, 8); arrayType$3 = $arrayType($Uint8, 128); arrayType$4 = $arrayType($Uint8, 64); ptrType = $ptrType(digest); block = function(dig, p) { var dig, p; blockGeneric(dig, p); }; blockGeneric = function(dig, p) { var _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$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$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$7, x$8, x$9; w = arrayType.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 >= 128)) { break; } i = 0; while (true) { if (!(i < 16)) { break; } j = $imul(i, 8); ((i < 0 || i >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[i] = (x = (x$1 = (x$2 = (x$3 = (x$4 = (x$5 = (x$6 = $shiftLeft64((new $Uint64(0, ((j < 0 || j >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + j]))), 56), x$7 = $shiftLeft64((new $Uint64(0, (x$8 = j + 1 >> 0, ((x$8 < 0 || x$8 >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + x$8])))), 48), new $Uint64(x$6.$high | x$7.$high, (x$6.$low | x$7.$low) >>> 0)), x$9 = $shiftLeft64((new $Uint64(0, (x$10 = j + 2 >> 0, ((x$10 < 0 || x$10 >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + x$10])))), 40), new $Uint64(x$5.$high | x$9.$high, (x$5.$low | x$9.$low) >>> 0)), x$11 = $shiftLeft64((new $Uint64(0, (x$12 = j + 3 >> 0, ((x$12 < 0 || x$12 >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + x$12])))), 32), new $Uint64(x$4.$high | x$11.$high, (x$4.$low | x$11.$low) >>> 0)), x$13 = $shiftLeft64((new $Uint64(0, (x$14 = j + 4 >> 0, ((x$14 < 0 || x$14 >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + x$14])))), 24), new $Uint64(x$3.$high | x$13.$high, (x$3.$low | x$13.$low) >>> 0)), x$15 = $shiftLeft64((new $Uint64(0, (x$16 = j + 5 >> 0, ((x$16 < 0 || x$16 >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + x$16])))), 16), new $Uint64(x$2.$high | x$15.$high, (x$2.$low | x$15.$low) >>> 0)), x$17 = $shiftLeft64((new $Uint64(0, (x$18 = j + 6 >> 0, ((x$18 < 0 || x$18 >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + x$18])))), 8), new $Uint64(x$1.$high | x$17.$high, (x$1.$low | x$17.$low) >>> 0)), x$19 = (new $Uint64(0, (x$20 = j + 7 >> 0, ((x$20 < 0 || x$20 >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + x$20])))), new $Uint64(x.$high | x$19.$high, (x.$low | x$19.$low) >>> 0))); i = i + (1) >> 0; } i$1 = 16; while (true) { if (!(i$1 < 80)) { break; } v1 = (x$21 = i$1 - 2 >> 0, ((x$21 < 0 || x$21 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[x$21])); t1 = (x$22 = (x$23 = bits.RotateLeft64(v1, -19), x$24 = bits.RotateLeft64(v1, -61), new $Uint64(x$23.$high ^ x$24.$high, (x$23.$low ^ x$24.$low) >>> 0)), x$25 = $shiftRightUint64(v1, 6), new $Uint64(x$22.$high ^ x$25.$high, (x$22.$low ^ x$25.$low) >>> 0)); v2 = (x$26 = i$1 - 15 >> 0, ((x$26 < 0 || x$26 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[x$26])); t2 = (x$27 = (x$28 = bits.RotateLeft64(v2, -1), x$29 = bits.RotateLeft64(v2, -8), new $Uint64(x$28.$high ^ x$29.$high, (x$28.$low ^ x$29.$low) >>> 0)), x$30 = $shiftRightUint64(v2, 7), new $Uint64(x$27.$high ^ x$30.$high, (x$27.$low ^ x$30.$low) >>> 0)); ((i$1 < 0 || i$1 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[i$1] = (x$31 = (x$32 = (x$33 = (x$34 = i$1 - 7 >> 0, ((x$34 < 0 || x$34 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[x$34])), new $Uint64(t1.$high + x$33.$high, t1.$low + x$33.$low)), new $Uint64(x$32.$high + t2.$high, x$32.$low + t2.$low)), x$35 = (x$36 = i$1 - 16 >> 0, ((x$36 < 0 || x$36 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[x$36])), new $Uint64(x$31.$high + x$35.$high, x$31.$low + x$35.$low))); 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 < 80)) { break; } t1$1 = (x$37 = (x$38 = (x$39 = (x$40 = (x$41 = (x$42 = bits.RotateLeft64(e, -14), x$43 = bits.RotateLeft64(e, -18), new $Uint64(x$42.$high ^ x$43.$high, (x$42.$low ^ x$43.$low) >>> 0)), x$44 = bits.RotateLeft64(e, -41), new $Uint64(x$41.$high ^ x$44.$high, (x$41.$low ^ x$44.$low) >>> 0)), new $Uint64(h.$high + x$40.$high, h.$low + x$40.$low)), x$45 = (x$46 = new $Uint64(e.$high & f.$high, (e.$low & f.$low) >>> 0), x$47 = (x$48 = new $Uint64(~e.$high, ~e.$low >>> 0), new $Uint64(x$48.$high & g.$high, (x$48.$low & g.$low) >>> 0)), new $Uint64(x$46.$high ^ x$47.$high, (x$46.$low ^ x$47.$low) >>> 0)), new $Uint64(x$39.$high + x$45.$high, x$39.$low + x$45.$low)), x$49 = ((i$2 < 0 || i$2 >= _K.$length) ? ($throwRuntimeError("index out of range"), undefined) : _K.$array[_K.$offset + i$2]), new $Uint64(x$38.$high + x$49.$high, x$38.$low + x$49.$low)), x$50 = ((i$2 < 0 || i$2 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[i$2]), new $Uint64(x$37.$high + x$50.$high, x$37.$low + x$50.$low)); t2$1 = (x$51 = (x$52 = (x$53 = bits.RotateLeft64(a, -28), x$54 = bits.RotateLeft64(a, -34), new $Uint64(x$53.$high ^ x$54.$high, (x$53.$low ^ x$54.$low) >>> 0)), x$55 = bits.RotateLeft64(a, -39), new $Uint64(x$52.$high ^ x$55.$high, (x$52.$low ^ x$55.$low) >>> 0)), x$56 = (x$57 = (x$58 = new $Uint64(a.$high & b.$high, (a.$low & b.$low) >>> 0), x$59 = new $Uint64(a.$high & c.$high, (a.$low & c.$low) >>> 0), new $Uint64(x$58.$high ^ x$59.$high, (x$58.$low ^ x$59.$low) >>> 0)), x$60 = new $Uint64(b.$high & c.$high, (b.$low & c.$low) >>> 0), new $Uint64(x$57.$high ^ x$60.$high, (x$57.$low ^ x$60.$low) >>> 0)), new $Uint64(x$51.$high + x$56.$high, x$51.$low + x$56.$low)); h = g; g = f; f = e; e = new $Uint64(d.$high + t1$1.$high, d.$low + t1$1.$low); d = c; c = b; b = a; a = new $Uint64(t1$1.$high + t2$1.$high, t1$1.$low + t2$1.$low); i$2 = i$2 + (1) >> 0; } h0 = (x$61 = a, new $Uint64(h0.$high + x$61.$high, h0.$low + x$61.$low)); h1 = (x$62 = b, new $Uint64(h1.$high + x$62.$high, h1.$low + x$62.$low)); h2 = (x$63 = c, new $Uint64(h2.$high + x$63.$high, h2.$low + x$63.$low)); h3 = (x$64 = d, new $Uint64(h3.$high + x$64.$high, h3.$low + x$64.$low)); h4 = (x$65 = e, new $Uint64(h4.$high + x$65.$high, h4.$low + x$65.$low)); h5 = (x$66 = f, new $Uint64(h5.$high + x$66.$high, h5.$low + x$66.$low)); h6 = (x$67 = g, new $Uint64(h6.$high + x$67.$high, h6.$low + x$67.$low)); h7 = (x$68 = h, new $Uint64(h7.$high + x$68.$high, h7.$low + x$68.$low)); p = $subslice(p, 128); } _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; }; init = function() { crypto.RegisterHash(6, New384); crypto.RegisterHash(7, New); crypto.RegisterHash(14, New512_224); crypto.RegisterHash(15, New512_256); }; digest.ptr.prototype.Reset = function() { var _1, d; d = this; _1 = d.function$4; if (_1 === (6)) { d.h[0] = new $Uint64(3418070365, 3238371032); d.h[1] = new $Uint64(1654270250, 914150663); d.h[2] = new $Uint64(2438529370, 812702999); d.h[3] = new $Uint64(355462360, 4144912697); d.h[4] = new $Uint64(1731405415, 4290775857); d.h[5] = new $Uint64(2394180231, 1750603025); d.h[6] = new $Uint64(3675008525, 1694076839); d.h[7] = new $Uint64(1203062813, 3204075428); } else if (_1 === (14)) { d.h[0] = new $Uint64(2352822216, 424955298); d.h[1] = new $Uint64(1944164710, 2312950998); d.h[2] = new $Uint64(502970286, 855612546); d.h[3] = new $Uint64(1738396948, 1479516111); d.h[4] = new $Uint64(258812777, 2077511080); d.h[5] = new $Uint64(2011393907, 79989058); d.h[6] = new $Uint64(1067287976, 1780299464); d.h[7] = new $Uint64(286451373, 2446758561); } else if (_1 === (15)) { d.h[0] = new $Uint64(573645204, 4230739756); d.h[1] = new $Uint64(2673172387, 3360449730); d.h[2] = new $Uint64(596883563, 1867755857); d.h[3] = new $Uint64(2520282905, 1497426621); d.h[4] = new $Uint64(2519219938, 2827943907); d.h[5] = new $Uint64(3193839141, 1401305490); d.h[6] = new $Uint64(721525244, 746961066); d.h[7] = new $Uint64(246885852, 2177182882); } else { d.h[0] = new $Uint64(1779033703, 4089235720); d.h[1] = new $Uint64(3144134277, 2227873595); d.h[2] = new $Uint64(1013904242, 4271175723); d.h[3] = new $Uint64(2773480762, 1595750129); d.h[4] = new $Uint64(1359893119, 2917565137); d.h[5] = new $Uint64(2600822924, 725511199); d.h[6] = new $Uint64(528734635, 4215389547); d.h[7] = new $Uint64(1541459225, 327033209); } d.nx = 0; d.len = new $Uint64(0, 0); }; digest.prototype.Reset = function() { return this.$val.Reset(); }; digest.ptr.prototype.MarshalBinary = function() { var _1, b, d; d = this; b = $makeSlice(sliceType$1, 0, 204); _1 = d.function$4; if (_1 === (6)) { b = $appendSlice(b, "sha\x04"); } else if (_1 === (14)) { b = $appendSlice(b, "sha\x05"); } else if (_1 === (15)) { b = $appendSlice(b, "sha\x06"); } else if (_1 === (7)) { b = $appendSlice(b, "sha\x07"); } else { return [sliceType$1.nil, errors.New("crypto/sha512: invalid hash function")]; } b = appendUint64(b, d.h[0]); b = appendUint64(b, d.h[1]); b = appendUint64(b, d.h[2]); b = appendUint64(b, d.h[3]); b = appendUint64(b, d.h[4]); b = appendUint64(b, d.h[5]); b = appendUint64(b, d.h[6]); b = appendUint64(b, d.h[7]); b = $appendSlice(b, $subslice(new sliceType$1(d.x), 0, d.nx)); b = $subslice(b, 0, ((b.$length + 128 >> 0) - (d.nx) >> 0)); b = appendUint64(b, d.len); return [b, $ifaceNil]; }; digest.prototype.MarshalBinary = function() { return this.$val.MarshalBinary(); }; digest.ptr.prototype.UnmarshalBinary = function(b) { var _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, _tuple$8, b, d; d = this; if (b.$length < 4) { return errors.New("crypto/sha512: invalid hash state identifier"); } if ((d.function$4 === 6) && ($bytesToString($subslice(b, 0, 4))) === "sha\x04") { } else if ((d.function$4 === 14) && ($bytesToString($subslice(b, 0, 4))) === "sha\x05") { } else if ((d.function$4 === 15) && ($bytesToString($subslice(b, 0, 4))) === "sha\x06") { } else if ((d.function$4 === 7) && ($bytesToString($subslice(b, 0, 4))) === "sha\x07") { } else { return errors.New("crypto/sha512: invalid hash state identifier"); } if (!((b.$length === 204))) { return errors.New("crypto/sha512: invalid hash state size"); } b = $subslice(b, 4); _tuple = consumeUint64(b); b = _tuple[0]; d.h[0] = _tuple[1]; _tuple$1 = consumeUint64(b); b = _tuple$1[0]; d.h[1] = _tuple$1[1]; _tuple$2 = consumeUint64(b); b = _tuple$2[0]; d.h[2] = _tuple$2[1]; _tuple$3 = consumeUint64(b); b = _tuple$3[0]; d.h[3] = _tuple$3[1]; _tuple$4 = consumeUint64(b); b = _tuple$4[0]; d.h[4] = _tuple$4[1]; _tuple$5 = consumeUint64(b); b = _tuple$5[0]; d.h[5] = _tuple$5[1]; _tuple$6 = consumeUint64(b); b = _tuple$6[0]; d.h[6] = _tuple$6[1]; _tuple$7 = consumeUint64(b); b = _tuple$7[0]; d.h[7] = _tuple$7[1]; b = $subslice(b, $copySlice(new sliceType$1(d.x), b)); _tuple$8 = consumeUint64(b); b = _tuple$8[0]; d.len = _tuple$8[1]; d.nx = (($div64(d.len, new $Uint64(0, 128), true).$low >> 0)); return $ifaceNil; }; digest.prototype.UnmarshalBinary = function(b) { return this.$val.UnmarshalBinary(b); }; appendUint64 = function(b, x) { var a, b, x; a = arrayType$1.zero(); $clone(binary.BigEndian, binary.bigEndian).PutUint64(new sliceType$1(a), x); return $appendSlice(b, new sliceType$1(a)); }; consumeUint64 = function(b) { var b, 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; $unused((7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7])); x$14 = (x = (x$1 = (x$2 = (x$3 = (x$4 = (x$5 = (x$6 = (new $Uint64(0, (7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7]))), x$7 = $shiftLeft64((new $Uint64(0, (6 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 6]))), 8), new $Uint64(x$6.$high | x$7.$high, (x$6.$low | x$7.$low) >>> 0)), x$8 = $shiftLeft64((new $Uint64(0, (5 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 5]))), 16), new $Uint64(x$5.$high | x$8.$high, (x$5.$low | x$8.$low) >>> 0)), x$9 = $shiftLeft64((new $Uint64(0, (4 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 4]))), 24), new $Uint64(x$4.$high | x$9.$high, (x$4.$low | x$9.$low) >>> 0)), x$10 = $shiftLeft64((new $Uint64(0, (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]))), 32), new $Uint64(x$3.$high | x$10.$high, (x$3.$low | x$10.$low) >>> 0)), x$11 = $shiftLeft64((new $Uint64(0, (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]))), 40), new $Uint64(x$2.$high | x$11.$high, (x$2.$low | x$11.$low) >>> 0)), x$12 = $shiftLeft64((new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), 48), new $Uint64(x$1.$high | x$12.$high, (x$1.$low | x$12.$low) >>> 0)), x$13 = $shiftLeft64((new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), 56), new $Uint64(x.$high | x$13.$high, (x.$low | x$13.$low) >>> 0)); return [$subslice(b, 8), x$14]; }; New = function() { var d; d = new digest.ptr(arrayType$2.zero(), arrayType$3.zero(), 0, new $Uint64(0, 0), 7); d.Reset(); return d; }; $pkg.New = New; New512_224 = function() { var d; d = new digest.ptr(arrayType$2.zero(), arrayType$3.zero(), 0, new $Uint64(0, 0), 14); d.Reset(); return d; }; $pkg.New512_224 = New512_224; New512_256 = function() { var d; d = new digest.ptr(arrayType$2.zero(), arrayType$3.zero(), 0, new $Uint64(0, 0), 15); d.Reset(); return d; }; $pkg.New512_256 = New512_256; New384 = function() { var d; d = new digest.ptr(arrayType$2.zero(), arrayType$3.zero(), 0, new $Uint64(0, 0), 6); d.Reset(); return d; }; $pkg.New384 = New384; digest.ptr.prototype.Size = function() { var _1, d; d = this; _1 = d.function$4; if (_1 === (14)) { return 28; } else if (_1 === (15)) { return 32; } else if (_1 === (6)) { return 48; } else { return 64; } }; digest.prototype.Size = function() { return this.$val.Size(); }; digest.ptr.prototype.BlockSize = function() { var d; d = this; return 128; }; digest.prototype.BlockSize = function() { return this.$val.BlockSize(); }; digest.ptr.prototype.Write = function(p) { var 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 === 128) { block(d, new sliceType$1(d.x)); d.nx = 0; } p = $subslice(p, n); } if (p.$length >= 128) { n$1 = (p.$length & ~127) >> 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 _1, d, d0, hash$1, in$1; d = this; d0 = new digest.ptr(arrayType$2.zero(), arrayType$3.zero(), 0, new $Uint64(0, 0), 0); digest.copy(d0, d); hash$1 = $clone(d0.checkSum(), arrayType$4); _1 = d0.function$4; if (_1 === (6)) { return $appendSlice(in$1, $subslice(new sliceType$1(hash$1), 0, 48)); } else if (_1 === (14)) { return $appendSlice(in$1, $subslice(new sliceType$1(hash$1), 0, 28)); } else if (_1 === (15)) { return $appendSlice(in$1, $subslice(new sliceType$1(hash$1), 0, 32)); } else { 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 d, digest$1, len, tmp, x, x$1, x$2; d = this; len = d.len; tmp = arrayType$3.zero(); tmp[0] = 128; if ((x = $div64(len, new $Uint64(0, 128), true), (x.$high < 0 || (x.$high === 0 && x.$low < 112)))) { d.Write($subslice(new sliceType$1(tmp), 0, $flatten64((x$1 = $div64(len, new $Uint64(0, 128), true), new $Uint64(0 - x$1.$high, 112 - x$1.$low))))); } else { d.Write($subslice(new sliceType$1(tmp), 0, $flatten64((x$2 = $div64(len, new $Uint64(0, 128), true), new $Uint64(0 - x$2.$high, 240 - x$2.$low))))); } len = $shiftLeft64(len, (3)); $clone(binary.BigEndian, binary.bigEndian).PutUint64($subslice(new sliceType$1(tmp), 0), new $Uint64(0, 0)); $clone(binary.BigEndian, binary.bigEndian).PutUint64($subslice(new sliceType$1(tmp), 8), len); d.Write($subslice(new sliceType$1(tmp), 0, 16)); if (!((d.nx === 0))) { $panic(new $String("d.nx != 0")); } digest$1 = arrayType$4.zero(); $clone(binary.BigEndian, binary.bigEndian).PutUint64($subslice(new sliceType$1(digest$1), 0), d.h[0]); $clone(binary.BigEndian, binary.bigEndian).PutUint64($subslice(new sliceType$1(digest$1), 8), d.h[1]); $clone(binary.BigEndian, binary.bigEndian).PutUint64($subslice(new sliceType$1(digest$1), 16), d.h[2]); $clone(binary.BigEndian, binary.bigEndian).PutUint64($subslice(new sliceType$1(digest$1), 24), d.h[3]); $clone(binary.BigEndian, binary.bigEndian).PutUint64($subslice(new sliceType$1(digest$1), 32), d.h[4]); $clone(binary.BigEndian, binary.bigEndian).PutUint64($subslice(new sliceType$1(digest$1), 40), d.h[5]); if (!((d.function$4 === 6))) { $clone(binary.BigEndian, binary.bigEndian).PutUint64($subslice(new sliceType$1(digest$1), 48), d.h[6]); $clone(binary.BigEndian, binary.bigEndian).PutUint64($subslice(new sliceType$1(digest$1), 56), d.h[7]); } return digest$1; }; digest.prototype.checkSum = function() { return this.$val.checkSum(); }; Sum512 = function(data) { var d, data; d = new digest.ptr(arrayType$2.zero(), arrayType$3.zero(), 0, new $Uint64(0, 0), 7); d.Reset(); d.Write(data); return d.checkSum(); }; $pkg.Sum512 = Sum512; ptrType.methods = [{prop: "Reset", name: "Reset", pkg: "", typ: $funcType([], [], false)}, {prop: "MarshalBinary", name: "MarshalBinary", pkg: "", typ: $funcType([], [sliceType$1, $error], false)}, {prop: "UnmarshalBinary", name: "UnmarshalBinary", pkg: "", typ: $funcType([sliceType$1], [$error], 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/sha512", typ: $funcType([], [arrayType$4], false)}]; digest.init("crypto/sha512", [{prop: "h", name: "h", embedded: false, exported: false, typ: arrayType$2, tag: ""}, {prop: "x", name: "x", embedded: false, exported: false, typ: arrayType$3, tag: ""}, {prop: "nx", name: "nx", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "len", name: "len", embedded: false, exported: false, typ: $Uint64, tag: ""}, {prop: "function$4", name: "function", embedded: false, exported: false, typ: crypto.Hash, 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 = 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 = hash.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = bits.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _K = new sliceType([new $Uint64(1116352408, 3609767458), new $Uint64(1899447441, 602891725), new $Uint64(3049323471, 3964484399), new $Uint64(3921009573, 2173295548), new $Uint64(961987163, 4081628472), new $Uint64(1508970993, 3053834265), new $Uint64(2453635748, 2937671579), new $Uint64(2870763221, 3664609560), new $Uint64(3624381080, 2734883394), new $Uint64(310598401, 1164996542), new $Uint64(607225278, 1323610764), new $Uint64(1426881987, 3590304994), new $Uint64(1925078388, 4068182383), new $Uint64(2162078206, 991336113), new $Uint64(2614888103, 633803317), new $Uint64(3248222580, 3479774868), new $Uint64(3835390401, 2666613458), new $Uint64(4022224774, 944711139), new $Uint64(264347078, 2341262773), new $Uint64(604807628, 2007800933), new $Uint64(770255983, 1495990901), new $Uint64(1249150122, 1856431235), new $Uint64(1555081692, 3175218132), new $Uint64(1996064986, 2198950837), new $Uint64(2554220882, 3999719339), new $Uint64(2821834349, 766784016), new $Uint64(2952996808, 2566594879), new $Uint64(3210313671, 3203337956), new $Uint64(3336571891, 1034457026), new $Uint64(3584528711, 2466948901), new $Uint64(113926993, 3758326383), new $Uint64(338241895, 168717936), new $Uint64(666307205, 1188179964), new $Uint64(773529912, 1546045734), new $Uint64(1294757372, 1522805485), new $Uint64(1396182291, 2643833823), new $Uint64(1695183700, 2343527390), new $Uint64(1986661051, 1014477480), new $Uint64(2177026350, 1206759142), new $Uint64(2456956037, 344077627), new $Uint64(2730485921, 1290863460), new $Uint64(2820302411, 3158454273), new $Uint64(3259730800, 3505952657), new $Uint64(3345764771, 106217008), new $Uint64(3516065817, 3606008344), new $Uint64(3600352804, 1432725776), new $Uint64(4094571909, 1467031594), new $Uint64(275423344, 851169720), new $Uint64(430227734, 3100823752), new $Uint64(506948616, 1363258195), new $Uint64(659060556, 3750685593), new $Uint64(883997877, 3785050280), new $Uint64(958139571, 3318307427), new $Uint64(1322822218, 3812723403), new $Uint64(1537002063, 2003034995), new $Uint64(1747873779, 3602036899), new $Uint64(1955562222, 1575990012), new $Uint64(2024104815, 1125592928), new $Uint64(2227730452, 2716904306), new $Uint64(2361852424, 442776044), new $Uint64(2428436474, 593698344), new $Uint64(2756734187, 3733110249), new $Uint64(3204031479, 2999351573), new $Uint64(3329325298, 3815920427), new $Uint64(3391569614, 3928383900), new $Uint64(3515267271, 566280711), new $Uint64(3940187606, 3454069534), new $Uint64(4118630271, 4000239992), new $Uint64(116418474, 1914138554), new $Uint64(174292421, 2731055270), new $Uint64(289380356, 3203993006), new $Uint64(460393269, 320620315), new $Uint64(685471733, 587496836), new $Uint64(852142971, 1086792851), new $Uint64(1017036298, 365543100), new $Uint64(1126000580, 2618297676), new $Uint64(1288033470, 3409855158), new $Uint64(1501505948, 4234509866), new $Uint64(1607167915, 987167468), new $Uint64(1816402316, 1246189591)]); init(); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["encoding/asn1"] = (function() { var $pkg = {}, $init, bytes, errors, fmt, math, big, reflect, sort, strconv, strings, time, utf16, utf8, encoder, byteEncoder, bytesEncoder, stringEncoder, multiEncoder, setEncoder, taggedEncoder, int64Encoder, bitStringEncoder, oidEncoder, tagAndLength, fieldParameters, StructuralError, SyntaxError, BitString, ObjectIdentifier, Enumerated, Flag, RawValue, RawContent, invalidUnmarshalError, sliceType, ptrType, sliceType$1, ptrType$1, sliceType$2, arrayType, sliceType$3, ptrType$2, ptrType$3, sliceType$4, arrayType$1, sliceType$5, ptrType$4, ptrType$5, ptrType$6, ptrType$7, ptrType$8, ptrType$9, ptrType$10, ptrType$11, ptrType$12, ptrType$13, byte00Encoder, byteFFEncoder, bigOne, bitStringType, objectIdentifierType, enumeratedType, flagType, timeType, rawValueType, rawContentsType, bigIntType, x, x$1, x$2, base128IntLength, appendBase128Int, makeBigInt, appendLength, lengthLength, appendTagAndLength, makeObjectIdentifier, makePrintableString, makeIA5String, makeNumericString, makeUTF8String, appendTwoDigits, appendFourDigits, outsideUTCRange, makeUTCTime, makeGeneralizedTime, appendUTCTime, appendGeneralizedTime, appendTimeCommon, stripTagAndLength, makeBody, makeField, Marshal, MarshalWithParams, parseFieldParameters, getUniversalType, parseBool, checkInteger, parseInt64, parseInt32, parseBigInt, parseBitString, parseObjectIdentifier, parseBase128Int, parseUTCTime, parseGeneralizedTime, parseNumericString, isNumeric, parsePrintableString, isPrintable, parseIA5String, parseT61String, parseUTF8String, parseBMPString, parseTagAndLength, parseSequenceOf, invalidLength, parseField, canHaveDefaultValue, setDefaultValue, Unmarshal, UnmarshalWithParams; bytes = $packages["bytes"]; errors = $packages["errors"]; fmt = $packages["fmt"]; math = $packages["math"]; big = $packages["math/big"]; reflect = $packages["reflect"]; sort = $packages["sort"]; strconv = $packages["strconv"]; strings = $packages["strings"]; time = $packages["time"]; utf16 = $packages["unicode/utf16"]; utf8 = $packages["unicode/utf8"]; encoder = $pkg.encoder = $newType(8, $kindInterface, "asn1.encoder", true, "encoding/asn1", false, null); byteEncoder = $pkg.byteEncoder = $newType(1, $kindUint8, "asn1.byteEncoder", true, "encoding/asn1", false, null); bytesEncoder = $pkg.bytesEncoder = $newType(12, $kindSlice, "asn1.bytesEncoder", true, "encoding/asn1", false, null); stringEncoder = $pkg.stringEncoder = $newType(8, $kindString, "asn1.stringEncoder", true, "encoding/asn1", false, null); multiEncoder = $pkg.multiEncoder = $newType(12, $kindSlice, "asn1.multiEncoder", true, "encoding/asn1", false, null); setEncoder = $pkg.setEncoder = $newType(12, $kindSlice, "asn1.setEncoder", true, "encoding/asn1", false, null); taggedEncoder = $pkg.taggedEncoder = $newType(0, $kindStruct, "asn1.taggedEncoder", true, "encoding/asn1", false, function(scratch_, tag_, body_) { this.$val = this; if (arguments.length === 0) { this.scratch = arrayType$1.zero(); this.tag = $ifaceNil; this.body = $ifaceNil; return; } this.scratch = scratch_; this.tag = tag_; this.body = body_; }); int64Encoder = $pkg.int64Encoder = $newType(8, $kindInt64, "asn1.int64Encoder", true, "encoding/asn1", false, null); bitStringEncoder = $pkg.bitStringEncoder = $newType(0, $kindStruct, "asn1.bitStringEncoder", true, "encoding/asn1", false, function(Bytes_, BitLength_) { this.$val = this; if (arguments.length === 0) { this.Bytes = sliceType.nil; this.BitLength = 0; return; } this.Bytes = Bytes_; this.BitLength = BitLength_; }); oidEncoder = $pkg.oidEncoder = $newType(12, $kindSlice, "asn1.oidEncoder", true, "encoding/asn1", false, null); tagAndLength = $pkg.tagAndLength = $newType(0, $kindStruct, "asn1.tagAndLength", true, "encoding/asn1", false, function(class$0_, tag_, length_, isCompound_) { this.$val = this; if (arguments.length === 0) { this.class$0 = 0; this.tag = 0; this.length = 0; this.isCompound = false; return; } this.class$0 = class$0_; this.tag = tag_; this.length = length_; this.isCompound = isCompound_; }); fieldParameters = $pkg.fieldParameters = $newType(0, $kindStruct, "asn1.fieldParameters", true, "encoding/asn1", false, function(optional_, explicit_, application_, private$3_, defaultValue_, tag_, stringType_, timeType_, set_, omitEmpty_) { this.$val = this; if (arguments.length === 0) { this.optional = false; this.explicit = false; this.application = false; this.private$3 = false; this.defaultValue = ptrType$2.nil; this.tag = ptrType$3.nil; this.stringType = 0; this.timeType = 0; this.set = false; this.omitEmpty = false; return; } this.optional = optional_; this.explicit = explicit_; this.application = application_; this.private$3 = private$3_; this.defaultValue = defaultValue_; this.tag = tag_; this.stringType = stringType_; this.timeType = timeType_; this.set = set_; this.omitEmpty = omitEmpty_; }); StructuralError = $pkg.StructuralError = $newType(0, $kindStruct, "asn1.StructuralError", true, "encoding/asn1", true, function(Msg_) { this.$val = this; if (arguments.length === 0) { this.Msg = ""; return; } this.Msg = Msg_; }); SyntaxError = $pkg.SyntaxError = $newType(0, $kindStruct, "asn1.SyntaxError", true, "encoding/asn1", true, function(Msg_) { this.$val = this; if (arguments.length === 0) { this.Msg = ""; return; } this.Msg = Msg_; }); BitString = $pkg.BitString = $newType(0, $kindStruct, "asn1.BitString", true, "encoding/asn1", true, function(Bytes_, BitLength_) { this.$val = this; if (arguments.length === 0) { this.Bytes = sliceType.nil; this.BitLength = 0; return; } this.Bytes = Bytes_; this.BitLength = BitLength_; }); ObjectIdentifier = $pkg.ObjectIdentifier = $newType(12, $kindSlice, "asn1.ObjectIdentifier", true, "encoding/asn1", true, null); Enumerated = $pkg.Enumerated = $newType(4, $kindInt, "asn1.Enumerated", true, "encoding/asn1", true, null); Flag = $pkg.Flag = $newType(1, $kindBool, "asn1.Flag", true, "encoding/asn1", true, null); RawValue = $pkg.RawValue = $newType(0, $kindStruct, "asn1.RawValue", true, "encoding/asn1", true, function(Class_, Tag_, IsCompound_, Bytes_, FullBytes_) { this.$val = this; if (arguments.length === 0) { this.Class = 0; this.Tag = 0; this.IsCompound = false; this.Bytes = sliceType.nil; this.FullBytes = sliceType.nil; return; } this.Class = Class_; this.Tag = Tag_; this.IsCompound = IsCompound_; this.Bytes = Bytes_; this.FullBytes = FullBytes_; }); RawContent = $pkg.RawContent = $newType(12, $kindSlice, "asn1.RawContent", true, "encoding/asn1", true, null); invalidUnmarshalError = $pkg.invalidUnmarshalError = $newType(0, $kindStruct, "asn1.invalidUnmarshalError", true, "encoding/asn1", false, function(Type_) { this.$val = this; if (arguments.length === 0) { this.Type = $ifaceNil; return; } this.Type = Type_; }); sliceType = $sliceType($Uint8); ptrType = $ptrType(time.Location); sliceType$1 = $sliceType(sliceType); ptrType$1 = $ptrType(big.Int); sliceType$2 = $sliceType(encoder); arrayType = $arrayType($Uint8, 4); sliceType$3 = $sliceType($Int); ptrType$2 = $ptrType($Int64); ptrType$3 = $ptrType($Int); sliceType$4 = $sliceType($emptyInterface); arrayType$1 = $arrayType($Uint8, 8); sliceType$5 = $sliceType($Uint16); ptrType$4 = $ptrType(reflect.rtype); ptrType$5 = $ptrType(RawValue); ptrType$6 = $ptrType(ObjectIdentifier); ptrType$7 = $ptrType(BitString); ptrType$8 = $ptrType(time.Time); ptrType$9 = $ptrType(Enumerated); ptrType$10 = $ptrType(Flag); ptrType$11 = $ptrType(ptrType$1); ptrType$12 = $ptrType(taggedEncoder); ptrType$13 = $ptrType(invalidUnmarshalError); byteEncoder.prototype.Len = function() { var c; c = this.$val; return 1; }; $ptrType(byteEncoder).prototype.Len = function() { return new byteEncoder(this.$get()).Len(); }; byteEncoder.prototype.Encode = function(dst) { var c, dst; c = this.$val; (0 >= dst.$length ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + 0] = ((c << 24 >>> 24))); }; $ptrType(byteEncoder).prototype.Encode = function(dst) { return new byteEncoder(this.$get()).Encode(dst); }; bytesEncoder.prototype.Len = function() { var b; b = this; return b.$length; }; $ptrType(bytesEncoder).prototype.Len = function() { return this.$get().Len(); }; bytesEncoder.prototype.Encode = function(dst) { var b, dst; b = this; if (!(($copySlice(dst, b) === b.$length))) { $panic(new $String("internal error")); } }; $ptrType(bytesEncoder).prototype.Encode = function(dst) { return this.$get().Encode(dst); }; stringEncoder.prototype.Len = function() { var s; s = this.$val; return s.length; }; $ptrType(stringEncoder).prototype.Len = function() { return new stringEncoder(this.$get()).Len(); }; stringEncoder.prototype.Encode = function(dst) { var dst, s; s = this.$val; if (!(($copyString(dst, s) === s.length))) { $panic(new $String("internal error")); } }; $ptrType(stringEncoder).prototype.Encode = function(dst) { return new stringEncoder(this.$get()).Encode(dst); }; multiEncoder.prototype.Len = function() { var _i, _r, _ref, e, m, size, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _ref = $f._ref; e = $f.e; m = $f.m; size = $f.size; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: m = this; size = 0; _ref = m; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } e = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r = e.Len(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } size = size + (_r) >> 0; _i++; $s = 1; continue; case 2: $s = -1; return size; /* */ } return; } if ($f === undefined) { $f = { $blk: multiEncoder.prototype.Len }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f.e = e; $f.m = m; $f.size = size; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(multiEncoder).prototype.Len = function() { return this.$get().Len(); }; multiEncoder.prototype.Encode = function(dst) { var _i, _r, _ref, dst, e, m, off, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _ref = $f._ref; dst = $f.dst; e = $f.e; m = $f.m; off = $f.off; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: m = this; off = 0; _ref = m; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } e = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); $r = e.Encode($subslice(dst, off)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r = e.Len(); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } off = off + (_r) >> 0; _i++; $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: multiEncoder.prototype.Encode }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f.dst = dst; $f.e = e; $f.m = m; $f.off = off; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(multiEncoder).prototype.Encode = function(dst) { return this.$get().Encode(dst); }; setEncoder.prototype.Len = function() { var _i, _r, _ref, e, s, size, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _ref = $f._ref; e = $f.e; s = $f.s; size = $f.size; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; size = 0; _ref = s; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } e = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r = e.Len(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } size = size + (_r) >> 0; _i++; $s = 1; continue; case 2: $s = -1; return size; /* */ } return; } if ($f === undefined) { $f = { $blk: setEncoder.prototype.Len }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f.e = e; $f.s = s; $f.size = size; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(setEncoder).prototype.Len = function() { return this.$get().Len(); }; setEncoder.prototype.Encode = function(dst) { var _i, _i$1, _r, _ref, _ref$1, b, dst, e, i, l, off, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _ref = $f._ref; _ref$1 = $f._ref$1; b = $f.b; dst = $f.dst; e = $f.e; i = $f.i; l = $f.l; off = $f.off; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: l = [l]; s = this; l[0] = $makeSlice(sliceType$1, s.$length); _ref = s; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } i = _i; e = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r = e.Len(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } ((i < 0 || i >= l[0].$length) ? ($throwRuntimeError("index out of range"), undefined) : l[0].$array[l[0].$offset + i] = $makeSlice(sliceType, _r)); $r = e.Encode(((i < 0 || i >= l[0].$length) ? ($throwRuntimeError("index out of range"), undefined) : l[0].$array[l[0].$offset + i])); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i++; $s = 1; continue; case 2: $r = sort.Slice(l[0], (function(l) { return function(i$1, j) { var i$1, j; return bytes.Compare(((i$1 < 0 || i$1 >= l[0].$length) ? ($throwRuntimeError("index out of range"), undefined) : l[0].$array[l[0].$offset + i$1]), ((j < 0 || j >= l[0].$length) ? ($throwRuntimeError("index out of range"), undefined) : l[0].$array[l[0].$offset + j])) < 0; }; })(l)); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } off = 0; _ref$1 = l[0]; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } b = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); $copySlice($subslice(dst, off), b); off = off + (b.$length) >> 0; _i$1++; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: setEncoder.prototype.Encode }; } $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._ref = _ref; $f._ref$1 = _ref$1; $f.b = b; $f.dst = dst; $f.e = e; $f.i = i; $f.l = l; $f.off = off; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(setEncoder).prototype.Encode = function(dst) { return this.$get().Encode(dst); }; taggedEncoder.ptr.prototype.Len = function() { var $24r, _r, _r$1, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r = t.tag.Len(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = t.body.Len(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r + _r$1 >> 0; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: taggedEncoder.ptr.prototype.Len }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; taggedEncoder.prototype.Len = function() { return this.$val.Len(); }; taggedEncoder.ptr.prototype.Encode = function(dst) { var _r, dst, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; dst = $f.dst; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; $r = t.tag.Encode(dst); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r = t.tag.Len(); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $r = t.body.Encode($subslice(dst, _r)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: taggedEncoder.ptr.prototype.Encode }; } $f._r = _r; $f.dst = dst; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; taggedEncoder.prototype.Encode = function(dst) { return this.$val.Encode(dst); }; int64Encoder.prototype.Len = function() { var i, n; i = this; n = 1; while (true) { if (!((i.$high > 0 || (i.$high === 0 && i.$low > 127)))) { break; } n = n + (1) >> 0; i = $shiftRightInt64(i, (8)); } while (true) { if (!((i.$high < -1 || (i.$high === -1 && i.$low < 4294967168)))) { break; } n = n + (1) >> 0; i = $shiftRightInt64(i, (8)); } return n; }; $ptrType(int64Encoder).prototype.Len = function() { return this.$get().Len(); }; int64Encoder.prototype.Encode = function(dst) { var dst, i, j, n; i = this; n = i.Len(); j = 0; while (true) { if (!(j < n)) { break; } ((j < 0 || j >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + j] = (($shiftRightInt64(i, ((($imul((((n - 1 >> 0) - j >> 0)), 8)) >>> 0))).$low << 24 >>> 24))); j = j + (1) >> 0; } }; $ptrType(int64Encoder).prototype.Encode = function(dst) { return this.$get().Encode(dst); }; base128IntLength = function(n) { var i, l, n; if ((n.$high === 0 && n.$low === 0)) { return 1; } l = 0; i = n; while (true) { if (!((i.$high > 0 || (i.$high === 0 && i.$low > 0)))) { break; } l = l + (1) >> 0; i = $shiftRightInt64(i, (7)); } return l; }; appendBase128Int = function(dst, n) { var dst, i, l, n, o; l = base128IntLength(n); i = l - 1 >> 0; while (true) { if (!(i >= 0)) { break; } o = (($shiftRightInt64(n, ((($imul(i, 7)) >>> 0))).$low << 24 >>> 24)); o = (o & (127)) >>> 0; if (!((i === 0))) { o = (o | (128)) >>> 0; } dst = $append(dst, o); i = i - (1) >> 0; } return dst; }; makeBigInt = function(n) { var _i, _r, _ref, bytes$1, bytes$2, i, n, nMinus1, x$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _ref = $f._ref; bytes$1 = $f.bytes$1; bytes$2 = $f.bytes$2; i = $f.i; n = $f.n; nMinus1 = $f.nMinus1; x$3 = $f.x$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (n === ptrType$1.nil) { $s = -1; return [$ifaceNil, (x$3 = new StructuralError.ptr("empty integer"), new x$3.constructor.elem(x$3))]; } /* */ if (n.Sign() < 0) { $s = 1; continue; } /* */ if (n.Sign() === 0) { $s = 2; continue; } /* */ $s = 3; continue; /* if (n.Sign() < 0) { */ case 1: nMinus1 = new big.Int.ptr(false, big.nat.nil).Neg(n); _r = nMinus1.Sub(nMinus1, bigOne); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; bytes$1 = nMinus1.Bytes(); _ref = bytes$1; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; ((i < 0 || i >= bytes$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : bytes$1.$array[bytes$1.$offset + i] = ((((i < 0 || i >= bytes$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : bytes$1.$array[bytes$1.$offset + i]) ^ (255)) << 24 >>> 24)); _i++; } if ((bytes$1.$length === 0) || ((((0 >= bytes$1.$length ? ($throwRuntimeError("index out of range"), undefined) : bytes$1.$array[bytes$1.$offset + 0]) & 128) >>> 0) === 0)) { $s = -1; return [($convertSliceType(new sliceType$2([byteFFEncoder, ($convertSliceType(bytes$1, bytesEncoder))]), multiEncoder)), $ifaceNil]; } $s = -1; return [($convertSliceType(bytes$1, bytesEncoder)), $ifaceNil]; /* } else if (n.Sign() === 0) { */ case 2: $s = -1; return [byte00Encoder, $ifaceNil]; /* } else { */ case 3: bytes$2 = n.Bytes(); if (bytes$2.$length > 0 && !(((((0 >= bytes$2.$length ? ($throwRuntimeError("index out of range"), undefined) : bytes$2.$array[bytes$2.$offset + 0]) & 128) >>> 0) === 0))) { $s = -1; return [($convertSliceType(new sliceType$2([byte00Encoder, ($convertSliceType(bytes$2, bytesEncoder))]), multiEncoder)), $ifaceNil]; } $s = -1; return [($convertSliceType(bytes$2, bytesEncoder)), $ifaceNil]; /* } */ case 4: $s = -1; return [$ifaceNil, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: makeBigInt }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f.bytes$1 = bytes$1; $f.bytes$2 = bytes$2; $f.i = i; $f.n = n; $f.nMinus1 = nMinus1; $f.x$3 = x$3; $f.$s = $s; $f.$r = $r; return $f; }; appendLength = function(dst, i) { var dst, i, n; n = lengthLength(i); while (true) { if (!(n > 0)) { break; } dst = $append(dst, ((((i >> $min(((($imul(((n - 1 >> 0)), 8)) >>> 0)), 31)) >> 0) << 24 >>> 24))); n = n - (1) >> 0; } return dst; }; lengthLength = function(i) { var i, numBytes; numBytes = 0; numBytes = 1; while (true) { if (!(i > 255)) { break; } numBytes = numBytes + (1) >> 0; i = (i >> $min((8), 31)) >> 0; } return numBytes; }; appendTagAndLength = function(dst, t) { var b, dst, l, t; b = ((t.class$0 << 24 >>> 24)) << 6 << 24 >>> 24; if (t.isCompound) { b = (b | (32)) >>> 0; } if (t.tag >= 31) { b = (b | (31)) >>> 0; dst = $append(dst, b); dst = appendBase128Int(dst, (new $Int64(0, t.tag))); } else { b = (b | (((t.tag << 24 >>> 24)))) >>> 0; dst = $append(dst, b); } if (t.length >= 128) { l = lengthLength(t.length); dst = $append(dst, (128 | ((l << 24 >>> 24))) >>> 0); dst = appendLength(dst, t.length); } else { dst = $append(dst, ((t.length << 24 >>> 24))); } return dst; }; bitStringEncoder.ptr.prototype.Len = function() { var b; b = this; return b.Bytes.$length + 1 >> 0; }; bitStringEncoder.prototype.Len = function() { return this.$val.Len(); }; bitStringEncoder.ptr.prototype.Encode = function(dst) { var _r, _r$1, b, dst; b = this; (0 >= dst.$length ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + 0] = (((_r = ((8 - (_r$1 = b.BitLength % 8, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) >> 0)) % 8, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) << 24 >>> 24))); if (!(($copySlice($subslice(dst, 1), b.Bytes) === b.Bytes.$length))) { $panic(new $String("internal error")); } }; bitStringEncoder.prototype.Encode = function(dst) { return this.$val.Encode(dst); }; oidEncoder.prototype.Len = function() { var i, l, oid; oid = this; l = base128IntLength((new $Int64(0, (($imul((0 >= oid.$length ? ($throwRuntimeError("index out of range"), undefined) : oid.$array[oid.$offset + 0]), 40)) + (1 >= oid.$length ? ($throwRuntimeError("index out of range"), undefined) : oid.$array[oid.$offset + 1]) >> 0)))); i = 2; while (true) { if (!(i < oid.$length)) { break; } l = l + (base128IntLength((new $Int64(0, ((i < 0 || i >= oid.$length) ? ($throwRuntimeError("index out of range"), undefined) : oid.$array[oid.$offset + i]))))) >> 0; i = i + (1) >> 0; } return l; }; $ptrType(oidEncoder).prototype.Len = function() { return this.$get().Len(); }; oidEncoder.prototype.Encode = function(dst) { var dst, i, oid; oid = this; dst = appendBase128Int($subslice(dst, 0, 0), (new $Int64(0, (($imul((0 >= oid.$length ? ($throwRuntimeError("index out of range"), undefined) : oid.$array[oid.$offset + 0]), 40)) + (1 >= oid.$length ? ($throwRuntimeError("index out of range"), undefined) : oid.$array[oid.$offset + 1]) >> 0)))); i = 2; while (true) { if (!(i < oid.$length)) { break; } dst = appendBase128Int(dst, (new $Int64(0, ((i < 0 || i >= oid.$length) ? ($throwRuntimeError("index out of range"), undefined) : oid.$array[oid.$offset + i])))); i = i + (1) >> 0; } }; $ptrType(oidEncoder).prototype.Encode = function(dst) { return this.$get().Encode(dst); }; makeObjectIdentifier = function(oid) { var _tmp, _tmp$1, _tmp$2, _tmp$3, e, err, oid, x$3; e = $ifaceNil; err = $ifaceNil; if (oid.$length < 2 || (0 >= oid.$length ? ($throwRuntimeError("index out of range"), undefined) : oid.$array[oid.$offset + 0]) > 2 || ((0 >= oid.$length ? ($throwRuntimeError("index out of range"), undefined) : oid.$array[oid.$offset + 0]) < 2 && (1 >= oid.$length ? ($throwRuntimeError("index out of range"), undefined) : oid.$array[oid.$offset + 1]) >= 40)) { _tmp = $ifaceNil; _tmp$1 = (x$3 = new StructuralError.ptr("invalid object identifier"), new x$3.constructor.elem(x$3)); e = _tmp; err = _tmp$1; return [e, err]; } _tmp$2 = ($convertSliceType(oid, oidEncoder)); _tmp$3 = $ifaceNil; e = _tmp$2; err = _tmp$3; return [e, err]; }; makePrintableString = function(s) { var _tmp, _tmp$1, _tmp$2, _tmp$3, e, err, i, s, x$3; e = $ifaceNil; err = $ifaceNil; i = 0; while (true) { if (!(i < s.length)) { break; } if (!isPrintable(s.charCodeAt(i), true, false)) { _tmp = $ifaceNil; _tmp$1 = (x$3 = new StructuralError.ptr("PrintableString contains invalid character"), new x$3.constructor.elem(x$3)); e = _tmp; err = _tmp$1; return [e, err]; } i = i + (1) >> 0; } _tmp$2 = new stringEncoder((s)); _tmp$3 = $ifaceNil; e = _tmp$2; err = _tmp$3; return [e, err]; }; makeIA5String = function(s) { var _tmp, _tmp$1, _tmp$2, _tmp$3, e, err, i, s, x$3; e = $ifaceNil; err = $ifaceNil; i = 0; while (true) { if (!(i < s.length)) { break; } if (s.charCodeAt(i) > 127) { _tmp = $ifaceNil; _tmp$1 = (x$3 = new StructuralError.ptr("IA5String contains invalid character"), new x$3.constructor.elem(x$3)); e = _tmp; err = _tmp$1; return [e, err]; } i = i + (1) >> 0; } _tmp$2 = new stringEncoder((s)); _tmp$3 = $ifaceNil; e = _tmp$2; err = _tmp$3; return [e, err]; }; makeNumericString = function(s) { var _tmp, _tmp$1, _tmp$2, _tmp$3, e, err, i, s, x$3; e = $ifaceNil; err = $ifaceNil; i = 0; while (true) { if (!(i < s.length)) { break; } if (!isNumeric(s.charCodeAt(i))) { _tmp = $ifaceNil; _tmp$1 = (x$3 = new StructuralError.ptr("NumericString contains invalid character"), new x$3.constructor.elem(x$3)); e = _tmp; err = _tmp$1; return [e, err]; } i = i + (1) >> 0; } _tmp$2 = new stringEncoder((s)); _tmp$3 = $ifaceNil; e = _tmp$2; err = _tmp$3; return [e, err]; }; makeUTF8String = function(s) { var s; return new stringEncoder((s)); }; appendTwoDigits = function(dst, v) { var _q, _r, _r$1, dst, v; return $append(dst, (((48 + (_r = ((_q = v / 10, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))) % 10, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) >> 0) << 24 >>> 24)), (((48 + (_r$1 = v % 10, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) >> 0) << 24 >>> 24))); }; appendFourDigits = function(dst, v) { var _i, _q, _r, _ref, bytes$1, dst, i, v, x$3; bytes$1 = arrayType.zero(); _ref = bytes$1; _i = 0; while (true) { if (!(_i < 4)) { break; } i = _i; (x$3 = 3 - i >> 0, ((x$3 < 0 || x$3 >= bytes$1.length) ? ($throwRuntimeError("index out of range"), undefined) : bytes$1[x$3] = (48 + (((_r = v % 10, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) << 24 >>> 24)) << 24 >>> 24))); v = (_q = v / (10), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); _i++; } return $appendSlice(dst, new sliceType(bytes$1)); }; outsideUTCRange = function(t) { var _r, t, year, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; year = $f.year; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = $clone(t, time.Time).Year(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } year = _r; $s = -1; return year < 1950 || year >= 2050; /* */ } return; } if ($f === undefined) { $f = { $blk: outsideUTCRange }; } $f._r = _r; $f.t = t; $f.year = year; $f.$s = $s; $f.$r = $r; return $f; }; makeUTCTime = function(t) { var _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, dst, e, err, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; dst = $f.dst; e = $f.e; err = $f.err; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = $ifaceNil; err = $ifaceNil; dst = $makeSlice(sliceType, 0, 18); _r = appendUTCTime(dst, $clone(t, time.Time)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; dst = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp = $ifaceNil; _tmp$1 = err; e = _tmp; err = _tmp$1; $s = -1; return [e, err]; } _tmp$2 = ($convertSliceType(dst, bytesEncoder)); _tmp$3 = $ifaceNil; e = _tmp$2; err = _tmp$3; $s = -1; return [e, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: makeUTCTime }; } $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.dst = dst; $f.e = e; $f.err = err; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; makeGeneralizedTime = function(t) { var _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, dst, e, err, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; dst = $f.dst; e = $f.e; err = $f.err; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = $ifaceNil; err = $ifaceNil; dst = $makeSlice(sliceType, 0, 20); _r = appendGeneralizedTime(dst, $clone(t, time.Time)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; dst = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp = $ifaceNil; _tmp$1 = err; e = _tmp; err = _tmp$1; $s = -1; return [e, err]; } _tmp$2 = ($convertSliceType(dst, bytesEncoder)); _tmp$3 = $ifaceNil; e = _tmp$2; err = _tmp$3; $s = -1; return [e, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: makeGeneralizedTime }; } $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.dst = dst; $f.e = e; $f.err = err; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; appendUTCTime = function(dst, t) { var $24r, _r, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, dst, err, ret, t, x$3, year, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; dst = $f.dst; err = $f.err; ret = $f.ret; t = $f.t; x$3 = $f.x$3; year = $f.year; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ret = sliceType.nil; err = $ifaceNil; _r = $clone(t, time.Time).Year(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } year = _r; if (1950 <= year && year < 2000) { dst = appendTwoDigits(dst, year - 1900 >> 0); } else if (2000 <= year && year < 2050) { dst = appendTwoDigits(dst, year - 2000 >> 0); } else { _tmp = sliceType.nil; _tmp$1 = (x$3 = new StructuralError.ptr("cannot represent time as UTCTime"), new x$3.constructor.elem(x$3)); ret = _tmp; err = _tmp$1; $s = -1; return [ret, err]; } _r$1 = appendTimeCommon(dst, $clone(t, time.Time)); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tmp$2 = _r$1; _tmp$3 = $ifaceNil; ret = _tmp$2; err = _tmp$3; $24r = [ret, err]; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: appendUTCTime }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f.dst = dst; $f.err = err; $f.ret = ret; $f.t = t; $f.x$3 = x$3; $f.year = year; $f.$s = $s; $f.$r = $r; return $f; }; appendGeneralizedTime = function(dst, t) { var $24r, _r, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, dst, err, ret, t, x$3, year, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; dst = $f.dst; err = $f.err; ret = $f.ret; t = $f.t; x$3 = $f.x$3; year = $f.year; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ret = sliceType.nil; err = $ifaceNil; _r = $clone(t, time.Time).Year(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } year = _r; if (year < 0 || year > 9999) { _tmp = sliceType.nil; _tmp$1 = (x$3 = new StructuralError.ptr("cannot represent time as GeneralizedTime"), new x$3.constructor.elem(x$3)); ret = _tmp; err = _tmp$1; $s = -1; return [ret, err]; } dst = appendFourDigits(dst, year); _r$1 = appendTimeCommon(dst, $clone(t, time.Time)); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tmp$2 = _r$1; _tmp$3 = $ifaceNil; ret = _tmp$2; err = _tmp$3; $24r = [ret, err]; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: appendGeneralizedTime }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f.dst = dst; $f.err = err; $f.ret = ret; $f.t = t; $f.x$3 = x$3; $f.year = year; $f.$s = $s; $f.$r = $r; return $f; }; appendTimeCommon = function(dst, t) { var _q, _q$1, _q$2, _r, _r$1, _r$2, _r$3, _tuple, _tuple$1, _tuple$2, day, dst, hour, min, month, offset, offsetMinutes, sec, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; day = $f.day; dst = $f.dst; hour = $f.hour; min = $f.min; month = $f.month; offset = $f.offset; offsetMinutes = $f.offsetMinutes; sec = $f.sec; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = $clone(t, time.Time).Date(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; month = _tuple[1]; day = _tuple[2]; dst = appendTwoDigits(dst, ((month >> 0))); dst = appendTwoDigits(dst, day); _r$1 = $clone(t, time.Time).Clock(); /* */ $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; hour = _tuple$1[0]; min = _tuple$1[1]; sec = _tuple$1[2]; dst = appendTwoDigits(dst, hour); dst = appendTwoDigits(dst, min); dst = appendTwoDigits(dst, sec); _r$2 = $clone(t, time.Time).Zone(); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$2 = _r$2; offset = _tuple$2[1]; if (((_q = offset / 60, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) === 0)) { $s = -1; return $append(dst, 90); } else if (offset > 0) { dst = $append(dst, 43); } else if (offset < 0) { dst = $append(dst, 45); } offsetMinutes = (_q$1 = offset / 60, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")); if (offsetMinutes < 0) { offsetMinutes = -offsetMinutes; } dst = appendTwoDigits(dst, (_q$2 = offsetMinutes / 60, (_q$2 === _q$2 && _q$2 !== 1/0 && _q$2 !== -1/0) ? _q$2 >> 0 : $throwRuntimeError("integer divide by zero"))); dst = appendTwoDigits(dst, (_r$3 = offsetMinutes % 60, _r$3 === _r$3 ? _r$3 : $throwRuntimeError("integer divide by zero"))); $s = -1; return dst; /* */ } return; } if ($f === undefined) { $f = { $blk: appendTimeCommon }; } $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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.day = day; $f.dst = dst; $f.hour = hour; $f.min = min; $f.month = month; $f.offset = offset; $f.offsetMinutes = offsetMinutes; $f.sec = sec; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; stripTagAndLength = function(in$1) { var _tuple, err, in$1, offset; _tuple = parseTagAndLength(in$1, 0); offset = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return in$1; } return $subslice(in$1, offset); }; makeBody = function(value, params) { var $24r, $24r$1, $24r$10, $24r$11, $24r$2, $24r$3, $24r$4, $24r$5, $24r$6, $24r$7, $24r$8, $24r$9, _1, _2, _3, _4, _5, _arg, _arg$1, _arg$2, _arg$3, _r, _r$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$36, _r$37, _r$38, _r$39, _r$4, _r$40, _r$5, _r$6, _r$7, _r$8, _r$9, _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$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$10, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, _tuple$8, _tuple$9, _v, bytes$1, e, err, fp, i, i$1, i$2, l, m, m$1, n, n1, params, s, sliceType$4, startingField, t, t$1, v, value, x$3, x$4, x$5, x$6, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$10 = $f.$24r$10; $24r$11 = $f.$24r$11; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; $24r$6 = $f.$24r$6; $24r$7 = $f.$24r$7; $24r$8 = $f.$24r$8; $24r$9 = $f.$24r$9; _1 = $f._1; _2 = $f._2; _3 = $f._3; _4 = $f._4; _5 = $f._5; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _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$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$36 = $f._r$36; _r$37 = $f._r$37; _r$38 = $f._r$38; _r$39 = $f._r$39; _r$4 = $f._r$4; _r$40 = $f._r$40; _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$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$4 = $f._tmp$4; _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 = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$10 = $f._tuple$10; _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; _tuple$9 = $f._tuple$9; _v = $f._v; bytes$1 = $f.bytes$1; e = $f.e; err = $f.err; fp = $f.fp; i = $f.i; i$1 = $f.i$1; i$2 = $f.i$2; l = $f.l; m = $f.m; m$1 = $f.m$1; n = $f.n; n1 = $f.n1; params = $f.params; s = $f.s; sliceType$4 = $f.sliceType$4; startingField = $f.startingField; t = $f.t; t$1 = $f.t$1; v = $f.v; value = $f.value; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; x$6 = $f.x$6; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = $ifaceNil; err = $ifaceNil; _1 = $clone(value, reflect.Value).Type(); /* */ if ($interfaceIsEqual(_1, (flagType))) { $s = 2; continue; } /* */ if ($interfaceIsEqual(_1, (timeType))) { $s = 3; continue; } /* */ if ($interfaceIsEqual(_1, (bitStringType))) { $s = 4; continue; } /* */ if ($interfaceIsEqual(_1, (objectIdentifierType))) { $s = 5; continue; } /* */ if ($interfaceIsEqual(_1, (bigIntType))) { $s = 6; continue; } /* */ $s = 7; continue; /* if ($interfaceIsEqual(_1, (flagType))) { */ case 2: _tmp = (bytesEncoder.nil); _tmp$1 = $ifaceNil; e = _tmp; err = _tmp$1; $s = -1; return [e, err]; /* } else if ($interfaceIsEqual(_1, (timeType))) { */ case 3: _r = $clone(value, reflect.Value).Interface(); /* */ $s = 8; case 8: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } t = $clone($assertType(_r, time.Time), time.Time); if (params.timeType === 24) { _v = true; $s = 11; continue s; } _r$1 = outsideUTCRange($clone(t, time.Time)); /* */ $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: /* */ if (_v) { $s = 9; continue; } /* */ $s = 10; continue; /* if (_v) { */ case 9: _r$2 = makeGeneralizedTime($clone(t, time.Time)); /* */ $s = 13; case 13: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; e = _tuple[0]; err = _tuple[1]; $24r = [e, err]; $s = 14; case 14: return $24r; /* } */ case 10: _r$3 = makeUTCTime($clone(t, time.Time)); /* */ $s = 15; case 15: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$1 = _r$3; e = _tuple$1[0]; err = _tuple$1[1]; $24r$1 = [e, err]; $s = 16; case 16: return $24r$1; /* } else if ($interfaceIsEqual(_1, (bitStringType))) { */ case 4: _r$4 = $clone(value, reflect.Value).Interface(); /* */ $s = 17; case 17: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tmp$2 = (x$3 = ($clone($assertType(_r$4, BitString), bitStringEncoder)), new x$3.constructor.elem(x$3)); _tmp$3 = $ifaceNil; e = _tmp$2; err = _tmp$3; $24r$2 = [e, err]; $s = 18; case 18: return $24r$2; /* } else if ($interfaceIsEqual(_1, (objectIdentifierType))) { */ case 5: _r$5 = $clone(value, reflect.Value).Interface(); /* */ $s = 19; case 19: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$6 = makeObjectIdentifier($convertSliceType($assertType(_r$5, ObjectIdentifier), sliceType$3)); /* */ $s = 20; case 20: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tuple$2 = _r$6; e = _tuple$2[0]; err = _tuple$2[1]; $24r$3 = [e, err]; $s = 21; case 21: return $24r$3; /* } else if ($interfaceIsEqual(_1, (bigIntType))) { */ case 6: _r$7 = $clone(value, reflect.Value).Interface(); /* */ $s = 22; case 22: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$8 = makeBigInt($assertType(_r$7, ptrType$1)); /* */ $s = 23; case 23: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _tuple$3 = _r$8; e = _tuple$3[0]; err = _tuple$3[1]; $24r$4 = [e, err]; $s = 24; case 24: return $24r$4; /* } */ case 7: case 1: v = value; _2 = $clone(v, reflect.Value).Kind(); /* */ if (_2 === (1)) { $s = 26; continue; } /* */ if ((_2 === (2)) || (_2 === (3)) || (_2 === (4)) || (_2 === (5)) || (_2 === (6))) { $s = 27; continue; } /* */ if (_2 === (25)) { $s = 28; continue; } /* */ if (_2 === (23)) { $s = 29; continue; } /* */ if (_2 === (24)) { $s = 30; continue; } /* */ $s = 31; continue; /* if (_2 === (1)) { */ case 26: if ($clone(v, reflect.Value).Bool()) { _tmp$4 = byteFFEncoder; _tmp$5 = $ifaceNil; e = _tmp$4; err = _tmp$5; $s = -1; return [e, err]; } _tmp$6 = byte00Encoder; _tmp$7 = $ifaceNil; e = _tmp$6; err = _tmp$7; $s = -1; return [e, err]; /* } else if ((_2 === (2)) || (_2 === (3)) || (_2 === (4)) || (_2 === (5)) || (_2 === (6))) { */ case 27: _tmp$8 = ((x$4 = $clone(v, reflect.Value).Int(), new int64Encoder(x$4.$high, x$4.$low))); _tmp$9 = $ifaceNil; e = _tmp$8; err = _tmp$9; $s = -1; return [e, err]; /* } else if (_2 === (25)) { */ case 28: t$1 = $clone(v, reflect.Value).Type(); i = 0; /* while (true) { */ case 32: _r$9 = t$1.NumField(); /* */ $s = 34; case 34: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } /* if (!(i < _r$9)) { break; } */ if(!(i < _r$9)) { $s = 33; continue; } _r$10 = t$1.Field(i); /* */ $s = 37; case 37: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$11 = $clone(_r$10, reflect.StructField).IsExported(); /* */ $s = 38; case 38: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } /* */ if (!_r$11) { $s = 35; continue; } /* */ $s = 36; continue; /* if (!_r$11) { */ case 35: _tmp$10 = $ifaceNil; _tmp$11 = (x$5 = new StructuralError.ptr("struct contains unexported fields"), new x$5.constructor.elem(x$5)); e = _tmp$10; err = _tmp$11; $s = -1; return [e, err]; /* } */ case 36: i = i + (1) >> 0; $s = 32; continue; case 33: startingField = 0; _r$12 = t$1.NumField(); /* */ $s = 39; case 39: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } n = _r$12; if (n === 0) { _tmp$12 = (bytesEncoder.nil); _tmp$13 = $ifaceNil; e = _tmp$12; err = _tmp$13; $s = -1; return [e, err]; } _r$13 = t$1.Field(0); /* */ $s = 42; case 42: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } /* */ if ($interfaceIsEqual(_r$13.Type, rawContentsType)) { $s = 40; continue; } /* */ $s = 41; continue; /* if ($interfaceIsEqual(_r$13.Type, rawContentsType)) { */ case 40: _r$14 = $clone(v, reflect.Value).Field(0); /* */ $s = 43; case 43: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } s = _r$14; /* */ if ($clone(s, reflect.Value).Len() > 0) { $s = 44; continue; } /* */ $s = 45; continue; /* if ($clone(s, reflect.Value).Len() > 0) { */ case 44: _r$15 = $clone(s, reflect.Value).Bytes(); /* */ $s = 46; case 46: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } bytes$1 = _r$15; _tmp$14 = ($convertSliceType(stripTagAndLength(bytes$1), bytesEncoder)); _tmp$15 = $ifaceNil; e = _tmp$14; err = _tmp$15; $s = -1; return [e, err]; /* } */ case 45: startingField = 1; /* } */ case 41: n1 = n - startingField >> 0; _3 = n1; /* */ if (_3 === (0)) { $s = 48; continue; } /* */ if (_3 === (1)) { $s = 49; continue; } /* */ $s = 50; continue; /* if (_3 === (0)) { */ case 48: _tmp$16 = (bytesEncoder.nil); _tmp$17 = $ifaceNil; e = _tmp$16; err = _tmp$17; $s = -1; return [e, err]; /* } else if (_3 === (1)) { */ case 49: _r$16 = $clone(v, reflect.Value).Field(startingField); /* */ $s = 52; case 52: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _arg = $clone(_r$16, reflect.Value); _r$17 = t$1.Field(startingField); /* */ $s = 53; case 53: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } _r$18 = new reflect.StructTag(_r$17.Tag).Get("asn1"); /* */ $s = 54; case 54: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } _r$19 = parseFieldParameters(_r$18); /* */ $s = 55; case 55: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } _arg$1 = $clone(_r$19, fieldParameters); _r$20 = makeField(_arg, _arg$1); /* */ $s = 56; case 56: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } _tuple$4 = _r$20; e = _tuple$4[0]; err = _tuple$4[1]; $24r$5 = [e, err]; $s = 57; case 57: return $24r$5; /* } else { */ case 50: m = $makeSlice(sliceType$2, n1); i$1 = 0; /* while (true) { */ case 58: /* if (!(i$1 < n1)) { break; } */ if(!(i$1 < n1)) { $s = 59; continue; } _r$21 = $clone(v, reflect.Value).Field(i$1 + startingField >> 0); /* */ $s = 60; case 60: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } _arg$2 = $clone(_r$21, reflect.Value); _r$22 = t$1.Field(i$1 + startingField >> 0); /* */ $s = 61; case 61: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; } _r$23 = new reflect.StructTag(_r$22.Tag).Get("asn1"); /* */ $s = 62; case 62: if($c) { $c = false; _r$23 = _r$23.$blk(); } if (_r$23 && _r$23.$blk !== undefined) { break s; } _r$24 = parseFieldParameters(_r$23); /* */ $s = 63; case 63: if($c) { $c = false; _r$24 = _r$24.$blk(); } if (_r$24 && _r$24.$blk !== undefined) { break s; } _arg$3 = $clone(_r$24, fieldParameters); _r$25 = makeField(_arg$2, _arg$3); /* */ $s = 64; case 64: if($c) { $c = false; _r$25 = _r$25.$blk(); } if (_r$25 && _r$25.$blk !== undefined) { break s; } _tuple$5 = _r$25; ((i$1 < 0 || i$1 >= m.$length) ? ($throwRuntimeError("index out of range"), undefined) : m.$array[m.$offset + i$1] = _tuple$5[0]); err = _tuple$5[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$18 = $ifaceNil; _tmp$19 = err; e = _tmp$18; err = _tmp$19; $s = -1; return [e, err]; } i$1 = i$1 + (1) >> 0; $s = 58; continue; case 59: _tmp$20 = ($convertSliceType(m, multiEncoder)); _tmp$21 = $ifaceNil; e = _tmp$20; err = _tmp$21; $s = -1; return [e, err]; /* } */ case 51: case 47: $s = 31; continue; /* } else if (_2 === (23)) { */ case 29: sliceType$4 = $clone(v, reflect.Value).Type(); _r$26 = sliceType$4.Elem(); /* */ $s = 67; case 67: if($c) { $c = false; _r$26 = _r$26.$blk(); } if (_r$26 && _r$26.$blk !== undefined) { break s; } _r$27 = _r$26.Kind(); /* */ $s = 68; case 68: if($c) { $c = false; _r$27 = _r$27.$blk(); } if (_r$27 && _r$27.$blk !== undefined) { break s; } /* */ if (_r$27 === 8) { $s = 65; continue; } /* */ $s = 66; continue; /* if (_r$27 === 8) { */ case 65: _r$28 = $clone(v, reflect.Value).Bytes(); /* */ $s = 69; case 69: if($c) { $c = false; _r$28 = _r$28.$blk(); } if (_r$28 && _r$28.$blk !== undefined) { break s; } _tmp$22 = ($convertSliceType(_r$28, bytesEncoder)); _tmp$23 = $ifaceNil; e = _tmp$22; err = _tmp$23; $24r$6 = [e, err]; $s = 70; case 70: return $24r$6; /* } */ case 66: fp = new fieldParameters.ptr(false, false, false, false, ptrType$2.nil, ptrType$3.nil, 0, 0, false, false); l = $clone(v, reflect.Value).Len(); _4 = l; /* */ if (_4 === (0)) { $s = 72; continue; } /* */ if (_4 === (1)) { $s = 73; continue; } /* */ $s = 74; continue; /* if (_4 === (0)) { */ case 72: _tmp$24 = (bytesEncoder.nil); _tmp$25 = $ifaceNil; e = _tmp$24; err = _tmp$25; $s = -1; return [e, err]; /* } else if (_4 === (1)) { */ case 73: _r$29 = $clone(v, reflect.Value).Index(0); /* */ $s = 76; case 76: if($c) { $c = false; _r$29 = _r$29.$blk(); } if (_r$29 && _r$29.$blk !== undefined) { break s; } _r$30 = makeField($clone(_r$29, reflect.Value), $clone(fp, fieldParameters)); /* */ $s = 77; case 77: if($c) { $c = false; _r$30 = _r$30.$blk(); } if (_r$30 && _r$30.$blk !== undefined) { break s; } _tuple$6 = _r$30; e = _tuple$6[0]; err = _tuple$6[1]; $24r$7 = [e, err]; $s = 78; case 78: return $24r$7; /* } else { */ case 74: m$1 = $makeSlice(sliceType$2, l); i$2 = 0; /* while (true) { */ case 79: /* if (!(i$2 < l)) { break; } */ if(!(i$2 < l)) { $s = 80; continue; } _r$31 = $clone(v, reflect.Value).Index(i$2); /* */ $s = 81; case 81: if($c) { $c = false; _r$31 = _r$31.$blk(); } if (_r$31 && _r$31.$blk !== undefined) { break s; } _r$32 = makeField($clone(_r$31, reflect.Value), $clone(fp, fieldParameters)); /* */ $s = 82; case 82: if($c) { $c = false; _r$32 = _r$32.$blk(); } if (_r$32 && _r$32.$blk !== undefined) { break s; } _tuple$7 = _r$32; ((i$2 < 0 || i$2 >= m$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : m$1.$array[m$1.$offset + i$2] = _tuple$7[0]); err = _tuple$7[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$26 = $ifaceNil; _tmp$27 = err; e = _tmp$26; err = _tmp$27; $s = -1; return [e, err]; } i$2 = i$2 + (1) >> 0; $s = 79; continue; case 80: if (params.set) { _tmp$28 = ($convertSliceType(m$1, setEncoder)); _tmp$29 = $ifaceNil; e = _tmp$28; err = _tmp$29; $s = -1; return [e, err]; } _tmp$30 = ($convertSliceType(m$1, multiEncoder)); _tmp$31 = $ifaceNil; e = _tmp$30; err = _tmp$31; $s = -1; return [e, err]; /* } */ case 75: case 71: $s = 31; continue; /* } else if (_2 === (24)) { */ case 30: _5 = params.stringType; /* */ if (_5 === (22)) { $s = 84; continue; } /* */ if (_5 === (19)) { $s = 85; continue; } /* */ if (_5 === (18)) { $s = 86; continue; } /* */ $s = 87; continue; /* if (_5 === (22)) { */ case 84: _r$33 = $clone(v, reflect.Value).String(); /* */ $s = 89; case 89: if($c) { $c = false; _r$33 = _r$33.$blk(); } if (_r$33 && _r$33.$blk !== undefined) { break s; } _r$34 = makeIA5String(_r$33); /* */ $s = 90; case 90: if($c) { $c = false; _r$34 = _r$34.$blk(); } if (_r$34 && _r$34.$blk !== undefined) { break s; } _tuple$8 = _r$34; e = _tuple$8[0]; err = _tuple$8[1]; $24r$8 = [e, err]; $s = 91; case 91: return $24r$8; /* } else if (_5 === (19)) { */ case 85: _r$35 = $clone(v, reflect.Value).String(); /* */ $s = 92; case 92: if($c) { $c = false; _r$35 = _r$35.$blk(); } if (_r$35 && _r$35.$blk !== undefined) { break s; } _r$36 = makePrintableString(_r$35); /* */ $s = 93; case 93: if($c) { $c = false; _r$36 = _r$36.$blk(); } if (_r$36 && _r$36.$blk !== undefined) { break s; } _tuple$9 = _r$36; e = _tuple$9[0]; err = _tuple$9[1]; $24r$9 = [e, err]; $s = 94; case 94: return $24r$9; /* } else if (_5 === (18)) { */ case 86: _r$37 = $clone(v, reflect.Value).String(); /* */ $s = 95; case 95: if($c) { $c = false; _r$37 = _r$37.$blk(); } if (_r$37 && _r$37.$blk !== undefined) { break s; } _r$38 = makeNumericString(_r$37); /* */ $s = 96; case 96: if($c) { $c = false; _r$38 = _r$38.$blk(); } if (_r$38 && _r$38.$blk !== undefined) { break s; } _tuple$10 = _r$38; e = _tuple$10[0]; err = _tuple$10[1]; $24r$10 = [e, err]; $s = 97; case 97: return $24r$10; /* } else { */ case 87: _r$39 = $clone(v, reflect.Value).String(); /* */ $s = 98; case 98: if($c) { $c = false; _r$39 = _r$39.$blk(); } if (_r$39 && _r$39.$blk !== undefined) { break s; } _r$40 = makeUTF8String(_r$39); /* */ $s = 99; case 99: if($c) { $c = false; _r$40 = _r$40.$blk(); } if (_r$40 && _r$40.$blk !== undefined) { break s; } _tmp$32 = _r$40; _tmp$33 = $ifaceNil; e = _tmp$32; err = _tmp$33; $24r$11 = [e, err]; $s = 100; case 100: return $24r$11; /* } */ case 88: case 83: /* } */ case 31: case 25: _tmp$34 = $ifaceNil; _tmp$35 = (x$6 = new StructuralError.ptr("unknown Go type"), new x$6.constructor.elem(x$6)); e = _tmp$34; err = _tmp$35; $s = -1; return [e, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: makeBody }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$10 = $24r$10; $f.$24r$11 = $24r$11; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f.$24r$6 = $24r$6; $f.$24r$7 = $24r$7; $f.$24r$8 = $24r$8; $f.$24r$9 = $24r$9; $f._1 = _1; $f._2 = _2; $f._3 = _3; $f._4 = _4; $f._5 = _5; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $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$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$36 = _r$36; $f._r$37 = _r$37; $f._r$38 = _r$38; $f._r$39 = _r$39; $f._r$4 = _r$4; $f._r$40 = _r$40; $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$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$4 = _tmp$4; $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 = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$10 = _tuple$10; $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._tuple$9 = _tuple$9; $f._v = _v; $f.bytes$1 = bytes$1; $f.e = e; $f.err = err; $f.fp = fp; $f.i = i; $f.i$1 = i$1; $f.i$2 = i$2; $f.l = l; $f.m = m; $f.m$1 = m$1; $f.n = n; $f.n1 = n1; $f.params = params; $f.s = s; $f.sliceType$4 = sliceType$4; $f.startingField = startingField; $f.t = t; $f.t$1 = t$1; $f.v = v; $f.value = value; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.x$6 = x$6; $f.$s = $s; $f.$r = $r; return $f; }; makeField = function(v, params) { var $24r, $24r$1, $24r$2, _1, _arg, _arg$1, _arg$2, _arg$3, _arg$4, _arg$5, _i, _r, _r$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$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _rune, _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$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, _v, _v$1, bodyLen, class$1, defaultValue, e, err, isCompound, matchAny, ok, params, r, rv, t, t$1, tag, tt, v, x$3, x$4, x$5, x$6, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _1 = $f._1; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _arg$4 = $f._arg$4; _arg$5 = $f._arg$5; _i = $f._i; _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$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$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; _rune = $f._rune; _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$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _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 = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _v = $f._v; _v$1 = $f._v$1; bodyLen = $f.bodyLen; class$1 = $f.class$1; defaultValue = $f.defaultValue; e = $f.e; err = $f.err; isCompound = $f.isCompound; matchAny = $f.matchAny; ok = $f.ok; params = $f.params; r = $f.r; rv = $f.rv; t = $f.t; t$1 = $f.t$1; tag = $f.tag; tt = $f.tt; v = $f.v; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; x$6 = $f.x$6; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = $ifaceNil; err = $ifaceNil; /* */ if (!$clone(v, reflect.Value).IsValid()) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!$clone(v, reflect.Value).IsValid()) { */ case 1: _tmp = $ifaceNil; _r = fmt.Errorf("asn1: cannot marshal nil value", new sliceType$4([])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tmp$1 = _r; e = _tmp; err = _tmp$1; $24r = [e, err]; $s = 4; case 4: return $24r; /* } */ case 2: if (!($clone(v, reflect.Value).Kind() === 20)) { _v = false; $s = 7; continue s; } _r$1 = $clone(v, reflect.Value).Type().NumMethod(); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _v = _r$1 === 0; case 7: /* */ if (_v) { $s = 5; continue; } /* */ $s = 6; continue; /* if (_v) { */ case 5: _r$2 = $clone(v, reflect.Value).Elem(); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = makeField($clone(_r$2, reflect.Value), $clone(params, fieldParameters)); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; e = _tuple[0]; err = _tuple[1]; $24r$1 = [e, err]; $s = 11; case 11: return $24r$1; /* } */ case 6: if (($clone(v, reflect.Value).Kind() === 23) && ($clone(v, reflect.Value).Len() === 0) && params.omitEmpty) { _tmp$2 = (bytesEncoder.nil); _tmp$3 = $ifaceNil; e = _tmp$2; err = _tmp$3; $s = -1; return [e, err]; } /* */ if (params.optional && !(params.defaultValue === ptrType$2.nil) && canHaveDefaultValue($clone(v, reflect.Value).Kind())) { $s = 12; continue; } /* */ $s = 13; continue; /* if (params.optional && !(params.defaultValue === ptrType$2.nil) && canHaveDefaultValue($clone(v, reflect.Value).Kind())) { */ case 12: _r$4 = $clone(reflect.New($clone(v, reflect.Value).Type()), reflect.Value).Elem(); /* */ $s = 14; case 14: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } defaultValue = _r$4; $clone(defaultValue, reflect.Value).SetInt(params.defaultValue.$get()); _r$5 = $clone(v, reflect.Value).Interface(); /* */ $s = 17; case 17: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg = _r$5; _r$6 = $clone(defaultValue, reflect.Value).Interface(); /* */ $s = 18; case 18: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _arg$1 = _r$6; _r$7 = reflect.DeepEqual(_arg, _arg$1); /* */ $s = 19; case 19: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } /* */ if (_r$7) { $s = 15; continue; } /* */ $s = 16; continue; /* if (_r$7) { */ case 15: _tmp$4 = (bytesEncoder.nil); _tmp$5 = $ifaceNil; e = _tmp$4; err = _tmp$5; $s = -1; return [e, err]; /* } */ case 16: /* } */ case 13: /* */ if (params.optional && params.defaultValue === ptrType$2.nil) { $s = 20; continue; } /* */ $s = 21; continue; /* if (params.optional && params.defaultValue === ptrType$2.nil) { */ case 20: _r$8 = $clone(v, reflect.Value).Interface(); /* */ $s = 24; case 24: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _arg$2 = _r$8; _r$9 = reflect.Zero($clone(v, reflect.Value).Type()); /* */ $s = 25; case 25: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$10 = $clone(_r$9, reflect.Value).Interface(); /* */ $s = 26; case 26: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _arg$3 = _r$10; _r$11 = reflect.DeepEqual(_arg$2, _arg$3); /* */ $s = 27; case 27: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } /* */ if (_r$11) { $s = 22; continue; } /* */ $s = 23; continue; /* if (_r$11) { */ case 22: _tmp$6 = (bytesEncoder.nil); _tmp$7 = $ifaceNil; e = _tmp$6; err = _tmp$7; $s = -1; return [e, err]; /* } */ case 23: /* } */ case 21: /* */ if ($interfaceIsEqual($clone(v, reflect.Value).Type(), rawValueType)) { $s = 28; continue; } /* */ $s = 29; continue; /* if ($interfaceIsEqual($clone(v, reflect.Value).Type(), rawValueType)) { */ case 28: _r$12 = $clone(v, reflect.Value).Interface(); /* */ $s = 30; case 30: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } rv = $clone($assertType(_r$12, RawValue), RawValue); if (!((rv.FullBytes.$length === 0))) { _tmp$8 = ($convertSliceType(rv.FullBytes, bytesEncoder)); _tmp$9 = $ifaceNil; e = _tmp$8; err = _tmp$9; $s = -1; return [e, err]; } t = new taggedEncoder.ptr(arrayType$1.zero(), $ifaceNil, $ifaceNil); t.tag = ($convertSliceType(appendTagAndLength($subslice(new sliceType(t.scratch), 0, 0), new tagAndLength.ptr(rv.Class, rv.Tag, rv.Bytes.$length, rv.IsCompound)), bytesEncoder)); t.body = ($convertSliceType(rv.Bytes, bytesEncoder)); _tmp$10 = t; _tmp$11 = $ifaceNil; e = _tmp$10; err = _tmp$11; $s = -1; return [e, err]; /* } */ case 29: _r$13 = getUniversalType($clone(v, reflect.Value).Type()); /* */ $s = 31; case 31: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _tuple$1 = _r$13; matchAny = _tuple$1[0]; tag = _tuple$1[1]; isCompound = _tuple$1[2]; ok = _tuple$1[3]; /* */ if (!ok || matchAny) { $s = 32; continue; } /* */ $s = 33; continue; /* if (!ok || matchAny) { */ case 32: _tmp$12 = $ifaceNil; _r$14 = fmt.Sprintf("unknown Go type: %v", new sliceType$4([$clone(v, reflect.Value).Type()])); /* */ $s = 34; case 34: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _tmp$13 = (x$3 = new StructuralError.ptr(_r$14), new x$3.constructor.elem(x$3)); e = _tmp$12; err = _tmp$13; $24r$2 = [e, err]; $s = 35; case 35: return $24r$2; /* } */ case 33: if (!((params.timeType === 0)) && !((tag === 23))) { _tmp$14 = $ifaceNil; _tmp$15 = (x$4 = new StructuralError.ptr("explicit time type given to non-time member"), new x$4.constructor.elem(x$4)); e = _tmp$14; err = _tmp$15; $s = -1; return [e, err]; } if (!((params.stringType === 0)) && !((tag === 19))) { _tmp$16 = $ifaceNil; _tmp$17 = (x$5 = new StructuralError.ptr("explicit string type given to non-string member"), new x$5.constructor.elem(x$5)); e = _tmp$16; err = _tmp$17; $s = -1; return [e, err]; } _1 = tag; /* */ if (_1 === (19)) { $s = 37; continue; } /* */ if (_1 === (23)) { $s = 38; continue; } /* */ $s = 39; continue; /* if (_1 === (19)) { */ case 37: /* */ if (params.stringType === 0) { $s = 40; continue; } /* */ $s = 41; continue; /* if (params.stringType === 0) { */ case 40: _r$15 = $clone(v, reflect.Value).String(); /* */ $s = 43; case 43: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _ref = _r$15; _i = 0; /* while (true) { */ case 44: /* if (!(_i < _ref.length)) { break; } */ if(!(_i < _ref.length)) { $s = 45; continue; } _rune = $decodeRune(_ref, _i); r = _rune[0]; /* */ if (r >= 128 || !isPrintable(((r << 24 >>> 24)), false, false)) { $s = 46; continue; } /* */ $s = 47; continue; /* if (r >= 128 || !isPrintable(((r << 24 >>> 24)), false, false)) { */ case 46: _r$16 = $clone(v, reflect.Value).String(); /* */ $s = 50; case 50: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _r$17 = utf8.ValidString(_r$16); /* */ $s = 51; case 51: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } /* */ if (!_r$17) { $s = 48; continue; } /* */ $s = 49; continue; /* if (!_r$17) { */ case 48: _tmp$18 = $ifaceNil; _tmp$19 = errors.New("asn1: string not valid UTF-8"); e = _tmp$18; err = _tmp$19; $s = -1; return [e, err]; /* } */ case 49: tag = 12; /* break; */ $s = 45; continue; /* } */ case 47: _i += _rune[1]; $s = 44; continue; case 45: $s = 42; continue; /* } else { */ case 41: tag = params.stringType; /* } */ case 42: $s = 39; continue; /* } else if (_1 === (23)) { */ case 38: if (params.timeType === 24) { _v$1 = true; $s = 54; continue s; } _r$18 = $clone(v, reflect.Value).Interface(); /* */ $s = 55; case 55: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } _r$19 = outsideUTCRange($clone($assertType(_r$18, time.Time), time.Time)); /* */ $s = 56; case 56: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } _v$1 = _r$19; case 54: /* */ if (_v$1) { $s = 52; continue; } /* */ $s = 53; continue; /* if (_v$1) { */ case 52: tag = 24; /* } */ case 53: /* } */ case 39: case 36: if (params.set) { if (!((tag === 16))) { _tmp$20 = $ifaceNil; _tmp$21 = (x$6 = new StructuralError.ptr("non sequence tagged as set"), new x$6.constructor.elem(x$6)); e = _tmp$20; err = _tmp$21; $s = -1; return [e, err]; } tag = 17; } if ((tag === 17) && !params.set) { params.set = true; } t$1 = new taggedEncoder.ptr(arrayType$1.zero(), $ifaceNil, $ifaceNil); _r$20 = makeBody($clone(v, reflect.Value), $clone(params, fieldParameters)); /* */ $s = 57; case 57: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } _tuple$2 = _r$20; t$1.body = _tuple$2[0]; err = _tuple$2[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$22 = $ifaceNil; _tmp$23 = err; e = _tmp$22; err = _tmp$23; $s = -1; return [e, err]; } _r$21 = t$1.body.Len(); /* */ $s = 58; case 58: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } bodyLen = _r$21; class$1 = 0; /* */ if (!(params.tag === ptrType$3.nil)) { $s = 59; continue; } /* */ $s = 60; continue; /* if (!(params.tag === ptrType$3.nil)) { */ case 59: if (params.application) { class$1 = 1; } else if (params.private$3) { class$1 = 3; } else { class$1 = 2; } /* */ if (params.explicit) { $s = 61; continue; } /* */ $s = 62; continue; /* if (params.explicit) { */ case 61: t$1.tag = ($convertSliceType(appendTagAndLength($subslice(new sliceType(t$1.scratch), 0, 0), new tagAndLength.ptr(0, tag, bodyLen, isCompound)), bytesEncoder)); tt = new taggedEncoder.ptr(arrayType$1.zero(), $ifaceNil, $ifaceNil); tt.body = t$1; _arg$4 = $subslice(new sliceType(tt.scratch), 0, 0); _r$22 = t$1.tag.Len(); /* */ $s = 63; case 63: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; } _arg$5 = new tagAndLength.ptr(class$1, params.tag.$get(), bodyLen + _r$22 >> 0, true); _r$23 = appendTagAndLength(_arg$4, _arg$5); /* */ $s = 64; case 64: if($c) { $c = false; _r$23 = _r$23.$blk(); } if (_r$23 && _r$23.$blk !== undefined) { break s; } tt.tag = ($convertSliceType(_r$23, bytesEncoder)); _tmp$24 = tt; _tmp$25 = $ifaceNil; e = _tmp$24; err = _tmp$25; $s = -1; return [e, err]; /* } */ case 62: tag = params.tag.$get(); /* } */ case 60: t$1.tag = ($convertSliceType(appendTagAndLength($subslice(new sliceType(t$1.scratch), 0, 0), new tagAndLength.ptr(class$1, tag, bodyLen, isCompound)), bytesEncoder)); _tmp$26 = t$1; _tmp$27 = $ifaceNil; e = _tmp$26; err = _tmp$27; $s = -1; return [e, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: makeField }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._1 = _1; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._arg$4 = _arg$4; $f._arg$5 = _arg$5; $f._i = _i; $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$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$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._rune = _rune; $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$3 = _tmp$3; $f._tmp$4 = _tmp$4; $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 = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._v = _v; $f._v$1 = _v$1; $f.bodyLen = bodyLen; $f.class$1 = class$1; $f.defaultValue = defaultValue; $f.e = e; $f.err = err; $f.isCompound = isCompound; $f.matchAny = matchAny; $f.ok = ok; $f.params = params; $f.r = r; $f.rv = rv; $f.t = t; $f.t$1 = t$1; $f.tag = tag; $f.tt = tt; $f.v = v; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.x$6 = x$6; $f.$s = $s; $f.$r = $r; return $f; }; Marshal = function(val) { var $24r, _r, val, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = MarshalWithParams(val, ""); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Marshal }; } $f.$24r = $24r; $f._r = _r; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Marshal = Marshal; MarshalWithParams = function(val, params) { var _r, _r$1, _r$2, _tuple, b, e, err, params, val, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; b = $f.b; e = $f.e; err = $f.err; params = $f.params; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = reflect.ValueOf(val); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = makeField($clone(_r, reflect.Value), $clone(parseFieldParameters(params), fieldParameters)); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; e = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType.nil, err]; } _r$2 = e.Len(); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } b = $makeSlice(sliceType, _r$2); $r = e.Encode(b); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return [b, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: MarshalWithParams }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.b = b; $f.e = e; $f.err = err; $f.params = params; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.MarshalWithParams = MarshalWithParams; parseFieldParameters = function(str) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, err, err$1, i, i$1, i$2, part, ret, str; ret = new fieldParameters.ptr(false, false, false, false, ptrType$2.nil, ptrType$3.nil, 0, 0, false, false); part = ""; while (true) { if (!(str.length > 0)) { break; } i = strings.IndexByte(str, 44); if (i < 0) { _tmp = str; _tmp$1 = ""; part = _tmp; str = _tmp$1; } else { _tmp$2 = $substring(str, 0, i); _tmp$3 = $substring(str, (i + 1 >> 0)); part = _tmp$2; str = _tmp$3; } if (part === "optional") { ret.optional = true; } else if (part === "explicit") { ret.explicit = true; if (ret.tag === ptrType$3.nil) { ret.tag = $newDataPointer(0, ptrType$3); } } else if (part === "generalized") { ret.timeType = 24; } else if (part === "utc") { ret.timeType = 23; } else if (part === "ia5") { ret.stringType = 22; } else if (part === "printable") { ret.stringType = 19; } else if (part === "numeric") { ret.stringType = 18; } else if (part === "utf8") { ret.stringType = 12; } else if (strings.HasPrefix(part, "default:")) { _tuple = strconv.ParseInt($substring(part, 8), 10, 64); i$1 = _tuple[0]; err = _tuple[1]; if ($interfaceIsEqual(err, $ifaceNil)) { ret.defaultValue = $newDataPointer(new $Int64(0, 0), ptrType$2); ret.defaultValue.$set(i$1); } } else if (strings.HasPrefix(part, "tag:")) { _tuple$1 = strconv.Atoi($substring(part, 4)); i$2 = _tuple$1[0]; err$1 = _tuple$1[1]; if ($interfaceIsEqual(err$1, $ifaceNil)) { ret.tag = $newDataPointer(0, ptrType$3); ret.tag.$set(i$2); } } else if (part === "set") { ret.set = true; } else if (part === "application") { ret.application = true; if (ret.tag === ptrType$3.nil) { ret.tag = $newDataPointer(0, ptrType$3); } } else if (part === "private") { ret.private$3 = true; if (ret.tag === ptrType$3.nil) { ret.tag = $newDataPointer(0, ptrType$3); } } else if (part === "omitempty") { ret.omitEmpty = true; } } return ret; }; getUniversalType = function(t) { var _1, _2, _r, _r$1, _r$2, _r$3, _r$4, _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$6, _tmp$7, _tmp$8, _tmp$9, isCompound, matchAny, ok, t, tagNumber, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _2 = $f._2; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _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$44 = $f._tmp$44; _tmp$45 = $f._tmp$45; _tmp$46 = $f._tmp$46; _tmp$47 = $f._tmp$47; _tmp$48 = $f._tmp$48; _tmp$49 = $f._tmp$49; _tmp$5 = $f._tmp$5; _tmp$50 = $f._tmp$50; _tmp$51 = $f._tmp$51; _tmp$52 = $f._tmp$52; _tmp$53 = $f._tmp$53; _tmp$54 = $f._tmp$54; _tmp$55 = $f._tmp$55; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; isCompound = $f.isCompound; matchAny = $f.matchAny; ok = $f.ok; t = $f.t; tagNumber = $f.tagNumber; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: matchAny = false; tagNumber = 0; isCompound = false; ok = false; _1 = t; if ($interfaceIsEqual(_1, (rawValueType))) { _tmp = true; _tmp$1 = -1; _tmp$2 = false; _tmp$3 = true; matchAny = _tmp; tagNumber = _tmp$1; isCompound = _tmp$2; ok = _tmp$3; $s = -1; return [matchAny, tagNumber, isCompound, ok]; } else if ($interfaceIsEqual(_1, (objectIdentifierType))) { _tmp$4 = false; _tmp$5 = 6; _tmp$6 = false; _tmp$7 = true; matchAny = _tmp$4; tagNumber = _tmp$5; isCompound = _tmp$6; ok = _tmp$7; $s = -1; return [matchAny, tagNumber, isCompound, ok]; } else if ($interfaceIsEqual(_1, (bitStringType))) { _tmp$8 = false; _tmp$9 = 3; _tmp$10 = false; _tmp$11 = true; matchAny = _tmp$8; tagNumber = _tmp$9; isCompound = _tmp$10; ok = _tmp$11; $s = -1; return [matchAny, tagNumber, isCompound, ok]; } else if ($interfaceIsEqual(_1, (timeType))) { _tmp$12 = false; _tmp$13 = 23; _tmp$14 = false; _tmp$15 = true; matchAny = _tmp$12; tagNumber = _tmp$13; isCompound = _tmp$14; ok = _tmp$15; $s = -1; return [matchAny, tagNumber, isCompound, ok]; } else if ($interfaceIsEqual(_1, (enumeratedType))) { _tmp$16 = false; _tmp$17 = 10; _tmp$18 = false; _tmp$19 = true; matchAny = _tmp$16; tagNumber = _tmp$17; isCompound = _tmp$18; ok = _tmp$19; $s = -1; return [matchAny, tagNumber, isCompound, ok]; } else if ($interfaceIsEqual(_1, (bigIntType))) { _tmp$20 = false; _tmp$21 = 2; _tmp$22 = false; _tmp$23 = true; matchAny = _tmp$20; tagNumber = _tmp$21; isCompound = _tmp$22; ok = _tmp$23; $s = -1; return [matchAny, tagNumber, isCompound, ok]; } _r = t.Kind(); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _2 = _r; /* */ if (_2 === (1)) { $s = 3; continue; } /* */ if ((_2 === (2)) || (_2 === (3)) || (_2 === (4)) || (_2 === (5)) || (_2 === (6))) { $s = 4; continue; } /* */ if (_2 === (25)) { $s = 5; continue; } /* */ if (_2 === (23)) { $s = 6; continue; } /* */ if (_2 === (24)) { $s = 7; continue; } /* */ $s = 8; continue; /* if (_2 === (1)) { */ case 3: _tmp$24 = false; _tmp$25 = 1; _tmp$26 = false; _tmp$27 = true; matchAny = _tmp$24; tagNumber = _tmp$25; isCompound = _tmp$26; ok = _tmp$27; $s = -1; return [matchAny, tagNumber, isCompound, ok]; /* } else if ((_2 === (2)) || (_2 === (3)) || (_2 === (4)) || (_2 === (5)) || (_2 === (6))) { */ case 4: _tmp$28 = false; _tmp$29 = 2; _tmp$30 = false; _tmp$31 = true; matchAny = _tmp$28; tagNumber = _tmp$29; isCompound = _tmp$30; ok = _tmp$31; $s = -1; return [matchAny, tagNumber, isCompound, ok]; /* } else if (_2 === (25)) { */ case 5: _tmp$32 = false; _tmp$33 = 16; _tmp$34 = true; _tmp$35 = true; matchAny = _tmp$32; tagNumber = _tmp$33; isCompound = _tmp$34; ok = _tmp$35; $s = -1; return [matchAny, tagNumber, isCompound, ok]; /* } else if (_2 === (23)) { */ case 6: _r$1 = t.Elem(); /* */ $s = 11; case 11: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = _r$1.Kind(); /* */ $s = 12; case 12: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } /* */ if (_r$2 === 8) { $s = 9; continue; } /* */ $s = 10; continue; /* if (_r$2 === 8) { */ case 9: _tmp$36 = false; _tmp$37 = 4; _tmp$38 = false; _tmp$39 = true; matchAny = _tmp$36; tagNumber = _tmp$37; isCompound = _tmp$38; ok = _tmp$39; $s = -1; return [matchAny, tagNumber, isCompound, ok]; /* } */ case 10: _r$3 = t.Name(); /* */ $s = 15; case 15: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = strings.HasSuffix(_r$3, "SET"); /* */ $s = 16; case 16: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } /* */ if (_r$4) { $s = 13; continue; } /* */ $s = 14; continue; /* if (_r$4) { */ case 13: _tmp$40 = false; _tmp$41 = 17; _tmp$42 = true; _tmp$43 = true; matchAny = _tmp$40; tagNumber = _tmp$41; isCompound = _tmp$42; ok = _tmp$43; $s = -1; return [matchAny, tagNumber, isCompound, ok]; /* } */ case 14: _tmp$44 = false; _tmp$45 = 16; _tmp$46 = true; _tmp$47 = true; matchAny = _tmp$44; tagNumber = _tmp$45; isCompound = _tmp$46; ok = _tmp$47; $s = -1; return [matchAny, tagNumber, isCompound, ok]; /* } else if (_2 === (24)) { */ case 7: _tmp$48 = false; _tmp$49 = 19; _tmp$50 = false; _tmp$51 = true; matchAny = _tmp$48; tagNumber = _tmp$49; isCompound = _tmp$50; ok = _tmp$51; $s = -1; return [matchAny, tagNumber, isCompound, ok]; /* } */ case 8: case 1: _tmp$52 = false; _tmp$53 = 0; _tmp$54 = false; _tmp$55 = false; matchAny = _tmp$52; tagNumber = _tmp$53; isCompound = _tmp$54; ok = _tmp$55; $s = -1; return [matchAny, tagNumber, isCompound, ok]; /* */ } return; } if ($f === undefined) { $f = { $blk: getUniversalType }; } $f._1 = _1; $f._2 = _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._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$44 = _tmp$44; $f._tmp$45 = _tmp$45; $f._tmp$46 = _tmp$46; $f._tmp$47 = _tmp$47; $f._tmp$48 = _tmp$48; $f._tmp$49 = _tmp$49; $f._tmp$5 = _tmp$5; $f._tmp$50 = _tmp$50; $f._tmp$51 = _tmp$51; $f._tmp$52 = _tmp$52; $f._tmp$53 = _tmp$53; $f._tmp$54 = _tmp$54; $f._tmp$55 = _tmp$55; $f._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f.isCompound = isCompound; $f.matchAny = matchAny; $f.ok = ok; $f.t = t; $f.tagNumber = tagNumber; $f.$s = $s; $f.$r = $r; return $f; }; StructuralError.ptr.prototype.Error = function() { var e; e = this; return "asn1: structure error: " + e.Msg; }; StructuralError.prototype.Error = function() { return this.$val.Error(); }; SyntaxError.ptr.prototype.Error = function() { var e; e = this; return "asn1: syntax error: " + e.Msg; }; SyntaxError.prototype.Error = function() { return this.$val.Error(); }; parseBool = function(bytes$1) { var _1, bytes$1, err, ret, x$3, x$4; ret = false; err = $ifaceNil; if (!((bytes$1.$length === 1))) { err = (x$3 = new SyntaxError.ptr("invalid boolean"), new x$3.constructor.elem(x$3)); return [ret, err]; } _1 = (0 >= bytes$1.$length ? ($throwRuntimeError("index out of range"), undefined) : bytes$1.$array[bytes$1.$offset + 0]); if (_1 === (0)) { ret = false; } else if (_1 === (255)) { ret = true; } else { err = (x$4 = new SyntaxError.ptr("invalid boolean"), new x$4.constructor.elem(x$4)); } return [ret, err]; }; checkInteger = function(bytes$1) { var bytes$1, x$3, x$4; if (bytes$1.$length === 0) { return (x$3 = new StructuralError.ptr("empty integer"), new x$3.constructor.elem(x$3)); } if (bytes$1.$length === 1) { return $ifaceNil; } if ((((0 >= bytes$1.$length ? ($throwRuntimeError("index out of range"), undefined) : bytes$1.$array[bytes$1.$offset + 0]) === 0) && ((((1 >= bytes$1.$length ? ($throwRuntimeError("index out of range"), undefined) : bytes$1.$array[bytes$1.$offset + 1]) & 128) >>> 0) === 0)) || (((0 >= bytes$1.$length ? ($throwRuntimeError("index out of range"), undefined) : bytes$1.$array[bytes$1.$offset + 0]) === 255) && ((((1 >= bytes$1.$length ? ($throwRuntimeError("index out of range"), undefined) : bytes$1.$array[bytes$1.$offset + 1]) & 128) >>> 0) === 128))) { return (x$4 = new StructuralError.ptr("integer not minimally-encoded"), new x$4.constructor.elem(x$4)); } return $ifaceNil; }; parseInt64 = function(bytes$1) { var bytes$1, bytesRead, err, ret, x$3, x$4; ret = new $Int64(0, 0); err = $ifaceNil; err = checkInteger(bytes$1); if (!($interfaceIsEqual(err, $ifaceNil))) { return [ret, err]; } if (bytes$1.$length > 8) { err = (x$3 = new StructuralError.ptr("integer too large"), new x$3.constructor.elem(x$3)); return [ret, err]; } bytesRead = 0; while (true) { if (!(bytesRead < bytes$1.$length)) { break; } ret = $shiftLeft64(ret, (8)); ret = (x$4 = (new $Int64(0, ((bytesRead < 0 || bytesRead >= bytes$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : bytes$1.$array[bytes$1.$offset + bytesRead]))), new $Int64(ret.$high | x$4.$high, (ret.$low | x$4.$low) >>> 0)); bytesRead = bytesRead + (1) >> 0; } ret = $shiftLeft64(ret, ((64 - (((bytes$1.$length << 24 >>> 24)) * 8 << 24 >>> 24) << 24 >>> 24))); ret = $shiftRightInt64(ret, ((64 - (((bytes$1.$length << 24 >>> 24)) * 8 << 24 >>> 24) << 24 >>> 24))); return [ret, err]; }; parseInt32 = function(bytes$1) { var _tuple, bytes$1, err, err$1, ret64, x$3, x$4; err = checkInteger(bytes$1); if (!($interfaceIsEqual(err, $ifaceNil))) { return [0, err]; } _tuple = parseInt64(bytes$1); ret64 = _tuple[0]; err$1 = _tuple[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { return [0, err$1]; } if (!((x$3 = (new $Int64(0, (((ret64.$low + ((ret64.$high >> 31) * 4294967296)) >> 0)))), (ret64.$high === x$3.$high && ret64.$low === x$3.$low)))) { return [0, (x$4 = new StructuralError.ptr("integer too large"), new x$4.constructor.elem(x$4))]; } return [(((ret64.$low + ((ret64.$high >> 31) * 4294967296)) >> 0)), $ifaceNil]; }; parseBigInt = function(bytes$1) { var _i, _r, _ref, bytes$1, err, i, notBytes, ret, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _ref = $f._ref; bytes$1 = $f.bytes$1; err = $f.err; i = $f.i; notBytes = $f.notBytes; ret = $f.ret; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = checkInteger(bytes$1); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$1.nil, err]; } ret = new big.Int.ptr(false, big.nat.nil); /* */ if (bytes$1.$length > 0 && ((((0 >= bytes$1.$length ? ($throwRuntimeError("index out of range"), undefined) : bytes$1.$array[bytes$1.$offset + 0]) & 128) >>> 0) === 128)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (bytes$1.$length > 0 && ((((0 >= bytes$1.$length ? ($throwRuntimeError("index out of range"), undefined) : bytes$1.$array[bytes$1.$offset + 0]) & 128) >>> 0) === 128)) { */ case 1: notBytes = $makeSlice(sliceType, bytes$1.$length); _ref = notBytes; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; ((i < 0 || i >= notBytes.$length) ? ($throwRuntimeError("index out of range"), undefined) : notBytes.$array[notBytes.$offset + i] = (~((i < 0 || i >= bytes$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : bytes$1.$array[bytes$1.$offset + i]) << 24 >>> 24)); _i++; } ret.SetBytes(notBytes); _r = ret.Add(ret, bigOne); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; ret.Neg(ret); $s = -1; return [ret, $ifaceNil]; /* } */ case 2: ret.SetBytes(bytes$1); $s = -1; return [ret, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: parseBigInt }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f.bytes$1 = bytes$1; $f.err = err; $f.i = i; $f.notBytes = notBytes; $f.ret = ret; $f.$s = $s; $f.$r = $r; return $f; }; BitString.ptr.prototype.At = function(i) { var _q, _r, b, i, x$3, x$4, y, y$1; b = this; if (i < 0 || i >= b.BitLength) { return 0; } x$3 = (_q = i / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); y = 7 - (((_r = i % 8, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) >>> 0)) >>> 0; return ((((y$1 = y, y$1 < 32 ? ((x$4 = b.Bytes, ((x$3 < 0 || x$3 >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + x$3])) >>> y$1) : 0) << 24 >>> 24) >> 0)) & 1; }; BitString.prototype.At = function(i) { return this.$val.At(i); }; BitString.ptr.prototype.RightAlign = function() { var _r, a, b, i, shift, x$3, x$4, x$5, x$6, y, y$1, y$2; b = this; shift = (((8 - ((_r = b.BitLength % 8, _r === _r ? _r : $throwRuntimeError("integer divide by zero"))) >> 0) >>> 0)); if ((shift === 8) || (b.Bytes.$length === 0)) { return b.Bytes; } a = $makeSlice(sliceType, b.Bytes.$length); (0 >= a.$length ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + 0] = ((y = shift, y < 32 ? ((x$3 = b.Bytes, (0 >= x$3.$length ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + 0])) >>> y) : 0) << 24 >>> 24)); i = 1; while (true) { if (!(i < b.Bytes.$length)) { break; } ((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i] = ((y$1 = ((8 - shift >>> 0)), y$1 < 32 ? ((x$4 = b.Bytes, x$5 = i - 1 >> 0, ((x$5 < 0 || x$5 >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + x$5])) << y$1) : 0) << 24 >>> 24)); ((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i] = ((((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i]) | (((y$2 = shift, y$2 < 32 ? ((x$6 = b.Bytes, ((i < 0 || i >= x$6.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$6.$array[x$6.$offset + i])) >>> y$2) : 0) << 24 >>> 24))) >>> 0)); i = i + (1) >> 0; } return a; }; BitString.prototype.RightAlign = function() { return this.$val.RightAlign(); }; parseBitString = function(bytes$1) { var bytes$1, err, paddingBits, ret, x$3, x$4, x$5, y; ret = new BitString.ptr(sliceType.nil, 0); err = $ifaceNil; if (bytes$1.$length === 0) { err = (x$3 = new SyntaxError.ptr("zero length BIT STRING"), new x$3.constructor.elem(x$3)); return [ret, err]; } paddingBits = (((0 >= bytes$1.$length ? ($throwRuntimeError("index out of range"), undefined) : bytes$1.$array[bytes$1.$offset + 0]) >> 0)); if (paddingBits > 7 || (bytes$1.$length === 1) && paddingBits > 0 || !(((((x$4 = bytes$1.$length - 1 >> 0, ((x$4 < 0 || x$4 >= bytes$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : bytes$1.$array[bytes$1.$offset + x$4])) & (((((y = (0 >= bytes$1.$length ? ($throwRuntimeError("index out of range"), undefined) : bytes$1.$array[bytes$1.$offset + 0]), y < 32 ? (1 << y) : 0) << 24 >>> 24)) - 1 << 24 >>> 24))) >>> 0) === 0))) { err = (x$5 = new SyntaxError.ptr("invalid padding bits in BIT STRING"), new x$5.constructor.elem(x$5)); return [ret, err]; } ret.BitLength = ($imul(((bytes$1.$length - 1 >> 0)), 8)) - paddingBits >> 0; ret.Bytes = $subslice(bytes$1, 1); return [ret, err]; }; ObjectIdentifier.prototype.Equal = function(other) { var i, oi, other; oi = this; if (!((oi.$length === other.$length))) { return false; } i = 0; while (true) { if (!(i < oi.$length)) { break; } if (!((((i < 0 || i >= oi.$length) ? ($throwRuntimeError("index out of range"), undefined) : oi.$array[oi.$offset + i]) === ((i < 0 || i >= other.$length) ? ($throwRuntimeError("index out of range"), undefined) : other.$array[other.$offset + i])))) { return false; } i = i + (1) >> 0; } return true; }; $ptrType(ObjectIdentifier).prototype.Equal = function(other) { return this.$get().Equal(other); }; ObjectIdentifier.prototype.String = function() { var _i, _ref, i, oi, s, v; oi = this; s = ""; _ref = oi; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (i > 0) { s = s + ("."); } s = s + (strconv.Itoa(v)); _i++; } return s; }; $ptrType(ObjectIdentifier).prototype.String = function() { return this.$get().String(); }; parseObjectIdentifier = function(bytes$1) { var _q, _r, _tuple, _tuple$1, bytes$1, err, i, offset, s, v, x$3; s = ObjectIdentifier.nil; err = $ifaceNil; if (bytes$1.$length === 0) { err = (x$3 = new SyntaxError.ptr("zero length OBJECT IDENTIFIER"), new x$3.constructor.elem(x$3)); return [s, err]; } s = $convertSliceType($makeSlice(sliceType$3, (bytes$1.$length + 1 >> 0)), ObjectIdentifier); _tuple = parseBase128Int(bytes$1, 0); v = _tuple[0]; offset = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [s, err]; } if (v < 80) { (0 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 0] = (_q = v / 40, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))); (1 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 1] = (_r = v % 40, _r === _r ? _r : $throwRuntimeError("integer divide by zero"))); } else { (0 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 0] = 2); (1 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 1] = (v - 80 >> 0)); } i = 2; while (true) { if (!(offset < bytes$1.$length)) { break; } _tuple$1 = parseBase128Int(bytes$1, offset); v = _tuple$1[0]; offset = _tuple$1[1]; err = _tuple$1[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [s, err]; } ((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i] = v); i = i + (1) >> 0; } s = $subslice(s, 0, i); return [s, err]; }; parseBase128Int = function(bytes$1, initOffset) { var b, bytes$1, err, initOffset, offset, ret, ret64, shifted, x$3, x$4, x$5, x$6, x$7; ret = 0; offset = 0; err = $ifaceNil; offset = initOffset; ret64 = new $Int64(0, 0); shifted = 0; while (true) { if (!(offset < bytes$1.$length)) { break; } if (shifted === 5) { err = (x$3 = new StructuralError.ptr("base 128 integer too large"), new x$3.constructor.elem(x$3)); return [ret, offset, err]; } ret64 = $shiftLeft64(ret64, (7)); b = ((offset < 0 || offset >= bytes$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : bytes$1.$array[bytes$1.$offset + offset]); if ((shifted === 0) && (b === 128)) { err = (x$4 = new SyntaxError.ptr("integer is not minimally encoded"), new x$4.constructor.elem(x$4)); return [ret, offset, err]; } ret64 = (x$5 = (new $Int64(0, ((b & 127) >>> 0))), new $Int64(ret64.$high | x$5.$high, (ret64.$low | x$5.$low) >>> 0)); offset = offset + (1) >> 0; if (((b & 128) >>> 0) === 0) { ret = (((ret64.$low + ((ret64.$high >> 31) * 4294967296)) >> 0)); if ((ret64.$high > 0 || (ret64.$high === 0 && ret64.$low > 2147483647))) { err = (x$6 = new StructuralError.ptr("base 128 integer too large"), new x$6.constructor.elem(x$6)); } return [ret, offset, err]; } shifted = shifted + (1) >> 0; } err = (x$7 = new SyntaxError.ptr("truncated base 128 integer"), new x$7.constructor.elem(x$7)); return [ret, offset, err]; }; parseUTCTime = function(bytes$1) { var _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, _tuple$1, bytes$1, err, formatStr, ret, s, serialized, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; bytes$1 = $f.bytes$1; err = $f.err; formatStr = $f.formatStr; ret = $f.ret; s = $f.s; serialized = $f.serialized; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ret = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil); err = $ifaceNil; s = ($bytesToString(bytes$1)); formatStr = "0601021504Z0700"; _r = time.Parse(formatStr, s); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; time.Time.copy(ret, _tuple[0]); err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: formatStr = "060102150405Z0700"; _r$1 = time.Parse(formatStr, s); /* */ $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; time.Time.copy(ret, _tuple$1[0]); err = _tuple$1[1]; /* } */ case 3: if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ret, err]; } _r$2 = $clone(ret, time.Time).Format(formatStr); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } serialized = _r$2; /* */ if (!(serialized === s)) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!(serialized === s)) { */ case 6: _r$3 = fmt.Errorf("asn1: time did not serialize back to the original value and may be invalid: given %q, but serialized as %q", new sliceType$4([new $String(s), new $String(serialized)])); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } err = _r$3; $s = -1; return [ret, err]; /* } */ case 7: _r$4 = $clone(ret, time.Time).Year(); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } /* */ if (_r$4 >= 2050) { $s = 9; continue; } /* */ $s = 10; continue; /* if (_r$4 >= 2050) { */ case 9: _r$5 = $clone(ret, time.Time).AddDate(-100, 0, 0); /* */ $s = 12; case 12: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } time.Time.copy(ret, _r$5); /* } */ case 10: $s = -1; return [ret, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: parseUTCTime }; } $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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.bytes$1 = bytes$1; $f.err = err; $f.formatStr = formatStr; $f.ret = ret; $f.s = s; $f.serialized = serialized; $f.$s = $s; $f.$r = $r; return $f; }; parseGeneralizedTime = function(bytes$1) { var _r, _r$1, _r$2, _tuple, bytes$1, err, ret, s, serialized, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; bytes$1 = $f.bytes$1; err = $f.err; ret = $f.ret; s = $f.s; serialized = $f.serialized; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ret = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil); err = $ifaceNil; s = ($bytesToString(bytes$1)); _r = time.Parse("20060102150405Z0700", s); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; time.Time.copy(ret, _tuple[0]); err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ret, err]; } _r$1 = $clone(ret, time.Time).Format("20060102150405Z0700"); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } serialized = _r$1; /* */ if (!(serialized === s)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!(serialized === s)) { */ case 3: _r$2 = fmt.Errorf("asn1: time did not serialize back to the original value and may be invalid: given %q, but serialized as %q", new sliceType$4([new $String(s), new $String(serialized)])); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } err = _r$2; /* } */ case 4: $s = -1; return [ret, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: parseGeneralizedTime }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.bytes$1 = bytes$1; $f.err = err; $f.ret = ret; $f.s = s; $f.serialized = serialized; $f.$s = $s; $f.$r = $r; return $f; }; parseNumericString = function(bytes$1) { var _i, _ref, _tmp, _tmp$1, _tmp$2, _tmp$3, b, bytes$1, err, ret, x$3; ret = ""; err = $ifaceNil; _ref = bytes$1; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } b = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (!isNumeric(b)) { _tmp = ""; _tmp$1 = (x$3 = new SyntaxError.ptr("NumericString contains invalid character"), new x$3.constructor.elem(x$3)); ret = _tmp; err = _tmp$1; return [ret, err]; } _i++; } _tmp$2 = ($bytesToString(bytes$1)); _tmp$3 = $ifaceNil; ret = _tmp$2; err = _tmp$3; return [ret, err]; }; isNumeric = function(b) { var b; return 48 <= b && b <= 57 || (b === 32); }; parsePrintableString = function(bytes$1) { var _i, _ref, b, bytes$1, err, ret, x$3; ret = ""; err = $ifaceNil; _ref = bytes$1; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } b = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (!isPrintable(b, true, true)) { err = (x$3 = new SyntaxError.ptr("PrintableString contains invalid character"), new x$3.constructor.elem(x$3)); return [ret, err]; } _i++; } ret = ($bytesToString(bytes$1)); return [ret, err]; }; isPrintable = function(b, asterisk, ampersand) { var ampersand, asterisk, b; return 97 <= b && b <= 122 || 65 <= b && b <= 90 || 48 <= b && b <= 57 || 39 <= b && b <= 41 || 43 <= b && b <= 47 || (b === 32) || (b === 58) || (b === 61) || (b === 63) || ((asterisk) && (b === 42)) || ((ampersand) && (b === 38)); }; parseIA5String = function(bytes$1) { var _i, _ref, b, bytes$1, err, ret, x$3; ret = ""; err = $ifaceNil; _ref = bytes$1; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } b = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (b >= 128) { err = (x$3 = new SyntaxError.ptr("IA5String contains invalid character"), new x$3.constructor.elem(x$3)); return [ret, err]; } _i++; } ret = ($bytesToString(bytes$1)); return [ret, err]; }; parseT61String = function(bytes$1) { var _tmp, _tmp$1, bytes$1, err, ret; ret = ""; err = $ifaceNil; _tmp = ($bytesToString(bytes$1)); _tmp$1 = $ifaceNil; ret = _tmp; err = _tmp$1; return [ret, err]; }; parseUTF8String = function(bytes$1) { var _tmp, _tmp$1, _tmp$2, _tmp$3, bytes$1, err, ret; ret = ""; err = $ifaceNil; if (!utf8.Valid(bytes$1)) { _tmp = ""; _tmp$1 = errors.New("asn1: invalid UTF-8 string"); ret = _tmp; err = _tmp$1; return [ret, err]; } _tmp$2 = ($bytesToString(bytes$1)); _tmp$3 = $ifaceNil; ret = _tmp$2; err = _tmp$3; return [ret, err]; }; parseBMPString = function(bmpString) { var _q, _r, bmpString, l, s, x$3, x$4; if (!(((_r = bmpString.$length % 2, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) === 0))) { return ["", errors.New("pkcs12: odd-length BMP string")]; } l = bmpString.$length; if (l >= 2 && ((x$3 = l - 1 >> 0, ((x$3 < 0 || x$3 >= bmpString.$length) ? ($throwRuntimeError("index out of range"), undefined) : bmpString.$array[bmpString.$offset + x$3])) === 0) && ((x$4 = l - 2 >> 0, ((x$4 < 0 || x$4 >= bmpString.$length) ? ($throwRuntimeError("index out of range"), undefined) : bmpString.$array[bmpString.$offset + x$4])) === 0)) { bmpString = $subslice(bmpString, 0, (l - 2 >> 0)); } s = $makeSlice(sliceType$5, 0, (_q = bmpString.$length / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))); while (true) { if (!(bmpString.$length > 0)) { break; } s = $append(s, ((((0 >= bmpString.$length ? ($throwRuntimeError("index out of range"), undefined) : bmpString.$array[bmpString.$offset + 0]) << 16 >>> 16)) << 8 << 16 >>> 16) + (((1 >= bmpString.$length ? ($throwRuntimeError("index out of range"), undefined) : bmpString.$array[bmpString.$offset + 1]) << 16 >>> 16)) << 16 >>> 16); bmpString = $subslice(bmpString, 2); } return [($runesToString(utf16.Decode(s))), $ifaceNil]; }; parseTagAndLength = function(bytes$1, initOffset) { var _tuple, b, bytes$1, err, i, initOffset, numBytes, offset, ret, x$3, x$4, x$5, x$6, x$7, x$8, x$9, y; ret = new tagAndLength.ptr(0, 0, 0, false); offset = 0; err = $ifaceNil; offset = initOffset; if (offset >= bytes$1.$length) { err = errors.New("asn1: internal error in parseTagAndLength"); return [ret, offset, err]; } b = ((offset < 0 || offset >= bytes$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : bytes$1.$array[bytes$1.$offset + offset]); offset = offset + (1) >> 0; ret.class$0 = (((b >>> 6 << 24 >>> 24) >> 0)); ret.isCompound = ((b & 32) >>> 0) === 32; ret.tag = ((((b & 31) >>> 0) >> 0)); if (ret.tag === 31) { _tuple = parseBase128Int(bytes$1, offset); ret.tag = _tuple[0]; offset = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [ret, offset, err]; } if (ret.tag < 31) { err = (x$3 = new SyntaxError.ptr("non-minimal tag"), new x$3.constructor.elem(x$3)); return [ret, offset, err]; } } if (offset >= bytes$1.$length) { err = (x$4 = new SyntaxError.ptr("truncated tag or length"), new x$4.constructor.elem(x$4)); return [ret, offset, err]; } b = ((offset < 0 || offset >= bytes$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : bytes$1.$array[bytes$1.$offset + offset]); offset = offset + (1) >> 0; if (((b & 128) >>> 0) === 0) { ret.length = ((((b & 127) >>> 0) >> 0)); } else { numBytes = ((((b & 127) >>> 0) >> 0)); if (numBytes === 0) { err = (x$5 = new SyntaxError.ptr("indefinite length found (not DER)"), new x$5.constructor.elem(x$5)); return [ret, offset, err]; } ret.length = 0; i = 0; while (true) { if (!(i < numBytes)) { break; } if (offset >= bytes$1.$length) { err = (x$6 = new SyntaxError.ptr("truncated tag or length"), new x$6.constructor.elem(x$6)); return [ret, offset, err]; } b = ((offset < 0 || offset >= bytes$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : bytes$1.$array[bytes$1.$offset + offset]); offset = offset + (1) >> 0; if (ret.length >= 8388608) { err = (x$7 = new StructuralError.ptr("length too large"), new x$7.constructor.elem(x$7)); return [ret, offset, err]; } ret.length = (y = (8), y < 32 ? (ret.length << y) : 0) >> 0; ret.length = ret.length | (((b >> 0))); if (ret.length === 0) { err = (x$8 = new StructuralError.ptr("superfluous leading zeros in length"), new x$8.constructor.elem(x$8)); return [ret, offset, err]; } i = i + (1) >> 0; } if (ret.length < 128) { err = (x$9 = new StructuralError.ptr("non-minimal length"), new x$9.constructor.elem(x$9)); return [ret, offset, err]; } } return [ret, offset, err]; }; parseSequenceOf = function(bytes$1, sliceType$6, elemType) { var _1, _r, _r$1, _r$2, _r$3, _tuple, _tuple$1, _tuple$2, bytes$1, compoundType, elemType, err, expectedTag, i, matchAny, numElements, offset, offset$1, ok, params, ret, sliceType$6, t, x$3, x$4, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _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; _tuple$2 = $f._tuple$2; bytes$1 = $f.bytes$1; compoundType = $f.compoundType; elemType = $f.elemType; err = $f.err; expectedTag = $f.expectedTag; i = $f.i; matchAny = $f.matchAny; numElements = $f.numElements; offset = $f.offset; offset$1 = $f.offset$1; ok = $f.ok; params = $f.params; ret = $f.ret; sliceType$6 = $f.sliceType$6; t = $f.t; 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: ret = new reflect.Value.ptr(ptrType$4.nil, 0, 0); err = $ifaceNil; _r = getUniversalType(elemType); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; matchAny = _tuple[0]; expectedTag = _tuple[1]; compoundType = _tuple[2]; ok = _tuple[3]; if (!ok) { err = (x$3 = new StructuralError.ptr("unknown Go type for slice"), new x$3.constructor.elem(x$3)); $s = -1; return [ret, err]; } numElements = 0; offset = 0; while (true) { if (!(offset < bytes$1.$length)) { break; } t = new tagAndLength.ptr(0, 0, 0, false); _tuple$1 = parseTagAndLength(bytes$1, offset); tagAndLength.copy(t, _tuple$1[0]); offset = _tuple$1[1]; err = _tuple$1[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ret, err]; } _1 = t.tag; if ((_1 === (22)) || (_1 === (27)) || (_1 === (20)) || (_1 === (12)) || (_1 === (18)) || (_1 === (30))) { t.tag = 19; } else if ((_1 === (24)) || (_1 === (23))) { t.tag = 23; } if (!matchAny && (!((t.class$0 === 0)) || !(t.isCompound === compoundType) || !((t.tag === expectedTag)))) { err = (x$4 = new StructuralError.ptr("sequence tag mismatch"), new x$4.constructor.elem(x$4)); $s = -1; return [ret, err]; } if (invalidLength(offset, t.length, bytes$1.$length)) { err = (x$5 = new SyntaxError.ptr("truncated sequence"), new x$5.constructor.elem(x$5)); $s = -1; return [ret, err]; } offset = offset + (t.length) >> 0; numElements = numElements + (1) >> 0; } _r$1 = reflect.MakeSlice(sliceType$6, numElements, numElements); /* */ $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; params = new fieldParameters.ptr(false, false, false, false, ptrType$2.nil, ptrType$3.nil, 0, 0, false, false); offset$1 = 0; i = 0; /* while (true) { */ case 3: /* if (!(i < numElements)) { break; } */ if(!(i < numElements)) { $s = 4; continue; } _r$2 = $clone(ret, reflect.Value).Index(i); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = parseField($clone(_r$2, reflect.Value), bytes$1, offset$1, $clone(params, fieldParameters)); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$2 = _r$3; offset$1 = _tuple$2[0]; err = _tuple$2[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ret, err]; } i = i + (1) >> 0; $s = 3; continue; case 4: $s = -1; return [ret, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: parseSequenceOf }; } $f._1 = _1; $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._tuple$2 = _tuple$2; $f.bytes$1 = bytes$1; $f.compoundType = compoundType; $f.elemType = elemType; $f.err = err; $f.expectedTag = expectedTag; $f.i = i; $f.matchAny = matchAny; $f.numElements = numElements; $f.offset = offset; $f.offset$1 = offset$1; $f.ok = ok; $f.params = params; $f.ret = ret; $f.sliceType$6 = sliceType$6; $f.t = t; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; invalidLength = function(offset, length, sliceLength) { var length, offset, sliceLength; return (offset + length >> 0) < offset || (offset + length >> 0) > sliceLength; }; parseField = function(v, bytes$1, initOffset, params) { var _1, _2, _3, _4, _arg, _arg$1, _arg$2, _arg$3, _arg$4, _arg$5, _arg$6, _arg$7, _arg$8, _arg$9, _r, _r$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$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _tuple, _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$26, _tuple$27, _tuple$28, _tuple$29, _tuple$3, _tuple$30, _tuple$31, _tuple$32, _tuple$4, _tuple$5, _tuple$6, _tuple$7, _tuple$8, _tuple$9, _v, _v$1, bytes$1, bytes$2, compoundType, err, err1, err1$1, err1$2, err1$3, err1$4, err1$5, expectedClass, expectedClass$1, expectedTag, field, fieldType, i, i$1, ifaceType, initOffset, innerBytes, innerBytes$1, innerOffset, matchAny, matchAnyClassAndTag, newSlice, offset, ok, ok$1, ok1, params, parsedBool, parsedInt, parsedInt$1, parsedInt$2, parsedInt$3, result, sliceType$6, structType, t, t$1, universalTag, v, v$1, v$2, v$3, v$4, v$5, v$6, v$7, v$8, val, x$10, x$11, x$12, x$13, 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; _1 = $f._1; _2 = $f._2; _3 = $f._3; _4 = $f._4; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _arg$4 = $f._arg$4; _arg$5 = $f._arg$5; _arg$6 = $f._arg$6; _arg$7 = $f._arg$7; _arg$8 = $f._arg$8; _arg$9 = $f._arg$9; _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$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$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; _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$26 = $f._tuple$26; _tuple$27 = $f._tuple$27; _tuple$28 = $f._tuple$28; _tuple$29 = $f._tuple$29; _tuple$3 = $f._tuple$3; _tuple$30 = $f._tuple$30; _tuple$31 = $f._tuple$31; _tuple$32 = $f._tuple$32; _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; _v = $f._v; _v$1 = $f._v$1; bytes$1 = $f.bytes$1; bytes$2 = $f.bytes$2; compoundType = $f.compoundType; err = $f.err; err1 = $f.err1; err1$1 = $f.err1$1; err1$2 = $f.err1$2; err1$3 = $f.err1$3; err1$4 = $f.err1$4; err1$5 = $f.err1$5; expectedClass = $f.expectedClass; expectedClass$1 = $f.expectedClass$1; expectedTag = $f.expectedTag; field = $f.field; fieldType = $f.fieldType; i = $f.i; i$1 = $f.i$1; ifaceType = $f.ifaceType; initOffset = $f.initOffset; innerBytes = $f.innerBytes; innerBytes$1 = $f.innerBytes$1; innerOffset = $f.innerOffset; matchAny = $f.matchAny; matchAnyClassAndTag = $f.matchAnyClassAndTag; newSlice = $f.newSlice; offset = $f.offset; ok = $f.ok; ok$1 = $f.ok$1; ok1 = $f.ok1; params = $f.params; parsedBool = $f.parsedBool; parsedInt = $f.parsedInt; parsedInt$1 = $f.parsedInt$1; parsedInt$2 = $f.parsedInt$2; parsedInt$3 = $f.parsedInt$3; result = $f.result; sliceType$6 = $f.sliceType$6; structType = $f.structType; t = $f.t; t$1 = $f.t$1; universalTag = $f.universalTag; v = $f.v; v$1 = $f.v$1; v$2 = $f.v$2; v$3 = $f.v$3; v$4 = $f.v$4; v$5 = $f.v$5; v$6 = $f.v$6; v$7 = $f.v$7; v$8 = $f.v$8; val = $f.val; x$10 = $f.x$10; x$11 = $f.x$11; x$12 = $f.x$12; x$13 = $f.x$13; 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: offset = 0; err = $ifaceNil; offset = initOffset; fieldType = $clone(v, reflect.Value).Type(); if (offset === bytes$1.$length) { if (!setDefaultValue($clone(v, reflect.Value), $clone(params, fieldParameters))) { err = (x$3 = new SyntaxError.ptr("sequence truncated"), new x$3.constructor.elem(x$3)); } $s = -1; return [offset, err]; } ifaceType = fieldType; _r = ifaceType.Kind(); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } if (!(_r === 20)) { _v = false; $s = 3; continue s; } _r$1 = ifaceType.NumMethod(); /* */ $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 === 0; case 3: /* */ if (_v) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v) { */ case 1: t = new tagAndLength.ptr(0, 0, 0, false); _tuple = parseTagAndLength(bytes$1, offset); tagAndLength.copy(t, _tuple[0]); offset = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [offset, err]; } if (invalidLength(offset, t.length, bytes$1.$length)) { err = (x$4 = new SyntaxError.ptr("data truncated"), new x$4.constructor.elem(x$4)); $s = -1; return [offset, err]; } result = $ifaceNil; /* */ if (!t.isCompound && (t.class$0 === 0)) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!t.isCompound && (t.class$0 === 0)) { */ case 6: innerBytes = $subslice(bytes$1, offset, (offset + t.length >> 0)); _1 = t.tag; /* */ if (_1 === (19)) { $s = 9; continue; } /* */ if (_1 === (18)) { $s = 10; continue; } /* */ if (_1 === (22)) { $s = 11; continue; } /* */ if (_1 === (20)) { $s = 12; continue; } /* */ if (_1 === (12)) { $s = 13; continue; } /* */ if (_1 === (2)) { $s = 14; continue; } /* */ if (_1 === (3)) { $s = 15; continue; } /* */ if (_1 === (6)) { $s = 16; continue; } /* */ if (_1 === (23)) { $s = 17; continue; } /* */ if (_1 === (24)) { $s = 18; continue; } /* */ if (_1 === (4)) { $s = 19; continue; } /* */ if (_1 === (30)) { $s = 20; continue; } /* */ $s = 21; continue; /* if (_1 === (19)) { */ case 9: _tuple$1 = parsePrintableString(innerBytes); result = new $String(_tuple$1[0]); err = _tuple$1[1]; $s = 21; continue; /* } else if (_1 === (18)) { */ case 10: _tuple$2 = parseNumericString(innerBytes); result = new $String(_tuple$2[0]); err = _tuple$2[1]; $s = 21; continue; /* } else if (_1 === (22)) { */ case 11: _tuple$3 = parseIA5String(innerBytes); result = new $String(_tuple$3[0]); err = _tuple$3[1]; $s = 21; continue; /* } else if (_1 === (20)) { */ case 12: _tuple$4 = parseT61String(innerBytes); result = new $String(_tuple$4[0]); err = _tuple$4[1]; $s = 21; continue; /* } else if (_1 === (12)) { */ case 13: _tuple$5 = parseUTF8String(innerBytes); result = new $String(_tuple$5[0]); err = _tuple$5[1]; $s = 21; continue; /* } else if (_1 === (2)) { */ case 14: _tuple$6 = parseInt64(innerBytes); result = _tuple$6[0]; err = _tuple$6[1]; $s = 21; continue; /* } else if (_1 === (3)) { */ case 15: _tuple$7 = parseBitString(innerBytes); result = new _tuple$7[0].constructor.elem(_tuple$7[0]); err = _tuple$7[1]; $s = 21; continue; /* } else if (_1 === (6)) { */ case 16: _tuple$8 = parseObjectIdentifier(innerBytes); result = _tuple$8[0]; err = _tuple$8[1]; $s = 21; continue; /* } else if (_1 === (23)) { */ case 17: _r$2 = parseUTCTime(innerBytes); /* */ $s = 22; case 22: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$9 = _r$2; result = new _tuple$9[0].constructor.elem(_tuple$9[0]); err = _tuple$9[1]; $s = 21; continue; /* } else if (_1 === (24)) { */ case 18: _r$3 = parseGeneralizedTime(innerBytes); /* */ $s = 23; case 23: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$10 = _r$3; result = new _tuple$10[0].constructor.elem(_tuple$10[0]); err = _tuple$10[1]; $s = 21; continue; /* } else if (_1 === (4)) { */ case 19: result = innerBytes; $s = 21; continue; /* } else if (_1 === (30)) { */ case 20: _tuple$11 = parseBMPString(innerBytes); result = new $String(_tuple$11[0]); err = _tuple$11[1]; /* } */ case 21: case 8: /* } */ case 7: offset = offset + (t.length) >> 0; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [offset, err]; } /* */ if (!($interfaceIsEqual(result, $ifaceNil))) { $s = 24; continue; } /* */ $s = 25; continue; /* if (!($interfaceIsEqual(result, $ifaceNil))) { */ case 24: _r$4 = reflect.ValueOf(result); /* */ $s = 26; case 26: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $r = $clone(v, reflect.Value).Set($clone(_r$4, reflect.Value)); /* */ $s = 27; case 27: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 25: $s = -1; return [offset, err]; /* } */ case 2: _tuple$12 = parseTagAndLength(bytes$1, offset); t$1 = $clone(_tuple$12[0], tagAndLength); offset = _tuple$12[1]; err = _tuple$12[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [offset, err]; } if (params.explicit) { expectedClass = 2; if (params.application) { expectedClass = 1; } if (offset === bytes$1.$length) { err = (x$5 = new StructuralError.ptr("explicit tag has no child"), new x$5.constructor.elem(x$5)); $s = -1; return [offset, err]; } if ((t$1.class$0 === expectedClass) && (t$1.tag === params.tag.$get()) && ((t$1.length === 0) || t$1.isCompound)) { if ($interfaceIsEqual(fieldType, rawValueType)) { } else if (t$1.length > 0) { _tuple$13 = parseTagAndLength(bytes$1, offset); tagAndLength.copy(t$1, _tuple$13[0]); offset = _tuple$13[1]; err = _tuple$13[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [offset, err]; } } else { if (!($interfaceIsEqual(fieldType, flagType))) { err = (x$6 = new StructuralError.ptr("zero length explicit tag was not an asn1.Flag"), new x$6.constructor.elem(x$6)); $s = -1; return [offset, err]; } $clone(v, reflect.Value).SetBool(true); $s = -1; return [offset, err]; } } else { ok = setDefaultValue($clone(v, reflect.Value), $clone(params, fieldParameters)); if (ok) { offset = initOffset; } else { err = (x$7 = new StructuralError.ptr("explicitly tagged member didn't match"), new x$7.constructor.elem(x$7)); } $s = -1; return [offset, err]; } } _r$5 = getUniversalType(fieldType); /* */ $s = 28; case 28: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$14 = _r$5; matchAny = _tuple$14[0]; universalTag = _tuple$14[1]; compoundType = _tuple$14[2]; ok1 = _tuple$14[3]; /* */ if (!ok1) { $s = 29; continue; } /* */ $s = 30; continue; /* if (!ok1) { */ case 29: _r$6 = fmt.Sprintf("unknown Go type: %v", new sliceType$4([fieldType])); /* */ $s = 31; case 31: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } err = (x$8 = new StructuralError.ptr(_r$6), new x$8.constructor.elem(x$8)); $s = -1; return [offset, err]; /* } */ case 30: if (universalTag === 19) { if (t$1.class$0 === 0) { _2 = t$1.tag; if ((_2 === (22)) || (_2 === (27)) || (_2 === (20)) || (_2 === (12)) || (_2 === (18)) || (_2 === (30))) { universalTag = t$1.tag; } } else if (!((params.stringType === 0))) { universalTag = params.stringType; } } if ((universalTag === 23) && (t$1.tag === 24) && (t$1.class$0 === 0)) { universalTag = 24; } if (params.set) { universalTag = 17; } matchAnyClassAndTag = matchAny; expectedClass$1 = 0; expectedTag = universalTag; if (!params.explicit && !(params.tag === ptrType$3.nil)) { expectedClass$1 = 2; expectedTag = params.tag.$get(); matchAnyClassAndTag = false; } if (!params.explicit && params.application && !(params.tag === ptrType$3.nil)) { expectedClass$1 = 1; expectedTag = params.tag.$get(); matchAnyClassAndTag = false; } if (!params.explicit && params.private$3 && !(params.tag === ptrType$3.nil)) { expectedClass$1 = 3; expectedTag = params.tag.$get(); matchAnyClassAndTag = false; } /* */ if (!matchAnyClassAndTag && (!((t$1.class$0 === expectedClass$1)) || !((t$1.tag === expectedTag))) || (!matchAny && !(t$1.isCompound === compoundType))) { $s = 32; continue; } /* */ $s = 33; continue; /* if (!matchAnyClassAndTag && (!((t$1.class$0 === expectedClass$1)) || !((t$1.tag === expectedTag))) || (!matchAny && !(t$1.isCompound === compoundType))) { */ case 32: ok$1 = setDefaultValue($clone(v, reflect.Value), $clone(params, fieldParameters)); /* */ if (ok$1) { $s = 34; continue; } /* */ $s = 35; continue; /* if (ok$1) { */ case 34: offset = initOffset; $s = 36; continue; /* } else { */ case 35: _arg = new $Int(expectedTag); _arg$1 = new t$1.constructor.elem(t$1); _arg$2 = new params.constructor.elem(params); _r$7 = fieldType.Name(); /* */ $s = 37; case 37: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _arg$3 = new $String(_r$7); _arg$4 = new $Int(offset); _r$8 = fmt.Sprintf("tags don't match (%d vs %+v) %+v %s @%d", new sliceType$4([_arg, _arg$1, _arg$2, _arg$3, _arg$4])); /* */ $s = 38; case 38: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } err = (x$9 = new StructuralError.ptr(_r$8), new x$9.constructor.elem(x$9)); /* } */ case 36: $s = -1; return [offset, err]; /* } */ case 33: if (invalidLength(offset, t$1.length, bytes$1.$length)) { err = (x$10 = new SyntaxError.ptr("data truncated"), new x$10.constructor.elem(x$10)); $s = -1; return [offset, err]; } innerBytes$1 = $subslice(bytes$1, offset, (offset + t$1.length >> 0)); offset = offset + (t$1.length) >> 0; _r$9 = $clone($clone(v, reflect.Value).Addr(), reflect.Value).Interface(); /* */ $s = 39; case 39: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _ref = _r$9; /* */ if ($assertType(_ref, ptrType$5, true)[1]) { $s = 40; continue; } /* */ if ($assertType(_ref, ptrType$6, true)[1]) { $s = 41; continue; } /* */ if ($assertType(_ref, ptrType$7, true)[1]) { $s = 42; continue; } /* */ if ($assertType(_ref, ptrType$8, true)[1]) { $s = 43; continue; } /* */ if ($assertType(_ref, ptrType$9, true)[1]) { $s = 44; continue; } /* */ if ($assertType(_ref, ptrType$10, true)[1]) { $s = 45; continue; } /* */ if ($assertType(_ref, ptrType$11, true)[1]) { $s = 46; continue; } /* */ $s = 47; continue; /* if ($assertType(_ref, ptrType$5, true)[1]) { */ case 40: v$1 = _ref.$val; RawValue.copy(v$1, new RawValue.ptr(t$1.class$0, t$1.tag, t$1.isCompound, innerBytes$1, $subslice(bytes$1, initOffset, offset))); $s = -1; return [offset, err]; /* } else if ($assertType(_ref, ptrType$6, true)[1]) { */ case 41: v$2 = _ref.$val; _tuple$15 = parseObjectIdentifier(innerBytes$1); v$2.$set(_tuple$15[0]); err = _tuple$15[1]; $s = -1; return [offset, err]; /* } else if ($assertType(_ref, ptrType$7, true)[1]) { */ case 42: v$3 = _ref.$val; _tuple$16 = parseBitString(innerBytes$1); BitString.copy(v$3, _tuple$16[0]); err = _tuple$16[1]; $s = -1; return [offset, err]; /* } else if ($assertType(_ref, ptrType$8, true)[1]) { */ case 43: v$4 = _ref.$val; /* */ if (universalTag === 23) { $s = 48; continue; } /* */ $s = 49; continue; /* if (universalTag === 23) { */ case 48: _r$10 = parseUTCTime(innerBytes$1); /* */ $s = 50; case 50: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$17 = _r$10; time.Time.copy(v$4, _tuple$17[0]); err = _tuple$17[1]; $s = -1; return [offset, err]; /* } */ case 49: _r$11 = parseGeneralizedTime(innerBytes$1); /* */ $s = 51; case 51: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tuple$18 = _r$11; time.Time.copy(v$4, _tuple$18[0]); err = _tuple$18[1]; $s = -1; return [offset, err]; /* } else if ($assertType(_ref, ptrType$9, true)[1]) { */ case 44: v$5 = _ref.$val; _tuple$19 = parseInt32(innerBytes$1); parsedInt = _tuple$19[0]; err1 = _tuple$19[1]; if ($interfaceIsEqual(err1, $ifaceNil)) { v$5.$set(((parsedInt >> 0))); } err = err1; $s = -1; return [offset, err]; /* } else if ($assertType(_ref, ptrType$10, true)[1]) { */ case 45: v$6 = _ref.$val; v$6.$set(true); $s = -1; return [offset, err]; /* } else if ($assertType(_ref, ptrType$11, true)[1]) { */ case 46: v$7 = _ref.$val; _r$12 = parseBigInt(innerBytes$1); /* */ $s = 52; case 52: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _tuple$20 = _r$12; parsedInt$1 = _tuple$20[0]; err1$1 = _tuple$20[1]; if ($interfaceIsEqual(err1$1, $ifaceNil)) { v$7.$set(parsedInt$1); } err = err1$1; $s = -1; return [offset, err]; /* } */ case 47: val = v; _3 = $clone(val, reflect.Value).Kind(); /* */ if (_3 === (1)) { $s = 54; continue; } /* */ if ((_3 === (2)) || (_3 === (5)) || (_3 === (6))) { $s = 55; continue; } /* */ if (_3 === (25)) { $s = 56; continue; } /* */ if (_3 === (23)) { $s = 57; continue; } /* */ if (_3 === (24)) { $s = 58; continue; } /* */ $s = 59; continue; /* if (_3 === (1)) { */ case 54: _tuple$21 = parseBool(innerBytes$1); parsedBool = _tuple$21[0]; err1$2 = _tuple$21[1]; if ($interfaceIsEqual(err1$2, $ifaceNil)) { $clone(val, reflect.Value).SetBool(parsedBool); } err = err1$2; $s = -1; return [offset, err]; /* } else if ((_3 === (2)) || (_3 === (5)) || (_3 === (6))) { */ case 55: _r$13 = $clone(val, reflect.Value).Type().Size(); /* */ $s = 63; case 63: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } /* */ if (_r$13 === 4) { $s = 60; continue; } /* */ $s = 61; continue; /* if (_r$13 === 4) { */ case 60: _tuple$22 = parseInt32(innerBytes$1); parsedInt$2 = _tuple$22[0]; err1$3 = _tuple$22[1]; if ($interfaceIsEqual(err1$3, $ifaceNil)) { $clone(val, reflect.Value).SetInt((new $Int64(0, parsedInt$2))); } err = err1$3; $s = 62; continue; /* } else { */ case 61: _tuple$23 = parseInt64(innerBytes$1); parsedInt$3 = _tuple$23[0]; err1$4 = _tuple$23[1]; if ($interfaceIsEqual(err1$4, $ifaceNil)) { $clone(val, reflect.Value).SetInt(parsedInt$3); } err = err1$4; /* } */ case 62: $s = -1; return [offset, err]; /* } else if (_3 === (25)) { */ case 56: structType = fieldType; i = 0; /* while (true) { */ case 64: _r$14 = structType.NumField(); /* */ $s = 66; case 66: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } /* if (!(i < _r$14)) { break; } */ if(!(i < _r$14)) { $s = 65; continue; } _r$15 = structType.Field(i); /* */ $s = 69; case 69: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _r$16 = $clone(_r$15, reflect.StructField).IsExported(); /* */ $s = 70; case 70: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } /* */ if (!_r$16) { $s = 67; continue; } /* */ $s = 68; continue; /* if (!_r$16) { */ case 67: err = (x$11 = new StructuralError.ptr("struct contains unexported fields"), new x$11.constructor.elem(x$11)); $s = -1; return [offset, err]; /* } */ case 68: i = i + (1) >> 0; $s = 64; continue; case 65: _r$17 = structType.NumField(); /* */ $s = 74; case 74: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } if (!(_r$17 > 0)) { _v$1 = false; $s = 73; continue s; } _r$18 = structType.Field(0); /* */ $s = 75; case 75: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } _v$1 = $interfaceIsEqual(_r$18.Type, rawContentsType); case 73: /* */ if (_v$1) { $s = 71; continue; } /* */ $s = 72; continue; /* if (_v$1) { */ case 71: bytes$2 = $subslice(bytes$1, initOffset, offset); _r$19 = $clone(val, reflect.Value).Field(0); /* */ $s = 76; case 76: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } _r$20 = reflect.ValueOf(($convertSliceType(bytes$2, RawContent))); /* */ $s = 77; case 77: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } $r = $clone(_r$19, reflect.Value).Set($clone(_r$20, reflect.Value)); /* */ $s = 78; case 78: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 72: innerOffset = 0; i$1 = 0; /* while (true) { */ case 79: _r$21 = structType.NumField(); /* */ $s = 81; case 81: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } /* if (!(i$1 < _r$21)) { break; } */ if(!(i$1 < _r$21)) { $s = 80; continue; } _r$22 = structType.Field(i$1); /* */ $s = 82; case 82: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; } field = $clone(_r$22, reflect.StructField); if ((i$1 === 0) && $interfaceIsEqual(field.Type, rawContentsType)) { i$1 = i$1 + (1) >> 0; /* continue; */ $s = 79; continue; } _r$23 = $clone(val, reflect.Value).Field(i$1); /* */ $s = 83; case 83: if($c) { $c = false; _r$23 = _r$23.$blk(); } if (_r$23 && _r$23.$blk !== undefined) { break s; } _r$24 = parseField($clone(_r$23, reflect.Value), innerBytes$1, innerOffset, $clone(parseFieldParameters(new reflect.StructTag(field.Tag).Get("asn1")), fieldParameters)); /* */ $s = 84; case 84: if($c) { $c = false; _r$24 = _r$24.$blk(); } if (_r$24 && _r$24.$blk !== undefined) { break s; } _tuple$24 = _r$24; innerOffset = _tuple$24[0]; err = _tuple$24[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [offset, err]; } i$1 = i$1 + (1) >> 0; $s = 79; continue; case 80: $s = -1; return [offset, err]; /* } else if (_3 === (23)) { */ case 57: sliceType$6 = fieldType; _r$25 = sliceType$6.Elem(); /* */ $s = 87; case 87: if($c) { $c = false; _r$25 = _r$25.$blk(); } if (_r$25 && _r$25.$blk !== undefined) { break s; } _r$26 = _r$25.Kind(); /* */ $s = 88; case 88: if($c) { $c = false; _r$26 = _r$26.$blk(); } if (_r$26 && _r$26.$blk !== undefined) { break s; } /* */ if (_r$26 === 8) { $s = 85; continue; } /* */ $s = 86; continue; /* if (_r$26 === 8) { */ case 85: _r$27 = reflect.MakeSlice(sliceType$6, innerBytes$1.$length, innerBytes$1.$length); /* */ $s = 89; case 89: if($c) { $c = false; _r$27 = _r$27.$blk(); } if (_r$27 && _r$27.$blk !== undefined) { break s; } $r = $clone(val, reflect.Value).Set($clone(_r$27, reflect.Value)); /* */ $s = 90; case 90: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _arg$5 = $clone(val, reflect.Value); _r$28 = reflect.ValueOf(innerBytes$1); /* */ $s = 91; case 91: if($c) { $c = false; _r$28 = _r$28.$blk(); } if (_r$28 && _r$28.$blk !== undefined) { break s; } _arg$6 = $clone(_r$28, reflect.Value); _r$29 = reflect.Copy(_arg$5, _arg$6); /* */ $s = 92; case 92: if($c) { $c = false; _r$29 = _r$29.$blk(); } if (_r$29 && _r$29.$blk !== undefined) { break s; } _r$29; $s = -1; return [offset, err]; /* } */ case 86: _arg$7 = innerBytes$1; _arg$8 = sliceType$6; _r$30 = sliceType$6.Elem(); /* */ $s = 93; case 93: if($c) { $c = false; _r$30 = _r$30.$blk(); } if (_r$30 && _r$30.$blk !== undefined) { break s; } _arg$9 = _r$30; _r$31 = parseSequenceOf(_arg$7, _arg$8, _arg$9); /* */ $s = 94; case 94: if($c) { $c = false; _r$31 = _r$31.$blk(); } if (_r$31 && _r$31.$blk !== undefined) { break s; } _tuple$25 = _r$31; newSlice = _tuple$25[0]; err1$5 = _tuple$25[1]; /* */ if ($interfaceIsEqual(err1$5, $ifaceNil)) { $s = 95; continue; } /* */ $s = 96; continue; /* if ($interfaceIsEqual(err1$5, $ifaceNil)) { */ case 95: $r = $clone(val, reflect.Value).Set($clone(newSlice, reflect.Value)); /* */ $s = 97; case 97: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 96: err = err1$5; $s = -1; return [offset, err]; /* } else if (_3 === (24)) { */ case 58: v$8 = ""; _4 = universalTag; /* */ if (_4 === (19)) { $s = 99; continue; } /* */ if (_4 === (18)) { $s = 100; continue; } /* */ if (_4 === (22)) { $s = 101; continue; } /* */ if (_4 === (20)) { $s = 102; continue; } /* */ if (_4 === (12)) { $s = 103; continue; } /* */ if (_4 === (27)) { $s = 104; continue; } /* */ if (_4 === (30)) { $s = 105; continue; } /* */ $s = 106; continue; /* if (_4 === (19)) { */ case 99: _tuple$26 = parsePrintableString(innerBytes$1); v$8 = _tuple$26[0]; err = _tuple$26[1]; $s = 107; continue; /* } else if (_4 === (18)) { */ case 100: _tuple$27 = parseNumericString(innerBytes$1); v$8 = _tuple$27[0]; err = _tuple$27[1]; $s = 107; continue; /* } else if (_4 === (22)) { */ case 101: _tuple$28 = parseIA5String(innerBytes$1); v$8 = _tuple$28[0]; err = _tuple$28[1]; $s = 107; continue; /* } else if (_4 === (20)) { */ case 102: _tuple$29 = parseT61String(innerBytes$1); v$8 = _tuple$29[0]; err = _tuple$29[1]; $s = 107; continue; /* } else if (_4 === (12)) { */ case 103: _tuple$30 = parseUTF8String(innerBytes$1); v$8 = _tuple$30[0]; err = _tuple$30[1]; $s = 107; continue; /* } else if (_4 === (27)) { */ case 104: _tuple$31 = parseT61String(innerBytes$1); v$8 = _tuple$31[0]; err = _tuple$31[1]; $s = 107; continue; /* } else if (_4 === (30)) { */ case 105: _tuple$32 = parseBMPString(innerBytes$1); v$8 = _tuple$32[0]; err = _tuple$32[1]; $s = 107; continue; /* } else { */ case 106: _r$32 = fmt.Sprintf("internal error: unknown string type %d", new sliceType$4([new $Int(universalTag)])); /* */ $s = 108; case 108: if($c) { $c = false; _r$32 = _r$32.$blk(); } if (_r$32 && _r$32.$blk !== undefined) { break s; } err = (x$12 = new SyntaxError.ptr(_r$32), new x$12.constructor.elem(x$12)); /* } */ case 107: case 98: if ($interfaceIsEqual(err, $ifaceNil)) { $clone(val, reflect.Value).SetString(v$8); } $s = -1; return [offset, err]; /* } */ case 59: case 53: _r$33 = $clone(v, reflect.Value).Type().String(); /* */ $s = 109; case 109: if($c) { $c = false; _r$33 = _r$33.$blk(); } if (_r$33 && _r$33.$blk !== undefined) { break s; } err = (x$13 = new StructuralError.ptr("unsupported: " + _r$33), new x$13.constructor.elem(x$13)); $s = -1; return [offset, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: parseField }; } $f._1 = _1; $f._2 = _2; $f._3 = _3; $f._4 = _4; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._arg$4 = _arg$4; $f._arg$5 = _arg$5; $f._arg$6 = _arg$6; $f._arg$7 = _arg$7; $f._arg$8 = _arg$8; $f._arg$9 = _arg$9; $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$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$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._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$26 = _tuple$26; $f._tuple$27 = _tuple$27; $f._tuple$28 = _tuple$28; $f._tuple$29 = _tuple$29; $f._tuple$3 = _tuple$3; $f._tuple$30 = _tuple$30; $f._tuple$31 = _tuple$31; $f._tuple$32 = _tuple$32; $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._v = _v; $f._v$1 = _v$1; $f.bytes$1 = bytes$1; $f.bytes$2 = bytes$2; $f.compoundType = compoundType; $f.err = err; $f.err1 = err1; $f.err1$1 = err1$1; $f.err1$2 = err1$2; $f.err1$3 = err1$3; $f.err1$4 = err1$4; $f.err1$5 = err1$5; $f.expectedClass = expectedClass; $f.expectedClass$1 = expectedClass$1; $f.expectedTag = expectedTag; $f.field = field; $f.fieldType = fieldType; $f.i = i; $f.i$1 = i$1; $f.ifaceType = ifaceType; $f.initOffset = initOffset; $f.innerBytes = innerBytes; $f.innerBytes$1 = innerBytes$1; $f.innerOffset = innerOffset; $f.matchAny = matchAny; $f.matchAnyClassAndTag = matchAnyClassAndTag; $f.newSlice = newSlice; $f.offset = offset; $f.ok = ok; $f.ok$1 = ok$1; $f.ok1 = ok1; $f.params = params; $f.parsedBool = parsedBool; $f.parsedInt = parsedInt; $f.parsedInt$1 = parsedInt$1; $f.parsedInt$2 = parsedInt$2; $f.parsedInt$3 = parsedInt$3; $f.result = result; $f.sliceType$6 = sliceType$6; $f.structType = structType; $f.t = t; $f.t$1 = t$1; $f.universalTag = universalTag; $f.v = v; $f.v$1 = v$1; $f.v$2 = v$2; $f.v$3 = v$3; $f.v$4 = v$4; $f.v$5 = v$5; $f.v$6 = v$6; $f.v$7 = v$7; $f.v$8 = v$8; $f.val = val; $f.x$10 = x$10; $f.x$11 = x$11; $f.x$12 = x$12; $f.x$13 = x$13; $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; }; canHaveDefaultValue = function(k) { var _1, k; _1 = k; if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { return true; } return false; }; setDefaultValue = function(v, params) { var ok, params, v; ok = false; if (!params.optional) { return ok; } ok = true; if (params.defaultValue === ptrType$2.nil) { return ok; } if (canHaveDefaultValue($clone(v, reflect.Value).Kind())) { $clone(v, reflect.Value).SetInt(params.defaultValue.$get()); } return ok; }; Unmarshal = function(b, val) { var $24r, _r, _tuple, b, err, rest, val, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _tuple = $f._tuple; b = $f.b; err = $f.err; rest = $f.rest; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rest = sliceType.nil; err = $ifaceNil; _r = UnmarshalWithParams(b, val, ""); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; rest = _tuple[0]; err = _tuple[1]; $24r = [rest, err]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Unmarshal }; } $f.$24r = $24r; $f._r = _r; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.rest = rest; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Unmarshal = Unmarshal; invalidUnmarshalError.ptr.prototype.Error = function() { var $24r, $24r$1, _r, _r$1, _r$2, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; if ($interfaceIsEqual(e.Type, $ifaceNil)) { $s = -1; return "asn1: Unmarshal recipient value is nil"; } _r = e.Type.Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (!((_r === 22))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((_r === 22))) { */ case 1: _r$1 = e.Type.String(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = "asn1: Unmarshal recipient value is non-pointer " + _r$1; $s = 5; case 5: return $24r; /* } */ case 2: _r$2 = e.Type.String(); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r$1 = "asn1: Unmarshal recipient value is nil " + _r$2; $s = 7; case 7: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: invalidUnmarshalError.ptr.prototype.Error }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; invalidUnmarshalError.prototype.Error = function() { return this.$val.Error(); }; UnmarshalWithParams = function(b, val, params) { var _r, _r$1, _r$2, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, b, err, offset, params, rest, v, val, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; b = $f.b; err = $f.err; offset = $f.offset; params = $f.params; rest = $f.rest; v = $f.v; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rest = sliceType.nil; err = $ifaceNil; _r = reflect.ValueOf(val); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } v = _r; if (!(($clone(v, reflect.Value).Kind() === 22)) || $clone(v, reflect.Value).IsNil()) { _tmp = sliceType.nil; _tmp$1 = new invalidUnmarshalError.ptr(reflect.TypeOf(val)); rest = _tmp; err = _tmp$1; $s = -1; return [rest, err]; } _r$1 = $clone(v, reflect.Value).Elem(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = parseField($clone(_r$1, reflect.Value), b, 0, $clone(parseFieldParameters(params), fieldParameters)); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; offset = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$2 = sliceType.nil; _tmp$3 = err; rest = _tmp$2; err = _tmp$3; $s = -1; return [rest, err]; } _tmp$4 = $subslice(b, offset); _tmp$5 = $ifaceNil; rest = _tmp$4; err = _tmp$5; $s = -1; return [rest, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: UnmarshalWithParams }; } $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.b = b; $f.err = err; $f.offset = offset; $f.params = params; $f.rest = rest; $f.v = v; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.UnmarshalWithParams = UnmarshalWithParams; byteEncoder.methods = [{prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Encode", name: "Encode", pkg: "", typ: $funcType([sliceType], [], false)}]; bytesEncoder.methods = [{prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Encode", name: "Encode", pkg: "", typ: $funcType([sliceType], [], false)}]; stringEncoder.methods = [{prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Encode", name: "Encode", pkg: "", typ: $funcType([sliceType], [], false)}]; multiEncoder.methods = [{prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Encode", name: "Encode", pkg: "", typ: $funcType([sliceType], [], false)}]; setEncoder.methods = [{prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Encode", name: "Encode", pkg: "", typ: $funcType([sliceType], [], false)}]; ptrType$12.methods = [{prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Encode", name: "Encode", pkg: "", typ: $funcType([sliceType], [], false)}]; int64Encoder.methods = [{prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Encode", name: "Encode", pkg: "", typ: $funcType([sliceType], [], false)}]; bitStringEncoder.methods = [{prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Encode", name: "Encode", pkg: "", typ: $funcType([sliceType], [], false)}]; oidEncoder.methods = [{prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Encode", name: "Encode", pkg: "", typ: $funcType([sliceType], [], false)}]; StructuralError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; SyntaxError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; BitString.methods = [{prop: "At", name: "At", pkg: "", typ: $funcType([$Int], [$Int], false)}, {prop: "RightAlign", name: "RightAlign", pkg: "", typ: $funcType([], [sliceType], false)}]; ObjectIdentifier.methods = [{prop: "Equal", name: "Equal", pkg: "", typ: $funcType([ObjectIdentifier], [$Bool], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$13.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; encoder.init([{prop: "Encode", name: "Encode", pkg: "", typ: $funcType([sliceType], [], false)}, {prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}]); bytesEncoder.init($Uint8); multiEncoder.init(encoder); setEncoder.init(encoder); taggedEncoder.init("encoding/asn1", [{prop: "scratch", name: "scratch", embedded: false, exported: false, typ: arrayType$1, tag: ""}, {prop: "tag", name: "tag", embedded: false, exported: false, typ: encoder, tag: ""}, {prop: "body", name: "body", embedded: false, exported: false, typ: encoder, tag: ""}]); bitStringEncoder.init("", [{prop: "Bytes", name: "Bytes", embedded: false, exported: true, typ: sliceType, tag: ""}, {prop: "BitLength", name: "BitLength", embedded: false, exported: true, typ: $Int, tag: ""}]); oidEncoder.init($Int); tagAndLength.init("encoding/asn1", [{prop: "class$0", name: "class", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "tag", name: "tag", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "length", name: "length", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "isCompound", name: "isCompound", embedded: false, exported: false, typ: $Bool, tag: ""}]); fieldParameters.init("encoding/asn1", [{prop: "optional", name: "optional", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "explicit", name: "explicit", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "application", name: "application", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "private$3", name: "private", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "defaultValue", name: "defaultValue", embedded: false, exported: false, typ: ptrType$2, tag: ""}, {prop: "tag", name: "tag", embedded: false, exported: false, typ: ptrType$3, tag: ""}, {prop: "stringType", name: "stringType", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "timeType", name: "timeType", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "set", name: "set", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "omitEmpty", name: "omitEmpty", embedded: false, exported: false, typ: $Bool, tag: ""}]); StructuralError.init("", [{prop: "Msg", name: "Msg", embedded: false, exported: true, typ: $String, tag: ""}]); SyntaxError.init("", [{prop: "Msg", name: "Msg", embedded: false, exported: true, typ: $String, tag: ""}]); BitString.init("", [{prop: "Bytes", name: "Bytes", embedded: false, exported: true, typ: sliceType, tag: ""}, {prop: "BitLength", name: "BitLength", embedded: false, exported: true, typ: $Int, tag: ""}]); ObjectIdentifier.init($Int); RawValue.init("", [{prop: "Class", name: "Class", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Tag", name: "Tag", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "IsCompound", name: "IsCompound", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "Bytes", name: "Bytes", embedded: false, exported: true, typ: sliceType, tag: ""}, {prop: "FullBytes", name: "FullBytes", embedded: false, exported: true, typ: sliceType, tag: ""}]); RawContent.init($Uint8); invalidUnmarshalError.init("", [{prop: "Type", name: "Type", embedded: false, exported: true, typ: reflect.Type, 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 = errors.$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 = math.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = big.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = reflect.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sort.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strconv.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strings.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = time.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = utf16.$init(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = utf8.$init(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } byte00Encoder = new byteEncoder(0); byteFFEncoder = new byteEncoder(255); bigOne = big.NewInt(new $Int64(0, 1)); $pkg.NullRawValue = new RawValue.ptr(0, 5, false, sliceType.nil, sliceType.nil); $pkg.NullBytes = new sliceType([5, 0]); bitStringType = reflect.TypeOf((x = new BitString.ptr(sliceType.nil, 0), new x.constructor.elem(x))); objectIdentifierType = reflect.TypeOf(new ObjectIdentifier([])); enumeratedType = reflect.TypeOf(new Enumerated(0)); flagType = reflect.TypeOf(new Flag(false)); timeType = reflect.TypeOf((x$1 = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil), new x$1.constructor.elem(x$1))); rawValueType = reflect.TypeOf((x$2 = new RawValue.ptr(0, 0, false, sliceType.nil, sliceType.nil), new x$2.constructor.elem(x$2))); rawContentsType = reflect.TypeOf((RawContent.nil)); bigIntType = reflect.TypeOf(new big.Int.ptr(false, big.nat.nil)); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["vendor/golang.org/x/crypto/cryptobyte/asn1"] = (function() { var $pkg = {}, $init, Tag; Tag = $pkg.Tag = $newType(1, $kindUint8, "asn1.Tag", true, "vendor/golang.org/x/crypto/cryptobyte/asn1", true, null); Tag.prototype.Constructed = function() { var t; t = this.$val; return (t | 32) >>> 0; }; $ptrType(Tag).prototype.Constructed = function() { return new Tag(this.$get()).Constructed(); }; Tag.prototype.ContextSpecific = function() { var t; t = this.$val; return (t | 128) >>> 0; }; $ptrType(Tag).prototype.ContextSpecific = function() { return new Tag(this.$get()).ContextSpecific(); }; Tag.methods = [{prop: "Constructed", name: "Constructed", pkg: "", typ: $funcType([], [Tag], false)}, {prop: "ContextSpecific", name: "ContextSpecific", pkg: "", typ: $funcType([], [Tag], 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["vendor/golang.org/x/crypto/cryptobyte"] = (function() { var $pkg = {}, $init, asn1, errors, fmt, big, reflect, time, asn1$1, String, Builder, BuilderContinuation, BuildError, MarshalingValue, ptrType, sliceType, ptrType$1, ptrType$2, sliceType$1, ptrType$3, ptrType$4, ptrType$5, ptrType$6, sliceType$2, ptrType$7, ptrType$8, ptrType$9, ptrType$10, ptrType$11, ptrType$12, ptrType$13, ptrType$14, bigIntType, bigOne, _r, NewBuilder, isValidOID, checkASN1Integer, asn1Signed, asn1Unsigned; asn1 = $packages["encoding/asn1"]; errors = $packages["errors"]; fmt = $packages["fmt"]; big = $packages["math/big"]; reflect = $packages["reflect"]; time = $packages["time"]; asn1$1 = $packages["vendor/golang.org/x/crypto/cryptobyte/asn1"]; String = $pkg.String = $newType(12, $kindSlice, "cryptobyte.String", true, "vendor/golang.org/x/crypto/cryptobyte", true, null); Builder = $pkg.Builder = $newType(0, $kindStruct, "cryptobyte.Builder", true, "vendor/golang.org/x/crypto/cryptobyte", true, function(err_, result_, fixedSize_, child_, offset_, pendingLenLen_, pendingIsASN1_, inContinuation_) { this.$val = this; if (arguments.length === 0) { this.err = $ifaceNil; this.result = sliceType.nil; this.fixedSize = false; this.child = ptrType$1.nil; this.offset = 0; this.pendingLenLen = 0; this.pendingIsASN1 = false; this.inContinuation = ptrType$2.nil; return; } this.err = err_; this.result = result_; this.fixedSize = fixedSize_; this.child = child_; this.offset = offset_; this.pendingLenLen = pendingLenLen_; this.pendingIsASN1 = pendingIsASN1_; this.inContinuation = inContinuation_; }); BuilderContinuation = $pkg.BuilderContinuation = $newType(4, $kindFunc, "cryptobyte.BuilderContinuation", true, "vendor/golang.org/x/crypto/cryptobyte", true, null); BuildError = $pkg.BuildError = $newType(0, $kindStruct, "cryptobyte.BuildError", true, "vendor/golang.org/x/crypto/cryptobyte", true, function(Err_) { this.$val = this; if (arguments.length === 0) { this.Err = $ifaceNil; return; } this.Err = Err_; }); MarshalingValue = $pkg.MarshalingValue = $newType(8, $kindInterface, "cryptobyte.MarshalingValue", true, "vendor/golang.org/x/crypto/cryptobyte", true, null); ptrType = $ptrType(big.Int); sliceType = $sliceType($Uint8); ptrType$1 = $ptrType(Builder); ptrType$2 = $ptrType($Bool); sliceType$1 = $sliceType($emptyInterface); ptrType$3 = $ptrType($Uint8); ptrType$4 = $ptrType(String); ptrType$5 = $ptrType($Int64); ptrType$6 = $ptrType($Uint64); sliceType$2 = $sliceType($Int); ptrType$7 = $ptrType($Int); ptrType$8 = $ptrType(asn1$1.Tag); ptrType$9 = $ptrType($Uint32); ptrType$10 = $ptrType(sliceType); ptrType$11 = $ptrType($Uint16); ptrType$12 = $ptrType(asn1.ObjectIdentifier); ptrType$13 = $ptrType(time.Time); ptrType$14 = $ptrType(asn1.BitString); $ptrType(String).prototype.read = function(n) { var n, s, v; s = this; if (s.$get().$length < n || n < 0) { return sliceType.nil; } v = $subslice((s.$get()), 0, n); s.$set($subslice((s.$get()), n)); return $convertSliceType(v, sliceType); }; $ptrType(String).prototype.Skip = function(n) { var n, s; s = this; return !(s.read(n) === sliceType.nil); }; $ptrType(String).prototype.ReadUint8 = function(out) { var out, s, v; s = this; v = s.read(1); if (v === sliceType.nil) { return false; } out.$set(((0 >= v.$length ? ($throwRuntimeError("index out of range"), undefined) : v.$array[v.$offset + 0]))); return true; }; $ptrType(String).prototype.ReadUint16 = function(out) { var out, s, v; s = this; v = s.read(2); if (v === sliceType.nil) { return false; } out.$set((((((0 >= v.$length ? ($throwRuntimeError("index out of range"), undefined) : v.$array[v.$offset + 0]) << 16 >>> 16)) << 8 << 16 >>> 16) | (((1 >= v.$length ? ($throwRuntimeError("index out of range"), undefined) : v.$array[v.$offset + 1]) << 16 >>> 16))) >>> 0); return true; }; $ptrType(String).prototype.ReadUint24 = function(out) { var out, s, v; s = this; v = s.read(3); if (v === sliceType.nil) { return false; } out.$set((((((((0 >= v.$length ? ($throwRuntimeError("index out of range"), undefined) : v.$array[v.$offset + 0]) >>> 0)) << 16 >>> 0) | ((((1 >= v.$length ? ($throwRuntimeError("index out of range"), undefined) : v.$array[v.$offset + 1]) >>> 0)) << 8 >>> 0)) >>> 0) | (((2 >= v.$length ? ($throwRuntimeError("index out of range"), undefined) : v.$array[v.$offset + 2]) >>> 0))) >>> 0); return true; }; $ptrType(String).prototype.ReadUint32 = function(out) { var out, s, v; s = this; v = s.read(4); if (v === sliceType.nil) { return false; } out.$set((((((((((0 >= v.$length ? ($throwRuntimeError("index out of range"), undefined) : v.$array[v.$offset + 0]) >>> 0)) << 24 >>> 0) | ((((1 >= v.$length ? ($throwRuntimeError("index out of range"), undefined) : v.$array[v.$offset + 1]) >>> 0)) << 16 >>> 0)) >>> 0) | ((((2 >= v.$length ? ($throwRuntimeError("index out of range"), undefined) : v.$array[v.$offset + 2]) >>> 0)) << 8 >>> 0)) >>> 0) | (((3 >= v.$length ? ($throwRuntimeError("index out of range"), undefined) : v.$array[v.$offset + 3]) >>> 0))) >>> 0); return true; }; $ptrType(String).prototype.readUnsigned = function(out, length) { var i, length, out, result, s, v, y; s = this; v = s.read(length); if (v === sliceType.nil) { return false; } result = 0; i = 0; while (true) { if (!(i < length)) { break; } result = (y = (8), y < 32 ? (result << y) : 0) >>> 0; result = (result | (((((i < 0 || i >= v.$length) ? ($throwRuntimeError("index out of range"), undefined) : v.$array[v.$offset + i]) >>> 0)))) >>> 0; i = i + (1) >> 0; } out.$set(result); return true; }; $ptrType(String).prototype.readLengthPrefixed = function(lenLen, outChild) { var _i, _ref, b, lenBytes, lenLen, length, outChild, s, v; s = this; lenBytes = s.read(lenLen); if (lenBytes === sliceType.nil) { return false; } length = 0; _ref = lenBytes; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } b = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); length = length << 8 >>> 0; length = (length | ((b >>> 0))) >>> 0; _i++; } v = s.read(((length >> 0))); if (v === sliceType.nil) { return false; } outChild.$set($convertSliceType(v, String)); return true; }; $ptrType(String).prototype.ReadUint8LengthPrefixed = function(out) { var out, s; s = this; return s.readLengthPrefixed(1, out); }; $ptrType(String).prototype.ReadUint16LengthPrefixed = function(out) { var out, s; s = this; return s.readLengthPrefixed(2, out); }; $ptrType(String).prototype.ReadUint24LengthPrefixed = function(out) { var out, s; s = this; return s.readLengthPrefixed(3, out); }; $ptrType(String).prototype.ReadBytes = function(out, n) { var n, out, s, v; s = this; v = s.read(n); if (v === sliceType.nil) { return false; } out.$set(v); return true; }; $ptrType(String).prototype.CopyBytes = function(out) { var n, out, s, v; s = this; n = out.$length; v = s.read(n); if (v === sliceType.nil) { return false; } return $copySlice(out, v) === n; }; String.prototype.Empty = function() { var s; s = this; return s.$length === 0; }; $ptrType(String).prototype.Empty = function() { return this.$get().Empty(); }; NewBuilder = function(buffer) { var buffer; return new Builder.ptr($ifaceNil, buffer, false, ptrType$1.nil, 0, 0, false, ptrType$2.nil); }; $pkg.NewBuilder = NewBuilder; Builder.ptr.prototype.SetError = function(err) { var b, err; b = this; b.err = err; }; Builder.prototype.SetError = function(err) { return this.$val.SetError(err); }; Builder.ptr.prototype.Bytes = function() { var b; b = this; if (!($interfaceIsEqual(b.err, $ifaceNil))) { return [sliceType.nil, b.err]; } return [$subslice(b.result, b.offset), $ifaceNil]; }; Builder.prototype.Bytes = function() { return this.$val.Bytes(); }; Builder.ptr.prototype.BytesOrPanic = function() { var b; b = this; if (!($interfaceIsEqual(b.err, $ifaceNil))) { $panic(b.err); } return $subslice(b.result, b.offset); }; Builder.prototype.BytesOrPanic = function() { return this.$val.BytesOrPanic(); }; Builder.ptr.prototype.AddUint8 = function(v) { var b, v; b = this; b.add(new sliceType([(v)])); }; Builder.prototype.AddUint8 = function(v) { return this.$val.AddUint8(v); }; Builder.ptr.prototype.AddUint16 = function(v) { var b, v; b = this; b.add(new sliceType([(((v >>> 8 << 16 >>> 16) << 24 >>> 24)), ((v << 24 >>> 24))])); }; Builder.prototype.AddUint16 = function(v) { return this.$val.AddUint16(v); }; Builder.ptr.prototype.AddUint24 = function(v) { var b, v; b = this; b.add(new sliceType([(((v >>> 16 >>> 0) << 24 >>> 24)), (((v >>> 8 >>> 0) << 24 >>> 24)), ((v << 24 >>> 24))])); }; Builder.prototype.AddUint24 = function(v) { return this.$val.AddUint24(v); }; Builder.ptr.prototype.AddUint32 = function(v) { var b, v; b = this; b.add(new sliceType([(((v >>> 24 >>> 0) << 24 >>> 24)), (((v >>> 16 >>> 0) << 24 >>> 24)), (((v >>> 8 >>> 0) << 24 >>> 24)), ((v << 24 >>> 24))])); }; Builder.prototype.AddUint32 = function(v) { return this.$val.AddUint32(v); }; Builder.ptr.prototype.AddBytes = function(v) { var b, v; b = this; b.add(v); }; Builder.prototype.AddBytes = function(v) { return this.$val.AddBytes(v); }; Builder.ptr.prototype.AddUint8LengthPrefixed = function(f) { var b, f, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; $r = b.addLengthPrefixed(1, false, f); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Builder.ptr.prototype.AddUint8LengthPrefixed }; } $f.b = b; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; }; Builder.prototype.AddUint8LengthPrefixed = function(f) { return this.$val.AddUint8LengthPrefixed(f); }; Builder.ptr.prototype.AddUint16LengthPrefixed = function(f) { var b, f, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; $r = b.addLengthPrefixed(2, false, f); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Builder.ptr.prototype.AddUint16LengthPrefixed }; } $f.b = b; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; }; Builder.prototype.AddUint16LengthPrefixed = function(f) { return this.$val.AddUint16LengthPrefixed(f); }; Builder.ptr.prototype.AddUint24LengthPrefixed = function(f) { var b, f, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; $r = b.addLengthPrefixed(3, false, f); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Builder.ptr.prototype.AddUint24LengthPrefixed }; } $f.b = b; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; }; Builder.prototype.AddUint24LengthPrefixed = function(f) { return this.$val.AddUint24LengthPrefixed(f); }; Builder.ptr.prototype.AddUint32LengthPrefixed = function(f) { var b, f, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; $r = b.addLengthPrefixed(4, false, f); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Builder.ptr.prototype.AddUint32LengthPrefixed }; } $f.b = b; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; }; Builder.prototype.AddUint32LengthPrefixed = function(f) { return this.$val.AddUint32LengthPrefixed(f); }; Builder.ptr.prototype.callContinuation = function(f, arg) { var arg, b, f, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; arg = $f.arg; b = $f.b; f = $f.f; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); b = [b]; b[0] = this; /* */ if (!b[0].inContinuation.$get()) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!b[0].inContinuation.$get()) { */ case 1: b[0].inContinuation.$set(true); $deferred.push([(function(b) { return function() { var _tuple, buildError, ok, r; b[0].inContinuation.$set(false); r = $recover(); if ($interfaceIsEqual(r, $ifaceNil)) { return; } _tuple = $assertType(r, BuildError, true); buildError = $clone(_tuple[0], BuildError); ok = _tuple[1]; if (ok) { b[0].err = buildError.Err; } else { $panic(r); } }; })(b), []]); /* } */ case 2: $r = f(arg); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Builder.ptr.prototype.callContinuation }; } $f.arg = arg; $f.b = b; $f.f = f; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Builder.prototype.callContinuation = function(f, arg) { return this.$val.callContinuation(f, arg); }; Builder.ptr.prototype.addLengthPrefixed = function(lenLen, isASN1, f) { var b, f, isASN1, lenLen, offset, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; f = $f.f; isASN1 = $f.isASN1; lenLen = $f.lenLen; offset = $f.offset; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; if (!($interfaceIsEqual(b.err, $ifaceNil))) { $s = -1; return; } offset = b.result.$length; b.add($makeSlice(sliceType, lenLen)); if (b.inContinuation === ptrType$2.nil) { b.inContinuation = $newDataPointer(false, ptrType$2); } b.child = new Builder.ptr($ifaceNil, b.result, b.fixedSize, ptrType$1.nil, offset, lenLen, isASN1, b.inContinuation); $r = b.callContinuation(f, b.child); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = b.flushChild(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (!(b.child === ptrType$1.nil)) { $panic(new $String("cryptobyte: internal error")); } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Builder.ptr.prototype.addLengthPrefixed }; } $f.b = b; $f.f = f; $f.isASN1 = isASN1; $f.lenLen = lenLen; $f.offset = offset; $f.$s = $s; $f.$r = $r; return $f; }; Builder.prototype.addLengthPrefixed = function(lenLen, isASN1, f) { return this.$val.addLengthPrefixed(lenLen, isASN1, f); }; Builder.ptr.prototype.flushChild = function() { var _r$1, _tmp, _tmp$1, b, child, childStart, extraBytes, i, l, lenByte, lenLen, length, x, x$1, x$2, x$3, x$4, x$5, x$6, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; b = $f.b; child = $f.child; childStart = $f.childStart; extraBytes = $f.extraBytes; i = $f.i; l = $f.l; lenByte = $f.lenByte; lenLen = $f.lenLen; length = $f.length; 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; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; if (b.child === ptrType$1.nil) { $s = -1; return; } $r = b.child.flushChild(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } child = b.child; b.child = ptrType$1.nil; if (!($interfaceIsEqual(child.err, $ifaceNil))) { b.err = child.err; $s = -1; return; } length = (child.result.$length - child.pendingLenLen >> 0) - child.offset >> 0; if (length < 0) { $panic(new $String("cryptobyte: internal error")); } if (child.pendingIsASN1) { if (!((child.pendingLenLen === 1))) { $panic(new $String("cryptobyte: internal error")); } _tmp = 0; _tmp$1 = 0; lenLen = _tmp; lenByte = _tmp$1; if ((x = (new $Int64(0, length)), (x.$high > 0 || (x.$high === 0 && x.$low > 4294967294)))) { b.err = errors.New("pending ASN.1 child too long"); $s = -1; return; } else if (length > 16777215) { lenLen = 5; lenByte = 132; } else if (length > 65535) { lenLen = 4; lenByte = 131; } else if (length > 255) { lenLen = 3; lenByte = 130; } else if (length > 127) { lenLen = 2; lenByte = 129; } else { lenLen = 1; lenByte = ((length << 24 >>> 24)); length = 0; } (x$1 = child.result, x$2 = child.offset, ((x$2 < 0 || x$2 >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + x$2] = lenByte)); extraBytes = (((lenLen - 1 << 24 >>> 24) >> 0)); if (!((extraBytes === 0))) { child.add($makeSlice(sliceType, extraBytes)); childStart = child.offset + child.pendingLenLen >> 0; $copySlice($subslice(child.result, (childStart + extraBytes >> 0)), $subslice(child.result, childStart)); } child.offset = child.offset + (1) >> 0; child.pendingLenLen = extraBytes; } l = length; i = child.pendingLenLen - 1 >> 0; while (true) { if (!(i >= 0)) { break; } (x$3 = child.result, x$4 = child.offset + i >> 0, ((x$4 < 0 || x$4 >= x$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + x$4] = ((l << 24 >>> 24)))); l = (l >> $min((8), 31)) >> 0; i = i - (1) >> 0; } /* */ if (!((l === 0))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!((l === 0))) { */ case 2: _r$1 = fmt.Errorf("cryptobyte: pending child length %d exceeds %d-byte length prefix", new sliceType$1([new $Int(length), new $Int(child.pendingLenLen)])); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } b.err = _r$1; $s = -1; return; /* } */ case 3: if (b.fixedSize && !((x$5 = b.result, $indexPtr(x$5.$array, x$5.$offset + 0, ptrType$3)) === (x$6 = child.result, $indexPtr(x$6.$array, x$6.$offset + 0, ptrType$3)))) { $panic(new $String("cryptobyte: BuilderContinuation reallocated a fixed-size buffer")); } b.result = child.result; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Builder.ptr.prototype.flushChild }; } $f._r$1 = _r$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.b = b; $f.child = child; $f.childStart = childStart; $f.extraBytes = extraBytes; $f.i = i; $f.l = l; $f.lenByte = lenByte; $f.lenLen = lenLen; $f.length = length; $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.$s = $s; $f.$r = $r; return $f; }; Builder.prototype.flushChild = function() { return this.$val.flushChild(); }; Builder.ptr.prototype.add = function(bytes) { var b, bytes; b = this; if (!($interfaceIsEqual(b.err, $ifaceNil))) { return; } if (!(b.child === ptrType$1.nil)) { $panic(new $String("cryptobyte: attempted write while child is pending")); } if ((b.result.$length + bytes.$length >> 0) < bytes.$length) { b.err = errors.New("cryptobyte: length overflow"); } if (b.fixedSize && (b.result.$length + bytes.$length >> 0) > b.result.$capacity) { b.err = errors.New("cryptobyte: Builder is exceeding its fixed-size buffer"); return; } b.result = $appendSlice(b.result, bytes); }; Builder.prototype.add = function(bytes) { return this.$val.add(bytes); }; Builder.ptr.prototype.Unwrite = function(n) { var b, length, n; b = this; if (!($interfaceIsEqual(b.err, $ifaceNil))) { return; } if (!(b.child === ptrType$1.nil)) { $panic(new $String("cryptobyte: attempted unwrite while child is pending")); } length = (b.result.$length - b.pendingLenLen >> 0) - b.offset >> 0; if (length < 0) { $panic(new $String("cryptobyte: internal error")); } if (n > length) { $panic(new $String("cryptobyte: attempted to unwrite more than was written")); } b.result = $subslice(b.result, 0, (b.result.$length - n >> 0)); }; Builder.prototype.Unwrite = function(n) { return this.$val.Unwrite(n); }; Builder.ptr.prototype.AddValue = function(v) { var _r$1, b, err, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; b = $f.b; err = $f.err; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; _r$1 = v.Marshal(b); /* */ $s = 1; case 1: 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))) { b.err = err; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Builder.ptr.prototype.AddValue }; } $f._r$1 = _r$1; $f.b = b; $f.err = err; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Builder.prototype.AddValue = function(v) { return this.$val.AddValue(v); }; Builder.ptr.prototype.AddASN1Int64 = function(v) { var b, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; $r = b.addASN1Signed(2, v); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Builder.ptr.prototype.AddASN1Int64 }; } $f.b = b; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Builder.prototype.AddASN1Int64 = function(v) { return this.$val.AddASN1Int64(v); }; Builder.ptr.prototype.AddASN1Int64WithTag = function(v, tag) { var b, tag, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; tag = $f.tag; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; $r = b.addASN1Signed(tag, v); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Builder.ptr.prototype.AddASN1Int64WithTag }; } $f.b = b; $f.tag = tag; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Builder.prototype.AddASN1Int64WithTag = function(v, tag) { return this.$val.AddASN1Int64WithTag(v, tag); }; Builder.ptr.prototype.AddASN1Enum = function(v) { var b, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; $r = b.addASN1Signed(10, v); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Builder.ptr.prototype.AddASN1Enum }; } $f.b = b; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Builder.prototype.AddASN1Enum = function(v) { return this.$val.AddASN1Enum(v); }; Builder.ptr.prototype.addASN1Signed = function(tag, v) { var b, tag, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; tag = $f.tag; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = [v]; b = this; $r = b.AddASN1(tag, (function(v) { return function(c) { var c, i, i$1, length, x; length = 1; i = v[0]; while (true) { if (!((i.$high > 0 || (i.$high === 0 && i.$low >= 128)) || (i.$high < -1 || (i.$high === -1 && i.$low < 4294967168)))) { break; } length = length + (1) >> 0; i = $shiftRightInt64(i, (8)); } while (true) { if (!(length > 0)) { break; } i$1 = (x = $shiftRightInt64(v[0], ((($imul(((length - 1 >> 0)), 8)) >>> 0))), new $Int64(x.$high & 0, (x.$low & 255) >>> 0)); c.AddUint8(((i$1.$low << 24 >>> 24))); length = length - (1) >> 0; } }; })(v)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Builder.ptr.prototype.addASN1Signed }; } $f.b = b; $f.tag = tag; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Builder.prototype.addASN1Signed = function(tag, v) { return this.$val.addASN1Signed(tag, v); }; Builder.ptr.prototype.AddASN1Uint64 = function(v) { var b, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = [v]; b = this; $r = b.AddASN1(2, (function(v) { return function(c) { var c, i, i$1, length, x; length = 1; i = v[0]; while (true) { if (!((i.$high > 0 || (i.$high === 0 && i.$low >= 128)))) { break; } length = length + (1) >> 0; i = $shiftRightUint64(i, (8)); } while (true) { if (!(length > 0)) { break; } i$1 = (x = $shiftRightUint64(v[0], ((($imul(((length - 1 >> 0)), 8)) >>> 0))), new $Uint64(x.$high & 0, (x.$low & 255) >>> 0)); c.AddUint8(((i$1.$low << 24 >>> 24))); length = length - (1) >> 0; } }; })(v)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Builder.ptr.prototype.AddASN1Uint64 }; } $f.b = b; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Builder.prototype.AddASN1Uint64 = function(v) { return this.$val.AddASN1Uint64(v); }; Builder.ptr.prototype.AddASN1BigInt = function(n) { var b, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = [n]; b = this; if (!($interfaceIsEqual(b.err, $ifaceNil))) { $s = -1; return; } $r = b.AddASN1(2, (function(n) { return function $b(c) { var _i, _r$1, _ref, bytes, bytes$1, c, i, nMinus1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r$1 = $f._r$1; _ref = $f._ref; bytes = $f.bytes; bytes$1 = $f.bytes$1; c = $f.c; i = $f.i; nMinus1 = $f.nMinus1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (n[0].Sign() < 0) { $s = 1; continue; } /* */ if (n[0].Sign() === 0) { $s = 2; continue; } /* */ $s = 3; continue; /* if (n[0].Sign() < 0) { */ case 1: nMinus1 = new big.Int.ptr(false, big.nat.nil).Neg(n[0]); _r$1 = nMinus1.Sub(nMinus1, bigOne); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; bytes = nMinus1.Bytes(); _ref = bytes; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; ((i < 0 || i >= bytes.$length) ? ($throwRuntimeError("index out of range"), undefined) : bytes.$array[bytes.$offset + i] = ((((i < 0 || i >= bytes.$length) ? ($throwRuntimeError("index out of range"), undefined) : bytes.$array[bytes.$offset + i]) ^ (255)) << 24 >>> 24)); _i++; } if ((bytes.$length === 0) || ((((0 >= bytes.$length ? ($throwRuntimeError("index out of range"), undefined) : bytes.$array[bytes.$offset + 0]) & 128) >>> 0) === 0)) { c.add(new sliceType([255])); } c.add(bytes); $s = 4; continue; /* } else if (n[0].Sign() === 0) { */ case 2: c.add(new sliceType([0])); $s = 4; continue; /* } else { */ case 3: bytes$1 = n[0].Bytes(); if (!(((((0 >= bytes$1.$length ? ($throwRuntimeError("index out of range"), undefined) : bytes$1.$array[bytes$1.$offset + 0]) & 128) >>> 0) === 0))) { c.add(new sliceType([0])); } c.add(bytes$1); /* } */ case 4: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._i = _i; $f._r$1 = _r$1; $f._ref = _ref; $f.bytes = bytes; $f.bytes$1 = bytes$1; $f.c = c; $f.i = i; $f.nMinus1 = nMinus1; $f.$s = $s; $f.$r = $r; return $f; }; })(n)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Builder.ptr.prototype.AddASN1BigInt }; } $f.b = b; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; Builder.prototype.AddASN1BigInt = function(n) { return this.$val.AddASN1BigInt(n); }; Builder.ptr.prototype.AddASN1OctetString = function(bytes) { var b, bytes, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; bytes = $f.bytes; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: bytes = [bytes]; b = this; $r = b.AddASN1(4, (function(bytes) { return function(c) { var c; c.AddBytes(bytes[0]); }; })(bytes)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Builder.ptr.prototype.AddASN1OctetString }; } $f.b = b; $f.bytes = bytes; $f.$s = $s; $f.$r = $r; return $f; }; Builder.prototype.AddASN1OctetString = function(bytes) { return this.$val.AddASN1OctetString(bytes); }; Builder.ptr.prototype.AddASN1GeneralizedTime = function(t) { var _r$1, _r$2, _r$3, _v, b, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _v = $f._v; b = $f.b; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = [t]; b = this; _r$1 = $clone(t[0], time.Time).Year(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } if (_r$1 < 0) { _v = true; $s = 3; continue s; } _r$2 = $clone(t[0], time.Time).Year(); /* */ $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 > 9999; case 3: /* */ if (_v) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v) { */ case 1: _r$3 = fmt.Errorf("cryptobyte: cannot represent %v as a GeneralizedTime", new sliceType$1([new t[0].constructor.elem(t[0])])); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } b.err = _r$3; $s = -1; return; /* } */ case 2: $r = b.AddASN1(24, (function(t) { return function $b(c) { var _r$4, c, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$4 = $f._r$4; c = $f.c; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$4 = $clone(t[0], time.Time).Format("20060102150405Z0700"); /* */ $s = 1; case 1: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $r = c.AddBytes((new sliceType($stringToBytes(_r$4)))); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$4 = _r$4; $f.c = c; $f.$s = $s; $f.$r = $r; return $f; }; })(t)); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Builder.ptr.prototype.AddASN1GeneralizedTime }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._v = _v; $f.b = b; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Builder.prototype.AddASN1GeneralizedTime = function(t) { return this.$val.AddASN1GeneralizedTime(t); }; Builder.ptr.prototype.AddASN1UTCTime = function(t) { var b, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = [b]; t = [t]; b[0] = this; $r = b[0].AddASN1(23, (function(b, t) { return function $b(c) { var _r$1, _r$2, _r$3, _r$4, _v, c, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _v = $f._v; c = $f.c; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = $clone(t[0], time.Time).Year(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } if (_r$1 < 1950) { _v = true; $s = 3; continue s; } _r$2 = $clone(t[0], time.Time).Year(); /* */ $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 >= 2050; case 3: /* */ if (_v) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v) { */ case 1: _r$3 = fmt.Errorf("cryptobyte: cannot represent %v as a UTCTime", new sliceType$1([new t[0].constructor.elem(t[0])])); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } b[0].err = _r$3; $s = -1; return; /* } */ case 2: _r$4 = $clone(t[0], time.Time).Format("060102150405Z0700"); /* */ $s = 7; case 7: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $r = c.AddBytes((new sliceType($stringToBytes(_r$4)))); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._v = _v; $f.c = c; $f.$s = $s; $f.$r = $r; return $f; }; })(b, t)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Builder.ptr.prototype.AddASN1UTCTime }; } $f.b = b; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Builder.prototype.AddASN1UTCTime = function(t) { return this.$val.AddASN1UTCTime(t); }; Builder.ptr.prototype.AddASN1BitString = function(data) { var b, data, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; data = $f.data; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: data = [data]; b = this; $r = b.AddASN1(3, (function(data) { return function(b$1) { var b$1; b$1.AddUint8(0); b$1.AddBytes(data[0]); }; })(data)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Builder.ptr.prototype.AddASN1BitString }; } $f.b = b; $f.data = data; $f.$s = $s; $f.$r = $r; return $f; }; Builder.prototype.AddASN1BitString = function(data) { return this.$val.AddASN1BitString(data); }; Builder.ptr.prototype.addBase128Int = function(n) { var b, i, i$1, length, n, o; b = this; length = 0; if ((n.$high === 0 && n.$low === 0)) { length = 1; } else { i = n; while (true) { if (!((i.$high > 0 || (i.$high === 0 && i.$low > 0)))) { break; } length = length + (1) >> 0; i = $shiftRightInt64(i, (7)); } } i$1 = length - 1 >> 0; while (true) { if (!(i$1 >= 0)) { break; } o = (($shiftRightInt64(n, ((($imul(i$1, 7)) >>> 0))).$low << 24 >>> 24)); o = (o & (127)) >>> 0; if (!((i$1 === 0))) { o = (o | (128)) >>> 0; } b.add(new sliceType([o])); i$1 = i$1 - (1) >> 0; } }; Builder.prototype.addBase128Int = function(n) { return this.$val.addBase128Int(n); }; isValidOID = function(oid) { var _i, _ref, oid, v; if (oid.$length < 2) { return false; } if ((0 >= oid.$length ? ($throwRuntimeError("index out of range"), undefined) : oid.$array[oid.$offset + 0]) > 2 || ((0 >= oid.$length ? ($throwRuntimeError("index out of range"), undefined) : oid.$array[oid.$offset + 0]) <= 1 && (1 >= oid.$length ? ($throwRuntimeError("index out of range"), undefined) : oid.$array[oid.$offset + 1]) >= 40)) { return false; } _ref = oid; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (v < 0) { return false; } _i++; } return true; }; Builder.ptr.prototype.AddASN1ObjectIdentifier = function(oid) { var b, oid, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; oid = $f.oid; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: oid = [oid]; b = this; $r = b.AddASN1(6, (function(oid) { return function $b(b$1) { var _i, _r$1, _ref, b$1, v, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r$1 = $f._r$1; _ref = $f._ref; b$1 = $f.b$1; v = $f.v; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (!isValidOID(oid[0])) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!isValidOID(oid[0])) { */ case 1: _r$1 = fmt.Errorf("cryptobyte: invalid OID: %v", new sliceType$1([oid[0]])); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } b$1.err = _r$1; $s = -1; return; /* } */ case 2: b$1.addBase128Int((x = $mul64((new $Int64(0, (0 >= oid[0].$length ? ($throwRuntimeError("index out of range"), undefined) : oid[0].$array[oid[0].$offset + 0]))), new $Int64(0, 40)), x$1 = (new $Int64(0, (1 >= oid[0].$length ? ($throwRuntimeError("index out of range"), undefined) : oid[0].$array[oid[0].$offset + 1]))), new $Int64(x.$high + x$1.$high, x.$low + x$1.$low))); _ref = $subslice(oid[0], 2); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); b$1.addBase128Int((new $Int64(0, v))); _i++; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._i = _i; $f._r$1 = _r$1; $f._ref = _ref; $f.b$1 = b$1; $f.v = v; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; })(oid)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Builder.ptr.prototype.AddASN1ObjectIdentifier }; } $f.b = b; $f.oid = oid; $f.$s = $s; $f.$r = $r; return $f; }; Builder.prototype.AddASN1ObjectIdentifier = function(oid) { return this.$val.AddASN1ObjectIdentifier(oid); }; Builder.ptr.prototype.AddASN1Boolean = function(v) { var b, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = [v]; b = this; $r = b.AddASN1(1, (function(v) { return function(b$1) { var b$1; if (v[0]) { b$1.AddUint8(255); } else { b$1.AddUint8(0); } }; })(v)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Builder.ptr.prototype.AddASN1Boolean }; } $f.b = b; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Builder.prototype.AddASN1Boolean = function(v) { return this.$val.AddASN1Boolean(v); }; Builder.ptr.prototype.AddASN1NULL = function() { var b; b = this; b.add(new sliceType([5, 0])); }; Builder.prototype.AddASN1NULL = function() { return this.$val.AddASN1NULL(); }; Builder.ptr.prototype.MarshalASN1 = function(v) { var _r$1, _tuple, b, bytes, err, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; b = $f.b; bytes = $f.bytes; err = $f.err; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; if (!($interfaceIsEqual(b.err, $ifaceNil))) { $s = -1; return; } _r$1 = asn1.Marshal(v); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; bytes = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { b.err = err; $s = -1; return; } b.AddBytes(bytes); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Builder.ptr.prototype.MarshalASN1 }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.b = b; $f.bytes = bytes; $f.err = err; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Builder.prototype.MarshalASN1 = function(v) { return this.$val.MarshalASN1(v); }; Builder.ptr.prototype.AddASN1 = function(tag, f) { var _r$1, b, f, tag, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; b = $f.b; f = $f.f; tag = $f.tag; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; if (!($interfaceIsEqual(b.err, $ifaceNil))) { $s = -1; return; } /* */ if (((tag & 31) >>> 0) === 31) { $s = 1; continue; } /* */ $s = 2; continue; /* if (((tag & 31) >>> 0) === 31) { */ case 1: _r$1 = fmt.Errorf("cryptobyte: high-tag number identifier octects not supported: 0x%x", new sliceType$1([new asn1$1.Tag(tag)])); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } b.err = _r$1; $s = -1; return; /* } */ case 2: b.AddUint8(((tag << 24 >>> 24))); $r = b.addLengthPrefixed(1, true, f); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Builder.ptr.prototype.AddASN1 }; } $f._r$1 = _r$1; $f.b = b; $f.f = f; $f.tag = tag; $f.$s = $s; $f.$r = $r; return $f; }; Builder.prototype.AddASN1 = function(tag, f) { return this.$val.AddASN1(tag, f); }; $ptrType(String).prototype.ReadASN1Boolean = function(out) { var _1, bytes, bytes$24ptr, out, s; s = this; bytes = String.nil; if (!s.ReadASN1((bytes$24ptr || (bytes$24ptr = new ptrType$4(function() { return bytes; }, function($v) { bytes = $convertSliceType($v, String); }))), 1) || !((bytes.$length === 1))) { return false; } _1 = (0 >= bytes.$length ? ($throwRuntimeError("index out of range"), undefined) : bytes.$array[bytes.$offset + 0]); if (_1 === (0)) { out.$set(false); } else if (_1 === (255)) { out.$set(true); } else { return false; } return true; }; $ptrType(String).prototype.ReadASN1Integer = function(out) { var $24r, _1, _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, _v, _v$1, i, out, s, u, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _1 = $f._1; _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; _v = $f._v; _v$1 = $f._v$1; i = $f.i; out = $f.out; s = $f.s; u = $f.u; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: i = [i]; u = [u]; s = this; _r$1 = reflect.TypeOf(out).Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (!((_r$1 === 22))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((_r$1 === 22))) { */ case 1: $panic(new $String("out is not a pointer")); /* } */ case 2: _r$2 = reflect.ValueOf(out); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = $clone(_r$2, reflect.Value).Elem(); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = $clone(_r$3, reflect.Value).Kind(); /* */ $s = 7; case 7: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _1 = _r$4; /* */ if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { $s = 8; continue; } /* */ if ((_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11))) { $s = 9; continue; } /* */ if (_1 === (25)) { $s = 10; continue; } /* */ $s = 11; continue; /* if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { */ case 8: i[0] = new $Int64(0, 0); if (!s.readASN1Int64((i.$ptr || (i.$ptr = new ptrType$5(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, i))))) { _v = true; $s = 14; continue s; } _r$5 = reflect.ValueOf(out); /* */ $s = 15; case 15: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$6 = $clone(_r$5, reflect.Value).Elem(); /* */ $s = 16; case 16: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$7 = $clone(_r$6, reflect.Value).OverflowInt(i[0]); /* */ $s = 17; case 17: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _v = _r$7; case 14: /* */ if (_v) { $s = 12; continue; } /* */ $s = 13; continue; /* if (_v) { */ case 12: $s = -1; return false; /* } */ case 13: _r$8 = reflect.ValueOf(out); /* */ $s = 18; case 18: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$9 = $clone(_r$8, reflect.Value).Elem(); /* */ $s = 19; case 19: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $r = $clone(_r$9, reflect.Value).SetInt(i[0]); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return true; /* } else if ((_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11))) { */ case 9: u[0] = new $Uint64(0, 0); if (!s.readASN1Uint64((u.$ptr || (u.$ptr = new ptrType$6(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, u))))) { _v$1 = true; $s = 23; continue s; } _r$10 = reflect.ValueOf(out); /* */ $s = 24; case 24: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$11 = $clone(_r$10, reflect.Value).Elem(); /* */ $s = 25; case 25: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _r$12 = $clone(_r$11, reflect.Value).OverflowUint(u[0]); /* */ $s = 26; case 26: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _v$1 = _r$12; case 23: /* */ if (_v$1) { $s = 21; continue; } /* */ $s = 22; continue; /* if (_v$1) { */ case 21: $s = -1; return false; /* } */ case 22: _r$13 = reflect.ValueOf(out); /* */ $s = 27; case 27: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _r$14 = $clone(_r$13, reflect.Value).Elem(); /* */ $s = 28; case 28: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } $r = $clone(_r$14, reflect.Value).SetUint(u[0]); /* */ $s = 29; case 29: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return true; /* } else if (_1 === (25)) { */ case 10: _r$15 = reflect.TypeOf(out).Elem(); /* */ $s = 32; case 32: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } /* */ if ($interfaceIsEqual(_r$15, bigIntType)) { $s = 30; continue; } /* */ $s = 31; continue; /* if ($interfaceIsEqual(_r$15, bigIntType)) { */ case 30: _r$16 = s.readASN1BigInt($assertType(out, ptrType)); /* */ $s = 33; case 33: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } $24r = _r$16; $s = 34; case 34: return $24r; /* } */ case 31: /* } */ case 11: case 4: $panic(new $String("out does not point to an integer type")); $s = -1; return false; /* */ } return; } if ($f === undefined) { $f = { $blk: $ptrType(String).prototype.ReadASN1Integer }; } $f.$24r = $24r; $f._1 = _1; $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._v = _v; $f._v$1 = _v$1; $f.i = i; $f.out = out; $f.s = s; $f.u = u; $f.$s = $s; $f.$r = $r; return $f; }; checkASN1Integer = function(bytes) { var bytes; if (bytes.$length === 0) { return false; } if (bytes.$length === 1) { return true; } if (((0 >= bytes.$length ? ($throwRuntimeError("index out of range"), undefined) : bytes.$array[bytes.$offset + 0]) === 0) && ((((1 >= bytes.$length ? ($throwRuntimeError("index out of range"), undefined) : bytes.$array[bytes.$offset + 1]) & 128) >>> 0) === 0) || ((0 >= bytes.$length ? ($throwRuntimeError("index out of range"), undefined) : bytes.$array[bytes.$offset + 0]) === 255) && ((((1 >= bytes.$length ? ($throwRuntimeError("index out of range"), undefined) : bytes.$array[bytes.$offset + 1]) & 128) >>> 0) === 128)) { return false; } return true; }; $ptrType(String).prototype.readASN1BigInt = function(out) { var _i, _r$1, _ref, b, bytes, i, neg, out, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r$1 = $f._r$1; _ref = $f._ref; b = $f.b; bytes = $f.bytes; i = $f.i; neg = $f.neg; out = $f.out; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: bytes = [bytes]; s = this; bytes[0] = String.nil; if (!s.ReadASN1((bytes.$ptr || (bytes.$ptr = new ptrType$4(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, bytes))), 2) || !checkASN1Integer($convertSliceType(bytes[0], sliceType))) { $s = -1; return false; } /* */ if ((((0 >= bytes[0].$length ? ($throwRuntimeError("index out of range"), undefined) : bytes[0].$array[bytes[0].$offset + 0]) & 128) >>> 0) === 128) { $s = 1; continue; } /* */ $s = 2; continue; /* if ((((0 >= bytes[0].$length ? ($throwRuntimeError("index out of range"), undefined) : bytes[0].$array[bytes[0].$offset + 0]) & 128) >>> 0) === 128) { */ case 1: neg = $makeSlice(sliceType, bytes[0].$length); _ref = bytes[0]; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; b = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); ((i < 0 || i >= neg.$length) ? ($throwRuntimeError("index out of range"), undefined) : neg.$array[neg.$offset + i] = (~b << 24 >>> 24)); _i++; } out.SetBytes(neg); _r$1 = out.Add(out, bigOne); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; out.Neg(out); $s = 3; continue; /* } else { */ case 2: out.SetBytes($convertSliceType(bytes[0], sliceType)); /* } */ case 3: $s = -1; return true; /* */ } return; } if ($f === undefined) { $f = { $blk: $ptrType(String).prototype.readASN1BigInt }; } $f._i = _i; $f._r$1 = _r$1; $f._ref = _ref; $f.b = b; $f.bytes = bytes; $f.i = i; $f.neg = neg; $f.out = out; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(String).prototype.readASN1Int64 = function(out) { var bytes, bytes$24ptr, out, s; s = this; bytes = String.nil; if (!s.ReadASN1((bytes$24ptr || (bytes$24ptr = new ptrType$4(function() { return bytes; }, function($v) { bytes = $convertSliceType($v, String); }))), 2) || !checkASN1Integer($convertSliceType(bytes, sliceType)) || !asn1Signed(out, $convertSliceType(bytes, sliceType))) { return false; } return true; }; asn1Signed = function(out, n) { var i, length, n, out, x, x$1; length = n.$length; if (length > 8) { return false; } i = 0; while (true) { if (!(i < length)) { break; } out.$set($shiftLeft64(out.$get(), (8))); out.$set((x = out.$get(), x$1 = (new $Int64(0, ((i < 0 || i >= n.$length) ? ($throwRuntimeError("index out of range"), undefined) : n.$array[n.$offset + i]))), new $Int64(x.$high | x$1.$high, (x.$low | x$1.$low) >>> 0))); i = i + (1) >> 0; } out.$set($shiftLeft64(out.$get(), ((64 - (((length << 24 >>> 24)) * 8 << 24 >>> 24) << 24 >>> 24)))); out.$set($shiftRightInt64(out.$get(), ((64 - (((length << 24 >>> 24)) * 8 << 24 >>> 24) << 24 >>> 24)))); return true; }; $ptrType(String).prototype.readASN1Uint64 = function(out) { var bytes, bytes$24ptr, out, s; s = this; bytes = String.nil; if (!s.ReadASN1((bytes$24ptr || (bytes$24ptr = new ptrType$4(function() { return bytes; }, function($v) { bytes = $convertSliceType($v, String); }))), 2) || !checkASN1Integer($convertSliceType(bytes, sliceType)) || !asn1Unsigned(out, $convertSliceType(bytes, sliceType))) { return false; } return true; }; asn1Unsigned = function(out, n) { var i, length, n, out, x, x$1; length = n.$length; if (length > 9 || (length === 9) && !(((0 >= n.$length ? ($throwRuntimeError("index out of range"), undefined) : n.$array[n.$offset + 0]) === 0))) { return false; } if (!(((((0 >= n.$length ? ($throwRuntimeError("index out of range"), undefined) : n.$array[n.$offset + 0]) & 128) >>> 0) === 0))) { return false; } i = 0; while (true) { if (!(i < length)) { break; } out.$set($shiftLeft64(out.$get(), (8))); out.$set((x = out.$get(), x$1 = (new $Uint64(0, ((i < 0 || i >= n.$length) ? ($throwRuntimeError("index out of range"), undefined) : n.$array[n.$offset + i]))), new $Uint64(x.$high | x$1.$high, (x.$low | x$1.$low) >>> 0))); i = i + (1) >> 0; } return true; }; $ptrType(String).prototype.ReadASN1Int64WithTag = function(out, tag) { var bytes, bytes$24ptr, out, s, tag; s = this; bytes = String.nil; return s.ReadASN1((bytes$24ptr || (bytes$24ptr = new ptrType$4(function() { return bytes; }, function($v) { bytes = $convertSliceType($v, String); }))), tag) && checkASN1Integer($convertSliceType(bytes, sliceType)) && asn1Signed(out, $convertSliceType(bytes, sliceType)); }; $ptrType(String).prototype.ReadASN1Enum = function(out) { var bytes, bytes$24ptr, i, i$24ptr, out, s, x; s = this; bytes = String.nil; i = new $Int64(0, 0); if (!s.ReadASN1((bytes$24ptr || (bytes$24ptr = new ptrType$4(function() { return bytes; }, function($v) { bytes = $convertSliceType($v, String); }))), 10) || !checkASN1Integer($convertSliceType(bytes, sliceType)) || !asn1Signed((i$24ptr || (i$24ptr = new ptrType$5(function() { return i; }, function($v) { i = $v; }))), $convertSliceType(bytes, sliceType))) { return false; } if (!((x = (new $Int64(0, (((i.$low + ((i.$high >> 31) * 4294967296)) >> 0)))), (x.$high === i.$high && x.$low === i.$low)))) { return false; } out.$set((((i.$low + ((i.$high >> 31) * 4294967296)) >> 0))); return true; }; $ptrType(String).prototype.readBase128Int = function(out) { var b, i, out, ret, s, x, y; s = this; ret = 0; i = 0; while (true) { if (!(s.$get().$length > 0)) { break; } if (i === 4) { return false; } ret = (y = (7), y < 32 ? (ret << y) : 0) >> 0; b = (x = s.read(1), (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])); ret = ret | (((((b & 127) >>> 0) >> 0))); if (((b & 128) >>> 0) === 0) { out.$set(ret); return true; } i = i + (1) >> 0; } return false; }; $ptrType(String).prototype.ReadASN1ObjectIdentifier = function(out) { var _q, _r$1, bytes, bytes$24ptr, components, i, out, s, v, v$24ptr; s = this; bytes = String.nil; if (!s.ReadASN1((bytes$24ptr || (bytes$24ptr = new ptrType$4(function() { return bytes; }, function($v) { bytes = $convertSliceType($v, String); }))), 6) || (bytes.$length === 0)) { return false; } components = $makeSlice(sliceType$2, (bytes.$length + 1 >> 0)); v = 0; if (!(bytes$24ptr || (bytes$24ptr = new ptrType$4(function() { return bytes; }, function($v) { bytes = $convertSliceType($v, String); }))).readBase128Int((v$24ptr || (v$24ptr = new ptrType$7(function() { return v; }, function($v) { v = $v; }))))) { return false; } if (v < 80) { (0 >= components.$length ? ($throwRuntimeError("index out of range"), undefined) : components.$array[components.$offset + 0] = (_q = v / 40, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))); (1 >= components.$length ? ($throwRuntimeError("index out of range"), undefined) : components.$array[components.$offset + 1] = (_r$1 = v % 40, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero"))); } else { (0 >= components.$length ? ($throwRuntimeError("index out of range"), undefined) : components.$array[components.$offset + 0] = 2); (1 >= components.$length ? ($throwRuntimeError("index out of range"), undefined) : components.$array[components.$offset + 1] = (v - 80 >> 0)); } i = 2; while (true) { if (!(bytes.$length > 0)) { break; } if (!(bytes$24ptr || (bytes$24ptr = new ptrType$4(function() { return bytes; }, function($v) { bytes = $convertSliceType($v, String); }))).readBase128Int((v$24ptr || (v$24ptr = new ptrType$7(function() { return v; }, function($v) { v = $v; }))))) { return false; } ((i < 0 || i >= components.$length) ? ($throwRuntimeError("index out of range"), undefined) : components.$array[components.$offset + i] = v); i = i + (1) >> 0; } out.$set($convertSliceType($subslice(components, 0, i), asn1.ObjectIdentifier)); return true; }; $ptrType(String).prototype.ReadASN1GeneralizedTime = function(out) { var _r$1, _r$2, _tuple, bytes, err, out, res, s, serialized, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; bytes = $f.bytes; err = $f.err; out = $f.out; res = $f.res; s = $f.s; serialized = $f.serialized; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: bytes = [bytes]; s = this; bytes[0] = String.nil; if (!s.ReadASN1((bytes.$ptr || (bytes.$ptr = new ptrType$4(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, bytes))), 24)) { $s = -1; return false; } t = ($bytesToString(bytes[0])); _r$1 = time.Parse("20060102150405Z0700", t); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; res = $clone(_tuple[0], time.Time); err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return false; } _r$2 = $clone(res, time.Time).Format("20060102150405Z0700"); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } serialized = _r$2; if (!(serialized === t)) { $s = -1; return false; } time.Time.copy(out, res); $s = -1; return true; /* */ } return; } if ($f === undefined) { $f = { $blk: $ptrType(String).prototype.ReadASN1GeneralizedTime }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.bytes = bytes; $f.err = err; $f.out = out; $f.res = res; $f.s = s; $f.serialized = serialized; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(String).prototype.ReadASN1UTCTime = function(out) { var _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, _tuple$1, bytes, err, formatStr, out, res, s, serialized, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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 = $f._tuple; _tuple$1 = $f._tuple$1; bytes = $f.bytes; err = $f.err; formatStr = $f.formatStr; out = $f.out; res = $f.res; s = $f.s; serialized = $f.serialized; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: bytes = [bytes]; s = this; bytes[0] = String.nil; if (!s.ReadASN1((bytes.$ptr || (bytes.$ptr = new ptrType$4(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, bytes))), 23)) { $s = -1; return false; } t = ($bytesToString(bytes[0])); formatStr = "060102150405Z0700"; err = $ifaceNil; _r$1 = time.Parse(formatStr, t); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; res = $clone(_tuple[0], time.Time); err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: formatStr = "0601021504Z0700"; _r$2 = time.Parse(formatStr, t); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; time.Time.copy(res, _tuple$1[0]); err = _tuple$1[1]; /* } */ case 3: if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return false; } _r$3 = $clone(res, time.Time).Format(formatStr); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } serialized = _r$3; if (!(serialized === t)) { $s = -1; return false; } _r$4 = $clone(res, time.Time).Year(); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } /* */ if (_r$4 >= 2050) { $s = 6; continue; } /* */ $s = 7; continue; /* if (_r$4 >= 2050) { */ case 6: _r$5 = $clone(res, time.Time).AddDate(-100, 0, 0); /* */ $s = 9; case 9: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } time.Time.copy(res, _r$5); /* } */ case 7: time.Time.copy(out, res); $s = -1; return true; /* */ } return; } if ($f === undefined) { $f = { $blk: $ptrType(String).prototype.ReadASN1UTCTime }; } $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 = _tuple; $f._tuple$1 = _tuple$1; $f.bytes = bytes; $f.err = err; $f.formatStr = formatStr; $f.out = out; $f.res = res; $f.s = s; $f.serialized = serialized; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(String).prototype.ReadASN1BitString = function(out) { var _q, bytes, bytes$24ptr, out, paddingBits, s, x, y; s = this; bytes = String.nil; if (!s.ReadASN1((bytes$24ptr || (bytes$24ptr = new ptrType$4(function() { return bytes; }, function($v) { bytes = $convertSliceType($v, String); }))), 3) || (bytes.$length === 0) || !(((_q = ($imul(bytes.$length, 8)) / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) === bytes.$length))) { return false; } paddingBits = ((0 >= bytes.$length ? ($throwRuntimeError("index out of range"), undefined) : bytes.$array[bytes.$offset + 0])); bytes = $subslice(bytes, 1); if (paddingBits > 7 || (bytes.$length === 0) && !((paddingBits === 0)) || bytes.$length > 0 && !(((((x = bytes.$length - 1 >> 0, ((x < 0 || x >= bytes.$length) ? ($throwRuntimeError("index out of range"), undefined) : bytes.$array[bytes.$offset + x])) & ((((y = paddingBits, y < 32 ? (1 << y) : 0) << 24 >>> 24) - 1 << 24 >>> 24))) >>> 0) === 0))) { return false; } out.BitLength = ($imul(bytes.$length, 8)) - ((paddingBits >> 0)) >> 0; out.Bytes = $convertSliceType(bytes, sliceType); return true; }; $ptrType(String).prototype.ReadASN1BitStringAsBytes = function(out) { var bytes, bytes$24ptr, out, paddingBits, s; s = this; bytes = String.nil; if (!s.ReadASN1((bytes$24ptr || (bytes$24ptr = new ptrType$4(function() { return bytes; }, function($v) { bytes = $convertSliceType($v, String); }))), 3) || (bytes.$length === 0)) { return false; } paddingBits = ((0 >= bytes.$length ? ($throwRuntimeError("index out of range"), undefined) : bytes.$array[bytes.$offset + 0])); if (!((paddingBits === 0))) { return false; } out.$set($convertSliceType($subslice(bytes, 1), sliceType)); return true; }; $ptrType(String).prototype.ReadASN1Bytes = function(out, tag) { var _ptr, out, s, tag; s = this; return s.ReadASN1(((_ptr = out, new ptrType$4(function() { return $convertSliceType(_ptr.$get(), String); }, function($v) { _ptr.$set($convertSliceType($v, sliceType)); }, _ptr.$target))), tag); }; $ptrType(String).prototype.ReadASN1 = function(out, tag) { var out, s, t, t$24ptr, tag; s = this; t = 0; if (!s.ReadAnyASN1(out, (t$24ptr || (t$24ptr = new ptrType$8(function() { return t; }, function($v) { t = $v; })))) || !((t === tag))) { return false; } return true; }; $ptrType(String).prototype.ReadASN1Element = function(out, tag) { var out, s, t, t$24ptr, tag; s = this; t = 0; if (!s.ReadAnyASN1Element(out, (t$24ptr || (t$24ptr = new ptrType$8(function() { return t; }, function($v) { t = $v; })))) || !((t === tag))) { return false; } return true; }; $ptrType(String).prototype.ReadAnyASN1 = function(out, outTag) { var out, outTag, s; s = this; return s.readASN1(out, outTag, true); }; $ptrType(String).prototype.ReadAnyASN1Element = function(out, outTag) { var out, outTag, s; s = this; return s.readASN1(out, outTag, false); }; String.prototype.PeekASN1Tag = function(tag) { var s, tag; s = this; if (s.$length === 0) { return false; } return (((0 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 0]) << 24 >>> 24)) === tag; }; $ptrType(String).prototype.PeekASN1Tag = function(tag) { return this.$get().PeekASN1Tag(tag); }; $ptrType(String).prototype.SkipASN1 = function(tag) { var s, tag, unused, unused$24ptr; s = this; unused = String.nil; return s.ReadASN1((unused$24ptr || (unused$24ptr = new ptrType$4(function() { return unused; }, function($v) { unused = $convertSliceType($v, String); }))), tag); }; $ptrType(String).prototype.ReadOptionalASN1 = function(out, outPresent, tag) { var out, outPresent, present, s, tag; s = this; present = s.PeekASN1Tag(tag); if (!(outPresent === ptrType$2.nil)) { outPresent.$set(present); } if (present && !s.ReadASN1(out, tag)) { return false; } return true; }; $ptrType(String).prototype.SkipOptionalASN1 = function(tag) { var s, tag, unused, unused$24ptr; s = this; if (!s.PeekASN1Tag(tag)) { return true; } unused = String.nil; return s.ReadASN1((unused$24ptr || (unused$24ptr = new ptrType$4(function() { return unused; }, function($v) { unused = $convertSliceType($v, String); }))), tag); }; $ptrType(String).prototype.ReadOptionalASN1Integer = function(out, tag, defaultValue) { var _1, _r$1, _r$10, _r$11, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _v, defaultValue, i, out, present, s, tag, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _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; _v = $f._v; defaultValue = $f.defaultValue; i = $f.i; out = $f.out; present = $f.present; s = $f.s; tag = $f.tag; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: i = [i]; present = [present]; s = this; _r$1 = reflect.TypeOf(out).Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (!((_r$1 === 22))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((_r$1 === 22))) { */ case 1: $panic(new $String("out is not a pointer")); /* } */ case 2: present[0] = false; i[0] = String.nil; if (!s.ReadOptionalASN1((i.$ptr || (i.$ptr = new ptrType$4(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, i))), (present.$ptr || (present.$ptr = new ptrType$2(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, present))), tag)) { $s = -1; return false; } /* */ if (!present[0]) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!present[0]) { */ case 4: _r$2 = reflect.ValueOf(out); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = $clone(_r$2, reflect.Value).Elem(); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = $clone(_r$3, reflect.Value).Kind(); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _1 = _r$4; /* */ if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6)) || (_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11))) { $s = 10; continue; } /* */ if (_1 === (25)) { $s = 11; continue; } /* */ $s = 12; continue; /* if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6)) || (_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11))) { */ case 10: _r$5 = reflect.ValueOf(out); /* */ $s = 14; case 14: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$6 = $clone(_r$5, reflect.Value).Elem(); /* */ $s = 15; case 15: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$7 = reflect.ValueOf(defaultValue); /* */ $s = 16; case 16: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } $r = $clone(_r$6, reflect.Value).Set($clone(_r$7, reflect.Value)); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 13; continue; /* } else if (_1 === (25)) { */ case 11: _r$8 = reflect.TypeOf(out).Elem(); /* */ $s = 20; case 20: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } /* */ if (!($interfaceIsEqual(_r$8, bigIntType))) { $s = 18; continue; } /* */ $s = 19; continue; /* if (!($interfaceIsEqual(_r$8, bigIntType))) { */ case 18: $panic(new $String("invalid integer type")); /* } */ case 19: _r$9 = reflect.TypeOf(defaultValue).Kind(); /* */ $s = 24; case 24: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } if (!((_r$9 === 22))) { _v = true; $s = 23; continue s; } _r$10 = reflect.TypeOf(defaultValue).Elem(); /* */ $s = 25; case 25: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _v = !($interfaceIsEqual(_r$10, bigIntType)); case 23: /* */ if (_v) { $s = 21; continue; } /* */ $s = 22; continue; /* if (_v) { */ case 21: $panic(new $String("out points to big.Int, but defaultValue does not")); /* } */ case 22: $assertType(out, ptrType).Set($assertType(defaultValue, ptrType)); $s = 13; continue; /* } else { */ case 12: $panic(new $String("invalid integer type")); /* } */ case 13: case 6: $s = -1; return true; /* } */ case 5: _r$11 = (i.$ptr || (i.$ptr = new ptrType$4(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, i))).ReadASN1Integer(out); /* */ $s = 28; case 28: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } /* */ if (!_r$11 || !i[0].Empty()) { $s = 26; continue; } /* */ $s = 27; continue; /* if (!_r$11 || !i[0].Empty()) { */ case 26: $s = -1; return false; /* } */ case 27: $s = -1; return true; /* */ } return; } if ($f === undefined) { $f = { $blk: $ptrType(String).prototype.ReadOptionalASN1Integer }; } $f._1 = _1; $f._r$1 = _r$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $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._v = _v; $f.defaultValue = defaultValue; $f.i = i; $f.out = out; $f.present = present; $f.s = s; $f.tag = tag; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(String).prototype.ReadOptionalASN1OctetString = function(out, outPresent, tag) { var child, child$24ptr, oct, oct$24ptr, out, outPresent, present, present$24ptr, s, tag; s = this; present = false; child = String.nil; if (!s.ReadOptionalASN1((child$24ptr || (child$24ptr = new ptrType$4(function() { return child; }, function($v) { child = $convertSliceType($v, String); }))), (present$24ptr || (present$24ptr = new ptrType$2(function() { return present; }, function($v) { present = $v; }))), tag)) { return false; } if (!(outPresent === ptrType$2.nil)) { outPresent.$set(present); } if (present) { oct = String.nil; if (!(child$24ptr || (child$24ptr = new ptrType$4(function() { return child; }, function($v) { child = $convertSliceType($v, String); }))).ReadASN1((oct$24ptr || (oct$24ptr = new ptrType$4(function() { return oct; }, function($v) { oct = $convertSliceType($v, String); }))), 4) || !child.Empty()) { return false; } out.$set($convertSliceType(oct, sliceType)); } else { out.$set(sliceType.nil); } return true; }; $ptrType(String).prototype.ReadOptionalASN1Boolean = function(out, defaultValue) { var child, child$24ptr, defaultValue, out, present, present$24ptr, s; s = this; present = false; child = String.nil; if (!s.ReadOptionalASN1((child$24ptr || (child$24ptr = new ptrType$4(function() { return child; }, function($v) { child = $convertSliceType($v, String); }))), (present$24ptr || (present$24ptr = new ptrType$2(function() { return present; }, function($v) { present = $v; }))), 1)) { return false; } if (!present) { out.$set(defaultValue); return true; } return s.ReadASN1Boolean(out); }; $ptrType(String).prototype.readASN1 = function(out, outTag, skipHeader) { var _ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, headerLen, len32, len32$24ptr, lenByte, lenBytes, lenBytes$24ptr, lenLen, length, out, outTag, s, skipHeader, tag, x, x$1, y; s = this; if (s.$get().$length < 2) { return false; } _tmp = (x = s.$get(), (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])); _tmp$1 = (x$1 = s.$get(), (1 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 1])); tag = _tmp; lenByte = _tmp$1; if (((tag & 31) >>> 0) === 31) { return false; } if (!(outTag === ptrType$8.nil)) { outTag.$set(((tag << 24 >>> 24))); } _tmp$2 = 0; _tmp$3 = 0; length = _tmp$2; headerLen = _tmp$3; if (((lenByte & 128) >>> 0) === 0) { length = ((lenByte >>> 0)) + 2 >>> 0; headerLen = 2; } else { lenLen = (lenByte & 127) >>> 0; len32 = 0; if ((lenLen === 0) || lenLen > 4 || s.$get().$length < (((2 + lenLen << 24 >>> 24) >> 0))) { return false; } lenBytes = ($subslice((s.$get()), 2, (2 + lenLen << 24 >>> 24))); if (!(lenBytes$24ptr || (lenBytes$24ptr = new ptrType$4(function() { return lenBytes; }, function($v) { lenBytes = $convertSliceType($v, String); }))).readUnsigned((len32$24ptr || (len32$24ptr = new ptrType$9(function() { return len32; }, function($v) { len32 = $v; }))), ((lenLen >> 0)))) { return false; } if (len32 < 128) { return false; } if (((y = ((((lenLen - 1 << 24 >>> 24)) * 8 << 24 >>> 24)), y < 32 ? (len32 >>> y) : 0) >>> 0) === 0) { return false; } headerLen = 2 + ((lenLen >>> 0)) >>> 0; if ((headerLen + len32 >>> 0) < len32) { return false; } length = headerLen + len32 >>> 0; } if (((length >> 0)) < 0 || !s.ReadBytes(((_ptr = out, new ptrType$10(function() { return $convertSliceType(_ptr.$get(), sliceType); }, function($v) { _ptr.$set($convertSliceType($v, String)); }, _ptr.$target))), ((length >> 0)))) { return false; } if (skipHeader && !out.Skip(((headerLen >> 0)))) { $panic(new $String("cryptobyte: internal error")); } return true; }; String.methods = [{prop: "Empty", name: "Empty", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "PeekASN1Tag", name: "PeekASN1Tag", pkg: "", typ: $funcType([asn1$1.Tag], [$Bool], false)}]; ptrType$4.methods = [{prop: "read", name: "read", pkg: "vendor/golang.org/x/crypto/cryptobyte", typ: $funcType([$Int], [sliceType], false)}, {prop: "Skip", name: "Skip", pkg: "", typ: $funcType([$Int], [$Bool], false)}, {prop: "ReadUint8", name: "ReadUint8", pkg: "", typ: $funcType([ptrType$3], [$Bool], false)}, {prop: "ReadUint16", name: "ReadUint16", pkg: "", typ: $funcType([ptrType$11], [$Bool], false)}, {prop: "ReadUint24", name: "ReadUint24", pkg: "", typ: $funcType([ptrType$9], [$Bool], false)}, {prop: "ReadUint32", name: "ReadUint32", pkg: "", typ: $funcType([ptrType$9], [$Bool], false)}, {prop: "readUnsigned", name: "readUnsigned", pkg: "vendor/golang.org/x/crypto/cryptobyte", typ: $funcType([ptrType$9, $Int], [$Bool], false)}, {prop: "readLengthPrefixed", name: "readLengthPrefixed", pkg: "vendor/golang.org/x/crypto/cryptobyte", typ: $funcType([$Int, ptrType$4], [$Bool], false)}, {prop: "ReadUint8LengthPrefixed", name: "ReadUint8LengthPrefixed", pkg: "", typ: $funcType([ptrType$4], [$Bool], false)}, {prop: "ReadUint16LengthPrefixed", name: "ReadUint16LengthPrefixed", pkg: "", typ: $funcType([ptrType$4], [$Bool], false)}, {prop: "ReadUint24LengthPrefixed", name: "ReadUint24LengthPrefixed", pkg: "", typ: $funcType([ptrType$4], [$Bool], false)}, {prop: "ReadBytes", name: "ReadBytes", pkg: "", typ: $funcType([ptrType$10, $Int], [$Bool], false)}, {prop: "CopyBytes", name: "CopyBytes", pkg: "", typ: $funcType([sliceType], [$Bool], false)}, {prop: "ReadASN1Boolean", name: "ReadASN1Boolean", pkg: "", typ: $funcType([ptrType$2], [$Bool], false)}, {prop: "ReadASN1Integer", name: "ReadASN1Integer", pkg: "", typ: $funcType([$emptyInterface], [$Bool], false)}, {prop: "readASN1BigInt", name: "readASN1BigInt", pkg: "vendor/golang.org/x/crypto/cryptobyte", typ: $funcType([ptrType], [$Bool], false)}, {prop: "readASN1Int64", name: "readASN1Int64", pkg: "vendor/golang.org/x/crypto/cryptobyte", typ: $funcType([ptrType$5], [$Bool], false)}, {prop: "readASN1Uint64", name: "readASN1Uint64", pkg: "vendor/golang.org/x/crypto/cryptobyte", typ: $funcType([ptrType$6], [$Bool], false)}, {prop: "ReadASN1Int64WithTag", name: "ReadASN1Int64WithTag", pkg: "", typ: $funcType([ptrType$5, asn1$1.Tag], [$Bool], false)}, {prop: "ReadASN1Enum", name: "ReadASN1Enum", pkg: "", typ: $funcType([ptrType$7], [$Bool], false)}, {prop: "readBase128Int", name: "readBase128Int", pkg: "vendor/golang.org/x/crypto/cryptobyte", typ: $funcType([ptrType$7], [$Bool], false)}, {prop: "ReadASN1ObjectIdentifier", name: "ReadASN1ObjectIdentifier", pkg: "", typ: $funcType([ptrType$12], [$Bool], false)}, {prop: "ReadASN1GeneralizedTime", name: "ReadASN1GeneralizedTime", pkg: "", typ: $funcType([ptrType$13], [$Bool], false)}, {prop: "ReadASN1UTCTime", name: "ReadASN1UTCTime", pkg: "", typ: $funcType([ptrType$13], [$Bool], false)}, {prop: "ReadASN1BitString", name: "ReadASN1BitString", pkg: "", typ: $funcType([ptrType$14], [$Bool], false)}, {prop: "ReadASN1BitStringAsBytes", name: "ReadASN1BitStringAsBytes", pkg: "", typ: $funcType([ptrType$10], [$Bool], false)}, {prop: "ReadASN1Bytes", name: "ReadASN1Bytes", pkg: "", typ: $funcType([ptrType$10, asn1$1.Tag], [$Bool], false)}, {prop: "ReadASN1", name: "ReadASN1", pkg: "", typ: $funcType([ptrType$4, asn1$1.Tag], [$Bool], false)}, {prop: "ReadASN1Element", name: "ReadASN1Element", pkg: "", typ: $funcType([ptrType$4, asn1$1.Tag], [$Bool], false)}, {prop: "ReadAnyASN1", name: "ReadAnyASN1", pkg: "", typ: $funcType([ptrType$4, ptrType$8], [$Bool], false)}, {prop: "ReadAnyASN1Element", name: "ReadAnyASN1Element", pkg: "", typ: $funcType([ptrType$4, ptrType$8], [$Bool], false)}, {prop: "SkipASN1", name: "SkipASN1", pkg: "", typ: $funcType([asn1$1.Tag], [$Bool], false)}, {prop: "ReadOptionalASN1", name: "ReadOptionalASN1", pkg: "", typ: $funcType([ptrType$4, ptrType$2, asn1$1.Tag], [$Bool], false)}, {prop: "SkipOptionalASN1", name: "SkipOptionalASN1", pkg: "", typ: $funcType([asn1$1.Tag], [$Bool], false)}, {prop: "ReadOptionalASN1Integer", name: "ReadOptionalASN1Integer", pkg: "", typ: $funcType([$emptyInterface, asn1$1.Tag, $emptyInterface], [$Bool], false)}, {prop: "ReadOptionalASN1OctetString", name: "ReadOptionalASN1OctetString", pkg: "", typ: $funcType([ptrType$10, ptrType$2, asn1$1.Tag], [$Bool], false)}, {prop: "ReadOptionalASN1Boolean", name: "ReadOptionalASN1Boolean", pkg: "", typ: $funcType([ptrType$2, $Bool], [$Bool], false)}, {prop: "readASN1", name: "readASN1", pkg: "vendor/golang.org/x/crypto/cryptobyte", typ: $funcType([ptrType$4, ptrType$8, $Bool], [$Bool], false)}]; ptrType$1.methods = [{prop: "SetError", name: "SetError", pkg: "", typ: $funcType([$error], [], false)}, {prop: "Bytes", name: "Bytes", pkg: "", typ: $funcType([], [sliceType, $error], false)}, {prop: "BytesOrPanic", name: "BytesOrPanic", pkg: "", typ: $funcType([], [sliceType], false)}, {prop: "AddUint8", name: "AddUint8", pkg: "", typ: $funcType([$Uint8], [], false)}, {prop: "AddUint16", name: "AddUint16", pkg: "", typ: $funcType([$Uint16], [], false)}, {prop: "AddUint24", name: "AddUint24", pkg: "", typ: $funcType([$Uint32], [], false)}, {prop: "AddUint32", name: "AddUint32", pkg: "", typ: $funcType([$Uint32], [], false)}, {prop: "AddBytes", name: "AddBytes", pkg: "", typ: $funcType([sliceType], [], false)}, {prop: "AddUint8LengthPrefixed", name: "AddUint8LengthPrefixed", pkg: "", typ: $funcType([BuilderContinuation], [], false)}, {prop: "AddUint16LengthPrefixed", name: "AddUint16LengthPrefixed", pkg: "", typ: $funcType([BuilderContinuation], [], false)}, {prop: "AddUint24LengthPrefixed", name: "AddUint24LengthPrefixed", pkg: "", typ: $funcType([BuilderContinuation], [], false)}, {prop: "AddUint32LengthPrefixed", name: "AddUint32LengthPrefixed", pkg: "", typ: $funcType([BuilderContinuation], [], false)}, {prop: "callContinuation", name: "callContinuation", pkg: "vendor/golang.org/x/crypto/cryptobyte", typ: $funcType([BuilderContinuation, ptrType$1], [], false)}, {prop: "addLengthPrefixed", name: "addLengthPrefixed", pkg: "vendor/golang.org/x/crypto/cryptobyte", typ: $funcType([$Int, $Bool, BuilderContinuation], [], false)}, {prop: "flushChild", name: "flushChild", pkg: "vendor/golang.org/x/crypto/cryptobyte", typ: $funcType([], [], false)}, {prop: "add", name: "add", pkg: "vendor/golang.org/x/crypto/cryptobyte", typ: $funcType([sliceType], [], true)}, {prop: "Unwrite", name: "Unwrite", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "AddValue", name: "AddValue", pkg: "", typ: $funcType([MarshalingValue], [], false)}, {prop: "AddASN1Int64", name: "AddASN1Int64", pkg: "", typ: $funcType([$Int64], [], false)}, {prop: "AddASN1Int64WithTag", name: "AddASN1Int64WithTag", pkg: "", typ: $funcType([$Int64, asn1$1.Tag], [], false)}, {prop: "AddASN1Enum", name: "AddASN1Enum", pkg: "", typ: $funcType([$Int64], [], false)}, {prop: "addASN1Signed", name: "addASN1Signed", pkg: "vendor/golang.org/x/crypto/cryptobyte", typ: $funcType([asn1$1.Tag, $Int64], [], false)}, {prop: "AddASN1Uint64", name: "AddASN1Uint64", pkg: "", typ: $funcType([$Uint64], [], false)}, {prop: "AddASN1BigInt", name: "AddASN1BigInt", pkg: "", typ: $funcType([ptrType], [], false)}, {prop: "AddASN1OctetString", name: "AddASN1OctetString", pkg: "", typ: $funcType([sliceType], [], false)}, {prop: "AddASN1GeneralizedTime", name: "AddASN1GeneralizedTime", pkg: "", typ: $funcType([time.Time], [], false)}, {prop: "AddASN1UTCTime", name: "AddASN1UTCTime", pkg: "", typ: $funcType([time.Time], [], false)}, {prop: "AddASN1BitString", name: "AddASN1BitString", pkg: "", typ: $funcType([sliceType], [], false)}, {prop: "addBase128Int", name: "addBase128Int", pkg: "vendor/golang.org/x/crypto/cryptobyte", typ: $funcType([$Int64], [], false)}, {prop: "AddASN1ObjectIdentifier", name: "AddASN1ObjectIdentifier", pkg: "", typ: $funcType([asn1.ObjectIdentifier], [], false)}, {prop: "AddASN1Boolean", name: "AddASN1Boolean", pkg: "", typ: $funcType([$Bool], [], false)}, {prop: "AddASN1NULL", name: "AddASN1NULL", pkg: "", typ: $funcType([], [], false)}, {prop: "MarshalASN1", name: "MarshalASN1", pkg: "", typ: $funcType([$emptyInterface], [], false)}, {prop: "AddASN1", name: "AddASN1", pkg: "", typ: $funcType([asn1$1.Tag, BuilderContinuation], [], false)}]; String.init($Uint8); Builder.init("vendor/golang.org/x/crypto/cryptobyte", [{prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "result", name: "result", embedded: false, exported: false, typ: sliceType, tag: ""}, {prop: "fixedSize", name: "fixedSize", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "child", name: "child", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "offset", name: "offset", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "pendingLenLen", name: "pendingLenLen", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "pendingIsASN1", name: "pendingIsASN1", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "inContinuation", name: "inContinuation", embedded: false, exported: false, typ: ptrType$2, tag: ""}]); BuilderContinuation.init([ptrType$1], [], false); BuildError.init("", [{prop: "Err", name: "Err", embedded: false, exported: true, typ: $error, tag: ""}]); MarshalingValue.init([{prop: "Marshal", name: "Marshal", pkg: "", typ: $funcType([ptrType$1], [$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 = asn1.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = errors.$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 = big.$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 = time.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = asn1$1.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r = reflect.TypeOf((ptrType.nil)).Elem(); /* */ $s = 8; case 8: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } bigIntType = _r; bigOne = big.NewInt(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["crypto/ecdsa"] = (function() { var $pkg = {}, $init, crypto, aes, cipher, elliptic, randutil, sha512, errors, io, big, cryptobyte, asn1, invertible, combinedMult, PublicKey, PrivateKey, zr, ptrType, ptrType$1, ptrType$2, sliceType, ptrType$3, ptrType$4, ptrType$5, ptrType$6, one, errZeroParam, zeroReader, sign, verify, randFieldElement, hashToInt, fermatInverse, Sign, signGeneric, Verify, verifyGeneric, VerifyASN1; crypto = $packages["crypto"]; aes = $packages["crypto/aes"]; cipher = $packages["crypto/cipher"]; elliptic = $packages["crypto/elliptic"]; randutil = $packages["crypto/internal/randutil"]; sha512 = $packages["crypto/sha512"]; errors = $packages["errors"]; io = $packages["io"]; big = $packages["math/big"]; cryptobyte = $packages["vendor/golang.org/x/crypto/cryptobyte"]; asn1 = $packages["vendor/golang.org/x/crypto/cryptobyte/asn1"]; invertible = $pkg.invertible = $newType(8, $kindInterface, "ecdsa.invertible", true, "crypto/ecdsa", false, null); combinedMult = $pkg.combinedMult = $newType(8, $kindInterface, "ecdsa.combinedMult", true, "crypto/ecdsa", false, null); PublicKey = $pkg.PublicKey = $newType(0, $kindStruct, "ecdsa.PublicKey", true, "crypto/ecdsa", true, function(Curve_, X_, Y_) { this.$val = this; if (arguments.length === 0) { this.Curve = $ifaceNil; this.X = ptrType.nil; this.Y = ptrType.nil; return; } this.Curve = Curve_; this.X = X_; this.Y = Y_; }); PrivateKey = $pkg.PrivateKey = $newType(0, $kindStruct, "ecdsa.PrivateKey", true, "crypto/ecdsa", true, function(PublicKey_, D_) { this.$val = this; if (arguments.length === 0) { this.PublicKey = new PublicKey.ptr($ifaceNil, ptrType.nil, ptrType.nil); this.D = ptrType.nil; return; } this.PublicKey = PublicKey_; this.D = D_; }); zr = $pkg.zr = $newType(0, $kindStruct, "ecdsa.zr", true, "crypto/ecdsa", false, function(Reader_) { this.$val = this; if (arguments.length === 0) { this.Reader = $ifaceNil; return; } this.Reader = Reader_; }); ptrType = $ptrType(big.Int); ptrType$1 = $ptrType(PublicKey); ptrType$2 = $ptrType(PrivateKey); sliceType = $sliceType($Uint8); ptrType$3 = $ptrType(cryptobyte.Builder); ptrType$4 = $ptrType($Bool); ptrType$5 = $ptrType(cryptobyte.String); ptrType$6 = $ptrType(zr); sign = function(priv, csprng, c, hash) { var $24r, _r, _tuple, c, csprng, err, hash, priv, r, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _tuple = $f._tuple; c = $f.c; csprng = $f.csprng; err = $f.err; hash = $f.hash; priv = $f.priv; r = $f.r; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = ptrType.nil; s = ptrType.nil; err = $ifaceNil; _r = signGeneric(priv, csprng, c, hash); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; r = _tuple[0]; s = _tuple[1]; err = _tuple[2]; $24r = [r, s, err]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: sign }; } $f.$24r = $24r; $f._r = _r; $f._tuple = _tuple; $f.c = c; $f.csprng = csprng; $f.err = err; $f.hash = hash; $f.priv = priv; $f.r = r; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; verify = function(pub, c, hash, r, s) { var $24r, _r, c, hash, pub, r, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; c = $f.c; hash = $f.hash; pub = $f.pub; r = $f.r; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = verifyGeneric(pub, c, hash, r, s); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: verify }; } $f.$24r = $24r; $f._r = _r; $f.c = c; $f.hash = hash; $f.pub = pub; $f.r = r; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; PublicKey.ptr.prototype.Equal = function(x) { var _tuple, ok, pub, x, xx; pub = this; _tuple = $assertType(x, ptrType$1, true); xx = _tuple[0]; ok = _tuple[1]; if (!ok) { return false; } return (pub.X.Cmp(xx.X) === 0) && (pub.Y.Cmp(xx.Y) === 0) && $interfaceIsEqual(pub.Curve, xx.Curve); }; PublicKey.prototype.Equal = function(x) { return this.$val.Equal(x); }; PrivateKey.ptr.prototype.Public = function() { var priv; priv = this; return priv.PublicKey; }; PrivateKey.prototype.Public = function() { return this.$val.Public(); }; PrivateKey.ptr.prototype.Equal = function(x) { var _tuple, ok, priv, x, xx; priv = this; _tuple = $assertType(x, ptrType$2, true); xx = _tuple[0]; ok = _tuple[1]; if (!ok) { return false; } return priv.PublicKey.Equal(xx.PublicKey) && (priv.D.Cmp(xx.D) === 0); }; PrivateKey.prototype.Equal = function(x) { return this.$val.Equal(x); }; PrivateKey.ptr.prototype.Sign = function(rand, digest, opts) { var _r, _tuple, b, digest, err, opts, priv, r, rand, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; b = $f.b; digest = $f.digest; err = $f.err; opts = $f.opts; priv = $f.priv; r = $f.r; rand = $f.rand; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = [r]; s = [s]; priv = this; _r = Sign(rand, priv, digest); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; r[0] = _tuple[0]; s[0] = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType.nil, err]; } b = new cryptobyte.Builder.ptr($ifaceNil, sliceType.nil, false, ptrType$3.nil, 0, 0, false, ptrType$4.nil); $r = b.AddASN1(48, (function(r, s) { return function $b(b$1) { var b$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$1 = $f.b$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = b$1.AddASN1BigInt(r[0]); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = b$1.AddASN1BigInt(s[0]); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$1 = b$1; $f.$s = $s; $f.$r = $r; return $f; }; })(r, s)); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return b.Bytes(); /* */ } return; } if ($f === undefined) { $f = { $blk: PrivateKey.ptr.prototype.Sign }; } $f._r = _r; $f._tuple = _tuple; $f.b = b; $f.digest = digest; $f.err = err; $f.opts = opts; $f.priv = priv; $f.r = r; $f.rand = rand; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; PrivateKey.prototype.Sign = function(rand, digest, opts) { return this.$val.Sign(rand, digest, opts); }; randFieldElement = function(c, rand) { var _q, _r, _r$1, _r$2, _r$3, _r$4, _tuple, b, c, err, k, n, params, rand, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _q = $f._q; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; b = $f.b; c = $f.c; err = $f.err; k = $f.k; n = $f.n; params = $f.params; rand = $f.rand; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: k = ptrType.nil; err = $ifaceNil; _r = c.Params(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } params = _r; b = $makeSlice(sliceType, ((_q = params.BitSize / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) + 8 >> 0)); _r$1 = io.ReadFull(rand, b); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [k, err]; } k = new big.Int.ptr(false, big.nat.nil).SetBytes(b); _r$2 = new big.Int.ptr(false, big.nat.nil).Sub(params.N, one); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } n = _r$2; _r$3 = k.Mod(k, n); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _r$4 = k.Add(k, one); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; $s = -1; return [k, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: randFieldElement }; } $f._q = _q; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f.b = b; $f.c = c; $f.err = err; $f.k = k; $f.n = n; $f.params = params; $f.rand = rand; $f.$s = $s; $f.$r = $r; return $f; }; hashToInt = function(hash, c) { var _q, _r, _r$1, _r$2, c, excess, hash, orderBits, orderBytes, ret, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _q = $f._q; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; c = $f.c; excess = $f.excess; hash = $f.hash; orderBits = $f.orderBits; orderBytes = $f.orderBytes; ret = $f.ret; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = c.Params(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = _r.N.BitLen(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } orderBits = _r$1; orderBytes = (_q = ((orderBits + 7 >> 0)) / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); if (hash.$length > orderBytes) { hash = $subslice(hash, 0, orderBytes); } ret = new big.Int.ptr(false, big.nat.nil).SetBytes(hash); excess = ($imul(hash.$length, 8)) - orderBits >> 0; /* */ if (excess > 0) { $s = 3; continue; } /* */ $s = 4; continue; /* if (excess > 0) { */ case 3: _r$2 = ret.Rsh(ret, ((excess >>> 0))); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; /* } */ case 4: $s = -1; return ret; /* */ } return; } if ($f === undefined) { $f = { $blk: hashToInt }; } $f._q = _q; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.c = c; $f.excess = excess; $f.hash = hash; $f.orderBits = orderBits; $f.orderBytes = orderBytes; $f.ret = ret; $f.$s = $s; $f.$r = $r; return $f; }; fermatInverse = function(k, N) { var $24r, N, _r, _r$1, k, nMinus2, two, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; N = $f.N; _r = $f._r; _r$1 = $f._r$1; k = $f.k; nMinus2 = $f.nMinus2; two = $f.two; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: two = big.NewInt(new $Int64(0, 2)); _r = new big.Int.ptr(false, big.nat.nil).Sub(N, two); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } nMinus2 = _r; _r$1 = new big.Int.ptr(false, big.nat.nil).Exp(k, nMinus2, N); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: fermatInverse }; } $f.$24r = $24r; $f.N = N; $f._r = _r; $f._r$1 = _r$1; $f.k = k; $f.nMinus2 = nMinus2; $f.two = two; $f.$s = $s; $f.$r = $r; return $f; }; Sign = function(rand, priv, hash) { var $24r, _q, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _tmp, _tmp$1, _tmp$2, _tuple, _tuple$1, _tuple$2, block, c, csprng, entropy, entropylen, err, hash, key, md, priv, r, rand, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _q = $f._q; _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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; block = $f.block; c = $f.c; csprng = $f.csprng; entropy = $f.entropy; entropylen = $f.entropylen; err = $f.err; hash = $f.hash; key = $f.key; md = $f.md; priv = $f.priv; r = $f.r; rand = $f.rand; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: csprng = [csprng]; r = ptrType.nil; s = ptrType.nil; err = $ifaceNil; $r = randutil.MaybeReadByte(rand); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r = priv.PublicKey.Curve.Params(); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } entropylen = (_q = ((_r.BitSize + 7 >> 0)) / 16, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); if (entropylen > 32) { entropylen = 32; } entropy = $makeSlice(sliceType, entropylen); _r$1 = io.ReadFull(rand, entropy); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [r, s, err]; } md = sha512.New(); _r$2 = md.Write(priv.D.Bytes()); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; _r$3 = md.Write(entropy); /* */ $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 = md.Write(hash); /* */ $s = 6; case 6: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; _r$5 = md.Sum(sliceType.nil); /* */ $s = 7; case 7: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } key = $subslice(_r$5, 0, 32); _tuple$1 = aes.NewCipher(key); block = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp = ptrType.nil; _tmp$1 = ptrType.nil; _tmp$2 = err; r = _tmp; s = _tmp$1; err = _tmp$2; $s = -1; return [r, s, err]; } _r$6 = cipher.NewCTR(block, (new sliceType($stringToBytes("IV for ECDSA CTR")))); /* */ $s = 8; case 8: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } csprng[0] = new cipher.StreamReader.ptr(_r$6, zeroReader); c = priv.PublicKey.Curve; _r$7 = sign(priv, csprng[0], c, hash); /* */ $s = 9; case 9: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _tuple$2 = _r$7; r = _tuple$2[0]; s = _tuple$2[1]; err = _tuple$2[2]; $24r = [r, s, err]; $s = 10; case 10: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Sign }; } $f.$24r = $24r; $f._q = _q; $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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.block = block; $f.c = c; $f.csprng = csprng; $f.entropy = entropy; $f.entropylen = entropylen; $f.err = err; $f.hash = hash; $f.key = key; $f.md = md; $f.priv = priv; $f.r = r; $f.rand = rand; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Sign = Sign; signGeneric = function(priv, csprng, c, hash) { var N, _r, _r$1, _r$10, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tuple, _tuple$1, _tuple$2, c, csprng, e, err, hash, in$1, k, kInv, ok, priv, r, s, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; N = $f.N; _r = $f._r; _r$1 = $f._r$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; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; c = $f.c; csprng = $f.csprng; e = $f.e; err = $f.err; hash = $f.hash; in$1 = $f.in$1; k = $f.k; kInv = $f.kInv; ok = $f.ok; priv = $f.priv; r = $f.r; s = $f.s; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = ptrType.nil; s = ptrType.nil; err = $ifaceNil; _r = c.Params(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } N = _r.N; if (N.Sign() === 0) { _tmp = ptrType.nil; _tmp$1 = ptrType.nil; _tmp$2 = errZeroParam; r = _tmp; s = _tmp$1; err = _tmp$2; $s = -1; return [r, s, err]; } _tmp$3 = ptrType.nil; _tmp$4 = ptrType.nil; k = _tmp$3; kInv = _tmp$4; /* while (true) { */ case 2: /* while (true) { */ case 4: _r$1 = randFieldElement(c, (x = csprng, new x.constructor.elem(x))); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; k = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { r = ptrType.nil; $s = -1; return [r, s, err]; } _tuple$1 = $assertType(priv.PublicKey.Curve, invertible, true); in$1 = _tuple$1[0]; ok = _tuple$1[1]; /* */ if (ok) { $s = 7; continue; } /* */ $s = 8; continue; /* if (ok) { */ case 7: _r$2 = in$1.Inverse(k); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } kInv = _r$2; $s = 9; continue; /* } else { */ case 8: _r$3 = fermatInverse(k, N); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } kInv = _r$3; /* } */ case 9: _r$4 = priv.PublicKey.Curve.ScalarBaseMult(k.Bytes()); /* */ $s = 12; case 12: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$2 = _r$4; r = _tuple$2[0]; _r$5 = r.Mod(r, N); /* */ $s = 13; case 13: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; if (!((r.Sign() === 0))) { /* break; */ $s = 5; continue; } $s = 4; continue; case 5: _r$6 = hashToInt(hash, c); /* */ $s = 14; case 14: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } e = _r$6; _r$7 = new big.Int.ptr(false, big.nat.nil).Mul(priv.D, r); /* */ $s = 15; case 15: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } s = _r$7; _r$8 = s.Add(s, e); /* */ $s = 16; case 16: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$8; _r$9 = s.Mul(s, kInv); /* */ $s = 17; case 17: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$9; _r$10 = s.Mod(s, N); /* */ $s = 18; case 18: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; if (!((s.Sign() === 0))) { /* break; */ $s = 3; continue; } $s = 2; continue; case 3: $s = -1; return [r, s, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: signGeneric }; } $f.N = N; $f._r = _r; $f._r$1 = _r$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._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.c = c; $f.csprng = csprng; $f.e = e; $f.err = err; $f.hash = hash; $f.in$1 = in$1; $f.k = k; $f.kInv = kInv; $f.ok = ok; $f.priv = priv; $f.r = r; $f.s = s; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Verify = function(pub, hash, r, s) { var $24r, N, _r, _r$1, c, hash, pub, r, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; N = $f.N; _r = $f._r; _r$1 = $f._r$1; c = $f.c; hash = $f.hash; pub = $f.pub; r = $f.r; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = pub.Curve; _r = c.Params(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } N = _r.N; if (r.Sign() <= 0 || s.Sign() <= 0) { $s = -1; return false; } if (r.Cmp(N) >= 0 || s.Cmp(N) >= 0) { $s = -1; return false; } _r$1 = verify(pub, c, hash, r, s); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Verify }; } $f.$24r = $24r; $f.N = N; $f._r = _r; $f._r$1 = _r$1; $f.c = c; $f.hash = hash; $f.pub = pub; $f.r = r; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Verify = Verify; verifyGeneric = function(pub, c, hash, r, s) { var N, _r, _r$1, _r$10, _r$11, _r$12, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, c, e, hash, in$1, ok, ok$1, opt, pub, r, s, u1, u2, w, x, x1, x2, y, y1, y2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; N = $f.N; _r = $f._r; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _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; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; _tuple$5 = $f._tuple$5; c = $f.c; e = $f.e; hash = $f.hash; in$1 = $f.in$1; ok = $f.ok; ok$1 = $f.ok$1; opt = $f.opt; pub = $f.pub; r = $f.r; s = $f.s; u1 = $f.u1; u2 = $f.u2; w = $f.w; x = $f.x; x1 = $f.x1; x2 = $f.x2; y = $f.y; y1 = $f.y1; y2 = $f.y2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = hashToInt(hash, c); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } e = _r; w = ptrType.nil; _r$1 = c.Params(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } N = _r$1.N; _tuple = $assertType(c, invertible, true); in$1 = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 3; continue; } /* */ $s = 4; continue; /* if (ok) { */ case 3: _r$2 = in$1.Inverse(s); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } w = _r$2; $s = 5; continue; /* } else { */ case 4: _r$3 = new big.Int.ptr(false, big.nat.nil).ModInverse(s, N); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } w = _r$3; /* } */ case 5: _r$4 = e.Mul(e, w); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } u1 = _r$4; _r$5 = u1.Mod(u1, N); /* */ $s = 9; case 9: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; _r$6 = w.Mul(r, w); /* */ $s = 10; case 10: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } u2 = _r$6; _r$7 = u2.Mod(u2, N); /* */ $s = 11; case 11: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$7; _tmp = ptrType.nil; _tmp$1 = ptrType.nil; x = _tmp; y = _tmp$1; _tuple$1 = $assertType(c, combinedMult, true); opt = _tuple$1[0]; ok$1 = _tuple$1[1]; /* */ if (ok$1) { $s = 12; continue; } /* */ $s = 13; continue; /* if (ok$1) { */ case 12: _r$8 = opt.CombinedMult(pub.X, pub.Y, u1.Bytes(), u2.Bytes()); /* */ $s = 15; case 15: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _tuple$2 = _r$8; x = _tuple$2[0]; y = _tuple$2[1]; $s = 14; continue; /* } else { */ case 13: _r$9 = c.ScalarBaseMult(u1.Bytes()); /* */ $s = 16; case 16: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple$3 = _r$9; x1 = _tuple$3[0]; y1 = _tuple$3[1]; _r$10 = c.ScalarMult(pub.X, pub.Y, u2.Bytes()); /* */ $s = 17; case 17: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$4 = _r$10; x2 = _tuple$4[0]; y2 = _tuple$4[1]; _r$11 = c.Add(x1, y1, x2, y2); /* */ $s = 18; case 18: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tuple$5 = _r$11; x = _tuple$5[0]; y = _tuple$5[1]; /* } */ case 14: if ((x.Sign() === 0) && (y.Sign() === 0)) { $s = -1; return false; } _r$12 = x.Mod(x, N); /* */ $s = 19; case 19: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _r$12; $s = -1; return x.Cmp(r) === 0; /* */ } return; } if ($f === undefined) { $f = { $blk: verifyGeneric }; } $f.N = N; $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$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._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f._tuple$5 = _tuple$5; $f.c = c; $f.e = e; $f.hash = hash; $f.in$1 = in$1; $f.ok = ok; $f.ok$1 = ok$1; $f.opt = opt; $f.pub = pub; $f.r = r; $f.s = s; $f.u1 = u1; $f.u2 = u2; $f.w = w; $f.x = x; $f.x1 = x1; $f.x2 = x2; $f.y = y; $f.y1 = y1; $f.y2 = y2; $f.$s = $s; $f.$r = $r; return $f; }; VerifyASN1 = function(pub, hash, sig) { var $24r, _r, _r$1, _r$2, _tmp, _tmp$1, _v, _v$1, hash, inner, input, input$24ptr, pub, r, s, sig, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _v = $f._v; _v$1 = $f._v$1; hash = $f.hash; inner = $f.inner; input = $f.input; input$24ptr = $f.input$24ptr; pub = $f.pub; r = $f.r; s = $f.s; sig = $f.sig; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: inner = [inner]; _tmp = new big.Int.ptr(false, big.nat.nil); _tmp$1 = new big.Int.ptr(false, big.nat.nil); r = _tmp; s = _tmp$1; inner[0] = cryptobyte.String.nil; input = ($convertSliceType(sig, cryptobyte.String)); if (!(input$24ptr || (input$24ptr = new ptrType$5(function() { return input; }, function($v) { input = $convertSliceType($v, cryptobyte.String); }))).ReadASN1((inner.$ptr || (inner.$ptr = new ptrType$5(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, inner))), 48) || !input.Empty()) { _v$1 = true; $s = 4; continue s; } _r = (inner.$ptr || (inner.$ptr = new ptrType$5(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, inner))).ReadASN1Integer(r); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _v$1 = !_r; case 4: if (_v$1) { _v = true; $s = 3; continue s; } _r$1 = (inner.$ptr || (inner.$ptr = new ptrType$5(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, inner))).ReadASN1Integer(s); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _v = !_r$1; case 3: /* */ if (_v || !inner[0].Empty()) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v || !inner[0].Empty()) { */ case 1: $s = -1; return false; /* } */ case 2: _r$2 = Verify(pub, hash, r, s); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 8; case 8: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: VerifyASN1 }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._v = _v; $f._v$1 = _v$1; $f.hash = hash; $f.inner = inner; $f.input = input; $f.input$24ptr = input$24ptr; $f.pub = pub; $f.r = r; $f.s = s; $f.sig = sig; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.VerifyASN1 = VerifyASN1; zr.ptr.prototype.Read = function(dst) { var _i, _ref, _tmp, _tmp$1, dst, err, i, n, z; n = 0; err = $ifaceNil; z = this; _ref = dst; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; ((i < 0 || i >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + i] = 0); _i++; } _tmp = dst.$length; _tmp$1 = $ifaceNil; n = _tmp; err = _tmp$1; return [n, err]; }; zr.prototype.Read = function(dst) { return this.$val.Read(dst); }; ptrType$1.methods = [{prop: "Equal", name: "Equal", pkg: "", typ: $funcType([crypto.PublicKey], [$Bool], false)}]; ptrType$2.methods = [{prop: "Public", name: "Public", pkg: "", typ: $funcType([], [crypto.PublicKey], false)}, {prop: "Equal", name: "Equal", pkg: "", typ: $funcType([crypto.PrivateKey], [$Bool], false)}, {prop: "Sign", name: "Sign", pkg: "", typ: $funcType([io.Reader, sliceType, crypto.SignerOpts], [sliceType, $error], false)}]; ptrType$6.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}]; invertible.init([{prop: "Inverse", name: "Inverse", pkg: "", typ: $funcType([ptrType], [ptrType], false)}]); combinedMult.init([{prop: "CombinedMult", name: "CombinedMult", pkg: "", typ: $funcType([ptrType, ptrType, sliceType, sliceType], [ptrType, ptrType], false)}]); PublicKey.init("", [{prop: "Curve", name: "Curve", embedded: true, exported: true, typ: elliptic.Curve, tag: ""}, {prop: "X", name: "X", embedded: false, exported: true, typ: ptrType, tag: ""}, {prop: "Y", name: "Y", embedded: false, exported: true, typ: ptrType, tag: ""}]); PrivateKey.init("", [{prop: "PublicKey", name: "PublicKey", embedded: true, exported: true, typ: PublicKey, tag: ""}, {prop: "D", name: "D", embedded: false, exported: true, typ: ptrType, tag: ""}]); zr.init("", [{prop: "Reader", name: "Reader", embedded: true, exported: true, typ: io.Reader, 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 = aes.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = cipher.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = elliptic.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = randutil.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sha512.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = errors.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = io.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = big.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = cryptobyte.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = asn1.$init(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } one = new big.Int.ptr(false, big.nat.nil).SetInt64(new $Int64(0, 1)); errZeroParam = errors.New("zero parameter"); zeroReader = new zr.ptr($ifaceNil); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["crypto/ed25519/internal/edwards25519/field"] = (function() { var $pkg = {}, $init, subtle, binary, bits, uint128, Element, arrayType, arrayType$1, sliceType, ptrType, ptrType$1, feZero, feOne, sqrtM1, mul64, addMul64, shiftRightBy51, feMulGeneric, feSquareGeneric, feMul, feSquare, mask64Bits, mul51; subtle = $packages["crypto/subtle"]; binary = $packages["encoding/binary"]; bits = $packages["math/bits"]; uint128 = $pkg.uint128 = $newType(0, $kindStruct, "field.uint128", true, "crypto/ed25519/internal/edwards25519/field", false, function(lo_, hi_) { this.$val = this; if (arguments.length === 0) { this.lo = new $Uint64(0, 0); this.hi = new $Uint64(0, 0); return; } this.lo = lo_; this.hi = hi_; }); Element = $pkg.Element = $newType(0, $kindStruct, "field.Element", true, "crypto/ed25519/internal/edwards25519/field", true, function(l0_, l1_, l2_, l3_, l4_) { this.$val = this; if (arguments.length === 0) { this.l0 = new $Uint64(0, 0); this.l1 = new $Uint64(0, 0); this.l2 = new $Uint64(0, 0); this.l3 = new $Uint64(0, 0); this.l4 = new $Uint64(0, 0); return; } this.l0 = l0_; this.l1 = l1_; this.l2 = l2_; this.l3 = l3_; this.l4 = l4_; }); arrayType = $arrayType($Uint8, 32); arrayType$1 = $arrayType($Uint8, 8); sliceType = $sliceType($Uint8); ptrType = $ptrType(Element); ptrType$1 = $ptrType(arrayType); mul64 = function(a, b) { var _tuple, a, b, hi, lo; _tuple = bits.Mul64(a, b); hi = _tuple[0]; lo = _tuple[1]; return new uint128.ptr(lo, hi); }; addMul64 = function(v, a, b) { var _tuple, _tuple$1, _tuple$2, a, b, c, hi, lo, v; _tuple = bits.Mul64(a, b); hi = _tuple[0]; lo = _tuple[1]; _tuple$1 = bits.Add64(lo, v.lo, new $Uint64(0, 0)); lo = _tuple$1[0]; c = _tuple$1[1]; _tuple$2 = bits.Add64(hi, v.hi, c); hi = _tuple$2[0]; return new uint128.ptr(lo, hi); }; shiftRightBy51 = function(a) { var a, x, x$1; return (x = $shiftLeft64(a.hi, 13), x$1 = $shiftRightUint64(a.lo, 51), new $Uint64(x.$high | x$1.$high, (x.$low | x$1.$low) >>> 0)); }; feMulGeneric = function(v, a, b) { var a, a0, a1, a1_19, a2, a2_19, a3, a3_19, a4, a4_19, b, b0, b1, b2, b3, b4, c0, c1, c2, c3, c4, r0, r1, r2, r3, r4, rr0, rr1, rr2, rr3, rr4, v, x, x$1, x$10, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; a0 = a.l0; a1 = a.l1; a2 = a.l2; a3 = a.l3; a4 = a.l4; b0 = b.l0; b1 = b.l1; b2 = b.l2; b3 = b.l3; b4 = b.l4; a1_19 = $mul64(a1, new $Uint64(0, 19)); a2_19 = $mul64(a2, new $Uint64(0, 19)); a3_19 = $mul64(a3, new $Uint64(0, 19)); a4_19 = $mul64(a4, new $Uint64(0, 19)); r0 = $clone(mul64(a0, b0), uint128); uint128.copy(r0, addMul64($clone(r0, uint128), a1_19, b4)); uint128.copy(r0, addMul64($clone(r0, uint128), a2_19, b3)); uint128.copy(r0, addMul64($clone(r0, uint128), a3_19, b2)); uint128.copy(r0, addMul64($clone(r0, uint128), a4_19, b1)); r1 = $clone(mul64(a0, b1), uint128); uint128.copy(r1, addMul64($clone(r1, uint128), a1, b0)); uint128.copy(r1, addMul64($clone(r1, uint128), a2_19, b4)); uint128.copy(r1, addMul64($clone(r1, uint128), a3_19, b3)); uint128.copy(r1, addMul64($clone(r1, uint128), a4_19, b2)); r2 = $clone(mul64(a0, b2), uint128); uint128.copy(r2, addMul64($clone(r2, uint128), a1, b1)); uint128.copy(r2, addMul64($clone(r2, uint128), a2, b0)); uint128.copy(r2, addMul64($clone(r2, uint128), a3_19, b4)); uint128.copy(r2, addMul64($clone(r2, uint128), a4_19, b3)); r3 = $clone(mul64(a0, b3), uint128); uint128.copy(r3, addMul64($clone(r3, uint128), a1, b2)); uint128.copy(r3, addMul64($clone(r3, uint128), a2, b1)); uint128.copy(r3, addMul64($clone(r3, uint128), a3, b0)); uint128.copy(r3, addMul64($clone(r3, uint128), a4_19, b4)); r4 = $clone(mul64(a0, b4), uint128); uint128.copy(r4, addMul64($clone(r4, uint128), a1, b3)); uint128.copy(r4, addMul64($clone(r4, uint128), a2, b2)); uint128.copy(r4, addMul64($clone(r4, uint128), a3, b1)); uint128.copy(r4, addMul64($clone(r4, uint128), a4, b0)); c0 = shiftRightBy51($clone(r0, uint128)); c1 = shiftRightBy51($clone(r1, uint128)); c2 = shiftRightBy51($clone(r2, uint128)); c3 = shiftRightBy51($clone(r3, uint128)); c4 = shiftRightBy51($clone(r4, uint128)); rr0 = (x = (x$1 = r0.lo, new $Uint64(x$1.$high & 524287, (x$1.$low & 4294967295) >>> 0)), x$2 = $mul64(c4, new $Uint64(0, 19)), new $Uint64(x.$high + x$2.$high, x.$low + x$2.$low)); rr1 = (x$3 = (x$4 = r1.lo, new $Uint64(x$4.$high & 524287, (x$4.$low & 4294967295) >>> 0)), new $Uint64(x$3.$high + c0.$high, x$3.$low + c0.$low)); rr2 = (x$5 = (x$6 = r2.lo, new $Uint64(x$6.$high & 524287, (x$6.$low & 4294967295) >>> 0)), new $Uint64(x$5.$high + c1.$high, x$5.$low + c1.$low)); rr3 = (x$7 = (x$8 = r3.lo, new $Uint64(x$8.$high & 524287, (x$8.$low & 4294967295) >>> 0)), new $Uint64(x$7.$high + c2.$high, x$7.$low + c2.$low)); rr4 = (x$9 = (x$10 = r4.lo, new $Uint64(x$10.$high & 524287, (x$10.$low & 4294967295) >>> 0)), new $Uint64(x$9.$high + c3.$high, x$9.$low + c3.$low)); Element.copy(v, new Element.ptr(rr0, rr1, rr2, rr3, rr4)); v.carryPropagate(); }; feSquareGeneric = function(v, a) { var a, c0, c1, c2, c3, c4, l0, l0_2, l1, l1_2, l1_38, l2, l2_38, l3, l3_19, l3_38, l4, l4_19, r0, r1, r2, r3, r4, rr0, rr1, rr2, rr3, rr4, v, x, x$1, x$10, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; l0 = a.l0; l1 = a.l1; l2 = a.l2; l3 = a.l3; l4 = a.l4; l0_2 = $mul64(l0, new $Uint64(0, 2)); l1_2 = $mul64(l1, new $Uint64(0, 2)); l1_38 = $mul64(l1, new $Uint64(0, 38)); l2_38 = $mul64(l2, new $Uint64(0, 38)); l3_38 = $mul64(l3, new $Uint64(0, 38)); l3_19 = $mul64(l3, new $Uint64(0, 19)); l4_19 = $mul64(l4, new $Uint64(0, 19)); r0 = $clone(mul64(l0, l0), uint128); uint128.copy(r0, addMul64($clone(r0, uint128), l1_38, l4)); uint128.copy(r0, addMul64($clone(r0, uint128), l2_38, l3)); r1 = $clone(mul64(l0_2, l1), uint128); uint128.copy(r1, addMul64($clone(r1, uint128), l2_38, l4)); uint128.copy(r1, addMul64($clone(r1, uint128), l3_19, l3)); r2 = $clone(mul64(l0_2, l2), uint128); uint128.copy(r2, addMul64($clone(r2, uint128), l1, l1)); uint128.copy(r2, addMul64($clone(r2, uint128), l3_38, l4)); r3 = $clone(mul64(l0_2, l3), uint128); uint128.copy(r3, addMul64($clone(r3, uint128), l1_2, l2)); uint128.copy(r3, addMul64($clone(r3, uint128), l4_19, l4)); r4 = $clone(mul64(l0_2, l4), uint128); uint128.copy(r4, addMul64($clone(r4, uint128), l1_2, l3)); uint128.copy(r4, addMul64($clone(r4, uint128), l2, l2)); c0 = shiftRightBy51($clone(r0, uint128)); c1 = shiftRightBy51($clone(r1, uint128)); c2 = shiftRightBy51($clone(r2, uint128)); c3 = shiftRightBy51($clone(r3, uint128)); c4 = shiftRightBy51($clone(r4, uint128)); rr0 = (x = (x$1 = r0.lo, new $Uint64(x$1.$high & 524287, (x$1.$low & 4294967295) >>> 0)), x$2 = $mul64(c4, new $Uint64(0, 19)), new $Uint64(x.$high + x$2.$high, x.$low + x$2.$low)); rr1 = (x$3 = (x$4 = r1.lo, new $Uint64(x$4.$high & 524287, (x$4.$low & 4294967295) >>> 0)), new $Uint64(x$3.$high + c0.$high, x$3.$low + c0.$low)); rr2 = (x$5 = (x$6 = r2.lo, new $Uint64(x$6.$high & 524287, (x$6.$low & 4294967295) >>> 0)), new $Uint64(x$5.$high + c1.$high, x$5.$low + c1.$low)); rr3 = (x$7 = (x$8 = r3.lo, new $Uint64(x$8.$high & 524287, (x$8.$low & 4294967295) >>> 0)), new $Uint64(x$7.$high + c2.$high, x$7.$low + c2.$low)); rr4 = (x$9 = (x$10 = r4.lo, new $Uint64(x$10.$high & 524287, (x$10.$low & 4294967295) >>> 0)), new $Uint64(x$9.$high + c3.$high, x$9.$low + c3.$low)); Element.copy(v, new Element.ptr(rr0, rr1, rr2, rr3, rr4)); v.carryPropagate(); }; Element.ptr.prototype.carryPropagateGeneric = function() { var c0, c1, c2, c3, c4, v, x, x$1, x$10, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; v = this; c0 = $shiftRightUint64(v.l0, 51); c1 = $shiftRightUint64(v.l1, 51); c2 = $shiftRightUint64(v.l2, 51); c3 = $shiftRightUint64(v.l3, 51); c4 = $shiftRightUint64(v.l4, 51); v.l0 = (x = (x$1 = v.l0, new $Uint64(x$1.$high & 524287, (x$1.$low & 4294967295) >>> 0)), x$2 = $mul64(c4, new $Uint64(0, 19)), new $Uint64(x.$high + x$2.$high, x.$low + x$2.$low)); v.l1 = (x$3 = (x$4 = v.l1, new $Uint64(x$4.$high & 524287, (x$4.$low & 4294967295) >>> 0)), new $Uint64(x$3.$high + c0.$high, x$3.$low + c0.$low)); v.l2 = (x$5 = (x$6 = v.l2, new $Uint64(x$6.$high & 524287, (x$6.$low & 4294967295) >>> 0)), new $Uint64(x$5.$high + c1.$high, x$5.$low + c1.$low)); v.l3 = (x$7 = (x$8 = v.l3, new $Uint64(x$8.$high & 524287, (x$8.$low & 4294967295) >>> 0)), new $Uint64(x$7.$high + c2.$high, x$7.$low + c2.$low)); v.l4 = (x$9 = (x$10 = v.l4, new $Uint64(x$10.$high & 524287, (x$10.$low & 4294967295) >>> 0)), new $Uint64(x$9.$high + c3.$high, x$9.$low + c3.$low)); return v; }; Element.prototype.carryPropagateGeneric = function() { return this.$val.carryPropagateGeneric(); }; Element.ptr.prototype.carryPropagate = function() { var v; v = this; return v.carryPropagateGeneric(); }; Element.prototype.carryPropagate = function() { return this.$val.carryPropagate(); }; feMul = function(v, x, y) { var v, x, y; feMulGeneric(v, x, y); }; feSquare = function(v, x) { var v, x; feSquareGeneric(v, x); }; Element.ptr.prototype.Zero = function() { var v; v = this; Element.copy(v, feZero); return v; }; Element.prototype.Zero = function() { return this.$val.Zero(); }; Element.ptr.prototype.One = function() { var v; v = this; Element.copy(v, feOne); return v; }; Element.prototype.One = function() { return this.$val.One(); }; Element.ptr.prototype.reduce = function() { var c, v, 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; v = this; v.carryPropagate(); c = $shiftRightUint64(((x = v.l0, new $Uint64(x.$high + 0, x.$low + 19))), 51); c = $shiftRightUint64(((x$1 = v.l1, new $Uint64(x$1.$high + c.$high, x$1.$low + c.$low))), 51); c = $shiftRightUint64(((x$2 = v.l2, new $Uint64(x$2.$high + c.$high, x$2.$low + c.$low))), 51); c = $shiftRightUint64(((x$3 = v.l3, new $Uint64(x$3.$high + c.$high, x$3.$low + c.$low))), 51); c = $shiftRightUint64(((x$4 = v.l4, new $Uint64(x$4.$high + c.$high, x$4.$low + c.$low))), 51); v.l0 = (x$5 = v.l0, x$6 = $mul64(new $Uint64(0, 19), c), new $Uint64(x$5.$high + x$6.$high, x$5.$low + x$6.$low)); v.l1 = (x$7 = v.l1, x$8 = $shiftRightUint64(v.l0, 51), new $Uint64(x$7.$high + x$8.$high, x$7.$low + x$8.$low)); v.l0 = (x$9 = v.l0, new $Uint64(x$9.$high & 524287, (x$9.$low & 4294967295) >>> 0)); v.l2 = (x$10 = v.l2, x$11 = $shiftRightUint64(v.l1, 51), new $Uint64(x$10.$high + x$11.$high, x$10.$low + x$11.$low)); v.l1 = (x$12 = v.l1, new $Uint64(x$12.$high & 524287, (x$12.$low & 4294967295) >>> 0)); v.l3 = (x$13 = v.l3, x$14 = $shiftRightUint64(v.l2, 51), new $Uint64(x$13.$high + x$14.$high, x$13.$low + x$14.$low)); v.l2 = (x$15 = v.l2, new $Uint64(x$15.$high & 524287, (x$15.$low & 4294967295) >>> 0)); v.l4 = (x$16 = v.l4, x$17 = $shiftRightUint64(v.l3, 51), new $Uint64(x$16.$high + x$17.$high, x$16.$low + x$17.$low)); v.l3 = (x$18 = v.l3, new $Uint64(x$18.$high & 524287, (x$18.$low & 4294967295) >>> 0)); v.l4 = (x$19 = v.l4, new $Uint64(x$19.$high & 524287, (x$19.$low & 4294967295) >>> 0)); return v; }; Element.prototype.reduce = function() { return this.$val.reduce(); }; Element.ptr.prototype.Add = function(a, b) { var a, b, v, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; v = this; v.l0 = (x = a.l0, x$1 = b.l0, new $Uint64(x.$high + x$1.$high, x.$low + x$1.$low)); v.l1 = (x$2 = a.l1, x$3 = b.l1, new $Uint64(x$2.$high + x$3.$high, x$2.$low + x$3.$low)); v.l2 = (x$4 = a.l2, x$5 = b.l2, new $Uint64(x$4.$high + x$5.$high, x$4.$low + x$5.$low)); v.l3 = (x$6 = a.l3, x$7 = b.l3, new $Uint64(x$6.$high + x$7.$high, x$6.$low + x$7.$low)); v.l4 = (x$8 = a.l4, x$9 = b.l4, new $Uint64(x$8.$high + x$9.$high, x$8.$low + x$9.$low)); return v.carryPropagateGeneric(); }; Element.prototype.Add = function(a, b) { return this.$val.Add(a, b); }; Element.ptr.prototype.Subtract = function(a, b) { var a, b, v, 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; v = this; v.l0 = (x = (x$1 = a.l0, new $Uint64(x$1.$high + 1048575, x$1.$low + 4294967258)), x$2 = b.l0, new $Uint64(x.$high - x$2.$high, x.$low - x$2.$low)); v.l1 = (x$3 = (x$4 = a.l1, new $Uint64(x$4.$high + 1048575, x$4.$low + 4294967294)), x$5 = b.l1, new $Uint64(x$3.$high - x$5.$high, x$3.$low - x$5.$low)); v.l2 = (x$6 = (x$7 = a.l2, new $Uint64(x$7.$high + 1048575, x$7.$low + 4294967294)), x$8 = b.l2, new $Uint64(x$6.$high - x$8.$high, x$6.$low - x$8.$low)); v.l3 = (x$9 = (x$10 = a.l3, new $Uint64(x$10.$high + 1048575, x$10.$low + 4294967294)), x$11 = b.l3, new $Uint64(x$9.$high - x$11.$high, x$9.$low - x$11.$low)); v.l4 = (x$12 = (x$13 = a.l4, new $Uint64(x$13.$high + 1048575, x$13.$low + 4294967294)), x$14 = b.l4, new $Uint64(x$12.$high - x$14.$high, x$12.$low - x$14.$low)); return v.carryPropagate(); }; Element.prototype.Subtract = function(a, b) { return this.$val.Subtract(a, b); }; Element.ptr.prototype.Negate = function(a) { var a, v; v = this; return v.Subtract(feZero, a); }; Element.prototype.Negate = function(a) { return this.$val.Negate(a); }; Element.ptr.prototype.Invert = function(z) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, i, i$1, i$2, i$3, i$4, i$5, i$6, t, v, z, z11, z2, z2_100_0, z2_10_0, z2_20_0, z2_50_0, z2_5_0, z9; v = this; _tmp = new Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$1 = new Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$2 = new Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$3 = new Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$4 = new Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$5 = new Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$6 = new Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$7 = new Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$8 = new Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); z2 = $clone(_tmp, Element); z9 = $clone(_tmp$1, Element); z11 = $clone(_tmp$2, Element); z2_5_0 = $clone(_tmp$3, Element); z2_10_0 = $clone(_tmp$4, Element); z2_20_0 = $clone(_tmp$5, Element); z2_50_0 = $clone(_tmp$6, Element); z2_100_0 = $clone(_tmp$7, Element); t = $clone(_tmp$8, Element); z2.Square(z); t.Square(z2); t.Square(t); z9.Multiply(t, z); z11.Multiply(z9, z2); t.Square(z11); z2_5_0.Multiply(t, z9); t.Square(z2_5_0); i = 0; while (true) { if (!(i < 4)) { break; } t.Square(t); i = i + (1) >> 0; } z2_10_0.Multiply(t, z2_5_0); t.Square(z2_10_0); i$1 = 0; while (true) { if (!(i$1 < 9)) { break; } t.Square(t); i$1 = i$1 + (1) >> 0; } z2_20_0.Multiply(t, z2_10_0); t.Square(z2_20_0); i$2 = 0; while (true) { if (!(i$2 < 19)) { break; } t.Square(t); i$2 = i$2 + (1) >> 0; } t.Multiply(t, z2_20_0); t.Square(t); i$3 = 0; while (true) { if (!(i$3 < 9)) { break; } t.Square(t); i$3 = i$3 + (1) >> 0; } z2_50_0.Multiply(t, z2_10_0); t.Square(z2_50_0); i$4 = 0; while (true) { if (!(i$4 < 49)) { break; } t.Square(t); i$4 = i$4 + (1) >> 0; } z2_100_0.Multiply(t, z2_50_0); t.Square(z2_100_0); i$5 = 0; while (true) { if (!(i$5 < 99)) { break; } t.Square(t); i$5 = i$5 + (1) >> 0; } t.Multiply(t, z2_100_0); t.Square(t); i$6 = 0; while (true) { if (!(i$6 < 49)) { break; } t.Square(t); i$6 = i$6 + (1) >> 0; } t.Multiply(t, z2_50_0); t.Square(t); t.Square(t); t.Square(t); t.Square(t); t.Square(t); return v.Multiply(t, z11); }; Element.prototype.Invert = function(z) { return this.$val.Invert(z); }; Element.ptr.prototype.Set = function(a) { var a, v; v = this; Element.copy(v, a); return v; }; Element.prototype.Set = function(a) { return this.$val.Set(a); }; Element.ptr.prototype.SetBytes = function(x) { var v, x, x$1, x$10, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; v = this; if (!((x.$length === 32))) { $panic(new $String("edwards25519: invalid field element input size")); } v.l0 = $clone(binary.LittleEndian, binary.littleEndian).Uint64($subslice(x, 0, 8)); v.l0 = (x$1 = v.l0, x$2 = new $Uint64(524287, 4294967295), new $Uint64(x$1.$high & x$2.$high, (x$1.$low & x$2.$low) >>> 0)); v.l1 = $shiftRightUint64($clone(binary.LittleEndian, binary.littleEndian).Uint64($subslice(x, 6, 14)), 3); v.l1 = (x$3 = v.l1, x$4 = new $Uint64(524287, 4294967295), new $Uint64(x$3.$high & x$4.$high, (x$3.$low & x$4.$low) >>> 0)); v.l2 = $shiftRightUint64($clone(binary.LittleEndian, binary.littleEndian).Uint64($subslice(x, 12, 20)), 6); v.l2 = (x$5 = v.l2, x$6 = new $Uint64(524287, 4294967295), new $Uint64(x$5.$high & x$6.$high, (x$5.$low & x$6.$low) >>> 0)); v.l3 = $shiftRightUint64($clone(binary.LittleEndian, binary.littleEndian).Uint64($subslice(x, 19, 27)), 1); v.l3 = (x$7 = v.l3, x$8 = new $Uint64(524287, 4294967295), new $Uint64(x$7.$high & x$8.$high, (x$7.$low & x$8.$low) >>> 0)); v.l4 = $shiftRightUint64($clone(binary.LittleEndian, binary.littleEndian).Uint64($subslice(x, 24, 32)), 12); v.l4 = (x$9 = v.l4, x$10 = new $Uint64(524287, 4294967295), new $Uint64(x$9.$high & x$10.$high, (x$9.$low & x$10.$low) >>> 0)); return v; }; Element.prototype.SetBytes = function(x) { return this.$val.SetBytes(x); }; Element.ptr.prototype.Bytes = function() { var out, v; v = this; out = arrayType.zero(); return v.bytes(out); }; Element.prototype.Bytes = function() { return this.$val.Bytes(); }; Element.ptr.prototype.bytes = function(out) { var _i, _i$1, _q, _r, _ref, _ref$1, bb, bitsOffset, buf, i, i$1, l, off, out, t, v, x, x$1; v = this; t = $clone(v, Element); t.reduce(); buf = arrayType$1.zero(); _ref = $toNativeArray($kindUint64, [t.l0, t.l1, t.l2, t.l3, t.l4]); _i = 0; while (true) { if (!(_i < 5)) { break; } i = _i; l = ((_i < 0 || _i >= _ref.length) ? ($throwRuntimeError("index out of range"), undefined) : _ref[_i]); bitsOffset = $imul(i, 51); $clone(binary.LittleEndian, binary.littleEndian).PutUint64(new sliceType(buf), $shiftLeft64(l, (((_r = bitsOffset % 8, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) >>> 0)))); _ref$1 = buf; _i$1 = 0; while (true) { if (!(_i$1 < 8)) { break; } i$1 = _i$1; bb = ((_i$1 < 0 || _i$1 >= _ref$1.length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1[_i$1]); off = (_q = bitsOffset / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) + i$1 >> 0; if (off >= 32) { break; } (x$1 = out, ((off < 0 || off >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[off] = (((x = out, ((off < 0 || off >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[off])) | (bb)) >>> 0))); _i$1++; } _i++; } return new sliceType(out); }; Element.prototype.bytes = function(out) { return this.$val.bytes(out); }; Element.ptr.prototype.Equal = function(u) { var _tmp, _tmp$1, sa, sv, u, v; v = this; _tmp = u.Bytes(); _tmp$1 = v.Bytes(); sa = _tmp; sv = _tmp$1; return subtle.ConstantTimeCompare(sa, sv); }; Element.prototype.Equal = function(u) { return this.$val.Equal(u); }; mask64Bits = function(cond) { var cond, x, x$1; return (x = (x$1 = (new $Uint64(0, cond)), new $Uint64(x$1.$high - 0, x$1.$low - 1)), new $Uint64(~x.$high, ~x.$low >>> 0)); }; Element.ptr.prototype.Select = function(a, b, cond) { var a, b, cond, m, v, 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$3, x$4, x$5, x$6, x$7, x$8, x$9; v = this; m = mask64Bits(cond); v.l0 = (x = (x$1 = a.l0, new $Uint64(m.$high & x$1.$high, (m.$low & x$1.$low) >>> 0)), x$2 = (x$3 = new $Uint64(~m.$high, ~m.$low >>> 0), x$4 = b.l0, new $Uint64(x$3.$high & x$4.$high, (x$3.$low & x$4.$low) >>> 0)), new $Uint64(x.$high | x$2.$high, (x.$low | x$2.$low) >>> 0)); v.l1 = (x$5 = (x$6 = a.l1, new $Uint64(m.$high & x$6.$high, (m.$low & x$6.$low) >>> 0)), x$7 = (x$8 = new $Uint64(~m.$high, ~m.$low >>> 0), x$9 = b.l1, new $Uint64(x$8.$high & x$9.$high, (x$8.$low & x$9.$low) >>> 0)), new $Uint64(x$5.$high | x$7.$high, (x$5.$low | x$7.$low) >>> 0)); v.l2 = (x$10 = (x$11 = a.l2, new $Uint64(m.$high & x$11.$high, (m.$low & x$11.$low) >>> 0)), x$12 = (x$13 = new $Uint64(~m.$high, ~m.$low >>> 0), x$14 = b.l2, new $Uint64(x$13.$high & x$14.$high, (x$13.$low & x$14.$low) >>> 0)), new $Uint64(x$10.$high | x$12.$high, (x$10.$low | x$12.$low) >>> 0)); v.l3 = (x$15 = (x$16 = a.l3, new $Uint64(m.$high & x$16.$high, (m.$low & x$16.$low) >>> 0)), x$17 = (x$18 = new $Uint64(~m.$high, ~m.$low >>> 0), x$19 = b.l3, new $Uint64(x$18.$high & x$19.$high, (x$18.$low & x$19.$low) >>> 0)), new $Uint64(x$15.$high | x$17.$high, (x$15.$low | x$17.$low) >>> 0)); v.l4 = (x$20 = (x$21 = a.l4, new $Uint64(m.$high & x$21.$high, (m.$low & x$21.$low) >>> 0)), x$22 = (x$23 = new $Uint64(~m.$high, ~m.$low >>> 0), x$24 = b.l4, new $Uint64(x$23.$high & x$24.$high, (x$23.$low & x$24.$low) >>> 0)), new $Uint64(x$20.$high | x$22.$high, (x$20.$low | x$22.$low) >>> 0)); return v; }; Element.prototype.Select = function(a, b, cond) { return this.$val.Select(a, b, cond); }; Element.ptr.prototype.Swap = function(u, cond) { var cond, m, t, u, v, 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$29, x$3, x$30, x$31, x$32, x$33, x$34, x$4, x$5, x$6, x$7, x$8, x$9; v = this; m = mask64Bits(cond); t = (x = (x$1 = v.l0, x$2 = u.l0, new $Uint64(x$1.$high ^ x$2.$high, (x$1.$low ^ x$2.$low) >>> 0)), new $Uint64(m.$high & x.$high, (m.$low & x.$low) >>> 0)); v.l0 = (x$3 = v.l0, x$4 = t, new $Uint64(x$3.$high ^ x$4.$high, (x$3.$low ^ x$4.$low) >>> 0)); u.l0 = (x$5 = u.l0, x$6 = t, new $Uint64(x$5.$high ^ x$6.$high, (x$5.$low ^ x$6.$low) >>> 0)); t = (x$7 = (x$8 = v.l1, x$9 = u.l1, new $Uint64(x$8.$high ^ x$9.$high, (x$8.$low ^ x$9.$low) >>> 0)), new $Uint64(m.$high & x$7.$high, (m.$low & x$7.$low) >>> 0)); v.l1 = (x$10 = v.l1, x$11 = t, new $Uint64(x$10.$high ^ x$11.$high, (x$10.$low ^ x$11.$low) >>> 0)); u.l1 = (x$12 = u.l1, x$13 = t, new $Uint64(x$12.$high ^ x$13.$high, (x$12.$low ^ x$13.$low) >>> 0)); t = (x$14 = (x$15 = v.l2, x$16 = u.l2, new $Uint64(x$15.$high ^ x$16.$high, (x$15.$low ^ x$16.$low) >>> 0)), new $Uint64(m.$high & x$14.$high, (m.$low & x$14.$low) >>> 0)); v.l2 = (x$17 = v.l2, x$18 = t, new $Uint64(x$17.$high ^ x$18.$high, (x$17.$low ^ x$18.$low) >>> 0)); u.l2 = (x$19 = u.l2, x$20 = t, new $Uint64(x$19.$high ^ x$20.$high, (x$19.$low ^ x$20.$low) >>> 0)); t = (x$21 = (x$22 = v.l3, x$23 = u.l3, new $Uint64(x$22.$high ^ x$23.$high, (x$22.$low ^ x$23.$low) >>> 0)), new $Uint64(m.$high & x$21.$high, (m.$low & x$21.$low) >>> 0)); v.l3 = (x$24 = v.l3, x$25 = t, new $Uint64(x$24.$high ^ x$25.$high, (x$24.$low ^ x$25.$low) >>> 0)); u.l3 = (x$26 = u.l3, x$27 = t, new $Uint64(x$26.$high ^ x$27.$high, (x$26.$low ^ x$27.$low) >>> 0)); t = (x$28 = (x$29 = v.l4, x$30 = u.l4, new $Uint64(x$29.$high ^ x$30.$high, (x$29.$low ^ x$30.$low) >>> 0)), new $Uint64(m.$high & x$28.$high, (m.$low & x$28.$low) >>> 0)); v.l4 = (x$31 = v.l4, x$32 = t, new $Uint64(x$31.$high ^ x$32.$high, (x$31.$low ^ x$32.$low) >>> 0)); u.l4 = (x$33 = u.l4, x$34 = t, new $Uint64(x$33.$high ^ x$34.$high, (x$33.$low ^ x$34.$low) >>> 0)); }; Element.prototype.Swap = function(u, cond) { return this.$val.Swap(u, cond); }; Element.ptr.prototype.IsNegative = function() { var v, x; v = this; return (((((x = v.Bytes(), (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])) & 1) >>> 0) >> 0)); }; Element.prototype.IsNegative = function() { return this.$val.IsNegative(); }; Element.ptr.prototype.Absolute = function(u) { var u, v; v = this; return v.Select(new Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)).Negate(u), u, u.IsNegative()); }; Element.prototype.Absolute = function(u) { return this.$val.Absolute(u); }; Element.ptr.prototype.Multiply = function(x, y) { var v, x, y; v = this; feMul(v, x, y); return v; }; Element.prototype.Multiply = function(x, y) { return this.$val.Multiply(x, y); }; Element.ptr.prototype.Square = function(x) { var v, x; v = this; feSquare(v, x); return v; }; Element.prototype.Square = function(x) { return this.$val.Square(x); }; Element.ptr.prototype.Mult32 = function(x, y) { var _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, v, x, x$1, x0hi, x0lo, x1hi, x1lo, x2hi, x2lo, x3hi, x3lo, x4hi, x4lo, y; v = this; _tuple = mul51(x.l0, y); x0lo = _tuple[0]; x0hi = _tuple[1]; _tuple$1 = mul51(x.l1, y); x1lo = _tuple$1[0]; x1hi = _tuple$1[1]; _tuple$2 = mul51(x.l2, y); x2lo = _tuple$2[0]; x2hi = _tuple$2[1]; _tuple$3 = mul51(x.l3, y); x3lo = _tuple$3[0]; x3hi = _tuple$3[1]; _tuple$4 = mul51(x.l4, y); x4lo = _tuple$4[0]; x4hi = _tuple$4[1]; v.l0 = (x$1 = $mul64(new $Uint64(0, 19), x4hi), new $Uint64(x0lo.$high + x$1.$high, x0lo.$low + x$1.$low)); v.l1 = new $Uint64(x1lo.$high + x0hi.$high, x1lo.$low + x0hi.$low); v.l2 = new $Uint64(x2lo.$high + x1hi.$high, x2lo.$low + x1hi.$low); v.l3 = new $Uint64(x3lo.$high + x2hi.$high, x3lo.$low + x2hi.$low); v.l4 = new $Uint64(x4lo.$high + x3hi.$high, x4lo.$low + x3hi.$low); return v; }; Element.prototype.Mult32 = function(x, y) { return this.$val.Mult32(x, y); }; mul51 = function(a, b) { var _tuple, a, b, hi, lo, mh, ml, x, x$1; lo = new $Uint64(0, 0); hi = new $Uint64(0, 0); _tuple = bits.Mul64(a, (new $Uint64(0, b))); mh = _tuple[0]; ml = _tuple[1]; lo = new $Uint64(ml.$high & 524287, (ml.$low & 4294967295) >>> 0); hi = (x = $shiftLeft64(mh, 13), x$1 = $shiftRightUint64(ml, 51), new $Uint64(x.$high | x$1.$high, (x.$low | x$1.$low) >>> 0)); return [lo, hi]; }; Element.ptr.prototype.Pow22523 = function(x) { var _tmp, _tmp$1, _tmp$2, i, i$1, i$2, i$3, i$4, i$5, i$6, t0, t1, t2, v, x; v = this; _tmp = new Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$1 = new Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$2 = new Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); t0 = $clone(_tmp, Element); t1 = $clone(_tmp$1, Element); t2 = $clone(_tmp$2, Element); t0.Square(x); t1.Square(t0); t1.Square(t1); t1.Multiply(x, t1); t0.Multiply(t0, t1); t0.Square(t0); t0.Multiply(t1, t0); t1.Square(t0); i = 1; while (true) { if (!(i < 5)) { break; } t1.Square(t1); i = i + (1) >> 0; } t0.Multiply(t1, t0); t1.Square(t0); i$1 = 1; while (true) { if (!(i$1 < 10)) { break; } t1.Square(t1); i$1 = i$1 + (1) >> 0; } t1.Multiply(t1, t0); t2.Square(t1); i$2 = 1; while (true) { if (!(i$2 < 20)) { break; } t2.Square(t2); i$2 = i$2 + (1) >> 0; } t1.Multiply(t2, t1); t1.Square(t1); i$3 = 1; while (true) { if (!(i$3 < 10)) { break; } t1.Square(t1); i$3 = i$3 + (1) >> 0; } t0.Multiply(t1, t0); t1.Square(t0); i$4 = 1; while (true) { if (!(i$4 < 50)) { break; } t1.Square(t1); i$4 = i$4 + (1) >> 0; } t1.Multiply(t1, t0); t2.Square(t1); i$5 = 1; while (true) { if (!(i$5 < 100)) { break; } t2.Square(t2); i$5 = i$5 + (1) >> 0; } t1.Multiply(t2, t1); t1.Square(t1); i$6 = 1; while (true) { if (!(i$6 < 50)) { break; } t1.Square(t1); i$6 = i$6 + (1) >> 0; } t0.Multiply(t1, t0); t0.Square(t0); t0.Square(t0); return v.Multiply(t0, x); }; Element.prototype.Pow22523 = function(x) { return this.$val.Pow22523(x); }; Element.ptr.prototype.SqrtRatio = function(u, v) { var _tmp, _tmp$1, _tmp$2, _tmp$3, a, b, check, correctSignSqrt, flippedSignSqrt, flippedSignSqrtI, r, rPrime, rr, u, uNeg, uv3, uv7, v, v2, wasSquare; rr = ptrType.nil; wasSquare = 0; r = this; _tmp = new Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$1 = new Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); a = $clone(_tmp, Element); b = $clone(_tmp$1, Element); v2 = a.Square(v); uv3 = b.Multiply(u, b.Multiply(v2, v)); uv7 = a.Multiply(uv3, a.Square(v2)); r.Multiply(uv3, r.Pow22523(uv7)); check = a.Multiply(v, a.Square(r)); uNeg = b.Negate(u); correctSignSqrt = check.Equal(u); flippedSignSqrt = check.Equal(uNeg); flippedSignSqrtI = check.Equal(uNeg.Multiply(uNeg, sqrtM1)); rPrime = b.Multiply(r, sqrtM1); r.Select(rPrime, r, flippedSignSqrt | flippedSignSqrtI); r.Absolute(r); _tmp$2 = r; _tmp$3 = correctSignSqrt | flippedSignSqrt; rr = _tmp$2; wasSquare = _tmp$3; return [rr, wasSquare]; }; Element.prototype.SqrtRatio = function(u, v) { return this.$val.SqrtRatio(u, v); }; ptrType.methods = [{prop: "carryPropagateGeneric", name: "carryPropagateGeneric", pkg: "crypto/ed25519/internal/edwards25519/field", typ: $funcType([], [ptrType], false)}, {prop: "carryPropagate", name: "carryPropagate", pkg: "crypto/ed25519/internal/edwards25519/field", typ: $funcType([], [ptrType], false)}, {prop: "Zero", name: "Zero", pkg: "", typ: $funcType([], [ptrType], false)}, {prop: "One", name: "One", pkg: "", typ: $funcType([], [ptrType], false)}, {prop: "reduce", name: "reduce", pkg: "crypto/ed25519/internal/edwards25519/field", typ: $funcType([], [ptrType], false)}, {prop: "Add", name: "Add", pkg: "", typ: $funcType([ptrType, ptrType], [ptrType], false)}, {prop: "Subtract", name: "Subtract", pkg: "", typ: $funcType([ptrType, ptrType], [ptrType], false)}, {prop: "Negate", name: "Negate", pkg: "", typ: $funcType([ptrType], [ptrType], false)}, {prop: "Invert", name: "Invert", pkg: "", typ: $funcType([ptrType], [ptrType], false)}, {prop: "Set", name: "Set", pkg: "", typ: $funcType([ptrType], [ptrType], false)}, {prop: "SetBytes", name: "SetBytes", pkg: "", typ: $funcType([sliceType], [ptrType], false)}, {prop: "Bytes", name: "Bytes", pkg: "", typ: $funcType([], [sliceType], false)}, {prop: "bytes", name: "bytes", pkg: "crypto/ed25519/internal/edwards25519/field", typ: $funcType([ptrType$1], [sliceType], false)}, {prop: "Equal", name: "Equal", pkg: "", typ: $funcType([ptrType], [$Int], false)}, {prop: "Select", name: "Select", pkg: "", typ: $funcType([ptrType, ptrType, $Int], [ptrType], false)}, {prop: "Swap", name: "Swap", pkg: "", typ: $funcType([ptrType, $Int], [], false)}, {prop: "IsNegative", name: "IsNegative", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Absolute", name: "Absolute", pkg: "", typ: $funcType([ptrType], [ptrType], false)}, {prop: "Multiply", name: "Multiply", pkg: "", typ: $funcType([ptrType, ptrType], [ptrType], false)}, {prop: "Square", name: "Square", pkg: "", typ: $funcType([ptrType], [ptrType], false)}, {prop: "Mult32", name: "Mult32", pkg: "", typ: $funcType([ptrType, $Uint32], [ptrType], false)}, {prop: "Pow22523", name: "Pow22523", pkg: "", typ: $funcType([ptrType], [ptrType], false)}, {prop: "SqrtRatio", name: "SqrtRatio", pkg: "", typ: $funcType([ptrType, ptrType], [ptrType, $Int], false)}]; uint128.init("crypto/ed25519/internal/edwards25519/field", [{prop: "lo", name: "lo", embedded: false, exported: false, typ: $Uint64, tag: ""}, {prop: "hi", name: "hi", embedded: false, exported: false, typ: $Uint64, tag: ""}]); Element.init("crypto/ed25519/internal/edwards25519/field", [{prop: "l0", name: "l0", embedded: false, exported: false, typ: $Uint64, tag: ""}, {prop: "l1", name: "l1", embedded: false, exported: false, typ: $Uint64, tag: ""}, {prop: "l2", name: "l2", embedded: false, exported: false, typ: $Uint64, tag: ""}, {prop: "l3", name: "l3", embedded: false, exported: false, typ: $Uint64, tag: ""}, {prop: "l4", name: "l4", embedded: false, exported: false, typ: $Uint64, 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 = subtle.$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 = bits.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } feZero = new Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); feOne = new Element.ptr(new $Uint64(0, 1), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); sqrtM1 = new Element.ptr(new $Uint64(400167, 1242472624), new $Uint64(54693, 4237236381), new $Uint64(520030, 2629635168), new $Uint64(492949, 2793426078), new $Uint64(178226, 1208286237)); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["crypto/ed25519/internal/edwards25519"] = (function() { var $pkg = {}, $init, field, subtle, binary, errors, sync, projLookupTable, affineLookupTable, nafLookupTable5, nafLookupTable8, Scalar, projP1xP1, projP2, Point, incomparable, projCached, affineCached, arrayType, arrayType$1, structType, arrayType$2, structType$1, sliceType, funcType, arrayType$3, arrayType$4, ptrType, sliceType$1, arrayType$5, arrayType$6, arrayType$7, arrayType$8, ptrType$1, arrayType$9, arrayType$10, arrayType$11, ptrType$2, ptrType$3, ptrType$4, ptrType$5, ptrType$6, ptrType$7, ptrType$8, ptrType$9, ptrType$10, basepointTablePrecomp, basepointNafTablePrecomp, scZero, scOne, scMinusOne, identity, generator, feOne, d, d2, _tuple, _tuple$1, basepointTable, basepointNafTable, NewScalar, isReduced, load3, load4, scMulAdd, scReduce, checkInitialized, NewIdentityPoint, NewGeneratorPoint, copyFieldElement; field = $packages["crypto/ed25519/internal/edwards25519/field"]; subtle = $packages["crypto/subtle"]; binary = $packages["encoding/binary"]; errors = $packages["errors"]; sync = $packages["sync"]; projLookupTable = $pkg.projLookupTable = $newType(0, $kindStruct, "edwards25519.projLookupTable", true, "crypto/ed25519/internal/edwards25519", false, function(points_) { this.$val = this; if (arguments.length === 0) { this.points = arrayType$5.zero(); return; } this.points = points_; }); affineLookupTable = $pkg.affineLookupTable = $newType(0, $kindStruct, "edwards25519.affineLookupTable", true, "crypto/ed25519/internal/edwards25519", false, function(points_) { this.$val = this; if (arguments.length === 0) { this.points = arrayType.zero(); return; } this.points = points_; }); nafLookupTable5 = $pkg.nafLookupTable5 = $newType(0, $kindStruct, "edwards25519.nafLookupTable5", true, "crypto/ed25519/internal/edwards25519", false, function(points_) { this.$val = this; if (arguments.length === 0) { this.points = arrayType$5.zero(); return; } this.points = points_; }); nafLookupTable8 = $pkg.nafLookupTable8 = $newType(0, $kindStruct, "edwards25519.nafLookupTable8", true, "crypto/ed25519/internal/edwards25519", false, function(points_) { this.$val = this; if (arguments.length === 0) { this.points = arrayType$2.zero(); return; } this.points = points_; }); Scalar = $pkg.Scalar = $newType(0, $kindStruct, "edwards25519.Scalar", true, "crypto/ed25519/internal/edwards25519", true, function(s_) { this.$val = this; if (arguments.length === 0) { this.s = arrayType$7.zero(); return; } this.s = s_; }); projP1xP1 = $pkg.projP1xP1 = $newType(0, $kindStruct, "edwards25519.projP1xP1", true, "crypto/ed25519/internal/edwards25519", false, function(X_, Y_, Z_, T_) { this.$val = this; if (arguments.length === 0) { this.X = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); this.Y = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); this.Z = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); this.T = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); return; } this.X = X_; this.Y = Y_; this.Z = Z_; this.T = T_; }); projP2 = $pkg.projP2 = $newType(0, $kindStruct, "edwards25519.projP2", true, "crypto/ed25519/internal/edwards25519", false, function(X_, Y_, Z_) { this.$val = this; if (arguments.length === 0) { this.X = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); this.Y = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); this.Z = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); return; } this.X = X_; this.Y = Y_; this.Z = Z_; }); Point = $pkg.Point = $newType(0, $kindStruct, "edwards25519.Point", true, "crypto/ed25519/internal/edwards25519", true, function(x_, y_, z_, t_, _$4_) { this.$val = this; if (arguments.length === 0) { this.x = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); this.y = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); this.z = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); this.t = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); this._$4 = arrayType$3.zero(); return; } this.x = x_; this.y = y_; this.z = z_; this.t = t_; this._$4 = _$4_; }); incomparable = $pkg.incomparable = $newType(0, $kindArray, "edwards25519.incomparable", true, "crypto/ed25519/internal/edwards25519", false, null); projCached = $pkg.projCached = $newType(0, $kindStruct, "edwards25519.projCached", true, "crypto/ed25519/internal/edwards25519", false, function(YplusX_, YminusX_, Z_, T2d_) { this.$val = this; if (arguments.length === 0) { this.YplusX = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); this.YminusX = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); this.Z = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); this.T2d = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); return; } this.YplusX = YplusX_; this.YminusX = YminusX_; this.Z = Z_; this.T2d = T2d_; }); affineCached = $pkg.affineCached = $newType(0, $kindStruct, "edwards25519.affineCached", true, "crypto/ed25519/internal/edwards25519", false, function(YplusX_, YminusX_, T2d_) { this.$val = this; if (arguments.length === 0) { this.YplusX = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); this.YminusX = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); this.T2d = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); return; } this.YplusX = YplusX_; this.YminusX = YminusX_; this.T2d = T2d_; }); arrayType = $arrayType(affineCached, 8); arrayType$1 = $arrayType(affineLookupTable, 32); structType = $structType("crypto/ed25519/internal/edwards25519", [{prop: "table", name: "table", embedded: false, exported: false, typ: arrayType$1, tag: ""}, {prop: "initOnce", name: "initOnce", embedded: false, exported: false, typ: sync.Once, tag: ""}]); arrayType$2 = $arrayType(affineCached, 64); structType$1 = $structType("crypto/ed25519/internal/edwards25519", [{prop: "table", name: "table", embedded: false, exported: false, typ: nafLookupTable8, tag: ""}, {prop: "initOnce", name: "initOnce", embedded: false, exported: false, typ: sync.Once, tag: ""}]); sliceType = $sliceType($Uint8); funcType = $funcType([], [], false); arrayType$3 = $arrayType(funcType, 0); arrayType$4 = $arrayType($Int8, 64); ptrType = $ptrType(Point); sliceType$1 = $sliceType(ptrType); arrayType$5 = $arrayType(projCached, 8); arrayType$6 = $arrayType($Int8, 256); arrayType$7 = $arrayType($Uint8, 32); arrayType$8 = $arrayType($Uint8, 64); ptrType$1 = $ptrType(Scalar); arrayType$9 = $arrayType($Int64, 23); arrayType$10 = $arrayType($Int64, 17); arrayType$11 = $arrayType($Uint64, 5); ptrType$2 = $ptrType(projCached); ptrType$3 = $ptrType(projLookupTable); ptrType$4 = $ptrType(affineCached); ptrType$5 = $ptrType(affineLookupTable); ptrType$6 = $ptrType(nafLookupTable5); ptrType$7 = $ptrType(nafLookupTable8); ptrType$8 = $ptrType(projP1xP1); ptrType$9 = $ptrType(projP2); ptrType$10 = $ptrType(arrayType$7); projLookupTable.ptr.prototype.FromP3 = function(q) { var i, q, tmpP1xP1, tmpP3, v, x, x$1, x$2; v = this; v.points[0].FromP3(q); tmpP3 = new Point.ptr(new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), arrayType$3.zero()); tmpP1xP1 = new projP1xP1.ptr(new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0))); i = 0; while (true) { if (!(i < 7)) { break; } (x = v.points, x$1 = i + 1 >> 0, ((x$1 < 0 || x$1 >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[x$1])).FromP3(tmpP3.fromP1xP1(tmpP1xP1.Add(q, (x$2 = v.points, ((i < 0 || i >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i]))))); i = i + (1) >> 0; } }; projLookupTable.prototype.FromP3 = function(q) { return this.$val.FromP3(q); }; affineLookupTable.ptr.prototype.FromP3 = function(q) { var i, q, tmpP1xP1, tmpP3, v, x, x$1, x$2; v = this; v.points[0].FromP3(q); tmpP3 = new Point.ptr(new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), arrayType$3.zero()); tmpP1xP1 = new projP1xP1.ptr(new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0))); i = 0; while (true) { if (!(i < 7)) { break; } (x = v.points, x$1 = i + 1 >> 0, ((x$1 < 0 || x$1 >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[x$1])).FromP3(tmpP3.fromP1xP1(tmpP1xP1.AddAffine(q, (x$2 = v.points, ((i < 0 || i >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i]))))); i = i + (1) >> 0; } }; affineLookupTable.prototype.FromP3 = function(q) { return this.$val.FromP3(q); }; nafLookupTable5.ptr.prototype.FromP3 = function(q) { var i, q, q2, tmpP1xP1, tmpP3, v, x, x$1, x$2; v = this; v.points[0].FromP3(q); q2 = new Point.ptr(new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), arrayType$3.zero()); q2.Add(q, q); tmpP3 = new Point.ptr(new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), arrayType$3.zero()); tmpP1xP1 = new projP1xP1.ptr(new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0))); i = 0; while (true) { if (!(i < 7)) { break; } (x = v.points, x$1 = i + 1 >> 0, ((x$1 < 0 || x$1 >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[x$1])).FromP3(tmpP3.fromP1xP1(tmpP1xP1.Add(q2, (x$2 = v.points, ((i < 0 || i >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i]))))); i = i + (1) >> 0; } }; nafLookupTable5.prototype.FromP3 = function(q) { return this.$val.FromP3(q); }; nafLookupTable8.ptr.prototype.FromP3 = function(q) { var i, q, q2, tmpP1xP1, tmpP3, v, x, x$1, x$2; v = this; v.points[0].FromP3(q); q2 = new Point.ptr(new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), arrayType$3.zero()); q2.Add(q, q); tmpP3 = new Point.ptr(new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), arrayType$3.zero()); tmpP1xP1 = new projP1xP1.ptr(new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0))); i = 0; while (true) { if (!(i < 63)) { break; } (x = v.points, x$1 = i + 1 >> 0, ((x$1 < 0 || x$1 >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[x$1])).FromP3(tmpP3.fromP1xP1(tmpP1xP1.AddAffine(q2, (x$2 = v.points, ((i < 0 || i >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i]))))); i = i + (1) >> 0; } }; nafLookupTable8.prototype.FromP3 = function(q) { return this.$val.FromP3(q); }; projLookupTable.ptr.prototype.SelectInto = function(dest, x) { var cond, dest, j, v, x, x$1, x$2, xabs, xmask; v = this; xmask = x >> 7 << 24 >> 24; xabs = ((((((x + xmask << 24 >> 24)) ^ xmask) << 24 >> 24) << 24 >>> 24)); dest.Zero(); j = 1; while (true) { if (!(j <= 8)) { break; } cond = subtle.ConstantTimeByteEq(xabs, ((j << 24 >>> 24))); dest.Select((x$1 = v.points, x$2 = j - 1 >> 0, ((x$2 < 0 || x$2 >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[x$2])), dest, cond); j = j + (1) >> 0; } dest.CondNeg((((xmask & 1) >> 0))); }; projLookupTable.prototype.SelectInto = function(dest, x) { return this.$val.SelectInto(dest, x); }; affineLookupTable.ptr.prototype.SelectInto = function(dest, x) { var cond, dest, j, v, x, x$1, x$2, xabs, xmask; v = this; xmask = x >> 7 << 24 >> 24; xabs = ((((((x + xmask << 24 >> 24)) ^ xmask) << 24 >> 24) << 24 >>> 24)); dest.Zero(); j = 1; while (true) { if (!(j <= 8)) { break; } cond = subtle.ConstantTimeByteEq(xabs, ((j << 24 >>> 24))); dest.Select((x$1 = v.points, x$2 = j - 1 >> 0, ((x$2 < 0 || x$2 >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[x$2])), dest, cond); j = j + (1) >> 0; } dest.CondNeg((((xmask & 1) >> 0))); }; affineLookupTable.prototype.SelectInto = function(dest, x) { return this.$val.SelectInto(dest, x); }; nafLookupTable5.ptr.prototype.SelectInto = function(dest, x) { var _q, dest, v, x, x$1, x$2; v = this; projCached.copy(dest, (x$1 = v.points, x$2 = (_q = x / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")), ((x$2 < 0 || x$2 >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[x$2]))); }; nafLookupTable5.prototype.SelectInto = function(dest, x) { return this.$val.SelectInto(dest, x); }; nafLookupTable8.ptr.prototype.SelectInto = function(dest, x) { var _q, dest, v, x, x$1, x$2; v = this; affineCached.copy(dest, (x$1 = v.points, x$2 = (_q = x / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")), ((x$2 < 0 || x$2 >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[x$2]))); }; nafLookupTable8.prototype.SelectInto = function(dest, x) { return this.$val.SelectInto(dest, x); }; basepointTable = function() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = basepointTablePrecomp.initOnce.Do((function() { var i, j, p, x; p = NewGeneratorPoint(); i = 0; while (true) { if (!(i < 32)) { break; } (x = basepointTablePrecomp.table, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i])).FromP3(p); j = 0; while (true) { if (!(j < 8)) { break; } p.Add(p, p); j = j + (1) >> 0; } i = i + (1) >> 0; } })); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return basepointTablePrecomp.table; /* */ } return; } if ($f === undefined) { $f = { $blk: basepointTable }; } $f.$s = $s; $f.$r = $r; return $f; }; Point.ptr.prototype.ScalarBaseMult = function(x) { var _q, _q$1, _r, basepointTable$1, digits, i, i$1, multiple, tmp1, tmp2, v, 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; _q = $f._q; _q$1 = $f._q$1; _r = $f._r; basepointTable$1 = $f.basepointTable$1; digits = $f.digits; i = $f.i; i$1 = $f.i$1; multiple = $f.multiple; tmp1 = $f.tmp1; tmp2 = $f.tmp2; 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; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = this; _r = basepointTable(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } basepointTable$1 = _r; digits = $clone(x.signedRadix16(), arrayType$4); multiple = new affineCached.ptr(new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0))); tmp1 = new projP1xP1.ptr(new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0))); tmp2 = new projP2.ptr(new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0))); v.Set(NewIdentityPoint()); i = 1; while (true) { if (!(i < 64)) { break; } (x$1 = basepointTable$1, x$2 = (_q = i / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")), ((x$2 < 0 || x$2 >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[x$2])).SelectInto(multiple, ((i < 0 || i >= digits.length) ? ($throwRuntimeError("index out of range"), undefined) : digits[i])); tmp1.AddAffine(v, multiple); v.fromP1xP1(tmp1); i = i + (2) >> 0; } tmp2.FromP3(v); tmp1.Double(tmp2); tmp2.FromP1xP1(tmp1); tmp1.Double(tmp2); tmp2.FromP1xP1(tmp1); tmp1.Double(tmp2); tmp2.FromP1xP1(tmp1); tmp1.Double(tmp2); v.fromP1xP1(tmp1); i$1 = 0; while (true) { if (!(i$1 < 64)) { break; } (x$3 = basepointTable$1, x$4 = (_q$1 = i$1 / 2, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")), ((x$4 < 0 || x$4 >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[x$4])).SelectInto(multiple, ((i$1 < 0 || i$1 >= digits.length) ? ($throwRuntimeError("index out of range"), undefined) : digits[i$1])); tmp1.AddAffine(v, multiple); v.fromP1xP1(tmp1); i$1 = i$1 + (2) >> 0; } $s = -1; return v; /* */ } return; } if ($f === undefined) { $f = { $blk: Point.ptr.prototype.ScalarBaseMult }; } $f._q = _q; $f._q$1 = _q$1; $f._r = _r; $f.basepointTable$1 = basepointTable$1; $f.digits = digits; $f.i = i; $f.i$1 = i$1; $f.multiple = multiple; $f.tmp1 = tmp1; $f.tmp2 = tmp2; $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.$s = $s; $f.$r = $r; return $f; }; Point.prototype.ScalarBaseMult = function(x) { return this.$val.ScalarBaseMult(x); }; Point.ptr.prototype.ScalarMult = function(x, q) { var digits, i, multiple, q, table, tmp1, tmp2, v, x; v = this; checkInitialized(new sliceType$1([q])); table = new projLookupTable.ptr(arrayType$5.zero()); table.FromP3(q); digits = $clone(x.signedRadix16(), arrayType$4); multiple = new projCached.ptr(new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0))); tmp1 = new projP1xP1.ptr(new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0))); tmp2 = new projP2.ptr(new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0))); table.SelectInto(multiple, digits[63]); v.Set(NewIdentityPoint()); tmp1.Add(v, multiple); i = 62; while (true) { if (!(i >= 0)) { break; } tmp2.FromP1xP1(tmp1); tmp1.Double(tmp2); tmp2.FromP1xP1(tmp1); tmp1.Double(tmp2); tmp2.FromP1xP1(tmp1); tmp1.Double(tmp2); tmp2.FromP1xP1(tmp1); tmp1.Double(tmp2); v.fromP1xP1(tmp1); table.SelectInto(multiple, ((i < 0 || i >= digits.length) ? ($throwRuntimeError("index out of range"), undefined) : digits[i])); tmp1.Add(v, multiple); i = i - (1) >> 0; } v.fromP1xP1(tmp1); return v; }; Point.prototype.ScalarMult = function(x, q) { return this.$val.ScalarMult(x, q); }; basepointNafTable = function() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = basepointNafTablePrecomp.initOnce.Do((function() { basepointNafTablePrecomp.table.FromP3(NewGeneratorPoint()); })); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return basepointNafTablePrecomp.table; /* */ } return; } if ($f === undefined) { $f = { $blk: basepointNafTable }; } $f.$s = $s; $f.$r = $r; return $f; }; Point.ptr.prototype.VarTimeDoubleScalarBaseMult = function(a, A, b) { var A, _r, a, aNaf, aTable, b, bNaf, basepointNafTable$1, i, j, multA, multB, tmp1, tmp2, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; A = $f.A; _r = $f._r; a = $f.a; aNaf = $f.aNaf; aTable = $f.aTable; b = $f.b; bNaf = $f.bNaf; basepointNafTable$1 = $f.basepointNafTable$1; i = $f.i; j = $f.j; multA = $f.multA; multB = $f.multB; tmp1 = $f.tmp1; tmp2 = $f.tmp2; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = this; checkInitialized(new sliceType$1([A])); _r = basepointNafTable(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } basepointNafTable$1 = _r; aTable = new nafLookupTable5.ptr(arrayType$5.zero()); aTable.FromP3(A); aNaf = $clone(a.nonAdjacentForm(5), arrayType$6); bNaf = $clone(b.nonAdjacentForm(8), arrayType$6); i = 255; j = i; while (true) { if (!(j >= 0)) { break; } if (!((((j < 0 || j >= aNaf.length) ? ($throwRuntimeError("index out of range"), undefined) : aNaf[j]) === 0)) || !((((j < 0 || j >= bNaf.length) ? ($throwRuntimeError("index out of range"), undefined) : bNaf[j]) === 0))) { break; } j = j - (1) >> 0; } multA = new projCached.ptr(new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0))); multB = new affineCached.ptr(new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0))); tmp1 = new projP1xP1.ptr(new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0))); tmp2 = new projP2.ptr(new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0))); tmp2.Zero(); while (true) { if (!(i >= 0)) { break; } tmp1.Double(tmp2); if (((i < 0 || i >= aNaf.length) ? ($throwRuntimeError("index out of range"), undefined) : aNaf[i]) > 0) { v.fromP1xP1(tmp1); aTable.SelectInto(multA, ((i < 0 || i >= aNaf.length) ? ($throwRuntimeError("index out of range"), undefined) : aNaf[i])); tmp1.Add(v, multA); } else if (((i < 0 || i >= aNaf.length) ? ($throwRuntimeError("index out of range"), undefined) : aNaf[i]) < 0) { v.fromP1xP1(tmp1); aTable.SelectInto(multA, -((i < 0 || i >= aNaf.length) ? ($throwRuntimeError("index out of range"), undefined) : aNaf[i])); tmp1.Sub(v, multA); } if (((i < 0 || i >= bNaf.length) ? ($throwRuntimeError("index out of range"), undefined) : bNaf[i]) > 0) { v.fromP1xP1(tmp1); basepointNafTable$1.SelectInto(multB, ((i < 0 || i >= bNaf.length) ? ($throwRuntimeError("index out of range"), undefined) : bNaf[i])); tmp1.AddAffine(v, multB); } else if (((i < 0 || i >= bNaf.length) ? ($throwRuntimeError("index out of range"), undefined) : bNaf[i]) < 0) { v.fromP1xP1(tmp1); basepointNafTable$1.SelectInto(multB, -((i < 0 || i >= bNaf.length) ? ($throwRuntimeError("index out of range"), undefined) : bNaf[i])); tmp1.SubAffine(v, multB); } tmp2.FromP1xP1(tmp1); i = i - (1) >> 0; } v.fromP2(tmp2); $s = -1; return v; /* */ } return; } if ($f === undefined) { $f = { $blk: Point.ptr.prototype.VarTimeDoubleScalarBaseMult }; } $f.A = A; $f._r = _r; $f.a = a; $f.aNaf = aNaf; $f.aTable = aTable; $f.b = b; $f.bNaf = bNaf; $f.basepointNafTable$1 = basepointNafTable$1; $f.i = i; $f.j = j; $f.multA = multA; $f.multB = multB; $f.tmp1 = tmp1; $f.tmp2 = tmp2; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Point.prototype.VarTimeDoubleScalarBaseMult = function(a, A, b) { return this.$val.VarTimeDoubleScalarBaseMult(a, A, b); }; NewScalar = function() { return new Scalar.ptr(arrayType$7.zero()); }; $pkg.NewScalar = NewScalar; Scalar.ptr.prototype.MultiplyAdd = function(x, y, z) { var s, x, y, z; s = this; scMulAdd(s.s, x.s, y.s, z.s); return s; }; Scalar.prototype.MultiplyAdd = function(x, y, z) { return this.$val.MultiplyAdd(x, y, z); }; Scalar.ptr.prototype.Add = function(x, y) { var s, x, y; s = this; scMulAdd(s.s, scOne.s, x.s, y.s); return s; }; Scalar.prototype.Add = function(x, y) { return this.$val.Add(x, y); }; Scalar.ptr.prototype.Subtract = function(x, y) { var s, x, y; s = this; scMulAdd(s.s, scMinusOne.s, y.s, x.s); return s; }; Scalar.prototype.Subtract = function(x, y) { return this.$val.Subtract(x, y); }; Scalar.ptr.prototype.Negate = function(x) { var s, x; s = this; scMulAdd(s.s, scMinusOne.s, x.s, scZero.s); return s; }; Scalar.prototype.Negate = function(x) { return this.$val.Negate(x); }; Scalar.ptr.prototype.Multiply = function(x, y) { var s, x, y; s = this; scMulAdd(s.s, x.s, y.s, scZero.s); return s; }; Scalar.prototype.Multiply = function(x, y) { return this.$val.Multiply(x, y); }; Scalar.ptr.prototype.Set = function(x) { var s, x; s = this; Scalar.copy(s, x); return s; }; Scalar.prototype.Set = function(x) { return this.$val.Set(x); }; Scalar.ptr.prototype.SetUniformBytes = function(x) { var s, wideBytes, x; s = this; if (!((x.$length === 64))) { $panic(new $String("edwards25519: invalid SetUniformBytes input length")); } wideBytes = arrayType$8.zero(); $copySlice(new sliceType(wideBytes), x); scReduce(s.s, wideBytes); return s; }; Scalar.prototype.SetUniformBytes = function(x) { return this.$val.SetUniformBytes(x); }; Scalar.ptr.prototype.SetCanonicalBytes = function(x) { var s, ss, x; s = this; if (!((x.$length === 32))) { return [ptrType$1.nil, errors.New("invalid scalar length")]; } ss = new Scalar.ptr(arrayType$7.zero()); $copySlice(new sliceType(ss.s), x); if (!isReduced(ss)) { return [ptrType$1.nil, errors.New("invalid scalar encoding")]; } arrayType$7.copy(s.s, ss.s); return [s, $ifaceNil]; }; Scalar.prototype.SetCanonicalBytes = function(x) { return this.$val.SetCanonicalBytes(x); }; isReduced = function(s) { var i, s, x, x$1, x$2, x$3; i = 31; while (true) { if (!(i >= 0)) { break; } if ((x = s.s, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i])) > (x$1 = scMinusOne.s, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i]))) { return false; } else if ((x$2 = s.s, ((i < 0 || i >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i])) < (x$3 = scMinusOne.s, ((i < 0 || i >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[i]))) { return true; } i = i - (1) >> 0; } return true; }; Scalar.ptr.prototype.SetBytesWithClamping = function(x) { var s, wideBytes, x; s = this; if (!((x.$length === 32))) { $panic(new $String("edwards25519: invalid SetBytesWithClamping input length")); } wideBytes = arrayType$8.zero(); $copySlice(new sliceType(wideBytes), x); wideBytes[0] = ((wideBytes[0] & (248)) >>> 0); wideBytes[31] = ((wideBytes[31] & (63)) >>> 0); wideBytes[31] = ((wideBytes[31] | (64)) >>> 0); scReduce(s.s, wideBytes); return s; }; Scalar.prototype.SetBytesWithClamping = function(x) { return this.$val.SetBytesWithClamping(x); }; Scalar.ptr.prototype.Bytes = function() { var buf, s; s = this; buf = $makeSlice(sliceType, 32); $copySlice(buf, new sliceType(s.s)); return buf; }; Scalar.prototype.Bytes = function() { return this.$val.Bytes(); }; Scalar.ptr.prototype.Equal = function(t) { var s, t; s = this; return subtle.ConstantTimeCompare(new sliceType(s.s), new sliceType(t.s)); }; Scalar.prototype.Equal = function(t) { return this.$val.Equal(t); }; load3 = function(in$1) { var in$1, r, x, x$1; r = (new $Int64(0, (0 >= in$1.$length ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + 0]))); r = (x = $shiftLeft64((new $Int64(0, (1 >= in$1.$length ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + 1]))), 8), new $Int64(r.$high | x.$high, (r.$low | x.$low) >>> 0)); r = (x$1 = $shiftLeft64((new $Int64(0, (2 >= in$1.$length ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + 2]))), 16), new $Int64(r.$high | x$1.$high, (r.$low | x$1.$low) >>> 0)); return r; }; load4 = function(in$1) { var in$1, r, x, x$1, x$2; r = (new $Int64(0, (0 >= in$1.$length ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + 0]))); r = (x = $shiftLeft64((new $Int64(0, (1 >= in$1.$length ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + 1]))), 8), new $Int64(r.$high | x.$high, (r.$low | x.$low) >>> 0)); r = (x$1 = $shiftLeft64((new $Int64(0, (2 >= in$1.$length ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + 2]))), 16), new $Int64(r.$high | x$1.$high, (r.$low | x$1.$low) >>> 0)); r = (x$2 = $shiftLeft64((new $Int64(0, (3 >= in$1.$length ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + 3]))), 24), new $Int64(r.$high | x$2.$high, (r.$low | x$2.$low) >>> 0)); return r; }; scMulAdd = function(s, a, b, c) { var a, a0, a1, a10, a11, a2, a3, a4, a5, a6, a7, a8, a9, b, b0, b1, b10, b11, b2, b3, b4, b5, b6, b7, b8, b9, c, c0, c1, c10, c11, c2, c3, c4, c5, c6, c7, c8, c9, carry, s, s0, s1, s10, s11, s12, s13, s14, s15, s16, s17, s18, s19, s2, s20, s21, s22, s23, s3, s4, s5, s6, s7, s8, s9, 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$125, x$126, x$127, x$128, x$129, x$13, x$130, x$131, x$132, x$133, x$134, x$135, x$136, x$137, x$138, x$139, x$14, x$140, x$141, x$142, x$143, x$144, x$145, x$146, x$147, x$148, x$149, x$15, x$150, x$151, x$152, x$153, x$154, x$155, x$156, x$157, x$158, x$159, x$16, x$160, x$161, x$162, x$163, x$164, x$165, x$166, x$167, x$168, x$169, x$17, x$170, x$171, x$172, x$173, x$174, x$175, x$176, x$177, x$178, x$179, x$18, x$180, x$181, x$182, x$183, x$184, x$185, x$186, x$187, x$188, x$189, x$19, x$190, x$191, x$192, x$193, x$194, x$195, x$196, x$197, x$198, x$199, x$2, x$20, x$200, x$201, x$202, x$203, x$204, x$205, x$206, x$207, x$208, x$209, x$21, x$210, x$211, x$212, x$213, x$214, x$215, x$216, x$217, x$218, x$219, x$22, x$220, x$221, x$222, x$223, x$224, x$225, x$226, x$227, x$228, x$229, x$23, x$230, x$231, x$232, x$233, x$234, x$235, x$236, x$237, x$238, x$239, x$24, x$240, x$241, x$242, x$243, x$244, x$245, x$246, x$247, x$248, x$249, x$25, x$250, x$251, x$252, x$253, x$254, x$255, x$256, x$257, x$258, x$259, x$26, x$260, x$261, x$262, x$263, x$264, x$265, x$266, x$267, x$268, x$269, x$27, x$270, x$271, x$272, x$273, x$274, x$275, x$276, x$277, x$278, x$279, x$28, x$280, x$281, x$282, x$283, x$284, x$285, x$286, x$287, x$288, x$289, x$29, x$290, x$291, x$292, x$293, x$294, x$295, x$296, x$297, x$298, x$299, x$3, x$30, x$300, x$301, x$302, x$303, x$304, x$305, x$306, x$307, x$308, x$309, x$31, x$310, x$311, x$312, x$313, x$314, x$315, x$316, x$317, x$318, x$319, x$32, x$320, x$321, x$322, x$323, x$324, x$325, x$326, x$327, x$328, x$329, x$33, x$330, x$331, x$332, x$333, x$334, x$335, x$336, x$337, x$338, x$339, x$34, x$340, x$341, x$342, x$343, x$344, x$345, x$346, x$347, x$348, x$349, x$35, x$350, x$351, x$352, x$353, x$354, x$355, x$356, x$357, x$358, x$359, x$36, x$360, x$361, x$362, x$363, x$364, x$365, x$366, x$367, x$368, x$369, x$37, x$370, x$371, x$372, x$373, x$374, x$375, x$376, x$377, x$378, x$379, x$38, x$380, x$381, x$382, x$383, x$384, x$385, x$386, x$387, x$388, x$389, x$39, x$390, x$391, x$392, x$393, x$394, x$395, x$396, x$397, x$398, x$399, x$4, x$40, x$400, x$401, x$402, x$403, x$404, x$405, x$406, x$407, x$408, x$409, x$41, x$410, x$411, x$412, x$413, x$414, x$415, x$416, x$417, x$418, x$419, x$42, x$420, x$421, x$422, x$423, x$424, x$425, x$426, x$427, x$428, x$429, x$43, x$430, x$431, x$432, x$433, x$434, x$435, x$436, x$437, x$438, x$439, x$44, x$440, x$441, x$442, x$443, x$444, x$445, x$446, x$447, x$448, x$449, x$45, x$450, x$451, x$452, x$453, x$454, x$455, x$456, x$457, x$458, x$459, x$46, x$460, x$461, x$462, x$463, x$464, x$465, x$466, x$467, x$468, x$469, x$47, x$470, x$471, x$472, x$473, x$474, x$475, x$476, x$477, x$478, x$479, x$48, x$480, x$481, x$482, x$483, x$484, x$485, x$486, x$487, x$488, x$489, x$49, x$490, x$491, x$492, x$493, x$494, x$495, x$496, x$497, x$498, x$499, x$5, x$50, x$500, x$501, x$502, x$503, x$504, x$505, x$506, x$507, x$508, x$509, x$51, x$510, x$511, x$512, x$513, x$514, x$515, x$516, x$517, x$518, x$519, x$52, x$520, x$521, x$522, x$523, x$524, x$525, x$526, x$527, x$528, 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; a0 = (x = load3(new sliceType(a)), new $Int64(0 & x.$high, (2097151 & x.$low) >>> 0)); a1 = (x$1 = $shiftRightInt64(load4($subslice(new sliceType(a), 2)), 5), new $Int64(0 & x$1.$high, (2097151 & x$1.$low) >>> 0)); a2 = (x$2 = $shiftRightInt64(load3($subslice(new sliceType(a), 5)), 2), new $Int64(0 & x$2.$high, (2097151 & x$2.$low) >>> 0)); a3 = (x$3 = $shiftRightInt64(load4($subslice(new sliceType(a), 7)), 7), new $Int64(0 & x$3.$high, (2097151 & x$3.$low) >>> 0)); a4 = (x$4 = $shiftRightInt64(load4($subslice(new sliceType(a), 10)), 4), new $Int64(0 & x$4.$high, (2097151 & x$4.$low) >>> 0)); a5 = (x$5 = $shiftRightInt64(load3($subslice(new sliceType(a), 13)), 1), new $Int64(0 & x$5.$high, (2097151 & x$5.$low) >>> 0)); a6 = (x$6 = $shiftRightInt64(load4($subslice(new sliceType(a), 15)), 6), new $Int64(0 & x$6.$high, (2097151 & x$6.$low) >>> 0)); a7 = (x$7 = $shiftRightInt64(load3($subslice(new sliceType(a), 18)), 3), new $Int64(0 & x$7.$high, (2097151 & x$7.$low) >>> 0)); a8 = (x$8 = load3($subslice(new sliceType(a), 21)), new $Int64(0 & x$8.$high, (2097151 & x$8.$low) >>> 0)); a9 = (x$9 = $shiftRightInt64(load4($subslice(new sliceType(a), 23)), 5), new $Int64(0 & x$9.$high, (2097151 & x$9.$low) >>> 0)); a10 = (x$10 = $shiftRightInt64(load3($subslice(new sliceType(a), 26)), 2), new $Int64(0 & x$10.$high, (2097151 & x$10.$low) >>> 0)); a11 = $shiftRightInt64(load4($subslice(new sliceType(a), 28)), 7); b0 = (x$11 = load3(new sliceType(b)), new $Int64(0 & x$11.$high, (2097151 & x$11.$low) >>> 0)); b1 = (x$12 = $shiftRightInt64(load4($subslice(new sliceType(b), 2)), 5), new $Int64(0 & x$12.$high, (2097151 & x$12.$low) >>> 0)); b2 = (x$13 = $shiftRightInt64(load3($subslice(new sliceType(b), 5)), 2), new $Int64(0 & x$13.$high, (2097151 & x$13.$low) >>> 0)); b3 = (x$14 = $shiftRightInt64(load4($subslice(new sliceType(b), 7)), 7), new $Int64(0 & x$14.$high, (2097151 & x$14.$low) >>> 0)); b4 = (x$15 = $shiftRightInt64(load4($subslice(new sliceType(b), 10)), 4), new $Int64(0 & x$15.$high, (2097151 & x$15.$low) >>> 0)); b5 = (x$16 = $shiftRightInt64(load3($subslice(new sliceType(b), 13)), 1), new $Int64(0 & x$16.$high, (2097151 & x$16.$low) >>> 0)); b6 = (x$17 = $shiftRightInt64(load4($subslice(new sliceType(b), 15)), 6), new $Int64(0 & x$17.$high, (2097151 & x$17.$low) >>> 0)); b7 = (x$18 = $shiftRightInt64(load3($subslice(new sliceType(b), 18)), 3), new $Int64(0 & x$18.$high, (2097151 & x$18.$low) >>> 0)); b8 = (x$19 = load3($subslice(new sliceType(b), 21)), new $Int64(0 & x$19.$high, (2097151 & x$19.$low) >>> 0)); b9 = (x$20 = $shiftRightInt64(load4($subslice(new sliceType(b), 23)), 5), new $Int64(0 & x$20.$high, (2097151 & x$20.$low) >>> 0)); b10 = (x$21 = $shiftRightInt64(load3($subslice(new sliceType(b), 26)), 2), new $Int64(0 & x$21.$high, (2097151 & x$21.$low) >>> 0)); b11 = $shiftRightInt64(load4($subslice(new sliceType(b), 28)), 7); c0 = (x$22 = load3(new sliceType(c)), new $Int64(0 & x$22.$high, (2097151 & x$22.$low) >>> 0)); c1 = (x$23 = $shiftRightInt64(load4($subslice(new sliceType(c), 2)), 5), new $Int64(0 & x$23.$high, (2097151 & x$23.$low) >>> 0)); c2 = (x$24 = $shiftRightInt64(load3($subslice(new sliceType(c), 5)), 2), new $Int64(0 & x$24.$high, (2097151 & x$24.$low) >>> 0)); c3 = (x$25 = $shiftRightInt64(load4($subslice(new sliceType(c), 7)), 7), new $Int64(0 & x$25.$high, (2097151 & x$25.$low) >>> 0)); c4 = (x$26 = $shiftRightInt64(load4($subslice(new sliceType(c), 10)), 4), new $Int64(0 & x$26.$high, (2097151 & x$26.$low) >>> 0)); c5 = (x$27 = $shiftRightInt64(load3($subslice(new sliceType(c), 13)), 1), new $Int64(0 & x$27.$high, (2097151 & x$27.$low) >>> 0)); c6 = (x$28 = $shiftRightInt64(load4($subslice(new sliceType(c), 15)), 6), new $Int64(0 & x$28.$high, (2097151 & x$28.$low) >>> 0)); c7 = (x$29 = $shiftRightInt64(load3($subslice(new sliceType(c), 18)), 3), new $Int64(0 & x$29.$high, (2097151 & x$29.$low) >>> 0)); c8 = (x$30 = load3($subslice(new sliceType(c), 21)), new $Int64(0 & x$30.$high, (2097151 & x$30.$low) >>> 0)); c9 = (x$31 = $shiftRightInt64(load4($subslice(new sliceType(c), 23)), 5), new $Int64(0 & x$31.$high, (2097151 & x$31.$low) >>> 0)); c10 = (x$32 = $shiftRightInt64(load3($subslice(new sliceType(c), 26)), 2), new $Int64(0 & x$32.$high, (2097151 & x$32.$low) >>> 0)); c11 = $shiftRightInt64(load4($subslice(new sliceType(c), 28)), 7); carry = arrayType$9.zero(); s0 = (x$33 = $mul64(a0, b0), new $Int64(c0.$high + x$33.$high, c0.$low + x$33.$low)); s1 = (x$34 = (x$35 = $mul64(a0, b1), new $Int64(c1.$high + x$35.$high, c1.$low + x$35.$low)), x$36 = $mul64(a1, b0), new $Int64(x$34.$high + x$36.$high, x$34.$low + x$36.$low)); s2 = (x$37 = (x$38 = (x$39 = $mul64(a0, b2), new $Int64(c2.$high + x$39.$high, c2.$low + x$39.$low)), x$40 = $mul64(a1, b1), new $Int64(x$38.$high + x$40.$high, x$38.$low + x$40.$low)), x$41 = $mul64(a2, b0), new $Int64(x$37.$high + x$41.$high, x$37.$low + x$41.$low)); s3 = (x$42 = (x$43 = (x$44 = (x$45 = $mul64(a0, b3), new $Int64(c3.$high + x$45.$high, c3.$low + x$45.$low)), x$46 = $mul64(a1, b2), new $Int64(x$44.$high + x$46.$high, x$44.$low + x$46.$low)), x$47 = $mul64(a2, b1), new $Int64(x$43.$high + x$47.$high, x$43.$low + x$47.$low)), x$48 = $mul64(a3, b0), new $Int64(x$42.$high + x$48.$high, x$42.$low + x$48.$low)); s4 = (x$49 = (x$50 = (x$51 = (x$52 = (x$53 = $mul64(a0, b4), new $Int64(c4.$high + x$53.$high, c4.$low + x$53.$low)), x$54 = $mul64(a1, b3), new $Int64(x$52.$high + x$54.$high, x$52.$low + x$54.$low)), x$55 = $mul64(a2, b2), new $Int64(x$51.$high + x$55.$high, x$51.$low + x$55.$low)), x$56 = $mul64(a3, b1), new $Int64(x$50.$high + x$56.$high, x$50.$low + x$56.$low)), x$57 = $mul64(a4, b0), new $Int64(x$49.$high + x$57.$high, x$49.$low + x$57.$low)); s5 = (x$58 = (x$59 = (x$60 = (x$61 = (x$62 = (x$63 = $mul64(a0, b5), new $Int64(c5.$high + x$63.$high, c5.$low + x$63.$low)), x$64 = $mul64(a1, b4), new $Int64(x$62.$high + x$64.$high, x$62.$low + x$64.$low)), x$65 = $mul64(a2, b3), new $Int64(x$61.$high + x$65.$high, x$61.$low + x$65.$low)), x$66 = $mul64(a3, b2), new $Int64(x$60.$high + x$66.$high, x$60.$low + x$66.$low)), x$67 = $mul64(a4, b1), new $Int64(x$59.$high + x$67.$high, x$59.$low + x$67.$low)), x$68 = $mul64(a5, b0), new $Int64(x$58.$high + x$68.$high, x$58.$low + x$68.$low)); s6 = (x$69 = (x$70 = (x$71 = (x$72 = (x$73 = (x$74 = (x$75 = $mul64(a0, b6), new $Int64(c6.$high + x$75.$high, c6.$low + x$75.$low)), x$76 = $mul64(a1, b5), new $Int64(x$74.$high + x$76.$high, x$74.$low + x$76.$low)), x$77 = $mul64(a2, b4), new $Int64(x$73.$high + x$77.$high, x$73.$low + x$77.$low)), x$78 = $mul64(a3, b3), new $Int64(x$72.$high + x$78.$high, x$72.$low + x$78.$low)), x$79 = $mul64(a4, b2), new $Int64(x$71.$high + x$79.$high, x$71.$low + x$79.$low)), x$80 = $mul64(a5, b1), new $Int64(x$70.$high + x$80.$high, x$70.$low + x$80.$low)), x$81 = $mul64(a6, b0), new $Int64(x$69.$high + x$81.$high, x$69.$low + x$81.$low)); s7 = (x$82 = (x$83 = (x$84 = (x$85 = (x$86 = (x$87 = (x$88 = (x$89 = $mul64(a0, b7), new $Int64(c7.$high + x$89.$high, c7.$low + x$89.$low)), x$90 = $mul64(a1, b6), new $Int64(x$88.$high + x$90.$high, x$88.$low + x$90.$low)), x$91 = $mul64(a2, b5), new $Int64(x$87.$high + x$91.$high, x$87.$low + x$91.$low)), x$92 = $mul64(a3, b4), new $Int64(x$86.$high + x$92.$high, x$86.$low + x$92.$low)), x$93 = $mul64(a4, b3), new $Int64(x$85.$high + x$93.$high, x$85.$low + x$93.$low)), x$94 = $mul64(a5, b2), new $Int64(x$84.$high + x$94.$high, x$84.$low + x$94.$low)), x$95 = $mul64(a6, b1), new $Int64(x$83.$high + x$95.$high, x$83.$low + x$95.$low)), x$96 = $mul64(a7, b0), new $Int64(x$82.$high + x$96.$high, x$82.$low + x$96.$low)); s8 = (x$97 = (x$98 = (x$99 = (x$100 = (x$101 = (x$102 = (x$103 = (x$104 = (x$105 = $mul64(a0, b8), new $Int64(c8.$high + x$105.$high, c8.$low + x$105.$low)), x$106 = $mul64(a1, b7), new $Int64(x$104.$high + x$106.$high, x$104.$low + x$106.$low)), x$107 = $mul64(a2, b6), new $Int64(x$103.$high + x$107.$high, x$103.$low + x$107.$low)), x$108 = $mul64(a3, b5), new $Int64(x$102.$high + x$108.$high, x$102.$low + x$108.$low)), x$109 = $mul64(a4, b4), new $Int64(x$101.$high + x$109.$high, x$101.$low + x$109.$low)), x$110 = $mul64(a5, b3), new $Int64(x$100.$high + x$110.$high, x$100.$low + x$110.$low)), x$111 = $mul64(a6, b2), new $Int64(x$99.$high + x$111.$high, x$99.$low + x$111.$low)), x$112 = $mul64(a7, b1), new $Int64(x$98.$high + x$112.$high, x$98.$low + x$112.$low)), x$113 = $mul64(a8, b0), new $Int64(x$97.$high + x$113.$high, x$97.$low + x$113.$low)); s9 = (x$114 = (x$115 = (x$116 = (x$117 = (x$118 = (x$119 = (x$120 = (x$121 = (x$122 = (x$123 = $mul64(a0, b9), new $Int64(c9.$high + x$123.$high, c9.$low + x$123.$low)), x$124 = $mul64(a1, b8), new $Int64(x$122.$high + x$124.$high, x$122.$low + x$124.$low)), x$125 = $mul64(a2, b7), new $Int64(x$121.$high + x$125.$high, x$121.$low + x$125.$low)), x$126 = $mul64(a3, b6), new $Int64(x$120.$high + x$126.$high, x$120.$low + x$126.$low)), x$127 = $mul64(a4, b5), new $Int64(x$119.$high + x$127.$high, x$119.$low + x$127.$low)), x$128 = $mul64(a5, b4), new $Int64(x$118.$high + x$128.$high, x$118.$low + x$128.$low)), x$129 = $mul64(a6, b3), new $Int64(x$117.$high + x$129.$high, x$117.$low + x$129.$low)), x$130 = $mul64(a7, b2), new $Int64(x$116.$high + x$130.$high, x$116.$low + x$130.$low)), x$131 = $mul64(a8, b1), new $Int64(x$115.$high + x$131.$high, x$115.$low + x$131.$low)), x$132 = $mul64(a9, b0), new $Int64(x$114.$high + x$132.$high, x$114.$low + x$132.$low)); s10 = (x$133 = (x$134 = (x$135 = (x$136 = (x$137 = (x$138 = (x$139 = (x$140 = (x$141 = (x$142 = (x$143 = $mul64(a0, b10), new $Int64(c10.$high + x$143.$high, c10.$low + x$143.$low)), x$144 = $mul64(a1, b9), new $Int64(x$142.$high + x$144.$high, x$142.$low + x$144.$low)), x$145 = $mul64(a2, b8), new $Int64(x$141.$high + x$145.$high, x$141.$low + x$145.$low)), x$146 = $mul64(a3, b7), new $Int64(x$140.$high + x$146.$high, x$140.$low + x$146.$low)), x$147 = $mul64(a4, b6), new $Int64(x$139.$high + x$147.$high, x$139.$low + x$147.$low)), x$148 = $mul64(a5, b5), new $Int64(x$138.$high + x$148.$high, x$138.$low + x$148.$low)), x$149 = $mul64(a6, b4), new $Int64(x$137.$high + x$149.$high, x$137.$low + x$149.$low)), x$150 = $mul64(a7, b3), new $Int64(x$136.$high + x$150.$high, x$136.$low + x$150.$low)), x$151 = $mul64(a8, b2), new $Int64(x$135.$high + x$151.$high, x$135.$low + x$151.$low)), x$152 = $mul64(a9, b1), new $Int64(x$134.$high + x$152.$high, x$134.$low + x$152.$low)), x$153 = $mul64(a10, b0), new $Int64(x$133.$high + x$153.$high, x$133.$low + x$153.$low)); s11 = (x$154 = (x$155 = (x$156 = (x$157 = (x$158 = (x$159 = (x$160 = (x$161 = (x$162 = (x$163 = (x$164 = (x$165 = $mul64(a0, b11), new $Int64(c11.$high + x$165.$high, c11.$low + x$165.$low)), x$166 = $mul64(a1, b10), new $Int64(x$164.$high + x$166.$high, x$164.$low + x$166.$low)), x$167 = $mul64(a2, b9), new $Int64(x$163.$high + x$167.$high, x$163.$low + x$167.$low)), x$168 = $mul64(a3, b8), new $Int64(x$162.$high + x$168.$high, x$162.$low + x$168.$low)), x$169 = $mul64(a4, b7), new $Int64(x$161.$high + x$169.$high, x$161.$low + x$169.$low)), x$170 = $mul64(a5, b6), new $Int64(x$160.$high + x$170.$high, x$160.$low + x$170.$low)), x$171 = $mul64(a6, b5), new $Int64(x$159.$high + x$171.$high, x$159.$low + x$171.$low)), x$172 = $mul64(a7, b4), new $Int64(x$158.$high + x$172.$high, x$158.$low + x$172.$low)), x$173 = $mul64(a8, b3), new $Int64(x$157.$high + x$173.$high, x$157.$low + x$173.$low)), x$174 = $mul64(a9, b2), new $Int64(x$156.$high + x$174.$high, x$156.$low + x$174.$low)), x$175 = $mul64(a10, b1), new $Int64(x$155.$high + x$175.$high, x$155.$low + x$175.$low)), x$176 = $mul64(a11, b0), new $Int64(x$154.$high + x$176.$high, x$154.$low + x$176.$low)); s12 = (x$177 = (x$178 = (x$179 = (x$180 = (x$181 = (x$182 = (x$183 = (x$184 = (x$185 = (x$186 = $mul64(a1, b11), x$187 = $mul64(a2, b10), new $Int64(x$186.$high + x$187.$high, x$186.$low + x$187.$low)), x$188 = $mul64(a3, b9), new $Int64(x$185.$high + x$188.$high, x$185.$low + x$188.$low)), x$189 = $mul64(a4, b8), new $Int64(x$184.$high + x$189.$high, x$184.$low + x$189.$low)), x$190 = $mul64(a5, b7), new $Int64(x$183.$high + x$190.$high, x$183.$low + x$190.$low)), x$191 = $mul64(a6, b6), new $Int64(x$182.$high + x$191.$high, x$182.$low + x$191.$low)), x$192 = $mul64(a7, b5), new $Int64(x$181.$high + x$192.$high, x$181.$low + x$192.$low)), x$193 = $mul64(a8, b4), new $Int64(x$180.$high + x$193.$high, x$180.$low + x$193.$low)), x$194 = $mul64(a9, b3), new $Int64(x$179.$high + x$194.$high, x$179.$low + x$194.$low)), x$195 = $mul64(a10, b2), new $Int64(x$178.$high + x$195.$high, x$178.$low + x$195.$low)), x$196 = $mul64(a11, b1), new $Int64(x$177.$high + x$196.$high, x$177.$low + x$196.$low)); s13 = (x$197 = (x$198 = (x$199 = (x$200 = (x$201 = (x$202 = (x$203 = (x$204 = (x$205 = $mul64(a2, b11), x$206 = $mul64(a3, b10), new $Int64(x$205.$high + x$206.$high, x$205.$low + x$206.$low)), x$207 = $mul64(a4, b9), new $Int64(x$204.$high + x$207.$high, x$204.$low + x$207.$low)), x$208 = $mul64(a5, b8), new $Int64(x$203.$high + x$208.$high, x$203.$low + x$208.$low)), x$209 = $mul64(a6, b7), new $Int64(x$202.$high + x$209.$high, x$202.$low + x$209.$low)), x$210 = $mul64(a7, b6), new $Int64(x$201.$high + x$210.$high, x$201.$low + x$210.$low)), x$211 = $mul64(a8, b5), new $Int64(x$200.$high + x$211.$high, x$200.$low + x$211.$low)), x$212 = $mul64(a9, b4), new $Int64(x$199.$high + x$212.$high, x$199.$low + x$212.$low)), x$213 = $mul64(a10, b3), new $Int64(x$198.$high + x$213.$high, x$198.$low + x$213.$low)), x$214 = $mul64(a11, b2), new $Int64(x$197.$high + x$214.$high, x$197.$low + x$214.$low)); s14 = (x$215 = (x$216 = (x$217 = (x$218 = (x$219 = (x$220 = (x$221 = (x$222 = $mul64(a3, b11), x$223 = $mul64(a4, b10), new $Int64(x$222.$high + x$223.$high, x$222.$low + x$223.$low)), x$224 = $mul64(a5, b9), new $Int64(x$221.$high + x$224.$high, x$221.$low + x$224.$low)), x$225 = $mul64(a6, b8), new $Int64(x$220.$high + x$225.$high, x$220.$low + x$225.$low)), x$226 = $mul64(a7, b7), new $Int64(x$219.$high + x$226.$high, x$219.$low + x$226.$low)), x$227 = $mul64(a8, b6), new $Int64(x$218.$high + x$227.$high, x$218.$low + x$227.$low)), x$228 = $mul64(a9, b5), new $Int64(x$217.$high + x$228.$high, x$217.$low + x$228.$low)), x$229 = $mul64(a10, b4), new $Int64(x$216.$high + x$229.$high, x$216.$low + x$229.$low)), x$230 = $mul64(a11, b3), new $Int64(x$215.$high + x$230.$high, x$215.$low + x$230.$low)); s15 = (x$231 = (x$232 = (x$233 = (x$234 = (x$235 = (x$236 = (x$237 = $mul64(a4, b11), x$238 = $mul64(a5, b10), new $Int64(x$237.$high + x$238.$high, x$237.$low + x$238.$low)), x$239 = $mul64(a6, b9), new $Int64(x$236.$high + x$239.$high, x$236.$low + x$239.$low)), x$240 = $mul64(a7, b8), new $Int64(x$235.$high + x$240.$high, x$235.$low + x$240.$low)), x$241 = $mul64(a8, b7), new $Int64(x$234.$high + x$241.$high, x$234.$low + x$241.$low)), x$242 = $mul64(a9, b6), new $Int64(x$233.$high + x$242.$high, x$233.$low + x$242.$low)), x$243 = $mul64(a10, b5), new $Int64(x$232.$high + x$243.$high, x$232.$low + x$243.$low)), x$244 = $mul64(a11, b4), new $Int64(x$231.$high + x$244.$high, x$231.$low + x$244.$low)); s16 = (x$245 = (x$246 = (x$247 = (x$248 = (x$249 = (x$250 = $mul64(a5, b11), x$251 = $mul64(a6, b10), new $Int64(x$250.$high + x$251.$high, x$250.$low + x$251.$low)), x$252 = $mul64(a7, b9), new $Int64(x$249.$high + x$252.$high, x$249.$low + x$252.$low)), x$253 = $mul64(a8, b8), new $Int64(x$248.$high + x$253.$high, x$248.$low + x$253.$low)), x$254 = $mul64(a9, b7), new $Int64(x$247.$high + x$254.$high, x$247.$low + x$254.$low)), x$255 = $mul64(a10, b6), new $Int64(x$246.$high + x$255.$high, x$246.$low + x$255.$low)), x$256 = $mul64(a11, b5), new $Int64(x$245.$high + x$256.$high, x$245.$low + x$256.$low)); s17 = (x$257 = (x$258 = (x$259 = (x$260 = (x$261 = $mul64(a6, b11), x$262 = $mul64(a7, b10), new $Int64(x$261.$high + x$262.$high, x$261.$low + x$262.$low)), x$263 = $mul64(a8, b9), new $Int64(x$260.$high + x$263.$high, x$260.$low + x$263.$low)), x$264 = $mul64(a9, b8), new $Int64(x$259.$high + x$264.$high, x$259.$low + x$264.$low)), x$265 = $mul64(a10, b7), new $Int64(x$258.$high + x$265.$high, x$258.$low + x$265.$low)), x$266 = $mul64(a11, b6), new $Int64(x$257.$high + x$266.$high, x$257.$low + x$266.$low)); s18 = (x$267 = (x$268 = (x$269 = (x$270 = $mul64(a7, b11), x$271 = $mul64(a8, b10), new $Int64(x$270.$high + x$271.$high, x$270.$low + x$271.$low)), x$272 = $mul64(a9, b9), new $Int64(x$269.$high + x$272.$high, x$269.$low + x$272.$low)), x$273 = $mul64(a10, b8), new $Int64(x$268.$high + x$273.$high, x$268.$low + x$273.$low)), x$274 = $mul64(a11, b7), new $Int64(x$267.$high + x$274.$high, x$267.$low + x$274.$low)); s19 = (x$275 = (x$276 = (x$277 = $mul64(a8, b11), x$278 = $mul64(a9, b10), new $Int64(x$277.$high + x$278.$high, x$277.$low + x$278.$low)), x$279 = $mul64(a10, b9), new $Int64(x$276.$high + x$279.$high, x$276.$low + x$279.$low)), x$280 = $mul64(a11, b8), new $Int64(x$275.$high + x$280.$high, x$275.$low + x$280.$low)); s20 = (x$281 = (x$282 = $mul64(a9, b11), x$283 = $mul64(a10, b10), new $Int64(x$282.$high + x$283.$high, x$282.$low + x$283.$low)), x$284 = $mul64(a11, b9), new $Int64(x$281.$high + x$284.$high, x$281.$low + x$284.$low)); s21 = (x$285 = $mul64(a10, b11), x$286 = $mul64(a11, b10), new $Int64(x$285.$high + x$286.$high, x$285.$low + x$286.$low)); s22 = $mul64(a11, b11); s23 = new $Int64(0, 0); carry[0] = $shiftRightInt64((new $Int64(s0.$high + 0, s0.$low + 1048576)), 21); s1 = (x$287 = carry[0], new $Int64(s1.$high + x$287.$high, s1.$low + x$287.$low)); s0 = (x$288 = $shiftLeft64(carry[0], 21), new $Int64(s0.$high - x$288.$high, s0.$low - x$288.$low)); carry[2] = $shiftRightInt64((new $Int64(s2.$high + 0, s2.$low + 1048576)), 21); s3 = (x$289 = carry[2], new $Int64(s3.$high + x$289.$high, s3.$low + x$289.$low)); s2 = (x$290 = $shiftLeft64(carry[2], 21), new $Int64(s2.$high - x$290.$high, s2.$low - x$290.$low)); carry[4] = $shiftRightInt64((new $Int64(s4.$high + 0, s4.$low + 1048576)), 21); s5 = (x$291 = carry[4], new $Int64(s5.$high + x$291.$high, s5.$low + x$291.$low)); s4 = (x$292 = $shiftLeft64(carry[4], 21), new $Int64(s4.$high - x$292.$high, s4.$low - x$292.$low)); carry[6] = $shiftRightInt64((new $Int64(s6.$high + 0, s6.$low + 1048576)), 21); s7 = (x$293 = carry[6], new $Int64(s7.$high + x$293.$high, s7.$low + x$293.$low)); s6 = (x$294 = $shiftLeft64(carry[6], 21), new $Int64(s6.$high - x$294.$high, s6.$low - x$294.$low)); carry[8] = $shiftRightInt64((new $Int64(s8.$high + 0, s8.$low + 1048576)), 21); s9 = (x$295 = carry[8], new $Int64(s9.$high + x$295.$high, s9.$low + x$295.$low)); s8 = (x$296 = $shiftLeft64(carry[8], 21), new $Int64(s8.$high - x$296.$high, s8.$low - x$296.$low)); carry[10] = $shiftRightInt64((new $Int64(s10.$high + 0, s10.$low + 1048576)), 21); s11 = (x$297 = carry[10], new $Int64(s11.$high + x$297.$high, s11.$low + x$297.$low)); s10 = (x$298 = $shiftLeft64(carry[10], 21), new $Int64(s10.$high - x$298.$high, s10.$low - x$298.$low)); carry[12] = $shiftRightInt64((new $Int64(s12.$high + 0, s12.$low + 1048576)), 21); s13 = (x$299 = carry[12], new $Int64(s13.$high + x$299.$high, s13.$low + x$299.$low)); s12 = (x$300 = $shiftLeft64(carry[12], 21), new $Int64(s12.$high - x$300.$high, s12.$low - x$300.$low)); carry[14] = $shiftRightInt64((new $Int64(s14.$high + 0, s14.$low + 1048576)), 21); s15 = (x$301 = carry[14], new $Int64(s15.$high + x$301.$high, s15.$low + x$301.$low)); s14 = (x$302 = $shiftLeft64(carry[14], 21), new $Int64(s14.$high - x$302.$high, s14.$low - x$302.$low)); carry[16] = $shiftRightInt64((new $Int64(s16.$high + 0, s16.$low + 1048576)), 21); s17 = (x$303 = carry[16], new $Int64(s17.$high + x$303.$high, s17.$low + x$303.$low)); s16 = (x$304 = $shiftLeft64(carry[16], 21), new $Int64(s16.$high - x$304.$high, s16.$low - x$304.$low)); carry[18] = $shiftRightInt64((new $Int64(s18.$high + 0, s18.$low + 1048576)), 21); s19 = (x$305 = carry[18], new $Int64(s19.$high + x$305.$high, s19.$low + x$305.$low)); s18 = (x$306 = $shiftLeft64(carry[18], 21), new $Int64(s18.$high - x$306.$high, s18.$low - x$306.$low)); carry[20] = $shiftRightInt64((new $Int64(s20.$high + 0, s20.$low + 1048576)), 21); s21 = (x$307 = carry[20], new $Int64(s21.$high + x$307.$high, s21.$low + x$307.$low)); s20 = (x$308 = $shiftLeft64(carry[20], 21), new $Int64(s20.$high - x$308.$high, s20.$low - x$308.$low)); carry[22] = $shiftRightInt64((new $Int64(s22.$high + 0, s22.$low + 1048576)), 21); s23 = (x$309 = carry[22], new $Int64(s23.$high + x$309.$high, s23.$low + x$309.$low)); s22 = (x$310 = $shiftLeft64(carry[22], 21), new $Int64(s22.$high - x$310.$high, s22.$low - x$310.$low)); carry[1] = $shiftRightInt64((new $Int64(s1.$high + 0, s1.$low + 1048576)), 21); s2 = (x$311 = carry[1], new $Int64(s2.$high + x$311.$high, s2.$low + x$311.$low)); s1 = (x$312 = $shiftLeft64(carry[1], 21), new $Int64(s1.$high - x$312.$high, s1.$low - x$312.$low)); carry[3] = $shiftRightInt64((new $Int64(s3.$high + 0, s3.$low + 1048576)), 21); s4 = (x$313 = carry[3], new $Int64(s4.$high + x$313.$high, s4.$low + x$313.$low)); s3 = (x$314 = $shiftLeft64(carry[3], 21), new $Int64(s3.$high - x$314.$high, s3.$low - x$314.$low)); carry[5] = $shiftRightInt64((new $Int64(s5.$high + 0, s5.$low + 1048576)), 21); s6 = (x$315 = carry[5], new $Int64(s6.$high + x$315.$high, s6.$low + x$315.$low)); s5 = (x$316 = $shiftLeft64(carry[5], 21), new $Int64(s5.$high - x$316.$high, s5.$low - x$316.$low)); carry[7] = $shiftRightInt64((new $Int64(s7.$high + 0, s7.$low + 1048576)), 21); s8 = (x$317 = carry[7], new $Int64(s8.$high + x$317.$high, s8.$low + x$317.$low)); s7 = (x$318 = $shiftLeft64(carry[7], 21), new $Int64(s7.$high - x$318.$high, s7.$low - x$318.$low)); carry[9] = $shiftRightInt64((new $Int64(s9.$high + 0, s9.$low + 1048576)), 21); s10 = (x$319 = carry[9], new $Int64(s10.$high + x$319.$high, s10.$low + x$319.$low)); s9 = (x$320 = $shiftLeft64(carry[9], 21), new $Int64(s9.$high - x$320.$high, s9.$low - x$320.$low)); carry[11] = $shiftRightInt64((new $Int64(s11.$high + 0, s11.$low + 1048576)), 21); s12 = (x$321 = carry[11], new $Int64(s12.$high + x$321.$high, s12.$low + x$321.$low)); s11 = (x$322 = $shiftLeft64(carry[11], 21), new $Int64(s11.$high - x$322.$high, s11.$low - x$322.$low)); carry[13] = $shiftRightInt64((new $Int64(s13.$high + 0, s13.$low + 1048576)), 21); s14 = (x$323 = carry[13], new $Int64(s14.$high + x$323.$high, s14.$low + x$323.$low)); s13 = (x$324 = $shiftLeft64(carry[13], 21), new $Int64(s13.$high - x$324.$high, s13.$low - x$324.$low)); carry[15] = $shiftRightInt64((new $Int64(s15.$high + 0, s15.$low + 1048576)), 21); s16 = (x$325 = carry[15], new $Int64(s16.$high + x$325.$high, s16.$low + x$325.$low)); s15 = (x$326 = $shiftLeft64(carry[15], 21), new $Int64(s15.$high - x$326.$high, s15.$low - x$326.$low)); carry[17] = $shiftRightInt64((new $Int64(s17.$high + 0, s17.$low + 1048576)), 21); s18 = (x$327 = carry[17], new $Int64(s18.$high + x$327.$high, s18.$low + x$327.$low)); s17 = (x$328 = $shiftLeft64(carry[17], 21), new $Int64(s17.$high - x$328.$high, s17.$low - x$328.$low)); carry[19] = $shiftRightInt64((new $Int64(s19.$high + 0, s19.$low + 1048576)), 21); s20 = (x$329 = carry[19], new $Int64(s20.$high + x$329.$high, s20.$low + x$329.$low)); s19 = (x$330 = $shiftLeft64(carry[19], 21), new $Int64(s19.$high - x$330.$high, s19.$low - x$330.$low)); carry[21] = $shiftRightInt64((new $Int64(s21.$high + 0, s21.$low + 1048576)), 21); s22 = (x$331 = carry[21], new $Int64(s22.$high + x$331.$high, s22.$low + x$331.$low)); s21 = (x$332 = $shiftLeft64(carry[21], 21), new $Int64(s21.$high - x$332.$high, s21.$low - x$332.$low)); s11 = (x$333 = $mul64(s23, new $Int64(0, 666643)), new $Int64(s11.$high + x$333.$high, s11.$low + x$333.$low)); s12 = (x$334 = $mul64(s23, new $Int64(0, 470296)), new $Int64(s12.$high + x$334.$high, s12.$low + x$334.$low)); s13 = (x$335 = $mul64(s23, new $Int64(0, 654183)), new $Int64(s13.$high + x$335.$high, s13.$low + x$335.$low)); s14 = (x$336 = $mul64(s23, new $Int64(0, 997805)), new $Int64(s14.$high - x$336.$high, s14.$low - x$336.$low)); s15 = (x$337 = $mul64(s23, new $Int64(0, 136657)), new $Int64(s15.$high + x$337.$high, s15.$low + x$337.$low)); s16 = (x$338 = $mul64(s23, new $Int64(0, 683901)), new $Int64(s16.$high - x$338.$high, s16.$low - x$338.$low)); s23 = new $Int64(0, 0); s10 = (x$339 = $mul64(s22, new $Int64(0, 666643)), new $Int64(s10.$high + x$339.$high, s10.$low + x$339.$low)); s11 = (x$340 = $mul64(s22, new $Int64(0, 470296)), new $Int64(s11.$high + x$340.$high, s11.$low + x$340.$low)); s12 = (x$341 = $mul64(s22, new $Int64(0, 654183)), new $Int64(s12.$high + x$341.$high, s12.$low + x$341.$low)); s13 = (x$342 = $mul64(s22, new $Int64(0, 997805)), new $Int64(s13.$high - x$342.$high, s13.$low - x$342.$low)); s14 = (x$343 = $mul64(s22, new $Int64(0, 136657)), new $Int64(s14.$high + x$343.$high, s14.$low + x$343.$low)); s15 = (x$344 = $mul64(s22, new $Int64(0, 683901)), new $Int64(s15.$high - x$344.$high, s15.$low - x$344.$low)); s22 = new $Int64(0, 0); s9 = (x$345 = $mul64(s21, new $Int64(0, 666643)), new $Int64(s9.$high + x$345.$high, s9.$low + x$345.$low)); s10 = (x$346 = $mul64(s21, new $Int64(0, 470296)), new $Int64(s10.$high + x$346.$high, s10.$low + x$346.$low)); s11 = (x$347 = $mul64(s21, new $Int64(0, 654183)), new $Int64(s11.$high + x$347.$high, s11.$low + x$347.$low)); s12 = (x$348 = $mul64(s21, new $Int64(0, 997805)), new $Int64(s12.$high - x$348.$high, s12.$low - x$348.$low)); s13 = (x$349 = $mul64(s21, new $Int64(0, 136657)), new $Int64(s13.$high + x$349.$high, s13.$low + x$349.$low)); s14 = (x$350 = $mul64(s21, new $Int64(0, 683901)), new $Int64(s14.$high - x$350.$high, s14.$low - x$350.$low)); s21 = new $Int64(0, 0); s8 = (x$351 = $mul64(s20, new $Int64(0, 666643)), new $Int64(s8.$high + x$351.$high, s8.$low + x$351.$low)); s9 = (x$352 = $mul64(s20, new $Int64(0, 470296)), new $Int64(s9.$high + x$352.$high, s9.$low + x$352.$low)); s10 = (x$353 = $mul64(s20, new $Int64(0, 654183)), new $Int64(s10.$high + x$353.$high, s10.$low + x$353.$low)); s11 = (x$354 = $mul64(s20, new $Int64(0, 997805)), new $Int64(s11.$high - x$354.$high, s11.$low - x$354.$low)); s12 = (x$355 = $mul64(s20, new $Int64(0, 136657)), new $Int64(s12.$high + x$355.$high, s12.$low + x$355.$low)); s13 = (x$356 = $mul64(s20, new $Int64(0, 683901)), new $Int64(s13.$high - x$356.$high, s13.$low - x$356.$low)); s20 = new $Int64(0, 0); s7 = (x$357 = $mul64(s19, new $Int64(0, 666643)), new $Int64(s7.$high + x$357.$high, s7.$low + x$357.$low)); s8 = (x$358 = $mul64(s19, new $Int64(0, 470296)), new $Int64(s8.$high + x$358.$high, s8.$low + x$358.$low)); s9 = (x$359 = $mul64(s19, new $Int64(0, 654183)), new $Int64(s9.$high + x$359.$high, s9.$low + x$359.$low)); s10 = (x$360 = $mul64(s19, new $Int64(0, 997805)), new $Int64(s10.$high - x$360.$high, s10.$low - x$360.$low)); s11 = (x$361 = $mul64(s19, new $Int64(0, 136657)), new $Int64(s11.$high + x$361.$high, s11.$low + x$361.$low)); s12 = (x$362 = $mul64(s19, new $Int64(0, 683901)), new $Int64(s12.$high - x$362.$high, s12.$low - x$362.$low)); s19 = new $Int64(0, 0); s6 = (x$363 = $mul64(s18, new $Int64(0, 666643)), new $Int64(s6.$high + x$363.$high, s6.$low + x$363.$low)); s7 = (x$364 = $mul64(s18, new $Int64(0, 470296)), new $Int64(s7.$high + x$364.$high, s7.$low + x$364.$low)); s8 = (x$365 = $mul64(s18, new $Int64(0, 654183)), new $Int64(s8.$high + x$365.$high, s8.$low + x$365.$low)); s9 = (x$366 = $mul64(s18, new $Int64(0, 997805)), new $Int64(s9.$high - x$366.$high, s9.$low - x$366.$low)); s10 = (x$367 = $mul64(s18, new $Int64(0, 136657)), new $Int64(s10.$high + x$367.$high, s10.$low + x$367.$low)); s11 = (x$368 = $mul64(s18, new $Int64(0, 683901)), new $Int64(s11.$high - x$368.$high, s11.$low - x$368.$low)); s18 = new $Int64(0, 0); carry[6] = $shiftRightInt64((new $Int64(s6.$high + 0, s6.$low + 1048576)), 21); s7 = (x$369 = carry[6], new $Int64(s7.$high + x$369.$high, s7.$low + x$369.$low)); s6 = (x$370 = $shiftLeft64(carry[6], 21), new $Int64(s6.$high - x$370.$high, s6.$low - x$370.$low)); carry[8] = $shiftRightInt64((new $Int64(s8.$high + 0, s8.$low + 1048576)), 21); s9 = (x$371 = carry[8], new $Int64(s9.$high + x$371.$high, s9.$low + x$371.$low)); s8 = (x$372 = $shiftLeft64(carry[8], 21), new $Int64(s8.$high - x$372.$high, s8.$low - x$372.$low)); carry[10] = $shiftRightInt64((new $Int64(s10.$high + 0, s10.$low + 1048576)), 21); s11 = (x$373 = carry[10], new $Int64(s11.$high + x$373.$high, s11.$low + x$373.$low)); s10 = (x$374 = $shiftLeft64(carry[10], 21), new $Int64(s10.$high - x$374.$high, s10.$low - x$374.$low)); carry[12] = $shiftRightInt64((new $Int64(s12.$high + 0, s12.$low + 1048576)), 21); s13 = (x$375 = carry[12], new $Int64(s13.$high + x$375.$high, s13.$low + x$375.$low)); s12 = (x$376 = $shiftLeft64(carry[12], 21), new $Int64(s12.$high - x$376.$high, s12.$low - x$376.$low)); carry[14] = $shiftRightInt64((new $Int64(s14.$high + 0, s14.$low + 1048576)), 21); s15 = (x$377 = carry[14], new $Int64(s15.$high + x$377.$high, s15.$low + x$377.$low)); s14 = (x$378 = $shiftLeft64(carry[14], 21), new $Int64(s14.$high - x$378.$high, s14.$low - x$378.$low)); carry[16] = $shiftRightInt64((new $Int64(s16.$high + 0, s16.$low + 1048576)), 21); s17 = (x$379 = carry[16], new $Int64(s17.$high + x$379.$high, s17.$low + x$379.$low)); s16 = (x$380 = $shiftLeft64(carry[16], 21), new $Int64(s16.$high - x$380.$high, s16.$low - x$380.$low)); carry[7] = $shiftRightInt64((new $Int64(s7.$high + 0, s7.$low + 1048576)), 21); s8 = (x$381 = carry[7], new $Int64(s8.$high + x$381.$high, s8.$low + x$381.$low)); s7 = (x$382 = $shiftLeft64(carry[7], 21), new $Int64(s7.$high - x$382.$high, s7.$low - x$382.$low)); carry[9] = $shiftRightInt64((new $Int64(s9.$high + 0, s9.$low + 1048576)), 21); s10 = (x$383 = carry[9], new $Int64(s10.$high + x$383.$high, s10.$low + x$383.$low)); s9 = (x$384 = $shiftLeft64(carry[9], 21), new $Int64(s9.$high - x$384.$high, s9.$low - x$384.$low)); carry[11] = $shiftRightInt64((new $Int64(s11.$high + 0, s11.$low + 1048576)), 21); s12 = (x$385 = carry[11], new $Int64(s12.$high + x$385.$high, s12.$low + x$385.$low)); s11 = (x$386 = $shiftLeft64(carry[11], 21), new $Int64(s11.$high - x$386.$high, s11.$low - x$386.$low)); carry[13] = $shiftRightInt64((new $Int64(s13.$high + 0, s13.$low + 1048576)), 21); s14 = (x$387 = carry[13], new $Int64(s14.$high + x$387.$high, s14.$low + x$387.$low)); s13 = (x$388 = $shiftLeft64(carry[13], 21), new $Int64(s13.$high - x$388.$high, s13.$low - x$388.$low)); carry[15] = $shiftRightInt64((new $Int64(s15.$high + 0, s15.$low + 1048576)), 21); s16 = (x$389 = carry[15], new $Int64(s16.$high + x$389.$high, s16.$low + x$389.$low)); s15 = (x$390 = $shiftLeft64(carry[15], 21), new $Int64(s15.$high - x$390.$high, s15.$low - x$390.$low)); s5 = (x$391 = $mul64(s17, new $Int64(0, 666643)), new $Int64(s5.$high + x$391.$high, s5.$low + x$391.$low)); s6 = (x$392 = $mul64(s17, new $Int64(0, 470296)), new $Int64(s6.$high + x$392.$high, s6.$low + x$392.$low)); s7 = (x$393 = $mul64(s17, new $Int64(0, 654183)), new $Int64(s7.$high + x$393.$high, s7.$low + x$393.$low)); s8 = (x$394 = $mul64(s17, new $Int64(0, 997805)), new $Int64(s8.$high - x$394.$high, s8.$low - x$394.$low)); s9 = (x$395 = $mul64(s17, new $Int64(0, 136657)), new $Int64(s9.$high + x$395.$high, s9.$low + x$395.$low)); s10 = (x$396 = $mul64(s17, new $Int64(0, 683901)), new $Int64(s10.$high - x$396.$high, s10.$low - x$396.$low)); s17 = new $Int64(0, 0); s4 = (x$397 = $mul64(s16, new $Int64(0, 666643)), new $Int64(s4.$high + x$397.$high, s4.$low + x$397.$low)); s5 = (x$398 = $mul64(s16, new $Int64(0, 470296)), new $Int64(s5.$high + x$398.$high, s5.$low + x$398.$low)); s6 = (x$399 = $mul64(s16, new $Int64(0, 654183)), new $Int64(s6.$high + x$399.$high, s6.$low + x$399.$low)); s7 = (x$400 = $mul64(s16, new $Int64(0, 997805)), new $Int64(s7.$high - x$400.$high, s7.$low - x$400.$low)); s8 = (x$401 = $mul64(s16, new $Int64(0, 136657)), new $Int64(s8.$high + x$401.$high, s8.$low + x$401.$low)); s9 = (x$402 = $mul64(s16, new $Int64(0, 683901)), new $Int64(s9.$high - x$402.$high, s9.$low - x$402.$low)); s16 = new $Int64(0, 0); s3 = (x$403 = $mul64(s15, new $Int64(0, 666643)), new $Int64(s3.$high + x$403.$high, s3.$low + x$403.$low)); s4 = (x$404 = $mul64(s15, new $Int64(0, 470296)), new $Int64(s4.$high + x$404.$high, s4.$low + x$404.$low)); s5 = (x$405 = $mul64(s15, new $Int64(0, 654183)), new $Int64(s5.$high + x$405.$high, s5.$low + x$405.$low)); s6 = (x$406 = $mul64(s15, new $Int64(0, 997805)), new $Int64(s6.$high - x$406.$high, s6.$low - x$406.$low)); s7 = (x$407 = $mul64(s15, new $Int64(0, 136657)), new $Int64(s7.$high + x$407.$high, s7.$low + x$407.$low)); s8 = (x$408 = $mul64(s15, new $Int64(0, 683901)), new $Int64(s8.$high - x$408.$high, s8.$low - x$408.$low)); s15 = new $Int64(0, 0); s2 = (x$409 = $mul64(s14, new $Int64(0, 666643)), new $Int64(s2.$high + x$409.$high, s2.$low + x$409.$low)); s3 = (x$410 = $mul64(s14, new $Int64(0, 470296)), new $Int64(s3.$high + x$410.$high, s3.$low + x$410.$low)); s4 = (x$411 = $mul64(s14, new $Int64(0, 654183)), new $Int64(s4.$high + x$411.$high, s4.$low + x$411.$low)); s5 = (x$412 = $mul64(s14, new $Int64(0, 997805)), new $Int64(s5.$high - x$412.$high, s5.$low - x$412.$low)); s6 = (x$413 = $mul64(s14, new $Int64(0, 136657)), new $Int64(s6.$high + x$413.$high, s6.$low + x$413.$low)); s7 = (x$414 = $mul64(s14, new $Int64(0, 683901)), new $Int64(s7.$high - x$414.$high, s7.$low - x$414.$low)); s14 = new $Int64(0, 0); s1 = (x$415 = $mul64(s13, new $Int64(0, 666643)), new $Int64(s1.$high + x$415.$high, s1.$low + x$415.$low)); s2 = (x$416 = $mul64(s13, new $Int64(0, 470296)), new $Int64(s2.$high + x$416.$high, s2.$low + x$416.$low)); s3 = (x$417 = $mul64(s13, new $Int64(0, 654183)), new $Int64(s3.$high + x$417.$high, s3.$low + x$417.$low)); s4 = (x$418 = $mul64(s13, new $Int64(0, 997805)), new $Int64(s4.$high - x$418.$high, s4.$low - x$418.$low)); s5 = (x$419 = $mul64(s13, new $Int64(0, 136657)), new $Int64(s5.$high + x$419.$high, s5.$low + x$419.$low)); s6 = (x$420 = $mul64(s13, new $Int64(0, 683901)), new $Int64(s6.$high - x$420.$high, s6.$low - x$420.$low)); s13 = new $Int64(0, 0); s0 = (x$421 = $mul64(s12, new $Int64(0, 666643)), new $Int64(s0.$high + x$421.$high, s0.$low + x$421.$low)); s1 = (x$422 = $mul64(s12, new $Int64(0, 470296)), new $Int64(s1.$high + x$422.$high, s1.$low + x$422.$low)); s2 = (x$423 = $mul64(s12, new $Int64(0, 654183)), new $Int64(s2.$high + x$423.$high, s2.$low + x$423.$low)); s3 = (x$424 = $mul64(s12, new $Int64(0, 997805)), new $Int64(s3.$high - x$424.$high, s3.$low - x$424.$low)); s4 = (x$425 = $mul64(s12, new $Int64(0, 136657)), new $Int64(s4.$high + x$425.$high, s4.$low + x$425.$low)); s5 = (x$426 = $mul64(s12, new $Int64(0, 683901)), new $Int64(s5.$high - x$426.$high, s5.$low - x$426.$low)); s12 = new $Int64(0, 0); carry[0] = $shiftRightInt64((new $Int64(s0.$high + 0, s0.$low + 1048576)), 21); s1 = (x$427 = carry[0], new $Int64(s1.$high + x$427.$high, s1.$low + x$427.$low)); s0 = (x$428 = $shiftLeft64(carry[0], 21), new $Int64(s0.$high - x$428.$high, s0.$low - x$428.$low)); carry[2] = $shiftRightInt64((new $Int64(s2.$high + 0, s2.$low + 1048576)), 21); s3 = (x$429 = carry[2], new $Int64(s3.$high + x$429.$high, s3.$low + x$429.$low)); s2 = (x$430 = $shiftLeft64(carry[2], 21), new $Int64(s2.$high - x$430.$high, s2.$low - x$430.$low)); carry[4] = $shiftRightInt64((new $Int64(s4.$high + 0, s4.$low + 1048576)), 21); s5 = (x$431 = carry[4], new $Int64(s5.$high + x$431.$high, s5.$low + x$431.$low)); s4 = (x$432 = $shiftLeft64(carry[4], 21), new $Int64(s4.$high - x$432.$high, s4.$low - x$432.$low)); carry[6] = $shiftRightInt64((new $Int64(s6.$high + 0, s6.$low + 1048576)), 21); s7 = (x$433 = carry[6], new $Int64(s7.$high + x$433.$high, s7.$low + x$433.$low)); s6 = (x$434 = $shiftLeft64(carry[6], 21), new $Int64(s6.$high - x$434.$high, s6.$low - x$434.$low)); carry[8] = $shiftRightInt64((new $Int64(s8.$high + 0, s8.$low + 1048576)), 21); s9 = (x$435 = carry[8], new $Int64(s9.$high + x$435.$high, s9.$low + x$435.$low)); s8 = (x$436 = $shiftLeft64(carry[8], 21), new $Int64(s8.$high - x$436.$high, s8.$low - x$436.$low)); carry[10] = $shiftRightInt64((new $Int64(s10.$high + 0, s10.$low + 1048576)), 21); s11 = (x$437 = carry[10], new $Int64(s11.$high + x$437.$high, s11.$low + x$437.$low)); s10 = (x$438 = $shiftLeft64(carry[10], 21), new $Int64(s10.$high - x$438.$high, s10.$low - x$438.$low)); carry[1] = $shiftRightInt64((new $Int64(s1.$high + 0, s1.$low + 1048576)), 21); s2 = (x$439 = carry[1], new $Int64(s2.$high + x$439.$high, s2.$low + x$439.$low)); s1 = (x$440 = $shiftLeft64(carry[1], 21), new $Int64(s1.$high - x$440.$high, s1.$low - x$440.$low)); carry[3] = $shiftRightInt64((new $Int64(s3.$high + 0, s3.$low + 1048576)), 21); s4 = (x$441 = carry[3], new $Int64(s4.$high + x$441.$high, s4.$low + x$441.$low)); s3 = (x$442 = $shiftLeft64(carry[3], 21), new $Int64(s3.$high - x$442.$high, s3.$low - x$442.$low)); carry[5] = $shiftRightInt64((new $Int64(s5.$high + 0, s5.$low + 1048576)), 21); s6 = (x$443 = carry[5], new $Int64(s6.$high + x$443.$high, s6.$low + x$443.$low)); s5 = (x$444 = $shiftLeft64(carry[5], 21), new $Int64(s5.$high - x$444.$high, s5.$low - x$444.$low)); carry[7] = $shiftRightInt64((new $Int64(s7.$high + 0, s7.$low + 1048576)), 21); s8 = (x$445 = carry[7], new $Int64(s8.$high + x$445.$high, s8.$low + x$445.$low)); s7 = (x$446 = $shiftLeft64(carry[7], 21), new $Int64(s7.$high - x$446.$high, s7.$low - x$446.$low)); carry[9] = $shiftRightInt64((new $Int64(s9.$high + 0, s9.$low + 1048576)), 21); s10 = (x$447 = carry[9], new $Int64(s10.$high + x$447.$high, s10.$low + x$447.$low)); s9 = (x$448 = $shiftLeft64(carry[9], 21), new $Int64(s9.$high - x$448.$high, s9.$low - x$448.$low)); carry[11] = $shiftRightInt64((new $Int64(s11.$high + 0, s11.$low + 1048576)), 21); s12 = (x$449 = carry[11], new $Int64(s12.$high + x$449.$high, s12.$low + x$449.$low)); s11 = (x$450 = $shiftLeft64(carry[11], 21), new $Int64(s11.$high - x$450.$high, s11.$low - x$450.$low)); s0 = (x$451 = $mul64(s12, new $Int64(0, 666643)), new $Int64(s0.$high + x$451.$high, s0.$low + x$451.$low)); s1 = (x$452 = $mul64(s12, new $Int64(0, 470296)), new $Int64(s1.$high + x$452.$high, s1.$low + x$452.$low)); s2 = (x$453 = $mul64(s12, new $Int64(0, 654183)), new $Int64(s2.$high + x$453.$high, s2.$low + x$453.$low)); s3 = (x$454 = $mul64(s12, new $Int64(0, 997805)), new $Int64(s3.$high - x$454.$high, s3.$low - x$454.$low)); s4 = (x$455 = $mul64(s12, new $Int64(0, 136657)), new $Int64(s4.$high + x$455.$high, s4.$low + x$455.$low)); s5 = (x$456 = $mul64(s12, new $Int64(0, 683901)), new $Int64(s5.$high - x$456.$high, s5.$low - x$456.$low)); s12 = new $Int64(0, 0); carry[0] = $shiftRightInt64(s0, 21); s1 = (x$457 = carry[0], new $Int64(s1.$high + x$457.$high, s1.$low + x$457.$low)); s0 = (x$458 = $shiftLeft64(carry[0], 21), new $Int64(s0.$high - x$458.$high, s0.$low - x$458.$low)); carry[1] = $shiftRightInt64(s1, 21); s2 = (x$459 = carry[1], new $Int64(s2.$high + x$459.$high, s2.$low + x$459.$low)); s1 = (x$460 = $shiftLeft64(carry[1], 21), new $Int64(s1.$high - x$460.$high, s1.$low - x$460.$low)); carry[2] = $shiftRightInt64(s2, 21); s3 = (x$461 = carry[2], new $Int64(s3.$high + x$461.$high, s3.$low + x$461.$low)); s2 = (x$462 = $shiftLeft64(carry[2], 21), new $Int64(s2.$high - x$462.$high, s2.$low - x$462.$low)); carry[3] = $shiftRightInt64(s3, 21); s4 = (x$463 = carry[3], new $Int64(s4.$high + x$463.$high, s4.$low + x$463.$low)); s3 = (x$464 = $shiftLeft64(carry[3], 21), new $Int64(s3.$high - x$464.$high, s3.$low - x$464.$low)); carry[4] = $shiftRightInt64(s4, 21); s5 = (x$465 = carry[4], new $Int64(s5.$high + x$465.$high, s5.$low + x$465.$low)); s4 = (x$466 = $shiftLeft64(carry[4], 21), new $Int64(s4.$high - x$466.$high, s4.$low - x$466.$low)); carry[5] = $shiftRightInt64(s5, 21); s6 = (x$467 = carry[5], new $Int64(s6.$high + x$467.$high, s6.$low + x$467.$low)); s5 = (x$468 = $shiftLeft64(carry[5], 21), new $Int64(s5.$high - x$468.$high, s5.$low - x$468.$low)); carry[6] = $shiftRightInt64(s6, 21); s7 = (x$469 = carry[6], new $Int64(s7.$high + x$469.$high, s7.$low + x$469.$low)); s6 = (x$470 = $shiftLeft64(carry[6], 21), new $Int64(s6.$high - x$470.$high, s6.$low - x$470.$low)); carry[7] = $shiftRightInt64(s7, 21); s8 = (x$471 = carry[7], new $Int64(s8.$high + x$471.$high, s8.$low + x$471.$low)); s7 = (x$472 = $shiftLeft64(carry[7], 21), new $Int64(s7.$high - x$472.$high, s7.$low - x$472.$low)); carry[8] = $shiftRightInt64(s8, 21); s9 = (x$473 = carry[8], new $Int64(s9.$high + x$473.$high, s9.$low + x$473.$low)); s8 = (x$474 = $shiftLeft64(carry[8], 21), new $Int64(s8.$high - x$474.$high, s8.$low - x$474.$low)); carry[9] = $shiftRightInt64(s9, 21); s10 = (x$475 = carry[9], new $Int64(s10.$high + x$475.$high, s10.$low + x$475.$low)); s9 = (x$476 = $shiftLeft64(carry[9], 21), new $Int64(s9.$high - x$476.$high, s9.$low - x$476.$low)); carry[10] = $shiftRightInt64(s10, 21); s11 = (x$477 = carry[10], new $Int64(s11.$high + x$477.$high, s11.$low + x$477.$low)); s10 = (x$478 = $shiftLeft64(carry[10], 21), new $Int64(s10.$high - x$478.$high, s10.$low - x$478.$low)); carry[11] = $shiftRightInt64(s11, 21); s12 = (x$479 = carry[11], new $Int64(s12.$high + x$479.$high, s12.$low + x$479.$low)); s11 = (x$480 = $shiftLeft64(carry[11], 21), new $Int64(s11.$high - x$480.$high, s11.$low - x$480.$low)); s0 = (x$481 = $mul64(s12, new $Int64(0, 666643)), new $Int64(s0.$high + x$481.$high, s0.$low + x$481.$low)); s1 = (x$482 = $mul64(s12, new $Int64(0, 470296)), new $Int64(s1.$high + x$482.$high, s1.$low + x$482.$low)); s2 = (x$483 = $mul64(s12, new $Int64(0, 654183)), new $Int64(s2.$high + x$483.$high, s2.$low + x$483.$low)); s3 = (x$484 = $mul64(s12, new $Int64(0, 997805)), new $Int64(s3.$high - x$484.$high, s3.$low - x$484.$low)); s4 = (x$485 = $mul64(s12, new $Int64(0, 136657)), new $Int64(s4.$high + x$485.$high, s4.$low + x$485.$low)); s5 = (x$486 = $mul64(s12, new $Int64(0, 683901)), new $Int64(s5.$high - x$486.$high, s5.$low - x$486.$low)); s12 = new $Int64(0, 0); carry[0] = $shiftRightInt64(s0, 21); s1 = (x$487 = carry[0], new $Int64(s1.$high + x$487.$high, s1.$low + x$487.$low)); s0 = (x$488 = $shiftLeft64(carry[0], 21), new $Int64(s0.$high - x$488.$high, s0.$low - x$488.$low)); carry[1] = $shiftRightInt64(s1, 21); s2 = (x$489 = carry[1], new $Int64(s2.$high + x$489.$high, s2.$low + x$489.$low)); s1 = (x$490 = $shiftLeft64(carry[1], 21), new $Int64(s1.$high - x$490.$high, s1.$low - x$490.$low)); carry[2] = $shiftRightInt64(s2, 21); s3 = (x$491 = carry[2], new $Int64(s3.$high + x$491.$high, s3.$low + x$491.$low)); s2 = (x$492 = $shiftLeft64(carry[2], 21), new $Int64(s2.$high - x$492.$high, s2.$low - x$492.$low)); carry[3] = $shiftRightInt64(s3, 21); s4 = (x$493 = carry[3], new $Int64(s4.$high + x$493.$high, s4.$low + x$493.$low)); s3 = (x$494 = $shiftLeft64(carry[3], 21), new $Int64(s3.$high - x$494.$high, s3.$low - x$494.$low)); carry[4] = $shiftRightInt64(s4, 21); s5 = (x$495 = carry[4], new $Int64(s5.$high + x$495.$high, s5.$low + x$495.$low)); s4 = (x$496 = $shiftLeft64(carry[4], 21), new $Int64(s4.$high - x$496.$high, s4.$low - x$496.$low)); carry[5] = $shiftRightInt64(s5, 21); s6 = (x$497 = carry[5], new $Int64(s6.$high + x$497.$high, s6.$low + x$497.$low)); s5 = (x$498 = $shiftLeft64(carry[5], 21), new $Int64(s5.$high - x$498.$high, s5.$low - x$498.$low)); carry[6] = $shiftRightInt64(s6, 21); s7 = (x$499 = carry[6], new $Int64(s7.$high + x$499.$high, s7.$low + x$499.$low)); s6 = (x$500 = $shiftLeft64(carry[6], 21), new $Int64(s6.$high - x$500.$high, s6.$low - x$500.$low)); carry[7] = $shiftRightInt64(s7, 21); s8 = (x$501 = carry[7], new $Int64(s8.$high + x$501.$high, s8.$low + x$501.$low)); s7 = (x$502 = $shiftLeft64(carry[7], 21), new $Int64(s7.$high - x$502.$high, s7.$low - x$502.$low)); carry[8] = $shiftRightInt64(s8, 21); s9 = (x$503 = carry[8], new $Int64(s9.$high + x$503.$high, s9.$low + x$503.$low)); s8 = (x$504 = $shiftLeft64(carry[8], 21), new $Int64(s8.$high - x$504.$high, s8.$low - x$504.$low)); carry[9] = $shiftRightInt64(s9, 21); s10 = (x$505 = carry[9], new $Int64(s10.$high + x$505.$high, s10.$low + x$505.$low)); s9 = (x$506 = $shiftLeft64(carry[9], 21), new $Int64(s9.$high - x$506.$high, s9.$low - x$506.$low)); carry[10] = $shiftRightInt64(s10, 21); s11 = (x$507 = carry[10], new $Int64(s11.$high + x$507.$high, s11.$low + x$507.$low)); s10 = (x$508 = $shiftLeft64(carry[10], 21), new $Int64(s10.$high - x$508.$high, s10.$low - x$508.$low)); s.nilCheck, s[0] = (($shiftRightInt64(s0, 0).$low << 24 >>> 24)); s.nilCheck, s[1] = (($shiftRightInt64(s0, 8).$low << 24 >>> 24)); s.nilCheck, s[2] = (((x$509 = $shiftRightInt64(s0, 16), x$510 = $shiftLeft64(s1, 5), new $Int64(x$509.$high | x$510.$high, (x$509.$low | x$510.$low) >>> 0)).$low << 24 >>> 24)); s.nilCheck, s[3] = (($shiftRightInt64(s1, 3).$low << 24 >>> 24)); s.nilCheck, s[4] = (($shiftRightInt64(s1, 11).$low << 24 >>> 24)); s.nilCheck, s[5] = (((x$511 = $shiftRightInt64(s1, 19), x$512 = $shiftLeft64(s2, 2), new $Int64(x$511.$high | x$512.$high, (x$511.$low | x$512.$low) >>> 0)).$low << 24 >>> 24)); s.nilCheck, s[6] = (($shiftRightInt64(s2, 6).$low << 24 >>> 24)); s.nilCheck, s[7] = (((x$513 = $shiftRightInt64(s2, 14), x$514 = $shiftLeft64(s3, 7), new $Int64(x$513.$high | x$514.$high, (x$513.$low | x$514.$low) >>> 0)).$low << 24 >>> 24)); s.nilCheck, s[8] = (($shiftRightInt64(s3, 1).$low << 24 >>> 24)); s.nilCheck, s[9] = (($shiftRightInt64(s3, 9).$low << 24 >>> 24)); s.nilCheck, s[10] = (((x$515 = $shiftRightInt64(s3, 17), x$516 = $shiftLeft64(s4, 4), new $Int64(x$515.$high | x$516.$high, (x$515.$low | x$516.$low) >>> 0)).$low << 24 >>> 24)); s.nilCheck, s[11] = (($shiftRightInt64(s4, 4).$low << 24 >>> 24)); s.nilCheck, s[12] = (($shiftRightInt64(s4, 12).$low << 24 >>> 24)); s.nilCheck, s[13] = (((x$517 = $shiftRightInt64(s4, 20), x$518 = $shiftLeft64(s5, 1), new $Int64(x$517.$high | x$518.$high, (x$517.$low | x$518.$low) >>> 0)).$low << 24 >>> 24)); s.nilCheck, s[14] = (($shiftRightInt64(s5, 7).$low << 24 >>> 24)); s.nilCheck, s[15] = (((x$519 = $shiftRightInt64(s5, 15), x$520 = $shiftLeft64(s6, 6), new $Int64(x$519.$high | x$520.$high, (x$519.$low | x$520.$low) >>> 0)).$low << 24 >>> 24)); s.nilCheck, s[16] = (($shiftRightInt64(s6, 2).$low << 24 >>> 24)); s.nilCheck, s[17] = (($shiftRightInt64(s6, 10).$low << 24 >>> 24)); s.nilCheck, s[18] = (((x$521 = $shiftRightInt64(s6, 18), x$522 = $shiftLeft64(s7, 3), new $Int64(x$521.$high | x$522.$high, (x$521.$low | x$522.$low) >>> 0)).$low << 24 >>> 24)); s.nilCheck, s[19] = (($shiftRightInt64(s7, 5).$low << 24 >>> 24)); s.nilCheck, s[20] = (($shiftRightInt64(s7, 13).$low << 24 >>> 24)); s.nilCheck, s[21] = (($shiftRightInt64(s8, 0).$low << 24 >>> 24)); s.nilCheck, s[22] = (($shiftRightInt64(s8, 8).$low << 24 >>> 24)); s.nilCheck, s[23] = (((x$523 = $shiftRightInt64(s8, 16), x$524 = $shiftLeft64(s9, 5), new $Int64(x$523.$high | x$524.$high, (x$523.$low | x$524.$low) >>> 0)).$low << 24 >>> 24)); s.nilCheck, s[24] = (($shiftRightInt64(s9, 3).$low << 24 >>> 24)); s.nilCheck, s[25] = (($shiftRightInt64(s9, 11).$low << 24 >>> 24)); s.nilCheck, s[26] = (((x$525 = $shiftRightInt64(s9, 19), x$526 = $shiftLeft64(s10, 2), new $Int64(x$525.$high | x$526.$high, (x$525.$low | x$526.$low) >>> 0)).$low << 24 >>> 24)); s.nilCheck, s[27] = (($shiftRightInt64(s10, 6).$low << 24 >>> 24)); s.nilCheck, s[28] = (((x$527 = $shiftRightInt64(s10, 14), x$528 = $shiftLeft64(s11, 7), new $Int64(x$527.$high | x$528.$high, (x$527.$low | x$528.$low) >>> 0)).$low << 24 >>> 24)); s.nilCheck, s[29] = (($shiftRightInt64(s11, 1).$low << 24 >>> 24)); s.nilCheck, s[30] = (($shiftRightInt64(s11, 9).$low << 24 >>> 24)); s.nilCheck, s[31] = (($shiftRightInt64(s11, 17).$low << 24 >>> 24)); }; scReduce = function(out, s) { var carry, out, s, s0, s1, s10, s11, s12, s13, s14, s15, s16, s17, s18, s19, s2, s20, s21, s22, s23, s3, s4, s5, s6, s7, s8, s9, 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$125, x$126, x$127, x$128, x$129, x$13, x$130, x$131, x$132, x$133, x$134, x$135, x$136, x$137, x$138, x$139, x$14, x$140, x$141, x$142, x$143, x$144, x$145, x$146, x$147, x$148, x$149, x$15, x$150, x$151, x$152, x$153, x$154, x$155, x$156, x$157, x$158, x$159, x$16, x$160, x$161, x$162, x$163, x$164, x$165, x$166, x$167, x$168, x$169, x$17, x$170, x$171, x$172, x$173, x$174, x$175, x$176, x$177, x$178, x$179, x$18, x$180, x$181, x$182, x$183, x$184, x$185, x$186, x$187, x$188, x$189, x$19, x$190, x$191, x$192, x$193, x$194, x$195, x$196, x$197, x$198, x$199, x$2, x$20, x$200, x$201, x$202, x$203, x$204, x$205, x$206, x$207, x$208, x$209, x$21, x$210, x$211, x$212, x$213, x$214, x$215, x$216, x$217, x$218, 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; s0 = (x = load3(new sliceType(s)), new $Int64(0 & x.$high, (2097151 & x.$low) >>> 0)); s1 = (x$1 = $shiftRightInt64(load4($subslice(new sliceType(s), 2)), 5), new $Int64(0 & x$1.$high, (2097151 & x$1.$low) >>> 0)); s2 = (x$2 = $shiftRightInt64(load3($subslice(new sliceType(s), 5)), 2), new $Int64(0 & x$2.$high, (2097151 & x$2.$low) >>> 0)); s3 = (x$3 = $shiftRightInt64(load4($subslice(new sliceType(s), 7)), 7), new $Int64(0 & x$3.$high, (2097151 & x$3.$low) >>> 0)); s4 = (x$4 = $shiftRightInt64(load4($subslice(new sliceType(s), 10)), 4), new $Int64(0 & x$4.$high, (2097151 & x$4.$low) >>> 0)); s5 = (x$5 = $shiftRightInt64(load3($subslice(new sliceType(s), 13)), 1), new $Int64(0 & x$5.$high, (2097151 & x$5.$low) >>> 0)); s6 = (x$6 = $shiftRightInt64(load4($subslice(new sliceType(s), 15)), 6), new $Int64(0 & x$6.$high, (2097151 & x$6.$low) >>> 0)); s7 = (x$7 = $shiftRightInt64(load3($subslice(new sliceType(s), 18)), 3), new $Int64(0 & x$7.$high, (2097151 & x$7.$low) >>> 0)); s8 = (x$8 = load3($subslice(new sliceType(s), 21)), new $Int64(0 & x$8.$high, (2097151 & x$8.$low) >>> 0)); s9 = (x$9 = $shiftRightInt64(load4($subslice(new sliceType(s), 23)), 5), new $Int64(0 & x$9.$high, (2097151 & x$9.$low) >>> 0)); s10 = (x$10 = $shiftRightInt64(load3($subslice(new sliceType(s), 26)), 2), new $Int64(0 & x$10.$high, (2097151 & x$10.$low) >>> 0)); s11 = (x$11 = $shiftRightInt64(load4($subslice(new sliceType(s), 28)), 7), new $Int64(0 & x$11.$high, (2097151 & x$11.$low) >>> 0)); s12 = (x$12 = $shiftRightInt64(load4($subslice(new sliceType(s), 31)), 4), new $Int64(0 & x$12.$high, (2097151 & x$12.$low) >>> 0)); s13 = (x$13 = $shiftRightInt64(load3($subslice(new sliceType(s), 34)), 1), new $Int64(0 & x$13.$high, (2097151 & x$13.$low) >>> 0)); s14 = (x$14 = $shiftRightInt64(load4($subslice(new sliceType(s), 36)), 6), new $Int64(0 & x$14.$high, (2097151 & x$14.$low) >>> 0)); s15 = (x$15 = $shiftRightInt64(load3($subslice(new sliceType(s), 39)), 3), new $Int64(0 & x$15.$high, (2097151 & x$15.$low) >>> 0)); s16 = (x$16 = load3($subslice(new sliceType(s), 42)), new $Int64(0 & x$16.$high, (2097151 & x$16.$low) >>> 0)); s17 = (x$17 = $shiftRightInt64(load4($subslice(new sliceType(s), 44)), 5), new $Int64(0 & x$17.$high, (2097151 & x$17.$low) >>> 0)); s18 = (x$18 = $shiftRightInt64(load3($subslice(new sliceType(s), 47)), 2), new $Int64(0 & x$18.$high, (2097151 & x$18.$low) >>> 0)); s19 = (x$19 = $shiftRightInt64(load4($subslice(new sliceType(s), 49)), 7), new $Int64(0 & x$19.$high, (2097151 & x$19.$low) >>> 0)); s20 = (x$20 = $shiftRightInt64(load4($subslice(new sliceType(s), 52)), 4), new $Int64(0 & x$20.$high, (2097151 & x$20.$low) >>> 0)); s21 = (x$21 = $shiftRightInt64(load3($subslice(new sliceType(s), 55)), 1), new $Int64(0 & x$21.$high, (2097151 & x$21.$low) >>> 0)); s22 = (x$22 = $shiftRightInt64(load4($subslice(new sliceType(s), 57)), 6), new $Int64(0 & x$22.$high, (2097151 & x$22.$low) >>> 0)); s23 = $shiftRightInt64(load4($subslice(new sliceType(s), 60)), 3); s11 = (x$23 = $mul64(s23, new $Int64(0, 666643)), new $Int64(s11.$high + x$23.$high, s11.$low + x$23.$low)); s12 = (x$24 = $mul64(s23, new $Int64(0, 470296)), new $Int64(s12.$high + x$24.$high, s12.$low + x$24.$low)); s13 = (x$25 = $mul64(s23, new $Int64(0, 654183)), new $Int64(s13.$high + x$25.$high, s13.$low + x$25.$low)); s14 = (x$26 = $mul64(s23, new $Int64(0, 997805)), new $Int64(s14.$high - x$26.$high, s14.$low - x$26.$low)); s15 = (x$27 = $mul64(s23, new $Int64(0, 136657)), new $Int64(s15.$high + x$27.$high, s15.$low + x$27.$low)); s16 = (x$28 = $mul64(s23, new $Int64(0, 683901)), new $Int64(s16.$high - x$28.$high, s16.$low - x$28.$low)); s23 = new $Int64(0, 0); s10 = (x$29 = $mul64(s22, new $Int64(0, 666643)), new $Int64(s10.$high + x$29.$high, s10.$low + x$29.$low)); s11 = (x$30 = $mul64(s22, new $Int64(0, 470296)), new $Int64(s11.$high + x$30.$high, s11.$low + x$30.$low)); s12 = (x$31 = $mul64(s22, new $Int64(0, 654183)), new $Int64(s12.$high + x$31.$high, s12.$low + x$31.$low)); s13 = (x$32 = $mul64(s22, new $Int64(0, 997805)), new $Int64(s13.$high - x$32.$high, s13.$low - x$32.$low)); s14 = (x$33 = $mul64(s22, new $Int64(0, 136657)), new $Int64(s14.$high + x$33.$high, s14.$low + x$33.$low)); s15 = (x$34 = $mul64(s22, new $Int64(0, 683901)), new $Int64(s15.$high - x$34.$high, s15.$low - x$34.$low)); s22 = new $Int64(0, 0); s9 = (x$35 = $mul64(s21, new $Int64(0, 666643)), new $Int64(s9.$high + x$35.$high, s9.$low + x$35.$low)); s10 = (x$36 = $mul64(s21, new $Int64(0, 470296)), new $Int64(s10.$high + x$36.$high, s10.$low + x$36.$low)); s11 = (x$37 = $mul64(s21, new $Int64(0, 654183)), new $Int64(s11.$high + x$37.$high, s11.$low + x$37.$low)); s12 = (x$38 = $mul64(s21, new $Int64(0, 997805)), new $Int64(s12.$high - x$38.$high, s12.$low - x$38.$low)); s13 = (x$39 = $mul64(s21, new $Int64(0, 136657)), new $Int64(s13.$high + x$39.$high, s13.$low + x$39.$low)); s14 = (x$40 = $mul64(s21, new $Int64(0, 683901)), new $Int64(s14.$high - x$40.$high, s14.$low - x$40.$low)); s21 = new $Int64(0, 0); s8 = (x$41 = $mul64(s20, new $Int64(0, 666643)), new $Int64(s8.$high + x$41.$high, s8.$low + x$41.$low)); s9 = (x$42 = $mul64(s20, new $Int64(0, 470296)), new $Int64(s9.$high + x$42.$high, s9.$low + x$42.$low)); s10 = (x$43 = $mul64(s20, new $Int64(0, 654183)), new $Int64(s10.$high + x$43.$high, s10.$low + x$43.$low)); s11 = (x$44 = $mul64(s20, new $Int64(0, 997805)), new $Int64(s11.$high - x$44.$high, s11.$low - x$44.$low)); s12 = (x$45 = $mul64(s20, new $Int64(0, 136657)), new $Int64(s12.$high + x$45.$high, s12.$low + x$45.$low)); s13 = (x$46 = $mul64(s20, new $Int64(0, 683901)), new $Int64(s13.$high - x$46.$high, s13.$low - x$46.$low)); s20 = new $Int64(0, 0); s7 = (x$47 = $mul64(s19, new $Int64(0, 666643)), new $Int64(s7.$high + x$47.$high, s7.$low + x$47.$low)); s8 = (x$48 = $mul64(s19, new $Int64(0, 470296)), new $Int64(s8.$high + x$48.$high, s8.$low + x$48.$low)); s9 = (x$49 = $mul64(s19, new $Int64(0, 654183)), new $Int64(s9.$high + x$49.$high, s9.$low + x$49.$low)); s10 = (x$50 = $mul64(s19, new $Int64(0, 997805)), new $Int64(s10.$high - x$50.$high, s10.$low - x$50.$low)); s11 = (x$51 = $mul64(s19, new $Int64(0, 136657)), new $Int64(s11.$high + x$51.$high, s11.$low + x$51.$low)); s12 = (x$52 = $mul64(s19, new $Int64(0, 683901)), new $Int64(s12.$high - x$52.$high, s12.$low - x$52.$low)); s19 = new $Int64(0, 0); s6 = (x$53 = $mul64(s18, new $Int64(0, 666643)), new $Int64(s6.$high + x$53.$high, s6.$low + x$53.$low)); s7 = (x$54 = $mul64(s18, new $Int64(0, 470296)), new $Int64(s7.$high + x$54.$high, s7.$low + x$54.$low)); s8 = (x$55 = $mul64(s18, new $Int64(0, 654183)), new $Int64(s8.$high + x$55.$high, s8.$low + x$55.$low)); s9 = (x$56 = $mul64(s18, new $Int64(0, 997805)), new $Int64(s9.$high - x$56.$high, s9.$low - x$56.$low)); s10 = (x$57 = $mul64(s18, new $Int64(0, 136657)), new $Int64(s10.$high + x$57.$high, s10.$low + x$57.$low)); s11 = (x$58 = $mul64(s18, new $Int64(0, 683901)), new $Int64(s11.$high - x$58.$high, s11.$low - x$58.$low)); s18 = new $Int64(0, 0); carry = arrayType$10.zero(); carry[6] = $shiftRightInt64((new $Int64(s6.$high + 0, s6.$low + 1048576)), 21); s7 = (x$59 = carry[6], new $Int64(s7.$high + x$59.$high, s7.$low + x$59.$low)); s6 = (x$60 = $shiftLeft64(carry[6], 21), new $Int64(s6.$high - x$60.$high, s6.$low - x$60.$low)); carry[8] = $shiftRightInt64((new $Int64(s8.$high + 0, s8.$low + 1048576)), 21); s9 = (x$61 = carry[8], new $Int64(s9.$high + x$61.$high, s9.$low + x$61.$low)); s8 = (x$62 = $shiftLeft64(carry[8], 21), new $Int64(s8.$high - x$62.$high, s8.$low - x$62.$low)); carry[10] = $shiftRightInt64((new $Int64(s10.$high + 0, s10.$low + 1048576)), 21); s11 = (x$63 = carry[10], new $Int64(s11.$high + x$63.$high, s11.$low + x$63.$low)); s10 = (x$64 = $shiftLeft64(carry[10], 21), new $Int64(s10.$high - x$64.$high, s10.$low - x$64.$low)); carry[12] = $shiftRightInt64((new $Int64(s12.$high + 0, s12.$low + 1048576)), 21); s13 = (x$65 = carry[12], new $Int64(s13.$high + x$65.$high, s13.$low + x$65.$low)); s12 = (x$66 = $shiftLeft64(carry[12], 21), new $Int64(s12.$high - x$66.$high, s12.$low - x$66.$low)); carry[14] = $shiftRightInt64((new $Int64(s14.$high + 0, s14.$low + 1048576)), 21); s15 = (x$67 = carry[14], new $Int64(s15.$high + x$67.$high, s15.$low + x$67.$low)); s14 = (x$68 = $shiftLeft64(carry[14], 21), new $Int64(s14.$high - x$68.$high, s14.$low - x$68.$low)); carry[16] = $shiftRightInt64((new $Int64(s16.$high + 0, s16.$low + 1048576)), 21); s17 = (x$69 = carry[16], new $Int64(s17.$high + x$69.$high, s17.$low + x$69.$low)); s16 = (x$70 = $shiftLeft64(carry[16], 21), new $Int64(s16.$high - x$70.$high, s16.$low - x$70.$low)); carry[7] = $shiftRightInt64((new $Int64(s7.$high + 0, s7.$low + 1048576)), 21); s8 = (x$71 = carry[7], new $Int64(s8.$high + x$71.$high, s8.$low + x$71.$low)); s7 = (x$72 = $shiftLeft64(carry[7], 21), new $Int64(s7.$high - x$72.$high, s7.$low - x$72.$low)); carry[9] = $shiftRightInt64((new $Int64(s9.$high + 0, s9.$low + 1048576)), 21); s10 = (x$73 = carry[9], new $Int64(s10.$high + x$73.$high, s10.$low + x$73.$low)); s9 = (x$74 = $shiftLeft64(carry[9], 21), new $Int64(s9.$high - x$74.$high, s9.$low - x$74.$low)); carry[11] = $shiftRightInt64((new $Int64(s11.$high + 0, s11.$low + 1048576)), 21); s12 = (x$75 = carry[11], new $Int64(s12.$high + x$75.$high, s12.$low + x$75.$low)); s11 = (x$76 = $shiftLeft64(carry[11], 21), new $Int64(s11.$high - x$76.$high, s11.$low - x$76.$low)); carry[13] = $shiftRightInt64((new $Int64(s13.$high + 0, s13.$low + 1048576)), 21); s14 = (x$77 = carry[13], new $Int64(s14.$high + x$77.$high, s14.$low + x$77.$low)); s13 = (x$78 = $shiftLeft64(carry[13], 21), new $Int64(s13.$high - x$78.$high, s13.$low - x$78.$low)); carry[15] = $shiftRightInt64((new $Int64(s15.$high + 0, s15.$low + 1048576)), 21); s16 = (x$79 = carry[15], new $Int64(s16.$high + x$79.$high, s16.$low + x$79.$low)); s15 = (x$80 = $shiftLeft64(carry[15], 21), new $Int64(s15.$high - x$80.$high, s15.$low - x$80.$low)); s5 = (x$81 = $mul64(s17, new $Int64(0, 666643)), new $Int64(s5.$high + x$81.$high, s5.$low + x$81.$low)); s6 = (x$82 = $mul64(s17, new $Int64(0, 470296)), new $Int64(s6.$high + x$82.$high, s6.$low + x$82.$low)); s7 = (x$83 = $mul64(s17, new $Int64(0, 654183)), new $Int64(s7.$high + x$83.$high, s7.$low + x$83.$low)); s8 = (x$84 = $mul64(s17, new $Int64(0, 997805)), new $Int64(s8.$high - x$84.$high, s8.$low - x$84.$low)); s9 = (x$85 = $mul64(s17, new $Int64(0, 136657)), new $Int64(s9.$high + x$85.$high, s9.$low + x$85.$low)); s10 = (x$86 = $mul64(s17, new $Int64(0, 683901)), new $Int64(s10.$high - x$86.$high, s10.$low - x$86.$low)); s17 = new $Int64(0, 0); s4 = (x$87 = $mul64(s16, new $Int64(0, 666643)), new $Int64(s4.$high + x$87.$high, s4.$low + x$87.$low)); s5 = (x$88 = $mul64(s16, new $Int64(0, 470296)), new $Int64(s5.$high + x$88.$high, s5.$low + x$88.$low)); s6 = (x$89 = $mul64(s16, new $Int64(0, 654183)), new $Int64(s6.$high + x$89.$high, s6.$low + x$89.$low)); s7 = (x$90 = $mul64(s16, new $Int64(0, 997805)), new $Int64(s7.$high - x$90.$high, s7.$low - x$90.$low)); s8 = (x$91 = $mul64(s16, new $Int64(0, 136657)), new $Int64(s8.$high + x$91.$high, s8.$low + x$91.$low)); s9 = (x$92 = $mul64(s16, new $Int64(0, 683901)), new $Int64(s9.$high - x$92.$high, s9.$low - x$92.$low)); s16 = new $Int64(0, 0); s3 = (x$93 = $mul64(s15, new $Int64(0, 666643)), new $Int64(s3.$high + x$93.$high, s3.$low + x$93.$low)); s4 = (x$94 = $mul64(s15, new $Int64(0, 470296)), new $Int64(s4.$high + x$94.$high, s4.$low + x$94.$low)); s5 = (x$95 = $mul64(s15, new $Int64(0, 654183)), new $Int64(s5.$high + x$95.$high, s5.$low + x$95.$low)); s6 = (x$96 = $mul64(s15, new $Int64(0, 997805)), new $Int64(s6.$high - x$96.$high, s6.$low - x$96.$low)); s7 = (x$97 = $mul64(s15, new $Int64(0, 136657)), new $Int64(s7.$high + x$97.$high, s7.$low + x$97.$low)); s8 = (x$98 = $mul64(s15, new $Int64(0, 683901)), new $Int64(s8.$high - x$98.$high, s8.$low - x$98.$low)); s15 = new $Int64(0, 0); s2 = (x$99 = $mul64(s14, new $Int64(0, 666643)), new $Int64(s2.$high + x$99.$high, s2.$low + x$99.$low)); s3 = (x$100 = $mul64(s14, new $Int64(0, 470296)), new $Int64(s3.$high + x$100.$high, s3.$low + x$100.$low)); s4 = (x$101 = $mul64(s14, new $Int64(0, 654183)), new $Int64(s4.$high + x$101.$high, s4.$low + x$101.$low)); s5 = (x$102 = $mul64(s14, new $Int64(0, 997805)), new $Int64(s5.$high - x$102.$high, s5.$low - x$102.$low)); s6 = (x$103 = $mul64(s14, new $Int64(0, 136657)), new $Int64(s6.$high + x$103.$high, s6.$low + x$103.$low)); s7 = (x$104 = $mul64(s14, new $Int64(0, 683901)), new $Int64(s7.$high - x$104.$high, s7.$low - x$104.$low)); s14 = new $Int64(0, 0); s1 = (x$105 = $mul64(s13, new $Int64(0, 666643)), new $Int64(s1.$high + x$105.$high, s1.$low + x$105.$low)); s2 = (x$106 = $mul64(s13, new $Int64(0, 470296)), new $Int64(s2.$high + x$106.$high, s2.$low + x$106.$low)); s3 = (x$107 = $mul64(s13, new $Int64(0, 654183)), new $Int64(s3.$high + x$107.$high, s3.$low + x$107.$low)); s4 = (x$108 = $mul64(s13, new $Int64(0, 997805)), new $Int64(s4.$high - x$108.$high, s4.$low - x$108.$low)); s5 = (x$109 = $mul64(s13, new $Int64(0, 136657)), new $Int64(s5.$high + x$109.$high, s5.$low + x$109.$low)); s6 = (x$110 = $mul64(s13, new $Int64(0, 683901)), new $Int64(s6.$high - x$110.$high, s6.$low - x$110.$low)); s13 = new $Int64(0, 0); s0 = (x$111 = $mul64(s12, new $Int64(0, 666643)), new $Int64(s0.$high + x$111.$high, s0.$low + x$111.$low)); s1 = (x$112 = $mul64(s12, new $Int64(0, 470296)), new $Int64(s1.$high + x$112.$high, s1.$low + x$112.$low)); s2 = (x$113 = $mul64(s12, new $Int64(0, 654183)), new $Int64(s2.$high + x$113.$high, s2.$low + x$113.$low)); s3 = (x$114 = $mul64(s12, new $Int64(0, 997805)), new $Int64(s3.$high - x$114.$high, s3.$low - x$114.$low)); s4 = (x$115 = $mul64(s12, new $Int64(0, 136657)), new $Int64(s4.$high + x$115.$high, s4.$low + x$115.$low)); s5 = (x$116 = $mul64(s12, new $Int64(0, 683901)), new $Int64(s5.$high - x$116.$high, s5.$low - x$116.$low)); s12 = new $Int64(0, 0); carry[0] = $shiftRightInt64((new $Int64(s0.$high + 0, s0.$low + 1048576)), 21); s1 = (x$117 = carry[0], new $Int64(s1.$high + x$117.$high, s1.$low + x$117.$low)); s0 = (x$118 = $shiftLeft64(carry[0], 21), new $Int64(s0.$high - x$118.$high, s0.$low - x$118.$low)); carry[2] = $shiftRightInt64((new $Int64(s2.$high + 0, s2.$low + 1048576)), 21); s3 = (x$119 = carry[2], new $Int64(s3.$high + x$119.$high, s3.$low + x$119.$low)); s2 = (x$120 = $shiftLeft64(carry[2], 21), new $Int64(s2.$high - x$120.$high, s2.$low - x$120.$low)); carry[4] = $shiftRightInt64((new $Int64(s4.$high + 0, s4.$low + 1048576)), 21); s5 = (x$121 = carry[4], new $Int64(s5.$high + x$121.$high, s5.$low + x$121.$low)); s4 = (x$122 = $shiftLeft64(carry[4], 21), new $Int64(s4.$high - x$122.$high, s4.$low - x$122.$low)); carry[6] = $shiftRightInt64((new $Int64(s6.$high + 0, s6.$low + 1048576)), 21); s7 = (x$123 = carry[6], new $Int64(s7.$high + x$123.$high, s7.$low + x$123.$low)); s6 = (x$124 = $shiftLeft64(carry[6], 21), new $Int64(s6.$high - x$124.$high, s6.$low - x$124.$low)); carry[8] = $shiftRightInt64((new $Int64(s8.$high + 0, s8.$low + 1048576)), 21); s9 = (x$125 = carry[8], new $Int64(s9.$high + x$125.$high, s9.$low + x$125.$low)); s8 = (x$126 = $shiftLeft64(carry[8], 21), new $Int64(s8.$high - x$126.$high, s8.$low - x$126.$low)); carry[10] = $shiftRightInt64((new $Int64(s10.$high + 0, s10.$low + 1048576)), 21); s11 = (x$127 = carry[10], new $Int64(s11.$high + x$127.$high, s11.$low + x$127.$low)); s10 = (x$128 = $shiftLeft64(carry[10], 21), new $Int64(s10.$high - x$128.$high, s10.$low - x$128.$low)); carry[1] = $shiftRightInt64((new $Int64(s1.$high + 0, s1.$low + 1048576)), 21); s2 = (x$129 = carry[1], new $Int64(s2.$high + x$129.$high, s2.$low + x$129.$low)); s1 = (x$130 = $shiftLeft64(carry[1], 21), new $Int64(s1.$high - x$130.$high, s1.$low - x$130.$low)); carry[3] = $shiftRightInt64((new $Int64(s3.$high + 0, s3.$low + 1048576)), 21); s4 = (x$131 = carry[3], new $Int64(s4.$high + x$131.$high, s4.$low + x$131.$low)); s3 = (x$132 = $shiftLeft64(carry[3], 21), new $Int64(s3.$high - x$132.$high, s3.$low - x$132.$low)); carry[5] = $shiftRightInt64((new $Int64(s5.$high + 0, s5.$low + 1048576)), 21); s6 = (x$133 = carry[5], new $Int64(s6.$high + x$133.$high, s6.$low + x$133.$low)); s5 = (x$134 = $shiftLeft64(carry[5], 21), new $Int64(s5.$high - x$134.$high, s5.$low - x$134.$low)); carry[7] = $shiftRightInt64((new $Int64(s7.$high + 0, s7.$low + 1048576)), 21); s8 = (x$135 = carry[7], new $Int64(s8.$high + x$135.$high, s8.$low + x$135.$low)); s7 = (x$136 = $shiftLeft64(carry[7], 21), new $Int64(s7.$high - x$136.$high, s7.$low - x$136.$low)); carry[9] = $shiftRightInt64((new $Int64(s9.$high + 0, s9.$low + 1048576)), 21); s10 = (x$137 = carry[9], new $Int64(s10.$high + x$137.$high, s10.$low + x$137.$low)); s9 = (x$138 = $shiftLeft64(carry[9], 21), new $Int64(s9.$high - x$138.$high, s9.$low - x$138.$low)); carry[11] = $shiftRightInt64((new $Int64(s11.$high + 0, s11.$low + 1048576)), 21); s12 = (x$139 = carry[11], new $Int64(s12.$high + x$139.$high, s12.$low + x$139.$low)); s11 = (x$140 = $shiftLeft64(carry[11], 21), new $Int64(s11.$high - x$140.$high, s11.$low - x$140.$low)); s0 = (x$141 = $mul64(s12, new $Int64(0, 666643)), new $Int64(s0.$high + x$141.$high, s0.$low + x$141.$low)); s1 = (x$142 = $mul64(s12, new $Int64(0, 470296)), new $Int64(s1.$high + x$142.$high, s1.$low + x$142.$low)); s2 = (x$143 = $mul64(s12, new $Int64(0, 654183)), new $Int64(s2.$high + x$143.$high, s2.$low + x$143.$low)); s3 = (x$144 = $mul64(s12, new $Int64(0, 997805)), new $Int64(s3.$high - x$144.$high, s3.$low - x$144.$low)); s4 = (x$145 = $mul64(s12, new $Int64(0, 136657)), new $Int64(s4.$high + x$145.$high, s4.$low + x$145.$low)); s5 = (x$146 = $mul64(s12, new $Int64(0, 683901)), new $Int64(s5.$high - x$146.$high, s5.$low - x$146.$low)); s12 = new $Int64(0, 0); carry[0] = $shiftRightInt64(s0, 21); s1 = (x$147 = carry[0], new $Int64(s1.$high + x$147.$high, s1.$low + x$147.$low)); s0 = (x$148 = $shiftLeft64(carry[0], 21), new $Int64(s0.$high - x$148.$high, s0.$low - x$148.$low)); carry[1] = $shiftRightInt64(s1, 21); s2 = (x$149 = carry[1], new $Int64(s2.$high + x$149.$high, s2.$low + x$149.$low)); s1 = (x$150 = $shiftLeft64(carry[1], 21), new $Int64(s1.$high - x$150.$high, s1.$low - x$150.$low)); carry[2] = $shiftRightInt64(s2, 21); s3 = (x$151 = carry[2], new $Int64(s3.$high + x$151.$high, s3.$low + x$151.$low)); s2 = (x$152 = $shiftLeft64(carry[2], 21), new $Int64(s2.$high - x$152.$high, s2.$low - x$152.$low)); carry[3] = $shiftRightInt64(s3, 21); s4 = (x$153 = carry[3], new $Int64(s4.$high + x$153.$high, s4.$low + x$153.$low)); s3 = (x$154 = $shiftLeft64(carry[3], 21), new $Int64(s3.$high - x$154.$high, s3.$low - x$154.$low)); carry[4] = $shiftRightInt64(s4, 21); s5 = (x$155 = carry[4], new $Int64(s5.$high + x$155.$high, s5.$low + x$155.$low)); s4 = (x$156 = $shiftLeft64(carry[4], 21), new $Int64(s4.$high - x$156.$high, s4.$low - x$156.$low)); carry[5] = $shiftRightInt64(s5, 21); s6 = (x$157 = carry[5], new $Int64(s6.$high + x$157.$high, s6.$low + x$157.$low)); s5 = (x$158 = $shiftLeft64(carry[5], 21), new $Int64(s5.$high - x$158.$high, s5.$low - x$158.$low)); carry[6] = $shiftRightInt64(s6, 21); s7 = (x$159 = carry[6], new $Int64(s7.$high + x$159.$high, s7.$low + x$159.$low)); s6 = (x$160 = $shiftLeft64(carry[6], 21), new $Int64(s6.$high - x$160.$high, s6.$low - x$160.$low)); carry[7] = $shiftRightInt64(s7, 21); s8 = (x$161 = carry[7], new $Int64(s8.$high + x$161.$high, s8.$low + x$161.$low)); s7 = (x$162 = $shiftLeft64(carry[7], 21), new $Int64(s7.$high - x$162.$high, s7.$low - x$162.$low)); carry[8] = $shiftRightInt64(s8, 21); s9 = (x$163 = carry[8], new $Int64(s9.$high + x$163.$high, s9.$low + x$163.$low)); s8 = (x$164 = $shiftLeft64(carry[8], 21), new $Int64(s8.$high - x$164.$high, s8.$low - x$164.$low)); carry[9] = $shiftRightInt64(s9, 21); s10 = (x$165 = carry[9], new $Int64(s10.$high + x$165.$high, s10.$low + x$165.$low)); s9 = (x$166 = $shiftLeft64(carry[9], 21), new $Int64(s9.$high - x$166.$high, s9.$low - x$166.$low)); carry[10] = $shiftRightInt64(s10, 21); s11 = (x$167 = carry[10], new $Int64(s11.$high + x$167.$high, s11.$low + x$167.$low)); s10 = (x$168 = $shiftLeft64(carry[10], 21), new $Int64(s10.$high - x$168.$high, s10.$low - x$168.$low)); carry[11] = $shiftRightInt64(s11, 21); s12 = (x$169 = carry[11], new $Int64(s12.$high + x$169.$high, s12.$low + x$169.$low)); s11 = (x$170 = $shiftLeft64(carry[11], 21), new $Int64(s11.$high - x$170.$high, s11.$low - x$170.$low)); s0 = (x$171 = $mul64(s12, new $Int64(0, 666643)), new $Int64(s0.$high + x$171.$high, s0.$low + x$171.$low)); s1 = (x$172 = $mul64(s12, new $Int64(0, 470296)), new $Int64(s1.$high + x$172.$high, s1.$low + x$172.$low)); s2 = (x$173 = $mul64(s12, new $Int64(0, 654183)), new $Int64(s2.$high + x$173.$high, s2.$low + x$173.$low)); s3 = (x$174 = $mul64(s12, new $Int64(0, 997805)), new $Int64(s3.$high - x$174.$high, s3.$low - x$174.$low)); s4 = (x$175 = $mul64(s12, new $Int64(0, 136657)), new $Int64(s4.$high + x$175.$high, s4.$low + x$175.$low)); s5 = (x$176 = $mul64(s12, new $Int64(0, 683901)), new $Int64(s5.$high - x$176.$high, s5.$low - x$176.$low)); s12 = new $Int64(0, 0); carry[0] = $shiftRightInt64(s0, 21); s1 = (x$177 = carry[0], new $Int64(s1.$high + x$177.$high, s1.$low + x$177.$low)); s0 = (x$178 = $shiftLeft64(carry[0], 21), new $Int64(s0.$high - x$178.$high, s0.$low - x$178.$low)); carry[1] = $shiftRightInt64(s1, 21); s2 = (x$179 = carry[1], new $Int64(s2.$high + x$179.$high, s2.$low + x$179.$low)); s1 = (x$180 = $shiftLeft64(carry[1], 21), new $Int64(s1.$high - x$180.$high, s1.$low - x$180.$low)); carry[2] = $shiftRightInt64(s2, 21); s3 = (x$181 = carry[2], new $Int64(s3.$high + x$181.$high, s3.$low + x$181.$low)); s2 = (x$182 = $shiftLeft64(carry[2], 21), new $Int64(s2.$high - x$182.$high, s2.$low - x$182.$low)); carry[3] = $shiftRightInt64(s3, 21); s4 = (x$183 = carry[3], new $Int64(s4.$high + x$183.$high, s4.$low + x$183.$low)); s3 = (x$184 = $shiftLeft64(carry[3], 21), new $Int64(s3.$high - x$184.$high, s3.$low - x$184.$low)); carry[4] = $shiftRightInt64(s4, 21); s5 = (x$185 = carry[4], new $Int64(s5.$high + x$185.$high, s5.$low + x$185.$low)); s4 = (x$186 = $shiftLeft64(carry[4], 21), new $Int64(s4.$high - x$186.$high, s4.$low - x$186.$low)); carry[5] = $shiftRightInt64(s5, 21); s6 = (x$187 = carry[5], new $Int64(s6.$high + x$187.$high, s6.$low + x$187.$low)); s5 = (x$188 = $shiftLeft64(carry[5], 21), new $Int64(s5.$high - x$188.$high, s5.$low - x$188.$low)); carry[6] = $shiftRightInt64(s6, 21); s7 = (x$189 = carry[6], new $Int64(s7.$high + x$189.$high, s7.$low + x$189.$low)); s6 = (x$190 = $shiftLeft64(carry[6], 21), new $Int64(s6.$high - x$190.$high, s6.$low - x$190.$low)); carry[7] = $shiftRightInt64(s7, 21); s8 = (x$191 = carry[7], new $Int64(s8.$high + x$191.$high, s8.$low + x$191.$low)); s7 = (x$192 = $shiftLeft64(carry[7], 21), new $Int64(s7.$high - x$192.$high, s7.$low - x$192.$low)); carry[8] = $shiftRightInt64(s8, 21); s9 = (x$193 = carry[8], new $Int64(s9.$high + x$193.$high, s9.$low + x$193.$low)); s8 = (x$194 = $shiftLeft64(carry[8], 21), new $Int64(s8.$high - x$194.$high, s8.$low - x$194.$low)); carry[9] = $shiftRightInt64(s9, 21); s10 = (x$195 = carry[9], new $Int64(s10.$high + x$195.$high, s10.$low + x$195.$low)); s9 = (x$196 = $shiftLeft64(carry[9], 21), new $Int64(s9.$high - x$196.$high, s9.$low - x$196.$low)); carry[10] = $shiftRightInt64(s10, 21); s11 = (x$197 = carry[10], new $Int64(s11.$high + x$197.$high, s11.$low + x$197.$low)); s10 = (x$198 = $shiftLeft64(carry[10], 21), new $Int64(s10.$high - x$198.$high, s10.$low - x$198.$low)); out.nilCheck, out[0] = (($shiftRightInt64(s0, 0).$low << 24 >>> 24)); out.nilCheck, out[1] = (($shiftRightInt64(s0, 8).$low << 24 >>> 24)); out.nilCheck, out[2] = (((x$199 = $shiftRightInt64(s0, 16), x$200 = $shiftLeft64(s1, 5), new $Int64(x$199.$high | x$200.$high, (x$199.$low | x$200.$low) >>> 0)).$low << 24 >>> 24)); out.nilCheck, out[3] = (($shiftRightInt64(s1, 3).$low << 24 >>> 24)); out.nilCheck, out[4] = (($shiftRightInt64(s1, 11).$low << 24 >>> 24)); out.nilCheck, out[5] = (((x$201 = $shiftRightInt64(s1, 19), x$202 = $shiftLeft64(s2, 2), new $Int64(x$201.$high | x$202.$high, (x$201.$low | x$202.$low) >>> 0)).$low << 24 >>> 24)); out.nilCheck, out[6] = (($shiftRightInt64(s2, 6).$low << 24 >>> 24)); out.nilCheck, out[7] = (((x$203 = $shiftRightInt64(s2, 14), x$204 = $shiftLeft64(s3, 7), new $Int64(x$203.$high | x$204.$high, (x$203.$low | x$204.$low) >>> 0)).$low << 24 >>> 24)); out.nilCheck, out[8] = (($shiftRightInt64(s3, 1).$low << 24 >>> 24)); out.nilCheck, out[9] = (($shiftRightInt64(s3, 9).$low << 24 >>> 24)); out.nilCheck, out[10] = (((x$205 = $shiftRightInt64(s3, 17), x$206 = $shiftLeft64(s4, 4), new $Int64(x$205.$high | x$206.$high, (x$205.$low | x$206.$low) >>> 0)).$low << 24 >>> 24)); out.nilCheck, out[11] = (($shiftRightInt64(s4, 4).$low << 24 >>> 24)); out.nilCheck, out[12] = (($shiftRightInt64(s4, 12).$low << 24 >>> 24)); out.nilCheck, out[13] = (((x$207 = $shiftRightInt64(s4, 20), x$208 = $shiftLeft64(s5, 1), new $Int64(x$207.$high | x$208.$high, (x$207.$low | x$208.$low) >>> 0)).$low << 24 >>> 24)); out.nilCheck, out[14] = (($shiftRightInt64(s5, 7).$low << 24 >>> 24)); out.nilCheck, out[15] = (((x$209 = $shiftRightInt64(s5, 15), x$210 = $shiftLeft64(s6, 6), new $Int64(x$209.$high | x$210.$high, (x$209.$low | x$210.$low) >>> 0)).$low << 24 >>> 24)); out.nilCheck, out[16] = (($shiftRightInt64(s6, 2).$low << 24 >>> 24)); out.nilCheck, out[17] = (($shiftRightInt64(s6, 10).$low << 24 >>> 24)); out.nilCheck, out[18] = (((x$211 = $shiftRightInt64(s6, 18), x$212 = $shiftLeft64(s7, 3), new $Int64(x$211.$high | x$212.$high, (x$211.$low | x$212.$low) >>> 0)).$low << 24 >>> 24)); out.nilCheck, out[19] = (($shiftRightInt64(s7, 5).$low << 24 >>> 24)); out.nilCheck, out[20] = (($shiftRightInt64(s7, 13).$low << 24 >>> 24)); out.nilCheck, out[21] = (($shiftRightInt64(s8, 0).$low << 24 >>> 24)); out.nilCheck, out[22] = (($shiftRightInt64(s8, 8).$low << 24 >>> 24)); out.nilCheck, out[23] = (((x$213 = $shiftRightInt64(s8, 16), x$214 = $shiftLeft64(s9, 5), new $Int64(x$213.$high | x$214.$high, (x$213.$low | x$214.$low) >>> 0)).$low << 24 >>> 24)); out.nilCheck, out[24] = (($shiftRightInt64(s9, 3).$low << 24 >>> 24)); out.nilCheck, out[25] = (($shiftRightInt64(s9, 11).$low << 24 >>> 24)); out.nilCheck, out[26] = (((x$215 = $shiftRightInt64(s9, 19), x$216 = $shiftLeft64(s10, 2), new $Int64(x$215.$high | x$216.$high, (x$215.$low | x$216.$low) >>> 0)).$low << 24 >>> 24)); out.nilCheck, out[27] = (($shiftRightInt64(s10, 6).$low << 24 >>> 24)); out.nilCheck, out[28] = (((x$217 = $shiftRightInt64(s10, 14), x$218 = $shiftLeft64(s11, 7), new $Int64(x$217.$high | x$218.$high, (x$217.$low | x$218.$low) >>> 0)).$low << 24 >>> 24)); out.nilCheck, out[29] = (($shiftRightInt64(s11, 1).$low << 24 >>> 24)); out.nilCheck, out[30] = (($shiftRightInt64(s11, 9).$low << 24 >>> 24)); out.nilCheck, out[31] = (($shiftRightInt64(s11, 17).$low << 24 >>> 24)); }; Scalar.ptr.prototype.nonAdjacentForm = function(w) { var _q, _r, bitBuf, carry, digits, i, indexBit, indexU64, naf, pos, s, w, width, window, windowMask, x, x$1, x$2, x$3, x$4, x$5; s = this; if (s.s[31] > 127) { $panic(new $String("scalar has high bit set illegally")); } if (w < 2) { $panic(new $String("w must be at least 2 by the definition of NAF")); } else if (w > 8) { $panic(new $String("NAF digits must fit in int8")); } naf = arrayType$6.zero(); digits = arrayType$11.zero(); i = 0; while (true) { if (!(i < 4)) { break; } ((i < 0 || i >= digits.length) ? ($throwRuntimeError("index out of range"), undefined) : digits[i] = $clone(binary.LittleEndian, binary.littleEndian).Uint64($subslice(new sliceType(s.s), ($imul(i, 8))))); i = i + (1) >> 0; } width = ($shiftLeft64(new $Uint64(0, 1), w)); windowMask = (new $Uint64(width.$high - 0, width.$low - 1)); pos = 0; carry = new $Uint64(0, 0); while (true) { if (!(pos < 256)) { break; } indexU64 = (_q = pos / 64, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); indexBit = (_r = pos % 64, _r === _r ? _r : $throwRuntimeError("integer divide by zero")); bitBuf = new $Uint64(0, 0); if (indexBit < (64 - w >>> 0)) { bitBuf = $shiftRightUint64(((indexU64 < 0 || indexU64 >= digits.length) ? ($throwRuntimeError("index out of range"), undefined) : digits[indexU64]), indexBit); } else { bitBuf = (x = $shiftRightUint64(((indexU64 < 0 || indexU64 >= digits.length) ? ($throwRuntimeError("index out of range"), undefined) : digits[indexU64]), indexBit), x$1 = $shiftLeft64((x$2 = 1 + indexU64 >>> 0, ((x$2 < 0 || x$2 >= digits.length) ? ($throwRuntimeError("index out of range"), undefined) : digits[x$2])), ((64 - indexBit >>> 0))), new $Uint64(x.$high | x$1.$high, (x.$low | x$1.$low) >>> 0)); } window = (x$3 = new $Uint64(bitBuf.$high & windowMask.$high, (bitBuf.$low & windowMask.$low) >>> 0), new $Uint64(carry.$high + x$3.$high, carry.$low + x$3.$low)); if ((x$4 = new $Uint64(window.$high & 0, (window.$low & 1) >>> 0), (x$4.$high === 0 && x$4.$low === 0))) { pos = pos + (1) >>> 0; continue; } if ((x$5 = $div64(width, new $Uint64(0, 2), false), (window.$high < x$5.$high || (window.$high === x$5.$high && window.$low < x$5.$low)))) { carry = new $Uint64(0, 0); ((pos < 0 || pos >= naf.length) ? ($throwRuntimeError("index out of range"), undefined) : naf[pos] = ((window.$low << 24 >> 24))); } else { carry = new $Uint64(0, 1); ((pos < 0 || pos >= naf.length) ? ($throwRuntimeError("index out of range"), undefined) : naf[pos] = (((window.$low << 24 >> 24)) - ((width.$low << 24 >> 24)) << 24 >> 24)); } pos = pos + (w) >>> 0; } return naf; }; Scalar.prototype.nonAdjacentForm = function(w) { return this.$val.nonAdjacentForm(w); }; Scalar.ptr.prototype.signedRadix16 = function() { var _index, carry, digits, i, i$1, s, x, x$1, x$2, x$3; s = this; if (s.s[31] > 127) { $panic(new $String("scalar has high bit set illegally")); } digits = arrayType$4.zero(); i = 0; while (true) { if (!(i < 32)) { break; } (x$1 = $imul(2, i), ((x$1 < 0 || x$1 >= digits.length) ? ($throwRuntimeError("index out of range"), undefined) : digits[x$1] = (((((x = s.s, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i])) & 15) >>> 0) << 24 >> 24)))); (x$3 = ($imul(2, i)) + 1 >> 0, ((x$3 < 0 || x$3 >= digits.length) ? ($throwRuntimeError("index out of range"), undefined) : digits[x$3] = (((((((x$2 = s.s, ((i < 0 || i >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i])) >>> 4 << 24 >>> 24)) & 15) >>> 0) << 24 >> 24)))); i = i + (1) >> 0; } i$1 = 0; while (true) { if (!(i$1 < 63)) { break; } carry = ((((i$1 < 0 || i$1 >= digits.length) ? ($throwRuntimeError("index out of range"), undefined) : digits[i$1]) + 8 << 24 >> 24)) >> 4 << 24 >> 24; ((i$1 < 0 || i$1 >= digits.length) ? ($throwRuntimeError("index out of range"), undefined) : digits[i$1] = (((i$1 < 0 || i$1 >= digits.length) ? ($throwRuntimeError("index out of range"), undefined) : digits[i$1]) - ((carry << 4 << 24 >> 24)) << 24 >> 24)); _index = i$1 + 1 >> 0; ((_index < 0 || _index >= digits.length) ? ($throwRuntimeError("index out of range"), undefined) : digits[_index] = (((_index < 0 || _index >= digits.length) ? ($throwRuntimeError("index out of range"), undefined) : digits[_index]) + (carry) << 24 >> 24)); i$1 = i$1 + (1) >> 0; } return digits; }; Scalar.prototype.signedRadix16 = function() { return this.$val.signedRadix16(); }; checkInitialized = function(points) { var _i, _ref, p, points; _ref = points; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } p = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if ($equal(p.x, (new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0))), field.Element) && $equal(p.y, (new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0))), field.Element)) { $panic(new $String("edwards25519: use of uninitialized Point")); } _i++; } }; projP2.ptr.prototype.Zero = function() { var v; v = this; v.X.Zero(); v.Y.One(); v.Z.One(); return v; }; projP2.prototype.Zero = function() { return this.$val.Zero(); }; NewIdentityPoint = function() { return new Point.ptr(new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), arrayType$3.zero()).Set(identity); }; $pkg.NewIdentityPoint = NewIdentityPoint; NewGeneratorPoint = function() { return new Point.ptr(new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), arrayType$3.zero()).Set(generator); }; $pkg.NewGeneratorPoint = NewGeneratorPoint; projCached.ptr.prototype.Zero = function() { var v; v = this; v.YplusX.One(); v.YminusX.One(); v.Z.One(); v.T2d.Zero(); return v; }; projCached.prototype.Zero = function() { return this.$val.Zero(); }; affineCached.ptr.prototype.Zero = function() { var v; v = this; v.YplusX.One(); v.YminusX.One(); v.T2d.Zero(); return v; }; affineCached.prototype.Zero = function() { return this.$val.Zero(); }; Point.ptr.prototype.Set = function(u) { var u, v; v = this; Point.copy(v, u); return v; }; Point.prototype.Set = function(u) { return this.$val.Set(u); }; Point.ptr.prototype.Bytes = function() { var buf, v; v = this; buf = arrayType$7.zero(); return v.bytes(buf); }; Point.prototype.Bytes = function() { return this.$val.Bytes(); }; Point.ptr.prototype.bytes = function(buf) { var _tmp, _tmp$1, _tmp$2, buf, out, v, x, y, zInv; v = this; checkInitialized(new sliceType$1([v])); _tmp = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$1 = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$2 = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); zInv = $clone(_tmp, field.Element); x = $clone(_tmp$1, field.Element); y = $clone(_tmp$2, field.Element); zInv.Invert(v.z); x.Multiply(v.x, zInv); y.Multiply(v.y, zInv); out = copyFieldElement(buf, y); (31 >= out.$length ? ($throwRuntimeError("index out of range"), undefined) : out.$array[out.$offset + 31] = (((31 >= out.$length ? ($throwRuntimeError("index out of range"), undefined) : out.$array[out.$offset + 31]) | ((((x.IsNegative() << 7 >> 0) << 24 >>> 24)))) >>> 0)); return out; }; Point.prototype.bytes = function(buf) { return this.$val.bytes(buf); }; Point.ptr.prototype.SetBytes = function(x) { var _tuple$2, u, v, vv, wasSquare, x, xx, xxNeg, y, y2; v = this; if (!((x.$length === 32))) { return [ptrType.nil, errors.New("edwards25519: invalid point encoding length")]; } y = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)).SetBytes(x); y2 = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)).Square(y); u = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)).Subtract(y2, feOne); vv = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)).Multiply(y2, d); vv = vv.Add(vv, feOne); _tuple$2 = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)).SqrtRatio(u, vv); xx = _tuple$2[0]; wasSquare = _tuple$2[1]; if (wasSquare === 0) { return [ptrType.nil, errors.New("edwards25519: invalid point encoding")]; } xxNeg = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)).Negate(xx); xx = xx.Select(xxNeg, xx, ((((31 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 31]) >>> 7 << 24 >>> 24) >> 0))); v.x.Set(xx); v.y.Set(y); v.z.One(); v.t.Multiply(xx, y); return [v, $ifaceNil]; }; Point.prototype.SetBytes = function(x) { return this.$val.SetBytes(x); }; copyFieldElement = function(buf, v) { var buf, v; $copySlice(new sliceType(buf), v.Bytes()); return new sliceType(buf); }; projP2.ptr.prototype.FromP1xP1 = function(p) { var p, v; v = this; v.X.Multiply(p.X, p.T); v.Y.Multiply(p.Y, p.Z); v.Z.Multiply(p.Z, p.T); return v; }; projP2.prototype.FromP1xP1 = function(p) { return this.$val.FromP1xP1(p); }; projP2.ptr.prototype.FromP3 = function(p) { var p, v; v = this; v.X.Set(p.x); v.Y.Set(p.y); v.Z.Set(p.z); return v; }; projP2.prototype.FromP3 = function(p) { return this.$val.FromP3(p); }; Point.ptr.prototype.fromP1xP1 = function(p) { var p, v; v = this; v.x.Multiply(p.X, p.T); v.y.Multiply(p.Y, p.Z); v.z.Multiply(p.Z, p.T); v.t.Multiply(p.X, p.Y); return v; }; Point.prototype.fromP1xP1 = function(p) { return this.$val.fromP1xP1(p); }; Point.ptr.prototype.fromP2 = function(p) { var p, v; v = this; v.x.Multiply(p.X, p.Z); v.y.Multiply(p.Y, p.Z); v.z.Square(p.Z); v.t.Multiply(p.X, p.Y); return v; }; Point.prototype.fromP2 = function(p) { return this.$val.fromP2(p); }; projCached.ptr.prototype.FromP3 = function(p) { var p, v; v = this; v.YplusX.Add(p.y, p.x); v.YminusX.Subtract(p.y, p.x); v.Z.Set(p.z); v.T2d.Multiply(p.t, d2); return v; }; projCached.prototype.FromP3 = function(p) { return this.$val.FromP3(p); }; affineCached.ptr.prototype.FromP3 = function(p) { var invZ, p, v; v = this; v.YplusX.Add(p.y, p.x); v.YminusX.Subtract(p.y, p.x); v.T2d.Multiply(p.t, d2); invZ = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); invZ.Invert(p.z); v.YplusX.Multiply(v.YplusX, invZ); v.YminusX.Multiply(v.YminusX, invZ); v.T2d.Multiply(v.T2d, invZ); return v; }; affineCached.prototype.FromP3 = function(p) { return this.$val.FromP3(p); }; Point.ptr.prototype.Add = function(p, q) { var p, q, qCached, result, v; v = this; checkInitialized(new sliceType$1([p, q])); qCached = new projCached.ptr(new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0))).FromP3(q); result = new projP1xP1.ptr(new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0))).Add(p, qCached); return v.fromP1xP1(result); }; Point.prototype.Add = function(p, q) { return this.$val.Add(p, q); }; Point.ptr.prototype.Subtract = function(p, q) { var p, q, qCached, result, v; v = this; checkInitialized(new sliceType$1([p, q])); qCached = new projCached.ptr(new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0))).FromP3(q); result = new projP1xP1.ptr(new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0))).Sub(p, qCached); return v.fromP1xP1(result); }; Point.prototype.Subtract = function(p, q) { return this.$val.Subtract(p, q); }; projP1xP1.ptr.prototype.Add = function(p, q) { var MM, PP, TT2d, YminusX, YplusX, ZZ2, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, p, q, v; v = this; _tmp = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$1 = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$2 = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$3 = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$4 = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$5 = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); YplusX = $clone(_tmp, field.Element); YminusX = $clone(_tmp$1, field.Element); PP = $clone(_tmp$2, field.Element); MM = $clone(_tmp$3, field.Element); TT2d = $clone(_tmp$4, field.Element); ZZ2 = $clone(_tmp$5, field.Element); YplusX.Add(p.y, p.x); YminusX.Subtract(p.y, p.x); PP.Multiply(YplusX, q.YplusX); MM.Multiply(YminusX, q.YminusX); TT2d.Multiply(p.t, q.T2d); ZZ2.Multiply(p.z, q.Z); ZZ2.Add(ZZ2, ZZ2); v.X.Subtract(PP, MM); v.Y.Add(PP, MM); v.Z.Add(ZZ2, TT2d); v.T.Subtract(ZZ2, TT2d); return v; }; projP1xP1.prototype.Add = function(p, q) { return this.$val.Add(p, q); }; projP1xP1.ptr.prototype.Sub = function(p, q) { var MM, PP, TT2d, YminusX, YplusX, ZZ2, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, p, q, v; v = this; _tmp = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$1 = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$2 = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$3 = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$4 = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$5 = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); YplusX = $clone(_tmp, field.Element); YminusX = $clone(_tmp$1, field.Element); PP = $clone(_tmp$2, field.Element); MM = $clone(_tmp$3, field.Element); TT2d = $clone(_tmp$4, field.Element); ZZ2 = $clone(_tmp$5, field.Element); YplusX.Add(p.y, p.x); YminusX.Subtract(p.y, p.x); PP.Multiply(YplusX, q.YminusX); MM.Multiply(YminusX, q.YplusX); TT2d.Multiply(p.t, q.T2d); ZZ2.Multiply(p.z, q.Z); ZZ2.Add(ZZ2, ZZ2); v.X.Subtract(PP, MM); v.Y.Add(PP, MM); v.Z.Subtract(ZZ2, TT2d); v.T.Add(ZZ2, TT2d); return v; }; projP1xP1.prototype.Sub = function(p, q) { return this.$val.Sub(p, q); }; projP1xP1.ptr.prototype.AddAffine = function(p, q) { var MM, PP, TT2d, YminusX, YplusX, Z2, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, p, q, v; v = this; _tmp = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$1 = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$2 = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$3 = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$4 = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$5 = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); YplusX = $clone(_tmp, field.Element); YminusX = $clone(_tmp$1, field.Element); PP = $clone(_tmp$2, field.Element); MM = $clone(_tmp$3, field.Element); TT2d = $clone(_tmp$4, field.Element); Z2 = $clone(_tmp$5, field.Element); YplusX.Add(p.y, p.x); YminusX.Subtract(p.y, p.x); PP.Multiply(YplusX, q.YplusX); MM.Multiply(YminusX, q.YminusX); TT2d.Multiply(p.t, q.T2d); Z2.Add(p.z, p.z); v.X.Subtract(PP, MM); v.Y.Add(PP, MM); v.Z.Add(Z2, TT2d); v.T.Subtract(Z2, TT2d); return v; }; projP1xP1.prototype.AddAffine = function(p, q) { return this.$val.AddAffine(p, q); }; projP1xP1.ptr.prototype.SubAffine = function(p, q) { var MM, PP, TT2d, YminusX, YplusX, Z2, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, p, q, v; v = this; _tmp = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$1 = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$2 = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$3 = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$4 = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$5 = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); YplusX = $clone(_tmp, field.Element); YminusX = $clone(_tmp$1, field.Element); PP = $clone(_tmp$2, field.Element); MM = $clone(_tmp$3, field.Element); TT2d = $clone(_tmp$4, field.Element); Z2 = $clone(_tmp$5, field.Element); YplusX.Add(p.y, p.x); YminusX.Subtract(p.y, p.x); PP.Multiply(YplusX, q.YminusX); MM.Multiply(YminusX, q.YplusX); TT2d.Multiply(p.t, q.T2d); Z2.Add(p.z, p.z); v.X.Subtract(PP, MM); v.Y.Add(PP, MM); v.Z.Subtract(Z2, TT2d); v.T.Add(Z2, TT2d); return v; }; projP1xP1.prototype.SubAffine = function(p, q) { return this.$val.SubAffine(p, q); }; projP1xP1.ptr.prototype.Double = function(p) { var XX, XplusYsq, YY, ZZ2, _tmp, _tmp$1, _tmp$2, _tmp$3, p, v; v = this; _tmp = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$1 = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$2 = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$3 = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); XX = $clone(_tmp, field.Element); YY = $clone(_tmp$1, field.Element); ZZ2 = $clone(_tmp$2, field.Element); XplusYsq = $clone(_tmp$3, field.Element); XX.Square(p.X); YY.Square(p.Y); ZZ2.Square(p.Z); ZZ2.Add(ZZ2, ZZ2); XplusYsq.Add(p.X, p.Y); XplusYsq.Square(XplusYsq); v.Y.Add(YY, XX); v.Z.Subtract(YY, XX); v.X.Subtract(XplusYsq, v.Y); v.T.Subtract(ZZ2, v.Z); return v; }; projP1xP1.prototype.Double = function(p) { return this.$val.Double(p); }; Point.ptr.prototype.Negate = function(p) { var p, v; v = this; checkInitialized(new sliceType$1([p])); v.x.Negate(p.x); v.y.Set(p.y); v.z.Set(p.z); v.t.Negate(p.t); return v; }; Point.prototype.Negate = function(p) { return this.$val.Negate(p); }; Point.ptr.prototype.Equal = function(u) { var _tmp, _tmp$1, _tmp$2, _tmp$3, t1, t2, t3, t4, u, v; v = this; checkInitialized(new sliceType$1([v, u])); _tmp = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$1 = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$2 = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); _tmp$3 = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)); t1 = $clone(_tmp, field.Element); t2 = $clone(_tmp$1, field.Element); t3 = $clone(_tmp$2, field.Element); t4 = $clone(_tmp$3, field.Element); t1.Multiply(v.x, u.z); t2.Multiply(u.x, v.z); t3.Multiply(v.y, u.z); t4.Multiply(u.y, v.z); return t1.Equal(t2) & t3.Equal(t4); }; Point.prototype.Equal = function(u) { return this.$val.Equal(u); }; projCached.ptr.prototype.Select = function(a, b, cond) { var a, b, cond, v; v = this; v.YplusX.Select(a.YplusX, b.YplusX, cond); v.YminusX.Select(a.YminusX, b.YminusX, cond); v.Z.Select(a.Z, b.Z, cond); v.T2d.Select(a.T2d, b.T2d, cond); return v; }; projCached.prototype.Select = function(a, b, cond) { return this.$val.Select(a, b, cond); }; affineCached.ptr.prototype.Select = function(a, b, cond) { var a, b, cond, v; v = this; v.YplusX.Select(a.YplusX, b.YplusX, cond); v.YminusX.Select(a.YminusX, b.YminusX, cond); v.T2d.Select(a.T2d, b.T2d, cond); return v; }; affineCached.prototype.Select = function(a, b, cond) { return this.$val.Select(a, b, cond); }; projCached.ptr.prototype.CondNeg = function(cond) { var cond, v; v = this; v.YplusX.Swap(v.YminusX, cond); v.T2d.Select(new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)).Negate(v.T2d), v.T2d, cond); return v; }; projCached.prototype.CondNeg = function(cond) { return this.$val.CondNeg(cond); }; affineCached.ptr.prototype.CondNeg = function(cond) { var cond, v; v = this; v.YplusX.Swap(v.YminusX, cond); v.T2d.Select(new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)).Negate(v.T2d), v.T2d, cond); return v; }; affineCached.prototype.CondNeg = function(cond) { return this.$val.CondNeg(cond); }; ptrType$3.methods = [{prop: "FromP3", name: "FromP3", pkg: "", typ: $funcType([ptrType], [], false)}, {prop: "SelectInto", name: "SelectInto", pkg: "", typ: $funcType([ptrType$2, $Int8], [], false)}]; ptrType$5.methods = [{prop: "FromP3", name: "FromP3", pkg: "", typ: $funcType([ptrType], [], false)}, {prop: "SelectInto", name: "SelectInto", pkg: "", typ: $funcType([ptrType$4, $Int8], [], false)}]; ptrType$6.methods = [{prop: "FromP3", name: "FromP3", pkg: "", typ: $funcType([ptrType], [], false)}, {prop: "SelectInto", name: "SelectInto", pkg: "", typ: $funcType([ptrType$2, $Int8], [], false)}]; ptrType$7.methods = [{prop: "FromP3", name: "FromP3", pkg: "", typ: $funcType([ptrType], [], false)}, {prop: "SelectInto", name: "SelectInto", pkg: "", typ: $funcType([ptrType$4, $Int8], [], false)}]; ptrType$1.methods = [{prop: "MultiplyAdd", name: "MultiplyAdd", pkg: "", typ: $funcType([ptrType$1, ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "Add", name: "Add", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "Subtract", name: "Subtract", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "Negate", name: "Negate", pkg: "", typ: $funcType([ptrType$1], [ptrType$1], false)}, {prop: "Multiply", name: "Multiply", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "Set", name: "Set", pkg: "", typ: $funcType([ptrType$1], [ptrType$1], false)}, {prop: "SetUniformBytes", name: "SetUniformBytes", pkg: "", typ: $funcType([sliceType], [ptrType$1], false)}, {prop: "SetCanonicalBytes", name: "SetCanonicalBytes", pkg: "", typ: $funcType([sliceType], [ptrType$1, $error], false)}, {prop: "SetBytesWithClamping", name: "SetBytesWithClamping", pkg: "", typ: $funcType([sliceType], [ptrType$1], false)}, {prop: "Bytes", name: "Bytes", pkg: "", typ: $funcType([], [sliceType], false)}, {prop: "Equal", name: "Equal", pkg: "", typ: $funcType([ptrType$1], [$Int], false)}, {prop: "nonAdjacentForm", name: "nonAdjacentForm", pkg: "crypto/ed25519/internal/edwards25519", typ: $funcType([$Uint], [arrayType$6], false)}, {prop: "signedRadix16", name: "signedRadix16", pkg: "crypto/ed25519/internal/edwards25519", typ: $funcType([], [arrayType$4], false)}]; ptrType$8.methods = [{prop: "Add", name: "Add", pkg: "", typ: $funcType([ptrType, ptrType$2], [ptrType$8], false)}, {prop: "Sub", name: "Sub", pkg: "", typ: $funcType([ptrType, ptrType$2], [ptrType$8], false)}, {prop: "AddAffine", name: "AddAffine", pkg: "", typ: $funcType([ptrType, ptrType$4], [ptrType$8], false)}, {prop: "SubAffine", name: "SubAffine", pkg: "", typ: $funcType([ptrType, ptrType$4], [ptrType$8], false)}, {prop: "Double", name: "Double", pkg: "", typ: $funcType([ptrType$9], [ptrType$8], false)}]; ptrType$9.methods = [{prop: "Zero", name: "Zero", pkg: "", typ: $funcType([], [ptrType$9], false)}, {prop: "FromP1xP1", name: "FromP1xP1", pkg: "", typ: $funcType([ptrType$8], [ptrType$9], false)}, {prop: "FromP3", name: "FromP3", pkg: "", typ: $funcType([ptrType], [ptrType$9], false)}]; ptrType.methods = [{prop: "ScalarBaseMult", name: "ScalarBaseMult", pkg: "", typ: $funcType([ptrType$1], [ptrType], false)}, {prop: "ScalarMult", name: "ScalarMult", pkg: "", typ: $funcType([ptrType$1, ptrType], [ptrType], false)}, {prop: "VarTimeDoubleScalarBaseMult", name: "VarTimeDoubleScalarBaseMult", pkg: "", typ: $funcType([ptrType$1, ptrType, ptrType$1], [ptrType], false)}, {prop: "Set", name: "Set", pkg: "", typ: $funcType([ptrType], [ptrType], false)}, {prop: "Bytes", name: "Bytes", pkg: "", typ: $funcType([], [sliceType], false)}, {prop: "bytes", name: "bytes", pkg: "crypto/ed25519/internal/edwards25519", typ: $funcType([ptrType$10], [sliceType], false)}, {prop: "SetBytes", name: "SetBytes", pkg: "", typ: $funcType([sliceType], [ptrType, $error], false)}, {prop: "fromP1xP1", name: "fromP1xP1", pkg: "crypto/ed25519/internal/edwards25519", typ: $funcType([ptrType$8], [ptrType], false)}, {prop: "fromP2", name: "fromP2", pkg: "crypto/ed25519/internal/edwards25519", typ: $funcType([ptrType$9], [ptrType], false)}, {prop: "Add", name: "Add", pkg: "", typ: $funcType([ptrType, ptrType], [ptrType], false)}, {prop: "Subtract", name: "Subtract", pkg: "", typ: $funcType([ptrType, ptrType], [ptrType], false)}, {prop: "Negate", name: "Negate", pkg: "", typ: $funcType([ptrType], [ptrType], false)}, {prop: "Equal", name: "Equal", pkg: "", typ: $funcType([ptrType], [$Int], false)}]; ptrType$2.methods = [{prop: "Zero", name: "Zero", pkg: "", typ: $funcType([], [ptrType$2], false)}, {prop: "FromP3", name: "FromP3", pkg: "", typ: $funcType([ptrType], [ptrType$2], false)}, {prop: "Select", name: "Select", pkg: "", typ: $funcType([ptrType$2, ptrType$2, $Int], [ptrType$2], false)}, {prop: "CondNeg", name: "CondNeg", pkg: "", typ: $funcType([$Int], [ptrType$2], false)}]; ptrType$4.methods = [{prop: "Zero", name: "Zero", pkg: "", typ: $funcType([], [ptrType$4], false)}, {prop: "FromP3", name: "FromP3", pkg: "", typ: $funcType([ptrType], [ptrType$4], false)}, {prop: "Select", name: "Select", pkg: "", typ: $funcType([ptrType$4, ptrType$4, $Int], [ptrType$4], false)}, {prop: "CondNeg", name: "CondNeg", pkg: "", typ: $funcType([$Int], [ptrType$4], false)}]; projLookupTable.init("crypto/ed25519/internal/edwards25519", [{prop: "points", name: "points", embedded: false, exported: false, typ: arrayType$5, tag: ""}]); affineLookupTable.init("crypto/ed25519/internal/edwards25519", [{prop: "points", name: "points", embedded: false, exported: false, typ: arrayType, tag: ""}]); nafLookupTable5.init("crypto/ed25519/internal/edwards25519", [{prop: "points", name: "points", embedded: false, exported: false, typ: arrayType$5, tag: ""}]); nafLookupTable8.init("crypto/ed25519/internal/edwards25519", [{prop: "points", name: "points", embedded: false, exported: false, typ: arrayType$2, tag: ""}]); Scalar.init("crypto/ed25519/internal/edwards25519", [{prop: "s", name: "s", embedded: false, exported: false, typ: arrayType$7, tag: ""}]); projP1xP1.init("", [{prop: "X", name: "X", embedded: false, exported: true, typ: field.Element, tag: ""}, {prop: "Y", name: "Y", embedded: false, exported: true, typ: field.Element, tag: ""}, {prop: "Z", name: "Z", embedded: false, exported: true, typ: field.Element, tag: ""}, {prop: "T", name: "T", embedded: false, exported: true, typ: field.Element, tag: ""}]); projP2.init("", [{prop: "X", name: "X", embedded: false, exported: true, typ: field.Element, tag: ""}, {prop: "Y", name: "Y", embedded: false, exported: true, typ: field.Element, tag: ""}, {prop: "Z", name: "Z", embedded: false, exported: true, typ: field.Element, tag: ""}]); Point.init("crypto/ed25519/internal/edwards25519", [{prop: "x", name: "x", embedded: false, exported: false, typ: field.Element, tag: ""}, {prop: "y", name: "y", embedded: false, exported: false, typ: field.Element, tag: ""}, {prop: "z", name: "z", embedded: false, exported: false, typ: field.Element, tag: ""}, {prop: "t", name: "t", embedded: false, exported: false, typ: field.Element, tag: ""}, {prop: "_$4", name: "_", embedded: false, exported: false, typ: incomparable, tag: ""}]); incomparable.init(funcType, 0); projCached.init("", [{prop: "YplusX", name: "YplusX", embedded: false, exported: true, typ: field.Element, tag: ""}, {prop: "YminusX", name: "YminusX", embedded: false, exported: true, typ: field.Element, tag: ""}, {prop: "Z", name: "Z", embedded: false, exported: true, typ: field.Element, tag: ""}, {prop: "T2d", name: "T2d", embedded: false, exported: true, typ: field.Element, tag: ""}]); affineCached.init("", [{prop: "YplusX", name: "YplusX", embedded: false, exported: true, typ: field.Element, tag: ""}, {prop: "YminusX", name: "YminusX", embedded: false, exported: true, typ: field.Element, tag: ""}, {prop: "T2d", name: "T2d", embedded: false, exported: true, typ: field.Element, 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 = field.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = subtle.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = binary.$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 = sync.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } basepointTablePrecomp = new structType.ptr(arrayType$1.zero(), new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0))); basepointNafTablePrecomp = new structType$1.ptr(new nafLookupTable8.ptr(arrayType$2.zero()), new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0))); scZero = new Scalar.ptr($toNativeArray($kindUint8, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])); scOne = new Scalar.ptr($toNativeArray($kindUint8, [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])); scMinusOne = new Scalar.ptr($toNativeArray($kindUint8, [236, 211, 245, 92, 26, 99, 18, 88, 214, 156, 247, 162, 222, 249, 222, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16])); feOne = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)).One(); d = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)).SetBytes(new sliceType([163, 120, 89, 19, 202, 77, 235, 117, 171, 216, 65, 65, 77, 10, 112, 0, 152, 232, 121, 119, 121, 64, 199, 140, 115, 254, 111, 43, 238, 108, 3, 82])); _tuple = new Point.ptr(new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), arrayType$3.zero()).SetBytes(new sliceType([1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])); identity = _tuple[0]; _tuple$1 = new Point.ptr(new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), arrayType$3.zero()).SetBytes(new sliceType([88, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102])); generator = _tuple$1[0]; d2 = new field.Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)).Add(d, d); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["crypto/ed25519"] = (function() { var $pkg = {}, $init, bytes, crypto, edwards25519, rand, sha512, errors, io, strconv, PublicKey, PrivateKey, sliceType, arrayType, funcType, arrayType$1, NewKeyFromSeed, newKeyFromSeed, Sign, sign, Verify; bytes = $packages["bytes"]; crypto = $packages["crypto"]; edwards25519 = $packages["crypto/ed25519/internal/edwards25519"]; rand = $packages["crypto/rand"]; sha512 = $packages["crypto/sha512"]; errors = $packages["errors"]; io = $packages["io"]; strconv = $packages["strconv"]; PublicKey = $pkg.PublicKey = $newType(12, $kindSlice, "ed25519.PublicKey", true, "crypto/ed25519", true, null); PrivateKey = $pkg.PrivateKey = $newType(12, $kindSlice, "ed25519.PrivateKey", true, "crypto/ed25519", true, null); sliceType = $sliceType($Uint8); arrayType = $arrayType($Uint8, 64); funcType = $funcType([], [], false); arrayType$1 = $arrayType(funcType, 0); PublicKey.prototype.Equal = function(x) { var _tuple, ok, pub, x, xx; pub = this; _tuple = $assertType(x, PublicKey, true); xx = _tuple[0]; ok = _tuple[1]; if (!ok) { return false; } return bytes.Equal($convertSliceType(pub, sliceType), $convertSliceType(xx, sliceType)); }; $ptrType(PublicKey).prototype.Equal = function(x) { return this.$get().Equal(x); }; PrivateKey.prototype.Public = function() { var priv, publicKey; priv = this; publicKey = $makeSlice(sliceType, 32); $copySlice(publicKey, $subslice(priv, 32)); return ($convertSliceType(publicKey, PublicKey)); }; $ptrType(PrivateKey).prototype.Public = function() { return this.$get().Public(); }; PrivateKey.prototype.Equal = function(x) { var _tuple, ok, priv, x, xx; priv = this; _tuple = $assertType(x, PrivateKey, true); xx = _tuple[0]; ok = _tuple[1]; if (!ok) { return false; } return bytes.Equal($convertSliceType(priv, sliceType), $convertSliceType(xx, sliceType)); }; $ptrType(PrivateKey).prototype.Equal = function(x) { return this.$get().Equal(x); }; PrivateKey.prototype.Seed = function() { var priv, seed; priv = this; seed = $makeSlice(sliceType, 32); $copySlice(seed, $subslice(priv, 0, 32)); return seed; }; $ptrType(PrivateKey).prototype.Seed = function() { return this.$get().Seed(); }; PrivateKey.prototype.Sign = function(rand$1, message, opts) { var $24r, _r, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, err, message, opts, priv, rand$1, signature, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; err = $f.err; message = $f.message; opts = $f.opts; priv = $f.priv; rand$1 = $f.rand$1; signature = $f.signature; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: signature = sliceType.nil; err = $ifaceNil; priv = this; _r = opts.HashFunc(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (!((_r === 0))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((_r === 0))) { */ case 1: _tmp = sliceType.nil; _tmp$1 = errors.New("ed25519: cannot sign hashed message"); signature = _tmp; err = _tmp$1; $s = -1; return [signature, err]; /* } */ case 2: _r$1 = Sign(priv, message); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tmp$2 = _r$1; _tmp$3 = $ifaceNil; signature = _tmp$2; err = _tmp$3; $24r = [signature, err]; $s = 5; case 5: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: PrivateKey.prototype.Sign }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f.err = err; $f.message = message; $f.opts = opts; $f.priv = priv; $f.rand$1 = rand$1; $f.signature = signature; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(PrivateKey).prototype.Sign = function(rand$1, message, opts) { return this.$get().Sign(rand$1, message, opts); }; NewKeyFromSeed = function(seed) { var privateKey, seed, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; privateKey = $f.privateKey; seed = $f.seed; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: privateKey = $makeSlice(sliceType, 64); $r = newKeyFromSeed(privateKey, seed); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $convertSliceType(privateKey, PrivateKey); /* */ } return; } if ($f === undefined) { $f = { $blk: NewKeyFromSeed }; } $f.privateKey = privateKey; $f.seed = seed; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.NewKeyFromSeed = NewKeyFromSeed; newKeyFromSeed = function(privateKey, seed) { var A, _r, h, l, privateKey, publicKey, s, seed, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; A = $f.A; _r = $f._r; h = $f.h; l = $f.l; privateKey = $f.privateKey; publicKey = $f.publicKey; s = $f.s; seed = $f.seed; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: l = seed.$length; if (!((l === 32))) { $panic(new $String("ed25519: bad seed length: " + strconv.Itoa(l))); } h = $clone(sha512.Sum512(seed), arrayType); s = edwards25519.NewScalar().SetBytesWithClamping($subslice(new sliceType(h), 0, 32)); _r = (new edwards25519.Point.ptr(new $packages["crypto/ed25519/internal/edwards25519/field"].Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new $packages["crypto/ed25519/internal/edwards25519/field"].Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new $packages["crypto/ed25519/internal/edwards25519/field"].Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new $packages["crypto/ed25519/internal/edwards25519/field"].Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), arrayType$1.zero())).ScalarBaseMult(s); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } A = _r; publicKey = A.Bytes(); $copySlice(privateKey, seed); $copySlice($subslice(privateKey, 32), publicKey); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: newKeyFromSeed }; } $f.A = A; $f._r = _r; $f.h = h; $f.l = l; $f.privateKey = privateKey; $f.publicKey = publicKey; $f.s = s; $f.seed = seed; $f.$s = $s; $f.$r = $r; return $f; }; Sign = function(privateKey, message) { var message, privateKey, signature, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; message = $f.message; privateKey = $f.privateKey; signature = $f.signature; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: signature = $makeSlice(sliceType, 64); $r = sign(signature, $convertSliceType(privateKey, sliceType), message); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return signature; /* */ } return; } if ($f === undefined) { $f = { $blk: Sign }; } $f.message = message; $f.privateKey = privateKey; $f.signature = signature; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Sign = Sign; sign = function(signature, privateKey, message) { var R, S, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _tmp, _tmp$1, h, hramDigest, k, kh, l, message, messageDigest, mh, prefix, privateKey, publicKey, r, s, seed, signature, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; R = $f.R; S = $f.S; _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; h = $f.h; hramDigest = $f.hramDigest; k = $f.k; kh = $f.kh; l = $f.l; message = $f.message; messageDigest = $f.messageDigest; mh = $f.mh; prefix = $f.prefix; privateKey = $f.privateKey; publicKey = $f.publicKey; r = $f.r; s = $f.s; seed = $f.seed; signature = $f.signature; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: l = privateKey.$length; if (!((l === 64))) { $panic(new $String("ed25519: bad private key length: " + strconv.Itoa(l))); } _tmp = $subslice(privateKey, 0, 32); _tmp$1 = $subslice(privateKey, 32); seed = _tmp; publicKey = _tmp$1; h = $clone(sha512.Sum512(seed), arrayType); s = edwards25519.NewScalar().SetBytesWithClamping($subslice(new sliceType(h), 0, 32)); prefix = $subslice(new sliceType(h), 32); mh = sha512.New(); _r = mh.Write(prefix); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; _r$1 = mh.Write(message); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; messageDigest = $makeSlice(sliceType, 0, 64); _r$2 = mh.Sum(messageDigest); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } messageDigest = _r$2; r = edwards25519.NewScalar().SetUniformBytes(messageDigest); _r$3 = (new edwards25519.Point.ptr(new $packages["crypto/ed25519/internal/edwards25519/field"].Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new $packages["crypto/ed25519/internal/edwards25519/field"].Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new $packages["crypto/ed25519/internal/edwards25519/field"].Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new $packages["crypto/ed25519/internal/edwards25519/field"].Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), arrayType$1.zero())).ScalarBaseMult(r); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } R = _r$3; kh = sha512.New(); _r$4 = kh.Write(R.Bytes()); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; _r$5 = kh.Write(publicKey); /* */ $s = 6; case 6: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; _r$6 = kh.Write(message); /* */ $s = 7; case 7: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; hramDigest = $makeSlice(sliceType, 0, 64); _r$7 = kh.Sum(hramDigest); /* */ $s = 8; case 8: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } hramDigest = _r$7; k = edwards25519.NewScalar().SetUniformBytes(hramDigest); S = edwards25519.NewScalar().MultiplyAdd(k, s, r); $copySlice($subslice(signature, 0, 32), R.Bytes()); $copySlice($subslice(signature, 32), S.Bytes()); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: sign }; } $f.R = R; $f.S = S; $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.h = h; $f.hramDigest = hramDigest; $f.k = k; $f.kh = kh; $f.l = l; $f.message = message; $f.messageDigest = messageDigest; $f.mh = mh; $f.prefix = prefix; $f.privateKey = privateKey; $f.publicKey = publicKey; $f.r = r; $f.s = s; $f.seed = seed; $f.signature = signature; $f.$s = $s; $f.$r = $r; return $f; }; Verify = function(publicKey, message, sig) { var A, R, S, _r, _r$1, _r$2, _r$3, _r$4, _tuple, _tuple$1, err, hramDigest, k, kh, l, message, minusA, publicKey, sig, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; A = $f.A; R = $f.R; S = $f.S; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; err = $f.err; hramDigest = $f.hramDigest; k = $f.k; kh = $f.kh; l = $f.l; message = $f.message; minusA = $f.minusA; publicKey = $f.publicKey; sig = $f.sig; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: l = publicKey.$length; if (!((l === 32))) { $panic(new $String("ed25519: bad public key length: " + strconv.Itoa(l))); } if (!((sig.$length === 64)) || !(((((63 >= sig.$length ? ($throwRuntimeError("index out of range"), undefined) : sig.$array[sig.$offset + 63]) & 224) >>> 0) === 0))) { $s = -1; return false; } _tuple = (new edwards25519.Point.ptr(new $packages["crypto/ed25519/internal/edwards25519/field"].Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new $packages["crypto/ed25519/internal/edwards25519/field"].Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new $packages["crypto/ed25519/internal/edwards25519/field"].Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new $packages["crypto/ed25519/internal/edwards25519/field"].Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), arrayType$1.zero())).SetBytes($convertSliceType(publicKey, sliceType)); A = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return false; } kh = sha512.New(); _r = kh.Write($subslice(sig, 0, 32)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; _r$1 = kh.Write($convertSliceType(publicKey, sliceType)); /* */ $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$2 = kh.Write(message); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; hramDigest = $makeSlice(sliceType, 0, 64); _r$3 = kh.Sum(hramDigest); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } hramDigest = _r$3; k = edwards25519.NewScalar().SetUniformBytes(hramDigest); _tuple$1 = edwards25519.NewScalar().SetCanonicalBytes($subslice(sig, 32)); S = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return false; } minusA = (new edwards25519.Point.ptr(new $packages["crypto/ed25519/internal/edwards25519/field"].Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new $packages["crypto/ed25519/internal/edwards25519/field"].Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new $packages["crypto/ed25519/internal/edwards25519/field"].Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new $packages["crypto/ed25519/internal/edwards25519/field"].Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), arrayType$1.zero())).Negate(A); _r$4 = (new edwards25519.Point.ptr(new $packages["crypto/ed25519/internal/edwards25519/field"].Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new $packages["crypto/ed25519/internal/edwards25519/field"].Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new $packages["crypto/ed25519/internal/edwards25519/field"].Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), new $packages["crypto/ed25519/internal/edwards25519/field"].Element.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0)), arrayType$1.zero())).VarTimeDoubleScalarBaseMult(k, minusA, S); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } R = _r$4; $s = -1; return bytes.Equal($subslice(sig, 0, 32), R.Bytes()); /* */ } return; } if ($f === undefined) { $f = { $blk: Verify }; } $f.A = A; $f.R = R; $f.S = S; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.err = err; $f.hramDigest = hramDigest; $f.k = k; $f.kh = kh; $f.l = l; $f.message = message; $f.minusA = minusA; $f.publicKey = publicKey; $f.sig = sig; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Verify = Verify; PublicKey.methods = [{prop: "Equal", name: "Equal", pkg: "", typ: $funcType([crypto.PublicKey], [$Bool], false)}]; PrivateKey.methods = [{prop: "Public", name: "Public", pkg: "", typ: $funcType([], [crypto.PublicKey], false)}, {prop: "Equal", name: "Equal", pkg: "", typ: $funcType([crypto.PrivateKey], [$Bool], false)}, {prop: "Seed", name: "Seed", pkg: "", typ: $funcType([], [sliceType], false)}, {prop: "Sign", name: "Sign", pkg: "", typ: $funcType([io.Reader, sliceType, crypto.SignerOpts], [sliceType, $error], false)}]; PublicKey.init($Uint8); PrivateKey.init($Uint8); $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 = crypto.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = edwards25519.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = rand.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sha512.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = errors.$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 = strconv.$init(); /* */ $s = 8; case 8: 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/hmac"] = (function() { var $pkg = {}, $init, subtle, hash, marshalable, hmac, sliceType, ptrType, New, Equal; subtle = $packages["crypto/subtle"]; hash = $packages["hash"]; marshalable = $pkg.marshalable = $newType(8, $kindInterface, "hmac.marshalable", true, "crypto/hmac", false, null); hmac = $pkg.hmac = $newType(0, $kindStruct, "hmac.hmac", true, "crypto/hmac", false, function(opad_, ipad_, outer_, inner_, marshaled_) { this.$val = this; if (arguments.length === 0) { this.opad = sliceType.nil; this.ipad = sliceType.nil; this.outer = $ifaceNil; this.inner = $ifaceNil; this.marshaled = false; return; } this.opad = opad_; this.ipad = ipad_; this.outer = outer_; this.inner = inner_; this.marshaled = marshaled_; }); sliceType = $sliceType($Uint8); ptrType = $ptrType(hmac); hmac.ptr.prototype.Sum = function(in$1) { var $24r, _r, _r$1, _r$2, _r$3, _r$4, err, h, in$1, origLen, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; err = $f.err; h = $f.h; in$1 = $f.in$1; origLen = $f.origLen; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: h = this; origLen = in$1.$length; _r = h.inner.Sum(in$1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } in$1 = _r; /* */ if (h.marshaled) { $s = 2; continue; } /* */ $s = 3; continue; /* if (h.marshaled) { */ case 2: _r$1 = $assertType(h.outer, marshalable).UnmarshalBinary(h.opad); /* */ $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))) { $panic(err); } $s = 4; continue; /* } else { */ case 3: $r = h.outer.Reset(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$2 = h.outer.Write(h.opad); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; /* } */ case 4: _r$3 = h.outer.Write($subslice(in$1, origLen)); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _r$4 = h.outer.Sum($subslice(in$1, 0, origLen)); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r = _r$4; $s = 10; case 10: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: hmac.ptr.prototype.Sum }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.err = err; $f.h = h; $f.in$1 = in$1; $f.origLen = origLen; $f.$s = $s; $f.$r = $r; return $f; }; hmac.prototype.Sum = function(in$1) { return this.$val.Sum(in$1); }; hmac.ptr.prototype.Write = function(p) { var $24r, _r, _tuple, err, h, n, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _tuple = $f._tuple; err = $f.err; h = $f.h; n = $f.n; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; h = this; _r = h.inner.Write(p); /* */ $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]; $24r = [n, err]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: hmac.ptr.prototype.Write }; } $f.$24r = $24r; $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.h = h; $f.n = n; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; hmac.prototype.Write = function(p) { return this.$val.Write(p); }; hmac.ptr.prototype.Size = function() { var $24r, _r, h, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; h = $f.h; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: h = this; _r = h.outer.Size(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: hmac.ptr.prototype.Size }; } $f.$24r = $24r; $f._r = _r; $f.h = h; $f.$s = $s; $f.$r = $r; return $f; }; hmac.prototype.Size = function() { return this.$val.Size(); }; hmac.ptr.prototype.BlockSize = function() { var $24r, _r, h, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; h = $f.h; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: h = this; _r = h.inner.BlockSize(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: hmac.ptr.prototype.BlockSize }; } $f.$24r = $24r; $f._r = _r; $f.h = h; $f.$s = $s; $f.$r = $r; return $f; }; hmac.prototype.BlockSize = function() { return this.$val.BlockSize(); }; hmac.ptr.prototype.Reset = function() { var _r, _r$1, _r$2, _r$3, _r$4, _tuple, _tuple$1, _tuple$2, _tuple$3, err, err$1, h, imarshal, innerOK, marshalableInner, marshalableOuter, omarshal, outerOK, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; err = $f.err; err$1 = $f.err$1; h = $f.h; imarshal = $f.imarshal; innerOK = $f.innerOK; marshalableInner = $f.marshalableInner; marshalableOuter = $f.marshalableOuter; omarshal = $f.omarshal; outerOK = $f.outerOK; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: h = this; /* */ if (h.marshaled) { $s = 1; continue; } /* */ $s = 2; continue; /* if (h.marshaled) { */ case 1: _r = $assertType(h.inner, marshalable).UnmarshalBinary(h.ipad); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil))) { $panic(err); } $s = -1; return; /* } */ case 2: $r = h.inner.Reset(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = h.inner.Write(h.ipad); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _tuple = $assertType(h.inner, marshalable, true); marshalableInner = _tuple[0]; innerOK = _tuple[1]; if (!innerOK) { $s = -1; return; } _tuple$1 = $assertType(h.outer, marshalable, true); marshalableOuter = _tuple$1[0]; outerOK = _tuple$1[1]; if (!outerOK) { $s = -1; return; } _r$2 = marshalableInner.MarshalBinary(); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$2 = _r$2; imarshal = _tuple$2[0]; err$1 = _tuple$2[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return; } $r = h.outer.Reset(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$3 = h.outer.Write(h.opad); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _r$4 = marshalableOuter.MarshalBinary(); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$3 = _r$4; omarshal = _tuple$3[0]; err$1 = _tuple$3[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return; } h.ipad = imarshal; h.opad = omarshal; h.marshaled = true; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: hmac.ptr.prototype.Reset }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.err = err; $f.err$1 = err$1; $f.h = h; $f.imarshal = imarshal; $f.innerOK = innerOK; $f.marshalableInner = marshalableInner; $f.marshalableOuter = marshalableOuter; $f.omarshal = omarshal; $f.outerOK = outerOK; $f.$s = $s; $f.$r = $r; return $f; }; hmac.prototype.Reset = function() { return this.$val.Reset(); }; New = function(h, key) { var _i, _i$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _ref, _ref$1, blocksize, h, hm, i, i$1, key, unique, 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; _i = $f._i; _i$1 = $f._i$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; _ref = $f._ref; _ref$1 = $f._ref$1; blocksize = $f.blocksize; h = $f.h; hm = $f.hm; i = $f.i; i$1 = $f.i$1; key = $f.key; unique = $f.unique; 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: hm = [hm]; unique = [unique]; hm[0] = new hmac.ptr(sliceType.nil, sliceType.nil, $ifaceNil, $ifaceNil, false); _r = h(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } hm[0].outer = _r; _r$1 = h(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } hm[0].inner = _r$1; unique[0] = true; $r = (function(hm, unique) { return function() { var $deferred; /* */ var $err = null; try { $deferred = []; $curGoroutine.deferStack.push($deferred); $deferred.push([(function(hm, unique) { return function() { $unused($recover()); }; })(hm, unique), []]); if ($interfaceIsEqual(hm[0].outer, hm[0].inner)) { unique[0] = false; } /* */ } catch(err) { $err = err; } finally { $callDeferred($deferred, $err); } }; })(hm, unique)(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (!unique[0]) { $panic(new $String("crypto/hmac: hash generation function does not produce unique values")); } _r$2 = hm[0].inner.BlockSize(); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } blocksize = _r$2; hm[0].ipad = $makeSlice(sliceType, blocksize); hm[0].opad = $makeSlice(sliceType, blocksize); /* */ if (key.$length > blocksize) { $s = 5; continue; } /* */ $s = 6; continue; /* if (key.$length > blocksize) { */ case 5: _r$3 = hm[0].outer.Write(key); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _r$4 = hm[0].outer.Sum(sliceType.nil); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } key = _r$4; /* } */ case 6: $copySlice(hm[0].ipad, key); $copySlice(hm[0].opad, key); _ref = hm[0].ipad; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; (x$1 = hm[0].ipad, ((i < 0 || i >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + i] = (((x = hm[0].ipad, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])) ^ (54)) << 24 >>> 24))); _i++; } _ref$1 = hm[0].opad; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } i$1 = _i$1; (x$3 = hm[0].opad, ((i$1 < 0 || i$1 >= x$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + i$1] = (((x$2 = hm[0].opad, ((i$1 < 0 || i$1 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + i$1])) ^ (92)) << 24 >>> 24))); _i$1++; } _r$5 = hm[0].inner.Write(hm[0].ipad); /* */ $s = 9; case 9: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; $s = -1; return hm[0]; /* */ } return; } if ($f === undefined) { $f = { $blk: New }; } $f._i = _i; $f._i$1 = _i$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._ref = _ref; $f._ref$1 = _ref$1; $f.blocksize = blocksize; $f.h = h; $f.hm = hm; $f.i = i; $f.i$1 = i$1; $f.key = key; $f.unique = unique; $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; }; $pkg.New = New; Equal = function(mac1, mac2) { var mac1, mac2; return subtle.ConstantTimeCompare(mac1, mac2) === 1; }; $pkg.Equal = Equal; ptrType.methods = [{prop: "Sum", name: "Sum", pkg: "", typ: $funcType([sliceType], [sliceType], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "BlockSize", name: "BlockSize", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Reset", name: "Reset", pkg: "", typ: $funcType([], [], false)}]; marshalable.init([{prop: "MarshalBinary", name: "MarshalBinary", pkg: "", typ: $funcType([], [sliceType, $error], false)}, {prop: "UnmarshalBinary", name: "UnmarshalBinary", pkg: "", typ: $funcType([sliceType], [$error], false)}]); hmac.init("crypto/hmac", [{prop: "opad", name: "opad", embedded: false, exported: false, typ: sliceType, tag: ""}, {prop: "ipad", name: "ipad", embedded: false, exported: false, typ: sliceType, tag: ""}, {prop: "outer", name: "outer", embedded: false, exported: false, typ: hash.Hash, tag: ""}, {prop: "inner", name: "inner", embedded: false, exported: false, typ: hash.Hash, tag: ""}, {prop: "marshaled", name: "marshaled", embedded: false, exported: false, 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 = subtle.$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; } /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["crypto/md5"] = (function() { var $pkg = {}, $init, crypto, binary, errors, hash, bits, digest, sliceType, arrayType, arrayType$1, arrayType$2, arrayType$3, arrayType$4, ptrType, block, blockGeneric, init, appendUint64, appendUint32, consumeUint64, consumeUint32, New; crypto = $packages["crypto"]; binary = $packages["encoding/binary"]; errors = $packages["errors"]; hash = $packages["hash"]; bits = $packages["math/bits"]; digest = $pkg.digest = $newType(0, $kindStruct, "md5.digest", true, "crypto/md5", false, function(s_, x_, nx_, len_) { this.$val = this; if (arguments.length === 0) { this.s = arrayType$2.zero(); this.x = arrayType$3.zero(); this.nx = 0; this.len = new $Uint64(0, 0); return; } this.s = s_; this.x = x_; this.nx = nx_; this.len = len_; }); sliceType = $sliceType($Uint8); arrayType = $arrayType($Uint8, 8); arrayType$1 = $arrayType($Uint8, 4); arrayType$2 = $arrayType($Uint32, 4); arrayType$3 = $arrayType($Uint8, 64); arrayType$4 = $arrayType($Uint8, 16); ptrType = $ptrType(digest); blockGeneric = function(dig, p) { var _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, a, aa, b, bb, c, cc, d, dd, dig, i, p, q, x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, xa, xb, xc, xd, xe, xf; _tmp = dig.s[0]; _tmp$1 = dig.s[1]; _tmp$2 = dig.s[2]; _tmp$3 = dig.s[3]; a = _tmp; b = _tmp$1; c = _tmp$2; d = _tmp$3; i = 0; while (true) { if (!(i <= (p.$length - 64 >> 0))) { break; } q = $subslice(p, i); q = $subslice(q, 0, 64, 64); _tmp$4 = a; _tmp$5 = b; _tmp$6 = c; _tmp$7 = d; aa = _tmp$4; bb = _tmp$5; cc = _tmp$6; dd = _tmp$7; x0 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 0)); x1 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 4)); x2 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 8)); x3 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 12)); x4 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 16)); x5 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 20)); x6 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 24)); x7 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 28)); x8 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 32)); x9 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 36)); xa = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 40)); xb = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 44)); xc = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 48)); xd = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 52)); xe = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 56)); xf = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(q, 60)); a = b + bits.RotateLeft32((((((((((((c ^ d) >>> 0)) & b) >>> 0)) ^ d) >>> 0)) + a >>> 0) + x0 >>> 0) + 3614090360 >>> 0, 7) >>> 0; d = a + bits.RotateLeft32((((((((((((b ^ c) >>> 0)) & a) >>> 0)) ^ c) >>> 0)) + d >>> 0) + x1 >>> 0) + 3905402710 >>> 0, 12) >>> 0; c = d + bits.RotateLeft32((((((((((((a ^ b) >>> 0)) & d) >>> 0)) ^ b) >>> 0)) + c >>> 0) + x2 >>> 0) + 606105819 >>> 0, 17) >>> 0; b = c + bits.RotateLeft32((((((((((((d ^ a) >>> 0)) & c) >>> 0)) ^ a) >>> 0)) + b >>> 0) + x3 >>> 0) + 3250441966 >>> 0, 22) >>> 0; a = b + bits.RotateLeft32((((((((((((c ^ d) >>> 0)) & b) >>> 0)) ^ d) >>> 0)) + a >>> 0) + x4 >>> 0) + 4118548399 >>> 0, 7) >>> 0; d = a + bits.RotateLeft32((((((((((((b ^ c) >>> 0)) & a) >>> 0)) ^ c) >>> 0)) + d >>> 0) + x5 >>> 0) + 1200080426 >>> 0, 12) >>> 0; c = d + bits.RotateLeft32((((((((((((a ^ b) >>> 0)) & d) >>> 0)) ^ b) >>> 0)) + c >>> 0) + x6 >>> 0) + 2821735955 >>> 0, 17) >>> 0; b = c + bits.RotateLeft32((((((((((((d ^ a) >>> 0)) & c) >>> 0)) ^ a) >>> 0)) + b >>> 0) + x7 >>> 0) + 4249261313 >>> 0, 22) >>> 0; a = b + bits.RotateLeft32((((((((((((c ^ d) >>> 0)) & b) >>> 0)) ^ d) >>> 0)) + a >>> 0) + x8 >>> 0) + 1770035416 >>> 0, 7) >>> 0; d = a + bits.RotateLeft32((((((((((((b ^ c) >>> 0)) & a) >>> 0)) ^ c) >>> 0)) + d >>> 0) + x9 >>> 0) + 2336552879 >>> 0, 12) >>> 0; c = d + bits.RotateLeft32((((((((((((a ^ b) >>> 0)) & d) >>> 0)) ^ b) >>> 0)) + c >>> 0) + xa >>> 0) + 4294925233 >>> 0, 17) >>> 0; b = c + bits.RotateLeft32((((((((((((d ^ a) >>> 0)) & c) >>> 0)) ^ a) >>> 0)) + b >>> 0) + xb >>> 0) + 2304563134 >>> 0, 22) >>> 0; a = b + bits.RotateLeft32((((((((((((c ^ d) >>> 0)) & b) >>> 0)) ^ d) >>> 0)) + a >>> 0) + xc >>> 0) + 1804603682 >>> 0, 7) >>> 0; d = a + bits.RotateLeft32((((((((((((b ^ c) >>> 0)) & a) >>> 0)) ^ c) >>> 0)) + d >>> 0) + xd >>> 0) + 4254626195 >>> 0, 12) >>> 0; c = d + bits.RotateLeft32((((((((((((a ^ b) >>> 0)) & d) >>> 0)) ^ b) >>> 0)) + c >>> 0) + xe >>> 0) + 2792965006 >>> 0, 17) >>> 0; b = c + bits.RotateLeft32((((((((((((d ^ a) >>> 0)) & c) >>> 0)) ^ a) >>> 0)) + b >>> 0) + xf >>> 0) + 1236535329 >>> 0, 22) >>> 0; a = b + bits.RotateLeft32((((((((((((b ^ c) >>> 0)) & d) >>> 0)) ^ c) >>> 0)) + a >>> 0) + x1 >>> 0) + 4129170786 >>> 0, 5) >>> 0; d = a + bits.RotateLeft32((((((((((((a ^ b) >>> 0)) & c) >>> 0)) ^ b) >>> 0)) + d >>> 0) + x6 >>> 0) + 3225465664 >>> 0, 9) >>> 0; c = d + bits.RotateLeft32((((((((((((d ^ a) >>> 0)) & b) >>> 0)) ^ a) >>> 0)) + c >>> 0) + xb >>> 0) + 643717713 >>> 0, 14) >>> 0; b = c + bits.RotateLeft32((((((((((((c ^ d) >>> 0)) & a) >>> 0)) ^ d) >>> 0)) + b >>> 0) + x0 >>> 0) + 3921069994 >>> 0, 20) >>> 0; a = b + bits.RotateLeft32((((((((((((b ^ c) >>> 0)) & d) >>> 0)) ^ c) >>> 0)) + a >>> 0) + x5 >>> 0) + 3593408605 >>> 0, 5) >>> 0; d = a + bits.RotateLeft32((((((((((((a ^ b) >>> 0)) & c) >>> 0)) ^ b) >>> 0)) + d >>> 0) + xa >>> 0) + 38016083 >>> 0, 9) >>> 0; c = d + bits.RotateLeft32((((((((((((d ^ a) >>> 0)) & b) >>> 0)) ^ a) >>> 0)) + c >>> 0) + xf >>> 0) + 3634488961 >>> 0, 14) >>> 0; b = c + bits.RotateLeft32((((((((((((c ^ d) >>> 0)) & a) >>> 0)) ^ d) >>> 0)) + b >>> 0) + x4 >>> 0) + 3889429448 >>> 0, 20) >>> 0; a = b + bits.RotateLeft32((((((((((((b ^ c) >>> 0)) & d) >>> 0)) ^ c) >>> 0)) + a >>> 0) + x9 >>> 0) + 568446438 >>> 0, 5) >>> 0; d = a + bits.RotateLeft32((((((((((((a ^ b) >>> 0)) & c) >>> 0)) ^ b) >>> 0)) + d >>> 0) + xe >>> 0) + 3275163606 >>> 0, 9) >>> 0; c = d + bits.RotateLeft32((((((((((((d ^ a) >>> 0)) & b) >>> 0)) ^ a) >>> 0)) + c >>> 0) + x3 >>> 0) + 4107603335 >>> 0, 14) >>> 0; b = c + bits.RotateLeft32((((((((((((c ^ d) >>> 0)) & a) >>> 0)) ^ d) >>> 0)) + b >>> 0) + x8 >>> 0) + 1163531501 >>> 0, 20) >>> 0; a = b + bits.RotateLeft32((((((((((((b ^ c) >>> 0)) & d) >>> 0)) ^ c) >>> 0)) + a >>> 0) + xd >>> 0) + 2850285829 >>> 0, 5) >>> 0; d = a + bits.RotateLeft32((((((((((((a ^ b) >>> 0)) & c) >>> 0)) ^ b) >>> 0)) + d >>> 0) + x2 >>> 0) + 4243563512 >>> 0, 9) >>> 0; c = d + bits.RotateLeft32((((((((((((d ^ a) >>> 0)) & b) >>> 0)) ^ a) >>> 0)) + c >>> 0) + x7 >>> 0) + 1735328473 >>> 0, 14) >>> 0; b = c + bits.RotateLeft32((((((((((((c ^ d) >>> 0)) & a) >>> 0)) ^ d) >>> 0)) + b >>> 0) + xc >>> 0) + 2368359562 >>> 0, 20) >>> 0; a = b + bits.RotateLeft32((((((((b ^ c) >>> 0) ^ d) >>> 0)) + a >>> 0) + x5 >>> 0) + 4294588738 >>> 0, 4) >>> 0; d = a + bits.RotateLeft32((((((((a ^ b) >>> 0) ^ c) >>> 0)) + d >>> 0) + x8 >>> 0) + 2272392833 >>> 0, 11) >>> 0; c = d + bits.RotateLeft32((((((((d ^ a) >>> 0) ^ b) >>> 0)) + c >>> 0) + xb >>> 0) + 1839030562 >>> 0, 16) >>> 0; b = c + bits.RotateLeft32((((((((c ^ d) >>> 0) ^ a) >>> 0)) + b >>> 0) + xe >>> 0) + 4259657740 >>> 0, 23) >>> 0; a = b + bits.RotateLeft32((((((((b ^ c) >>> 0) ^ d) >>> 0)) + a >>> 0) + x1 >>> 0) + 2763975236 >>> 0, 4) >>> 0; d = a + bits.RotateLeft32((((((((a ^ b) >>> 0) ^ c) >>> 0)) + d >>> 0) + x4 >>> 0) + 1272893353 >>> 0, 11) >>> 0; c = d + bits.RotateLeft32((((((((d ^ a) >>> 0) ^ b) >>> 0)) + c >>> 0) + x7 >>> 0) + 4139469664 >>> 0, 16) >>> 0; b = c + bits.RotateLeft32((((((((c ^ d) >>> 0) ^ a) >>> 0)) + b >>> 0) + xa >>> 0) + 3200236656 >>> 0, 23) >>> 0; a = b + bits.RotateLeft32((((((((b ^ c) >>> 0) ^ d) >>> 0)) + a >>> 0) + xd >>> 0) + 681279174 >>> 0, 4) >>> 0; d = a + bits.RotateLeft32((((((((a ^ b) >>> 0) ^ c) >>> 0)) + d >>> 0) + x0 >>> 0) + 3936430074 >>> 0, 11) >>> 0; c = d + bits.RotateLeft32((((((((d ^ a) >>> 0) ^ b) >>> 0)) + c >>> 0) + x3 >>> 0) + 3572445317 >>> 0, 16) >>> 0; b = c + bits.RotateLeft32((((((((c ^ d) >>> 0) ^ a) >>> 0)) + b >>> 0) + x6 >>> 0) + 76029189 >>> 0, 23) >>> 0; a = b + bits.RotateLeft32((((((((b ^ c) >>> 0) ^ d) >>> 0)) + a >>> 0) + x9 >>> 0) + 3654602809 >>> 0, 4) >>> 0; d = a + bits.RotateLeft32((((((((a ^ b) >>> 0) ^ c) >>> 0)) + d >>> 0) + xc >>> 0) + 3873151461 >>> 0, 11) >>> 0; c = d + bits.RotateLeft32((((((((d ^ a) >>> 0) ^ b) >>> 0)) + c >>> 0) + xf >>> 0) + 530742520 >>> 0, 16) >>> 0; b = c + bits.RotateLeft32((((((((c ^ d) >>> 0) ^ a) >>> 0)) + b >>> 0) + x2 >>> 0) + 3299628645 >>> 0, 23) >>> 0; a = b + bits.RotateLeft32((((((c ^ (((b | (~d >>> 0)) >>> 0))) >>> 0)) + a >>> 0) + x0 >>> 0) + 4096336452 >>> 0, 6) >>> 0; d = a + bits.RotateLeft32((((((b ^ (((a | (~c >>> 0)) >>> 0))) >>> 0)) + d >>> 0) + x7 >>> 0) + 1126891415 >>> 0, 10) >>> 0; c = d + bits.RotateLeft32((((((a ^ (((d | (~b >>> 0)) >>> 0))) >>> 0)) + c >>> 0) + xe >>> 0) + 2878612391 >>> 0, 15) >>> 0; b = c + bits.RotateLeft32((((((d ^ (((c | (~a >>> 0)) >>> 0))) >>> 0)) + b >>> 0) + x5 >>> 0) + 4237533241 >>> 0, 21) >>> 0; a = b + bits.RotateLeft32((((((c ^ (((b | (~d >>> 0)) >>> 0))) >>> 0)) + a >>> 0) + xc >>> 0) + 1700485571 >>> 0, 6) >>> 0; d = a + bits.RotateLeft32((((((b ^ (((a | (~c >>> 0)) >>> 0))) >>> 0)) + d >>> 0) + x3 >>> 0) + 2399980690 >>> 0, 10) >>> 0; c = d + bits.RotateLeft32((((((a ^ (((d | (~b >>> 0)) >>> 0))) >>> 0)) + c >>> 0) + xa >>> 0) + 4293915773 >>> 0, 15) >>> 0; b = c + bits.RotateLeft32((((((d ^ (((c | (~a >>> 0)) >>> 0))) >>> 0)) + b >>> 0) + x1 >>> 0) + 2240044497 >>> 0, 21) >>> 0; a = b + bits.RotateLeft32((((((c ^ (((b | (~d >>> 0)) >>> 0))) >>> 0)) + a >>> 0) + x8 >>> 0) + 1873313359 >>> 0, 6) >>> 0; d = a + bits.RotateLeft32((((((b ^ (((a | (~c >>> 0)) >>> 0))) >>> 0)) + d >>> 0) + xf >>> 0) + 4264355552 >>> 0, 10) >>> 0; c = d + bits.RotateLeft32((((((a ^ (((d | (~b >>> 0)) >>> 0))) >>> 0)) + c >>> 0) + x6 >>> 0) + 2734768916 >>> 0, 15) >>> 0; b = c + bits.RotateLeft32((((((d ^ (((c | (~a >>> 0)) >>> 0))) >>> 0)) + b >>> 0) + xd >>> 0) + 1309151649 >>> 0, 21) >>> 0; a = b + bits.RotateLeft32((((((c ^ (((b | (~d >>> 0)) >>> 0))) >>> 0)) + a >>> 0) + x4 >>> 0) + 4149444226 >>> 0, 6) >>> 0; d = a + bits.RotateLeft32((((((b ^ (((a | (~c >>> 0)) >>> 0))) >>> 0)) + d >>> 0) + xb >>> 0) + 3174756917 >>> 0, 10) >>> 0; c = d + bits.RotateLeft32((((((a ^ (((d | (~b >>> 0)) >>> 0))) >>> 0)) + c >>> 0) + x2 >>> 0) + 718787259 >>> 0, 15) >>> 0; b = c + bits.RotateLeft32((((((d ^ (((c | (~a >>> 0)) >>> 0))) >>> 0)) + b >>> 0) + x9 >>> 0) + 3951481745 >>> 0, 21) >>> 0; a = a + (aa) >>> 0; b = b + (bb) >>> 0; c = c + (cc) >>> 0; d = d + (dd) >>> 0; i = i + (64) >> 0; } _tmp$8 = a; _tmp$9 = b; _tmp$10 = c; _tmp$11 = d; dig.s[0] = _tmp$8; dig.s[1] = _tmp$9; dig.s[2] = _tmp$10; dig.s[3] = _tmp$11; }; init = function() { crypto.RegisterHash(2, New); }; digest.ptr.prototype.Reset = function() { var d; d = this; d.s[0] = 1732584193; d.s[1] = 4023233417; d.s[2] = 2562383102; d.s[3] = 271733878; d.nx = 0; d.len = new $Uint64(0, 0); }; digest.prototype.Reset = function() { return this.$val.Reset(); }; digest.ptr.prototype.MarshalBinary = function() { var b, d; d = this; b = $makeSlice(sliceType, 0, 92); b = $appendSlice(b, "md5\x01"); b = appendUint32(b, d.s[0]); b = appendUint32(b, d.s[1]); b = appendUint32(b, d.s[2]); b = appendUint32(b, d.s[3]); b = $appendSlice(b, $subslice(new sliceType(d.x), 0, d.nx)); b = $subslice(b, 0, ((b.$length + 64 >> 0) - d.nx >> 0)); b = appendUint64(b, d.len); return [b, $ifaceNil]; }; digest.prototype.MarshalBinary = function() { return this.$val.MarshalBinary(); }; digest.ptr.prototype.UnmarshalBinary = function(b) { var _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, b, d; d = this; if (b.$length < 4 || !(($bytesToString($subslice(b, 0, 4))) === "md5\x01")) { return errors.New("crypto/md5: invalid hash state identifier"); } if (!((b.$length === 92))) { return errors.New("crypto/md5: invalid hash state size"); } b = $subslice(b, 4); _tuple = consumeUint32(b); b = _tuple[0]; d.s[0] = _tuple[1]; _tuple$1 = consumeUint32(b); b = _tuple$1[0]; d.s[1] = _tuple$1[1]; _tuple$2 = consumeUint32(b); b = _tuple$2[0]; d.s[2] = _tuple$2[1]; _tuple$3 = consumeUint32(b); b = _tuple$3[0]; d.s[3] = _tuple$3[1]; b = $subslice(b, $copySlice(new sliceType(d.x), b)); _tuple$4 = consumeUint64(b); b = _tuple$4[0]; d.len = _tuple$4[1]; d.nx = (($div64(d.len, new $Uint64(0, 64), true).$low >> 0)); return $ifaceNil; }; digest.prototype.UnmarshalBinary = function(b) { return this.$val.UnmarshalBinary(b); }; appendUint64 = function(b, x) { var a, b, x; a = arrayType.zero(); $clone(binary.BigEndian, binary.bigEndian).PutUint64(new sliceType(a), x); return $appendSlice(b, new sliceType(a)); }; appendUint32 = function(b, x) { var a, b, x; a = arrayType$1.zero(); $clone(binary.BigEndian, binary.bigEndian).PutUint32(new sliceType(a), x); return $appendSlice(b, new sliceType(a)); }; consumeUint64 = function(b) { var b; return [$subslice(b, 8), $clone(binary.BigEndian, binary.bigEndian).Uint64($subslice(b, 0, 8))]; }; consumeUint32 = function(b) { var b; return [$subslice(b, 4), $clone(binary.BigEndian, binary.bigEndian).Uint32($subslice(b, 0, 4))]; }; New = function() { var d; d = new digest.ptr(arrayType$2.zero(), arrayType$3.zero(), 0, new $Uint64(0, 0)); d.Reset(); return d; }; $pkg.New = New; digest.ptr.prototype.Size = function() { var d; d = this; return 16; }; digest.prototype.Size = function() { return this.$val.Size(); }; digest.ptr.prototype.BlockSize = function() { var d; d = this; return 64; }; digest.prototype.BlockSize = function() { return this.$val.BlockSize(); }; digest.ptr.prototype.Write = function(p) { var d, err, n, n$1, nn, p, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; d = $f.d; err = $f.err; n = $f.n; n$1 = $f.n$1; nn = $f.nn; p = $f.p; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: 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) { $s = 1; continue; } /* */ $s = 2; continue; /* if (d.nx > 0) { */ case 1: n = $copySlice($subslice(new sliceType(d.x), d.nx), p); d.nx = d.nx + (n) >> 0; /* */ if (d.nx === 64) { $s = 3; continue; } /* */ $s = 4; continue; /* if (d.nx === 64) { */ case 3: /* */ if (false) { $s = 5; continue; } /* */ $s = 6; continue; /* if (false) { */ case 5: $r = block(d, new sliceType(d.x)); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 7; continue; /* } else { */ case 6: blockGeneric(d, new sliceType(d.x)); /* } */ case 7: d.nx = 0; /* } */ case 4: p = $subslice(p, n); /* } */ case 2: /* */ if (p.$length >= 64) { $s = 9; continue; } /* */ $s = 10; continue; /* if (p.$length >= 64) { */ case 9: n$1 = (p.$length & ~63) >> 0; /* */ if (false) { $s = 11; continue; } /* */ $s = 12; continue; /* if (false) { */ case 11: $r = block(d, $subslice(p, 0, n$1)); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 13; continue; /* } else { */ case 12: blockGeneric(d, $subslice(p, 0, n$1)); /* } */ case 13: p = $subslice(p, n$1); /* } */ case 10: if (p.$length > 0) { d.nx = $copySlice(new sliceType(d.x), p); } $s = -1; return [nn, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: digest.ptr.prototype.Write }; } $f.d = d; $f.err = err; $f.n = n; $f.n$1 = n$1; $f.nn = nn; $f.p = p; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; digest.prototype.Write = function(p) { return this.$val.Write(p); }; digest.ptr.prototype.Sum = function(in$1) { var _r, d, d0, hash$1, in$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; d = $f.d; d0 = $f.d0; hash$1 = $f.hash$1; in$1 = $f.in$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: d = this; d0 = $clone(d, digest); _r = d0.checkSum(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } hash$1 = $clone(_r, arrayType$4); $s = -1; return $appendSlice(in$1, new sliceType(hash$1)); /* */ } return; } if ($f === undefined) { $f = { $blk: digest.ptr.prototype.Sum }; } $f._r = _r; $f.d = d; $f.d0 = d0; $f.hash$1 = hash$1; $f.in$1 = in$1; $f.$s = $s; $f.$r = $r; return $f; }; digest.prototype.Sum = function(in$1) { return this.$val.Sum(in$1); }; digest.ptr.prototype.checkSum = function() { var _r, d, digest$1, pad, tmp, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; d = $f.d; digest$1 = $f.digest$1; pad = $f.pad; tmp = $f.tmp; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: d = this; tmp = $toNativeArray($kindUint8, [128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); pad = $div64(((x = d.len, new $Uint64(0 - x.$high, 55 - x.$low))), new $Uint64(0, 64), true); $clone(binary.LittleEndian, binary.littleEndian).PutUint64($subslice(new sliceType(tmp), $flatten64(new $Uint64(0 + pad.$high, 1 + pad.$low))), $shiftLeft64(d.len, 3)); _r = d.Write($subslice(new sliceType(tmp), 0, $flatten64((x$1 = new $Uint64(0 + pad.$high, 1 + pad.$low), new $Uint64(x$1.$high + 0, x$1.$low + 8))))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; if (!((d.nx === 0))) { $panic(new $String("d.nx != 0")); } digest$1 = arrayType$4.zero(); $clone(binary.LittleEndian, binary.littleEndian).PutUint32($subslice(new sliceType(digest$1), 0), d.s[0]); $clone(binary.LittleEndian, binary.littleEndian).PutUint32($subslice(new sliceType(digest$1), 4), d.s[1]); $clone(binary.LittleEndian, binary.littleEndian).PutUint32($subslice(new sliceType(digest$1), 8), d.s[2]); $clone(binary.LittleEndian, binary.littleEndian).PutUint32($subslice(new sliceType(digest$1), 12), d.s[3]); $s = -1; return digest$1; /* */ } return; } if ($f === undefined) { $f = { $blk: digest.ptr.prototype.checkSum }; } $f._r = _r; $f.d = d; $f.digest$1 = digest$1; $f.pad = pad; $f.tmp = tmp; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; digest.prototype.checkSum = function() { return this.$val.checkSum(); }; ptrType.methods = [{prop: "Reset", name: "Reset", pkg: "", typ: $funcType([], [], false)}, {prop: "MarshalBinary", name: "MarshalBinary", pkg: "", typ: $funcType([], [sliceType, $error], false)}, {prop: "UnmarshalBinary", name: "UnmarshalBinary", pkg: "", typ: $funcType([sliceType], [$error], 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], [$Int, $error], false)}, {prop: "Sum", name: "Sum", pkg: "", typ: $funcType([sliceType], [sliceType], false)}, {prop: "checkSum", name: "checkSum", pkg: "crypto/md5", typ: $funcType([], [arrayType$4], false)}]; digest.init("crypto/md5", [{prop: "s", name: "s", embedded: false, exported: false, typ: arrayType$2, tag: ""}, {prop: "x", name: "x", embedded: false, exported: false, typ: arrayType$3, tag: ""}, {prop: "nx", name: "nx", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "len", name: "len", embedded: false, exported: false, typ: $Uint64, 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 = 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 = hash.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = bits.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } block = blockGeneric; init(); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["crypto/rc4"] = (function() { var $pkg = {}, $init, subtle, strconv, Cipher, KeySizeError, ptrType, arrayType, sliceType, NewCipher; subtle = $packages["crypto/internal/subtle"]; strconv = $packages["strconv"]; Cipher = $pkg.Cipher = $newType(0, $kindStruct, "rc4.Cipher", true, "crypto/rc4", true, function(s_, i_, j_) { this.$val = this; if (arguments.length === 0) { this.s = arrayType.zero(); this.i = 0; this.j = 0; return; } this.s = s_; this.i = i_; this.j = j_; }); KeySizeError = $pkg.KeySizeError = $newType(4, $kindInt, "rc4.KeySizeError", true, "crypto/rc4", true, null); ptrType = $ptrType(Cipher); arrayType = $arrayType($Uint32, 256); sliceType = $sliceType($Uint8); KeySizeError.prototype.Error = function() { var k; k = this.$val; return "crypto/rc4: invalid key size " + strconv.Itoa(((k >> 0))); }; $ptrType(KeySizeError).prototype.Error = function() { return new KeySizeError(this.$get()).Error(); }; NewCipher = function(key) { var _r, _tmp, _tmp$1, c, i, i$1, j, k, key, x, x$1, x$2, x$3, x$4, x$5, x$6; k = key.$length; if (k < 1 || k > 256) { return [ptrType.nil, new KeySizeError(((k >> 0)))]; } c = new Cipher.ptr(arrayType.zero(), 0, 0); i = 0; while (true) { if (!(i < 256)) { break; } (x = c.s, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i] = ((i >>> 0)))); i = i + (1) >> 0; } j = 0; i$1 = 0; while (true) { if (!(i$1 < 256)) { break; } j = j + (((((x$1 = c.s, ((i$1 < 0 || i$1 >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i$1])) << 24 >>> 24)) + (x$2 = (_r = i$1 % k, _r === _r ? _r : $throwRuntimeError("integer divide by zero")), ((x$2 < 0 || x$2 >= key.$length) ? ($throwRuntimeError("index out of range"), undefined) : key.$array[key.$offset + x$2])) << 24 >>> 24)) << 24 >>> 24; _tmp = (x$3 = c.s, ((j < 0 || j >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[j])); _tmp$1 = (x$4 = c.s, ((i$1 < 0 || i$1 >= x$4.length) ? ($throwRuntimeError("index out of range"), undefined) : x$4[i$1])); (x$5 = c.s, ((i$1 < 0 || i$1 >= x$5.length) ? ($throwRuntimeError("index out of range"), undefined) : x$5[i$1] = _tmp)); (x$6 = c.s, ((j < 0 || j >= x$6.length) ? ($throwRuntimeError("index out of range"), undefined) : x$6[j] = _tmp$1)); i$1 = i$1 + (1) >> 0; } return [c, $ifaceNil]; }; $pkg.NewCipher = NewCipher; Cipher.ptr.prototype.Reset = function() { var _i, _ref, _tmp, _tmp$1, c, i, x; c = this; _ref = c.s; _i = 0; while (true) { if (!(_i < 256)) { break; } i = _i; (x = c.s, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i] = 0)); _i++; } _tmp = 0; _tmp$1 = 0; c.i = _tmp; c.j = _tmp$1; }; Cipher.prototype.Reset = function() { return this.$val.Reset(); }; Cipher.ptr.prototype.XORKeyStream = function(dst, src) { var _i, _ref, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, c, dst, i, j, k, src, v, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, y; c = this; if (src.$length === 0) { return; } if (subtle.InexactOverlap($subslice(dst, 0, src.$length), src)) { $panic(new $String("crypto/rc4: invalid buffer overlap")); } _tmp = c.i; _tmp$1 = c.j; i = _tmp; j = _tmp$1; $unused((x = src.$length - 1 >> 0, ((x < 0 || x >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + x]))); dst = $subslice(dst, 0, src.$length); _ref = src; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } k = _i; v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); i = i + (1) << 24 >>> 24; x$2 = (x$1 = c.s, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i])); j = j + (((x$2 << 24 >>> 24))) << 24 >>> 24; y = (x$3 = c.s, ((j < 0 || j >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[j])); _tmp$2 = y; _tmp$3 = x$2; (x$4 = c.s, ((i < 0 || i >= x$4.length) ? ($throwRuntimeError("index out of range"), undefined) : x$4[i] = _tmp$2)); (x$5 = c.s, ((j < 0 || j >= x$5.length) ? ($throwRuntimeError("index out of range"), undefined) : x$5[j] = _tmp$3)); ((k < 0 || k >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + k] = ((v ^ (((x$6 = c.s, x$7 = (((x$2 + y >>> 0) << 24 >>> 24)), ((x$7 < 0 || x$7 >= x$6.length) ? ($throwRuntimeError("index out of range"), undefined) : x$6[x$7])) << 24 >>> 24))) << 24 >>> 24)); _i++; } _tmp$4 = i; _tmp$5 = j; c.i = _tmp$4; c.j = _tmp$5; }; Cipher.prototype.XORKeyStream = function(dst, src) { return this.$val.XORKeyStream(dst, src); }; ptrType.methods = [{prop: "Reset", name: "Reset", pkg: "", typ: $funcType([], [], false)}, {prop: "XORKeyStream", name: "XORKeyStream", pkg: "", typ: $funcType([sliceType, sliceType], [], false)}]; KeySizeError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; Cipher.init("crypto/rc4", [{prop: "s", name: "s", embedded: false, exported: false, typ: arrayType, tag: ""}, {prop: "i", name: "i", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "j", name: "j", embedded: false, exported: false, 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: $r = subtle.$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; } /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["crypto/rsa"] = (function() { var $pkg = {}, $init, bytes, crypto, randutil, rand, subtle, errors, hash, io, math, big, PublicKey, OAEPOptions, PrivateKey, PrecomputedValues, CRTValue, PSSOptions, PKCS1v15DecryptOptions, sliceType, ptrType, ptrType$1, ptrType$2, ptrType$3, ptrType$4, ptrType$5, sliceType$1, sliceType$2, arrayType, arrayType$1, bigZero, bigOne, errPublicModulus, errPublicExponentSmall, errPublicExponentLarge, hashPrefixes, checkPub, incCounter, mgf1XOR, encrypt, decrypt, decryptAndCheck, DecryptOAEP, emsaPSSEncode, emsaPSSVerify, signPSSWithSalt, SignPSS, VerifyPSS, EncryptPKCS1v15, DecryptPKCS1v15, DecryptPKCS1v15SessionKey, decryptPKCS1v15, nonZeroRandomBytes, SignPKCS1v15, VerifyPKCS1v15, pkcs1v15HashInfo; bytes = $packages["bytes"]; crypto = $packages["crypto"]; randutil = $packages["crypto/internal/randutil"]; rand = $packages["crypto/rand"]; subtle = $packages["crypto/subtle"]; errors = $packages["errors"]; hash = $packages["hash"]; io = $packages["io"]; math = $packages["math"]; big = $packages["math/big"]; PublicKey = $pkg.PublicKey = $newType(0, $kindStruct, "rsa.PublicKey", true, "crypto/rsa", true, function(N_, E_) { this.$val = this; if (arguments.length === 0) { this.N = ptrType$1.nil; this.E = 0; return; } this.N = N_; this.E = E_; }); OAEPOptions = $pkg.OAEPOptions = $newType(0, $kindStruct, "rsa.OAEPOptions", true, "crypto/rsa", true, function(Hash_, Label_) { this.$val = this; if (arguments.length === 0) { this.Hash = 0; this.Label = sliceType.nil; return; } this.Hash = Hash_; this.Label = Label_; }); PrivateKey = $pkg.PrivateKey = $newType(0, $kindStruct, "rsa.PrivateKey", true, "crypto/rsa", true, function(PublicKey_, D_, Primes_, Precomputed_) { this.$val = this; if (arguments.length === 0) { this.PublicKey = new PublicKey.ptr(ptrType$1.nil, 0); this.D = ptrType$1.nil; this.Primes = sliceType$1.nil; this.Precomputed = new PrecomputedValues.ptr(ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, sliceType$2.nil); return; } this.PublicKey = PublicKey_; this.D = D_; this.Primes = Primes_; this.Precomputed = Precomputed_; }); PrecomputedValues = $pkg.PrecomputedValues = $newType(0, $kindStruct, "rsa.PrecomputedValues", true, "crypto/rsa", true, function(Dp_, Dq_, Qinv_, CRTValues_) { this.$val = this; if (arguments.length === 0) { this.Dp = ptrType$1.nil; this.Dq = ptrType$1.nil; this.Qinv = ptrType$1.nil; this.CRTValues = sliceType$2.nil; return; } this.Dp = Dp_; this.Dq = Dq_; this.Qinv = Qinv_; this.CRTValues = CRTValues_; }); CRTValue = $pkg.CRTValue = $newType(0, $kindStruct, "rsa.CRTValue", true, "crypto/rsa", true, function(Exp_, Coeff_, R_) { this.$val = this; if (arguments.length === 0) { this.Exp = ptrType$1.nil; this.Coeff = ptrType$1.nil; this.R = ptrType$1.nil; return; } this.Exp = Exp_; this.Coeff = Coeff_; this.R = R_; }); PSSOptions = $pkg.PSSOptions = $newType(0, $kindStruct, "rsa.PSSOptions", true, "crypto/rsa", true, function(SaltLength_, Hash_) { this.$val = this; if (arguments.length === 0) { this.SaltLength = 0; this.Hash = 0; return; } this.SaltLength = SaltLength_; this.Hash = Hash_; }); PKCS1v15DecryptOptions = $pkg.PKCS1v15DecryptOptions = $newType(0, $kindStruct, "rsa.PKCS1v15DecryptOptions", true, "crypto/rsa", true, function(SessionKeyLen_) { this.$val = this; if (arguments.length === 0) { this.SessionKeyLen = 0; return; } this.SessionKeyLen = SessionKeyLen_; }); sliceType = $sliceType($Uint8); ptrType = $ptrType(PublicKey); ptrType$1 = $ptrType(big.Int); ptrType$2 = $ptrType(PrivateKey); ptrType$3 = $ptrType(PSSOptions); ptrType$4 = $ptrType(OAEPOptions); ptrType$5 = $ptrType(PKCS1v15DecryptOptions); sliceType$1 = $sliceType(ptrType$1); sliceType$2 = $sliceType(CRTValue); arrayType = $arrayType($Uint8, 4); arrayType$1 = $arrayType($Uint8, 8); PublicKey.ptr.prototype.Size = function() { var _q, pub; pub = this; return (_q = ((pub.N.BitLen() + 7 >> 0)) / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); }; PublicKey.prototype.Size = function() { return this.$val.Size(); }; PublicKey.ptr.prototype.Equal = function(x) { var _tuple, ok, pub, x, xx; pub = this; _tuple = $assertType(x, ptrType, true); xx = _tuple[0]; ok = _tuple[1]; if (!ok) { return false; } return (pub.N.Cmp(xx.N) === 0) && (pub.E === xx.E); }; PublicKey.prototype.Equal = function(x) { return this.$val.Equal(x); }; checkPub = function(pub) { var pub; if (pub.N === ptrType$1.nil) { return errPublicModulus; } if (pub.E < 2) { return errPublicExponentSmall; } if (pub.E > 2147483647) { return errPublicExponentLarge; } return $ifaceNil; }; PrivateKey.ptr.prototype.Public = function() { var priv; priv = this; return priv.PublicKey; }; PrivateKey.prototype.Public = function() { return this.$val.Public(); }; PrivateKey.ptr.prototype.Equal = function(x) { var _i, _ref, _tuple, i, ok, priv, x, x$1, x$2, xx; priv = this; _tuple = $assertType(x, ptrType$2, true); xx = _tuple[0]; ok = _tuple[1]; if (!ok) { return false; } if (!priv.PublicKey.Equal(xx.PublicKey) || !((priv.D.Cmp(xx.D) === 0))) { return false; } if (!((priv.Primes.$length === xx.Primes.$length))) { return false; } _ref = priv.Primes; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; if (!(((x$1 = priv.Primes, ((i < 0 || i >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + i])).Cmp((x$2 = xx.Primes, ((i < 0 || i >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + i]))) === 0))) { return false; } _i++; } return true; }; PrivateKey.prototype.Equal = function(x) { return this.$val.Equal(x); }; PrivateKey.ptr.prototype.Sign = function(rand$1, digest, opts) { var $24r, $24r$1, _arg, _arg$1, _arg$2, _arg$3, _r, _r$1, _r$2, _tuple, digest, ok, opts, priv, pssOpts, rand$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; digest = $f.digest; ok = $f.ok; opts = $f.opts; priv = $f.priv; pssOpts = $f.pssOpts; rand$1 = $f.rand$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: priv = this; _tuple = $assertType(opts, ptrType$3, true); pssOpts = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 1; continue; } /* */ $s = 2; continue; /* if (ok) { */ case 1: _r = SignPSS(rand$1, priv, pssOpts.Hash, digest, pssOpts); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 4; case 4: return $24r; /* } */ case 2: _arg = rand$1; _arg$1 = priv; _r$1 = opts.HashFunc(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$2 = _r$1; _arg$3 = digest; _r$2 = SignPKCS1v15(_arg, _arg$1, _arg$2, _arg$3); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r$1 = _r$2; $s = 7; case 7: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: PrivateKey.ptr.prototype.Sign }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.digest = digest; $f.ok = ok; $f.opts = opts; $f.priv = priv; $f.pssOpts = pssOpts; $f.rand$1 = rand$1; $f.$s = $s; $f.$r = $r; return $f; }; PrivateKey.prototype.Sign = function(rand$1, digest, opts) { return this.$val.Sign(rand$1, digest, opts); }; PrivateKey.ptr.prototype.Decrypt = function(rand$1, ciphertext, opts) { var $24r, $24r$1, $24r$2, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _ref, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, _tuple$1, _tuple$2, _tuple$3, ciphertext, err, err$1, err$2, l, opts, opts$1, opts$2, opts$3, plaintext, priv, rand$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$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; _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; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; ciphertext = $f.ciphertext; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; l = $f.l; opts = $f.opts; opts$1 = $f.opts$1; opts$2 = $f.opts$2; opts$3 = $f.opts$3; plaintext = $f.plaintext; priv = $f.priv; rand$1 = $f.rand$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: plaintext = sliceType.nil; err = $ifaceNil; priv = this; /* */ if ($interfaceIsEqual(opts, $ifaceNil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($interfaceIsEqual(opts, $ifaceNil)) { */ case 1: _r = DecryptPKCS1v15(rand$1, priv, ciphertext); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; plaintext = _tuple[0]; err = _tuple[1]; $24r = [plaintext, err]; $s = 4; case 4: return $24r; /* } */ case 2: _ref = opts; /* */ if ($assertType(_ref, ptrType$4, true)[1]) { $s = 5; continue; } /* */ if ($assertType(_ref, ptrType$5, true)[1]) { $s = 6; continue; } /* */ $s = 7; continue; /* if ($assertType(_ref, ptrType$4, true)[1]) { */ case 5: opts$1 = _ref.$val; _r$1 = new crypto.Hash(opts$1.Hash).New(); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = DecryptOAEP(_r$1, rand$1, priv, ciphertext, opts$1.Label); /* */ $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; plaintext = _tuple$1[0]; err = _tuple$1[1]; $24r$1 = [plaintext, err]; $s = 11; case 11: return $24r$1; /* } else if ($assertType(_ref, ptrType$5, true)[1]) { */ case 6: opts$2 = _ref.$val; l = opts$2.SessionKeyLen; /* */ if (l > 0) { $s = 12; continue; } /* */ $s = 13; continue; /* if (l > 0) { */ case 12: plaintext = $makeSlice(sliceType, l); _r$3 = io.ReadFull(rand$1, plaintext); /* */ $s = 15; case 15: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$2 = _r$3; err$1 = _tuple$2[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { _tmp = sliceType.nil; _tmp$1 = err$1; plaintext = _tmp; err = _tmp$1; $s = -1; return [plaintext, err]; } _r$4 = DecryptPKCS1v15SessionKey(rand$1, priv, ciphertext, plaintext); /* */ $s = 16; case 16: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } err$2 = _r$4; if (!($interfaceIsEqual(err$2, $ifaceNil))) { _tmp$2 = sliceType.nil; _tmp$3 = err$2; plaintext = _tmp$2; err = _tmp$3; $s = -1; return [plaintext, err]; } _tmp$4 = plaintext; _tmp$5 = $ifaceNil; plaintext = _tmp$4; err = _tmp$5; $s = -1; return [plaintext, err]; /* } else { */ case 13: _r$5 = DecryptPKCS1v15(rand$1, priv, ciphertext); /* */ $s = 17; case 17: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$3 = _r$5; plaintext = _tuple$3[0]; err = _tuple$3[1]; $24r$2 = [plaintext, err]; $s = 18; case 18: return $24r$2; /* } */ case 14: $s = 8; continue; /* } else { */ case 7: opts$3 = _ref; _tmp$6 = sliceType.nil; _tmp$7 = errors.New("crypto/rsa: invalid options for Decrypt"); plaintext = _tmp$6; err = _tmp$7; $s = -1; return [plaintext, err]; /* } */ case 8: $s = -1; return [plaintext, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: PrivateKey.ptr.prototype.Decrypt }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$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._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._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.ciphertext = ciphertext; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.l = l; $f.opts = opts; $f.opts$1 = opts$1; $f.opts$2 = opts$2; $f.opts$3 = opts$3; $f.plaintext = plaintext; $f.priv = priv; $f.rand$1 = rand$1; $f.$s = $s; $f.$r = $r; return $f; }; PrivateKey.prototype.Decrypt = function(rand$1, ciphertext, opts) { return this.$val.Decrypt(rand$1, ciphertext, opts); }; PrivateKey.ptr.prototype.Validate = function() { var _i, _i$1, _r, _r$1, _r$2, _r$3, _ref, _ref$1, congruence, de, err, modulus, pminus1, prime, prime$1, priv, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; _ref$1 = $f._ref$1; congruence = $f.congruence; de = $f.de; err = $f.err; modulus = $f.modulus; pminus1 = $f.pminus1; prime = $f.prime; prime$1 = $f.prime$1; priv = $f.priv; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: priv = this; err = checkPub(priv.PublicKey); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } modulus = new big.Int.ptr(false, big.nat.nil).Set(bigOne); _ref = priv.Primes; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } prime = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (prime.Cmp(bigOne) <= 0) { $s = -1; return errors.New("crypto/rsa: invalid prime value"); } _r = modulus.Mul(modulus, prime); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; _i++; $s = 1; continue; case 2: if (!((modulus.Cmp(priv.PublicKey.N) === 0))) { $s = -1; return errors.New("crypto/rsa: invalid modulus"); } congruence = new big.Int.ptr(false, big.nat.nil); de = new big.Int.ptr(false, big.nat.nil).SetInt64((new $Int64(0, priv.PublicKey.E))); _r$1 = de.Mul(de, priv.D); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _ref$1 = priv.Primes; _i$1 = 0; /* while (true) { */ case 5: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 6; continue; } prime$1 = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); _r$2 = new big.Int.ptr(false, big.nat.nil).Sub(prime$1, bigOne); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } pminus1 = _r$2; _r$3 = congruence.Mod(de, pminus1); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; if (!((congruence.Cmp(bigOne) === 0))) { $s = -1; return errors.New("crypto/rsa: invalid exponents"); } _i$1++; $s = 5; continue; case 6: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: PrivateKey.ptr.prototype.Validate }; } $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._ref = _ref; $f._ref$1 = _ref$1; $f.congruence = congruence; $f.de = de; $f.err = err; $f.modulus = modulus; $f.pminus1 = pminus1; $f.prime = prime; $f.prime$1 = prime$1; $f.priv = priv; $f.$s = $s; $f.$r = $r; return $f; }; PrivateKey.prototype.Validate = function() { return this.$val.Validate(); }; incCounter = function(c) { var c; c[3] = (c[3] + (1) << 24 >>> 24); if (!((c[3] === 0))) { return; } c[2] = (c[2] + (1) << 24 >>> 24); if (!((c[2] === 0))) { return; } c[1] = (c[1] + (1) << 24 >>> 24); if (!((c[1] === 0))) { return; } c[0] = (c[0] + (1) << 24 >>> 24); }; mgf1XOR = function(out, hash$1, seed) { var _r, _r$1, _r$2, counter, digest, done, hash$1, i, out, seed, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; counter = $f.counter; digest = $f.digest; done = $f.done; hash$1 = $f.hash$1; i = $f.i; out = $f.out; seed = $f.seed; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: counter = [counter]; counter[0] = arrayType.zero(); digest = sliceType.nil; done = 0; /* while (true) { */ case 1: /* if (!(done < out.$length)) { break; } */ if(!(done < out.$length)) { $s = 2; continue; } _r = hash$1.Write(seed); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; _r$1 = hash$1.Write($subslice(new sliceType(counter[0]), 0, 4)); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _r$2 = hash$1.Sum($subslice(digest, 0, 0)); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } digest = _r$2; $r = hash$1.Reset(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i = 0; while (true) { if (!(i < digest.$length && done < out.$length)) { break; } ((done < 0 || done >= out.$length) ? ($throwRuntimeError("index out of range"), undefined) : out.$array[out.$offset + done] = ((((done < 0 || done >= out.$length) ? ($throwRuntimeError("index out of range"), undefined) : out.$array[out.$offset + done]) ^ (((i < 0 || i >= digest.$length) ? ($throwRuntimeError("index out of range"), undefined) : digest.$array[digest.$offset + i]))) << 24 >>> 24)); done = done + (1) >> 0; i = i + (1) >> 0; } incCounter(counter[0]); $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: mgf1XOR }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.counter = counter; $f.digest = digest; $f.done = done; $f.hash$1 = hash$1; $f.i = i; $f.out = out; $f.seed = seed; $f.$s = $s; $f.$r = $r; return $f; }; encrypt = function(c, pub, m) { var _r, c, e, m, pub, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; c = $f.c; e = $f.e; m = $f.m; pub = $f.pub; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = big.NewInt((new $Int64(0, pub.E))); _r = c.Exp(m, e, pub.N); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; $s = -1; return c; /* */ } return; } if ($f === undefined) { $f = { $blk: encrypt }; } $f._r = _r; $f.c = c; $f.e = e; $f.m = m; $f.pub = pub; $f.$s = $s; $f.$r = $r; return $f; }; PrivateKey.ptr.prototype.Precompute = function() { var _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, i, prime, priv, r, values, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; i = $f.i; prime = $f.prime; priv = $f.priv; r = $f.r; values = $f.values; 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; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: priv = this; if (!(priv.Precomputed.Dp === ptrType$1.nil)) { $s = -1; return; } _r = new big.Int.ptr(false, big.nat.nil).Sub((x = priv.Primes, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])), bigOne); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } priv.Precomputed.Dp = _r; _r$1 = priv.Precomputed.Dp.Mod(priv.D, priv.Precomputed.Dp); /* */ $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$2 = new big.Int.ptr(false, big.nat.nil).Sub((x$1 = priv.Primes, (1 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 1])), bigOne); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } priv.Precomputed.Dq = _r$2; _r$3 = priv.Precomputed.Dq.Mod(priv.D, priv.Precomputed.Dq); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _r$4 = new big.Int.ptr(false, big.nat.nil).ModInverse((x$2 = priv.Primes, (1 >= x$2.$length ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + 1])), (x$3 = priv.Primes, (0 >= x$3.$length ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + 0]))); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } priv.Precomputed.Qinv = _r$4; _r$5 = new big.Int.ptr(false, big.nat.nil).Mul((x$4 = priv.Primes, (0 >= x$4.$length ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + 0])), (x$5 = priv.Primes, (1 >= x$5.$length ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + 1]))); /* */ $s = 6; case 6: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } r = _r$5; priv.Precomputed.CRTValues = $makeSlice(sliceType$2, (priv.Primes.$length - 2 >> 0)); i = 2; /* while (true) { */ case 7: /* if (!(i < priv.Primes.$length)) { break; } */ if(!(i < priv.Primes.$length)) { $s = 8; continue; } prime = (x$6 = priv.Primes, ((i < 0 || i >= x$6.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$6.$array[x$6.$offset + i])); values = (x$7 = priv.Precomputed.CRTValues, x$8 = i - 2 >> 0, ((x$8 < 0 || x$8 >= x$7.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$7.$array[x$7.$offset + x$8])); _r$6 = new big.Int.ptr(false, big.nat.nil).Sub(prime, bigOne); /* */ $s = 9; case 9: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } values.Exp = _r$6; _r$7 = values.Exp.Mod(priv.D, values.Exp); /* */ $s = 10; case 10: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$7; values.R = new big.Int.ptr(false, big.nat.nil).Set(r); _r$8 = new big.Int.ptr(false, big.nat.nil).ModInverse(r, prime); /* */ $s = 11; case 11: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } values.Coeff = _r$8; _r$9 = r.Mul(r, prime); /* */ $s = 12; case 12: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$9; i = i + (1) >> 0; $s = 7; continue; case 8: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: PrivateKey.ptr.prototype.Precompute }; } $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.i = i; $f.prime = prime; $f.priv = priv; $f.r = r; $f.values = values; $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.$s = $s; $f.$r = $r; return $f; }; PrivateKey.prototype.Precompute = function() { return this.$val.Precompute(); }; decrypt = function(random, priv, c) { var _i, _r, _r$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$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _tmp, _tmp$1, _tuple, bigE, c, cCopy, err, i, ir, m, m2, ok, prime, priv, r, random, rpowe, values, x, x$1, x$2, x$3, x$4, x$5, x$6, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _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$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$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; _tuple = $f._tuple; bigE = $f.bigE; c = $f.c; cCopy = $f.cCopy; err = $f.err; i = $f.i; ir = $f.ir; m = $f.m; m2 = $f.m2; ok = $f.ok; prime = $f.prime; priv = $f.priv; r = $f.r; random = $f.random; rpowe = $f.rpowe; values = $f.values; 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; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: m = ptrType$1.nil; err = $ifaceNil; if (c.Cmp(priv.PublicKey.N) > 0) { err = $pkg.ErrDecryption; $s = -1; return [m, err]; } if (priv.PublicKey.N.Sign() === 0) { _tmp = ptrType$1.nil; _tmp$1 = $pkg.ErrDecryption; m = _tmp; err = _tmp$1; $s = -1; return [m, err]; } ir = ptrType$1.nil; /* */ if (!($interfaceIsEqual(random, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(random, $ifaceNil))) { */ case 1: $r = randutil.MaybeReadByte(random); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } r = ptrType$1.nil; ir = new big.Int.ptr(false, big.nat.nil); /* while (true) { */ case 4: _r = rand.Int(random, priv.PublicKey.N); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; r = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [m, err]; } if (r.Cmp(bigZero) === 0) { r = bigOne; } _r$1 = ir.ModInverse(r, priv.PublicKey.N); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } ok = _r$1; if (!(ok === ptrType$1.nil)) { /* break; */ $s = 5; continue; } $s = 4; continue; case 5: bigE = big.NewInt((new $Int64(0, priv.PublicKey.E))); _r$2 = new big.Int.ptr(false, big.nat.nil).Exp(r, bigE, priv.PublicKey.N); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } rpowe = _r$2; cCopy = new big.Int.ptr(false, big.nat.nil).Set(c); _r$3 = cCopy.Mul(cCopy, rpowe); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _r$4 = cCopy.Mod(cCopy, priv.PublicKey.N); /* */ $s = 10; case 10: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; c = cCopy; /* } */ case 2: /* */ if (priv.Precomputed.Dp === ptrType$1.nil) { $s = 11; continue; } /* */ $s = 12; continue; /* if (priv.Precomputed.Dp === ptrType$1.nil) { */ case 11: _r$5 = new big.Int.ptr(false, big.nat.nil).Exp(c, priv.D, priv.PublicKey.N); /* */ $s = 14; case 14: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } m = _r$5; $s = 13; continue; /* } else { */ case 12: _r$6 = new big.Int.ptr(false, big.nat.nil).Exp(c, priv.Precomputed.Dp, (x = priv.Primes, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0]))); /* */ $s = 15; case 15: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } m = _r$6; _r$7 = new big.Int.ptr(false, big.nat.nil).Exp(c, priv.Precomputed.Dq, (x$1 = priv.Primes, (1 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 1]))); /* */ $s = 16; case 16: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } m2 = _r$7; _r$8 = m.Sub(m, m2); /* */ $s = 17; case 17: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$8; /* */ if (m.Sign() < 0) { $s = 18; continue; } /* */ $s = 19; continue; /* if (m.Sign() < 0) { */ case 18: _r$9 = m.Add(m, (x$2 = priv.Primes, (0 >= x$2.$length ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + 0]))); /* */ $s = 20; case 20: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$9; /* } */ case 19: _r$10 = m.Mul(m, priv.Precomputed.Qinv); /* */ $s = 21; case 21: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; _r$11 = m.Mod(m, (x$3 = priv.Primes, (0 >= x$3.$length ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + 0]))); /* */ $s = 22; case 22: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _r$11; _r$12 = m.Mul(m, (x$4 = priv.Primes, (1 >= x$4.$length ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + 1]))); /* */ $s = 23; case 23: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _r$12; _r$13 = m.Add(m, m2); /* */ $s = 24; case 24: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _r$13; _ref = priv.Precomputed.CRTValues; _i = 0; /* while (true) { */ case 25: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 26; continue; } i = _i; values = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), CRTValue); prime = (x$5 = priv.Primes, x$6 = 2 + i >> 0, ((x$6 < 0 || x$6 >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + x$6])); _r$14 = m2.Exp(c, values.Exp, prime); /* */ $s = 27; case 27: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _r$14; _r$15 = m2.Sub(m2, m); /* */ $s = 28; case 28: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _r$15; _r$16 = m2.Mul(m2, values.Coeff); /* */ $s = 29; case 29: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _r$16; _r$17 = m2.Mod(m2, prime); /* */ $s = 30; case 30: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } _r$17; /* */ if (m2.Sign() < 0) { $s = 31; continue; } /* */ $s = 32; continue; /* if (m2.Sign() < 0) { */ case 31: _r$18 = m2.Add(m2, prime); /* */ $s = 33; case 33: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } _r$18; /* } */ case 32: _r$19 = m2.Mul(m2, values.R); /* */ $s = 34; case 34: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } _r$19; _r$20 = m.Add(m, m2); /* */ $s = 35; case 35: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } _r$20; _i++; $s = 25; continue; case 26: /* } */ case 13: /* */ if (!(ir === ptrType$1.nil)) { $s = 36; continue; } /* */ $s = 37; continue; /* if (!(ir === ptrType$1.nil)) { */ case 36: _r$21 = m.Mul(m, ir); /* */ $s = 38; case 38: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } _r$21; _r$22 = m.Mod(m, priv.PublicKey.N); /* */ $s = 39; case 39: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; } _r$22; /* } */ case 37: $s = -1; return [m, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: decrypt }; } $f._i = _i; $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$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$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._tuple = _tuple; $f.bigE = bigE; $f.c = c; $f.cCopy = cCopy; $f.err = err; $f.i = i; $f.ir = ir; $f.m = m; $f.m2 = m2; $f.ok = ok; $f.prime = prime; $f.priv = priv; $f.r = r; $f.random = random; $f.rpowe = rpowe; $f.values = values; $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.$s = $s; $f.$r = $r; return $f; }; decryptAndCheck = function(random, priv, c) { var _r, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, c, check, err, m, priv, random, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$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 = $f._tuple; c = $f.c; check = $f.check; err = $f.err; m = $f.m; priv = $f.priv; random = $f.random; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: m = ptrType$1.nil; err = $ifaceNil; _r = decrypt(random, priv, c); /* */ $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 (!($interfaceIsEqual(err, $ifaceNil))) { _tmp = ptrType$1.nil; _tmp$1 = err; m = _tmp; err = _tmp$1; $s = -1; return [m, err]; } _r$1 = encrypt(new big.Int.ptr(false, big.nat.nil), priv.PublicKey, m); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } check = _r$1; if (!((c.Cmp(check) === 0))) { _tmp$2 = ptrType$1.nil; _tmp$3 = errors.New("rsa: internal error"); m = _tmp$2; err = _tmp$3; $s = -1; return [m, err]; } _tmp$4 = m; _tmp$5 = $ifaceNil; m = _tmp$4; err = _tmp$5; $s = -1; return [m, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: decryptAndCheck }; } $f._r = _r; $f._r$1 = _r$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 = _tuple; $f.c = c; $f.check = check; $f.err = err; $f.m = m; $f.priv = priv; $f.random = random; $f.$s = $s; $f.$r = $r; return $f; }; DecryptOAEP = function(hash$1, random, priv, ciphertext, label) { var _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _tmp, _tmp$1, _tmp$2, _tuple, _v, c, ciphertext, db, em, equals0, equals1, err, err$1, firstByteIsZero, hash$1, i, index, invalid, k, lHash, lHash2, lHash2Good, label, lookingForIndex, m, priv, random, rest, seed, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; _tuple = $f._tuple; _v = $f._v; c = $f.c; ciphertext = $f.ciphertext; db = $f.db; em = $f.em; equals0 = $f.equals0; equals1 = $f.equals1; err = $f.err; err$1 = $f.err$1; firstByteIsZero = $f.firstByteIsZero; hash$1 = $f.hash$1; i = $f.i; index = $f.index; invalid = $f.invalid; k = $f.k; lHash = $f.lHash; lHash2 = $f.lHash2; lHash2Good = $f.lHash2Good; label = $f.label; lookingForIndex = $f.lookingForIndex; m = $f.m; priv = $f.priv; random = $f.random; rest = $f.rest; seed = $f.seed; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = checkPub(priv.PublicKey); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType.nil, err]; } k = priv.PublicKey.Size(); if (ciphertext.$length > k) { _v = true; $s = 3; continue s; } _r = hash$1.Size(); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _v = k < (($imul(_r, 2)) + 2 >> 0); case 3: /* */ if (_v) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v) { */ case 1: $s = -1; return [sliceType.nil, $pkg.ErrDecryption]; /* } */ case 2: c = new big.Int.ptr(false, big.nat.nil).SetBytes(ciphertext); _r$1 = decrypt(random, priv, c); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; m = _tuple[0]; err$1 = _tuple[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [sliceType.nil, err$1]; } _r$2 = hash$1.Write(label); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; _r$3 = hash$1.Sum(sliceType.nil); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } lHash = _r$3; $r = hash$1.Reset(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } em = m.FillBytes($makeSlice(sliceType, k)); firstByteIsZero = subtle.ConstantTimeByteEq((0 >= em.$length ? ($throwRuntimeError("index out of range"), undefined) : em.$array[em.$offset + 0]), 0); _r$4 = hash$1.Size(); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } seed = $subslice(em, 1, (_r$4 + 1 >> 0)); _r$5 = hash$1.Size(); /* */ $s = 10; case 10: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } db = $subslice(em, (_r$5 + 1 >> 0)); $r = mgf1XOR(seed, hash$1, db); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = mgf1XOR(db, hash$1, seed); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$6 = hash$1.Size(); /* */ $s = 13; case 13: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } lHash2 = $subslice(db, 0, _r$6); lHash2Good = subtle.ConstantTimeCompare(lHash, lHash2); _tmp = 0; _tmp$1 = 0; _tmp$2 = 0; lookingForIndex = _tmp; index = _tmp$1; invalid = _tmp$2; lookingForIndex = 1; _r$7 = hash$1.Size(); /* */ $s = 14; case 14: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } rest = $subslice(db, _r$7); i = 0; while (true) { if (!(i < rest.$length)) { break; } equals0 = subtle.ConstantTimeByteEq(((i < 0 || i >= rest.$length) ? ($throwRuntimeError("index out of range"), undefined) : rest.$array[rest.$offset + i]), 0); equals1 = subtle.ConstantTimeByteEq(((i < 0 || i >= rest.$length) ? ($throwRuntimeError("index out of range"), undefined) : rest.$array[rest.$offset + i]), 1); index = subtle.ConstantTimeSelect(lookingForIndex & equals1, i, index); lookingForIndex = subtle.ConstantTimeSelect(equals1, 0, lookingForIndex); invalid = subtle.ConstantTimeSelect((lookingForIndex & ~equals0) >> 0, 1, invalid); i = i + (1) >> 0; } if (!(((((((firstByteIsZero & lHash2Good) & ~invalid) >> 0) & ~lookingForIndex) >> 0) === 1))) { $s = -1; return [sliceType.nil, $pkg.ErrDecryption]; } $s = -1; return [$subslice(rest, (index + 1 >> 0)), $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: DecryptOAEP }; } $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._tuple = _tuple; $f._v = _v; $f.c = c; $f.ciphertext = ciphertext; $f.db = db; $f.em = em; $f.equals0 = equals0; $f.equals1 = equals1; $f.err = err; $f.err$1 = err$1; $f.firstByteIsZero = firstByteIsZero; $f.hash$1 = hash$1; $f.i = i; $f.index = index; $f.invalid = invalid; $f.k = k; $f.lHash = lHash; $f.lHash2 = lHash2; $f.lHash2Good = lHash2Good; $f.label = label; $f.lookingForIndex = lookingForIndex; $f.m = m; $f.priv = priv; $f.random = random; $f.rest = rest; $f.seed = seed; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.DecryptOAEP = DecryptOAEP; emsaPSSEncode = function(mHash, emBits, salt, hash$1) { var _q, _r, _r$1, _r$2, _r$3, _r$4, db, em, emBits, emLen, h, hLen, hash$1, mHash, prefix, psLen, sLen, salt, x, y, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _q = $f._q; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; db = $f.db; em = $f.em; emBits = $f.emBits; emLen = $f.emLen; h = $f.h; hLen = $f.hLen; hash$1 = $f.hash$1; mHash = $f.mHash; prefix = $f.prefix; psLen = $f.psLen; sLen = $f.sLen; salt = $f.salt; x = $f.x; y = $f.y; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = hash$1.Size(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } hLen = _r; sLen = salt.$length; emLen = (_q = ((emBits + 7 >> 0)) / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); if (!((mHash.$length === hLen))) { $s = -1; return [sliceType.nil, errors.New("crypto/rsa: input must be hashed with given hash")]; } if (emLen < ((hLen + sLen >> 0) + 2 >> 0)) { $s = -1; return [sliceType.nil, errors.New("crypto/rsa: key size too small for PSS signature")]; } em = $makeSlice(sliceType, emLen); psLen = ((emLen - sLen >> 0) - hLen >> 0) - 2 >> 0; db = $subslice(em, 0, ((psLen + 1 >> 0) + sLen >> 0)); h = $subslice(em, ((psLen + 1 >> 0) + sLen >> 0), (emLen - 1 >> 0)); prefix = arrayType$1.zero(); _r$1 = hash$1.Write(new sliceType(prefix)); /* */ $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$2 = hash$1.Write(mHash); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; _r$3 = hash$1.Write(salt); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _r$4 = hash$1.Sum($subslice(h, 0, 0)); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } h = _r$4; $r = hash$1.Reset(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } ((psLen < 0 || psLen >= db.$length) ? ($throwRuntimeError("index out of range"), undefined) : db.$array[db.$offset + psLen] = 1); $copySlice($subslice(db, (psLen + 1 >> 0)), salt); $r = mgf1XOR(db, hash$1, h); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } (0 >= db.$length ? ($throwRuntimeError("index out of range"), undefined) : db.$array[db.$offset + 0] = (((0 >= db.$length ? ($throwRuntimeError("index out of range"), undefined) : db.$array[db.$offset + 0]) & (((y = ((($imul(8, emLen)) - emBits >> 0)), y < 32 ? (255 >>> y) : 0) << 24 >>> 24))) >>> 0)); (x = emLen - 1 >> 0, ((x < 0 || x >= em.$length) ? ($throwRuntimeError("index out of range"), undefined) : em.$array[em.$offset + x] = 188)); $s = -1; return [em, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: emsaPSSEncode }; } $f._q = _q; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.db = db; $f.em = em; $f.emBits = emBits; $f.emLen = emLen; $f.h = h; $f.hLen = hLen; $f.hash$1 = hash$1; $f.mHash = mHash; $f.prefix = prefix; $f.psLen = psLen; $f.sLen = sLen; $f.salt = salt; $f.x = x; $f.y = y; $f.$s = $s; $f.$r = $r; return $f; }; emsaPSSVerify = function(mHash, em, emBits, sLen, hash$1) { var _i, _q, _r, _r$1, _r$2, _r$3, _r$4, _ref, bitMask, db, e, em, emBits, emLen, h, h0, hLen, hash$1, mHash, prefix, psLen, psLen$1, sLen, salt, x, y, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _q = $f._q; _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; bitMask = $f.bitMask; db = $f.db; e = $f.e; em = $f.em; emBits = $f.emBits; emLen = $f.emLen; h = $f.h; h0 = $f.h0; hLen = $f.hLen; hash$1 = $f.hash$1; mHash = $f.mHash; prefix = $f.prefix; psLen = $f.psLen; psLen$1 = $f.psLen$1; sLen = $f.sLen; salt = $f.salt; x = $f.x; y = $f.y; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = hash$1.Size(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } hLen = _r; if (sLen === -1) { sLen = hLen; } emLen = (_q = ((emBits + 7 >> 0)) / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); if (!((emLen === em.$length))) { $s = -1; return errors.New("rsa: internal error: inconsistent length"); } if (!((hLen === mHash.$length))) { $s = -1; return $pkg.ErrVerification; } if (emLen < ((hLen + sLen >> 0) + 2 >> 0)) { $s = -1; return $pkg.ErrVerification; } if (!(((x = emLen - 1 >> 0, ((x < 0 || x >= em.$length) ? ($throwRuntimeError("index out of range"), undefined) : em.$array[em.$offset + x])) === 188))) { $s = -1; return $pkg.ErrVerification; } db = $subslice(em, 0, ((emLen - hLen >> 0) - 1 >> 0)); h = $subslice(em, ((emLen - hLen >> 0) - 1 >> 0), (emLen - 1 >> 0)); bitMask = (y = ((($imul(8, emLen)) - emBits >> 0)), y < 32 ? (255 >>> y) : 0) << 24 >>> 24; if (!(((((0 >= em.$length ? ($throwRuntimeError("index out of range"), undefined) : em.$array[em.$offset + 0]) & (~bitMask << 24 >>> 24)) >>> 0) === 0))) { $s = -1; return $pkg.ErrVerification; } $r = mgf1XOR(db, hash$1, h); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } (0 >= db.$length ? ($throwRuntimeError("index out of range"), undefined) : db.$array[db.$offset + 0] = (((0 >= db.$length ? ($throwRuntimeError("index out of range"), undefined) : db.$array[db.$offset + 0]) & (bitMask)) >>> 0)); if (sLen === 0) { psLen = bytes.IndexByte(db, 1); if (psLen < 0) { $s = -1; return $pkg.ErrVerification; } sLen = (db.$length - psLen >> 0) - 1 >> 0; } psLen$1 = ((emLen - hLen >> 0) - sLen >> 0) - 2 >> 0; _ref = $subslice(db, 0, psLen$1); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } e = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (!((e === 0))) { $s = -1; return $pkg.ErrVerification; } _i++; } if (!((((psLen$1 < 0 || psLen$1 >= db.$length) ? ($throwRuntimeError("index out of range"), undefined) : db.$array[db.$offset + psLen$1]) === 1))) { $s = -1; return $pkg.ErrVerification; } salt = $subslice(db, (db.$length - sLen >> 0)); prefix = arrayType$1.zero(); _r$1 = hash$1.Write(new sliceType(prefix)); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _r$2 = hash$1.Write(mHash); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; _r$3 = hash$1.Write(salt); /* */ $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 = hash$1.Sum(sliceType.nil); /* */ $s = 6; case 6: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } h0 = _r$4; if (!bytes.Equal(h0, h)) { $s = -1; return $pkg.ErrVerification; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: emsaPSSVerify }; } $f._i = _i; $f._q = _q; $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.bitMask = bitMask; $f.db = db; $f.e = e; $f.em = em; $f.emBits = emBits; $f.emLen = emLen; $f.h = h; $f.h0 = h0; $f.hLen = hLen; $f.hash$1 = hash$1; $f.mHash = mHash; $f.prefix = prefix; $f.psLen = psLen; $f.psLen$1 = psLen$1; $f.sLen = sLen; $f.salt = salt; $f.x = x; $f.y = y; $f.$s = $s; $f.$r = $r; return $f; }; signPSSWithSalt = function(rand$1, priv, hash$1, hashed, salt) { var _arg, _arg$1, _arg$2, _arg$3, _r, _r$1, _r$2, _tuple, _tuple$1, c, em, emBits, err, hash$1, hashed, m, priv, rand$1, s, salt, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; c = $f.c; em = $f.em; emBits = $f.emBits; err = $f.err; hash$1 = $f.hash$1; hashed = $f.hashed; m = $f.m; priv = $f.priv; rand$1 = $f.rand$1; s = $f.s; salt = $f.salt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: emBits = priv.PublicKey.N.BitLen() - 1 >> 0; _arg = hashed; _arg$1 = emBits; _arg$2 = salt; _r = new crypto.Hash(hash$1).New(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$3 = _r; _r$1 = emsaPSSEncode(_arg, _arg$1, _arg$2, _arg$3); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; em = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType.nil, err]; } m = new big.Int.ptr(false, big.nat.nil).SetBytes(em); _r$2 = decryptAndCheck(rand$1, priv, m); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; c = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType.nil, err]; } s = $makeSlice(sliceType, priv.PublicKey.Size()); $s = -1; return [c.FillBytes(s), $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: signPSSWithSalt }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.c = c; $f.em = em; $f.emBits = emBits; $f.err = err; $f.hash$1 = hash$1; $f.hashed = hashed; $f.m = m; $f.priv = priv; $f.rand$1 = rand$1; $f.s = s; $f.salt = salt; $f.$s = $s; $f.$r = $r; return $f; }; PSSOptions.ptr.prototype.HashFunc = function() { var opts; opts = this; return opts.Hash; }; PSSOptions.prototype.HashFunc = function() { return this.$val.HashFunc(); }; PSSOptions.ptr.prototype.saltLength = function() { var opts; opts = this; if (opts === ptrType$3.nil) { return 0; } return opts.SaltLength; }; PSSOptions.prototype.saltLength = function() { return this.$val.saltLength(); }; SignPSS = function(rand$1, priv, hash$1, digest, opts) { var $24r, _1, _q, _r, _r$1, _tuple, digest, err, hash$1, opts, priv, rand$1, salt, saltLength, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _1 = $f._1; _q = $f._q; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; digest = $f.digest; err = $f.err; hash$1 = $f.hash$1; opts = $f.opts; priv = $f.priv; rand$1 = $f.rand$1; salt = $f.salt; saltLength = $f.saltLength; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (!(opts === ptrType$3.nil) && !((opts.Hash === 0))) { hash$1 = opts.Hash; } saltLength = opts.saltLength(); _1 = saltLength; if (_1 === (0)) { saltLength = ((_q = (((priv.PublicKey.N.BitLen() - 1 >> 0) + 7 >> 0)) / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) - 2 >> 0) - new crypto.Hash(hash$1).Size() >> 0; } else if (_1 === (-1)) { saltLength = new crypto.Hash(hash$1).Size(); } salt = $makeSlice(sliceType, saltLength); _r = io.ReadFull(rand$1, salt); /* */ $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))) { $s = -1; return [sliceType.nil, err]; } _r$1 = signPSSWithSalt(rand$1, priv, hash$1, digest, salt); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: SignPSS }; } $f.$24r = $24r; $f._1 = _1; $f._q = _q; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.digest = digest; $f.err = err; $f.hash$1 = hash$1; $f.opts = opts; $f.priv = priv; $f.rand$1 = rand$1; $f.salt = salt; $f.saltLength = saltLength; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.SignPSS = SignPSS; VerifyPSS = function(pub, hash$1, digest, sig, opts) { var $24r, _arg, _arg$1, _arg$2, _arg$3, _arg$4, _q, _r, _r$1, _r$2, digest, em, emBits, emLen, hash$1, m, opts, pub, s, sig, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _arg$4 = $f._arg$4; _q = $f._q; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; digest = $f.digest; em = $f.em; emBits = $f.emBits; emLen = $f.emLen; hash$1 = $f.hash$1; m = $f.m; opts = $f.opts; pub = $f.pub; s = $f.s; sig = $f.sig; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (!((sig.$length === pub.Size()))) { $s = -1; return $pkg.ErrVerification; } s = new big.Int.ptr(false, big.nat.nil).SetBytes(sig); _r = encrypt(new big.Int.ptr(false, big.nat.nil), pub, s); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } m = _r; emBits = pub.N.BitLen() - 1 >> 0; emLen = (_q = ((emBits + 7 >> 0)) / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); if (m.BitLen() > ($imul(emLen, 8))) { $s = -1; return $pkg.ErrVerification; } em = m.FillBytes($makeSlice(sliceType, emLen)); _arg = digest; _arg$1 = em; _arg$2 = emBits; _arg$3 = opts.saltLength(); _r$1 = new crypto.Hash(hash$1).New(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$4 = _r$1; _r$2 = emsaPSSVerify(_arg, _arg$1, _arg$2, _arg$3, _arg$4); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 4; case 4: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: VerifyPSS }; } $f.$24r = $24r; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._arg$4 = _arg$4; $f._q = _q; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.digest = digest; $f.em = em; $f.emBits = emBits; $f.emLen = emLen; $f.hash$1 = hash$1; $f.m = m; $f.opts = opts; $f.pub = pub; $f.s = s; $f.sig = sig; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.VerifyPSS = VerifyPSS; EncryptPKCS1v15 = function(rand$1, pub, msg) { var _r, _r$1, _tmp, _tmp$1, c, em, err, err$1, k, m, mm, msg, ps, pub, rand$1, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; c = $f.c; em = $f.em; err = $f.err; err$1 = $f.err$1; k = $f.k; m = $f.m; mm = $f.mm; msg = $f.msg; ps = $f.ps; pub = $f.pub; rand$1 = $f.rand$1; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = randutil.MaybeReadByte(rand$1); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } err = checkPub(pub); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType.nil, err]; } k = pub.Size(); if (msg.$length > (k - 11 >> 0)) { $s = -1; return [sliceType.nil, $pkg.ErrMessageTooLong]; } em = $makeSlice(sliceType, k); (1 >= em.$length ? ($throwRuntimeError("index out of range"), undefined) : em.$array[em.$offset + 1] = 2); _tmp = $subslice(em, 2, ((em.$length - msg.$length >> 0) - 1 >> 0)); _tmp$1 = $subslice(em, (em.$length - msg.$length >> 0)); ps = _tmp; mm = _tmp$1; _r = nonZeroRandomBytes(ps, rand$1); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err$1 = _r; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [sliceType.nil, err$1]; } (x = (em.$length - msg.$length >> 0) - 1 >> 0, ((x < 0 || x >= em.$length) ? ($throwRuntimeError("index out of range"), undefined) : em.$array[em.$offset + x] = 0)); $copySlice(mm, msg); m = new big.Int.ptr(false, big.nat.nil).SetBytes(em); _r$1 = encrypt(new big.Int.ptr(false, big.nat.nil), pub, m); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } c = _r$1; $s = -1; return [c.FillBytes(em), $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: EncryptPKCS1v15 }; } $f._r = _r; $f._r$1 = _r$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.c = c; $f.em = em; $f.err = err; $f.err$1 = err$1; $f.k = k; $f.m = m; $f.mm = mm; $f.msg = msg; $f.ps = ps; $f.pub = pub; $f.rand$1 = rand$1; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.EncryptPKCS1v15 = EncryptPKCS1v15; DecryptPKCS1v15 = function(rand$1, priv, ciphertext) { var _r, _tuple, ciphertext, err, err$1, index, out, priv, rand$1, valid, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; ciphertext = $f.ciphertext; err = $f.err; err$1 = $f.err$1; index = $f.index; out = $f.out; priv = $f.priv; rand$1 = $f.rand$1; valid = $f.valid; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = checkPub(priv.PublicKey); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType.nil, err]; } _r = decryptPKCS1v15(rand$1, priv, ciphertext); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; valid = _tuple[0]; out = _tuple[1]; index = _tuple[2]; err$1 = _tuple[3]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [sliceType.nil, err$1]; } if (valid === 0) { $s = -1; return [sliceType.nil, $pkg.ErrDecryption]; } $s = -1; return [$subslice(out, index), $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: DecryptPKCS1v15 }; } $f._r = _r; $f._tuple = _tuple; $f.ciphertext = ciphertext; $f.err = err; $f.err$1 = err$1; $f.index = index; $f.out = out; $f.priv = priv; $f.rand$1 = rand$1; $f.valid = valid; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.DecryptPKCS1v15 = DecryptPKCS1v15; DecryptPKCS1v15SessionKey = function(rand$1, priv, ciphertext, key) { var _r, _tuple, ciphertext, em, err, err$1, index, k, key, priv, rand$1, valid, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; ciphertext = $f.ciphertext; em = $f.em; err = $f.err; err$1 = $f.err$1; index = $f.index; k = $f.k; key = $f.key; priv = $f.priv; rand$1 = $f.rand$1; valid = $f.valid; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = checkPub(priv.PublicKey); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } k = priv.PublicKey.Size(); if ((k - (((key.$length + 3 >> 0) + 8 >> 0)) >> 0) < 0) { $s = -1; return $pkg.ErrDecryption; } _r = decryptPKCS1v15(rand$1, priv, ciphertext); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; valid = _tuple[0]; em = _tuple[1]; index = _tuple[2]; err$1 = _tuple[3]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } if (!((em.$length === k))) { $s = -1; return $pkg.ErrDecryption; } valid = valid & (subtle.ConstantTimeEq((((em.$length - index >> 0) >> 0)), ((key.$length >> 0)))); subtle.ConstantTimeCopy(valid, key, $subslice(em, (em.$length - key.$length >> 0))); $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: DecryptPKCS1v15SessionKey }; } $f._r = _r; $f._tuple = _tuple; $f.ciphertext = ciphertext; $f.em = em; $f.err = err; $f.err$1 = err$1; $f.index = index; $f.k = k; $f.key = key; $f.priv = priv; $f.rand$1 = rand$1; $f.valid = valid; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.DecryptPKCS1v15SessionKey = DecryptPKCS1v15SessionKey; decryptPKCS1v15 = function(rand$1, priv, ciphertext) { var _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, c, ciphertext, em, equals0, err, firstByteIsZero, i, index, k, lookingForIndex, m, priv, rand$1, secondByteIsTwo, valid, validPS, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; c = $f.c; ciphertext = $f.ciphertext; em = $f.em; equals0 = $f.equals0; err = $f.err; firstByteIsZero = $f.firstByteIsZero; i = $f.i; index = $f.index; k = $f.k; lookingForIndex = $f.lookingForIndex; m = $f.m; priv = $f.priv; rand$1 = $f.rand$1; secondByteIsTwo = $f.secondByteIsTwo; valid = $f.valid; validPS = $f.validPS; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: valid = 0; em = sliceType.nil; index = 0; err = $ifaceNil; k = priv.PublicKey.Size(); if (k < 11) { err = $pkg.ErrDecryption; $s = -1; return [valid, em, index, err]; } c = new big.Int.ptr(false, big.nat.nil).SetBytes(ciphertext); _r = decrypt(rand$1, priv, c); /* */ $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 (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [valid, em, index, err]; } em = m.FillBytes($makeSlice(sliceType, k)); firstByteIsZero = subtle.ConstantTimeByteEq((0 >= em.$length ? ($throwRuntimeError("index out of range"), undefined) : em.$array[em.$offset + 0]), 0); secondByteIsTwo = subtle.ConstantTimeByteEq((1 >= em.$length ? ($throwRuntimeError("index out of range"), undefined) : em.$array[em.$offset + 1]), 2); lookingForIndex = 1; i = 2; while (true) { if (!(i < em.$length)) { break; } equals0 = subtle.ConstantTimeByteEq(((i < 0 || i >= em.$length) ? ($throwRuntimeError("index out of range"), undefined) : em.$array[em.$offset + i]), 0); index = subtle.ConstantTimeSelect(lookingForIndex & equals0, i, index); lookingForIndex = subtle.ConstantTimeSelect(equals0, 0, lookingForIndex); i = i + (1) >> 0; } validPS = subtle.ConstantTimeLessOrEq(10, index); valid = ((firstByteIsZero & secondByteIsTwo) & (((~lookingForIndex >> 0) & 1))) & validPS; index = subtle.ConstantTimeSelect(valid, index + 1 >> 0, 0); _tmp = valid; _tmp$1 = em; _tmp$2 = index; _tmp$3 = $ifaceNil; valid = _tmp; em = _tmp$1; index = _tmp$2; err = _tmp$3; $s = -1; return [valid, em, index, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: decryptPKCS1v15 }; } $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.c = c; $f.ciphertext = ciphertext; $f.em = em; $f.equals0 = equals0; $f.err = err; $f.firstByteIsZero = firstByteIsZero; $f.i = i; $f.index = index; $f.k = k; $f.lookingForIndex = lookingForIndex; $f.m = m; $f.priv = priv; $f.rand$1 = rand$1; $f.secondByteIsTwo = secondByteIsTwo; $f.valid = valid; $f.validPS = validPS; $f.$s = $s; $f.$r = $r; return $f; }; nonZeroRandomBytes = function(s, rand$1) { var _r, _r$1, _tuple, _tuple$1, err, i, rand$1, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; err = $f.err; i = $f.i; rand$1 = $f.rand$1; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _r = io.ReadFull(rand$1, s); /* */ $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))) { $s = -1; return err; } i = 0; /* while (true) { */ case 2: /* if (!(i < s.$length)) { break; } */ if(!(i < s.$length)) { $s = 3; continue; } /* while (true) { */ case 4: /* if (!(((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]) === 0)) { break; } */ if(!(((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]) === 0)) { $s = 5; continue; } _r$1 = io.ReadFull(rand$1, $subslice(s, i, (i + 1 >> 0))); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } ((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i] = ((((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]) ^ (66)) << 24 >>> 24)); $s = 4; continue; case 5: i = i + (1) >> 0; $s = 2; continue; case 3: $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: nonZeroRandomBytes }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.err = err; $f.i = i; $f.rand$1 = rand$1; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; SignPKCS1v15 = function(rand$1, priv, hash$1, hashed) { var _r, _tuple, _tuple$1, c, em, err, hash$1, hashLen, hashed, i, k, m, prefix, priv, rand$1, tLen, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; c = $f.c; em = $f.em; err = $f.err; hash$1 = $f.hash$1; hashLen = $f.hashLen; hashed = $f.hashed; i = $f.i; k = $f.k; m = $f.m; prefix = $f.prefix; priv = $f.priv; rand$1 = $f.rand$1; tLen = $f.tLen; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _tuple = pkcs1v15HashInfo(hash$1, hashed.$length); hashLen = _tuple[0]; prefix = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType.nil, err]; } tLen = prefix.$length + hashLen >> 0; k = priv.PublicKey.Size(); if (k < (tLen + 11 >> 0)) { $s = -1; return [sliceType.nil, $pkg.ErrMessageTooLong]; } em = $makeSlice(sliceType, k); (1 >= em.$length ? ($throwRuntimeError("index out of range"), undefined) : em.$array[em.$offset + 1] = 1); i = 2; while (true) { if (!(i < ((k - tLen >> 0) - 1 >> 0))) { break; } ((i < 0 || i >= em.$length) ? ($throwRuntimeError("index out of range"), undefined) : em.$array[em.$offset + i] = 255); i = i + (1) >> 0; } $copySlice($subslice(em, (k - tLen >> 0), (k - hashLen >> 0)), prefix); $copySlice($subslice(em, (k - hashLen >> 0), k), hashed); m = new big.Int.ptr(false, big.nat.nil).SetBytes(em); _r = decryptAndCheck(rand$1, priv, m); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple$1 = _r; c = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType.nil, err]; } $s = -1; return [c.FillBytes(em), $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: SignPKCS1v15 }; } $f._r = _r; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.c = c; $f.em = em; $f.err = err; $f.hash$1 = hash$1; $f.hashLen = hashLen; $f.hashed = hashed; $f.i = i; $f.k = k; $f.m = m; $f.prefix = prefix; $f.priv = priv; $f.rand$1 = rand$1; $f.tLen = tLen; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.SignPKCS1v15 = SignPKCS1v15; VerifyPKCS1v15 = function(pub, hash$1, hashed, sig) { var _r, _tuple, c, em, err, hash$1, hashLen, hashed, i, k, m, ok, prefix, pub, sig, tLen, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; c = $f.c; em = $f.em; err = $f.err; hash$1 = $f.hash$1; hashLen = $f.hashLen; hashed = $f.hashed; i = $f.i; k = $f.k; m = $f.m; ok = $f.ok; prefix = $f.prefix; pub = $f.pub; sig = $f.sig; tLen = $f.tLen; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _tuple = pkcs1v15HashInfo(hash$1, hashed.$length); hashLen = _tuple[0]; prefix = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } tLen = prefix.$length + hashLen >> 0; k = pub.Size(); if (k < (tLen + 11 >> 0)) { $s = -1; return $pkg.ErrVerification; } if (!((k === sig.$length))) { $s = -1; return $pkg.ErrVerification; } c = new big.Int.ptr(false, big.nat.nil).SetBytes(sig); _r = encrypt(new big.Int.ptr(false, big.nat.nil), pub, c); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } m = _r; em = m.FillBytes($makeSlice(sliceType, k)); ok = subtle.ConstantTimeByteEq((0 >= em.$length ? ($throwRuntimeError("index out of range"), undefined) : em.$array[em.$offset + 0]), 0); ok = ok & (subtle.ConstantTimeByteEq((1 >= em.$length ? ($throwRuntimeError("index out of range"), undefined) : em.$array[em.$offset + 1]), 1)); ok = ok & (subtle.ConstantTimeCompare($subslice(em, (k - hashLen >> 0), k), hashed)); ok = ok & (subtle.ConstantTimeCompare($subslice(em, (k - tLen >> 0), (k - hashLen >> 0)), prefix)); ok = ok & (subtle.ConstantTimeByteEq((x = (k - tLen >> 0) - 1 >> 0, ((x < 0 || x >= em.$length) ? ($throwRuntimeError("index out of range"), undefined) : em.$array[em.$offset + x])), 0)); i = 2; while (true) { if (!(i < ((k - tLen >> 0) - 1 >> 0))) { break; } ok = ok & (subtle.ConstantTimeByteEq(((i < 0 || i >= em.$length) ? ($throwRuntimeError("index out of range"), undefined) : em.$array[em.$offset + i]), 255)); i = i + (1) >> 0; } if (!((ok === 1))) { $s = -1; return $pkg.ErrVerification; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: VerifyPKCS1v15 }; } $f._r = _r; $f._tuple = _tuple; $f.c = c; $f.em = em; $f.err = err; $f.hash$1 = hash$1; $f.hashLen = hashLen; $f.hashed = hashed; $f.i = i; $f.k = k; $f.m = m; $f.ok = ok; $f.prefix = prefix; $f.pub = pub; $f.sig = sig; $f.tLen = tLen; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.VerifyPKCS1v15 = VerifyPKCS1v15; pkcs1v15HashInfo = function(hash$1, inLen) { var _entry, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tuple, err, hash$1, hashLen, inLen, ok, prefix; hashLen = 0; prefix = sliceType.nil; err = $ifaceNil; if (hash$1 === 0) { _tmp = inLen; _tmp$1 = sliceType.nil; _tmp$2 = $ifaceNil; hashLen = _tmp; prefix = _tmp$1; err = _tmp$2; return [hashLen, prefix, err]; } hashLen = new crypto.Hash(hash$1).Size(); if (!((inLen === hashLen))) { _tmp$3 = 0; _tmp$4 = sliceType.nil; _tmp$5 = errors.New("crypto/rsa: input must be hashed message"); hashLen = _tmp$3; prefix = _tmp$4; err = _tmp$5; return [hashLen, prefix, err]; } _tuple = (_entry = hashPrefixes[crypto.Hash.keyFor(hash$1)], _entry !== undefined ? [_entry.v, true] : [sliceType.nil, false]); prefix = _tuple[0]; ok = _tuple[1]; if (!ok) { _tmp$6 = 0; _tmp$7 = sliceType.nil; _tmp$8 = errors.New("crypto/rsa: unsupported hash function"); hashLen = _tmp$6; prefix = _tmp$7; err = _tmp$8; return [hashLen, prefix, err]; } return [hashLen, prefix, err]; }; ptrType.methods = [{prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Equal", name: "Equal", pkg: "", typ: $funcType([crypto.PublicKey], [$Bool], false)}]; ptrType$2.methods = [{prop: "Public", name: "Public", pkg: "", typ: $funcType([], [crypto.PublicKey], false)}, {prop: "Equal", name: "Equal", pkg: "", typ: $funcType([crypto.PrivateKey], [$Bool], false)}, {prop: "Sign", name: "Sign", pkg: "", typ: $funcType([io.Reader, sliceType, crypto.SignerOpts], [sliceType, $error], false)}, {prop: "Decrypt", name: "Decrypt", pkg: "", typ: $funcType([io.Reader, sliceType, crypto.DecrypterOpts], [sliceType, $error], false)}, {prop: "Validate", name: "Validate", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Precompute", name: "Precompute", pkg: "", typ: $funcType([], [], false)}]; ptrType$3.methods = [{prop: "HashFunc", name: "HashFunc", pkg: "", typ: $funcType([], [crypto.Hash], false)}, {prop: "saltLength", name: "saltLength", pkg: "crypto/rsa", typ: $funcType([], [$Int], false)}]; PublicKey.init("", [{prop: "N", name: "N", embedded: false, exported: true, typ: ptrType$1, tag: ""}, {prop: "E", name: "E", embedded: false, exported: true, typ: $Int, tag: ""}]); OAEPOptions.init("", [{prop: "Hash", name: "Hash", embedded: false, exported: true, typ: crypto.Hash, tag: ""}, {prop: "Label", name: "Label", embedded: false, exported: true, typ: sliceType, tag: ""}]); PrivateKey.init("", [{prop: "PublicKey", name: "PublicKey", embedded: true, exported: true, typ: PublicKey, tag: ""}, {prop: "D", name: "D", embedded: false, exported: true, typ: ptrType$1, tag: ""}, {prop: "Primes", name: "Primes", embedded: false, exported: true, typ: sliceType$1, tag: ""}, {prop: "Precomputed", name: "Precomputed", embedded: false, exported: true, typ: PrecomputedValues, tag: ""}]); PrecomputedValues.init("", [{prop: "Dp", name: "Dp", embedded: false, exported: true, typ: ptrType$1, tag: ""}, {prop: "Dq", name: "Dq", embedded: false, exported: true, typ: ptrType$1, tag: ""}, {prop: "Qinv", name: "Qinv", embedded: false, exported: true, typ: ptrType$1, tag: ""}, {prop: "CRTValues", name: "CRTValues", embedded: false, exported: true, typ: sliceType$2, tag: ""}]); CRTValue.init("", [{prop: "Exp", name: "Exp", embedded: false, exported: true, typ: ptrType$1, tag: ""}, {prop: "Coeff", name: "Coeff", embedded: false, exported: true, typ: ptrType$1, tag: ""}, {prop: "R", name: "R", embedded: false, exported: true, typ: ptrType$1, tag: ""}]); PSSOptions.init("", [{prop: "SaltLength", name: "SaltLength", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Hash", name: "Hash", embedded: false, exported: true, typ: crypto.Hash, tag: ""}]); PKCS1v15DecryptOptions.init("", [{prop: "SessionKeyLen", name: "SessionKeyLen", embedded: false, exported: true, 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 = crypto.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = randutil.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = rand.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = subtle.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = errors.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = hash.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = io.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = math.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = big.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } bigZero = big.NewInt(new $Int64(0, 0)); bigOne = big.NewInt(new $Int64(0, 1)); errPublicModulus = errors.New("crypto/rsa: missing public modulus"); errPublicExponentSmall = errors.New("crypto/rsa: public exponent too small"); errPublicExponentLarge = errors.New("crypto/rsa: public exponent too large"); $pkg.ErrMessageTooLong = errors.New("crypto/rsa: message too long for RSA public key size"); $pkg.ErrDecryption = errors.New("crypto/rsa: decryption error"); $pkg.ErrVerification = errors.New("crypto/rsa: verification error"); hashPrefixes = $makeMap(crypto.Hash.keyFor, [{ k: 2, v: new sliceType([48, 32, 48, 12, 6, 8, 42, 134, 72, 134, 247, 13, 2, 5, 5, 0, 4, 16]) }, { k: 3, v: new sliceType([48, 33, 48, 9, 6, 5, 43, 14, 3, 2, 26, 5, 0, 4, 20]) }, { k: 4, v: new sliceType([48, 45, 48, 13, 6, 9, 96, 134, 72, 1, 101, 3, 4, 2, 4, 5, 0, 4, 28]) }, { k: 5, v: new sliceType([48, 49, 48, 13, 6, 9, 96, 134, 72, 1, 101, 3, 4, 2, 1, 5, 0, 4, 32]) }, { k: 6, v: new sliceType([48, 65, 48, 13, 6, 9, 96, 134, 72, 1, 101, 3, 4, 2, 2, 5, 0, 4, 48]) }, { k: 7, v: new sliceType([48, 81, 48, 13, 6, 9, 96, 134, 72, 1, 101, 3, 4, 2, 3, 5, 0, 4, 64]) }, { k: 8, v: new sliceType([]) }, { k: 9, v: new sliceType([48, 32, 48, 8, 6, 6, 40, 207, 6, 3, 0, 49, 4, 20]) }]); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["crypto/sha1"] = (function() { var $pkg = {}, $init, crypto, binary, errors, hash, bits, digest, arrayType, sliceType, arrayType$1, arrayType$2, arrayType$3, arrayType$4, arrayType$5, ptrType, block, blockGeneric, init, appendUint64, appendUint32, consumeUint64, consumeUint32, New; crypto = $packages["crypto"]; binary = $packages["encoding/binary"]; errors = $packages["errors"]; hash = $packages["hash"]; bits = $packages["math/bits"]; digest = $pkg.digest = $newType(0, $kindStruct, "sha1.digest", true, "crypto/sha1", false, function(h_, x_, nx_, len_) { this.$val = this; if (arguments.length === 0) { this.h = arrayType$3.zero(); this.x = arrayType$4.zero(); this.nx = 0; this.len = new $Uint64(0, 0); return; } this.h = h_; this.x = x_; this.nx = nx_; this.len = len_; }); arrayType = $arrayType($Uint32, 16); sliceType = $sliceType($Uint8); arrayType$1 = $arrayType($Uint8, 8); arrayType$2 = $arrayType($Uint8, 4); arrayType$3 = $arrayType($Uint32, 5); arrayType$4 = $arrayType($Uint8, 64); arrayType$5 = $arrayType($Uint8, 20); ptrType = $ptrType(digest); blockGeneric = function(dig, p) { var _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$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, a, b, c, d, dig, e, f, f$1, f$2, f$3, f$4, h0, h1, h2, h3, h4, i, i$1, j, p, t, t$1, t$2, t$3, t$4, tmp, tmp$1, tmp$2, tmp$3, w, 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$3, x$4, x$5, x$6, x$7, x$8, x$9; w = arrayType.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]; h0 = _tmp; h1 = _tmp$1; h2 = _tmp$2; h3 = _tmp$3; h4 = _tmp$4; 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"), undefined) : w[i] = (((((((((((j < 0 || j >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + j]) >>> 0)) << 24 >>> 0) | ((((x = j + 1 >> 0, ((x < 0 || x >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : 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"), undefined) : 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"), undefined) : p.$array[p.$offset + x$2])) >>> 0))) >>> 0)); i = i + (1) >> 0; } _tmp$5 = h0; _tmp$6 = h1; _tmp$7 = h2; _tmp$8 = h3; _tmp$9 = h4; a = _tmp$5; b = _tmp$6; c = _tmp$7; d = _tmp$8; e = _tmp$9; i$1 = 0; while (true) { if (!(i$1 < 16)) { break; } f = (((b & c) >>> 0) | ((((~b >>> 0)) & d) >>> 0)) >>> 0; t = (((bits.RotateLeft32(a, 5) + f >>> 0) + e >>> 0) + (x$3 = i$1 & 15, ((x$3 < 0 || x$3 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[x$3])) >>> 0) + 1518500249 >>> 0; _tmp$10 = t; _tmp$11 = a; _tmp$12 = bits.RotateLeft32(b, 30); _tmp$13 = c; _tmp$14 = d; a = _tmp$10; b = _tmp$11; c = _tmp$12; d = _tmp$13; e = _tmp$14; i$1 = i$1 + (1) >> 0; } while (true) { if (!(i$1 < 20)) { break; } tmp = ((((((x$4 = ((i$1 - 3 >> 0)) & 15, ((x$4 < 0 || x$4 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[x$4])) ^ (x$5 = ((i$1 - 8 >> 0)) & 15, ((x$5 < 0 || x$5 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[x$5]))) >>> 0) ^ (x$6 = ((i$1 - 14 >> 0)) & 15, ((x$6 < 0 || x$6 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[x$6]))) >>> 0) ^ (x$7 = (i$1) & 15, ((x$7 < 0 || x$7 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[x$7]))) >>> 0; (x$8 = i$1 & 15, ((x$8 < 0 || x$8 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[x$8] = (((tmp << 1 >>> 0) | (tmp >>> 31 >>> 0)) >>> 0))); f$1 = (((b & c) >>> 0) | ((((~b >>> 0)) & d) >>> 0)) >>> 0; t$1 = (((bits.RotateLeft32(a, 5) + f$1 >>> 0) + e >>> 0) + (x$9 = i$1 & 15, ((x$9 < 0 || x$9 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[x$9])) >>> 0) + 1518500249 >>> 0; _tmp$15 = t$1; _tmp$16 = a; _tmp$17 = bits.RotateLeft32(b, 30); _tmp$18 = c; _tmp$19 = d; a = _tmp$15; b = _tmp$16; c = _tmp$17; d = _tmp$18; e = _tmp$19; i$1 = i$1 + (1) >> 0; } while (true) { if (!(i$1 < 40)) { break; } tmp$1 = ((((((x$10 = ((i$1 - 3 >> 0)) & 15, ((x$10 < 0 || x$10 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[x$10])) ^ (x$11 = ((i$1 - 8 >> 0)) & 15, ((x$11 < 0 || x$11 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[x$11]))) >>> 0) ^ (x$12 = ((i$1 - 14 >> 0)) & 15, ((x$12 < 0 || x$12 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[x$12]))) >>> 0) ^ (x$13 = (i$1) & 15, ((x$13 < 0 || x$13 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[x$13]))) >>> 0; (x$14 = i$1 & 15, ((x$14 < 0 || x$14 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[x$14] = (((tmp$1 << 1 >>> 0) | (tmp$1 >>> 31 >>> 0)) >>> 0))); f$2 = (((b ^ c) >>> 0) ^ d) >>> 0; t$2 = (((bits.RotateLeft32(a, 5) + f$2 >>> 0) + e >>> 0) + (x$15 = i$1 & 15, ((x$15 < 0 || x$15 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[x$15])) >>> 0) + 1859775393 >>> 0; _tmp$20 = t$2; _tmp$21 = a; _tmp$22 = bits.RotateLeft32(b, 30); _tmp$23 = c; _tmp$24 = d; a = _tmp$20; b = _tmp$21; c = _tmp$22; d = _tmp$23; e = _tmp$24; i$1 = i$1 + (1) >> 0; } while (true) { if (!(i$1 < 60)) { break; } tmp$2 = ((((((x$16 = ((i$1 - 3 >> 0)) & 15, ((x$16 < 0 || x$16 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[x$16])) ^ (x$17 = ((i$1 - 8 >> 0)) & 15, ((x$17 < 0 || x$17 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[x$17]))) >>> 0) ^ (x$18 = ((i$1 - 14 >> 0)) & 15, ((x$18 < 0 || x$18 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[x$18]))) >>> 0) ^ (x$19 = (i$1) & 15, ((x$19 < 0 || x$19 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[x$19]))) >>> 0; (x$20 = i$1 & 15, ((x$20 < 0 || x$20 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[x$20] = (((tmp$2 << 1 >>> 0) | (tmp$2 >>> 31 >>> 0)) >>> 0))); f$3 = (((((((b | c) >>> 0)) & d) >>> 0)) | (((b & c) >>> 0))) >>> 0; t$3 = (((bits.RotateLeft32(a, 5) + f$3 >>> 0) + e >>> 0) + (x$21 = i$1 & 15, ((x$21 < 0 || x$21 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[x$21])) >>> 0) + 2400959708 >>> 0; _tmp$25 = t$3; _tmp$26 = a; _tmp$27 = bits.RotateLeft32(b, 30); _tmp$28 = c; _tmp$29 = d; a = _tmp$25; b = _tmp$26; c = _tmp$27; d = _tmp$28; e = _tmp$29; i$1 = i$1 + (1) >> 0; } while (true) { if (!(i$1 < 80)) { break; } tmp$3 = ((((((x$22 = ((i$1 - 3 >> 0)) & 15, ((x$22 < 0 || x$22 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[x$22])) ^ (x$23 = ((i$1 - 8 >> 0)) & 15, ((x$23 < 0 || x$23 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[x$23]))) >>> 0) ^ (x$24 = ((i$1 - 14 >> 0)) & 15, ((x$24 < 0 || x$24 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[x$24]))) >>> 0) ^ (x$25 = (i$1) & 15, ((x$25 < 0 || x$25 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[x$25]))) >>> 0; (x$26 = i$1 & 15, ((x$26 < 0 || x$26 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[x$26] = (((tmp$3 << 1 >>> 0) | (tmp$3 >>> 31 >>> 0)) >>> 0))); f$4 = (((b ^ c) >>> 0) ^ d) >>> 0; t$4 = (((bits.RotateLeft32(a, 5) + f$4 >>> 0) + e >>> 0) + (x$27 = i$1 & 15, ((x$27 < 0 || x$27 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[x$27])) >>> 0) + 3395469782 >>> 0; _tmp$30 = t$4; _tmp$31 = a; _tmp$32 = bits.RotateLeft32(b, 30); _tmp$33 = c; _tmp$34 = d; a = _tmp$30; b = _tmp$31; c = _tmp$32; d = _tmp$33; e = _tmp$34; i$1 = i$1 + (1) >> 0; } h0 = h0 + (a) >>> 0; h1 = h1 + (b) >>> 0; h2 = h2 + (c) >>> 0; h3 = h3 + (d) >>> 0; h4 = h4 + (e) >>> 0; p = $subslice(p, 64); } _tmp$35 = h0; _tmp$36 = h1; _tmp$37 = h2; _tmp$38 = h3; _tmp$39 = h4; dig.h[0] = _tmp$35; dig.h[1] = _tmp$36; dig.h[2] = _tmp$37; dig.h[3] = _tmp$38; dig.h[4] = _tmp$39; }; init = function() { crypto.RegisterHash(3, New); }; digest.ptr.prototype.MarshalBinary = function() { var b, d; d = this; b = $makeSlice(sliceType, 0, 96); b = $appendSlice(b, "sha\x01"); b = appendUint32(b, d.h[0]); b = appendUint32(b, d.h[1]); b = appendUint32(b, d.h[2]); b = appendUint32(b, d.h[3]); b = appendUint32(b, d.h[4]); b = $appendSlice(b, $subslice(new sliceType(d.x), 0, d.nx)); b = $subslice(b, 0, ((b.$length + 64 >> 0) - (d.nx) >> 0)); b = appendUint64(b, d.len); return [b, $ifaceNil]; }; digest.prototype.MarshalBinary = function() { return this.$val.MarshalBinary(); }; digest.ptr.prototype.UnmarshalBinary = function(b) { var _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, b, d; d = this; if (b.$length < 4 || !(($bytesToString($subslice(b, 0, 4))) === "sha\x01")) { return errors.New("crypto/sha1: invalid hash state identifier"); } if (!((b.$length === 96))) { return errors.New("crypto/sha1: invalid hash state size"); } b = $subslice(b, 4); _tuple = consumeUint32(b); b = _tuple[0]; d.h[0] = _tuple[1]; _tuple$1 = consumeUint32(b); b = _tuple$1[0]; d.h[1] = _tuple$1[1]; _tuple$2 = consumeUint32(b); b = _tuple$2[0]; d.h[2] = _tuple$2[1]; _tuple$3 = consumeUint32(b); b = _tuple$3[0]; d.h[3] = _tuple$3[1]; _tuple$4 = consumeUint32(b); b = _tuple$4[0]; d.h[4] = _tuple$4[1]; b = $subslice(b, $copySlice(new sliceType(d.x), b)); _tuple$5 = consumeUint64(b); b = _tuple$5[0]; d.len = _tuple$5[1]; d.nx = (($div64(d.len, new $Uint64(0, 64), true).$low >> 0)); return $ifaceNil; }; digest.prototype.UnmarshalBinary = function(b) { return this.$val.UnmarshalBinary(b); }; appendUint64 = function(b, x) { var a, b, x; a = arrayType$1.zero(); $clone(binary.BigEndian, binary.bigEndian).PutUint64(new sliceType(a), x); return $appendSlice(b, new sliceType(a)); }; appendUint32 = function(b, x) { var a, b, x; a = arrayType$2.zero(); $clone(binary.BigEndian, binary.bigEndian).PutUint32(new sliceType(a), x); return $appendSlice(b, new sliceType(a)); }; consumeUint64 = function(b) { var b, 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; $unused((7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7])); x$14 = (x = (x$1 = (x$2 = (x$3 = (x$4 = (x$5 = (x$6 = (new $Uint64(0, (7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7]))), x$7 = $shiftLeft64((new $Uint64(0, (6 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 6]))), 8), new $Uint64(x$6.$high | x$7.$high, (x$6.$low | x$7.$low) >>> 0)), x$8 = $shiftLeft64((new $Uint64(0, (5 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 5]))), 16), new $Uint64(x$5.$high | x$8.$high, (x$5.$low | x$8.$low) >>> 0)), x$9 = $shiftLeft64((new $Uint64(0, (4 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 4]))), 24), new $Uint64(x$4.$high | x$9.$high, (x$4.$low | x$9.$low) >>> 0)), x$10 = $shiftLeft64((new $Uint64(0, (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]))), 32), new $Uint64(x$3.$high | x$10.$high, (x$3.$low | x$10.$low) >>> 0)), x$11 = $shiftLeft64((new $Uint64(0, (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]))), 40), new $Uint64(x$2.$high | x$11.$high, (x$2.$low | x$11.$low) >>> 0)), x$12 = $shiftLeft64((new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), 48), new $Uint64(x$1.$high | x$12.$high, (x$1.$low | x$12.$low) >>> 0)), x$13 = $shiftLeft64((new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), 56), new $Uint64(x.$high | x$13.$high, (x.$low | x$13.$low) >>> 0)); return [$subslice(b, 8), x$14]; }; consumeUint32 = function(b) { var b, x; $unused((3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3])); x = ((((((((3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]) >>> 0)) | ((((2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]) >>> 0)) << 8 >>> 0)) >>> 0) | ((((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]) >>> 0)) << 16 >>> 0)) >>> 0) | ((((0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]) >>> 0)) << 24 >>> 0)) >>> 0; return [$subslice(b, 4), x]; }; digest.ptr.prototype.Reset = function() { var d; d = this; d.h[0] = 1732584193; d.h[1] = 4023233417; d.h[2] = 2562383102; d.h[3] = 271733878; d.h[4] = 3285377520; d.nx = 0; d.len = new $Uint64(0, 0); }; digest.prototype.Reset = function() { return this.$val.Reset(); }; New = function() { var d; d = new digest.ptr(arrayType$3.zero(), arrayType$4.zero(), 0, new $Uint64(0, 0)); d.Reset(); return d; }; $pkg.New = New; digest.ptr.prototype.Size = function() { var d; d = this; return 20; }; digest.prototype.Size = function() { return this.$val.Size(); }; digest.ptr.prototype.BlockSize = function() { var d; d = this; return 64; }; digest.prototype.BlockSize = function() { return this.$val.BlockSize(); }; digest.ptr.prototype.Write = function(p) { var d, err, n, n$1, nn, p, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; d = $f.d; err = $f.err; n = $f.n; n$1 = $f.n$1; nn = $f.nn; p = $f.p; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: 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) { $s = 1; continue; } /* */ $s = 2; continue; /* if (d.nx > 0) { */ case 1: n = $copySlice($subslice(new sliceType(d.x), d.nx), p); d.nx = d.nx + (n) >> 0; /* */ if (d.nx === 64) { $s = 3; continue; } /* */ $s = 4; continue; /* if (d.nx === 64) { */ case 3: $r = block(d, new sliceType(d.x)); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } d.nx = 0; /* } */ case 4: p = $subslice(p, n); /* } */ case 2: /* */ if (p.$length >= 64) { $s = 6; continue; } /* */ $s = 7; continue; /* if (p.$length >= 64) { */ case 6: n$1 = (p.$length & ~63) >> 0; $r = block(d, $subslice(p, 0, n$1)); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } p = $subslice(p, n$1); /* } */ case 7: if (p.$length > 0) { d.nx = $copySlice(new sliceType(d.x), p); } $s = -1; return [nn, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: digest.ptr.prototype.Write }; } $f.d = d; $f.err = err; $f.n = n; $f.n$1 = n$1; $f.nn = nn; $f.p = p; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; digest.prototype.Write = function(p) { return this.$val.Write(p); }; digest.ptr.prototype.Sum = function(in$1) { var _r, d, d0, hash$1, in$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; d = $f.d; d0 = $f.d0; hash$1 = $f.hash$1; in$1 = $f.in$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: d = this; d0 = $clone(d, digest); _r = d0.checkSum(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } hash$1 = $clone(_r, arrayType$5); $s = -1; return $appendSlice(in$1, new sliceType(hash$1)); /* */ } return; } if ($f === undefined) { $f = { $blk: digest.ptr.prototype.Sum }; } $f._r = _r; $f.d = d; $f.d0 = d0; $f.hash$1 = hash$1; $f.in$1 = in$1; $f.$s = $s; $f.$r = $r; return $f; }; digest.prototype.Sum = function(in$1) { return this.$val.Sum(in$1); }; digest.ptr.prototype.checkSum = function() { var _r, _r$1, _r$2, d, digest$1, len, tmp, x, x$1, x$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; d = $f.d; digest$1 = $f.digest$1; len = $f.len; tmp = $f.tmp; 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: d = this; len = d.len; tmp = arrayType$4.zero(); tmp[0] = 128; /* */ if ((x = $div64(len, new $Uint64(0, 64), true), (x.$high < 0 || (x.$high === 0 && x.$low < 56)))) { $s = 1; continue; } /* */ $s = 2; continue; /* if ((x = $div64(len, new $Uint64(0, 64), true), (x.$high < 0 || (x.$high === 0 && x.$low < 56)))) { */ case 1: _r = d.Write($subslice(new sliceType(tmp), 0, $flatten64((x$1 = $div64(len, new $Uint64(0, 64), true), new $Uint64(0 - x$1.$high, 56 - x$1.$low))))); /* */ $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 = d.Write($subslice(new sliceType(tmp), 0, $flatten64((x$2 = $div64(len, new $Uint64(0, 64), true), new $Uint64(0 - x$2.$high, 120 - x$2.$low))))); /* */ $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: len = $shiftLeft64(len, (3)); $clone(binary.BigEndian, binary.bigEndian).PutUint64(new sliceType(tmp), len); _r$2 = d.Write($subslice(new sliceType(tmp), 0, 8)); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; if (!((d.nx === 0))) { $panic(new $String("d.nx != 0")); } digest$1 = arrayType$5.zero(); $clone(binary.BigEndian, binary.bigEndian).PutUint32($subslice(new sliceType(digest$1), 0), d.h[0]); $clone(binary.BigEndian, binary.bigEndian).PutUint32($subslice(new sliceType(digest$1), 4), d.h[1]); $clone(binary.BigEndian, binary.bigEndian).PutUint32($subslice(new sliceType(digest$1), 8), d.h[2]); $clone(binary.BigEndian, binary.bigEndian).PutUint32($subslice(new sliceType(digest$1), 12), d.h[3]); $clone(binary.BigEndian, binary.bigEndian).PutUint32($subslice(new sliceType(digest$1), 16), d.h[4]); $s = -1; return digest$1; /* */ } return; } if ($f === undefined) { $f = { $blk: digest.ptr.prototype.checkSum }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.d = d; $f.digest$1 = digest$1; $f.len = len; $f.tmp = tmp; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; }; digest.prototype.checkSum = function() { return this.$val.checkSum(); }; digest.ptr.prototype.ConstantTimeSum = function(in$1) { var _r, d, d0, hash$1, in$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; d = $f.d; d0 = $f.d0; hash$1 = $f.hash$1; in$1 = $f.in$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: d = this; d0 = $clone(d, digest); _r = d0.constSum(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } hash$1 = $clone(_r, arrayType$5); $s = -1; return $appendSlice(in$1, new sliceType(hash$1)); /* */ } return; } if ($f === undefined) { $f = { $blk: digest.ptr.prototype.ConstantTimeSum }; } $f._r = _r; $f.d = d; $f.d0 = d0; $f.hash$1 = hash$1; $f.in$1 = in$1; $f.$s = $s; $f.$r = $r; return $f; }; digest.prototype.ConstantTimeSum = function(in$1) { return this.$val.ConstantTimeSum(in$1); }; digest.ptr.prototype.constSum = function() { var _i, _i$1, _index, _index$1, _index$2, _index$3, _ref, _ref$1, d, digest$1, i, i$1, i$2, i$3, i$4, l, length, mask, mask1b, nx, s, s$1, separator, t, x, x$1, x$10, x$11, 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; _i = $f._i; _i$1 = $f._i$1; _index = $f._index; _index$1 = $f._index$1; _index$2 = $f._index$2; _index$3 = $f._index$3; _ref = $f._ref; _ref$1 = $f._ref$1; d = $f.d; digest$1 = $f.digest$1; i = $f.i; i$1 = $f.i$1; i$2 = $f.i$2; i$3 = $f.i$3; i$4 = $f.i$4; l = $f.l; length = $f.length; mask = $f.mask; mask1b = $f.mask1b; nx = $f.nx; s = $f.s; s$1 = $f.s$1; separator = $f.separator; t = $f.t; x = $f.x; x$1 = $f.x$1; x$10 = $f.x$10; x$11 = $f.x$11; 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: d = this; length = arrayType$1.zero(); l = $shiftLeft64(d.len, 3); i = 0; while (true) { if (!(i < 8)) { break; } ((i < 0 || i >= length.length) ? ($throwRuntimeError("index out of range"), undefined) : length[i] = (($shiftRightUint64(l, ((56 - (8 * i >>> 0) >>> 0))).$low << 24 >>> 24))); i = i + (1) >>> 0; } nx = ((d.nx << 24 >>> 24)); t = nx - 56 << 24 >>> 24; mask1b = (((((t << 24 >> 24)) >> 7 << 24 >> 24) << 24 >>> 24)); separator = 128; i$1 = 0; while (true) { if (!(i$1 < 64)) { break; } mask = ((((((i$1 - nx << 24 >>> 24) << 24 >> 24)) >> 7 << 24 >> 24) << 24 >>> 24)); (x$1 = d.x, ((i$1 < 0 || i$1 >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i$1] = ((((((~mask << 24 >>> 24) & separator) >>> 0)) | (((mask & (x = d.x, ((i$1 < 0 || i$1 >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i$1]))) >>> 0))) >>> 0))); separator = (separator & (mask)) >>> 0; if (i$1 >= 56) { (x$4 = d.x, ((i$1 < 0 || i$1 >= x$4.length) ? ($throwRuntimeError("index out of range"), undefined) : x$4[i$1] = (((x$2 = d.x, ((i$1 < 0 || i$1 >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i$1])) | (((mask1b & (x$3 = i$1 - 56 << 24 >>> 24, ((x$3 < 0 || x$3 >= length.length) ? ($throwRuntimeError("index out of range"), undefined) : length[x$3]))) >>> 0))) >>> 0))); } i$1 = i$1 + (1) << 24 >>> 24; } $r = block(d, new sliceType(d.x)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } digest$1 = arrayType$5.zero(); _ref = d.h; _i = 0; while (true) { if (!(_i < 5)) { break; } i$2 = _i; s = ((_i < 0 || _i >= _ref.length) ? ($throwRuntimeError("index out of range"), undefined) : _ref[_i]); (x$5 = $imul(i$2, 4), ((x$5 < 0 || x$5 >= digest$1.length) ? ($throwRuntimeError("index out of range"), undefined) : digest$1[x$5] = ((mask1b & (((s >>> 24 >>> 0) << 24 >>> 24))) >>> 0))); (x$6 = ($imul(i$2, 4)) + 1 >> 0, ((x$6 < 0 || x$6 >= digest$1.length) ? ($throwRuntimeError("index out of range"), undefined) : digest$1[x$6] = ((mask1b & (((s >>> 16 >>> 0) << 24 >>> 24))) >>> 0))); (x$7 = ($imul(i$2, 4)) + 2 >> 0, ((x$7 < 0 || x$7 >= digest$1.length) ? ($throwRuntimeError("index out of range"), undefined) : digest$1[x$7] = ((mask1b & (((s >>> 8 >>> 0) << 24 >>> 24))) >>> 0))); (x$8 = ($imul(i$2, 4)) + 3 >> 0, ((x$8 < 0 || x$8 >= digest$1.length) ? ($throwRuntimeError("index out of range"), undefined) : digest$1[x$8] = ((mask1b & ((s << 24 >>> 24))) >>> 0))); _i++; } i$3 = 0; while (true) { if (!(i$3 < 64)) { break; } if (i$3 < 56) { (x$9 = d.x, ((i$3 < 0 || i$3 >= x$9.length) ? ($throwRuntimeError("index out of range"), undefined) : x$9[i$3] = separator)); separator = 0; } else { (x$11 = d.x, ((i$3 < 0 || i$3 >= x$11.length) ? ($throwRuntimeError("index out of range"), undefined) : x$11[i$3] = (x$10 = i$3 - 56 << 24 >>> 24, ((x$10 < 0 || x$10 >= length.length) ? ($throwRuntimeError("index out of range"), undefined) : length[x$10])))); } i$3 = i$3 + (1) << 24 >>> 24; } $r = block(d, new sliceType(d.x)); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _ref$1 = d.h; _i$1 = 0; while (true) { if (!(_i$1 < 5)) { break; } i$4 = _i$1; s$1 = ((_i$1 < 0 || _i$1 >= _ref$1.length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1[_i$1]); _index = $imul(i$4, 4); ((_index < 0 || _index >= digest$1.length) ? ($throwRuntimeError("index out of range"), undefined) : digest$1[_index] = ((((_index < 0 || _index >= digest$1.length) ? ($throwRuntimeError("index out of range"), undefined) : digest$1[_index]) | ((((~mask1b << 24 >>> 24) & (((s$1 >>> 24 >>> 0) << 24 >>> 24))) >>> 0))) >>> 0)); _index$1 = ($imul(i$4, 4)) + 1 >> 0; ((_index$1 < 0 || _index$1 >= digest$1.length) ? ($throwRuntimeError("index out of range"), undefined) : digest$1[_index$1] = ((((_index$1 < 0 || _index$1 >= digest$1.length) ? ($throwRuntimeError("index out of range"), undefined) : digest$1[_index$1]) | ((((~mask1b << 24 >>> 24) & (((s$1 >>> 16 >>> 0) << 24 >>> 24))) >>> 0))) >>> 0)); _index$2 = ($imul(i$4, 4)) + 2 >> 0; ((_index$2 < 0 || _index$2 >= digest$1.length) ? ($throwRuntimeError("index out of range"), undefined) : digest$1[_index$2] = ((((_index$2 < 0 || _index$2 >= digest$1.length) ? ($throwRuntimeError("index out of range"), undefined) : digest$1[_index$2]) | ((((~mask1b << 24 >>> 24) & (((s$1 >>> 8 >>> 0) << 24 >>> 24))) >>> 0))) >>> 0)); _index$3 = ($imul(i$4, 4)) + 3 >> 0; ((_index$3 < 0 || _index$3 >= digest$1.length) ? ($throwRuntimeError("index out of range"), undefined) : digest$1[_index$3] = ((((_index$3 < 0 || _index$3 >= digest$1.length) ? ($throwRuntimeError("index out of range"), undefined) : digest$1[_index$3]) | ((((~mask1b << 24 >>> 24) & ((s$1 << 24 >>> 24))) >>> 0))) >>> 0)); _i$1++; } $s = -1; return digest$1; /* */ } return; } if ($f === undefined) { $f = { $blk: digest.ptr.prototype.constSum }; } $f._i = _i; $f._i$1 = _i$1; $f._index = _index; $f._index$1 = _index$1; $f._index$2 = _index$2; $f._index$3 = _index$3; $f._ref = _ref; $f._ref$1 = _ref$1; $f.d = d; $f.digest$1 = digest$1; $f.i = i; $f.i$1 = i$1; $f.i$2 = i$2; $f.i$3 = i$3; $f.i$4 = i$4; $f.l = l; $f.length = length; $f.mask = mask; $f.mask1b = mask1b; $f.nx = nx; $f.s = s; $f.s$1 = s$1; $f.separator = separator; $f.t = t; $f.x = x; $f.x$1 = x$1; $f.x$10 = x$10; $f.x$11 = x$11; $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; }; digest.prototype.constSum = function() { return this.$val.constSum(); }; ptrType.methods = [{prop: "MarshalBinary", name: "MarshalBinary", pkg: "", typ: $funcType([], [sliceType, $error], false)}, {prop: "UnmarshalBinary", name: "UnmarshalBinary", pkg: "", typ: $funcType([sliceType], [$error], false)}, {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], [$Int, $error], false)}, {prop: "Sum", name: "Sum", pkg: "", typ: $funcType([sliceType], [sliceType], false)}, {prop: "checkSum", name: "checkSum", pkg: "crypto/sha1", typ: $funcType([], [arrayType$5], false)}, {prop: "ConstantTimeSum", name: "ConstantTimeSum", pkg: "", typ: $funcType([sliceType], [sliceType], false)}, {prop: "constSum", name: "constSum", pkg: "crypto/sha1", typ: $funcType([], [arrayType$5], false)}]; digest.init("crypto/sha1", [{prop: "h", name: "h", embedded: false, exported: false, typ: arrayType$3, tag: ""}, {prop: "x", name: "x", embedded: false, exported: false, typ: arrayType$4, tag: ""}, {prop: "nx", name: "nx", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "len", name: "len", embedded: false, exported: false, typ: $Uint64, 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 = 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 = hash.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = bits.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } block = blockGeneric; init(); /* */ } 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, binary, errors, hash, bits, digest, sliceType, arrayType, sliceType$1, arrayType$1, arrayType$2, arrayType$3, arrayType$4, arrayType$5, arrayType$6, ptrType, block, _K, blockGeneric, init, appendUint64, appendUint32, consumeUint64, consumeUint32, New, New224, Sum224; crypto = $packages["crypto"]; binary = $packages["encoding/binary"]; errors = $packages["errors"]; hash = $packages["hash"]; bits = $packages["math/bits"]; digest = $pkg.digest = $newType(0, $kindStruct, "sha256.digest", true, "crypto/sha256", false, function(h_, x_, nx_, len_, is224_) { this.$val = this; if (arguments.length === 0) { this.h = arrayType$3.zero(); this.x = arrayType$4.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, 64); sliceType$1 = $sliceType($Uint8); arrayType$1 = $arrayType($Uint8, 8); arrayType$2 = $arrayType($Uint8, 4); arrayType$3 = $arrayType($Uint32, 8); arrayType$4 = $arrayType($Uint8, 64); arrayType$5 = $arrayType($Uint8, 32); arrayType$6 = $arrayType($Uint8, 28); ptrType = $ptrType(digest); blockGeneric = function(dig, p) { var _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.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"), undefined) : w[i] = (((((((((((j < 0 || j >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + j]) >>> 0)) << 24 >>> 0) | ((((x = j + 1 >> 0, ((x < 0 || x >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : 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"), undefined) : 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"), undefined) : 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"), undefined) : w[x$3])); t1 = ((((bits.RotateLeft32(v1, -17)) ^ (bits.RotateLeft32(v1, -19))) >>> 0) ^ ((v1 >>> 10 >>> 0))) >>> 0; v2 = (x$4 = i$1 - 15 >> 0, ((x$4 < 0 || x$4 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[x$4])); t2 = ((((bits.RotateLeft32(v2, -7)) ^ (bits.RotateLeft32(v2, -18))) >>> 0) ^ ((v2 >>> 3 >>> 0))) >>> 0; ((i$1 < 0 || i$1 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[i$1] = (((t1 + (x$5 = i$1 - 7 >> 0, ((x$5 < 0 || x$5 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[x$5])) >>> 0) + t2 >>> 0) + (x$6 = i$1 - 16 >> 0, ((x$6 < 0 || x$6 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : 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 + ((((((bits.RotateLeft32(e, -6)) ^ (bits.RotateLeft32(e, -11))) >>> 0) ^ (bits.RotateLeft32(e, -25))) >>> 0)) >>> 0) + ((((((e & f) >>> 0)) ^ ((((~e >>> 0) & g) >>> 0))) >>> 0)) >>> 0) + ((i$2 < 0 || i$2 >= _K.$length) ? ($throwRuntimeError("index out of range"), undefined) : _K.$array[_K.$offset + i$2]) >>> 0) + ((i$2 < 0 || i$2 >= w.length) ? ($throwRuntimeError("index out of range"), undefined) : w[i$2]) >>> 0; t2$1 = ((((((bits.RotateLeft32(a, -2)) ^ (bits.RotateLeft32(a, -13))) >>> 0) ^ (bits.RotateLeft32(a, -22))) >>> 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; }; init = function() { crypto.RegisterHash(4, New224); crypto.RegisterHash(5, New); }; digest.ptr.prototype.MarshalBinary = function() { var b, d; d = this; b = $makeSlice(sliceType$1, 0, 108); if (d.is224) { b = $appendSlice(b, "sha\x02"); } else { b = $appendSlice(b, "sha\x03"); } b = appendUint32(b, d.h[0]); b = appendUint32(b, d.h[1]); b = appendUint32(b, d.h[2]); b = appendUint32(b, d.h[3]); b = appendUint32(b, d.h[4]); b = appendUint32(b, d.h[5]); b = appendUint32(b, d.h[6]); b = appendUint32(b, d.h[7]); b = $appendSlice(b, $subslice(new sliceType$1(d.x), 0, d.nx)); b = $subslice(b, 0, ((b.$length + 64 >> 0) - (d.nx) >> 0)); b = appendUint64(b, d.len); return [b, $ifaceNil]; }; digest.prototype.MarshalBinary = function() { return this.$val.MarshalBinary(); }; digest.ptr.prototype.UnmarshalBinary = function(b) { var _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, _tuple$8, b, d; d = this; if (b.$length < 4 || (d.is224 && !(($bytesToString($subslice(b, 0, 4))) === "sha\x02")) || (!d.is224 && !(($bytesToString($subslice(b, 0, 4))) === "sha\x03"))) { return errors.New("crypto/sha256: invalid hash state identifier"); } if (!((b.$length === 108))) { return errors.New("crypto/sha256: invalid hash state size"); } b = $subslice(b, 4); _tuple = consumeUint32(b); b = _tuple[0]; d.h[0] = _tuple[1]; _tuple$1 = consumeUint32(b); b = _tuple$1[0]; d.h[1] = _tuple$1[1]; _tuple$2 = consumeUint32(b); b = _tuple$2[0]; d.h[2] = _tuple$2[1]; _tuple$3 = consumeUint32(b); b = _tuple$3[0]; d.h[3] = _tuple$3[1]; _tuple$4 = consumeUint32(b); b = _tuple$4[0]; d.h[4] = _tuple$4[1]; _tuple$5 = consumeUint32(b); b = _tuple$5[0]; d.h[5] = _tuple$5[1]; _tuple$6 = consumeUint32(b); b = _tuple$6[0]; d.h[6] = _tuple$6[1]; _tuple$7 = consumeUint32(b); b = _tuple$7[0]; d.h[7] = _tuple$7[1]; b = $subslice(b, $copySlice(new sliceType$1(d.x), b)); _tuple$8 = consumeUint64(b); b = _tuple$8[0]; d.len = _tuple$8[1]; d.nx = (($div64(d.len, new $Uint64(0, 64), true).$low >> 0)); return $ifaceNil; }; digest.prototype.UnmarshalBinary = function(b) { return this.$val.UnmarshalBinary(b); }; appendUint64 = function(b, x) { var a, b, x; a = arrayType$1.zero(); $clone(binary.BigEndian, binary.bigEndian).PutUint64(new sliceType$1(a), x); return $appendSlice(b, new sliceType$1(a)); }; appendUint32 = function(b, x) { var a, b, x; a = arrayType$2.zero(); $clone(binary.BigEndian, binary.bigEndian).PutUint32(new sliceType$1(a), x); return $appendSlice(b, new sliceType$1(a)); }; consumeUint64 = function(b) { var b, 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; $unused((7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7])); x$14 = (x = (x$1 = (x$2 = (x$3 = (x$4 = (x$5 = (x$6 = (new $Uint64(0, (7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7]))), x$7 = $shiftLeft64((new $Uint64(0, (6 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 6]))), 8), new $Uint64(x$6.$high | x$7.$high, (x$6.$low | x$7.$low) >>> 0)), x$8 = $shiftLeft64((new $Uint64(0, (5 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 5]))), 16), new $Uint64(x$5.$high | x$8.$high, (x$5.$low | x$8.$low) >>> 0)), x$9 = $shiftLeft64((new $Uint64(0, (4 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 4]))), 24), new $Uint64(x$4.$high | x$9.$high, (x$4.$low | x$9.$low) >>> 0)), x$10 = $shiftLeft64((new $Uint64(0, (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]))), 32), new $Uint64(x$3.$high | x$10.$high, (x$3.$low | x$10.$low) >>> 0)), x$11 = $shiftLeft64((new $Uint64(0, (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]))), 40), new $Uint64(x$2.$high | x$11.$high, (x$2.$low | x$11.$low) >>> 0)), x$12 = $shiftLeft64((new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), 48), new $Uint64(x$1.$high | x$12.$high, (x$1.$low | x$12.$low) >>> 0)), x$13 = $shiftLeft64((new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), 56), new $Uint64(x.$high | x$13.$high, (x.$low | x$13.$low) >>> 0)); return [$subslice(b, 8), x$14]; }; consumeUint32 = function(b) { var b, x; $unused((3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3])); x = ((((((((3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]) >>> 0)) | ((((2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]) >>> 0)) << 8 >>> 0)) >>> 0) | ((((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]) >>> 0)) << 16 >>> 0)) >>> 0) | ((((0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]) >>> 0)) << 24 >>> 0)) >>> 0; return [$subslice(b, 4), x]; }; digest.ptr.prototype.Reset = function() { var 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 d; d = new digest.ptr(arrayType$3.zero(), arrayType$4.zero(), 0, new $Uint64(0, 0), false); d.Reset(); return d; }; $pkg.New = New; New224 = function() { var d; d = new digest.ptr(arrayType$3.zero(), arrayType$4.zero(), 0, new $Uint64(0, 0), false); d.is224 = true; d.Reset(); return d; }; $pkg.New224 = New224; digest.ptr.prototype.Size = function() { var d; d = this; if (!d.is224) { return 32; } return 28; }; digest.prototype.Size = function() { return this.$val.Size(); }; digest.ptr.prototype.BlockSize = function() { var d; d = this; return 64; }; digest.prototype.BlockSize = function() { return this.$val.BlockSize(); }; digest.ptr.prototype.Write = function(p) { var d, err, n, n$1, nn, p, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; d = $f.d; err = $f.err; n = $f.n; n$1 = $f.n$1; nn = $f.nn; p = $f.p; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: 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) { $s = 1; continue; } /* */ $s = 2; continue; /* if (d.nx > 0) { */ case 1: n = $copySlice($subslice(new sliceType$1(d.x), d.nx), p); d.nx = d.nx + (n) >> 0; /* */ if (d.nx === 64) { $s = 3; continue; } /* */ $s = 4; continue; /* if (d.nx === 64) { */ case 3: $r = block(d, new sliceType$1(d.x)); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } d.nx = 0; /* } */ case 4: p = $subslice(p, n); /* } */ case 2: /* */ if (p.$length >= 64) { $s = 6; continue; } /* */ $s = 7; continue; /* if (p.$length >= 64) { */ case 6: n$1 = (p.$length & ~63) >> 0; $r = block(d, $subslice(p, 0, n$1)); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } p = $subslice(p, n$1); /* } */ case 7: if (p.$length > 0) { d.nx = $copySlice(new sliceType$1(d.x), p); } $s = -1; return [nn, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: digest.ptr.prototype.Write }; } $f.d = d; $f.err = err; $f.n = n; $f.n$1 = n$1; $f.nn = nn; $f.p = p; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; digest.prototype.Write = function(p) { return this.$val.Write(p); }; digest.ptr.prototype.Sum = function(in$1) { var _r, d, d0, hash$1, in$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; d = $f.d; d0 = $f.d0; hash$1 = $f.hash$1; in$1 = $f.in$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: d = this; d0 = $clone(d, digest); _r = d0.checkSum(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } hash$1 = $clone(_r, arrayType$5); if (d0.is224) { $s = -1; return $appendSlice(in$1, $subslice(new sliceType$1(hash$1), 0, 28)); } $s = -1; return $appendSlice(in$1, new sliceType$1(hash$1)); /* */ } return; } if ($f === undefined) { $f = { $blk: digest.ptr.prototype.Sum }; } $f._r = _r; $f.d = d; $f.d0 = d0; $f.hash$1 = hash$1; $f.in$1 = in$1; $f.$s = $s; $f.$r = $r; return $f; }; digest.prototype.Sum = function(in$1) { return this.$val.Sum(in$1); }; digest.ptr.prototype.checkSum = function() { var _r, _r$1, _r$2, d, digest$1, len, tmp, x, x$1, x$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; d = $f.d; digest$1 = $f.digest$1; len = $f.len; tmp = $f.tmp; 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: d = this; len = d.len; tmp = arrayType$4.zero(); tmp[0] = 128; /* */ if ((x = $div64(len, new $Uint64(0, 64), true), (x.$high < 0 || (x.$high === 0 && x.$low < 56)))) { $s = 1; continue; } /* */ $s = 2; continue; /* if ((x = $div64(len, new $Uint64(0, 64), true), (x.$high < 0 || (x.$high === 0 && x.$low < 56)))) { */ case 1: _r = 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))))); /* */ $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 = 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))))); /* */ $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: len = $shiftLeft64(len, (3)); $clone(binary.BigEndian, binary.bigEndian).PutUint64(new sliceType$1(tmp), len); _r$2 = d.Write($subslice(new sliceType$1(tmp), 0, 8)); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; if (!((d.nx === 0))) { $panic(new $String("d.nx != 0")); } digest$1 = arrayType$5.zero(); $clone(binary.BigEndian, binary.bigEndian).PutUint32($subslice(new sliceType$1(digest$1), 0), d.h[0]); $clone(binary.BigEndian, binary.bigEndian).PutUint32($subslice(new sliceType$1(digest$1), 4), d.h[1]); $clone(binary.BigEndian, binary.bigEndian).PutUint32($subslice(new sliceType$1(digest$1), 8), d.h[2]); $clone(binary.BigEndian, binary.bigEndian).PutUint32($subslice(new sliceType$1(digest$1), 12), d.h[3]); $clone(binary.BigEndian, binary.bigEndian).PutUint32($subslice(new sliceType$1(digest$1), 16), d.h[4]); $clone(binary.BigEndian, binary.bigEndian).PutUint32($subslice(new sliceType$1(digest$1), 20), d.h[5]); $clone(binary.BigEndian, binary.bigEndian).PutUint32($subslice(new sliceType$1(digest$1), 24), d.h[6]); if (!d.is224) { $clone(binary.BigEndian, binary.bigEndian).PutUint32($subslice(new sliceType$1(digest$1), 28), d.h[7]); } $s = -1; return digest$1; /* */ } return; } if ($f === undefined) { $f = { $blk: digest.ptr.prototype.checkSum }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.d = d; $f.digest$1 = digest$1; $f.len = len; $f.tmp = tmp; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; }; digest.prototype.checkSum = function() { return this.$val.checkSum(); }; Sum224 = function(data) { var _r, _r$1, d, data, sum, sum224, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; d = $f.d; data = $f.data; sum = $f.sum; sum224 = $f.sum224; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sum224 = arrayType$6.zero(); d = new digest.ptr(arrayType$3.zero(), arrayType$4.zero(), 0, new $Uint64(0, 0), false); d.is224 = true; d.Reset(); _r = d.Write(data); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; _r$1 = d.checkSum(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } sum = $clone(_r$1, arrayType$5); $copySlice(new sliceType$1(sum224), $subslice(new sliceType$1(sum), 0, 28)); $s = -1; return sum224; /* */ } return; } if ($f === undefined) { $f = { $blk: Sum224 }; } $f._r = _r; $f._r$1 = _r$1; $f.d = d; $f.data = data; $f.sum = sum; $f.sum224 = sum224; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Sum224 = Sum224; ptrType.methods = [{prop: "MarshalBinary", name: "MarshalBinary", pkg: "", typ: $funcType([], [sliceType$1, $error], false)}, {prop: "UnmarshalBinary", name: "UnmarshalBinary", pkg: "", typ: $funcType([sliceType$1], [$error], false)}, {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$5], false)}]; digest.init("crypto/sha256", [{prop: "h", name: "h", embedded: false, exported: false, typ: arrayType$3, tag: ""}, {prop: "x", name: "x", embedded: false, exported: false, typ: arrayType$4, tag: ""}, {prop: "nx", name: "nx", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "len", name: "len", embedded: false, exported: false, typ: $Uint64, tag: ""}, {prop: "is224", name: "is224", embedded: false, exported: false, 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 = 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 = hash.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = bits.$init(); /* */ $s = 5; case 5: 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]); block = blockGeneric; init(); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["crypto/dsa"] = (function() { var $pkg = {}, $init, randutil, errors, io, big, Parameters, PublicKey, ptrType; randutil = $packages["crypto/internal/randutil"]; errors = $packages["errors"]; io = $packages["io"]; big = $packages["math/big"]; Parameters = $pkg.Parameters = $newType(0, $kindStruct, "dsa.Parameters", true, "crypto/dsa", true, function(P_, Q_, G_) { this.$val = this; if (arguments.length === 0) { this.P = ptrType.nil; this.Q = ptrType.nil; this.G = ptrType.nil; return; } this.P = P_; this.Q = Q_; this.G = G_; }); PublicKey = $pkg.PublicKey = $newType(0, $kindStruct, "dsa.PublicKey", true, "crypto/dsa", true, function(Parameters_, Y_) { this.$val = this; if (arguments.length === 0) { this.Parameters = new Parameters.ptr(ptrType.nil, ptrType.nil, ptrType.nil); this.Y = ptrType.nil; return; } this.Parameters = Parameters_; this.Y = Y_; }); ptrType = $ptrType(big.Int); Parameters.init("", [{prop: "P", name: "P", embedded: false, exported: true, typ: ptrType, tag: ""}, {prop: "Q", name: "Q", embedded: false, exported: true, typ: ptrType, tag: ""}, {prop: "G", name: "G", embedded: false, exported: true, typ: ptrType, tag: ""}]); PublicKey.init("", [{prop: "Parameters", name: "Parameters", embedded: true, exported: true, typ: Parameters, tag: ""}, {prop: "Y", name: "Y", embedded: false, exported: true, 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: $r = randutil.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = errors.$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.ErrInvalidPublicKey = errors.New("crypto/dsa: invalid public key"); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["encoding/hex"] = (function() { var $pkg = {}, $init, errors, fmt, io, strings, sliceType$1, EncodedLen, Encode, EncodeToString; errors = $packages["errors"]; fmt = $packages["fmt"]; io = $packages["io"]; strings = $packages["strings"]; sliceType$1 = $sliceType($Uint8); EncodedLen = function(n) { var n; return $imul(n, 2); }; $pkg.EncodedLen = EncodedLen; Encode = function(dst, src) { var _i, _ref, dst, j, src, v, x; j = 0; _ref = src; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); ((j < 0 || j >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + j] = "0123456789abcdef".charCodeAt((v >>> 4 << 24 >>> 24))); (x = j + 1 >> 0, ((x < 0 || x >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + x] = "0123456789abcdef".charCodeAt(((v & 15) >>> 0)))); j = j + (2) >> 0; _i++; } return $imul(src.$length, 2); }; $pkg.Encode = Encode; EncodeToString = function(src) { var dst, src; dst = $makeSlice(sliceType$1, EncodedLen(src.$length)); Encode(dst, src); return ($bytesToString(dst)); }; $pkg.EncodeToString = EncodeToString; $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 = strings.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $pkg.ErrLength = errors.New("encoding/hex: odd length hex string"); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["crypto/x509/pkix"] = (function() { var $pkg = {}, $init, asn1, hex, fmt, big, time, AlgorithmIdentifier, RDNSequence, RelativeDistinguishedNameSET, AttributeTypeAndValue, Extension, Name, CertificateList, TBSCertificateList, RevokedCertificate, sliceType, sliceType$1, sliceType$2, sliceType$3, sliceType$4, sliceType$5, sliceType$6, ptrType, ptrType$1, ptrType$2, sliceType$8, sliceType$9, ptrType$3, ptrType$4, attributeTypeNames, oidCountry, oidOrganization, oidOrganizationalUnit, oidCommonName, oidSerialNumber, oidLocality, oidProvince, oidStreetAddress, oidPostalCode, oidInAttributeTypeAndValue; asn1 = $packages["encoding/asn1"]; hex = $packages["encoding/hex"]; fmt = $packages["fmt"]; big = $packages["math/big"]; time = $packages["time"]; AlgorithmIdentifier = $pkg.AlgorithmIdentifier = $newType(0, $kindStruct, "pkix.AlgorithmIdentifier", true, "crypto/x509/pkix", true, function(Algorithm_, Parameters_) { this.$val = this; if (arguments.length === 0) { this.Algorithm = asn1.ObjectIdentifier.nil; this.Parameters = new asn1.RawValue.ptr(0, 0, false, sliceType$6.nil, sliceType$6.nil); return; } this.Algorithm = Algorithm_; this.Parameters = Parameters_; }); RDNSequence = $pkg.RDNSequence = $newType(12, $kindSlice, "pkix.RDNSequence", true, "crypto/x509/pkix", true, null); RelativeDistinguishedNameSET = $pkg.RelativeDistinguishedNameSET = $newType(12, $kindSlice, "pkix.RelativeDistinguishedNameSET", true, "crypto/x509/pkix", true, null); AttributeTypeAndValue = $pkg.AttributeTypeAndValue = $newType(0, $kindStruct, "pkix.AttributeTypeAndValue", true, "crypto/x509/pkix", true, function(Type_, Value_) { this.$val = this; if (arguments.length === 0) { this.Type = asn1.ObjectIdentifier.nil; this.Value = $ifaceNil; return; } this.Type = Type_; this.Value = Value_; }); Extension = $pkg.Extension = $newType(0, $kindStruct, "pkix.Extension", true, "crypto/x509/pkix", true, function(Id_, Critical_, Value_) { this.$val = this; if (arguments.length === 0) { this.Id = asn1.ObjectIdentifier.nil; this.Critical = false; this.Value = sliceType$6.nil; return; } this.Id = Id_; this.Critical = Critical_; this.Value = Value_; }); Name = $pkg.Name = $newType(0, $kindStruct, "pkix.Name", true, "crypto/x509/pkix", true, function(Country_, Organization_, OrganizationalUnit_, Locality_, Province_, StreetAddress_, PostalCode_, SerialNumber_, CommonName_, Names_, ExtraNames_) { this.$val = this; if (arguments.length === 0) { this.Country = sliceType$4.nil; this.Organization = sliceType$4.nil; this.OrganizationalUnit = sliceType$4.nil; this.Locality = sliceType$4.nil; this.Province = sliceType$4.nil; this.StreetAddress = sliceType$4.nil; this.PostalCode = sliceType$4.nil; this.SerialNumber = ""; this.CommonName = ""; this.Names = sliceType$3.nil; this.ExtraNames = sliceType$3.nil; return; } this.Country = Country_; this.Organization = Organization_; this.OrganizationalUnit = OrganizationalUnit_; this.Locality = Locality_; this.Province = Province_; this.StreetAddress = StreetAddress_; this.PostalCode = PostalCode_; this.SerialNumber = SerialNumber_; this.CommonName = CommonName_; this.Names = Names_; this.ExtraNames = ExtraNames_; }); CertificateList = $pkg.CertificateList = $newType(0, $kindStruct, "pkix.CertificateList", true, "crypto/x509/pkix", true, function(TBSCertList_, SignatureAlgorithm_, SignatureValue_) { this.$val = this; if (arguments.length === 0) { this.TBSCertList = new TBSCertificateList.ptr(asn1.RawContent.nil, 0, new AlgorithmIdentifier.ptr(asn1.ObjectIdentifier.nil, new asn1.RawValue.ptr(0, 0, false, sliceType$6.nil, sliceType$6.nil)), RDNSequence.nil, new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil), new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil), sliceType$8.nil, sliceType$9.nil); this.SignatureAlgorithm = new AlgorithmIdentifier.ptr(asn1.ObjectIdentifier.nil, new asn1.RawValue.ptr(0, 0, false, sliceType$6.nil, sliceType$6.nil)); this.SignatureValue = new asn1.BitString.ptr(sliceType$6.nil, 0); return; } this.TBSCertList = TBSCertList_; this.SignatureAlgorithm = SignatureAlgorithm_; this.SignatureValue = SignatureValue_; }); TBSCertificateList = $pkg.TBSCertificateList = $newType(0, $kindStruct, "pkix.TBSCertificateList", true, "crypto/x509/pkix", true, function(Raw_, Version_, Signature_, Issuer_, ThisUpdate_, NextUpdate_, RevokedCertificates_, Extensions_) { this.$val = this; if (arguments.length === 0) { this.Raw = asn1.RawContent.nil; this.Version = 0; this.Signature = new AlgorithmIdentifier.ptr(asn1.ObjectIdentifier.nil, new asn1.RawValue.ptr(0, 0, false, sliceType$6.nil, sliceType$6.nil)); this.Issuer = RDNSequence.nil; this.ThisUpdate = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil); this.NextUpdate = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil); this.RevokedCertificates = sliceType$8.nil; this.Extensions = sliceType$9.nil; return; } this.Raw = Raw_; this.Version = Version_; this.Signature = Signature_; this.Issuer = Issuer_; this.ThisUpdate = ThisUpdate_; this.NextUpdate = NextUpdate_; this.RevokedCertificates = RevokedCertificates_; this.Extensions = Extensions_; }); RevokedCertificate = $pkg.RevokedCertificate = $newType(0, $kindStruct, "pkix.RevokedCertificate", true, "crypto/x509/pkix", true, function(SerialNumber_, RevocationTime_, Extensions_) { this.$val = this; if (arguments.length === 0) { this.SerialNumber = ptrType$4.nil; this.RevocationTime = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil); this.Extensions = sliceType$9.nil; return; } this.SerialNumber = SerialNumber_; this.RevocationTime = RevocationTime_; this.Extensions = Extensions_; }); sliceType = $sliceType($Int); sliceType$1 = $sliceType($emptyInterface); sliceType$2 = $sliceType($Int32); sliceType$3 = $sliceType(AttributeTypeAndValue); sliceType$4 = $sliceType($String); sliceType$5 = $sliceType(RelativeDistinguishedNameSET); sliceType$6 = $sliceType($Uint8); ptrType = $ptrType(RDNSequence); ptrType$1 = $ptrType(Name); ptrType$2 = $ptrType(time.Location); sliceType$8 = $sliceType(RevokedCertificate); sliceType$9 = $sliceType(Extension); ptrType$3 = $ptrType(CertificateList); ptrType$4 = $ptrType(big.Int); RDNSequence.prototype.String = function() { var _1, _entry, _i, _i$1, _r, _r$1, _ref, _ref$1, _rune, _tuple, _tuple$1, c, derBytes, err, escape, escaped, i, j, k, oidString, ok, r, rdn, s, tv, typeName, valueString, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _entry = $f._entry; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; _ref$1 = $f._ref$1; _rune = $f._rune; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; c = $f.c; derBytes = $f.derBytes; err = $f.err; escape = $f.escape; escaped = $f.escaped; i = $f.i; j = $f.j; k = $f.k; oidString = $f.oidString; ok = $f.ok; r = $f.r; rdn = $f.rdn; s = $f.s; tv = $f.tv; typeName = $f.typeName; valueString = $f.valueString; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; s = ""; i = 0; /* while (true) { */ case 1: /* if (!(i < r.$length)) { break; } */ if(!(i < r.$length)) { $s = 2; continue; } rdn = (x = (r.$length - 1 >> 0) - i >> 0, ((x < 0 || x >= r.$length) ? ($throwRuntimeError("index out of range"), undefined) : r.$array[r.$offset + x])); if (i > 0) { s = s + (","); } _ref = rdn; _i = 0; /* while (true) { */ case 3: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 4; continue; } j = _i; tv = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), AttributeTypeAndValue); if (j > 0) { s = s + ("+"); } oidString = tv.Type.String(); _tuple = (_entry = attributeTypeNames[$String.keyFor(oidString)], _entry !== undefined ? [_entry.v, true] : ["", false]); typeName = _tuple[0]; ok = _tuple[1]; /* */ if (!ok) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!ok) { */ case 5: _r = asn1.Marshal(tv.Value); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple$1 = _r; derBytes = _tuple$1[0]; err = _tuple$1[1]; if ($interfaceIsEqual(err, $ifaceNil)) { s = s + (oidString + "=#" + hex.EncodeToString(derBytes)); _i++; /* continue; */ $s = 3; continue; } typeName = oidString; /* } */ case 6: _r$1 = fmt.Sprint(new sliceType$1([tv.Value])); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } valueString = _r$1; escaped = $makeSlice(sliceType$2, 0, valueString.length); _ref$1 = valueString; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.length)) { break; } _rune = $decodeRune(_ref$1, _i$1); k = _i$1; c = _rune[0]; escape = false; _1 = c; if ((_1 === (44)) || (_1 === (43)) || (_1 === (34)) || (_1 === (92)) || (_1 === (60)) || (_1 === (62)) || (_1 === (59))) { escape = true; } else if (_1 === (32)) { escape = (k === 0) || (k === (valueString.length - 1 >> 0)); } else if (_1 === (35)) { escape = k === 0; } if (escape) { escaped = $append(escaped, 92, c); } else { escaped = $append(escaped, c); } _i$1 += _rune[1]; } s = s + (typeName + "=" + ($runesToString(escaped))); _i++; $s = 3; continue; case 4: i = i + (1) >> 0; $s = 1; continue; case 2: $s = -1; return s; /* */ } return; } if ($f === undefined) { $f = { $blk: RDNSequence.prototype.String }; } $f._1 = _1; $f._entry = _entry; $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f._ref$1 = _ref$1; $f._rune = _rune; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.c = c; $f.derBytes = derBytes; $f.err = err; $f.escape = escape; $f.escaped = escaped; $f.i = i; $f.j = j; $f.k = k; $f.oidString = oidString; $f.ok = ok; $f.r = r; $f.rdn = rdn; $f.s = s; $f.tv = tv; $f.typeName = typeName; $f.valueString = valueString; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(RDNSequence).prototype.String = function() { return this.$get().String(); }; Name.ptr.prototype.FillFromRDNSequence = function(rdns) { var _1, _i, _i$1, _ref, _ref$1, _tuple, atv, n, ok, rdn, rdns, t, value; n = this; _ref = rdns.$get(); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } rdn = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (rdn.$length === 0) { _i++; continue; } _ref$1 = rdn; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } atv = $clone(((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]), AttributeTypeAndValue); n.Names = $append(n.Names, atv); _tuple = $assertType(atv.Value, $String, true); value = _tuple[0]; ok = _tuple[1]; if (!ok) { _i$1++; continue; } t = atv.Type; if ((t.$length === 4) && ((0 >= t.$length ? ($throwRuntimeError("index out of range"), undefined) : t.$array[t.$offset + 0]) === 2) && ((1 >= t.$length ? ($throwRuntimeError("index out of range"), undefined) : t.$array[t.$offset + 1]) === 5) && ((2 >= t.$length ? ($throwRuntimeError("index out of range"), undefined) : t.$array[t.$offset + 2]) === 4)) { _1 = (3 >= t.$length ? ($throwRuntimeError("index out of range"), undefined) : t.$array[t.$offset + 3]); if (_1 === (3)) { n.CommonName = value; } else if (_1 === (5)) { n.SerialNumber = value; } else if (_1 === (6)) { n.Country = $append(n.Country, value); } else if (_1 === (7)) { n.Locality = $append(n.Locality, value); } else if (_1 === (8)) { n.Province = $append(n.Province, value); } else if (_1 === (9)) { n.StreetAddress = $append(n.StreetAddress, value); } else if (_1 === (10)) { n.Organization = $append(n.Organization, value); } else if (_1 === (11)) { n.OrganizationalUnit = $append(n.OrganizationalUnit, value); } else if (_1 === (17)) { n.PostalCode = $append(n.PostalCode, value); } } _i$1++; } _i++; } }; Name.prototype.FillFromRDNSequence = function(rdns) { return this.$val.FillFromRDNSequence(rdns); }; Name.ptr.prototype.appendRDNs = function(in$1, values, oid) { var _i, _ref, i, in$1, n, oid, s, value, values; n = this; if ((values.$length === 0) || oidInAttributeTypeAndValue(oid, n.ExtraNames)) { return in$1; } s = $makeSlice(sliceType$3, values.$length); _ref = values; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; value = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); ((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]).Type = oid; ((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]).Value = new $String(value); _i++; } return $append(in$1, $convertSliceType(s, RelativeDistinguishedNameSET)); }; Name.prototype.appendRDNs = function(in$1, values, oid) { return this.$val.appendRDNs(in$1, values, oid); }; Name.ptr.prototype.ToRDNSequence = function() { var _i, _ref, atv, n, ret; ret = RDNSequence.nil; n = this; ret = $clone(n, Name).appendRDNs(ret, n.Country, $convertSliceType(oidCountry, asn1.ObjectIdentifier)); ret = $clone(n, Name).appendRDNs(ret, n.Province, $convertSliceType(oidProvince, asn1.ObjectIdentifier)); ret = $clone(n, Name).appendRDNs(ret, n.Locality, $convertSliceType(oidLocality, asn1.ObjectIdentifier)); ret = $clone(n, Name).appendRDNs(ret, n.StreetAddress, $convertSliceType(oidStreetAddress, asn1.ObjectIdentifier)); ret = $clone(n, Name).appendRDNs(ret, n.PostalCode, $convertSliceType(oidPostalCode, asn1.ObjectIdentifier)); ret = $clone(n, Name).appendRDNs(ret, n.Organization, $convertSliceType(oidOrganization, asn1.ObjectIdentifier)); ret = $clone(n, Name).appendRDNs(ret, n.OrganizationalUnit, $convertSliceType(oidOrganizationalUnit, asn1.ObjectIdentifier)); if (n.CommonName.length > 0) { ret = $clone(n, Name).appendRDNs(ret, new sliceType$4([n.CommonName]), $convertSliceType(oidCommonName, asn1.ObjectIdentifier)); } if (n.SerialNumber.length > 0) { ret = $clone(n, Name).appendRDNs(ret, new sliceType$4([n.SerialNumber]), $convertSliceType(oidSerialNumber, asn1.ObjectIdentifier)); } _ref = n.ExtraNames; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } atv = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), AttributeTypeAndValue); ret = $append(ret, $convertSliceType(new sliceType$3([$clone(atv, AttributeTypeAndValue)]), RelativeDistinguishedNameSET)); _i++; } ret = ret; return ret; }; Name.prototype.ToRDNSequence = function() { return this.$val.ToRDNSequence(); }; Name.ptr.prototype.String = function() { var $24r, _1, _i, _r, _ref, atv, n, rdns, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _1 = $f._1; _i = $f._i; _r = $f._r; _ref = $f._ref; atv = $f.atv; n = $f.n; rdns = $f.rdns; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = this; rdns = RDNSequence.nil; if (n.ExtraNames === sliceType$3.nil) { _ref = n.Names; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } atv = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), AttributeTypeAndValue); t = atv.Type; if ((t.$length === 4) && ((0 >= t.$length ? ($throwRuntimeError("index out of range"), undefined) : t.$array[t.$offset + 0]) === 2) && ((1 >= t.$length ? ($throwRuntimeError("index out of range"), undefined) : t.$array[t.$offset + 1]) === 5) && ((2 >= t.$length ? ($throwRuntimeError("index out of range"), undefined) : t.$array[t.$offset + 2]) === 4)) { _1 = (3 >= t.$length ? ($throwRuntimeError("index out of range"), undefined) : t.$array[t.$offset + 3]); if ((_1 === (3)) || (_1 === (5)) || (_1 === (6)) || (_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (17))) { _i++; continue; } } rdns = $append(rdns, $convertSliceType(new sliceType$3([$clone(atv, AttributeTypeAndValue)]), RelativeDistinguishedNameSET)); _i++; } } rdns = $appendSlice(rdns, $convertSliceType($clone(n, Name).ToRDNSequence(), sliceType$5)); _r = rdns.String(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Name.ptr.prototype.String }; } $f.$24r = $24r; $f._1 = _1; $f._i = _i; $f._r = _r; $f._ref = _ref; $f.atv = atv; $f.n = n; $f.rdns = rdns; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Name.prototype.String = function() { return this.$val.String(); }; oidInAttributeTypeAndValue = function(oid, atv) { var _i, _ref, a, atv, oid; _ref = atv; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } a = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), AttributeTypeAndValue); if (a.Type.Equal(oid)) { return true; } _i++; } return false; }; CertificateList.ptr.prototype.HasExpired = function(now) { var certList, now; certList = this; return !$clone(now, time.Time).Before($clone(certList.TBSCertList.NextUpdate, time.Time)); }; CertificateList.prototype.HasExpired = function(now) { return this.$val.HasExpired(now); }; RDNSequence.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; Name.methods = [{prop: "appendRDNs", name: "appendRDNs", pkg: "crypto/x509/pkix", typ: $funcType([RDNSequence, sliceType$4, asn1.ObjectIdentifier], [RDNSequence], false)}, {prop: "ToRDNSequence", name: "ToRDNSequence", pkg: "", typ: $funcType([], [RDNSequence], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$1.methods = [{prop: "FillFromRDNSequence", name: "FillFromRDNSequence", pkg: "", typ: $funcType([ptrType], [], false)}]; ptrType$3.methods = [{prop: "HasExpired", name: "HasExpired", pkg: "", typ: $funcType([time.Time], [$Bool], false)}]; AlgorithmIdentifier.init("", [{prop: "Algorithm", name: "Algorithm", embedded: false, exported: true, typ: asn1.ObjectIdentifier, tag: ""}, {prop: "Parameters", name: "Parameters", embedded: false, exported: true, typ: asn1.RawValue, tag: "asn1:\"optional\""}]); RDNSequence.init(RelativeDistinguishedNameSET); RelativeDistinguishedNameSET.init(AttributeTypeAndValue); AttributeTypeAndValue.init("", [{prop: "Type", name: "Type", embedded: false, exported: true, typ: asn1.ObjectIdentifier, tag: ""}, {prop: "Value", name: "Value", embedded: false, exported: true, typ: $emptyInterface, tag: ""}]); Extension.init("", [{prop: "Id", name: "Id", embedded: false, exported: true, typ: asn1.ObjectIdentifier, tag: ""}, {prop: "Critical", name: "Critical", embedded: false, exported: true, typ: $Bool, tag: "asn1:\"optional\""}, {prop: "Value", name: "Value", embedded: false, exported: true, typ: sliceType$6, tag: ""}]); Name.init("", [{prop: "Country", name: "Country", embedded: false, exported: true, typ: sliceType$4, tag: ""}, {prop: "Organization", name: "Organization", embedded: false, exported: true, typ: sliceType$4, tag: ""}, {prop: "OrganizationalUnit", name: "OrganizationalUnit", embedded: false, exported: true, typ: sliceType$4, tag: ""}, {prop: "Locality", name: "Locality", embedded: false, exported: true, typ: sliceType$4, tag: ""}, {prop: "Province", name: "Province", embedded: false, exported: true, typ: sliceType$4, tag: ""}, {prop: "StreetAddress", name: "StreetAddress", embedded: false, exported: true, typ: sliceType$4, tag: ""}, {prop: "PostalCode", name: "PostalCode", embedded: false, exported: true, typ: sliceType$4, tag: ""}, {prop: "SerialNumber", name: "SerialNumber", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "CommonName", name: "CommonName", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Names", name: "Names", embedded: false, exported: true, typ: sliceType$3, tag: ""}, {prop: "ExtraNames", name: "ExtraNames", embedded: false, exported: true, typ: sliceType$3, tag: ""}]); CertificateList.init("", [{prop: "TBSCertList", name: "TBSCertList", embedded: false, exported: true, typ: TBSCertificateList, tag: ""}, {prop: "SignatureAlgorithm", name: "SignatureAlgorithm", embedded: false, exported: true, typ: AlgorithmIdentifier, tag: ""}, {prop: "SignatureValue", name: "SignatureValue", embedded: false, exported: true, typ: asn1.BitString, tag: ""}]); TBSCertificateList.init("", [{prop: "Raw", name: "Raw", embedded: false, exported: true, typ: asn1.RawContent, tag: ""}, {prop: "Version", name: "Version", embedded: false, exported: true, typ: $Int, tag: "asn1:\"optional,default:0\""}, {prop: "Signature", name: "Signature", embedded: false, exported: true, typ: AlgorithmIdentifier, tag: ""}, {prop: "Issuer", name: "Issuer", embedded: false, exported: true, typ: RDNSequence, tag: ""}, {prop: "ThisUpdate", name: "ThisUpdate", embedded: false, exported: true, typ: time.Time, tag: ""}, {prop: "NextUpdate", name: "NextUpdate", embedded: false, exported: true, typ: time.Time, tag: "asn1:\"optional\""}, {prop: "RevokedCertificates", name: "RevokedCertificates", embedded: false, exported: true, typ: sliceType$8, tag: "asn1:\"optional\""}, {prop: "Extensions", name: "Extensions", embedded: false, exported: true, typ: sliceType$9, tag: "asn1:\"tag:0,optional,explicit\""}]); RevokedCertificate.init("", [{prop: "SerialNumber", name: "SerialNumber", embedded: false, exported: true, typ: ptrType$4, tag: ""}, {prop: "RevocationTime", name: "RevocationTime", embedded: false, exported: true, typ: time.Time, tag: ""}, {prop: "Extensions", name: "Extensions", embedded: false, exported: true, typ: sliceType$9, tag: "asn1:\"optional\""}]); $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 = asn1.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = hex.$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 = big.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = time.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } attributeTypeNames = $makeMap($String.keyFor, [{ k: "2.5.4.6", v: "C" }, { k: "2.5.4.10", v: "O" }, { k: "2.5.4.11", v: "OU" }, { k: "2.5.4.3", v: "CN" }, { k: "2.5.4.5", v: "SERIALNUMBER" }, { k: "2.5.4.7", v: "L" }, { k: "2.5.4.8", v: "ST" }, { k: "2.5.4.9", v: "STREET" }, { k: "2.5.4.17", v: "POSTALCODE" }]); oidCountry = new sliceType([2, 5, 4, 6]); oidOrganization = new sliceType([2, 5, 4, 10]); oidOrganizationalUnit = new sliceType([2, 5, 4, 11]); oidCommonName = new sliceType([2, 5, 4, 3]); oidSerialNumber = new sliceType([2, 5, 4, 5]); oidLocality = new sliceType([2, 5, 4, 7]); oidProvince = new sliceType([2, 5, 4, 8]); oidStreetAddress = new sliceType([2, 5, 4, 9]); oidPostalCode = new sliceType([2, 5, 4, 17]); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["encoding/pem"] = (function() { var $pkg = {}, $init, bytes, base64, errors, io, sort, strings, Block, sliceType, ptrType, mapType, pemStart, pemEnd, pemEndOfLine, getLine, removeSpacesAndTabs, Decode, decodeError; bytes = $packages["bytes"]; base64 = $packages["encoding/base64"]; errors = $packages["errors"]; io = $packages["io"]; sort = $packages["sort"]; strings = $packages["strings"]; Block = $pkg.Block = $newType(0, $kindStruct, "pem.Block", true, "encoding/pem", true, function(Type_, Headers_, Bytes_) { this.$val = this; if (arguments.length === 0) { this.Type = ""; this.Headers = false; this.Bytes = sliceType.nil; return; } this.Type = Type_; this.Headers = Headers_; this.Bytes = Bytes_; }); sliceType = $sliceType($Uint8); ptrType = $ptrType(Block); mapType = $mapType($String, $String); getLine = function(data) { var $24r, _r, _tmp, _tmp$1, data, i, j, line, rest, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; data = $f.data; i = $f.i; j = $f.j; line = $f.line; rest = $f.rest; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: line = sliceType.nil; rest = sliceType.nil; i = bytes.IndexByte(data, 10); j = 0; if (i < 0) { i = data.$length; j = i; } else { j = i + 1 >> 0; if (i > 0 && ((x = i - 1 >> 0, ((x < 0 || x >= data.$length) ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + x])) === 13)) { i = i - (1) >> 0; } } _r = bytes.TrimRight($subslice(data, 0, i), " \t"); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tmp = _r; _tmp$1 = $subslice(data, j); line = _tmp; rest = _tmp$1; $24r = [line, rest]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: getLine }; } $f.$24r = $24r; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.data = data; $f.i = i; $f.j = j; $f.line = line; $f.rest = rest; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; removeSpacesAndTabs = function(data) { var _i, _ref, b, data, n, result; if (!bytes.ContainsAny(data, " \t")) { return data; } result = $makeSlice(sliceType, data.$length); n = 0; _ref = data; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } b = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if ((b === 32) || (b === 9)) { _i++; continue; } ((n < 0 || n >= result.$length) ? ($throwRuntimeError("index out of range"), undefined) : result.$array[result.$offset + n] = b); n = n + (1) >> 0; _i++; } return $subslice(result, 0, n); }; Decode = function(data) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, $24r$5, _key, _r, _r$1, _r$10, _r$11, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, _tuple$1, _tuple$10, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, _tuple$8, _tuple$9, base64Data, data, endIndex, endTrailer, endTrailerIndex, endTrailerLen, err, i, i$1, key, line, n, next, p, rest, restOfEndLine, s, typeLine, val, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; _key = $f._key; _r = $f._r; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _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; _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; _tuple$1 = $f._tuple$1; _tuple$10 = $f._tuple$10; _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; _tuple$9 = $f._tuple$9; base64Data = $f.base64Data; data = $f.data; endIndex = $f.endIndex; endTrailer = $f.endTrailer; endTrailerIndex = $f.endTrailerIndex; endTrailerLen = $f.endTrailerLen; err = $f.err; i = $f.i; i$1 = $f.i$1; key = $f.key; line = $f.line; n = $f.n; next = $f.next; p = $f.p; rest = $f.rest; restOfEndLine = $f.restOfEndLine; s = $f.s; typeLine = $f.typeLine; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = ptrType.nil; rest = sliceType.nil; rest = data; if (bytes.HasPrefix(data, $subslice(pemStart, 1))) { rest = $subslice(rest, (pemStart.$length - 1 >> 0), data.$length); } else { i = bytes.Index(data, pemStart); if (i >= 0) { rest = $subslice(rest, (i + pemStart.$length >> 0), data.$length); } else { _tmp = ptrType.nil; _tmp$1 = data; p = _tmp; rest = _tmp$1; $s = -1; return [p, rest]; } } _r = getLine(rest); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; typeLine = _tuple[0]; rest = _tuple[1]; /* */ if (!bytes.HasSuffix(typeLine, pemEndOfLine)) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!bytes.HasSuffix(typeLine, pemEndOfLine)) { */ case 2: _r$1 = decodeError(data, rest); /* */ $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; p = _tuple$1[0]; rest = _tuple$1[1]; $24r = [p, rest]; $s = 5; case 5: return $24r; /* } */ case 3: typeLine = $subslice(typeLine, 0, (typeLine.$length - pemEndOfLine.$length >> 0)); p = new Block.ptr(($bytesToString(typeLine)), {}, sliceType.nil); /* while (true) { */ case 6: if (rest.$length === 0) { _tmp$2 = ptrType.nil; _tmp$3 = data; p = _tmp$2; rest = _tmp$3; $s = -1; return [p, rest]; } _r$2 = getLine(rest); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$2 = _r$2; line = _tuple$2[0]; next = _tuple$2[1]; i$1 = bytes.IndexByte(line, 58); if (i$1 === -1) { /* break; */ $s = 7; continue; } _tmp$4 = $subslice(line, 0, i$1); _tmp$5 = $subslice(line, (i$1 + 1 >> 0)); key = _tmp$4; val = _tmp$5; _r$3 = bytes.TrimSpace(key); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } key = _r$3; _r$4 = bytes.TrimSpace(val); /* */ $s = 10; case 10: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } val = _r$4; _key = ($bytesToString(key)); (p.Headers || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: ($bytesToString(val)) }; rest = next; $s = 6; continue; case 7: _tmp$6 = 0; _tmp$7 = 0; endIndex = _tmp$6; endTrailerIndex = _tmp$7; if (($keys(p.Headers).length === 0) && bytes.HasPrefix(rest, $subslice(pemEnd, 1))) { endIndex = 0; endTrailerIndex = pemEnd.$length - 1 >> 0; } else { endIndex = bytes.Index(rest, pemEnd); endTrailerIndex = endIndex + pemEnd.$length >> 0; } /* */ if (endIndex < 0) { $s = 11; continue; } /* */ $s = 12; continue; /* if (endIndex < 0) { */ case 11: _r$5 = decodeError(data, rest); /* */ $s = 13; case 13: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$3 = _r$5; p = _tuple$3[0]; rest = _tuple$3[1]; $24r$1 = [p, rest]; $s = 14; case 14: return $24r$1; /* } */ case 12: endTrailer = $subslice(rest, endTrailerIndex); endTrailerLen = typeLine.$length + pemEndOfLine.$length >> 0; /* */ if (endTrailer.$length < endTrailerLen) { $s = 15; continue; } /* */ $s = 16; continue; /* if (endTrailer.$length < endTrailerLen) { */ case 15: _r$6 = decodeError(data, rest); /* */ $s = 17; case 17: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tuple$4 = _r$6; p = _tuple$4[0]; rest = _tuple$4[1]; $24r$2 = [p, rest]; $s = 18; case 18: return $24r$2; /* } */ case 16: restOfEndLine = $subslice(endTrailer, endTrailerLen); endTrailer = $subslice(endTrailer, 0, endTrailerLen); /* */ if (!bytes.HasPrefix(endTrailer, typeLine) || !bytes.HasSuffix(endTrailer, pemEndOfLine)) { $s = 19; continue; } /* */ $s = 20; continue; /* if (!bytes.HasPrefix(endTrailer, typeLine) || !bytes.HasSuffix(endTrailer, pemEndOfLine)) { */ case 19: _r$7 = decodeError(data, rest); /* */ $s = 21; case 21: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _tuple$5 = _r$7; p = _tuple$5[0]; rest = _tuple$5[1]; $24r$3 = [p, rest]; $s = 22; case 22: return $24r$3; /* } */ case 20: _r$8 = getLine(restOfEndLine); /* */ $s = 23; case 23: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _tuple$6 = _r$8; s = _tuple$6[0]; /* */ if (!((s.$length === 0))) { $s = 24; continue; } /* */ $s = 25; continue; /* if (!((s.$length === 0))) { */ case 24: _r$9 = decodeError(data, rest); /* */ $s = 26; case 26: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple$7 = _r$9; p = _tuple$7[0]; rest = _tuple$7[1]; $24r$4 = [p, rest]; $s = 27; case 27: return $24r$4; /* } */ case 25: base64Data = removeSpacesAndTabs($subslice(rest, 0, endIndex)); p.Bytes = $makeSlice(sliceType, base64.StdEncoding.DecodedLen(base64Data.$length)); _tuple$8 = base64.StdEncoding.Decode(p.Bytes, base64Data); n = _tuple$8[0]; err = _tuple$8[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 28; continue; } /* */ $s = 29; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 28: _r$10 = decodeError(data, rest); /* */ $s = 30; case 30: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$9 = _r$10; p = _tuple$9[0]; rest = _tuple$9[1]; $24r$5 = [p, rest]; $s = 31; case 31: return $24r$5; /* } */ case 29: p.Bytes = $subslice(p.Bytes, 0, n); _r$11 = getLine($subslice(rest, ((endIndex + pemEnd.$length >> 0) - 1 >> 0))); /* */ $s = 32; case 32: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tuple$10 = _r$11; rest = _tuple$10[1]; $s = -1; return [p, rest]; /* */ } return; } if ($f === undefined) { $f = { $blk: Decode }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f._key = _key; $f._r = _r; $f._r$1 = _r$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $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._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._tuple$1 = _tuple$1; $f._tuple$10 = _tuple$10; $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._tuple$9 = _tuple$9; $f.base64Data = base64Data; $f.data = data; $f.endIndex = endIndex; $f.endTrailer = endTrailer; $f.endTrailerIndex = endTrailerIndex; $f.endTrailerLen = endTrailerLen; $f.err = err; $f.i = i; $f.i$1 = i$1; $f.key = key; $f.line = line; $f.n = n; $f.next = next; $f.p = p; $f.rest = rest; $f.restOfEndLine = restOfEndLine; $f.s = s; $f.typeLine = typeLine; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Decode = Decode; decodeError = function(data, rest) { var _r, _tuple, data, p, rest, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; data = $f.data; p = $f.p; rest = $f.rest; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = Decode(rest); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; p = _tuple[0]; rest = _tuple[1]; if (p === ptrType.nil) { rest = data; } $s = -1; return [p, rest]; /* */ } return; } if ($f === undefined) { $f = { $blk: decodeError }; } $f._r = _r; $f._tuple = _tuple; $f.data = data; $f.p = p; $f.rest = rest; $f.$s = $s; $f.$r = $r; return $f; }; Block.init("", [{prop: "Type", name: "Type", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Headers", name: "Headers", embedded: false, exported: true, typ: mapType, tag: ""}, {prop: "Bytes", name: "Bytes", embedded: false, exported: true, typ: sliceType, 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 = base64.$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 = io.$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 = strings.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } pemStart = (new sliceType($stringToBytes("\n-----BEGIN "))); pemEnd = (new sliceType($stringToBytes("\n-----END "))); pemEndOfLine = (new sliceType($stringToBytes("-----"))); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["net/url"] = (function() { var $pkg = {}, $init, errors, fmt, sort, strconv, strings, Error, EscapeError, InvalidHostError, URL, Userinfo, Values, sliceType, interfaceType, interfaceType$1, ptrType, sliceType$1, arrayType, ptrType$1, ptrType$2, sliceType$2, ptrType$3, ishex, unhex, shouldEscape, QueryUnescape, unescape, QueryEscape, escape, User, UserPassword, getScheme, split, Parse, ParseRequestURI, parse, parseAuthority, parseHost, validEncoded, validOptionalPort, ParseQuery, parseQuery, resolvePath, splitHostPort, validUserinfo, stringContainsCTLByte; errors = $packages["errors"]; fmt = $packages["fmt"]; sort = $packages["sort"]; strconv = $packages["strconv"]; strings = $packages["strings"]; Error = $pkg.Error = $newType(0, $kindStruct, "url.Error", true, "net/url", true, function(Op_, URL_, Err_) { this.$val = this; if (arguments.length === 0) { this.Op = ""; this.URL = ""; this.Err = $ifaceNil; return; } this.Op = Op_; this.URL = URL_; this.Err = Err_; }); EscapeError = $pkg.EscapeError = $newType(8, $kindString, "url.EscapeError", true, "net/url", true, null); InvalidHostError = $pkg.InvalidHostError = $newType(8, $kindString, "url.InvalidHostError", true, "net/url", true, null); URL = $pkg.URL = $newType(0, $kindStruct, "url.URL", true, "net/url", true, function(Scheme_, Opaque_, User_, Host_, Path_, RawPath_, ForceQuery_, RawQuery_, Fragment_, RawFragment_) { this.$val = this; if (arguments.length === 0) { this.Scheme = ""; this.Opaque = ""; this.User = ptrType$1.nil; this.Host = ""; this.Path = ""; this.RawPath = ""; this.ForceQuery = false; this.RawQuery = ""; this.Fragment = ""; this.RawFragment = ""; return; } this.Scheme = Scheme_; this.Opaque = Opaque_; this.User = User_; this.Host = Host_; this.Path = Path_; this.RawPath = RawPath_; this.ForceQuery = ForceQuery_; this.RawQuery = RawQuery_; this.Fragment = Fragment_; this.RawFragment = RawFragment_; }); Userinfo = $pkg.Userinfo = $newType(0, $kindStruct, "url.Userinfo", true, "net/url", true, function(username_, password_, passwordSet_) { this.$val = this; if (arguments.length === 0) { this.username = ""; this.password = ""; this.passwordSet = false; return; } this.username = username_; this.password = password_; this.passwordSet = passwordSet_; }); Values = $pkg.Values = $newType(4, $kindMap, "url.Values", true, "net/url", true, null); sliceType = $sliceType($emptyInterface); interfaceType = $interfaceType([{prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}]); interfaceType$1 = $interfaceType([{prop: "Temporary", name: "Temporary", pkg: "", typ: $funcType([], [$Bool], false)}]); ptrType = $ptrType(strings.Builder); sliceType$1 = $sliceType($Uint8); arrayType = $arrayType($Uint8, 64); ptrType$1 = $ptrType(Userinfo); ptrType$2 = $ptrType(URL); sliceType$2 = $sliceType($String); ptrType$3 = $ptrType(Error); Error.ptr.prototype.Unwrap = function() { var e; e = this; return e.Err; }; Error.prototype.Unwrap = function() { return this.$val.Unwrap(); }; Error.ptr.prototype.Error = function() { var $24r, _r, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; _r = fmt.Sprintf("%s %q: %s", new sliceType([new $String(e.Op), new $String(e.URL), e.Err])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Error.ptr.prototype.Error }; } $f.$24r = $24r; $f._r = _r; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; Error.prototype.Error = function() { return this.$val.Error(); }; Error.ptr.prototype.Timeout = function() { var $24r, _r, _tuple, _v, e, ok, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _tuple = $f._tuple; _v = $f._v; e = $f.e; ok = $f.ok; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; _tuple = $assertType(e.Err, interfaceType, true); t = _tuple[0]; ok = _tuple[1]; if (!(ok)) { _v = false; $s = 1; continue s; } _r = t.Timeout(); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _v = _r; case 1: $24r = _v; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Error.ptr.prototype.Timeout }; } $f.$24r = $24r; $f._r = _r; $f._tuple = _tuple; $f._v = _v; $f.e = e; $f.ok = ok; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Error.prototype.Timeout = function() { return this.$val.Timeout(); }; Error.ptr.prototype.Temporary = function() { var $24r, _r, _tuple, _v, e, ok, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _tuple = $f._tuple; _v = $f._v; e = $f.e; ok = $f.ok; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; _tuple = $assertType(e.Err, interfaceType$1, true); t = _tuple[0]; ok = _tuple[1]; if (!(ok)) { _v = false; $s = 1; continue s; } _r = t.Temporary(); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _v = _r; case 1: $24r = _v; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Error.ptr.prototype.Temporary }; } $f.$24r = $24r; $f._r = _r; $f._tuple = _tuple; $f._v = _v; $f.e = e; $f.ok = ok; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Error.prototype.Temporary = function() { return this.$val.Temporary(); }; ishex = function(c) { var c; if (48 <= c && c <= 57) { return true; } else if (97 <= c && c <= 102) { return true; } else if (65 <= c && c <= 70) { return true; } return false; }; unhex = function(c) { var c; if (48 <= c && c <= 57) { return c - 48 << 24 >>> 24; } else if (97 <= c && c <= 102) { return (c - 97 << 24 >>> 24) + 10 << 24 >>> 24; } else if (65 <= c && c <= 70) { return (c - 65 << 24 >>> 24) + 10 << 24 >>> 24; } return 0; }; EscapeError.prototype.Error = function() { var e; e = this.$val; return "invalid URL escape " + strconv.Quote((e)); }; $ptrType(EscapeError).prototype.Error = function() { return new EscapeError(this.$get()).Error(); }; InvalidHostError.prototype.Error = function() { var e; e = this.$val; return "invalid character " + strconv.Quote((e)) + " in host name"; }; $ptrType(InvalidHostError).prototype.Error = function() { return new InvalidHostError(this.$get()).Error(); }; shouldEscape = function(c, mode) { var _1, _2, _3, _4, c, mode; if (97 <= c && c <= 122 || 65 <= c && c <= 90 || 48 <= c && c <= 57) { return false; } if ((mode === 3) || (mode === 4)) { _1 = c; if ((_1 === (33)) || (_1 === (36)) || (_1 === (38)) || (_1 === (39)) || (_1 === (40)) || (_1 === (41)) || (_1 === (42)) || (_1 === (43)) || (_1 === (44)) || (_1 === (59)) || (_1 === (61)) || (_1 === (58)) || (_1 === (91)) || (_1 === (93)) || (_1 === (60)) || (_1 === (62)) || (_1 === (34))) { return false; } } _2 = c; if ((_2 === (45)) || (_2 === (95)) || (_2 === (46)) || (_2 === (126))) { return false; } else if ((_2 === (36)) || (_2 === (38)) || (_2 === (43)) || (_2 === (44)) || (_2 === (47)) || (_2 === (58)) || (_2 === (59)) || (_2 === (61)) || (_2 === (63)) || (_2 === (64))) { _3 = mode; if (_3 === (1)) { return c === 63; } else if (_3 === (2)) { return (c === 47) || (c === 59) || (c === 44) || (c === 63); } else if (_3 === (5)) { return (c === 64) || (c === 47) || (c === 63) || (c === 58); } else if (_3 === (6)) { return true; } else if (_3 === (7)) { return false; } } if (mode === 7) { _4 = c; if ((_4 === (33)) || (_4 === (40)) || (_4 === (41)) || (_4 === (42))) { return false; } } return true; }; QueryUnescape = function(s) { var s; return unescape(s, 6); }; $pkg.QueryUnescape = QueryUnescape; unescape = function(s, mode) { var _1, _2, hasPlus, i, i$1, mode, n, s, t, v; n = 0; hasPlus = false; i = 0; while (true) { if (!(i < s.length)) { break; } _1 = s.charCodeAt(i); if (_1 === (37)) { n = n + (1) >> 0; if ((i + 2 >> 0) >= s.length || !ishex(s.charCodeAt((i + 1 >> 0))) || !ishex(s.charCodeAt((i + 2 >> 0)))) { s = $substring(s, i); if (s.length > 3) { s = $substring(s, 0, 3); } return ["", new EscapeError((s))]; } if ((mode === 3) && unhex(s.charCodeAt((i + 1 >> 0))) < 8 && !($substring(s, i, (i + 3 >> 0)) === "%25")) { return ["", new EscapeError(($substring(s, i, (i + 3 >> 0))))]; } if (mode === 4) { v = ((unhex(s.charCodeAt((i + 1 >> 0))) << 4 << 24 >>> 24) | unhex(s.charCodeAt((i + 2 >> 0)))) >>> 0; if (!($substring(s, i, (i + 3 >> 0)) === "%25") && !((v === 32)) && shouldEscape(v, 3)) { return ["", new EscapeError(($substring(s, i, (i + 3 >> 0))))]; } } i = i + (3) >> 0; } else if (_1 === (43)) { hasPlus = mode === 6; i = i + (1) >> 0; } else { if (((mode === 3) || (mode === 4)) && s.charCodeAt(i) < 128 && shouldEscape(s.charCodeAt(i), mode)) { return ["", new InvalidHostError(($substring(s, i, (i + 1 >> 0))))]; } i = i + (1) >> 0; } } if ((n === 0) && !hasPlus) { return [s, $ifaceNil]; } t = new strings.Builder.ptr(ptrType.nil, sliceType$1.nil); t.Grow(s.length - ($imul(2, n)) >> 0); i$1 = 0; while (true) { if (!(i$1 < s.length)) { break; } _2 = s.charCodeAt(i$1); if (_2 === (37)) { t.WriteByte(((unhex(s.charCodeAt((i$1 + 1 >> 0))) << 4 << 24 >>> 24) | unhex(s.charCodeAt((i$1 + 2 >> 0)))) >>> 0); i$1 = i$1 + (2) >> 0; } else if (_2 === (43)) { if (mode === 6) { t.WriteByte(32); } else { t.WriteByte(43); } } else { t.WriteByte(s.charCodeAt(i$1)); } i$1 = i$1 + (1) >> 0; } return [t.String(), $ifaceNil]; }; QueryEscape = function(s) { var s; return escape(s, 6); }; $pkg.QueryEscape = QueryEscape; escape = function(s, mode) { var _tmp, _tmp$1, buf, c, c$1, hexCount, i, i$1, i$2, j, mode, required, s, spaceCount, t, x, x$1; _tmp = 0; _tmp$1 = 0; spaceCount = _tmp; hexCount = _tmp$1; i = 0; while (true) { if (!(i < s.length)) { break; } c = s.charCodeAt(i); if (shouldEscape(c, mode)) { if ((c === 32) && (mode === 6)) { spaceCount = spaceCount + (1) >> 0; } else { hexCount = hexCount + (1) >> 0; } } i = i + (1) >> 0; } if ((spaceCount === 0) && (hexCount === 0)) { return s; } buf = arrayType.zero(); t = sliceType$1.nil; required = s.length + ($imul(2, hexCount)) >> 0; if (required <= 64) { t = $subslice(new sliceType$1(buf), 0, required); } else { t = $makeSlice(sliceType$1, required); } if (hexCount === 0) { $copyString(t, s); i$1 = 0; while (true) { if (!(i$1 < s.length)) { break; } if (s.charCodeAt(i$1) === 32) { ((i$1 < 0 || i$1 >= t.$length) ? ($throwRuntimeError("index out of range"), undefined) : t.$array[t.$offset + i$1] = 43); } i$1 = i$1 + (1) >> 0; } return ($bytesToString(t)); } j = 0; i$2 = 0; while (true) { if (!(i$2 < s.length)) { break; } c$1 = s.charCodeAt(i$2); if ((c$1 === 32) && (mode === 6)) { ((j < 0 || j >= t.$length) ? ($throwRuntimeError("index out of range"), undefined) : t.$array[t.$offset + j] = 43); j = j + (1) >> 0; } else if (shouldEscape(c$1, mode)) { ((j < 0 || j >= t.$length) ? ($throwRuntimeError("index out of range"), undefined) : t.$array[t.$offset + j] = 37); (x = j + 1 >> 0, ((x < 0 || x >= t.$length) ? ($throwRuntimeError("index out of range"), undefined) : t.$array[t.$offset + x] = "0123456789ABCDEF".charCodeAt((c$1 >>> 4 << 24 >>> 24)))); (x$1 = j + 2 >> 0, ((x$1 < 0 || x$1 >= t.$length) ? ($throwRuntimeError("index out of range"), undefined) : t.$array[t.$offset + x$1] = "0123456789ABCDEF".charCodeAt(((c$1 & 15) >>> 0)))); j = j + (3) >> 0; } else { ((j < 0 || j >= t.$length) ? ($throwRuntimeError("index out of range"), undefined) : t.$array[t.$offset + j] = s.charCodeAt(i$2)); j = j + (1) >> 0; } i$2 = i$2 + (1) >> 0; } return ($bytesToString(t)); }; User = function(username) { var username; return new Userinfo.ptr(username, "", false); }; $pkg.User = User; UserPassword = function(username, password) { var password, username; return new Userinfo.ptr(username, password, true); }; $pkg.UserPassword = UserPassword; Userinfo.ptr.prototype.Username = function() { var u; u = this; if (u === ptrType$1.nil) { return ""; } return u.username; }; Userinfo.prototype.Username = function() { return this.$val.Username(); }; Userinfo.ptr.prototype.Password = function() { var u; u = this; if (u === ptrType$1.nil) { return ["", false]; } return [u.password, u.passwordSet]; }; Userinfo.prototype.Password = function() { return this.$val.Password(); }; Userinfo.ptr.prototype.String = function() { var s, u; u = this; if (u === ptrType$1.nil) { return ""; } s = escape(u.username, 5); if (u.passwordSet) { s = s + (":" + escape(u.password, 5)); } return s; }; Userinfo.prototype.String = function() { return this.$val.String(); }; getScheme = function(rawURL) { var _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, c, err, i, path, rawURL, scheme; scheme = ""; path = ""; err = $ifaceNil; i = 0; while (true) { if (!(i < rawURL.length)) { break; } c = rawURL.charCodeAt(i); if (97 <= c && c <= 122 || 65 <= c && c <= 90) { } else if (48 <= c && c <= 57 || (c === 43) || (c === 45) || (c === 46)) { if (i === 0) { _tmp = ""; _tmp$1 = rawURL; _tmp$2 = $ifaceNil; scheme = _tmp; path = _tmp$1; err = _tmp$2; return [scheme, path, err]; } } else if ((c === 58)) { if (i === 0) { _tmp$3 = ""; _tmp$4 = ""; _tmp$5 = errors.New("missing protocol scheme"); scheme = _tmp$3; path = _tmp$4; err = _tmp$5; return [scheme, path, err]; } _tmp$6 = $substring(rawURL, 0, i); _tmp$7 = $substring(rawURL, (i + 1 >> 0)); _tmp$8 = $ifaceNil; scheme = _tmp$6; path = _tmp$7; err = _tmp$8; return [scheme, path, err]; } else { _tmp$9 = ""; _tmp$10 = rawURL; _tmp$11 = $ifaceNil; scheme = _tmp$9; path = _tmp$10; err = _tmp$11; return [scheme, path, err]; } i = i + (1) >> 0; } _tmp$12 = ""; _tmp$13 = rawURL; _tmp$14 = $ifaceNil; scheme = _tmp$12; path = _tmp$13; err = _tmp$14; return [scheme, path, err]; }; split = function(s, sep, cutc) { var cutc, i, s, sep; i = strings.IndexByte(s, sep); if (i < 0) { return [s, ""]; } if (cutc) { return [$substring(s, 0, i), $substring(s, (i + 1 >> 0))]; } return [$substring(s, 0, i), $substring(s, i)]; }; Parse = function(rawURL) { var _r, _tuple, _tuple$1, err, frag, rawURL, u, url, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; err = $f.err; frag = $f.frag; rawURL = $f.rawURL; u = $f.u; url = $f.url; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _tuple = split(rawURL, 35, true); u = _tuple[0]; frag = _tuple[1]; _r = parse(u, false); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple$1 = _r; url = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$2.nil, new Error.ptr("parse", u, err)]; } if (frag === "") { $s = -1; return [url, $ifaceNil]; } err = url.setFragment(frag); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$2.nil, new Error.ptr("parse", rawURL, err)]; } $s = -1; return [url, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Parse }; } $f._r = _r; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.err = err; $f.frag = frag; $f.rawURL = rawURL; $f.u = u; $f.url = url; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Parse = Parse; ParseRequestURI = function(rawURL) { var _r, _tuple, err, rawURL, url, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; rawURL = $f.rawURL; url = $f.url; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = parse(rawURL, true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; url = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$2.nil, new Error.ptr("parse", rawURL, err)]; } $s = -1; return [url, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: ParseRequestURI }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.rawURL = rawURL; $f.url = url; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.ParseRequestURI = ParseRequestURI; parse = function(rawURL, viaRequest) { var _r, _r$1, _tuple, _tuple$1, _tuple$2, _tuple$3, authority, colon, err, err$1, rawURL, rest, slash, url, viaRequest, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; authority = $f.authority; colon = $f.colon; err = $f.err; err$1 = $f.err$1; rawURL = $f.rawURL; rest = $f.rest; slash = $f.slash; url = $f.url; viaRequest = $f.viaRequest; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rest = ""; err = $ifaceNil; if (stringContainsCTLByte(rawURL)) { $s = -1; return [ptrType$2.nil, errors.New("net/url: invalid control character in URL")]; } if (rawURL === "" && viaRequest) { $s = -1; return [ptrType$2.nil, errors.New("empty url")]; } url = new URL.ptr("", "", ptrType$1.nil, "", "", "", false, "", "", ""); if (rawURL === "*") { url.Path = "*"; $s = -1; return [url, $ifaceNil]; } _tuple = getScheme(rawURL); url.Scheme = _tuple[0]; rest = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$2.nil, err]; } _r = strings.ToLower(url.Scheme); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } url.Scheme = _r; if (strings.HasSuffix(rest, "?") && (strings.Count(rest, "?") === 1)) { url.ForceQuery = true; rest = $substring(rest, 0, (rest.length - 1 >> 0)); } else { _tuple$1 = split(rest, 63, true); rest = _tuple$1[0]; url.RawQuery = _tuple$1[1]; } if (!strings.HasPrefix(rest, "/")) { if (!(url.Scheme === "")) { url.Opaque = rest; $s = -1; return [url, $ifaceNil]; } if (viaRequest) { $s = -1; return [ptrType$2.nil, errors.New("invalid URI for request")]; } colon = strings.Index(rest, ":"); slash = strings.Index(rest, "/"); if (colon >= 0 && (slash < 0 || colon < slash)) { $s = -1; return [ptrType$2.nil, errors.New("first path segment in URL cannot contain colon")]; } } /* */ if ((!(url.Scheme === "") || !viaRequest && !strings.HasPrefix(rest, "///")) && strings.HasPrefix(rest, "//")) { $s = 2; continue; } /* */ $s = 3; continue; /* if ((!(url.Scheme === "") || !viaRequest && !strings.HasPrefix(rest, "///")) && strings.HasPrefix(rest, "//")) { */ case 2: authority = ""; _tuple$2 = split($substring(rest, 2), 47, false); authority = _tuple$2[0]; rest = _tuple$2[1]; _r$1 = parseAuthority(authority); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$3 = _r$1; url.User = _tuple$3[0]; url.Host = _tuple$3[1]; err = _tuple$3[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$2.nil, err]; } /* } */ case 3: err$1 = url.setPath(rest); if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [ptrType$2.nil, err$1]; } $s = -1; return [url, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: parse }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.authority = authority; $f.colon = colon; $f.err = err; $f.err$1 = err$1; $f.rawURL = rawURL; $f.rest = rest; $f.slash = slash; $f.url = url; $f.viaRequest = viaRequest; $f.$s = $s; $f.$r = $r; return $f; }; parseAuthority = function(authority) { var _r, _r$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$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, authority, err, host, i, password, user, userinfo, username, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _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$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _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 = $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; authority = $f.authority; err = $f.err; host = $f.host; i = $f.i; password = $f.password; user = $f.user; userinfo = $f.userinfo; username = $f.username; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: user = ptrType$1.nil; host = ""; err = $ifaceNil; i = strings.LastIndex(authority, "@"); /* */ if (i < 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (i < 0) { */ case 1: _r = parseHost(authority); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; host = _tuple[0]; err = _tuple[1]; $s = 3; continue; /* } else { */ case 2: _r$1 = parseHost($substring(authority, (i + 1 >> 0))); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; host = _tuple$1[0]; err = _tuple$1[1]; /* } */ case 3: if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp = ptrType$1.nil; _tmp$1 = ""; _tmp$2 = err; user = _tmp; host = _tmp$1; err = _tmp$2; $s = -1; return [user, host, err]; } if (i < 0) { _tmp$3 = ptrType$1.nil; _tmp$4 = host; _tmp$5 = $ifaceNil; user = _tmp$3; host = _tmp$4; err = _tmp$5; $s = -1; return [user, host, err]; } userinfo = $substring(authority, 0, i); if (!validUserinfo(userinfo)) { _tmp$6 = ptrType$1.nil; _tmp$7 = ""; _tmp$8 = errors.New("net/url: invalid userinfo"); user = _tmp$6; host = _tmp$7; err = _tmp$8; $s = -1; return [user, host, err]; } if (!strings.Contains(userinfo, ":")) { _tuple$2 = unescape(userinfo, 5); userinfo = _tuple$2[0]; err = _tuple$2[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$9 = ptrType$1.nil; _tmp$10 = ""; _tmp$11 = err; user = _tmp$9; host = _tmp$10; err = _tmp$11; $s = -1; return [user, host, err]; } user = User(userinfo); } else { _tuple$3 = split(userinfo, 58, true); username = _tuple$3[0]; password = _tuple$3[1]; _tuple$4 = unescape(username, 5); username = _tuple$4[0]; err = _tuple$4[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$12 = ptrType$1.nil; _tmp$13 = ""; _tmp$14 = err; user = _tmp$12; host = _tmp$13; err = _tmp$14; $s = -1; return [user, host, err]; } _tuple$5 = unescape(password, 5); password = _tuple$5[0]; err = _tuple$5[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$15 = ptrType$1.nil; _tmp$16 = ""; _tmp$17 = err; user = _tmp$15; host = _tmp$16; err = _tmp$17; $s = -1; return [user, host, err]; } user = UserPassword(username, password); } _tmp$18 = user; _tmp$19 = host; _tmp$20 = $ifaceNil; user = _tmp$18; host = _tmp$19; err = _tmp$20; $s = -1; return [user, host, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: parseAuthority }; } $f._r = _r; $f._r$1 = _r$1; $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$3 = _tmp$3; $f._tmp$4 = _tmp$4; $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 = _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.authority = authority; $f.err = err; $f.host = host; $f.i = i; $f.password = password; $f.user = user; $f.userinfo = userinfo; $f.username = username; $f.$s = $s; $f.$r = $r; return $f; }; parseHost = function(host) { var $24r, $24r$1, _r, _r$1, _tuple, _tuple$1, _tuple$2, _tuple$3, colonPort, colonPort$1, err, err$1, host, host1, host2, host3, i, i$1, zone, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; colonPort = $f.colonPort; colonPort$1 = $f.colonPort$1; err = $f.err; err$1 = $f.err$1; host = $f.host; host1 = $f.host1; host2 = $f.host2; host3 = $f.host3; i = $f.i; i$1 = $f.i$1; zone = $f.zone; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (strings.HasPrefix(host, "[")) { $s = 1; continue; } /* */ $s = 2; continue; /* if (strings.HasPrefix(host, "[")) { */ case 1: i = strings.LastIndex(host, "]"); if (i < 0) { $s = -1; return ["", errors.New("missing ']' in host")]; } colonPort = $substring(host, (i + 1 >> 0)); /* */ if (!validOptionalPort(colonPort)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!validOptionalPort(colonPort)) { */ case 4: _r = fmt.Errorf("invalid port %q after host", new sliceType([new $String(colonPort)])); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = ["", _r]; $s = 7; case 7: return $24r; /* } */ case 5: zone = strings.Index($substring(host, 0, i), "%25"); if (zone >= 0) { _tuple = unescape($substring(host, 0, zone), 3); host1 = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return ["", err]; } _tuple$1 = unescape($substring(host, zone, i), 4); host2 = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return ["", err]; } _tuple$2 = unescape($substring(host, i), 3); host3 = _tuple$2[0]; err = _tuple$2[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return ["", err]; } $s = -1; return [host1 + host2 + host3, $ifaceNil]; } $s = 3; continue; /* } else { */ case 2: i$1 = strings.LastIndex(host, ":"); /* */ if (!((i$1 === -1))) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!((i$1 === -1))) { */ case 8: colonPort$1 = $substring(host, i$1); /* */ if (!validOptionalPort(colonPort$1)) { $s = 10; continue; } /* */ $s = 11; continue; /* if (!validOptionalPort(colonPort$1)) { */ case 10: _r$1 = fmt.Errorf("invalid port %q after host", new sliceType([new $String(colonPort$1)])); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r$1 = ["", _r$1]; $s = 13; case 13: return $24r$1; /* } */ case 11: /* } */ case 9: /* } */ case 3: err$1 = $ifaceNil; _tuple$3 = unescape(host, 3); host = _tuple$3[0]; err$1 = _tuple$3[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return ["", err$1]; } $s = -1; return [host, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: parseHost }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.colonPort = colonPort; $f.colonPort$1 = colonPort$1; $f.err = err; $f.err$1 = err$1; $f.host = host; $f.host1 = host1; $f.host2 = host2; $f.host3 = host3; $f.i = i; $f.i$1 = i$1; $f.zone = zone; $f.$s = $s; $f.$r = $r; return $f; }; URL.ptr.prototype.setPath = function(p) { var _tuple, err, escp, p, path, u; u = this; _tuple = unescape(p, 1); path = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } u.Path = path; escp = escape(path, 1); if (p === escp) { u.RawPath = ""; } else { u.RawPath = p; } return $ifaceNil; }; URL.prototype.setPath = function(p) { return this.$val.setPath(p); }; URL.ptr.prototype.EscapedPath = function() { var _tuple, err, p, u; u = this; if (!(u.RawPath === "") && validEncoded(u.RawPath, 1)) { _tuple = unescape(u.RawPath, 1); p = _tuple[0]; err = _tuple[1]; if ($interfaceIsEqual(err, $ifaceNil) && p === u.Path) { return u.RawPath; } } if (u.Path === "*") { return "*"; } return escape(u.Path, 1); }; URL.prototype.EscapedPath = function() { return this.$val.EscapedPath(); }; validEncoded = function(s, mode) { var _1, i, mode, s; i = 0; while (true) { if (!(i < s.length)) { break; } _1 = s.charCodeAt(i); if ((_1 === (33)) || (_1 === (36)) || (_1 === (38)) || (_1 === (39)) || (_1 === (40)) || (_1 === (41)) || (_1 === (42)) || (_1 === (43)) || (_1 === (44)) || (_1 === (59)) || (_1 === (61)) || (_1 === (58)) || (_1 === (64))) { } else if ((_1 === (91)) || (_1 === (93))) { } else if (_1 === (37)) { } else if (shouldEscape(s.charCodeAt(i), mode)) { return false; } i = i + (1) >> 0; } return true; }; URL.ptr.prototype.setFragment = function(f) { var _tuple, err, escf, f, frag, u; u = this; _tuple = unescape(f, 7); frag = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } u.Fragment = frag; escf = escape(frag, 7); if (f === escf) { u.RawFragment = ""; } else { u.RawFragment = f; } return $ifaceNil; }; URL.prototype.setFragment = function(f) { return this.$val.setFragment(f); }; URL.ptr.prototype.EscapedFragment = function() { var _tuple, err, f, u; u = this; if (!(u.RawFragment === "") && validEncoded(u.RawFragment, 7)) { _tuple = unescape(u.RawFragment, 7); f = _tuple[0]; err = _tuple[1]; if ($interfaceIsEqual(err, $ifaceNil) && f === u.Fragment) { return u.RawFragment; } } return escape(u.Fragment, 7); }; URL.prototype.EscapedFragment = function() { return this.$val.EscapedFragment(); }; validOptionalPort = function(port) { var _i, _ref, _rune, b, port; if (port === "") { return true; } if (!((port.charCodeAt(0) === 58))) { return false; } _ref = $substring(port, 1); _i = 0; while (true) { if (!(_i < _ref.length)) { break; } _rune = $decodeRune(_ref, _i); b = _rune[0]; if (b < 48 || b > 57) { return false; } _i += _rune[1]; } return true; }; URL.ptr.prototype.String = function() { var buf, h, i, path, u, ui; u = this; buf = new strings.Builder.ptr(ptrType.nil, sliceType$1.nil); if (!(u.Scheme === "")) { buf.WriteString(u.Scheme); buf.WriteByte(58); } if (!(u.Opaque === "")) { buf.WriteString(u.Opaque); } else { if (!(u.Scheme === "") || !(u.Host === "") || !(u.User === ptrType$1.nil)) { if (!(u.Host === "") || !(u.Path === "") || !(u.User === ptrType$1.nil)) { buf.WriteString("//"); } ui = u.User; if (!(ui === ptrType$1.nil)) { buf.WriteString(ui.String()); buf.WriteByte(64); } h = u.Host; if (!(h === "")) { buf.WriteString(escape(h, 3)); } } path = u.EscapedPath(); if (!(path === "") && !((path.charCodeAt(0) === 47)) && !(u.Host === "")) { buf.WriteByte(47); } if (buf.Len() === 0) { i = strings.IndexByte(path, 58); if (i > -1 && (strings.IndexByte($substring(path, 0, i), 47) === -1)) { buf.WriteString("./"); } } buf.WriteString(path); } if (u.ForceQuery || !(u.RawQuery === "")) { buf.WriteByte(63); buf.WriteString(u.RawQuery); } if (!(u.Fragment === "")) { buf.WriteByte(35); buf.WriteString(u.EscapedFragment()); } return buf.String(); }; URL.prototype.String = function() { return this.$val.String(); }; URL.ptr.prototype.Redacted = function() { var _tuple, has, ru, u; u = this; if (u === ptrType$2.nil) { return ""; } ru = $clone(u, URL); _tuple = ru.User.Password(); has = _tuple[1]; if (has) { ru.User = UserPassword(ru.User.Username(), "xxxxx"); } return ru.String(); }; URL.prototype.Redacted = function() { return this.$val.Redacted(); }; Values.prototype.Get = function(key) { var _entry, key, v, vs; v = this.$val; if (v === false) { return ""; } vs = (_entry = v[$String.keyFor(key)], _entry !== undefined ? _entry.v : sliceType$2.nil); if (vs.$length === 0) { return ""; } return (0 >= vs.$length ? ($throwRuntimeError("index out of range"), undefined) : vs.$array[vs.$offset + 0]); }; $ptrType(Values).prototype.Get = function(key) { return new Values(this.$get()).Get(key); }; Values.prototype.Set = function(key, value) { var _key, key, v, value; v = this.$val; _key = key; (v || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: new sliceType$2([value]) }; }; $ptrType(Values).prototype.Set = function(key, value) { return new Values(this.$get()).Set(key, value); }; Values.prototype.Add = function(key, value) { var _entry, _key, key, v, value; v = this.$val; _key = key; (v || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: $append((_entry = v[$String.keyFor(key)], _entry !== undefined ? _entry.v : sliceType$2.nil), value) }; }; $ptrType(Values).prototype.Add = function(key, value) { return new Values(this.$get()).Add(key, value); }; Values.prototype.Del = function(key) { var key, v; v = this.$val; delete v[$String.keyFor(key)]; }; $ptrType(Values).prototype.Del = function(key) { return new Values(this.$get()).Del(key); }; Values.prototype.Has = function(key) { var _entry, _tuple, key, ok, v; v = this.$val; _tuple = (_entry = v[$String.keyFor(key)], _entry !== undefined ? [_entry.v, true] : [sliceType$2.nil, false]); ok = _tuple[1]; return ok; }; $ptrType(Values).prototype.Has = function(key) { return new Values(this.$get()).Has(key); }; ParseQuery = function(query) { var _r, err, m, query, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; err = $f.err; m = $f.m; query = $f.query; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: m = {}; _r = parseQuery(m, query); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; $s = -1; return [m, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: ParseQuery }; } $f._r = _r; $f.err = err; $f.m = m; $f.query = query; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.ParseQuery = ParseQuery; parseQuery = function(m, query) { var _entry, _key, _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, err, err1, i, i$1, key, m, query, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _key = $f._key; _r = $f._r; _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; err = $f.err; err1 = $f.err1; i = $f.i; i$1 = $f.i$1; key = $f.key; m = $f.m; query = $f.query; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; /* while (true) { */ case 1: /* if (!(!(query === ""))) { break; } */ if(!(!(query === ""))) { $s = 2; continue; } key = query; i = strings.IndexAny(key, "&"); if (i >= 0) { _tmp = $substring(key, 0, i); _tmp$1 = $substring(key, (i + 1 >> 0)); key = _tmp; query = _tmp$1; } else { query = ""; } /* */ if (strings.Contains(key, ";")) { $s = 3; continue; } /* */ $s = 4; continue; /* if (strings.Contains(key, ";")) { */ case 3: _r = fmt.Errorf("invalid semicolon separator in query", new sliceType([])); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; /* continue; */ $s = 1; continue; /* } */ case 4: if (key === "") { /* continue; */ $s = 1; continue; } value = ""; i$1 = strings.Index(key, "="); if (i$1 >= 0) { _tmp$2 = $substring(key, 0, i$1); _tmp$3 = $substring(key, (i$1 + 1 >> 0)); key = _tmp$2; value = _tmp$3; } _tuple = QueryUnescape(key); key = _tuple[0]; err1 = _tuple[1]; if (!($interfaceIsEqual(err1, $ifaceNil))) { if ($interfaceIsEqual(err, $ifaceNil)) { err = err1; } /* continue; */ $s = 1; continue; } _tuple$1 = QueryUnescape(value); value = _tuple$1[0]; err1 = _tuple$1[1]; if (!($interfaceIsEqual(err1, $ifaceNil))) { if ($interfaceIsEqual(err, $ifaceNil)) { err = err1; } /* continue; */ $s = 1; continue; } _key = key; (m || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: $append((_entry = m[$String.keyFor(key)], _entry !== undefined ? _entry.v : sliceType$2.nil), value) }; $s = 1; continue; case 2: err = err; $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: parseQuery }; } $f._entry = _entry; $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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.err = err; $f.err1 = err1; $f.i = i; $f.i$1 = i$1; $f.key = key; $f.m = m; $f.query = query; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; Values.prototype.Encode = function() { var _entry, _entry$1, _i, _i$1, _i$2, _keys, _ref, _ref$1, _ref$2, buf, k, k$1, keyEscaped, keys, v, v$1, vs, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _i = $f._i; _i$1 = $f._i$1; _i$2 = $f._i$2; _keys = $f._keys; _ref = $f._ref; _ref$1 = $f._ref$1; _ref$2 = $f._ref$2; buf = $f.buf; k = $f.k; k$1 = $f.k$1; keyEscaped = $f.keyEscaped; keys = $f.keys; v = $f.v; v$1 = $f.v$1; vs = $f.vs; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = this.$val; if (v === false) { $s = -1; return ""; } buf = new strings.Builder.ptr(ptrType.nil, sliceType$1.nil); keys = $makeSlice(sliceType$2, 0, $keys(v).length); _ref = v; _i = 0; _keys = $keys(_ref); while (true) { if (!(_i < _keys.length)) { break; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; continue; } k = _entry.k; keys = $append(keys, k); _i++; } $r = sort.Strings(keys); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _ref$1 = keys; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } k$1 = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); vs = (_entry$1 = v[$String.keyFor(k$1)], _entry$1 !== undefined ? _entry$1.v : sliceType$2.nil); keyEscaped = QueryEscape(k$1); _ref$2 = vs; _i$2 = 0; while (true) { if (!(_i$2 < _ref$2.$length)) { break; } v$1 = ((_i$2 < 0 || _i$2 >= _ref$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$2.$array[_ref$2.$offset + _i$2]); if (buf.Len() > 0) { buf.WriteByte(38); } buf.WriteString(keyEscaped); buf.WriteByte(61); buf.WriteString(QueryEscape(v$1)); _i$2++; } _i$1++; } $s = -1; return buf.String(); /* */ } return; } if ($f === undefined) { $f = { $blk: Values.prototype.Encode }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._i = _i; $f._i$1 = _i$1; $f._i$2 = _i$2; $f._keys = _keys; $f._ref = _ref; $f._ref$1 = _ref$1; $f._ref$2 = _ref$2; $f.buf = buf; $f.k = k; $f.k$1 = k$1; $f.keyEscaped = keyEscaped; $f.keys = keys; $f.v = v; $f.v$1 = v$1; $f.vs = vs; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Values).prototype.Encode = function() { return new Values(this.$get()).Encode(); }; resolvePath = function(base, ref) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, base, dst, elem, first, full, i, i$1, index, last, r, ref, remaining, str; full = ""; if (ref === "") { full = base; } else if (!((ref.charCodeAt(0) === 47))) { i = strings.LastIndex(base, "/"); full = $substring(base, 0, (i + 1 >> 0)) + ref; } else { full = ref; } if (full === "") { return ""; } last = ""; elem = ""; i$1 = 0; dst = new strings.Builder.ptr(ptrType.nil, sliceType$1.nil); first = true; remaining = full; dst.WriteByte(47); while (true) { if (!(i$1 >= 0)) { break; } i$1 = strings.IndexByte(remaining, 47); if (i$1 < 0) { _tmp = remaining; _tmp$1 = remaining; _tmp$2 = ""; last = _tmp; elem = _tmp$1; remaining = _tmp$2; } else { _tmp$3 = $substring(remaining, 0, i$1); _tmp$4 = $substring(remaining, (i$1 + 1 >> 0)); elem = _tmp$3; remaining = _tmp$4; } if (elem === ".") { first = false; continue; } if (elem === "..") { str = $substring(dst.String(), 1); index = strings.LastIndexByte(str, 47); dst.Reset(); dst.WriteByte(47); if (index === -1) { first = true; } else { dst.WriteString($substring(str, 0, index)); } } else { if (!first) { dst.WriteByte(47); } dst.WriteString(elem); first = false; } } if (last === "." || last === "..") { dst.WriteByte(47); } r = dst.String(); if (r.length > 1 && (r.charCodeAt(1) === 47)) { r = $substring(r, 1); } return r; }; URL.ptr.prototype.IsAbs = function() { var u; u = this; return !(u.Scheme === ""); }; URL.prototype.IsAbs = function() { return this.$val.IsAbs(); }; URL.ptr.prototype.Parse = function(ref) { var _r, _tuple, err, ref, refURL, u, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; ref = $f.ref; refURL = $f.refURL; u = $f.u; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: u = this; _r = Parse(ref); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; refURL = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$2.nil, err]; } $s = -1; return [u.ResolveReference(refURL), $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: URL.ptr.prototype.Parse }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.ref = ref; $f.refURL = refURL; $f.u = u; $f.$s = $s; $f.$r = $r; return $f; }; URL.prototype.Parse = function(ref) { return this.$val.Parse(ref); }; URL.ptr.prototype.ResolveReference = function(ref) { var ref, u, url; u = this; url = $clone(ref, URL); if (ref.Scheme === "") { url.Scheme = u.Scheme; } if (!(ref.Scheme === "") || !(ref.Host === "") || !(ref.User === ptrType$1.nil)) { url.setPath(resolvePath(ref.EscapedPath(), "")); return url; } if (!(ref.Opaque === "")) { url.User = ptrType$1.nil; url.Host = ""; url.Path = ""; return url; } if (ref.Path === "" && ref.RawQuery === "") { url.RawQuery = u.RawQuery; if (ref.Fragment === "") { url.Fragment = u.Fragment; url.RawFragment = u.RawFragment; } } url.Host = u.Host; url.User = u.User; url.setPath(resolvePath(u.EscapedPath(), ref.EscapedPath())); return url; }; URL.prototype.ResolveReference = function(ref) { return this.$val.ResolveReference(ref); }; URL.ptr.prototype.Query = function() { var _r, _tuple, u, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; u = $f.u; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: u = this; _r = ParseQuery(u.RawQuery); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; v = _tuple[0]; $s = -1; return v; /* */ } return; } if ($f === undefined) { $f = { $blk: URL.ptr.prototype.Query }; } $f._r = _r; $f._tuple = _tuple; $f.u = u; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; URL.prototype.Query = function() { return this.$val.Query(); }; URL.ptr.prototype.RequestURI = function() { var result, u; u = this; result = u.Opaque; if (result === "") { result = u.EscapedPath(); if (result === "") { result = "/"; } } else { if (strings.HasPrefix(result, "//")) { result = u.Scheme + ":" + result; } } if (u.ForceQuery || !(u.RawQuery === "")) { result = result + ("?" + u.RawQuery); } return result; }; URL.prototype.RequestURI = function() { return this.$val.RequestURI(); }; URL.ptr.prototype.Hostname = function() { var _tuple, host, u; u = this; _tuple = splitHostPort(u.Host); host = _tuple[0]; return host; }; URL.prototype.Hostname = function() { return this.$val.Hostname(); }; URL.ptr.prototype.Port = function() { var _tuple, port, u; u = this; _tuple = splitHostPort(u.Host); port = _tuple[1]; return port; }; URL.prototype.Port = function() { return this.$val.Port(); }; splitHostPort = function(hostPort) { var _tmp, _tmp$1, colon, host, hostPort, port; host = ""; port = ""; host = hostPort; colon = strings.LastIndexByte(host, 58); if (!((colon === -1)) && validOptionalPort($substring(host, colon))) { _tmp = $substring(host, 0, colon); _tmp$1 = $substring(host, (colon + 1 >> 0)); host = _tmp; port = _tmp$1; } if (strings.HasPrefix(host, "[") && strings.HasSuffix(host, "]")) { host = $substring(host, 1, (host.length - 1 >> 0)); } return [host, port]; }; URL.ptr.prototype.MarshalBinary = function() { var _tmp, _tmp$1, err, text, u; text = sliceType$1.nil; err = $ifaceNil; u = this; _tmp = (new sliceType$1($stringToBytes(u.String()))); _tmp$1 = $ifaceNil; text = _tmp; err = _tmp$1; return [text, err]; }; URL.prototype.MarshalBinary = function() { return this.$val.MarshalBinary(); }; URL.ptr.prototype.UnmarshalBinary = function(text) { var _r, _tuple, err, text, u, u1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; text = $f.text; u = $f.u; u1 = $f.u1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: u = this; _r = Parse(($bytesToString(text))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; u1 = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } URL.copy(u, u1); $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: URL.ptr.prototype.UnmarshalBinary }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.text = text; $f.u = u; $f.u1 = u1; $f.$s = $s; $f.$r = $r; return $f; }; URL.prototype.UnmarshalBinary = function(text) { return this.$val.UnmarshalBinary(text); }; validUserinfo = function(s) { var _1, _i, _ref, _rune, r, s; _ref = s; _i = 0; while (true) { if (!(_i < _ref.length)) { break; } _rune = $decodeRune(_ref, _i); r = _rune[0]; if (65 <= r && r <= 90) { _i += _rune[1]; continue; } if (97 <= r && r <= 122) { _i += _rune[1]; continue; } if (48 <= r && r <= 57) { _i += _rune[1]; continue; } _1 = r; if ((_1 === (45)) || (_1 === (46)) || (_1 === (95)) || (_1 === (58)) || (_1 === (126)) || (_1 === (33)) || (_1 === (36)) || (_1 === (38)) || (_1 === (39)) || (_1 === (40)) || (_1 === (41)) || (_1 === (42)) || (_1 === (43)) || (_1 === (44)) || (_1 === (59)) || (_1 === (61)) || (_1 === (37)) || (_1 === (64))) { _i += _rune[1]; continue; } else { return false; } _i += _rune[1]; } return true; }; stringContainsCTLByte = function(s) { var b, i, s; i = 0; while (true) { if (!(i < s.length)) { break; } b = s.charCodeAt(i); if (b < 32 || (b === 127)) { return true; } i = i + (1) >> 0; } return false; }; ptrType$3.methods = [{prop: "Unwrap", name: "Unwrap", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Temporary", name: "Temporary", pkg: "", typ: $funcType([], [$Bool], false)}]; EscapeError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; InvalidHostError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$2.methods = [{prop: "setPath", name: "setPath", pkg: "net/url", typ: $funcType([$String], [$error], false)}, {prop: "EscapedPath", name: "EscapedPath", pkg: "", typ: $funcType([], [$String], false)}, {prop: "setFragment", name: "setFragment", pkg: "net/url", typ: $funcType([$String], [$error], false)}, {prop: "EscapedFragment", name: "EscapedFragment", pkg: "", typ: $funcType([], [$String], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Redacted", name: "Redacted", pkg: "", typ: $funcType([], [$String], false)}, {prop: "IsAbs", name: "IsAbs", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Parse", name: "Parse", pkg: "", typ: $funcType([$String], [ptrType$2, $error], false)}, {prop: "ResolveReference", name: "ResolveReference", pkg: "", typ: $funcType([ptrType$2], [ptrType$2], false)}, {prop: "Query", name: "Query", pkg: "", typ: $funcType([], [Values], false)}, {prop: "RequestURI", name: "RequestURI", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Hostname", name: "Hostname", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Port", name: "Port", pkg: "", typ: $funcType([], [$String], false)}, {prop: "MarshalBinary", name: "MarshalBinary", pkg: "", typ: $funcType([], [sliceType$1, $error], false)}, {prop: "UnmarshalBinary", name: "UnmarshalBinary", pkg: "", typ: $funcType([sliceType$1], [$error], false)}]; ptrType$1.methods = [{prop: "Username", name: "Username", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Password", name: "Password", pkg: "", typ: $funcType([], [$String, $Bool], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; Values.methods = [{prop: "Get", name: "Get", pkg: "", typ: $funcType([$String], [$String], false)}, {prop: "Set", name: "Set", pkg: "", typ: $funcType([$String, $String], [], false)}, {prop: "Add", name: "Add", pkg: "", typ: $funcType([$String, $String], [], false)}, {prop: "Del", name: "Del", pkg: "", typ: $funcType([$String], [], false)}, {prop: "Has", name: "Has", pkg: "", typ: $funcType([$String], [$Bool], false)}, {prop: "Encode", name: "Encode", pkg: "", typ: $funcType([], [$String], false)}]; Error.init("", [{prop: "Op", name: "Op", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "URL", name: "URL", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Err", name: "Err", embedded: false, exported: true, typ: $error, tag: ""}]); URL.init("", [{prop: "Scheme", name: "Scheme", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Opaque", name: "Opaque", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "User", name: "User", embedded: false, exported: true, typ: ptrType$1, tag: ""}, {prop: "Host", name: "Host", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Path", name: "Path", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "RawPath", name: "RawPath", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "ForceQuery", name: "ForceQuery", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "RawQuery", name: "RawQuery", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Fragment", name: "Fragment", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "RawFragment", name: "RawFragment", embedded: false, exported: true, typ: $String, tag: ""}]); Userinfo.init("net/url", [{prop: "username", name: "username", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "password", name: "password", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "passwordSet", name: "passwordSet", embedded: false, exported: false, typ: $Bool, tag: ""}]); Values.init($String, sliceType$2); $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 = sort.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strconv.$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; } /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["path/filepath"] = (function() { var $pkg = {}, $init, errors, fs, os, runtime, sort, strings, syscall, utf8, volumeNameLen, Base, VolumeName; errors = $packages["errors"]; fs = $packages["io/fs"]; os = $packages["os"]; runtime = $packages["runtime"]; sort = $packages["sort"]; strings = $packages["strings"]; syscall = $packages["syscall"]; utf8 = $packages["unicode/utf8"]; volumeNameLen = function(path) { var path; return 0; }; Base = function(path) { var i, path; if (path === "") { return "."; } while (true) { if (!(path.length > 0 && os.IsPathSeparator(path.charCodeAt((path.length - 1 >> 0))))) { break; } path = $substring(path, 0, (path.length - 1 >> 0)); } path = $substring(path, VolumeName(path).length); i = path.length - 1 >> 0; while (true) { if (!(i >= 0 && !os.IsPathSeparator(path.charCodeAt(i)))) { break; } i = i - (1) >> 0; } if (i >= 0) { path = $substring(path, (i + 1 >> 0)); } if (path === "") { return "/"; } return path; }; $pkg.Base = Base; VolumeName = function(path) { var path; return $substring(path, 0, volumeNameLen(path)); }; $pkg.VolumeName = VolumeName; $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 = fs.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = os.$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 = sort.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strings.$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 = utf8.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $pkg.ErrBadPattern = errors.New("syntax error in pattern"); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["crypto/x509"] = (function() { var $pkg = {}, $init, bytes, crypto, aes, cipher, des, dsa, ecdsa, ed25519, elliptic, md5, rsa, sha1, sha256, sha512, pkix, asn1, hex, pem, errors, fmt, io, fs, big, net, url, os, filepath, reflect, runtime, strconv, strings, sync, time, unicode, utf16, utf8, cryptobyte, asn1$1, publicKeyInfo, authKeyId, SignatureAlgorithm, PublicKeyAlgorithm, pssParameters, KeyUsage, ExtKeyUsage, Certificate, InsecureAlgorithmError, ConstraintViolationError, UnhandledCriticalExtension, InvalidReason, CertificateInvalidError, HostnameError, UnknownAuthorityError, SystemRootsError, VerifyOptions, rfc2821Mailbox, ecPrivateKey, pkcs8, pkcs1PrivateKey, pkcs1AdditionalRSAPrime, pkcs1PublicKey, sum224, CertPool, lazyCert, ptrType, structType, sliceType, sliceType$1, structType$1, sliceType$2, sliceType$3, sliceType$4, ptrType$1, ptrType$2, ptrType$3, sliceType$6, ptrType$4, sliceType$8, ptrType$6, sliceType$11, ptrType$7, ptrType$8, sliceType$13, ptrType$9, sliceType$15, sliceType$18, ptrType$13, sliceType$19, ptrType$14, ptrType$16, ptrType$17, sliceType$20, sliceType$21, sliceType$22, ptrType$18, ptrType$19, sliceType$23, ptrType$20, ptrType$21, sliceType$25, sliceType$26, sliceType$27, ptrType$23, ptrType$24, sliceType$28, sliceType$29, structType$3, sliceType$30, funcType, ptrType$25, mapType, funcType$2, mapType$1, mapType$2, publicKeyAlgoName, oidSignatureMD2WithRSA, oidSignatureMD5WithRSA, oidSignatureSHA1WithRSA, oidSignatureSHA256WithRSA, oidSignatureSHA384WithRSA, oidSignatureSHA512WithRSA, oidSignatureRSAPSS, oidSignatureDSAWithSHA1, oidSignatureDSAWithSHA256, oidSignatureECDSAWithSHA1, oidSignatureECDSAWithSHA256, oidSignatureECDSAWithSHA384, oidSignatureECDSAWithSHA512, oidSignatureEd25519, oidSHA256, oidSHA384, oidSHA512, oidMGF1, oidISOSignatureSHA1WithRSA, signatureAlgorithmDetails, hashToPSSParameters, oidPublicKeyRSA, oidPublicKeyDSA, oidPublicKeyECDSA, oidPublicKeyEd25519, oidNamedCurveP224, oidNamedCurveP256, oidNamedCurveP384, oidNamedCurveP521, oidExtKeyUsageAny, oidExtKeyUsageServerAuth, oidExtKeyUsageClientAuth, oidExtKeyUsageCodeSigning, oidExtKeyUsageEmailProtection, oidExtKeyUsageIPSECEndSystem, oidExtKeyUsageIPSECTunnel, oidExtKeyUsageIPSECUser, oidExtKeyUsageTimeStamping, oidExtKeyUsageOCSPSigning, oidExtKeyUsageMicrosoftServerGatedCrypto, oidExtKeyUsageNetscapeServerGatedCrypto, oidExtKeyUsageMicrosoftCommercialCodeSigning, oidExtKeyUsageMicrosoftKernelCodeSigning, extKeyUsageOIDs, oidExtensionAuthorityKeyId, oidExtensionSubjectAltName, oidExtensionNameConstraints, oidExtensionAuthorityInfoAccess, oidAuthorityInfoAccessOcsp, oidAuthorityInfoAccessIssuers, errNotParsed, once, systemRoots, systemRootsErr, getSignatureAlgorithmFromAI, getPublicKeyAlgorithmFromOID, namedCurveFromOID, extKeyUsageFromOID, signaturePublicKeyAlgoMismatchError, checkSignature, oidInExtensions, isIA5String, signingParamsForPublicKey, parseRFC2821Mailbox, domainToReverseLabels, matchEmailConstraint, matchURIConstraint, matchIPConstraint, matchDomainConstraint, appendToFreshChain, validHostnamePattern, validHostnameInput, validHostname, matchExactly, matchHostnames, toLowerCaseASCII, checkChainForKeyUsage, ParseECPrivateKey, parseECPrivateKey, systemRootsPool, initSystemRoots, ParsePKCS8PrivateKey, ParsePKCS1PrivateKey, isPrintable, parseASN1String, parseName, parseAI, parseValidity, parseExtension, parsePublicKey, parseKeyUsageExtension, parseBasicConstraintsExtension, forEachSAN, parseSANExtension, parseExtKeyUsageExtension, parseCertificatePoliciesExtension, isValidIPMask, parseNameConstraintsExtension, processExtensions, parseCertificate, ParseCertificate, loadSystemRoots, NewCertPool; bytes = $packages["bytes"]; crypto = $packages["crypto"]; aes = $packages["crypto/aes"]; cipher = $packages["crypto/cipher"]; des = $packages["crypto/des"]; dsa = $packages["crypto/dsa"]; ecdsa = $packages["crypto/ecdsa"]; ed25519 = $packages["crypto/ed25519"]; elliptic = $packages["crypto/elliptic"]; md5 = $packages["crypto/md5"]; rsa = $packages["crypto/rsa"]; sha1 = $packages["crypto/sha1"]; sha256 = $packages["crypto/sha256"]; sha512 = $packages["crypto/sha512"]; pkix = $packages["crypto/x509/pkix"]; asn1 = $packages["encoding/asn1"]; hex = $packages["encoding/hex"]; pem = $packages["encoding/pem"]; errors = $packages["errors"]; fmt = $packages["fmt"]; io = $packages["io"]; fs = $packages["io/fs"]; big = $packages["math/big"]; net = $packages["net"]; url = $packages["net/url"]; os = $packages["os"]; filepath = $packages["path/filepath"]; reflect = $packages["reflect"]; runtime = $packages["runtime"]; strconv = $packages["strconv"]; strings = $packages["strings"]; sync = $packages["sync"]; time = $packages["time"]; unicode = $packages["unicode"]; utf16 = $packages["unicode/utf16"]; utf8 = $packages["unicode/utf8"]; cryptobyte = $packages["vendor/golang.org/x/crypto/cryptobyte"]; asn1$1 = $packages["vendor/golang.org/x/crypto/cryptobyte/asn1"]; publicKeyInfo = $pkg.publicKeyInfo = $newType(0, $kindStruct, "x509.publicKeyInfo", true, "crypto/x509", false, function(Raw_, Algorithm_, PublicKey_) { this.$val = this; if (arguments.length === 0) { this.Raw = asn1.RawContent.nil; this.Algorithm = new pkix.AlgorithmIdentifier.ptr(asn1.ObjectIdentifier.nil, new asn1.RawValue.ptr(0, 0, false, sliceType$1.nil, sliceType$1.nil)); this.PublicKey = new asn1.BitString.ptr(sliceType$1.nil, 0); return; } this.Raw = Raw_; this.Algorithm = Algorithm_; this.PublicKey = PublicKey_; }); authKeyId = $pkg.authKeyId = $newType(0, $kindStruct, "x509.authKeyId", true, "crypto/x509", false, function(Id_) { this.$val = this; if (arguments.length === 0) { this.Id = sliceType$1.nil; return; } this.Id = Id_; }); SignatureAlgorithm = $pkg.SignatureAlgorithm = $newType(4, $kindInt, "x509.SignatureAlgorithm", true, "crypto/x509", true, null); PublicKeyAlgorithm = $pkg.PublicKeyAlgorithm = $newType(4, $kindInt, "x509.PublicKeyAlgorithm", true, "crypto/x509", true, null); pssParameters = $pkg.pssParameters = $newType(0, $kindStruct, "x509.pssParameters", true, "crypto/x509", false, function(Hash_, MGF_, SaltLength_, TrailerField_) { this.$val = this; if (arguments.length === 0) { this.Hash = new pkix.AlgorithmIdentifier.ptr(asn1.ObjectIdentifier.nil, new asn1.RawValue.ptr(0, 0, false, sliceType$1.nil, sliceType$1.nil)); this.MGF = new pkix.AlgorithmIdentifier.ptr(asn1.ObjectIdentifier.nil, new asn1.RawValue.ptr(0, 0, false, sliceType$1.nil, sliceType$1.nil)); this.SaltLength = 0; this.TrailerField = 0; return; } this.Hash = Hash_; this.MGF = MGF_; this.SaltLength = SaltLength_; this.TrailerField = TrailerField_; }); KeyUsage = $pkg.KeyUsage = $newType(4, $kindInt, "x509.KeyUsage", true, "crypto/x509", true, null); ExtKeyUsage = $pkg.ExtKeyUsage = $newType(4, $kindInt, "x509.ExtKeyUsage", true, "crypto/x509", true, null); Certificate = $pkg.Certificate = $newType(0, $kindStruct, "x509.Certificate", true, "crypto/x509", true, function(Raw_, RawTBSCertificate_, RawSubjectPublicKeyInfo_, RawSubject_, RawIssuer_, Signature_, SignatureAlgorithm_, PublicKeyAlgorithm_, PublicKey_, Version_, SerialNumber_, Issuer_, Subject_, NotBefore_, NotAfter_, KeyUsage_, Extensions_, ExtraExtensions_, UnhandledCriticalExtensions_, ExtKeyUsage_, UnknownExtKeyUsage_, BasicConstraintsValid_, IsCA_, MaxPathLen_, MaxPathLenZero_, SubjectKeyId_, AuthorityKeyId_, OCSPServer_, IssuingCertificateURL_, DNSNames_, EmailAddresses_, IPAddresses_, URIs_, PermittedDNSDomainsCritical_, PermittedDNSDomains_, ExcludedDNSDomains_, PermittedIPRanges_, ExcludedIPRanges_, PermittedEmailAddresses_, ExcludedEmailAddresses_, PermittedURIDomains_, ExcludedURIDomains_, CRLDistributionPoints_, PolicyIdentifiers_) { this.$val = this; if (arguments.length === 0) { this.Raw = sliceType$1.nil; this.RawTBSCertificate = sliceType$1.nil; this.RawSubjectPublicKeyInfo = sliceType$1.nil; this.RawSubject = sliceType$1.nil; this.RawIssuer = sliceType$1.nil; this.Signature = sliceType$1.nil; this.SignatureAlgorithm = 0; this.PublicKeyAlgorithm = 0; this.PublicKey = $ifaceNil; this.Version = 0; this.SerialNumber = ptrType$1.nil; this.Issuer = new pkix.Name.ptr(sliceType$4.nil, sliceType$4.nil, sliceType$4.nil, sliceType$4.nil, sliceType$4.nil, sliceType$4.nil, sliceType$4.nil, "", "", sliceType$15.nil, sliceType$15.nil); this.Subject = new pkix.Name.ptr(sliceType$4.nil, sliceType$4.nil, sliceType$4.nil, sliceType$4.nil, sliceType$4.nil, sliceType$4.nil, sliceType$4.nil, "", "", sliceType$15.nil, sliceType$15.nil); this.NotBefore = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$7.nil); this.NotAfter = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$7.nil); this.KeyUsage = 0; this.Extensions = sliceType$8.nil; this.ExtraExtensions = sliceType$8.nil; this.UnhandledCriticalExtensions = sliceType$11.nil; this.ExtKeyUsage = sliceType$22.nil; this.UnknownExtKeyUsage = sliceType$11.nil; this.BasicConstraintsValid = false; this.IsCA = false; this.MaxPathLen = 0; this.MaxPathLenZero = false; this.SubjectKeyId = sliceType$1.nil; this.AuthorityKeyId = sliceType$1.nil; this.OCSPServer = sliceType$4.nil; this.IssuingCertificateURL = sliceType$4.nil; this.DNSNames = sliceType$4.nil; this.EmailAddresses = sliceType$4.nil; this.IPAddresses = sliceType$18.nil; this.URIs = sliceType$19.nil; this.PermittedDNSDomainsCritical = false; this.PermittedDNSDomains = sliceType$4.nil; this.ExcludedDNSDomains = sliceType$4.nil; this.PermittedIPRanges = sliceType$28.nil; this.ExcludedIPRanges = sliceType$28.nil; this.PermittedEmailAddresses = sliceType$4.nil; this.ExcludedEmailAddresses = sliceType$4.nil; this.PermittedURIDomains = sliceType$4.nil; this.ExcludedURIDomains = sliceType$4.nil; this.CRLDistributionPoints = sliceType$4.nil; this.PolicyIdentifiers = sliceType$11.nil; return; } this.Raw = Raw_; this.RawTBSCertificate = RawTBSCertificate_; this.RawSubjectPublicKeyInfo = RawSubjectPublicKeyInfo_; this.RawSubject = RawSubject_; this.RawIssuer = RawIssuer_; this.Signature = Signature_; this.SignatureAlgorithm = SignatureAlgorithm_; this.PublicKeyAlgorithm = PublicKeyAlgorithm_; this.PublicKey = PublicKey_; this.Version = Version_; this.SerialNumber = SerialNumber_; this.Issuer = Issuer_; this.Subject = Subject_; this.NotBefore = NotBefore_; this.NotAfter = NotAfter_; this.KeyUsage = KeyUsage_; this.Extensions = Extensions_; this.ExtraExtensions = ExtraExtensions_; this.UnhandledCriticalExtensions = UnhandledCriticalExtensions_; this.ExtKeyUsage = ExtKeyUsage_; this.UnknownExtKeyUsage = UnknownExtKeyUsage_; this.BasicConstraintsValid = BasicConstraintsValid_; this.IsCA = IsCA_; this.MaxPathLen = MaxPathLen_; this.MaxPathLenZero = MaxPathLenZero_; this.SubjectKeyId = SubjectKeyId_; this.AuthorityKeyId = AuthorityKeyId_; this.OCSPServer = OCSPServer_; this.IssuingCertificateURL = IssuingCertificateURL_; this.DNSNames = DNSNames_; this.EmailAddresses = EmailAddresses_; this.IPAddresses = IPAddresses_; this.URIs = URIs_; this.PermittedDNSDomainsCritical = PermittedDNSDomainsCritical_; this.PermittedDNSDomains = PermittedDNSDomains_; this.ExcludedDNSDomains = ExcludedDNSDomains_; this.PermittedIPRanges = PermittedIPRanges_; this.ExcludedIPRanges = ExcludedIPRanges_; this.PermittedEmailAddresses = PermittedEmailAddresses_; this.ExcludedEmailAddresses = ExcludedEmailAddresses_; this.PermittedURIDomains = PermittedURIDomains_; this.ExcludedURIDomains = ExcludedURIDomains_; this.CRLDistributionPoints = CRLDistributionPoints_; this.PolicyIdentifiers = PolicyIdentifiers_; }); InsecureAlgorithmError = $pkg.InsecureAlgorithmError = $newType(4, $kindInt, "x509.InsecureAlgorithmError", true, "crypto/x509", true, null); ConstraintViolationError = $pkg.ConstraintViolationError = $newType(0, $kindStruct, "x509.ConstraintViolationError", true, "crypto/x509", true, function() { this.$val = this; if (arguments.length === 0) { return; } }); UnhandledCriticalExtension = $pkg.UnhandledCriticalExtension = $newType(0, $kindStruct, "x509.UnhandledCriticalExtension", true, "crypto/x509", true, function() { this.$val = this; if (arguments.length === 0) { return; } }); InvalidReason = $pkg.InvalidReason = $newType(4, $kindInt, "x509.InvalidReason", true, "crypto/x509", true, null); CertificateInvalidError = $pkg.CertificateInvalidError = $newType(0, $kindStruct, "x509.CertificateInvalidError", true, "crypto/x509", true, function(Cert_, Reason_, Detail_) { this.$val = this; if (arguments.length === 0) { this.Cert = ptrType$4.nil; this.Reason = 0; this.Detail = ""; return; } this.Cert = Cert_; this.Reason = Reason_; this.Detail = Detail_; }); HostnameError = $pkg.HostnameError = $newType(0, $kindStruct, "x509.HostnameError", true, "crypto/x509", true, function(Certificate_, Host_) { this.$val = this; if (arguments.length === 0) { this.Certificate = ptrType$4.nil; this.Host = ""; return; } this.Certificate = Certificate_; this.Host = Host_; }); UnknownAuthorityError = $pkg.UnknownAuthorityError = $newType(0, $kindStruct, "x509.UnknownAuthorityError", true, "crypto/x509", true, function(Cert_, hintErr_, hintCert_) { this.$val = this; if (arguments.length === 0) { this.Cert = ptrType$4.nil; this.hintErr = $ifaceNil; this.hintCert = ptrType$4.nil; return; } this.Cert = Cert_; this.hintErr = hintErr_; this.hintCert = hintCert_; }); SystemRootsError = $pkg.SystemRootsError = $newType(0, $kindStruct, "x509.SystemRootsError", true, "crypto/x509", true, function(Err_) { this.$val = this; if (arguments.length === 0) { this.Err = $ifaceNil; return; } this.Err = Err_; }); VerifyOptions = $pkg.VerifyOptions = $newType(0, $kindStruct, "x509.VerifyOptions", true, "crypto/x509", true, function(DNSName_, Intermediates_, Roots_, CurrentTime_, KeyUsages_, MaxConstraintComparisions_) { this.$val = this; if (arguments.length === 0) { this.DNSName = ""; this.Intermediates = ptrType.nil; this.Roots = ptrType.nil; this.CurrentTime = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$7.nil); this.KeyUsages = sliceType$22.nil; this.MaxConstraintComparisions = 0; return; } this.DNSName = DNSName_; this.Intermediates = Intermediates_; this.Roots = Roots_; this.CurrentTime = CurrentTime_; this.KeyUsages = KeyUsages_; this.MaxConstraintComparisions = MaxConstraintComparisions_; }); rfc2821Mailbox = $pkg.rfc2821Mailbox = $newType(0, $kindStruct, "x509.rfc2821Mailbox", true, "crypto/x509", false, function(local_, domain_) { this.$val = this; if (arguments.length === 0) { this.local = ""; this.domain = ""; return; } this.local = local_; this.domain = domain_; }); ecPrivateKey = $pkg.ecPrivateKey = $newType(0, $kindStruct, "x509.ecPrivateKey", true, "crypto/x509", false, function(Version_, PrivateKey_, NamedCurveOID_, PublicKey_) { this.$val = this; if (arguments.length === 0) { this.Version = 0; this.PrivateKey = sliceType$1.nil; this.NamedCurveOID = asn1.ObjectIdentifier.nil; this.PublicKey = new asn1.BitString.ptr(sliceType$1.nil, 0); return; } this.Version = Version_; this.PrivateKey = PrivateKey_; this.NamedCurveOID = NamedCurveOID_; this.PublicKey = PublicKey_; }); pkcs8 = $pkg.pkcs8 = $newType(0, $kindStruct, "x509.pkcs8", true, "crypto/x509", false, function(Version_, Algo_, PrivateKey_) { this.$val = this; if (arguments.length === 0) { this.Version = 0; this.Algo = new pkix.AlgorithmIdentifier.ptr(asn1.ObjectIdentifier.nil, new asn1.RawValue.ptr(0, 0, false, sliceType$1.nil, sliceType$1.nil)); this.PrivateKey = sliceType$1.nil; return; } this.Version = Version_; this.Algo = Algo_; this.PrivateKey = PrivateKey_; }); pkcs1PrivateKey = $pkg.pkcs1PrivateKey = $newType(0, $kindStruct, "x509.pkcs1PrivateKey", true, "crypto/x509", false, function(Version_, N_, E_, D_, P_, Q_, Dp_, Dq_, Qinv_, AdditionalPrimes_) { this.$val = this; if (arguments.length === 0) { this.Version = 0; this.N = ptrType$1.nil; this.E = 0; this.D = ptrType$1.nil; this.P = ptrType$1.nil; this.Q = ptrType$1.nil; this.Dp = ptrType$1.nil; this.Dq = ptrType$1.nil; this.Qinv = ptrType$1.nil; this.AdditionalPrimes = sliceType$23.nil; return; } this.Version = Version_; this.N = N_; this.E = E_; this.D = D_; this.P = P_; this.Q = Q_; this.Dp = Dp_; this.Dq = Dq_; this.Qinv = Qinv_; this.AdditionalPrimes = AdditionalPrimes_; }); pkcs1AdditionalRSAPrime = $pkg.pkcs1AdditionalRSAPrime = $newType(0, $kindStruct, "x509.pkcs1AdditionalRSAPrime", true, "crypto/x509", false, function(Prime_, Exp_, Coeff_) { this.$val = this; if (arguments.length === 0) { this.Prime = ptrType$1.nil; this.Exp = ptrType$1.nil; this.Coeff = ptrType$1.nil; return; } this.Prime = Prime_; this.Exp = Exp_; this.Coeff = Coeff_; }); pkcs1PublicKey = $pkg.pkcs1PublicKey = $newType(0, $kindStruct, "x509.pkcs1PublicKey", true, "crypto/x509", false, function(N_, E_) { this.$val = this; if (arguments.length === 0) { this.N = ptrType$1.nil; this.E = 0; return; } this.N = N_; this.E = E_; }); sum224 = $pkg.sum224 = $newType(28, $kindArray, "x509.sum224", true, "crypto/x509", false, null); CertPool = $pkg.CertPool = $newType(0, $kindStruct, "x509.CertPool", true, "crypto/x509", true, function(byName_, lazyCerts_, haveSum_) { this.$val = this; if (arguments.length === 0) { this.byName = false; this.lazyCerts = sliceType$29.nil; this.haveSum = false; return; } this.byName = byName_; this.lazyCerts = lazyCerts_; this.haveSum = haveSum_; }); lazyCert = $pkg.lazyCert = $newType(0, $kindStruct, "x509.lazyCert", true, "crypto/x509", false, function(rawSubject_, getCert_) { this.$val = this; if (arguments.length === 0) { this.rawSubject = sliceType$1.nil; this.getCert = $throwNilPointerError; return; } this.rawSubject = rawSubject_; this.getCert = getCert_; }); ptrType = $ptrType(CertPool); structType = $structType("crypto/x509", [{prop: "algo", name: "algo", embedded: false, exported: false, typ: SignatureAlgorithm, tag: ""}, {prop: "name", name: "name", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "oid", name: "oid", embedded: false, exported: false, typ: asn1.ObjectIdentifier, tag: ""}, {prop: "pubKeyAlgo", name: "pubKeyAlgo", embedded: false, exported: false, typ: PublicKeyAlgorithm, tag: ""}, {prop: "hash", name: "hash", embedded: false, exported: false, typ: crypto.Hash, tag: ""}]); sliceType = $sliceType(structType); sliceType$1 = $sliceType($Uint8); structType$1 = $structType("crypto/x509", [{prop: "extKeyUsage", name: "extKeyUsage", embedded: false, exported: false, typ: ExtKeyUsage, tag: ""}, {prop: "oid", name: "oid", embedded: false, exported: false, typ: asn1.ObjectIdentifier, tag: ""}]); sliceType$2 = $sliceType(structType$1); sliceType$3 = $sliceType($Int); sliceType$4 = $sliceType($String); ptrType$1 = $ptrType(big.Int); ptrType$2 = $ptrType(rsa.PublicKey); ptrType$3 = $ptrType(ecdsa.PublicKey); sliceType$6 = $sliceType($emptyInterface); ptrType$4 = $ptrType(Certificate); sliceType$8 = $sliceType(pkix.Extension); ptrType$6 = $ptrType($Bool); sliceType$11 = $sliceType(asn1.ObjectIdentifier); ptrType$7 = $ptrType(time.Location); ptrType$8 = $ptrType(pem.Block); sliceType$13 = $sliceType(pkix.RevokedCertificate); ptrType$9 = $ptrType(pkix.CertificateList); sliceType$15 = $sliceType(pkix.AttributeTypeAndValue); sliceType$18 = $sliceType(net.IP); ptrType$13 = $ptrType(url.URL); sliceType$19 = $sliceType(ptrType$13); ptrType$14 = $ptrType(pkix.RDNSequence); ptrType$16 = $ptrType($Int); ptrType$17 = $ptrType(net.IPNet); sliceType$20 = $sliceType(ptrType$4); sliceType$21 = $sliceType(sliceType$20); sliceType$22 = $sliceType(ExtKeyUsage); ptrType$18 = $ptrType(asn1.ObjectIdentifier); ptrType$19 = $ptrType(ecdsa.PrivateKey); sliceType$23 = $sliceType(pkcs1AdditionalRSAPrime); ptrType$20 = $ptrType(sliceType$1); ptrType$21 = $ptrType(rsa.PrivateKey); sliceType$25 = $sliceType(ptrType$1); sliceType$26 = $sliceType(rsa.CRTValue); sliceType$27 = $sliceType($Uint16); ptrType$23 = $ptrType(cryptobyte.String); ptrType$24 = $ptrType(asn1$1.Tag); sliceType$28 = $sliceType(ptrType$17); sliceType$29 = $sliceType(lazyCert); structType$3 = $structType("crypto/x509", [{prop: "Once", name: "Once", embedded: true, exported: true, typ: sync.Once, tag: ""}, {prop: "v", name: "v", embedded: false, exported: false, typ: ptrType$4, tag: ""}]); sliceType$30 = $sliceType(sliceType$1); funcType = $funcType([$emptyInterface, $emptyInterface], [$Bool, $error], false); ptrType$25 = $ptrType(VerifyOptions); mapType = $mapType(ptrType$4, sliceType$21); funcType$2 = $funcType([], [ptrType$4, $error], false); mapType$1 = $mapType($String, sliceType$3); mapType$2 = $mapType(sum224, $Bool); SignatureAlgorithm.prototype.isRSAPSS = function() { var _1, algo; algo = this.$val; _1 = algo; if ((_1 === (13)) || (_1 === (14)) || (_1 === (15))) { return true; } else { return false; } }; $ptrType(SignatureAlgorithm).prototype.isRSAPSS = function() { return new SignatureAlgorithm(this.$get()).isRSAPSS(); }; SignatureAlgorithm.prototype.String = function() { var _i, _ref, algo, details; algo = this.$val; _ref = signatureAlgorithmDetails; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } details = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), structType); if (details.algo === algo) { return details.name; } _i++; } return strconv.Itoa(((algo >> 0))); }; $ptrType(SignatureAlgorithm).prototype.String = function() { return new SignatureAlgorithm(this.$get()).String(); }; PublicKeyAlgorithm.prototype.String = function() { var algo; algo = this.$val; if (0 < algo && ((algo >> 0)) < 5) { return ((algo < 0 || algo >= publicKeyAlgoName.length) ? ($throwRuntimeError("index out of range"), undefined) : publicKeyAlgoName[algo]); } return strconv.Itoa(((algo >> 0))); }; $ptrType(PublicKeyAlgorithm).prototype.String = function() { return new PublicKeyAlgorithm(this.$get()).String(); }; getSignatureAlgorithmFromAI = function(ai) { var _i, _r, _r$1, _ref, _tuple, _tuple$1, ai, details, err, err$1, mgf1HashFunc, params, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; ai = $f.ai; details = $f.details; err = $f.err; err$1 = $f.err$1; mgf1HashFunc = $f.mgf1HashFunc; params = $f.params; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: mgf1HashFunc = [mgf1HashFunc]; params = [params]; if (ai.Algorithm.Equal(oidSignatureEd25519)) { if (!((ai.Parameters.FullBytes.$length === 0))) { $s = -1; return 0; } } if (!ai.Algorithm.Equal(oidSignatureRSAPSS)) { _ref = signatureAlgorithmDetails; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } details = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), structType); if (ai.Algorithm.Equal(details.oid)) { $s = -1; return details.algo; } _i++; } $s = -1; return 0; } params[0] = new pssParameters.ptr(new pkix.AlgorithmIdentifier.ptr(asn1.ObjectIdentifier.nil, new asn1.RawValue.ptr(0, 0, false, sliceType$1.nil, sliceType$1.nil)), new pkix.AlgorithmIdentifier.ptr(asn1.ObjectIdentifier.nil, new asn1.RawValue.ptr(0, 0, false, sliceType$1.nil, sliceType$1.nil)), 0, 0); _r = asn1.Unmarshal(ai.Parameters.FullBytes, params[0]); /* */ $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))) { $s = -1; return 0; } mgf1HashFunc[0] = new pkix.AlgorithmIdentifier.ptr(asn1.ObjectIdentifier.nil, new asn1.RawValue.ptr(0, 0, false, sliceType$1.nil, sliceType$1.nil)); _r$1 = asn1.Unmarshal(params[0].MGF.Parameters.FullBytes, mgf1HashFunc[0]); /* */ $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; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return 0; } if ((!((params[0].Hash.Parameters.FullBytes.$length === 0)) && !bytes.Equal(params[0].Hash.Parameters.FullBytes, asn1.NullBytes)) || !params[0].MGF.Algorithm.Equal(oidMGF1) || !mgf1HashFunc[0].Algorithm.Equal(params[0].Hash.Algorithm) || (!((mgf1HashFunc[0].Parameters.FullBytes.$length === 0)) && !bytes.Equal(mgf1HashFunc[0].Parameters.FullBytes, asn1.NullBytes)) || !((params[0].TrailerField === 1))) { $s = -1; return 0; } if (params[0].Hash.Algorithm.Equal(oidSHA256) && (params[0].SaltLength === 32)) { $s = -1; return 13; } else if (params[0].Hash.Algorithm.Equal(oidSHA384) && (params[0].SaltLength === 48)) { $s = -1; return 14; } else if (params[0].Hash.Algorithm.Equal(oidSHA512) && (params[0].SaltLength === 64)) { $s = -1; return 15; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: getSignatureAlgorithmFromAI }; } $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.ai = ai; $f.details = details; $f.err = err; $f.err$1 = err$1; $f.mgf1HashFunc = mgf1HashFunc; $f.params = params; $f.$s = $s; $f.$r = $r; return $f; }; getPublicKeyAlgorithmFromOID = function(oid) { var oid; if (oid.Equal(oidPublicKeyRSA)) { return 1; } else if (oid.Equal(oidPublicKeyDSA)) { return 2; } else if (oid.Equal(oidPublicKeyECDSA)) { return 3; } else if (oid.Equal(oidPublicKeyEd25519)) { return 4; } return 0; }; namedCurveFromOID = function(oid) { var $24r, $24r$1, $24r$2, $24r$3, _r, _r$1, _r$2, _r$3, oid, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; oid = $f.oid; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (oid.Equal(oidNamedCurveP224)) { $s = 2; continue; } /* */ if (oid.Equal(oidNamedCurveP256)) { $s = 3; continue; } /* */ if (oid.Equal(oidNamedCurveP384)) { $s = 4; continue; } /* */ if (oid.Equal(oidNamedCurveP521)) { $s = 5; continue; } /* */ $s = 6; continue; /* if (oid.Equal(oidNamedCurveP224)) { */ case 2: _r = elliptic.P224(); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 8; case 8: return $24r; /* } else if (oid.Equal(oidNamedCurveP256)) { */ case 3: _r$1 = elliptic.P256(); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r$1 = _r$1; $s = 10; case 10: return $24r$1; /* } else if (oid.Equal(oidNamedCurveP384)) { */ case 4: _r$2 = elliptic.P384(); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r$2 = _r$2; $s = 12; case 12: return $24r$2; /* } else if (oid.Equal(oidNamedCurveP521)) { */ case 5: _r$3 = elliptic.P521(); /* */ $s = 13; case 13: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r$3 = _r$3; $s = 14; case 14: return $24r$3; /* } */ case 6: case 1: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: namedCurveFromOID }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.oid = oid; $f.$s = $s; $f.$r = $r; return $f; }; extKeyUsageFromOID = function(oid) { var _i, _ref, _tmp, _tmp$1, eku, oid, ok, pair; eku = 0; ok = false; _ref = extKeyUsageOIDs; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } pair = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), structType$1); if (oid.Equal(pair.oid)) { _tmp = pair.extKeyUsage; _tmp$1 = true; eku = _tmp; ok = _tmp$1; return [eku, ok]; } _i++; } return [eku, ok]; }; InsecureAlgorithmError.prototype.Error = function() { var $24r, _r, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this.$val; _r = fmt.Sprintf("x509: cannot verify signature: insecure algorithm %v", new sliceType$6([new SignatureAlgorithm(((e >> 0)))])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: InsecureAlgorithmError.prototype.Error }; } $f.$24r = $24r; $f._r = _r; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(InsecureAlgorithmError).prototype.Error = function() { return new InsecureAlgorithmError(this.$get()).Error(); }; ConstraintViolationError.ptr.prototype.Error = function() { return "x509: invalid signature: parent certificate cannot sign this kind of certificate"; }; ConstraintViolationError.prototype.Error = function() { return this.$val.Error(); }; Certificate.ptr.prototype.Equal = function(other) { var c, other; c = this; if (c === ptrType$4.nil || other === ptrType$4.nil) { return c === other; } return bytes.Equal(c.Raw, other.Raw); }; Certificate.prototype.Equal = function(other) { return this.$val.Equal(other); }; Certificate.ptr.prototype.hasSANExtension = function() { var c; c = this; return oidInExtensions($convertSliceType(oidExtensionSubjectAltName, asn1.ObjectIdentifier), c.Extensions); }; Certificate.prototype.hasSANExtension = function() { return this.$val.hasSANExtension(); }; Certificate.ptr.prototype.CheckSignatureFrom = function(parent) { var $24r, _r, c, parent, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; c = $f.c; parent = $f.parent; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if ((parent.Version === 3) && !parent.BasicConstraintsValid || parent.BasicConstraintsValid && !parent.IsCA) { $s = -1; return (x = new ConstraintViolationError.ptr(), new x.constructor.elem(x)); } if (!((parent.KeyUsage === 0)) && ((parent.KeyUsage & 32) === 0)) { $s = -1; return (x$1 = new ConstraintViolationError.ptr(), new x$1.constructor.elem(x$1)); } if (parent.PublicKeyAlgorithm === 0) { $s = -1; return $pkg.ErrUnsupportedAlgorithm; } _r = parent.CheckSignature(c.SignatureAlgorithm, c.RawTBSCertificate, c.Signature); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Certificate.ptr.prototype.CheckSignatureFrom }; } $f.$24r = $24r; $f._r = _r; $f.c = c; $f.parent = parent; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; Certificate.prototype.CheckSignatureFrom = function(parent) { return this.$val.CheckSignatureFrom(parent); }; Certificate.ptr.prototype.CheckSignature = function(algo, signed, signature) { var $24r, _r, algo, c, signature, signed, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; algo = $f.algo; c = $f.c; signature = $f.signature; signed = $f.signed; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r = checkSignature(algo, signed, signature, c.PublicKey); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Certificate.ptr.prototype.CheckSignature }; } $f.$24r = $24r; $f._r = _r; $f.algo = algo; $f.c = c; $f.signature = signature; $f.signed = signed; $f.$s = $s; $f.$r = $r; return $f; }; Certificate.prototype.CheckSignature = function(algo, signed, signature) { return this.$val.CheckSignature(algo, signed, signature); }; Certificate.ptr.prototype.hasNameConstraints = function() { var c; c = this; return oidInExtensions($convertSliceType(oidExtensionNameConstraints, asn1.ObjectIdentifier), c.Extensions); }; Certificate.prototype.hasNameConstraints = function() { return this.$val.hasNameConstraints(); }; Certificate.ptr.prototype.getSANExtension = function() { var _i, _ref, c, e; c = this; _ref = c.Extensions; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } e = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), pkix.Extension); if (e.Id.Equal($convertSliceType(oidExtensionSubjectAltName, asn1.ObjectIdentifier))) { return e.Value; } _i++; } return sliceType$1.nil; }; Certificate.prototype.getSANExtension = function() { return this.$val.getSANExtension(); }; signaturePublicKeyAlgoMismatchError = function(expectedPubKeyAlgo, pubKey) { var $24r, _r, expectedPubKeyAlgo, pubKey, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; expectedPubKeyAlgo = $f.expectedPubKeyAlgo; pubKey = $f.pubKey; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = fmt.Errorf("x509: signature algorithm specifies an %s public key, but have public key of type %T", new sliceType$6([new $String(new PublicKeyAlgorithm(expectedPubKeyAlgo).String()), pubKey])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: signaturePublicKeyAlgoMismatchError }; } $f.$24r = $24r; $f._r = _r; $f.expectedPubKeyAlgo = expectedPubKeyAlgo; $f.pubKey = pubKey; $f.$s = $s; $f.$r = $r; return $f; }; checkSignature = function(algo, signed, signature, publicKey) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, _1, _i, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _ref$1, algo, details, err, h, hashType, pub, pub$1, pub$2, pubKeyAlgo, publicKey, signature, signed, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; _1 = $f._1; _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; _ref$1 = $f._ref$1; algo = $f.algo; details = $f.details; err = $f.err; h = $f.h; hashType = $f.hashType; pub = $f.pub; pub$1 = $f.pub$1; pub$2 = $f.pub$2; pubKeyAlgo = $f.pubKeyAlgo; publicKey = $f.publicKey; signature = $f.signature; signed = $f.signed; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; hashType = 0; pubKeyAlgo = 0; _ref = signatureAlgorithmDetails; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } details = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), structType); if (details.algo === algo) { hashType = details.hash; pubKeyAlgo = details.pubKeyAlgo; } _i++; } _1 = hashType; /* */ if (_1 === (0)) { $s = 2; continue; } /* */ if (_1 === (2)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_1 === (0)) { */ case 2: if (!((pubKeyAlgo === 4))) { err = $pkg.ErrUnsupportedAlgorithm; $s = -1; return err; } $s = 5; continue; /* } else if (_1 === (2)) { */ case 3: err = new InsecureAlgorithmError(((algo >> 0))); $s = -1; return err; /* } else { */ case 4: if (!new crypto.Hash(hashType).Available()) { err = $pkg.ErrUnsupportedAlgorithm; $s = -1; return err; } _r = new crypto.Hash(hashType).New(); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } h = _r; _r$1 = h.Write(signed); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _r$2 = h.Sum(sliceType$1.nil); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } signed = _r$2; /* } */ case 5: case 1: _ref$1 = publicKey; /* */ if ($assertType(_ref$1, ptrType$2, true)[1]) { $s = 9; continue; } /* */ if ($assertType(_ref$1, ptrType$3, true)[1]) { $s = 10; continue; } /* */ if ($assertType(_ref$1, ed25519.PublicKey, true)[1]) { $s = 11; continue; } /* */ $s = 12; continue; /* if ($assertType(_ref$1, ptrType$2, true)[1]) { */ case 9: pub = _ref$1.$val; /* */ if (!((pubKeyAlgo === 1))) { $s = 13; continue; } /* */ $s = 14; continue; /* if (!((pubKeyAlgo === 1))) { */ case 13: _r$3 = signaturePublicKeyAlgoMismatchError(pubKeyAlgo, pub); /* */ $s = 15; case 15: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } err = _r$3; $24r = err; $s = 16; case 16: return $24r; /* } */ case 14: /* */ if (new SignatureAlgorithm(algo).isRSAPSS()) { $s = 17; continue; } /* */ $s = 18; continue; /* if (new SignatureAlgorithm(algo).isRSAPSS()) { */ case 17: _r$4 = rsa.VerifyPSS(pub, hashType, signed, signature, new rsa.PSSOptions.ptr(-1, 0)); /* */ $s = 20; case 20: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } err = _r$4; $24r$1 = err; $s = 21; case 21: return $24r$1; /* } else { */ case 18: _r$5 = rsa.VerifyPKCS1v15(pub, hashType, signed, signature); /* */ $s = 22; case 22: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } err = _r$5; $24r$2 = err; $s = 23; case 23: return $24r$2; /* } */ case 19: $s = 12; continue; /* } else if ($assertType(_ref$1, ptrType$3, true)[1]) { */ case 10: pub$1 = _ref$1.$val; /* */ if (!((pubKeyAlgo === 3))) { $s = 24; continue; } /* */ $s = 25; continue; /* if (!((pubKeyAlgo === 3))) { */ case 24: _r$6 = signaturePublicKeyAlgoMismatchError(pubKeyAlgo, pub$1); /* */ $s = 26; case 26: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } err = _r$6; $24r$3 = err; $s = 27; case 27: return $24r$3; /* } */ case 25: _r$7 = ecdsa.VerifyASN1(pub$1, signed, signature); /* */ $s = 30; case 30: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } /* */ if (!_r$7) { $s = 28; continue; } /* */ $s = 29; continue; /* if (!_r$7) { */ case 28: err = errors.New("x509: ECDSA verification failure"); $s = -1; return err; /* } */ case 29: $s = -1; return err; /* } else if ($assertType(_ref$1, ed25519.PublicKey, true)[1]) { */ case 11: pub$2 = _ref$1.$val; /* */ if (!((pubKeyAlgo === 4))) { $s = 31; continue; } /* */ $s = 32; continue; /* if (!((pubKeyAlgo === 4))) { */ case 31: _r$8 = signaturePublicKeyAlgoMismatchError(pubKeyAlgo, pub$2); /* */ $s = 33; case 33: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } err = _r$8; $24r$4 = err; $s = 34; case 34: return $24r$4; /* } */ case 32: _r$9 = ed25519.Verify(pub$2, signed, signature); /* */ $s = 37; case 37: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } /* */ if (!_r$9) { $s = 35; continue; } /* */ $s = 36; continue; /* if (!_r$9) { */ case 35: err = errors.New("x509: Ed25519 verification failure"); $s = -1; return err; /* } */ case 36: $s = -1; return err; /* } */ case 12: err = $pkg.ErrUnsupportedAlgorithm; $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: checkSignature }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f._1 = _1; $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._ref$1 = _ref$1; $f.algo = algo; $f.details = details; $f.err = err; $f.h = h; $f.hashType = hashType; $f.pub = pub; $f.pub$1 = pub$1; $f.pub$2 = pub$2; $f.pubKeyAlgo = pubKeyAlgo; $f.publicKey = publicKey; $f.signature = signature; $f.signed = signed; $f.$s = $s; $f.$r = $r; return $f; }; Certificate.ptr.prototype.CheckCRLSignature = function(crl) { var $24r, _r, _r$1, algo, c, crl, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; algo = $f.algo; c = $f.c; crl = $f.crl; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r = getSignatureAlgorithmFromAI($clone(crl.SignatureAlgorithm, pkix.AlgorithmIdentifier)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } algo = _r; _r$1 = c.CheckSignature(algo, $convertSliceType(crl.TBSCertList.Raw, sliceType$1), $clone(crl.SignatureValue, asn1.BitString).RightAlign()); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Certificate.ptr.prototype.CheckCRLSignature }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f.algo = algo; $f.c = c; $f.crl = crl; $f.$s = $s; $f.$r = $r; return $f; }; Certificate.prototype.CheckCRLSignature = function(crl) { return this.$val.CheckCRLSignature(crl); }; UnhandledCriticalExtension.ptr.prototype.Error = function() { var h; h = this; return "x509: unhandled critical extension"; }; UnhandledCriticalExtension.prototype.Error = function() { return this.$val.Error(); }; oidInExtensions = function(oid, extensions) { var _i, _ref, e, extensions, oid; _ref = extensions; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } e = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), pkix.Extension); if (e.Id.Equal(oid)) { return true; } _i++; } return false; }; isIA5String = function(s) { var $24r, _i, _r, _ref, _rune, r, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _i = $f._i; _r = $f._r; _ref = $f._ref; _rune = $f._rune; r = $f.r; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _ref = s; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.length)) { break; } */ if(!(_i < _ref.length)) { $s = 2; continue; } _rune = $decodeRune(_ref, _i); r = _rune[0]; /* */ if (r > 127) { $s = 3; continue; } /* */ $s = 4; continue; /* if (r > 127) { */ case 3: _r = fmt.Errorf("x509: %q cannot be encoded as an IA5String", new sliceType$6([new $String(s)])); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 6; case 6: return $24r; /* } */ case 4: _i += _rune[1]; $s = 1; continue; case 2: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: isIA5String }; } $f.$24r = $24r; $f._i = _i; $f._r = _r; $f._ref = _ref; $f._rune = _rune; $f.r = r; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; signingParamsForPublicKey = function(pub, requestedSigAlgo) { var _1, _entry, _i, _r, _r$1, _r$2, _r$3, _ref, _ref$1, _tmp, _tmp$1, _v, details, err, found, hashFunc, pub, pub$1, pub$2, pub$3, pub$4, pubType, requestedSigAlgo, sigAlgo, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _entry = $f._entry; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; _ref$1 = $f._ref$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _v = $f._v; details = $f.details; err = $f.err; found = $f.found; hashFunc = $f.hashFunc; pub = $f.pub; pub$1 = $f.pub$1; pub$2 = $f.pub$2; pub$3 = $f.pub$3; pub$4 = $f.pub$4; pubType = $f.pubType; requestedSigAlgo = $f.requestedSigAlgo; sigAlgo = $f.sigAlgo; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hashFunc = 0; sigAlgo = new pkix.AlgorithmIdentifier.ptr(asn1.ObjectIdentifier.nil, new asn1.RawValue.ptr(0, 0, false, sliceType$1.nil, sliceType$1.nil)); err = $ifaceNil; pubType = 0; _ref = pub; /* */ if ($assertType(_ref, ptrType$2, true)[1]) { $s = 1; continue; } /* */ if ($assertType(_ref, ptrType$3, true)[1]) { $s = 2; continue; } /* */ if ($assertType(_ref, ed25519.PublicKey, true)[1]) { $s = 3; continue; } /* */ $s = 4; continue; /* if ($assertType(_ref, ptrType$2, true)[1]) { */ case 1: pub$1 = _ref.$val; pubType = 1; hashFunc = 5; sigAlgo.Algorithm = oidSignatureSHA256WithRSA; asn1.RawValue.copy(sigAlgo.Parameters, asn1.NullRawValue); $s = 5; continue; /* } else if ($assertType(_ref, ptrType$3, true)[1]) { */ case 2: pub$2 = _ref.$val; pubType = 3; _1 = pub$2.Curve; _r = elliptic.P224(); /* */ $s = 13; case 13: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } if ($interfaceIsEqual(_1, (_r))) { _v = true; $s = 12; continue s; } _r$1 = elliptic.P256(); /* */ $s = 14; case 14: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _v = $interfaceIsEqual(_1, (_r$1)); case 12: /* */ if (_v) { $s = 7; continue; } _r$2 = elliptic.P384(); /* */ $s = 15; case 15: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } /* */ if ($interfaceIsEqual(_1, (_r$2))) { $s = 8; continue; } _r$3 = elliptic.P521(); /* */ $s = 16; case 16: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } /* */ if ($interfaceIsEqual(_1, (_r$3))) { $s = 9; continue; } /* */ $s = 10; continue; /* if (_v) { */ case 7: hashFunc = 5; sigAlgo.Algorithm = oidSignatureECDSAWithSHA256; $s = 11; continue; /* } else if ($interfaceIsEqual(_1, (_r$2))) { */ case 8: hashFunc = 6; sigAlgo.Algorithm = oidSignatureECDSAWithSHA384; $s = 11; continue; /* } else if ($interfaceIsEqual(_1, (_r$3))) { */ case 9: hashFunc = 7; sigAlgo.Algorithm = oidSignatureECDSAWithSHA512; $s = 11; continue; /* } else { */ case 10: err = errors.New("x509: unknown elliptic curve"); /* } */ case 11: case 6: $s = 5; continue; /* } else if ($assertType(_ref, ed25519.PublicKey, true)[1]) { */ case 3: pub$3 = _ref.$val; pubType = 4; sigAlgo.Algorithm = oidSignatureEd25519; $s = 5; continue; /* } else { */ case 4: pub$4 = _ref; err = errors.New("x509: only RSA, ECDSA and Ed25519 keys supported"); /* } */ case 5: if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [hashFunc, sigAlgo, err]; } if (requestedSigAlgo === 0) { $s = -1; return [hashFunc, sigAlgo, err]; } found = false; _ref$1 = signatureAlgorithmDetails; _i = 0; while (true) { if (!(_i < _ref$1.$length)) { break; } details = $clone(((_i < 0 || _i >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i]), structType); if (details.algo === requestedSigAlgo) { if (!((details.pubKeyAlgo === pubType))) { err = errors.New("x509: requested SignatureAlgorithm does not match private key type"); $s = -1; return [hashFunc, sigAlgo, err]; } _tmp = details.oid; _tmp$1 = details.hash; sigAlgo.Algorithm = _tmp; hashFunc = _tmp$1; if ((hashFunc === 0) && !((pubType === 4))) { err = errors.New("x509: cannot sign with hash function requested"); $s = -1; return [hashFunc, sigAlgo, err]; } if (new SignatureAlgorithm(requestedSigAlgo).isRSAPSS()) { asn1.RawValue.copy(sigAlgo.Parameters, (_entry = hashToPSSParameters[crypto.Hash.keyFor(hashFunc)], _entry !== undefined ? _entry.v : new asn1.RawValue.ptr(0, 0, false, sliceType$1.nil, sliceType$1.nil))); } found = true; break; } _i++; } if (!found) { err = errors.New("x509: unknown SignatureAlgorithm"); } $s = -1; return [hashFunc, sigAlgo, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: signingParamsForPublicKey }; } $f._1 = _1; $f._entry = _entry; $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._ref$1 = _ref$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._v = _v; $f.details = details; $f.err = err; $f.found = found; $f.hashFunc = hashFunc; $f.pub = pub; $f.pub$1 = pub$1; $f.pub$2 = pub$2; $f.pub$3 = pub$3; $f.pub$4 = pub$4; $f.pubType = pubType; $f.requestedSigAlgo = requestedSigAlgo; $f.sigAlgo = sigAlgo; $f.$s = $s; $f.$r = $r; return $f; }; Certificate.ptr.prototype.CreateCRL = function(rand, priv, revokedCerts, now, expiry) { var $24r, _i, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _ref, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, aki, c, crlBytes, err, expiry, h, hashFunc, i, key, now, ok, priv, rand, rc, revokedCerts, revokedCertsUTC, signature, signatureAlgorithm, signed, tbsCertList, tbsCertListContents, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; _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; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; _tuple$5 = $f._tuple$5; aki = $f.aki; c = $f.c; crlBytes = $f.crlBytes; err = $f.err; expiry = $f.expiry; h = $f.h; hashFunc = $f.hashFunc; i = $f.i; key = $f.key; now = $f.now; ok = $f.ok; priv = $f.priv; rand = $f.rand; rc = $f.rc; revokedCerts = $f.revokedCerts; revokedCertsUTC = $f.revokedCertsUTC; signature = $f.signature; signatureAlgorithm = $f.signatureAlgorithm; signed = $f.signed; tbsCertList = $f.tbsCertList; tbsCertListContents = $f.tbsCertListContents; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: crlBytes = sliceType$1.nil; err = $ifaceNil; c = this; _tuple = $assertType(priv, crypto.Signer, true); key = _tuple[0]; ok = _tuple[1]; if (!ok) { _tmp = sliceType$1.nil; _tmp$1 = errors.New("x509: certificate private key does not implement crypto.Signer"); crlBytes = _tmp; err = _tmp$1; $s = -1; return [crlBytes, err]; } _r = key.Public(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = signingParamsForPublicKey(_r, 0); /* */ $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; hashFunc = _tuple$1[0]; signatureAlgorithm = $clone(_tuple$1[1], pkix.AlgorithmIdentifier); err = _tuple$1[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$2 = sliceType$1.nil; _tmp$3 = err; crlBytes = _tmp$2; err = _tmp$3; $s = -1; return [crlBytes, err]; } revokedCertsUTC = $makeSlice(sliceType$13, revokedCerts.$length); _ref = revokedCerts; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; rc = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), pkix.RevokedCertificate); time.Time.copy(rc.RevocationTime, $clone(rc.RevocationTime, time.Time).UTC()); pkix.RevokedCertificate.copy(((i < 0 || i >= revokedCertsUTC.$length) ? ($throwRuntimeError("index out of range"), undefined) : revokedCertsUTC.$array[revokedCertsUTC.$offset + i]), rc); _i++; } tbsCertList = new pkix.TBSCertificateList.ptr(asn1.RawContent.nil, 1, $clone(signatureAlgorithm, pkix.AlgorithmIdentifier), $clone(c.Subject, pkix.Name).ToRDNSequence(), $clone($clone(now, time.Time).UTC(), time.Time), $clone($clone(expiry, time.Time).UTC(), time.Time), revokedCertsUTC, sliceType$8.nil); /* */ if (c.SubjectKeyId.$length > 0) { $s = 3; continue; } /* */ $s = 4; continue; /* if (c.SubjectKeyId.$length > 0) { */ case 3: aki = new pkix.Extension.ptr(asn1.ObjectIdentifier.nil, false, sliceType$1.nil); aki.Id = $convertSliceType(oidExtensionAuthorityKeyId, asn1.ObjectIdentifier); _r$2 = asn1.Marshal((x = new authKeyId.ptr(c.SubjectKeyId), new x.constructor.elem(x))); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$2 = _r$2; aki.Value = _tuple$2[0]; err = _tuple$2[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [crlBytes, err]; } tbsCertList.Extensions = $append(tbsCertList.Extensions, aki); /* } */ case 4: _r$3 = asn1.Marshal(new tbsCertList.constructor.elem(tbsCertList)); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$3 = _r$3; tbsCertListContents = _tuple$3[0]; err = _tuple$3[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [crlBytes, err]; } signed = tbsCertListContents; /* */ if (!((hashFunc === 0))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!((hashFunc === 0))) { */ case 7: _r$4 = new crypto.Hash(hashFunc).New(); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } h = _r$4; _r$5 = h.Write(signed); /* */ $s = 10; case 10: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; _r$6 = h.Sum(sliceType$1.nil); /* */ $s = 11; case 11: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } signed = _r$6; /* } */ case 8: signature = sliceType$1.nil; _r$7 = key.Sign(rand, signed, new crypto.Hash(hashFunc)); /* */ $s = 12; case 12: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _tuple$4 = _r$7; signature = _tuple$4[0]; err = _tuple$4[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [crlBytes, err]; } _r$8 = asn1.Marshal((x$1 = new pkix.CertificateList.ptr($clone(tbsCertList, pkix.TBSCertificateList), $clone(signatureAlgorithm, pkix.AlgorithmIdentifier), new asn1.BitString.ptr(signature, $imul(signature.$length, 8))), new x$1.constructor.elem(x$1))); /* */ $s = 13; case 13: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _tuple$5 = _r$8; crlBytes = _tuple$5[0]; err = _tuple$5[1]; $24r = [crlBytes, err]; $s = 14; case 14: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Certificate.ptr.prototype.CreateCRL }; } $f.$24r = $24r; $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._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._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f._tuple$5 = _tuple$5; $f.aki = aki; $f.c = c; $f.crlBytes = crlBytes; $f.err = err; $f.expiry = expiry; $f.h = h; $f.hashFunc = hashFunc; $f.i = i; $f.key = key; $f.now = now; $f.ok = ok; $f.priv = priv; $f.rand = rand; $f.rc = rc; $f.revokedCerts = revokedCerts; $f.revokedCertsUTC = revokedCertsUTC; $f.signature = signature; $f.signatureAlgorithm = signatureAlgorithm; $f.signed = signed; $f.tbsCertList = tbsCertList; $f.tbsCertListContents = tbsCertListContents; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; Certificate.prototype.CreateCRL = function(rand, priv, revokedCerts, now, expiry) { return this.$val.CreateCRL(rand, priv, revokedCerts, now, expiry); }; CertificateInvalidError.ptr.prototype.Error = function() { var _1, e; e = this; _1 = e.Reason; if (_1 === (0)) { return "x509: certificate is not authorized to sign other certificates"; } else if (_1 === (1)) { return "x509: certificate has expired or is not yet valid: " + e.Detail; } else if (_1 === (2)) { return "x509: a root or intermediate certificate is not authorized to sign for this name: " + e.Detail; } else if (_1 === (9)) { return "x509: a root or intermediate certificate is not authorized for an extended key usage: " + e.Detail; } else if (_1 === (3)) { return "x509: too many intermediates for path length constraint"; } else if (_1 === (4)) { return "x509: certificate specifies an incompatible key usage"; } else if (_1 === (5)) { return "x509: issuer name does not match subject from issuing certificate"; } else if (_1 === (6)) { return "x509: issuer has name constraints but leaf doesn't have a SAN extension"; } else if (_1 === (7)) { return "x509: issuer has name constraints but leaf contains unknown or unconstrained name: " + e.Detail; } return "x509: unknown error"; }; CertificateInvalidError.prototype.Error = function() { return this.$val.Error(); }; HostnameError.ptr.prototype.Error = function() { var _i, _ref, c, h, ip, san, valid; h = this; c = h.Certificate; if (!c.hasSANExtension() && matchHostnames(c.Subject.CommonName, h.Host)) { return "x509: certificate relies on legacy Common Name field, use SANs instead"; } valid = ""; ip = net.ParseIP(h.Host); if (!(ip === net.IP.nil)) { if (c.IPAddresses.$length === 0) { return "x509: cannot validate certificate for " + h.Host + " because it doesn't contain any IP SANs"; } _ref = c.IPAddresses; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } san = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (valid.length > 0) { valid = valid + (", "); } valid = valid + (san.String()); _i++; } } else { valid = strings.Join(c.DNSNames, ", "); } if (valid.length === 0) { return "x509: certificate is not valid for any names, but wanted to match " + h.Host; } return "x509: certificate is valid for " + valid + ", not " + h.Host; }; HostnameError.prototype.Error = function() { return this.$val.Error(); }; UnknownAuthorityError.ptr.prototype.Error = function() { var _r, _r$1, certName, e, s, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; certName = $f.certName; e = $f.e; s = $f.s; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; s = "x509: certificate signed by unknown authority"; /* */ if (!($interfaceIsEqual(e.hintErr, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(e.hintErr, $ifaceNil))) { */ case 1: certName = e.hintCert.Subject.CommonName; /* */ if (certName.length === 0) { $s = 3; continue; } /* */ $s = 4; continue; /* if (certName.length === 0) { */ case 3: /* */ if (e.hintCert.Subject.Organization.$length > 0) { $s = 5; continue; } /* */ $s = 6; continue; /* if (e.hintCert.Subject.Organization.$length > 0) { */ case 5: certName = (x = e.hintCert.Subject.Organization, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])); $s = 7; continue; /* } else { */ case 6: _r = e.hintCert.SerialNumber.String(); /* */ $s = 8; case 8: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } certName = "serial:" + _r; /* } */ case 7: /* } */ case 4: _r$1 = fmt.Sprintf(" (possibly because of %q while trying to verify candidate authority certificate %q)", new sliceType$6([e.hintErr, new $String(certName)])); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } s = s + (_r$1); /* } */ case 2: $s = -1; return s; /* */ } return; } if ($f === undefined) { $f = { $blk: UnknownAuthorityError.ptr.prototype.Error }; } $f._r = _r; $f._r$1 = _r$1; $f.certName = certName; $f.e = e; $f.s = s; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; UnknownAuthorityError.prototype.Error = function() { return this.$val.Error(); }; SystemRootsError.ptr.prototype.Error = function() { var $24r, _r, msg, se, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; msg = $f.msg; se = $f.se; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: se = this; msg = "x509: failed to load system roots and no roots provided"; /* */ if (!($interfaceIsEqual(se.Err, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(se.Err, $ifaceNil))) { */ case 1: _r = se.Err.Error(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = msg + "; " + _r; $s = 4; case 4: return $24r; /* } */ case 2: $s = -1; return msg; /* */ } return; } if ($f === undefined) { $f = { $blk: SystemRootsError.ptr.prototype.Error }; } $f.$24r = $24r; $f._r = _r; $f.msg = msg; $f.se = se; $f.$s = $s; $f.$r = $r; return $f; }; SystemRootsError.prototype.Error = function() { return this.$val.Error(); }; SystemRootsError.ptr.prototype.Unwrap = function() { var se; se = this; return se.Err; }; SystemRootsError.prototype.Unwrap = function() { return this.$val.Unwrap(); }; parseRFC2821Mailbox = function(in$1) { var _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, c, c$1, in$1, localPartBytes, mailbox, ok, ok$1, twoDots, x; mailbox = new rfc2821Mailbox.ptr("", ""); ok = false; if (in$1.length === 0) { _tmp = $clone(mailbox, rfc2821Mailbox); _tmp$1 = false; rfc2821Mailbox.copy(mailbox, _tmp); ok = _tmp$1; return [mailbox, ok]; } localPartBytes = $makeSlice(sliceType$1, 0, (_q = in$1.length / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))); if (in$1.charCodeAt(0) === 34) { in$1 = $substring(in$1, 1); QuotedString: while (true) { if (in$1.length === 0) { _tmp$2 = $clone(mailbox, rfc2821Mailbox); _tmp$3 = false; rfc2821Mailbox.copy(mailbox, _tmp$2); ok = _tmp$3; return [mailbox, ok]; } c = in$1.charCodeAt(0); in$1 = $substring(in$1, 1); if ((c === 34)) { break QuotedString; } else if ((c === 92)) { if (in$1.length === 0) { _tmp$4 = $clone(mailbox, rfc2821Mailbox); _tmp$5 = false; rfc2821Mailbox.copy(mailbox, _tmp$4); ok = _tmp$5; return [mailbox, ok]; } if ((in$1.charCodeAt(0) === 11) || (in$1.charCodeAt(0) === 12) || (1 <= in$1.charCodeAt(0) && in$1.charCodeAt(0) <= 9) || (14 <= in$1.charCodeAt(0) && in$1.charCodeAt(0) <= 127)) { localPartBytes = $append(localPartBytes, in$1.charCodeAt(0)); in$1 = $substring(in$1, 1); } else { _tmp$6 = $clone(mailbox, rfc2821Mailbox); _tmp$7 = false; rfc2821Mailbox.copy(mailbox, _tmp$6); ok = _tmp$7; return [mailbox, ok]; } } else if ((c === 11) || (c === 12) || (c === 32) || (c === 33) || (c === 127) || (1 <= c && c <= 8) || (14 <= c && c <= 31) || (35 <= c && c <= 91) || (93 <= c && c <= 126)) { localPartBytes = $append(localPartBytes, c); } else { _tmp$8 = $clone(mailbox, rfc2821Mailbox); _tmp$9 = false; rfc2821Mailbox.copy(mailbox, _tmp$8); ok = _tmp$9; return [mailbox, ok]; } } } else { NextChar: while (true) { if (!(in$1.length > 0)) { break; } c$1 = in$1.charCodeAt(0); if ((c$1 === 92)) { in$1 = $substring(in$1, 1); if (in$1.length === 0) { _tmp$10 = $clone(mailbox, rfc2821Mailbox); _tmp$11 = false; rfc2821Mailbox.copy(mailbox, _tmp$10); ok = _tmp$11; return [mailbox, ok]; } localPartBytes = $append(localPartBytes, in$1.charCodeAt(0)); in$1 = $substring(in$1, 1); } else if ((48 <= c$1 && c$1 <= 57) || (97 <= c$1 && c$1 <= 122) || (65 <= c$1 && c$1 <= 90) || (c$1 === 33) || (c$1 === 35) || (c$1 === 36) || (c$1 === 37) || (c$1 === 38) || (c$1 === 39) || (c$1 === 42) || (c$1 === 43) || (c$1 === 45) || (c$1 === 47) || (c$1 === 61) || (c$1 === 63) || (c$1 === 94) || (c$1 === 95) || (c$1 === 96) || (c$1 === 123) || (c$1 === 124) || (c$1 === 125) || (c$1 === 126) || (c$1 === 46)) { localPartBytes = $append(localPartBytes, in$1.charCodeAt(0)); in$1 = $substring(in$1, 1); } else { break NextChar; } } if (localPartBytes.$length === 0) { _tmp$12 = $clone(mailbox, rfc2821Mailbox); _tmp$13 = false; rfc2821Mailbox.copy(mailbox, _tmp$12); ok = _tmp$13; return [mailbox, ok]; } twoDots = new sliceType$1([46, 46]); if (((0 >= localPartBytes.$length ? ($throwRuntimeError("index out of range"), undefined) : localPartBytes.$array[localPartBytes.$offset + 0]) === 46) || ((x = localPartBytes.$length - 1 >> 0, ((x < 0 || x >= localPartBytes.$length) ? ($throwRuntimeError("index out of range"), undefined) : localPartBytes.$array[localPartBytes.$offset + x])) === 46) || bytes.Contains(localPartBytes, twoDots)) { _tmp$14 = $clone(mailbox, rfc2821Mailbox); _tmp$15 = false; rfc2821Mailbox.copy(mailbox, _tmp$14); ok = _tmp$15; return [mailbox, ok]; } } if ((in$1.length === 0) || !((in$1.charCodeAt(0) === 64))) { _tmp$16 = $clone(mailbox, rfc2821Mailbox); _tmp$17 = false; rfc2821Mailbox.copy(mailbox, _tmp$16); ok = _tmp$17; return [mailbox, ok]; } in$1 = $substring(in$1, 1); _tuple = domainToReverseLabels(in$1); ok$1 = _tuple[1]; if (!ok$1) { _tmp$18 = $clone(mailbox, rfc2821Mailbox); _tmp$19 = false; rfc2821Mailbox.copy(mailbox, _tmp$18); ok = _tmp$19; return [mailbox, ok]; } mailbox.local = ($bytesToString(localPartBytes)); mailbox.domain = in$1; _tmp$20 = $clone(mailbox, rfc2821Mailbox); _tmp$21 = true; rfc2821Mailbox.copy(mailbox, _tmp$20); ok = _tmp$21; return [mailbox, ok]; }; domainToReverseLabels = function(domain) { var _i, _i$1, _ref, _ref$1, _rune, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, c, domain, i, label, ok, reverseLabels; reverseLabels = sliceType$4.nil; ok = false; while (true) { if (!(domain.length > 0)) { break; } i = strings.LastIndexByte(domain, 46); if (i === -1) { reverseLabels = $append(reverseLabels, domain); domain = ""; } else { reverseLabels = $append(reverseLabels, $substring(domain, (i + 1 >> 0))); domain = $substring(domain, 0, i); } } if (reverseLabels.$length > 0 && ((0 >= reverseLabels.$length ? ($throwRuntimeError("index out of range"), undefined) : reverseLabels.$array[reverseLabels.$offset + 0]).length === 0)) { _tmp = sliceType$4.nil; _tmp$1 = false; reverseLabels = _tmp; ok = _tmp$1; return [reverseLabels, ok]; } _ref = reverseLabels; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } label = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (label.length === 0) { _tmp$2 = sliceType$4.nil; _tmp$3 = false; reverseLabels = _tmp$2; ok = _tmp$3; return [reverseLabels, ok]; } _ref$1 = label; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.length)) { break; } _rune = $decodeRune(_ref$1, _i$1); c = _rune[0]; if (c < 33 || c > 126) { _tmp$4 = sliceType$4.nil; _tmp$5 = false; reverseLabels = _tmp$4; ok = _tmp$5; return [reverseLabels, ok]; } _i$1 += _rune[1]; } _i++; } _tmp$6 = reverseLabels; _tmp$7 = true; reverseLabels = _tmp$6; ok = _tmp$7; return [reverseLabels, ok]; }; matchEmailConstraint = function(mailbox, constraint) { var $24r, $24r$1, _r, _r$1, _tuple, constraint, constraintMailbox, mailbox, ok, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; constraint = $f.constraint; constraintMailbox = $f.constraintMailbox; mailbox = $f.mailbox; ok = $f.ok; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (strings.Contains(constraint, "@")) { $s = 1; continue; } /* */ $s = 2; continue; /* if (strings.Contains(constraint, "@")) { */ case 1: _tuple = parseRFC2821Mailbox(constraint); constraintMailbox = $clone(_tuple[0], rfc2821Mailbox); ok = _tuple[1]; /* */ if (!ok) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!ok) { */ case 3: _r = fmt.Errorf("x509: internal error: cannot parse constraint %q", new sliceType$6([new $String(constraint)])); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = [false, _r]; $s = 6; case 6: return $24r; /* } */ case 4: $s = -1; return [mailbox.local === constraintMailbox.local && strings.EqualFold(mailbox.domain, constraintMailbox.domain), $ifaceNil]; /* } */ case 2: _r$1 = matchDomainConstraint(mailbox.domain, constraint); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r$1 = _r$1; $s = 8; case 8: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: matchEmailConstraint }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.constraint = constraint; $f.constraintMailbox = constraintMailbox; $f.mailbox = mailbox; $f.ok = ok; $f.$s = $s; $f.$r = $r; return $f; }; matchURIConstraint = function(uri, constraint) { var $24r, $24r$1, $24r$2, _r, _r$1, _r$2, _r$3, _tuple, constraint, err, host, uri, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; constraint = $f.constraint; err = $f.err; host = $f.host; uri = $f.uri; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: host = uri.Host; /* */ if (host.length === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (host.length === 0) { */ case 1: _r = fmt.Errorf("URI with empty host (%q) cannot be matched against constraints", new sliceType$6([new $String(uri.String())])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = [false, _r]; $s = 4; case 4: return $24r; /* } */ case 2: /* */ if (strings.Contains(host, ":") && !strings.HasSuffix(host, "]")) { $s = 5; continue; } /* */ $s = 6; continue; /* if (strings.Contains(host, ":") && !strings.HasSuffix(host, "]")) { */ case 5: err = $ifaceNil; _r$1 = net.SplitHostPort(uri.Host); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; host = _tuple[0]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [false, err]; } /* } */ case 6: /* */ if (strings.HasPrefix(host, "[") && strings.HasSuffix(host, "]") || !(net.ParseIP(host) === net.IP.nil)) { $s = 8; continue; } /* */ $s = 9; continue; /* if (strings.HasPrefix(host, "[") && strings.HasSuffix(host, "]") || !(net.ParseIP(host) === net.IP.nil)) { */ case 8: _r$2 = fmt.Errorf("URI with IP (%q) cannot be matched against constraints", new sliceType$6([new $String(uri.String())])); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r$1 = [false, _r$2]; $s = 11; case 11: return $24r$1; /* } */ case 9: _r$3 = matchDomainConstraint(host, constraint); /* */ $s = 12; case 12: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r$2 = _r$3; $s = 13; case 13: return $24r$2; /* */ } return; } if ($f === undefined) { $f = { $blk: matchURIConstraint }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.constraint = constraint; $f.err = err; $f.host = host; $f.uri = uri; $f.$s = $s; $f.$r = $r; return $f; }; matchIPConstraint = function(ip, constraint) { var _i, _ref, constraint, i, ip, mask, x, x$1; if (!((ip.$length === constraint.IP.$length))) { return [false, $ifaceNil]; } _ref = ip; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; mask = (x = constraint.Mask, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); if (!((((((i < 0 || i >= ip.$length) ? ($throwRuntimeError("index out of range"), undefined) : ip.$array[ip.$offset + i]) & mask) >>> 0) === (((x$1 = constraint.IP, ((i < 0 || i >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + i])) & mask) >>> 0)))) { return [false, $ifaceNil]; } _i++; } return [true, $ifaceNil]; }; matchDomainConstraint = function(domain, constraint) { var $24r, $24r$1, _i, _r, _r$1, _ref, _tuple, _tuple$1, constraint, constraintLabel, constraintLabels, domain, domainLabels, i, mustHaveSubdomains, ok, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; constraint = $f.constraint; constraintLabel = $f.constraintLabel; constraintLabels = $f.constraintLabels; domain = $f.domain; domainLabels = $f.domainLabels; i = $f.i; mustHaveSubdomains = $f.mustHaveSubdomains; ok = $f.ok; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (constraint.length === 0) { $s = -1; return [true, $ifaceNil]; } _tuple = domainToReverseLabels(domain); domainLabels = _tuple[0]; ok = _tuple[1]; /* */ if (!ok) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!ok) { */ case 1: _r = fmt.Errorf("x509: internal error: cannot parse domain %q", new sliceType$6([new $String(domain)])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = [false, _r]; $s = 4; case 4: return $24r; /* } */ case 2: mustHaveSubdomains = false; if (constraint.charCodeAt(0) === 46) { mustHaveSubdomains = true; constraint = $substring(constraint, 1); } _tuple$1 = domainToReverseLabels(constraint); constraintLabels = _tuple$1[0]; ok = _tuple$1[1]; /* */ if (!ok) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!ok) { */ case 5: _r$1 = fmt.Errorf("x509: internal error: cannot parse domain %q", new sliceType$6([new $String(constraint)])); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r$1 = [false, _r$1]; $s = 8; case 8: return $24r$1; /* } */ case 6: if (domainLabels.$length < constraintLabels.$length || (mustHaveSubdomains && (domainLabels.$length === constraintLabels.$length))) { $s = -1; return [false, $ifaceNil]; } _ref = constraintLabels; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; constraintLabel = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (!strings.EqualFold(constraintLabel, ((i < 0 || i >= domainLabels.$length) ? ($throwRuntimeError("index out of range"), undefined) : domainLabels.$array[domainLabels.$offset + i]))) { $s = -1; return [false, $ifaceNil]; } _i++; } $s = -1; return [true, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: matchDomainConstraint }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.constraint = constraint; $f.constraintLabel = constraintLabel; $f.constraintLabels = constraintLabels; $f.domain = domain; $f.domainLabels = domainLabels; $f.i = i; $f.mustHaveSubdomains = mustHaveSubdomains; $f.ok = ok; $f.$s = $s; $f.$r = $r; return $f; }; Certificate.ptr.prototype.checkNameConstraints = function(count, maxConstraintComparisons, nameType, name, parsedName, match, permitted, excluded) { var $24r, $24r$1, $24r$2, $24r$3, _r, _r$1, _r$10, _r$11, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, c, constraint, constraint$1, count, err, err$1, excluded, excludedValue, i, i$1, match, match$1, maxConstraintComparisons, name, nameType, ok, parsedName, permitted, permittedValue, 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; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; _r = $f._r; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; c = $f.c; constraint = $f.constraint; constraint$1 = $f.constraint$1; count = $f.count; err = $f.err; err$1 = $f.err$1; excluded = $f.excluded; excludedValue = $f.excludedValue; i = $f.i; i$1 = $f.i$1; match = $f.match; match$1 = $f.match$1; maxConstraintComparisons = $f.maxConstraintComparisons; name = $f.name; nameType = $f.nameType; ok = $f.ok; parsedName = $f.parsedName; permitted = $f.permitted; permittedValue = $f.permittedValue; 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: c = this; _r = reflect.ValueOf(excluded); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } excludedValue = _r; count.$set(count.$get() + ($clone(excludedValue, reflect.Value).Len()) >> 0); if (count.$get() > maxConstraintComparisons) { $s = -1; return (x = new CertificateInvalidError.ptr(c, 8, ""), new x.constructor.elem(x)); } i = 0; /* while (true) { */ case 2: /* if (!(i < $clone(excludedValue, reflect.Value).Len())) { break; } */ if(!(i < $clone(excludedValue, reflect.Value).Len())) { $s = 3; continue; } _r$1 = $clone(excludedValue, reflect.Value).Index(i); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = $clone(_r$1, reflect.Value).Interface(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } constraint = _r$2; _r$3 = match(parsedName, constraint); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; match$1 = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 7: _r$4 = err.Error(); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r = (x$1 = new CertificateInvalidError.ptr(c, 2, _r$4), new x$1.constructor.elem(x$1)); $s = 10; case 10: return $24r; /* } */ case 8: /* */ if (match$1) { $s = 11; continue; } /* */ $s = 12; continue; /* if (match$1) { */ case 11: _r$5 = fmt.Sprintf("%s %q is excluded by constraint %q", new sliceType$6([new $String(nameType), new $String(name), constraint])); /* */ $s = 13; case 13: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $24r$1 = (x$2 = new CertificateInvalidError.ptr(c, 2, _r$5), new x$2.constructor.elem(x$2)); $s = 14; case 14: return $24r$1; /* } */ case 12: i = i + (1) >> 0; $s = 2; continue; case 3: _r$6 = reflect.ValueOf(permitted); /* */ $s = 15; case 15: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } permittedValue = _r$6; count.$set(count.$get() + ($clone(permittedValue, reflect.Value).Len()) >> 0); if (count.$get() > maxConstraintComparisons) { $s = -1; return (x$3 = new CertificateInvalidError.ptr(c, 8, ""), new x$3.constructor.elem(x$3)); } ok = true; i$1 = 0; /* while (true) { */ case 16: /* if (!(i$1 < $clone(permittedValue, reflect.Value).Len())) { break; } */ if(!(i$1 < $clone(permittedValue, reflect.Value).Len())) { $s = 17; continue; } _r$7 = $clone(permittedValue, reflect.Value).Index(i$1); /* */ $s = 18; case 18: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$8 = $clone(_r$7, reflect.Value).Interface(); /* */ $s = 19; case 19: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } constraint$1 = _r$8; err$1 = $ifaceNil; _r$9 = match(parsedName, constraint$1); /* */ $s = 20; case 20: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple$1 = _r$9; ok = _tuple$1[0]; err$1 = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 21; continue; } /* */ $s = 22; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 21: _r$10 = err$1.Error(); /* */ $s = 23; case 23: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } $24r$2 = (x$4 = new CertificateInvalidError.ptr(c, 2, _r$10), new x$4.constructor.elem(x$4)); $s = 24; case 24: return $24r$2; /* } */ case 22: if (ok) { /* break; */ $s = 17; continue; } i$1 = i$1 + (1) >> 0; $s = 16; continue; case 17: /* */ if (!ok) { $s = 25; continue; } /* */ $s = 26; continue; /* if (!ok) { */ case 25: _r$11 = fmt.Sprintf("%s %q is not permitted by any constraint", new sliceType$6([new $String(nameType), new $String(name)])); /* */ $s = 27; case 27: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } $24r$3 = (x$5 = new CertificateInvalidError.ptr(c, 2, _r$11), new x$5.constructor.elem(x$5)); $s = 28; case 28: return $24r$3; /* } */ case 26: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Certificate.ptr.prototype.checkNameConstraints }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f._r = _r; $f._r$1 = _r$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.c = c; $f.constraint = constraint; $f.constraint$1 = constraint$1; $f.count = count; $f.err = err; $f.err$1 = err$1; $f.excluded = excluded; $f.excludedValue = excludedValue; $f.i = i; $f.i$1 = i$1; $f.match = match; $f.match$1 = match$1; $f.maxConstraintComparisons = maxConstraintComparisons; $f.name = name; $f.nameType = nameType; $f.ok = ok; $f.parsedName = parsedName; $f.permitted = permitted; $f.permittedValue = permittedValue; $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; }; Certificate.prototype.checkNameConstraints = function(count, maxConstraintComparisons, nameType, name, parsedName, match, permitted, excluded) { return this.$val.checkNameConstraints(count, maxConstraintComparisons, nameType, name, parsedName, match, permitted, excluded); }; Certificate.ptr.prototype.isValid = function(certType, currentChain, opts) { var $24r, $24r$1, _arg, _arg$1, _arg$2, _arg$3, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, c, certType, child, comparisonCount, currentChain, err, leaf, maxConstraintComparisons, now, numIntermediates, opts, x, x$1, x$2, x$3, x$4, x$5, x$6, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$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; _r$7 = $f._r$7; c = $f.c; certType = $f.certType; child = $f.child; comparisonCount = $f.comparisonCount; currentChain = $f.currentChain; err = $f.err; leaf = $f.leaf; maxConstraintComparisons = $f.maxConstraintComparisons; now = $f.now; numIntermediates = $f.numIntermediates; opts = $f.opts; 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; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = [c]; comparisonCount = [comparisonCount]; maxConstraintComparisons = [maxConstraintComparisons]; c[0] = this; if (c[0].UnhandledCriticalExtensions.$length > 0) { $s = -1; return (x = new UnhandledCriticalExtension.ptr(), new x.constructor.elem(x)); } if (currentChain.$length > 0) { child = (x$1 = currentChain.$length - 1 >> 0, ((x$1 < 0 || x$1 >= currentChain.$length) ? ($throwRuntimeError("index out of range"), undefined) : currentChain.$array[currentChain.$offset + x$1])); if (!bytes.Equal(child.RawIssuer, c[0].RawSubject)) { $s = -1; return (x$2 = new CertificateInvalidError.ptr(c[0], 5, ""), new x$2.constructor.elem(x$2)); } } now = $clone(opts.CurrentTime, time.Time); /* */ if ($clone(now, time.Time).IsZero()) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($clone(now, time.Time).IsZero()) { */ case 1: _r = time.Now(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } time.Time.copy(now, _r); /* } */ case 2: /* */ if ($clone(now, time.Time).Before($clone(c[0].NotBefore, time.Time))) { $s = 4; continue; } /* */ if ($clone(now, time.Time).After($clone(c[0].NotAfter, time.Time))) { $s = 5; continue; } /* */ $s = 6; continue; /* if ($clone(now, time.Time).Before($clone(c[0].NotBefore, time.Time))) { */ case 4: _r$1 = $clone(now, time.Time).Format("2006-01-02T15:04:05Z07:00"); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg = new $String(_r$1); _r$2 = $clone(c[0].NotBefore, time.Time).Format("2006-01-02T15:04:05Z07:00"); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg$1 = new $String(_r$2); _r$3 = fmt.Sprintf("current time %s is before %s", new sliceType$6([_arg, _arg$1])); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = (x$3 = new CertificateInvalidError.ptr(c[0], 1, _r$3), new x$3.constructor.elem(x$3)); $s = 10; case 10: return $24r; /* } else if ($clone(now, time.Time).After($clone(c[0].NotAfter, time.Time))) { */ case 5: _r$4 = $clone(now, time.Time).Format("2006-01-02T15:04:05Z07:00"); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _arg$2 = new $String(_r$4); _r$5 = $clone(c[0].NotAfter, time.Time).Format("2006-01-02T15:04:05Z07:00"); /* */ $s = 12; case 12: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg$3 = new $String(_r$5); _r$6 = fmt.Sprintf("current time %s is after %s", new sliceType$6([_arg$2, _arg$3])); /* */ $s = 13; case 13: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } $24r$1 = (x$4 = new CertificateInvalidError.ptr(c[0], 1, _r$6), new x$4.constructor.elem(x$4)); $s = 14; case 14: return $24r$1; /* } */ case 6: maxConstraintComparisons[0] = opts.MaxConstraintComparisions; if (maxConstraintComparisons[0] === 0) { maxConstraintComparisons[0] = 250000; } comparisonCount[0] = 0; leaf = ptrType$4.nil; if ((certType === 1) || (certType === 2)) { if (currentChain.$length === 0) { $s = -1; return errors.New("x509: internal error: empty chain when appending CA cert"); } leaf = (0 >= currentChain.$length ? ($throwRuntimeError("index out of range"), undefined) : currentChain.$array[currentChain.$offset + 0]); } /* */ if (((certType === 1) || (certType === 2)) && c[0].hasNameConstraints() && leaf.hasSANExtension()) { $s = 15; continue; } /* */ $s = 16; continue; /* if (((certType === 1) || (certType === 2)) && c[0].hasNameConstraints() && leaf.hasSANExtension()) { */ case 15: _r$7 = forEachSAN($convertSliceType(leaf.getSANExtension(), cryptobyte.String), (function(c, comparisonCount, maxConstraintComparisons) { return function $b(tag, data) { var $24r$2, $24r$3, $24r$4, $24r$5, _1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$7, _r$8, _r$9, _tuple, _tuple$1, _tuple$2, data, err, err$1, err$2, err$3, err$4, ip, l, mailbox, name, name$1, name$2, ok, ok$1, tag, uri, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; _1 = $f._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$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; data = $f.data; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; err$4 = $f.err$4; ip = $f.ip; l = $f.l; mailbox = $f.mailbox; name = $f.name; name$1 = $f.name$1; name$2 = $f.name$2; ok = $f.ok; ok$1 = $f.ok$1; tag = $f.tag; uri = $f.uri; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _1 = tag; /* */ if (_1 === (1)) { $s = 2; continue; } /* */ if (_1 === (2)) { $s = 3; continue; } /* */ if (_1 === (6)) { $s = 4; continue; } /* */ if (_1 === (7)) { $s = 5; continue; } /* */ $s = 6; continue; /* if (_1 === (1)) { */ case 2: name = ($bytesToString(data)); _tuple = parseRFC2821Mailbox(name); mailbox = $clone(_tuple[0], rfc2821Mailbox); ok = _tuple[1]; /* */ if (!ok) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!ok) { */ case 7: _r$7 = fmt.Errorf("x509: cannot parse rfc822Name %q", new sliceType$6([new mailbox.constructor.elem(mailbox)])); /* */ $s = 9; case 9: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } $24r$2 = _r$7; $s = 10; case 10: return $24r$2; /* } */ case 8: _r$8 = c[0].checkNameConstraints((comparisonCount.$ptr || (comparisonCount.$ptr = new ptrType$16(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, comparisonCount))), maxConstraintComparisons[0], "email address", name, new mailbox.constructor.elem(mailbox), (function(c, comparisonCount, maxConstraintComparisons) { return function $b(parsedName, constraint) { var $24r$3, _r$8, constraint, parsedName, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r$3 = $f.$24r$3; _r$8 = $f._r$8; constraint = $f.constraint; parsedName = $f.parsedName; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$8 = matchEmailConstraint($clone($assertType(parsedName, rfc2821Mailbox), rfc2821Mailbox), $assertType(constraint, $String)); /* */ $s = 1; case 1: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } $24r$3 = _r$8; $s = 2; case 2: return $24r$3; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$24r$3 = $24r$3; $f._r$8 = _r$8; $f.constraint = constraint; $f.parsedName = parsedName; $f.$s = $s; $f.$r = $r; return $f; }; })(c, comparisonCount, maxConstraintComparisons), c[0].PermittedEmailAddresses, c[0].ExcludedEmailAddresses); /* */ $s = 11; case 11: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } err = _r$8; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $s = 6; continue; /* } else if (_1 === (2)) { */ case 3: name$1 = ($bytesToString(data)); _tuple$1 = domainToReverseLabels(name$1); ok$1 = _tuple$1[1]; /* */ if (!ok$1) { $s = 12; continue; } /* */ $s = 13; continue; /* if (!ok$1) { */ case 12: _r$9 = fmt.Errorf("x509: cannot parse dnsName %q", new sliceType$6([new $String(name$1)])); /* */ $s = 14; case 14: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $24r$3 = _r$9; $s = 15; case 15: return $24r$3; /* } */ case 13: _r$10 = c[0].checkNameConstraints((comparisonCount.$ptr || (comparisonCount.$ptr = new ptrType$16(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, comparisonCount))), maxConstraintComparisons[0], "DNS name", name$1, new $String(name$1), (function(c, comparisonCount, maxConstraintComparisons) { return function $b(parsedName, constraint) { var $24r$4, _r$10, constraint, parsedName, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r$4 = $f.$24r$4; _r$10 = $f._r$10; constraint = $f.constraint; parsedName = $f.parsedName; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$10 = matchDomainConstraint($assertType(parsedName, $String), $assertType(constraint, $String)); /* */ $s = 1; case 1: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } $24r$4 = _r$10; $s = 2; case 2: return $24r$4; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$24r$4 = $24r$4; $f._r$10 = _r$10; $f.constraint = constraint; $f.parsedName = parsedName; $f.$s = $s; $f.$r = $r; return $f; }; })(c, comparisonCount, maxConstraintComparisons), c[0].PermittedDNSDomains, c[0].ExcludedDNSDomains); /* */ $s = 16; case 16: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } err$1 = _r$10; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } $s = 6; continue; /* } else if (_1 === (6)) { */ case 4: name$2 = ($bytesToString(data)); _r$11 = url.Parse(name$2); /* */ $s = 17; case 17: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tuple$2 = _r$11; uri = _tuple$2[0]; err$2 = _tuple$2[1]; /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 18; continue; } /* */ $s = 19; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 18: _r$12 = fmt.Errorf("x509: internal error: URI SAN %q failed to parse", new sliceType$6([new $String(name$2)])); /* */ $s = 20; case 20: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } $24r$4 = _r$12; $s = 21; case 21: return $24r$4; /* } */ case 19: _r$13 = c[0].checkNameConstraints((comparisonCount.$ptr || (comparisonCount.$ptr = new ptrType$16(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, comparisonCount))), maxConstraintComparisons[0], "URI", name$2, uri, (function(c, comparisonCount, maxConstraintComparisons) { return function $b(parsedName, constraint) { var $24r$5, _r$13, constraint, parsedName, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r$5 = $f.$24r$5; _r$13 = $f._r$13; constraint = $f.constraint; parsedName = $f.parsedName; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$13 = matchURIConstraint($assertType(parsedName, ptrType$13), $assertType(constraint, $String)); /* */ $s = 1; case 1: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } $24r$5 = _r$13; $s = 2; case 2: return $24r$5; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$24r$5 = $24r$5; $f._r$13 = _r$13; $f.constraint = constraint; $f.parsedName = parsedName; $f.$s = $s; $f.$r = $r; return $f; }; })(c, comparisonCount, maxConstraintComparisons), c[0].PermittedURIDomains, c[0].ExcludedURIDomains); /* */ $s = 22; case 22: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } err$3 = _r$13; if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = -1; return err$3; } $s = 6; continue; /* } else if (_1 === (7)) { */ case 5: ip = ($convertSliceType(data, net.IP)); l = ip.$length; /* */ if (!((l === 4)) && !((l === 16))) { $s = 23; continue; } /* */ $s = 24; continue; /* if (!((l === 4)) && !((l === 16))) { */ case 23: _r$14 = fmt.Errorf("x509: internal error: IP SAN %x failed to parse", new sliceType$6([data])); /* */ $s = 25; case 25: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } $24r$5 = _r$14; $s = 26; case 26: return $24r$5; /* } */ case 24: _r$15 = c[0].checkNameConstraints((comparisonCount.$ptr || (comparisonCount.$ptr = new ptrType$16(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, comparisonCount))), maxConstraintComparisons[0], "IP address", ip.String(), ip, (function(c, comparisonCount, maxConstraintComparisons) { return function(parsedName, constraint) { var constraint, parsedName; return matchIPConstraint($assertType(parsedName, net.IP), $assertType(constraint, ptrType$17)); }; })(c, comparisonCount, maxConstraintComparisons), c[0].PermittedIPRanges, c[0].ExcludedIPRanges); /* */ $s = 27; case 27: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } err$4 = _r$15; if (!($interfaceIsEqual(err$4, $ifaceNil))) { $s = -1; return err$4; } /* } */ case 6: case 1: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f._1 = _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$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.data = data; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.err$4 = err$4; $f.ip = ip; $f.l = l; $f.mailbox = mailbox; $f.name = name; $f.name$1 = name$1; $f.name$2 = name$2; $f.ok = ok; $f.ok$1 = ok$1; $f.tag = tag; $f.uri = uri; $f.$s = $s; $f.$r = $r; return $f; }; })(c, comparisonCount, maxConstraintComparisons)); /* */ $s = 17; case 17: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } err = _r$7; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } /* } */ case 16: if ((certType === 1) && (!c[0].BasicConstraintsValid || !c[0].IsCA)) { $s = -1; return (x$5 = new CertificateInvalidError.ptr(c[0], 0, ""), new x$5.constructor.elem(x$5)); } if (c[0].BasicConstraintsValid && c[0].MaxPathLen >= 0) { numIntermediates = currentChain.$length - 1 >> 0; if (numIntermediates > c[0].MaxPathLen) { $s = -1; return (x$6 = new CertificateInvalidError.ptr(c[0], 3, ""), new x$6.constructor.elem(x$6)); } } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Certificate.ptr.prototype.isValid }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$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._r$7 = _r$7; $f.c = c; $f.certType = certType; $f.child = child; $f.comparisonCount = comparisonCount; $f.currentChain = currentChain; $f.err = err; $f.leaf = leaf; $f.maxConstraintComparisons = maxConstraintComparisons; $f.now = now; $f.numIntermediates = numIntermediates; $f.opts = opts; $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.$s = $s; $f.$r = $r; return $f; }; Certificate.prototype.isValid = function(certType, currentChain, opts) { return this.$val.isValid(certType, currentChain, opts); }; Certificate.ptr.prototype.Verify = function(opts) { var $24r, _i, _i$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _ref, _ref$1, _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, _tuple, _tuple$1, _tuple$2, c, c$1, candidate, candidateChains, chains, err, err$1, i, keyUsages, opts, usage, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _i = $f._i; _i$1 = $f._i$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; _ref = $f._ref; _ref$1 = $f._ref$1; _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$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; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; c = $f.c; c$1 = $f.c$1; candidate = $f.candidate; candidateChains = $f.candidateChains; chains = $f.chains; err = $f.err; err$1 = $f.err$1; i = $f.i; keyUsages = $f.keyUsages; opts = $f.opts; usage = $f.usage; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: opts = [opts]; chains = sliceType$21.nil; err = $ifaceNil; c = this; if (c.Raw.$length === 0) { _tmp = sliceType$21.nil; _tmp$1 = errNotParsed; chains = _tmp; err = _tmp$1; $s = -1; return [chains, err]; } i = 0; /* while (true) { */ case 1: /* if (!(i < opts[0].Intermediates.len())) { break; } */ if(!(i < opts[0].Intermediates.len())) { $s = 2; continue; } _r = opts[0].Intermediates.cert(i); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; c$1 = _tuple[0]; err$1 = _tuple[1]; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 4: _tmp$2 = sliceType$21.nil; _r$1 = fmt.Errorf("crypto/x509: error fetching intermediate: %w", new sliceType$6([err$1])); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tmp$3 = _r$1; chains = _tmp$2; err = _tmp$3; $24r = [chains, err]; $s = 7; case 7: return $24r; /* } */ case 5: if (c$1.Raw.$length === 0) { _tmp$4 = sliceType$21.nil; _tmp$5 = errNotParsed; chains = _tmp$4; err = _tmp$5; $s = -1; return [chains, err]; } i = i + (1) >> 0; $s = 1; continue; case 2: if (opts[0].Roots === ptrType.nil && false) { _tuple$1 = c.systemVerify(opts[0]); chains = _tuple$1[0]; err = _tuple$1[1]; $s = -1; return [chains, err]; } /* */ if (opts[0].Roots === ptrType.nil) { $s = 8; continue; } /* */ $s = 9; continue; /* if (opts[0].Roots === ptrType.nil) { */ case 8: _r$2 = systemRootsPool(); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } opts[0].Roots = _r$2; if (opts[0].Roots === ptrType.nil) { _tmp$6 = sliceType$21.nil; _tmp$7 = (x = new SystemRootsError.ptr(systemRootsErr), new x.constructor.elem(x)); chains = _tmp$6; err = _tmp$7; $s = -1; return [chains, err]; } /* } */ case 9: _r$3 = c.isValid(0, sliceType$20.nil, opts[0]); /* */ $s = 11; case 11: 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 = -1; return [chains, err]; } if (opts[0].DNSName.length > 0) { err = c.VerifyHostname(opts[0].DNSName); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [chains, err]; } } candidateChains = sliceType$21.nil; _r$4 = opts[0].Roots.contains(c); /* */ $s = 15; case 15: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } /* */ if (_r$4) { $s = 12; continue; } /* */ $s = 13; continue; /* if (_r$4) { */ case 12: candidateChains = $append(candidateChains, new sliceType$20([c])); $s = 14; continue; /* } else { */ case 13: _r$5 = c.buildChains(false, new sliceType$20([c]), ptrType$16.nil, opts[0]); /* */ $s = 16; case 16: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$2 = _r$5; candidateChains = _tuple$2[0]; err = _tuple$2[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$8 = sliceType$21.nil; _tmp$9 = err; chains = _tmp$8; err = _tmp$9; $s = -1; return [chains, err]; } /* } */ case 14: keyUsages = opts[0].KeyUsages; if (keyUsages.$length === 0) { keyUsages = new sliceType$22([1]); } _ref = keyUsages; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } usage = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (usage === 0) { _tmp$10 = candidateChains; _tmp$11 = $ifaceNil; chains = _tmp$10; err = _tmp$11; $s = -1; return [chains, err]; } _i++; } _ref$1 = candidateChains; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } candidate = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); if (checkChainForKeyUsage(candidate, keyUsages)) { chains = $append(chains, candidate); } _i$1++; } if (chains.$length === 0) { _tmp$12 = sliceType$21.nil; _tmp$13 = (x$1 = new CertificateInvalidError.ptr(c, 4, ""), new x$1.constructor.elem(x$1)); chains = _tmp$12; err = _tmp$13; $s = -1; return [chains, err]; } _tmp$14 = chains; _tmp$15 = $ifaceNil; chains = _tmp$14; err = _tmp$15; $s = -1; return [chains, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Certificate.ptr.prototype.Verify }; } $f.$24r = $24r; $f._i = _i; $f._i$1 = _i$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._ref = _ref; $f._ref$1 = _ref$1; $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$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._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.c = c; $f.c$1 = c$1; $f.candidate = candidate; $f.candidateChains = candidateChains; $f.chains = chains; $f.err = err; $f.err$1 = err$1; $f.i = i; $f.keyUsages = keyUsages; $f.opts = opts; $f.usage = usage; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; Certificate.prototype.Verify = function(opts) { return this.$val.Verify(opts); }; appendToFreshChain = function(chain, cert) { var cert, chain, n, x; n = $makeSlice(sliceType$20, (chain.$length + 1 >> 0)); $copySlice(n, chain); (x = chain.$length, ((x < 0 || x >= n.$length) ? ($throwRuntimeError("index out of range"), undefined) : n.$array[n.$offset + x] = cert)); return n; }; Certificate.ptr.prototype.buildChains = function(cache, currentChain, sigChecks, opts) { var _i, _i$1, _r, _r$1, _ref, _ref$1, c, cache, chains, considerCandidate, currentChain, err, hintCert, hintErr, intermediate, opts, root, sigChecks, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; _ref$1 = $f._ref$1; c = $f.c; cache = $f.cache; chains = $f.chains; considerCandidate = $f.considerCandidate; currentChain = $f.currentChain; err = $f.err; hintCert = $f.hintCert; hintErr = $f.hintErr; intermediate = $f.intermediate; opts = $f.opts; root = $f.root; sigChecks = $f.sigChecks; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = [c]; cache = [cache]; chains = [chains]; currentChain = [currentChain]; err = [err]; hintCert = [hintCert]; hintErr = [hintErr]; opts = [opts]; sigChecks = [sigChecks]; chains[0] = sliceType$21.nil; err[0] = $ifaceNil; c[0] = this; hintErr[0] = $ifaceNil; hintCert[0] = ptrType$4.nil; considerCandidate = (function(c, cache, chains, currentChain, err, hintCert, hintErr, opts, sigChecks) { return function $b(certType, candidate) { var _1, _entry, _i, _key, _r, _r$1, _r$2, _ref, _tuple, _tuple$1, candidate, cert, certType, childChains, err$1, ok, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _entry = $f._entry; _i = $f._i; _key = $f._key; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; candidate = $f.candidate; cert = $f.cert; certType = $f.certType; childChains = $f.childChains; err$1 = $f.err$1; ok = $f.ok; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _ref = currentChain[0]; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } cert = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (cert.Equal(candidate)) { $s = -1; return; } _i++; } if (sigChecks[0] === ptrType$16.nil) { sigChecks[0] = $newDataPointer(0, ptrType$16); } sigChecks[0].$set(sigChecks[0].$get() + (1) >> 0); if (sigChecks[0].$get() > 100) { err[0] = errors.New("x509: signature check attempts limit reached while verifying certificate chain"); $s = -1; return; } _r = c[0].CheckSignatureFrom(candidate); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err$1 = _r; if (!($interfaceIsEqual(err$1, $ifaceNil))) { if ($interfaceIsEqual(hintErr[0], $ifaceNil)) { hintErr[0] = err$1; hintCert[0] = candidate; } $s = -1; return; } _r$1 = candidate.isValid(certType, currentChain[0], opts[0]); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err[0] = _r$1; if (!($interfaceIsEqual(err[0], $ifaceNil))) { $s = -1; return; } _1 = certType; /* */ if (_1 === (2)) { $s = 4; continue; } /* */ if (_1 === (1)) { $s = 5; continue; } /* */ $s = 6; continue; /* if (_1 === (2)) { */ case 4: chains[0] = $append(chains[0], appendToFreshChain(currentChain[0], candidate)); $s = 6; continue; /* } else if (_1 === (1)) { */ case 5: if (cache[0] === false) { cache[0] = {}; } _tuple = (_entry = cache[0][ptrType$4.keyFor(candidate)], _entry !== undefined ? [_entry.v, true] : [sliceType$21.nil, false]); childChains = _tuple[0]; ok = _tuple[1]; /* */ if (!ok) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!ok) { */ case 7: _r$2 = candidate.buildChains(cache[0], appendToFreshChain(currentChain[0], candidate), sigChecks[0], opts[0]); /* */ $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; childChains = _tuple$1[0]; err[0] = _tuple$1[1]; _key = candidate; (cache[0] || $throwRuntimeError("assignment to entry in nil map"))[ptrType$4.keyFor(_key)] = { k: _key, v: childChains }; /* } */ case 8: chains[0] = $appendSlice(chains[0], childChains); /* } */ case 6: case 3: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._1 = _1; $f._entry = _entry; $f._i = _i; $f._key = _key; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.candidate = candidate; $f.cert = cert; $f.certType = certType; $f.childChains = childChains; $f.err$1 = err$1; $f.ok = ok; $f.$s = $s; $f.$r = $r; return $f; }; })(c, cache, chains, currentChain, err, hintCert, hintErr, opts, sigChecks); _r = opts[0].Roots.findPotentialParents(c[0]); /* */ $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; } root = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); $r = considerCandidate(2, root); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i++; $s = 2; continue; case 3: _r$1 = opts[0].Intermediates.findPotentialParents(c[0]); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _ref$1 = _r$1; _i$1 = 0; /* while (true) { */ case 6: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 7; continue; } intermediate = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); $r = considerCandidate(1, intermediate); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i$1++; $s = 6; continue; case 7: if (chains[0].$length > 0) { err[0] = $ifaceNil; } if ((chains[0].$length === 0) && $interfaceIsEqual(err[0], $ifaceNil)) { err[0] = (x = new UnknownAuthorityError.ptr(c[0], hintErr[0], hintCert[0]), new x.constructor.elem(x)); } $s = -1; return [chains[0], err[0]]; /* */ } return; } if ($f === undefined) { $f = { $blk: Certificate.ptr.prototype.buildChains }; } $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f._ref$1 = _ref$1; $f.c = c; $f.cache = cache; $f.chains = chains; $f.considerCandidate = considerCandidate; $f.currentChain = currentChain; $f.err = err; $f.hintCert = hintCert; $f.hintErr = hintErr; $f.intermediate = intermediate; $f.opts = opts; $f.root = root; $f.sigChecks = sigChecks; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Certificate.prototype.buildChains = function(cache, currentChain, sigChecks, opts) { return this.$val.buildChains(cache, currentChain, sigChecks, opts); }; validHostnamePattern = function(host) { var host; return validHostname(host, true); }; validHostnameInput = function(host) { var host; return validHostname(host, false); }; validHostname = function(host, isPattern) { var _i, _i$1, _ref, _ref$1, _rune, c, host, i, isPattern, j, part; if (!isPattern) { host = strings.TrimSuffix(host, "."); } if (host.length === 0) { return false; } _ref = strings.Split(host, "."); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; part = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (part === "") { return false; } if (isPattern && (i === 0) && part === "*") { _i++; continue; } _ref$1 = part; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.length)) { break; } _rune = $decodeRune(_ref$1, _i$1); j = _i$1; c = _rune[0]; if (97 <= c && c <= 122) { _i$1 += _rune[1]; continue; } if (48 <= c && c <= 57) { _i$1 += _rune[1]; continue; } if (65 <= c && c <= 90) { _i$1 += _rune[1]; continue; } if ((c === 45) && !((j === 0))) { _i$1 += _rune[1]; continue; } if (c === 95) { _i$1 += _rune[1]; continue; } return false; } _i++; } return true; }; matchExactly = function(hostA, hostB) { var hostA, hostB; if (hostA === "" || hostA === "." || hostB === "" || hostB === ".") { return false; } return toLowerCaseASCII(hostA) === toLowerCaseASCII(hostB); }; matchHostnames = function(pattern, host) { var _i, _ref, host, hostParts, i, pattern, patternPart, patternParts; pattern = toLowerCaseASCII(pattern); host = toLowerCaseASCII(strings.TrimSuffix(host, ".")); if ((pattern.length === 0) || (host.length === 0)) { return false; } patternParts = strings.Split(pattern, "."); hostParts = strings.Split(host, "."); if (!((patternParts.$length === hostParts.$length))) { return false; } _ref = patternParts; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; patternPart = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if ((i === 0) && patternPart === "*") { _i++; continue; } if (!(patternPart === ((i < 0 || i >= hostParts.$length) ? ($throwRuntimeError("index out of range"), undefined) : hostParts.$array[hostParts.$offset + i]))) { return false; } _i++; } return true; }; toLowerCaseASCII = function(in$1) { var _i, _i$1, _ref, _ref$1, _rune, c, c$1, i, in$1, isAlreadyLowerCase, out; isAlreadyLowerCase = true; _ref = in$1; _i = 0; while (true) { if (!(_i < _ref.length)) { break; } _rune = $decodeRune(_ref, _i); c = _rune[0]; if (c === 65533) { isAlreadyLowerCase = false; break; } if (65 <= c && c <= 90) { isAlreadyLowerCase = false; break; } _i += _rune[1]; } if (isAlreadyLowerCase) { return in$1; } out = (new sliceType$1($stringToBytes(in$1))); _ref$1 = out; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } i = _i$1; c$1 = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); if (65 <= c$1 && c$1 <= 90) { ((i < 0 || i >= out.$length) ? ($throwRuntimeError("index out of range"), undefined) : out.$array[out.$offset + i] = (((i < 0 || i >= out.$length) ? ($throwRuntimeError("index out of range"), undefined) : out.$array[out.$offset + i]) + (32) << 24 >>> 24)); } _i$1++; } return ($bytesToString(out)); }; Certificate.ptr.prototype.VerifyHostname = function(h) { var _i, _i$1, _ref, _ref$1, c, candidate, candidateIP, candidateName, h, ip, match, validCandidateName, x, x$1; c = this; candidateIP = h; if (h.length >= 3 && (h.charCodeAt(0) === 91) && (h.charCodeAt((h.length - 1 >> 0)) === 93)) { candidateIP = $substring(h, 1, (h.length - 1 >> 0)); } ip = net.ParseIP(candidateIP); if (!(ip === net.IP.nil)) { _ref = c.IPAddresses; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } candidate = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (ip.Equal(candidate)) { return $ifaceNil; } _i++; } return (x = new HostnameError.ptr(c, candidateIP), new x.constructor.elem(x)); } candidateName = toLowerCaseASCII(h); validCandidateName = validHostnameInput(candidateName); _ref$1 = c.DNSNames; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } match = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); if (validCandidateName && validHostnamePattern(match)) { if (matchHostnames(match, candidateName)) { return $ifaceNil; } } else { if (matchExactly(match, candidateName)) { return $ifaceNil; } } _i$1++; } return (x$1 = new HostnameError.ptr(c, h), new x$1.constructor.elem(x$1)); }; Certificate.prototype.VerifyHostname = function(h) { return this.$val.VerifyHostname(h); }; checkChainForKeyUsage = function(chain, keyUsages) { var _i, _i$1, _i$2, _ref, _ref$1, _ref$2, cert, chain, i, i$1, keyUsages, requestedUsage, usage, usage$1, usages, usagesRemaining; usages = $makeSlice(sliceType$22, keyUsages.$length); $copySlice(usages, keyUsages); if (chain.$length === 0) { return false; } usagesRemaining = usages.$length; i = chain.$length - 1 >> 0; NextCert: while (true) { if (!(i >= 0)) { break; } cert = ((i < 0 || i >= chain.$length) ? ($throwRuntimeError("index out of range"), undefined) : chain.$array[chain.$offset + i]); if ((cert.ExtKeyUsage.$length === 0) && (cert.UnknownExtKeyUsage.$length === 0)) { i = i - (1) >> 0; continue; } _ref = cert.ExtKeyUsage; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } usage = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (usage === 0) { i = i - (1) >> 0; continue NextCert; } _i++; } _ref$1 = usages; _i$1 = 0; NextRequestedUsage: while (true) { if (!(_i$1 < _ref$1.$length)) { break; } i$1 = _i$1; requestedUsage = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); if (requestedUsage === -1) { _i$1++; continue; } _ref$2 = cert.ExtKeyUsage; _i$2 = 0; while (true) { if (!(_i$2 < _ref$2.$length)) { break; } usage$1 = ((_i$2 < 0 || _i$2 >= _ref$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$2.$array[_ref$2.$offset + _i$2]); if (requestedUsage === usage$1) { _i$1++; continue NextRequestedUsage; } else if ((requestedUsage === 1) && ((usage$1 === 11) || (usage$1 === 10))) { _i$1++; continue NextRequestedUsage; } _i$2++; } ((i$1 < 0 || i$1 >= usages.$length) ? ($throwRuntimeError("index out of range"), undefined) : usages.$array[usages.$offset + i$1] = -1); usagesRemaining = usagesRemaining - (1) >> 0; if (usagesRemaining === 0) { return false; } _i$1++; } i = i - (1) >> 0; } return true; }; ParseECPrivateKey = function(der) { var $24r, _r, der, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; der = $f.der; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = parseECPrivateKey(ptrType$18.nil, der); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: ParseECPrivateKey }; } $f.$24r = $24r; $f._r = _r; $f.der = der; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.ParseECPrivateKey = ParseECPrivateKey; parseECPrivateKey = function(namedCurveOID, der) { var $24r, $24r$1, _q, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _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, _tuple, _tuple$1, _tuple$2, _tuple$3, curve, curveOrder, der, err, err$1, err$2, err$3, k, key, namedCurveOID, priv, privKey, privateKey$1, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _q = $f._q; _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; _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$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; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; curve = $f.curve; curveOrder = $f.curveOrder; der = $f.der; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; k = $f.k; key = $f.key; namedCurveOID = $f.namedCurveOID; priv = $f.priv; privKey = $f.privKey; privateKey$1 = $f.privateKey$1; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: privKey = [privKey]; key = ptrType$19.nil; err = $ifaceNil; privKey[0] = new ecPrivateKey.ptr(0, sliceType$1.nil, asn1.ObjectIdentifier.nil, new asn1.BitString.ptr(sliceType$1.nil, 0)); _r = asn1.Unmarshal(der, privKey[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; err$1 = _tuple[1]; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 2: _r$1 = asn1.Unmarshal(der, new pkcs8.ptr(0, new pkix.AlgorithmIdentifier.ptr(asn1.ObjectIdentifier.nil, new asn1.RawValue.ptr(0, 0, false, sliceType$1.nil, sliceType$1.nil)), sliceType$1.nil)); /* */ $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; err$2 = _tuple$1[1]; if ($interfaceIsEqual(err$2, $ifaceNil)) { _tmp = ptrType$19.nil; _tmp$1 = errors.New("x509: failed to parse private key (use ParsePKCS8PrivateKey instead for this key format)"); key = _tmp; err = _tmp$1; $s = -1; return [key, err]; } _r$2 = asn1.Unmarshal(der, new pkcs1PrivateKey.ptr(0, ptrType$1.nil, 0, ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, sliceType$23.nil)); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$2 = _r$2; err$3 = _tuple$2[1]; if ($interfaceIsEqual(err$3, $ifaceNil)) { _tmp$2 = ptrType$19.nil; _tmp$3 = errors.New("x509: failed to parse private key (use ParsePKCS1PrivateKey instead for this key format)"); key = _tmp$2; err = _tmp$3; $s = -1; return [key, err]; } _tmp$4 = ptrType$19.nil; _r$3 = err$1.Error(); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = errors.New("x509: failed to parse EC private key: " + _r$3); /* */ $s = 7; case 7: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tmp$5 = _r$4; key = _tmp$4; err = _tmp$5; $24r = [key, err]; $s = 8; case 8: return $24r; /* } */ case 3: /* */ if (!((privKey[0].Version === 1))) { $s = 9; continue; } /* */ $s = 10; continue; /* if (!((privKey[0].Version === 1))) { */ case 9: _tmp$6 = ptrType$19.nil; _r$5 = fmt.Errorf("x509: unknown EC private key version %d", new sliceType$6([new $Int(privKey[0].Version)])); /* */ $s = 11; case 11: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tmp$7 = _r$5; key = _tmp$6; err = _tmp$7; $24r$1 = [key, err]; $s = 12; case 12: return $24r$1; /* } */ case 10: curve = $ifaceNil; /* */ if (!(namedCurveOID === ptrType$18.nil)) { $s = 13; continue; } /* */ $s = 14; continue; /* if (!(namedCurveOID === ptrType$18.nil)) { */ case 13: _r$6 = namedCurveFromOID(namedCurveOID.$get()); /* */ $s = 16; case 16: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } curve = _r$6; $s = 15; continue; /* } else { */ case 14: _r$7 = namedCurveFromOID(privKey[0].NamedCurveOID); /* */ $s = 17; case 17: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } curve = _r$7; /* } */ case 15: if ($interfaceIsEqual(curve, $ifaceNil)) { _tmp$8 = ptrType$19.nil; _tmp$9 = errors.New("x509: unknown elliptic curve"); key = _tmp$8; err = _tmp$9; $s = -1; return [key, err]; } k = new big.Int.ptr(false, big.nat.nil).SetBytes(privKey[0].PrivateKey); _r$8 = curve.Params(); /* */ $s = 18; case 18: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } curveOrder = _r$8.N; if (k.Cmp(curveOrder) >= 0) { _tmp$10 = ptrType$19.nil; _tmp$11 = errors.New("x509: invalid elliptic curve private key value"); key = _tmp$10; err = _tmp$11; $s = -1; return [key, err]; } priv = new ecdsa.PrivateKey.ptr(new ecdsa.PublicKey.ptr($ifaceNil, ptrType$1.nil, ptrType$1.nil), ptrType$1.nil); priv.PublicKey.Curve = curve; priv.D = k; privateKey$1 = $makeSlice(sliceType$1, (_q = ((curveOrder.BitLen() + 7 >> 0)) / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))); while (true) { if (!(privKey[0].PrivateKey.$length > privateKey$1.$length)) { break; } if (!(((x = privKey[0].PrivateKey, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])) === 0))) { _tmp$12 = ptrType$19.nil; _tmp$13 = errors.New("x509: invalid private key length"); key = _tmp$12; err = _tmp$13; $s = -1; return [key, err]; } privKey[0].PrivateKey = $subslice(privKey[0].PrivateKey, 1); } $copySlice($subslice(privateKey$1, (privateKey$1.$length - privKey[0].PrivateKey.$length >> 0)), privKey[0].PrivateKey); _r$9 = curve.ScalarBaseMult(privateKey$1); /* */ $s = 19; case 19: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple$3 = _r$9; priv.PublicKey.X = _tuple$3[0]; priv.PublicKey.Y = _tuple$3[1]; _tmp$14 = priv; _tmp$15 = $ifaceNil; key = _tmp$14; err = _tmp$15; $s = -1; return [key, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: parseECPrivateKey }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._q = _q; $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._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$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._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.curve = curve; $f.curveOrder = curveOrder; $f.der = der; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.k = k; $f.key = key; $f.namedCurveOID = namedCurveOID; $f.priv = priv; $f.privKey = privKey; $f.privateKey$1 = privateKey$1; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Certificate.ptr.prototype.systemVerify = function(opts) { var _tmp, _tmp$1, c, chains, err, opts; chains = sliceType$21.nil; err = $ifaceNil; c = this; _tmp = sliceType$21.nil; _tmp$1 = $ifaceNil; chains = _tmp; err = _tmp$1; return [chains, err]; }; Certificate.prototype.systemVerify = function(opts) { return this.$val.systemVerify(opts); }; systemRootsPool = function() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = once.Do(initSystemRoots); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return systemRoots; /* */ } return; } if ($f === undefined) { $f = { $blk: systemRootsPool }; } $f.$s = $s; $f.$r = $r; return $f; }; initSystemRoots = function() { var _tuple; _tuple = loadSystemRoots(); systemRoots = _tuple[0]; systemRootsErr = _tuple[1]; if (!($interfaceIsEqual(systemRootsErr, $ifaceNil))) { systemRoots = ptrType.nil; } }; ParsePKCS8PrivateKey = function(der) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, $24r$5, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _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, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, bytes$1, curvePrivateKey, der, err, err$1, err$2, err$3, err$4, err$5, key, l, l$1, namedCurveOID, privKey, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$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$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$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$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _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 = $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; bytes$1 = $f.bytes$1; curvePrivateKey = $f.curvePrivateKey; der = $f.der; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; err$4 = $f.err$4; err$5 = $f.err$5; key = $f.key; l = $f.l; l$1 = $f.l$1; namedCurveOID = $f.namedCurveOID; privKey = $f.privKey; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: curvePrivateKey = [curvePrivateKey]; privKey = [privKey]; key = $ifaceNil; err = $ifaceNil; privKey[0] = new pkcs8.ptr(0, new pkix.AlgorithmIdentifier.ptr(asn1.ObjectIdentifier.nil, new asn1.RawValue.ptr(0, 0, false, sliceType$1.nil, sliceType$1.nil)), sliceType$1.nil); _r = asn1.Unmarshal(der, privKey[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; err$1 = _tuple[1]; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 2: _r$1 = asn1.Unmarshal(der, new ecPrivateKey.ptr(0, sliceType$1.nil, asn1.ObjectIdentifier.nil, new asn1.BitString.ptr(sliceType$1.nil, 0))); /* */ $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; err$2 = _tuple$1[1]; if ($interfaceIsEqual(err$2, $ifaceNil)) { _tmp = $ifaceNil; _tmp$1 = errors.New("x509: failed to parse private key (use ParseECPrivateKey instead for this key format)"); key = _tmp; err = _tmp$1; $s = -1; return [key, err]; } _r$2 = asn1.Unmarshal(der, new pkcs1PrivateKey.ptr(0, ptrType$1.nil, 0, ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, sliceType$23.nil)); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$2 = _r$2; err$3 = _tuple$2[1]; if ($interfaceIsEqual(err$3, $ifaceNil)) { _tmp$2 = $ifaceNil; _tmp$3 = errors.New("x509: failed to parse private key (use ParsePKCS1PrivateKey instead for this key format)"); key = _tmp$2; err = _tmp$3; $s = -1; return [key, err]; } _tmp$4 = $ifaceNil; _tmp$5 = err$1; key = _tmp$4; err = _tmp$5; $s = -1; return [key, err]; /* } */ case 3: /* */ if (privKey[0].Algo.Algorithm.Equal(oidPublicKeyRSA)) { $s = 7; continue; } /* */ if (privKey[0].Algo.Algorithm.Equal(oidPublicKeyECDSA)) { $s = 8; continue; } /* */ if (privKey[0].Algo.Algorithm.Equal(oidPublicKeyEd25519)) { $s = 9; continue; } /* */ $s = 10; continue; /* if (privKey[0].Algo.Algorithm.Equal(oidPublicKeyRSA)) { */ case 7: _r$3 = ParsePKCS1PrivateKey(privKey[0].PrivateKey); /* */ $s = 12; case 12: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$3 = _r$3; key = _tuple$3[0]; err = _tuple$3[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 13; continue; } /* */ $s = 14; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 13: _tmp$6 = $ifaceNil; _r$4 = err.Error(); /* */ $s = 15; case 15: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = errors.New("x509: failed to parse RSA private key embedded in PKCS#8: " + _r$4); /* */ $s = 16; case 16: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tmp$7 = _r$5; key = _tmp$6; err = _tmp$7; $24r = [key, err]; $s = 17; case 17: return $24r; /* } */ case 14: _tmp$8 = key; _tmp$9 = $ifaceNil; key = _tmp$8; err = _tmp$9; $s = -1; return [key, err]; /* } else if (privKey[0].Algo.Algorithm.Equal(oidPublicKeyECDSA)) { */ case 8: bytes$1 = privKey[0].Algo.Parameters.FullBytes; namedCurveOID = $newDataPointer(asn1.ObjectIdentifier.nil, ptrType$18); _r$6 = asn1.Unmarshal(bytes$1, namedCurveOID); /* */ $s = 18; case 18: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tuple$4 = _r$6; err$4 = _tuple$4[1]; if (!($interfaceIsEqual(err$4, $ifaceNil))) { namedCurveOID = ptrType$18.nil; } _r$7 = parseECPrivateKey(namedCurveOID, privKey[0].PrivateKey); /* */ $s = 19; case 19: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _tuple$5 = _r$7; key = _tuple$5[0]; err = _tuple$5[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 20; continue; } /* */ $s = 21; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 20: _tmp$10 = $ifaceNil; _r$8 = err.Error(); /* */ $s = 22; case 22: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$9 = errors.New("x509: failed to parse EC private key embedded in PKCS#8: " + _r$8); /* */ $s = 23; case 23: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tmp$11 = _r$9; key = _tmp$10; err = _tmp$11; $24r$1 = [key, err]; $s = 24; case 24: return $24r$1; /* } */ case 21: _tmp$12 = key; _tmp$13 = $ifaceNil; key = _tmp$12; err = _tmp$13; $s = -1; return [key, err]; /* } else if (privKey[0].Algo.Algorithm.Equal(oidPublicKeyEd25519)) { */ case 9: l = privKey[0].Algo.Parameters.FullBytes.$length; if (!((l === 0))) { _tmp$14 = $ifaceNil; _tmp$15 = errors.New("x509: invalid Ed25519 private key parameters"); key = _tmp$14; err = _tmp$15; $s = -1; return [key, err]; } curvePrivateKey[0] = sliceType$1.nil; _r$10 = asn1.Unmarshal(privKey[0].PrivateKey, (curvePrivateKey.$ptr || (curvePrivateKey.$ptr = new ptrType$20(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, curvePrivateKey)))); /* */ $s = 25; case 25: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$6 = _r$10; err$5 = _tuple$6[1]; /* */ if (!($interfaceIsEqual(err$5, $ifaceNil))) { $s = 26; continue; } /* */ $s = 27; continue; /* if (!($interfaceIsEqual(err$5, $ifaceNil))) { */ case 26: _tmp$16 = $ifaceNil; _r$11 = fmt.Errorf("x509: invalid Ed25519 private key: %v", new sliceType$6([err$5])); /* */ $s = 28; case 28: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tmp$17 = _r$11; key = _tmp$16; err = _tmp$17; $24r$2 = [key, err]; $s = 29; case 29: return $24r$2; /* } */ case 27: l$1 = curvePrivateKey[0].$length; /* */ if (!((l$1 === 32))) { $s = 30; continue; } /* */ $s = 31; continue; /* if (!((l$1 === 32))) { */ case 30: _tmp$18 = $ifaceNil; _r$12 = fmt.Errorf("x509: invalid Ed25519 private key length: %d", new sliceType$6([new $Int(l$1)])); /* */ $s = 32; case 32: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _tmp$19 = _r$12; key = _tmp$18; err = _tmp$19; $24r$3 = [key, err]; $s = 33; case 33: return $24r$3; /* } */ case 31: _r$13 = ed25519.NewKeyFromSeed(curvePrivateKey[0]); /* */ $s = 34; case 34: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _tmp$20 = _r$13; _tmp$21 = $ifaceNil; key = _tmp$20; err = _tmp$21; $24r$4 = [key, err]; $s = 35; case 35: return $24r$4; /* } else { */ case 10: _tmp$22 = $ifaceNil; _r$14 = fmt.Errorf("x509: PKCS#8 wrapping contained private key with unknown algorithm: %v", new sliceType$6([privKey[0].Algo.Algorithm])); /* */ $s = 36; case 36: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _tmp$23 = _r$14; key = _tmp$22; err = _tmp$23; $24r$5 = [key, err]; $s = 37; case 37: return $24r$5; /* } */ case 11: case 6: $s = -1; return [key, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: ParsePKCS8PrivateKey }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$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$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$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$3 = _tmp$3; $f._tmp$4 = _tmp$4; $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 = _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.bytes$1 = bytes$1; $f.curvePrivateKey = curvePrivateKey; $f.der = der; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.err$4 = err$4; $f.err$5 = err$5; $f.key = key; $f.l = l; $f.l$1 = l$1; $f.namedCurveOID = namedCurveOID; $f.privKey = privKey; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.ParsePKCS8PrivateKey = ParsePKCS8PrivateKey; ParsePKCS1PrivateKey = function(der) { var _i, _r, _r$1, _r$2, _r$3, _ref, _tuple, _tuple$1, _tuple$2, a, der, err, err$1, err$2, i, key, priv, rest, 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; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; a = $f.a; der = $f.der; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; i = $f.i; key = $f.key; priv = $f.priv; rest = $f.rest; 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: priv = [priv]; priv[0] = new pkcs1PrivateKey.ptr(0, ptrType$1.nil, 0, ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, sliceType$23.nil); _r = asn1.Unmarshal(der, priv[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; rest = _tuple[0]; err = _tuple[1]; if (rest.$length > 0) { $s = -1; return [ptrType$21.nil, (x = new asn1.SyntaxError.ptr("trailing data"), new x.constructor.elem(x))]; } /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: _r$1 = asn1.Unmarshal(der, new ecPrivateKey.ptr(0, sliceType$1.nil, asn1.ObjectIdentifier.nil, new asn1.BitString.ptr(sliceType$1.nil, 0))); /* */ $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; err$1 = _tuple$1[1]; if ($interfaceIsEqual(err$1, $ifaceNil)) { $s = -1; return [ptrType$21.nil, errors.New("x509: failed to parse private key (use ParseECPrivateKey instead for this key format)")]; } _r$2 = asn1.Unmarshal(der, new pkcs8.ptr(0, new pkix.AlgorithmIdentifier.ptr(asn1.ObjectIdentifier.nil, new asn1.RawValue.ptr(0, 0, false, sliceType$1.nil, sliceType$1.nil)), sliceType$1.nil)); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$2 = _r$2; err$2 = _tuple$2[1]; if ($interfaceIsEqual(err$2, $ifaceNil)) { $s = -1; return [ptrType$21.nil, errors.New("x509: failed to parse private key (use ParsePKCS8PrivateKey instead for this key format)")]; } $s = -1; return [ptrType$21.nil, err]; /* } */ case 3: if (priv[0].Version > 1) { $s = -1; return [ptrType$21.nil, errors.New("x509: unsupported private key version")]; } if (priv[0].N.Sign() <= 0 || priv[0].D.Sign() <= 0 || priv[0].P.Sign() <= 0 || priv[0].Q.Sign() <= 0) { $s = -1; return [ptrType$21.nil, errors.New("x509: private key contains zero or negative value")]; } key = new rsa.PrivateKey.ptr(new rsa.PublicKey.ptr(ptrType$1.nil, 0), ptrType$1.nil, sliceType$25.nil, new rsa.PrecomputedValues.ptr(ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, sliceType$26.nil)); rsa.PublicKey.copy(key.PublicKey, new rsa.PublicKey.ptr(priv[0].N, priv[0].E)); key.D = priv[0].D; key.Primes = $makeSlice(sliceType$25, (2 + priv[0].AdditionalPrimes.$length >> 0)); (x$1 = key.Primes, (0 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 0] = priv[0].P)); (x$2 = key.Primes, (1 >= x$2.$length ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + 1] = priv[0].Q)); _ref = priv[0].AdditionalPrimes; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; a = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), pkcs1AdditionalRSAPrime); if (a.Prime.Sign() <= 0) { $s = -1; return [ptrType$21.nil, errors.New("x509: private key contains zero or negative prime")]; } (x$3 = key.Primes, x$4 = i + 2 >> 0, ((x$4 < 0 || x$4 >= x$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + x$4] = a.Prime)); _i++; } _r$3 = key.Validate(); /* */ $s = 6; case 6: 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 = -1; return [ptrType$21.nil, err]; } $r = key.Precompute(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return [key, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: ParsePKCS1PrivateKey }; } $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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.a = a; $f.der = der; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.i = i; $f.key = key; $f.priv = priv; $f.rest = rest; $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; }; $pkg.ParsePKCS1PrivateKey = ParsePKCS1PrivateKey; isPrintable = function(b) { var b; return 97 <= b && b <= 122 || 65 <= b && b <= 90 || 48 <= b && b <= 57 || 39 <= b && b <= 41 || 43 <= b && b <= 47 || (b === 32) || (b === 58) || (b === 61) || (b === 63) || (b === 42) || (b === 38); }; parseASN1String = function(tag, value) { var $24r, _1, _i, _q, _r, _r$1, _r$2, _ref, b, l, s, s$1, tag, value, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _1 = $f._1; _i = $f._i; _q = $f._q; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; b = $f.b; l = $f.l; s = $f.s; s$1 = $f.s$1; tag = $f.tag; value = $f.value; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _1 = tag; /* */ if (_1 === (20)) { $s = 2; continue; } /* */ if (_1 === (19)) { $s = 3; continue; } /* */ if (_1 === (12)) { $s = 4; continue; } /* */ if (_1 === (30)) { $s = 5; continue; } /* */ if (_1 === (22)) { $s = 6; continue; } /* */ $s = 7; continue; /* if (_1 === (20)) { */ case 2: $s = -1; return [($bytesToString(value)), $ifaceNil]; /* } else if (_1 === (19)) { */ case 3: _ref = value; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } b = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (!isPrintable(b)) { $s = -1; return ["", errors.New("invalid PrintableString")]; } _i++; } $s = -1; return [($bytesToString(value)), $ifaceNil]; /* } else if (_1 === (12)) { */ case 4: if (!utf8.Valid(value)) { $s = -1; return ["", errors.New("invalid UTF-8 string")]; } $s = -1; return [($bytesToString(value)), $ifaceNil]; /* } else if (_1 === (30)) { */ case 5: if (!(((_r = value.$length % 2, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) === 0))) { $s = -1; return ["", errors.New("invalid BMPString")]; } l = value.$length; if (l >= 2 && ((x = l - 1 >> 0, ((x < 0 || x >= value.$length) ? ($throwRuntimeError("index out of range"), undefined) : value.$array[value.$offset + x])) === 0) && ((x$1 = l - 2 >> 0, ((x$1 < 0 || x$1 >= value.$length) ? ($throwRuntimeError("index out of range"), undefined) : value.$array[value.$offset + x$1])) === 0)) { value = $subslice(value, 0, (l - 2 >> 0)); } s = $makeSlice(sliceType$27, 0, (_q = value.$length / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))); while (true) { if (!(value.$length > 0)) { break; } s = $append(s, ((((0 >= value.$length ? ($throwRuntimeError("index out of range"), undefined) : value.$array[value.$offset + 0]) << 16 >>> 16)) << 8 << 16 >>> 16) + (((1 >= value.$length ? ($throwRuntimeError("index out of range"), undefined) : value.$array[value.$offset + 1]) << 16 >>> 16)) << 16 >>> 16); value = $subslice(value, 2); } $s = -1; return [($runesToString(utf16.Decode(s))), $ifaceNil]; /* } else if (_1 === (22)) { */ case 6: s$1 = ($bytesToString(value)); _r$1 = isIA5String(s$1); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (!($interfaceIsEqual(_r$1, $ifaceNil))) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!($interfaceIsEqual(_r$1, $ifaceNil))) { */ case 8: $s = -1; return ["", errors.New("invalid IA5String")]; /* } */ case 9: $s = -1; return [s$1, $ifaceNil]; /* } */ case 7: case 1: _r$2 = fmt.Errorf("unsupported string type: %v", new sliceType$6([new asn1$1.Tag(tag)])); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = ["", _r$2]; $s = 12; case 12: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: parseASN1String }; } $f.$24r = $24r; $f._1 = _1; $f._i = _i; $f._q = _q; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f.b = b; $f.l = l; $f.s = s; $f.s$1 = s$1; $f.tag = tag; $f.value = value; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; parseName = function(raw) { var $24r, _r, _r$1, _tuple, atav, attr, err, raw, rawValue, rdnSeq, rdnSet, set, valueTag, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; atav = $f.atav; attr = $f.attr; err = $f.err; raw = $f.raw; rawValue = $f.rawValue; rdnSeq = $f.rdnSeq; rdnSet = $f.rdnSet; set = $f.set; valueTag = $f.valueTag; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: raw = [raw]; rdnSeq = [rdnSeq]; if (!(raw.$ptr || (raw.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, raw))).ReadASN1((raw.$ptr || (raw.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, raw))), 48)) { $s = -1; return [ptrType$14.nil, errors.New("x509: invalid RDNSequence")]; } rdnSeq[0] = pkix.RDNSequence.nil; /* while (true) { */ case 1: /* if (!(!raw[0].Empty())) { break; } */ if(!(!raw[0].Empty())) { $s = 2; continue; } set = [set]; rdnSet = pkix.RelativeDistinguishedNameSET.nil; set[0] = cryptobyte.String.nil; if (!(raw.$ptr || (raw.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, raw))).ReadASN1((set.$ptr || (set.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, set))), 49)) { $s = -1; return [ptrType$14.nil, errors.New("x509: invalid RDNSequence")]; } /* while (true) { */ case 3: /* if (!(!set[0].Empty())) { break; } */ if(!(!set[0].Empty())) { $s = 4; continue; } atav = [atav]; rawValue = [rawValue]; valueTag = [valueTag]; atav[0] = cryptobyte.String.nil; if (!(set.$ptr || (set.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, set))).ReadASN1((atav.$ptr || (atav.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, atav))), 48)) { $s = -1; return [ptrType$14.nil, errors.New("x509: invalid RDNSequence: invalid attribute")]; } attr = new pkix.AttributeTypeAndValue.ptr(asn1.ObjectIdentifier.nil, $ifaceNil); if (!(atav.$ptr || (atav.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, atav))).ReadASN1ObjectIdentifier((attr.$ptr_Type || (attr.$ptr_Type = new ptrType$18(function() { return this.$target.Type; }, function($v) { this.$target.Type = $v; }, attr))))) { $s = -1; return [ptrType$14.nil, errors.New("x509: invalid RDNSequence: invalid attribute type")]; } rawValue[0] = cryptobyte.String.nil; valueTag[0] = 0; if (!(atav.$ptr || (atav.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, atav))).ReadAnyASN1((rawValue.$ptr || (rawValue.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, rawValue))), (valueTag.$ptr || (valueTag.$ptr = new ptrType$24(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, valueTag))))) { $s = -1; return [ptrType$14.nil, errors.New("x509: invalid RDNSequence: invalid attribute value")]; } err = $ifaceNil; _r = parseASN1String(valueTag[0], $convertSliceType(rawValue[0], sliceType$1)); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; attr.Value = new $String(_tuple[0]); err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 6: _r$1 = fmt.Errorf("x509: invalid RDNSequence: invalid attribute value: %s", new sliceType$6([err])); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = [ptrType$14.nil, _r$1]; $s = 9; case 9: return $24r; /* } */ case 7: rdnSet = $append(rdnSet, attr); $s = 3; continue; case 4: rdnSeq[0] = $append(rdnSeq[0], rdnSet); $s = 1; continue; case 2: $s = -1; return [(rdnSeq.$ptr || (rdnSeq.$ptr = new ptrType$14(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, rdnSeq))), $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: parseName }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.atav = atav; $f.attr = attr; $f.err = err; $f.raw = raw; $f.rawValue = rawValue; $f.rdnSeq = rdnSeq; $f.rdnSet = rdnSet; $f.set = set; $f.valueTag = valueTag; $f.$s = $s; $f.$r = $r; return $f; }; parseAI = function(der) { var ai, der, der$24ptr, params, params$24ptr, tag, tag$24ptr; ai = new pkix.AlgorithmIdentifier.ptr(asn1.ObjectIdentifier.nil, new asn1.RawValue.ptr(0, 0, false, sliceType$1.nil, sliceType$1.nil)); if (!(der$24ptr || (der$24ptr = new ptrType$23(function() { return der; }, function($v) { der = $convertSliceType($v, cryptobyte.String); }))).ReadASN1ObjectIdentifier((ai.$ptr_Algorithm || (ai.$ptr_Algorithm = new ptrType$18(function() { return this.$target.Algorithm; }, function($v) { this.$target.Algorithm = $v; }, ai))))) { return [ai, errors.New("x509: malformed OID")]; } if (der.Empty()) { return [ai, $ifaceNil]; } params = cryptobyte.String.nil; tag = 0; if (!(der$24ptr || (der$24ptr = new ptrType$23(function() { return der; }, function($v) { der = $convertSliceType($v, cryptobyte.String); }))).ReadAnyASN1Element((params$24ptr || (params$24ptr = new ptrType$23(function() { return params; }, function($v) { params = $convertSliceType($v, cryptobyte.String); }))), (tag$24ptr || (tag$24ptr = new ptrType$24(function() { return tag; }, function($v) { tag = $v; }))))) { return [ai, errors.New("x509: malformed parameters")]; } ai.Parameters.Tag = ((tag >> 0)); ai.Parameters.FullBytes = $convertSliceType(params, sliceType$1); return [ai, $ifaceNil]; }; parseValidity = function(der) { var _r, _r$1, _tuple, _tuple$1, der, err, extract, notAfter, notBefore, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; der = $f.der; err = $f.err; extract = $f.extract; notAfter = $f.notAfter; notBefore = $f.notBefore; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: der = [der]; extract = (function(der) { return function $b() { var _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, _tuple$1, err, formatStr, s, serialized, t, utc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; err = $f.err; formatStr = $f.formatStr; s = $f.s; serialized = $f.serialized; t = $f.t; utc = $f.utc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = [t]; utc = [utc]; t[0] = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$7.nil); /* */ if (der[0].PeekASN1Tag(23)) { $s = 2; continue; } /* */ if (der[0].PeekASN1Tag(24)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (der[0].PeekASN1Tag(23)) { */ case 2: utc[0] = cryptobyte.String.nil; if (!(der.$ptr || (der.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, der))).ReadASN1((utc.$ptr || (utc.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, utc))), 23)) { $s = -1; return [t[0], errors.New("x509: malformed UTCTime")]; } s = ($bytesToString(utc[0])); formatStr = "0601021504Z0700"; err = $ifaceNil; _r = time.Parse(formatStr, s); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; time.Time.copy(t[0], _tuple[0]); err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 7: formatStr = "060102150405Z0700"; _r$1 = time.Parse(formatStr, s); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; time.Time.copy(t[0], _tuple$1[0]); err = _tuple$1[1]; /* } */ case 8: if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [t[0], err]; } _r$2 = $clone(t[0], time.Time).Format(formatStr); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } serialized = _r$2; if (!(serialized === s)) { $s = -1; return [t[0], errors.New("x509: malformed UTCTime")]; } _r$3 = $clone(t[0], time.Time).Year(); /* */ $s = 13; case 13: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } /* */ if (_r$3 >= 2050) { $s = 11; continue; } /* */ $s = 12; continue; /* if (_r$3 >= 2050) { */ case 11: _r$4 = $clone(t[0], time.Time).AddDate(-100, 0, 0); /* */ $s = 14; case 14: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } time.Time.copy(t[0], _r$4); /* } */ case 12: $s = 5; continue; /* } else if (der[0].PeekASN1Tag(24)) { */ case 3: _r$5 = (der.$ptr || (der.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, der))).ReadASN1GeneralizedTime(t[0]); /* */ $s = 17; case 17: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } /* */ if (!_r$5) { $s = 15; continue; } /* */ $s = 16; continue; /* if (!_r$5) { */ case 15: $s = -1; return [t[0], errors.New("x509: malformed GeneralizedTime")]; /* } */ case 16: $s = 5; continue; /* } else { */ case 4: $s = -1; return [t[0], errors.New("x509: unsupported time format")]; /* } */ case 5: case 1: $s = -1; return [t[0], $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.err = err; $f.formatStr = formatStr; $f.s = s; $f.serialized = serialized; $f.t = t; $f.utc = utc; $f.$s = $s; $f.$r = $r; return $f; }; })(der); _r = extract(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; notBefore = $clone(_tuple[0], time.Time); err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$7.nil), new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$7.nil), err]; } _r$1 = extract(); /* */ $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; notAfter = $clone(_tuple$1[0], time.Time); err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$7.nil), new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$7.nil), err]; } $s = -1; return [notBefore, notAfter, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: parseValidity }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.der = der; $f.err = err; $f.extract = extract; $f.notAfter = notAfter; $f.notBefore = notBefore; $f.$s = $s; $f.$r = $r; return $f; }; parseExtension = function(der) { var der, der$24ptr, ext, val, val$24ptr; ext = new pkix.Extension.ptr(asn1.ObjectIdentifier.nil, false, sliceType$1.nil); if (!(der$24ptr || (der$24ptr = new ptrType$23(function() { return der; }, function($v) { der = $convertSliceType($v, cryptobyte.String); }))).ReadASN1ObjectIdentifier((ext.$ptr_Id || (ext.$ptr_Id = new ptrType$18(function() { return this.$target.Id; }, function($v) { this.$target.Id = $v; }, ext))))) { return [ext, errors.New("x509: malformed extention OID field")]; } if (der.PeekASN1Tag(1)) { if (!(der$24ptr || (der$24ptr = new ptrType$23(function() { return der; }, function($v) { der = $convertSliceType($v, cryptobyte.String); }))).ReadASN1Boolean((ext.$ptr_Critical || (ext.$ptr_Critical = new ptrType$6(function() { return this.$target.Critical; }, function($v) { this.$target.Critical = $v; }, ext))))) { return [ext, errors.New("x509: malformed extention critical field")]; } } val = cryptobyte.String.nil; if (!(der$24ptr || (der$24ptr = new ptrType$23(function() { return der; }, function($v) { der = $convertSliceType($v, cryptobyte.String); }))).ReadASN1((val$24ptr || (val$24ptr = new ptrType$23(function() { return val; }, function($v) { val = $convertSliceType($v, cryptobyte.String); }))), 4)) { return [ext, errors.New("x509: malformed extention value field")]; } ext.Value = $convertSliceType(val, sliceType$1); return [ext, $ifaceNil]; }; parsePublicKey = function(algo, keyData) { var _1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _tuple, _v, _v$1, _v$2, algo, der, keyData, namedCurve, namedCurveOID, p, paramsDer, paramsDer$1, paramsDer$24ptr, pub, pub$1, pub$2, x, y, y$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._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; _r$7 = $f._r$7; _tuple = $f._tuple; _v = $f._v; _v$1 = $f._v$1; _v$2 = $f._v$2; algo = $f.algo; der = $f.der; keyData = $f.keyData; namedCurve = $f.namedCurve; namedCurveOID = $f.namedCurveOID; p = $f.p; paramsDer = $f.paramsDer; paramsDer$1 = $f.paramsDer$1; paramsDer$24ptr = $f.paramsDer$24ptr; pub = $f.pub; pub$1 = $f.pub$1; pub$2 = $f.pub$2; x = $f.x; y = $f.y; y$1 = $f.y$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: der = [der]; paramsDer = [paramsDer]; der[0] = ($convertSliceType($clone(keyData.PublicKey, asn1.BitString).RightAlign(), cryptobyte.String)); _1 = algo; /* */ if (_1 === (1)) { $s = 2; continue; } /* */ if (_1 === (3)) { $s = 3; continue; } /* */ if (_1 === (4)) { $s = 4; continue; } /* */ if (_1 === (2)) { $s = 5; continue; } /* */ $s = 6; continue; /* if (_1 === (1)) { */ case 2: if (!bytes.Equal(keyData.Algorithm.Parameters.FullBytes, asn1.NullBytes)) { $s = -1; return [$ifaceNil, errors.New("x509: RSA key missing NULL parameters")]; } p = new pkcs1PublicKey.ptr(new big.Int.ptr(false, big.nat.nil), 0); if (!(der.$ptr || (der.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, der))).ReadASN1((der.$ptr || (der.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, der))), 48)) { $s = -1; return [$ifaceNil, errors.New("x509: invalid RSA public key")]; } _r = (der.$ptr || (der.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, der))).ReadASN1Integer(p.N); /* */ $s = 10; case 10: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (!_r) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!_r) { */ case 8: $s = -1; return [$ifaceNil, errors.New("x509: invalid RSA modulus")]; /* } */ case 9: _r$1 = (der.$ptr || (der.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, der))).ReadASN1Integer((p.$ptr_E || (p.$ptr_E = new ptrType$16(function() { return this.$target.E; }, function($v) { this.$target.E = $v; }, p)))); /* */ $s = 13; case 13: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (!_r$1) { $s = 11; continue; } /* */ $s = 12; continue; /* if (!_r$1) { */ case 11: $s = -1; return [$ifaceNil, errors.New("x509: invalid RSA public exponent")]; /* } */ case 12: if (p.N.Sign() <= 0) { $s = -1; return [$ifaceNil, errors.New("x509: RSA modulus is not a positive number")]; } if (p.E <= 0) { $s = -1; return [$ifaceNil, errors.New("x509: RSA public exponent is not a positive number")]; } pub = new rsa.PublicKey.ptr(p.N, p.E); $s = -1; return [pub, $ifaceNil]; /* } else if (_1 === (3)) { */ case 3: paramsDer$1 = ($convertSliceType(keyData.Algorithm.Parameters.FullBytes, cryptobyte.String)); namedCurveOID = $newDataPointer(asn1.ObjectIdentifier.nil, ptrType$18); if (!(paramsDer$24ptr || (paramsDer$24ptr = new ptrType$23(function() { return paramsDer$1; }, function($v) { paramsDer$1 = $convertSliceType($v, cryptobyte.String); }))).ReadASN1ObjectIdentifier(namedCurveOID)) { $s = -1; return [$ifaceNil, errors.New("x509: invalid ECDSA parameters")]; } _r$2 = namedCurveFromOID(namedCurveOID.$get()); /* */ $s = 14; case 14: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } namedCurve = _r$2; if ($interfaceIsEqual(namedCurve, $ifaceNil)) { $s = -1; return [$ifaceNil, errors.New("x509: unsupported elliptic curve")]; } _r$3 = elliptic.Unmarshal(namedCurve, $convertSliceType(der[0], sliceType$1)); /* */ $s = 15; case 15: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; x = _tuple[0]; y = _tuple[1]; if (x === ptrType$1.nil) { $s = -1; return [$ifaceNil, errors.New("x509: failed to unmarshal elliptic curve point")]; } pub$1 = new ecdsa.PublicKey.ptr(namedCurve, x, y); $s = -1; return [pub$1, $ifaceNil]; /* } else if (_1 === (4)) { */ case 4: if (!((keyData.Algorithm.Parameters.FullBytes.$length === 0))) { $s = -1; return [$ifaceNil, errors.New("x509: Ed25519 key encoded with illegal parameters")]; } if (!((der[0].$length === 32))) { $s = -1; return [$ifaceNil, errors.New("x509: wrong Ed25519 public key size")]; } $s = -1; return [($convertSliceType(der[0], ed25519.PublicKey)), $ifaceNil]; /* } else if (_1 === (2)) { */ case 5: y$1 = new big.Int.ptr(false, big.nat.nil); _r$4 = (der.$ptr || (der.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, der))).ReadASN1Integer(y$1); /* */ $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) { $s = 16; continue; } /* */ $s = 17; continue; /* if (!_r$4) { */ case 16: $s = -1; return [$ifaceNil, errors.New("x509: invalid DSA public key")]; /* } */ case 17: pub$2 = new dsa.PublicKey.ptr(new dsa.Parameters.ptr(new big.Int.ptr(false, big.nat.nil), new big.Int.ptr(false, big.nat.nil), new big.Int.ptr(false, big.nat.nil)), y$1); paramsDer[0] = ($convertSliceType(keyData.Algorithm.Parameters.FullBytes, cryptobyte.String)); if (!(paramsDer.$ptr || (paramsDer.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, paramsDer))).ReadASN1((paramsDer.$ptr || (paramsDer.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, paramsDer))), 48)) { _v$2 = true; $s = 23; continue s; } _r$5 = (paramsDer.$ptr || (paramsDer.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, paramsDer))).ReadASN1Integer(pub$2.Parameters.P); /* */ $s = 24; case 24: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _v$2 = !_r$5; case 23: if (_v$2) { _v$1 = true; $s = 22; continue s; } _r$6 = (paramsDer.$ptr || (paramsDer.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, paramsDer))).ReadASN1Integer(pub$2.Parameters.Q); /* */ $s = 25; case 25: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _v$1 = !_r$6; case 22: if (_v$1) { _v = true; $s = 21; continue s; } _r$7 = (paramsDer.$ptr || (paramsDer.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, paramsDer))).ReadASN1Integer(pub$2.Parameters.G); /* */ $s = 26; case 26: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _v = !_r$7; case 21: /* */ if (_v) { $s = 19; continue; } /* */ $s = 20; continue; /* if (_v) { */ case 19: $s = -1; return [$ifaceNil, errors.New("x509: invalid DSA parameters")]; /* } */ case 20: if (pub$2.Y.Sign() <= 0 || pub$2.Parameters.P.Sign() <= 0 || pub$2.Parameters.Q.Sign() <= 0 || pub$2.Parameters.G.Sign() <= 0) { $s = -1; return [$ifaceNil, errors.New("x509: zero or negative DSA parameter")]; } $s = -1; return [pub$2, $ifaceNil]; /* } else { */ case 6: $s = -1; return [$ifaceNil, $ifaceNil]; /* } */ case 7: case 1: $s = -1; return [$ifaceNil, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: parsePublicKey }; } $f._1 = _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._r$7 = _r$7; $f._tuple = _tuple; $f._v = _v; $f._v$1 = _v$1; $f._v$2 = _v$2; $f.algo = algo; $f.der = der; $f.keyData = keyData; $f.namedCurve = namedCurve; $f.namedCurveOID = namedCurveOID; $f.p = p; $f.paramsDer = paramsDer; $f.paramsDer$1 = paramsDer$1; $f.paramsDer$24ptr = paramsDer$24ptr; $f.pub = pub; $f.pub$1 = pub$1; $f.pub$2 = pub$2; $f.x = x; $f.y = y; $f.y$1 = y$1; $f.$s = $s; $f.$r = $r; return $f; }; parseKeyUsageExtension = function(der) { var der, der$24ptr, i, usage, usageBits, y; usageBits = new asn1.BitString.ptr(sliceType$1.nil, 0); if (!(der$24ptr || (der$24ptr = new ptrType$23(function() { return der; }, function($v) { der = $convertSliceType($v, cryptobyte.String); }))).ReadASN1BitString(usageBits)) { return [0, errors.New("x509: invalid key usage")]; } usage = 0; i = 0; while (true) { if (!(i < 9)) { break; } if (!(($clone(usageBits, asn1.BitString).At(i) === 0))) { usage = usage | (((y = ((i >>> 0)), y < 32 ? (1 << y) : 0) >> 0)); } i = i + (1) >> 0; } return [((usage >> 0)), $ifaceNil]; }; parseBasicConstraintsExtension = function(der) { var _r, der, isCA, maxPathLen, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; der = $f.der; isCA = $f.isCA; maxPathLen = $f.maxPathLen; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: der = [der]; isCA = [isCA]; maxPathLen = [maxPathLen]; isCA[0] = false; if (!(der.$ptr || (der.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, der))).ReadASN1((der.$ptr || (der.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, der))), 48)) { $s = -1; return [false, 0, errors.New("x509: invalid basic constraints a")]; } if (der[0].PeekASN1Tag(1)) { if (!(der.$ptr || (der.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, der))).ReadASN1Boolean((isCA.$ptr || (isCA.$ptr = new ptrType$6(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, isCA))))) { $s = -1; return [false, 0, errors.New("x509: invalid basic constraints b")]; } } maxPathLen[0] = -1; /* */ if (!der[0].Empty() && der[0].PeekASN1Tag(2)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!der[0].Empty() && der[0].PeekASN1Tag(2)) { */ case 1: _r = (der.$ptr || (der.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, der))).ReadASN1Integer((maxPathLen.$ptr || (maxPathLen.$ptr = new ptrType$16(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, maxPathLen)))); /* */ $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: $s = -1; return [false, 0, errors.New("x509: invalid basic constraints c")]; /* } */ case 4: /* } */ case 2: $s = -1; return [isCA[0], maxPathLen[0], $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: parseBasicConstraintsExtension }; } $f._r = _r; $f.der = der; $f.isCA = isCA; $f.maxPathLen = maxPathLen; $f.$s = $s; $f.$r = $r; return $f; }; forEachSAN = function(der, callback) { var _r, callback, der, err, san, tag, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; callback = $f.callback; der = $f.der; err = $f.err; san = $f.san; tag = $f.tag; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: der = [der]; if (!(der.$ptr || (der.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, der))).ReadASN1((der.$ptr || (der.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, der))), 48)) { $s = -1; return errors.New("x509: invalid subject alternative names"); } /* while (true) { */ case 1: /* if (!(!der[0].Empty())) { break; } */ if(!(!der[0].Empty())) { $s = 2; continue; } san = [san]; tag = [tag]; san[0] = cryptobyte.String.nil; tag[0] = 0; if (!(der.$ptr || (der.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, der))).ReadAnyASN1((san.$ptr || (san.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, san))), (tag.$ptr || (tag.$ptr = new ptrType$24(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, tag))))) { $s = -1; return errors.New("x509: invalid subject alternative name"); } _r = callback(((((tag[0] ^ 128) << 24 >>> 24) >> 0)), $convertSliceType(san[0], sliceType$1)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $s = 1; continue; case 2: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: forEachSAN }; } $f._r = _r; $f.callback = callback; $f.der = der; $f.err = err; $f.san = san; $f.tag = tag; $f.$s = $s; $f.$r = $r; return $f; }; parseSANExtension = function(der) { var _r, der, dnsNames, emailAddresses, err, ipAddresses, uris, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; der = $f.der; dnsNames = $f.dnsNames; emailAddresses = $f.emailAddresses; err = $f.err; ipAddresses = $f.ipAddresses; uris = $f.uris; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: dnsNames = [dnsNames]; emailAddresses = [emailAddresses]; ipAddresses = [ipAddresses]; uris = [uris]; dnsNames[0] = sliceType$4.nil; emailAddresses[0] = sliceType$4.nil; ipAddresses[0] = sliceType$18.nil; uris[0] = sliceType$19.nil; err = $ifaceNil; _r = forEachSAN(der, (function(dnsNames, emailAddresses, ipAddresses, uris) { return function $b(tag, data) { var $24r, $24r$1, _1, _2, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, _tuple$1, data, email, err$1, err$2, err$3, err$4, name, ok, tag, uri, uriStr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _1 = $f._1; _2 = $f._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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; data = $f.data; email = $f.email; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; err$4 = $f.err$4; name = $f.name; ok = $f.ok; tag = $f.tag; uri = $f.uri; uriStr = $f.uriStr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _1 = tag; /* */ if (_1 === (1)) { $s = 2; continue; } /* */ if (_1 === (2)) { $s = 3; continue; } /* */ if (_1 === (6)) { $s = 4; continue; } /* */ if (_1 === (7)) { $s = 5; continue; } /* */ $s = 6; continue; /* if (_1 === (1)) { */ case 2: email = ($bytesToString(data)); _r = isIA5String(email); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err$1 = _r; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return errors.New("x509: SAN rfc822Name is malformed"); } emailAddresses[0] = $append(emailAddresses[0], email); $s = 6; continue; /* } else if (_1 === (2)) { */ case 3: name = ($bytesToString(data)); _r$1 = isIA5String(name); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err$2 = _r$1; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return errors.New("x509: SAN dNSName is malformed"); } dnsNames[0] = $append(dnsNames[0], (name)); $s = 6; continue; /* } else if (_1 === (6)) { */ case 4: uriStr = ($bytesToString(data)); _r$2 = isIA5String(uriStr); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } err$3 = _r$2; if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = -1; return errors.New("x509: SAN uniformResourceIdentifier is malformed"); } _r$3 = url.Parse(uriStr); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; uri = _tuple[0]; err$4 = _tuple[1]; /* */ if (!($interfaceIsEqual(err$4, $ifaceNil))) { $s = 11; continue; } /* */ $s = 12; continue; /* if (!($interfaceIsEqual(err$4, $ifaceNil))) { */ case 11: _r$4 = fmt.Errorf("x509: cannot parse URI %q: %s", new sliceType$6([new $String(uriStr), err$4])); /* */ $s = 13; case 13: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r = _r$4; $s = 14; case 14: return $24r; /* } */ case 12: /* */ if (uri.Host.length > 0) { $s = 15; continue; } /* */ $s = 16; continue; /* if (uri.Host.length > 0) { */ case 15: _tuple$1 = domainToReverseLabels(uri.Host); ok = _tuple$1[1]; /* */ if (!ok) { $s = 17; continue; } /* */ $s = 18; continue; /* if (!ok) { */ case 17: _r$5 = fmt.Errorf("x509: cannot parse URI %q: invalid domain", new sliceType$6([new $String(uriStr)])); /* */ $s = 19; case 19: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $24r$1 = _r$5; $s = 20; case 20: return $24r$1; /* } */ case 18: /* } */ case 16: uris[0] = $append(uris[0], uri); $s = 6; continue; /* } else if (_1 === (7)) { */ case 5: _2 = data.$length; if ((_2 === (4)) || (_2 === (16))) { ipAddresses[0] = $append(ipAddresses[0], $convertSliceType(data, net.IP)); } else { $s = -1; return errors.New("x509: cannot parse IP address of length " + strconv.Itoa(data.$length)); } /* } */ case 6: case 1: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._1 = _1; $f._2 = _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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.data = data; $f.email = email; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.err$4 = err$4; $f.name = name; $f.ok = ok; $f.tag = tag; $f.uri = uri; $f.uriStr = uriStr; $f.$s = $s; $f.$r = $r; return $f; }; })(dnsNames, emailAddresses, ipAddresses, uris)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; $s = -1; return [dnsNames[0], emailAddresses[0], ipAddresses[0], uris[0], err]; /* */ } return; } if ($f === undefined) { $f = { $blk: parseSANExtension }; } $f._r = _r; $f.der = der; $f.dnsNames = dnsNames; $f.emailAddresses = emailAddresses; $f.err = err; $f.ipAddresses = ipAddresses; $f.uris = uris; $f.$s = $s; $f.$r = $r; return $f; }; parseExtKeyUsageExtension = function(der) { var _tuple, der, der$24ptr, eku, extKeyUsage, extKeyUsages, ok, unknownUsages; extKeyUsages = sliceType$22.nil; unknownUsages = sliceType$11.nil; if (!(der$24ptr || (der$24ptr = new ptrType$23(function() { return der; }, function($v) { der = $convertSliceType($v, cryptobyte.String); }))).ReadASN1((der$24ptr || (der$24ptr = new ptrType$23(function() { return der; }, function($v) { der = $convertSliceType($v, cryptobyte.String); }))), 48)) { return [sliceType$22.nil, sliceType$11.nil, errors.New("x509: invalid extended key usages")]; } while (true) { if (!(!der.Empty())) { break; } eku = [eku]; eku[0] = asn1.ObjectIdentifier.nil; if (!(der$24ptr || (der$24ptr = new ptrType$23(function() { return der; }, function($v) { der = $convertSliceType($v, cryptobyte.String); }))).ReadASN1ObjectIdentifier((eku.$ptr || (eku.$ptr = new ptrType$18(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, eku))))) { return [sliceType$22.nil, sliceType$11.nil, errors.New("x509: invalid extended key usages")]; } _tuple = extKeyUsageFromOID(eku[0]); extKeyUsage = _tuple[0]; ok = _tuple[1]; if (ok) { extKeyUsages = $append(extKeyUsages, extKeyUsage); } else { unknownUsages = $append(unknownUsages, eku[0]); } } return [extKeyUsages, unknownUsages, $ifaceNil]; }; parseCertificatePoliciesExtension = function(der) { var cp, der, der$24ptr, oid, oids; oids = sliceType$11.nil; if (!(der$24ptr || (der$24ptr = new ptrType$23(function() { return der; }, function($v) { der = $convertSliceType($v, cryptobyte.String); }))).ReadASN1((der$24ptr || (der$24ptr = new ptrType$23(function() { return der; }, function($v) { der = $convertSliceType($v, cryptobyte.String); }))), 48)) { return [sliceType$11.nil, errors.New("x509: invalid certificate policies")]; } while (true) { if (!(!der.Empty())) { break; } cp = [cp]; oid = [oid]; cp[0] = cryptobyte.String.nil; if (!(der$24ptr || (der$24ptr = new ptrType$23(function() { return der; }, function($v) { der = $convertSliceType($v, cryptobyte.String); }))).ReadASN1((cp.$ptr || (cp.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, cp))), 48)) { return [sliceType$11.nil, errors.New("x509: invalid certificate policies")]; } oid[0] = asn1.ObjectIdentifier.nil; if (!(cp.$ptr || (cp.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, cp))).ReadASN1ObjectIdentifier((oid.$ptr || (oid.$ptr = new ptrType$18(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, oid))))) { return [sliceType$11.nil, errors.New("x509: invalid certificate policies")]; } oids = $append(oids, oid[0]); } return [oids, $ifaceNil]; }; isValidIPMask = function(mask) { var _1, _i, _ref, b, mask, seenZero; seenZero = false; _ref = mask; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } b = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (seenZero) { if (!((b === 0))) { return false; } _i++; continue; } _1 = b; if ((_1 === (0)) || (_1 === (128)) || (_1 === (192)) || (_1 === (224)) || (_1 === (240)) || (_1 === (248)) || (_1 === (252)) || (_1 === (254))) { seenZero = true; } else if (_1 === (255)) { } else { return false; } _i++; } return true; }; parseNameConstraintsExtension = function(out, e) { var _r, _r$1, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, e, err, excluded, getValues, haveExcluded, havePermitted, out, outer, outer$24ptr, permitted, toplevel, unhandled, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _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$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; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; e = $f.e; err = $f.err; excluded = $f.excluded; getValues = $f.getValues; haveExcluded = $f.haveExcluded; havePermitted = $f.havePermitted; out = $f.out; outer = $f.outer; outer$24ptr = $f.outer$24ptr; permitted = $f.permitted; toplevel = $f.toplevel; unhandled = $f.unhandled; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: excluded = [excluded]; haveExcluded = [haveExcluded]; havePermitted = [havePermitted]; permitted = [permitted]; toplevel = [toplevel]; unhandled = [unhandled]; unhandled[0] = false; err = $ifaceNil; outer = ($convertSliceType(e.Value, cryptobyte.String)); _tmp = cryptobyte.String.nil; _tmp$1 = cryptobyte.String.nil; _tmp$2 = cryptobyte.String.nil; toplevel[0] = _tmp; permitted[0] = _tmp$1; excluded[0] = _tmp$2; _tmp$3 = false; _tmp$4 = false; havePermitted[0] = _tmp$3; haveExcluded[0] = _tmp$4; if (!(outer$24ptr || (outer$24ptr = new ptrType$23(function() { return outer; }, function($v) { outer = $convertSliceType($v, cryptobyte.String); }))).ReadASN1((toplevel.$ptr || (toplevel.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, toplevel))), 48) || !outer.Empty() || !(toplevel.$ptr || (toplevel.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, toplevel))).ReadOptionalASN1((permitted.$ptr || (permitted.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, permitted))), (havePermitted.$ptr || (havePermitted.$ptr = new ptrType$6(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, havePermitted))), new asn1$1.Tag(new asn1$1.Tag(0).ContextSpecific()).Constructed()) || !(toplevel.$ptr || (toplevel.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, toplevel))).ReadOptionalASN1((excluded.$ptr || (excluded.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, excluded))), (haveExcluded.$ptr || (haveExcluded.$ptr = new ptrType$6(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, haveExcluded))), new asn1$1.Tag(new asn1$1.Tag(1).ContextSpecific()).Constructed()) || !toplevel[0].Empty()) { _tmp$5 = false; _tmp$6 = errors.New("x509: invalid NameConstraints extension"); unhandled[0] = _tmp$5; err = _tmp$6; $s = -1; return [unhandled[0], err]; } if (!havePermitted[0] && !haveExcluded[0] || (permitted[0].$length === 0) && (excluded[0].$length === 0)) { _tmp$7 = false; _tmp$8 = errors.New("x509: empty name constraints extension"); unhandled[0] = _tmp$7; err = _tmp$8; $s = -1; return [unhandled[0], err]; } getValues = (function(excluded, haveExcluded, havePermitted, permitted, toplevel, unhandled) { return function $b(subtrees) { var $24r, $24r$1, $24r$10, $24r$2, $24r$3, $24r$4, $24r$5, $24r$6, $24r$7, $24r$8, $24r$9, _1, _2, _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$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$18, _tmp$19, _tmp$20, _tmp$21, _tmp$22, _tmp$23, _tmp$24, _tmp$25, _tmp$26, _tmp$27, _tmp$28, _tmp$29, _tmp$30, _tmp$31, _tmp$32, _tmp$33, _tmp$34, _tmp$35, _tmp$36, _tmp$37, _tmp$38, _tmp$39, _tmp$40, _tmp$41, _tmp$42, _tmp$43, _tmp$44, _tmp$45, _tmp$46, _tmp$47, _tmp$48, _tmp$49, _tmp$50, _tmp$51, _tmp$52, _tmp$53, _tmp$54, _tmp$55, _tmp$56, _tmp$57, _tmp$58, _tmp$59, _tmp$60, _tmp$61, _tmp$62, _tmp$63, _tmp$64, _tmp$65, _tmp$66, _tmp$67, _tmp$68, _tmp$69, _tmp$70, _tmp$71, _tmp$72, _tmp$9, _tuple, _tuple$1, _tuple$2, _tuple$3, constraint, dnsNames, dnsTag, domain, domain$1, domain$2, emailTag, emails, err$1, err$2, err$3, err$4, ip, ipTag, ips, l, mask, ok, ok$1, ok$2, ok$3, seq, subtrees, subtrees$24ptr, tag, trimmedDomain, trimmedDomain$1, uriDomains, uriTag, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$10 = $f.$24r$10; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; $24r$6 = $f.$24r$6; $24r$7 = $f.$24r$7; $24r$8 = $f.$24r$8; $24r$9 = $f.$24r$9; _1 = $f._1; _2 = $f._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$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$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$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$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$40 = $f._tmp$40; _tmp$41 = $f._tmp$41; _tmp$42 = $f._tmp$42; _tmp$43 = $f._tmp$43; _tmp$44 = $f._tmp$44; _tmp$45 = $f._tmp$45; _tmp$46 = $f._tmp$46; _tmp$47 = $f._tmp$47; _tmp$48 = $f._tmp$48; _tmp$49 = $f._tmp$49; _tmp$50 = $f._tmp$50; _tmp$51 = $f._tmp$51; _tmp$52 = $f._tmp$52; _tmp$53 = $f._tmp$53; _tmp$54 = $f._tmp$54; _tmp$55 = $f._tmp$55; _tmp$56 = $f._tmp$56; _tmp$57 = $f._tmp$57; _tmp$58 = $f._tmp$58; _tmp$59 = $f._tmp$59; _tmp$60 = $f._tmp$60; _tmp$61 = $f._tmp$61; _tmp$62 = $f._tmp$62; _tmp$63 = $f._tmp$63; _tmp$64 = $f._tmp$64; _tmp$65 = $f._tmp$65; _tmp$66 = $f._tmp$66; _tmp$67 = $f._tmp$67; _tmp$68 = $f._tmp$68; _tmp$69 = $f._tmp$69; _tmp$70 = $f._tmp$70; _tmp$71 = $f._tmp$71; _tmp$72 = $f._tmp$72; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; constraint = $f.constraint; dnsNames = $f.dnsNames; dnsTag = $f.dnsTag; domain = $f.domain; domain$1 = $f.domain$1; domain$2 = $f.domain$2; emailTag = $f.emailTag; emails = $f.emails; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; err$4 = $f.err$4; ip = $f.ip; ipTag = $f.ipTag; ips = $f.ips; l = $f.l; mask = $f.mask; ok = $f.ok; ok$1 = $f.ok$1; ok$2 = $f.ok$2; ok$3 = $f.ok$3; seq = $f.seq; subtrees = $f.subtrees; subtrees$24ptr = $f.subtrees$24ptr; tag = $f.tag; trimmedDomain = $f.trimmedDomain; trimmedDomain$1 = $f.trimmedDomain$1; uriDomains = $f.uriDomains; uriTag = $f.uriTag; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: dnsNames = sliceType$4.nil; ips = sliceType$28.nil; emails = sliceType$4.nil; uriDomains = sliceType$4.nil; err$1 = $ifaceNil; /* while (true) { */ case 1: /* if (!(!subtrees.Empty())) { break; } */ if(!(!subtrees.Empty())) { $s = 2; continue; } seq = [seq]; tag = [tag]; value = [value]; _tmp$9 = cryptobyte.String.nil; _tmp$10 = cryptobyte.String.nil; seq[0] = _tmp$9; value[0] = _tmp$10; tag[0] = 0; /* */ if (!(subtrees$24ptr || (subtrees$24ptr = new ptrType$23(function() { return subtrees; }, function($v) { subtrees = $convertSliceType($v, cryptobyte.String); }))).ReadASN1((seq.$ptr || (seq.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, seq))), 48) || !(seq.$ptr || (seq.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, seq))).ReadAnyASN1((value.$ptr || (value.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, value))), (tag.$ptr || (tag.$ptr = new ptrType$24(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, tag))))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!(subtrees$24ptr || (subtrees$24ptr = new ptrType$23(function() { return subtrees; }, function($v) { subtrees = $convertSliceType($v, cryptobyte.String); }))).ReadASN1((seq.$ptr || (seq.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, seq))), 48) || !(seq.$ptr || (seq.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, seq))).ReadAnyASN1((value.$ptr || (value.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, value))), (tag.$ptr || (tag.$ptr = new ptrType$24(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, tag))))) { */ case 3: _tmp$11 = sliceType$4.nil; _tmp$12 = sliceType$28.nil; _tmp$13 = sliceType$4.nil; _tmp$14 = sliceType$4.nil; _r = fmt.Errorf("x509: invalid NameConstraints extension", new sliceType$6([])); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tmp$15 = _r; dnsNames = _tmp$11; ips = _tmp$12; emails = _tmp$13; uriDomains = _tmp$14; err$1 = _tmp$15; $24r = [dnsNames, ips, emails, uriDomains, err$1]; $s = 6; case 6: return $24r; /* } */ case 4: dnsTag = new asn1$1.Tag(2).ContextSpecific(); emailTag = new asn1$1.Tag(1).ContextSpecific(); ipTag = new asn1$1.Tag(7).ContextSpecific(); uriTag = new asn1$1.Tag(6).ContextSpecific(); _1 = tag[0]; /* */ if (_1 === (dnsTag)) { $s = 8; continue; } /* */ if (_1 === (ipTag)) { $s = 9; continue; } /* */ if (_1 === (emailTag)) { $s = 10; continue; } /* */ if (_1 === (uriTag)) { $s = 11; continue; } /* */ $s = 12; continue; /* if (_1 === (dnsTag)) { */ case 8: domain = ($bytesToString(value[0])); _r$1 = isIA5String(domain); /* */ $s = 14; case 14: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err$2 = _r$1; /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 15; continue; } /* */ $s = 16; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 15: _tmp$16 = sliceType$4.nil; _tmp$17 = sliceType$28.nil; _tmp$18 = sliceType$4.nil; _tmp$19 = sliceType$4.nil; _r$2 = err$2.Error(); /* */ $s = 17; case 17: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = errors.New("x509: invalid constraint value: " + _r$2); /* */ $s = 18; case 18: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tmp$20 = _r$3; dnsNames = _tmp$16; ips = _tmp$17; emails = _tmp$18; uriDomains = _tmp$19; err$1 = _tmp$20; $24r$1 = [dnsNames, ips, emails, uriDomains, err$1]; $s = 19; case 19: return $24r$1; /* } */ case 16: trimmedDomain = domain; if (trimmedDomain.length > 0 && (trimmedDomain.charCodeAt(0) === 46)) { trimmedDomain = $substring(trimmedDomain, 1); } _tuple = domainToReverseLabels(trimmedDomain); ok = _tuple[1]; /* */ if (!ok) { $s = 20; continue; } /* */ $s = 21; continue; /* if (!ok) { */ case 20: _tmp$21 = sliceType$4.nil; _tmp$22 = sliceType$28.nil; _tmp$23 = sliceType$4.nil; _tmp$24 = sliceType$4.nil; _r$4 = fmt.Errorf("x509: failed to parse dnsName constraint %q", new sliceType$6([new $String(domain)])); /* */ $s = 22; case 22: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tmp$25 = _r$4; dnsNames = _tmp$21; ips = _tmp$22; emails = _tmp$23; uriDomains = _tmp$24; err$1 = _tmp$25; $24r$2 = [dnsNames, ips, emails, uriDomains, err$1]; $s = 23; case 23: return $24r$2; /* } */ case 21: dnsNames = $append(dnsNames, domain); $s = 13; continue; /* } else if (_1 === (ipTag)) { */ case 9: l = value[0].$length; _tmp$26 = sliceType$1.nil; _tmp$27 = sliceType$1.nil; ip = _tmp$26; mask = _tmp$27; _2 = l; /* */ if (_2 === (8)) { $s = 25; continue; } /* */ if (_2 === (32)) { $s = 26; continue; } /* */ $s = 27; continue; /* if (_2 === (8)) { */ case 25: ip = $convertSliceType($subslice(value[0], 0, 4), sliceType$1); mask = $convertSliceType($subslice(value[0], 4), sliceType$1); $s = 28; continue; /* } else if (_2 === (32)) { */ case 26: ip = $convertSliceType($subslice(value[0], 0, 16), sliceType$1); mask = $convertSliceType($subslice(value[0], 16), sliceType$1); $s = 28; continue; /* } else { */ case 27: _tmp$28 = sliceType$4.nil; _tmp$29 = sliceType$28.nil; _tmp$30 = sliceType$4.nil; _tmp$31 = sliceType$4.nil; _r$5 = fmt.Errorf("x509: IP constraint contained value of length %d", new sliceType$6([new $Int(l)])); /* */ $s = 29; case 29: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tmp$32 = _r$5; dnsNames = _tmp$28; ips = _tmp$29; emails = _tmp$30; uriDomains = _tmp$31; err$1 = _tmp$32; $24r$3 = [dnsNames, ips, emails, uriDomains, err$1]; $s = 30; case 30: return $24r$3; /* } */ case 28: case 24: /* */ if (!isValidIPMask(mask)) { $s = 31; continue; } /* */ $s = 32; continue; /* if (!isValidIPMask(mask)) { */ case 31: _tmp$33 = sliceType$4.nil; _tmp$34 = sliceType$28.nil; _tmp$35 = sliceType$4.nil; _tmp$36 = sliceType$4.nil; _r$6 = fmt.Errorf("x509: IP constraint contained invalid mask %x", new sliceType$6([mask])); /* */ $s = 33; case 33: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tmp$37 = _r$6; dnsNames = _tmp$33; ips = _tmp$34; emails = _tmp$35; uriDomains = _tmp$36; err$1 = _tmp$37; $24r$4 = [dnsNames, ips, emails, uriDomains, err$1]; $s = 34; case 34: return $24r$4; /* } */ case 32: ips = $append(ips, new net.IPNet.ptr(($convertSliceType(ip, net.IP)), ($convertSliceType(mask, net.IPMask)))); $s = 13; continue; /* } else if (_1 === (emailTag)) { */ case 10: constraint = ($bytesToString(value[0])); _r$7 = isIA5String(constraint); /* */ $s = 35; case 35: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } err$3 = _r$7; /* */ if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = 36; continue; } /* */ $s = 37; continue; /* if (!($interfaceIsEqual(err$3, $ifaceNil))) { */ case 36: _tmp$38 = sliceType$4.nil; _tmp$39 = sliceType$28.nil; _tmp$40 = sliceType$4.nil; _tmp$41 = sliceType$4.nil; _r$8 = err$3.Error(); /* */ $s = 38; case 38: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$9 = errors.New("x509: invalid constraint value: " + _r$8); /* */ $s = 39; case 39: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tmp$42 = _r$9; dnsNames = _tmp$38; ips = _tmp$39; emails = _tmp$40; uriDomains = _tmp$41; err$1 = _tmp$42; $24r$5 = [dnsNames, ips, emails, uriDomains, err$1]; $s = 40; case 40: return $24r$5; /* } */ case 37: /* */ if (strings.Contains(constraint, "@")) { $s = 41; continue; } /* */ $s = 42; continue; /* if (strings.Contains(constraint, "@")) { */ case 41: _tuple$1 = parseRFC2821Mailbox(constraint); ok$1 = _tuple$1[1]; /* */ if (!ok$1) { $s = 44; continue; } /* */ $s = 45; continue; /* if (!ok$1) { */ case 44: _tmp$43 = sliceType$4.nil; _tmp$44 = sliceType$28.nil; _tmp$45 = sliceType$4.nil; _tmp$46 = sliceType$4.nil; _r$10 = fmt.Errorf("x509: failed to parse rfc822Name constraint %q", new sliceType$6([new $String(constraint)])); /* */ $s = 46; case 46: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tmp$47 = _r$10; dnsNames = _tmp$43; ips = _tmp$44; emails = _tmp$45; uriDomains = _tmp$46; err$1 = _tmp$47; $24r$6 = [dnsNames, ips, emails, uriDomains, err$1]; $s = 47; case 47: return $24r$6; /* } */ case 45: $s = 43; continue; /* } else { */ case 42: domain$1 = constraint; if (domain$1.length > 0 && (domain$1.charCodeAt(0) === 46)) { domain$1 = $substring(domain$1, 1); } _tuple$2 = domainToReverseLabels(domain$1); ok$2 = _tuple$2[1]; /* */ if (!ok$2) { $s = 48; continue; } /* */ $s = 49; continue; /* if (!ok$2) { */ case 48: _tmp$48 = sliceType$4.nil; _tmp$49 = sliceType$28.nil; _tmp$50 = sliceType$4.nil; _tmp$51 = sliceType$4.nil; _r$11 = fmt.Errorf("x509: failed to parse rfc822Name constraint %q", new sliceType$6([new $String(constraint)])); /* */ $s = 50; case 50: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tmp$52 = _r$11; dnsNames = _tmp$48; ips = _tmp$49; emails = _tmp$50; uriDomains = _tmp$51; err$1 = _tmp$52; $24r$7 = [dnsNames, ips, emails, uriDomains, err$1]; $s = 51; case 51: return $24r$7; /* } */ case 49: /* } */ case 43: emails = $append(emails, constraint); $s = 13; continue; /* } else if (_1 === (uriTag)) { */ case 11: domain$2 = ($bytesToString(value[0])); _r$12 = isIA5String(domain$2); /* */ $s = 52; case 52: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } err$4 = _r$12; /* */ if (!($interfaceIsEqual(err$4, $ifaceNil))) { $s = 53; continue; } /* */ $s = 54; continue; /* if (!($interfaceIsEqual(err$4, $ifaceNil))) { */ case 53: _tmp$53 = sliceType$4.nil; _tmp$54 = sliceType$28.nil; _tmp$55 = sliceType$4.nil; _tmp$56 = sliceType$4.nil; _r$13 = err$4.Error(); /* */ $s = 55; case 55: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _r$14 = errors.New("x509: invalid constraint value: " + _r$13); /* */ $s = 56; case 56: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _tmp$57 = _r$14; dnsNames = _tmp$53; ips = _tmp$54; emails = _tmp$55; uriDomains = _tmp$56; err$1 = _tmp$57; $24r$8 = [dnsNames, ips, emails, uriDomains, err$1]; $s = 57; case 57: return $24r$8; /* } */ case 54: /* */ if (!(net.ParseIP(domain$2) === net.IP.nil)) { $s = 58; continue; } /* */ $s = 59; continue; /* if (!(net.ParseIP(domain$2) === net.IP.nil)) { */ case 58: _tmp$58 = sliceType$4.nil; _tmp$59 = sliceType$28.nil; _tmp$60 = sliceType$4.nil; _tmp$61 = sliceType$4.nil; _r$15 = fmt.Errorf("x509: failed to parse URI constraint %q: cannot be IP address", new sliceType$6([new $String(domain$2)])); /* */ $s = 60; case 60: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _tmp$62 = _r$15; dnsNames = _tmp$58; ips = _tmp$59; emails = _tmp$60; uriDomains = _tmp$61; err$1 = _tmp$62; $24r$9 = [dnsNames, ips, emails, uriDomains, err$1]; $s = 61; case 61: return $24r$9; /* } */ case 59: trimmedDomain$1 = domain$2; if (trimmedDomain$1.length > 0 && (trimmedDomain$1.charCodeAt(0) === 46)) { trimmedDomain$1 = $substring(trimmedDomain$1, 1); } _tuple$3 = domainToReverseLabels(trimmedDomain$1); ok$3 = _tuple$3[1]; /* */ if (!ok$3) { $s = 62; continue; } /* */ $s = 63; continue; /* if (!ok$3) { */ case 62: _tmp$63 = sliceType$4.nil; _tmp$64 = sliceType$28.nil; _tmp$65 = sliceType$4.nil; _tmp$66 = sliceType$4.nil; _r$16 = fmt.Errorf("x509: failed to parse URI constraint %q", new sliceType$6([new $String(domain$2)])); /* */ $s = 64; case 64: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _tmp$67 = _r$16; dnsNames = _tmp$63; ips = _tmp$64; emails = _tmp$65; uriDomains = _tmp$66; err$1 = _tmp$67; $24r$10 = [dnsNames, ips, emails, uriDomains, err$1]; $s = 65; case 65: return $24r$10; /* } */ case 63: uriDomains = $append(uriDomains, domain$2); $s = 13; continue; /* } else { */ case 12: unhandled[0] = true; /* } */ case 13: case 7: $s = 1; continue; case 2: _tmp$68 = dnsNames; _tmp$69 = ips; _tmp$70 = emails; _tmp$71 = uriDomains; _tmp$72 = $ifaceNil; dnsNames = _tmp$68; ips = _tmp$69; emails = _tmp$70; uriDomains = _tmp$71; err$1 = _tmp$72; $s = -1; return [dnsNames, ips, emails, uriDomains, err$1]; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$10 = $24r$10; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f.$24r$6 = $24r$6; $f.$24r$7 = $24r$7; $f.$24r$8 = $24r$8; $f.$24r$9 = $24r$9; $f._1 = _1; $f._2 = _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$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$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$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$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$40 = _tmp$40; $f._tmp$41 = _tmp$41; $f._tmp$42 = _tmp$42; $f._tmp$43 = _tmp$43; $f._tmp$44 = _tmp$44; $f._tmp$45 = _tmp$45; $f._tmp$46 = _tmp$46; $f._tmp$47 = _tmp$47; $f._tmp$48 = _tmp$48; $f._tmp$49 = _tmp$49; $f._tmp$50 = _tmp$50; $f._tmp$51 = _tmp$51; $f._tmp$52 = _tmp$52; $f._tmp$53 = _tmp$53; $f._tmp$54 = _tmp$54; $f._tmp$55 = _tmp$55; $f._tmp$56 = _tmp$56; $f._tmp$57 = _tmp$57; $f._tmp$58 = _tmp$58; $f._tmp$59 = _tmp$59; $f._tmp$60 = _tmp$60; $f._tmp$61 = _tmp$61; $f._tmp$62 = _tmp$62; $f._tmp$63 = _tmp$63; $f._tmp$64 = _tmp$64; $f._tmp$65 = _tmp$65; $f._tmp$66 = _tmp$66; $f._tmp$67 = _tmp$67; $f._tmp$68 = _tmp$68; $f._tmp$69 = _tmp$69; $f._tmp$70 = _tmp$70; $f._tmp$71 = _tmp$71; $f._tmp$72 = _tmp$72; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.constraint = constraint; $f.dnsNames = dnsNames; $f.dnsTag = dnsTag; $f.domain = domain; $f.domain$1 = domain$1; $f.domain$2 = domain$2; $f.emailTag = emailTag; $f.emails = emails; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.err$4 = err$4; $f.ip = ip; $f.ipTag = ipTag; $f.ips = ips; $f.l = l; $f.mask = mask; $f.ok = ok; $f.ok$1 = ok$1; $f.ok$2 = ok$2; $f.ok$3 = ok$3; $f.seq = seq; $f.subtrees = subtrees; $f.subtrees$24ptr = subtrees$24ptr; $f.tag = tag; $f.trimmedDomain = trimmedDomain; $f.trimmedDomain$1 = trimmedDomain$1; $f.uriDomains = uriDomains; $f.uriTag = uriTag; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; })(excluded, haveExcluded, havePermitted, permitted, toplevel, unhandled); _r = getValues(permitted[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; out.PermittedDNSDomains = _tuple[0]; out.PermittedIPRanges = _tuple[1]; out.PermittedEmailAddresses = _tuple[2]; out.PermittedURIDomains = _tuple[3]; err = _tuple[4]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$9 = false; _tmp$10 = err; unhandled[0] = _tmp$9; err = _tmp$10; $s = -1; return [unhandled[0], err]; } _r$1 = getValues(excluded[0]); /* */ $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; out.ExcludedDNSDomains = _tuple$1[0]; out.ExcludedIPRanges = _tuple$1[1]; out.ExcludedEmailAddresses = _tuple$1[2]; out.ExcludedURIDomains = _tuple$1[3]; err = _tuple$1[4]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$11 = false; _tmp$12 = err; unhandled[0] = _tmp$11; err = _tmp$12; $s = -1; return [unhandled[0], err]; } out.PermittedDNSDomainsCritical = e.Critical; _tmp$13 = unhandled[0]; _tmp$14 = $ifaceNil; unhandled[0] = _tmp$13; err = _tmp$14; $s = -1; return [unhandled[0], err]; /* */ } return; } if ($f === undefined) { $f = { $blk: parseNameConstraintsExtension }; } $f._r = _r; $f._r$1 = _r$1; $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$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._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.e = e; $f.err = err; $f.excluded = excluded; $f.getValues = getValues; $f.haveExcluded = haveExcluded; $f.havePermitted = havePermitted; $f.out = out; $f.outer = outer; $f.outer$24ptr = outer$24ptr; $f.permitted = permitted; $f.toplevel = toplevel; $f.unhandled = unhandled; $f.$s = $s; $f.$r = $r; return $f; }; processExtensions = function(out) { var _1, _i, _r, _r$1, _r$2, _ref, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, aiaDER, akid, dpDER, dpNameDER, dpNamePresent, e, err, method, out, skid, unhandled, uri, val, val$1, val$2, val$24ptr, val$24ptr$1, val$3, 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; _1 = $f._1; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; _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; aiaDER = $f.aiaDER; akid = $f.akid; dpDER = $f.dpDER; dpNameDER = $f.dpNameDER; dpNamePresent = $f.dpNamePresent; e = $f.e; err = $f.err; method = $f.method; out = $f.out; skid = $f.skid; unhandled = $f.unhandled; uri = $f.uri; val = $f.val; val$1 = $f.val$1; val$2 = $f.val$2; val$24ptr = $f.val$24ptr; val$24ptr$1 = $f.val$24ptr$1; val$3 = $f.val$3; 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: err = $ifaceNil; _ref = out.Extensions; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } akid = [akid]; skid = [skid]; val = [val]; val$1 = [val$1]; e = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), pkix.Extension); unhandled = false; /* */ if ((e.Id.$length === 4) && ((x = e.Id, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])) === 2) && ((x$1 = e.Id, (1 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 1])) === 5) && ((x$2 = e.Id, (2 >= x$2.$length ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + 2])) === 29)) { $s = 3; continue; } /* */ if (e.Id.Equal($convertSliceType(oidExtensionAuthorityInfoAccess, asn1.ObjectIdentifier))) { $s = 4; continue; } /* */ $s = 5; continue; /* if ((e.Id.$length === 4) && ((x = e.Id, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])) === 2) && ((x$1 = e.Id, (1 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 1])) === 5) && ((x$2 = e.Id, (2 >= x$2.$length ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + 2])) === 29)) { */ case 3: _1 = (x$3 = e.Id, (3 >= x$3.$length ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + 3])); /* */ if (_1 === (15)) { $s = 8; continue; } /* */ if (_1 === (19)) { $s = 9; continue; } /* */ if (_1 === (17)) { $s = 10; continue; } /* */ if (_1 === (30)) { $s = 11; continue; } /* */ if (_1 === (31)) { $s = 12; continue; } /* */ if (_1 === (35)) { $s = 13; continue; } /* */ if (_1 === (37)) { $s = 14; continue; } /* */ if (_1 === (14)) { $s = 15; continue; } /* */ if (_1 === (32)) { $s = 16; continue; } /* */ $s = 17; continue; /* if (_1 === (15)) { */ case 8: _tuple = parseKeyUsageExtension($convertSliceType(e.Value, cryptobyte.String)); out.KeyUsage = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $s = 18; continue; /* } else if (_1 === (19)) { */ case 9: _r = parseBasicConstraintsExtension($convertSliceType(e.Value, cryptobyte.String)); /* */ $s = 19; case 19: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple$1 = _r; out.IsCA = _tuple$1[0]; out.MaxPathLen = _tuple$1[1]; err = _tuple$1[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } out.BasicConstraintsValid = true; out.MaxPathLenZero = out.MaxPathLen === 0; $s = 18; continue; /* } else if (_1 === (17)) { */ case 10: _r$1 = parseSANExtension($convertSliceType(e.Value, cryptobyte.String)); /* */ $s = 20; case 20: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$2 = _r$1; out.DNSNames = _tuple$2[0]; out.EmailAddresses = _tuple$2[1]; out.IPAddresses = _tuple$2[2]; out.URIs = _tuple$2[3]; err = _tuple$2[4]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } if ((out.DNSNames.$length === 0) && (out.EmailAddresses.$length === 0) && (out.IPAddresses.$length === 0) && (out.URIs.$length === 0)) { unhandled = true; } $s = 18; continue; /* } else if (_1 === (30)) { */ case 11: _r$2 = parseNameConstraintsExtension(out, $clone(e, pkix.Extension)); /* */ $s = 21; case 21: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$3 = _r$2; unhandled = _tuple$3[0]; err = _tuple$3[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $s = 18; continue; /* } else if (_1 === (31)) { */ case 12: val[0] = ($convertSliceType(e.Value, cryptobyte.String)); if (!(val.$ptr || (val.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, val))).ReadASN1((val.$ptr || (val.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, val))), 48)) { $s = -1; return errors.New("x509: invalid CRL distribution points"); } while (true) { if (!(!val[0].Empty())) { break; } dpDER = [dpDER]; dpNameDER = [dpNameDER]; dpNamePresent = [dpNamePresent]; dpDER[0] = cryptobyte.String.nil; if (!(val.$ptr || (val.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, val))).ReadASN1((dpDER.$ptr || (dpDER.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, dpDER))), 48)) { $s = -1; return errors.New("x509: invalid CRL distribution point"); } dpNameDER[0] = cryptobyte.String.nil; dpNamePresent[0] = false; if (!(dpDER.$ptr || (dpDER.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, dpDER))).ReadOptionalASN1((dpNameDER.$ptr || (dpNameDER.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, dpNameDER))), (dpNamePresent.$ptr || (dpNamePresent.$ptr = new ptrType$6(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, dpNamePresent))), new asn1$1.Tag(new asn1$1.Tag(0).Constructed()).ContextSpecific())) { $s = -1; return errors.New("x509: invalid CRL distribution point"); } if (!dpNamePresent[0]) { continue; } if (!(dpNameDER.$ptr || (dpNameDER.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, dpNameDER))).ReadASN1((dpNameDER.$ptr || (dpNameDER.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, dpNameDER))), new asn1$1.Tag(new asn1$1.Tag(0).Constructed()).ContextSpecific())) { $s = -1; return errors.New("x509: invalid CRL distribution point"); } while (true) { if (!(!dpNameDER[0].Empty())) { break; } uri = [uri]; if (!dpNameDER[0].PeekASN1Tag(new asn1$1.Tag(6).ContextSpecific())) { break; } uri[0] = cryptobyte.String.nil; if (!(dpNameDER.$ptr || (dpNameDER.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, dpNameDER))).ReadASN1((uri.$ptr || (uri.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, uri))), new asn1$1.Tag(6).ContextSpecific())) { $s = -1; return errors.New("x509: invalid CRL distribution point"); } out.CRLDistributionPoints = $append(out.CRLDistributionPoints, ($bytesToString(uri[0]))); } } $s = 18; continue; /* } else if (_1 === (35)) { */ case 13: val$2 = ($convertSliceType(e.Value, cryptobyte.String)); akid[0] = cryptobyte.String.nil; if (!(val$24ptr || (val$24ptr = new ptrType$23(function() { return val$2; }, function($v) { val$2 = $convertSliceType($v, cryptobyte.String); }))).ReadASN1((akid.$ptr || (akid.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, akid))), 48)) { $s = -1; return errors.New("x509: invalid authority key identifier"); } if (akid[0].PeekASN1Tag(new asn1$1.Tag(0).ContextSpecific())) { if (!(akid.$ptr || (akid.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, akid))).ReadASN1((akid.$ptr || (akid.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, akid))), new asn1$1.Tag(0).ContextSpecific())) { $s = -1; return errors.New("x509: invalid authority key identifier"); } out.AuthorityKeyId = $convertSliceType(akid[0], sliceType$1); } $s = 18; continue; /* } else if (_1 === (37)) { */ case 14: _tuple$4 = parseExtKeyUsageExtension($convertSliceType(e.Value, cryptobyte.String)); out.ExtKeyUsage = _tuple$4[0]; out.UnknownExtKeyUsage = _tuple$4[1]; err = _tuple$4[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $s = 18; continue; /* } else if (_1 === (14)) { */ case 15: val$3 = ($convertSliceType(e.Value, cryptobyte.String)); skid[0] = cryptobyte.String.nil; if (!(val$24ptr$1 || (val$24ptr$1 = new ptrType$23(function() { return val$3; }, function($v) { val$3 = $convertSliceType($v, cryptobyte.String); }))).ReadASN1((skid.$ptr || (skid.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, skid))), 4)) { $s = -1; return errors.New("x509: invalid subject key identifier"); } out.SubjectKeyId = $convertSliceType(skid[0], sliceType$1); $s = 18; continue; /* } else if (_1 === (32)) { */ case 16: _tuple$5 = parseCertificatePoliciesExtension($convertSliceType(e.Value, cryptobyte.String)); out.PolicyIdentifiers = _tuple$5[0]; err = _tuple$5[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $s = 18; continue; /* } else { */ case 17: unhandled = true; /* } */ case 18: case 7: $s = 6; continue; /* } else if (e.Id.Equal($convertSliceType(oidExtensionAuthorityInfoAccess, asn1.ObjectIdentifier))) { */ case 4: val$1[0] = ($convertSliceType(e.Value, cryptobyte.String)); if (!(val$1.$ptr || (val$1.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, val$1))).ReadASN1((val$1.$ptr || (val$1.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, val$1))), 48)) { $s = -1; return errors.New("x509: invalid authority info access"); } while (true) { if (!(!val$1[0].Empty())) { break; } aiaDER = [aiaDER]; method = [method]; aiaDER[0] = cryptobyte.String.nil; if (!(val$1.$ptr || (val$1.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, val$1))).ReadASN1((aiaDER.$ptr || (aiaDER.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, aiaDER))), 48)) { $s = -1; return errors.New("x509: invalid authority info access"); } method[0] = asn1.ObjectIdentifier.nil; if (!(aiaDER.$ptr || (aiaDER.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, aiaDER))).ReadASN1ObjectIdentifier((method.$ptr || (method.$ptr = new ptrType$18(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, method))))) { $s = -1; return errors.New("x509: invalid authority info access"); } if (!aiaDER[0].PeekASN1Tag(new asn1$1.Tag(6).ContextSpecific())) { continue; } if (!(aiaDER.$ptr || (aiaDER.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, aiaDER))).ReadASN1((aiaDER.$ptr || (aiaDER.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, aiaDER))), new asn1$1.Tag(6).ContextSpecific())) { $s = -1; return errors.New("x509: invalid authority info access"); } if (method[0].Equal(oidAuthorityInfoAccessOcsp)) { out.OCSPServer = $append(out.OCSPServer, ($bytesToString(aiaDER[0]))); } else if (method[0].Equal(oidAuthorityInfoAccessIssuers)) { out.IssuingCertificateURL = $append(out.IssuingCertificateURL, ($bytesToString(aiaDER[0]))); } } $s = 6; continue; /* } else { */ case 5: unhandled = true; /* } */ case 6: if (e.Critical && unhandled) { out.UnhandledCriticalExtensions = $append(out.UnhandledCriticalExtensions, e.Id); } _i++; $s = 1; continue; case 2: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: processExtensions }; } $f._1 = _1; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $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.aiaDER = aiaDER; $f.akid = akid; $f.dpDER = dpDER; $f.dpNameDER = dpNameDER; $f.dpNamePresent = dpNamePresent; $f.e = e; $f.err = err; $f.method = method; $f.out = out; $f.skid = skid; $f.unhandled = unhandled; $f.uri = uri; $f.val = val; $f.val$1 = val$1; $f.val$2 = val$2; $f.val$24ptr = val$24ptr; $f.val$24ptr$1 = val$24ptr$1; $f.val$3 = val$3; $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; }; parseCertificate = function(der) { var _r, _r$1, _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, cert, der, err, err$1, ext, extension, extensions, input, issuerRDNs, issuerSeq, outerSigAISeq, pkAI, pkAISeq, present, serial, sigAI, sigAISeq, signature, spk, spki, subjectRDNs, subjectSeq, tbs, validity$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; _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; cert = $f.cert; der = $f.der; err = $f.err; err$1 = $f.err$1; ext = $f.ext; extension = $f.extension; extensions = $f.extensions; input = $f.input; issuerRDNs = $f.issuerRDNs; issuerSeq = $f.issuerSeq; outerSigAISeq = $f.outerSigAISeq; pkAI = $f.pkAI; pkAISeq = $f.pkAISeq; present = $f.present; serial = $f.serial; sigAI = $f.sigAI; sigAISeq = $f.sigAISeq; signature = $f.signature; spk = $f.spk; spki = $f.spki; subjectRDNs = $f.subjectRDNs; subjectSeq = $f.subjectSeq; tbs = $f.tbs; validity$1 = $f.validity$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: extensions = [extensions]; input = [input]; issuerSeq = [issuerSeq]; outerSigAISeq = [outerSigAISeq]; pkAISeq = [pkAISeq]; present = [present]; sigAISeq = [sigAISeq]; signature = [signature]; spk = [spk]; spki = [spki]; subjectSeq = [subjectSeq]; tbs = [tbs]; validity$1 = [validity$1]; cert = new Certificate.ptr(sliceType$1.nil, sliceType$1.nil, sliceType$1.nil, sliceType$1.nil, sliceType$1.nil, sliceType$1.nil, 0, 0, $ifaceNil, 0, ptrType$1.nil, new pkix.Name.ptr(sliceType$4.nil, sliceType$4.nil, sliceType$4.nil, sliceType$4.nil, sliceType$4.nil, sliceType$4.nil, sliceType$4.nil, "", "", sliceType$15.nil, sliceType$15.nil), new pkix.Name.ptr(sliceType$4.nil, sliceType$4.nil, sliceType$4.nil, sliceType$4.nil, sliceType$4.nil, sliceType$4.nil, sliceType$4.nil, "", "", sliceType$15.nil, sliceType$15.nil), new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$7.nil), new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$7.nil), 0, sliceType$8.nil, sliceType$8.nil, sliceType$11.nil, sliceType$22.nil, sliceType$11.nil, false, false, 0, false, sliceType$1.nil, sliceType$1.nil, sliceType$4.nil, sliceType$4.nil, sliceType$4.nil, sliceType$4.nil, sliceType$18.nil, sliceType$19.nil, false, sliceType$4.nil, sliceType$4.nil, sliceType$28.nil, sliceType$28.nil, sliceType$4.nil, sliceType$4.nil, sliceType$4.nil, sliceType$4.nil, sliceType$4.nil, sliceType$11.nil); input[0] = ($convertSliceType(der, cryptobyte.String)); if (!(input.$ptr || (input.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, input))).ReadASN1Element((input.$ptr || (input.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, input))), 48)) { $s = -1; return [ptrType$4.nil, errors.New("x509: malformed certificate")]; } cert.Raw = $convertSliceType(input[0], sliceType$1); if (!(input.$ptr || (input.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, input))).ReadASN1((input.$ptr || (input.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, input))), 48)) { $s = -1; return [ptrType$4.nil, errors.New("x509: malformed certificate")]; } tbs[0] = cryptobyte.String.nil; if (!(input.$ptr || (input.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, input))).ReadASN1Element((tbs.$ptr || (tbs.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, tbs))), 48)) { $s = -1; return [ptrType$4.nil, errors.New("x509: malformed tbs certificate")]; } cert.RawTBSCertificate = $convertSliceType(tbs[0], sliceType$1); if (!(tbs.$ptr || (tbs.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, tbs))).ReadASN1((tbs.$ptr || (tbs.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, tbs))), 48)) { $s = -1; return [ptrType$4.nil, errors.New("x509: malformed tbs certificate")]; } _r = (tbs.$ptr || (tbs.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, tbs))).ReadOptionalASN1Integer((cert.$ptr_Version || (cert.$ptr_Version = new ptrType$16(function() { return this.$target.Version; }, function($v) { this.$target.Version = $v; }, cert))), new asn1$1.Tag(new asn1$1.Tag(0).Constructed()).ContextSpecific(), new $Int(0)); /* */ $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: $s = -1; return [ptrType$4.nil, errors.New("x509: malformed version")]; /* } */ case 2: if (cert.Version < 0) { $s = -1; return [ptrType$4.nil, errors.New("x509: malformed version")]; } cert.Version = cert.Version + (1) >> 0; if (cert.Version > 3) { $s = -1; return [ptrType$4.nil, errors.New("x509: invalid version")]; } serial = new big.Int.ptr(false, big.nat.nil); _r$1 = (tbs.$ptr || (tbs.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, tbs))).ReadASN1Integer(serial); /* */ $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) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!_r$1) { */ case 4: $s = -1; return [ptrType$4.nil, errors.New("x509: malformed serial number")]; /* } */ case 5: cert.SerialNumber = serial; sigAISeq[0] = cryptobyte.String.nil; if (!(tbs.$ptr || (tbs.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, tbs))).ReadASN1((sigAISeq.$ptr || (sigAISeq.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, sigAISeq))), 48)) { $s = -1; return [ptrType$4.nil, errors.New("x509: malformed signature algorithm identifier")]; } outerSigAISeq[0] = cryptobyte.String.nil; if (!(input.$ptr || (input.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, input))).ReadASN1((outerSigAISeq.$ptr || (outerSigAISeq.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, outerSigAISeq))), 48)) { $s = -1; return [ptrType$4.nil, errors.New("x509: malformed algorithm identifier")]; } if (!bytes.Equal($convertSliceType(outerSigAISeq[0], sliceType$1), $convertSliceType(sigAISeq[0], sliceType$1))) { $s = -1; return [ptrType$4.nil, errors.New("x509: inner and outer signature algorithm identifiers don't match")]; } _tuple = parseAI(sigAISeq[0]); sigAI = $clone(_tuple[0], pkix.AlgorithmIdentifier); err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$4.nil, err]; } _r$2 = getSignatureAlgorithmFromAI($clone(sigAI, pkix.AlgorithmIdentifier)); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } cert.SignatureAlgorithm = _r$2; issuerSeq[0] = cryptobyte.String.nil; if (!(tbs.$ptr || (tbs.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, tbs))).ReadASN1Element((issuerSeq.$ptr || (issuerSeq.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, issuerSeq))), 48)) { $s = -1; return [ptrType$4.nil, errors.New("x509: malformed issuer")]; } cert.RawIssuer = $convertSliceType(issuerSeq[0], sliceType$1); _r$3 = parseName(issuerSeq[0]); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$1 = _r$3; issuerRDNs = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$4.nil, err]; } cert.Issuer.FillFromRDNSequence(issuerRDNs); validity$1[0] = cryptobyte.String.nil; if (!(tbs.$ptr || (tbs.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, tbs))).ReadASN1((validity$1.$ptr || (validity$1.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, validity$1))), 48)) { $s = -1; return [ptrType$4.nil, errors.New("x509: malformed validity")]; } _r$4 = parseValidity(validity$1[0]); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$2 = _r$4; time.Time.copy(cert.NotBefore, _tuple$2[0]); time.Time.copy(cert.NotAfter, _tuple$2[1]); err = _tuple$2[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$4.nil, err]; } subjectSeq[0] = cryptobyte.String.nil; if (!(tbs.$ptr || (tbs.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, tbs))).ReadASN1Element((subjectSeq.$ptr || (subjectSeq.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, subjectSeq))), 48)) { $s = -1; return [ptrType$4.nil, errors.New("x509: malformed issuer")]; } cert.RawSubject = $convertSliceType(subjectSeq[0], sliceType$1); _r$5 = parseName(subjectSeq[0]); /* */ $s = 10; case 10: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$3 = _r$5; subjectRDNs = _tuple$3[0]; err = _tuple$3[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$4.nil, err]; } cert.Subject.FillFromRDNSequence(subjectRDNs); spki[0] = cryptobyte.String.nil; if (!(tbs.$ptr || (tbs.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, tbs))).ReadASN1Element((spki.$ptr || (spki.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, spki))), 48)) { $s = -1; return [ptrType$4.nil, errors.New("x509: malformed spki")]; } cert.RawSubjectPublicKeyInfo = $convertSliceType(spki[0], sliceType$1); if (!(spki.$ptr || (spki.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, spki))).ReadASN1((spki.$ptr || (spki.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, spki))), 48)) { $s = -1; return [ptrType$4.nil, errors.New("x509: malformed spki")]; } pkAISeq[0] = cryptobyte.String.nil; if (!(spki.$ptr || (spki.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, spki))).ReadASN1((pkAISeq.$ptr || (pkAISeq.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, pkAISeq))), 48)) { $s = -1; return [ptrType$4.nil, errors.New("x509: malformed public key algorithm identifier")]; } _tuple$4 = parseAI(pkAISeq[0]); pkAI = $clone(_tuple$4[0], pkix.AlgorithmIdentifier); err = _tuple$4[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$4.nil, err]; } cert.PublicKeyAlgorithm = getPublicKeyAlgorithmFromOID(pkAI.Algorithm); spk[0] = new asn1.BitString.ptr(sliceType$1.nil, 0); if (!(spki.$ptr || (spki.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, spki))).ReadASN1BitString(spk[0])) { $s = -1; return [ptrType$4.nil, errors.New("x509: malformed subjectPublicKey")]; } _r$6 = parsePublicKey(cert.PublicKeyAlgorithm, new publicKeyInfo.ptr(asn1.RawContent.nil, $clone(pkAI, pkix.AlgorithmIdentifier), $clone(spk[0], asn1.BitString))); /* */ $s = 11; case 11: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tuple$5 = _r$6; cert.PublicKey = _tuple$5[0]; err = _tuple$5[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$4.nil, err]; } /* */ if (cert.Version > 1) { $s = 12; continue; } /* */ $s = 13; continue; /* if (cert.Version > 1) { */ case 12: if (!(tbs.$ptr || (tbs.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, tbs))).SkipOptionalASN1(new asn1$1.Tag(new asn1$1.Tag(1).Constructed()).ContextSpecific())) { $s = -1; return [ptrType$4.nil, errors.New("x509: malformed issuerUniqueID")]; } if (!(tbs.$ptr || (tbs.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, tbs))).SkipOptionalASN1(new asn1$1.Tag(new asn1$1.Tag(2).Constructed()).ContextSpecific())) { $s = -1; return [ptrType$4.nil, errors.New("x509: malformed subjectUniqueID")]; } /* */ if (cert.Version === 3) { $s = 14; continue; } /* */ $s = 15; continue; /* if (cert.Version === 3) { */ case 14: extensions[0] = cryptobyte.String.nil; present[0] = false; if (!(tbs.$ptr || (tbs.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, tbs))).ReadOptionalASN1((extensions.$ptr || (extensions.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extensions))), (present.$ptr || (present.$ptr = new ptrType$6(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, present))), new asn1$1.Tag(new asn1$1.Tag(3).Constructed()).ContextSpecific())) { $s = -1; return [ptrType$4.nil, errors.New("x509: malformed extensions")]; } /* */ if (present[0]) { $s = 16; continue; } /* */ $s = 17; continue; /* if (present[0]) { */ case 16: if (!(extensions.$ptr || (extensions.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extensions))).ReadASN1((extensions.$ptr || (extensions.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extensions))), 48)) { $s = -1; return [ptrType$4.nil, errors.New("x509: malformed extensions")]; } while (true) { if (!(!extensions[0].Empty())) { break; } extension = [extension]; extension[0] = cryptobyte.String.nil; if (!(extensions.$ptr || (extensions.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extensions))).ReadASN1((extension.$ptr || (extension.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extension))), 48)) { $s = -1; return [ptrType$4.nil, errors.New("x509: malformed extension")]; } _tuple$6 = parseExtension(extension[0]); ext = $clone(_tuple$6[0], pkix.Extension); err$1 = _tuple$6[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [ptrType$4.nil, err$1]; } cert.Extensions = $append(cert.Extensions, ext); } _r$7 = processExtensions(cert); /* */ $s = 18; case 18: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } err = _r$7; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$4.nil, err]; } /* } */ case 17: /* } */ case 15: /* } */ case 13: signature[0] = new asn1.BitString.ptr(sliceType$1.nil, 0); if (!(input.$ptr || (input.$ptr = new ptrType$23(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, input))).ReadASN1BitString(signature[0])) { $s = -1; return [ptrType$4.nil, errors.New("x509: malformed signature")]; } cert.Signature = $clone(signature[0], asn1.BitString).RightAlign(); $s = -1; return [cert, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: parseCertificate }; } $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._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.cert = cert; $f.der = der; $f.err = err; $f.err$1 = err$1; $f.ext = ext; $f.extension = extension; $f.extensions = extensions; $f.input = input; $f.issuerRDNs = issuerRDNs; $f.issuerSeq = issuerSeq; $f.outerSigAISeq = outerSigAISeq; $f.pkAI = pkAI; $f.pkAISeq = pkAISeq; $f.present = present; $f.serial = serial; $f.sigAI = sigAI; $f.sigAISeq = sigAISeq; $f.signature = signature; $f.spk = spk; $f.spki = spki; $f.subjectRDNs = subjectRDNs; $f.subjectSeq = subjectSeq; $f.tbs = tbs; $f.validity$1 = validity$1; $f.$s = $s; $f.$r = $r; return $f; }; ParseCertificate = function(der) { var _r, _tuple, cert, der, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; cert = $f.cert; der = $f.der; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = parseCertificate(der); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; cert = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$4.nil, err]; } if (!((der.$length === cert.Raw.$length))) { $s = -1; return [ptrType$4.nil, errors.New("x509: trailing data")]; } $s = -1; return [cert, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: ParseCertificate }; } $f._r = _r; $f._tuple = _tuple; $f.cert = cert; $f.der = der; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.ParseCertificate = ParseCertificate; loadSystemRoots = function() { return [ptrType.nil, errors.New("crypto/x509: system root pool is not available in GopherJS")]; }; NewCertPool = function() { return new CertPool.ptr({}, sliceType$29.nil, {}); }; $pkg.NewCertPool = NewCertPool; CertPool.ptr.prototype.len = function() { var s; s = this; if (s === ptrType.nil) { return 0; } return s.lazyCerts.$length; }; CertPool.prototype.len = function() { return this.$val.len(); }; CertPool.ptr.prototype.cert = function(n) { var $24r, _r, n, s, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; n = $f.n; s = $f.s; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; _r = (x = s.lazyCerts, ((n < 0 || n >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + n])).getCert(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: CertPool.ptr.prototype.cert }; } $f.$24r = $24r; $f._r = _r; $f.n = n; $f.s = s; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; CertPool.prototype.cert = function(n) { return this.$val.cert(n); }; CertPool.ptr.prototype.findPotentialParents = function(cert) { var _entry, _i, _r, _ref, _tmp, _tmp$1, _tmp$2, _tuple, c, candidate, candidates, cert, err, found, kidMatch, matchingKeyID, mismatchKeyID, oneKeyID, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _i = $f._i; _r = $f._r; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tuple = $f._tuple; c = $f.c; candidate = $f.candidate; candidates = $f.candidates; cert = $f.cert; err = $f.err; found = $f.found; kidMatch = $f.kidMatch; matchingKeyID = $f.matchingKeyID; mismatchKeyID = $f.mismatchKeyID; oneKeyID = $f.oneKeyID; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; if (s === ptrType.nil) { $s = -1; return sliceType$20.nil; } _tmp = sliceType$20.nil; _tmp$1 = sliceType$20.nil; _tmp$2 = sliceType$20.nil; matchingKeyID = _tmp; oneKeyID = _tmp$1; mismatchKeyID = _tmp$2; _ref = (_entry = s.byName[$String.keyFor(($bytesToString(cert.RawIssuer)))], _entry !== undefined ? _entry.v : sliceType$3.nil); _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } c = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r = s.cert(c); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; candidate = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _i++; /* continue; */ $s = 1; continue; } kidMatch = bytes.Equal(candidate.SubjectKeyId, cert.AuthorityKeyId); if (kidMatch) { matchingKeyID = $append(matchingKeyID, candidate); } else if (((candidate.SubjectKeyId.$length === 0) && cert.AuthorityKeyId.$length > 0) || (candidate.SubjectKeyId.$length > 0 && (cert.AuthorityKeyId.$length === 0))) { oneKeyID = $append(oneKeyID, candidate); } else { mismatchKeyID = $append(mismatchKeyID, candidate); } _i++; $s = 1; continue; case 2: found = (matchingKeyID.$length + oneKeyID.$length >> 0) + mismatchKeyID.$length >> 0; if (found === 0) { $s = -1; return sliceType$20.nil; } candidates = $makeSlice(sliceType$20, 0, found); candidates = $appendSlice(candidates, matchingKeyID); candidates = $appendSlice(candidates, oneKeyID); candidates = $appendSlice(candidates, mismatchKeyID); $s = -1; return candidates; /* */ } return; } if ($f === undefined) { $f = { $blk: CertPool.ptr.prototype.findPotentialParents }; } $f._entry = _entry; $f._i = _i; $f._r = _r; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tuple = _tuple; $f.c = c; $f.candidate = candidate; $f.candidates = candidates; $f.cert = cert; $f.err = err; $f.found = found; $f.kidMatch = kidMatch; $f.matchingKeyID = matchingKeyID; $f.mismatchKeyID = mismatchKeyID; $f.oneKeyID = oneKeyID; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; CertPool.prototype.findPotentialParents = function(cert) { return this.$val.findPotentialParents(cert); }; CertPool.ptr.prototype.contains = function(cert) { var $24r, _entry, _r, cert, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _entry = $f._entry; _r = $f._r; cert = $f.cert; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; if (s === ptrType.nil) { $s = -1; return false; } _r = sha256.Sum224(cert.Raw); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = (_entry = s.haveSum[sum224.keyFor(_r)], _entry !== undefined ? _entry.v : false); $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: CertPool.ptr.prototype.contains }; } $f.$24r = $24r; $f._entry = _entry; $f._r = _r; $f.cert = cert; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; CertPool.prototype.contains = function(cert) { return this.$val.contains(cert); }; CertPool.ptr.prototype.AddCert = function(cert) { var _r, cert, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; cert = $f.cert; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cert = [cert]; s = this; if (cert[0] === ptrType$4.nil) { $panic(new $String("adding nil Certificate to CertPool")); } _r = sha256.Sum224(cert[0].Raw); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $r = s.addCertFunc($clone(_r, sum224), ($bytesToString(cert[0].RawSubject)), (function(cert) { return function() { return [cert[0], $ifaceNil]; }; })(cert)); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: CertPool.ptr.prototype.AddCert }; } $f._r = _r; $f.cert = cert; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; CertPool.prototype.AddCert = function(cert) { return this.$val.AddCert(cert); }; CertPool.ptr.prototype.addCertFunc = function(rawSum224, rawSubject, getCert) { var _entry, _entry$1, _key, _key$1, getCert, rawSubject, rawSum224, s; s = this; if (getCert === $throwNilPointerError) { $panic(new $String("getCert can't be nil")); } if ((_entry = s.haveSum[sum224.keyFor(rawSum224)], _entry !== undefined ? _entry.v : false)) { return; } _key = $clone(rawSum224, sum224); (s.haveSum || $throwRuntimeError("assignment to entry in nil map"))[sum224.keyFor(_key)] = { k: _key, v: true }; s.lazyCerts = $append(s.lazyCerts, new lazyCert.ptr((new sliceType$1($stringToBytes(rawSubject))), getCert)); _key$1 = rawSubject; (s.byName || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key$1)] = { k: _key$1, v: $append((_entry$1 = s.byName[$String.keyFor(rawSubject)], _entry$1 !== undefined ? _entry$1.v : sliceType$3.nil), s.lazyCerts.$length - 1 >> 0) }; }; CertPool.prototype.addCertFunc = function(rawSum224, rawSubject, getCert) { return this.$val.addCertFunc(rawSum224, rawSubject, getCert); }; CertPool.ptr.prototype.AppendCertsFromPEM = function(pemCerts) { var _r, _r$1, _r$2, _tuple, _tuple$1, block, cert, certBytes, err, lazyCert$1, ok, pemCerts, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; block = $f.block; cert = $f.cert; certBytes = $f.certBytes; err = $f.err; lazyCert$1 = $f.lazyCert$1; ok = $f.ok; pemCerts = $f.pemCerts; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ok = false; s = this; /* while (true) { */ case 1: /* if (!(pemCerts.$length > 0)) { break; } */ if(!(pemCerts.$length > 0)) { $s = 2; continue; } certBytes = [certBytes]; lazyCert$1 = [lazyCert$1]; block = ptrType$8.nil; _r = pem.Decode(pemCerts); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; block = _tuple[0]; pemCerts = _tuple[1]; if (block === ptrType$8.nil) { /* break; */ $s = 2; continue; } if (!(block.Type === "CERTIFICATE") || !(($keys(block.Headers).length === 0))) { /* continue; */ $s = 1; continue; } certBytes[0] = block.Bytes; _r$1 = ParseCertificate(certBytes[0]); /* */ $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; cert = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { /* continue; */ $s = 1; continue; } lazyCert$1[0] = new structType$3.ptr(new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)), ptrType$4.nil); _r$2 = sha256.Sum224(cert.Raw); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $r = s.addCertFunc($clone(_r$2, sum224), ($bytesToString(cert.RawSubject)), (function(certBytes, lazyCert$1) { return function $b() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = lazyCert$1[0].Once.Do((function(certBytes, lazyCert$1) { return function $b() { var _r$3, _tuple$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _tuple$2 = $f._tuple$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$3 = ParseCertificate(certBytes[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$2 = _r$3; lazyCert$1[0].v = _tuple$2[0]; certBytes[0] = sliceType$1.nil; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$3 = _r$3; $f._tuple$2 = _tuple$2; $f.$s = $s; $f.$r = $r; return $f; }; })(certBytes, lazyCert$1)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return [lazyCert$1[0].v, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$s = $s; $f.$r = $r; return $f; }; })(certBytes, lazyCert$1)); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } ok = true; $s = 1; continue; case 2: ok = ok; $s = -1; return ok; /* */ } return; } if ($f === undefined) { $f = { $blk: CertPool.ptr.prototype.AppendCertsFromPEM }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.block = block; $f.cert = cert; $f.certBytes = certBytes; $f.err = err; $f.lazyCert$1 = lazyCert$1; $f.ok = ok; $f.pemCerts = pemCerts; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; CertPool.prototype.AppendCertsFromPEM = function(pemCerts) { return this.$val.AppendCertsFromPEM(pemCerts); }; CertPool.ptr.prototype.Subjects = function() { var _i, _ref, i, lc, res, s; s = this; res = $makeSlice(sliceType$30, s.len()); _ref = s.lazyCerts; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; lc = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), lazyCert); ((i < 0 || i >= res.$length) ? ($throwRuntimeError("index out of range"), undefined) : res.$array[res.$offset + i] = lc.rawSubject); _i++; } return res; }; CertPool.prototype.Subjects = function() { return this.$val.Subjects(); }; SignatureAlgorithm.methods = [{prop: "isRSAPSS", name: "isRSAPSS", pkg: "crypto/x509", typ: $funcType([], [$Bool], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; PublicKeyAlgorithm.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$4.methods = [{prop: "Equal", name: "Equal", pkg: "", typ: $funcType([ptrType$4], [$Bool], false)}, {prop: "hasSANExtension", name: "hasSANExtension", pkg: "crypto/x509", typ: $funcType([], [$Bool], false)}, {prop: "CheckSignatureFrom", name: "CheckSignatureFrom", pkg: "", typ: $funcType([ptrType$4], [$error], false)}, {prop: "CheckSignature", name: "CheckSignature", pkg: "", typ: $funcType([SignatureAlgorithm, sliceType$1, sliceType$1], [$error], false)}, {prop: "hasNameConstraints", name: "hasNameConstraints", pkg: "crypto/x509", typ: $funcType([], [$Bool], false)}, {prop: "getSANExtension", name: "getSANExtension", pkg: "crypto/x509", typ: $funcType([], [sliceType$1], false)}, {prop: "CheckCRLSignature", name: "CheckCRLSignature", pkg: "", typ: $funcType([ptrType$9], [$error], false)}, {prop: "CreateCRL", name: "CreateCRL", pkg: "", typ: $funcType([io.Reader, $emptyInterface, sliceType$13, time.Time, time.Time], [sliceType$1, $error], false)}, {prop: "checkNameConstraints", name: "checkNameConstraints", pkg: "crypto/x509", typ: $funcType([ptrType$16, $Int, $String, $String, $emptyInterface, funcType, $emptyInterface, $emptyInterface], [$error], false)}, {prop: "isValid", name: "isValid", pkg: "crypto/x509", typ: $funcType([$Int, sliceType$20, ptrType$25], [$error], false)}, {prop: "Verify", name: "Verify", pkg: "", typ: $funcType([VerifyOptions], [sliceType$21, $error], false)}, {prop: "buildChains", name: "buildChains", pkg: "crypto/x509", typ: $funcType([mapType, sliceType$20, ptrType$16, ptrType$25], [sliceType$21, $error], false)}, {prop: "VerifyHostname", name: "VerifyHostname", pkg: "", typ: $funcType([$String], [$error], false)}, {prop: "systemVerify", name: "systemVerify", pkg: "crypto/x509", typ: $funcType([ptrType$25], [sliceType$21, $error], false)}]; InsecureAlgorithmError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; ConstraintViolationError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; UnhandledCriticalExtension.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; CertificateInvalidError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; HostnameError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; UnknownAuthorityError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; SystemRootsError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Unwrap", name: "Unwrap", pkg: "", typ: $funcType([], [$error], false)}]; ptrType.methods = [{prop: "len", name: "len", pkg: "crypto/x509", typ: $funcType([], [$Int], false)}, {prop: "cert", name: "cert", pkg: "crypto/x509", typ: $funcType([$Int], [ptrType$4, $error], false)}, {prop: "copy", name: "copy", pkg: "crypto/x509", typ: $funcType([], [ptrType], false)}, {prop: "findPotentialParents", name: "findPotentialParents", pkg: "crypto/x509", typ: $funcType([ptrType$4], [sliceType$20], false)}, {prop: "contains", name: "contains", pkg: "crypto/x509", typ: $funcType([ptrType$4], [$Bool], false)}, {prop: "AddCert", name: "AddCert", pkg: "", typ: $funcType([ptrType$4], [], false)}, {prop: "addCertFunc", name: "addCertFunc", pkg: "crypto/x509", typ: $funcType([sum224, $String, funcType$2], [], false)}, {prop: "AppendCertsFromPEM", name: "AppendCertsFromPEM", pkg: "", typ: $funcType([sliceType$1], [$Bool], false)}, {prop: "Subjects", name: "Subjects", pkg: "", typ: $funcType([], [sliceType$30], false)}]; publicKeyInfo.init("", [{prop: "Raw", name: "Raw", embedded: false, exported: true, typ: asn1.RawContent, tag: ""}, {prop: "Algorithm", name: "Algorithm", embedded: false, exported: true, typ: pkix.AlgorithmIdentifier, tag: ""}, {prop: "PublicKey", name: "PublicKey", embedded: false, exported: true, typ: asn1.BitString, tag: ""}]); authKeyId.init("", [{prop: "Id", name: "Id", embedded: false, exported: true, typ: sliceType$1, tag: "asn1:\"optional,tag:0\""}]); pssParameters.init("", [{prop: "Hash", name: "Hash", embedded: false, exported: true, typ: pkix.AlgorithmIdentifier, tag: "asn1:\"explicit,tag:0\""}, {prop: "MGF", name: "MGF", embedded: false, exported: true, typ: pkix.AlgorithmIdentifier, tag: "asn1:\"explicit,tag:1\""}, {prop: "SaltLength", name: "SaltLength", embedded: false, exported: true, typ: $Int, tag: "asn1:\"explicit,tag:2\""}, {prop: "TrailerField", name: "TrailerField", embedded: false, exported: true, typ: $Int, tag: "asn1:\"optional,explicit,tag:3,default:1\""}]); Certificate.init("", [{prop: "Raw", name: "Raw", embedded: false, exported: true, typ: sliceType$1, tag: ""}, {prop: "RawTBSCertificate", name: "RawTBSCertificate", embedded: false, exported: true, typ: sliceType$1, tag: ""}, {prop: "RawSubjectPublicKeyInfo", name: "RawSubjectPublicKeyInfo", embedded: false, exported: true, typ: sliceType$1, tag: ""}, {prop: "RawSubject", name: "RawSubject", embedded: false, exported: true, typ: sliceType$1, tag: ""}, {prop: "RawIssuer", name: "RawIssuer", embedded: false, exported: true, typ: sliceType$1, tag: ""}, {prop: "Signature", name: "Signature", embedded: false, exported: true, typ: sliceType$1, tag: ""}, {prop: "SignatureAlgorithm", name: "SignatureAlgorithm", embedded: false, exported: true, typ: SignatureAlgorithm, tag: ""}, {prop: "PublicKeyAlgorithm", name: "PublicKeyAlgorithm", embedded: false, exported: true, typ: PublicKeyAlgorithm, tag: ""}, {prop: "PublicKey", name: "PublicKey", embedded: false, exported: true, typ: $emptyInterface, tag: ""}, {prop: "Version", name: "Version", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "SerialNumber", name: "SerialNumber", embedded: false, exported: true, typ: ptrType$1, tag: ""}, {prop: "Issuer", name: "Issuer", embedded: false, exported: true, typ: pkix.Name, tag: ""}, {prop: "Subject", name: "Subject", embedded: false, exported: true, typ: pkix.Name, tag: ""}, {prop: "NotBefore", name: "NotBefore", embedded: false, exported: true, typ: time.Time, tag: ""}, {prop: "NotAfter", name: "NotAfter", embedded: false, exported: true, typ: time.Time, tag: ""}, {prop: "KeyUsage", name: "KeyUsage", embedded: false, exported: true, typ: KeyUsage, tag: ""}, {prop: "Extensions", name: "Extensions", embedded: false, exported: true, typ: sliceType$8, tag: ""}, {prop: "ExtraExtensions", name: "ExtraExtensions", embedded: false, exported: true, typ: sliceType$8, tag: ""}, {prop: "UnhandledCriticalExtensions", name: "UnhandledCriticalExtensions", embedded: false, exported: true, typ: sliceType$11, tag: ""}, {prop: "ExtKeyUsage", name: "ExtKeyUsage", embedded: false, exported: true, typ: sliceType$22, tag: ""}, {prop: "UnknownExtKeyUsage", name: "UnknownExtKeyUsage", embedded: false, exported: true, typ: sliceType$11, tag: ""}, {prop: "BasicConstraintsValid", name: "BasicConstraintsValid", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "IsCA", name: "IsCA", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "MaxPathLen", name: "MaxPathLen", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "MaxPathLenZero", name: "MaxPathLenZero", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "SubjectKeyId", name: "SubjectKeyId", embedded: false, exported: true, typ: sliceType$1, tag: ""}, {prop: "AuthorityKeyId", name: "AuthorityKeyId", embedded: false, exported: true, typ: sliceType$1, tag: ""}, {prop: "OCSPServer", name: "OCSPServer", embedded: false, exported: true, typ: sliceType$4, tag: ""}, {prop: "IssuingCertificateURL", name: "IssuingCertificateURL", embedded: false, exported: true, typ: sliceType$4, tag: ""}, {prop: "DNSNames", name: "DNSNames", embedded: false, exported: true, typ: sliceType$4, tag: ""}, {prop: "EmailAddresses", name: "EmailAddresses", embedded: false, exported: true, typ: sliceType$4, tag: ""}, {prop: "IPAddresses", name: "IPAddresses", embedded: false, exported: true, typ: sliceType$18, tag: ""}, {prop: "URIs", name: "URIs", embedded: false, exported: true, typ: sliceType$19, tag: ""}, {prop: "PermittedDNSDomainsCritical", name: "PermittedDNSDomainsCritical", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "PermittedDNSDomains", name: "PermittedDNSDomains", embedded: false, exported: true, typ: sliceType$4, tag: ""}, {prop: "ExcludedDNSDomains", name: "ExcludedDNSDomains", embedded: false, exported: true, typ: sliceType$4, tag: ""}, {prop: "PermittedIPRanges", name: "PermittedIPRanges", embedded: false, exported: true, typ: sliceType$28, tag: ""}, {prop: "ExcludedIPRanges", name: "ExcludedIPRanges", embedded: false, exported: true, typ: sliceType$28, tag: ""}, {prop: "PermittedEmailAddresses", name: "PermittedEmailAddresses", embedded: false, exported: true, typ: sliceType$4, tag: ""}, {prop: "ExcludedEmailAddresses", name: "ExcludedEmailAddresses", embedded: false, exported: true, typ: sliceType$4, tag: ""}, {prop: "PermittedURIDomains", name: "PermittedURIDomains", embedded: false, exported: true, typ: sliceType$4, tag: ""}, {prop: "ExcludedURIDomains", name: "ExcludedURIDomains", embedded: false, exported: true, typ: sliceType$4, tag: ""}, {prop: "CRLDistributionPoints", name: "CRLDistributionPoints", embedded: false, exported: true, typ: sliceType$4, tag: ""}, {prop: "PolicyIdentifiers", name: "PolicyIdentifiers", embedded: false, exported: true, typ: sliceType$11, tag: ""}]); ConstraintViolationError.init("", []); UnhandledCriticalExtension.init("", []); CertificateInvalidError.init("", [{prop: "Cert", name: "Cert", embedded: false, exported: true, typ: ptrType$4, tag: ""}, {prop: "Reason", name: "Reason", embedded: false, exported: true, typ: InvalidReason, tag: ""}, {prop: "Detail", name: "Detail", embedded: false, exported: true, typ: $String, tag: ""}]); HostnameError.init("", [{prop: "Certificate", name: "Certificate", embedded: false, exported: true, typ: ptrType$4, tag: ""}, {prop: "Host", name: "Host", embedded: false, exported: true, typ: $String, tag: ""}]); UnknownAuthorityError.init("crypto/x509", [{prop: "Cert", name: "Cert", embedded: false, exported: true, typ: ptrType$4, tag: ""}, {prop: "hintErr", name: "hintErr", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "hintCert", name: "hintCert", embedded: false, exported: false, typ: ptrType$4, tag: ""}]); SystemRootsError.init("", [{prop: "Err", name: "Err", embedded: false, exported: true, typ: $error, tag: ""}]); VerifyOptions.init("", [{prop: "DNSName", name: "DNSName", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Intermediates", name: "Intermediates", embedded: false, exported: true, typ: ptrType, tag: ""}, {prop: "Roots", name: "Roots", embedded: false, exported: true, typ: ptrType, tag: ""}, {prop: "CurrentTime", name: "CurrentTime", embedded: false, exported: true, typ: time.Time, tag: ""}, {prop: "KeyUsages", name: "KeyUsages", embedded: false, exported: true, typ: sliceType$22, tag: ""}, {prop: "MaxConstraintComparisions", name: "MaxConstraintComparisions", embedded: false, exported: true, typ: $Int, tag: ""}]); rfc2821Mailbox.init("crypto/x509", [{prop: "local", name: "local", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "domain", name: "domain", embedded: false, exported: false, typ: $String, tag: ""}]); ecPrivateKey.init("", [{prop: "Version", name: "Version", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "PrivateKey", name: "PrivateKey", embedded: false, exported: true, typ: sliceType$1, tag: ""}, {prop: "NamedCurveOID", name: "NamedCurveOID", embedded: false, exported: true, typ: asn1.ObjectIdentifier, tag: "asn1:\"optional,explicit,tag:0\""}, {prop: "PublicKey", name: "PublicKey", embedded: false, exported: true, typ: asn1.BitString, tag: "asn1:\"optional,explicit,tag:1\""}]); pkcs8.init("", [{prop: "Version", name: "Version", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Algo", name: "Algo", embedded: false, exported: true, typ: pkix.AlgorithmIdentifier, tag: ""}, {prop: "PrivateKey", name: "PrivateKey", embedded: false, exported: true, typ: sliceType$1, tag: ""}]); pkcs1PrivateKey.init("", [{prop: "Version", name: "Version", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "N", name: "N", embedded: false, exported: true, typ: ptrType$1, tag: ""}, {prop: "E", name: "E", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "D", name: "D", embedded: false, exported: true, typ: ptrType$1, tag: ""}, {prop: "P", name: "P", embedded: false, exported: true, typ: ptrType$1, tag: ""}, {prop: "Q", name: "Q", embedded: false, exported: true, typ: ptrType$1, tag: ""}, {prop: "Dp", name: "Dp", embedded: false, exported: true, typ: ptrType$1, tag: "asn1:\"optional\""}, {prop: "Dq", name: "Dq", embedded: false, exported: true, typ: ptrType$1, tag: "asn1:\"optional\""}, {prop: "Qinv", name: "Qinv", embedded: false, exported: true, typ: ptrType$1, tag: "asn1:\"optional\""}, {prop: "AdditionalPrimes", name: "AdditionalPrimes", embedded: false, exported: true, typ: sliceType$23, tag: "asn1:\"optional,omitempty\""}]); pkcs1AdditionalRSAPrime.init("", [{prop: "Prime", name: "Prime", embedded: false, exported: true, typ: ptrType$1, tag: ""}, {prop: "Exp", name: "Exp", embedded: false, exported: true, typ: ptrType$1, tag: ""}, {prop: "Coeff", name: "Coeff", embedded: false, exported: true, typ: ptrType$1, tag: ""}]); pkcs1PublicKey.init("", [{prop: "N", name: "N", embedded: false, exported: true, typ: ptrType$1, tag: ""}, {prop: "E", name: "E", embedded: false, exported: true, typ: $Int, tag: ""}]); sum224.init($Uint8, 28); CertPool.init("crypto/x509", [{prop: "byName", name: "byName", embedded: false, exported: false, typ: mapType$1, tag: ""}, {prop: "lazyCerts", name: "lazyCerts", embedded: false, exported: false, typ: sliceType$29, tag: ""}, {prop: "haveSum", name: "haveSum", embedded: false, exported: false, typ: mapType$2, tag: ""}]); lazyCert.init("crypto/x509", [{prop: "rawSubject", name: "rawSubject", embedded: false, exported: false, typ: sliceType$1, tag: ""}, {prop: "getCert", name: "getCert", embedded: false, exported: false, typ: funcType$2, 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 = crypto.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = aes.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = cipher.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = des.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = dsa.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = ecdsa.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = ed25519.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = elliptic.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = md5.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = rsa.$init(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sha1.$init(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sha256.$init(); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sha512.$init(); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = pkix.$init(); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = asn1.$init(); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = hex.$init(); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = pem.$init(); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = errors.$init(); /* */ $s = 19; case 19: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = fmt.$init(); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = io.$init(); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = fs.$init(); /* */ $s = 22; case 22: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = big.$init(); /* */ $s = 23; case 23: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = net.$init(); /* */ $s = 24; case 24: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = url.$init(); /* */ $s = 25; case 25: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = os.$init(); /* */ $s = 26; case 26: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = filepath.$init(); /* */ $s = 27; case 27: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = reflect.$init(); /* */ $s = 28; case 28: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = runtime.$init(); /* */ $s = 29; case 29: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strconv.$init(); /* */ $s = 30; case 30: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strings.$init(); /* */ $s = 31; case 31: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sync.$init(); /* */ $s = 32; case 32: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = time.$init(); /* */ $s = 33; case 33: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = unicode.$init(); /* */ $s = 34; case 34: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = utf16.$init(); /* */ $s = 35; case 35: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = utf8.$init(); /* */ $s = 36; case 36: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = cryptobyte.$init(); /* */ $s = 37; case 37: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = asn1$1.$init(); /* */ $s = 38; case 38: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } once = new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)); systemRoots = ptrType.nil; systemRootsErr = $ifaceNil; publicKeyAlgoName = $toNativeArray($kindString, ["", "RSA", "DSA", "ECDSA", "Ed25519"]); oidSignatureMD2WithRSA = new asn1.ObjectIdentifier([1, 2, 840, 113549, 1, 1, 2]); oidSignatureMD5WithRSA = new asn1.ObjectIdentifier([1, 2, 840, 113549, 1, 1, 4]); oidSignatureSHA1WithRSA = new asn1.ObjectIdentifier([1, 2, 840, 113549, 1, 1, 5]); oidSignatureSHA256WithRSA = new asn1.ObjectIdentifier([1, 2, 840, 113549, 1, 1, 11]); oidSignatureSHA384WithRSA = new asn1.ObjectIdentifier([1, 2, 840, 113549, 1, 1, 12]); oidSignatureSHA512WithRSA = new asn1.ObjectIdentifier([1, 2, 840, 113549, 1, 1, 13]); oidSignatureRSAPSS = new asn1.ObjectIdentifier([1, 2, 840, 113549, 1, 1, 10]); oidSignatureDSAWithSHA1 = new asn1.ObjectIdentifier([1, 2, 840, 10040, 4, 3]); oidSignatureDSAWithSHA256 = new asn1.ObjectIdentifier([2, 16, 840, 1, 101, 3, 4, 3, 2]); oidSignatureECDSAWithSHA1 = new asn1.ObjectIdentifier([1, 2, 840, 10045, 4, 1]); oidSignatureECDSAWithSHA256 = new asn1.ObjectIdentifier([1, 2, 840, 10045, 4, 3, 2]); oidSignatureECDSAWithSHA384 = new asn1.ObjectIdentifier([1, 2, 840, 10045, 4, 3, 3]); oidSignatureECDSAWithSHA512 = new asn1.ObjectIdentifier([1, 2, 840, 10045, 4, 3, 4]); oidSignatureEd25519 = new asn1.ObjectIdentifier([1, 3, 101, 112]); oidSHA256 = new asn1.ObjectIdentifier([2, 16, 840, 1, 101, 3, 4, 2, 1]); oidSHA384 = new asn1.ObjectIdentifier([2, 16, 840, 1, 101, 3, 4, 2, 2]); oidSHA512 = new asn1.ObjectIdentifier([2, 16, 840, 1, 101, 3, 4, 2, 3]); oidMGF1 = new asn1.ObjectIdentifier([1, 2, 840, 113549, 1, 1, 8]); oidISOSignatureSHA1WithRSA = new asn1.ObjectIdentifier([1, 3, 14, 3, 2, 29]); signatureAlgorithmDetails = new sliceType([new structType.ptr(1, "MD2-RSA", oidSignatureMD2WithRSA, 1, 0), new structType.ptr(2, "MD5-RSA", oidSignatureMD5WithRSA, 1, 2), new structType.ptr(3, "SHA1-RSA", oidSignatureSHA1WithRSA, 1, 3), new structType.ptr(3, "SHA1-RSA", oidISOSignatureSHA1WithRSA, 1, 3), new structType.ptr(4, "SHA256-RSA", oidSignatureSHA256WithRSA, 1, 5), new structType.ptr(5, "SHA384-RSA", oidSignatureSHA384WithRSA, 1, 6), new structType.ptr(6, "SHA512-RSA", oidSignatureSHA512WithRSA, 1, 7), new structType.ptr(13, "SHA256-RSAPSS", oidSignatureRSAPSS, 1, 5), new structType.ptr(14, "SHA384-RSAPSS", oidSignatureRSAPSS, 1, 6), new structType.ptr(15, "SHA512-RSAPSS", oidSignatureRSAPSS, 1, 7), new structType.ptr(7, "DSA-SHA1", oidSignatureDSAWithSHA1, 2, 3), new structType.ptr(8, "DSA-SHA256", oidSignatureDSAWithSHA256, 2, 5), new structType.ptr(9, "ECDSA-SHA1", oidSignatureECDSAWithSHA1, 3, 3), new structType.ptr(10, "ECDSA-SHA256", oidSignatureECDSAWithSHA256, 3, 5), new structType.ptr(11, "ECDSA-SHA384", oidSignatureECDSAWithSHA384, 3, 6), new structType.ptr(12, "ECDSA-SHA512", oidSignatureECDSAWithSHA512, 3, 7), new structType.ptr(16, "Ed25519", oidSignatureEd25519, 4, 0)]); hashToPSSParameters = $makeMap(crypto.Hash.keyFor, [{ k: 5, v: new asn1.RawValue.ptr(0, 0, false, sliceType$1.nil, new sliceType$1([48, 52, 160, 15, 48, 13, 6, 9, 96, 134, 72, 1, 101, 3, 4, 2, 1, 5, 0, 161, 28, 48, 26, 6, 9, 42, 134, 72, 134, 247, 13, 1, 1, 8, 48, 13, 6, 9, 96, 134, 72, 1, 101, 3, 4, 2, 1, 5, 0, 162, 3, 2, 1, 32])) }, { k: 6, v: new asn1.RawValue.ptr(0, 0, false, sliceType$1.nil, new sliceType$1([48, 52, 160, 15, 48, 13, 6, 9, 96, 134, 72, 1, 101, 3, 4, 2, 2, 5, 0, 161, 28, 48, 26, 6, 9, 42, 134, 72, 134, 247, 13, 1, 1, 8, 48, 13, 6, 9, 96, 134, 72, 1, 101, 3, 4, 2, 2, 5, 0, 162, 3, 2, 1, 48])) }, { k: 7, v: new asn1.RawValue.ptr(0, 0, false, sliceType$1.nil, new sliceType$1([48, 52, 160, 15, 48, 13, 6, 9, 96, 134, 72, 1, 101, 3, 4, 2, 3, 5, 0, 161, 28, 48, 26, 6, 9, 42, 134, 72, 134, 247, 13, 1, 1, 8, 48, 13, 6, 9, 96, 134, 72, 1, 101, 3, 4, 2, 3, 5, 0, 162, 3, 2, 1, 64])) }]); oidPublicKeyRSA = new asn1.ObjectIdentifier([1, 2, 840, 113549, 1, 1, 1]); oidPublicKeyDSA = new asn1.ObjectIdentifier([1, 2, 840, 10040, 4, 1]); oidPublicKeyECDSA = new asn1.ObjectIdentifier([1, 2, 840, 10045, 2, 1]); oidPublicKeyEd25519 = oidSignatureEd25519; oidNamedCurveP224 = new asn1.ObjectIdentifier([1, 3, 132, 0, 33]); oidNamedCurveP256 = new asn1.ObjectIdentifier([1, 2, 840, 10045, 3, 1, 7]); oidNamedCurveP384 = new asn1.ObjectIdentifier([1, 3, 132, 0, 34]); oidNamedCurveP521 = new asn1.ObjectIdentifier([1, 3, 132, 0, 35]); oidExtKeyUsageAny = new asn1.ObjectIdentifier([2, 5, 29, 37, 0]); oidExtKeyUsageServerAuth = new asn1.ObjectIdentifier([1, 3, 6, 1, 5, 5, 7, 3, 1]); oidExtKeyUsageClientAuth = new asn1.ObjectIdentifier([1, 3, 6, 1, 5, 5, 7, 3, 2]); oidExtKeyUsageCodeSigning = new asn1.ObjectIdentifier([1, 3, 6, 1, 5, 5, 7, 3, 3]); oidExtKeyUsageEmailProtection = new asn1.ObjectIdentifier([1, 3, 6, 1, 5, 5, 7, 3, 4]); oidExtKeyUsageIPSECEndSystem = new asn1.ObjectIdentifier([1, 3, 6, 1, 5, 5, 7, 3, 5]); oidExtKeyUsageIPSECTunnel = new asn1.ObjectIdentifier([1, 3, 6, 1, 5, 5, 7, 3, 6]); oidExtKeyUsageIPSECUser = new asn1.ObjectIdentifier([1, 3, 6, 1, 5, 5, 7, 3, 7]); oidExtKeyUsageTimeStamping = new asn1.ObjectIdentifier([1, 3, 6, 1, 5, 5, 7, 3, 8]); oidExtKeyUsageOCSPSigning = new asn1.ObjectIdentifier([1, 3, 6, 1, 5, 5, 7, 3, 9]); oidExtKeyUsageMicrosoftServerGatedCrypto = new asn1.ObjectIdentifier([1, 3, 6, 1, 4, 1, 311, 10, 3, 3]); oidExtKeyUsageNetscapeServerGatedCrypto = new asn1.ObjectIdentifier([2, 16, 840, 1, 113730, 4, 1]); oidExtKeyUsageMicrosoftCommercialCodeSigning = new asn1.ObjectIdentifier([1, 3, 6, 1, 4, 1, 311, 2, 1, 22]); oidExtKeyUsageMicrosoftKernelCodeSigning = new asn1.ObjectIdentifier([1, 3, 6, 1, 4, 1, 311, 61, 1, 1]); extKeyUsageOIDs = new sliceType$2([new structType$1.ptr(0, oidExtKeyUsageAny), new structType$1.ptr(1, oidExtKeyUsageServerAuth), new structType$1.ptr(2, oidExtKeyUsageClientAuth), new structType$1.ptr(3, oidExtKeyUsageCodeSigning), new structType$1.ptr(4, oidExtKeyUsageEmailProtection), new structType$1.ptr(5, oidExtKeyUsageIPSECEndSystem), new structType$1.ptr(6, oidExtKeyUsageIPSECTunnel), new structType$1.ptr(7, oidExtKeyUsageIPSECUser), new structType$1.ptr(8, oidExtKeyUsageTimeStamping), new structType$1.ptr(9, oidExtKeyUsageOCSPSigning), new structType$1.ptr(10, oidExtKeyUsageMicrosoftServerGatedCrypto), new structType$1.ptr(11, oidExtKeyUsageNetscapeServerGatedCrypto), new structType$1.ptr(12, oidExtKeyUsageMicrosoftCommercialCodeSigning), new structType$1.ptr(13, oidExtKeyUsageMicrosoftKernelCodeSigning)]); $pkg.ErrUnsupportedAlgorithm = errors.New("x509: cannot verify signature: algorithm unimplemented"); oidExtensionAuthorityKeyId = new sliceType$3([2, 5, 29, 35]); oidExtensionSubjectAltName = new sliceType$3([2, 5, 29, 17]); oidExtensionNameConstraints = new sliceType$3([2, 5, 29, 30]); oidExtensionAuthorityInfoAccess = new sliceType$3([1, 3, 6, 1, 5, 5, 7, 1, 1]); oidAuthorityInfoAccessOcsp = new asn1.ObjectIdentifier([1, 3, 6, 1, 5, 5, 7, 48, 1]); oidAuthorityInfoAccessIssuers = new asn1.ObjectIdentifier([1, 3, 6, 1, 5, 5, 7, 48, 2]); errNotParsed = errors.New("x509: missing ASN.1 contents; use ParseCertificate"); $pkg.IncorrectPasswordError = errors.New("x509: decryption password incorrect"); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["vendor/golang.org/x/crypto/internal/subtle"] = (function() { var $pkg = {}, $init, reflect, ptrType, AnyOverlap, InexactOverlap; reflect = $packages["reflect"]; ptrType = $ptrType($Uint8); AnyOverlap = function(x, y) { var $24r, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _v, _v$1, x, y, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; _v = $f._v; _v$1 = $f._v$1; x = $f.x; y = $f.y; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (!(x.$length > 0 && y.$length > 0)) { _v$1 = false; $s = 2; continue s; } _r = reflect.ValueOf($indexPtr(x.$array, x.$offset + 0, ptrType)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = $clone(_r, reflect.Value).Pointer(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = reflect.ValueOf($indexPtr(y.$array, y.$offset + (y.$length - 1 >> 0), ptrType)); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = $clone(_r$2, reflect.Value).Pointer(); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _v$1 = _r$1 <= _r$3; case 2: if (!(_v$1)) { _v = false; $s = 1; continue s; } _r$4 = reflect.ValueOf($indexPtr(y.$array, y.$offset + 0, ptrType)); /* */ $s = 7; case 7: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = $clone(_r$4, reflect.Value).Pointer(); /* */ $s = 8; case 8: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$6 = reflect.ValueOf($indexPtr(x.$array, x.$offset + (x.$length - 1 >> 0), ptrType)); /* */ $s = 9; case 9: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$7 = $clone(_r$6, reflect.Value).Pointer(); /* */ $s = 10; case 10: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _v = _r$5 <= _r$7; case 1: $24r = _v; $s = 11; case 11: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: AnyOverlap }; } $f.$24r = $24r; $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._v = _v; $f._v$1 = _v$1; $f.x = x; $f.y = y; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.AnyOverlap = AnyOverlap; InexactOverlap = function(x, y) { var $24r, _r, x, y, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; x = $f.x; y = $f.y; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if ((x.$length === 0) || (y.$length === 0) || $indexPtr(x.$array, x.$offset + 0, ptrType) === $indexPtr(y.$array, y.$offset + 0, ptrType)) { $s = -1; return false; } _r = AnyOverlap(x, y); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: InexactOverlap }; } $f.$24r = $24r; $f._r = _r; $f.x = x; $f.y = y; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.InexactOverlap = InexactOverlap; $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 = reflect.$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["vendor/golang.org/x/crypto/chacha20"] = (function() { var $pkg = {}, $init, cipher, binary, errors, bits, runtime, subtle, Cipher, ptrType, arrayType, arrayType$1, arrayType$2, sliceType, addXor, NewUnauthenticatedCipher, newUnauthenticatedCipher, quarterRound, HChaCha20, hChaCha20; cipher = $packages["crypto/cipher"]; binary = $packages["encoding/binary"]; errors = $packages["errors"]; bits = $packages["math/bits"]; runtime = $packages["runtime"]; subtle = $packages["vendor/golang.org/x/crypto/internal/subtle"]; Cipher = $pkg.Cipher = $newType(0, $kindStruct, "chacha20.Cipher", true, "vendor/golang.org/x/crypto/chacha20", true, function(key_, counter_, nonce_, buf_, len_, overflow_, precompDone_, p1_, p5_, p9_, p13_, p2_, p6_, p10_, p14_, p3_, p7_, p11_, p15_) { this.$val = this; if (arguments.length === 0) { this.key = arrayType.zero(); this.counter = 0; this.nonce = arrayType$1.zero(); this.buf = arrayType$2.zero(); this.len = 0; this.overflow = false; this.precompDone = false; this.p1 = 0; this.p5 = 0; this.p9 = 0; this.p13 = 0; this.p2 = 0; this.p6 = 0; this.p10 = 0; this.p14 = 0; this.p3 = 0; this.p7 = 0; this.p11 = 0; this.p15 = 0; return; } this.key = key_; this.counter = counter_; this.nonce = nonce_; this.buf = buf_; this.len = len_; this.overflow = overflow_; this.precompDone = precompDone_; this.p1 = p1_; this.p5 = p5_; this.p9 = p9_; this.p13 = p13_; this.p2 = p2_; this.p6 = p6_; this.p10 = p10_; this.p14 = p14_; this.p3 = p3_; this.p7 = p7_; this.p11 = p11_; this.p15 = p15_; }); ptrType = $ptrType(Cipher); arrayType = $arrayType($Uint32, 8); arrayType$1 = $arrayType($Uint32, 3); arrayType$2 = $arrayType($Uint8, 64); sliceType = $sliceType($Uint8); addXor = function(dst, src, a, b) { var _tmp, _tmp$1, a, b, dst, src, v; $unused((3 >= src.$length ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + 3])); $unused((3 >= dst.$length ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + 3])); if (false) { v = (((0 >= src.$length ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + 0]) >>> 0)); v = (v | (((((1 >= src.$length ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + 1]) >>> 0)) << 8 >>> 0))) >>> 0; v = (v | (((((2 >= src.$length ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + 2]) >>> 0)) << 16 >>> 0))) >>> 0; v = (v | (((((3 >= src.$length ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + 3]) >>> 0)) << 24 >>> 0))) >>> 0; v = (v ^ ((a + b >>> 0))) >>> 0; (0 >= dst.$length ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + 0] = ((v << 24 >>> 24))); (1 >= dst.$length ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + 1] = (((v >>> 8 >>> 0) << 24 >>> 24))); (2 >= dst.$length ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + 2] = (((v >>> 16 >>> 0) << 24 >>> 24))); (3 >= dst.$length ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + 3] = (((v >>> 24 >>> 0) << 24 >>> 24))); } else { a = a + (b) >>> 0; (0 >= dst.$length ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + 0] = (((0 >= src.$length ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + 0]) ^ ((a << 24 >>> 24))) << 24 >>> 24)); (1 >= dst.$length ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + 1] = (((1 >= src.$length ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + 1]) ^ (((a >>> 8 >>> 0) << 24 >>> 24))) << 24 >>> 24)); (2 >= dst.$length ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + 2] = (((2 >= src.$length ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + 2]) ^ (((a >>> 16 >>> 0) << 24 >>> 24))) << 24 >>> 24)); (3 >= dst.$length ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + 3] = (((3 >= src.$length ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + 3]) ^ (((a >>> 24 >>> 0) << 24 >>> 24))) << 24 >>> 24)); } }; Cipher.ptr.prototype.xorKeyStreamBlocks = function(dst, src) { var dst, s, src; s = this; s.xorKeyStreamBlocksGeneric(dst, src); }; Cipher.prototype.xorKeyStreamBlocks = function(dst, src) { return this.$val.xorKeyStreamBlocks(dst, src); }; NewUnauthenticatedCipher = function(key, nonce) { var c, key, nonce; c = new Cipher.ptr(arrayType.zero(), 0, arrayType$1.zero(), arrayType$2.zero(), 0, false, false, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); return newUnauthenticatedCipher(c, key, nonce); }; $pkg.NewUnauthenticatedCipher = NewUnauthenticatedCipher; newUnauthenticatedCipher = function(c, key, nonce) { var _tmp, _tmp$1, _tuple, c, cNonce, key, nonce; if (!((key.$length === 32))) { return [ptrType.nil, errors.New("chacha20: wrong key size")]; } if (nonce.$length === 24) { _tuple = HChaCha20(key, $subslice(nonce, 0, 16)); key = _tuple[0]; cNonce = $makeSlice(sliceType, 12); $copySlice($subslice(cNonce, 4, 12), $subslice(nonce, 16, 24)); nonce = cNonce; } else if (!((nonce.$length === 12))) { return [ptrType.nil, errors.New("chacha20: wrong nonce size")]; } _tmp = $subslice(key, 0, 32); _tmp$1 = $subslice(nonce, 0, 12); key = _tmp; nonce = _tmp$1; arrayType.copy(c.key, $toNativeArray($kindUint32, [$clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(key, 0, 4)), $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(key, 4, 8)), $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(key, 8, 12)), $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(key, 12, 16)), $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(key, 16, 20)), $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(key, 20, 24)), $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(key, 24, 28)), $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(key, 28, 32))])); arrayType$1.copy(c.nonce, $toNativeArray($kindUint32, [$clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(nonce, 0, 4)), $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(nonce, 4, 8)), $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(nonce, 8, 12))])); return [c, $ifaceNil]; }; quarterRound = function(a, b, c, d) { var a, b, c, d; a = a + (b) >>> 0; d = (d ^ (a)) >>> 0; d = bits.RotateLeft32(d, 16); c = c + (d) >>> 0; b = (b ^ (c)) >>> 0; b = bits.RotateLeft32(b, 12); a = a + (b) >>> 0; d = (d ^ (a)) >>> 0; d = bits.RotateLeft32(d, 8); c = c + (d) >>> 0; b = (b ^ (c)) >>> 0; b = bits.RotateLeft32(b, 7); return [a, b, c, d]; }; Cipher.ptr.prototype.SetCounter = function(counter) { var _q, counter, outputCounter, s; s = this; outputCounter = s.counter - (_q = ((s.len >>> 0)) / 64, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")) >>> 0; if (s.overflow || counter < outputCounter) { $panic(new $String("chacha20: SetCounter attempted to rollback counter")); } if (counter < s.counter) { s.len = $imul((((s.counter - counter >>> 0) >> 0)), 64); } else { s.counter = counter; s.len = 0; } }; Cipher.prototype.SetCounter = function(counter) { return this.$val.SetCounter(counter); }; Cipher.ptr.prototype.XORKeyStream = function(dst, src) { var _i, _q, _r, _r$1, _ref, _tmp, _tmp$1, _tmp$2, _tmp$3, b, buf, dst, full, i, keyStream, numBlocks, numBlocks$1, s, src, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _q = $f._q; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; b = $f.b; buf = $f.buf; dst = $f.dst; full = $f.full; i = $f.i; keyStream = $f.keyStream; numBlocks = $f.numBlocks; numBlocks$1 = $f.numBlocks$1; s = $f.s; src = $f.src; 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; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; if (src.$length === 0) { $s = -1; return; } if (dst.$length < src.$length) { $panic(new $String("chacha20: output smaller than input")); } dst = $subslice(dst, 0, src.$length); _r = subtle.InexactOverlap(dst, src); /* */ $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: $panic(new $String("chacha20: invalid buffer overlap")); /* } */ case 2: if (!((s.len === 0))) { keyStream = $subslice(new sliceType(s.buf), (64 - s.len >> 0)); if (src.$length < keyStream.$length) { keyStream = $subslice(keyStream, 0, src.$length); } $unused((x = keyStream.$length - 1 >> 0, ((x < 0 || x >= src.$length) ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + x]))); _ref = keyStream; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; b = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); ((i < 0 || i >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + i] = ((((i < 0 || i >= src.$length) ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + i]) ^ b) << 24 >>> 24)); _i++; } s.len = s.len - (keyStream.$length) >> 0; _tmp = $subslice(dst, keyStream.$length); _tmp$1 = $subslice(src, keyStream.$length); dst = _tmp; src = _tmp$1; } if (src.$length === 0) { $s = -1; return; } numBlocks = $div64(((x$1 = (x$2 = (new $Uint64(0, src.$length)), new $Uint64(x$2.$high + 0, x$2.$low + 64)), new $Uint64(x$1.$high - 0, x$1.$low - 1))), new $Uint64(0, 64), false); if (s.overflow || (x$3 = (x$4 = (new $Uint64(0, s.counter)), new $Uint64(x$4.$high + numBlocks.$high, x$4.$low + numBlocks.$low)), (x$3.$high > 1 || (x$3.$high === 1 && x$3.$low > 0)))) { $panic(new $String("chacha20: counter overflow")); } else if ((x$5 = (x$6 = (new $Uint64(0, s.counter)), new $Uint64(x$6.$high + numBlocks.$high, x$6.$low + numBlocks.$low)), (x$5.$high === 1 && x$5.$low === 0))) { s.overflow = true; } full = src.$length - (_r$1 = src.$length % 64, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) >> 0; if (full > 0) { s.xorKeyStreamBlocks($subslice(dst, 0, full), $subslice(src, 0, full)); } _tmp$2 = $subslice(dst, full); _tmp$3 = $subslice(src, full); dst = _tmp$2; src = _tmp$3; if ((x$7 = (x$8 = (new $Uint64(0, s.counter)), new $Uint64(x$8.$high + 0, x$8.$low + 1)), (x$7.$high > 1 || (x$7.$high === 1 && x$7.$low > 0)))) { arrayType$2.copy(s.buf, arrayType$2.zero()); numBlocks$1 = (_q = (((src.$length + 64 >> 0) - 1 >> 0)) / 64, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); buf = $subslice(new sliceType(s.buf), (64 - ($imul(numBlocks$1, 64)) >> 0)); $copySlice(buf, src); s.xorKeyStreamBlocksGeneric(buf, buf); s.len = buf.$length - $copySlice(dst, buf) >> 0; $s = -1; return; } if (src.$length > 0) { arrayType$2.copy(s.buf, arrayType$2.zero()); $copySlice(new sliceType(s.buf), src); s.xorKeyStreamBlocks(new sliceType(s.buf), new sliceType(s.buf)); s.len = 64 - $copySlice(dst, new sliceType(s.buf)) >> 0; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Cipher.ptr.prototype.XORKeyStream }; } $f._i = _i; $f._q = _q; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f.b = b; $f.buf = buf; $f.dst = dst; $f.full = full; $f.i = i; $f.keyStream = keyStream; $f.numBlocks = numBlocks; $f.numBlocks$1 = numBlocks$1; $f.s = s; $f.src = src; $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.$s = $s; $f.$r = $r; return $f; }; Cipher.prototype.XORKeyStream = function(dst, src) { return this.$val.XORKeyStream(dst, src); }; Cipher.ptr.prototype.xorKeyStreamBlocksGeneric = function(dst, src) { var _r, _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$10, _tuple$11, _tuple$12, _tuple$13, _tuple$14, _tuple$15, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, _tuple$8, _tuple$9, c0, c1, c10, c11, c13, c14, c15, c2, c3, c4, c5, c6, c7, c8, c9, dst, fcr0, fcr12, fcr4, fcr8, i, s, src, x0, x1, x10, x11, x12, x13, x14, x15, x2, x3, x4, x5, x6, x7, x8, x9; s = this; if (!((dst.$length === src.$length)) || !(((_r = dst.$length % 64, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) === 0))) { $panic(new $String("chacha20: internal error: wrong dst and/or src length")); } _tmp = 1634760805; _tmp$1 = 857760878; _tmp$2 = 2036477234; _tmp$3 = 1797285236; c0 = _tmp; c1 = _tmp$1; c2 = _tmp$2; c3 = _tmp$3; _tmp$4 = s.key[0]; _tmp$5 = s.key[1]; _tmp$6 = s.key[2]; _tmp$7 = s.key[3]; c4 = _tmp$4; c5 = _tmp$5; c6 = _tmp$6; c7 = _tmp$7; _tmp$8 = s.key[4]; _tmp$9 = s.key[5]; _tmp$10 = s.key[6]; _tmp$11 = s.key[7]; c8 = _tmp$8; c9 = _tmp$9; c10 = _tmp$10; c11 = _tmp$11; $unused(s.counter); _tmp$13 = s.nonce[0]; _tmp$14 = s.nonce[1]; _tmp$15 = s.nonce[2]; c13 = _tmp$13; c14 = _tmp$14; c15 = _tmp$15; if (!s.precompDone) { _tuple = quarterRound(c1, c5, c9, c13); s.p1 = _tuple[0]; s.p5 = _tuple[1]; s.p9 = _tuple[2]; s.p13 = _tuple[3]; _tuple$1 = quarterRound(c2, c6, c10, c14); s.p2 = _tuple$1[0]; s.p6 = _tuple$1[1]; s.p10 = _tuple$1[2]; s.p14 = _tuple$1[3]; _tuple$2 = quarterRound(c3, c7, c11, c15); s.p3 = _tuple$2[0]; s.p7 = _tuple$2[1]; s.p11 = _tuple$2[2]; s.p15 = _tuple$2[3]; s.precompDone = true; } while (true) { if (!(src.$length >= 64 && dst.$length >= 64)) { break; } _tuple$3 = quarterRound(c0, c4, c8, s.counter); fcr0 = _tuple$3[0]; fcr4 = _tuple$3[1]; fcr8 = _tuple$3[2]; fcr12 = _tuple$3[3]; _tuple$4 = quarterRound(fcr0, s.p5, s.p10, s.p15); x0 = _tuple$4[0]; x5 = _tuple$4[1]; x10 = _tuple$4[2]; x15 = _tuple$4[3]; _tuple$5 = quarterRound(s.p1, s.p6, s.p11, fcr12); x1 = _tuple$5[0]; x6 = _tuple$5[1]; x11 = _tuple$5[2]; x12 = _tuple$5[3]; _tuple$6 = quarterRound(s.p2, s.p7, fcr8, s.p13); x2 = _tuple$6[0]; x7 = _tuple$6[1]; x8 = _tuple$6[2]; x13 = _tuple$6[3]; _tuple$7 = quarterRound(s.p3, fcr4, s.p9, s.p14); x3 = _tuple$7[0]; x4 = _tuple$7[1]; x9 = _tuple$7[2]; x14 = _tuple$7[3]; i = 0; while (true) { if (!(i < 9)) { break; } _tuple$8 = quarterRound(x0, x4, x8, x12); x0 = _tuple$8[0]; x4 = _tuple$8[1]; x8 = _tuple$8[2]; x12 = _tuple$8[3]; _tuple$9 = quarterRound(x1, x5, x9, x13); x1 = _tuple$9[0]; x5 = _tuple$9[1]; x9 = _tuple$9[2]; x13 = _tuple$9[3]; _tuple$10 = quarterRound(x2, x6, x10, x14); x2 = _tuple$10[0]; x6 = _tuple$10[1]; x10 = _tuple$10[2]; x14 = _tuple$10[3]; _tuple$11 = quarterRound(x3, x7, x11, x15); x3 = _tuple$11[0]; x7 = _tuple$11[1]; x11 = _tuple$11[2]; x15 = _tuple$11[3]; _tuple$12 = quarterRound(x0, x5, x10, x15); x0 = _tuple$12[0]; x5 = _tuple$12[1]; x10 = _tuple$12[2]; x15 = _tuple$12[3]; _tuple$13 = quarterRound(x1, x6, x11, x12); x1 = _tuple$13[0]; x6 = _tuple$13[1]; x11 = _tuple$13[2]; x12 = _tuple$13[3]; _tuple$14 = quarterRound(x2, x7, x8, x13); x2 = _tuple$14[0]; x7 = _tuple$14[1]; x8 = _tuple$14[2]; x13 = _tuple$14[3]; _tuple$15 = quarterRound(x3, x4, x9, x14); x3 = _tuple$15[0]; x4 = _tuple$15[1]; x9 = _tuple$15[2]; x14 = _tuple$15[3]; i = i + (1) >> 0; } addXor($subslice(dst, 0, 4), $subslice(src, 0, 4), x0, c0); addXor($subslice(dst, 4, 8), $subslice(src, 4, 8), x1, c1); addXor($subslice(dst, 8, 12), $subslice(src, 8, 12), x2, c2); addXor($subslice(dst, 12, 16), $subslice(src, 12, 16), x3, c3); addXor($subslice(dst, 16, 20), $subslice(src, 16, 20), x4, c4); addXor($subslice(dst, 20, 24), $subslice(src, 20, 24), x5, c5); addXor($subslice(dst, 24, 28), $subslice(src, 24, 28), x6, c6); addXor($subslice(dst, 28, 32), $subslice(src, 28, 32), x7, c7); addXor($subslice(dst, 32, 36), $subslice(src, 32, 36), x8, c8); addXor($subslice(dst, 36, 40), $subslice(src, 36, 40), x9, c9); addXor($subslice(dst, 40, 44), $subslice(src, 40, 44), x10, c10); addXor($subslice(dst, 44, 48), $subslice(src, 44, 48), x11, c11); addXor($subslice(dst, 48, 52), $subslice(src, 48, 52), x12, s.counter); addXor($subslice(dst, 52, 56), $subslice(src, 52, 56), x13, c13); addXor($subslice(dst, 56, 60), $subslice(src, 56, 60), x14, c14); addXor($subslice(dst, 60, 64), $subslice(src, 60, 64), x15, c15); s.counter = s.counter + (1) >>> 0; _tmp$16 = $subslice(src, 64); _tmp$17 = $subslice(dst, 64); src = _tmp$16; dst = _tmp$17; } }; Cipher.prototype.xorKeyStreamBlocksGeneric = function(dst, src) { return this.$val.xorKeyStreamBlocksGeneric(dst, src); }; HChaCha20 = function(key, nonce) { var key, nonce, out; out = $makeSlice(sliceType, 32); return hChaCha20(out, key, nonce); }; $pkg.HChaCha20 = HChaCha20; hChaCha20 = function(out, key, nonce) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, i, key, nonce, out, x0, x1, x10, x11, x12, x13, x14, x15, x2, x3, x4, x5, x6, x7, x8, x9; if (!((key.$length === 32))) { return [sliceType.nil, errors.New("chacha20: wrong HChaCha20 key size")]; } if (!((nonce.$length === 16))) { return [sliceType.nil, errors.New("chacha20: wrong HChaCha20 nonce size")]; } _tmp = 1634760805; _tmp$1 = 857760878; _tmp$2 = 2036477234; _tmp$3 = 1797285236; x0 = _tmp; x1 = _tmp$1; x2 = _tmp$2; x3 = _tmp$3; x4 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(key, 0, 4)); x5 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(key, 4, 8)); x6 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(key, 8, 12)); x7 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(key, 12, 16)); x8 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(key, 16, 20)); x9 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(key, 20, 24)); x10 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(key, 24, 28)); x11 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(key, 28, 32)); x12 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(nonce, 0, 4)); x13 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(nonce, 4, 8)); x14 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(nonce, 8, 12)); x15 = $clone(binary.LittleEndian, binary.littleEndian).Uint32($subslice(nonce, 12, 16)); i = 0; while (true) { if (!(i < 10)) { break; } _tuple = quarterRound(x0, x4, x8, x12); x0 = _tuple[0]; x4 = _tuple[1]; x8 = _tuple[2]; x12 = _tuple[3]; _tuple$1 = quarterRound(x1, x5, x9, x13); x1 = _tuple$1[0]; x5 = _tuple$1[1]; x9 = _tuple$1[2]; x13 = _tuple$1[3]; _tuple$2 = quarterRound(x2, x6, x10, x14); x2 = _tuple$2[0]; x6 = _tuple$2[1]; x10 = _tuple$2[2]; x14 = _tuple$2[3]; _tuple$3 = quarterRound(x3, x7, x11, x15); x3 = _tuple$3[0]; x7 = _tuple$3[1]; x11 = _tuple$3[2]; x15 = _tuple$3[3]; _tuple$4 = quarterRound(x0, x5, x10, x15); x0 = _tuple$4[0]; x5 = _tuple$4[1]; x10 = _tuple$4[2]; x15 = _tuple$4[3]; _tuple$5 = quarterRound(x1, x6, x11, x12); x1 = _tuple$5[0]; x6 = _tuple$5[1]; x11 = _tuple$5[2]; x12 = _tuple$5[3]; _tuple$6 = quarterRound(x2, x7, x8, x13); x2 = _tuple$6[0]; x7 = _tuple$6[1]; x8 = _tuple$6[2]; x13 = _tuple$6[3]; _tuple$7 = quarterRound(x3, x4, x9, x14); x3 = _tuple$7[0]; x4 = _tuple$7[1]; x9 = _tuple$7[2]; x14 = _tuple$7[3]; i = i + (1) >> 0; } $unused((31 >= out.$length ? ($throwRuntimeError("index out of range"), undefined) : out.$array[out.$offset + 31])); $clone(binary.LittleEndian, binary.littleEndian).PutUint32($subslice(out, 0, 4), x0); $clone(binary.LittleEndian, binary.littleEndian).PutUint32($subslice(out, 4, 8), x1); $clone(binary.LittleEndian, binary.littleEndian).PutUint32($subslice(out, 8, 12), x2); $clone(binary.LittleEndian, binary.littleEndian).PutUint32($subslice(out, 12, 16), x3); $clone(binary.LittleEndian, binary.littleEndian).PutUint32($subslice(out, 16, 20), x12); $clone(binary.LittleEndian, binary.littleEndian).PutUint32($subslice(out, 20, 24), x13); $clone(binary.LittleEndian, binary.littleEndian).PutUint32($subslice(out, 24, 28), x14); $clone(binary.LittleEndian, binary.littleEndian).PutUint32($subslice(out, 28, 32), x15); return [out, $ifaceNil]; }; ptrType.methods = [{prop: "xorKeyStreamBlocks", name: "xorKeyStreamBlocks", pkg: "vendor/golang.org/x/crypto/chacha20", typ: $funcType([sliceType, sliceType], [], false)}, {prop: "SetCounter", name: "SetCounter", pkg: "", typ: $funcType([$Uint32], [], false)}, {prop: "XORKeyStream", name: "XORKeyStream", pkg: "", typ: $funcType([sliceType, sliceType], [], false)}, {prop: "xorKeyStreamBlocksGeneric", name: "xorKeyStreamBlocksGeneric", pkg: "vendor/golang.org/x/crypto/chacha20", typ: $funcType([sliceType, sliceType], [], false)}]; Cipher.init("vendor/golang.org/x/crypto/chacha20", [{prop: "key", name: "key", embedded: false, exported: false, typ: arrayType, tag: ""}, {prop: "counter", name: "counter", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "nonce", name: "nonce", embedded: false, exported: false, typ: arrayType$1, tag: ""}, {prop: "buf", name: "buf", embedded: false, exported: false, typ: arrayType$2, tag: ""}, {prop: "len", name: "len", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "overflow", name: "overflow", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "precompDone", name: "precompDone", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "p1", name: "p1", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "p5", name: "p5", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "p9", name: "p9", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "p13", name: "p13", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "p2", name: "p2", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "p6", name: "p6", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "p10", name: "p10", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "p14", name: "p14", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "p3", name: "p3", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "p7", name: "p7", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "p11", name: "p11", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "p15", name: "p15", embedded: false, exported: false, typ: $Uint32, 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 = cipher.$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 = bits.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = runtime.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = subtle.$init(); /* */ $s = 6; case 6: 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["vendor/golang.org/x/crypto/poly1305"] = (function() { var $pkg = {}, $init, subtle, binary, bits, macState, macGeneric, uint128, MAC, mac, arrayType, arrayType$1, arrayType$2, sliceType, ptrType, ptrType$1, ptrType$2, initialize, mul64, add128, shiftRightBy2, updateGeneric, select64, finalize, New, bitsAdd64, bitsSub64, bitsMul64; subtle = $packages["crypto/subtle"]; binary = $packages["encoding/binary"]; bits = $packages["math/bits"]; macState = $pkg.macState = $newType(0, $kindStruct, "poly1305.macState", true, "vendor/golang.org/x/crypto/poly1305", false, function(h_, r_, s_) { this.$val = this; if (arguments.length === 0) { this.h = arrayType.zero(); this.r = arrayType$1.zero(); this.s = arrayType$1.zero(); return; } this.h = h_; this.r = r_; this.s = s_; }); macGeneric = $pkg.macGeneric = $newType(0, $kindStruct, "poly1305.macGeneric", true, "vendor/golang.org/x/crypto/poly1305", false, function(macState_, buffer_, offset_) { this.$val = this; if (arguments.length === 0) { this.macState = new macState.ptr(arrayType.zero(), arrayType$1.zero(), arrayType$1.zero()); this.buffer = arrayType$2.zero(); this.offset = 0; return; } this.macState = macState_; this.buffer = buffer_; this.offset = offset_; }); uint128 = $pkg.uint128 = $newType(0, $kindStruct, "poly1305.uint128", true, "vendor/golang.org/x/crypto/poly1305", false, function(lo_, hi_) { this.$val = this; if (arguments.length === 0) { this.lo = new $Uint64(0, 0); this.hi = new $Uint64(0, 0); return; } this.lo = lo_; this.hi = hi_; }); MAC = $pkg.MAC = $newType(0, $kindStruct, "poly1305.MAC", true, "vendor/golang.org/x/crypto/poly1305", true, function(mac_, finalized_) { this.$val = this; if (arguments.length === 0) { this.mac = new mac.ptr(new macGeneric.ptr(new macState.ptr(arrayType.zero(), arrayType$1.zero(), arrayType$1.zero()), arrayType$2.zero(), 0)); this.finalized = false; return; } this.mac = mac_; this.finalized = finalized_; }); mac = $pkg.mac = $newType(0, $kindStruct, "poly1305.mac", true, "vendor/golang.org/x/crypto/poly1305", false, function(macGeneric_) { this.$val = this; if (arguments.length === 0) { this.macGeneric = new macGeneric.ptr(new macState.ptr(arrayType.zero(), arrayType$1.zero(), arrayType$1.zero()), arrayType$2.zero(), 0); return; } this.macGeneric = macGeneric_; }); arrayType = $arrayType($Uint64, 3); arrayType$1 = $arrayType($Uint64, 2); arrayType$2 = $arrayType($Uint8, 16); sliceType = $sliceType($Uint8); ptrType = $ptrType(arrayType$2); ptrType$1 = $ptrType(macGeneric); ptrType$2 = $ptrType(MAC); macGeneric.ptr.prototype.Write = function(p) { var _r, h, n, n$1, nn, p; h = this; nn = p.$length; if (h.offset > 0) { n = $copySlice($subslice(new sliceType(h.buffer), h.offset), p); if ((h.offset + n >> 0) < 16) { h.offset = h.offset + (n) >> 0; return [nn, $ifaceNil]; } p = $subslice(p, n); h.offset = 0; updateGeneric(h.macState, new sliceType(h.buffer)); } n$1 = p.$length - ((_r = p.$length % 16, _r === _r ? _r : $throwRuntimeError("integer divide by zero"))) >> 0; if (n$1 > 0) { updateGeneric(h.macState, $subslice(p, 0, n$1)); p = $subslice(p, n$1); } if (p.$length > 0) { h.offset = h.offset + ($copySlice($subslice(new sliceType(h.buffer), h.offset), p)) >> 0; } return [nn, $ifaceNil]; }; macGeneric.prototype.Write = function(p) { return this.$val.Write(p); }; macGeneric.ptr.prototype.Sum = function(out) { var h, out, state; h = this; state = $clone(h.macState, macState); if (h.offset > 0) { updateGeneric(state, $subslice(new sliceType(h.buffer), 0, h.offset)); } finalize(out, state.h, state.s); }; macGeneric.prototype.Sum = function(out) { return this.$val.Sum(out); }; initialize = function(key, m) { var key, m, x, x$1; m.r[0] = (x = $clone(binary.LittleEndian, binary.littleEndian).Uint64($subslice(new sliceType(key), 0, 8)), new $Uint64(x.$high & 268435452, (x.$low & 268435455) >>> 0)); m.r[1] = (x$1 = $clone(binary.LittleEndian, binary.littleEndian).Uint64($subslice(new sliceType(key), 8, 16)), new $Uint64(x$1.$high & 268435452, (x$1.$low & 268435452) >>> 0)); m.s[0] = $clone(binary.LittleEndian, binary.littleEndian).Uint64($subslice(new sliceType(key), 16, 24)); m.s[1] = $clone(binary.LittleEndian, binary.littleEndian).Uint64($subslice(new sliceType(key), 24, 32)); }; mul64 = function(a, b) { var _tuple, a, b, hi, lo; _tuple = bitsMul64(a, b); hi = _tuple[0]; lo = _tuple[1]; return new uint128.ptr(lo, hi); }; add128 = function(a, b) { var _tuple, _tuple$1, a, b, c, hi, lo; _tuple = bitsAdd64(a.lo, b.lo, new $Uint64(0, 0)); lo = _tuple[0]; c = _tuple[1]; _tuple$1 = bitsAdd64(a.hi, b.hi, c); hi = _tuple$1[0]; c = _tuple$1[1]; if (!((c.$high === 0 && c.$low === 0))) { $panic(new $String("poly1305: unexpected overflow")); } return new uint128.ptr(lo, hi); }; shiftRightBy2 = function(a) { var a, x, x$1, x$2; a.lo = (x = $shiftRightUint64(a.lo, 2), x$1 = $shiftLeft64(((x$2 = a.hi, new $Uint64(x$2.$high & 0, (x$2.$low & 3) >>> 0))), 62), new $Uint64(x.$high | x$1.$high, (x.$low | x$1.$low) >>> 0)); a.hi = $shiftRightUint64(a.hi, 2); return a; }; updateGeneric = function(state, msg) { var _tmp, _tmp$1, _tmp$10, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$10, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, _tuple$8, _tuple$9, buf, c, cc, h0, h0r0, h0r1, h1, h1r0, h1r1, h2, h2r0, h2r1, m0, m1, m2, m3, msg, r0, r1, state, t0, t1, t2, t3, x, x$1, x$2, x$3, x$4, x$5, x$6; _tmp = state.h[0]; _tmp$1 = state.h[1]; _tmp$2 = state.h[2]; h0 = _tmp; h1 = _tmp$1; h2 = _tmp$2; _tmp$3 = state.r[0]; _tmp$4 = state.r[1]; r0 = _tmp$3; r1 = _tmp$4; while (true) { if (!(msg.$length > 0)) { break; } c = new $Uint64(0, 0); if (msg.$length >= 16) { _tuple = bitsAdd64(h0, $clone(binary.LittleEndian, binary.littleEndian).Uint64($subslice(msg, 0, 8)), new $Uint64(0, 0)); h0 = _tuple[0]; c = _tuple[1]; _tuple$1 = bitsAdd64(h1, $clone(binary.LittleEndian, binary.littleEndian).Uint64($subslice(msg, 8, 16)), c); h1 = _tuple$1[0]; c = _tuple$1[1]; h2 = (x = new $Uint64(c.$high + 0, c.$low + 1), new $Uint64(h2.$high + x.$high, h2.$low + x.$low)); msg = $subslice(msg, 16); } else { buf = arrayType$2.zero(); $copySlice(new sliceType(buf), msg); (x$1 = msg.$length, ((x$1 < 0 || x$1 >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[x$1] = 1)); _tuple$2 = bitsAdd64(h0, $clone(binary.LittleEndian, binary.littleEndian).Uint64($subslice(new sliceType(buf), 0, 8)), new $Uint64(0, 0)); h0 = _tuple$2[0]; c = _tuple$2[1]; _tuple$3 = bitsAdd64(h1, $clone(binary.LittleEndian, binary.littleEndian).Uint64($subslice(new sliceType(buf), 8, 16)), c); h1 = _tuple$3[0]; c = _tuple$3[1]; h2 = (x$2 = c, new $Uint64(h2.$high + x$2.$high, h2.$low + x$2.$low)); msg = sliceType.nil; } h0r0 = $clone(mul64(h0, r0), uint128); h1r0 = $clone(mul64(h1, r0), uint128); h2r0 = $clone(mul64(h2, r0), uint128); h0r1 = $clone(mul64(h0, r1), uint128); h1r1 = $clone(mul64(h1, r1), uint128); h2r1 = $clone(mul64(h2, r1), uint128); if (!((x$3 = h2r0.hi, (x$3.$high === 0 && x$3.$low === 0)))) { $panic(new $String("poly1305: unexpected overflow")); } if (!((x$4 = h2r1.hi, (x$4.$high === 0 && x$4.$low === 0)))) { $panic(new $String("poly1305: unexpected overflow")); } m0 = $clone(h0r0, uint128); m1 = $clone(add128($clone(h1r0, uint128), $clone(h0r1, uint128)), uint128); m2 = $clone(add128($clone(h2r0, uint128), $clone(h1r1, uint128)), uint128); m3 = $clone(h2r1, uint128); t0 = m0.lo; _tuple$4 = bitsAdd64(m1.lo, m0.hi, new $Uint64(0, 0)); t1 = _tuple$4[0]; c = _tuple$4[1]; _tuple$5 = bitsAdd64(m2.lo, m1.hi, c); t2 = _tuple$5[0]; c = _tuple$5[1]; _tuple$6 = bitsAdd64(m3.lo, m2.hi, c); t3 = _tuple$6[0]; _tmp$5 = t0; _tmp$6 = t1; _tmp$7 = new $Uint64(t2.$high & 0, (t2.$low & 3) >>> 0); h0 = _tmp$5; h1 = _tmp$6; h2 = _tmp$7; cc = new uint128.ptr(new $Uint64(t2.$high & 4294967295, (t2.$low & 4294967292) >>> 0), t3); _tuple$7 = bitsAdd64(h0, cc.lo, new $Uint64(0, 0)); h0 = _tuple$7[0]; c = _tuple$7[1]; _tuple$8 = bitsAdd64(h1, cc.hi, c); h1 = _tuple$8[0]; c = _tuple$8[1]; h2 = (x$5 = c, new $Uint64(h2.$high + x$5.$high, h2.$low + x$5.$low)); uint128.copy(cc, shiftRightBy2($clone(cc, uint128))); _tuple$9 = bitsAdd64(h0, cc.lo, new $Uint64(0, 0)); h0 = _tuple$9[0]; c = _tuple$9[1]; _tuple$10 = bitsAdd64(h1, cc.hi, c); h1 = _tuple$10[0]; c = _tuple$10[1]; h2 = (x$6 = c, new $Uint64(h2.$high + x$6.$high, h2.$low + x$6.$low)); } _tmp$8 = h0; _tmp$9 = h1; _tmp$10 = h2; state.h[0] = _tmp$8; state.h[1] = _tmp$9; state.h[2] = _tmp$10; }; select64 = function(v, x, y) { var v, x, x$1, x$2, x$3, x$4, x$5, y; return (x$1 = (x$2 = (x$3 = new $Uint64(v.$high - 0, v.$low - 1), new $Uint64(~x$3.$high, ~x$3.$low >>> 0)), new $Uint64(x$2.$high & x.$high, (x$2.$low & x.$low) >>> 0)), x$4 = (x$5 = new $Uint64(v.$high - 0, v.$low - 1), new $Uint64(x$5.$high & y.$high, (x$5.$low & y.$low) >>> 0)), new $Uint64(x$1.$high | x$4.$high, (x$1.$low | x$4.$low) >>> 0)); }; finalize = function(out, h, s) { var _tmp, _tmp$1, _tmp$2, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, b, c, h, h0, h1, h2, hMinusP0, hMinusP1, out, s; _tmp = h[0]; _tmp$1 = h[1]; _tmp$2 = h[2]; h0 = _tmp; h1 = _tmp$1; h2 = _tmp$2; _tuple = bitsSub64(h0, new $Uint64(4294967295, 4294967291), new $Uint64(0, 0)); hMinusP0 = _tuple[0]; b = _tuple[1]; _tuple$1 = bitsSub64(h1, new $Uint64(4294967295, 4294967295), b); hMinusP1 = _tuple$1[0]; b = _tuple$1[1]; _tuple$2 = bitsSub64(h2, new $Uint64(0, 3), b); b = _tuple$2[1]; h0 = select64(b, h0, hMinusP0); h1 = select64(b, h1, hMinusP1); _tuple$3 = bitsAdd64(h0, s[0], new $Uint64(0, 0)); h0 = _tuple$3[0]; c = _tuple$3[1]; _tuple$4 = bitsAdd64(h1, s[1], c); h1 = _tuple$4[0]; $clone(binary.LittleEndian, binary.littleEndian).PutUint64($subslice(new sliceType(out), 0, 8), h0); $clone(binary.LittleEndian, binary.littleEndian).PutUint64($subslice(new sliceType(out), 8, 16), h1); }; New = function(key) { var key, m; m = new MAC.ptr(new mac.ptr(new macGeneric.ptr(new macState.ptr(arrayType.zero(), arrayType$1.zero(), arrayType$1.zero()), arrayType$2.zero(), 0)), false); initialize(key, m.mac.macGeneric.macState); return m; }; $pkg.New = New; MAC.ptr.prototype.Size = function() { var h; h = this; return 16; }; MAC.prototype.Size = function() { return this.$val.Size(); }; MAC.ptr.prototype.Write = function(p) { var _tuple, err, h, n, p; n = 0; err = $ifaceNil; h = this; if (h.finalized) { $panic(new $String("poly1305: write to MAC after Sum or Verify")); } _tuple = h.mac.macGeneric.Write(p); n = _tuple[0]; err = _tuple[1]; return [n, err]; }; MAC.prototype.Write = function(p) { return this.$val.Write(p); }; MAC.ptr.prototype.Sum = function(b) { var b, h, mac$1; h = this; mac$1 = arrayType$2.zero(); h.mac.macGeneric.Sum(mac$1); h.finalized = true; return $appendSlice(b, new sliceType(mac$1)); }; MAC.prototype.Sum = function(b) { return this.$val.Sum(b); }; MAC.ptr.prototype.Verify = function(expected) { var expected, h, mac$1; h = this; mac$1 = arrayType$2.zero(); h.mac.macGeneric.Sum(mac$1); h.finalized = true; return subtle.ConstantTimeCompare(expected, new sliceType(mac$1)) === 1; }; MAC.prototype.Verify = function(expected) { return this.$val.Verify(expected); }; bitsAdd64 = function(x, y, carry) { var _tuple, carry, carryOut, sum, x, y; sum = new $Uint64(0, 0); carryOut = new $Uint64(0, 0); _tuple = bits.Add64(x, y, carry); sum = _tuple[0]; carryOut = _tuple[1]; return [sum, carryOut]; }; bitsSub64 = function(x, y, borrow) { var _tuple, borrow, borrowOut, diff, x, y; diff = new $Uint64(0, 0); borrowOut = new $Uint64(0, 0); _tuple = bits.Sub64(x, y, borrow); diff = _tuple[0]; borrowOut = _tuple[1]; return [diff, borrowOut]; }; bitsMul64 = function(x, y) { var _tuple, hi, lo, x, y; hi = new $Uint64(0, 0); lo = new $Uint64(0, 0); _tuple = bits.Mul64(x, y); hi = _tuple[0]; lo = _tuple[1]; return [hi, lo]; }; ptrType$1.methods = [{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}, {prop: "Sum", name: "Sum", pkg: "", typ: $funcType([ptrType], [], false)}]; ptrType$2.methods = [{prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}, {prop: "Sum", name: "Sum", pkg: "", typ: $funcType([sliceType], [sliceType], false)}, {prop: "Verify", name: "Verify", pkg: "", typ: $funcType([sliceType], [$Bool], false)}]; macState.init("vendor/golang.org/x/crypto/poly1305", [{prop: "h", name: "h", embedded: false, exported: false, typ: arrayType, tag: ""}, {prop: "r", name: "r", embedded: false, exported: false, typ: arrayType$1, tag: ""}, {prop: "s", name: "s", embedded: false, exported: false, typ: arrayType$1, tag: ""}]); macGeneric.init("vendor/golang.org/x/crypto/poly1305", [{prop: "macState", name: "macState", embedded: true, exported: false, typ: macState, tag: ""}, {prop: "buffer", name: "buffer", embedded: false, exported: false, typ: arrayType$2, tag: ""}, {prop: "offset", name: "offset", embedded: false, exported: false, typ: $Int, tag: ""}]); uint128.init("vendor/golang.org/x/crypto/poly1305", [{prop: "lo", name: "lo", embedded: false, exported: false, typ: $Uint64, tag: ""}, {prop: "hi", name: "hi", embedded: false, exported: false, typ: $Uint64, tag: ""}]); MAC.init("vendor/golang.org/x/crypto/poly1305", [{prop: "mac", name: "mac", embedded: true, exported: false, typ: mac, tag: ""}, {prop: "finalized", name: "finalized", embedded: false, exported: false, typ: $Bool, tag: ""}]); mac.init("vendor/golang.org/x/crypto/poly1305", [{prop: "macGeneric", name: "macGeneric", embedded: true, exported: false, typ: macGeneric, 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 = subtle.$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 = bits.$init(); /* */ $s = 3; case 3: 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["vendor/golang.org/x/crypto/chacha20poly1305"] = (function() { var $pkg = {}, $init, cipher, binary, errors, chacha20, subtle, poly1305, chacha20poly1305, arrayType, sliceType, arrayType$1, arrayType$2, ptrType$1, errOpen, writeWithPadding, writeUint64, New, sliceForAppend; cipher = $packages["crypto/cipher"]; binary = $packages["encoding/binary"]; errors = $packages["errors"]; chacha20 = $packages["vendor/golang.org/x/crypto/chacha20"]; subtle = $packages["vendor/golang.org/x/crypto/internal/subtle"]; poly1305 = $packages["vendor/golang.org/x/crypto/poly1305"]; chacha20poly1305 = $pkg.chacha20poly1305 = $newType(0, $kindStruct, "chacha20poly1305.chacha20poly1305", true, "vendor/golang.org/x/crypto/chacha20poly1305", false, function(key_) { this.$val = this; if (arguments.length === 0) { this.key = arrayType.zero(); return; } this.key = key_; }); arrayType = $arrayType($Uint8, 32); sliceType = $sliceType($Uint8); arrayType$1 = $arrayType($Uint8, 16); arrayType$2 = $arrayType($Uint8, 8); ptrType$1 = $ptrType(chacha20poly1305); chacha20poly1305.ptr.prototype.seal = function(dst, nonce, plaintext, additionalData) { var $24r, _r, additionalData, c, dst, nonce, plaintext, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; additionalData = $f.additionalData; c = $f.c; dst = $f.dst; nonce = $f.nonce; plaintext = $f.plaintext; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r = c.sealGeneric(dst, nonce, plaintext, additionalData); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: chacha20poly1305.ptr.prototype.seal }; } $f.$24r = $24r; $f._r = _r; $f.additionalData = additionalData; $f.c = c; $f.dst = dst; $f.nonce = nonce; $f.plaintext = plaintext; $f.$s = $s; $f.$r = $r; return $f; }; chacha20poly1305.prototype.seal = function(dst, nonce, plaintext, additionalData) { return this.$val.seal(dst, nonce, plaintext, additionalData); }; chacha20poly1305.ptr.prototype.open = function(dst, nonce, ciphertext, additionalData) { var $24r, _r, additionalData, c, ciphertext, dst, nonce, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; additionalData = $f.additionalData; c = $f.c; ciphertext = $f.ciphertext; dst = $f.dst; nonce = $f.nonce; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r = c.openGeneric(dst, nonce, ciphertext, additionalData); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: chacha20poly1305.ptr.prototype.open }; } $f.$24r = $24r; $f._r = _r; $f.additionalData = additionalData; $f.c = c; $f.ciphertext = ciphertext; $f.dst = dst; $f.nonce = nonce; $f.$s = $s; $f.$r = $r; return $f; }; chacha20poly1305.prototype.open = function(dst, nonce, ciphertext, additionalData) { return this.$val.open(dst, nonce, ciphertext, additionalData); }; writeWithPadding = function(p, b) { var _r, b, buf, p, padLen, rem; p.Write(b); rem = (_r = b.$length % 16, _r === _r ? _r : $throwRuntimeError("integer divide by zero")); if (!((rem === 0))) { buf = arrayType$1.zero(); padLen = 16 - rem >> 0; p.Write($subslice(new sliceType(buf), 0, padLen)); } }; writeUint64 = function(p, n) { var buf, n, p; buf = arrayType$2.zero(); $clone(binary.LittleEndian, binary.littleEndian).PutUint64(new sliceType(buf), (new $Uint64(0, n))); p.Write(new sliceType(buf)); }; chacha20poly1305.ptr.prototype.sealGeneric = function(dst, nonce, plaintext, additionalData) { var _r, _tmp, _tmp$1, _tuple, _tuple$1, additionalData, c, ciphertext, dst, nonce, out, p, plaintext, polyKey, ret, s, tag, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; additionalData = $f.additionalData; c = $f.c; ciphertext = $f.ciphertext; dst = $f.dst; nonce = $f.nonce; out = $f.out; p = $f.p; plaintext = $f.plaintext; polyKey = $f.polyKey; ret = $f.ret; s = $f.s; tag = $f.tag; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: polyKey = [polyKey]; c = this; _tuple = sliceForAppend(dst, plaintext.$length + 16 >> 0); ret = _tuple[0]; out = _tuple[1]; _tmp = $subslice(out, 0, plaintext.$length); _tmp$1 = $subslice(out, plaintext.$length); ciphertext = _tmp; tag = _tmp$1; _r = subtle.InexactOverlap(out, plaintext); /* */ $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: $panic(new $String("chacha20poly1305: invalid buffer overlap")); /* } */ case 2: polyKey[0] = arrayType.zero(); _tuple$1 = chacha20.NewUnauthenticatedCipher(new sliceType(c.key), nonce); s = _tuple$1[0]; $r = s.XORKeyStream(new sliceType(polyKey[0]), new sliceType(polyKey[0])); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } s.SetCounter(1); $r = s.XORKeyStream(ciphertext, plaintext); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } p = poly1305.New(polyKey[0]); writeWithPadding(p, additionalData); writeWithPadding(p, ciphertext); writeUint64(p, additionalData.$length); writeUint64(p, plaintext.$length); p.Sum($subslice(tag, 0, 0)); $s = -1; return ret; /* */ } return; } if ($f === undefined) { $f = { $blk: chacha20poly1305.ptr.prototype.sealGeneric }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.additionalData = additionalData; $f.c = c; $f.ciphertext = ciphertext; $f.dst = dst; $f.nonce = nonce; $f.out = out; $f.p = p; $f.plaintext = plaintext; $f.polyKey = polyKey; $f.ret = ret; $f.s = s; $f.tag = tag; $f.$s = $s; $f.$r = $r; return $f; }; chacha20poly1305.prototype.sealGeneric = function(dst, nonce, plaintext, additionalData) { return this.$val.sealGeneric(dst, nonce, plaintext, additionalData); }; chacha20poly1305.ptr.prototype.openGeneric = function(dst, nonce, ciphertext, additionalData) { var _i, _r, _ref, _tuple, _tuple$1, additionalData, c, ciphertext, dst, i, nonce, out, p, polyKey, ret, s, tag, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; additionalData = $f.additionalData; c = $f.c; ciphertext = $f.ciphertext; dst = $f.dst; i = $f.i; nonce = $f.nonce; out = $f.out; p = $f.p; polyKey = $f.polyKey; ret = $f.ret; s = $f.s; tag = $f.tag; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: polyKey = [polyKey]; c = this; tag = $subslice(ciphertext, (ciphertext.$length - 16 >> 0)); ciphertext = $subslice(ciphertext, 0, (ciphertext.$length - 16 >> 0)); polyKey[0] = arrayType.zero(); _tuple = chacha20.NewUnauthenticatedCipher(new sliceType(c.key), nonce); s = _tuple[0]; $r = s.XORKeyStream(new sliceType(polyKey[0]), new sliceType(polyKey[0])); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } s.SetCounter(1); p = poly1305.New(polyKey[0]); writeWithPadding(p, additionalData); writeWithPadding(p, ciphertext); writeUint64(p, additionalData.$length); writeUint64(p, ciphertext.$length); _tuple$1 = sliceForAppend(dst, ciphertext.$length); ret = _tuple$1[0]; out = _tuple$1[1]; _r = subtle.InexactOverlap(out, ciphertext); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (_r) { $s = 2; continue; } /* */ $s = 3; continue; /* if (_r) { */ case 2: $panic(new $String("chacha20poly1305: invalid buffer overlap")); /* } */ case 3: if (!p.Verify(tag)) { _ref = out; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; ((i < 0 || i >= out.$length) ? ($throwRuntimeError("index out of range"), undefined) : out.$array[out.$offset + i] = 0); _i++; } $s = -1; return [sliceType.nil, errOpen]; } $r = s.XORKeyStream(out, ciphertext); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return [ret, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: chacha20poly1305.ptr.prototype.openGeneric }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.additionalData = additionalData; $f.c = c; $f.ciphertext = ciphertext; $f.dst = dst; $f.i = i; $f.nonce = nonce; $f.out = out; $f.p = p; $f.polyKey = polyKey; $f.ret = ret; $f.s = s; $f.tag = tag; $f.$s = $s; $f.$r = $r; return $f; }; chacha20poly1305.prototype.openGeneric = function(dst, nonce, ciphertext, additionalData) { return this.$val.openGeneric(dst, nonce, ciphertext, additionalData); }; New = function(key) { var key, ret; if (!((key.$length === 32))) { return [$ifaceNil, errors.New("chacha20poly1305: bad key length")]; } ret = new chacha20poly1305.ptr(arrayType.zero()); $copySlice(new sliceType(ret.key), key); return [ret, $ifaceNil]; }; $pkg.New = New; chacha20poly1305.ptr.prototype.NonceSize = function() { var c; c = this; return 12; }; chacha20poly1305.prototype.NonceSize = function() { return this.$val.NonceSize(); }; chacha20poly1305.ptr.prototype.Overhead = function() { var c; c = this; return 16; }; chacha20poly1305.prototype.Overhead = function() { return this.$val.Overhead(); }; chacha20poly1305.ptr.prototype.Seal = function(dst, nonce, plaintext, additionalData) { var $24r, _r, additionalData, c, dst, nonce, plaintext, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; additionalData = $f.additionalData; c = $f.c; dst = $f.dst; nonce = $f.nonce; plaintext = $f.plaintext; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!((nonce.$length === 12))) { $panic(new $String("chacha20poly1305: bad nonce length passed to Seal")); } if ((x = (new $Uint64(0, plaintext.$length)), (x.$high > 63 || (x.$high === 63 && x.$low > 4294967232)))) { $panic(new $String("chacha20poly1305: plaintext too large")); } _r = c.seal(dst, nonce, plaintext, additionalData); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: chacha20poly1305.ptr.prototype.Seal }; } $f.$24r = $24r; $f._r = _r; $f.additionalData = additionalData; $f.c = c; $f.dst = dst; $f.nonce = nonce; $f.plaintext = plaintext; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; chacha20poly1305.prototype.Seal = function(dst, nonce, plaintext, additionalData) { return this.$val.Seal(dst, nonce, plaintext, additionalData); }; chacha20poly1305.ptr.prototype.Open = function(dst, nonce, ciphertext, additionalData) { var $24r, _r, additionalData, c, ciphertext, dst, nonce, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; additionalData = $f.additionalData; c = $f.c; ciphertext = $f.ciphertext; dst = $f.dst; nonce = $f.nonce; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!((nonce.$length === 12))) { $panic(new $String("chacha20poly1305: bad nonce length passed to Open")); } if (ciphertext.$length < 16) { $s = -1; return [sliceType.nil, errOpen]; } if ((x = (new $Uint64(0, ciphertext.$length)), (x.$high > 63 || (x.$high === 63 && x.$low > 4294967248)))) { $panic(new $String("chacha20poly1305: ciphertext too large")); } _r = c.open(dst, nonce, ciphertext, additionalData); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: chacha20poly1305.ptr.prototype.Open }; } $f.$24r = $24r; $f._r = _r; $f.additionalData = additionalData; $f.c = c; $f.ciphertext = ciphertext; $f.dst = dst; $f.nonce = nonce; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; chacha20poly1305.prototype.Open = function(dst, nonce, ciphertext, additionalData) { return this.$val.Open(dst, nonce, ciphertext, additionalData); }; sliceForAppend = function(in$1, n) { var head, in$1, n, tail, total; head = sliceType.nil; tail = sliceType.nil; total = in$1.$length + n >> 0; if (in$1.$capacity >= total) { head = $subslice(in$1, 0, total); } else { head = $makeSlice(sliceType, total); $copySlice(head, in$1); } tail = $subslice(head, in$1.$length); return [head, tail]; }; ptrType$1.methods = [{prop: "seal", name: "seal", pkg: "vendor/golang.org/x/crypto/chacha20poly1305", typ: $funcType([sliceType, sliceType, sliceType, sliceType], [sliceType], false)}, {prop: "open", name: "open", pkg: "vendor/golang.org/x/crypto/chacha20poly1305", typ: $funcType([sliceType, sliceType, sliceType, sliceType], [sliceType, $error], false)}, {prop: "sealGeneric", name: "sealGeneric", pkg: "vendor/golang.org/x/crypto/chacha20poly1305", typ: $funcType([sliceType, sliceType, sliceType, sliceType], [sliceType], false)}, {prop: "openGeneric", name: "openGeneric", pkg: "vendor/golang.org/x/crypto/chacha20poly1305", typ: $funcType([sliceType, sliceType, sliceType, sliceType], [sliceType, $error], false)}, {prop: "NonceSize", name: "NonceSize", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Overhead", name: "Overhead", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Seal", name: "Seal", pkg: "", typ: $funcType([sliceType, sliceType, sliceType, sliceType], [sliceType], false)}, {prop: "Open", name: "Open", pkg: "", typ: $funcType([sliceType, sliceType, sliceType, sliceType], [sliceType, $error], false)}]; chacha20poly1305.init("vendor/golang.org/x/crypto/chacha20poly1305", [{prop: "key", name: "key", embedded: false, exported: false, 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 = cipher.$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 = chacha20.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = subtle.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = poly1305.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } errOpen = errors.New("chacha20poly1305: message authentication failed"); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["vendor/golang.org/x/crypto/curve25519"] = (function() { var $pkg = {}, $init, subtle, binary, fmt, fieldElement, sliceType, arrayType, arrayType$1, arrayType$2, sliceType$1, ptrType, basePoint, basePoint$24ptr, scalarMult, feZero, feOne, feAdd, feSub, feCopy, feCSwap, load3, load4, feFromBytes, feToBytes, feMul, feSquare, feMul121666, feInvert, scalarMultGeneric, ScalarMult, ScalarBaseMult, init, checkBasepoint, X25519, x25519; subtle = $packages["crypto/subtle"]; binary = $packages["encoding/binary"]; fmt = $packages["fmt"]; fieldElement = $pkg.fieldElement = $newType(40, $kindArray, "curve25519.fieldElement", true, "vendor/golang.org/x/crypto/curve25519", false, null); sliceType = $sliceType($Uint8); arrayType = $arrayType($Int64, 10); arrayType$1 = $arrayType($Int32, 10); arrayType$2 = $arrayType($Uint8, 32); sliceType$1 = $sliceType($emptyInterface); ptrType = $ptrType($Uint8); scalarMult = function(out, in$1, base) { var base, in$1, out; scalarMultGeneric(out, in$1, base); }; feZero = function(fe) { var _i, _ref, fe, i; _ref = fe; _i = 0; while (true) { if (!(_i < 10)) { break; } i = _i; fe.nilCheck, ((i < 0 || i >= fe.length) ? ($throwRuntimeError("index out of range"), undefined) : fe[i] = 0); _i++; } }; feOne = function(fe) { var fe; feZero(fe); fe.nilCheck, fe[0] = 1; }; feAdd = function(dst, a, b) { var _i, _ref, a, b, dst, i, x, x$1; _ref = dst; _i = 0; while (true) { if (!(_i < 10)) { break; } i = _i; dst.nilCheck, ((i < 0 || i >= dst.length) ? ($throwRuntimeError("index out of range"), undefined) : dst[i] = ((x = a, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i])) + (x$1 = b, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i])) >> 0)); _i++; } }; feSub = function(dst, a, b) { var _i, _ref, a, b, dst, i, x, x$1; _ref = dst; _i = 0; while (true) { if (!(_i < 10)) { break; } i = _i; dst.nilCheck, ((i < 0 || i >= dst.length) ? ($throwRuntimeError("index out of range"), undefined) : dst[i] = ((x = a, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i])) - (x$1 = b, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i])) >> 0)); _i++; } }; feCopy = function(dst, src) { var _i, _ref, dst, i, src, x; _ref = dst; _i = 0; while (true) { if (!(_i < 10)) { break; } i = _i; dst.nilCheck, ((i < 0 || i >= dst.length) ? ($throwRuntimeError("index out of range"), undefined) : dst[i] = (x = src, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i]))); _i++; } }; feCSwap = function(f, g, b) { var _i, _ref, b, f, g, i, t, x, x$1, x$2, x$3, x$4, x$5; b = -b; _ref = f; _i = 0; while (true) { if (!(_i < 10)) { break; } i = _i; t = b & ((((x = f, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i])) ^ (x$1 = g, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i]))) >> 0)); (x$3 = f, ((i < 0 || i >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[i] = (((x$2 = f, ((i < 0 || i >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i])) ^ (t)) >> 0))); (x$5 = g, ((i < 0 || i >= x$5.length) ? ($throwRuntimeError("index out of range"), undefined) : x$5[i] = (((x$4 = g, ((i < 0 || i >= x$4.length) ? ($throwRuntimeError("index out of range"), undefined) : x$4[i])) ^ (t)) >> 0))); _i++; } }; load3 = function(in$1) { var in$1, r, x, x$1; r = new $Int64(0, 0); r = (new $Int64(0, (0 >= in$1.$length ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + 0]))); r = (x = $shiftLeft64((new $Int64(0, (1 >= in$1.$length ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + 1]))), 8), new $Int64(r.$high | x.$high, (r.$low | x.$low) >>> 0)); r = (x$1 = $shiftLeft64((new $Int64(0, (2 >= in$1.$length ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + 2]))), 16), new $Int64(r.$high | x$1.$high, (r.$low | x$1.$low) >>> 0)); return r; }; load4 = function(in$1) { var in$1; return (new $Int64(0, $clone(binary.LittleEndian, binary.littleEndian).Uint32(in$1))); }; feFromBytes = function(dst, src) { var carry, dst, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9, src, 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; h0 = load4(new sliceType(src)); h1 = $shiftLeft64(load3($subslice(new sliceType(src), 4)), 6); h2 = $shiftLeft64(load3($subslice(new sliceType(src), 7)), 5); h3 = $shiftLeft64(load3($subslice(new sliceType(src), 10)), 3); h4 = $shiftLeft64(load3($subslice(new sliceType(src), 13)), 2); h5 = load4($subslice(new sliceType(src), 16)); h6 = $shiftLeft64(load3($subslice(new sliceType(src), 20)), 7); h7 = $shiftLeft64(load3($subslice(new sliceType(src), 23)), 5); h8 = $shiftLeft64(load3($subslice(new sliceType(src), 26)), 4); h9 = $shiftLeft64(((x = load3($subslice(new sliceType(src), 29)), new $Int64(x.$high & 0, (x.$low & 8388607) >>> 0))), 2); carry = arrayType.zero(); carry[9] = $shiftRightInt64((new $Int64(h9.$high + 0, h9.$low + 16777216)), 25); h0 = (x$1 = $mul64(carry[9], new $Int64(0, 19)), new $Int64(h0.$high + x$1.$high, h0.$low + x$1.$low)); h9 = (x$2 = $shiftLeft64(carry[9], 25), new $Int64(h9.$high - x$2.$high, h9.$low - x$2.$low)); carry[1] = $shiftRightInt64((new $Int64(h1.$high + 0, h1.$low + 16777216)), 25); h2 = (x$3 = carry[1], new $Int64(h2.$high + x$3.$high, h2.$low + x$3.$low)); h1 = (x$4 = $shiftLeft64(carry[1], 25), new $Int64(h1.$high - x$4.$high, h1.$low - x$4.$low)); carry[3] = $shiftRightInt64((new $Int64(h3.$high + 0, h3.$low + 16777216)), 25); h4 = (x$5 = carry[3], new $Int64(h4.$high + x$5.$high, h4.$low + x$5.$low)); h3 = (x$6 = $shiftLeft64(carry[3], 25), new $Int64(h3.$high - x$6.$high, h3.$low - x$6.$low)); carry[5] = $shiftRightInt64((new $Int64(h5.$high + 0, h5.$low + 16777216)), 25); h6 = (x$7 = carry[5], new $Int64(h6.$high + x$7.$high, h6.$low + x$7.$low)); h5 = (x$8 = $shiftLeft64(carry[5], 25), new $Int64(h5.$high - x$8.$high, h5.$low - x$8.$low)); carry[7] = $shiftRightInt64((new $Int64(h7.$high + 0, h7.$low + 16777216)), 25); h8 = (x$9 = carry[7], new $Int64(h8.$high + x$9.$high, h8.$low + x$9.$low)); h7 = (x$10 = $shiftLeft64(carry[7], 25), new $Int64(h7.$high - x$10.$high, h7.$low - x$10.$low)); carry[0] = $shiftRightInt64((new $Int64(h0.$high + 0, h0.$low + 33554432)), 26); h1 = (x$11 = carry[0], new $Int64(h1.$high + x$11.$high, h1.$low + x$11.$low)); h0 = (x$12 = $shiftLeft64(carry[0], 26), new $Int64(h0.$high - x$12.$high, h0.$low - x$12.$low)); carry[2] = $shiftRightInt64((new $Int64(h2.$high + 0, h2.$low + 33554432)), 26); h3 = (x$13 = carry[2], new $Int64(h3.$high + x$13.$high, h3.$low + x$13.$low)); h2 = (x$14 = $shiftLeft64(carry[2], 26), new $Int64(h2.$high - x$14.$high, h2.$low - x$14.$low)); carry[4] = $shiftRightInt64((new $Int64(h4.$high + 0, h4.$low + 33554432)), 26); h5 = (x$15 = carry[4], new $Int64(h5.$high + x$15.$high, h5.$low + x$15.$low)); h4 = (x$16 = $shiftLeft64(carry[4], 26), new $Int64(h4.$high - x$16.$high, h4.$low - x$16.$low)); carry[6] = $shiftRightInt64((new $Int64(h6.$high + 0, h6.$low + 33554432)), 26); h7 = (x$17 = carry[6], new $Int64(h7.$high + x$17.$high, h7.$low + x$17.$low)); h6 = (x$18 = $shiftLeft64(carry[6], 26), new $Int64(h6.$high - x$18.$high, h6.$low - x$18.$low)); carry[8] = $shiftRightInt64((new $Int64(h8.$high + 0, h8.$low + 33554432)), 26); h9 = (x$19 = carry[8], new $Int64(h9.$high + x$19.$high, h9.$low + x$19.$low)); h8 = (x$20 = $shiftLeft64(carry[8], 26), new $Int64(h8.$high - x$20.$high, h8.$low - x$20.$low)); dst.nilCheck, dst[0] = (((h0.$low + ((h0.$high >> 31) * 4294967296)) >> 0)); dst.nilCheck, dst[1] = (((h1.$low + ((h1.$high >> 31) * 4294967296)) >> 0)); dst.nilCheck, dst[2] = (((h2.$low + ((h2.$high >> 31) * 4294967296)) >> 0)); dst.nilCheck, dst[3] = (((h3.$low + ((h3.$high >> 31) * 4294967296)) >> 0)); dst.nilCheck, dst[4] = (((h4.$low + ((h4.$high >> 31) * 4294967296)) >> 0)); dst.nilCheck, dst[5] = (((h5.$low + ((h5.$high >> 31) * 4294967296)) >> 0)); dst.nilCheck, dst[6] = (((h6.$low + ((h6.$high >> 31) * 4294967296)) >> 0)); dst.nilCheck, dst[7] = (((h7.$low + ((h7.$high >> 31) * 4294967296)) >> 0)); dst.nilCheck, dst[8] = (((h8.$low + ((h8.$high >> 31) * 4294967296)) >> 0)); dst.nilCheck, dst[9] = (((h9.$low + ((h9.$high >> 31) * 4294967296)) >> 0)); }; feToBytes = function(s, h) { var carry, h, q, s; carry = arrayType$1.zero(); q = ((($imul(19, h[9])) + 16777216 >> 0)) >> 25 >> 0; q = ((h[0] + q >> 0)) >> 26 >> 0; q = ((h[1] + q >> 0)) >> 25 >> 0; q = ((h[2] + q >> 0)) >> 26 >> 0; q = ((h[3] + q >> 0)) >> 25 >> 0; q = ((h[4] + q >> 0)) >> 26 >> 0; q = ((h[5] + q >> 0)) >> 25 >> 0; q = ((h[6] + q >> 0)) >> 26 >> 0; q = ((h[7] + q >> 0)) >> 25 >> 0; q = ((h[8] + q >> 0)) >> 26 >> 0; q = ((h[9] + q >> 0)) >> 25 >> 0; h[0] = (h[0] + (($imul(19, q))) >> 0); carry[0] = (h[0] >> 26 >> 0); h[1] = (h[1] + (carry[0]) >> 0); h[0] = (h[0] - ((carry[0] << 26 >> 0)) >> 0); carry[1] = (h[1] >> 25 >> 0); h[2] = (h[2] + (carry[1]) >> 0); h[1] = (h[1] - ((carry[1] << 25 >> 0)) >> 0); carry[2] = (h[2] >> 26 >> 0); h[3] = (h[3] + (carry[2]) >> 0); h[2] = (h[2] - ((carry[2] << 26 >> 0)) >> 0); carry[3] = (h[3] >> 25 >> 0); h[4] = (h[4] + (carry[3]) >> 0); h[3] = (h[3] - ((carry[3] << 25 >> 0)) >> 0); carry[4] = (h[4] >> 26 >> 0); h[5] = (h[5] + (carry[4]) >> 0); h[4] = (h[4] - ((carry[4] << 26 >> 0)) >> 0); carry[5] = (h[5] >> 25 >> 0); h[6] = (h[6] + (carry[5]) >> 0); h[5] = (h[5] - ((carry[5] << 25 >> 0)) >> 0); carry[6] = (h[6] >> 26 >> 0); h[7] = (h[7] + (carry[6]) >> 0); h[6] = (h[6] - ((carry[6] << 26 >> 0)) >> 0); carry[7] = (h[7] >> 25 >> 0); h[8] = (h[8] + (carry[7]) >> 0); h[7] = (h[7] - ((carry[7] << 25 >> 0)) >> 0); carry[8] = (h[8] >> 26 >> 0); h[9] = (h[9] + (carry[8]) >> 0); h[8] = (h[8] - ((carry[8] << 26 >> 0)) >> 0); carry[9] = (h[9] >> 25 >> 0); h[9] = (h[9] - ((carry[9] << 25 >> 0)) >> 0); s.nilCheck, s[0] = (((h[0] >> 0 >> 0) << 24 >>> 24)); s.nilCheck, s[1] = (((h[0] >> 8 >> 0) << 24 >>> 24)); s.nilCheck, s[2] = (((h[0] >> 16 >> 0) << 24 >>> 24)); s.nilCheck, s[3] = (((((h[0] >> 24 >> 0)) | ((h[1] << 2 >> 0))) << 24 >>> 24)); s.nilCheck, s[4] = (((h[1] >> 6 >> 0) << 24 >>> 24)); s.nilCheck, s[5] = (((h[1] >> 14 >> 0) << 24 >>> 24)); s.nilCheck, s[6] = (((((h[1] >> 22 >> 0)) | ((h[2] << 3 >> 0))) << 24 >>> 24)); s.nilCheck, s[7] = (((h[2] >> 5 >> 0) << 24 >>> 24)); s.nilCheck, s[8] = (((h[2] >> 13 >> 0) << 24 >>> 24)); s.nilCheck, s[9] = (((((h[2] >> 21 >> 0)) | ((h[3] << 5 >> 0))) << 24 >>> 24)); s.nilCheck, s[10] = (((h[3] >> 3 >> 0) << 24 >>> 24)); s.nilCheck, s[11] = (((h[3] >> 11 >> 0) << 24 >>> 24)); s.nilCheck, s[12] = (((((h[3] >> 19 >> 0)) | ((h[4] << 6 >> 0))) << 24 >>> 24)); s.nilCheck, s[13] = (((h[4] >> 2 >> 0) << 24 >>> 24)); s.nilCheck, s[14] = (((h[4] >> 10 >> 0) << 24 >>> 24)); s.nilCheck, s[15] = (((h[4] >> 18 >> 0) << 24 >>> 24)); s.nilCheck, s[16] = (((h[5] >> 0 >> 0) << 24 >>> 24)); s.nilCheck, s[17] = (((h[5] >> 8 >> 0) << 24 >>> 24)); s.nilCheck, s[18] = (((h[5] >> 16 >> 0) << 24 >>> 24)); s.nilCheck, s[19] = (((((h[5] >> 24 >> 0)) | ((h[6] << 1 >> 0))) << 24 >>> 24)); s.nilCheck, s[20] = (((h[6] >> 7 >> 0) << 24 >>> 24)); s.nilCheck, s[21] = (((h[6] >> 15 >> 0) << 24 >>> 24)); s.nilCheck, s[22] = (((((h[6] >> 23 >> 0)) | ((h[7] << 3 >> 0))) << 24 >>> 24)); s.nilCheck, s[23] = (((h[7] >> 5 >> 0) << 24 >>> 24)); s.nilCheck, s[24] = (((h[7] >> 13 >> 0) << 24 >>> 24)); s.nilCheck, s[25] = (((((h[7] >> 21 >> 0)) | ((h[8] << 4 >> 0))) << 24 >>> 24)); s.nilCheck, s[26] = (((h[8] >> 4 >> 0) << 24 >>> 24)); s.nilCheck, s[27] = (((h[8] >> 12 >> 0) << 24 >>> 24)); s.nilCheck, s[28] = (((((h[8] >> 20 >> 0)) | ((h[9] << 6 >> 0))) << 24 >>> 24)); s.nilCheck, s[29] = (((h[9] >> 2 >> 0) << 24 >>> 24)); s.nilCheck, s[30] = (((h[9] >> 10 >> 0) << 24 >>> 24)); s.nilCheck, s[31] = (((h[9] >> 18 >> 0) << 24 >>> 24)); }; feMul = function(h, f, g) { var carry, f, f0, f0g0, f0g1, f0g2, f0g3, f0g4, f0g5, f0g6, f0g7, f0g8, f0g9, f1, f1_2, f1g0, f1g1_2, f1g2, f1g3_2, f1g4, f1g5_2, f1g6, f1g7_2, f1g8, f1g9_38, f2, f2g0, f2g1, f2g2, f2g3, f2g4, f2g5, f2g6, f2g7, f2g8_19, f2g9_19, f3, f3_2, f3g0, f3g1_2, f3g2, f3g3_2, f3g4, f3g5_2, f3g6, f3g7_38, f3g8_19, f3g9_38, f4, f4g0, f4g1, f4g2, f4g3, f4g4, f4g5, f4g6_19, f4g7_19, f4g8_19, f4g9_19, f5, f5_2, f5g0, f5g1_2, f5g2, f5g3_2, f5g4, f5g5_38, f5g6_19, f5g7_38, f5g8_19, f5g9_38, f6, f6g0, f6g1, f6g2, f6g3, f6g4_19, f6g5_19, f6g6_19, f6g7_19, f6g8_19, f6g9_19, f7, f7_2, f7g0, f7g1_2, f7g2, f7g3_38, f7g4_19, f7g5_38, f7g6_19, f7g7_38, f7g8_19, f7g9_38, f8, f8g0, f8g1, f8g2_19, f8g3_19, f8g4_19, f8g5_19, f8g6_19, f8g7_19, f8g8_19, f8g9_19, f9, f9_2, f9g0, f9g1_38, f9g2_19, f9g3_38, f9g4_19, f9g5_38, f9g6_19, f9g7_38, f9g8_19, f9g9_38, g, g0, g1, g1_19, g2, g2_19, g3, g3_19, g4, g4_19, g5, g5_19, g6, g6_19, g7, g7_19, g8, g8_19, g9, g9_19, h, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9, x, x$1, x$10, x$100, x$101, x$102, x$103, 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$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; f0 = f[0]; f1 = f[1]; f2 = f[2]; f3 = f[3]; f4 = f[4]; f5 = f[5]; f6 = f[6]; f7 = f[7]; f8 = f[8]; f9 = f[9]; g0 = g[0]; g1 = g[1]; g2 = g[2]; g3 = g[3]; g4 = g[4]; g5 = g[5]; g6 = g[6]; g7 = g[7]; g8 = g[8]; g9 = g[9]; g1_19 = $imul(19, g1); g2_19 = $imul(19, g2); g3_19 = $imul(19, g3); g4_19 = $imul(19, g4); g5_19 = $imul(19, g5); g6_19 = $imul(19, g6); g7_19 = $imul(19, g7); g8_19 = $imul(19, g8); g9_19 = $imul(19, g9); f1_2 = $imul(2, f1); f3_2 = $imul(2, f3); f5_2 = $imul(2, f5); f7_2 = $imul(2, f7); f9_2 = $imul(2, f9); f0g0 = $mul64((new $Int64(0, f0)), (new $Int64(0, g0))); f0g1 = $mul64((new $Int64(0, f0)), (new $Int64(0, g1))); f0g2 = $mul64((new $Int64(0, f0)), (new $Int64(0, g2))); f0g3 = $mul64((new $Int64(0, f0)), (new $Int64(0, g3))); f0g4 = $mul64((new $Int64(0, f0)), (new $Int64(0, g4))); f0g5 = $mul64((new $Int64(0, f0)), (new $Int64(0, g5))); f0g6 = $mul64((new $Int64(0, f0)), (new $Int64(0, g6))); f0g7 = $mul64((new $Int64(0, f0)), (new $Int64(0, g7))); f0g8 = $mul64((new $Int64(0, f0)), (new $Int64(0, g8))); f0g9 = $mul64((new $Int64(0, f0)), (new $Int64(0, g9))); f1g0 = $mul64((new $Int64(0, f1)), (new $Int64(0, g0))); f1g1_2 = $mul64((new $Int64(0, f1_2)), (new $Int64(0, g1))); f1g2 = $mul64((new $Int64(0, f1)), (new $Int64(0, g2))); f1g3_2 = $mul64((new $Int64(0, f1_2)), (new $Int64(0, g3))); f1g4 = $mul64((new $Int64(0, f1)), (new $Int64(0, g4))); f1g5_2 = $mul64((new $Int64(0, f1_2)), (new $Int64(0, g5))); f1g6 = $mul64((new $Int64(0, f1)), (new $Int64(0, g6))); f1g7_2 = $mul64((new $Int64(0, f1_2)), (new $Int64(0, g7))); f1g8 = $mul64((new $Int64(0, f1)), (new $Int64(0, g8))); f1g9_38 = $mul64((new $Int64(0, f1_2)), (new $Int64(0, g9_19))); f2g0 = $mul64((new $Int64(0, f2)), (new $Int64(0, g0))); f2g1 = $mul64((new $Int64(0, f2)), (new $Int64(0, g1))); f2g2 = $mul64((new $Int64(0, f2)), (new $Int64(0, g2))); f2g3 = $mul64((new $Int64(0, f2)), (new $Int64(0, g3))); f2g4 = $mul64((new $Int64(0, f2)), (new $Int64(0, g4))); f2g5 = $mul64((new $Int64(0, f2)), (new $Int64(0, g5))); f2g6 = $mul64((new $Int64(0, f2)), (new $Int64(0, g6))); f2g7 = $mul64((new $Int64(0, f2)), (new $Int64(0, g7))); f2g8_19 = $mul64((new $Int64(0, f2)), (new $Int64(0, g8_19))); f2g9_19 = $mul64((new $Int64(0, f2)), (new $Int64(0, g9_19))); f3g0 = $mul64((new $Int64(0, f3)), (new $Int64(0, g0))); f3g1_2 = $mul64((new $Int64(0, f3_2)), (new $Int64(0, g1))); f3g2 = $mul64((new $Int64(0, f3)), (new $Int64(0, g2))); f3g3_2 = $mul64((new $Int64(0, f3_2)), (new $Int64(0, g3))); f3g4 = $mul64((new $Int64(0, f3)), (new $Int64(0, g4))); f3g5_2 = $mul64((new $Int64(0, f3_2)), (new $Int64(0, g5))); f3g6 = $mul64((new $Int64(0, f3)), (new $Int64(0, g6))); f3g7_38 = $mul64((new $Int64(0, f3_2)), (new $Int64(0, g7_19))); f3g8_19 = $mul64((new $Int64(0, f3)), (new $Int64(0, g8_19))); f3g9_38 = $mul64((new $Int64(0, f3_2)), (new $Int64(0, g9_19))); f4g0 = $mul64((new $Int64(0, f4)), (new $Int64(0, g0))); f4g1 = $mul64((new $Int64(0, f4)), (new $Int64(0, g1))); f4g2 = $mul64((new $Int64(0, f4)), (new $Int64(0, g2))); f4g3 = $mul64((new $Int64(0, f4)), (new $Int64(0, g3))); f4g4 = $mul64((new $Int64(0, f4)), (new $Int64(0, g4))); f4g5 = $mul64((new $Int64(0, f4)), (new $Int64(0, g5))); f4g6_19 = $mul64((new $Int64(0, f4)), (new $Int64(0, g6_19))); f4g7_19 = $mul64((new $Int64(0, f4)), (new $Int64(0, g7_19))); f4g8_19 = $mul64((new $Int64(0, f4)), (new $Int64(0, g8_19))); f4g9_19 = $mul64((new $Int64(0, f4)), (new $Int64(0, g9_19))); f5g0 = $mul64((new $Int64(0, f5)), (new $Int64(0, g0))); f5g1_2 = $mul64((new $Int64(0, f5_2)), (new $Int64(0, g1))); f5g2 = $mul64((new $Int64(0, f5)), (new $Int64(0, g2))); f5g3_2 = $mul64((new $Int64(0, f5_2)), (new $Int64(0, g3))); f5g4 = $mul64((new $Int64(0, f5)), (new $Int64(0, g4))); f5g5_38 = $mul64((new $Int64(0, f5_2)), (new $Int64(0, g5_19))); f5g6_19 = $mul64((new $Int64(0, f5)), (new $Int64(0, g6_19))); f5g7_38 = $mul64((new $Int64(0, f5_2)), (new $Int64(0, g7_19))); f5g8_19 = $mul64((new $Int64(0, f5)), (new $Int64(0, g8_19))); f5g9_38 = $mul64((new $Int64(0, f5_2)), (new $Int64(0, g9_19))); f6g0 = $mul64((new $Int64(0, f6)), (new $Int64(0, g0))); f6g1 = $mul64((new $Int64(0, f6)), (new $Int64(0, g1))); f6g2 = $mul64((new $Int64(0, f6)), (new $Int64(0, g2))); f6g3 = $mul64((new $Int64(0, f6)), (new $Int64(0, g3))); f6g4_19 = $mul64((new $Int64(0, f6)), (new $Int64(0, g4_19))); f6g5_19 = $mul64((new $Int64(0, f6)), (new $Int64(0, g5_19))); f6g6_19 = $mul64((new $Int64(0, f6)), (new $Int64(0, g6_19))); f6g7_19 = $mul64((new $Int64(0, f6)), (new $Int64(0, g7_19))); f6g8_19 = $mul64((new $Int64(0, f6)), (new $Int64(0, g8_19))); f6g9_19 = $mul64((new $Int64(0, f6)), (new $Int64(0, g9_19))); f7g0 = $mul64((new $Int64(0, f7)), (new $Int64(0, g0))); f7g1_2 = $mul64((new $Int64(0, f7_2)), (new $Int64(0, g1))); f7g2 = $mul64((new $Int64(0, f7)), (new $Int64(0, g2))); f7g3_38 = $mul64((new $Int64(0, f7_2)), (new $Int64(0, g3_19))); f7g4_19 = $mul64((new $Int64(0, f7)), (new $Int64(0, g4_19))); f7g5_38 = $mul64((new $Int64(0, f7_2)), (new $Int64(0, g5_19))); f7g6_19 = $mul64((new $Int64(0, f7)), (new $Int64(0, g6_19))); f7g7_38 = $mul64((new $Int64(0, f7_2)), (new $Int64(0, g7_19))); f7g8_19 = $mul64((new $Int64(0, f7)), (new $Int64(0, g8_19))); f7g9_38 = $mul64((new $Int64(0, f7_2)), (new $Int64(0, g9_19))); f8g0 = $mul64((new $Int64(0, f8)), (new $Int64(0, g0))); f8g1 = $mul64((new $Int64(0, f8)), (new $Int64(0, g1))); f8g2_19 = $mul64((new $Int64(0, f8)), (new $Int64(0, g2_19))); f8g3_19 = $mul64((new $Int64(0, f8)), (new $Int64(0, g3_19))); f8g4_19 = $mul64((new $Int64(0, f8)), (new $Int64(0, g4_19))); f8g5_19 = $mul64((new $Int64(0, f8)), (new $Int64(0, g5_19))); f8g6_19 = $mul64((new $Int64(0, f8)), (new $Int64(0, g6_19))); f8g7_19 = $mul64((new $Int64(0, f8)), (new $Int64(0, g7_19))); f8g8_19 = $mul64((new $Int64(0, f8)), (new $Int64(0, g8_19))); f8g9_19 = $mul64((new $Int64(0, f8)), (new $Int64(0, g9_19))); f9g0 = $mul64((new $Int64(0, f9)), (new $Int64(0, g0))); f9g1_38 = $mul64((new $Int64(0, f9_2)), (new $Int64(0, g1_19))); f9g2_19 = $mul64((new $Int64(0, f9)), (new $Int64(0, g2_19))); f9g3_38 = $mul64((new $Int64(0, f9_2)), (new $Int64(0, g3_19))); f9g4_19 = $mul64((new $Int64(0, f9)), (new $Int64(0, g4_19))); f9g5_38 = $mul64((new $Int64(0, f9_2)), (new $Int64(0, g5_19))); f9g6_19 = $mul64((new $Int64(0, f9)), (new $Int64(0, g6_19))); f9g7_38 = $mul64((new $Int64(0, f9_2)), (new $Int64(0, g7_19))); f9g8_19 = $mul64((new $Int64(0, f9)), (new $Int64(0, g8_19))); f9g9_38 = $mul64((new $Int64(0, f9_2)), (new $Int64(0, g9_19))); h0 = (x = (x$1 = (x$2 = (x$3 = (x$4 = (x$5 = (x$6 = (x$7 = new $Int64(f0g0.$high + f1g9_38.$high, f0g0.$low + f1g9_38.$low), new $Int64(x$7.$high + f2g8_19.$high, x$7.$low + f2g8_19.$low)), new $Int64(x$6.$high + f3g7_38.$high, x$6.$low + f3g7_38.$low)), new $Int64(x$5.$high + f4g6_19.$high, x$5.$low + f4g6_19.$low)), new $Int64(x$4.$high + f5g5_38.$high, x$4.$low + f5g5_38.$low)), new $Int64(x$3.$high + f6g4_19.$high, x$3.$low + f6g4_19.$low)), new $Int64(x$2.$high + f7g3_38.$high, x$2.$low + f7g3_38.$low)), new $Int64(x$1.$high + f8g2_19.$high, x$1.$low + f8g2_19.$low)), new $Int64(x.$high + f9g1_38.$high, x.$low + f9g1_38.$low)); h1 = (x$8 = (x$9 = (x$10 = (x$11 = (x$12 = (x$13 = (x$14 = (x$15 = new $Int64(f0g1.$high + f1g0.$high, f0g1.$low + f1g0.$low), new $Int64(x$15.$high + f2g9_19.$high, x$15.$low + f2g9_19.$low)), new $Int64(x$14.$high + f3g8_19.$high, x$14.$low + f3g8_19.$low)), new $Int64(x$13.$high + f4g7_19.$high, x$13.$low + f4g7_19.$low)), new $Int64(x$12.$high + f5g6_19.$high, x$12.$low + f5g6_19.$low)), new $Int64(x$11.$high + f6g5_19.$high, x$11.$low + f6g5_19.$low)), new $Int64(x$10.$high + f7g4_19.$high, x$10.$low + f7g4_19.$low)), new $Int64(x$9.$high + f8g3_19.$high, x$9.$low + f8g3_19.$low)), new $Int64(x$8.$high + f9g2_19.$high, x$8.$low + f9g2_19.$low)); h2 = (x$16 = (x$17 = (x$18 = (x$19 = (x$20 = (x$21 = (x$22 = (x$23 = new $Int64(f0g2.$high + f1g1_2.$high, f0g2.$low + f1g1_2.$low), new $Int64(x$23.$high + f2g0.$high, x$23.$low + f2g0.$low)), new $Int64(x$22.$high + f3g9_38.$high, x$22.$low + f3g9_38.$low)), new $Int64(x$21.$high + f4g8_19.$high, x$21.$low + f4g8_19.$low)), new $Int64(x$20.$high + f5g7_38.$high, x$20.$low + f5g7_38.$low)), new $Int64(x$19.$high + f6g6_19.$high, x$19.$low + f6g6_19.$low)), new $Int64(x$18.$high + f7g5_38.$high, x$18.$low + f7g5_38.$low)), new $Int64(x$17.$high + f8g4_19.$high, x$17.$low + f8g4_19.$low)), new $Int64(x$16.$high + f9g3_38.$high, x$16.$low + f9g3_38.$low)); h3 = (x$24 = (x$25 = (x$26 = (x$27 = (x$28 = (x$29 = (x$30 = (x$31 = new $Int64(f0g3.$high + f1g2.$high, f0g3.$low + f1g2.$low), new $Int64(x$31.$high + f2g1.$high, x$31.$low + f2g1.$low)), new $Int64(x$30.$high + f3g0.$high, x$30.$low + f3g0.$low)), new $Int64(x$29.$high + f4g9_19.$high, x$29.$low + f4g9_19.$low)), new $Int64(x$28.$high + f5g8_19.$high, x$28.$low + f5g8_19.$low)), new $Int64(x$27.$high + f6g7_19.$high, x$27.$low + f6g7_19.$low)), new $Int64(x$26.$high + f7g6_19.$high, x$26.$low + f7g6_19.$low)), new $Int64(x$25.$high + f8g5_19.$high, x$25.$low + f8g5_19.$low)), new $Int64(x$24.$high + f9g4_19.$high, x$24.$low + f9g4_19.$low)); h4 = (x$32 = (x$33 = (x$34 = (x$35 = (x$36 = (x$37 = (x$38 = (x$39 = new $Int64(f0g4.$high + f1g3_2.$high, f0g4.$low + f1g3_2.$low), new $Int64(x$39.$high + f2g2.$high, x$39.$low + f2g2.$low)), new $Int64(x$38.$high + f3g1_2.$high, x$38.$low + f3g1_2.$low)), new $Int64(x$37.$high + f4g0.$high, x$37.$low + f4g0.$low)), new $Int64(x$36.$high + f5g9_38.$high, x$36.$low + f5g9_38.$low)), new $Int64(x$35.$high + f6g8_19.$high, x$35.$low + f6g8_19.$low)), new $Int64(x$34.$high + f7g7_38.$high, x$34.$low + f7g7_38.$low)), new $Int64(x$33.$high + f8g6_19.$high, x$33.$low + f8g6_19.$low)), new $Int64(x$32.$high + f9g5_38.$high, x$32.$low + f9g5_38.$low)); h5 = (x$40 = (x$41 = (x$42 = (x$43 = (x$44 = (x$45 = (x$46 = (x$47 = new $Int64(f0g5.$high + f1g4.$high, f0g5.$low + f1g4.$low), new $Int64(x$47.$high + f2g3.$high, x$47.$low + f2g3.$low)), new $Int64(x$46.$high + f3g2.$high, x$46.$low + f3g2.$low)), new $Int64(x$45.$high + f4g1.$high, x$45.$low + f4g1.$low)), new $Int64(x$44.$high + f5g0.$high, x$44.$low + f5g0.$low)), new $Int64(x$43.$high + f6g9_19.$high, x$43.$low + f6g9_19.$low)), new $Int64(x$42.$high + f7g8_19.$high, x$42.$low + f7g8_19.$low)), new $Int64(x$41.$high + f8g7_19.$high, x$41.$low + f8g7_19.$low)), new $Int64(x$40.$high + f9g6_19.$high, x$40.$low + f9g6_19.$low)); h6 = (x$48 = (x$49 = (x$50 = (x$51 = (x$52 = (x$53 = (x$54 = (x$55 = new $Int64(f0g6.$high + f1g5_2.$high, f0g6.$low + f1g5_2.$low), new $Int64(x$55.$high + f2g4.$high, x$55.$low + f2g4.$low)), new $Int64(x$54.$high + f3g3_2.$high, x$54.$low + f3g3_2.$low)), new $Int64(x$53.$high + f4g2.$high, x$53.$low + f4g2.$low)), new $Int64(x$52.$high + f5g1_2.$high, x$52.$low + f5g1_2.$low)), new $Int64(x$51.$high + f6g0.$high, x$51.$low + f6g0.$low)), new $Int64(x$50.$high + f7g9_38.$high, x$50.$low + f7g9_38.$low)), new $Int64(x$49.$high + f8g8_19.$high, x$49.$low + f8g8_19.$low)), new $Int64(x$48.$high + f9g7_38.$high, x$48.$low + f9g7_38.$low)); h7 = (x$56 = (x$57 = (x$58 = (x$59 = (x$60 = (x$61 = (x$62 = (x$63 = new $Int64(f0g7.$high + f1g6.$high, f0g7.$low + f1g6.$low), new $Int64(x$63.$high + f2g5.$high, x$63.$low + f2g5.$low)), new $Int64(x$62.$high + f3g4.$high, x$62.$low + f3g4.$low)), new $Int64(x$61.$high + f4g3.$high, x$61.$low + f4g3.$low)), new $Int64(x$60.$high + f5g2.$high, x$60.$low + f5g2.$low)), new $Int64(x$59.$high + f6g1.$high, x$59.$low + f6g1.$low)), new $Int64(x$58.$high + f7g0.$high, x$58.$low + f7g0.$low)), new $Int64(x$57.$high + f8g9_19.$high, x$57.$low + f8g9_19.$low)), new $Int64(x$56.$high + f9g8_19.$high, x$56.$low + f9g8_19.$low)); h8 = (x$64 = (x$65 = (x$66 = (x$67 = (x$68 = (x$69 = (x$70 = (x$71 = new $Int64(f0g8.$high + f1g7_2.$high, f0g8.$low + f1g7_2.$low), new $Int64(x$71.$high + f2g6.$high, x$71.$low + f2g6.$low)), new $Int64(x$70.$high + f3g5_2.$high, x$70.$low + f3g5_2.$low)), new $Int64(x$69.$high + f4g4.$high, x$69.$low + f4g4.$low)), new $Int64(x$68.$high + f5g3_2.$high, x$68.$low + f5g3_2.$low)), new $Int64(x$67.$high + f6g2.$high, x$67.$low + f6g2.$low)), new $Int64(x$66.$high + f7g1_2.$high, x$66.$low + f7g1_2.$low)), new $Int64(x$65.$high + f8g0.$high, x$65.$low + f8g0.$low)), new $Int64(x$64.$high + f9g9_38.$high, x$64.$low + f9g9_38.$low)); h9 = (x$72 = (x$73 = (x$74 = (x$75 = (x$76 = (x$77 = (x$78 = (x$79 = new $Int64(f0g9.$high + f1g8.$high, f0g9.$low + f1g8.$low), new $Int64(x$79.$high + f2g7.$high, x$79.$low + f2g7.$low)), new $Int64(x$78.$high + f3g6.$high, x$78.$low + f3g6.$low)), new $Int64(x$77.$high + f4g5.$high, x$77.$low + f4g5.$low)), new $Int64(x$76.$high + f5g4.$high, x$76.$low + f5g4.$low)), new $Int64(x$75.$high + f6g3.$high, x$75.$low + f6g3.$low)), new $Int64(x$74.$high + f7g2.$high, x$74.$low + f7g2.$low)), new $Int64(x$73.$high + f8g1.$high, x$73.$low + f8g1.$low)), new $Int64(x$72.$high + f9g0.$high, x$72.$low + f9g0.$low)); carry = arrayType.zero(); carry[0] = $shiftRightInt64((new $Int64(h0.$high + 0, h0.$low + 33554432)), 26); h1 = (x$80 = carry[0], new $Int64(h1.$high + x$80.$high, h1.$low + x$80.$low)); h0 = (x$81 = $shiftLeft64(carry[0], 26), new $Int64(h0.$high - x$81.$high, h0.$low - x$81.$low)); carry[4] = $shiftRightInt64((new $Int64(h4.$high + 0, h4.$low + 33554432)), 26); h5 = (x$82 = carry[4], new $Int64(h5.$high + x$82.$high, h5.$low + x$82.$low)); h4 = (x$83 = $shiftLeft64(carry[4], 26), new $Int64(h4.$high - x$83.$high, h4.$low - x$83.$low)); carry[1] = $shiftRightInt64((new $Int64(h1.$high + 0, h1.$low + 16777216)), 25); h2 = (x$84 = carry[1], new $Int64(h2.$high + x$84.$high, h2.$low + x$84.$low)); h1 = (x$85 = $shiftLeft64(carry[1], 25), new $Int64(h1.$high - x$85.$high, h1.$low - x$85.$low)); carry[5] = $shiftRightInt64((new $Int64(h5.$high + 0, h5.$low + 16777216)), 25); h6 = (x$86 = carry[5], new $Int64(h6.$high + x$86.$high, h6.$low + x$86.$low)); h5 = (x$87 = $shiftLeft64(carry[5], 25), new $Int64(h5.$high - x$87.$high, h5.$low - x$87.$low)); carry[2] = $shiftRightInt64((new $Int64(h2.$high + 0, h2.$low + 33554432)), 26); h3 = (x$88 = carry[2], new $Int64(h3.$high + x$88.$high, h3.$low + x$88.$low)); h2 = (x$89 = $shiftLeft64(carry[2], 26), new $Int64(h2.$high - x$89.$high, h2.$low - x$89.$low)); carry[6] = $shiftRightInt64((new $Int64(h6.$high + 0, h6.$low + 33554432)), 26); h7 = (x$90 = carry[6], new $Int64(h7.$high + x$90.$high, h7.$low + x$90.$low)); h6 = (x$91 = $shiftLeft64(carry[6], 26), new $Int64(h6.$high - x$91.$high, h6.$low - x$91.$low)); carry[3] = $shiftRightInt64((new $Int64(h3.$high + 0, h3.$low + 16777216)), 25); h4 = (x$92 = carry[3], new $Int64(h4.$high + x$92.$high, h4.$low + x$92.$low)); h3 = (x$93 = $shiftLeft64(carry[3], 25), new $Int64(h3.$high - x$93.$high, h3.$low - x$93.$low)); carry[7] = $shiftRightInt64((new $Int64(h7.$high + 0, h7.$low + 16777216)), 25); h8 = (x$94 = carry[7], new $Int64(h8.$high + x$94.$high, h8.$low + x$94.$low)); h7 = (x$95 = $shiftLeft64(carry[7], 25), new $Int64(h7.$high - x$95.$high, h7.$low - x$95.$low)); carry[4] = $shiftRightInt64((new $Int64(h4.$high + 0, h4.$low + 33554432)), 26); h5 = (x$96 = carry[4], new $Int64(h5.$high + x$96.$high, h5.$low + x$96.$low)); h4 = (x$97 = $shiftLeft64(carry[4], 26), new $Int64(h4.$high - x$97.$high, h4.$low - x$97.$low)); carry[8] = $shiftRightInt64((new $Int64(h8.$high + 0, h8.$low + 33554432)), 26); h9 = (x$98 = carry[8], new $Int64(h9.$high + x$98.$high, h9.$low + x$98.$low)); h8 = (x$99 = $shiftLeft64(carry[8], 26), new $Int64(h8.$high - x$99.$high, h8.$low - x$99.$low)); carry[9] = $shiftRightInt64((new $Int64(h9.$high + 0, h9.$low + 16777216)), 25); h0 = (x$100 = $mul64(carry[9], new $Int64(0, 19)), new $Int64(h0.$high + x$100.$high, h0.$low + x$100.$low)); h9 = (x$101 = $shiftLeft64(carry[9], 25), new $Int64(h9.$high - x$101.$high, h9.$low - x$101.$low)); carry[0] = $shiftRightInt64((new $Int64(h0.$high + 0, h0.$low + 33554432)), 26); h1 = (x$102 = carry[0], new $Int64(h1.$high + x$102.$high, h1.$low + x$102.$low)); h0 = (x$103 = $shiftLeft64(carry[0], 26), new $Int64(h0.$high - x$103.$high, h0.$low - x$103.$low)); h.nilCheck, h[0] = (((h0.$low + ((h0.$high >> 31) * 4294967296)) >> 0)); h.nilCheck, h[1] = (((h1.$low + ((h1.$high >> 31) * 4294967296)) >> 0)); h.nilCheck, h[2] = (((h2.$low + ((h2.$high >> 31) * 4294967296)) >> 0)); h.nilCheck, h[3] = (((h3.$low + ((h3.$high >> 31) * 4294967296)) >> 0)); h.nilCheck, h[4] = (((h4.$low + ((h4.$high >> 31) * 4294967296)) >> 0)); h.nilCheck, h[5] = (((h5.$low + ((h5.$high >> 31) * 4294967296)) >> 0)); h.nilCheck, h[6] = (((h6.$low + ((h6.$high >> 31) * 4294967296)) >> 0)); h.nilCheck, h[7] = (((h7.$low + ((h7.$high >> 31) * 4294967296)) >> 0)); h.nilCheck, h[8] = (((h8.$low + ((h8.$high >> 31) * 4294967296)) >> 0)); h.nilCheck, h[9] = (((h9.$low + ((h9.$high >> 31) * 4294967296)) >> 0)); }; feSquare = function(h, f) { var carry, f, f0, f0_2, f0f0, f0f1_2, f0f2_2, f0f3_2, f0f4_2, f0f5_2, f0f6_2, f0f7_2, f0f8_2, f0f9_2, f1, f1_2, f1f1_2, f1f2_2, f1f3_4, f1f4_2, f1f5_4, f1f6_2, f1f7_4, f1f8_2, f1f9_76, f2, f2_2, f2f2, f2f3_2, f2f4_2, f2f5_2, f2f6_2, f2f7_2, f2f8_38, f2f9_38, f3, f3_2, f3f3_2, f3f4_2, f3f5_4, f3f6_2, f3f7_76, f3f8_38, f3f9_76, f4, f4_2, f4f4, f4f5_2, f4f6_38, f4f7_38, f4f8_38, f4f9_38, f5, f5_2, f5_38, f5f5_38, f5f6_38, f5f7_76, f5f8_38, f5f9_76, f6, f6_19, f6_2, f6f6_19, f6f7_38, f6f8_38, f6f9_38, f7, f7_2, f7_38, f7f7_38, f7f8_38, f7f9_76, f8, f8_19, f8f8_19, f8f9_38, f9, f9_38, f9f9_38, h, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9, 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$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$6, x$7, x$8, x$9; f0 = f[0]; f1 = f[1]; f2 = f[2]; f3 = f[3]; f4 = f[4]; f5 = f[5]; f6 = f[6]; f7 = f[7]; f8 = f[8]; f9 = f[9]; f0_2 = $imul(2, f0); f1_2 = $imul(2, f1); f2_2 = $imul(2, f2); f3_2 = $imul(2, f3); f4_2 = $imul(2, f4); f5_2 = $imul(2, f5); f6_2 = $imul(2, f6); f7_2 = $imul(2, f7); f5_38 = $imul(38, f5); f6_19 = $imul(19, f6); f7_38 = $imul(38, f7); f8_19 = $imul(19, f8); f9_38 = $imul(38, f9); f0f0 = $mul64((new $Int64(0, f0)), (new $Int64(0, f0))); f0f1_2 = $mul64((new $Int64(0, f0_2)), (new $Int64(0, f1))); f0f2_2 = $mul64((new $Int64(0, f0_2)), (new $Int64(0, f2))); f0f3_2 = $mul64((new $Int64(0, f0_2)), (new $Int64(0, f3))); f0f4_2 = $mul64((new $Int64(0, f0_2)), (new $Int64(0, f4))); f0f5_2 = $mul64((new $Int64(0, f0_2)), (new $Int64(0, f5))); f0f6_2 = $mul64((new $Int64(0, f0_2)), (new $Int64(0, f6))); f0f7_2 = $mul64((new $Int64(0, f0_2)), (new $Int64(0, f7))); f0f8_2 = $mul64((new $Int64(0, f0_2)), (new $Int64(0, f8))); f0f9_2 = $mul64((new $Int64(0, f0_2)), (new $Int64(0, f9))); f1f1_2 = $mul64((new $Int64(0, f1_2)), (new $Int64(0, f1))); f1f2_2 = $mul64((new $Int64(0, f1_2)), (new $Int64(0, f2))); f1f3_4 = $mul64((new $Int64(0, f1_2)), (new $Int64(0, f3_2))); f1f4_2 = $mul64((new $Int64(0, f1_2)), (new $Int64(0, f4))); f1f5_4 = $mul64((new $Int64(0, f1_2)), (new $Int64(0, f5_2))); f1f6_2 = $mul64((new $Int64(0, f1_2)), (new $Int64(0, f6))); f1f7_4 = $mul64((new $Int64(0, f1_2)), (new $Int64(0, f7_2))); f1f8_2 = $mul64((new $Int64(0, f1_2)), (new $Int64(0, f8))); f1f9_76 = $mul64((new $Int64(0, f1_2)), (new $Int64(0, f9_38))); f2f2 = $mul64((new $Int64(0, f2)), (new $Int64(0, f2))); f2f3_2 = $mul64((new $Int64(0, f2_2)), (new $Int64(0, f3))); f2f4_2 = $mul64((new $Int64(0, f2_2)), (new $Int64(0, f4))); f2f5_2 = $mul64((new $Int64(0, f2_2)), (new $Int64(0, f5))); f2f6_2 = $mul64((new $Int64(0, f2_2)), (new $Int64(0, f6))); f2f7_2 = $mul64((new $Int64(0, f2_2)), (new $Int64(0, f7))); f2f8_38 = $mul64((new $Int64(0, f2_2)), (new $Int64(0, f8_19))); f2f9_38 = $mul64((new $Int64(0, f2)), (new $Int64(0, f9_38))); f3f3_2 = $mul64((new $Int64(0, f3_2)), (new $Int64(0, f3))); f3f4_2 = $mul64((new $Int64(0, f3_2)), (new $Int64(0, f4))); f3f5_4 = $mul64((new $Int64(0, f3_2)), (new $Int64(0, f5_2))); f3f6_2 = $mul64((new $Int64(0, f3_2)), (new $Int64(0, f6))); f3f7_76 = $mul64((new $Int64(0, f3_2)), (new $Int64(0, f7_38))); f3f8_38 = $mul64((new $Int64(0, f3_2)), (new $Int64(0, f8_19))); f3f9_76 = $mul64((new $Int64(0, f3_2)), (new $Int64(0, f9_38))); f4f4 = $mul64((new $Int64(0, f4)), (new $Int64(0, f4))); f4f5_2 = $mul64((new $Int64(0, f4_2)), (new $Int64(0, f5))); f4f6_38 = $mul64((new $Int64(0, f4_2)), (new $Int64(0, f6_19))); f4f7_38 = $mul64((new $Int64(0, f4)), (new $Int64(0, f7_38))); f4f8_38 = $mul64((new $Int64(0, f4_2)), (new $Int64(0, f8_19))); f4f9_38 = $mul64((new $Int64(0, f4)), (new $Int64(0, f9_38))); f5f5_38 = $mul64((new $Int64(0, f5)), (new $Int64(0, f5_38))); f5f6_38 = $mul64((new $Int64(0, f5_2)), (new $Int64(0, f6_19))); f5f7_76 = $mul64((new $Int64(0, f5_2)), (new $Int64(0, f7_38))); f5f8_38 = $mul64((new $Int64(0, f5_2)), (new $Int64(0, f8_19))); f5f9_76 = $mul64((new $Int64(0, f5_2)), (new $Int64(0, f9_38))); f6f6_19 = $mul64((new $Int64(0, f6)), (new $Int64(0, f6_19))); f6f7_38 = $mul64((new $Int64(0, f6)), (new $Int64(0, f7_38))); f6f8_38 = $mul64((new $Int64(0, f6_2)), (new $Int64(0, f8_19))); f6f9_38 = $mul64((new $Int64(0, f6)), (new $Int64(0, f9_38))); f7f7_38 = $mul64((new $Int64(0, f7)), (new $Int64(0, f7_38))); f7f8_38 = $mul64((new $Int64(0, f7_2)), (new $Int64(0, f8_19))); f7f9_76 = $mul64((new $Int64(0, f7_2)), (new $Int64(0, f9_38))); f8f8_19 = $mul64((new $Int64(0, f8)), (new $Int64(0, f8_19))); f8f9_38 = $mul64((new $Int64(0, f8)), (new $Int64(0, f9_38))); f9f9_38 = $mul64((new $Int64(0, f9)), (new $Int64(0, f9_38))); h0 = (x = (x$1 = (x$2 = (x$3 = new $Int64(f0f0.$high + f1f9_76.$high, f0f0.$low + f1f9_76.$low), new $Int64(x$3.$high + f2f8_38.$high, x$3.$low + f2f8_38.$low)), new $Int64(x$2.$high + f3f7_76.$high, x$2.$low + f3f7_76.$low)), new $Int64(x$1.$high + f4f6_38.$high, x$1.$low + f4f6_38.$low)), new $Int64(x.$high + f5f5_38.$high, x.$low + f5f5_38.$low)); h1 = (x$4 = (x$5 = (x$6 = new $Int64(f0f1_2.$high + f2f9_38.$high, f0f1_2.$low + f2f9_38.$low), new $Int64(x$6.$high + f3f8_38.$high, x$6.$low + f3f8_38.$low)), new $Int64(x$5.$high + f4f7_38.$high, x$5.$low + f4f7_38.$low)), new $Int64(x$4.$high + f5f6_38.$high, x$4.$low + f5f6_38.$low)); h2 = (x$7 = (x$8 = (x$9 = (x$10 = new $Int64(f0f2_2.$high + f1f1_2.$high, f0f2_2.$low + f1f1_2.$low), new $Int64(x$10.$high + f3f9_76.$high, x$10.$low + f3f9_76.$low)), new $Int64(x$9.$high + f4f8_38.$high, x$9.$low + f4f8_38.$low)), new $Int64(x$8.$high + f5f7_76.$high, x$8.$low + f5f7_76.$low)), new $Int64(x$7.$high + f6f6_19.$high, x$7.$low + f6f6_19.$low)); h3 = (x$11 = (x$12 = (x$13 = new $Int64(f0f3_2.$high + f1f2_2.$high, f0f3_2.$low + f1f2_2.$low), new $Int64(x$13.$high + f4f9_38.$high, x$13.$low + f4f9_38.$low)), new $Int64(x$12.$high + f5f8_38.$high, x$12.$low + f5f8_38.$low)), new $Int64(x$11.$high + f6f7_38.$high, x$11.$low + f6f7_38.$low)); h4 = (x$14 = (x$15 = (x$16 = (x$17 = new $Int64(f0f4_2.$high + f1f3_4.$high, f0f4_2.$low + f1f3_4.$low), new $Int64(x$17.$high + f2f2.$high, x$17.$low + f2f2.$low)), new $Int64(x$16.$high + f5f9_76.$high, x$16.$low + f5f9_76.$low)), new $Int64(x$15.$high + f6f8_38.$high, x$15.$low + f6f8_38.$low)), new $Int64(x$14.$high + f7f7_38.$high, x$14.$low + f7f7_38.$low)); h5 = (x$18 = (x$19 = (x$20 = new $Int64(f0f5_2.$high + f1f4_2.$high, f0f5_2.$low + f1f4_2.$low), new $Int64(x$20.$high + f2f3_2.$high, x$20.$low + f2f3_2.$low)), new $Int64(x$19.$high + f6f9_38.$high, x$19.$low + f6f9_38.$low)), new $Int64(x$18.$high + f7f8_38.$high, x$18.$low + f7f8_38.$low)); h6 = (x$21 = (x$22 = (x$23 = (x$24 = new $Int64(f0f6_2.$high + f1f5_4.$high, f0f6_2.$low + f1f5_4.$low), new $Int64(x$24.$high + f2f4_2.$high, x$24.$low + f2f4_2.$low)), new $Int64(x$23.$high + f3f3_2.$high, x$23.$low + f3f3_2.$low)), new $Int64(x$22.$high + f7f9_76.$high, x$22.$low + f7f9_76.$low)), new $Int64(x$21.$high + f8f8_19.$high, x$21.$low + f8f8_19.$low)); h7 = (x$25 = (x$26 = (x$27 = new $Int64(f0f7_2.$high + f1f6_2.$high, f0f7_2.$low + f1f6_2.$low), new $Int64(x$27.$high + f2f5_2.$high, x$27.$low + f2f5_2.$low)), new $Int64(x$26.$high + f3f4_2.$high, x$26.$low + f3f4_2.$low)), new $Int64(x$25.$high + f8f9_38.$high, x$25.$low + f8f9_38.$low)); h8 = (x$28 = (x$29 = (x$30 = (x$31 = new $Int64(f0f8_2.$high + f1f7_4.$high, f0f8_2.$low + f1f7_4.$low), new $Int64(x$31.$high + f2f6_2.$high, x$31.$low + f2f6_2.$low)), new $Int64(x$30.$high + f3f5_4.$high, x$30.$low + f3f5_4.$low)), new $Int64(x$29.$high + f4f4.$high, x$29.$low + f4f4.$low)), new $Int64(x$28.$high + f9f9_38.$high, x$28.$low + f9f9_38.$low)); h9 = (x$32 = (x$33 = (x$34 = new $Int64(f0f9_2.$high + f1f8_2.$high, f0f9_2.$low + f1f8_2.$low), new $Int64(x$34.$high + f2f7_2.$high, x$34.$low + f2f7_2.$low)), new $Int64(x$33.$high + f3f6_2.$high, x$33.$low + f3f6_2.$low)), new $Int64(x$32.$high + f4f5_2.$high, x$32.$low + f4f5_2.$low)); carry = arrayType.zero(); carry[0] = $shiftRightInt64((new $Int64(h0.$high + 0, h0.$low + 33554432)), 26); h1 = (x$35 = carry[0], new $Int64(h1.$high + x$35.$high, h1.$low + x$35.$low)); h0 = (x$36 = $shiftLeft64(carry[0], 26), new $Int64(h0.$high - x$36.$high, h0.$low - x$36.$low)); carry[4] = $shiftRightInt64((new $Int64(h4.$high + 0, h4.$low + 33554432)), 26); h5 = (x$37 = carry[4], new $Int64(h5.$high + x$37.$high, h5.$low + x$37.$low)); h4 = (x$38 = $shiftLeft64(carry[4], 26), new $Int64(h4.$high - x$38.$high, h4.$low - x$38.$low)); carry[1] = $shiftRightInt64((new $Int64(h1.$high + 0, h1.$low + 16777216)), 25); h2 = (x$39 = carry[1], new $Int64(h2.$high + x$39.$high, h2.$low + x$39.$low)); h1 = (x$40 = $shiftLeft64(carry[1], 25), new $Int64(h1.$high - x$40.$high, h1.$low - x$40.$low)); carry[5] = $shiftRightInt64((new $Int64(h5.$high + 0, h5.$low + 16777216)), 25); h6 = (x$41 = carry[5], new $Int64(h6.$high + x$41.$high, h6.$low + x$41.$low)); h5 = (x$42 = $shiftLeft64(carry[5], 25), new $Int64(h5.$high - x$42.$high, h5.$low - x$42.$low)); carry[2] = $shiftRightInt64((new $Int64(h2.$high + 0, h2.$low + 33554432)), 26); h3 = (x$43 = carry[2], new $Int64(h3.$high + x$43.$high, h3.$low + x$43.$low)); h2 = (x$44 = $shiftLeft64(carry[2], 26), new $Int64(h2.$high - x$44.$high, h2.$low - x$44.$low)); carry[6] = $shiftRightInt64((new $Int64(h6.$high + 0, h6.$low + 33554432)), 26); h7 = (x$45 = carry[6], new $Int64(h7.$high + x$45.$high, h7.$low + x$45.$low)); h6 = (x$46 = $shiftLeft64(carry[6], 26), new $Int64(h6.$high - x$46.$high, h6.$low - x$46.$low)); carry[3] = $shiftRightInt64((new $Int64(h3.$high + 0, h3.$low + 16777216)), 25); h4 = (x$47 = carry[3], new $Int64(h4.$high + x$47.$high, h4.$low + x$47.$low)); h3 = (x$48 = $shiftLeft64(carry[3], 25), new $Int64(h3.$high - x$48.$high, h3.$low - x$48.$low)); carry[7] = $shiftRightInt64((new $Int64(h7.$high + 0, h7.$low + 16777216)), 25); h8 = (x$49 = carry[7], new $Int64(h8.$high + x$49.$high, h8.$low + x$49.$low)); h7 = (x$50 = $shiftLeft64(carry[7], 25), new $Int64(h7.$high - x$50.$high, h7.$low - x$50.$low)); carry[4] = $shiftRightInt64((new $Int64(h4.$high + 0, h4.$low + 33554432)), 26); h5 = (x$51 = carry[4], new $Int64(h5.$high + x$51.$high, h5.$low + x$51.$low)); h4 = (x$52 = $shiftLeft64(carry[4], 26), new $Int64(h4.$high - x$52.$high, h4.$low - x$52.$low)); carry[8] = $shiftRightInt64((new $Int64(h8.$high + 0, h8.$low + 33554432)), 26); h9 = (x$53 = carry[8], new $Int64(h9.$high + x$53.$high, h9.$low + x$53.$low)); h8 = (x$54 = $shiftLeft64(carry[8], 26), new $Int64(h8.$high - x$54.$high, h8.$low - x$54.$low)); carry[9] = $shiftRightInt64((new $Int64(h9.$high + 0, h9.$low + 16777216)), 25); h0 = (x$55 = $mul64(carry[9], new $Int64(0, 19)), new $Int64(h0.$high + x$55.$high, h0.$low + x$55.$low)); h9 = (x$56 = $shiftLeft64(carry[9], 25), new $Int64(h9.$high - x$56.$high, h9.$low - x$56.$low)); carry[0] = $shiftRightInt64((new $Int64(h0.$high + 0, h0.$low + 33554432)), 26); h1 = (x$57 = carry[0], new $Int64(h1.$high + x$57.$high, h1.$low + x$57.$low)); h0 = (x$58 = $shiftLeft64(carry[0], 26), new $Int64(h0.$high - x$58.$high, h0.$low - x$58.$low)); h.nilCheck, h[0] = (((h0.$low + ((h0.$high >> 31) * 4294967296)) >> 0)); h.nilCheck, h[1] = (((h1.$low + ((h1.$high >> 31) * 4294967296)) >> 0)); h.nilCheck, h[2] = (((h2.$low + ((h2.$high >> 31) * 4294967296)) >> 0)); h.nilCheck, h[3] = (((h3.$low + ((h3.$high >> 31) * 4294967296)) >> 0)); h.nilCheck, h[4] = (((h4.$low + ((h4.$high >> 31) * 4294967296)) >> 0)); h.nilCheck, h[5] = (((h5.$low + ((h5.$high >> 31) * 4294967296)) >> 0)); h.nilCheck, h[6] = (((h6.$low + ((h6.$high >> 31) * 4294967296)) >> 0)); h.nilCheck, h[7] = (((h7.$low + ((h7.$high >> 31) * 4294967296)) >> 0)); h.nilCheck, h[8] = (((h8.$low + ((h8.$high >> 31) * 4294967296)) >> 0)); h.nilCheck, h[9] = (((h9.$low + ((h9.$high >> 31) * 4294967296)) >> 0)); }; feMul121666 = function(h, f) { var carry, f, h, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9, 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; h0 = $mul64((new $Int64(0, f[0])), new $Int64(0, 121666)); h1 = $mul64((new $Int64(0, f[1])), new $Int64(0, 121666)); h2 = $mul64((new $Int64(0, f[2])), new $Int64(0, 121666)); h3 = $mul64((new $Int64(0, f[3])), new $Int64(0, 121666)); h4 = $mul64((new $Int64(0, f[4])), new $Int64(0, 121666)); h5 = $mul64((new $Int64(0, f[5])), new $Int64(0, 121666)); h6 = $mul64((new $Int64(0, f[6])), new $Int64(0, 121666)); h7 = $mul64((new $Int64(0, f[7])), new $Int64(0, 121666)); h8 = $mul64((new $Int64(0, f[8])), new $Int64(0, 121666)); h9 = $mul64((new $Int64(0, f[9])), new $Int64(0, 121666)); carry = arrayType.zero(); carry[9] = $shiftRightInt64((new $Int64(h9.$high + 0, h9.$low + 16777216)), 25); h0 = (x = $mul64(carry[9], new $Int64(0, 19)), new $Int64(h0.$high + x.$high, h0.$low + x.$low)); h9 = (x$1 = $shiftLeft64(carry[9], 25), new $Int64(h9.$high - x$1.$high, h9.$low - x$1.$low)); carry[1] = $shiftRightInt64((new $Int64(h1.$high + 0, h1.$low + 16777216)), 25); h2 = (x$2 = carry[1], new $Int64(h2.$high + x$2.$high, h2.$low + x$2.$low)); h1 = (x$3 = $shiftLeft64(carry[1], 25), new $Int64(h1.$high - x$3.$high, h1.$low - x$3.$low)); carry[3] = $shiftRightInt64((new $Int64(h3.$high + 0, h3.$low + 16777216)), 25); h4 = (x$4 = carry[3], new $Int64(h4.$high + x$4.$high, h4.$low + x$4.$low)); h3 = (x$5 = $shiftLeft64(carry[3], 25), new $Int64(h3.$high - x$5.$high, h3.$low - x$5.$low)); carry[5] = $shiftRightInt64((new $Int64(h5.$high + 0, h5.$low + 16777216)), 25); h6 = (x$6 = carry[5], new $Int64(h6.$high + x$6.$high, h6.$low + x$6.$low)); h5 = (x$7 = $shiftLeft64(carry[5], 25), new $Int64(h5.$high - x$7.$high, h5.$low - x$7.$low)); carry[7] = $shiftRightInt64((new $Int64(h7.$high + 0, h7.$low + 16777216)), 25); h8 = (x$8 = carry[7], new $Int64(h8.$high + x$8.$high, h8.$low + x$8.$low)); h7 = (x$9 = $shiftLeft64(carry[7], 25), new $Int64(h7.$high - x$9.$high, h7.$low - x$9.$low)); carry[0] = $shiftRightInt64((new $Int64(h0.$high + 0, h0.$low + 33554432)), 26); h1 = (x$10 = carry[0], new $Int64(h1.$high + x$10.$high, h1.$low + x$10.$low)); h0 = (x$11 = $shiftLeft64(carry[0], 26), new $Int64(h0.$high - x$11.$high, h0.$low - x$11.$low)); carry[2] = $shiftRightInt64((new $Int64(h2.$high + 0, h2.$low + 33554432)), 26); h3 = (x$12 = carry[2], new $Int64(h3.$high + x$12.$high, h3.$low + x$12.$low)); h2 = (x$13 = $shiftLeft64(carry[2], 26), new $Int64(h2.$high - x$13.$high, h2.$low - x$13.$low)); carry[4] = $shiftRightInt64((new $Int64(h4.$high + 0, h4.$low + 33554432)), 26); h5 = (x$14 = carry[4], new $Int64(h5.$high + x$14.$high, h5.$low + x$14.$low)); h4 = (x$15 = $shiftLeft64(carry[4], 26), new $Int64(h4.$high - x$15.$high, h4.$low - x$15.$low)); carry[6] = $shiftRightInt64((new $Int64(h6.$high + 0, h6.$low + 33554432)), 26); h7 = (x$16 = carry[6], new $Int64(h7.$high + x$16.$high, h7.$low + x$16.$low)); h6 = (x$17 = $shiftLeft64(carry[6], 26), new $Int64(h6.$high - x$17.$high, h6.$low - x$17.$low)); carry[8] = $shiftRightInt64((new $Int64(h8.$high + 0, h8.$low + 33554432)), 26); h9 = (x$18 = carry[8], new $Int64(h9.$high + x$18.$high, h9.$low + x$18.$low)); h8 = (x$19 = $shiftLeft64(carry[8], 26), new $Int64(h8.$high - x$19.$high, h8.$low - x$19.$low)); h.nilCheck, h[0] = (((h0.$low + ((h0.$high >> 31) * 4294967296)) >> 0)); h.nilCheck, h[1] = (((h1.$low + ((h1.$high >> 31) * 4294967296)) >> 0)); h.nilCheck, h[2] = (((h2.$low + ((h2.$high >> 31) * 4294967296)) >> 0)); h.nilCheck, h[3] = (((h3.$low + ((h3.$high >> 31) * 4294967296)) >> 0)); h.nilCheck, h[4] = (((h4.$low + ((h4.$high >> 31) * 4294967296)) >> 0)); h.nilCheck, h[5] = (((h5.$low + ((h5.$high >> 31) * 4294967296)) >> 0)); h.nilCheck, h[6] = (((h6.$low + ((h6.$high >> 31) * 4294967296)) >> 0)); h.nilCheck, h[7] = (((h7.$low + ((h7.$high >> 31) * 4294967296)) >> 0)); h.nilCheck, h[8] = (((h8.$low + ((h8.$high >> 31) * 4294967296)) >> 0)); h.nilCheck, h[9] = (((h9.$low + ((h9.$high >> 31) * 4294967296)) >> 0)); }; feInvert = function(out, z) { var _tmp, _tmp$1, _tmp$2, _tmp$3, i, out, t0, t1, t2, t3, z; _tmp = arrayType$1.zero(); _tmp$1 = arrayType$1.zero(); _tmp$2 = arrayType$1.zero(); _tmp$3 = arrayType$1.zero(); t0 = $clone(_tmp, fieldElement); t1 = $clone(_tmp$1, fieldElement); t2 = $clone(_tmp$2, fieldElement); t3 = $clone(_tmp$3, fieldElement); i = 0; feSquare(t0, z); i = 1; while (true) { if (!(i < 1)) { break; } feSquare(t0, t0); i = i + (1) >> 0; } feSquare(t1, t0); i = 1; while (true) { if (!(i < 2)) { break; } feSquare(t1, t1); i = i + (1) >> 0; } feMul(t1, z, t1); feMul(t0, t0, t1); feSquare(t2, t0); i = 1; while (true) { if (!(i < 1)) { break; } feSquare(t2, t2); i = i + (1) >> 0; } feMul(t1, t1, t2); feSquare(t2, t1); i = 1; while (true) { if (!(i < 5)) { break; } feSquare(t2, t2); i = i + (1) >> 0; } feMul(t1, t2, t1); feSquare(t2, t1); i = 1; while (true) { if (!(i < 10)) { break; } feSquare(t2, t2); i = i + (1) >> 0; } feMul(t2, t2, t1); feSquare(t3, t2); i = 1; while (true) { if (!(i < 20)) { break; } feSquare(t3, t3); i = i + (1) >> 0; } feMul(t2, t3, t2); feSquare(t2, t2); i = 1; while (true) { if (!(i < 10)) { break; } feSquare(t2, t2); i = i + (1) >> 0; } feMul(t1, t2, t1); feSquare(t2, t1); i = 1; while (true) { if (!(i < 50)) { break; } feSquare(t2, t2); i = i + (1) >> 0; } feMul(t2, t2, t1); feSquare(t3, t2); i = 1; while (true) { if (!(i < 100)) { break; } feSquare(t3, t3); i = i + (1) >> 0; } feMul(t2, t3, t2); feSquare(t2, t2); i = 1; while (true) { if (!(i < 50)) { break; } feSquare(t2, t2); i = i + (1) >> 0; } feMul(t1, t2, t1); feSquare(t1, t1); i = 1; while (true) { if (!(i < 5)) { break; } feSquare(t1, t1); i = i + (1) >> 0; } feMul(out, t1, t0); }; scalarMultGeneric = function(out, in$1, base) { var _q, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, b, base, e, in$1, out, pos, swap, tmp0, tmp1, x, x1, x2, x3, y, z2, z3; e = arrayType$2.zero(); $copySlice(new sliceType(e), new sliceType(in$1)); e[0] = ((e[0] & (248)) >>> 0); e[31] = ((e[31] & (127)) >>> 0); e[31] = ((e[31] | (64)) >>> 0); _tmp = arrayType$1.zero(); _tmp$1 = arrayType$1.zero(); _tmp$2 = arrayType$1.zero(); _tmp$3 = arrayType$1.zero(); _tmp$4 = arrayType$1.zero(); _tmp$5 = arrayType$1.zero(); _tmp$6 = arrayType$1.zero(); x1 = $clone(_tmp, fieldElement); x2 = $clone(_tmp$1, fieldElement); z2 = $clone(_tmp$2, fieldElement); x3 = $clone(_tmp$3, fieldElement); z3 = $clone(_tmp$4, fieldElement); tmp0 = $clone(_tmp$5, fieldElement); tmp1 = $clone(_tmp$6, fieldElement); feFromBytes(x1, base); feOne(x2); feCopy(x3, x1); feOne(z3); swap = 0; pos = 254; while (true) { if (!(pos >= 0)) { break; } b = (y = (((pos & 7) >>> 0)), y < 32 ? ((x = (_q = pos / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")), ((x < 0 || x >= e.length) ? ($throwRuntimeError("index out of range"), undefined) : e[x])) >>> y) : 0) << 24 >>> 24; b = (b & (1)) >>> 0; swap = (swap ^ (((b >> 0)))) >> 0; feCSwap(x2, x3, swap); feCSwap(z2, z3, swap); swap = ((b >> 0)); feSub(tmp0, x3, z3); feSub(tmp1, x2, z2); feAdd(x2, x2, z2); feAdd(z2, x3, z3); feMul(z3, tmp0, x2); feMul(z2, z2, tmp1); feSquare(tmp0, tmp1); feSquare(tmp1, x2); feAdd(x3, z3, z2); feSub(z2, z3, z2); feMul(x2, tmp1, tmp0); feSub(tmp1, tmp1, tmp0); feSquare(z2, z2); feMul121666(z3, tmp1); feSquare(x3, x3); feAdd(tmp0, tmp0, z3); feMul(z3, x1, z2); feMul(z2, tmp1, tmp0); pos = pos - (1) >> 0; } feCSwap(x2, x3, swap); feCSwap(z2, z3, swap); feInvert(z2, z2); feMul(x2, x2, z2); feToBytes(out, x2); }; ScalarMult = function(dst, scalar, point) { var dst, point, scalar; scalarMult(dst, scalar, point); }; $pkg.ScalarMult = ScalarMult; ScalarBaseMult = function(dst, scalar) { var dst, scalar; ScalarMult(dst, scalar, basePoint); }; $pkg.ScalarBaseMult = ScalarBaseMult; init = function() { $pkg.Basepoint = new sliceType(basePoint); }; checkBasepoint = function() { if (!((subtle.ConstantTimeCompare($pkg.Basepoint, new sliceType([9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])) === 1))) { $panic(new $String("curve25519: global Basepoint value was modified")); } }; X25519 = function(scalar, point) { var $24r, _r, dst, point, scalar, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; dst = $f.dst; point = $f.point; scalar = $f.scalar; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: dst = [dst]; dst[0] = arrayType$2.zero(); _r = x25519(dst[0], scalar, point); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: X25519 }; } $f.$24r = $24r; $f._r = _r; $f.dst = dst; $f.point = point; $f.scalar = scalar; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.X25519 = X25519; x25519 = function(dst, scalar, point) { var $24r, $24r$1, $24r$2, _r, _r$1, _r$2, _tmp, _tmp$1, base, dst, in$1, l, l$1, point, scalar, zero, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; base = $f.base; dst = $f.dst; in$1 = $f.in$1; l = $f.l; l$1 = $f.l$1; point = $f.point; scalar = $f.scalar; zero = $f.zero; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: base = [base]; in$1 = [in$1]; in$1[0] = arrayType$2.zero(); l = scalar.$length; /* */ if (!((l === 32))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((l === 32))) { */ case 1: _r = fmt.Errorf("bad scalar length: %d, expected %d", new sliceType$1([new $Int(l), new $Int(32)])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = [sliceType.nil, _r]; $s = 4; case 4: return $24r; /* } */ case 2: l$1 = point.$length; /* */ if (!((l$1 === 32))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!((l$1 === 32))) { */ case 5: _r$1 = fmt.Errorf("bad point length: %d, expected %d", new sliceType$1([new $Int(l$1), new $Int(32)])); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r$1 = [sliceType.nil, _r$1]; $s = 8; case 8: return $24r$1; /* } */ case 6: $copySlice(new sliceType(in$1[0]), scalar); /* */ if ($indexPtr(point.$array, point.$offset + 0, ptrType) === $indexPtr($pkg.Basepoint.$array, $pkg.Basepoint.$offset + 0, ptrType)) { $s = 9; continue; } /* */ $s = 10; continue; /* if ($indexPtr(point.$array, point.$offset + 0, ptrType) === $indexPtr($pkg.Basepoint.$array, $pkg.Basepoint.$offset + 0, ptrType)) { */ case 9: checkBasepoint(); ScalarBaseMult(dst, in$1[0]); $s = 11; continue; /* } else { */ case 10: _tmp = arrayType$2.zero(); _tmp$1 = arrayType$2.zero(); base[0] = $clone(_tmp, arrayType$2); zero = $clone(_tmp$1, arrayType$2); $copySlice(new sliceType(base[0]), point); ScalarMult(dst, in$1[0], base[0]); /* */ if (subtle.ConstantTimeCompare(new sliceType(dst), new sliceType(zero)) === 1) { $s = 12; continue; } /* */ $s = 13; continue; /* if (subtle.ConstantTimeCompare(new sliceType(dst), new sliceType(zero)) === 1) { */ case 12: _r$2 = fmt.Errorf("bad input point: low order point", new sliceType$1([])); /* */ $s = 14; case 14: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r$2 = [sliceType.nil, _r$2]; $s = 15; case 15: return $24r$2; /* } */ case 13: /* } */ case 11: $s = -1; return [new sliceType(dst), $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: x25519 }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.base = base; $f.dst = dst; $f.in$1 = in$1; $f.l = l; $f.l$1 = l$1; $f.point = point; $f.scalar = scalar; $f.zero = zero; $f.$s = $s; $f.$r = $r; return $f; }; fieldElement.init($Int32, 10); $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 = subtle.$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 = fmt.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $pkg.Basepoint = sliceType.nil; basePoint = $toNativeArray($kindUint8, [9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); init(); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["vendor/golang.org/x/crypto/hkdf"] = (function() { var $pkg = {}, $init, hmac, errors, hash, io, hkdf, sliceType, ptrType, Extract, Expand; hmac = $packages["crypto/hmac"]; errors = $packages["errors"]; hash = $packages["hash"]; io = $packages["io"]; hkdf = $pkg.hkdf = $newType(0, $kindStruct, "hkdf.hkdf", true, "vendor/golang.org/x/crypto/hkdf", false, function(expander_, size_, info_, counter_, prev_, buf_) { this.$val = this; if (arguments.length === 0) { this.expander = $ifaceNil; this.size = 0; this.info = sliceType.nil; this.counter = 0; this.prev = sliceType.nil; this.buf = sliceType.nil; return; } this.expander = expander_; this.size = size_; this.info = info_; this.counter = counter_; this.prev = prev_; this.buf = buf_; }); sliceType = $sliceType($Uint8); ptrType = $ptrType(hkdf); Extract = function(hash$1, secret, salt) { var $24r, _r, _r$1, _r$2, _r$3, _r$4, extractor, hash$1, salt, secret, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; extractor = $f.extractor; hash$1 = $f.hash$1; salt = $f.salt; secret = $f.secret; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (salt === sliceType.nil) { $s = 1; continue; } /* */ $s = 2; continue; /* if (salt === sliceType.nil) { */ case 1: _r = hash$1(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = _r.Size(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } salt = $makeSlice(sliceType, _r$1); /* } */ case 2: _r$2 = hmac.New(hash$1, salt); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } extractor = _r$2; _r$3 = extractor.Write(secret); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _r$4 = extractor.Sum(sliceType.nil); /* */ $s = 7; case 7: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r = _r$4; $s = 8; case 8: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Extract }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.extractor = extractor; $f.hash$1 = hash$1; $f.salt = salt; $f.secret = secret; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Extract = Extract; hkdf.ptr.prototype.Read = function(p) { var _r, _r$1, _r$2, _r$3, f, n, need, p, remains, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; f = $f.f; n = $f.n; need = $f.need; p = $f.p; remains = $f.remains; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; need = p.$length; remains = f.buf.$length + ($imul(((((255 - f.counter << 24 >>> 24) + 1 << 24 >>> 24) >> 0)), f.size)) >> 0; if (remains < need) { $s = -1; return [0, errors.New("hkdf: entropy limit reached")]; } n = $copySlice(p, f.buf); p = $subslice(p, n); /* while (true) { */ case 1: /* if (!(p.$length > 0)) { break; } */ if(!(p.$length > 0)) { $s = 2; continue; } $r = f.expander.Reset(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r = f.expander.Write(f.prev); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; _r$1 = f.expander.Write(f.info); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _r$2 = f.expander.Write(new sliceType([f.counter])); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; _r$3 = f.expander.Sum($subslice(f.prev, 0, 0)); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } f.prev = _r$3; f.counter = f.counter + (1) << 24 >>> 24; f.buf = f.prev; n = $copySlice(p, f.buf); p = $subslice(p, n); $s = 1; continue; case 2: f.buf = $subslice(f.buf, n); $s = -1; return [need, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: hkdf.ptr.prototype.Read }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.f = f; $f.n = n; $f.need = need; $f.p = p; $f.remains = remains; $f.$s = $s; $f.$r = $r; return $f; }; hkdf.prototype.Read = function(p) { return this.$val.Read(p); }; Expand = function(hash$1, pseudorandomKey, info) { var $24r, _r, _r$1, expander, hash$1, info, pseudorandomKey, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; expander = $f.expander; hash$1 = $f.hash$1; info = $f.info; pseudorandomKey = $f.pseudorandomKey; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = hmac.New(hash$1, pseudorandomKey); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } expander = _r; _r$1 = expander.Size(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = new hkdf.ptr(expander, _r$1, info, 1, sliceType.nil, sliceType.nil); $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Expand }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f.expander = expander; $f.hash$1 = hash$1; $f.info = info; $f.pseudorandomKey = pseudorandomKey; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Expand = Expand; ptrType.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}]; hkdf.init("vendor/golang.org/x/crypto/hkdf", [{prop: "expander", name: "expander", embedded: false, exported: false, typ: hash.Hash, tag: ""}, {prop: "size", name: "size", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "info", name: "info", embedded: false, exported: false, typ: sliceType, tag: ""}, {prop: "counter", name: "counter", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "prev", name: "prev", embedded: false, exported: false, typ: sliceType, tag: ""}, {prop: "buf", name: "buf", embedded: false, exported: false, typ: sliceType, 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 = hmac.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = errors.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = hash.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = io.$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["crypto/tls"] = (function() { var $pkg = {}, $init, bytes, list, context, crypto, aes, cipher, des, ecdsa, ed25519, elliptic, hmac, md5, rand, rc4, rsa, sha1, sha256, sha512, subtle, x509, pem, errors, fmt, hash, cpu, io, big, net, os, runtime, strconv, strings, sync, atomic, time, chacha20poly1305, cryptobyte, curve25519, hkdf, listener, Dialer, sessionState, sessionStateTLS13, finishedHash, ecdheParameters, nistParameters, x25519Parameters, keyAgreement, rsaKeyAgreement, ecdheKeyAgreement, serverHandshakeStateTLS13, serverHandshakeState, marshalingFunction, clientHelloMsg, serverHelloMsg, encryptedExtensionsMsg, endOfEarlyDataMsg, keyUpdateMsg, newSessionTicketMsgTLS13, certificateRequestMsgTLS13, certificateMsg, certificateMsgTLS13, serverKeyExchangeMsg, certificateStatusMsg, serverHelloDoneMsg, clientKeyExchangeMsg, finishedMsg, certificateRequestMsg, certificateVerifyMsg, newSessionTicketMsg, helloRequestMsg, clientHandshakeStateTLS13, clientHandshakeState, Conn, halfConn, permanentError, cbcMode, RecordHeaderError, atLeastReader, recordType, CurveID, keyShare, pskIdentity, ConnectionState, ClientAuthType, ClientSessionState, ClientSessionCache, SignatureScheme, ClientHelloInfo, CertificateRequestInfo, RenegotiationSupport, Config, ticketKey, Certificate, cipherSuite, cipherSuiteTLS13, aead, prefixNonceAEAD, xorNonceAEAD, constantTimeHash, cthWrapper, alert, binaryMarshaler, sliceType, ptrType, sliceType$1, sliceType$2, arrayType, sliceType$3, sliceType$4, sliceType$5, sliceType$6, ptrType$1, sliceType$7, ptrType$2, sliceType$8, ptrType$3, sliceType$9, structType, sliceType$10, ptrType$4, sliceType$11, ptrType$5, sliceType$12, sliceType$13, arrayType$1, arrayType$2, arrayType$3, arrayType$4, ptrType$6, ptrType$7, ptrType$8, ptrType$9, ptrType$10, ptrType$11, ptrType$12, ptrType$13, ptrType$14, ptrType$15, ptrType$16, ptrType$17, ptrType$18, ptrType$19, ptrType$20, ptrType$21, ptrType$22, ptrType$23, ptrType$24, ptrType$25, ptrType$26, ptrType$27, ptrType$28, ptrType$29, ptrType$30, ptrType$31, ptrType$32, ptrType$33, ptrType$34, sliceType$14, sliceType$15, sliceType$16, ptrType$35, ptrType$36, ptrType$37, ptrType$38, ptrType$39, ptrType$40, ptrType$41, arrayType$5, ptrType$42, arrayType$6, ptrType$43, ptrType$44, ptrType$45, ptrType$46, structType$1, arrayType$7, ptrType$51, ptrType$52, ptrType$53, ptrType$54, ptrType$55, funcType, ptrType$56, ptrType$57, ptrType$58, ptrType$59, ptrType$60, ptrType$61, ptrType$62, ptrType$63, ptrType$64, funcType$1, funcType$2, ptrType$65, ptrType$66, ptrType$67, ptrType$68, ptrType$69, sliceType$18, funcType$3, mapType, funcType$4, funcType$5, funcType$6, funcType$7, funcType$8, funcType$9, funcType$10, funcType$11, funcType$12, ptrType$71, ptrType$72, ptrType$73, masterSecretLabel, keyExpansionLabel, clientFinishedLabel, serverFinishedLabel, errClientKeyExchange, errServerKeyExchange, outBufPool, errShutdown, errEarlyCloseWrite, _SignatureScheme_index_8, _CurveID_index_0, _ClientAuthType_index, directSigning, supportedSignatureAlgorithms, helloRetryRequestRandom, testingOnlyForceDowngradeCanary, deprecatedSessionTicketKey, supportedVersions, defaultCurvePreferences, errNoCertificates, writerMutex, emptyConfig, emptyConfig$24ptr, cipherSuites, cipherSuitesTLS13, cipherSuitesPreferenceOrder, cipherSuitesPreferenceOrderNoAES, disabledCipherSuites, defaultCipherSuitesLen, defaultCipherSuites, defaultCipherSuitesTLS13, defaultCipherSuitesTLS13NoAES, hasGCMAsmAMD64, hasGCMAsmARM64, hasGCMAsmS390X, hasAESGCMHardwareSupport, aesgcmCiphers, signaturePadding, rsaSignatureSchemes, alertText, Server, Client, NewListener, dial, LoadX509KeyPair, X509KeyPair, parsePrivateKey, splitPreMasterSecret, pHash, prf10, prf12, prfAndHashForVersion, prfForVersion, masterFromPreMasterSecret, keysFromMasterSecret, newFinishedHash, noExportedKeyingMaterial, ekmFromMasterSecret, generateECDHEParameters, curveForCurveID, sha1Hash, md5SHA1Hash, hashForServerKeyExchange, cloneHash, illegalClientHelloChange, negotiateALPN, supportsECDHE, clientHelloInfo, addBytesWithLength, addUint64, readUint64, readUint8LengthPrefixed, readUint16LengthPrefixed, readUint24LengthPrefixed, marshalCertificate, unmarshalCertificate, checkALPN, certificateRequestInfoFromMsg, clientSessionCacheKey, hostnameInSNI, extractPadding, roundUp, sliceForAppend, requiresClientCert, supportedVersionsFromMax, defaultConfig, unexpectedMessageError, isSupportedSignatureAlgorithm, selectCipherSuite, aesgcmPreferred, cipherRC4, cipher3DES, cipherAES, macSHA1, macSHA256, aeadAESGCM, aeadAESGCMTLS13, aeadChaCha20Poly1305, newConstantTimeHash, tls10MAC, rsaKA, ecdheECDSAKA, ecdheRSAKA, mutualCipherSuite, cipherSuiteByID, mutualCipherSuiteTLS13, cipherSuiteTLS13ByID, verifyHandshakeSignature, signedMessage, typeAndHashFromSignatureScheme, legacyTypeAndHashFromPublicKey, signatureSchemesForCertificate, selectSignatureScheme, unsupportedCertificateError; bytes = $packages["bytes"]; list = $packages["container/list"]; context = $packages["context"]; crypto = $packages["crypto"]; aes = $packages["crypto/aes"]; cipher = $packages["crypto/cipher"]; des = $packages["crypto/des"]; ecdsa = $packages["crypto/ecdsa"]; ed25519 = $packages["crypto/ed25519"]; elliptic = $packages["crypto/elliptic"]; hmac = $packages["crypto/hmac"]; md5 = $packages["crypto/md5"]; rand = $packages["crypto/rand"]; rc4 = $packages["crypto/rc4"]; rsa = $packages["crypto/rsa"]; sha1 = $packages["crypto/sha1"]; sha256 = $packages["crypto/sha256"]; sha512 = $packages["crypto/sha512"]; subtle = $packages["crypto/subtle"]; x509 = $packages["crypto/x509"]; pem = $packages["encoding/pem"]; errors = $packages["errors"]; fmt = $packages["fmt"]; hash = $packages["hash"]; cpu = $packages["internal/cpu"]; io = $packages["io"]; big = $packages["math/big"]; net = $packages["net"]; os = $packages["os"]; runtime = $packages["runtime"]; strconv = $packages["strconv"]; strings = $packages["strings"]; sync = $packages["sync"]; atomic = $packages["sync/atomic"]; time = $packages["time"]; chacha20poly1305 = $packages["vendor/golang.org/x/crypto/chacha20poly1305"]; cryptobyte = $packages["vendor/golang.org/x/crypto/cryptobyte"]; curve25519 = $packages["vendor/golang.org/x/crypto/curve25519"]; hkdf = $packages["vendor/golang.org/x/crypto/hkdf"]; listener = $pkg.listener = $newType(0, $kindStruct, "tls.listener", true, "crypto/tls", false, function(Listener_, config_) { this.$val = this; if (arguments.length === 0) { this.Listener = $ifaceNil; this.config = ptrType$4.nil; return; } this.Listener = Listener_; this.config = config_; }); Dialer = $pkg.Dialer = $newType(0, $kindStruct, "tls.Dialer", true, "crypto/tls", true, function(NetDialer_, Config_) { this.$val = this; if (arguments.length === 0) { this.NetDialer = ptrType$9.nil; this.Config = ptrType$4.nil; return; } this.NetDialer = NetDialer_; this.Config = Config_; }); sessionState = $pkg.sessionState = $newType(0, $kindStruct, "tls.sessionState", true, "crypto/tls", false, function(vers_, cipherSuite_, createdAt_, masterSecret_, certificates_, usedOldKey_) { this.$val = this; if (arguments.length === 0) { this.vers = 0; this.cipherSuite = 0; this.createdAt = new $Uint64(0, 0); this.masterSecret = sliceType$5.nil; this.certificates = sliceType$11.nil; this.usedOldKey = false; return; } this.vers = vers_; this.cipherSuite = cipherSuite_; this.createdAt = createdAt_; this.masterSecret = masterSecret_; this.certificates = certificates_; this.usedOldKey = usedOldKey_; }); sessionStateTLS13 = $pkg.sessionStateTLS13 = $newType(0, $kindStruct, "tls.sessionStateTLS13", true, "crypto/tls", false, function(cipherSuite_, createdAt_, resumptionSecret_, certificate_) { this.$val = this; if (arguments.length === 0) { this.cipherSuite = 0; this.createdAt = new $Uint64(0, 0); this.resumptionSecret = sliceType$5.nil; this.certificate = new Certificate.ptr(sliceType$11.nil, $ifaceNil, sliceType$7.nil, sliceType$5.nil, sliceType$11.nil, ptrType$5.nil); return; } this.cipherSuite = cipherSuite_; this.createdAt = createdAt_; this.resumptionSecret = resumptionSecret_; this.certificate = certificate_; }); finishedHash = $pkg.finishedHash = $newType(0, $kindStruct, "tls.finishedHash", true, "crypto/tls", false, function(client_, server_, clientMD5_, serverMD5_, buffer_, version_, prf_) { this.$val = this; if (arguments.length === 0) { this.client = $ifaceNil; this.server = $ifaceNil; this.clientMD5 = $ifaceNil; this.serverMD5 = $ifaceNil; this.buffer = sliceType$5.nil; this.version = 0; this.prf = $throwNilPointerError; return; } this.client = client_; this.server = server_; this.clientMD5 = clientMD5_; this.serverMD5 = serverMD5_; this.buffer = buffer_; this.version = version_; this.prf = prf_; }); ecdheParameters = $pkg.ecdheParameters = $newType(8, $kindInterface, "tls.ecdheParameters", true, "crypto/tls", false, null); nistParameters = $pkg.nistParameters = $newType(0, $kindStruct, "tls.nistParameters", true, "crypto/tls", false, function(privateKey_, x_, y_, curveID_) { this.$val = this; if (arguments.length === 0) { this.privateKey = sliceType$5.nil; this.x = ptrType$21.nil; this.y = ptrType$21.nil; this.curveID = 0; return; } this.privateKey = privateKey_; this.x = x_; this.y = y_; this.curveID = curveID_; }); x25519Parameters = $pkg.x25519Parameters = $newType(0, $kindStruct, "tls.x25519Parameters", true, "crypto/tls", false, function(privateKey_, publicKey_) { this.$val = this; if (arguments.length === 0) { this.privateKey = sliceType$5.nil; this.publicKey = sliceType$5.nil; return; } this.privateKey = privateKey_; this.publicKey = publicKey_; }); keyAgreement = $pkg.keyAgreement = $newType(8, $kindInterface, "tls.keyAgreement", true, "crypto/tls", false, null); rsaKeyAgreement = $pkg.rsaKeyAgreement = $newType(0, $kindStruct, "tls.rsaKeyAgreement", true, "crypto/tls", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); ecdheKeyAgreement = $pkg.ecdheKeyAgreement = $newType(0, $kindStruct, "tls.ecdheKeyAgreement", true, "crypto/tls", false, function(version_, isRSA_, params_, ckx_, preMasterSecret_) { this.$val = this; if (arguments.length === 0) { this.version = 0; this.isRSA = false; this.params = $ifaceNil; this.ckx = ptrType$23.nil; this.preMasterSecret = sliceType$5.nil; return; } this.version = version_; this.isRSA = isRSA_; this.params = params_; this.ckx = ckx_; this.preMasterSecret = preMasterSecret_; }); serverHandshakeStateTLS13 = $pkg.serverHandshakeStateTLS13 = $newType(0, $kindStruct, "tls.serverHandshakeStateTLS13", true, "crypto/tls", false, function(c_, ctx_, clientHello_, hello_, sentDummyCCS_, usingPSK_, suite_, cert_, sigAlg_, earlySecret_, sharedKey_, handshakeSecret_, masterSecret_, trafficSecret_, transcript_, clientFinished_) { this.$val = this; if (arguments.length === 0) { this.c = ptrType$6.nil; this.ctx = $ifaceNil; this.clientHello = ptrType$26.nil; this.hello = ptrType$30.nil; this.sentDummyCCS = false; this.usingPSK = false; this.suite = ptrType$2.nil; this.cert = ptrType$31.nil; this.sigAlg = 0; this.earlySecret = sliceType$5.nil; this.sharedKey = sliceType$5.nil; this.handshakeSecret = sliceType$5.nil; this.masterSecret = sliceType$5.nil; this.trafficSecret = sliceType$5.nil; this.transcript = $ifaceNil; this.clientFinished = sliceType$5.nil; return; } this.c = c_; this.ctx = ctx_; this.clientHello = clientHello_; this.hello = hello_; this.sentDummyCCS = sentDummyCCS_; this.usingPSK = usingPSK_; this.suite = suite_; this.cert = cert_; this.sigAlg = sigAlg_; this.earlySecret = earlySecret_; this.sharedKey = sharedKey_; this.handshakeSecret = handshakeSecret_; this.masterSecret = masterSecret_; this.trafficSecret = trafficSecret_; this.transcript = transcript_; this.clientFinished = clientFinished_; }); serverHandshakeState = $pkg.serverHandshakeState = $newType(0, $kindStruct, "tls.serverHandshakeState", true, "crypto/tls", false, function(c_, ctx_, clientHello_, hello_, suite_, ecdheOk_, ecSignOk_, rsaDecryptOk_, rsaSignOk_, sessionState_, finishedHash_, masterSecret_, cert_) { this.$val = this; if (arguments.length === 0) { this.c = ptrType$6.nil; this.ctx = $ifaceNil; this.clientHello = ptrType$26.nil; this.hello = ptrType$30.nil; this.suite = ptrType$3.nil; this.ecdheOk = false; this.ecSignOk = false; this.rsaDecryptOk = false; this.rsaSignOk = false; this.sessionState = ptrType$32.nil; this.finishedHash = new finishedHash.ptr($ifaceNil, $ifaceNil, $ifaceNil, $ifaceNil, sliceType$5.nil, 0, $throwNilPointerError); this.masterSecret = sliceType$5.nil; this.cert = ptrType$31.nil; return; } this.c = c_; this.ctx = ctx_; this.clientHello = clientHello_; this.hello = hello_; this.suite = suite_; this.ecdheOk = ecdheOk_; this.ecSignOk = ecSignOk_; this.rsaDecryptOk = rsaDecryptOk_; this.rsaSignOk = rsaSignOk_; this.sessionState = sessionState_; this.finishedHash = finishedHash_; this.masterSecret = masterSecret_; this.cert = cert_; }); marshalingFunction = $pkg.marshalingFunction = $newType(4, $kindFunc, "tls.marshalingFunction", true, "crypto/tls", false, null); clientHelloMsg = $pkg.clientHelloMsg = $newType(0, $kindStruct, "tls.clientHelloMsg", true, "crypto/tls", false, function(raw_, vers_, random_, sessionId_, cipherSuites_, compressionMethods_, serverName_, ocspStapling_, supportedCurves_, supportedPoints_, ticketSupported_, sessionTicket_, supportedSignatureAlgorithms_, supportedSignatureAlgorithmsCert_, secureRenegotiationSupported_, secureRenegotiation_, alpnProtocols_, scts_, supportedVersions_, cookie_, keyShares_, earlyData_, pskModes_, pskIdentities_, pskBinders_) { this.$val = this; if (arguments.length === 0) { this.raw = sliceType$5.nil; this.vers = 0; this.random = sliceType$5.nil; this.sessionId = sliceType$5.nil; this.cipherSuites = sliceType$2.nil; this.compressionMethods = sliceType$5.nil; this.serverName = ""; this.ocspStapling = false; this.supportedCurves = sliceType$3.nil; this.supportedPoints = sliceType$5.nil; this.ticketSupported = false; this.sessionTicket = sliceType$5.nil; this.supportedSignatureAlgorithms = sliceType$7.nil; this.supportedSignatureAlgorithmsCert = sliceType$7.nil; this.secureRenegotiationSupported = false; this.secureRenegotiation = sliceType$5.nil; this.alpnProtocols = sliceType$1.nil; this.scts = false; this.supportedVersions = sliceType$2.nil; this.cookie = sliceType$5.nil; this.keyShares = sliceType$15.nil; this.earlyData = false; this.pskModes = sliceType$5.nil; this.pskIdentities = sliceType$16.nil; this.pskBinders = sliceType$11.nil; return; } this.raw = raw_; this.vers = vers_; this.random = random_; this.sessionId = sessionId_; this.cipherSuites = cipherSuites_; this.compressionMethods = compressionMethods_; this.serverName = serverName_; this.ocspStapling = ocspStapling_; this.supportedCurves = supportedCurves_; this.supportedPoints = supportedPoints_; this.ticketSupported = ticketSupported_; this.sessionTicket = sessionTicket_; this.supportedSignatureAlgorithms = supportedSignatureAlgorithms_; this.supportedSignatureAlgorithmsCert = supportedSignatureAlgorithmsCert_; this.secureRenegotiationSupported = secureRenegotiationSupported_; this.secureRenegotiation = secureRenegotiation_; this.alpnProtocols = alpnProtocols_; this.scts = scts_; this.supportedVersions = supportedVersions_; this.cookie = cookie_; this.keyShares = keyShares_; this.earlyData = earlyData_; this.pskModes = pskModes_; this.pskIdentities = pskIdentities_; this.pskBinders = pskBinders_; }); serverHelloMsg = $pkg.serverHelloMsg = $newType(0, $kindStruct, "tls.serverHelloMsg", true, "crypto/tls", false, function(raw_, vers_, random_, sessionId_, cipherSuite_, compressionMethod_, ocspStapling_, ticketSupported_, secureRenegotiationSupported_, secureRenegotiation_, alpnProtocol_, scts_, supportedVersion_, serverShare_, selectedIdentityPresent_, selectedIdentity_, supportedPoints_, cookie_, selectedGroup_) { this.$val = this; if (arguments.length === 0) { this.raw = sliceType$5.nil; this.vers = 0; this.random = sliceType$5.nil; this.sessionId = sliceType$5.nil; this.cipherSuite = 0; this.compressionMethod = 0; this.ocspStapling = false; this.ticketSupported = false; this.secureRenegotiationSupported = false; this.secureRenegotiation = sliceType$5.nil; this.alpnProtocol = ""; this.scts = sliceType$11.nil; this.supportedVersion = 0; this.serverShare = new keyShare.ptr(0, sliceType$5.nil); this.selectedIdentityPresent = false; this.selectedIdentity = 0; this.supportedPoints = sliceType$5.nil; this.cookie = sliceType$5.nil; this.selectedGroup = 0; return; } this.raw = raw_; this.vers = vers_; this.random = random_; this.sessionId = sessionId_; this.cipherSuite = cipherSuite_; this.compressionMethod = compressionMethod_; this.ocspStapling = ocspStapling_; this.ticketSupported = ticketSupported_; this.secureRenegotiationSupported = secureRenegotiationSupported_; this.secureRenegotiation = secureRenegotiation_; this.alpnProtocol = alpnProtocol_; this.scts = scts_; this.supportedVersion = supportedVersion_; this.serverShare = serverShare_; this.selectedIdentityPresent = selectedIdentityPresent_; this.selectedIdentity = selectedIdentity_; this.supportedPoints = supportedPoints_; this.cookie = cookie_; this.selectedGroup = selectedGroup_; }); encryptedExtensionsMsg = $pkg.encryptedExtensionsMsg = $newType(0, $kindStruct, "tls.encryptedExtensionsMsg", true, "crypto/tls", false, function(raw_, alpnProtocol_) { this.$val = this; if (arguments.length === 0) { this.raw = sliceType$5.nil; this.alpnProtocol = ""; return; } this.raw = raw_; this.alpnProtocol = alpnProtocol_; }); endOfEarlyDataMsg = $pkg.endOfEarlyDataMsg = $newType(0, $kindStruct, "tls.endOfEarlyDataMsg", true, "crypto/tls", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); keyUpdateMsg = $pkg.keyUpdateMsg = $newType(0, $kindStruct, "tls.keyUpdateMsg", true, "crypto/tls", false, function(raw_, updateRequested_) { this.$val = this; if (arguments.length === 0) { this.raw = sliceType$5.nil; this.updateRequested = false; return; } this.raw = raw_; this.updateRequested = updateRequested_; }); newSessionTicketMsgTLS13 = $pkg.newSessionTicketMsgTLS13 = $newType(0, $kindStruct, "tls.newSessionTicketMsgTLS13", true, "crypto/tls", false, function(raw_, lifetime_, ageAdd_, nonce_, label_, maxEarlyData_) { this.$val = this; if (arguments.length === 0) { this.raw = sliceType$5.nil; this.lifetime = 0; this.ageAdd = 0; this.nonce = sliceType$5.nil; this.label = sliceType$5.nil; this.maxEarlyData = 0; return; } this.raw = raw_; this.lifetime = lifetime_; this.ageAdd = ageAdd_; this.nonce = nonce_; this.label = label_; this.maxEarlyData = maxEarlyData_; }); certificateRequestMsgTLS13 = $pkg.certificateRequestMsgTLS13 = $newType(0, $kindStruct, "tls.certificateRequestMsgTLS13", true, "crypto/tls", false, function(raw_, ocspStapling_, scts_, supportedSignatureAlgorithms_, supportedSignatureAlgorithmsCert_, certificateAuthorities_) { this.$val = this; if (arguments.length === 0) { this.raw = sliceType$5.nil; this.ocspStapling = false; this.scts = false; this.supportedSignatureAlgorithms = sliceType$7.nil; this.supportedSignatureAlgorithmsCert = sliceType$7.nil; this.certificateAuthorities = sliceType$11.nil; return; } this.raw = raw_; this.ocspStapling = ocspStapling_; this.scts = scts_; this.supportedSignatureAlgorithms = supportedSignatureAlgorithms_; this.supportedSignatureAlgorithmsCert = supportedSignatureAlgorithmsCert_; this.certificateAuthorities = certificateAuthorities_; }); certificateMsg = $pkg.certificateMsg = $newType(0, $kindStruct, "tls.certificateMsg", true, "crypto/tls", false, function(raw_, certificates_) { this.$val = this; if (arguments.length === 0) { this.raw = sliceType$5.nil; this.certificates = sliceType$11.nil; return; } this.raw = raw_; this.certificates = certificates_; }); certificateMsgTLS13 = $pkg.certificateMsgTLS13 = $newType(0, $kindStruct, "tls.certificateMsgTLS13", true, "crypto/tls", false, function(raw_, certificate_, ocspStapling_, scts_) { this.$val = this; if (arguments.length === 0) { this.raw = sliceType$5.nil; this.certificate = new Certificate.ptr(sliceType$11.nil, $ifaceNil, sliceType$7.nil, sliceType$5.nil, sliceType$11.nil, ptrType$5.nil); this.ocspStapling = false; this.scts = false; return; } this.raw = raw_; this.certificate = certificate_; this.ocspStapling = ocspStapling_; this.scts = scts_; }); serverKeyExchangeMsg = $pkg.serverKeyExchangeMsg = $newType(0, $kindStruct, "tls.serverKeyExchangeMsg", true, "crypto/tls", false, function(raw_, key_) { this.$val = this; if (arguments.length === 0) { this.raw = sliceType$5.nil; this.key = sliceType$5.nil; return; } this.raw = raw_; this.key = key_; }); certificateStatusMsg = $pkg.certificateStatusMsg = $newType(0, $kindStruct, "tls.certificateStatusMsg", true, "crypto/tls", false, function(raw_, response_) { this.$val = this; if (arguments.length === 0) { this.raw = sliceType$5.nil; this.response = sliceType$5.nil; return; } this.raw = raw_; this.response = response_; }); serverHelloDoneMsg = $pkg.serverHelloDoneMsg = $newType(0, $kindStruct, "tls.serverHelloDoneMsg", true, "crypto/tls", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); clientKeyExchangeMsg = $pkg.clientKeyExchangeMsg = $newType(0, $kindStruct, "tls.clientKeyExchangeMsg", true, "crypto/tls", false, function(raw_, ciphertext_) { this.$val = this; if (arguments.length === 0) { this.raw = sliceType$5.nil; this.ciphertext = sliceType$5.nil; return; } this.raw = raw_; this.ciphertext = ciphertext_; }); finishedMsg = $pkg.finishedMsg = $newType(0, $kindStruct, "tls.finishedMsg", true, "crypto/tls", false, function(raw_, verifyData_) { this.$val = this; if (arguments.length === 0) { this.raw = sliceType$5.nil; this.verifyData = sliceType$5.nil; return; } this.raw = raw_; this.verifyData = verifyData_; }); certificateRequestMsg = $pkg.certificateRequestMsg = $newType(0, $kindStruct, "tls.certificateRequestMsg", true, "crypto/tls", false, function(raw_, hasSignatureAlgorithm_, certificateTypes_, supportedSignatureAlgorithms_, certificateAuthorities_) { this.$val = this; if (arguments.length === 0) { this.raw = sliceType$5.nil; this.hasSignatureAlgorithm = false; this.certificateTypes = sliceType$5.nil; this.supportedSignatureAlgorithms = sliceType$7.nil; this.certificateAuthorities = sliceType$11.nil; return; } this.raw = raw_; this.hasSignatureAlgorithm = hasSignatureAlgorithm_; this.certificateTypes = certificateTypes_; this.supportedSignatureAlgorithms = supportedSignatureAlgorithms_; this.certificateAuthorities = certificateAuthorities_; }); certificateVerifyMsg = $pkg.certificateVerifyMsg = $newType(0, $kindStruct, "tls.certificateVerifyMsg", true, "crypto/tls", false, function(raw_, hasSignatureAlgorithm_, signatureAlgorithm_, signature_) { this.$val = this; if (arguments.length === 0) { this.raw = sliceType$5.nil; this.hasSignatureAlgorithm = false; this.signatureAlgorithm = 0; this.signature = sliceType$5.nil; return; } this.raw = raw_; this.hasSignatureAlgorithm = hasSignatureAlgorithm_; this.signatureAlgorithm = signatureAlgorithm_; this.signature = signature_; }); newSessionTicketMsg = $pkg.newSessionTicketMsg = $newType(0, $kindStruct, "tls.newSessionTicketMsg", true, "crypto/tls", false, function(raw_, ticket_) { this.$val = this; if (arguments.length === 0) { this.raw = sliceType$5.nil; this.ticket = sliceType$5.nil; return; } this.raw = raw_; this.ticket = ticket_; }); helloRequestMsg = $pkg.helloRequestMsg = $newType(0, $kindStruct, "tls.helloRequestMsg", true, "crypto/tls", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); clientHandshakeStateTLS13 = $pkg.clientHandshakeStateTLS13 = $newType(0, $kindStruct, "tls.clientHandshakeStateTLS13", true, "crypto/tls", false, function(c_, ctx_, serverHello_, hello_, ecdheParams_, session_, earlySecret_, binderKey_, certReq_, usingPSK_, sentDummyCCS_, suite_, transcript_, masterSecret_, trafficSecret_) { this.$val = this; if (arguments.length === 0) { this.c = ptrType$6.nil; this.ctx = $ifaceNil; this.serverHello = ptrType$30.nil; this.hello = ptrType$26.nil; this.ecdheParams = $ifaceNil; this.session = ptrType$37.nil; this.earlySecret = sliceType$5.nil; this.binderKey = sliceType$5.nil; this.certReq = ptrType$39.nil; this.usingPSK = false; this.sentDummyCCS = false; this.suite = ptrType$2.nil; this.transcript = $ifaceNil; this.masterSecret = sliceType$5.nil; this.trafficSecret = sliceType$5.nil; return; } this.c = c_; this.ctx = ctx_; this.serverHello = serverHello_; this.hello = hello_; this.ecdheParams = ecdheParams_; this.session = session_; this.earlySecret = earlySecret_; this.binderKey = binderKey_; this.certReq = certReq_; this.usingPSK = usingPSK_; this.sentDummyCCS = sentDummyCCS_; this.suite = suite_; this.transcript = transcript_; this.masterSecret = masterSecret_; this.trafficSecret = trafficSecret_; }); clientHandshakeState = $pkg.clientHandshakeState = $newType(0, $kindStruct, "tls.clientHandshakeState", true, "crypto/tls", false, function(c_, ctx_, serverHello_, hello_, suite_, finishedHash_, masterSecret_, session_) { this.$val = this; if (arguments.length === 0) { this.c = ptrType$6.nil; this.ctx = $ifaceNil; this.serverHello = ptrType$30.nil; this.hello = ptrType$26.nil; this.suite = ptrType$3.nil; this.finishedHash = new finishedHash.ptr($ifaceNil, $ifaceNil, $ifaceNil, $ifaceNil, sliceType$5.nil, 0, $throwNilPointerError); this.masterSecret = sliceType$5.nil; this.session = ptrType$37.nil; return; } this.c = c_; this.ctx = ctx_; this.serverHello = serverHello_; this.hello = hello_; this.suite = suite_; this.finishedHash = finishedHash_; this.masterSecret = masterSecret_; this.session = session_; }); Conn = $pkg.Conn = $newType(0, $kindStruct, "tls.Conn", true, "crypto/tls", true, function(conn_, isClient_, handshakeFn_, handshakeStatus_, handshakeMutex_, handshakeErr_, vers_, haveVers_, config_, handshakes_, didResume_, cipherSuite_, ocspResponse_, scts_, peerCertificates_, verifiedChains_, serverName_, secureRenegotiation_, ekm_, resumptionSecret_, ticketKeys_, clientFinishedIsFirst_, closeNotifyErr_, closeNotifySent_, clientFinished_, serverFinished_, clientProtocol_, in$27_, out_, rawInput_, input_, hand_, buffering_, sendBuf_, bytesSent_, packetsSent_, retryCount_, activeCall_, tmp_) { this.$val = this; if (arguments.length === 0) { this.conn = $ifaceNil; this.isClient = false; this.handshakeFn = $throwNilPointerError; this.handshakeStatus = 0; this.handshakeMutex = new sync.Mutex.ptr(0, 0); this.handshakeErr = $ifaceNil; this.vers = 0; this.haveVers = false; this.config = ptrType$4.nil; this.handshakes = 0; this.didResume = false; this.cipherSuite = 0; this.ocspResponse = sliceType$5.nil; this.scts = sliceType$11.nil; this.peerCertificates = sliceType$12.nil; this.verifiedChains = sliceType$13.nil; this.serverName = ""; this.secureRenegotiation = false; this.ekm = $throwNilPointerError; this.resumptionSecret = sliceType$5.nil; this.ticketKeys = sliceType$4.nil; this.clientFinishedIsFirst = false; this.closeNotifyErr = $ifaceNil; this.closeNotifySent = false; this.clientFinished = arrayType$1.zero(); this.serverFinished = arrayType$1.zero(); this.clientProtocol = ""; this.in$27 = new halfConn.ptr(new sync.Mutex.ptr(0, 0), $ifaceNil, 0, $ifaceNil, $ifaceNil, arrayType$2.zero(), arrayType$3.zero(), $ifaceNil, $ifaceNil, sliceType$5.nil); this.out = new halfConn.ptr(new sync.Mutex.ptr(0, 0), $ifaceNil, 0, $ifaceNil, $ifaceNil, arrayType$2.zero(), arrayType$3.zero(), $ifaceNil, $ifaceNil, sliceType$5.nil); this.rawInput = new bytes.Buffer.ptr(sliceType$5.nil, 0, 0); this.input = new bytes.Reader.ptr(sliceType$5.nil, new $Int64(0, 0), 0); this.hand = new bytes.Buffer.ptr(sliceType$5.nil, 0, 0); this.buffering = false; this.sendBuf = sliceType$5.nil; this.bytesSent = new $Int64(0, 0); this.packetsSent = new $Int64(0, 0); this.retryCount = 0; this.activeCall = 0; this.tmp = arrayType$4.zero(); return; } this.conn = conn_; this.isClient = isClient_; this.handshakeFn = handshakeFn_; this.handshakeStatus = handshakeStatus_; this.handshakeMutex = handshakeMutex_; this.handshakeErr = handshakeErr_; this.vers = vers_; this.haveVers = haveVers_; this.config = config_; this.handshakes = handshakes_; this.didResume = didResume_; this.cipherSuite = cipherSuite_; this.ocspResponse = ocspResponse_; this.scts = scts_; this.peerCertificates = peerCertificates_; this.verifiedChains = verifiedChains_; this.serverName = serverName_; this.secureRenegotiation = secureRenegotiation_; this.ekm = ekm_; this.resumptionSecret = resumptionSecret_; this.ticketKeys = ticketKeys_; this.clientFinishedIsFirst = clientFinishedIsFirst_; this.closeNotifyErr = closeNotifyErr_; this.closeNotifySent = closeNotifySent_; this.clientFinished = clientFinished_; this.serverFinished = serverFinished_; this.clientProtocol = clientProtocol_; this.in$27 = in$27_; this.out = out_; this.rawInput = rawInput_; this.input = input_; this.hand = hand_; this.buffering = buffering_; this.sendBuf = sendBuf_; this.bytesSent = bytesSent_; this.packetsSent = packetsSent_; this.retryCount = retryCount_; this.activeCall = activeCall_; this.tmp = tmp_; }); halfConn = $pkg.halfConn = $newType(0, $kindStruct, "tls.halfConn", true, "crypto/tls", false, function(Mutex_, err_, version_, cipher_, mac_, seq_, scratchBuf_, nextCipher_, nextMac_, trafficSecret_) { this.$val = this; if (arguments.length === 0) { this.Mutex = new sync.Mutex.ptr(0, 0); this.err = $ifaceNil; this.version = 0; this.cipher = $ifaceNil; this.mac = $ifaceNil; this.seq = arrayType$2.zero(); this.scratchBuf = arrayType$3.zero(); this.nextCipher = $ifaceNil; this.nextMac = $ifaceNil; this.trafficSecret = sliceType$5.nil; return; } this.Mutex = Mutex_; this.err = err_; this.version = version_; this.cipher = cipher_; this.mac = mac_; this.seq = seq_; this.scratchBuf = scratchBuf_; this.nextCipher = nextCipher_; this.nextMac = nextMac_; this.trafficSecret = trafficSecret_; }); permanentError = $pkg.permanentError = $newType(0, $kindStruct, "tls.permanentError", true, "crypto/tls", false, function(err_) { this.$val = this; if (arguments.length === 0) { this.err = $ifaceNil; return; } this.err = err_; }); cbcMode = $pkg.cbcMode = $newType(8, $kindInterface, "tls.cbcMode", true, "crypto/tls", false, null); RecordHeaderError = $pkg.RecordHeaderError = $newType(0, $kindStruct, "tls.RecordHeaderError", true, "crypto/tls", true, function(Msg_, RecordHeader_, Conn_) { this.$val = this; if (arguments.length === 0) { this.Msg = ""; this.RecordHeader = arrayType$6.zero(); this.Conn = $ifaceNil; return; } this.Msg = Msg_; this.RecordHeader = RecordHeader_; this.Conn = Conn_; }); atLeastReader = $pkg.atLeastReader = $newType(0, $kindStruct, "tls.atLeastReader", true, "crypto/tls", false, function(R_, N_) { this.$val = this; if (arguments.length === 0) { this.R = $ifaceNil; this.N = new $Int64(0, 0); return; } this.R = R_; this.N = N_; }); recordType = $pkg.recordType = $newType(1, $kindUint8, "tls.recordType", true, "crypto/tls", false, null); CurveID = $pkg.CurveID = $newType(2, $kindUint16, "tls.CurveID", true, "crypto/tls", true, null); keyShare = $pkg.keyShare = $newType(0, $kindStruct, "tls.keyShare", true, "crypto/tls", false, function(group_, data_) { this.$val = this; if (arguments.length === 0) { this.group = 0; this.data = sliceType$5.nil; return; } this.group = group_; this.data = data_; }); pskIdentity = $pkg.pskIdentity = $newType(0, $kindStruct, "tls.pskIdentity", true, "crypto/tls", false, function(label_, obfuscatedTicketAge_) { this.$val = this; if (arguments.length === 0) { this.label = sliceType$5.nil; this.obfuscatedTicketAge = 0; return; } this.label = label_; this.obfuscatedTicketAge = obfuscatedTicketAge_; }); ConnectionState = $pkg.ConnectionState = $newType(0, $kindStruct, "tls.ConnectionState", true, "crypto/tls", true, function(Version_, HandshakeComplete_, DidResume_, CipherSuite_, NegotiatedProtocol_, NegotiatedProtocolIsMutual_, ServerName_, PeerCertificates_, VerifiedChains_, SignedCertificateTimestamps_, OCSPResponse_, TLSUnique_, ekm_) { this.$val = this; if (arguments.length === 0) { this.Version = 0; this.HandshakeComplete = false; this.DidResume = false; this.CipherSuite = 0; this.NegotiatedProtocol = ""; this.NegotiatedProtocolIsMutual = false; this.ServerName = ""; this.PeerCertificates = sliceType$12.nil; this.VerifiedChains = sliceType$13.nil; this.SignedCertificateTimestamps = sliceType$11.nil; this.OCSPResponse = sliceType$5.nil; this.TLSUnique = sliceType$5.nil; this.ekm = $throwNilPointerError; return; } this.Version = Version_; this.HandshakeComplete = HandshakeComplete_; this.DidResume = DidResume_; this.CipherSuite = CipherSuite_; this.NegotiatedProtocol = NegotiatedProtocol_; this.NegotiatedProtocolIsMutual = NegotiatedProtocolIsMutual_; this.ServerName = ServerName_; this.PeerCertificates = PeerCertificates_; this.VerifiedChains = VerifiedChains_; this.SignedCertificateTimestamps = SignedCertificateTimestamps_; this.OCSPResponse = OCSPResponse_; this.TLSUnique = TLSUnique_; this.ekm = ekm_; }); ClientAuthType = $pkg.ClientAuthType = $newType(4, $kindInt, "tls.ClientAuthType", true, "crypto/tls", true, null); ClientSessionState = $pkg.ClientSessionState = $newType(0, $kindStruct, "tls.ClientSessionState", true, "crypto/tls", true, function(sessionTicket_, vers_, cipherSuite_, masterSecret_, serverCertificates_, verifiedChains_, receivedAt_, ocspResponse_, scts_, nonce_, useBy_, ageAdd_) { this.$val = this; if (arguments.length === 0) { this.sessionTicket = sliceType$5.nil; this.vers = 0; this.cipherSuite = 0; this.masterSecret = sliceType$5.nil; this.serverCertificates = sliceType$12.nil; this.verifiedChains = sliceType$13.nil; this.receivedAt = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$7.nil); this.ocspResponse = sliceType$5.nil; this.scts = sliceType$11.nil; this.nonce = sliceType$5.nil; this.useBy = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$7.nil); this.ageAdd = 0; return; } this.sessionTicket = sessionTicket_; this.vers = vers_; this.cipherSuite = cipherSuite_; this.masterSecret = masterSecret_; this.serverCertificates = serverCertificates_; this.verifiedChains = verifiedChains_; this.receivedAt = receivedAt_; this.ocspResponse = ocspResponse_; this.scts = scts_; this.nonce = nonce_; this.useBy = useBy_; this.ageAdd = ageAdd_; }); ClientSessionCache = $pkg.ClientSessionCache = $newType(8, $kindInterface, "tls.ClientSessionCache", true, "crypto/tls", true, null); SignatureScheme = $pkg.SignatureScheme = $newType(2, $kindUint16, "tls.SignatureScheme", true, "crypto/tls", true, null); ClientHelloInfo = $pkg.ClientHelloInfo = $newType(0, $kindStruct, "tls.ClientHelloInfo", true, "crypto/tls", true, function(CipherSuites_, ServerName_, SupportedCurves_, SupportedPoints_, SignatureSchemes_, SupportedProtos_, SupportedVersions_, Conn_, config_, ctx_) { this.$val = this; if (arguments.length === 0) { this.CipherSuites = sliceType$2.nil; this.ServerName = ""; this.SupportedCurves = sliceType$3.nil; this.SupportedPoints = sliceType$5.nil; this.SignatureSchemes = sliceType$7.nil; this.SupportedProtos = sliceType$1.nil; this.SupportedVersions = sliceType$2.nil; this.Conn = $ifaceNil; this.config = ptrType$4.nil; this.ctx = $ifaceNil; return; } this.CipherSuites = CipherSuites_; this.ServerName = ServerName_; this.SupportedCurves = SupportedCurves_; this.SupportedPoints = SupportedPoints_; this.SignatureSchemes = SignatureSchemes_; this.SupportedProtos = SupportedProtos_; this.SupportedVersions = SupportedVersions_; this.Conn = Conn_; this.config = config_; this.ctx = ctx_; }); CertificateRequestInfo = $pkg.CertificateRequestInfo = $newType(0, $kindStruct, "tls.CertificateRequestInfo", true, "crypto/tls", true, function(AcceptableCAs_, SignatureSchemes_, Version_, ctx_) { this.$val = this; if (arguments.length === 0) { this.AcceptableCAs = sliceType$11.nil; this.SignatureSchemes = sliceType$7.nil; this.Version = 0; this.ctx = $ifaceNil; return; } this.AcceptableCAs = AcceptableCAs_; this.SignatureSchemes = SignatureSchemes_; this.Version = Version_; this.ctx = ctx_; }); RenegotiationSupport = $pkg.RenegotiationSupport = $newType(4, $kindInt, "tls.RenegotiationSupport", true, "crypto/tls", true, null); Config = $pkg.Config = $newType(0, $kindStruct, "tls.Config", true, "crypto/tls", true, function(Rand_, Time_, Certificates_, NameToCertificate_, GetCertificate_, GetClientCertificate_, GetConfigForClient_, VerifyPeerCertificate_, VerifyConnection_, RootCAs_, NextProtos_, ServerName_, ClientAuth_, ClientCAs_, InsecureSkipVerify_, CipherSuites_, PreferServerCipherSuites_, SessionTicketsDisabled_, SessionTicketKey_, ClientSessionCache_, MinVersion_, MaxVersion_, CurvePreferences_, DynamicRecordSizingDisabled_, Renegotiation_, KeyLogWriter_, mutex_, sessionTicketKeys_, autoSessionTicketKeys_) { this.$val = this; if (arguments.length === 0) { this.Rand = $ifaceNil; this.Time = $throwNilPointerError; this.Certificates = sliceType.nil; this.NameToCertificate = false; this.GetCertificate = $throwNilPointerError; this.GetClientCertificate = $throwNilPointerError; this.GetConfigForClient = $throwNilPointerError; this.VerifyPeerCertificate = $throwNilPointerError; this.VerifyConnection = $throwNilPointerError; this.RootCAs = ptrType.nil; this.NextProtos = sliceType$1.nil; this.ServerName = ""; this.ClientAuth = 0; this.ClientCAs = ptrType.nil; this.InsecureSkipVerify = false; this.CipherSuites = sliceType$2.nil; this.PreferServerCipherSuites = false; this.SessionTicketsDisabled = false; this.SessionTicketKey = arrayType.zero(); this.ClientSessionCache = $ifaceNil; this.MinVersion = 0; this.MaxVersion = 0; this.CurvePreferences = sliceType$3.nil; this.DynamicRecordSizingDisabled = false; this.Renegotiation = 0; this.KeyLogWriter = $ifaceNil; this.mutex = new sync.RWMutex.ptr(new sync.Mutex.ptr(0, 0), 0, 0, 0, 0); this.sessionTicketKeys = sliceType$4.nil; this.autoSessionTicketKeys = sliceType$4.nil; return; } this.Rand = Rand_; this.Time = Time_; this.Certificates = Certificates_; this.NameToCertificate = NameToCertificate_; this.GetCertificate = GetCertificate_; this.GetClientCertificate = GetClientCertificate_; this.GetConfigForClient = GetConfigForClient_; this.VerifyPeerCertificate = VerifyPeerCertificate_; this.VerifyConnection = VerifyConnection_; this.RootCAs = RootCAs_; this.NextProtos = NextProtos_; this.ServerName = ServerName_; this.ClientAuth = ClientAuth_; this.ClientCAs = ClientCAs_; this.InsecureSkipVerify = InsecureSkipVerify_; this.CipherSuites = CipherSuites_; this.PreferServerCipherSuites = PreferServerCipherSuites_; this.SessionTicketsDisabled = SessionTicketsDisabled_; this.SessionTicketKey = SessionTicketKey_; this.ClientSessionCache = ClientSessionCache_; this.MinVersion = MinVersion_; this.MaxVersion = MaxVersion_; this.CurvePreferences = CurvePreferences_; this.DynamicRecordSizingDisabled = DynamicRecordSizingDisabled_; this.Renegotiation = Renegotiation_; this.KeyLogWriter = KeyLogWriter_; this.mutex = mutex_; this.sessionTicketKeys = sessionTicketKeys_; this.autoSessionTicketKeys = autoSessionTicketKeys_; }); ticketKey = $pkg.ticketKey = $newType(0, $kindStruct, "tls.ticketKey", true, "crypto/tls", false, function(keyName_, aesKey_, hmacKey_, created_) { this.$val = this; if (arguments.length === 0) { this.keyName = arrayType$4.zero(); this.aesKey = arrayType$4.zero(); this.hmacKey = arrayType$4.zero(); this.created = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$7.nil); return; } this.keyName = keyName_; this.aesKey = aesKey_; this.hmacKey = hmacKey_; this.created = created_; }); Certificate = $pkg.Certificate = $newType(0, $kindStruct, "tls.Certificate", true, "crypto/tls", true, function(Certificate_, PrivateKey_, SupportedSignatureAlgorithms_, OCSPStaple_, SignedCertificateTimestamps_, Leaf_) { this.$val = this; if (arguments.length === 0) { this.Certificate = sliceType$11.nil; this.PrivateKey = $ifaceNil; this.SupportedSignatureAlgorithms = sliceType$7.nil; this.OCSPStaple = sliceType$5.nil; this.SignedCertificateTimestamps = sliceType$11.nil; this.Leaf = ptrType$5.nil; return; } this.Certificate = Certificate_; this.PrivateKey = PrivateKey_; this.SupportedSignatureAlgorithms = SupportedSignatureAlgorithms_; this.OCSPStaple = OCSPStaple_; this.SignedCertificateTimestamps = SignedCertificateTimestamps_; this.Leaf = Leaf_; }); cipherSuite = $pkg.cipherSuite = $newType(0, $kindStruct, "tls.cipherSuite", true, "crypto/tls", false, function(id_, keyLen_, macLen_, ivLen_, ka_, flags_, cipher_, mac_, aead_) { this.$val = this; if (arguments.length === 0) { this.id = 0; this.keyLen = 0; this.macLen = 0; this.ivLen = 0; this.ka = $throwNilPointerError; this.flags = 0; this.cipher = $throwNilPointerError; this.mac = $throwNilPointerError; this.aead = $throwNilPointerError; return; } this.id = id_; this.keyLen = keyLen_; this.macLen = macLen_; this.ivLen = ivLen_; this.ka = ka_; this.flags = flags_; this.cipher = cipher_; this.mac = mac_; this.aead = aead_; }); cipherSuiteTLS13 = $pkg.cipherSuiteTLS13 = $newType(0, $kindStruct, "tls.cipherSuiteTLS13", true, "crypto/tls", false, function(id_, keyLen_, aead_, hash_) { this.$val = this; if (arguments.length === 0) { this.id = 0; this.keyLen = 0; this.aead = $throwNilPointerError; this.hash = 0; return; } this.id = id_; this.keyLen = keyLen_; this.aead = aead_; this.hash = hash_; }); aead = $pkg.aead = $newType(8, $kindInterface, "tls.aead", true, "crypto/tls", false, null); prefixNonceAEAD = $pkg.prefixNonceAEAD = $newType(0, $kindStruct, "tls.prefixNonceAEAD", true, "crypto/tls", false, function(nonce_, aead_) { this.$val = this; if (arguments.length === 0) { this.nonce = arrayType$1.zero(); this.aead = $ifaceNil; return; } this.nonce = nonce_; this.aead = aead_; }); xorNonceAEAD = $pkg.xorNonceAEAD = $newType(0, $kindStruct, "tls.xorNonceAEAD", true, "crypto/tls", false, function(nonceMask_, aead_) { this.$val = this; if (arguments.length === 0) { this.nonceMask = arrayType$1.zero(); this.aead = $ifaceNil; return; } this.nonceMask = nonceMask_; this.aead = aead_; }); constantTimeHash = $pkg.constantTimeHash = $newType(8, $kindInterface, "tls.constantTimeHash", true, "crypto/tls", false, null); cthWrapper = $pkg.cthWrapper = $newType(0, $kindStruct, "tls.cthWrapper", true, "crypto/tls", false, function(h_) { this.$val = this; if (arguments.length === 0) { this.h = $ifaceNil; return; } this.h = h_; }); alert = $pkg.alert = $newType(1, $kindUint8, "tls.alert", true, "crypto/tls", false, null); binaryMarshaler = $newType(8, $kindInterface, "tls.binaryMarshaler", true, "crypto/tls", false, null); sliceType = $sliceType(Certificate); ptrType = $ptrType(x509.CertPool); sliceType$1 = $sliceType($String); sliceType$2 = $sliceType($Uint16); arrayType = $arrayType($Uint8, 32); sliceType$3 = $sliceType(CurveID); sliceType$4 = $sliceType(ticketKey); sliceType$5 = $sliceType($Uint8); sliceType$6 = $sliceType($emptyInterface); ptrType$1 = $ptrType(sliceType$5); sliceType$7 = $sliceType(SignatureScheme); ptrType$2 = $ptrType(cipherSuiteTLS13); sliceType$8 = $sliceType(ptrType$2); ptrType$3 = $ptrType(cipherSuite); sliceType$9 = $sliceType(ptrType$3); structType = $structType("crypto/tls", [{prop: "scheme", name: "scheme", embedded: false, exported: false, typ: SignatureScheme, tag: ""}, {prop: "minModulusBytes", name: "minModulusBytes", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "maxVersion", name: "maxVersion", embedded: false, exported: false, typ: $Uint16, tag: ""}]); sliceType$10 = $sliceType(structType); ptrType$4 = $ptrType(Config); sliceType$11 = $sliceType(sliceType$5); ptrType$5 = $ptrType(x509.Certificate); sliceType$12 = $sliceType(ptrType$5); sliceType$13 = $sliceType(sliceType$12); arrayType$1 = $arrayType($Uint8, 12); arrayType$2 = $arrayType($Uint8, 8); arrayType$3 = $arrayType($Uint8, 13); arrayType$4 = $arrayType($Uint8, 16); ptrType$6 = $ptrType(Conn); ptrType$7 = $ptrType(time.Location); ptrType$8 = $ptrType(net.Resolver); ptrType$9 = $ptrType(net.Dialer); ptrType$10 = $ptrType(pem.Block); ptrType$11 = $ptrType(rsa.PublicKey); ptrType$12 = $ptrType(ecdsa.PublicKey); ptrType$13 = $ptrType(rsa.PrivateKey); ptrType$14 = $ptrType(ecdsa.PrivateKey); ptrType$15 = $ptrType(cryptobyte.Builder); ptrType$16 = $ptrType($Bool); ptrType$17 = $ptrType(cryptobyte.String); ptrType$18 = $ptrType($Uint16); ptrType$19 = $ptrType($Uint64); ptrType$20 = $ptrType($Uint8); ptrType$21 = $ptrType(big.Int); ptrType$22 = $ptrType(serverKeyExchangeMsg); ptrType$23 = $ptrType(clientKeyExchangeMsg); ptrType$24 = $ptrType($Uint32); ptrType$25 = $ptrType(keyShare); ptrType$26 = $ptrType(clientHelloMsg); ptrType$27 = $ptrType(certificateMsgTLS13); ptrType$28 = $ptrType(certificateVerifyMsg); ptrType$29 = $ptrType(finishedMsg); ptrType$30 = $ptrType(serverHelloMsg); ptrType$31 = $ptrType(Certificate); ptrType$32 = $ptrType(sessionState); ptrType$33 = $ptrType(certificateRequestMsg); ptrType$34 = $ptrType(certificateMsg); sliceType$14 = $sliceType(x509.ExtKeyUsage); sliceType$15 = $sliceType(keyShare); sliceType$16 = $sliceType(pskIdentity); ptrType$35 = $ptrType(CurveID); ptrType$36 = $ptrType(SignatureScheme); ptrType$37 = $ptrType(ClientSessionState); ptrType$38 = $ptrType(encryptedExtensionsMsg); ptrType$39 = $ptrType(certificateRequestMsgTLS13); ptrType$40 = $ptrType(certificateStatusMsg); ptrType$41 = $ptrType(serverHelloDoneMsg); arrayType$5 = $arrayType($Uint8, 24); ptrType$42 = $ptrType(newSessionTicketMsg); arrayType$6 = $arrayType($Uint8, 5); ptrType$43 = $ptrType($Int32); ptrType$44 = $ptrType(helloRequestMsg); ptrType$45 = $ptrType(newSessionTicketMsgTLS13); ptrType$46 = $ptrType(keyUpdateMsg); structType$1 = $structType("", []); arrayType$7 = $arrayType($Uint8, 64); ptrType$51 = $ptrType(ed25519.PrivateKey); ptrType$52 = $ptrType(listener); ptrType$53 = $ptrType(Dialer); ptrType$54 = $ptrType(sessionStateTLS13); ptrType$55 = $ptrType(finishedHash); funcType = $funcType([sliceType$5, sliceType$5, sliceType$5, sliceType$5], [], false); ptrType$56 = $ptrType(nistParameters); ptrType$57 = $ptrType(x25519Parameters); ptrType$58 = $ptrType(ecdheKeyAgreement); ptrType$59 = $ptrType(serverHandshakeStateTLS13); ptrType$60 = $ptrType(serverHandshakeState); ptrType$61 = $ptrType(endOfEarlyDataMsg); ptrType$62 = $ptrType(clientHandshakeStateTLS13); ptrType$63 = $ptrType(clientHandshakeState); ptrType$64 = $ptrType(CertificateRequestInfo); funcType$1 = $funcType([context.Context], [$error], false); funcType$2 = $funcType([$String, sliceType$5, $Int], [sliceType$5, $error], false); ptrType$65 = $ptrType(halfConn); ptrType$66 = $ptrType(permanentError); ptrType$67 = $ptrType(atLeastReader); ptrType$68 = $ptrType(ConnectionState); ptrType$69 = $ptrType(ClientHelloInfo); sliceType$18 = $sliceType(arrayType); funcType$3 = $funcType([], [time.Time], false); mapType = $mapType($String, ptrType$31); funcType$4 = $funcType([ptrType$69], [ptrType$31, $error], false); funcType$5 = $funcType([ptrType$64], [ptrType$31, $error], false); funcType$6 = $funcType([ptrType$69], [ptrType$4, $error], false); funcType$7 = $funcType([sliceType$11, sliceType$13], [$error], false); funcType$8 = $funcType([ConnectionState], [$error], false); funcType$9 = $funcType([$Uint16], [keyAgreement], false); funcType$10 = $funcType([sliceType$5, sliceType$5, $Bool], [$emptyInterface], false); funcType$11 = $funcType([sliceType$5], [hash.Hash], false); funcType$12 = $funcType([sliceType$5, sliceType$5], [aead], false); ptrType$71 = $ptrType(prefixNonceAEAD); ptrType$72 = $ptrType(xorNonceAEAD); ptrType$73 = $ptrType(cthWrapper); Server = function(conn, config) { var c, config, conn; c = new Conn.ptr(conn, false, $throwNilPointerError, 0, new sync.Mutex.ptr(0, 0), $ifaceNil, 0, false, config, 0, false, 0, sliceType$5.nil, sliceType$11.nil, sliceType$12.nil, sliceType$13.nil, "", false, $throwNilPointerError, sliceType$5.nil, sliceType$4.nil, false, $ifaceNil, false, arrayType$1.zero(), arrayType$1.zero(), "", new halfConn.ptr(new sync.Mutex.ptr(0, 0), $ifaceNil, 0, $ifaceNil, $ifaceNil, arrayType$2.zero(), arrayType$3.zero(), $ifaceNil, $ifaceNil, sliceType$5.nil), new halfConn.ptr(new sync.Mutex.ptr(0, 0), $ifaceNil, 0, $ifaceNil, $ifaceNil, arrayType$2.zero(), arrayType$3.zero(), $ifaceNil, $ifaceNil, sliceType$5.nil), new bytes.Buffer.ptr(sliceType$5.nil, 0, 0), new bytes.Reader.ptr(sliceType$5.nil, new $Int64(0, 0), 0), new bytes.Buffer.ptr(sliceType$5.nil, 0, 0), false, sliceType$5.nil, new $Int64(0, 0), new $Int64(0, 0), 0, 0, arrayType$4.zero()); c.handshakeFn = $methodVal(c, "serverHandshake"); return c; }; $pkg.Server = Server; Client = function(conn, config) { var c, config, conn; c = new Conn.ptr(conn, true, $throwNilPointerError, 0, new sync.Mutex.ptr(0, 0), $ifaceNil, 0, false, config, 0, false, 0, sliceType$5.nil, sliceType$11.nil, sliceType$12.nil, sliceType$13.nil, "", false, $throwNilPointerError, sliceType$5.nil, sliceType$4.nil, false, $ifaceNil, false, arrayType$1.zero(), arrayType$1.zero(), "", new halfConn.ptr(new sync.Mutex.ptr(0, 0), $ifaceNil, 0, $ifaceNil, $ifaceNil, arrayType$2.zero(), arrayType$3.zero(), $ifaceNil, $ifaceNil, sliceType$5.nil), new halfConn.ptr(new sync.Mutex.ptr(0, 0), $ifaceNil, 0, $ifaceNil, $ifaceNil, arrayType$2.zero(), arrayType$3.zero(), $ifaceNil, $ifaceNil, sliceType$5.nil), new bytes.Buffer.ptr(sliceType$5.nil, 0, 0), new bytes.Reader.ptr(sliceType$5.nil, new $Int64(0, 0), 0), new bytes.Buffer.ptr(sliceType$5.nil, 0, 0), false, sliceType$5.nil, new $Int64(0, 0), new $Int64(0, 0), 0, 0, arrayType$4.zero()); c.handshakeFn = $methodVal(c, "clientHandshake"); return c; }; $pkg.Client = Client; listener.ptr.prototype.Accept = function() { var _r, _tuple, c, err, l, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; c = $f.c; err = $f.err; l = $f.l; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: l = this; _r = l.Listener.Accept(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; c = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [$ifaceNil, err]; } $s = -1; return [Server(c, l.config), $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: listener.ptr.prototype.Accept }; } $f._r = _r; $f._tuple = _tuple; $f.c = c; $f.err = err; $f.l = l; $f.$s = $s; $f.$r = $r; return $f; }; listener.prototype.Accept = function() { return this.$val.Accept(); }; NewListener = function(inner, config) { var config, inner, l; l = new listener.ptr($ifaceNil, ptrType$4.nil); l.Listener = inner; l.config = config; return l; }; $pkg.NewListener = NewListener; dial = function(ctx, netDialer, network, addr, config) { var $24r, $24r$1, $24r$2, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, _tuple$1, _tuple$2, addr, c, cancel, cancel$1, colonPos, config, conn, ctx, err, err$1, hostname, netDialer, network, rawConn, x, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; addr = $f.addr; c = $f.c; cancel = $f.cancel; cancel$1 = $f.cancel$1; colonPos = $f.colonPos; config = $f.config; conn = $f.conn; ctx = $f.ctx; err = $f.err; err$1 = $f.err$1; hostname = $f.hostname; netDialer = $f.netDialer; network = $f.network; rawConn = $f.rawConn; x = $f.x; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); /* */ if (!((x = netDialer.Timeout, (x.$high === 0 && x.$low === 0)))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((x = netDialer.Timeout, (x.$high === 0 && x.$low === 0)))) { */ case 1: cancel = $throwNilPointerError; _r = context.WithTimeout(ctx, netDialer.Timeout); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; ctx = _tuple[0]; cancel = _tuple[1]; $deferred.push([cancel, []]); /* } */ case 2: /* */ if (!$clone(netDialer.Deadline, time.Time).IsZero()) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!$clone(netDialer.Deadline, time.Time).IsZero()) { */ case 4: cancel$1 = $throwNilPointerError; _r$1 = context.WithDeadline(ctx, $clone(netDialer.Deadline, time.Time)); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; ctx = _tuple$1[0]; cancel$1 = _tuple$1[1]; $deferred.push([cancel$1, []]); /* } */ case 5: _r$2 = netDialer.DialContext(ctx, network, addr); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$2 = _r$2; rawConn = _tuple$2[0]; err = _tuple$2[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 8: $24r = [ptrType$6.nil, err]; $s = 10; case 10: return $24r; /* } */ case 9: colonPos = strings.LastIndex(addr, ":"); if (colonPos === -1) { colonPos = addr.length; } hostname = $substring(addr, 0, colonPos); if (config === ptrType$4.nil) { config = defaultConfig(); } /* */ if (config.ServerName === "") { $s = 11; continue; } /* */ $s = 12; continue; /* if (config.ServerName === "") { */ case 11: _r$3 = config.Clone(); /* */ $s = 13; case 13: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } c = _r$3; c.ServerName = hostname; config = c; /* } */ case 12: conn = Client(rawConn, config); _r$4 = conn.HandshakeContext(ctx); /* */ $s = 14; case 14: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } err$1 = _r$4; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 15; continue; } /* */ $s = 16; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 15: _r$5 = rawConn.Close(); /* */ $s = 17; case 17: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; $24r$1 = [ptrType$6.nil, err$1]; $s = 18; case 18: return $24r$1; /* } */ case 16: $24r$2 = [conn, $ifaceNil]; $s = 19; case 19: return $24r$2; /* */ } return; } } catch(err) { $err = err; $s = -1; return [ptrType$6.nil, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: dial }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.addr = addr; $f.c = c; $f.cancel = cancel; $f.cancel$1 = cancel$1; $f.colonPos = colonPos; $f.config = config; $f.conn = conn; $f.ctx = ctx; $f.err = err; $f.err$1 = err$1; $f.hostname = hostname; $f.netDialer = netDialer; $f.network = network; $f.rawConn = rawConn; $f.x = x; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Dialer.ptr.prototype.Dial = function(network, addr) { var $24r, _r, addr, d, network, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; addr = $f.addr; d = $f.d; network = $f.network; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: d = this; _r = d.DialContext(context.Background(), network, addr); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Dialer.ptr.prototype.Dial }; } $f.$24r = $24r; $f._r = _r; $f.addr = addr; $f.d = d; $f.network = network; $f.$s = $s; $f.$r = $r; return $f; }; Dialer.prototype.Dial = function(network, addr) { return this.$val.Dial(network, addr); }; Dialer.ptr.prototype.netDialer = function() { var d; d = this; if (!(d.NetDialer === ptrType$9.nil)) { return d.NetDialer; } return new net.Dialer.ptr(new time.Duration(0, 0), new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$7.nil), $ifaceNil, false, new time.Duration(0, 0), new time.Duration(0, 0), ptrType$8.nil, $chanNil, $throwNilPointerError); }; Dialer.prototype.netDialer = function() { return this.$val.netDialer(); }; Dialer.ptr.prototype.DialContext = function(ctx, network, addr) { var _r, _tuple, addr, c, ctx, d, err, network, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; addr = $f.addr; c = $f.c; ctx = $f.ctx; d = $f.d; err = $f.err; network = $f.network; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: d = this; _r = dial(ctx, d.netDialer(), network, addr, d.Config); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; c = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [$ifaceNil, err]; } $s = -1; return [c, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Dialer.ptr.prototype.DialContext }; } $f._r = _r; $f._tuple = _tuple; $f.addr = addr; $f.c = c; $f.ctx = ctx; $f.d = d; $f.err = err; $f.network = network; $f.$s = $s; $f.$r = $r; return $f; }; Dialer.prototype.DialContext = function(ctx, network, addr) { return this.$val.DialContext(ctx, network, addr); }; LoadX509KeyPair = function(certFile, keyFile) { var $24r, _r, _r$1, _r$2, _tuple, _tuple$1, certFile, certPEMBlock, err, keyFile, keyPEMBlock, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; certFile = $f.certFile; certPEMBlock = $f.certPEMBlock; err = $f.err; keyFile = $f.keyFile; keyPEMBlock = $f.keyPEMBlock; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = os.ReadFile(certFile); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; certPEMBlock = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [new Certificate.ptr(sliceType$11.nil, $ifaceNil, sliceType$7.nil, sliceType$5.nil, sliceType$11.nil, ptrType$5.nil), err]; } _r$1 = os.ReadFile(keyFile); /* */ $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; keyPEMBlock = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [new Certificate.ptr(sliceType$11.nil, $ifaceNil, sliceType$7.nil, sliceType$5.nil, sliceType$11.nil, ptrType$5.nil), err]; } _r$2 = X509KeyPair(certPEMBlock, keyPEMBlock); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 4; case 4: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: LoadX509KeyPair }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.certFile = certFile; $f.certPEMBlock = certPEMBlock; $f.err = err; $f.keyFile = keyFile; $f.keyPEMBlock = keyPEMBlock; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.LoadX509KeyPair = LoadX509KeyPair; X509KeyPair = function(certPEMBlock, keyPEMBlock) { var $24r, $24r$1, $24r$10, $24r$11, $24r$12, $24r$13, $24r$14, $24r$2, $24r$3, $24r$4, $24r$5, $24r$6, $24r$7, $24r$8, $24r$9, _r, _r$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$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, cert, certDERBlock, certPEMBlock, err, fail, keyDERBlock, keyPEMBlock, ok, ok$1, ok$2, priv, priv$1, priv$2, pub, pub$1, pub$2, pub$3, skippedBlockTypes, x, x509Cert, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$10 = $f.$24r$10; $24r$11 = $f.$24r$11; $24r$12 = $f.$24r$12; $24r$13 = $f.$24r$13; $24r$14 = $f.$24r$14; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; $24r$6 = $f.$24r$6; $24r$7 = $f.$24r$7; $24r$8 = $f.$24r$8; $24r$9 = $f.$24r$9; _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$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$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; _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; cert = $f.cert; certDERBlock = $f.certDERBlock; certPEMBlock = $f.certPEMBlock; err = $f.err; fail = $f.fail; keyDERBlock = $f.keyDERBlock; keyPEMBlock = $f.keyPEMBlock; ok = $f.ok; ok$1 = $f.ok$1; ok$2 = $f.ok$2; priv = $f.priv; priv$1 = $f.priv$1; priv$2 = $f.priv$2; pub = $f.pub; pub$1 = $f.pub$1; pub$2 = $f.pub$2; pub$3 = $f.pub$3; skippedBlockTypes = $f.skippedBlockTypes; x = $f.x; x509Cert = $f.x509Cert; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fail = (function(err) { var err; return [new Certificate.ptr(sliceType$11.nil, $ifaceNil, sliceType$7.nil, sliceType$5.nil, sliceType$11.nil, ptrType$5.nil), err]; }); cert = new Certificate.ptr(sliceType$11.nil, $ifaceNil, sliceType$7.nil, sliceType$5.nil, sliceType$11.nil, ptrType$5.nil); skippedBlockTypes = sliceType$1.nil; /* while (true) { */ case 1: certDERBlock = ptrType$10.nil; _r = pem.Decode(certPEMBlock); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; certDERBlock = _tuple[0]; certPEMBlock = _tuple[1]; if (certDERBlock === ptrType$10.nil) { /* break; */ $s = 2; continue; } if (certDERBlock.Type === "CERTIFICATE") { cert.Certificate = $append(cert.Certificate, certDERBlock.Bytes); } else { skippedBlockTypes = $append(skippedBlockTypes, certDERBlock.Type); } $s = 1; continue; case 2: /* */ if (cert.Certificate.$length === 0) { $s = 4; continue; } /* */ $s = 5; continue; /* if (cert.Certificate.$length === 0) { */ case 4: /* */ if (skippedBlockTypes.$length === 0) { $s = 6; continue; } /* */ $s = 7; continue; /* if (skippedBlockTypes.$length === 0) { */ case 6: _r$1 = fail(errors.New("tls: failed to find any PEM data in certificate input")); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 9; case 9: return $24r; /* } */ case 7: /* */ if ((skippedBlockTypes.$length === 1) && strings.HasSuffix((0 >= skippedBlockTypes.$length ? ($throwRuntimeError("index out of range"), undefined) : skippedBlockTypes.$array[skippedBlockTypes.$offset + 0]), "PRIVATE KEY")) { $s = 10; continue; } /* */ $s = 11; continue; /* if ((skippedBlockTypes.$length === 1) && strings.HasSuffix((0 >= skippedBlockTypes.$length ? ($throwRuntimeError("index out of range"), undefined) : skippedBlockTypes.$array[skippedBlockTypes.$offset + 0]), "PRIVATE KEY")) { */ case 10: _r$2 = fail(errors.New("tls: failed to find certificate PEM data in certificate input, but did find a private key; PEM inputs may have been switched")); /* */ $s = 12; case 12: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r$1 = _r$2; $s = 13; case 13: return $24r$1; /* } */ case 11: _r$3 = fmt.Errorf("tls: failed to find \"CERTIFICATE\" PEM block in certificate input after skipping PEM blocks of the following types: %v", new sliceType$6([skippedBlockTypes])); /* */ $s = 14; case 14: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = fail(_r$3); /* */ $s = 15; case 15: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r$2 = _r$4; $s = 16; case 16: return $24r$2; /* } */ case 5: skippedBlockTypes = $subslice(skippedBlockTypes, 0, 0); keyDERBlock = ptrType$10.nil; /* while (true) { */ case 17: _r$5 = pem.Decode(keyPEMBlock); /* */ $s = 19; case 19: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$1 = _r$5; keyDERBlock = _tuple$1[0]; keyPEMBlock = _tuple$1[1]; /* */ if (keyDERBlock === ptrType$10.nil) { $s = 20; continue; } /* */ $s = 21; continue; /* if (keyDERBlock === ptrType$10.nil) { */ case 20: /* */ if (skippedBlockTypes.$length === 0) { $s = 22; continue; } /* */ $s = 23; continue; /* if (skippedBlockTypes.$length === 0) { */ case 22: _r$6 = fail(errors.New("tls: failed to find any PEM data in key input")); /* */ $s = 24; case 24: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } $24r$3 = _r$6; $s = 25; case 25: return $24r$3; /* } */ case 23: /* */ if ((skippedBlockTypes.$length === 1) && (0 >= skippedBlockTypes.$length ? ($throwRuntimeError("index out of range"), undefined) : skippedBlockTypes.$array[skippedBlockTypes.$offset + 0]) === "CERTIFICATE") { $s = 26; continue; } /* */ $s = 27; continue; /* if ((skippedBlockTypes.$length === 1) && (0 >= skippedBlockTypes.$length ? ($throwRuntimeError("index out of range"), undefined) : skippedBlockTypes.$array[skippedBlockTypes.$offset + 0]) === "CERTIFICATE") { */ case 26: _r$7 = fail(errors.New("tls: found a certificate rather than a key in the PEM for the private key")); /* */ $s = 28; case 28: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } $24r$4 = _r$7; $s = 29; case 29: return $24r$4; /* } */ case 27: _r$8 = fmt.Errorf("tls: failed to find PEM block with type ending in \"PRIVATE KEY\" in key input after skipping PEM blocks of the following types: %v", new sliceType$6([skippedBlockTypes])); /* */ $s = 30; case 30: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$9 = fail(_r$8); /* */ $s = 31; case 31: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $24r$5 = _r$9; $s = 32; case 32: return $24r$5; /* } */ case 21: if (keyDERBlock.Type === "PRIVATE KEY" || strings.HasSuffix(keyDERBlock.Type, " PRIVATE KEY")) { /* break; */ $s = 18; continue; } skippedBlockTypes = $append(skippedBlockTypes, keyDERBlock.Type); $s = 17; continue; case 18: _r$10 = x509.ParseCertificate((x = cert.Certificate, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0]))); /* */ $s = 33; case 33: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$2 = _r$10; x509Cert = _tuple$2[0]; err = _tuple$2[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 34; continue; } /* */ $s = 35; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 34: _r$11 = fail(err); /* */ $s = 36; case 36: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } $24r$6 = _r$11; $s = 37; case 37: return $24r$6; /* } */ case 35: _r$12 = parsePrivateKey(keyDERBlock.Bytes); /* */ $s = 38; case 38: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _tuple$3 = _r$12; cert.PrivateKey = _tuple$3[0]; err = _tuple$3[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 39; continue; } /* */ $s = 40; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 39: _r$13 = fail(err); /* */ $s = 41; case 41: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } $24r$7 = _r$13; $s = 42; case 42: return $24r$7; /* } */ case 40: _ref = x509Cert.PublicKey; /* */ if ($assertType(_ref, ptrType$11, true)[1]) { $s = 43; continue; } /* */ if ($assertType(_ref, ptrType$12, true)[1]) { $s = 44; continue; } /* */ if ($assertType(_ref, ed25519.PublicKey, true)[1]) { $s = 45; continue; } /* */ $s = 46; continue; /* if ($assertType(_ref, ptrType$11, true)[1]) { */ case 43: pub = _ref.$val; _tuple$4 = $assertType(cert.PrivateKey, ptrType$13, true); priv = _tuple$4[0]; ok = _tuple$4[1]; /* */ if (!ok) { $s = 48; continue; } /* */ $s = 49; continue; /* if (!ok) { */ case 48: _r$14 = fail(errors.New("tls: private key type does not match public key type")); /* */ $s = 50; case 50: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } $24r$8 = _r$14; $s = 51; case 51: return $24r$8; /* } */ case 49: /* */ if (!((pub.N.Cmp(priv.PublicKey.N) === 0))) { $s = 52; continue; } /* */ $s = 53; continue; /* if (!((pub.N.Cmp(priv.PublicKey.N) === 0))) { */ case 52: _r$15 = fail(errors.New("tls: private key does not match public key")); /* */ $s = 54; case 54: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } $24r$9 = _r$15; $s = 55; case 55: return $24r$9; /* } */ case 53: $s = 47; continue; /* } else if ($assertType(_ref, ptrType$12, true)[1]) { */ case 44: pub$1 = _ref.$val; _tuple$5 = $assertType(cert.PrivateKey, ptrType$14, true); priv$1 = _tuple$5[0]; ok$1 = _tuple$5[1]; /* */ if (!ok$1) { $s = 56; continue; } /* */ $s = 57; continue; /* if (!ok$1) { */ case 56: _r$16 = fail(errors.New("tls: private key type does not match public key type")); /* */ $s = 58; case 58: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } $24r$10 = _r$16; $s = 59; case 59: return $24r$10; /* } */ case 57: /* */ if (!((pub$1.X.Cmp(priv$1.PublicKey.X) === 0)) || !((pub$1.Y.Cmp(priv$1.PublicKey.Y) === 0))) { $s = 60; continue; } /* */ $s = 61; continue; /* if (!((pub$1.X.Cmp(priv$1.PublicKey.X) === 0)) || !((pub$1.Y.Cmp(priv$1.PublicKey.Y) === 0))) { */ case 60: _r$17 = fail(errors.New("tls: private key does not match public key")); /* */ $s = 62; case 62: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } $24r$11 = _r$17; $s = 63; case 63: return $24r$11; /* } */ case 61: $s = 47; continue; /* } else if ($assertType(_ref, ed25519.PublicKey, true)[1]) { */ case 45: pub$2 = _ref.$val; _tuple$6 = $assertType(cert.PrivateKey, ed25519.PrivateKey, true); priv$2 = _tuple$6[0]; ok$2 = _tuple$6[1]; /* */ if (!ok$2) { $s = 64; continue; } /* */ $s = 65; continue; /* if (!ok$2) { */ case 64: _r$18 = fail(errors.New("tls: private key type does not match public key type")); /* */ $s = 66; case 66: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } $24r$12 = _r$18; $s = 67; case 67: return $24r$12; /* } */ case 65: /* */ if (!bytes.Equal($convertSliceType($assertType(priv$2.Public(), ed25519.PublicKey), sliceType$5), $convertSliceType(pub$2, sliceType$5))) { $s = 68; continue; } /* */ $s = 69; continue; /* if (!bytes.Equal($convertSliceType($assertType(priv$2.Public(), ed25519.PublicKey), sliceType$5), $convertSliceType(pub$2, sliceType$5))) { */ case 68: _r$19 = fail(errors.New("tls: private key does not match public key")); /* */ $s = 70; case 70: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } $24r$13 = _r$19; $s = 71; case 71: return $24r$13; /* } */ case 69: $s = 47; continue; /* } else { */ case 46: pub$3 = _ref; _r$20 = fail(errors.New("tls: unknown public key algorithm")); /* */ $s = 72; case 72: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } $24r$14 = _r$20; $s = 73; case 73: return $24r$14; /* } */ case 47: $s = -1; return [cert, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: X509KeyPair }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$10 = $24r$10; $f.$24r$11 = $24r$11; $f.$24r$12 = $24r$12; $f.$24r$13 = $24r$13; $f.$24r$14 = $24r$14; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f.$24r$6 = $24r$6; $f.$24r$7 = $24r$7; $f.$24r$8 = $24r$8; $f.$24r$9 = $24r$9; $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$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$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._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.cert = cert; $f.certDERBlock = certDERBlock; $f.certPEMBlock = certPEMBlock; $f.err = err; $f.fail = fail; $f.keyDERBlock = keyDERBlock; $f.keyPEMBlock = keyPEMBlock; $f.ok = ok; $f.ok$1 = ok$1; $f.ok$2 = ok$2; $f.priv = priv; $f.priv$1 = priv$1; $f.priv$2 = priv$2; $f.pub = pub; $f.pub$1 = pub$1; $f.pub$2 = pub$2; $f.pub$3 = pub$3; $f.skippedBlockTypes = skippedBlockTypes; $f.x = x; $f.x509Cert = x509Cert; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.X509KeyPair = X509KeyPair; parsePrivateKey = function(der) { var _r, _r$1, _r$2, _ref, _tuple, _tuple$1, _tuple$2, der, err, err$1, err$2, key, key$1, key$2, key$3, key$4, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; der = $f.der; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; key = $f.key; key$1 = $f.key$1; key$2 = $f.key$2; key$3 = $f.key$3; key$4 = $f.key$4; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = x509.ParsePKCS1PrivateKey(der); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; key = _tuple[0]; err = _tuple[1]; if ($interfaceIsEqual(err, $ifaceNil)) { $s = -1; return [key, $ifaceNil]; } _r$1 = x509.ParsePKCS8PrivateKey(der); /* */ $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; key$1 = _tuple$1[0]; err$1 = _tuple$1[1]; if ($interfaceIsEqual(err$1, $ifaceNil)) { _ref = key$1; if ($assertType(_ref, ptrType$13, true)[1] || $assertType(_ref, ptrType$14, true)[1] || $assertType(_ref, ed25519.PrivateKey, true)[1]) { key$2 = _ref; $s = -1; return [key$2, $ifaceNil]; } else { key$3 = _ref; $s = -1; return [$ifaceNil, errors.New("tls: found unknown private key type in PKCS#8 wrapping")]; } } _r$2 = x509.ParseECPrivateKey(der); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$2 = _r$2; key$4 = _tuple$2[0]; err$2 = _tuple$2[1]; if ($interfaceIsEqual(err$2, $ifaceNil)) { $s = -1; return [key$4, $ifaceNil]; } $s = -1; return [$ifaceNil, errors.New("tls: failed to parse private key")]; /* */ } return; } if ($f === undefined) { $f = { $blk: parsePrivateKey }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.der = der; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.key = key; $f.key$1 = key$1; $f.key$2 = key$2; $f.key$3 = key$3; $f.key$4 = key$4; $f.$s = $s; $f.$r = $r; return $f; }; sessionState.ptr.prototype.marshal = function() { var b, m, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; m = $f.m; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = [b]; m = [m]; m[0] = this; b[0] = new cryptobyte.Builder.ptr($ifaceNil, sliceType$5.nil, false, ptrType$15.nil, 0, 0, false, ptrType$16.nil); b[0].AddUint16(m[0].vers); b[0].AddUint16(m[0].cipherSuite); addUint64(b[0], m[0].createdAt); $r = b[0].AddUint16LengthPrefixed((function(b, m) { return function(b$1) { var b$1; b$1.AddBytes(m[0].masterSecret); }; })(b, m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = b[0].AddUint24LengthPrefixed((function(b, m) { return function $b(b$1) { var _i, _ref, b$1, cert, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _ref = $f._ref; b$1 = $f.b$1; cert = $f.cert; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cert = [cert]; _ref = m[0].certificates; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } cert[0] = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); $r = b$1.AddUint24LengthPrefixed((function(b, cert, m) { return function(b$2) { var b$2; b$2.AddBytes(cert[0]); }; })(b, cert, m)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i++; $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._i = _i; $f._ref = _ref; $f.b$1 = b$1; $f.cert = cert; $f.$s = $s; $f.$r = $r; return $f; }; })(b, m)); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return b[0].BytesOrPanic(); /* */ } return; } if ($f === undefined) { $f = { $blk: sessionState.ptr.prototype.marshal }; } $f.b = b; $f.m = m; $f.$s = $s; $f.$r = $r; return $f; }; sessionState.prototype.marshal = function() { return this.$val.marshal(); }; sessionState.ptr.prototype.unmarshal = function(data) { var cert, certList, certList$24ptr, data, m, ok, s, s$24ptr; m = this; sessionState.copy(m, new sessionState.ptr(0, 0, new $Uint64(0, 0), sliceType$5.nil, sliceType$11.nil, m.usedOldKey)); s = ($convertSliceType(data, cryptobyte.String)); ok = (s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).ReadUint16((m.$ptr_vers || (m.$ptr_vers = new ptrType$18(function() { return this.$target.vers; }, function($v) { this.$target.vers = $v; }, m)))) && (s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).ReadUint16((m.$ptr_cipherSuite || (m.$ptr_cipherSuite = new ptrType$18(function() { return this.$target.cipherSuite; }, function($v) { this.$target.cipherSuite = $v; }, m)))) && readUint64((s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))), (m.$ptr_createdAt || (m.$ptr_createdAt = new ptrType$19(function() { return this.$target.createdAt; }, function($v) { this.$target.createdAt = $v; }, m)))) && readUint16LengthPrefixed((s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))), (m.$ptr_masterSecret || (m.$ptr_masterSecret = new ptrType$1(function() { return this.$target.masterSecret; }, function($v) { this.$target.masterSecret = $v; }, m)))) && !((m.masterSecret.$length === 0)); if (!ok) { return false; } certList = cryptobyte.String.nil; if (!(s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).ReadUint24LengthPrefixed((certList$24ptr || (certList$24ptr = new ptrType$17(function() { return certList; }, function($v) { certList = $convertSliceType($v, cryptobyte.String); }))))) { return false; } while (true) { if (!(!certList.Empty())) { break; } cert = [cert]; cert[0] = sliceType$5.nil; if (!readUint24LengthPrefixed((certList$24ptr || (certList$24ptr = new ptrType$17(function() { return certList; }, function($v) { certList = $convertSliceType($v, cryptobyte.String); }))), (cert.$ptr || (cert.$ptr = new ptrType$1(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, cert))))) { return false; } m.certificates = $append(m.certificates, cert[0]); } return s.Empty(); }; sessionState.prototype.unmarshal = function(data) { return this.$val.unmarshal(data); }; sessionStateTLS13.ptr.prototype.marshal = function() { var b, m, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; m = $f.m; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = [b]; m = [m]; m[0] = this; b[0] = new cryptobyte.Builder.ptr($ifaceNil, sliceType$5.nil, false, ptrType$15.nil, 0, 0, false, ptrType$16.nil); b[0].AddUint16(772); b[0].AddUint8(0); b[0].AddUint16(m[0].cipherSuite); addUint64(b[0], m[0].createdAt); $r = b[0].AddUint8LengthPrefixed((function(b, m) { return function(b$1) { var b$1; b$1.AddBytes(m[0].resumptionSecret); }; })(b, m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = marshalCertificate(b[0], $clone(m[0].certificate, Certificate)); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return b[0].BytesOrPanic(); /* */ } return; } if ($f === undefined) { $f = { $blk: sessionStateTLS13.ptr.prototype.marshal }; } $f.b = b; $f.m = m; $f.$s = $s; $f.$r = $r; return $f; }; sessionStateTLS13.prototype.marshal = function() { return this.$val.marshal(); }; sessionStateTLS13.ptr.prototype.unmarshal = function(data) { var data, m, revision, revision$24ptr, s, s$24ptr, version, version$24ptr; m = this; sessionStateTLS13.copy(m, new sessionStateTLS13.ptr(0, new $Uint64(0, 0), sliceType$5.nil, new Certificate.ptr(sliceType$11.nil, $ifaceNil, sliceType$7.nil, sliceType$5.nil, sliceType$11.nil, ptrType$5.nil))); s = ($convertSliceType(data, cryptobyte.String)); version = 0; revision = 0; return (s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).ReadUint16((version$24ptr || (version$24ptr = new ptrType$18(function() { return version; }, function($v) { version = $v; })))) && (version === 772) && (s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).ReadUint8((revision$24ptr || (revision$24ptr = new ptrType$20(function() { return revision; }, function($v) { revision = $v; })))) && (revision === 0) && (s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).ReadUint16((m.$ptr_cipherSuite || (m.$ptr_cipherSuite = new ptrType$18(function() { return this.$target.cipherSuite; }, function($v) { this.$target.cipherSuite = $v; }, m)))) && readUint64((s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))), (m.$ptr_createdAt || (m.$ptr_createdAt = new ptrType$19(function() { return this.$target.createdAt; }, function($v) { this.$target.createdAt = $v; }, m)))) && readUint8LengthPrefixed((s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))), (m.$ptr_resumptionSecret || (m.$ptr_resumptionSecret = new ptrType$1(function() { return this.$target.resumptionSecret; }, function($v) { this.$target.resumptionSecret = $v; }, m)))) && !((m.resumptionSecret.$length === 0)) && unmarshalCertificate((s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))), m.certificate) && s.Empty(); }; sessionStateTLS13.prototype.unmarshal = function(data) { return this.$val.unmarshal(data); }; Conn.ptr.prototype.encryptTicket = function(state) { var $24r, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _tuple, _tuple$1, block, c, encrypted, err, err$1, iv, key, keyName, mac, macBytes, state, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; block = $f.block; c = $f.c; encrypted = $f.encrypted; err = $f.err; err$1 = $f.err$1; iv = $f.iv; key = $f.key; keyName = $f.keyName; mac = $f.mac; macBytes = $f.macBytes; state = $f.state; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (c.ticketKeys.$length === 0) { $s = -1; return [sliceType$5.nil, errors.New("tls: internal error: session ticket keys unavailable")]; } encrypted = $makeSlice(sliceType$5, ((32 + state.$length >> 0) + 32 >> 0)); keyName = $subslice(encrypted, 0, 16); iv = $subslice(encrypted, 16, 32); macBytes = $subslice(encrypted, (encrypted.$length - 32 >> 0)); _r = io.ReadFull(c.config.rand(), iv); /* */ $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))) { $s = -1; return [sliceType$5.nil, err]; } key = $clone((x = c.ticketKeys, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])), ticketKey); $copySlice(keyName, new sliceType$5(key.keyName)); _tuple$1 = aes.NewCipher(new sliceType$5(key.aesKey)); block = _tuple$1[0]; err$1 = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 2: _r$1 = err$1.Error(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = errors.New("tls: failed to create cipher while encrypting ticket: " + _r$1); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = [sliceType$5.nil, _r$2]; $s = 6; case 6: return $24r; /* } */ case 3: _r$3 = cipher.NewCTR(block, iv); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $r = _r$3.XORKeyStream($subslice(encrypted, 32), state); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$4 = hmac.New(sha256.New, new sliceType$5(key.hmacKey)); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } mac = _r$4; _r$5 = mac.Write($subslice(encrypted, 0, (encrypted.$length - 32 >> 0))); /* */ $s = 10; case 10: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; _r$6 = mac.Sum($subslice(macBytes, 0, 0)); /* */ $s = 11; case 11: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; $s = -1; return [encrypted, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.encryptTicket }; } $f.$24r = $24r; $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.block = block; $f.c = c; $f.encrypted = encrypted; $f.err = err; $f.err$1 = err$1; $f.iv = iv; $f.key = key; $f.keyName = keyName; $f.mac = mac; $f.macBytes = macBytes; $f.state = state; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Conn.prototype.encryptTicket = function(state) { return this.$val.encryptTicket(state); }; Conn.ptr.prototype.decryptTicket = function(encrypted) { var _i, _r, _r$1, _r$2, _r$3, _ref, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, block, c, candidateKey, ciphertext, encrypted, err, expected, i, iv, key, keyIndex, keyName, mac, macBytes, plaintext, usedOldKey, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _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; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; block = $f.block; c = $f.c; candidateKey = $f.candidateKey; ciphertext = $f.ciphertext; encrypted = $f.encrypted; err = $f.err; expected = $f.expected; i = $f.i; iv = $f.iv; key = $f.key; keyIndex = $f.keyIndex; keyName = $f.keyName; mac = $f.mac; macBytes = $f.macBytes; plaintext = $f.plaintext; usedOldKey = $f.usedOldKey; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: plaintext = sliceType$5.nil; usedOldKey = false; c = this; if (encrypted.$length < 64) { _tmp = sliceType$5.nil; _tmp$1 = false; plaintext = _tmp; usedOldKey = _tmp$1; $s = -1; return [plaintext, usedOldKey]; } keyName = $subslice(encrypted, 0, 16); iv = $subslice(encrypted, 16, 32); macBytes = $subslice(encrypted, (encrypted.$length - 32 >> 0)); ciphertext = $subslice(encrypted, 32, (encrypted.$length - 32 >> 0)); keyIndex = -1; _ref = c.ticketKeys; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; candidateKey = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), ticketKey); if (bytes.Equal(keyName, new sliceType$5(candidateKey.keyName))) { keyIndex = i; break; } _i++; } if (keyIndex === -1) { _tmp$2 = sliceType$5.nil; _tmp$3 = false; plaintext = _tmp$2; usedOldKey = _tmp$3; $s = -1; return [plaintext, usedOldKey]; } key = (x = c.ticketKeys, ((keyIndex < 0 || keyIndex >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + keyIndex])); _r = hmac.New(sha256.New, new sliceType$5(key.hmacKey)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } mac = _r; _r$1 = mac.Write($subslice(encrypted, 0, (encrypted.$length - 32 >> 0))); /* */ $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$2 = mac.Sum(sliceType$5.nil); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } expected = _r$2; if (!((subtle.ConstantTimeCompare(macBytes, expected) === 1))) { _tmp$4 = sliceType$5.nil; _tmp$5 = false; plaintext = _tmp$4; usedOldKey = _tmp$5; $s = -1; return [plaintext, usedOldKey]; } _tuple = aes.NewCipher(new sliceType$5(key.aesKey)); block = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$6 = sliceType$5.nil; _tmp$7 = false; plaintext = _tmp$6; usedOldKey = _tmp$7; $s = -1; return [plaintext, usedOldKey]; } plaintext = $makeSlice(sliceType$5, ciphertext.$length); _r$3 = cipher.NewCTR(block, iv); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $r = _r$3.XORKeyStream(plaintext, ciphertext); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp$8 = plaintext; _tmp$9 = keyIndex > 0; plaintext = _tmp$8; usedOldKey = _tmp$9; $s = -1; return [plaintext, usedOldKey]; /* */ } return; } if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.decryptTicket }; } $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._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._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f.block = block; $f.c = c; $f.candidateKey = candidateKey; $f.ciphertext = ciphertext; $f.encrypted = encrypted; $f.err = err; $f.expected = expected; $f.i = i; $f.iv = iv; $f.key = key; $f.keyIndex = keyIndex; $f.keyName = keyName; $f.mac = mac; $f.macBytes = macBytes; $f.plaintext = plaintext; $f.usedOldKey = usedOldKey; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Conn.prototype.decryptTicket = function(encrypted) { return this.$val.decryptTicket(encrypted); }; splitPreMasterSecret = function(secret) { var _q, _q$1, s1, s2, secret; s1 = sliceType$5.nil; s2 = sliceType$5.nil; s1 = $subslice(secret, 0, (_q = ((secret.$length + 1 >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))); s2 = $subslice(secret, (_q$1 = secret.$length / 2, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero"))); return [s1, s2]; }; pHash = function(result, secret, seed, hash$1) { var _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, a, b, h, hash$1, j, result, secret, seed, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; a = $f.a; b = $f.b; h = $f.h; hash$1 = $f.hash$1; j = $f.j; result = $f.result; secret = $f.secret; seed = $f.seed; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = hmac.New(hash$1, secret); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } h = _r; _r$1 = h.Write(seed); /* */ $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$2 = h.Sum(sliceType$5.nil); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } a = _r$2; j = 0; /* while (true) { */ case 4: /* if (!(j < result.$length)) { break; } */ if(!(j < result.$length)) { $s = 5; continue; } $r = h.Reset(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$3 = h.Write(a); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _r$4 = h.Write(seed); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; _r$5 = h.Sum(sliceType$5.nil); /* */ $s = 9; case 9: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } b = _r$5; $copySlice($subslice(result, j), b); j = j + (b.$length) >> 0; $r = h.Reset(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$6 = h.Write(a); /* */ $s = 11; case 11: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; _r$7 = h.Sum(sliceType$5.nil); /* */ $s = 12; case 12: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } a = _r$7; $s = 4; continue; case 5: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: pHash }; } $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.a = a; $f.b = b; $f.h = h; $f.hash$1 = hash$1; $f.j = j; $f.result = result; $f.secret = secret; $f.seed = seed; $f.$s = $s; $f.$r = $r; return $f; }; prf10 = function(result, secret, label, seed) { var _i, _ref, _tuple, b, hashMD5, hashSHA1, i, label, labelAndSeed, result, result2, s1, s2, secret, seed, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _ref = $f._ref; _tuple = $f._tuple; b = $f.b; hashMD5 = $f.hashMD5; hashSHA1 = $f.hashSHA1; i = $f.i; label = $f.label; labelAndSeed = $f.labelAndSeed; result = $f.result; result2 = $f.result2; s1 = $f.s1; s2 = $f.s2; secret = $f.secret; seed = $f.seed; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hashSHA1 = sha1.New; hashMD5 = md5.New; labelAndSeed = $makeSlice(sliceType$5, (label.$length + seed.$length >> 0)); $copySlice(labelAndSeed, label); $copySlice($subslice(labelAndSeed, label.$length), seed); _tuple = splitPreMasterSecret(secret); s1 = _tuple[0]; s2 = _tuple[1]; $r = pHash(result, s1, labelAndSeed, hashMD5); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } result2 = $makeSlice(sliceType$5, result.$length); $r = pHash(result2, s2, labelAndSeed, hashSHA1); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _ref = result2; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; b = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); ((i < 0 || i >= result.$length) ? ($throwRuntimeError("index out of range"), undefined) : result.$array[result.$offset + i] = ((((i < 0 || i >= result.$length) ? ($throwRuntimeError("index out of range"), undefined) : result.$array[result.$offset + i]) ^ (b)) << 24 >>> 24)); _i++; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: prf10 }; } $f._i = _i; $f._ref = _ref; $f._tuple = _tuple; $f.b = b; $f.hashMD5 = hashMD5; $f.hashSHA1 = hashSHA1; $f.i = i; $f.label = label; $f.labelAndSeed = labelAndSeed; $f.result = result; $f.result2 = result2; $f.s1 = s1; $f.s2 = s2; $f.secret = secret; $f.seed = seed; $f.$s = $s; $f.$r = $r; return $f; }; prf12 = function(hashFunc) { var hashFunc; return (function $b(result, secret, label, seed) { var label, labelAndSeed, result, secret, seed, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; label = $f.label; labelAndSeed = $f.labelAndSeed; result = $f.result; secret = $f.secret; seed = $f.seed; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: labelAndSeed = $makeSlice(sliceType$5, (label.$length + seed.$length >> 0)); $copySlice(labelAndSeed, label); $copySlice($subslice(labelAndSeed, label.$length), seed); $r = pHash(result, secret, labelAndSeed, hashFunc); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.label = label; $f.labelAndSeed = labelAndSeed; $f.result = result; $f.secret = secret; $f.seed = seed; $f.$s = $s; $f.$r = $r; return $f; }); }; prfAndHashForVersion = function(version, suite) { var _1, suite, version; _1 = version; if ((_1 === (769)) || (_1 === (770))) { return [prf10, 0]; } else if (_1 === (771)) { if (!(((suite.flags & 8) === 0))) { return [prf12(sha512.New384), 6]; } return [prf12(sha256.New), 5]; } else { $panic(new $String("unknown version")); } }; prfForVersion = function(version, suite) { var _tuple, prf, suite, version; _tuple = prfAndHashForVersion(version, suite); prf = _tuple[0]; return prf; }; masterFromPreMasterSecret = function(version, suite, preMasterSecret, clientRandom, serverRandom) { var clientRandom, masterSecret, preMasterSecret, seed, serverRandom, suite, version, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; clientRandom = $f.clientRandom; masterSecret = $f.masterSecret; preMasterSecret = $f.preMasterSecret; seed = $f.seed; serverRandom = $f.serverRandom; suite = $f.suite; version = $f.version; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: seed = $makeSlice(sliceType$5, 0, (clientRandom.$length + serverRandom.$length >> 0)); seed = $appendSlice(seed, clientRandom); seed = $appendSlice(seed, serverRandom); masterSecret = $makeSlice(sliceType$5, 48); $r = prfForVersion(version, suite)(masterSecret, preMasterSecret, masterSecretLabel, seed); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return masterSecret; /* */ } return; } if ($f === undefined) { $f = { $blk: masterFromPreMasterSecret }; } $f.clientRandom = clientRandom; $f.masterSecret = masterSecret; $f.preMasterSecret = preMasterSecret; $f.seed = seed; $f.serverRandom = serverRandom; $f.suite = suite; $f.version = version; $f.$s = $s; $f.$r = $r; return $f; }; keysFromMasterSecret = function(version, suite, masterSecret, clientRandom, serverRandom, macLen, keyLen, ivLen) { var clientIV, clientKey, clientMAC, clientRandom, ivLen, keyLen, keyMaterial, macLen, masterSecret, n, seed, serverIV, serverKey, serverMAC, serverRandom, suite, version, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; clientIV = $f.clientIV; clientKey = $f.clientKey; clientMAC = $f.clientMAC; clientRandom = $f.clientRandom; ivLen = $f.ivLen; keyLen = $f.keyLen; keyMaterial = $f.keyMaterial; macLen = $f.macLen; masterSecret = $f.masterSecret; n = $f.n; seed = $f.seed; serverIV = $f.serverIV; serverKey = $f.serverKey; serverMAC = $f.serverMAC; serverRandom = $f.serverRandom; suite = $f.suite; version = $f.version; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: clientMAC = sliceType$5.nil; serverMAC = sliceType$5.nil; clientKey = sliceType$5.nil; serverKey = sliceType$5.nil; clientIV = sliceType$5.nil; serverIV = sliceType$5.nil; seed = $makeSlice(sliceType$5, 0, (serverRandom.$length + clientRandom.$length >> 0)); seed = $appendSlice(seed, serverRandom); seed = $appendSlice(seed, clientRandom); n = (($imul(2, macLen)) + ($imul(2, keyLen)) >> 0) + ($imul(2, ivLen)) >> 0; keyMaterial = $makeSlice(sliceType$5, n); $r = prfForVersion(version, suite)(keyMaterial, masterSecret, keyExpansionLabel, seed); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } clientMAC = $subslice(keyMaterial, 0, macLen); keyMaterial = $subslice(keyMaterial, macLen); serverMAC = $subslice(keyMaterial, 0, macLen); keyMaterial = $subslice(keyMaterial, macLen); clientKey = $subslice(keyMaterial, 0, keyLen); keyMaterial = $subslice(keyMaterial, keyLen); serverKey = $subslice(keyMaterial, 0, keyLen); keyMaterial = $subslice(keyMaterial, keyLen); clientIV = $subslice(keyMaterial, 0, ivLen); keyMaterial = $subslice(keyMaterial, ivLen); serverIV = $subslice(keyMaterial, 0, ivLen); $s = -1; return [clientMAC, serverMAC, clientKey, serverKey, clientIV, serverIV]; /* */ } return; } if ($f === undefined) { $f = { $blk: keysFromMasterSecret }; } $f.clientIV = clientIV; $f.clientKey = clientKey; $f.clientMAC = clientMAC; $f.clientRandom = clientRandom; $f.ivLen = ivLen; $f.keyLen = keyLen; $f.keyMaterial = keyMaterial; $f.macLen = macLen; $f.masterSecret = masterSecret; $f.n = n; $f.seed = seed; $f.serverIV = serverIV; $f.serverKey = serverKey; $f.serverMAC = serverMAC; $f.serverRandom = serverRandom; $f.suite = suite; $f.version = version; $f.$s = $s; $f.$r = $r; return $f; }; newFinishedHash = function(version, cipherSuite$1) { var $24r, _r, _r$1, _tuple, buffer, cipherSuite$1, hash$1, prf, version, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; buffer = $f.buffer; cipherSuite$1 = $f.cipherSuite$1; hash$1 = $f.hash$1; prf = $f.prf; version = $f.version; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: buffer = sliceType$5.nil; if (version >= 771) { buffer = new sliceType$5([]); } _tuple = prfAndHashForVersion(version, cipherSuite$1); prf = _tuple[0]; hash$1 = _tuple[1]; /* */ if (!((hash$1 === 0))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((hash$1 === 0))) { */ case 1: _r = new crypto.Hash(hash$1).New(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = new crypto.Hash(hash$1).New(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = new finishedHash.ptr(_r, _r$1, $ifaceNil, $ifaceNil, buffer, version, prf); $s = 5; case 5: return $24r; /* } */ case 2: $s = -1; return new finishedHash.ptr(sha1.New(), sha1.New(), md5.New(), md5.New(), buffer, version, prf); /* */ } return; } if ($f === undefined) { $f = { $blk: newFinishedHash }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.buffer = buffer; $f.cipherSuite$1 = cipherSuite$1; $f.hash$1 = hash$1; $f.prf = prf; $f.version = version; $f.$s = $s; $f.$r = $r; return $f; }; finishedHash.ptr.prototype.Write = function(msg) { var _r, _r$1, _r$2, _r$3, _tmp, _tmp$1, err, h, msg, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; err = $f.err; h = $f.h; msg = $f.msg; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; h = this; _r = h.client.Write(msg); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; _r$1 = h.server.Write(msg); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; /* */ if (h.version < 771) { $s = 3; continue; } /* */ $s = 4; continue; /* if (h.version < 771) { */ case 3: _r$2 = h.clientMD5.Write(msg); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; _r$3 = h.serverMD5.Write(msg); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; /* } */ case 4: if (!(h.buffer === sliceType$5.nil)) { h.buffer = $appendSlice(h.buffer, msg); } _tmp = msg.$length; _tmp$1 = $ifaceNil; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: finishedHash.ptr.prototype.Write }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.err = err; $f.h = h; $f.msg = msg; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; finishedHash.prototype.Write = function(msg) { return this.$val.Write(msg); }; finishedHash.ptr.prototype.Sum = function() { var $24r, $24r$1, _r, _r$1, _r$2, h, out, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; h = $f.h; out = $f.out; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: h = this; /* */ if (h.version >= 771) { $s = 1; continue; } /* */ $s = 2; continue; /* if (h.version >= 771) { */ case 1: _r = h.client.Sum(sliceType$5.nil); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 4; case 4: return $24r; /* } */ case 2: out = $makeSlice(sliceType$5, 0, 36); _r$1 = h.clientMD5.Sum(out); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } out = _r$1; _r$2 = h.client.Sum(out); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r$1 = _r$2; $s = 7; case 7: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: finishedHash.ptr.prototype.Sum }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.h = h; $f.out = out; $f.$s = $s; $f.$r = $r; return $f; }; finishedHash.prototype.Sum = function() { return this.$val.Sum(); }; finishedHash.ptr.prototype.clientSum = function(masterSecret) { var _arg, _arg$1, _arg$2, _arg$3, _r, h, masterSecret, out, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _r = $f._r; h = $f.h; masterSecret = $f.masterSecret; out = $f.out; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: h = this; out = $makeSlice(sliceType$5, 12); _arg = out; _arg$1 = masterSecret; _arg$2 = clientFinishedLabel; _r = $clone(h, finishedHash).Sum(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$3 = _r; $r = h.prf(_arg, _arg$1, _arg$2, _arg$3); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return out; /* */ } return; } if ($f === undefined) { $f = { $blk: finishedHash.ptr.prototype.clientSum }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._r = _r; $f.h = h; $f.masterSecret = masterSecret; $f.out = out; $f.$s = $s; $f.$r = $r; return $f; }; finishedHash.prototype.clientSum = function(masterSecret) { return this.$val.clientSum(masterSecret); }; finishedHash.ptr.prototype.serverSum = function(masterSecret) { var _arg, _arg$1, _arg$2, _arg$3, _r, h, masterSecret, out, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _r = $f._r; h = $f.h; masterSecret = $f.masterSecret; out = $f.out; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: h = this; out = $makeSlice(sliceType$5, 12); _arg = out; _arg$1 = masterSecret; _arg$2 = serverFinishedLabel; _r = $clone(h, finishedHash).Sum(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$3 = _r; $r = h.prf(_arg, _arg$1, _arg$2, _arg$3); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return out; /* */ } return; } if ($f === undefined) { $f = { $blk: finishedHash.ptr.prototype.serverSum }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._r = _r; $f.h = h; $f.masterSecret = masterSecret; $f.out = out; $f.$s = $s; $f.$r = $r; return $f; }; finishedHash.prototype.serverSum = function(masterSecret) { return this.$val.serverSum(masterSecret); }; finishedHash.ptr.prototype.hashForClientCertificate = function(sigType, hashAlg, masterSecret) { var $24r, $24r$1, $24r$2, _r, _r$1, _r$2, _r$3, _r$4, h, hash$1, hashAlg, masterSecret, sigType, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; h = $f.h; hash$1 = $f.hash$1; hashAlg = $f.hashAlg; masterSecret = $f.masterSecret; sigType = $f.sigType; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: h = this; if ((h.version >= 771 || (sigType === 228)) && h.buffer === sliceType$5.nil) { $panic(new $String("tls: handshake hash for a client certificate requested after discarding the handshake buffer")); } if (sigType === 228) { $s = -1; return h.buffer; } /* */ if (h.version >= 771) { $s = 1; continue; } /* */ $s = 2; continue; /* if (h.version >= 771) { */ case 1: _r = new crypto.Hash(hashAlg).New(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } hash$1 = _r; _r$1 = hash$1.Write(h.buffer); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _r$2 = hash$1.Sum(sliceType$5.nil); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 6; case 6: return $24r; /* } */ case 2: /* */ if (sigType === 227) { $s = 7; continue; } /* */ $s = 8; continue; /* if (sigType === 227) { */ case 7: _r$3 = h.server.Sum(sliceType$5.nil); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r$1 = _r$3; $s = 10; case 10: return $24r$1; /* } */ case 8: _r$4 = $clone(h, finishedHash).Sum(); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r$2 = _r$4; $s = 12; case 12: return $24r$2; /* */ } return; } if ($f === undefined) { $f = { $blk: finishedHash.ptr.prototype.hashForClientCertificate }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$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.h = h; $f.hash$1 = hash$1; $f.hashAlg = hashAlg; $f.masterSecret = masterSecret; $f.sigType = sigType; $f.$s = $s; $f.$r = $r; return $f; }; finishedHash.prototype.hashForClientCertificate = function(sigType, hashAlg, masterSecret) { return this.$val.hashForClientCertificate(sigType, hashAlg, masterSecret); }; finishedHash.ptr.prototype.discardHandshakeBuffer = function() { var h; h = this; h.buffer = sliceType$5.nil; }; finishedHash.prototype.discardHandshakeBuffer = function() { return this.$val.discardHandshakeBuffer(); }; noExportedKeyingMaterial = function(label, context$1, length) { var context$1, label, length; return [sliceType$5.nil, errors.New("crypto/tls: ExportKeyingMaterial is unavailable when renegotiation is enabled")]; }; ekmFromMasterSecret = function(version, suite, masterSecret, clientRandom, serverRandom) { var clientRandom, masterSecret, serverRandom, suite, version; return (function $b(label, context$1, length) { var $24r, $24r$1, _1, _r, _r$1, context$1, keyMaterial, label, length, seed, seedLen, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; context$1 = $f.context$1; keyMaterial = $f.keyMaterial; label = $f.label; length = $f.length; seed = $f.seed; seedLen = $f.seedLen; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _1 = label; /* */ if (_1 === ("client finished") || _1 === ("server finished") || _1 === ("master secret") || _1 === ("key expansion")) { $s = 2; continue; } /* */ $s = 3; continue; /* if (_1 === ("client finished") || _1 === ("server finished") || _1 === ("master secret") || _1 === ("key expansion")) { */ case 2: _r = fmt.Errorf("crypto/tls: reserved ExportKeyingMaterial label: %s", new sliceType$6([new $String(label)])); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = [sliceType$5.nil, _r]; $s = 5; case 5: return $24r; /* } */ case 3: case 1: seedLen = serverRandom.$length + clientRandom.$length >> 0; if (!(context$1 === sliceType$5.nil)) { seedLen = seedLen + ((2 + context$1.$length >> 0)) >> 0; } seed = $makeSlice(sliceType$5, 0, seedLen); seed = $appendSlice(seed, clientRandom); seed = $appendSlice(seed, serverRandom); /* */ if (!(context$1 === sliceType$5.nil)) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!(context$1 === sliceType$5.nil)) { */ case 6: /* */ if (context$1.$length >= 65536) { $s = 8; continue; } /* */ $s = 9; continue; /* if (context$1.$length >= 65536) { */ case 8: _r$1 = fmt.Errorf("crypto/tls: ExportKeyingMaterial context too long", new sliceType$6([])); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r$1 = [sliceType$5.nil, _r$1]; $s = 11; case 11: return $24r$1; /* } */ case 9: seed = $append(seed, (((context$1.$length >> 8 >> 0) << 24 >>> 24)), ((context$1.$length << 24 >>> 24))); seed = $appendSlice(seed, context$1); /* } */ case 7: keyMaterial = $makeSlice(sliceType$5, length); $r = prfForVersion(version, suite)(keyMaterial, masterSecret, (new sliceType$5($stringToBytes(label))), seed); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return [keyMaterial, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f.context$1 = context$1; $f.keyMaterial = keyMaterial; $f.label = label; $f.length = length; $f.seed = seed; $f.seedLen = seedLen; $f.$s = $s; $f.$r = $r; return $f; }); }; cipherSuiteTLS13.ptr.prototype.expandLabel = function(secret, label, context$1, length) { var _r, _r$1, _tuple, c, context$1, err, hkdfLabel, label, length, n, out, secret, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; c = $f.c; context$1 = $f.context$1; err = $f.err; hkdfLabel = $f.hkdfLabel; label = $f.label; length = $f.length; n = $f.n; out = $f.out; secret = $f.secret; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: context$1 = [context$1]; label = [label]; c = this; hkdfLabel = new cryptobyte.Builder.ptr($ifaceNil, sliceType$5.nil, false, ptrType$15.nil, 0, 0, false, ptrType$16.nil); hkdfLabel.AddUint16(((length << 16 >>> 16))); $r = hkdfLabel.AddUint8LengthPrefixed((function(context$1, label) { return function(b) { var b; b.AddBytes((new sliceType$5($stringToBytes("tls13 ")))); b.AddBytes((new sliceType$5($stringToBytes(label[0])))); }; })(context$1, label)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = hkdfLabel.AddUint8LengthPrefixed((function(context$1, label) { return function(b) { var b; b.AddBytes(context$1[0]); }; })(context$1, label)); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } out = $makeSlice(sliceType$5, length); _r = hkdf.Expand($methodVal(new crypto.Hash(c.hash), "New"), secret, hkdfLabel.BytesOrPanic()); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = _r.Read(out); /* */ $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; n = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil)) || !((n === length))) { $panic(new $String("tls: HKDF-Expand-Label invocation failed unexpectedly")); } $s = -1; return out; /* */ } return; } if ($f === undefined) { $f = { $blk: cipherSuiteTLS13.ptr.prototype.expandLabel }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.c = c; $f.context$1 = context$1; $f.err = err; $f.hkdfLabel = hkdfLabel; $f.label = label; $f.length = length; $f.n = n; $f.out = out; $f.secret = secret; $f.$s = $s; $f.$r = $r; return $f; }; cipherSuiteTLS13.prototype.expandLabel = function(secret, label, context$1, length) { return this.$val.expandLabel(secret, label, context$1, length); }; cipherSuiteTLS13.ptr.prototype.deriveSecret = function(secret, label, transcript) { var $24r, _arg, _arg$1, _arg$2, _arg$3, _r, _r$1, _r$2, c, label, secret, transcript, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; c = $f.c; label = $f.label; secret = $f.secret; transcript = $f.transcript; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; /* */ if ($interfaceIsEqual(transcript, $ifaceNil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($interfaceIsEqual(transcript, $ifaceNil)) { */ case 1: _r = new crypto.Hash(c.hash).New(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } transcript = _r; /* } */ case 2: _arg = secret; _arg$1 = label; _r$1 = transcript.Sum(sliceType$5.nil); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$2 = _r$1; _arg$3 = new crypto.Hash(c.hash).Size(); _r$2 = c.expandLabel(_arg, _arg$1, _arg$2, _arg$3); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 6; case 6: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: cipherSuiteTLS13.ptr.prototype.deriveSecret }; } $f.$24r = $24r; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.c = c; $f.label = label; $f.secret = secret; $f.transcript = transcript; $f.$s = $s; $f.$r = $r; return $f; }; cipherSuiteTLS13.prototype.deriveSecret = function(secret, label, transcript) { return this.$val.deriveSecret(secret, label, transcript); }; cipherSuiteTLS13.ptr.prototype.extract = function(newSecret, currentSecret) { var $24r, _r, c, currentSecret, newSecret, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; c = $f.c; currentSecret = $f.currentSecret; newSecret = $f.newSecret; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (newSecret === sliceType$5.nil) { newSecret = $makeSlice(sliceType$5, new crypto.Hash(c.hash).Size()); } _r = hkdf.Extract($methodVal(new crypto.Hash(c.hash), "New"), newSecret, currentSecret); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: cipherSuiteTLS13.ptr.prototype.extract }; } $f.$24r = $24r; $f._r = _r; $f.c = c; $f.currentSecret = currentSecret; $f.newSecret = newSecret; $f.$s = $s; $f.$r = $r; return $f; }; cipherSuiteTLS13.prototype.extract = function(newSecret, currentSecret) { return this.$val.extract(newSecret, currentSecret); }; cipherSuiteTLS13.ptr.prototype.nextTrafficSecret = function(trafficSecret) { var $24r, _r, c, trafficSecret, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; c = $f.c; trafficSecret = $f.trafficSecret; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r = c.expandLabel(trafficSecret, "traffic upd", sliceType$5.nil, new crypto.Hash(c.hash).Size()); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: cipherSuiteTLS13.ptr.prototype.nextTrafficSecret }; } $f.$24r = $24r; $f._r = _r; $f.c = c; $f.trafficSecret = trafficSecret; $f.$s = $s; $f.$r = $r; return $f; }; cipherSuiteTLS13.prototype.nextTrafficSecret = function(trafficSecret) { return this.$val.nextTrafficSecret(trafficSecret); }; cipherSuiteTLS13.ptr.prototype.trafficKey = function(trafficSecret) { var _r, _r$1, c, iv, key, trafficSecret, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; c = $f.c; iv = $f.iv; key = $f.key; trafficSecret = $f.trafficSecret; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: key = sliceType$5.nil; iv = sliceType$5.nil; c = this; _r = c.expandLabel(trafficSecret, "key", sliceType$5.nil, c.keyLen); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } key = _r; _r$1 = c.expandLabel(trafficSecret, "iv", sliceType$5.nil, 12); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } iv = _r$1; $s = -1; return [key, iv]; /* */ } return; } if ($f === undefined) { $f = { $blk: cipherSuiteTLS13.ptr.prototype.trafficKey }; } $f._r = _r; $f._r$1 = _r$1; $f.c = c; $f.iv = iv; $f.key = key; $f.trafficSecret = trafficSecret; $f.$s = $s; $f.$r = $r; return $f; }; cipherSuiteTLS13.prototype.trafficKey = function(trafficSecret) { return this.$val.trafficKey(trafficSecret); }; cipherSuiteTLS13.ptr.prototype.finishedHash = function(baseKey, transcript) { var $24r, _r, _r$1, _r$2, _r$3, _r$4, baseKey, c, finishedKey, transcript, verifyData, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; baseKey = $f.baseKey; c = $f.c; finishedKey = $f.finishedKey; transcript = $f.transcript; verifyData = $f.verifyData; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r = c.expandLabel(baseKey, "finished", sliceType$5.nil, new crypto.Hash(c.hash).Size()); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } finishedKey = _r; _r$1 = hmac.New($methodVal(new crypto.Hash(c.hash), "New"), finishedKey); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } verifyData = _r$1; _r$2 = transcript.Sum(sliceType$5.nil); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = verifyData.Write(_r$2); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _r$4 = verifyData.Sum(sliceType$5.nil); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r = _r$4; $s = 6; case 6: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: cipherSuiteTLS13.ptr.prototype.finishedHash }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.baseKey = baseKey; $f.c = c; $f.finishedKey = finishedKey; $f.transcript = transcript; $f.verifyData = verifyData; $f.$s = $s; $f.$r = $r; return $f; }; cipherSuiteTLS13.prototype.finishedHash = function(baseKey, transcript) { return this.$val.finishedHash(baseKey, transcript); }; cipherSuiteTLS13.ptr.prototype.exportKeyingMaterial = function(masterSecret, transcript) { var _r, c, expMasterSecret, masterSecret, transcript, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; c = $f.c; expMasterSecret = $f.expMasterSecret; masterSecret = $f.masterSecret; transcript = $f.transcript; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = [c]; expMasterSecret = [expMasterSecret]; c[0] = this; _r = c[0].deriveSecret(masterSecret, "exp master", transcript); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } expMasterSecret[0] = _r; $s = -1; return (function(c, expMasterSecret) { return function $b(label, context$1, length) { var $24r, _arg, _arg$1, _arg$2, _r$1, _r$2, _r$3, _r$4, _r$5, context$1, h, label, length, secret, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _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; context$1 = $f.context$1; h = $f.h; label = $f.label; length = $f.length; secret = $f.secret; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = c[0].deriveSecret(expMasterSecret[0], label, $ifaceNil); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } secret = _r$1; _r$2 = new crypto.Hash(c[0].hash).New(); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } h = _r$2; _r$3 = h.Write(context$1); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _arg = secret; _r$4 = h.Sum(sliceType$5.nil); /* */ $s = 4; case 4: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _arg$1 = _r$4; _arg$2 = length; _r$5 = c[0].expandLabel(_arg, "exporter", _arg$1, _arg$2); /* */ $s = 5; case 5: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $24r = [_r$5, $ifaceNil]; $s = 6; case 6: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$24r = $24r; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $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.context$1 = context$1; $f.h = h; $f.label = label; $f.length = length; $f.secret = secret; $f.$s = $s; $f.$r = $r; return $f; }; })(c, expMasterSecret); /* */ } return; } if ($f === undefined) { $f = { $blk: cipherSuiteTLS13.ptr.prototype.exportKeyingMaterial }; } $f._r = _r; $f.c = c; $f.expMasterSecret = expMasterSecret; $f.masterSecret = masterSecret; $f.transcript = transcript; $f.$s = $s; $f.$r = $r; return $f; }; cipherSuiteTLS13.prototype.exportKeyingMaterial = function(masterSecret, transcript) { return this.$val.exportKeyingMaterial(masterSecret, transcript); }; generateECDHEParameters = function(rand$1, curveID) { var _r, _r$1, _r$2, _r$3, _tuple, _tuple$1, _tuple$2, _tuple$3, curve, curveID, err, err$1, err$2, ok, p, privateKey, publicKey, rand$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; curve = $f.curve; curveID = $f.curveID; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; ok = $f.ok; p = $f.p; privateKey = $f.privateKey; publicKey = $f.publicKey; rand$1 = $f.rand$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (curveID === 29) { $s = 1; continue; } /* */ $s = 2; continue; /* if (curveID === 29) { */ case 1: privateKey = $makeSlice(sliceType$5, 32); _r = io.ReadFull(rand$1, privateKey); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [$ifaceNil, err]; } _r$1 = curve25519.X25519(privateKey, curve25519.Basepoint); /* */ $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; publicKey = _tuple$1[0]; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [$ifaceNil, err$1]; } $s = -1; return [new x25519Parameters.ptr(privateKey, publicKey), $ifaceNil]; /* } */ case 2: _r$2 = curveForCurveID(curveID); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$2 = _r$2; curve = _tuple$2[0]; ok = _tuple$2[1]; if (!ok) { $s = -1; return [$ifaceNil, errors.New("tls: internal error: unsupported curve")]; } p = new nistParameters.ptr(sliceType$5.nil, ptrType$21.nil, ptrType$21.nil, curveID); err$2 = $ifaceNil; _r$3 = elliptic.GenerateKey(curve, rand$1); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$3 = _r$3; p.privateKey = _tuple$3[0]; p.x = _tuple$3[1]; p.y = _tuple$3[2]; err$2 = _tuple$3[3]; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return [$ifaceNil, err$2]; } $s = -1; return [p, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: generateECDHEParameters }; } $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._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.curve = curve; $f.curveID = curveID; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.ok = ok; $f.p = p; $f.privateKey = privateKey; $f.publicKey = publicKey; $f.rand$1 = rand$1; $f.$s = $s; $f.$r = $r; return $f; }; curveForCurveID = function(id) { var $24r, $24r$1, $24r$2, _1, _r, _r$1, _r$2, id, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; id = $f.id; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _1 = id; /* */ if (_1 === (23)) { $s = 2; continue; } /* */ if (_1 === (24)) { $s = 3; continue; } /* */ if (_1 === (25)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_1 === (23)) { */ case 2: _r = elliptic.P256(); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = [_r, true]; $s = 8; case 8: return $24r; /* } else if (_1 === (24)) { */ case 3: _r$1 = elliptic.P384(); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r$1 = [_r$1, true]; $s = 10; case 10: return $24r$1; /* } else if (_1 === (25)) { */ case 4: _r$2 = elliptic.P521(); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r$2 = [_r$2, true]; $s = 12; case 12: return $24r$2; /* } else { */ case 5: $s = -1; return [$ifaceNil, false]; /* } */ case 6: case 1: $s = -1; return [$ifaceNil, false]; /* */ } return; } if ($f === undefined) { $f = { $blk: curveForCurveID }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.id = id; $f.$s = $s; $f.$r = $r; return $f; }; nistParameters.ptr.prototype.CurveID = function() { var p; p = this; return p.curveID; }; nistParameters.prototype.CurveID = function() { return this.$val.CurveID(); }; nistParameters.ptr.prototype.PublicKey = function() { var $24r, _r, _r$1, _tuple, curve, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; curve = $f.curve; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; _r = curveForCurveID(p.curveID); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; curve = _tuple[0]; _r$1 = elliptic.Marshal(curve, p.x, p.y); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: nistParameters.ptr.prototype.PublicKey }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.curve = curve; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; nistParameters.prototype.PublicKey = function() { return this.$val.PublicKey(); }; nistParameters.ptr.prototype.SharedKey = function(peerPublicKey) { var _q, _r, _r$1, _r$2, _r$3, _tuple, _tuple$1, _tuple$2, curve, p, peerPublicKey, sharedKey, x, xShared, y, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _q = $f._q; _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; _tuple$2 = $f._tuple$2; curve = $f.curve; p = $f.p; peerPublicKey = $f.peerPublicKey; sharedKey = $f.sharedKey; x = $f.x; xShared = $f.xShared; y = $f.y; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; _r = curveForCurveID(p.curveID); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; curve = _tuple[0]; _r$1 = elliptic.Unmarshal(curve, peerPublicKey); /* */ $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; x = _tuple$1[0]; y = _tuple$1[1]; if (x === ptrType$21.nil) { $s = -1; return sliceType$5.nil; } _r$2 = curve.ScalarMult(x, y, p.privateKey); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$2 = _r$2; xShared = _tuple$2[0]; _r$3 = curve.Params(); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } sharedKey = $makeSlice(sliceType$5, (_q = ((_r$3.BitSize + 7 >> 0)) / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))); $s = -1; return xShared.FillBytes(sharedKey); /* */ } return; } if ($f === undefined) { $f = { $blk: nistParameters.ptr.prototype.SharedKey }; } $f._q = _q; $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._tuple$2 = _tuple$2; $f.curve = curve; $f.p = p; $f.peerPublicKey = peerPublicKey; $f.sharedKey = sharedKey; $f.x = x; $f.xShared = xShared; $f.y = y; $f.$s = $s; $f.$r = $r; return $f; }; nistParameters.prototype.SharedKey = function(peerPublicKey) { return this.$val.SharedKey(peerPublicKey); }; x25519Parameters.ptr.prototype.CurveID = function() { var p; p = this; return 29; }; x25519Parameters.prototype.CurveID = function() { return this.$val.CurveID(); }; x25519Parameters.ptr.prototype.PublicKey = function() { var p; p = this; return p.publicKey; }; x25519Parameters.prototype.PublicKey = function() { return this.$val.PublicKey(); }; x25519Parameters.ptr.prototype.SharedKey = function(peerPublicKey) { var _r, _tuple, err, p, peerPublicKey, sharedKey, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; p = $f.p; peerPublicKey = $f.peerPublicKey; sharedKey = $f.sharedKey; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; _r = curve25519.X25519(p.privateKey, peerPublicKey); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; sharedKey = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return sliceType$5.nil; } $s = -1; return sharedKey; /* */ } return; } if ($f === undefined) { $f = { $blk: x25519Parameters.ptr.prototype.SharedKey }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.p = p; $f.peerPublicKey = peerPublicKey; $f.sharedKey = sharedKey; $f.$s = $s; $f.$r = $r; return $f; }; x25519Parameters.prototype.SharedKey = function(peerPublicKey) { return this.$val.SharedKey(peerPublicKey); }; rsaKeyAgreement.ptr.prototype.generateServerKeyExchange = function(config, cert, clientHello, hello) { var cert, clientHello, config, hello, ka; ka = this; return [ptrType$22.nil, $ifaceNil]; }; rsaKeyAgreement.prototype.generateServerKeyExchange = function(config, cert, clientHello, hello) { return this.$val.generateServerKeyExchange(config, cert, clientHello, hello); }; rsaKeyAgreement.ptr.prototype.processClientKeyExchange = function(config, cert, ckx, version) { var _r, _tuple, _tuple$1, cert, ciphertext, ciphertextLen, ckx, config, err, ka, ok, preMasterSecret, priv, version, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; cert = $f.cert; ciphertext = $f.ciphertext; ciphertextLen = $f.ciphertextLen; ckx = $f.ckx; config = $f.config; err = $f.err; ka = $f.ka; ok = $f.ok; preMasterSecret = $f.preMasterSecret; priv = $f.priv; version = $f.version; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ka = this; if (ckx.ciphertext.$length < 2) { $s = -1; return [sliceType$5.nil, errClientKeyExchange]; } ciphertextLen = ((((x = ckx.ciphertext, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])) >> 0)) << 8 >> 0) | (((x$1 = ckx.ciphertext, (1 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 1])) >> 0)); if (!((ciphertextLen === (ckx.ciphertext.$length - 2 >> 0)))) { $s = -1; return [sliceType$5.nil, errClientKeyExchange]; } ciphertext = $subslice(ckx.ciphertext, 2); _tuple = $assertType(cert.PrivateKey, crypto.Decrypter, true); priv = _tuple[0]; ok = _tuple[1]; if (!ok) { $s = -1; return [sliceType$5.nil, errors.New("tls: certificate private key does not implement crypto.Decrypter")]; } _r = priv.Decrypt(config.rand(), ciphertext, new rsa.PKCS1v15DecryptOptions.ptr(48)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple$1 = _r; preMasterSecret = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType$5.nil, err]; } $s = -1; return [preMasterSecret, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: rsaKeyAgreement.ptr.prototype.processClientKeyExchange }; } $f._r = _r; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.cert = cert; $f.ciphertext = ciphertext; $f.ciphertextLen = ciphertextLen; $f.ckx = ckx; $f.config = config; $f.err = err; $f.ka = ka; $f.ok = ok; $f.preMasterSecret = preMasterSecret; $f.priv = priv; $f.version = version; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; rsaKeyAgreement.prototype.processClientKeyExchange = function(config, cert, ckx, version) { return this.$val.processClientKeyExchange(config, cert, ckx, version); }; rsaKeyAgreement.ptr.prototype.processServerKeyExchange = function(config, clientHello, serverHello, cert, skx) { var cert, clientHello, config, ka, serverHello, skx; ka = this; return errors.New("tls: unexpected ServerKeyExchange"); }; rsaKeyAgreement.prototype.processServerKeyExchange = function(config, clientHello, serverHello, cert, skx) { return this.$val.processServerKeyExchange(config, clientHello, serverHello, cert, skx); }; rsaKeyAgreement.ptr.prototype.generateClientKeyExchange = function(config, clientHello, cert) { var _r, _r$1, _tuple, _tuple$1, _tuple$2, cert, ckx, clientHello, config, encrypted, err, ka, ok, preMasterSecret, rsaKey, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; cert = $f.cert; ckx = $f.ckx; clientHello = $f.clientHello; config = $f.config; encrypted = $f.encrypted; err = $f.err; ka = $f.ka; ok = $f.ok; preMasterSecret = $f.preMasterSecret; rsaKey = $f.rsaKey; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ka = this; preMasterSecret = $makeSlice(sliceType$5, 48); (0 >= preMasterSecret.$length ? ($throwRuntimeError("index out of range"), undefined) : preMasterSecret.$array[preMasterSecret.$offset + 0] = (((clientHello.vers >>> 8 << 16 >>> 16) << 24 >>> 24))); (1 >= preMasterSecret.$length ? ($throwRuntimeError("index out of range"), undefined) : preMasterSecret.$array[preMasterSecret.$offset + 1] = ((clientHello.vers << 24 >>> 24))); _r = io.ReadFull(config.rand(), $subslice(preMasterSecret, 2)); /* */ $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))) { $s = -1; return [sliceType$5.nil, ptrType$23.nil, err]; } _tuple$1 = $assertType(cert.PublicKey, ptrType$11, true); rsaKey = _tuple$1[0]; ok = _tuple$1[1]; if (!ok) { $s = -1; return [sliceType$5.nil, ptrType$23.nil, errors.New("tls: server certificate contains incorrect key type for selected ciphersuite")]; } _r$1 = rsa.EncryptPKCS1v15(config.rand(), rsaKey, preMasterSecret); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$2 = _r$1; encrypted = _tuple$2[0]; err = _tuple$2[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType$5.nil, ptrType$23.nil, err]; } ckx = new clientKeyExchangeMsg.ptr(sliceType$5.nil, sliceType$5.nil); ckx.ciphertext = $makeSlice(sliceType$5, (encrypted.$length + 2 >> 0)); (x = ckx.ciphertext, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0] = (((encrypted.$length >> 8 >> 0) << 24 >>> 24)))); (x$1 = ckx.ciphertext, (1 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 1] = ((encrypted.$length << 24 >>> 24)))); $copySlice($subslice(ckx.ciphertext, 2), encrypted); $s = -1; return [preMasterSecret, ckx, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: rsaKeyAgreement.ptr.prototype.generateClientKeyExchange }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.cert = cert; $f.ckx = ckx; $f.clientHello = clientHello; $f.config = config; $f.encrypted = encrypted; $f.err = err; $f.ka = ka; $f.ok = ok; $f.preMasterSecret = preMasterSecret; $f.rsaKey = rsaKey; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; rsaKeyAgreement.prototype.generateClientKeyExchange = function(config, clientHello, cert) { return this.$val.generateClientKeyExchange(config, clientHello, cert); }; sha1Hash = function(slices) { var $24r, _i, _r, _r$1, _ref, hsha1, slice, slices, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; hsha1 = $f.hsha1; slice = $f.slice; slices = $f.slices; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hsha1 = sha1.New(); _ref = slices; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } slice = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r = hsha1.Write(slice); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; _i++; $s = 1; continue; case 2: _r$1 = hsha1.Sum(sliceType$5.nil); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 5; case 5: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: sha1Hash }; } $f.$24r = $24r; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f.hsha1 = hsha1; $f.slice = slice; $f.slices = slices; $f.$s = $s; $f.$r = $r; return $f; }; md5SHA1Hash = function(slices) { var _i, _r, _r$1, _r$2, _ref, hmd5, md5sha1, slice, slices, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; hmd5 = $f.hmd5; md5sha1 = $f.md5sha1; slice = $f.slice; slices = $f.slices; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: md5sha1 = $makeSlice(sliceType$5, 36); hmd5 = md5.New(); _ref = slices; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } slice = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r = hmd5.Write(slice); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; _i++; $s = 1; continue; case 2: _r$1 = hmd5.Sum(sliceType$5.nil); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $copySlice(md5sha1, _r$1); _r$2 = sha1Hash(slices); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $copySlice($subslice(md5sha1, 16), _r$2); $s = -1; return md5sha1; /* */ } return; } if ($f === undefined) { $f = { $blk: md5SHA1Hash }; } $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f.hmd5 = hmd5; $f.md5sha1 = md5sha1; $f.slice = slice; $f.slices = slices; $f.$s = $s; $f.$r = $r; return $f; }; hashForServerKeyExchange = function(sigType, hashFunc, version, slices) { var $24r, $24r$1, _i, _i$1, _r, _r$1, _r$2, _r$3, _r$4, _ref, _ref$1, digest, h, hashFunc, sigType, signed, slice, slice$1, slices, version, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _i = $f._i; _i$1 = $f._i$1; _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; _ref$1 = $f._ref$1; digest = $f.digest; h = $f.h; hashFunc = $f.hashFunc; sigType = $f.sigType; signed = $f.signed; slice = $f.slice; slice$1 = $f.slice$1; slices = $f.slices; version = $f.version; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (sigType === 228) { signed = sliceType$5.nil; _ref = slices; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } slice = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); signed = $appendSlice(signed, slice); _i++; } $s = -1; return signed; } /* */ if (version >= 771) { $s = 1; continue; } /* */ $s = 2; continue; /* if (version >= 771) { */ case 1: _r = new crypto.Hash(hashFunc).New(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } h = _r; _ref$1 = slices; _i$1 = 0; /* while (true) { */ case 4: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 5; continue; } slice$1 = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); _r$1 = h.Write(slice$1); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _i$1++; $s = 4; continue; case 5: _r$2 = h.Sum(sliceType$5.nil); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } digest = _r$2; $s = -1; return digest; /* } */ case 2: /* */ if (sigType === 227) { $s = 8; continue; } /* */ $s = 9; continue; /* if (sigType === 227) { */ case 8: _r$3 = sha1Hash(slices); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = _r$3; $s = 11; case 11: return $24r; /* } */ case 9: _r$4 = md5SHA1Hash(slices); /* */ $s = 12; case 12: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r$1 = _r$4; $s = 13; case 13: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: hashForServerKeyExchange }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._i = _i; $f._i$1 = _i$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._ref = _ref; $f._ref$1 = _ref$1; $f.digest = digest; $f.h = h; $f.hashFunc = hashFunc; $f.sigType = sigType; $f.signed = signed; $f.slice = slice; $f.slice$1 = slice$1; $f.slices = slices; $f.version = version; $f.$s = $s; $f.$r = $r; return $f; }; ecdheKeyAgreement.ptr.prototype.generateServerKeyExchange = function(config, cert, clientHello, hello) { var $24r, $24r$1, _i, _r, _r$1, _r$10, _r$11, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, c, cert, clientHello, config, curveID, ecdhePublic, err, hello, k, ka, ok, ok$1, params, priv, serverECDHEParams, sig, sigAndHashLen, sigHash, sigType, signOpts, signatureAlgorithm, signed, skx, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _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; _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; c = $f.c; cert = $f.cert; clientHello = $f.clientHello; config = $f.config; curveID = $f.curveID; ecdhePublic = $f.ecdhePublic; err = $f.err; hello = $f.hello; k = $f.k; ka = $f.ka; ok = $f.ok; ok$1 = $f.ok$1; params = $f.params; priv = $f.priv; serverECDHEParams = $f.serverECDHEParams; sig = $f.sig; sigAndHashLen = $f.sigAndHashLen; sigHash = $f.sigHash; sigType = $f.sigType; signOpts = $f.signOpts; signatureAlgorithm = $f.signatureAlgorithm; signed = $f.signed; skx = $f.skx; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ka = this; curveID = 0; _ref = clientHello.supportedCurves; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } c = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (config.supportsCurve(c)) { curveID = c; break; } _i++; } if (curveID === 0) { $s = -1; return [ptrType$22.nil, errors.New("tls: no supported elliptic curves offered")]; } _r = curveForCurveID(curveID); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; ok = _tuple[1]; if (!((curveID === 29)) && !ok) { $s = -1; return [ptrType$22.nil, errors.New("tls: CurvePreferences includes unsupported curve")]; } _r$1 = generateECDHEParameters(config.rand(), curveID); /* */ $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; params = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$22.nil, err]; } ka.params = params; _r$2 = params.PublicKey(); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } ecdhePublic = _r$2; serverECDHEParams = $makeSlice(sliceType$5, (4 + ecdhePublic.$length >> 0)); (0 >= serverECDHEParams.$length ? ($throwRuntimeError("index out of range"), undefined) : serverECDHEParams.$array[serverECDHEParams.$offset + 0] = 3); (1 >= serverECDHEParams.$length ? ($throwRuntimeError("index out of range"), undefined) : serverECDHEParams.$array[serverECDHEParams.$offset + 1] = (((curveID >>> 8 << 16 >>> 16) << 24 >>> 24))); (2 >= serverECDHEParams.$length ? ($throwRuntimeError("index out of range"), undefined) : serverECDHEParams.$array[serverECDHEParams.$offset + 2] = ((curveID << 24 >>> 24))); (3 >= serverECDHEParams.$length ? ($throwRuntimeError("index out of range"), undefined) : serverECDHEParams.$array[serverECDHEParams.$offset + 3] = ((ecdhePublic.$length << 24 >>> 24))); $copySlice($subslice(serverECDHEParams, 4), ecdhePublic); _tuple$2 = $assertType(cert.PrivateKey, crypto.Signer, true); priv = _tuple$2[0]; ok$1 = _tuple$2[1]; /* */ if (!ok$1) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!ok$1) { */ case 4: _r$3 = fmt.Errorf("tls: certificate private key of type %T does not implement crypto.Signer", new sliceType$6([cert.PrivateKey])); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = [ptrType$22.nil, _r$3]; $s = 7; case 7: return $24r; /* } */ case 5: signatureAlgorithm = 0; sigType = 0; sigHash = 0; /* */ if (ka.version >= 771) { $s = 8; continue; } /* */ $s = 9; continue; /* if (ka.version >= 771) { */ case 8: _r$4 = selectSignatureScheme(ka.version, cert, clientHello.supportedSignatureAlgorithms); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$3 = _r$4; signatureAlgorithm = _tuple$3[0]; err = _tuple$3[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$22.nil, err]; } _r$5 = typeAndHashFromSignatureScheme(signatureAlgorithm); /* */ $s = 12; case 12: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$4 = _r$5; sigType = _tuple$4[0]; sigHash = _tuple$4[1]; err = _tuple$4[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$22.nil, err]; } $s = 10; continue; /* } else { */ case 9: _r$6 = priv.Public(); /* */ $s = 13; case 13: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$7 = legacyTypeAndHashFromPublicKey(_r$6); /* */ $s = 14; case 14: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _tuple$5 = _r$7; sigType = _tuple$5[0]; sigHash = _tuple$5[1]; err = _tuple$5[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$22.nil, err]; } /* } */ case 10: if (!(((sigType === 225) || (sigType === 226)) === ka.isRSA)) { $s = -1; return [ptrType$22.nil, errors.New("tls: certificate cannot be used with the selected cipher suite")]; } _r$8 = hashForServerKeyExchange(sigType, sigHash, ka.version, new sliceType$11([clientHello.random, hello.random, serverECDHEParams])); /* */ $s = 15; case 15: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } signed = _r$8; signOpts = (new crypto.Hash(sigHash)); if (sigType === 226) { signOpts = new rsa.PSSOptions.ptr(-1, sigHash); } _r$9 = priv.Sign(config.rand(), signed, signOpts); /* */ $s = 16; case 16: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple$6 = _r$9; sig = _tuple$6[0]; err = _tuple$6[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 17; continue; } /* */ $s = 18; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 17: _r$10 = err.Error(); /* */ $s = 19; case 19: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$11 = errors.New("tls: failed to sign ECDHE parameters: " + _r$10); /* */ $s = 20; case 20: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } $24r$1 = [ptrType$22.nil, _r$11]; $s = 21; case 21: return $24r$1; /* } */ case 18: skx = new serverKeyExchangeMsg.ptr(sliceType$5.nil, sliceType$5.nil); sigAndHashLen = 0; if (ka.version >= 771) { sigAndHashLen = 2; } skx.key = $makeSlice(sliceType$5, (((serverECDHEParams.$length + sigAndHashLen >> 0) + 2 >> 0) + sig.$length >> 0)); $copySlice(skx.key, serverECDHEParams); k = $subslice(skx.key, serverECDHEParams.$length); if (ka.version >= 771) { (0 >= k.$length ? ($throwRuntimeError("index out of range"), undefined) : k.$array[k.$offset + 0] = (((signatureAlgorithm >>> 8 << 16 >>> 16) << 24 >>> 24))); (1 >= k.$length ? ($throwRuntimeError("index out of range"), undefined) : k.$array[k.$offset + 1] = ((signatureAlgorithm << 24 >>> 24))); k = $subslice(k, 2); } (0 >= k.$length ? ($throwRuntimeError("index out of range"), undefined) : k.$array[k.$offset + 0] = (((sig.$length >> 8 >> 0) << 24 >>> 24))); (1 >= k.$length ? ($throwRuntimeError("index out of range"), undefined) : k.$array[k.$offset + 1] = ((sig.$length << 24 >>> 24))); $copySlice($subslice(k, 2), sig); $s = -1; return [skx, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: ecdheKeyAgreement.ptr.prototype.generateServerKeyExchange }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $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._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.c = c; $f.cert = cert; $f.clientHello = clientHello; $f.config = config; $f.curveID = curveID; $f.ecdhePublic = ecdhePublic; $f.err = err; $f.hello = hello; $f.k = k; $f.ka = ka; $f.ok = ok; $f.ok$1 = ok$1; $f.params = params; $f.priv = priv; $f.serverECDHEParams = serverECDHEParams; $f.sig = sig; $f.sigAndHashLen = sigAndHashLen; $f.sigHash = sigHash; $f.sigType = sigType; $f.signOpts = signOpts; $f.signatureAlgorithm = signatureAlgorithm; $f.signed = signed; $f.skx = skx; $f.$s = $s; $f.$r = $r; return $f; }; ecdheKeyAgreement.prototype.generateServerKeyExchange = function(config, cert, clientHello, hello) { return this.$val.generateServerKeyExchange(config, cert, clientHello, hello); }; ecdheKeyAgreement.ptr.prototype.processClientKeyExchange = function(config, cert, ckx, version) { var _r, cert, ckx, config, ka, preMasterSecret, version, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; cert = $f.cert; ckx = $f.ckx; config = $f.config; ka = $f.ka; preMasterSecret = $f.preMasterSecret; version = $f.version; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ka = this; if ((ckx.ciphertext.$length === 0) || !(((((x = ckx.ciphertext, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])) >> 0)) === (ckx.ciphertext.$length - 1 >> 0)))) { $s = -1; return [sliceType$5.nil, errClientKeyExchange]; } _r = ka.params.SharedKey($subslice(ckx.ciphertext, 1)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } preMasterSecret = _r; if (preMasterSecret === sliceType$5.nil) { $s = -1; return [sliceType$5.nil, errClientKeyExchange]; } $s = -1; return [preMasterSecret, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: ecdheKeyAgreement.ptr.prototype.processClientKeyExchange }; } $f._r = _r; $f.cert = cert; $f.ckx = ckx; $f.config = config; $f.ka = ka; $f.preMasterSecret = preMasterSecret; $f.version = version; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; ecdheKeyAgreement.prototype.processClientKeyExchange = function(config, cert, ckx, version) { return this.$val.processClientKeyExchange(config, cert, ckx, version); }; ecdheKeyAgreement.ptr.prototype.processServerKeyExchange = function(config, clientHello, serverHello, cert, skx) { var $24r, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, _tuple$2, _tuple$3, cert, clientHello, config, curveID, err, err$1, ka, ok, ourPublicKey, params, publicKey, publicLen, serverECDHEParams, serverHello, sig, sigHash, sigLen, sigType, signatureAlgorithm, signed, skx, 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; $24r = $f.$24r; _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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; cert = $f.cert; clientHello = $f.clientHello; config = $f.config; curveID = $f.curveID; err = $f.err; err$1 = $f.err$1; ka = $f.ka; ok = $f.ok; ourPublicKey = $f.ourPublicKey; params = $f.params; publicKey = $f.publicKey; publicLen = $f.publicLen; serverECDHEParams = $f.serverECDHEParams; serverHello = $f.serverHello; sig = $f.sig; sigHash = $f.sigHash; sigLen = $f.sigLen; sigType = $f.sigType; signatureAlgorithm = $f.signatureAlgorithm; signed = $f.signed; skx = $f.skx; 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: ka = this; if (skx.key.$length < 4) { $s = -1; return errServerKeyExchange; } if (!(((x = skx.key, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])) === 3))) { $s = -1; return errors.New("tls: server selected unsupported curve"); } curveID = (((((x$1 = skx.key, (1 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 1])) << 16 >>> 16)) << 8 << 16 >>> 16) | (((x$2 = skx.key, (2 >= x$2.$length ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + 2])) << 16 >>> 16))) >>> 0; publicLen = (((x$3 = skx.key, (3 >= x$3.$length ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + 3])) >> 0)); if ((publicLen + 4 >> 0) > skx.key.$length) { $s = -1; return errServerKeyExchange; } serverECDHEParams = $subslice(skx.key, 0, (4 + publicLen >> 0)); publicKey = $subslice(serverECDHEParams, 4); sig = $subslice(skx.key, (4 + publicLen >> 0)); if (sig.$length < 2) { $s = -1; return errServerKeyExchange; } _r = curveForCurveID(curveID); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; ok = _tuple[1]; if (!((curveID === 29)) && !ok) { $s = -1; return errors.New("tls: server selected unsupported curve"); } _r$1 = generateECDHEParameters(config.rand(), curveID); /* */ $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; params = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } ka.params = params; _r$2 = params.SharedKey(publicKey); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } ka.preMasterSecret = _r$2; if (ka.preMasterSecret === sliceType$5.nil) { $s = -1; return errServerKeyExchange; } _r$3 = params.PublicKey(); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } ourPublicKey = _r$3; ka.ckx = new clientKeyExchangeMsg.ptr(sliceType$5.nil, sliceType$5.nil); ka.ckx.ciphertext = $makeSlice(sliceType$5, (1 + ourPublicKey.$length >> 0)); (x$4 = ka.ckx.ciphertext, (0 >= x$4.$length ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + 0] = ((ourPublicKey.$length << 24 >>> 24)))); $copySlice($subslice(ka.ckx.ciphertext, 1), ourPublicKey); sigType = 0; sigHash = 0; /* */ if (ka.version >= 771) { $s = 5; continue; } /* */ $s = 6; continue; /* if (ka.version >= 771) { */ case 5: signatureAlgorithm = (((((0 >= sig.$length ? ($throwRuntimeError("index out of range"), undefined) : sig.$array[sig.$offset + 0]) << 16 >>> 16)) << 8 << 16 >>> 16) | (((1 >= sig.$length ? ($throwRuntimeError("index out of range"), undefined) : sig.$array[sig.$offset + 1]) << 16 >>> 16))) >>> 0; sig = $subslice(sig, 2); if (sig.$length < 2) { $s = -1; return errServerKeyExchange; } if (!isSupportedSignatureAlgorithm(signatureAlgorithm, clientHello.supportedSignatureAlgorithms)) { $s = -1; return errors.New("tls: certificate used with invalid signature algorithm"); } _r$4 = typeAndHashFromSignatureScheme(signatureAlgorithm); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$2 = _r$4; sigType = _tuple$2[0]; sigHash = _tuple$2[1]; err = _tuple$2[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $s = 7; continue; /* } else { */ case 6: _r$5 = legacyTypeAndHashFromPublicKey(cert.PublicKey); /* */ $s = 9; case 9: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$3 = _r$5; sigType = _tuple$3[0]; sigHash = _tuple$3[1]; err = _tuple$3[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } /* } */ case 7: if (!(((sigType === 225) || (sigType === 226)) === ka.isRSA)) { $s = -1; return errServerKeyExchange; } sigLen = ((((0 >= sig.$length ? ($throwRuntimeError("index out of range"), undefined) : sig.$array[sig.$offset + 0]) >> 0)) << 8 >> 0) | (((1 >= sig.$length ? ($throwRuntimeError("index out of range"), undefined) : sig.$array[sig.$offset + 1]) >> 0)); if (!(((sigLen + 2 >> 0) === sig.$length))) { $s = -1; return errServerKeyExchange; } sig = $subslice(sig, 2); _r$6 = hashForServerKeyExchange(sigType, sigHash, ka.version, new sliceType$11([clientHello.random, serverHello.random, serverECDHEParams])); /* */ $s = 10; case 10: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } signed = _r$6; _r$7 = verifyHandshakeSignature(sigType, cert.PublicKey, sigHash, signed, sig); /* */ $s = 11; case 11: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } err$1 = _r$7; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 12; continue; } /* */ $s = 13; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 12: _r$8 = err$1.Error(); /* */ $s = 14; case 14: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$9 = errors.New("tls: invalid signature by the server certificate: " + _r$8); /* */ $s = 15; case 15: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $24r = _r$9; $s = 16; case 16: return $24r; /* } */ case 13: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: ecdheKeyAgreement.ptr.prototype.processServerKeyExchange }; } $f.$24r = $24r; $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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.cert = cert; $f.clientHello = clientHello; $f.config = config; $f.curveID = curveID; $f.err = err; $f.err$1 = err$1; $f.ka = ka; $f.ok = ok; $f.ourPublicKey = ourPublicKey; $f.params = params; $f.publicKey = publicKey; $f.publicLen = publicLen; $f.serverECDHEParams = serverECDHEParams; $f.serverHello = serverHello; $f.sig = sig; $f.sigHash = sigHash; $f.sigLen = sigLen; $f.sigType = sigType; $f.signatureAlgorithm = signatureAlgorithm; $f.signed = signed; $f.skx = skx; $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; }; ecdheKeyAgreement.prototype.processServerKeyExchange = function(config, clientHello, serverHello, cert, skx) { return this.$val.processServerKeyExchange(config, clientHello, serverHello, cert, skx); }; ecdheKeyAgreement.ptr.prototype.generateClientKeyExchange = function(config, clientHello, cert) { var cert, clientHello, config, ka; ka = this; if (ka.ckx === ptrType$23.nil) { return [sliceType$5.nil, ptrType$23.nil, errors.New("tls: missing ServerKeyExchange message")]; } return [ka.preMasterSecret, ka.ckx, $ifaceNil]; }; ecdheKeyAgreement.prototype.generateClientKeyExchange = function(config, clientHello, cert) { return this.$val.generateClientKeyExchange(config, clientHello, cert); }; serverHandshakeStateTLS13.ptr.prototype.handshake = function() { var _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _tuple, c, err, err$1, err$2, err$3, err$4, err$5, err$6, err$7, err$8, hs, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; _tuple = $f._tuple; c = $f.c; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; err$4 = $f.err$4; err$5 = $f.err$5; err$6 = $f.err$6; err$7 = $f.err$7; err$8 = $f.err$8; hs = $f.hs; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; _r = hs.processClientHello(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _r$1 = hs.checkForResumption(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err$1 = _r$1; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } _r$2 = hs.pickCertificate(); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } err$2 = _r$2; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return err$2; } c.buffering = true; _r$3 = hs.sendServerParameters(); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } err$3 = _r$3; if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = -1; return err$3; } _r$4 = hs.sendServerCertificate(); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } err$4 = _r$4; if (!($interfaceIsEqual(err$4, $ifaceNil))) { $s = -1; return err$4; } _r$5 = hs.sendServerFinished(); /* */ $s = 6; case 6: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } err$5 = _r$5; if (!($interfaceIsEqual(err$5, $ifaceNil))) { $s = -1; return err$5; } _r$6 = c.flush(); /* */ $s = 7; case 7: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tuple = _r$6; err$6 = _tuple[1]; if (!($interfaceIsEqual(err$6, $ifaceNil))) { $s = -1; return err$6; } _r$7 = hs.readClientCertificate(); /* */ $s = 8; case 8: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } err$7 = _r$7; if (!($interfaceIsEqual(err$7, $ifaceNil))) { $s = -1; return err$7; } _r$8 = hs.readClientFinished(); /* */ $s = 9; case 9: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } err$8 = _r$8; if (!($interfaceIsEqual(err$8, $ifaceNil))) { $s = -1; return err$8; } atomic.StoreUint32((c.$ptr_handshakeStatus || (c.$ptr_handshakeStatus = new ptrType$24(function() { return this.$target.handshakeStatus; }, function($v) { this.$target.handshakeStatus = $v; }, c))), 1); $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: serverHandshakeStateTLS13.ptr.prototype.handshake }; } $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._tuple = _tuple; $f.c = c; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.err$4 = err$4; $f.err$5 = err$5; $f.err$6 = err$6; $f.err$7 = err$7; $f.err$8 = err$8; $f.hs = hs; $f.$s = $s; $f.$r = $r; return $f; }; serverHandshakeStateTLS13.prototype.handshake = function() { return this.$val.handshake(); }; serverHandshakeStateTLS13.ptr.prototype.processClientHello = function() { var _i, _i$1, _i$2, _i$3, _i$4, _r, _r$1, _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, _ref, _ref$1, _ref$2, _ref$3, _ref$4, _tuple, _tuple$1, _tuple$2, c, clientKeyShare, err, err$1, err$2, group, hs, id, ks, ok, params, preferenceList, preferredGroup, selectedGroup, suiteID, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _i$1 = $f._i$1; _i$2 = $f._i$2; _i$3 = $f._i$3; _i$4 = $f._i$4; _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$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; _ref = $f._ref; _ref$1 = $f._ref$1; _ref$2 = $f._ref$2; _ref$3 = $f._ref$3; _ref$4 = $f._ref$4; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; c = $f.c; clientKeyShare = $f.clientKeyShare; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; group = $f.group; hs = $f.hs; id = $f.id; ks = $f.ks; ok = $f.ok; params = $f.params; preferenceList = $f.preferenceList; preferredGroup = $f.preferredGroup; selectedGroup = $f.selectedGroup; suiteID = $f.suiteID; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; hs.hello = new serverHelloMsg.ptr(sliceType$5.nil, 0, sliceType$5.nil, sliceType$5.nil, 0, 0, false, false, false, sliceType$5.nil, "", sliceType$11.nil, 0, new keyShare.ptr(0, sliceType$5.nil), false, 0, sliceType$5.nil, sliceType$5.nil, 0); hs.hello.vers = 771; hs.hello.supportedVersion = c.vers; /* */ if (hs.clientHello.supportedVersions.$length === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (hs.clientHello.supportedVersions.$length === 0) { */ case 1: _r = c.sendAlert(47); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; $s = -1; return errors.New("tls: client used the legacy version field to negotiate TLS 1.3"); /* } */ case 2: _ref = hs.clientHello.cipherSuites; _i = 0; /* while (true) { */ case 4: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 5; continue; } id = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); /* */ if (id === 22016) { $s = 6; continue; } /* */ $s = 7; continue; /* if (id === 22016) { */ case 6: /* */ if (c.vers < c.config.maxSupportedVersion()) { $s = 8; continue; } /* */ $s = 9; continue; /* if (c.vers < c.config.maxSupportedVersion()) { */ case 8: _r$1 = c.sendAlert(86); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = -1; return errors.New("tls: client using inappropriate protocol fallback"); /* } */ case 9: /* break; */ $s = 5; continue; /* } */ case 7: _i++; $s = 4; continue; case 5: /* */ if (!((hs.clientHello.compressionMethods.$length === 1)) || !(((x = hs.clientHello.compressionMethods, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])) === 0))) { $s = 11; continue; } /* */ $s = 12; continue; /* if (!((hs.clientHello.compressionMethods.$length === 1)) || !(((x = hs.clientHello.compressionMethods, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])) === 0))) { */ case 11: _r$2 = c.sendAlert(47); /* */ $s = 13; case 13: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; $s = -1; return errors.New("tls: TLS 1.3 client supports illegal compression methods"); /* } */ case 12: hs.hello.random = $makeSlice(sliceType$5, 32); _r$3 = io.ReadFull(c.config.rand(), hs.hello.random); /* */ $s = 14; case 14: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 15; continue; } /* */ $s = 16; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 15: _r$4 = c.sendAlert(80); /* */ $s = 17; case 17: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; $s = -1; return err; /* } */ case 16: /* */ if (!((hs.clientHello.secureRenegotiation.$length === 0))) { $s = 18; continue; } /* */ $s = 19; continue; /* if (!((hs.clientHello.secureRenegotiation.$length === 0))) { */ case 18: _r$5 = c.sendAlert(40); /* */ $s = 20; case 20: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; $s = -1; return errors.New("tls: initial handshake had non-empty renegotiation extension"); /* } */ case 19: /* */ if (hs.clientHello.earlyData) { $s = 21; continue; } /* */ $s = 22; continue; /* if (hs.clientHello.earlyData) { */ case 21: _r$6 = c.sendAlert(110); /* */ $s = 23; case 23: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; $s = -1; return errors.New("tls: client sent unexpected early data"); /* } */ case 22: hs.hello.sessionId = hs.clientHello.sessionId; hs.hello.compressionMethod = 0; preferenceList = defaultCipherSuitesTLS13; if (!hasAESGCMHardwareSupport || !aesgcmPreferred(hs.clientHello.cipherSuites)) { preferenceList = defaultCipherSuitesTLS13NoAES; } _ref$1 = preferenceList; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } suiteID = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); hs.suite = mutualCipherSuiteTLS13(hs.clientHello.cipherSuites, suiteID); if (!(hs.suite === ptrType$2.nil)) { break; } _i$1++; } /* */ if (hs.suite === ptrType$2.nil) { $s = 24; continue; } /* */ $s = 25; continue; /* if (hs.suite === ptrType$2.nil) { */ case 24: _r$7 = c.sendAlert(40); /* */ $s = 26; case 26: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$7; $s = -1; return errors.New("tls: no cipher suite supported by both client and server"); /* } */ case 25: c.cipherSuite = hs.suite.id; hs.hello.cipherSuite = hs.suite.id; _r$8 = new crypto.Hash(hs.suite.hash).New(); /* */ $s = 27; case 27: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } hs.transcript = _r$8; selectedGroup = 0; clientKeyShare = ptrType$25.nil; _ref$2 = c.config.curvePreferences(); _i$2 = 0; GroupSelection: while (true) { if (!(_i$2 < _ref$2.$length)) { break; } ks = [ks]; preferredGroup = ((_i$2 < 0 || _i$2 >= _ref$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$2.$array[_ref$2.$offset + _i$2]); _ref$3 = hs.clientHello.keyShares; _i$3 = 0; while (true) { if (!(_i$3 < _ref$3.$length)) { break; } ks[0] = $clone(((_i$3 < 0 || _i$3 >= _ref$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$3.$array[_ref$3.$offset + _i$3]), keyShare); if (ks[0].group === preferredGroup) { selectedGroup = ks[0].group; clientKeyShare = ks[0]; break GroupSelection; } _i$3++; } if (!((selectedGroup === 0))) { _i$2++; continue; } _ref$4 = hs.clientHello.supportedCurves; _i$4 = 0; while (true) { if (!(_i$4 < _ref$4.$length)) { break; } group = ((_i$4 < 0 || _i$4 >= _ref$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$4.$array[_ref$4.$offset + _i$4]); if (group === preferredGroup) { selectedGroup = group; break; } _i$4++; } _i$2++; } /* */ if (selectedGroup === 0) { $s = 28; continue; } /* */ $s = 29; continue; /* if (selectedGroup === 0) { */ case 28: _r$9 = c.sendAlert(40); /* */ $s = 30; case 30: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$9; $s = -1; return errors.New("tls: no ECDHE curve supported by both client and server"); /* } */ case 29: /* */ if (clientKeyShare === ptrType$25.nil) { $s = 31; continue; } /* */ $s = 32; continue; /* if (clientKeyShare === ptrType$25.nil) { */ case 31: _r$10 = hs.doHelloRetryRequest(selectedGroup); /* */ $s = 33; case 33: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } err$1 = _r$10; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } clientKeyShare = (x$1 = hs.clientHello.keyShares, (0 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 0])); /* } */ case 32: _r$11 = curveForCurveID(selectedGroup); /* */ $s = 34; case 34: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tuple$1 = _r$11; ok = _tuple$1[1]; /* */ if (!((selectedGroup === 29)) && !ok) { $s = 35; continue; } /* */ $s = 36; continue; /* if (!((selectedGroup === 29)) && !ok) { */ case 35: _r$12 = c.sendAlert(80); /* */ $s = 37; case 37: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _r$12; $s = -1; return errors.New("tls: CurvePreferences includes unsupported curve"); /* } */ case 36: _r$13 = generateECDHEParameters(c.config.rand(), selectedGroup); /* */ $s = 38; case 38: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _tuple$2 = _r$13; params = _tuple$2[0]; err$2 = _tuple$2[1]; /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 39; continue; } /* */ $s = 40; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 39: _r$14 = c.sendAlert(80); /* */ $s = 41; case 41: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _r$14; $s = -1; return err$2; /* } */ case 40: _r$15 = params.PublicKey(); /* */ $s = 42; case 42: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } keyShare.copy(hs.hello.serverShare, new keyShare.ptr(selectedGroup, _r$15)); _r$16 = params.SharedKey(clientKeyShare.data); /* */ $s = 43; case 43: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } hs.sharedKey = _r$16; /* */ if (hs.sharedKey === sliceType$5.nil) { $s = 44; continue; } /* */ $s = 45; continue; /* if (hs.sharedKey === sliceType$5.nil) { */ case 44: _r$17 = c.sendAlert(47); /* */ $s = 46; case 46: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } _r$17; $s = -1; return errors.New("tls: invalid client key share"); /* } */ case 45: c.serverName = hs.clientHello.serverName; $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: serverHandshakeStateTLS13.ptr.prototype.processClientHello }; } $f._i = _i; $f._i$1 = _i$1; $f._i$2 = _i$2; $f._i$3 = _i$3; $f._i$4 = _i$4; $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$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._ref = _ref; $f._ref$1 = _ref$1; $f._ref$2 = _ref$2; $f._ref$3 = _ref$3; $f._ref$4 = _ref$4; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.c = c; $f.clientKeyShare = clientKeyShare; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.group = group; $f.hs = hs; $f.id = id; $f.ks = ks; $f.ok = ok; $f.params = params; $f.preferenceList = preferenceList; $f.preferredGroup = preferredGroup; $f.selectedGroup = selectedGroup; $f.suiteID = suiteID; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; serverHandshakeStateTLS13.prototype.processClientHello = function() { return this.$val.processClientHello(); }; serverHandshakeStateTLS13.ptr.prototype.checkForResumption = function() { var _i, _i$1, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _ref$1, _tuple, binderKey, c, createdAt, err, hs, i, identity, mode, modeOK, needClientCerts, ok, plaintext, psk, pskBinder, pskSuite, sessionHasClientCerts, sessionState$1, transcript, x, x$1, x$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _i$1 = $f._i$1; _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$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; _tuple = $f._tuple; binderKey = $f.binderKey; c = $f.c; createdAt = $f.createdAt; err = $f.err; hs = $f.hs; i = $f.i; identity = $f.identity; mode = $f.mode; modeOK = $f.modeOK; needClientCerts = $f.needClientCerts; ok = $f.ok; plaintext = $f.plaintext; psk = $f.psk; pskBinder = $f.pskBinder; pskSuite = $f.pskSuite; sessionHasClientCerts = $f.sessionHasClientCerts; sessionState$1 = $f.sessionState$1; transcript = $f.transcript; 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: hs = this; c = hs.c; if (c.config.SessionTicketsDisabled) { $s = -1; return $ifaceNil; } modeOK = false; _ref = hs.clientHello.pskModes; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } mode = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (mode === 1) { modeOK = true; break; } _i++; } if (!modeOK) { $s = -1; return $ifaceNil; } /* */ if (!((hs.clientHello.pskIdentities.$length === hs.clientHello.pskBinders.$length))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((hs.clientHello.pskIdentities.$length === hs.clientHello.pskBinders.$length))) { */ case 1: _r = c.sendAlert(47); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; $s = -1; return errors.New("tls: invalid or missing PSK binders"); /* } */ case 2: if (hs.clientHello.pskIdentities.$length === 0) { $s = -1; return $ifaceNil; } _ref$1 = hs.clientHello.pskIdentities; _i$1 = 0; /* while (true) { */ case 4: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 5; continue; } i = _i$1; identity = $clone(((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]), pskIdentity); if (i >= 5) { /* break; */ $s = 5; continue; } _r$1 = c.decryptTicket(identity.label); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; plaintext = _tuple[0]; if (plaintext === sliceType$5.nil) { _i$1++; /* continue; */ $s = 4; continue; } sessionState$1 = new sessionStateTLS13.ptr(0, new $Uint64(0, 0), sliceType$5.nil, new Certificate.ptr(sliceType$11.nil, $ifaceNil, sliceType$7.nil, sliceType$5.nil, sliceType$11.nil, ptrType$5.nil)); ok = sessionState$1.unmarshal(plaintext); if (!ok) { _i$1++; /* continue; */ $s = 4; continue; } createdAt = $clone(time.Unix(((x = sessionState$1.createdAt, new $Int64(x.$high, x.$low))), new $Int64(0, 0)), time.Time); _r$2 = c.config.time(); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = $clone(_r$2, time.Time).Sub($clone(createdAt, time.Time)); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } /* */ if ((x$1 = _r$3, (x$1.$high > 140815 || (x$1.$high === 140815 && x$1.$low > 4180213760)))) { $s = 7; continue; } /* */ $s = 8; continue; /* if ((x$1 = _r$3, (x$1.$high > 140815 || (x$1.$high === 140815 && x$1.$low > 4180213760)))) { */ case 7: _i$1++; /* continue; */ $s = 4; continue; /* } */ case 8: pskSuite = cipherSuiteTLS13ByID(sessionState$1.cipherSuite); if (pskSuite === ptrType$2.nil || !((pskSuite.hash === hs.suite.hash))) { _i$1++; /* continue; */ $s = 4; continue; } sessionHasClientCerts = !((sessionState$1.certificate.Certificate.$length === 0)); needClientCerts = requiresClientCert(c.config.ClientAuth); if (needClientCerts && !sessionHasClientCerts) { _i$1++; /* continue; */ $s = 4; continue; } if (sessionHasClientCerts && (c.config.ClientAuth === 0)) { _i$1++; /* continue; */ $s = 4; continue; } _r$4 = hs.suite.expandLabel(sessionState$1.resumptionSecret, "resumption", sliceType$5.nil, new crypto.Hash(hs.suite.hash).Size()); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } psk = _r$4; _r$5 = hs.suite.extract(psk, sliceType$5.nil); /* */ $s = 12; case 12: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } hs.earlySecret = _r$5; _r$6 = hs.suite.deriveSecret(hs.earlySecret, "res binder", $ifaceNil); /* */ $s = 13; case 13: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } binderKey = _r$6; _r$7 = cloneHash(hs.transcript, hs.suite.hash); /* */ $s = 14; case 14: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } transcript = _r$7; /* */ if ($interfaceIsEqual(transcript, $ifaceNil)) { $s = 15; continue; } /* */ $s = 16; continue; /* if ($interfaceIsEqual(transcript, $ifaceNil)) { */ case 15: _r$8 = c.sendAlert(80); /* */ $s = 17; case 17: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$8; $s = -1; return errors.New("tls: internal error: failed to clone hash"); /* } */ case 16: _r$9 = hs.clientHello.marshalWithoutBinders(); /* */ $s = 18; case 18: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$10 = transcript.Write(_r$9); /* */ $s = 19; case 19: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; _r$11 = hs.suite.finishedHash(binderKey, transcript); /* */ $s = 20; case 20: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } pskBinder = _r$11; /* */ if (!hmac.Equal((x$2 = hs.clientHello.pskBinders, ((i < 0 || i >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + i])), pskBinder)) { $s = 21; continue; } /* */ $s = 22; continue; /* if (!hmac.Equal((x$2 = hs.clientHello.pskBinders, ((i < 0 || i >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + i])), pskBinder)) { */ case 21: _r$12 = c.sendAlert(51); /* */ $s = 23; case 23: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _r$12; $s = -1; return errors.New("tls: invalid PSK binder"); /* } */ case 22: c.didResume = true; _r$13 = c.processCertsFromClient($clone(sessionState$1.certificate, Certificate)); /* */ $s = 24; case 24: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } err = _r$13; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } hs.hello.selectedIdentityPresent = true; hs.hello.selectedIdentity = ((i << 16 >>> 16)); hs.usingPSK = true; $s = -1; return $ifaceNil; case 5: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: serverHandshakeStateTLS13.ptr.prototype.checkForResumption }; } $f._i = _i; $f._i$1 = _i$1; $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$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._tuple = _tuple; $f.binderKey = binderKey; $f.c = c; $f.createdAt = createdAt; $f.err = err; $f.hs = hs; $f.i = i; $f.identity = identity; $f.mode = mode; $f.modeOK = modeOK; $f.needClientCerts = needClientCerts; $f.ok = ok; $f.plaintext = plaintext; $f.psk = psk; $f.pskBinder = pskBinder; $f.pskSuite = pskSuite; $f.sessionHasClientCerts = sessionHasClientCerts; $f.sessionState$1 = sessionState$1; $f.transcript = transcript; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; }; serverHandshakeStateTLS13.prototype.checkForResumption = function() { return this.$val.checkForResumption(); }; cloneHash = function(in$1, h) { var _r, _r$1, _r$2, _tuple, _tuple$1, _tuple$2, err, err$1, h, in$1, marshaler, ok, out, state, unmarshaler, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; err = $f.err; err$1 = $f.err$1; h = $f.h; in$1 = $f.in$1; marshaler = $f.marshaler; ok = $f.ok; out = $f.out; state = $f.state; unmarshaler = $f.unmarshaler; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _tuple = $assertType(in$1, binaryMarshaler, true); marshaler = _tuple[0]; ok = _tuple[1]; if (!ok) { $s = -1; return $ifaceNil; } _r = marshaler.MarshalBinary(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple$1 = _r; state = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return $ifaceNil; } _r$1 = new crypto.Hash(h).New(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } out = _r$1; _tuple$2 = $assertType(out, binaryMarshaler, true); unmarshaler = _tuple$2[0]; ok = _tuple$2[1]; if (!ok) { $s = -1; return $ifaceNil; } _r$2 = unmarshaler.UnmarshalBinary(state); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } err$1 = _r$2; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return $ifaceNil; } $s = -1; return out; /* */ } return; } if ($f === undefined) { $f = { $blk: cloneHash }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.err = err; $f.err$1 = err$1; $f.h = h; $f.in$1 = in$1; $f.marshaler = marshaler; $f.ok = ok; $f.out = out; $f.state = state; $f.unmarshaler = unmarshaler; $f.$s = $s; $f.$r = $r; return $f; }; serverHandshakeStateTLS13.ptr.prototype.pickCertificate = function() { var $24r, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, _tuple$1, c, certificate, err, hs, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; c = $f.c; certificate = $f.certificate; err = $f.err; hs = $f.hs; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; if (hs.usingPSK) { $s = -1; return $ifaceNil; } /* */ if (hs.clientHello.supportedSignatureAlgorithms.$length === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (hs.clientHello.supportedSignatureAlgorithms.$length === 0) { */ case 1: _r = c.sendAlert(109); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 4; case 4: return $24r; /* } */ case 2: _r$1 = c.config.getCertificate(clientHelloInfo(hs.ctx, c, hs.clientHello)); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; certificate = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 6: /* */ if ($interfaceIsEqual(err, errNoCertificates)) { $s = 8; continue; } /* */ $s = 9; continue; /* if ($interfaceIsEqual(err, errNoCertificates)) { */ case 8: _r$2 = c.sendAlert(112); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; $s = 10; continue; /* } else { */ case 9: _r$3 = c.sendAlert(80); /* */ $s = 12; case 12: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; /* } */ case 10: $s = -1; return err; /* } */ case 7: _r$4 = selectSignatureScheme(c.vers, certificate, hs.clientHello.supportedSignatureAlgorithms); /* */ $s = 13; case 13: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$1 = _r$4; hs.sigAlg = _tuple$1[0]; err = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 14; continue; } /* */ $s = 15; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 14: _r$5 = c.sendAlert(40); /* */ $s = 16; case 16: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; $s = -1; return err; /* } */ case 15: hs.cert = certificate; $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: serverHandshakeStateTLS13.ptr.prototype.pickCertificate }; } $f.$24r = $24r; $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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.c = c; $f.certificate = certificate; $f.err = err; $f.hs = hs; $f.$s = $s; $f.$r = $r; return $f; }; serverHandshakeStateTLS13.prototype.pickCertificate = function() { return this.$val.pickCertificate(); }; serverHandshakeStateTLS13.ptr.prototype.sendDummyChangeCipherSpec = function() { var _r, _tuple, err, hs, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; hs = $f.hs; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; if (hs.sentDummyCCS) { $s = -1; return $ifaceNil; } hs.sentDummyCCS = true; _r = hs.c.writeRecord(20, new sliceType$5([1])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; err = _tuple[1]; $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: serverHandshakeStateTLS13.ptr.prototype.sendDummyChangeCipherSpec }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.hs = hs; $f.$s = $s; $f.$r = $r; return $f; }; serverHandshakeStateTLS13.prototype.sendDummyChangeCipherSpec = function() { return this.$val.sendDummyChangeCipherSpec(); }; serverHandshakeStateTLS13.ptr.prototype.doHelloRetryRequest = function(selectedGroup) { var $24r, _arg, _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, _tuple, _tuple$1, _tuple$2, c, chHash, clientHello, err, err$1, err$2, helloRetryRequest, hs, msg, ok, selectedGroup, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _arg = $f._arg; _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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; c = $f.c; chHash = $f.chHash; clientHello = $f.clientHello; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; helloRetryRequest = $f.helloRetryRequest; hs = $f.hs; msg = $f.msg; ok = $f.ok; selectedGroup = $f.selectedGroup; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; _r = hs.clientHello.marshal(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = hs.transcript.Write(_r); /* */ $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$2 = hs.transcript.Sum(sliceType$5.nil); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } chHash = _r$2; $r = hs.transcript.Reset(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$3 = hs.transcript.Write(new sliceType$5([254, 0, 0, ((chHash.$length << 24 >>> 24))])); /* */ $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 = hs.transcript.Write(chHash); /* */ $s = 6; case 6: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; helloRetryRequest = new serverHelloMsg.ptr(sliceType$5.nil, hs.hello.vers, helloRetryRequestRandom, hs.hello.sessionId, hs.hello.cipherSuite, hs.hello.compressionMethod, false, false, false, sliceType$5.nil, "", sliceType$11.nil, hs.hello.supportedVersion, new keyShare.ptr(0, sliceType$5.nil), false, 0, sliceType$5.nil, sliceType$5.nil, selectedGroup); _r$5 = helloRetryRequest.marshal(); /* */ $s = 7; case 7: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$6 = hs.transcript.Write(_r$5); /* */ $s = 8; case 8: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; _r$7 = helloRetryRequest.marshal(); /* */ $s = 9; case 9: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _arg = _r$7; _r$8 = c.writeRecord(22, _arg); /* */ $s = 10; case 10: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _tuple = _r$8; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _r$9 = hs.sendDummyChangeCipherSpec(); /* */ $s = 11; case 11: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err$1 = _r$9; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } _r$10 = c.readHandshake(); /* */ $s = 12; case 12: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$1 = _r$10; msg = _tuple$1[0]; err$2 = _tuple$1[1]; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return err$2; } _tuple$2 = $assertType(msg, ptrType$26, true); clientHello = _tuple$2[0]; ok = _tuple$2[1]; /* */ if (!ok) { $s = 13; continue; } /* */ $s = 14; continue; /* if (!ok) { */ case 13: _r$11 = c.sendAlert(10); /* */ $s = 15; case 15: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _r$11; _r$12 = unexpectedMessageError(clientHello, msg); /* */ $s = 16; case 16: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } $24r = _r$12; $s = 17; case 17: return $24r; /* } */ case 14: /* */ if (!((clientHello.keyShares.$length === 1)) || !(((x = clientHello.keyShares, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])).group === selectedGroup))) { $s = 18; continue; } /* */ $s = 19; continue; /* if (!((clientHello.keyShares.$length === 1)) || !(((x = clientHello.keyShares, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])).group === selectedGroup))) { */ case 18: _r$13 = c.sendAlert(47); /* */ $s = 20; case 20: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _r$13; $s = -1; return errors.New("tls: client sent invalid key share in second ClientHello"); /* } */ case 19: /* */ if (clientHello.earlyData) { $s = 21; continue; } /* */ $s = 22; continue; /* if (clientHello.earlyData) { */ case 21: _r$14 = c.sendAlert(47); /* */ $s = 23; case 23: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _r$14; $s = -1; return errors.New("tls: client indicated early data in second ClientHello"); /* } */ case 22: /* */ if (illegalClientHelloChange(clientHello, hs.clientHello)) { $s = 24; continue; } /* */ $s = 25; continue; /* if (illegalClientHelloChange(clientHello, hs.clientHello)) { */ case 24: _r$15 = c.sendAlert(47); /* */ $s = 26; case 26: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _r$15; $s = -1; return errors.New("tls: client illegally modified second ClientHello"); /* } */ case 25: hs.clientHello = clientHello; $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: serverHandshakeStateTLS13.ptr.prototype.doHelloRetryRequest }; } $f.$24r = $24r; $f._arg = _arg; $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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.c = c; $f.chHash = chHash; $f.clientHello = clientHello; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.helloRetryRequest = helloRetryRequest; $f.hs = hs; $f.msg = msg; $f.ok = ok; $f.selectedGroup = selectedGroup; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; serverHandshakeStateTLS13.prototype.doHelloRetryRequest = function(selectedGroup) { return this.$val.doHelloRetryRequest(selectedGroup); }; illegalClientHelloChange = function(ch, ch1) { var _i, _i$1, _i$2, _i$3, _i$4, _i$5, _ref, _ref$1, _ref$2, _ref$3, _ref$4, _ref$5, ch, ch1, i, i$1, i$2, i$3, i$4, i$5, x, x$1, x$10, x$11, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; if (!((ch.supportedVersions.$length === ch1.supportedVersions.$length)) || !((ch.cipherSuites.$length === ch1.cipherSuites.$length)) || !((ch.supportedCurves.$length === ch1.supportedCurves.$length)) || !((ch.supportedSignatureAlgorithms.$length === ch1.supportedSignatureAlgorithms.$length)) || !((ch.supportedSignatureAlgorithmsCert.$length === ch1.supportedSignatureAlgorithmsCert.$length)) || !((ch.alpnProtocols.$length === ch1.alpnProtocols.$length))) { return true; } _ref = ch.supportedVersions; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; if (!(((x = ch.supportedVersions, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])) === (x$1 = ch1.supportedVersions, ((i < 0 || i >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + i]))))) { return true; } _i++; } _ref$1 = ch.cipherSuites; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } i$1 = _i$1; if (!(((x$2 = ch.cipherSuites, ((i$1 < 0 || i$1 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + i$1])) === (x$3 = ch1.cipherSuites, ((i$1 < 0 || i$1 >= x$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + i$1]))))) { return true; } _i$1++; } _ref$2 = ch.supportedCurves; _i$2 = 0; while (true) { if (!(_i$2 < _ref$2.$length)) { break; } i$2 = _i$2; if (!(((x$4 = ch.supportedCurves, ((i$2 < 0 || i$2 >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + i$2])) === (x$5 = ch1.supportedCurves, ((i$2 < 0 || i$2 >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + i$2]))))) { return true; } _i$2++; } _ref$3 = ch.supportedSignatureAlgorithms; _i$3 = 0; while (true) { if (!(_i$3 < _ref$3.$length)) { break; } i$3 = _i$3; if (!(((x$6 = ch.supportedSignatureAlgorithms, ((i$3 < 0 || i$3 >= x$6.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$6.$array[x$6.$offset + i$3])) === (x$7 = ch1.supportedSignatureAlgorithms, ((i$3 < 0 || i$3 >= x$7.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$7.$array[x$7.$offset + i$3]))))) { return true; } _i$3++; } _ref$4 = ch.supportedSignatureAlgorithmsCert; _i$4 = 0; while (true) { if (!(_i$4 < _ref$4.$length)) { break; } i$4 = _i$4; if (!(((x$8 = ch.supportedSignatureAlgorithmsCert, ((i$4 < 0 || i$4 >= x$8.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$8.$array[x$8.$offset + i$4])) === (x$9 = ch1.supportedSignatureAlgorithmsCert, ((i$4 < 0 || i$4 >= x$9.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$9.$array[x$9.$offset + i$4]))))) { return true; } _i$4++; } _ref$5 = ch.alpnProtocols; _i$5 = 0; while (true) { if (!(_i$5 < _ref$5.$length)) { break; } i$5 = _i$5; if (!((x$10 = ch.alpnProtocols, ((i$5 < 0 || i$5 >= x$10.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$10.$array[x$10.$offset + i$5])) === (x$11 = ch1.alpnProtocols, ((i$5 < 0 || i$5 >= x$11.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$11.$array[x$11.$offset + i$5])))) { return true; } _i$5++; } return !((ch.vers === ch1.vers)) || !bytes.Equal(ch.random, ch1.random) || !bytes.Equal(ch.sessionId, ch1.sessionId) || !bytes.Equal(ch.compressionMethods, ch1.compressionMethods) || !(ch.serverName === ch1.serverName) || !(ch.ocspStapling === ch1.ocspStapling) || !bytes.Equal(ch.supportedPoints, ch1.supportedPoints) || !(ch.ticketSupported === ch1.ticketSupported) || !bytes.Equal(ch.sessionTicket, ch1.sessionTicket) || !(ch.secureRenegotiationSupported === ch1.secureRenegotiationSupported) || !bytes.Equal(ch.secureRenegotiation, ch1.secureRenegotiation) || !(ch.scts === ch1.scts) || !bytes.Equal(ch.cookie, ch1.cookie) || !bytes.Equal(ch.pskModes, ch1.pskModes); }; serverHandshakeStateTLS13.ptr.prototype.sendServerParameters = function() { var _arg, _arg$1, _arg$2, _arg$3, _r, _r$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$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, _tuple$2, c, clientSecret, earlySecret, encryptedExtensions, err, err$1, err$2, err$3, hs, selectedProto, serverSecret, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _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$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$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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; c = $f.c; clientSecret = $f.clientSecret; earlySecret = $f.earlySecret; encryptedExtensions = $f.encryptedExtensions; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; hs = $f.hs; selectedProto = $f.selectedProto; serverSecret = $f.serverSecret; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; _r = hs.clientHello.marshal(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = hs.transcript.Write(_r); /* */ $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$2 = hs.hello.marshal(); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = hs.transcript.Write(_r$2); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _r$4 = hs.hello.marshal(); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _arg = _r$4; _r$5 = c.writeRecord(22, _arg); /* */ $s = 6; case 6: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple = _r$5; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _r$6 = hs.sendDummyChangeCipherSpec(); /* */ $s = 7; case 7: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } err$1 = _r$6; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } earlySecret = hs.earlySecret; /* */ if (earlySecret === sliceType$5.nil) { $s = 8; continue; } /* */ $s = 9; continue; /* if (earlySecret === sliceType$5.nil) { */ case 8: _r$7 = hs.suite.extract(sliceType$5.nil, sliceType$5.nil); /* */ $s = 10; case 10: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } earlySecret = _r$7; /* } */ case 9: _arg$1 = hs.sharedKey; _r$8 = hs.suite.deriveSecret(earlySecret, "derived", $ifaceNil); /* */ $s = 11; case 11: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _arg$2 = _r$8; _r$9 = hs.suite.extract(_arg$1, _arg$2); /* */ $s = 12; case 12: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } hs.handshakeSecret = _r$9; _r$10 = hs.suite.deriveSecret(hs.handshakeSecret, "c hs traffic", hs.transcript); /* */ $s = 13; case 13: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } clientSecret = _r$10; $r = c.in$27.setTrafficSecret(hs.suite, clientSecret); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$11 = hs.suite.deriveSecret(hs.handshakeSecret, "s hs traffic", hs.transcript); /* */ $s = 15; case 15: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } serverSecret = _r$11; $r = c.out.setTrafficSecret(hs.suite, serverSecret); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$12 = c.config.writeKeyLog("CLIENT_HANDSHAKE_TRAFFIC_SECRET", hs.clientHello.random, clientSecret); /* */ $s = 17; case 17: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } err$2 = _r$12; /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 18; continue; } /* */ $s = 19; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 18: _r$13 = c.sendAlert(80); /* */ $s = 20; case 20: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _r$13; $s = -1; return err$2; /* } */ case 19: _r$14 = c.config.writeKeyLog("SERVER_HANDSHAKE_TRAFFIC_SECRET", hs.clientHello.random, serverSecret); /* */ $s = 21; case 21: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } err$2 = _r$14; /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 22; continue; } /* */ $s = 23; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 22: _r$15 = c.sendAlert(80); /* */ $s = 24; case 24: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _r$15; $s = -1; return err$2; /* } */ case 23: encryptedExtensions = new encryptedExtensionsMsg.ptr(sliceType$5.nil, ""); _r$16 = negotiateALPN(c.config.NextProtos, hs.clientHello.alpnProtocols); /* */ $s = 25; case 25: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _tuple$1 = _r$16; selectedProto = _tuple$1[0]; err$2 = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 26; continue; } /* */ $s = 27; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 26: _r$17 = c.sendAlert(120); /* */ $s = 28; case 28: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } _r$17; $s = -1; return err$2; /* } */ case 27: encryptedExtensions.alpnProtocol = selectedProto; c.clientProtocol = selectedProto; _r$18 = encryptedExtensions.marshal(); /* */ $s = 29; case 29: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } _r$19 = hs.transcript.Write(_r$18); /* */ $s = 30; case 30: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } _r$19; _r$20 = encryptedExtensions.marshal(); /* */ $s = 31; case 31: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } _arg$3 = _r$20; _r$21 = c.writeRecord(22, _arg$3); /* */ $s = 32; case 32: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } _tuple$2 = _r$21; err$3 = _tuple$2[1]; if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = -1; return err$3; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: serverHandshakeStateTLS13.ptr.prototype.sendServerParameters }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $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$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$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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.c = c; $f.clientSecret = clientSecret; $f.earlySecret = earlySecret; $f.encryptedExtensions = encryptedExtensions; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.hs = hs; $f.selectedProto = selectedProto; $f.serverSecret = serverSecret; $f.$s = $s; $f.$r = $r; return $f; }; serverHandshakeStateTLS13.prototype.sendServerParameters = function() { return this.$val.sendServerParameters(); }; serverHandshakeStateTLS13.ptr.prototype.requestClientCert = function() { var hs; hs = this; return hs.c.config.ClientAuth >= 1 && !hs.usingPSK; }; serverHandshakeStateTLS13.prototype.requestClientCert = function() { return this.$val.requestClientCert(); }; serverHandshakeStateTLS13.ptr.prototype.sendServerCertificate = function() { var $24r, $24r$1, _arg, _arg$1, _arg$2, _q, _r, _r$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$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, c, certMsg, certReq, certVerifyMsg, err, err$1, err$2, err$3, hs, ok, public$1, rsaKey, sig, sigHash, sigType, signOpts, signed, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _q = $f._q; _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$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$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; _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; c = $f.c; certMsg = $f.certMsg; certReq = $f.certReq; certVerifyMsg = $f.certVerifyMsg; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; hs = $f.hs; ok = $f.ok; public$1 = $f.public$1; rsaKey = $f.rsaKey; sig = $f.sig; sigHash = $f.sigHash; sigType = $f.sigType; signOpts = $f.signOpts; signed = $f.signed; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; if (hs.usingPSK) { $s = -1; return $ifaceNil; } /* */ if (hs.requestClientCert()) { $s = 1; continue; } /* */ $s = 2; continue; /* if (hs.requestClientCert()) { */ case 1: certReq = new certificateRequestMsgTLS13.ptr(sliceType$5.nil, false, false, sliceType$7.nil, sliceType$7.nil, sliceType$11.nil); certReq.ocspStapling = true; certReq.scts = true; certReq.supportedSignatureAlgorithms = supportedSignatureAlgorithms; if (!(c.config.ClientCAs === ptrType.nil)) { certReq.certificateAuthorities = c.config.ClientCAs.Subjects(); } _r = certReq.marshal(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = hs.transcript.Write(_r); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _r$2 = certReq.marshal(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg = _r$2; _r$3 = c.writeRecord(22, _arg); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } /* } */ case 2: certMsg = new certificateMsgTLS13.ptr(sliceType$5.nil, new Certificate.ptr(sliceType$11.nil, $ifaceNil, sliceType$7.nil, sliceType$5.nil, sliceType$11.nil, ptrType$5.nil), false, false); Certificate.copy(certMsg.certificate, hs.cert); certMsg.scts = hs.clientHello.scts && hs.cert.SignedCertificateTimestamps.$length > 0; certMsg.ocspStapling = hs.clientHello.ocspStapling && hs.cert.OCSPStaple.$length > 0; _r$4 = certMsg.marshal(); /* */ $s = 7; case 7: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = hs.transcript.Write(_r$4); /* */ $s = 8; case 8: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; _r$6 = certMsg.marshal(); /* */ $s = 9; case 9: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _arg$1 = _r$6; _r$7 = c.writeRecord(22, _arg$1); /* */ $s = 10; case 10: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _tuple$1 = _r$7; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } certVerifyMsg = new certificateVerifyMsg.ptr(sliceType$5.nil, false, 0, sliceType$5.nil); certVerifyMsg.hasSignatureAlgorithm = true; certVerifyMsg.signatureAlgorithm = hs.sigAlg; _r$8 = typeAndHashFromSignatureScheme(hs.sigAlg); /* */ $s = 11; case 11: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _tuple$2 = _r$8; sigType = _tuple$2[0]; sigHash = _tuple$2[1]; err$2 = _tuple$2[2]; /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 12; continue; } /* */ $s = 13; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 12: _r$9 = c.sendAlert(80); /* */ $s = 14; case 14: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $24r = _r$9; $s = 15; case 15: return $24r; /* } */ case 13: _r$10 = signedMessage(sigHash, "TLS 1.3, server CertificateVerify\x00", hs.transcript); /* */ $s = 16; case 16: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } signed = _r$10; signOpts = (new crypto.Hash(sigHash)); if (sigType === 226) { signOpts = new rsa.PSSOptions.ptr(-1, sigHash); } _r$11 = $assertType(hs.cert.PrivateKey, crypto.Signer).Sign(c.config.rand(), signed, signOpts); /* */ $s = 17; case 17: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tuple$3 = _r$11; sig = _tuple$3[0]; err$2 = _tuple$3[1]; /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 18; continue; } /* */ $s = 19; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 18: _r$12 = $assertType(hs.cert.PrivateKey, crypto.Signer).Public(); /* */ $s = 20; case 20: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } public$1 = _r$12; _tuple$4 = $assertType(public$1, ptrType$11, true); rsaKey = _tuple$4[0]; ok = _tuple$4[1]; /* */ if (ok && (sigType === 226) && (_q = rsaKey.N.BitLen() / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) < (($imul(new crypto.Hash(sigHash).Size(), 2)) + 2 >> 0)) { $s = 21; continue; } /* */ $s = 22; continue; /* if (ok && (sigType === 226) && (_q = rsaKey.N.BitLen() / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) < (($imul(new crypto.Hash(sigHash).Size(), 2)) + 2 >> 0)) { */ case 21: _r$13 = c.sendAlert(40); /* */ $s = 24; case 24: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _r$13; $s = 23; continue; /* } else { */ case 22: _r$14 = c.sendAlert(80); /* */ $s = 25; case 25: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _r$14; /* } */ case 23: _r$15 = err$2.Error(); /* */ $s = 26; case 26: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _r$16 = errors.New("tls: failed to sign handshake: " + _r$15); /* */ $s = 27; case 27: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } $24r$1 = _r$16; $s = 28; case 28: return $24r$1; /* } */ case 19: certVerifyMsg.signature = sig; _r$17 = certVerifyMsg.marshal(); /* */ $s = 29; case 29: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } _r$18 = hs.transcript.Write(_r$17); /* */ $s = 30; case 30: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } _r$18; _r$19 = certVerifyMsg.marshal(); /* */ $s = 31; case 31: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } _arg$2 = _r$19; _r$20 = c.writeRecord(22, _arg$2); /* */ $s = 32; case 32: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } _tuple$5 = _r$20; err$3 = _tuple$5[1]; if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = -1; return err$3; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: serverHandshakeStateTLS13.ptr.prototype.sendServerCertificate }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._q = _q; $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$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$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._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.c = c; $f.certMsg = certMsg; $f.certReq = certReq; $f.certVerifyMsg = certVerifyMsg; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.hs = hs; $f.ok = ok; $f.public$1 = public$1; $f.rsaKey = rsaKey; $f.sig = sig; $f.sigHash = sigHash; $f.sigType = sigType; $f.signOpts = signOpts; $f.signed = signed; $f.$s = $s; $f.$r = $r; return $f; }; serverHandshakeStateTLS13.prototype.sendServerCertificate = function() { return this.$val.sendServerCertificate(); }; serverHandshakeStateTLS13.ptr.prototype.sendServerFinished = function() { var _arg, _arg$1, _arg$2, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, c, err, err$1, err$2, finished, hs, serverSecret, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$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$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; _tuple = $f._tuple; c = $f.c; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; finished = $f.finished; hs = $f.hs; serverSecret = $f.serverSecret; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; _r = hs.suite.finishedHash(c.out.trafficSecret, hs.transcript); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } finished = new finishedMsg.ptr(sliceType$5.nil, _r); _r$1 = finished.marshal(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = hs.transcript.Write(_r$1); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; _r$3 = finished.marshal(); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _arg = _r$3; _r$4 = c.writeRecord(22, _arg); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple = _r$4; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _arg$1 = sliceType$5.nil; _r$5 = hs.suite.deriveSecret(hs.handshakeSecret, "derived", $ifaceNil); /* */ $s = 6; case 6: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg$2 = _r$5; _r$6 = hs.suite.extract(_arg$1, _arg$2); /* */ $s = 7; case 7: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } hs.masterSecret = _r$6; _r$7 = hs.suite.deriveSecret(hs.masterSecret, "c ap traffic", hs.transcript); /* */ $s = 8; case 8: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } hs.trafficSecret = _r$7; _r$8 = hs.suite.deriveSecret(hs.masterSecret, "s ap traffic", hs.transcript); /* */ $s = 9; case 9: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } serverSecret = _r$8; $r = c.out.setTrafficSecret(hs.suite, serverSecret); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$9 = c.config.writeKeyLog("CLIENT_TRAFFIC_SECRET_0", hs.clientHello.random, hs.trafficSecret); /* */ $s = 11; case 11: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err$1 = _r$9; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 12; continue; } /* */ $s = 13; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 12: _r$10 = c.sendAlert(80); /* */ $s = 14; case 14: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; $s = -1; return err$1; /* } */ case 13: _r$11 = c.config.writeKeyLog("SERVER_TRAFFIC_SECRET_0", hs.clientHello.random, serverSecret); /* */ $s = 15; case 15: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } err$1 = _r$11; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 16; continue; } /* */ $s = 17; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 16: _r$12 = c.sendAlert(80); /* */ $s = 18; case 18: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _r$12; $s = -1; return err$1; /* } */ case 17: _r$13 = hs.suite.exportKeyingMaterial(hs.masterSecret, hs.transcript); /* */ $s = 19; case 19: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } c.ekm = _r$13; /* */ if (!hs.requestClientCert()) { $s = 20; continue; } /* */ $s = 21; continue; /* if (!hs.requestClientCert()) { */ case 20: _r$14 = hs.sendSessionTickets(); /* */ $s = 22; case 22: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } err$2 = _r$14; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return err$2; } /* } */ case 21: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: serverHandshakeStateTLS13.ptr.prototype.sendServerFinished }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$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$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._tuple = _tuple; $f.c = c; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.finished = finished; $f.hs = hs; $f.serverSecret = serverSecret; $f.$s = $s; $f.$r = $r; return $f; }; serverHandshakeStateTLS13.prototype.sendServerFinished = function() { return this.$val.sendServerFinished(); }; serverHandshakeStateTLS13.ptr.prototype.shouldSendSessionTickets = function() { var _i, _ref, hs, pskMode; hs = this; if (hs.c.config.SessionTicketsDisabled) { return false; } _ref = hs.clientHello.pskModes; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } pskMode = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (pskMode === 1) { return true; } _i++; } return false; }; serverHandshakeStateTLS13.prototype.shouldSendSessionTickets = function() { return this.$val.shouldSendSessionTickets(); }; serverHandshakeStateTLS13.ptr.prototype.sendSessionTickets = function() { var _arg, _i, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _tuple, _tuple$1, c, cert, certsFromClient, err, err$1, finishedMsg$1, hs, m, resumptionSecret, state, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _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; c = $f.c; cert = $f.cert; certsFromClient = $f.certsFromClient; err = $f.err; err$1 = $f.err$1; finishedMsg$1 = $f.finishedMsg$1; hs = $f.hs; m = $f.m; resumptionSecret = $f.resumptionSecret; state = $f.state; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; _r = hs.suite.finishedHash(c.in$27.trafficSecret, hs.transcript); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } hs.clientFinished = _r; finishedMsg$1 = new finishedMsg.ptr(sliceType$5.nil, hs.clientFinished); _r$1 = finishedMsg$1.marshal(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = hs.transcript.Write(_r$1); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; if (!hs.shouldSendSessionTickets()) { $s = -1; return $ifaceNil; } _r$3 = hs.suite.deriveSecret(hs.masterSecret, "res master", hs.transcript); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } resumptionSecret = _r$3; m = new newSessionTicketMsgTLS13.ptr(sliceType$5.nil, 0, 0, sliceType$5.nil, sliceType$5.nil, 0); certsFromClient = sliceType$11.nil; _ref = c.peerCertificates; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } cert = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); certsFromClient = $append(certsFromClient, cert.Raw); _i++; } _r$4 = c.config.time(); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = $clone(_r$4, time.Time).Unix(); /* */ $s = 6; case 6: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } state = new sessionStateTLS13.ptr(hs.suite.id, ((x = _r$5, new $Uint64(x.$high, x.$low))), resumptionSecret, new Certificate.ptr(certsFromClient, $ifaceNil, sliceType$7.nil, c.ocspResponse, c.scts, ptrType$5.nil)); err = $ifaceNil; _r$6 = state.marshal(); /* */ $s = 7; case 7: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$7 = c.encryptTicket(_r$6); /* */ $s = 8; case 8: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _tuple = _r$7; m.label = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } m.lifetime = 604800; _r$8 = m.marshal(); /* */ $s = 9; case 9: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _arg = _r$8; _r$9 = c.writeRecord(22, _arg); /* */ $s = 10; case 10: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple$1 = _r$9; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: serverHandshakeStateTLS13.ptr.prototype.sendSessionTickets }; } $f._arg = _arg; $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.c = c; $f.cert = cert; $f.certsFromClient = certsFromClient; $f.err = err; $f.err$1 = err$1; $f.finishedMsg$1 = finishedMsg$1; $f.hs = hs; $f.m = m; $f.resumptionSecret = resumptionSecret; $f.state = state; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; serverHandshakeStateTLS13.prototype.sendSessionTickets = function() { return this.$val.sendSessionTickets(); }; serverHandshakeStateTLS13.ptr.prototype.readClientCertificate = function() { var $24r, $24r$1, $24r$2, $24r$3, _r, _r$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$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, c, certMsg, certVerify, err, err$1, err$2, err$3, err$4, err$5, err$6, hs, msg, ok, ok$1, sigHash, sigType, signed, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; _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$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$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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; c = $f.c; certMsg = $f.certMsg; certVerify = $f.certVerify; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; err$4 = $f.err$4; err$5 = $f.err$5; err$6 = $f.err$6; hs = $f.hs; msg = $f.msg; ok = $f.ok; ok$1 = $f.ok$1; sigHash = $f.sigHash; sigType = $f.sigType; signed = $f.signed; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; /* */ if (!hs.requestClientCert()) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!hs.requestClientCert()) { */ case 1: /* */ if (!(c.config.VerifyConnection === $throwNilPointerError)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!(c.config.VerifyConnection === $throwNilPointerError)) { */ case 3: _r = c.config.VerifyConnection($clone(c.connectionStateLocked(), ConnectionState)); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 6: _r$1 = c.sendAlert(42); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = -1; return err; /* } */ case 7: /* } */ case 4: $s = -1; return $ifaceNil; /* } */ case 2: _r$2 = c.readHandshake(); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; msg = _tuple[0]; err$1 = _tuple[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } _tuple$1 = $assertType(msg, ptrType$27, true); certMsg = _tuple$1[0]; ok = _tuple$1[1]; /* */ if (!ok) { $s = 10; continue; } /* */ $s = 11; continue; /* if (!ok) { */ case 10: _r$3 = c.sendAlert(10); /* */ $s = 12; case 12: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _r$4 = unexpectedMessageError(certMsg, msg); /* */ $s = 13; case 13: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r = _r$4; $s = 14; case 14: return $24r; /* } */ case 11: _r$5 = certMsg.marshal(); /* */ $s = 15; case 15: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$6 = hs.transcript.Write(_r$5); /* */ $s = 16; case 16: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; _r$7 = c.processCertsFromClient($clone(certMsg.certificate, Certificate)); /* */ $s = 17; case 17: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } err$2 = _r$7; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return err$2; } /* */ if (!(c.config.VerifyConnection === $throwNilPointerError)) { $s = 18; continue; } /* */ $s = 19; continue; /* if (!(c.config.VerifyConnection === $throwNilPointerError)) { */ case 18: _r$8 = c.config.VerifyConnection($clone(c.connectionStateLocked(), ConnectionState)); /* */ $s = 20; case 20: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } err$3 = _r$8; /* */ if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = 21; continue; } /* */ $s = 22; continue; /* if (!($interfaceIsEqual(err$3, $ifaceNil))) { */ case 21: _r$9 = c.sendAlert(42); /* */ $s = 23; case 23: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$9; $s = -1; return err$3; /* } */ case 22: /* } */ case 19: /* */ if (!((certMsg.certificate.Certificate.$length === 0))) { $s = 24; continue; } /* */ $s = 25; continue; /* if (!((certMsg.certificate.Certificate.$length === 0))) { */ case 24: _r$10 = c.readHandshake(); /* */ $s = 26; case 26: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$2 = _r$10; msg = _tuple$2[0]; err$1 = _tuple$2[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } _tuple$3 = $assertType(msg, ptrType$28, true); certVerify = _tuple$3[0]; ok$1 = _tuple$3[1]; /* */ if (!ok$1) { $s = 27; continue; } /* */ $s = 28; continue; /* if (!ok$1) { */ case 27: _r$11 = c.sendAlert(10); /* */ $s = 29; case 29: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _r$11; _r$12 = unexpectedMessageError(certVerify, msg); /* */ $s = 30; case 30: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } $24r$1 = _r$12; $s = 31; case 31: return $24r$1; /* } */ case 28: /* */ if (!isSupportedSignatureAlgorithm(certVerify.signatureAlgorithm, supportedSignatureAlgorithms)) { $s = 32; continue; } /* */ $s = 33; continue; /* if (!isSupportedSignatureAlgorithm(certVerify.signatureAlgorithm, supportedSignatureAlgorithms)) { */ case 32: _r$13 = c.sendAlert(47); /* */ $s = 34; case 34: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _r$13; $s = -1; return errors.New("tls: client certificate used with invalid signature algorithm"); /* } */ case 33: _r$14 = typeAndHashFromSignatureScheme(certVerify.signatureAlgorithm); /* */ $s = 35; case 35: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _tuple$4 = _r$14; sigType = _tuple$4[0]; sigHash = _tuple$4[1]; err$4 = _tuple$4[2]; /* */ if (!($interfaceIsEqual(err$4, $ifaceNil))) { $s = 36; continue; } /* */ $s = 37; continue; /* if (!($interfaceIsEqual(err$4, $ifaceNil))) { */ case 36: _r$15 = c.sendAlert(80); /* */ $s = 38; case 38: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } $24r$2 = _r$15; $s = 39; case 39: return $24r$2; /* } */ case 37: /* */ if ((sigType === 225) || (sigHash === 3)) { $s = 40; continue; } /* */ $s = 41; continue; /* if ((sigType === 225) || (sigHash === 3)) { */ case 40: _r$16 = c.sendAlert(47); /* */ $s = 42; case 42: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _r$16; $s = -1; return errors.New("tls: client certificate used with invalid signature algorithm"); /* } */ case 41: _r$17 = signedMessage(sigHash, "TLS 1.3, client CertificateVerify\x00", hs.transcript); /* */ $s = 43; case 43: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } signed = _r$17; _r$18 = verifyHandshakeSignature(sigType, (x = c.peerCertificates, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])).PublicKey, sigHash, signed, certVerify.signature); /* */ $s = 44; case 44: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } err$5 = _r$18; /* */ if (!($interfaceIsEqual(err$5, $ifaceNil))) { $s = 45; continue; } /* */ $s = 46; continue; /* if (!($interfaceIsEqual(err$5, $ifaceNil))) { */ case 45: _r$19 = c.sendAlert(51); /* */ $s = 47; case 47: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } _r$19; _r$20 = err$5.Error(); /* */ $s = 48; case 48: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } _r$21 = errors.New("tls: invalid signature by the client certificate: " + _r$20); /* */ $s = 49; case 49: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } $24r$3 = _r$21; $s = 50; case 50: return $24r$3; /* } */ case 46: _r$22 = certVerify.marshal(); /* */ $s = 51; case 51: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; } _r$23 = hs.transcript.Write(_r$22); /* */ $s = 52; case 52: if($c) { $c = false; _r$23 = _r$23.$blk(); } if (_r$23 && _r$23.$blk !== undefined) { break s; } _r$23; /* } */ case 25: _r$24 = hs.sendSessionTickets(); /* */ $s = 53; case 53: if($c) { $c = false; _r$24 = _r$24.$blk(); } if (_r$24 && _r$24.$blk !== undefined) { break s; } err$6 = _r$24; if (!($interfaceIsEqual(err$6, $ifaceNil))) { $s = -1; return err$6; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: serverHandshakeStateTLS13.ptr.prototype.readClientCertificate }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $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$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$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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f.c = c; $f.certMsg = certMsg; $f.certVerify = certVerify; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.err$4 = err$4; $f.err$5 = err$5; $f.err$6 = err$6; $f.hs = hs; $f.msg = msg; $f.ok = ok; $f.ok$1 = ok$1; $f.sigHash = sigHash; $f.sigType = sigType; $f.signed = signed; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; serverHandshakeStateTLS13.prototype.readClientCertificate = function() { return this.$val.readClientCertificate(); }; serverHandshakeStateTLS13.ptr.prototype.readClientFinished = function() { var $24r, _r, _r$1, _r$2, _r$3, _tuple, _tuple$1, c, err, finished, hs, msg, ok, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; c = $f.c; err = $f.err; finished = $f.finished; hs = $f.hs; msg = $f.msg; ok = $f.ok; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; _r = c.readHandshake(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; msg = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _tuple$1 = $assertType(msg, ptrType$29, true); finished = _tuple$1[0]; ok = _tuple$1[1]; /* */ if (!ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!ok) { */ case 2: _r$1 = c.sendAlert(10); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _r$2 = unexpectedMessageError(finished, msg); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 6; case 6: return $24r; /* } */ case 3: /* */ if (!hmac.Equal(hs.clientFinished, finished.verifyData)) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!hmac.Equal(hs.clientFinished, finished.verifyData)) { */ case 7: _r$3 = c.sendAlert(51); /* */ $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; return errors.New("tls: invalid client finished hash"); /* } */ case 8: $r = c.in$27.setTrafficSecret(hs.suite, hs.trafficSecret); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: serverHandshakeStateTLS13.ptr.prototype.readClientFinished }; } $f.$24r = $24r; $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.c = c; $f.err = err; $f.finished = finished; $f.hs = hs; $f.msg = msg; $f.ok = ok; $f.$s = $s; $f.$r = $r; return $f; }; serverHandshakeStateTLS13.prototype.readClientFinished = function() { return this.$val.readClientFinished(); }; Conn.ptr.prototype.serverHandshake = function(ctx) { var $24r, $24r$1, _r, _r$1, _r$2, _tuple, c, clientHello, ctx, err, hs, hs$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; c = $f.c; clientHello = $f.clientHello; ctx = $f.ctx; err = $f.err; hs = $f.hs; hs$1 = $f.hs$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r = c.readClientHello(ctx); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; clientHello = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } /* */ if (c.vers === 772) { $s = 2; continue; } /* */ $s = 3; continue; /* if (c.vers === 772) { */ case 2: hs = new serverHandshakeStateTLS13.ptr(c, ctx, clientHello, ptrType$30.nil, false, false, ptrType$2.nil, ptrType$31.nil, 0, sliceType$5.nil, sliceType$5.nil, sliceType$5.nil, sliceType$5.nil, sliceType$5.nil, $ifaceNil, sliceType$5.nil); _r$1 = hs.handshake(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 5; case 5: return $24r; /* } */ case 3: hs$1 = new serverHandshakeState.ptr(c, ctx, clientHello, ptrType$30.nil, ptrType$3.nil, false, false, false, false, ptrType$32.nil, new finishedHash.ptr($ifaceNil, $ifaceNil, $ifaceNil, $ifaceNil, sliceType$5.nil, 0, $throwNilPointerError), sliceType$5.nil, ptrType$31.nil); _r$2 = hs$1.handshake(); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r$1 = _r$2; $s = 7; case 7: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.serverHandshake }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.c = c; $f.clientHello = clientHello; $f.ctx = ctx; $f.err = err; $f.hs = hs; $f.hs$1 = hs$1; $f.$s = $s; $f.$r = $r; return $f; }; Conn.prototype.serverHandshake = function(ctx) { return this.$val.serverHandshake(ctx); }; serverHandshakeState.ptr.prototype.handshake = function() { var _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, c, err, err$1, err$10, err$11, err$12, err$13, err$2, err$3, err$4, err$5, err$6, err$7, err$8, err$9, hs, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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$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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; c = $f.c; err = $f.err; err$1 = $f.err$1; err$10 = $f.err$10; err$11 = $f.err$11; err$12 = $f.err$12; err$13 = $f.err$13; err$2 = $f.err$2; err$3 = $f.err$3; err$4 = $f.err$4; err$5 = $f.err$5; err$6 = $f.err$6; err$7 = $f.err$7; err$8 = $f.err$8; err$9 = $f.err$9; hs = $f.hs; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; _r = hs.processClientHello(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } c.buffering = true; _r$1 = hs.checkForResumption(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (_r$1) { $s = 2; continue; } /* */ $s = 3; continue; /* if (_r$1) { */ case 2: c.didResume = true; _r$2 = hs.doResumeHandshake(); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } err$1 = _r$2; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } _r$3 = hs.establishKeys(); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } err$2 = _r$3; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return err$2; } _r$4 = hs.sendSessionTicket(); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } err$3 = _r$4; if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = -1; return err$3; } _r$5 = hs.sendFinished(new sliceType$5(c.serverFinished)); /* */ $s = 9; case 9: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } err$4 = _r$5; if (!($interfaceIsEqual(err$4, $ifaceNil))) { $s = -1; return err$4; } _r$6 = c.flush(); /* */ $s = 10; case 10: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tuple = _r$6; err$5 = _tuple[1]; if (!($interfaceIsEqual(err$5, $ifaceNil))) { $s = -1; return err$5; } c.clientFinishedIsFirst = false; _r$7 = hs.readFinished(sliceType$5.nil); /* */ $s = 11; case 11: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } err$6 = _r$7; if (!($interfaceIsEqual(err$6, $ifaceNil))) { $s = -1; return err$6; } $s = 4; continue; /* } else { */ case 3: _r$8 = hs.pickCipherSuite(); /* */ $s = 12; case 12: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } err$7 = _r$8; if (!($interfaceIsEqual(err$7, $ifaceNil))) { $s = -1; return err$7; } _r$9 = hs.doFullHandshake(); /* */ $s = 13; case 13: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err$8 = _r$9; if (!($interfaceIsEqual(err$8, $ifaceNil))) { $s = -1; return err$8; } _r$10 = hs.establishKeys(); /* */ $s = 14; case 14: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } err$9 = _r$10; if (!($interfaceIsEqual(err$9, $ifaceNil))) { $s = -1; return err$9; } _r$11 = hs.readFinished(new sliceType$5(c.clientFinished)); /* */ $s = 15; case 15: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } err$10 = _r$11; if (!($interfaceIsEqual(err$10, $ifaceNil))) { $s = -1; return err$10; } c.clientFinishedIsFirst = true; c.buffering = true; _r$12 = hs.sendSessionTicket(); /* */ $s = 16; case 16: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } err$11 = _r$12; if (!($interfaceIsEqual(err$11, $ifaceNil))) { $s = -1; return err$11; } _r$13 = hs.sendFinished(sliceType$5.nil); /* */ $s = 17; case 17: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } err$12 = _r$13; if (!($interfaceIsEqual(err$12, $ifaceNil))) { $s = -1; return err$12; } _r$14 = c.flush(); /* */ $s = 18; case 18: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _tuple$1 = _r$14; err$13 = _tuple$1[1]; if (!($interfaceIsEqual(err$13, $ifaceNil))) { $s = -1; return err$13; } /* } */ case 4: c.ekm = ekmFromMasterSecret(c.vers, hs.suite, hs.masterSecret, hs.clientHello.random, hs.hello.random); atomic.StoreUint32((c.$ptr_handshakeStatus || (c.$ptr_handshakeStatus = new ptrType$24(function() { return this.$target.handshakeStatus; }, function($v) { this.$target.handshakeStatus = $v; }, c))), 1); $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: serverHandshakeState.ptr.prototype.handshake }; } $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$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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.c = c; $f.err = err; $f.err$1 = err$1; $f.err$10 = err$10; $f.err$11 = err$11; $f.err$12 = err$12; $f.err$13 = err$13; $f.err$2 = err$2; $f.err$3 = err$3; $f.err$4 = err$4; $f.err$5 = err$5; $f.err$6 = err$6; $f.err$7 = err$7; $f.err$8 = err$8; $f.err$9 = err$9; $f.hs = hs; $f.$s = $s; $f.$r = $r; return $f; }; serverHandshakeState.prototype.handshake = function() { return this.$val.handshake(); }; Conn.ptr.prototype.readClientHello = function(ctx) { var $24r, $24r$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _tuple, _tuple$1, _tuple$2, _tuple$3, c, chi, clientHello, clientVersions, configForClient, ctx, err, msg, ok, originalConfig, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$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; _r$7 = $f._r$7; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; c = $f.c; chi = $f.chi; clientHello = $f.clientHello; clientVersions = $f.clientVersions; configForClient = $f.configForClient; ctx = $f.ctx; err = $f.err; msg = $f.msg; ok = $f.ok; originalConfig = $f.originalConfig; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r = c.readHandshake(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; msg = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$26.nil, err]; } _tuple$1 = $assertType(msg, ptrType$26, true); clientHello = _tuple$1[0]; ok = _tuple$1[1]; /* */ if (!ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!ok) { */ case 2: _r$1 = c.sendAlert(10); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _r$2 = unexpectedMessageError(clientHello, msg); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = [ptrType$26.nil, _r$2]; $s = 6; case 6: return $24r; /* } */ case 3: configForClient = ptrType$4.nil; originalConfig = c.config; /* */ if (!(c.config.GetConfigForClient === $throwNilPointerError)) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!(c.config.GetConfigForClient === $throwNilPointerError)) { */ case 7: chi = clientHelloInfo(ctx, c, clientHello); _r$3 = c.config.GetConfigForClient(chi); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$2 = _r$3; configForClient = _tuple$2[0]; err = _tuple$2[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 10; continue; } /* */ if (!(configForClient === ptrType$4.nil)) { $s = 11; continue; } /* */ $s = 12; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 10: _r$4 = c.sendAlert(80); /* */ $s = 13; case 13: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; $s = -1; return [ptrType$26.nil, err]; /* } else if (!(configForClient === ptrType$4.nil)) { */ case 11: c.config = configForClient; /* } */ case 12: /* } */ case 8: _r$5 = originalConfig.ticketKeys(configForClient); /* */ $s = 14; case 14: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } c.ticketKeys = _r$5; clientVersions = clientHello.supportedVersions; if (clientHello.supportedVersions.$length === 0) { clientVersions = supportedVersionsFromMax(clientHello.vers); } _tuple$3 = c.config.mutualVersion(clientVersions); c.vers = _tuple$3[0]; ok = _tuple$3[1]; /* */ if (!ok) { $s = 15; continue; } /* */ $s = 16; continue; /* if (!ok) { */ case 15: _r$6 = c.sendAlert(70); /* */ $s = 17; case 17: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; _r$7 = fmt.Errorf("tls: client offered only unsupported versions: %x", new sliceType$6([clientVersions])); /* */ $s = 18; case 18: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } $24r$1 = [ptrType$26.nil, _r$7]; $s = 19; case 19: return $24r$1; /* } */ case 16: c.haveVers = true; c.in$27.version = c.vers; c.out.version = c.vers; $s = -1; return [clientHello, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.readClientHello }; } $f.$24r = $24r; $f.$24r$1 = $24r$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._r$7 = _r$7; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.c = c; $f.chi = chi; $f.clientHello = clientHello; $f.clientVersions = clientVersions; $f.configForClient = configForClient; $f.ctx = ctx; $f.err = err; $f.msg = msg; $f.ok = ok; $f.originalConfig = originalConfig; $f.$s = $s; $f.$r = $r; return $f; }; Conn.prototype.readClientHello = function(ctx) { return this.$val.readClientHello(ctx); }; serverHandshakeState.ptr.prototype.processClientHello = function() { var $24r, $24r$1, _arg, _arg$1, _i, _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, _ref, _ref$1, _ref$2, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, c, compression, err, foundCompression, hs, maxVers, ok, ok$1, priv, priv$1, selectedProto, serverRandom, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _arg = $f._arg; _arg$1 = $f._arg$1; _i = $f._i; _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; _ref = $f._ref; _ref$1 = $f._ref$1; _ref$2 = $f._ref$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; c = $f.c; compression = $f.compression; err = $f.err; foundCompression = $f.foundCompression; hs = $f.hs; maxVers = $f.maxVers; ok = $f.ok; ok$1 = $f.ok$1; priv = $f.priv; priv$1 = $f.priv$1; selectedProto = $f.selectedProto; serverRandom = $f.serverRandom; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; hs.hello = new serverHelloMsg.ptr(sliceType$5.nil, 0, sliceType$5.nil, sliceType$5.nil, 0, 0, false, false, false, sliceType$5.nil, "", sliceType$11.nil, 0, new keyShare.ptr(0, sliceType$5.nil), false, 0, sliceType$5.nil, sliceType$5.nil, 0); hs.hello.vers = c.vers; foundCompression = false; _ref = hs.clientHello.compressionMethods; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } compression = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (compression === 0) { foundCompression = true; break; } _i++; } /* */ if (!foundCompression) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!foundCompression) { */ case 1: _r = c.sendAlert(40); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; $s = -1; return errors.New("tls: client does not support uncompressed connections"); /* } */ case 2: hs.hello.random = $makeSlice(sliceType$5, 32); serverRandom = hs.hello.random; maxVers = c.config.maxSupportedVersion(); if (maxVers >= 771 && c.vers < maxVers || testingOnlyForceDowngradeCanary) { if (c.vers === 771) { $copyString($subslice(serverRandom, 24), "DOWNGRD\x01"); } else { $copyString($subslice(serverRandom, 24), "DOWNGRD\x00"); } serverRandom = $subslice(serverRandom, 0, 24); } _r$1 = io.ReadFull(c.config.rand(), serverRandom); /* */ $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; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 5: _r$2 = c.sendAlert(80); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; $s = -1; return err; /* } */ case 6: /* */ if (!((hs.clientHello.secureRenegotiation.$length === 0))) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!((hs.clientHello.secureRenegotiation.$length === 0))) { */ case 8: _r$3 = c.sendAlert(40); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $s = -1; return errors.New("tls: initial handshake had non-empty renegotiation extension"); /* } */ case 9: hs.hello.secureRenegotiationSupported = hs.clientHello.secureRenegotiationSupported; hs.hello.compressionMethod = 0; if (hs.clientHello.serverName.length > 0) { c.serverName = hs.clientHello.serverName; } _r$4 = negotiateALPN(c.config.NextProtos, hs.clientHello.alpnProtocols); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$1 = _r$4; selectedProto = _tuple$1[0]; err = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 12; continue; } /* */ $s = 13; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 12: _r$5 = c.sendAlert(120); /* */ $s = 14; case 14: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; $s = -1; return err; /* } */ case 13: hs.hello.alpnProtocol = selectedProto; c.clientProtocol = selectedProto; _r$6 = c.config.getCertificate(clientHelloInfo(hs.ctx, c, hs.clientHello)); /* */ $s = 15; case 15: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tuple$2 = _r$6; hs.cert = _tuple$2[0]; err = _tuple$2[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 16; continue; } /* */ $s = 17; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 16: /* */ if ($interfaceIsEqual(err, errNoCertificates)) { $s = 18; continue; } /* */ $s = 19; continue; /* if ($interfaceIsEqual(err, errNoCertificates)) { */ case 18: _r$7 = c.sendAlert(112); /* */ $s = 21; case 21: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$7; $s = 20; continue; /* } else { */ case 19: _r$8 = c.sendAlert(80); /* */ $s = 22; case 22: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$8; /* } */ case 20: $s = -1; return err; /* } */ case 17: if (hs.clientHello.scts) { hs.hello.scts = hs.cert.SignedCertificateTimestamps; } hs.ecdheOk = supportsECDHE(c.config, hs.clientHello.supportedCurves, hs.clientHello.supportedPoints); if (hs.ecdheOk) { hs.hello.supportedPoints = new sliceType$5([0]); } _tuple$3 = $assertType(hs.cert.PrivateKey, crypto.Signer, true); priv = _tuple$3[0]; ok = _tuple$3[1]; /* */ if (ok) { $s = 23; continue; } /* */ $s = 24; continue; /* if (ok) { */ case 23: _r$9 = priv.Public(); /* */ $s = 25; case 25: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _ref$1 = _r$9; /* */ if ($assertType(_ref$1, ptrType$12, true)[1]) { $s = 26; continue; } /* */ if ($assertType(_ref$1, ed25519.PublicKey, true)[1]) { $s = 27; continue; } /* */ if ($assertType(_ref$1, ptrType$11, true)[1]) { $s = 28; continue; } /* */ $s = 29; continue; /* if ($assertType(_ref$1, ptrType$12, true)[1]) { */ case 26: hs.ecSignOk = true; $s = 30; continue; /* } else if ($assertType(_ref$1, ed25519.PublicKey, true)[1]) { */ case 27: hs.ecSignOk = true; $s = 30; continue; /* } else if ($assertType(_ref$1, ptrType$11, true)[1]) { */ case 28: hs.rsaSignOk = true; $s = 30; continue; /* } else { */ case 29: _r$10 = c.sendAlert(80); /* */ $s = 31; case 31: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; _r$11 = priv.Public(); /* */ $s = 32; case 32: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _arg = _r$11; _r$12 = fmt.Errorf("tls: unsupported signing key type (%T)", new sliceType$6([_arg])); /* */ $s = 33; case 33: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } $24r = _r$12; $s = 34; case 34: return $24r; /* } */ case 30: /* } */ case 24: _tuple$4 = $assertType(hs.cert.PrivateKey, crypto.Decrypter, true); priv$1 = _tuple$4[0]; ok$1 = _tuple$4[1]; /* */ if (ok$1) { $s = 35; continue; } /* */ $s = 36; continue; /* if (ok$1) { */ case 35: _r$13 = priv$1.Public(); /* */ $s = 37; case 37: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _ref$2 = _r$13; /* */ if ($assertType(_ref$2, ptrType$11, true)[1]) { $s = 38; continue; } /* */ $s = 39; continue; /* if ($assertType(_ref$2, ptrType$11, true)[1]) { */ case 38: hs.rsaDecryptOk = true; $s = 40; continue; /* } else { */ case 39: _r$14 = c.sendAlert(80); /* */ $s = 41; case 41: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _r$14; _r$15 = priv$1.Public(); /* */ $s = 42; case 42: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _arg$1 = _r$15; _r$16 = fmt.Errorf("tls: unsupported decryption key type (%T)", new sliceType$6([_arg$1])); /* */ $s = 43; case 43: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } $24r$1 = _r$16; $s = 44; case 44: return $24r$1; /* } */ case 40: /* } */ case 36: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: serverHandshakeState.ptr.prototype.processClientHello }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._arg = _arg; $f._arg$1 = _arg$1; $f._i = _i; $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._ref = _ref; $f._ref$1 = _ref$1; $f._ref$2 = _ref$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f.c = c; $f.compression = compression; $f.err = err; $f.foundCompression = foundCompression; $f.hs = hs; $f.maxVers = maxVers; $f.ok = ok; $f.ok$1 = ok$1; $f.priv = priv; $f.priv$1 = priv$1; $f.selectedProto = selectedProto; $f.serverRandom = serverRandom; $f.$s = $s; $f.$r = $r; return $f; }; serverHandshakeState.prototype.processClientHello = function() { return this.$val.processClientHello(); }; negotiateALPN = function(serverProtos, clientProtos) { var $24r, _i, _i$1, _r, _ref, _ref$1, c, clientProtos, http11fallback, s, serverProtos, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _ref = $f._ref; _ref$1 = $f._ref$1; c = $f.c; clientProtos = $f.clientProtos; http11fallback = $f.http11fallback; s = $f.s; serverProtos = $f.serverProtos; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if ((serverProtos.$length === 0) || (clientProtos.$length === 0)) { $s = -1; return ["", $ifaceNil]; } http11fallback = false; _ref = serverProtos; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } s = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _ref$1 = clientProtos; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } c = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); if (s === c) { $s = -1; return [s, $ifaceNil]; } if (s === "h2" && c === "http/1.1") { http11fallback = true; } _i$1++; } _i++; } if (http11fallback) { $s = -1; return ["", $ifaceNil]; } _r = fmt.Errorf("tls: client requested unsupported application protocols (%s)", new sliceType$6([clientProtos])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = ["", _r]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: negotiateALPN }; } $f.$24r = $24r; $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._ref = _ref; $f._ref$1 = _ref$1; $f.c = c; $f.clientProtos = clientProtos; $f.http11fallback = http11fallback; $f.s = s; $f.serverProtos = serverProtos; $f.$s = $s; $f.$r = $r; return $f; }; supportsECDHE = function(c, supportedCurves, supportedPoints) { var _i, _i$1, _ref, _ref$1, c, curve, pointFormat, supportedCurves, supportedPoints, supportsCurve, supportsPointFormat; supportsCurve = false; _ref = supportedCurves; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } curve = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (c.supportsCurve(curve)) { supportsCurve = true; break; } _i++; } supportsPointFormat = false; _ref$1 = supportedPoints; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } pointFormat = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); if (pointFormat === 0) { supportsPointFormat = true; break; } _i$1++; } return supportsCurve && supportsPointFormat; }; serverHandshakeState.ptr.prototype.pickCipherSuite = function() { var _i, _i$1, _i$2, _r, _r$1, _r$2, _ref, _ref$1, _ref$2, c, configCipherSuites, hs, id, id$1, preferenceList, preferenceOrder, suiteID, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _i$1 = $f._i$1; _i$2 = $f._i$2; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; _ref$1 = $f._ref$1; _ref$2 = $f._ref$2; c = $f.c; configCipherSuites = $f.configCipherSuites; hs = $f.hs; id = $f.id; id$1 = $f.id$1; preferenceList = $f.preferenceList; preferenceOrder = $f.preferenceOrder; suiteID = $f.suiteID; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; preferenceOrder = cipherSuitesPreferenceOrder; if (!hasAESGCMHardwareSupport || !aesgcmPreferred(hs.clientHello.cipherSuites)) { preferenceOrder = cipherSuitesPreferenceOrderNoAES; } configCipherSuites = c.config.cipherSuites(); preferenceList = $makeSlice(sliceType$2, 0, configCipherSuites.$length); _ref = preferenceOrder; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } suiteID = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _ref$1 = configCipherSuites; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } id = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); if (id === suiteID) { preferenceList = $append(preferenceList, id); break; } _i$1++; } _i++; } _r = selectCipherSuite(preferenceList, hs.clientHello.cipherSuites, $methodVal(hs, "cipherSuiteOk")); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } hs.suite = _r; /* */ if (hs.suite === ptrType$3.nil) { $s = 2; continue; } /* */ $s = 3; continue; /* if (hs.suite === ptrType$3.nil) { */ case 2: _r$1 = c.sendAlert(40); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = -1; return errors.New("tls: no cipher suite supported by both client and server"); /* } */ case 3: c.cipherSuite = hs.suite.id; _ref$2 = hs.clientHello.cipherSuites; _i$2 = 0; /* while (true) { */ case 5: /* if (!(_i$2 < _ref$2.$length)) { break; } */ if(!(_i$2 < _ref$2.$length)) { $s = 6; continue; } id$1 = ((_i$2 < 0 || _i$2 >= _ref$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$2.$array[_ref$2.$offset + _i$2]); /* */ if (id$1 === 22016) { $s = 7; continue; } /* */ $s = 8; continue; /* if (id$1 === 22016) { */ case 7: /* */ if (hs.clientHello.vers < c.config.maxSupportedVersion()) { $s = 9; continue; } /* */ $s = 10; continue; /* if (hs.clientHello.vers < c.config.maxSupportedVersion()) { */ case 9: _r$2 = c.sendAlert(86); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; $s = -1; return errors.New("tls: client using inappropriate protocol fallback"); /* } */ case 10: /* break; */ $s = 6; continue; /* } */ case 8: _i$2++; $s = 5; continue; case 6: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: serverHandshakeState.ptr.prototype.pickCipherSuite }; } $f._i = _i; $f._i$1 = _i$1; $f._i$2 = _i$2; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f._ref$1 = _ref$1; $f._ref$2 = _ref$2; $f.c = c; $f.configCipherSuites = configCipherSuites; $f.hs = hs; $f.id = id; $f.id$1 = id$1; $f.preferenceList = preferenceList; $f.preferenceOrder = preferenceOrder; $f.suiteID = suiteID; $f.$s = $s; $f.$r = $r; return $f; }; serverHandshakeState.prototype.pickCipherSuite = function() { return this.$val.pickCipherSuite(); }; serverHandshakeState.ptr.prototype.cipherSuiteOk = function(c) { var c, hs; hs = this; if (!(((c.flags & 1) === 0))) { if (!hs.ecdheOk) { return false; } if (!(((c.flags & 2) === 0))) { if (!hs.ecSignOk) { return false; } } else if (!hs.rsaSignOk) { return false; } } else if (!hs.rsaDecryptOk) { return false; } if (hs.c.vers < 771 && !(((c.flags & 4) === 0))) { return false; } return true; }; serverHandshakeState.prototype.cipherSuiteOk = function(c) { return this.$val.cipherSuiteOk(c); }; serverHandshakeState.ptr.prototype.checkForResumption = function() { var _i, _r, _r$1, _r$2, _r$3, _ref, _tuple, c, cipherSuiteOk, createdAt, hs, id, needClientCerts, ok, plaintext, sessionHasClientCerts, usedOldKey, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; _tuple = $f._tuple; c = $f.c; cipherSuiteOk = $f.cipherSuiteOk; createdAt = $f.createdAt; hs = $f.hs; id = $f.id; needClientCerts = $f.needClientCerts; ok = $f.ok; plaintext = $f.plaintext; sessionHasClientCerts = $f.sessionHasClientCerts; usedOldKey = $f.usedOldKey; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; if (c.config.SessionTicketsDisabled) { $s = -1; return false; } _r = c.decryptTicket(hs.clientHello.sessionTicket); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; plaintext = _tuple[0]; usedOldKey = _tuple[1]; if (plaintext === sliceType$5.nil) { $s = -1; return false; } hs.sessionState = new sessionState.ptr(0, 0, new $Uint64(0, 0), sliceType$5.nil, sliceType$11.nil, usedOldKey); ok = hs.sessionState.unmarshal(plaintext); if (!ok) { $s = -1; return false; } createdAt = $clone(time.Unix(((x = hs.sessionState.createdAt, new $Int64(x.$high, x.$low))), new $Int64(0, 0)), time.Time); _r$1 = c.config.time(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = $clone(_r$1, time.Time).Sub($clone(createdAt, time.Time)); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } /* */ if ((x$1 = _r$2, (x$1.$high > 140815 || (x$1.$high === 140815 && x$1.$low > 4180213760)))) { $s = 2; continue; } /* */ $s = 3; continue; /* if ((x$1 = _r$2, (x$1.$high > 140815 || (x$1.$high === 140815 && x$1.$low > 4180213760)))) { */ case 2: $s = -1; return false; /* } */ case 3: if (!((c.vers === hs.sessionState.vers))) { $s = -1; return false; } cipherSuiteOk = false; _ref = hs.clientHello.cipherSuites; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } id = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (id === hs.sessionState.cipherSuite) { cipherSuiteOk = true; break; } _i++; } if (!cipherSuiteOk) { $s = -1; return false; } _r$3 = selectCipherSuite(new sliceType$2([hs.sessionState.cipherSuite]), c.config.cipherSuites(), $methodVal(hs, "cipherSuiteOk")); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } hs.suite = _r$3; if (hs.suite === ptrType$3.nil) { $s = -1; return false; } sessionHasClientCerts = !((hs.sessionState.certificates.$length === 0)); needClientCerts = requiresClientCert(c.config.ClientAuth); if (needClientCerts && !sessionHasClientCerts) { $s = -1; return false; } if (sessionHasClientCerts && (c.config.ClientAuth === 0)) { $s = -1; return false; } $s = -1; return true; /* */ } return; } if ($f === undefined) { $f = { $blk: serverHandshakeState.ptr.prototype.checkForResumption }; } $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._tuple = _tuple; $f.c = c; $f.cipherSuiteOk = cipherSuiteOk; $f.createdAt = createdAt; $f.hs = hs; $f.id = id; $f.needClientCerts = needClientCerts; $f.ok = ok; $f.plaintext = plaintext; $f.sessionHasClientCerts = sessionHasClientCerts; $f.usedOldKey = usedOldKey; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; serverHandshakeState.prototype.checkForResumption = function() { return this.$val.checkForResumption(); }; serverHandshakeState.ptr.prototype.doResumeHandshake = function() { var _arg, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, c, err, err$1, err$2, hs, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _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; _tuple = $f._tuple; c = $f.c; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; hs = $f.hs; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; hs.hello.cipherSuite = hs.suite.id; c.cipherSuite = hs.suite.id; hs.hello.sessionId = hs.clientHello.sessionId; hs.hello.ticketSupported = hs.sessionState.usedOldKey; _r = newFinishedHash(c.vers, hs.suite); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } finishedHash.copy(hs.finishedHash, _r); hs.finishedHash.discardHandshakeBuffer(); _r$1 = hs.clientHello.marshal(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = hs.finishedHash.Write(_r$1); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; _r$3 = hs.hello.marshal(); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = hs.finishedHash.Write(_r$3); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; _r$5 = hs.hello.marshal(); /* */ $s = 6; case 6: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg = _r$5; _r$6 = c.writeRecord(22, _arg); /* */ $s = 7; case 7: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tuple = _r$6; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _r$7 = c.processCertsFromClient(new Certificate.ptr(hs.sessionState.certificates, $ifaceNil, sliceType$7.nil, sliceType$5.nil, sliceType$11.nil, ptrType$5.nil)); /* */ $s = 8; case 8: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } err$1 = _r$7; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } /* */ if (!(c.config.VerifyConnection === $throwNilPointerError)) { $s = 9; continue; } /* */ $s = 10; continue; /* if (!(c.config.VerifyConnection === $throwNilPointerError)) { */ case 9: _r$8 = c.config.VerifyConnection($clone(c.connectionStateLocked(), ConnectionState)); /* */ $s = 11; case 11: 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 = 12; continue; } /* */ $s = 13; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 12: _r$9 = c.sendAlert(42); /* */ $s = 14; case 14: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$9; $s = -1; return err$2; /* } */ case 13: /* } */ case 10: hs.masterSecret = hs.sessionState.masterSecret; $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: serverHandshakeState.ptr.prototype.doResumeHandshake }; } $f._arg = _arg; $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._tuple = _tuple; $f.c = c; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.hs = hs; $f.$s = $s; $f.$r = $r; return $f; }; serverHandshakeState.prototype.doResumeHandshake = function() { return this.$val.doResumeHandshake(); }; serverHandshakeState.ptr.prototype.doFullHandshake = function() { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, _arg, _arg$1, _r, _r$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$36, _r$37, _r$38, _r$39, _r$4, _r$40, _r$41, _r$42, _r$43, _r$44, _r$45, _r$46, _r$47, _r$48, _r$49, _r$5, _r$50, _r$51, _r$52, _r$53, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, _tuple$10, _tuple$11, _tuple$12, _tuple$13, _tuple$14, _tuple$15, _tuple$16, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, _tuple$8, _tuple$9, c, certMsg, certMsg$1, certReq, certStatus, certVerify, ckx, err, err$1, err$10, err$11, err$2, err$3, err$4, err$5, err$6, err$7, err$8, err$9, helloDone, hs, keyAgreement$1, msg, ok, ok$1, ok$2, preMasterSecret, pub, sigHash, sigType, signed, skx, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; _arg = $f._arg; _arg$1 = $f._arg$1; _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$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$36 = $f._r$36; _r$37 = $f._r$37; _r$38 = $f._r$38; _r$39 = $f._r$39; _r$4 = $f._r$4; _r$40 = $f._r$40; _r$41 = $f._r$41; _r$42 = $f._r$42; _r$43 = $f._r$43; _r$44 = $f._r$44; _r$45 = $f._r$45; _r$46 = $f._r$46; _r$47 = $f._r$47; _r$48 = $f._r$48; _r$49 = $f._r$49; _r$5 = $f._r$5; _r$50 = $f._r$50; _r$51 = $f._r$51; _r$52 = $f._r$52; _r$53 = $f._r$53; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; _tuple = $f._tuple; _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$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; _tuple$9 = $f._tuple$9; c = $f.c; certMsg = $f.certMsg; certMsg$1 = $f.certMsg$1; certReq = $f.certReq; certStatus = $f.certStatus; certVerify = $f.certVerify; ckx = $f.ckx; err = $f.err; err$1 = $f.err$1; err$10 = $f.err$10; err$11 = $f.err$11; err$2 = $f.err$2; err$3 = $f.err$3; err$4 = $f.err$4; err$5 = $f.err$5; err$6 = $f.err$6; err$7 = $f.err$7; err$8 = $f.err$8; err$9 = $f.err$9; helloDone = $f.helloDone; hs = $f.hs; keyAgreement$1 = $f.keyAgreement$1; msg = $f.msg; ok = $f.ok; ok$1 = $f.ok$1; ok$2 = $f.ok$2; preMasterSecret = $f.preMasterSecret; pub = $f.pub; sigHash = $f.sigHash; sigType = $f.sigType; signed = $f.signed; skx = $f.skx; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; if (hs.clientHello.ocspStapling && hs.cert.OCSPStaple.$length > 0) { hs.hello.ocspStapling = true; } hs.hello.ticketSupported = hs.clientHello.ticketSupported && !c.config.SessionTicketsDisabled; hs.hello.cipherSuite = hs.suite.id; _r = newFinishedHash(hs.c.vers, hs.suite); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } finishedHash.copy(hs.finishedHash, _r); if (c.config.ClientAuth === 0) { hs.finishedHash.discardHandshakeBuffer(); } _r$1 = hs.clientHello.marshal(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = hs.finishedHash.Write(_r$1); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; _r$3 = hs.hello.marshal(); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = hs.finishedHash.Write(_r$3); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; _r$5 = hs.hello.marshal(); /* */ $s = 6; case 6: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg = _r$5; _r$6 = c.writeRecord(22, _arg); /* */ $s = 7; case 7: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tuple = _r$6; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } certMsg = new certificateMsg.ptr(sliceType$5.nil, sliceType$11.nil); certMsg.certificates = hs.cert.Certificate; _r$7 = hs.finishedHash.Write(certMsg.marshal()); /* */ $s = 8; case 8: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$7; _r$8 = c.writeRecord(22, certMsg.marshal()); /* */ $s = 9; case 9: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _tuple$1 = _r$8; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } /* */ if (hs.hello.ocspStapling) { $s = 10; continue; } /* */ $s = 11; continue; /* if (hs.hello.ocspStapling) { */ case 10: certStatus = new certificateStatusMsg.ptr(sliceType$5.nil, sliceType$5.nil); certStatus.response = hs.cert.OCSPStaple; _r$9 = certStatus.marshal(); /* */ $s = 12; case 12: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$10 = hs.finishedHash.Write(_r$9); /* */ $s = 13; case 13: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; _r$11 = certStatus.marshal(); /* */ $s = 14; case 14: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _arg$1 = _r$11; _r$12 = c.writeRecord(22, _arg$1); /* */ $s = 15; case 15: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _tuple$2 = _r$12; err$2 = _tuple$2[1]; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return err$2; } /* } */ case 11: _r$13 = hs.suite.ka(c.vers); /* */ $s = 16; case 16: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } keyAgreement$1 = _r$13; _r$14 = keyAgreement$1.generateServerKeyExchange(c.config, hs.cert, hs.clientHello, hs.hello); /* */ $s = 17; case 17: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _tuple$3 = _r$14; skx = _tuple$3[0]; err$3 = _tuple$3[1]; /* */ if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = 18; continue; } /* */ $s = 19; continue; /* if (!($interfaceIsEqual(err$3, $ifaceNil))) { */ case 18: _r$15 = c.sendAlert(40); /* */ $s = 20; case 20: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _r$15; $s = -1; return err$3; /* } */ case 19: /* */ if (!(skx === ptrType$22.nil)) { $s = 21; continue; } /* */ $s = 22; continue; /* if (!(skx === ptrType$22.nil)) { */ case 21: _r$16 = hs.finishedHash.Write(skx.marshal()); /* */ $s = 23; case 23: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _r$16; _r$17 = c.writeRecord(22, skx.marshal()); /* */ $s = 24; case 24: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } _tuple$4 = _r$17; err$4 = _tuple$4[1]; if (!($interfaceIsEqual(err$4, $ifaceNil))) { $s = -1; return err$4; } /* } */ case 22: certReq = ptrType$33.nil; /* */ if (c.config.ClientAuth >= 1) { $s = 25; continue; } /* */ $s = 26; continue; /* if (c.config.ClientAuth >= 1) { */ case 25: certReq = new certificateRequestMsg.ptr(sliceType$5.nil, false, sliceType$5.nil, sliceType$7.nil, sliceType$11.nil); certReq.certificateTypes = new sliceType$5([1, 64]); if (c.vers >= 771) { certReq.hasSignatureAlgorithm = true; certReq.supportedSignatureAlgorithms = supportedSignatureAlgorithms; } if (!(c.config.ClientCAs === ptrType.nil)) { certReq.certificateAuthorities = c.config.ClientCAs.Subjects(); } _r$18 = hs.finishedHash.Write(certReq.marshal()); /* */ $s = 27; case 27: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } _r$18; _r$19 = c.writeRecord(22, certReq.marshal()); /* */ $s = 28; case 28: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } _tuple$5 = _r$19; err$5 = _tuple$5[1]; if (!($interfaceIsEqual(err$5, $ifaceNil))) { $s = -1; return err$5; } /* } */ case 26: helloDone = new serverHelloDoneMsg.ptr(); _r$20 = hs.finishedHash.Write(helloDone.marshal()); /* */ $s = 29; case 29: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } _r$20; _r$21 = c.writeRecord(22, helloDone.marshal()); /* */ $s = 30; case 30: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } _tuple$6 = _r$21; err$6 = _tuple$6[1]; if (!($interfaceIsEqual(err$6, $ifaceNil))) { $s = -1; return err$6; } _r$22 = c.flush(); /* */ $s = 31; case 31: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; } _tuple$7 = _r$22; err$7 = _tuple$7[1]; if (!($interfaceIsEqual(err$7, $ifaceNil))) { $s = -1; return err$7; } pub = $ifaceNil; _r$23 = c.readHandshake(); /* */ $s = 32; case 32: if($c) { $c = false; _r$23 = _r$23.$blk(); } if (_r$23 && _r$23.$blk !== undefined) { break s; } _tuple$8 = _r$23; msg = _tuple$8[0]; err$3 = _tuple$8[1]; if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = -1; return err$3; } /* */ if (c.config.ClientAuth >= 1) { $s = 33; continue; } /* */ $s = 34; continue; /* if (c.config.ClientAuth >= 1) { */ case 33: _tuple$9 = $assertType(msg, ptrType$34, true); certMsg$1 = _tuple$9[0]; ok = _tuple$9[1]; /* */ if (!ok) { $s = 35; continue; } /* */ $s = 36; continue; /* if (!ok) { */ case 35: _r$24 = c.sendAlert(10); /* */ $s = 37; case 37: if($c) { $c = false; _r$24 = _r$24.$blk(); } if (_r$24 && _r$24.$blk !== undefined) { break s; } _r$24; _r$25 = unexpectedMessageError(certMsg$1, msg); /* */ $s = 38; case 38: if($c) { $c = false; _r$25 = _r$25.$blk(); } if (_r$25 && _r$25.$blk !== undefined) { break s; } $24r = _r$25; $s = 39; case 39: return $24r; /* } */ case 36: _r$26 = hs.finishedHash.Write(certMsg$1.marshal()); /* */ $s = 40; case 40: if($c) { $c = false; _r$26 = _r$26.$blk(); } if (_r$26 && _r$26.$blk !== undefined) { break s; } _r$26; _r$27 = c.processCertsFromClient(new Certificate.ptr(certMsg$1.certificates, $ifaceNil, sliceType$7.nil, sliceType$5.nil, sliceType$11.nil, ptrType$5.nil)); /* */ $s = 41; case 41: if($c) { $c = false; _r$27 = _r$27.$blk(); } if (_r$27 && _r$27.$blk !== undefined) { break s; } err$8 = _r$27; if (!($interfaceIsEqual(err$8, $ifaceNil))) { $s = -1; return err$8; } if (!((certMsg$1.certificates.$length === 0))) { pub = (x = c.peerCertificates, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])).PublicKey; } _r$28 = c.readHandshake(); /* */ $s = 42; case 42: if($c) { $c = false; _r$28 = _r$28.$blk(); } if (_r$28 && _r$28.$blk !== undefined) { break s; } _tuple$10 = _r$28; msg = _tuple$10[0]; err$3 = _tuple$10[1]; if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = -1; return err$3; } /* } */ case 34: /* */ if (!(c.config.VerifyConnection === $throwNilPointerError)) { $s = 43; continue; } /* */ $s = 44; continue; /* if (!(c.config.VerifyConnection === $throwNilPointerError)) { */ case 43: _r$29 = c.config.VerifyConnection($clone(c.connectionStateLocked(), ConnectionState)); /* */ $s = 45; case 45: if($c) { $c = false; _r$29 = _r$29.$blk(); } if (_r$29 && _r$29.$blk !== undefined) { break s; } err$9 = _r$29; /* */ if (!($interfaceIsEqual(err$9, $ifaceNil))) { $s = 46; continue; } /* */ $s = 47; continue; /* if (!($interfaceIsEqual(err$9, $ifaceNil))) { */ case 46: _r$30 = c.sendAlert(42); /* */ $s = 48; case 48: if($c) { $c = false; _r$30 = _r$30.$blk(); } if (_r$30 && _r$30.$blk !== undefined) { break s; } _r$30; $s = -1; return err$9; /* } */ case 47: /* } */ case 44: _tuple$11 = $assertType(msg, ptrType$23, true); ckx = _tuple$11[0]; ok$1 = _tuple$11[1]; /* */ if (!ok$1) { $s = 49; continue; } /* */ $s = 50; continue; /* if (!ok$1) { */ case 49: _r$31 = c.sendAlert(10); /* */ $s = 51; case 51: if($c) { $c = false; _r$31 = _r$31.$blk(); } if (_r$31 && _r$31.$blk !== undefined) { break s; } _r$31; _r$32 = unexpectedMessageError(ckx, msg); /* */ $s = 52; case 52: if($c) { $c = false; _r$32 = _r$32.$blk(); } if (_r$32 && _r$32.$blk !== undefined) { break s; } $24r$1 = _r$32; $s = 53; case 53: return $24r$1; /* } */ case 50: _r$33 = hs.finishedHash.Write(ckx.marshal()); /* */ $s = 54; case 54: if($c) { $c = false; _r$33 = _r$33.$blk(); } if (_r$33 && _r$33.$blk !== undefined) { break s; } _r$33; _r$34 = keyAgreement$1.processClientKeyExchange(c.config, hs.cert, ckx, c.vers); /* */ $s = 55; case 55: if($c) { $c = false; _r$34 = _r$34.$blk(); } if (_r$34 && _r$34.$blk !== undefined) { break s; } _tuple$12 = _r$34; preMasterSecret = _tuple$12[0]; err$3 = _tuple$12[1]; /* */ if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = 56; continue; } /* */ $s = 57; continue; /* if (!($interfaceIsEqual(err$3, $ifaceNil))) { */ case 56: _r$35 = c.sendAlert(40); /* */ $s = 58; case 58: if($c) { $c = false; _r$35 = _r$35.$blk(); } if (_r$35 && _r$35.$blk !== undefined) { break s; } _r$35; $s = -1; return err$3; /* } */ case 57: _r$36 = masterFromPreMasterSecret(c.vers, hs.suite, preMasterSecret, hs.clientHello.random, hs.hello.random); /* */ $s = 59; case 59: if($c) { $c = false; _r$36 = _r$36.$blk(); } if (_r$36 && _r$36.$blk !== undefined) { break s; } hs.masterSecret = _r$36; _r$37 = c.config.writeKeyLog("CLIENT_RANDOM", hs.clientHello.random, hs.masterSecret); /* */ $s = 60; case 60: if($c) { $c = false; _r$37 = _r$37.$blk(); } if (_r$37 && _r$37.$blk !== undefined) { break s; } err$10 = _r$37; /* */ if (!($interfaceIsEqual(err$10, $ifaceNil))) { $s = 61; continue; } /* */ $s = 62; continue; /* if (!($interfaceIsEqual(err$10, $ifaceNil))) { */ case 61: _r$38 = c.sendAlert(80); /* */ $s = 63; case 63: if($c) { $c = false; _r$38 = _r$38.$blk(); } if (_r$38 && _r$38.$blk !== undefined) { break s; } _r$38; $s = -1; return err$10; /* } */ case 62: /* */ if (c.peerCertificates.$length > 0) { $s = 64; continue; } /* */ $s = 65; continue; /* if (c.peerCertificates.$length > 0) { */ case 64: _r$39 = c.readHandshake(); /* */ $s = 66; case 66: if($c) { $c = false; _r$39 = _r$39.$blk(); } if (_r$39 && _r$39.$blk !== undefined) { break s; } _tuple$13 = _r$39; msg = _tuple$13[0]; err$3 = _tuple$13[1]; if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = -1; return err$3; } _tuple$14 = $assertType(msg, ptrType$28, true); certVerify = _tuple$14[0]; ok$2 = _tuple$14[1]; /* */ if (!ok$2) { $s = 67; continue; } /* */ $s = 68; continue; /* if (!ok$2) { */ case 67: _r$40 = c.sendAlert(10); /* */ $s = 69; case 69: if($c) { $c = false; _r$40 = _r$40.$blk(); } if (_r$40 && _r$40.$blk !== undefined) { break s; } _r$40; _r$41 = unexpectedMessageError(certVerify, msg); /* */ $s = 70; case 70: if($c) { $c = false; _r$41 = _r$41.$blk(); } if (_r$41 && _r$41.$blk !== undefined) { break s; } $24r$2 = _r$41; $s = 71; case 71: return $24r$2; /* } */ case 68: sigType = 0; sigHash = 0; /* */ if (c.vers >= 771) { $s = 72; continue; } /* */ $s = 73; continue; /* if (c.vers >= 771) { */ case 72: /* */ if (!isSupportedSignatureAlgorithm(certVerify.signatureAlgorithm, certReq.supportedSignatureAlgorithms)) { $s = 75; continue; } /* */ $s = 76; continue; /* if (!isSupportedSignatureAlgorithm(certVerify.signatureAlgorithm, certReq.supportedSignatureAlgorithms)) { */ case 75: _r$42 = c.sendAlert(47); /* */ $s = 77; case 77: if($c) { $c = false; _r$42 = _r$42.$blk(); } if (_r$42 && _r$42.$blk !== undefined) { break s; } _r$42; $s = -1; return errors.New("tls: client certificate used with invalid signature algorithm"); /* } */ case 76: _r$43 = typeAndHashFromSignatureScheme(certVerify.signatureAlgorithm); /* */ $s = 78; case 78: if($c) { $c = false; _r$43 = _r$43.$blk(); } if (_r$43 && _r$43.$blk !== undefined) { break s; } _tuple$15 = _r$43; sigType = _tuple$15[0]; sigHash = _tuple$15[1]; err$3 = _tuple$15[2]; /* */ if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = 79; continue; } /* */ $s = 80; continue; /* if (!($interfaceIsEqual(err$3, $ifaceNil))) { */ case 79: _r$44 = c.sendAlert(80); /* */ $s = 81; case 81: if($c) { $c = false; _r$44 = _r$44.$blk(); } if (_r$44 && _r$44.$blk !== undefined) { break s; } $24r$3 = _r$44; $s = 82; case 82: return $24r$3; /* } */ case 80: $s = 74; continue; /* } else { */ case 73: _r$45 = legacyTypeAndHashFromPublicKey(pub); /* */ $s = 83; case 83: if($c) { $c = false; _r$45 = _r$45.$blk(); } if (_r$45 && _r$45.$blk !== undefined) { break s; } _tuple$16 = _r$45; sigType = _tuple$16[0]; sigHash = _tuple$16[1]; err$3 = _tuple$16[2]; /* */ if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = 84; continue; } /* */ $s = 85; continue; /* if (!($interfaceIsEqual(err$3, $ifaceNil))) { */ case 84: _r$46 = c.sendAlert(47); /* */ $s = 86; case 86: if($c) { $c = false; _r$46 = _r$46.$blk(); } if (_r$46 && _r$46.$blk !== undefined) { break s; } _r$46; $s = -1; return err$3; /* } */ case 85: /* } */ case 74: _r$47 = $clone(hs.finishedHash, finishedHash).hashForClientCertificate(sigType, sigHash, hs.masterSecret); /* */ $s = 87; case 87: if($c) { $c = false; _r$47 = _r$47.$blk(); } if (_r$47 && _r$47.$blk !== undefined) { break s; } signed = _r$47; _r$48 = verifyHandshakeSignature(sigType, pub, sigHash, signed, certVerify.signature); /* */ $s = 88; case 88: if($c) { $c = false; _r$48 = _r$48.$blk(); } if (_r$48 && _r$48.$blk !== undefined) { break s; } err$11 = _r$48; /* */ if (!($interfaceIsEqual(err$11, $ifaceNil))) { $s = 89; continue; } /* */ $s = 90; continue; /* if (!($interfaceIsEqual(err$11, $ifaceNil))) { */ case 89: _r$49 = c.sendAlert(51); /* */ $s = 91; case 91: if($c) { $c = false; _r$49 = _r$49.$blk(); } if (_r$49 && _r$49.$blk !== undefined) { break s; } _r$49; _r$50 = err$11.Error(); /* */ $s = 92; case 92: if($c) { $c = false; _r$50 = _r$50.$blk(); } if (_r$50 && _r$50.$blk !== undefined) { break s; } _r$51 = errors.New("tls: invalid signature by the client certificate: " + _r$50); /* */ $s = 93; case 93: if($c) { $c = false; _r$51 = _r$51.$blk(); } if (_r$51 && _r$51.$blk !== undefined) { break s; } $24r$4 = _r$51; $s = 94; case 94: return $24r$4; /* } */ case 90: _r$52 = certVerify.marshal(); /* */ $s = 95; case 95: if($c) { $c = false; _r$52 = _r$52.$blk(); } if (_r$52 && _r$52.$blk !== undefined) { break s; } _r$53 = hs.finishedHash.Write(_r$52); /* */ $s = 96; case 96: if($c) { $c = false; _r$53 = _r$53.$blk(); } if (_r$53 && _r$53.$blk !== undefined) { break s; } _r$53; /* } */ case 65: hs.finishedHash.discardHandshakeBuffer(); $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: serverHandshakeState.ptr.prototype.doFullHandshake }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f._arg = _arg; $f._arg$1 = _arg$1; $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$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$36 = _r$36; $f._r$37 = _r$37; $f._r$38 = _r$38; $f._r$39 = _r$39; $f._r$4 = _r$4; $f._r$40 = _r$40; $f._r$41 = _r$41; $f._r$42 = _r$42; $f._r$43 = _r$43; $f._r$44 = _r$44; $f._r$45 = _r$45; $f._r$46 = _r$46; $f._r$47 = _r$47; $f._r$48 = _r$48; $f._r$49 = _r$49; $f._r$5 = _r$5; $f._r$50 = _r$50; $f._r$51 = _r$51; $f._r$52 = _r$52; $f._r$53 = _r$53; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f._tuple = _tuple; $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$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._tuple$9 = _tuple$9; $f.c = c; $f.certMsg = certMsg; $f.certMsg$1 = certMsg$1; $f.certReq = certReq; $f.certStatus = certStatus; $f.certVerify = certVerify; $f.ckx = ckx; $f.err = err; $f.err$1 = err$1; $f.err$10 = err$10; $f.err$11 = err$11; $f.err$2 = err$2; $f.err$3 = err$3; $f.err$4 = err$4; $f.err$5 = err$5; $f.err$6 = err$6; $f.err$7 = err$7; $f.err$8 = err$8; $f.err$9 = err$9; $f.helloDone = helloDone; $f.hs = hs; $f.keyAgreement$1 = keyAgreement$1; $f.msg = msg; $f.ok = ok; $f.ok$1 = ok$1; $f.ok$2 = ok$2; $f.preMasterSecret = preMasterSecret; $f.pub = pub; $f.sigHash = sigHash; $f.sigType = sigType; $f.signed = signed; $f.skx = skx; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; serverHandshakeState.prototype.doFullHandshake = function() { return this.$val.doFullHandshake(); }; serverHandshakeState.ptr.prototype.establishKeys = function() { var _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, c, clientCipher, clientHash, clientIV, clientKey, clientMAC, hs, serverCipher, serverHash, serverIV, serverKey, serverMAC, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; c = $f.c; clientCipher = $f.clientCipher; clientHash = $f.clientHash; clientIV = $f.clientIV; clientKey = $f.clientKey; clientMAC = $f.clientMAC; hs = $f.hs; serverCipher = $f.serverCipher; serverHash = $f.serverHash; serverIV = $f.serverIV; serverKey = $f.serverKey; serverMAC = $f.serverMAC; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; _r = keysFromMasterSecret(c.vers, hs.suite, hs.masterSecret, hs.clientHello.random, hs.hello.random, hs.suite.macLen, hs.suite.keyLen, hs.suite.ivLen); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; clientMAC = _tuple[0]; serverMAC = _tuple[1]; clientKey = _tuple[2]; serverKey = _tuple[3]; clientIV = _tuple[4]; serverIV = _tuple[5]; _tmp = $ifaceNil; _tmp$1 = $ifaceNil; clientCipher = _tmp; serverCipher = _tmp$1; _tmp$2 = $ifaceNil; _tmp$3 = $ifaceNil; clientHash = _tmp$2; serverHash = _tmp$3; /* */ if (hs.suite.aead === $throwNilPointerError) { $s = 2; continue; } /* */ $s = 3; continue; /* if (hs.suite.aead === $throwNilPointerError) { */ case 2: _r$1 = hs.suite.cipher(clientKey, clientIV, true); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } clientCipher = _r$1; _r$2 = hs.suite.mac(clientMAC); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } clientHash = _r$2; _r$3 = hs.suite.cipher(serverKey, serverIV, false); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } serverCipher = _r$3; _r$4 = hs.suite.mac(serverMAC); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } serverHash = _r$4; $s = 4; continue; /* } else { */ case 3: _r$5 = hs.suite.aead(clientKey, clientIV); /* */ $s = 9; case 9: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } clientCipher = _r$5; _r$6 = hs.suite.aead(serverKey, serverIV); /* */ $s = 10; case 10: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } serverCipher = _r$6; /* } */ case 4: c.in$27.prepareCipherSpec(c.vers, clientCipher, clientHash); c.out.prepareCipherSpec(c.vers, serverCipher, serverHash); $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: serverHandshakeState.ptr.prototype.establishKeys }; } $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._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f.c = c; $f.clientCipher = clientCipher; $f.clientHash = clientHash; $f.clientIV = clientIV; $f.clientKey = clientKey; $f.clientMAC = clientMAC; $f.hs = hs; $f.serverCipher = serverCipher; $f.serverHash = serverHash; $f.serverIV = serverIV; $f.serverKey = serverKey; $f.serverMAC = serverMAC; $f.$s = $s; $f.$r = $r; return $f; }; serverHandshakeState.prototype.establishKeys = function() { return this.$val.establishKeys(); }; serverHandshakeState.ptr.prototype.readFinished = function(out) { var $24r, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _tuple, _tuple$1, c, clientFinished, err, err$1, hs, msg, ok, out, verify, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; c = $f.c; clientFinished = $f.clientFinished; err = $f.err; err$1 = $f.err$1; hs = $f.hs; msg = $f.msg; ok = $f.ok; out = $f.out; verify = $f.verify; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; _r = c.readChangeCipherSpec(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _r$1 = c.readHandshake(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; msg = _tuple[0]; err$1 = _tuple[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } _tuple$1 = $assertType(msg, ptrType$29, true); clientFinished = _tuple$1[0]; ok = _tuple$1[1]; /* */ if (!ok) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!ok) { */ case 3: _r$2 = c.sendAlert(10); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; _r$3 = unexpectedMessageError(clientFinished, msg); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = _r$3; $s = 7; case 7: return $24r; /* } */ case 4: _r$4 = $clone(hs.finishedHash, finishedHash).clientSum(hs.masterSecret); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } verify = _r$4; /* */ if (!((verify.$length === clientFinished.verifyData.$length)) || !((subtle.ConstantTimeCompare(verify, clientFinished.verifyData) === 1))) { $s = 9; continue; } /* */ $s = 10; continue; /* if (!((verify.$length === clientFinished.verifyData.$length)) || !((subtle.ConstantTimeCompare(verify, clientFinished.verifyData) === 1))) { */ case 9: _r$5 = c.sendAlert(40); /* */ $s = 11; case 11: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; $s = -1; return errors.New("tls: client's Finished message is incorrect"); /* } */ case 10: _r$6 = clientFinished.marshal(); /* */ $s = 12; case 12: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$7 = hs.finishedHash.Write(_r$6); /* */ $s = 13; case 13: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$7; $copySlice(out, verify); $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: serverHandshakeState.ptr.prototype.readFinished }; } $f.$24r = $24r; $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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.c = c; $f.clientFinished = clientFinished; $f.err = err; $f.err$1 = err$1; $f.hs = hs; $f.msg = msg; $f.ok = ok; $f.out = out; $f.verify = verify; $f.$s = $s; $f.$r = $r; return $f; }; serverHandshakeState.prototype.readFinished = function(out) { return this.$val.readFinished(out); }; serverHandshakeState.ptr.prototype.sendSessionTicket = function() { var _i, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _ref, _tuple, _tuple$1, c, cert, certsFromClient, createdAt, err, err$1, hs, m, state, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; c = $f.c; cert = $f.cert; certsFromClient = $f.certsFromClient; createdAt = $f.createdAt; err = $f.err; err$1 = $f.err$1; hs = $f.hs; m = $f.m; state = $f.state; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; if (!hs.hello.ticketSupported) { $s = -1; return $ifaceNil; } c = hs.c; m = new newSessionTicketMsg.ptr(sliceType$5.nil, sliceType$5.nil); _r = c.config.time(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = $clone(_r, time.Time).Unix(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } createdAt = ((x = _r$1, new $Uint64(x.$high, x.$low))); if (!(hs.sessionState === ptrType$32.nil)) { createdAt = hs.sessionState.createdAt; } certsFromClient = sliceType$11.nil; _ref = c.peerCertificates; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } cert = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); certsFromClient = $append(certsFromClient, cert.Raw); _i++; } state = new sessionState.ptr(c.vers, hs.suite.id, createdAt, hs.masterSecret, certsFromClient, false); err = $ifaceNil; _r$2 = state.marshal(); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = c.encryptTicket(_r$2); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; m.ticket = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _r$4 = hs.finishedHash.Write(m.marshal()); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; _r$5 = c.writeRecord(22, m.marshal()); /* */ $s = 6; case 6: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$1 = _r$5; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: serverHandshakeState.ptr.prototype.sendSessionTicket }; } $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._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.c = c; $f.cert = cert; $f.certsFromClient = certsFromClient; $f.createdAt = createdAt; $f.err = err; $f.err$1 = err$1; $f.hs = hs; $f.m = m; $f.state = state; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; serverHandshakeState.prototype.sendSessionTicket = function() { return this.$val.sendSessionTicket(); }; serverHandshakeState.ptr.prototype.sendFinished = function(out) { var _arg, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, _tuple$1, c, err, err$1, finished, hs, out, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; c = $f.c; err = $f.err; err$1 = $f.err$1; finished = $f.finished; hs = $f.hs; out = $f.out; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; _r = c.writeRecord(20, new sliceType$5([1])); /* */ $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))) { $s = -1; return err; } finished = new finishedMsg.ptr(sliceType$5.nil, sliceType$5.nil); _r$1 = $clone(hs.finishedHash, finishedHash).serverSum(hs.masterSecret); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } finished.verifyData = _r$1; _r$2 = finished.marshal(); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = hs.finishedHash.Write(_r$2); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _r$4 = finished.marshal(); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _arg = _r$4; _r$5 = c.writeRecord(22, _arg); /* */ $s = 6; case 6: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$1 = _r$5; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } $copySlice(out, finished.verifyData); $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: serverHandshakeState.ptr.prototype.sendFinished }; } $f._arg = _arg; $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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.c = c; $f.err = err; $f.err$1 = err$1; $f.finished = finished; $f.hs = hs; $f.out = out; $f.$s = $s; $f.$r = $r; return $f; }; serverHandshakeState.prototype.sendFinished = function(out) { return this.$val.sendFinished(out); }; Conn.ptr.prototype.processCertsFromClient = function(certificate) { var $24r, $24r$1, $24r$2, _i, _i$1, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _ref$1, _ref$2, _tuple, _tuple$1, asn1Data, c, cert, certificate, certificates, certs, chains, err, err$1, err$2, i, opts, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _i = $f._i; _i$1 = $f._i$1; _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$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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; asn1Data = $f.asn1Data; c = $f.c; cert = $f.cert; certificate = $f.certificate; certificates = $f.certificates; certs = $f.certs; chains = $f.chains; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; i = $f.i; opts = $f.opts; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; certificates = certificate.Certificate; certs = $makeSlice(sliceType$12, certificates.$length); err = $ifaceNil; _ref = certificates; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } i = _i; asn1Data = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r = x509.ParseCertificate(asn1Data); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; ((i < 0 || i >= certs.$length) ? ($throwRuntimeError("index out of range"), undefined) : certs.$array[certs.$offset + i] = _tuple[0]); err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 4: _r$1 = c.sendAlert(42); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _r$2 = err.Error(); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = errors.New("tls: failed to parse client certificate: " + _r$2); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = _r$3; $s = 9; case 9: return $24r; /* } */ case 5: _i++; $s = 1; continue; case 2: /* */ if ((certs.$length === 0) && requiresClientCert(c.config.ClientAuth)) { $s = 10; continue; } /* */ $s = 11; continue; /* if ((certs.$length === 0) && requiresClientCert(c.config.ClientAuth)) { */ case 10: _r$4 = c.sendAlert(42); /* */ $s = 12; case 12: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; $s = -1; return errors.New("tls: client didn't provide a certificate"); /* } */ case 11: /* */ if (c.config.ClientAuth >= 3 && certs.$length > 0) { $s = 13; continue; } /* */ $s = 14; continue; /* if (c.config.ClientAuth >= 3 && certs.$length > 0) { */ case 13: _r$5 = c.config.time(); /* */ $s = 15; case 15: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } opts = new x509.VerifyOptions.ptr("", x509.NewCertPool(), c.config.ClientCAs, $clone(_r$5, time.Time), new sliceType$14([2]), 0); _ref$1 = $subslice(certs, 1); _i$1 = 0; /* while (true) { */ case 16: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 17; continue; } cert = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); $r = opts.Intermediates.AddCert(cert); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i$1++; $s = 16; continue; case 17: _r$6 = (0 >= certs.$length ? ($throwRuntimeError("index out of range"), undefined) : certs.$array[certs.$offset + 0]).Verify($clone(opts, x509.VerifyOptions)); /* */ $s = 19; case 19: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tuple$1 = _r$6; chains = _tuple$1[0]; err$1 = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 20; continue; } /* */ $s = 21; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 20: _r$7 = c.sendAlert(42); /* */ $s = 22; case 22: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$7; _r$8 = err$1.Error(); /* */ $s = 23; case 23: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$9 = errors.New("tls: failed to verify client certificate: " + _r$8); /* */ $s = 24; case 24: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $24r$1 = _r$9; $s = 25; case 25: return $24r$1; /* } */ case 21: c.verifiedChains = chains; /* } */ case 14: c.peerCertificates = certs; c.ocspResponse = certificate.OCSPStaple; c.scts = certificate.SignedCertificateTimestamps; /* */ if (certs.$length > 0) { $s = 26; continue; } /* */ $s = 27; continue; /* if (certs.$length > 0) { */ case 26: _ref$2 = (0 >= certs.$length ? ($throwRuntimeError("index out of range"), undefined) : certs.$array[certs.$offset + 0]).PublicKey; /* */ if ($assertType(_ref$2, ptrType$12, true)[1] || $assertType(_ref$2, ptrType$11, true)[1] || $assertType(_ref$2, ed25519.PublicKey, true)[1]) { $s = 28; continue; } /* */ $s = 29; continue; /* if ($assertType(_ref$2, ptrType$12, true)[1] || $assertType(_ref$2, ptrType$11, true)[1] || $assertType(_ref$2, ed25519.PublicKey, true)[1]) { */ case 28: $s = 30; continue; /* } else { */ case 29: _r$10 = c.sendAlert(43); /* */ $s = 31; case 31: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; _r$11 = fmt.Errorf("tls: client certificate contains an unsupported public key of type %T", new sliceType$6([(0 >= certs.$length ? ($throwRuntimeError("index out of range"), undefined) : certs.$array[certs.$offset + 0]).PublicKey])); /* */ $s = 32; case 32: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } $24r$2 = _r$11; $s = 33; case 33: return $24r$2; /* } */ case 30: /* } */ case 27: /* */ if (!(c.config.VerifyPeerCertificate === $throwNilPointerError)) { $s = 34; continue; } /* */ $s = 35; continue; /* if (!(c.config.VerifyPeerCertificate === $throwNilPointerError)) { */ case 34: _r$12 = c.config.VerifyPeerCertificate(certificates, c.verifiedChains); /* */ $s = 36; case 36: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } err$2 = _r$12; /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 37; continue; } /* */ $s = 38; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 37: _r$13 = c.sendAlert(42); /* */ $s = 39; case 39: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _r$13; $s = -1; return err$2; /* } */ case 38: /* } */ case 35: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.processCertsFromClient }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._i = _i; $f._i$1 = _i$1; $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$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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.asn1Data = asn1Data; $f.c = c; $f.cert = cert; $f.certificate = certificate; $f.certificates = certificates; $f.certs = certs; $f.chains = chains; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.i = i; $f.opts = opts; $f.$s = $s; $f.$r = $r; return $f; }; Conn.prototype.processCertsFromClient = function(certificate) { return this.$val.processCertsFromClient(certificate); }; clientHelloInfo = function(ctx, c, clientHello) { var c, clientHello, ctx, supportedVersions$1; supportedVersions$1 = clientHello.supportedVersions; if (clientHello.supportedVersions.$length === 0) { supportedVersions$1 = supportedVersionsFromMax(clientHello.vers); } return new ClientHelloInfo.ptr(clientHello.cipherSuites, clientHello.serverName, clientHello.supportedCurves, clientHello.supportedPoints, clientHello.supportedSignatureAlgorithms, clientHello.alpnProtocols, supportedVersions$1, c.conn, c.config, ctx); }; marshalingFunction.prototype.Marshal = function(b) { var $24r, _r, b, f, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; b = $f.b; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this.$val; _r = f(b); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: marshalingFunction.prototype.Marshal }; } $f.$24r = $24r; $f._r = _r; $f.b = b; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(marshalingFunction).prototype.Marshal = function(b) { return new marshalingFunction(this.$get()).Marshal(b); }; addBytesWithLength = function(b, v, n) { var b, n, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; n = $f.n; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = [n]; v = [v]; $r = b.AddValue(new marshalingFunction(((function(n, v) { return function $b(b$1) { var $24r, _r, b$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; b$1 = $f.b$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (!((v[0].$length === n[0]))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((v[0].$length === n[0]))) { */ case 1: _r = fmt.Errorf("invalid value length: expected %d, got %d", new sliceType$6([new $Int(n[0]), new $Int(v[0].$length)])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 4; case 4: return $24r; /* } */ case 2: b$1.AddBytes(v[0]); $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$24r = $24r; $f._r = _r; $f.b$1 = b$1; $f.$s = $s; $f.$r = $r; return $f; }; })(n, v)))); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: addBytesWithLength }; } $f.b = b; $f.n = n; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; addUint64 = function(b, v) { var b, v; b.AddUint32((($shiftRightUint64(v, 32).$low >>> 0))); b.AddUint32(((v.$low >>> 0))); }; readUint64 = function(s, out) { var _tmp, _tmp$1, hi, hi$24ptr, lo, lo$24ptr, out, s, x, x$1; _tmp = 0; _tmp$1 = 0; hi = _tmp; lo = _tmp$1; if (!s.ReadUint32((hi$24ptr || (hi$24ptr = new ptrType$24(function() { return hi; }, function($v) { hi = $v; })))) || !s.ReadUint32((lo$24ptr || (lo$24ptr = new ptrType$24(function() { return lo; }, function($v) { lo = $v; }))))) { return false; } out.$set((x = $shiftLeft64((new $Uint64(0, hi)), 32), x$1 = (new $Uint64(0, lo)), new $Uint64(x.$high | x$1.$high, (x.$low | x$1.$low) >>> 0))); return true; }; readUint8LengthPrefixed = function(s, out) { var _ptr, out, s; return s.ReadUint8LengthPrefixed(((_ptr = out, new ptrType$17(function() { return $convertSliceType(_ptr.$get(), cryptobyte.String); }, function($v) { _ptr.$set($convertSliceType($v, sliceType$5)); }, _ptr.$target)))); }; readUint16LengthPrefixed = function(s, out) { var _ptr, out, s; return s.ReadUint16LengthPrefixed(((_ptr = out, new ptrType$17(function() { return $convertSliceType(_ptr.$get(), cryptobyte.String); }, function($v) { _ptr.$set($convertSliceType($v, sliceType$5)); }, _ptr.$target)))); }; readUint24LengthPrefixed = function(s, out) { var _ptr, out, s; return s.ReadUint24LengthPrefixed(((_ptr = out, new ptrType$17(function() { return $convertSliceType(_ptr.$get(), cryptobyte.String); }, function($v) { _ptr.$set($convertSliceType($v, sliceType$5)); }, _ptr.$target)))); }; clientHelloMsg.ptr.prototype.marshal = function() { var b, m, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; m = $f.m; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: m = [m]; m[0] = this; if (!(m[0].raw === sliceType$5.nil)) { $s = -1; return m[0].raw; } b = new cryptobyte.Builder.ptr($ifaceNil, sliceType$5.nil, false, ptrType$15.nil, 0, 0, false, ptrType$16.nil); b.AddUint8(1); $r = b.AddUint24LengthPrefixed((function(m) { return function $b(b$1) { var b$1, bWithoutExtensions, extensionsPresent, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$1 = $f.b$1; bWithoutExtensions = $f.bWithoutExtensions; extensionsPresent = $f.extensionsPresent; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: extensionsPresent = [extensionsPresent]; b$1.AddUint16(m[0].vers); $r = addBytesWithLength(b$1, m[0].random, 32); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = b$1.AddUint8LengthPrefixed((function(extensionsPresent, m) { return function(b$2) { var b$2; b$2.AddBytes(m[0].sessionId); }; })(extensionsPresent, m)); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = b$1.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function(b$2) { var _i, _ref, b$2, suite; _ref = m[0].cipherSuites; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } suite = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); b$2.AddUint16(suite); _i++; } }; })(extensionsPresent, m)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = b$1.AddUint8LengthPrefixed((function(extensionsPresent, m) { return function(b$2) { var b$2; b$2.AddBytes(m[0].compressionMethods); }; })(extensionsPresent, m)); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } extensionsPresent[0] = false; bWithoutExtensions = $clone(b$1, cryptobyte.Builder); $r = b$1.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function $b(b$2) { var b$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$2 = $f.b$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (m[0].serverName.length > 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (m[0].serverName.length > 0) { */ case 1: b$2.AddUint16(0); $r = b$2.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function $b(b$3) { var b$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$3 = $f.b$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = b$3.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function $b(b$4) { var b$4, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$4 = $f.b$4; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b$4.AddUint8(0); $r = b$4.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function(b$5) { var b$5; b$5.AddBytes((new sliceType$5($stringToBytes(m[0].serverName)))); }; })(extensionsPresent, m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$4 = b$4; $f.$s = $s; $f.$r = $r; return $f; }; })(extensionsPresent, m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$3 = b$3; $f.$s = $s; $f.$r = $r; return $f; }; })(extensionsPresent, m)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: /* */ if (m[0].ocspStapling) { $s = 4; continue; } /* */ $s = 5; continue; /* if (m[0].ocspStapling) { */ case 4: b$2.AddUint16(5); $r = b$2.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function(b$3) { var b$3; b$3.AddUint8(1); b$3.AddUint16(0); b$3.AddUint16(0); }; })(extensionsPresent, m)); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: /* */ if (m[0].supportedCurves.$length > 0) { $s = 7; continue; } /* */ $s = 8; continue; /* if (m[0].supportedCurves.$length > 0) { */ case 7: b$2.AddUint16(10); $r = b$2.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function $b(b$3) { var b$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$3 = $f.b$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = b$3.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function(b$4) { var _i, _ref, b$4, curve; _ref = m[0].supportedCurves; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } curve = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); b$4.AddUint16(((curve << 16 >>> 16))); _i++; } }; })(extensionsPresent, m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$3 = b$3; $f.$s = $s; $f.$r = $r; return $f; }; })(extensionsPresent, m)); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 8: /* */ if (m[0].supportedPoints.$length > 0) { $s = 10; continue; } /* */ $s = 11; continue; /* if (m[0].supportedPoints.$length > 0) { */ case 10: b$2.AddUint16(11); $r = b$2.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function $b(b$3) { var b$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$3 = $f.b$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = b$3.AddUint8LengthPrefixed((function(extensionsPresent, m) { return function(b$4) { var b$4; b$4.AddBytes(m[0].supportedPoints); }; })(extensionsPresent, m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$3 = b$3; $f.$s = $s; $f.$r = $r; return $f; }; })(extensionsPresent, m)); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 11: /* */ if (m[0].ticketSupported) { $s = 13; continue; } /* */ $s = 14; continue; /* if (m[0].ticketSupported) { */ case 13: b$2.AddUint16(35); $r = b$2.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function(b$3) { var b$3; b$3.AddBytes(m[0].sessionTicket); }; })(extensionsPresent, m)); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 14: /* */ if (m[0].supportedSignatureAlgorithms.$length > 0) { $s = 16; continue; } /* */ $s = 17; continue; /* if (m[0].supportedSignatureAlgorithms.$length > 0) { */ case 16: b$2.AddUint16(13); $r = b$2.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function $b(b$3) { var b$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$3 = $f.b$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = b$3.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function(b$4) { var _i, _ref, b$4, sigAlgo; _ref = m[0].supportedSignatureAlgorithms; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } sigAlgo = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); b$4.AddUint16(((sigAlgo << 16 >>> 16))); _i++; } }; })(extensionsPresent, m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$3 = b$3; $f.$s = $s; $f.$r = $r; return $f; }; })(extensionsPresent, m)); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 17: /* */ if (m[0].supportedSignatureAlgorithmsCert.$length > 0) { $s = 19; continue; } /* */ $s = 20; continue; /* if (m[0].supportedSignatureAlgorithmsCert.$length > 0) { */ case 19: b$2.AddUint16(50); $r = b$2.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function $b(b$3) { var b$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$3 = $f.b$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = b$3.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function(b$4) { var _i, _ref, b$4, sigAlgo; _ref = m[0].supportedSignatureAlgorithmsCert; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } sigAlgo = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); b$4.AddUint16(((sigAlgo << 16 >>> 16))); _i++; } }; })(extensionsPresent, m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$3 = b$3; $f.$s = $s; $f.$r = $r; return $f; }; })(extensionsPresent, m)); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 20: /* */ if (m[0].secureRenegotiationSupported) { $s = 22; continue; } /* */ $s = 23; continue; /* if (m[0].secureRenegotiationSupported) { */ case 22: b$2.AddUint16(65281); $r = b$2.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function $b(b$3) { var b$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$3 = $f.b$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = b$3.AddUint8LengthPrefixed((function(extensionsPresent, m) { return function(b$4) { var b$4; b$4.AddBytes(m[0].secureRenegotiation); }; })(extensionsPresent, m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$3 = b$3; $f.$s = $s; $f.$r = $r; return $f; }; })(extensionsPresent, m)); /* */ $s = 24; case 24: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 23: /* */ if (m[0].alpnProtocols.$length > 0) { $s = 25; continue; } /* */ $s = 26; continue; /* if (m[0].alpnProtocols.$length > 0) { */ case 25: b$2.AddUint16(16); $r = b$2.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function $b(b$3) { var b$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$3 = $f.b$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = b$3.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function $b(b$4) { var _i, _ref, b$4, proto, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _ref = $f._ref; b$4 = $f.b$4; proto = $f.proto; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: proto = [proto]; _ref = m[0].alpnProtocols; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } proto[0] = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); $r = b$4.AddUint8LengthPrefixed((function(extensionsPresent, m, proto) { return function(b$5) { var b$5; b$5.AddBytes((new sliceType$5($stringToBytes(proto[0])))); }; })(extensionsPresent, m, proto)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i++; $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._i = _i; $f._ref = _ref; $f.b$4 = b$4; $f.proto = proto; $f.$s = $s; $f.$r = $r; return $f; }; })(extensionsPresent, m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$3 = b$3; $f.$s = $s; $f.$r = $r; return $f; }; })(extensionsPresent, m)); /* */ $s = 27; case 27: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 26: if (m[0].scts) { b$2.AddUint16(18); b$2.AddUint16(0); } /* */ if (m[0].supportedVersions.$length > 0) { $s = 28; continue; } /* */ $s = 29; continue; /* if (m[0].supportedVersions.$length > 0) { */ case 28: b$2.AddUint16(43); $r = b$2.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function $b(b$3) { var b$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$3 = $f.b$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = b$3.AddUint8LengthPrefixed((function(extensionsPresent, m) { return function(b$4) { var _i, _ref, b$4, vers; _ref = m[0].supportedVersions; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } vers = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); b$4.AddUint16(vers); _i++; } }; })(extensionsPresent, m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$3 = b$3; $f.$s = $s; $f.$r = $r; return $f; }; })(extensionsPresent, m)); /* */ $s = 30; case 30: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 29: /* */ if (m[0].cookie.$length > 0) { $s = 31; continue; } /* */ $s = 32; continue; /* if (m[0].cookie.$length > 0) { */ case 31: b$2.AddUint16(44); $r = b$2.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function $b(b$3) { var b$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$3 = $f.b$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = b$3.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function(b$4) { var b$4; b$4.AddBytes(m[0].cookie); }; })(extensionsPresent, m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$3 = b$3; $f.$s = $s; $f.$r = $r; return $f; }; })(extensionsPresent, m)); /* */ $s = 33; case 33: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 32: /* */ if (m[0].keyShares.$length > 0) { $s = 34; continue; } /* */ $s = 35; continue; /* if (m[0].keyShares.$length > 0) { */ case 34: b$2.AddUint16(51); $r = b$2.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function $b(b$3) { var b$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$3 = $f.b$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = b$3.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function $b(b$4) { var _i, _ref, b$4, ks, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _ref = $f._ref; b$4 = $f.b$4; ks = $f.ks; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ks = [ks]; _ref = m[0].keyShares; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } ks[0] = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), keyShare); b$4.AddUint16(((ks[0].group << 16 >>> 16))); $r = b$4.AddUint16LengthPrefixed((function(extensionsPresent, ks, m) { return function(b$5) { var b$5; b$5.AddBytes(ks[0].data); }; })(extensionsPresent, ks, m)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i++; $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._i = _i; $f._ref = _ref; $f.b$4 = b$4; $f.ks = ks; $f.$s = $s; $f.$r = $r; return $f; }; })(extensionsPresent, m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$3 = b$3; $f.$s = $s; $f.$r = $r; return $f; }; })(extensionsPresent, m)); /* */ $s = 36; case 36: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 35: if (m[0].earlyData) { b$2.AddUint16(42); b$2.AddUint16(0); } /* */ if (m[0].pskModes.$length > 0) { $s = 37; continue; } /* */ $s = 38; continue; /* if (m[0].pskModes.$length > 0) { */ case 37: b$2.AddUint16(45); $r = b$2.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function $b(b$3) { var b$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$3 = $f.b$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = b$3.AddUint8LengthPrefixed((function(extensionsPresent, m) { return function(b$4) { var b$4; b$4.AddBytes(m[0].pskModes); }; })(extensionsPresent, m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$3 = b$3; $f.$s = $s; $f.$r = $r; return $f; }; })(extensionsPresent, m)); /* */ $s = 39; case 39: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 38: /* */ if (m[0].pskIdentities.$length > 0) { $s = 40; continue; } /* */ $s = 41; continue; /* if (m[0].pskIdentities.$length > 0) { */ case 40: b$2.AddUint16(41); $r = b$2.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function $b(b$3) { var b$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$3 = $f.b$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = b$3.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function $b(b$4) { var _i, _ref, b$4, psk, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _ref = $f._ref; b$4 = $f.b$4; psk = $f.psk; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: psk = [psk]; _ref = m[0].pskIdentities; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } psk[0] = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), pskIdentity); $r = b$4.AddUint16LengthPrefixed((function(extensionsPresent, m, psk) { return function(b$5) { var b$5; b$5.AddBytes(psk[0].label); }; })(extensionsPresent, m, psk)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } b$4.AddUint32(psk[0].obfuscatedTicketAge); _i++; $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._i = _i; $f._ref = _ref; $f.b$4 = b$4; $f.psk = psk; $f.$s = $s; $f.$r = $r; return $f; }; })(extensionsPresent, m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = b$3.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function $b(b$4) { var _i, _ref, b$4, binder, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _ref = $f._ref; b$4 = $f.b$4; binder = $f.binder; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: binder = [binder]; _ref = m[0].pskBinders; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } binder[0] = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); $r = b$4.AddUint8LengthPrefixed((function(binder, extensionsPresent, m) { return function(b$5) { var b$5; b$5.AddBytes(binder[0]); }; })(binder, extensionsPresent, m)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i++; $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._i = _i; $f._ref = _ref; $f.b$4 = b$4; $f.binder = binder; $f.$s = $s; $f.$r = $r; return $f; }; })(extensionsPresent, m)); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$3 = b$3; $f.$s = $s; $f.$r = $r; return $f; }; })(extensionsPresent, m)); /* */ $s = 42; case 42: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 41: extensionsPresent[0] = b$2.BytesOrPanic().$length > 2; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$2 = b$2; $f.$s = $s; $f.$r = $r; return $f; }; })(extensionsPresent, m)); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (!extensionsPresent[0]) { cryptobyte.Builder.copy(b$1, bWithoutExtensions); } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$1 = b$1; $f.bWithoutExtensions = bWithoutExtensions; $f.extensionsPresent = extensionsPresent; $f.$s = $s; $f.$r = $r; return $f; }; })(m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } m[0].raw = b.BytesOrPanic(); $s = -1; return m[0].raw; /* */ } return; } if ($f === undefined) { $f = { $blk: clientHelloMsg.ptr.prototype.marshal }; } $f.b = b; $f.m = m; $f.$s = $s; $f.$r = $r; return $f; }; clientHelloMsg.prototype.marshal = function() { return this.$val.marshal(); }; clientHelloMsg.ptr.prototype.marshalWithoutBinders = function() { var _i, _r, _ref, binder, bindersLen, fullMessage, m, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _ref = $f._ref; binder = $f.binder; bindersLen = $f.bindersLen; fullMessage = $f.fullMessage; m = $f.m; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: m = this; bindersLen = 2; _ref = m.pskBinders; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } binder = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); bindersLen = bindersLen + (1) >> 0; bindersLen = bindersLen + (binder.$length) >> 0; _i++; } _r = m.marshal(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } fullMessage = _r; $s = -1; return $subslice(fullMessage, 0, (fullMessage.$length - bindersLen >> 0)); /* */ } return; } if ($f === undefined) { $f = { $blk: clientHelloMsg.ptr.prototype.marshalWithoutBinders }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f.binder = binder; $f.bindersLen = bindersLen; $f.fullMessage = fullMessage; $f.m = m; $f.$s = $s; $f.$r = $r; return $f; }; clientHelloMsg.prototype.marshalWithoutBinders = function() { return this.$val.marshalWithoutBinders(); }; clientHelloMsg.ptr.prototype.updateBinders = function(pskBinders) { var _i, _r, _ref, b, i, lenWithoutBinders, m, pskBinders, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _ref = $f._ref; b = $f.b; i = $f.i; lenWithoutBinders = $f.lenWithoutBinders; m = $f.m; pskBinders = $f.pskBinders; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: m = [m]; m[0] = this; if (!((pskBinders.$length === m[0].pskBinders.$length))) { $panic(new $String("tls: internal error: pskBinders length mismatch")); } _ref = m[0].pskBinders; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; if (!((((i < 0 || i >= pskBinders.$length) ? ($throwRuntimeError("index out of range"), undefined) : pskBinders.$array[pskBinders.$offset + i]).$length === (x = m[0].pskBinders, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])).$length))) { $panic(new $String("tls: internal error: pskBinders length mismatch")); } _i++; } m[0].pskBinders = pskBinders; /* */ if (!(m[0].raw === sliceType$5.nil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(m[0].raw === sliceType$5.nil)) { */ case 1: _r = m[0].marshalWithoutBinders(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } lenWithoutBinders = _r.$length; b = cryptobyte.NewBuilder($subslice(m[0].raw, 0, lenWithoutBinders)); $r = b.AddUint16LengthPrefixed((function(m) { return function $b(b$1) { var _i$1, _ref$1, b$1, binder, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i$1 = $f._i$1; _ref$1 = $f._ref$1; b$1 = $f.b$1; binder = $f.binder; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: binder = [binder]; _ref$1 = m[0].pskBinders; _i$1 = 0; /* while (true) { */ case 1: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 2; continue; } binder[0] = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); $r = b$1.AddUint8LengthPrefixed((function(binder, m) { return function(b$2) { var b$2; b$2.AddBytes(binder[0]); }; })(binder, m)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i$1++; $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._i$1 = _i$1; $f._ref$1 = _ref$1; $f.b$1 = b$1; $f.binder = binder; $f.$s = $s; $f.$r = $r; return $f; }; })(m)); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (!((b.BytesOrPanic().$length === m[0].raw.$length))) { $panic(new $String("tls: internal error: failed to update binders")); } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: clientHelloMsg.ptr.prototype.updateBinders }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f.b = b; $f.i = i; $f.lenWithoutBinders = lenWithoutBinders; $f.m = m; $f.pskBinders = pskBinders; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; clientHelloMsg.prototype.updateBinders = function(pskBinders) { return this.$val.updateBinders(pskBinders); }; clientHelloMsg.ptr.prototype.unmarshal = function(data) { var _1, _ptr, binder, binders, cipherSuites$1, cipherSuites$24ptr, clientShares, curve, curves, data, extData, extension, extensions, extensions$24ptr, identities, ignored, ks, m, nameList, nameType, proto, protoList, psk, s, s$24ptr, serverName, sigAndAlg, sigAndAlg$1, sigAndAlgs, sigAndAlgs$1, statusType, suite, vers, versList; m = this; clientHelloMsg.copy(m, new clientHelloMsg.ptr(data, 0, sliceType$5.nil, sliceType$5.nil, sliceType$2.nil, sliceType$5.nil, "", false, sliceType$3.nil, sliceType$5.nil, false, sliceType$5.nil, sliceType$7.nil, sliceType$7.nil, false, sliceType$5.nil, sliceType$1.nil, false, sliceType$2.nil, sliceType$5.nil, sliceType$15.nil, false, sliceType$5.nil, sliceType$16.nil, sliceType$11.nil)); s = ($convertSliceType(data, cryptobyte.String)); if (!(s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).Skip(4) || !(s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).ReadUint16((m.$ptr_vers || (m.$ptr_vers = new ptrType$18(function() { return this.$target.vers; }, function($v) { this.$target.vers = $v; }, m)))) || !(s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).ReadBytes((m.$ptr_random || (m.$ptr_random = new ptrType$1(function() { return this.$target.random; }, function($v) { this.$target.random = $v; }, m))), 32) || !readUint8LengthPrefixed((s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))), (m.$ptr_sessionId || (m.$ptr_sessionId = new ptrType$1(function() { return this.$target.sessionId; }, function($v) { this.$target.sessionId = $v; }, m))))) { return false; } cipherSuites$1 = cryptobyte.String.nil; if (!(s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).ReadUint16LengthPrefixed((cipherSuites$24ptr || (cipherSuites$24ptr = new ptrType$17(function() { return cipherSuites$1; }, function($v) { cipherSuites$1 = $convertSliceType($v, cryptobyte.String); }))))) { return false; } m.cipherSuites = new sliceType$2([]); m.secureRenegotiationSupported = false; while (true) { if (!(!cipherSuites$1.Empty())) { break; } suite = [suite]; suite[0] = 0; if (!(cipherSuites$24ptr || (cipherSuites$24ptr = new ptrType$17(function() { return cipherSuites$1; }, function($v) { cipherSuites$1 = $convertSliceType($v, cryptobyte.String); }))).ReadUint16((suite.$ptr || (suite.$ptr = new ptrType$18(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, suite))))) { return false; } if (suite[0] === 255) { m.secureRenegotiationSupported = true; } m.cipherSuites = $append(m.cipherSuites, suite[0]); } if (!readUint8LengthPrefixed((s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))), (m.$ptr_compressionMethods || (m.$ptr_compressionMethods = new ptrType$1(function() { return this.$target.compressionMethods; }, function($v) { this.$target.compressionMethods = $v; }, m))))) { return false; } if (s.Empty()) { return true; } extensions = cryptobyte.String.nil; if (!(s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).ReadUint16LengthPrefixed((extensions$24ptr || (extensions$24ptr = new ptrType$17(function() { return extensions; }, function($v) { extensions = $convertSliceType($v, cryptobyte.String); })))) || !s.Empty()) { return false; } while (true) { if (!(!extensions.Empty())) { break; } binders = [binders]; clientShares = [clientShares]; curves = [curves]; extData = [extData]; extension = [extension]; identities = [identities]; ignored = [ignored]; nameList = [nameList]; protoList = [protoList]; sigAndAlgs = [sigAndAlgs]; sigAndAlgs$1 = [sigAndAlgs$1]; statusType = [statusType]; versList = [versList]; extension[0] = 0; extData[0] = cryptobyte.String.nil; if (!(extensions$24ptr || (extensions$24ptr = new ptrType$17(function() { return extensions; }, function($v) { extensions = $convertSliceType($v, cryptobyte.String); }))).ReadUint16((extension.$ptr || (extension.$ptr = new ptrType$18(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extension)))) || !(extensions$24ptr || (extensions$24ptr = new ptrType$17(function() { return extensions; }, function($v) { extensions = $convertSliceType($v, cryptobyte.String); }))).ReadUint16LengthPrefixed((extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))))) { return false; } _1 = extension[0]; if (_1 === (0)) { nameList[0] = cryptobyte.String.nil; if (!(extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))).ReadUint16LengthPrefixed((nameList.$ptr || (nameList.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, nameList)))) || nameList[0].Empty()) { return false; } while (true) { if (!(!nameList[0].Empty())) { break; } nameType = [nameType]; serverName = [serverName]; nameType[0] = 0; serverName[0] = cryptobyte.String.nil; if (!(nameList.$ptr || (nameList.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, nameList))).ReadUint8((nameType.$ptr || (nameType.$ptr = new ptrType$20(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, nameType)))) || !(nameList.$ptr || (nameList.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, nameList))).ReadUint16LengthPrefixed((serverName.$ptr || (serverName.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, serverName)))) || serverName[0].Empty()) { return false; } if (!((nameType[0] === 0))) { continue; } if (!((m.serverName.length === 0))) { return false; } m.serverName = ($bytesToString(serverName[0])); if (strings.HasSuffix(m.serverName, ".")) { return false; } } } else if (_1 === (5)) { statusType[0] = 0; ignored[0] = cryptobyte.String.nil; if (!(extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))).ReadUint8((statusType.$ptr || (statusType.$ptr = new ptrType$20(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, statusType)))) || !(extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))).ReadUint16LengthPrefixed((ignored.$ptr || (ignored.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, ignored)))) || !(extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))).ReadUint16LengthPrefixed((ignored.$ptr || (ignored.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, ignored))))) { return false; } m.ocspStapling = statusType[0] === 1; } else if (_1 === (10)) { curves[0] = cryptobyte.String.nil; if (!(extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))).ReadUint16LengthPrefixed((curves.$ptr || (curves.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, curves)))) || curves[0].Empty()) { return false; } while (true) { if (!(!curves[0].Empty())) { break; } curve = [curve]; curve[0] = 0; if (!(curves.$ptr || (curves.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, curves))).ReadUint16((curve.$ptr || (curve.$ptr = new ptrType$18(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, curve))))) { return false; } m.supportedCurves = $append(m.supportedCurves, ((curve[0] << 16 >>> 16))); } } else if (_1 === (11)) { if (!readUint8LengthPrefixed((extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))), (m.$ptr_supportedPoints || (m.$ptr_supportedPoints = new ptrType$1(function() { return this.$target.supportedPoints; }, function($v) { this.$target.supportedPoints = $v; }, m)))) || (m.supportedPoints.$length === 0)) { return false; } } else if (_1 === (35)) { m.ticketSupported = true; (extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))).ReadBytes((m.$ptr_sessionTicket || (m.$ptr_sessionTicket = new ptrType$1(function() { return this.$target.sessionTicket; }, function($v) { this.$target.sessionTicket = $v; }, m))), extData[0].$length); } else if (_1 === (13)) { sigAndAlgs[0] = cryptobyte.String.nil; if (!(extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))).ReadUint16LengthPrefixed((sigAndAlgs.$ptr || (sigAndAlgs.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, sigAndAlgs)))) || sigAndAlgs[0].Empty()) { return false; } while (true) { if (!(!sigAndAlgs[0].Empty())) { break; } sigAndAlg = [sigAndAlg]; sigAndAlg[0] = 0; if (!(sigAndAlgs.$ptr || (sigAndAlgs.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, sigAndAlgs))).ReadUint16((sigAndAlg.$ptr || (sigAndAlg.$ptr = new ptrType$18(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, sigAndAlg))))) { return false; } m.supportedSignatureAlgorithms = $append(m.supportedSignatureAlgorithms, ((sigAndAlg[0] << 16 >>> 16))); } } else if (_1 === (50)) { sigAndAlgs$1[0] = cryptobyte.String.nil; if (!(extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))).ReadUint16LengthPrefixed((sigAndAlgs$1.$ptr || (sigAndAlgs$1.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, sigAndAlgs$1)))) || sigAndAlgs$1[0].Empty()) { return false; } while (true) { if (!(!sigAndAlgs$1[0].Empty())) { break; } sigAndAlg$1 = [sigAndAlg$1]; sigAndAlg$1[0] = 0; if (!(sigAndAlgs$1.$ptr || (sigAndAlgs$1.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, sigAndAlgs$1))).ReadUint16((sigAndAlg$1.$ptr || (sigAndAlg$1.$ptr = new ptrType$18(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, sigAndAlg$1))))) { return false; } m.supportedSignatureAlgorithmsCert = $append(m.supportedSignatureAlgorithmsCert, ((sigAndAlg$1[0] << 16 >>> 16))); } } else if (_1 === (65281)) { if (!readUint8LengthPrefixed((extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))), (m.$ptr_secureRenegotiation || (m.$ptr_secureRenegotiation = new ptrType$1(function() { return this.$target.secureRenegotiation; }, function($v) { this.$target.secureRenegotiation = $v; }, m))))) { return false; } m.secureRenegotiationSupported = true; } else if (_1 === (16)) { protoList[0] = cryptobyte.String.nil; if (!(extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))).ReadUint16LengthPrefixed((protoList.$ptr || (protoList.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, protoList)))) || protoList[0].Empty()) { return false; } while (true) { if (!(!protoList[0].Empty())) { break; } proto = [proto]; proto[0] = cryptobyte.String.nil; if (!(protoList.$ptr || (protoList.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, protoList))).ReadUint8LengthPrefixed((proto.$ptr || (proto.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, proto)))) || proto[0].Empty()) { return false; } m.alpnProtocols = $append(m.alpnProtocols, ($bytesToString(proto[0]))); } } else if (_1 === (18)) { m.scts = true; } else if (_1 === (43)) { versList[0] = cryptobyte.String.nil; if (!(extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))).ReadUint8LengthPrefixed((versList.$ptr || (versList.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, versList)))) || versList[0].Empty()) { return false; } while (true) { if (!(!versList[0].Empty())) { break; } vers = [vers]; vers[0] = 0; if (!(versList.$ptr || (versList.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, versList))).ReadUint16((vers.$ptr || (vers.$ptr = new ptrType$18(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, vers))))) { return false; } m.supportedVersions = $append(m.supportedVersions, vers[0]); } } else if (_1 === (44)) { if (!readUint16LengthPrefixed((extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))), (m.$ptr_cookie || (m.$ptr_cookie = new ptrType$1(function() { return this.$target.cookie; }, function($v) { this.$target.cookie = $v; }, m)))) || (m.cookie.$length === 0)) { return false; } } else if (_1 === (51)) { clientShares[0] = cryptobyte.String.nil; if (!(extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))).ReadUint16LengthPrefixed((clientShares.$ptr || (clientShares.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, clientShares))))) { return false; } while (true) { if (!(!clientShares[0].Empty())) { break; } ks = new keyShare.ptr(0, sliceType$5.nil); if (!(clientShares.$ptr || (clientShares.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, clientShares))).ReadUint16(((_ptr = (ks.$ptr_group || (ks.$ptr_group = new ptrType$35(function() { return this.$target.group; }, function($v) { this.$target.group = $v; }, ks))), new ptrType$18(function() { return (_ptr.$get() << 16 >>> 16); }, function($v) { _ptr.$set(($v << 16 >>> 16)); }, _ptr.$target)))) || !readUint16LengthPrefixed((clientShares.$ptr || (clientShares.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, clientShares))), (ks.$ptr_data || (ks.$ptr_data = new ptrType$1(function() { return this.$target.data; }, function($v) { this.$target.data = $v; }, ks)))) || (ks.data.$length === 0)) { return false; } m.keyShares = $append(m.keyShares, ks); } } else if (_1 === (42)) { m.earlyData = true; } else if (_1 === (45)) { if (!readUint8LengthPrefixed((extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))), (m.$ptr_pskModes || (m.$ptr_pskModes = new ptrType$1(function() { return this.$target.pskModes; }, function($v) { this.$target.pskModes = $v; }, m))))) { return false; } } else if (_1 === (41)) { if (!extensions.Empty()) { return false; } identities[0] = cryptobyte.String.nil; if (!(extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))).ReadUint16LengthPrefixed((identities.$ptr || (identities.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, identities)))) || identities[0].Empty()) { return false; } while (true) { if (!(!identities[0].Empty())) { break; } psk = new pskIdentity.ptr(sliceType$5.nil, 0); if (!readUint16LengthPrefixed((identities.$ptr || (identities.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, identities))), (psk.$ptr_label || (psk.$ptr_label = new ptrType$1(function() { return this.$target.label; }, function($v) { this.$target.label = $v; }, psk)))) || !(identities.$ptr || (identities.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, identities))).ReadUint32((psk.$ptr_obfuscatedTicketAge || (psk.$ptr_obfuscatedTicketAge = new ptrType$24(function() { return this.$target.obfuscatedTicketAge; }, function($v) { this.$target.obfuscatedTicketAge = $v; }, psk)))) || (psk.label.$length === 0)) { return false; } m.pskIdentities = $append(m.pskIdentities, psk); } binders[0] = cryptobyte.String.nil; if (!(extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))).ReadUint16LengthPrefixed((binders.$ptr || (binders.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, binders)))) || binders[0].Empty()) { return false; } while (true) { if (!(!binders[0].Empty())) { break; } binder = [binder]; binder[0] = sliceType$5.nil; if (!readUint8LengthPrefixed((binders.$ptr || (binders.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, binders))), (binder.$ptr || (binder.$ptr = new ptrType$1(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, binder)))) || (binder[0].$length === 0)) { return false; } m.pskBinders = $append(m.pskBinders, binder[0]); } } else { continue; } if (!extData[0].Empty()) { return false; } } return true; }; clientHelloMsg.prototype.unmarshal = function(data) { return this.$val.unmarshal(data); }; serverHelloMsg.ptr.prototype.marshal = function() { var b, m, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; m = $f.m; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: m = [m]; m[0] = this; if (!(m[0].raw === sliceType$5.nil)) { $s = -1; return m[0].raw; } b = new cryptobyte.Builder.ptr($ifaceNil, sliceType$5.nil, false, ptrType$15.nil, 0, 0, false, ptrType$16.nil); b.AddUint8(2); $r = b.AddUint24LengthPrefixed((function(m) { return function $b(b$1) { var b$1, bWithoutExtensions, extensionsPresent, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$1 = $f.b$1; bWithoutExtensions = $f.bWithoutExtensions; extensionsPresent = $f.extensionsPresent; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: extensionsPresent = [extensionsPresent]; b$1.AddUint16(m[0].vers); $r = addBytesWithLength(b$1, m[0].random, 32); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = b$1.AddUint8LengthPrefixed((function(extensionsPresent, m) { return function(b$2) { var b$2; b$2.AddBytes(m[0].sessionId); }; })(extensionsPresent, m)); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } b$1.AddUint16(m[0].cipherSuite); b$1.AddUint8(m[0].compressionMethod); extensionsPresent[0] = false; bWithoutExtensions = $clone(b$1, cryptobyte.Builder); $r = b$1.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function $b(b$2) { var b$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$2 = $f.b$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (m[0].ocspStapling) { b$2.AddUint16(5); b$2.AddUint16(0); } if (m[0].ticketSupported) { b$2.AddUint16(35); b$2.AddUint16(0); } /* */ if (m[0].secureRenegotiationSupported) { $s = 1; continue; } /* */ $s = 2; continue; /* if (m[0].secureRenegotiationSupported) { */ case 1: b$2.AddUint16(65281); $r = b$2.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function $b(b$3) { var b$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$3 = $f.b$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = b$3.AddUint8LengthPrefixed((function(extensionsPresent, m) { return function(b$4) { var b$4; b$4.AddBytes(m[0].secureRenegotiation); }; })(extensionsPresent, m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$3 = b$3; $f.$s = $s; $f.$r = $r; return $f; }; })(extensionsPresent, m)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: /* */ if (m[0].alpnProtocol.length > 0) { $s = 4; continue; } /* */ $s = 5; continue; /* if (m[0].alpnProtocol.length > 0) { */ case 4: b$2.AddUint16(16); $r = b$2.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function $b(b$3) { var b$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$3 = $f.b$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = b$3.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function $b(b$4) { var b$4, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$4 = $f.b$4; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = b$4.AddUint8LengthPrefixed((function(extensionsPresent, m) { return function(b$5) { var b$5; b$5.AddBytes((new sliceType$5($stringToBytes(m[0].alpnProtocol)))); }; })(extensionsPresent, m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$4 = b$4; $f.$s = $s; $f.$r = $r; return $f; }; })(extensionsPresent, m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$3 = b$3; $f.$s = $s; $f.$r = $r; return $f; }; })(extensionsPresent, m)); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: /* */ if (m[0].scts.$length > 0) { $s = 7; continue; } /* */ $s = 8; continue; /* if (m[0].scts.$length > 0) { */ case 7: b$2.AddUint16(18); $r = b$2.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function $b(b$3) { var b$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$3 = $f.b$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = b$3.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function $b(b$4) { var _i, _ref, b$4, sct, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _ref = $f._ref; b$4 = $f.b$4; sct = $f.sct; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sct = [sct]; _ref = m[0].scts; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } sct[0] = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); $r = b$4.AddUint16LengthPrefixed((function(extensionsPresent, m, sct) { return function(b$5) { var b$5; b$5.AddBytes(sct[0]); }; })(extensionsPresent, m, sct)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i++; $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._i = _i; $f._ref = _ref; $f.b$4 = b$4; $f.sct = sct; $f.$s = $s; $f.$r = $r; return $f; }; })(extensionsPresent, m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$3 = b$3; $f.$s = $s; $f.$r = $r; return $f; }; })(extensionsPresent, m)); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 8: /* */ if (!((m[0].supportedVersion === 0))) { $s = 10; continue; } /* */ $s = 11; continue; /* if (!((m[0].supportedVersion === 0))) { */ case 10: b$2.AddUint16(43); $r = b$2.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function(b$3) { var b$3; b$3.AddUint16(m[0].supportedVersion); }; })(extensionsPresent, m)); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 11: /* */ if (!((m[0].serverShare.group === 0))) { $s = 13; continue; } /* */ $s = 14; continue; /* if (!((m[0].serverShare.group === 0))) { */ case 13: b$2.AddUint16(51); $r = b$2.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function $b(b$3) { var b$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$3 = $f.b$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b$3.AddUint16(((m[0].serverShare.group << 16 >>> 16))); $r = b$3.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function(b$4) { var b$4; b$4.AddBytes(m[0].serverShare.data); }; })(extensionsPresent, m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$3 = b$3; $f.$s = $s; $f.$r = $r; return $f; }; })(extensionsPresent, m)); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 14: /* */ if (m[0].selectedIdentityPresent) { $s = 16; continue; } /* */ $s = 17; continue; /* if (m[0].selectedIdentityPresent) { */ case 16: b$2.AddUint16(41); $r = b$2.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function(b$3) { var b$3; b$3.AddUint16(m[0].selectedIdentity); }; })(extensionsPresent, m)); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 17: /* */ if (m[0].cookie.$length > 0) { $s = 19; continue; } /* */ $s = 20; continue; /* if (m[0].cookie.$length > 0) { */ case 19: b$2.AddUint16(44); $r = b$2.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function $b(b$3) { var b$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$3 = $f.b$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = b$3.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function(b$4) { var b$4; b$4.AddBytes(m[0].cookie); }; })(extensionsPresent, m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$3 = b$3; $f.$s = $s; $f.$r = $r; return $f; }; })(extensionsPresent, m)); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 20: /* */ if (!((m[0].selectedGroup === 0))) { $s = 22; continue; } /* */ $s = 23; continue; /* if (!((m[0].selectedGroup === 0))) { */ case 22: b$2.AddUint16(51); $r = b$2.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function(b$3) { var b$3; b$3.AddUint16(((m[0].selectedGroup << 16 >>> 16))); }; })(extensionsPresent, m)); /* */ $s = 24; case 24: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 23: /* */ if (m[0].supportedPoints.$length > 0) { $s = 25; continue; } /* */ $s = 26; continue; /* if (m[0].supportedPoints.$length > 0) { */ case 25: b$2.AddUint16(11); $r = b$2.AddUint16LengthPrefixed((function(extensionsPresent, m) { return function $b(b$3) { var b$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$3 = $f.b$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = b$3.AddUint8LengthPrefixed((function(extensionsPresent, m) { return function(b$4) { var b$4; b$4.AddBytes(m[0].supportedPoints); }; })(extensionsPresent, m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$3 = b$3; $f.$s = $s; $f.$r = $r; return $f; }; })(extensionsPresent, m)); /* */ $s = 27; case 27: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 26: extensionsPresent[0] = b$2.BytesOrPanic().$length > 2; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$2 = b$2; $f.$s = $s; $f.$r = $r; return $f; }; })(extensionsPresent, m)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (!extensionsPresent[0]) { cryptobyte.Builder.copy(b$1, bWithoutExtensions); } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$1 = b$1; $f.bWithoutExtensions = bWithoutExtensions; $f.extensionsPresent = extensionsPresent; $f.$s = $s; $f.$r = $r; return $f; }; })(m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } m[0].raw = b.BytesOrPanic(); $s = -1; return m[0].raw; /* */ } return; } if ($f === undefined) { $f = { $blk: serverHelloMsg.ptr.prototype.marshal }; } $f.b = b; $f.m = m; $f.$s = $s; $f.$r = $r; return $f; }; serverHelloMsg.prototype.marshal = function() { return this.$val.marshal(); }; serverHelloMsg.ptr.prototype.unmarshal = function(data) { var _1, _ptr, _ptr$1, data, extData, extension, extensions, extensions$24ptr, m, proto, protoList, s, s$24ptr, sct, sctList, x, x$1; m = this; serverHelloMsg.copy(m, new serverHelloMsg.ptr(data, 0, sliceType$5.nil, sliceType$5.nil, 0, 0, false, false, false, sliceType$5.nil, "", sliceType$11.nil, 0, new keyShare.ptr(0, sliceType$5.nil), false, 0, sliceType$5.nil, sliceType$5.nil, 0)); s = ($convertSliceType(data, cryptobyte.String)); if (!(s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).Skip(4) || !(s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).ReadUint16((m.$ptr_vers || (m.$ptr_vers = new ptrType$18(function() { return this.$target.vers; }, function($v) { this.$target.vers = $v; }, m)))) || !(s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).ReadBytes((m.$ptr_random || (m.$ptr_random = new ptrType$1(function() { return this.$target.random; }, function($v) { this.$target.random = $v; }, m))), 32) || !readUint8LengthPrefixed((s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))), (m.$ptr_sessionId || (m.$ptr_sessionId = new ptrType$1(function() { return this.$target.sessionId; }, function($v) { this.$target.sessionId = $v; }, m)))) || !(s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).ReadUint16((m.$ptr_cipherSuite || (m.$ptr_cipherSuite = new ptrType$18(function() { return this.$target.cipherSuite; }, function($v) { this.$target.cipherSuite = $v; }, m)))) || !(s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).ReadUint8((m.$ptr_compressionMethod || (m.$ptr_compressionMethod = new ptrType$20(function() { return this.$target.compressionMethod; }, function($v) { this.$target.compressionMethod = $v; }, m))))) { return false; } if (s.Empty()) { return true; } extensions = cryptobyte.String.nil; if (!(s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).ReadUint16LengthPrefixed((extensions$24ptr || (extensions$24ptr = new ptrType$17(function() { return extensions; }, function($v) { extensions = $convertSliceType($v, cryptobyte.String); })))) || !s.Empty()) { return false; } while (true) { if (!(!extensions.Empty())) { break; } extData = [extData]; extension = [extension]; proto = [proto]; protoList = [protoList]; sctList = [sctList]; extension[0] = 0; extData[0] = cryptobyte.String.nil; if (!(extensions$24ptr || (extensions$24ptr = new ptrType$17(function() { return extensions; }, function($v) { extensions = $convertSliceType($v, cryptobyte.String); }))).ReadUint16((extension.$ptr || (extension.$ptr = new ptrType$18(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extension)))) || !(extensions$24ptr || (extensions$24ptr = new ptrType$17(function() { return extensions; }, function($v) { extensions = $convertSliceType($v, cryptobyte.String); }))).ReadUint16LengthPrefixed((extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))))) { return false; } _1 = extension[0]; if (_1 === (5)) { m.ocspStapling = true; } else if (_1 === (35)) { m.ticketSupported = true; } else if (_1 === (65281)) { if (!readUint8LengthPrefixed((extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))), (m.$ptr_secureRenegotiation || (m.$ptr_secureRenegotiation = new ptrType$1(function() { return this.$target.secureRenegotiation; }, function($v) { this.$target.secureRenegotiation = $v; }, m))))) { return false; } m.secureRenegotiationSupported = true; } else if (_1 === (16)) { protoList[0] = cryptobyte.String.nil; if (!(extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))).ReadUint16LengthPrefixed((protoList.$ptr || (protoList.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, protoList)))) || protoList[0].Empty()) { return false; } proto[0] = cryptobyte.String.nil; if (!(protoList.$ptr || (protoList.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, protoList))).ReadUint8LengthPrefixed((proto.$ptr || (proto.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, proto)))) || proto[0].Empty() || !protoList[0].Empty()) { return false; } m.alpnProtocol = ($bytesToString(proto[0])); } else if (_1 === (18)) { sctList[0] = cryptobyte.String.nil; if (!(extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))).ReadUint16LengthPrefixed((sctList.$ptr || (sctList.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, sctList)))) || sctList[0].Empty()) { return false; } while (true) { if (!(!sctList[0].Empty())) { break; } sct = [sct]; sct[0] = sliceType$5.nil; if (!readUint16LengthPrefixed((sctList.$ptr || (sctList.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, sctList))), (sct.$ptr || (sct.$ptr = new ptrType$1(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, sct)))) || (sct[0].$length === 0)) { return false; } m.scts = $append(m.scts, sct[0]); } } else if (_1 === (43)) { if (!(extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))).ReadUint16((m.$ptr_supportedVersion || (m.$ptr_supportedVersion = new ptrType$18(function() { return this.$target.supportedVersion; }, function($v) { this.$target.supportedVersion = $v; }, m))))) { return false; } } else if (_1 === (44)) { if (!readUint16LengthPrefixed((extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))), (m.$ptr_cookie || (m.$ptr_cookie = new ptrType$1(function() { return this.$target.cookie; }, function($v) { this.$target.cookie = $v; }, m)))) || (m.cookie.$length === 0)) { return false; } } else if (_1 === (51)) { if (extData[0].$length === 2) { if (!(extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))).ReadUint16(((_ptr = (m.$ptr_selectedGroup || (m.$ptr_selectedGroup = new ptrType$35(function() { return this.$target.selectedGroup; }, function($v) { this.$target.selectedGroup = $v; }, m))), new ptrType$18(function() { return (_ptr.$get() << 16 >>> 16); }, function($v) { _ptr.$set(($v << 16 >>> 16)); }, _ptr.$target))))) { return false; } } else { if (!(extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))).ReadUint16(((_ptr$1 = (x = m.serverShare, (x.$ptr_group || (x.$ptr_group = new ptrType$35(function() { return this.$target.group; }, function($v) { this.$target.group = $v; }, x)))), new ptrType$18(function() { return (_ptr$1.$get() << 16 >>> 16); }, function($v) { _ptr$1.$set(($v << 16 >>> 16)); }, _ptr$1.$target)))) || !readUint16LengthPrefixed((extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))), (x$1 = m.serverShare, (x$1.$ptr_data || (x$1.$ptr_data = new ptrType$1(function() { return this.$target.data; }, function($v) { this.$target.data = $v; }, x$1)))))) { return false; } } } else if (_1 === (41)) { m.selectedIdentityPresent = true; if (!(extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))).ReadUint16((m.$ptr_selectedIdentity || (m.$ptr_selectedIdentity = new ptrType$18(function() { return this.$target.selectedIdentity; }, function($v) { this.$target.selectedIdentity = $v; }, m))))) { return false; } } else if (_1 === (11)) { if (!readUint8LengthPrefixed((extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))), (m.$ptr_supportedPoints || (m.$ptr_supportedPoints = new ptrType$1(function() { return this.$target.supportedPoints; }, function($v) { this.$target.supportedPoints = $v; }, m)))) || (m.supportedPoints.$length === 0)) { return false; } } else { continue; } if (!extData[0].Empty()) { return false; } } return true; }; serverHelloMsg.prototype.unmarshal = function(data) { return this.$val.unmarshal(data); }; encryptedExtensionsMsg.ptr.prototype.marshal = function() { var b, m, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; m = $f.m; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: m = [m]; m[0] = this; if (!(m[0].raw === sliceType$5.nil)) { $s = -1; return m[0].raw; } b = new cryptobyte.Builder.ptr($ifaceNil, sliceType$5.nil, false, ptrType$15.nil, 0, 0, false, ptrType$16.nil); b.AddUint8(8); $r = b.AddUint24LengthPrefixed((function(m) { return function $b(b$1) { var b$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$1 = $f.b$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = b$1.AddUint16LengthPrefixed((function(m) { return function $b(b$2) { var b$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$2 = $f.b$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (m[0].alpnProtocol.length > 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (m[0].alpnProtocol.length > 0) { */ case 1: b$2.AddUint16(16); $r = b$2.AddUint16LengthPrefixed((function(m) { return function $b(b$3) { var b$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$3 = $f.b$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = b$3.AddUint16LengthPrefixed((function(m) { return function $b(b$4) { var b$4, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$4 = $f.b$4; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = b$4.AddUint8LengthPrefixed((function(m) { return function(b$5) { var b$5; b$5.AddBytes((new sliceType$5($stringToBytes(m[0].alpnProtocol)))); }; })(m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$4 = b$4; $f.$s = $s; $f.$r = $r; return $f; }; })(m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$3 = b$3; $f.$s = $s; $f.$r = $r; return $f; }; })(m)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$2 = b$2; $f.$s = $s; $f.$r = $r; return $f; }; })(m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$1 = b$1; $f.$s = $s; $f.$r = $r; return $f; }; })(m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } m[0].raw = b.BytesOrPanic(); $s = -1; return m[0].raw; /* */ } return; } if ($f === undefined) { $f = { $blk: encryptedExtensionsMsg.ptr.prototype.marshal }; } $f.b = b; $f.m = m; $f.$s = $s; $f.$r = $r; return $f; }; encryptedExtensionsMsg.prototype.marshal = function() { return this.$val.marshal(); }; encryptedExtensionsMsg.ptr.prototype.unmarshal = function(data) { var _1, data, extData, extension, extensions, extensions$24ptr, m, proto, protoList, s, s$24ptr; m = this; encryptedExtensionsMsg.copy(m, new encryptedExtensionsMsg.ptr(data, "")); s = ($convertSliceType(data, cryptobyte.String)); extensions = cryptobyte.String.nil; if (!(s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).Skip(4) || !(s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).ReadUint16LengthPrefixed((extensions$24ptr || (extensions$24ptr = new ptrType$17(function() { return extensions; }, function($v) { extensions = $convertSliceType($v, cryptobyte.String); })))) || !s.Empty()) { return false; } while (true) { if (!(!extensions.Empty())) { break; } extData = [extData]; extension = [extension]; proto = [proto]; protoList = [protoList]; extension[0] = 0; extData[0] = cryptobyte.String.nil; if (!(extensions$24ptr || (extensions$24ptr = new ptrType$17(function() { return extensions; }, function($v) { extensions = $convertSliceType($v, cryptobyte.String); }))).ReadUint16((extension.$ptr || (extension.$ptr = new ptrType$18(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extension)))) || !(extensions$24ptr || (extensions$24ptr = new ptrType$17(function() { return extensions; }, function($v) { extensions = $convertSliceType($v, cryptobyte.String); }))).ReadUint16LengthPrefixed((extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))))) { return false; } _1 = extension[0]; if (_1 === (16)) { protoList[0] = cryptobyte.String.nil; if (!(extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))).ReadUint16LengthPrefixed((protoList.$ptr || (protoList.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, protoList)))) || protoList[0].Empty()) { return false; } proto[0] = cryptobyte.String.nil; if (!(protoList.$ptr || (protoList.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, protoList))).ReadUint8LengthPrefixed((proto.$ptr || (proto.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, proto)))) || proto[0].Empty() || !protoList[0].Empty()) { return false; } m.alpnProtocol = ($bytesToString(proto[0])); } else { continue; } if (!extData[0].Empty()) { return false; } } return true; }; encryptedExtensionsMsg.prototype.unmarshal = function(data) { return this.$val.unmarshal(data); }; endOfEarlyDataMsg.ptr.prototype.marshal = function() { var m, x; m = this; x = $makeSlice(sliceType$5, 4); (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0] = 5); return x; }; endOfEarlyDataMsg.prototype.marshal = function() { return this.$val.marshal(); }; endOfEarlyDataMsg.ptr.prototype.unmarshal = function(data) { var data, m; m = this; return data.$length === 4; }; endOfEarlyDataMsg.prototype.unmarshal = function(data) { return this.$val.unmarshal(data); }; keyUpdateMsg.ptr.prototype.marshal = function() { var b, m, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; m = $f.m; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: m = [m]; m[0] = this; if (!(m[0].raw === sliceType$5.nil)) { $s = -1; return m[0].raw; } b = new cryptobyte.Builder.ptr($ifaceNil, sliceType$5.nil, false, ptrType$15.nil, 0, 0, false, ptrType$16.nil); b.AddUint8(24); $r = b.AddUint24LengthPrefixed((function(m) { return function(b$1) { var b$1; if (m[0].updateRequested) { b$1.AddUint8(1); } else { b$1.AddUint8(0); } }; })(m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } m[0].raw = b.BytesOrPanic(); $s = -1; return m[0].raw; /* */ } return; } if ($f === undefined) { $f = { $blk: keyUpdateMsg.ptr.prototype.marshal }; } $f.b = b; $f.m = m; $f.$s = $s; $f.$r = $r; return $f; }; keyUpdateMsg.prototype.marshal = function() { return this.$val.marshal(); }; keyUpdateMsg.ptr.prototype.unmarshal = function(data) { var _1, data, m, s, s$24ptr, updateRequested, updateRequested$24ptr; m = this; m.raw = data; s = ($convertSliceType(data, cryptobyte.String)); updateRequested = 0; if (!(s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).Skip(4) || !(s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).ReadUint8((updateRequested$24ptr || (updateRequested$24ptr = new ptrType$20(function() { return updateRequested; }, function($v) { updateRequested = $v; })))) || !s.Empty()) { return false; } _1 = updateRequested; if (_1 === (0)) { m.updateRequested = false; } else if (_1 === (1)) { m.updateRequested = true; } else { return false; } return true; }; keyUpdateMsg.prototype.unmarshal = function(data) { return this.$val.unmarshal(data); }; newSessionTicketMsgTLS13.ptr.prototype.marshal = function() { var b, m, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; m = $f.m; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: m = [m]; m[0] = this; if (!(m[0].raw === sliceType$5.nil)) { $s = -1; return m[0].raw; } b = new cryptobyte.Builder.ptr($ifaceNil, sliceType$5.nil, false, ptrType$15.nil, 0, 0, false, ptrType$16.nil); b.AddUint8(4); $r = b.AddUint24LengthPrefixed((function(m) { return function $b(b$1) { var b$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$1 = $f.b$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b$1.AddUint32(m[0].lifetime); b$1.AddUint32(m[0].ageAdd); $r = b$1.AddUint8LengthPrefixed((function(m) { return function(b$2) { var b$2; b$2.AddBytes(m[0].nonce); }; })(m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = b$1.AddUint16LengthPrefixed((function(m) { return function(b$2) { var b$2; b$2.AddBytes(m[0].label); }; })(m)); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = b$1.AddUint16LengthPrefixed((function(m) { return function $b(b$2) { var b$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$2 = $f.b$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (m[0].maxEarlyData > 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (m[0].maxEarlyData > 0) { */ case 1: b$2.AddUint16(42); $r = b$2.AddUint16LengthPrefixed((function(m) { return function(b$3) { var b$3; b$3.AddUint32(m[0].maxEarlyData); }; })(m)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$2 = b$2; $f.$s = $s; $f.$r = $r; return $f; }; })(m)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$1 = b$1; $f.$s = $s; $f.$r = $r; return $f; }; })(m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } m[0].raw = b.BytesOrPanic(); $s = -1; return m[0].raw; /* */ } return; } if ($f === undefined) { $f = { $blk: newSessionTicketMsgTLS13.ptr.prototype.marshal }; } $f.b = b; $f.m = m; $f.$s = $s; $f.$r = $r; return $f; }; newSessionTicketMsgTLS13.prototype.marshal = function() { return this.$val.marshal(); }; newSessionTicketMsgTLS13.ptr.prototype.unmarshal = function(data) { var _1, data, extData, extension, extensions, extensions$24ptr, m, s, s$24ptr; m = this; newSessionTicketMsgTLS13.copy(m, new newSessionTicketMsgTLS13.ptr(data, 0, 0, sliceType$5.nil, sliceType$5.nil, 0)); s = ($convertSliceType(data, cryptobyte.String)); extensions = cryptobyte.String.nil; if (!(s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).Skip(4) || !(s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).ReadUint32((m.$ptr_lifetime || (m.$ptr_lifetime = new ptrType$24(function() { return this.$target.lifetime; }, function($v) { this.$target.lifetime = $v; }, m)))) || !(s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).ReadUint32((m.$ptr_ageAdd || (m.$ptr_ageAdd = new ptrType$24(function() { return this.$target.ageAdd; }, function($v) { this.$target.ageAdd = $v; }, m)))) || !readUint8LengthPrefixed((s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))), (m.$ptr_nonce || (m.$ptr_nonce = new ptrType$1(function() { return this.$target.nonce; }, function($v) { this.$target.nonce = $v; }, m)))) || !readUint16LengthPrefixed((s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))), (m.$ptr_label || (m.$ptr_label = new ptrType$1(function() { return this.$target.label; }, function($v) { this.$target.label = $v; }, m)))) || !(s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).ReadUint16LengthPrefixed((extensions$24ptr || (extensions$24ptr = new ptrType$17(function() { return extensions; }, function($v) { extensions = $convertSliceType($v, cryptobyte.String); })))) || !s.Empty()) { return false; } while (true) { if (!(!extensions.Empty())) { break; } extData = [extData]; extension = [extension]; extension[0] = 0; extData[0] = cryptobyte.String.nil; if (!(extensions$24ptr || (extensions$24ptr = new ptrType$17(function() { return extensions; }, function($v) { extensions = $convertSliceType($v, cryptobyte.String); }))).ReadUint16((extension.$ptr || (extension.$ptr = new ptrType$18(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extension)))) || !(extensions$24ptr || (extensions$24ptr = new ptrType$17(function() { return extensions; }, function($v) { extensions = $convertSliceType($v, cryptobyte.String); }))).ReadUint16LengthPrefixed((extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))))) { return false; } _1 = extension[0]; if (_1 === (42)) { if (!(extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))).ReadUint32((m.$ptr_maxEarlyData || (m.$ptr_maxEarlyData = new ptrType$24(function() { return this.$target.maxEarlyData; }, function($v) { this.$target.maxEarlyData = $v; }, m))))) { return false; } } else { continue; } if (!extData[0].Empty()) { return false; } } return true; }; newSessionTicketMsgTLS13.prototype.unmarshal = function(data) { return this.$val.unmarshal(data); }; certificateRequestMsgTLS13.ptr.prototype.marshal = function() { var b, m, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; m = $f.m; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: m = [m]; m[0] = this; if (!(m[0].raw === sliceType$5.nil)) { $s = -1; return m[0].raw; } b = new cryptobyte.Builder.ptr($ifaceNil, sliceType$5.nil, false, ptrType$15.nil, 0, 0, false, ptrType$16.nil); b.AddUint8(13); $r = b.AddUint24LengthPrefixed((function(m) { return function $b(b$1) { var b$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$1 = $f.b$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b$1.AddUint8(0); $r = b$1.AddUint16LengthPrefixed((function(m) { return function $b(b$2) { var b$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$2 = $f.b$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (m[0].ocspStapling) { b$2.AddUint16(5); b$2.AddUint16(0); } if (m[0].scts) { b$2.AddUint16(18); b$2.AddUint16(0); } /* */ if (m[0].supportedSignatureAlgorithms.$length > 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (m[0].supportedSignatureAlgorithms.$length > 0) { */ case 1: b$2.AddUint16(13); $r = b$2.AddUint16LengthPrefixed((function(m) { return function $b(b$3) { var b$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$3 = $f.b$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = b$3.AddUint16LengthPrefixed((function(m) { return function(b$4) { var _i, _ref, b$4, sigAlgo; _ref = m[0].supportedSignatureAlgorithms; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } sigAlgo = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); b$4.AddUint16(((sigAlgo << 16 >>> 16))); _i++; } }; })(m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$3 = b$3; $f.$s = $s; $f.$r = $r; return $f; }; })(m)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: /* */ if (m[0].supportedSignatureAlgorithmsCert.$length > 0) { $s = 4; continue; } /* */ $s = 5; continue; /* if (m[0].supportedSignatureAlgorithmsCert.$length > 0) { */ case 4: b$2.AddUint16(50); $r = b$2.AddUint16LengthPrefixed((function(m) { return function $b(b$3) { var b$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$3 = $f.b$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = b$3.AddUint16LengthPrefixed((function(m) { return function(b$4) { var _i, _ref, b$4, sigAlgo; _ref = m[0].supportedSignatureAlgorithmsCert; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } sigAlgo = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); b$4.AddUint16(((sigAlgo << 16 >>> 16))); _i++; } }; })(m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$3 = b$3; $f.$s = $s; $f.$r = $r; return $f; }; })(m)); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: /* */ if (m[0].certificateAuthorities.$length > 0) { $s = 7; continue; } /* */ $s = 8; continue; /* if (m[0].certificateAuthorities.$length > 0) { */ case 7: b$2.AddUint16(47); $r = b$2.AddUint16LengthPrefixed((function(m) { return function $b(b$3) { var b$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$3 = $f.b$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = b$3.AddUint16LengthPrefixed((function(m) { return function $b(b$4) { var _i, _ref, b$4, ca, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _ref = $f._ref; b$4 = $f.b$4; ca = $f.ca; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ca = [ca]; _ref = m[0].certificateAuthorities; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } ca[0] = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); $r = b$4.AddUint16LengthPrefixed((function(ca, m) { return function(b$5) { var b$5; b$5.AddBytes(ca[0]); }; })(ca, m)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i++; $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._i = _i; $f._ref = _ref; $f.b$4 = b$4; $f.ca = ca; $f.$s = $s; $f.$r = $r; return $f; }; })(m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$3 = b$3; $f.$s = $s; $f.$r = $r; return $f; }; })(m)); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 8: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$2 = b$2; $f.$s = $s; $f.$r = $r; return $f; }; })(m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$1 = b$1; $f.$s = $s; $f.$r = $r; return $f; }; })(m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } m[0].raw = b.BytesOrPanic(); $s = -1; return m[0].raw; /* */ } return; } if ($f === undefined) { $f = { $blk: certificateRequestMsgTLS13.ptr.prototype.marshal }; } $f.b = b; $f.m = m; $f.$s = $s; $f.$r = $r; return $f; }; certificateRequestMsgTLS13.prototype.marshal = function() { return this.$val.marshal(); }; certificateRequestMsgTLS13.ptr.prototype.unmarshal = function(data) { var _1, _tmp, _tmp$1, auths, ca, context$1, context$24ptr, data, extData, extension, extensions, extensions$24ptr, m, s, s$24ptr, sigAndAlg, sigAndAlg$1, sigAndAlgs, sigAndAlgs$1; m = this; certificateRequestMsgTLS13.copy(m, new certificateRequestMsgTLS13.ptr(data, false, false, sliceType$7.nil, sliceType$7.nil, sliceType$11.nil)); s = ($convertSliceType(data, cryptobyte.String)); _tmp = cryptobyte.String.nil; _tmp$1 = cryptobyte.String.nil; context$1 = _tmp; extensions = _tmp$1; if (!(s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).Skip(4) || !(s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).ReadUint8LengthPrefixed((context$24ptr || (context$24ptr = new ptrType$17(function() { return context$1; }, function($v) { context$1 = $convertSliceType($v, cryptobyte.String); })))) || !context$1.Empty() || !(s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).ReadUint16LengthPrefixed((extensions$24ptr || (extensions$24ptr = new ptrType$17(function() { return extensions; }, function($v) { extensions = $convertSliceType($v, cryptobyte.String); })))) || !s.Empty()) { return false; } while (true) { if (!(!extensions.Empty())) { break; } auths = [auths]; extData = [extData]; extension = [extension]; sigAndAlgs = [sigAndAlgs]; sigAndAlgs$1 = [sigAndAlgs$1]; extension[0] = 0; extData[0] = cryptobyte.String.nil; if (!(extensions$24ptr || (extensions$24ptr = new ptrType$17(function() { return extensions; }, function($v) { extensions = $convertSliceType($v, cryptobyte.String); }))).ReadUint16((extension.$ptr || (extension.$ptr = new ptrType$18(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extension)))) || !(extensions$24ptr || (extensions$24ptr = new ptrType$17(function() { return extensions; }, function($v) { extensions = $convertSliceType($v, cryptobyte.String); }))).ReadUint16LengthPrefixed((extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))))) { return false; } _1 = extension[0]; if (_1 === (5)) { m.ocspStapling = true; } else if (_1 === (18)) { m.scts = true; } else if (_1 === (13)) { sigAndAlgs[0] = cryptobyte.String.nil; if (!(extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))).ReadUint16LengthPrefixed((sigAndAlgs.$ptr || (sigAndAlgs.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, sigAndAlgs)))) || sigAndAlgs[0].Empty()) { return false; } while (true) { if (!(!sigAndAlgs[0].Empty())) { break; } sigAndAlg = [sigAndAlg]; sigAndAlg[0] = 0; if (!(sigAndAlgs.$ptr || (sigAndAlgs.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, sigAndAlgs))).ReadUint16((sigAndAlg.$ptr || (sigAndAlg.$ptr = new ptrType$18(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, sigAndAlg))))) { return false; } m.supportedSignatureAlgorithms = $append(m.supportedSignatureAlgorithms, ((sigAndAlg[0] << 16 >>> 16))); } } else if (_1 === (50)) { sigAndAlgs$1[0] = cryptobyte.String.nil; if (!(extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))).ReadUint16LengthPrefixed((sigAndAlgs$1.$ptr || (sigAndAlgs$1.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, sigAndAlgs$1)))) || sigAndAlgs$1[0].Empty()) { return false; } while (true) { if (!(!sigAndAlgs$1[0].Empty())) { break; } sigAndAlg$1 = [sigAndAlg$1]; sigAndAlg$1[0] = 0; if (!(sigAndAlgs$1.$ptr || (sigAndAlgs$1.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, sigAndAlgs$1))).ReadUint16((sigAndAlg$1.$ptr || (sigAndAlg$1.$ptr = new ptrType$18(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, sigAndAlg$1))))) { return false; } m.supportedSignatureAlgorithmsCert = $append(m.supportedSignatureAlgorithmsCert, ((sigAndAlg$1[0] << 16 >>> 16))); } } else if (_1 === (47)) { auths[0] = cryptobyte.String.nil; if (!(extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))).ReadUint16LengthPrefixed((auths.$ptr || (auths.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, auths)))) || auths[0].Empty()) { return false; } while (true) { if (!(!auths[0].Empty())) { break; } ca = [ca]; ca[0] = sliceType$5.nil; if (!readUint16LengthPrefixed((auths.$ptr || (auths.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, auths))), (ca.$ptr || (ca.$ptr = new ptrType$1(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, ca)))) || (ca[0].$length === 0)) { return false; } m.certificateAuthorities = $append(m.certificateAuthorities, ca[0]); } } else { continue; } if (!extData[0].Empty()) { return false; } } return true; }; certificateRequestMsgTLS13.prototype.unmarshal = function(data) { return this.$val.unmarshal(data); }; certificateMsg.ptr.prototype.marshal = function() { var _i, _i$1, _ref, _ref$1, certificateOctets, i, length, m, slice, slice$1, x, y; x = sliceType$5.nil; m = this; if (!(m.raw === sliceType$5.nil)) { x = m.raw; return x; } i = 0; _ref = m.certificates; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } slice = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); i = i + (slice.$length) >> 0; _i++; } length = (3 + ($imul(3, m.certificates.$length)) >> 0) + i >> 0; x = $makeSlice(sliceType$5, (4 + length >> 0)); (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0] = 11); (1 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 1] = (((length >> 16 >> 0) << 24 >>> 24))); (2 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 2] = (((length >> 8 >> 0) << 24 >>> 24))); (3 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 3] = ((length << 24 >>> 24))); certificateOctets = length - 3 >> 0; (4 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 4] = (((certificateOctets >> 16 >> 0) << 24 >>> 24))); (5 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 5] = (((certificateOctets >> 8 >> 0) << 24 >>> 24))); (6 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 6] = ((certificateOctets << 24 >>> 24))); y = $subslice(x, 7); _ref$1 = m.certificates; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } slice$1 = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); (0 >= y.$length ? ($throwRuntimeError("index out of range"), undefined) : y.$array[y.$offset + 0] = (((slice$1.$length >> 16 >> 0) << 24 >>> 24))); (1 >= y.$length ? ($throwRuntimeError("index out of range"), undefined) : y.$array[y.$offset + 1] = (((slice$1.$length >> 8 >> 0) << 24 >>> 24))); (2 >= y.$length ? ($throwRuntimeError("index out of range"), undefined) : y.$array[y.$offset + 2] = ((slice$1.$length << 24 >>> 24))); $copySlice($subslice(y, 3), slice$1); y = $subslice(y, (3 + slice$1.$length >> 0)); _i$1++; } m.raw = x; return x; }; certificateMsg.prototype.marshal = function() { return this.$val.marshal(); }; certificateMsg.ptr.prototype.unmarshal = function(data) { var certLen, certLen$1, certsLen, d, data, i, m, numCerts, x; m = this; if (data.$length < 7) { return false; } m.raw = data; certsLen = (((((((4 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 4]) >>> 0)) << 16 >>> 0) | ((((5 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 5]) >>> 0)) << 8 >>> 0)) >>> 0) | (((6 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 6]) >>> 0))) >>> 0; if (!((((data.$length >>> 0)) === (certsLen + 7 >>> 0)))) { return false; } numCerts = 0; d = $subslice(data, 7); while (true) { if (!(certsLen > 0)) { break; } if (d.$length < 4) { return false; } certLen = (((((((0 >= d.$length ? ($throwRuntimeError("index out of range"), undefined) : d.$array[d.$offset + 0]) >>> 0)) << 16 >>> 0) | ((((1 >= d.$length ? ($throwRuntimeError("index out of range"), undefined) : d.$array[d.$offset + 1]) >>> 0)) << 8 >>> 0)) >>> 0) | (((2 >= d.$length ? ($throwRuntimeError("index out of range"), undefined) : d.$array[d.$offset + 2]) >>> 0))) >>> 0; if (((d.$length >>> 0)) < (3 + certLen >>> 0)) { return false; } d = $subslice(d, (3 + certLen >>> 0)); certsLen = certsLen - ((3 + certLen >>> 0)) >>> 0; numCerts = numCerts + (1) >> 0; } m.certificates = $makeSlice(sliceType$11, numCerts); d = $subslice(data, 7); i = 0; while (true) { if (!(i < numCerts)) { break; } certLen$1 = (((((((0 >= d.$length ? ($throwRuntimeError("index out of range"), undefined) : d.$array[d.$offset + 0]) >>> 0)) << 16 >>> 0) | ((((1 >= d.$length ? ($throwRuntimeError("index out of range"), undefined) : d.$array[d.$offset + 1]) >>> 0)) << 8 >>> 0)) >>> 0) | (((2 >= d.$length ? ($throwRuntimeError("index out of range"), undefined) : d.$array[d.$offset + 2]) >>> 0))) >>> 0; (x = m.certificates, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i] = $subslice(d, 3, (3 + certLen$1 >>> 0)))); d = $subslice(d, (3 + certLen$1 >>> 0)); i = i + (1) >> 0; } return true; }; certificateMsg.prototype.unmarshal = function(data) { return this.$val.unmarshal(data); }; certificateMsgTLS13.ptr.prototype.marshal = function() { var b, m, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; m = $f.m; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: m = [m]; m[0] = this; if (!(m[0].raw === sliceType$5.nil)) { $s = -1; return m[0].raw; } b = new cryptobyte.Builder.ptr($ifaceNil, sliceType$5.nil, false, ptrType$15.nil, 0, 0, false, ptrType$16.nil); b.AddUint8(11); $r = b.AddUint24LengthPrefixed((function(m) { return function $b(b$1) { var b$1, certificate, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$1 = $f.b$1; certificate = $f.certificate; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b$1.AddUint8(0); certificate = $clone(m[0].certificate, Certificate); if (!m[0].ocspStapling) { certificate.OCSPStaple = sliceType$5.nil; } if (!m[0].scts) { certificate.SignedCertificateTimestamps = sliceType$11.nil; } $r = marshalCertificate(b$1, $clone(certificate, Certificate)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$1 = b$1; $f.certificate = certificate; $f.$s = $s; $f.$r = $r; return $f; }; })(m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } m[0].raw = b.BytesOrPanic(); $s = -1; return m[0].raw; /* */ } return; } if ($f === undefined) { $f = { $blk: certificateMsgTLS13.ptr.prototype.marshal }; } $f.b = b; $f.m = m; $f.$s = $s; $f.$r = $r; return $f; }; certificateMsgTLS13.prototype.marshal = function() { return this.$val.marshal(); }; marshalCertificate = function(b, certificate) { var b, certificate, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; certificate = $f.certificate; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: certificate = [certificate]; $r = b.AddUint24LengthPrefixed((function(certificate) { return function $b(b$1) { var _i, _ref, b$1, cert, i, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _ref = $f._ref; b$1 = $f.b$1; cert = $f.cert; i = $f.i; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cert = [cert]; i = [i]; _ref = certificate[0].Certificate; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } i[0] = _i; cert[0] = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); $r = b$1.AddUint24LengthPrefixed((function(cert, certificate, i) { return function(b$2) { var b$2; b$2.AddBytes(cert[0]); }; })(cert, certificate, i)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = b$1.AddUint16LengthPrefixed((function(cert, certificate, i) { return function $b(b$2) { var b$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$2 = $f.b$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (i[0] > 0) { $s = -1; return; } /* */ if (!(certificate[0].OCSPStaple === sliceType$5.nil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(certificate[0].OCSPStaple === sliceType$5.nil)) { */ case 1: b$2.AddUint16(5); $r = b$2.AddUint16LengthPrefixed((function(cert, certificate, i) { return function $b(b$3) { var b$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$3 = $f.b$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b$3.AddUint8(1); $r = b$3.AddUint24LengthPrefixed((function(cert, certificate, i) { return function(b$4) { var b$4; b$4.AddBytes(certificate[0].OCSPStaple); }; })(cert, certificate, i)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$3 = b$3; $f.$s = $s; $f.$r = $r; return $f; }; })(cert, certificate, i)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: /* */ if (!(certificate[0].SignedCertificateTimestamps === sliceType$11.nil)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!(certificate[0].SignedCertificateTimestamps === sliceType$11.nil)) { */ case 4: b$2.AddUint16(18); $r = b$2.AddUint16LengthPrefixed((function(cert, certificate, i) { return function $b(b$3) { var b$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$3 = $f.b$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = b$3.AddUint16LengthPrefixed((function(cert, certificate, i) { return function $b(b$4) { var _i$1, _ref$1, b$4, sct, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i$1 = $f._i$1; _ref$1 = $f._ref$1; b$4 = $f.b$4; sct = $f.sct; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sct = [sct]; _ref$1 = certificate[0].SignedCertificateTimestamps; _i$1 = 0; /* while (true) { */ case 1: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 2; continue; } sct[0] = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); $r = b$4.AddUint16LengthPrefixed((function(cert, certificate, i, sct) { return function(b$5) { var b$5; b$5.AddBytes(sct[0]); }; })(cert, certificate, i, sct)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i$1++; $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._i$1 = _i$1; $f._ref$1 = _ref$1; $f.b$4 = b$4; $f.sct = sct; $f.$s = $s; $f.$r = $r; return $f; }; })(cert, certificate, i)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$3 = b$3; $f.$s = $s; $f.$r = $r; return $f; }; })(cert, certificate, i)); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$2 = b$2; $f.$s = $s; $f.$r = $r; return $f; }; })(cert, certificate, i)); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i++; $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._i = _i; $f._ref = _ref; $f.b$1 = b$1; $f.cert = cert; $f.i = i; $f.$s = $s; $f.$r = $r; return $f; }; })(certificate)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: marshalCertificate }; } $f.b = b; $f.certificate = certificate; $f.$s = $s; $f.$r = $r; return $f; }; certificateMsgTLS13.ptr.prototype.unmarshal = function(data) { var context$1, context$24ptr, data, m, s, s$24ptr; m = this; certificateMsgTLS13.copy(m, new certificateMsgTLS13.ptr(data, new Certificate.ptr(sliceType$11.nil, $ifaceNil, sliceType$7.nil, sliceType$5.nil, sliceType$11.nil, ptrType$5.nil), false, false)); s = ($convertSliceType(data, cryptobyte.String)); context$1 = cryptobyte.String.nil; if (!(s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).Skip(4) || !(s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).ReadUint8LengthPrefixed((context$24ptr || (context$24ptr = new ptrType$17(function() { return context$1; }, function($v) { context$1 = $convertSliceType($v, cryptobyte.String); })))) || !context$1.Empty() || !unmarshalCertificate((s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))), m.certificate) || !s.Empty()) { return false; } m.scts = !(m.certificate.SignedCertificateTimestamps === sliceType$11.nil); m.ocspStapling = !(m.certificate.OCSPStaple === sliceType$5.nil); return true; }; certificateMsgTLS13.prototype.unmarshal = function(data) { return this.$val.unmarshal(data); }; unmarshalCertificate = function(s, certificate) { var _1, cert, certList, certList$24ptr, certificate, extData, extension, extensions, s, sct, sctList, statusType; certList = cryptobyte.String.nil; if (!s.ReadUint24LengthPrefixed((certList$24ptr || (certList$24ptr = new ptrType$17(function() { return certList; }, function($v) { certList = $convertSliceType($v, cryptobyte.String); }))))) { return false; } while (true) { if (!(!certList.Empty())) { break; } cert = [cert]; extensions = [extensions]; cert[0] = sliceType$5.nil; extensions[0] = cryptobyte.String.nil; if (!readUint24LengthPrefixed((certList$24ptr || (certList$24ptr = new ptrType$17(function() { return certList; }, function($v) { certList = $convertSliceType($v, cryptobyte.String); }))), (cert.$ptr || (cert.$ptr = new ptrType$1(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, cert)))) || !(certList$24ptr || (certList$24ptr = new ptrType$17(function() { return certList; }, function($v) { certList = $convertSliceType($v, cryptobyte.String); }))).ReadUint16LengthPrefixed((extensions.$ptr || (extensions.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extensions))))) { return false; } certificate.Certificate = $append(certificate.Certificate, cert[0]); while (true) { if (!(!extensions[0].Empty())) { break; } extData = [extData]; extension = [extension]; sctList = [sctList]; statusType = [statusType]; extension[0] = 0; extData[0] = cryptobyte.String.nil; if (!(extensions.$ptr || (extensions.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extensions))).ReadUint16((extension.$ptr || (extension.$ptr = new ptrType$18(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extension)))) || !(extensions.$ptr || (extensions.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extensions))).ReadUint16LengthPrefixed((extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))))) { return false; } if (certificate.Certificate.$length > 1) { continue; } _1 = extension[0]; if (_1 === (5)) { statusType[0] = 0; if (!(extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))).ReadUint8((statusType.$ptr || (statusType.$ptr = new ptrType$20(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, statusType)))) || !((statusType[0] === 1)) || !readUint24LengthPrefixed((extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))), (certificate.$ptr_OCSPStaple || (certificate.$ptr_OCSPStaple = new ptrType$1(function() { return this.$target.OCSPStaple; }, function($v) { this.$target.OCSPStaple = $v; }, certificate)))) || (certificate.OCSPStaple.$length === 0)) { return false; } } else if (_1 === (18)) { sctList[0] = cryptobyte.String.nil; if (!(extData.$ptr || (extData.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, extData))).ReadUint16LengthPrefixed((sctList.$ptr || (sctList.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, sctList)))) || sctList[0].Empty()) { return false; } while (true) { if (!(!sctList[0].Empty())) { break; } sct = [sct]; sct[0] = sliceType$5.nil; if (!readUint16LengthPrefixed((sctList.$ptr || (sctList.$ptr = new ptrType$17(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, sctList))), (sct.$ptr || (sct.$ptr = new ptrType$1(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, sct)))) || (sct[0].$length === 0)) { return false; } certificate.SignedCertificateTimestamps = $append(certificate.SignedCertificateTimestamps, sct[0]); } } else { continue; } if (!extData[0].Empty()) { return false; } } } return true; }; serverKeyExchangeMsg.ptr.prototype.marshal = function() { var length, m, x; m = this; if (!(m.raw === sliceType$5.nil)) { return m.raw; } length = m.key.$length; x = $makeSlice(sliceType$5, (length + 4 >> 0)); (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0] = 12); (1 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 1] = (((length >> 16 >> 0) << 24 >>> 24))); (2 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 2] = (((length >> 8 >> 0) << 24 >>> 24))); (3 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 3] = ((length << 24 >>> 24))); $copySlice($subslice(x, 4), m.key); m.raw = x; return x; }; serverKeyExchangeMsg.prototype.marshal = function() { return this.$val.marshal(); }; serverKeyExchangeMsg.ptr.prototype.unmarshal = function(data) { var data, m; m = this; m.raw = data; if (data.$length < 4) { return false; } m.key = $subslice(data, 4); return true; }; serverKeyExchangeMsg.prototype.unmarshal = function(data) { return this.$val.unmarshal(data); }; certificateStatusMsg.ptr.prototype.marshal = function() { var b, m, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; m = $f.m; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: m = [m]; m[0] = this; if (!(m[0].raw === sliceType$5.nil)) { $s = -1; return m[0].raw; } b = new cryptobyte.Builder.ptr($ifaceNil, sliceType$5.nil, false, ptrType$15.nil, 0, 0, false, ptrType$16.nil); b.AddUint8(22); $r = b.AddUint24LengthPrefixed((function(m) { return function $b(b$1) { var b$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$1 = $f.b$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b$1.AddUint8(1); $r = b$1.AddUint24LengthPrefixed((function(m) { return function(b$2) { var b$2; b$2.AddBytes(m[0].response); }; })(m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$1 = b$1; $f.$s = $s; $f.$r = $r; return $f; }; })(m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } m[0].raw = b.BytesOrPanic(); $s = -1; return m[0].raw; /* */ } return; } if ($f === undefined) { $f = { $blk: certificateStatusMsg.ptr.prototype.marshal }; } $f.b = b; $f.m = m; $f.$s = $s; $f.$r = $r; return $f; }; certificateStatusMsg.prototype.marshal = function() { return this.$val.marshal(); }; certificateStatusMsg.ptr.prototype.unmarshal = function(data) { var data, m, s, s$24ptr, statusType, statusType$24ptr; m = this; m.raw = data; s = ($convertSliceType(data, cryptobyte.String)); statusType = 0; if (!(s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).Skip(4) || !(s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).ReadUint8((statusType$24ptr || (statusType$24ptr = new ptrType$20(function() { return statusType; }, function($v) { statusType = $v; })))) || !((statusType === 1)) || !readUint24LengthPrefixed((s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))), (m.$ptr_response || (m.$ptr_response = new ptrType$1(function() { return this.$target.response; }, function($v) { this.$target.response = $v; }, m)))) || (m.response.$length === 0) || !s.Empty()) { return false; } return true; }; certificateStatusMsg.prototype.unmarshal = function(data) { return this.$val.unmarshal(data); }; serverHelloDoneMsg.ptr.prototype.marshal = function() { var m, x; m = this; x = $makeSlice(sliceType$5, 4); (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0] = 14); return x; }; serverHelloDoneMsg.prototype.marshal = function() { return this.$val.marshal(); }; serverHelloDoneMsg.ptr.prototype.unmarshal = function(data) { var data, m; m = this; return data.$length === 4; }; serverHelloDoneMsg.prototype.unmarshal = function(data) { return this.$val.unmarshal(data); }; clientKeyExchangeMsg.ptr.prototype.marshal = function() { var length, m, x; m = this; if (!(m.raw === sliceType$5.nil)) { return m.raw; } length = m.ciphertext.$length; x = $makeSlice(sliceType$5, (length + 4 >> 0)); (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0] = 16); (1 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 1] = (((length >> 16 >> 0) << 24 >>> 24))); (2 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 2] = (((length >> 8 >> 0) << 24 >>> 24))); (3 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 3] = ((length << 24 >>> 24))); $copySlice($subslice(x, 4), m.ciphertext); m.raw = x; return x; }; clientKeyExchangeMsg.prototype.marshal = function() { return this.$val.marshal(); }; clientKeyExchangeMsg.ptr.prototype.unmarshal = function(data) { var data, l, m; m = this; m.raw = data; if (data.$length < 4) { return false; } l = (((((1 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 1]) >> 0)) << 16 >> 0) | ((((2 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 2]) >> 0)) << 8 >> 0)) | (((3 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 3]) >> 0)); if (!((l === (data.$length - 4 >> 0)))) { return false; } m.ciphertext = $subslice(data, 4); return true; }; clientKeyExchangeMsg.prototype.unmarshal = function(data) { return this.$val.unmarshal(data); }; finishedMsg.ptr.prototype.marshal = function() { var b, m, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; m = $f.m; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: m = [m]; m[0] = this; if (!(m[0].raw === sliceType$5.nil)) { $s = -1; return m[0].raw; } b = new cryptobyte.Builder.ptr($ifaceNil, sliceType$5.nil, false, ptrType$15.nil, 0, 0, false, ptrType$16.nil); b.AddUint8(20); $r = b.AddUint24LengthPrefixed((function(m) { return function(b$1) { var b$1; b$1.AddBytes(m[0].verifyData); }; })(m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } m[0].raw = b.BytesOrPanic(); $s = -1; return m[0].raw; /* */ } return; } if ($f === undefined) { $f = { $blk: finishedMsg.ptr.prototype.marshal }; } $f.b = b; $f.m = m; $f.$s = $s; $f.$r = $r; return $f; }; finishedMsg.prototype.marshal = function() { return this.$val.marshal(); }; finishedMsg.ptr.prototype.unmarshal = function(data) { var data, m, s, s$24ptr; m = this; m.raw = data; s = ($convertSliceType(data, cryptobyte.String)); return (s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).Skip(1) && readUint24LengthPrefixed((s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))), (m.$ptr_verifyData || (m.$ptr_verifyData = new ptrType$1(function() { return this.$target.verifyData; }, function($v) { this.$target.verifyData = $v; }, m)))) && s.Empty(); }; finishedMsg.prototype.unmarshal = function(data) { return this.$val.unmarshal(data); }; certificateRequestMsg.ptr.prototype.marshal = function() { var _i, _i$1, _i$2, _ref, _ref$1, _ref$2, ca, ca$1, casLength, length, m, n, sigAlgo, x, y; x = sliceType$5.nil; m = this; if (!(m.raw === sliceType$5.nil)) { x = m.raw; return x; } length = (1 + m.certificateTypes.$length >> 0) + 2 >> 0; casLength = 0; _ref = m.certificateAuthorities; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } ca = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); casLength = casLength + ((2 + ca.$length >> 0)) >> 0; _i++; } length = length + (casLength) >> 0; if (m.hasSignatureAlgorithm) { length = length + ((2 + ($imul(2, m.supportedSignatureAlgorithms.$length)) >> 0)) >> 0; } x = $makeSlice(sliceType$5, (4 + length >> 0)); (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0] = 13); (1 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 1] = (((length >> 16 >> 0) << 24 >>> 24))); (2 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 2] = (((length >> 8 >> 0) << 24 >>> 24))); (3 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 3] = ((length << 24 >>> 24))); (4 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 4] = ((m.certificateTypes.$length << 24 >>> 24))); $copySlice($subslice(x, 5), m.certificateTypes); y = $subslice(x, (5 + m.certificateTypes.$length >> 0)); if (m.hasSignatureAlgorithm) { n = $imul(m.supportedSignatureAlgorithms.$length, 2); (0 >= y.$length ? ($throwRuntimeError("index out of range"), undefined) : y.$array[y.$offset + 0] = (((n >> 8 >> 0) << 24 >>> 24))); (1 >= y.$length ? ($throwRuntimeError("index out of range"), undefined) : y.$array[y.$offset + 1] = ((n << 24 >>> 24))); y = $subslice(y, 2); _ref$1 = m.supportedSignatureAlgorithms; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } sigAlgo = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); (0 >= y.$length ? ($throwRuntimeError("index out of range"), undefined) : y.$array[y.$offset + 0] = (((sigAlgo >>> 8 << 16 >>> 16) << 24 >>> 24))); (1 >= y.$length ? ($throwRuntimeError("index out of range"), undefined) : y.$array[y.$offset + 1] = ((sigAlgo << 24 >>> 24))); y = $subslice(y, 2); _i$1++; } } (0 >= y.$length ? ($throwRuntimeError("index out of range"), undefined) : y.$array[y.$offset + 0] = (((casLength >> 8 >> 0) << 24 >>> 24))); (1 >= y.$length ? ($throwRuntimeError("index out of range"), undefined) : y.$array[y.$offset + 1] = ((casLength << 24 >>> 24))); y = $subslice(y, 2); _ref$2 = m.certificateAuthorities; _i$2 = 0; while (true) { if (!(_i$2 < _ref$2.$length)) { break; } ca$1 = ((_i$2 < 0 || _i$2 >= _ref$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$2.$array[_ref$2.$offset + _i$2]); (0 >= y.$length ? ($throwRuntimeError("index out of range"), undefined) : y.$array[y.$offset + 0] = (((ca$1.$length >> 8 >> 0) << 24 >>> 24))); (1 >= y.$length ? ($throwRuntimeError("index out of range"), undefined) : y.$array[y.$offset + 1] = ((ca$1.$length << 24 >>> 24))); y = $subslice(y, 2); $copySlice(y, ca$1); y = $subslice(y, ca$1.$length); _i$2++; } m.raw = x; return x; }; certificateRequestMsg.prototype.marshal = function() { return this.$val.marshal(); }; certificateRequestMsg.ptr.prototype.unmarshal = function(data) { var _i, _q, _ref, caLen, cas, casLength, data, i, length, m, numCertTypes, numSigAlgos, sigAndHashLen, x; m = this; m.raw = data; if (data.$length < 5) { return false; } length = (((((((1 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 1]) >>> 0)) << 16 >>> 0) | ((((2 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 2]) >>> 0)) << 8 >>> 0)) >>> 0) | (((3 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 3]) >>> 0))) >>> 0; if (!(((((data.$length >>> 0)) - 4 >>> 0) === length))) { return false; } numCertTypes = (((4 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 4]) >> 0)); data = $subslice(data, 5); if ((numCertTypes === 0) || data.$length <= numCertTypes) { return false; } m.certificateTypes = $makeSlice(sliceType$5, numCertTypes); if (!(($copySlice(m.certificateTypes, data) === numCertTypes))) { return false; } data = $subslice(data, numCertTypes); if (m.hasSignatureAlgorithm) { if (data.$length < 2) { return false; } sigAndHashLen = (((((0 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 0]) << 16 >>> 16)) << 8 << 16 >>> 16) | (((1 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 1]) << 16 >>> 16))) >>> 0; data = $subslice(data, 2); if (!((((sigAndHashLen & 1) >>> 0) === 0))) { return false; } if (data.$length < ((sigAndHashLen >> 0))) { return false; } numSigAlgos = (_q = sigAndHashLen / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); m.supportedSignatureAlgorithms = $makeSlice(sliceType$7, numSigAlgos); _ref = m.supportedSignatureAlgorithms; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; (x = m.supportedSignatureAlgorithms, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i] = ((((((0 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 0]) << 16 >>> 16)) << 8 << 16 >>> 16) | (((1 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 1]) << 16 >>> 16))) >>> 0))); data = $subslice(data, 2); _i++; } } if (data.$length < 2) { return false; } casLength = (((((0 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 0]) << 16 >>> 16)) << 8 << 16 >>> 16) | (((1 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 1]) << 16 >>> 16))) >>> 0; data = $subslice(data, 2); if (data.$length < ((casLength >> 0))) { return false; } cas = $makeSlice(sliceType$5, casLength); $copySlice(cas, data); data = $subslice(data, casLength); m.certificateAuthorities = sliceType$11.nil; while (true) { if (!(cas.$length > 0)) { break; } if (cas.$length < 2) { return false; } caLen = (((((0 >= cas.$length ? ($throwRuntimeError("index out of range"), undefined) : cas.$array[cas.$offset + 0]) << 16 >>> 16)) << 8 << 16 >>> 16) | (((1 >= cas.$length ? ($throwRuntimeError("index out of range"), undefined) : cas.$array[cas.$offset + 1]) << 16 >>> 16))) >>> 0; cas = $subslice(cas, 2); if (cas.$length < ((caLen >> 0))) { return false; } m.certificateAuthorities = $append(m.certificateAuthorities, $subslice(cas, 0, caLen)); cas = $subslice(cas, caLen); } return data.$length === 0; }; certificateRequestMsg.prototype.unmarshal = function(data) { return this.$val.unmarshal(data); }; certificateVerifyMsg.ptr.prototype.marshal = function() { var b, m, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; m = $f.m; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: m = [m]; x = sliceType$5.nil; m[0] = this; if (!(m[0].raw === sliceType$5.nil)) { x = m[0].raw; $s = -1; return x; } b = new cryptobyte.Builder.ptr($ifaceNil, sliceType$5.nil, false, ptrType$15.nil, 0, 0, false, ptrType$16.nil); b.AddUint8(15); $r = b.AddUint24LengthPrefixed((function(m) { return function $b(b$1) { var b$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b$1 = $f.b$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (m[0].hasSignatureAlgorithm) { b$1.AddUint16(((m[0].signatureAlgorithm << 16 >>> 16))); } $r = b$1.AddUint16LengthPrefixed((function(m) { return function(b$2) { var b$2; b$2.AddBytes(m[0].signature); }; })(m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.b$1 = b$1; $f.$s = $s; $f.$r = $r; return $f; }; })(m)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } m[0].raw = b.BytesOrPanic(); x = m[0].raw; $s = -1; return x; /* */ } return; } if ($f === undefined) { $f = { $blk: certificateVerifyMsg.ptr.prototype.marshal }; } $f.b = b; $f.m = m; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; certificateVerifyMsg.prototype.marshal = function() { return this.$val.marshal(); }; certificateVerifyMsg.ptr.prototype.unmarshal = function(data) { var _ptr, data, m, s, s$24ptr; m = this; m.raw = data; s = ($convertSliceType(data, cryptobyte.String)); if (!(s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).Skip(4)) { return false; } if (m.hasSignatureAlgorithm) { if (!(s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))).ReadUint16(((_ptr = (m.$ptr_signatureAlgorithm || (m.$ptr_signatureAlgorithm = new ptrType$36(function() { return this.$target.signatureAlgorithm; }, function($v) { this.$target.signatureAlgorithm = $v; }, m))), new ptrType$18(function() { return (_ptr.$get() << 16 >>> 16); }, function($v) { _ptr.$set(($v << 16 >>> 16)); }, _ptr.$target))))) { return false; } } return readUint16LengthPrefixed((s$24ptr || (s$24ptr = new ptrType$17(function() { return s; }, function($v) { s = $convertSliceType($v, cryptobyte.String); }))), (m.$ptr_signature || (m.$ptr_signature = new ptrType$1(function() { return this.$target.signature; }, function($v) { this.$target.signature = $v; }, m)))) && s.Empty(); }; certificateVerifyMsg.prototype.unmarshal = function(data) { return this.$val.unmarshal(data); }; newSessionTicketMsg.ptr.prototype.marshal = function() { var length, m, ticketLen, x; x = sliceType$5.nil; m = this; if (!(m.raw === sliceType$5.nil)) { x = m.raw; return x; } ticketLen = m.ticket.$length; length = 6 + ticketLen >> 0; x = $makeSlice(sliceType$5, (4 + length >> 0)); (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0] = 4); (1 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 1] = (((length >> 16 >> 0) << 24 >>> 24))); (2 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 2] = (((length >> 8 >> 0) << 24 >>> 24))); (3 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 3] = ((length << 24 >>> 24))); (8 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 8] = (((ticketLen >> 8 >> 0) << 24 >>> 24))); (9 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 9] = ((ticketLen << 24 >>> 24))); $copySlice($subslice(x, 10), m.ticket); m.raw = x; return x; }; newSessionTicketMsg.prototype.marshal = function() { return this.$val.marshal(); }; newSessionTicketMsg.ptr.prototype.unmarshal = function(data) { var data, length, m, ticketLen; m = this; m.raw = data; if (data.$length < 10) { return false; } length = (((((((1 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 1]) >>> 0)) << 16 >>> 0) | ((((2 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 2]) >>> 0)) << 8 >>> 0)) >>> 0) | (((3 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 3]) >>> 0))) >>> 0; if (!(((((data.$length >>> 0)) - 4 >>> 0) === length))) { return false; } ticketLen = ((((8 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 8]) >> 0)) << 8 >> 0) + (((9 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 9]) >> 0)) >> 0; if (!(((data.$length - 10 >> 0) === ticketLen))) { return false; } m.ticket = $subslice(data, 10); return true; }; newSessionTicketMsg.prototype.unmarshal = function(data) { return this.$val.unmarshal(data); }; helloRequestMsg.ptr.prototype.marshal = function() { return new sliceType$5([0, 0, 0, 0]); }; helloRequestMsg.prototype.marshal = function() { return this.$val.marshal(); }; helloRequestMsg.ptr.prototype.unmarshal = function(data) { var data; return data.$length === 4; }; helloRequestMsg.prototype.unmarshal = function(data) { return this.$val.unmarshal(data); }; clientHandshakeStateTLS13.ptr.prototype.handshake = function() { var $24r, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, c, err, err$1, err$10, err$11, err$2, err$3, err$4, err$5, err$6, err$7, err$8, err$9, hs, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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$17 = $f._r$17; _r$18 = $f._r$18; _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; _tuple = $f._tuple; c = $f.c; err = $f.err; err$1 = $f.err$1; err$10 = $f.err$10; err$11 = $f.err$11; err$2 = $f.err$2; err$3 = $f.err$3; err$4 = $f.err$4; err$5 = $f.err$5; err$6 = $f.err$6; err$7 = $f.err$7; err$8 = $f.err$8; err$9 = $f.err$9; hs = $f.hs; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; /* */ if (c.handshakes > 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (c.handshakes > 0) { */ case 1: _r = c.sendAlert(70); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; $s = -1; return errors.New("tls: server selected TLS 1.3 in a renegotiation"); /* } */ case 2: /* */ if ($interfaceIsEqual(hs.ecdheParams, $ifaceNil) || !((hs.hello.keyShares.$length === 1))) { $s = 4; continue; } /* */ $s = 5; continue; /* if ($interfaceIsEqual(hs.ecdheParams, $ifaceNil) || !((hs.hello.keyShares.$length === 1))) { */ case 4: _r$1 = c.sendAlert(80); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 7; case 7: return $24r; /* } */ case 5: _r$2 = hs.checkServerHelloOrHRR(); /* */ $s = 8; case 8: 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))) { $s = -1; return err; } _r$3 = new crypto.Hash(hs.suite.hash).New(); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } hs.transcript = _r$3; _r$4 = hs.hello.marshal(); /* */ $s = 10; case 10: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = hs.transcript.Write(_r$4); /* */ $s = 11; case 11: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; /* */ if (bytes.Equal(hs.serverHello.random, helloRetryRequestRandom)) { $s = 12; continue; } /* */ $s = 13; continue; /* if (bytes.Equal(hs.serverHello.random, helloRetryRequestRandom)) { */ case 12: _r$6 = hs.sendDummyChangeCipherSpec(); /* */ $s = 14; case 14: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } err$1 = _r$6; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } _r$7 = hs.processHelloRetryRequest(); /* */ $s = 15; case 15: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } err$2 = _r$7; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return err$2; } /* } */ case 13: _r$8 = hs.serverHello.marshal(); /* */ $s = 16; case 16: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$9 = hs.transcript.Write(_r$8); /* */ $s = 17; case 17: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$9; c.buffering = true; _r$10 = hs.processServerHello(); /* */ $s = 18; case 18: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } err$3 = _r$10; if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = -1; return err$3; } _r$11 = hs.sendDummyChangeCipherSpec(); /* */ $s = 19; case 19: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } err$4 = _r$11; if (!($interfaceIsEqual(err$4, $ifaceNil))) { $s = -1; return err$4; } _r$12 = hs.establishHandshakeKeys(); /* */ $s = 20; case 20: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } err$5 = _r$12; if (!($interfaceIsEqual(err$5, $ifaceNil))) { $s = -1; return err$5; } _r$13 = hs.readServerParameters(); /* */ $s = 21; case 21: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } err$6 = _r$13; if (!($interfaceIsEqual(err$6, $ifaceNil))) { $s = -1; return err$6; } _r$14 = hs.readServerCertificate(); /* */ $s = 22; case 22: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } err$7 = _r$14; if (!($interfaceIsEqual(err$7, $ifaceNil))) { $s = -1; return err$7; } _r$15 = hs.readServerFinished(); /* */ $s = 23; case 23: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } err$8 = _r$15; if (!($interfaceIsEqual(err$8, $ifaceNil))) { $s = -1; return err$8; } _r$16 = hs.sendClientCertificate(); /* */ $s = 24; case 24: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } err$9 = _r$16; if (!($interfaceIsEqual(err$9, $ifaceNil))) { $s = -1; return err$9; } _r$17 = hs.sendClientFinished(); /* */ $s = 25; case 25: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } err$10 = _r$17; if (!($interfaceIsEqual(err$10, $ifaceNil))) { $s = -1; return err$10; } _r$18 = c.flush(); /* */ $s = 26; case 26: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } _tuple = _r$18; err$11 = _tuple[1]; if (!($interfaceIsEqual(err$11, $ifaceNil))) { $s = -1; return err$11; } atomic.StoreUint32((c.$ptr_handshakeStatus || (c.$ptr_handshakeStatus = new ptrType$24(function() { return this.$target.handshakeStatus; }, function($v) { this.$target.handshakeStatus = $v; }, c))), 1); $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: clientHandshakeStateTLS13.ptr.prototype.handshake }; } $f.$24r = $24r; $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$17 = _r$17; $f._r$18 = _r$18; $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._tuple = _tuple; $f.c = c; $f.err = err; $f.err$1 = err$1; $f.err$10 = err$10; $f.err$11 = err$11; $f.err$2 = err$2; $f.err$3 = err$3; $f.err$4 = err$4; $f.err$5 = err$5; $f.err$6 = err$6; $f.err$7 = err$7; $f.err$8 = err$8; $f.err$9 = err$9; $f.hs = hs; $f.$s = $s; $f.$r = $r; return $f; }; clientHandshakeStateTLS13.prototype.handshake = function() { return this.$val.handshake(); }; clientHandshakeStateTLS13.ptr.prototype.checkServerHelloOrHRR = function() { var _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, c, hs, selectedSuite, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; c = $f.c; hs = $f.hs; selectedSuite = $f.selectedSuite; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; /* */ if (hs.serverHello.supportedVersion === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (hs.serverHello.supportedVersion === 0) { */ case 1: _r = c.sendAlert(109); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; $s = -1; return errors.New("tls: server selected TLS 1.3 using the legacy version field"); /* } */ case 2: /* */ if (!((hs.serverHello.supportedVersion === 772))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!((hs.serverHello.supportedVersion === 772))) { */ case 4: _r$1 = c.sendAlert(47); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = -1; return errors.New("tls: server selected an invalid version after a HelloRetryRequest"); /* } */ case 5: /* */ if (!((hs.serverHello.vers === 771))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!((hs.serverHello.vers === 771))) { */ case 7: _r$2 = c.sendAlert(47); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; $s = -1; return errors.New("tls: server sent an incorrect legacy version"); /* } */ case 8: /* */ if (hs.serverHello.ocspStapling || hs.serverHello.ticketSupported || hs.serverHello.secureRenegotiationSupported || !((hs.serverHello.secureRenegotiation.$length === 0)) || !((hs.serverHello.alpnProtocol.length === 0)) || !((hs.serverHello.scts.$length === 0))) { $s = 10; continue; } /* */ $s = 11; continue; /* if (hs.serverHello.ocspStapling || hs.serverHello.ticketSupported || hs.serverHello.secureRenegotiationSupported || !((hs.serverHello.secureRenegotiation.$length === 0)) || !((hs.serverHello.alpnProtocol.length === 0)) || !((hs.serverHello.scts.$length === 0))) { */ case 10: _r$3 = c.sendAlert(110); /* */ $s = 12; case 12: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $s = -1; return errors.New("tls: server sent a ServerHello extension forbidden in TLS 1.3"); /* } */ case 11: /* */ if (!bytes.Equal(hs.hello.sessionId, hs.serverHello.sessionId)) { $s = 13; continue; } /* */ $s = 14; continue; /* if (!bytes.Equal(hs.hello.sessionId, hs.serverHello.sessionId)) { */ case 13: _r$4 = c.sendAlert(47); /* */ $s = 15; case 15: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; $s = -1; return errors.New("tls: server did not echo the legacy session ID"); /* } */ case 14: /* */ if (!((hs.serverHello.compressionMethod === 0))) { $s = 16; continue; } /* */ $s = 17; continue; /* if (!((hs.serverHello.compressionMethod === 0))) { */ case 16: _r$5 = c.sendAlert(47); /* */ $s = 18; case 18: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; $s = -1; return errors.New("tls: server selected unsupported compression format"); /* } */ case 17: selectedSuite = mutualCipherSuiteTLS13(hs.hello.cipherSuites, hs.serverHello.cipherSuite); /* */ if (!(hs.suite === ptrType$2.nil) && !(selectedSuite === hs.suite)) { $s = 19; continue; } /* */ $s = 20; continue; /* if (!(hs.suite === ptrType$2.nil) && !(selectedSuite === hs.suite)) { */ case 19: _r$6 = c.sendAlert(47); /* */ $s = 21; case 21: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; $s = -1; return errors.New("tls: server changed cipher suite after a HelloRetryRequest"); /* } */ case 20: /* */ if (selectedSuite === ptrType$2.nil) { $s = 22; continue; } /* */ $s = 23; continue; /* if (selectedSuite === ptrType$2.nil) { */ case 22: _r$7 = c.sendAlert(47); /* */ $s = 24; case 24: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$7; $s = -1; return errors.New("tls: server chose an unconfigured cipher suite"); /* } */ case 23: hs.suite = selectedSuite; c.cipherSuite = hs.suite.id; $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: clientHandshakeStateTLS13.ptr.prototype.checkServerHelloOrHRR }; } $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.c = c; $f.hs = hs; $f.selectedSuite = selectedSuite; $f.$s = $s; $f.$r = $r; return $f; }; clientHandshakeStateTLS13.prototype.checkServerHelloOrHRR = function() { return this.$val.checkServerHelloOrHRR(); }; clientHandshakeStateTLS13.ptr.prototype.sendDummyChangeCipherSpec = function() { var _r, _tuple, err, hs, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; hs = $f.hs; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; if (hs.sentDummyCCS) { $s = -1; return $ifaceNil; } hs.sentDummyCCS = true; _r = hs.c.writeRecord(20, new sliceType$5([1])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; err = _tuple[1]; $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: clientHandshakeStateTLS13.ptr.prototype.sendDummyChangeCipherSpec }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.hs = hs; $f.$s = $s; $f.$r = $r; return $f; }; clientHandshakeStateTLS13.prototype.sendDummyChangeCipherSpec = function() { return this.$val.sendDummyChangeCipherSpec(); }; clientHandshakeStateTLS13.ptr.prototype.processHelloRetryRequest = function() { var $24r, $24r$1, _arg, _i, _r, _r$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$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, c, chHash, curveID, curveOK, err, err$1, err$2, err$3, hs, id, msg, ok, ok$1, params, pskBinders, pskSuite, serverHello, ticketAge, transcript, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _arg = $f._arg; _i = $f._i; _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$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$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; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; c = $f.c; chHash = $f.chHash; curveID = $f.curveID; curveOK = $f.curveOK; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; hs = $f.hs; id = $f.id; msg = $f.msg; ok = $f.ok; ok$1 = $f.ok$1; params = $f.params; pskBinders = $f.pskBinders; pskSuite = $f.pskSuite; serverHello = $f.serverHello; ticketAge = $f.ticketAge; transcript = $f.transcript; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; _r = hs.transcript.Sum(sliceType$5.nil); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } chHash = _r; $r = hs.transcript.Reset(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = hs.transcript.Write(new sliceType$5([254, 0, 0, ((chHash.$length << 24 >>> 24))])); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _r$2 = hs.transcript.Write(chHash); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; _r$3 = hs.serverHello.marshal(); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = hs.transcript.Write(_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; /* */ if ((hs.serverHello.selectedGroup === 0) && hs.serverHello.cookie === sliceType$5.nil) { $s = 7; continue; } /* */ $s = 8; continue; /* if ((hs.serverHello.selectedGroup === 0) && hs.serverHello.cookie === sliceType$5.nil) { */ case 7: _r$5 = c.sendAlert(47); /* */ $s = 9; case 9: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; $s = -1; return errors.New("tls: server sent an unnecessary HelloRetryRequest message"); /* } */ case 8: if (!(hs.serverHello.cookie === sliceType$5.nil)) { hs.hello.cookie = hs.serverHello.cookie; } /* */ if (!((hs.serverHello.serverShare.group === 0))) { $s = 10; continue; } /* */ $s = 11; continue; /* if (!((hs.serverHello.serverShare.group === 0))) { */ case 10: _r$6 = c.sendAlert(50); /* */ $s = 12; case 12: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; $s = -1; return errors.New("tls: received malformed key_share extension"); /* } */ case 11: curveID = hs.serverHello.selectedGroup; /* */ if (!((curveID === 0))) { $s = 13; continue; } /* */ $s = 14; continue; /* if (!((curveID === 0))) { */ case 13: curveOK = false; _ref = hs.hello.supportedCurves; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } id = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (id === curveID) { curveOK = true; break; } _i++; } /* */ if (!curveOK) { $s = 15; continue; } /* */ $s = 16; continue; /* if (!curveOK) { */ case 15: _r$7 = c.sendAlert(47); /* */ $s = 17; case 17: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$7; $s = -1; return errors.New("tls: server selected unsupported group"); /* } */ case 16: _r$8 = hs.ecdheParams.CurveID(); /* */ $s = 20; case 20: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } /* */ if (_r$8 === curveID) { $s = 18; continue; } /* */ $s = 19; continue; /* if (_r$8 === curveID) { */ case 18: _r$9 = c.sendAlert(47); /* */ $s = 21; case 21: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$9; $s = -1; return errors.New("tls: server sent an unnecessary HelloRetryRequest key_share"); /* } */ case 19: _r$10 = curveForCurveID(curveID); /* */ $s = 22; case 22: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple = _r$10; ok = _tuple[1]; /* */ if (!((curveID === 29)) && !ok) { $s = 23; continue; } /* */ $s = 24; continue; /* if (!((curveID === 29)) && !ok) { */ case 23: _r$11 = c.sendAlert(80); /* */ $s = 25; case 25: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _r$11; $s = -1; return errors.New("tls: CurvePreferences includes unsupported curve"); /* } */ case 24: _r$12 = generateECDHEParameters(c.config.rand(), curveID); /* */ $s = 26; case 26: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _tuple$1 = _r$12; params = _tuple$1[0]; err = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 27; continue; } /* */ $s = 28; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 27: _r$13 = c.sendAlert(80); /* */ $s = 29; case 29: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _r$13; $s = -1; return err; /* } */ case 28: hs.ecdheParams = params; _r$14 = params.PublicKey(); /* */ $s = 30; case 30: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } hs.hello.keyShares = new sliceType$15([new keyShare.ptr(curveID, _r$14)]); /* } */ case 14: hs.hello.raw = sliceType$5.nil; /* */ if (hs.hello.pskIdentities.$length > 0) { $s = 31; continue; } /* */ $s = 32; continue; /* if (hs.hello.pskIdentities.$length > 0) { */ case 31: pskSuite = cipherSuiteTLS13ByID(hs.session.cipherSuite); /* */ if (pskSuite === ptrType$2.nil) { $s = 33; continue; } /* */ $s = 34; continue; /* if (pskSuite === ptrType$2.nil) { */ case 33: _r$15 = c.sendAlert(80); /* */ $s = 35; case 35: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } $24r = _r$15; $s = 36; case 36: return $24r; /* } */ case 34: /* */ if (pskSuite.hash === hs.suite.hash) { $s = 37; continue; } /* */ $s = 38; continue; /* if (pskSuite.hash === hs.suite.hash) { */ case 37: _r$16 = c.config.time(); /* */ $s = 40; case 40: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _r$17 = $clone(_r$16, time.Time).Sub($clone(hs.session.receivedAt, time.Time)); /* */ $s = 41; case 41: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } ticketAge = (($div64(_r$17, new time.Duration(0, 1000000), false).$low >>> 0)); (x = hs.hello.pskIdentities, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])).obfuscatedTicketAge = ticketAge + hs.session.ageAdd >>> 0; _r$18 = new crypto.Hash(hs.suite.hash).New(); /* */ $s = 42; case 42: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } transcript = _r$18; _r$19 = transcript.Write(new sliceType$5([254, 0, 0, ((chHash.$length << 24 >>> 24))])); /* */ $s = 43; case 43: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } _r$19; _r$20 = transcript.Write(chHash); /* */ $s = 44; case 44: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } _r$20; _r$21 = hs.serverHello.marshal(); /* */ $s = 45; case 45: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } _r$22 = transcript.Write(_r$21); /* */ $s = 46; case 46: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; } _r$22; _r$23 = hs.hello.marshalWithoutBinders(); /* */ $s = 47; case 47: if($c) { $c = false; _r$23 = _r$23.$blk(); } if (_r$23 && _r$23.$blk !== undefined) { break s; } _r$24 = transcript.Write(_r$23); /* */ $s = 48; case 48: if($c) { $c = false; _r$24 = _r$24.$blk(); } if (_r$24 && _r$24.$blk !== undefined) { break s; } _r$24; _r$25 = hs.suite.finishedHash(hs.binderKey, transcript); /* */ $s = 49; case 49: if($c) { $c = false; _r$25 = _r$25.$blk(); } if (_r$25 && _r$25.$blk !== undefined) { break s; } pskBinders = new sliceType$11([_r$25]); $r = hs.hello.updateBinders(pskBinders); /* */ $s = 50; case 50: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 39; continue; /* } else { */ case 38: hs.hello.pskIdentities = sliceType$16.nil; hs.hello.pskBinders = sliceType$11.nil; /* } */ case 39: /* } */ case 32: _r$26 = hs.hello.marshal(); /* */ $s = 51; case 51: if($c) { $c = false; _r$26 = _r$26.$blk(); } if (_r$26 && _r$26.$blk !== undefined) { break s; } _r$27 = hs.transcript.Write(_r$26); /* */ $s = 52; case 52: if($c) { $c = false; _r$27 = _r$27.$blk(); } if (_r$27 && _r$27.$blk !== undefined) { break s; } _r$27; _r$28 = hs.hello.marshal(); /* */ $s = 53; case 53: if($c) { $c = false; _r$28 = _r$28.$blk(); } if (_r$28 && _r$28.$blk !== undefined) { break s; } _arg = _r$28; _r$29 = c.writeRecord(22, _arg); /* */ $s = 54; case 54: if($c) { $c = false; _r$29 = _r$29.$blk(); } if (_r$29 && _r$29.$blk !== undefined) { break s; } _tuple$2 = _r$29; err$1 = _tuple$2[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } _r$30 = c.readHandshake(); /* */ $s = 55; case 55: if($c) { $c = false; _r$30 = _r$30.$blk(); } if (_r$30 && _r$30.$blk !== undefined) { break s; } _tuple$3 = _r$30; msg = _tuple$3[0]; err$2 = _tuple$3[1]; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return err$2; } _tuple$4 = $assertType(msg, ptrType$30, true); serverHello = _tuple$4[0]; ok$1 = _tuple$4[1]; /* */ if (!ok$1) { $s = 56; continue; } /* */ $s = 57; continue; /* if (!ok$1) { */ case 56: _r$31 = c.sendAlert(10); /* */ $s = 58; case 58: if($c) { $c = false; _r$31 = _r$31.$blk(); } if (_r$31 && _r$31.$blk !== undefined) { break s; } _r$31; _r$32 = unexpectedMessageError(serverHello, msg); /* */ $s = 59; case 59: if($c) { $c = false; _r$32 = _r$32.$blk(); } if (_r$32 && _r$32.$blk !== undefined) { break s; } $24r$1 = _r$32; $s = 60; case 60: return $24r$1; /* } */ case 57: hs.serverHello = serverHello; _r$33 = hs.checkServerHelloOrHRR(); /* */ $s = 61; case 61: if($c) { $c = false; _r$33 = _r$33.$blk(); } if (_r$33 && _r$33.$blk !== undefined) { break s; } err$3 = _r$33; if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = -1; return err$3; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: clientHandshakeStateTLS13.ptr.prototype.processHelloRetryRequest }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._arg = _arg; $f._i = _i; $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$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$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._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f.c = c; $f.chHash = chHash; $f.curveID = curveID; $f.curveOK = curveOK; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.hs = hs; $f.id = id; $f.msg = msg; $f.ok = ok; $f.ok$1 = ok$1; $f.params = params; $f.pskBinders = pskBinders; $f.pskSuite = pskSuite; $f.serverHello = serverHello; $f.ticketAge = ticketAge; $f.transcript = transcript; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; clientHandshakeStateTLS13.prototype.processHelloRetryRequest = function() { return this.$val.processHelloRetryRequest(); }; clientHandshakeStateTLS13.ptr.prototype.processServerHello = function() { var $24r, $24r$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, c, hs, pskSuite, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$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; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; c = $f.c; hs = $f.hs; pskSuite = $f.pskSuite; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; /* */ if (bytes.Equal(hs.serverHello.random, helloRetryRequestRandom)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (bytes.Equal(hs.serverHello.random, helloRetryRequestRandom)) { */ case 1: _r = c.sendAlert(10); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; $s = -1; return errors.New("tls: server sent two HelloRetryRequest messages"); /* } */ case 2: /* */ if (!((hs.serverHello.cookie.$length === 0))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!((hs.serverHello.cookie.$length === 0))) { */ case 4: _r$1 = c.sendAlert(110); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = -1; return errors.New("tls: server sent a cookie in a normal ServerHello"); /* } */ case 5: /* */ if (!((hs.serverHello.selectedGroup === 0))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!((hs.serverHello.selectedGroup === 0))) { */ case 7: _r$2 = c.sendAlert(50); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; $s = -1; return errors.New("tls: malformed key_share extension"); /* } */ case 8: /* */ if (hs.serverHello.serverShare.group === 0) { $s = 10; continue; } /* */ $s = 11; continue; /* if (hs.serverHello.serverShare.group === 0) { */ case 10: _r$3 = c.sendAlert(47); /* */ $s = 12; case 12: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $s = -1; return errors.New("tls: server did not send a key share"); /* } */ case 11: _r$4 = hs.ecdheParams.CurveID(); /* */ $s = 15; case 15: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } /* */ if (!((hs.serverHello.serverShare.group === _r$4))) { $s = 13; continue; } /* */ $s = 14; continue; /* if (!((hs.serverHello.serverShare.group === _r$4))) { */ case 13: _r$5 = c.sendAlert(47); /* */ $s = 16; case 16: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; $s = -1; return errors.New("tls: server selected unsupported group"); /* } */ case 14: if (!hs.serverHello.selectedIdentityPresent) { $s = -1; return $ifaceNil; } /* */ if (((hs.serverHello.selectedIdentity >> 0)) >= hs.hello.pskIdentities.$length) { $s = 17; continue; } /* */ $s = 18; continue; /* if (((hs.serverHello.selectedIdentity >> 0)) >= hs.hello.pskIdentities.$length) { */ case 17: _r$6 = c.sendAlert(47); /* */ $s = 19; case 19: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; $s = -1; return errors.New("tls: server selected an invalid PSK"); /* } */ case 18: /* */ if (!((hs.hello.pskIdentities.$length === 1)) || hs.session === ptrType$37.nil) { $s = 20; continue; } /* */ $s = 21; continue; /* if (!((hs.hello.pskIdentities.$length === 1)) || hs.session === ptrType$37.nil) { */ case 20: _r$7 = c.sendAlert(80); /* */ $s = 22; case 22: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } $24r = _r$7; $s = 23; case 23: return $24r; /* } */ case 21: pskSuite = cipherSuiteTLS13ByID(hs.session.cipherSuite); /* */ if (pskSuite === ptrType$2.nil) { $s = 24; continue; } /* */ $s = 25; continue; /* if (pskSuite === ptrType$2.nil) { */ case 24: _r$8 = c.sendAlert(80); /* */ $s = 26; case 26: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } $24r$1 = _r$8; $s = 27; case 27: return $24r$1; /* } */ case 25: /* */ if (!((pskSuite.hash === hs.suite.hash))) { $s = 28; continue; } /* */ $s = 29; continue; /* if (!((pskSuite.hash === hs.suite.hash))) { */ case 28: _r$9 = c.sendAlert(47); /* */ $s = 30; case 30: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$9; $s = -1; return errors.New("tls: server selected an invalid PSK and cipher suite pair"); /* } */ case 29: hs.usingPSK = true; c.didResume = true; c.peerCertificates = hs.session.serverCertificates; c.verifiedChains = hs.session.verifiedChains; c.ocspResponse = hs.session.ocspResponse; c.scts = hs.session.scts; $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: clientHandshakeStateTLS13.ptr.prototype.processServerHello }; } $f.$24r = $24r; $f.$24r$1 = $24r$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._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f.c = c; $f.hs = hs; $f.pskSuite = pskSuite; $f.$s = $s; $f.$r = $r; return $f; }; clientHandshakeStateTLS13.prototype.processServerHello = function() { return this.$val.processServerHello(); }; clientHandshakeStateTLS13.ptr.prototype.establishHandshakeKeys = function() { var _arg, _arg$1, _arg$2, _arg$3, _r, _r$1, _r$10, _r$11, _r$12, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, c, clientSecret, earlySecret, err, handshakeSecret, hs, serverSecret, sharedKey, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _r = $f._r; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _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; c = $f.c; clientSecret = $f.clientSecret; earlySecret = $f.earlySecret; err = $f.err; handshakeSecret = $f.handshakeSecret; hs = $f.hs; serverSecret = $f.serverSecret; sharedKey = $f.sharedKey; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; _r = hs.ecdheParams.SharedKey(hs.serverHello.serverShare.data); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } sharedKey = _r; /* */ if (sharedKey === sliceType$5.nil) { $s = 2; continue; } /* */ $s = 3; continue; /* if (sharedKey === sliceType$5.nil) { */ case 2: _r$1 = c.sendAlert(47); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = -1; return errors.New("tls: invalid server key share"); /* } */ case 3: earlySecret = hs.earlySecret; /* */ if (!hs.usingPSK) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!hs.usingPSK) { */ case 5: _r$2 = hs.suite.extract(sliceType$5.nil, sliceType$5.nil); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } earlySecret = _r$2; /* } */ case 6: _arg = sharedKey; _r$3 = hs.suite.deriveSecret(earlySecret, "derived", $ifaceNil); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _arg$1 = _r$3; _r$4 = hs.suite.extract(_arg, _arg$1); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } handshakeSecret = _r$4; _r$5 = hs.suite.deriveSecret(handshakeSecret, "c hs traffic", hs.transcript); /* */ $s = 10; case 10: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } clientSecret = _r$5; $r = c.out.setTrafficSecret(hs.suite, clientSecret); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$6 = hs.suite.deriveSecret(handshakeSecret, "s hs traffic", hs.transcript); /* */ $s = 12; case 12: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } serverSecret = _r$6; $r = c.in$27.setTrafficSecret(hs.suite, serverSecret); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$7 = c.config.writeKeyLog("CLIENT_HANDSHAKE_TRAFFIC_SECRET", hs.hello.random, clientSecret); /* */ $s = 14; case 14: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } err = _r$7; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 15; continue; } /* */ $s = 16; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 15: _r$8 = c.sendAlert(80); /* */ $s = 17; case 17: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$8; $s = -1; return err; /* } */ case 16: _r$9 = c.config.writeKeyLog("SERVER_HANDSHAKE_TRAFFIC_SECRET", hs.hello.random, serverSecret); /* */ $s = 18; case 18: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err = _r$9; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 19; continue; } /* */ $s = 20; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 19: _r$10 = c.sendAlert(80); /* */ $s = 21; case 21: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; $s = -1; return err; /* } */ case 20: _arg$2 = sliceType$5.nil; _r$11 = hs.suite.deriveSecret(handshakeSecret, "derived", $ifaceNil); /* */ $s = 22; case 22: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _arg$3 = _r$11; _r$12 = hs.suite.extract(_arg$2, _arg$3); /* */ $s = 23; case 23: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } hs.masterSecret = _r$12; $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: clientHandshakeStateTLS13.ptr.prototype.establishHandshakeKeys }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $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$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.c = c; $f.clientSecret = clientSecret; $f.earlySecret = earlySecret; $f.err = err; $f.handshakeSecret = handshakeSecret; $f.hs = hs; $f.serverSecret = serverSecret; $f.sharedKey = sharedKey; $f.$s = $s; $f.$r = $r; return $f; }; clientHandshakeStateTLS13.prototype.establishHandshakeKeys = function() { return this.$val.establishHandshakeKeys(); }; clientHandshakeStateTLS13.ptr.prototype.readServerParameters = function() { var $24r, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, _tuple$1, c, encryptedExtensions, err, err$1, hs, msg, ok, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; c = $f.c; encryptedExtensions = $f.encryptedExtensions; err = $f.err; err$1 = $f.err$1; hs = $f.hs; msg = $f.msg; ok = $f.ok; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; _r = c.readHandshake(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; msg = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _tuple$1 = $assertType(msg, ptrType$38, true); encryptedExtensions = _tuple$1[0]; ok = _tuple$1[1]; /* */ if (!ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!ok) { */ case 2: _r$1 = c.sendAlert(10); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _r$2 = unexpectedMessageError(encryptedExtensions, msg); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 6; case 6: return $24r; /* } */ case 3: _r$3 = encryptedExtensions.marshal(); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = hs.transcript.Write(_r$3); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; err$1 = checkALPN(hs.hello.alpnProtocols, encryptedExtensions.alpnProtocol); /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 9; continue; } /* */ $s = 10; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 9: _r$5 = c.sendAlert(110); /* */ $s = 11; case 11: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; $s = -1; return err$1; /* } */ case 10: c.clientProtocol = encryptedExtensions.alpnProtocol; $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: clientHandshakeStateTLS13.ptr.prototype.readServerParameters }; } $f.$24r = $24r; $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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.c = c; $f.encryptedExtensions = encryptedExtensions; $f.err = err; $f.err$1 = err$1; $f.hs = hs; $f.msg = msg; $f.ok = ok; $f.$s = $s; $f.$r = $r; return $f; }; clientHandshakeStateTLS13.prototype.readServerParameters = function() { return this.$val.readServerParameters(); }; clientHandshakeStateTLS13.ptr.prototype.readServerCertificate = function() { var $24r, $24r$1, $24r$2, $24r$3, _r, _r$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$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, c, certMsg, certReq, certVerify, err, err$1, err$2, err$3, hs, msg, ok, sigHash, sigType, signed, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; _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$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$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; _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; c = $f.c; certMsg = $f.certMsg; certReq = $f.certReq; certVerify = $f.certVerify; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; hs = $f.hs; msg = $f.msg; ok = $f.ok; sigHash = $f.sigHash; sigType = $f.sigType; signed = $f.signed; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; /* */ if (hs.usingPSK) { $s = 1; continue; } /* */ $s = 2; continue; /* if (hs.usingPSK) { */ case 1: /* */ if (!(c.config.VerifyConnection === $throwNilPointerError)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!(c.config.VerifyConnection === $throwNilPointerError)) { */ case 3: _r = c.config.VerifyConnection($clone(c.connectionStateLocked(), ConnectionState)); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 6: _r$1 = c.sendAlert(42); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = -1; return err; /* } */ case 7: /* } */ case 4: $s = -1; return $ifaceNil; /* } */ case 2: _r$2 = c.readHandshake(); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; msg = _tuple[0]; err$1 = _tuple[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } _tuple$1 = $assertType(msg, ptrType$39, true); certReq = _tuple$1[0]; ok = _tuple$1[1]; /* */ if (ok) { $s = 10; continue; } /* */ $s = 11; continue; /* if (ok) { */ case 10: _r$3 = certReq.marshal(); /* */ $s = 12; case 12: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = hs.transcript.Write(_r$3); /* */ $s = 13; case 13: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; hs.certReq = certReq; _r$5 = c.readHandshake(); /* */ $s = 14; case 14: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$2 = _r$5; msg = _tuple$2[0]; err$1 = _tuple$2[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } /* } */ case 11: _tuple$3 = $assertType(msg, ptrType$27, true); certMsg = _tuple$3[0]; ok = _tuple$3[1]; /* */ if (!ok) { $s = 15; continue; } /* */ $s = 16; continue; /* if (!ok) { */ case 15: _r$6 = c.sendAlert(10); /* */ $s = 17; case 17: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; _r$7 = unexpectedMessageError(certMsg, msg); /* */ $s = 18; case 18: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } $24r = _r$7; $s = 19; case 19: return $24r; /* } */ case 16: /* */ if (certMsg.certificate.Certificate.$length === 0) { $s = 20; continue; } /* */ $s = 21; continue; /* if (certMsg.certificate.Certificate.$length === 0) { */ case 20: _r$8 = c.sendAlert(50); /* */ $s = 22; case 22: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$8; $s = -1; return errors.New("tls: received empty certificates message"); /* } */ case 21: _r$9 = certMsg.marshal(); /* */ $s = 23; case 23: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$10 = hs.transcript.Write(_r$9); /* */ $s = 24; case 24: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; c.scts = certMsg.certificate.SignedCertificateTimestamps; c.ocspResponse = certMsg.certificate.OCSPStaple; _r$11 = c.verifyServerCertificate(certMsg.certificate.Certificate); /* */ $s = 25; case 25: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } err$2 = _r$11; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return err$2; } _r$12 = c.readHandshake(); /* */ $s = 26; case 26: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _tuple$4 = _r$12; msg = _tuple$4[0]; err$1 = _tuple$4[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } _tuple$5 = $assertType(msg, ptrType$28, true); certVerify = _tuple$5[0]; ok = _tuple$5[1]; /* */ if (!ok) { $s = 27; continue; } /* */ $s = 28; continue; /* if (!ok) { */ case 27: _r$13 = c.sendAlert(10); /* */ $s = 29; case 29: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _r$13; _r$14 = unexpectedMessageError(certVerify, msg); /* */ $s = 30; case 30: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } $24r$1 = _r$14; $s = 31; case 31: return $24r$1; /* } */ case 28: /* */ if (!isSupportedSignatureAlgorithm(certVerify.signatureAlgorithm, supportedSignatureAlgorithms)) { $s = 32; continue; } /* */ $s = 33; continue; /* if (!isSupportedSignatureAlgorithm(certVerify.signatureAlgorithm, supportedSignatureAlgorithms)) { */ case 32: _r$15 = c.sendAlert(47); /* */ $s = 34; case 34: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _r$15; $s = -1; return errors.New("tls: certificate used with invalid signature algorithm"); /* } */ case 33: _r$16 = typeAndHashFromSignatureScheme(certVerify.signatureAlgorithm); /* */ $s = 35; case 35: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _tuple$6 = _r$16; sigType = _tuple$6[0]; sigHash = _tuple$6[1]; err$1 = _tuple$6[2]; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 36; continue; } /* */ $s = 37; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 36: _r$17 = c.sendAlert(80); /* */ $s = 38; case 38: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } $24r$2 = _r$17; $s = 39; case 39: return $24r$2; /* } */ case 37: /* */ if ((sigType === 225) || (sigHash === 3)) { $s = 40; continue; } /* */ $s = 41; continue; /* if ((sigType === 225) || (sigHash === 3)) { */ case 40: _r$18 = c.sendAlert(47); /* */ $s = 42; case 42: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } _r$18; $s = -1; return errors.New("tls: certificate used with invalid signature algorithm"); /* } */ case 41: _r$19 = signedMessage(sigHash, "TLS 1.3, server CertificateVerify\x00", hs.transcript); /* */ $s = 43; case 43: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } signed = _r$19; _r$20 = verifyHandshakeSignature(sigType, (x = c.peerCertificates, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])).PublicKey, sigHash, signed, certVerify.signature); /* */ $s = 44; case 44: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } err$3 = _r$20; /* */ if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = 45; continue; } /* */ $s = 46; continue; /* if (!($interfaceIsEqual(err$3, $ifaceNil))) { */ case 45: _r$21 = c.sendAlert(51); /* */ $s = 47; case 47: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } _r$21; _r$22 = err$3.Error(); /* */ $s = 48; case 48: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; } _r$23 = errors.New("tls: invalid signature by the server certificate: " + _r$22); /* */ $s = 49; case 49: if($c) { $c = false; _r$23 = _r$23.$blk(); } if (_r$23 && _r$23.$blk !== undefined) { break s; } $24r$3 = _r$23; $s = 50; case 50: return $24r$3; /* } */ case 46: _r$24 = certVerify.marshal(); /* */ $s = 51; case 51: if($c) { $c = false; _r$24 = _r$24.$blk(); } if (_r$24 && _r$24.$blk !== undefined) { break s; } _r$25 = hs.transcript.Write(_r$24); /* */ $s = 52; case 52: if($c) { $c = false; _r$25 = _r$25.$blk(); } if (_r$25 && _r$25.$blk !== undefined) { break s; } _r$25; $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: clientHandshakeStateTLS13.ptr.prototype.readServerCertificate }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $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$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$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._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.c = c; $f.certMsg = certMsg; $f.certReq = certReq; $f.certVerify = certVerify; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.hs = hs; $f.msg = msg; $f.ok = ok; $f.sigHash = sigHash; $f.sigType = sigType; $f.signed = signed; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; clientHandshakeStateTLS13.prototype.readServerCertificate = function() { return this.$val.readServerCertificate(); }; clientHandshakeStateTLS13.ptr.prototype.readServerFinished = function() { var $24r, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, c, err, expectedMAC, finished, hs, msg, ok, serverSecret, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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$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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; c = $f.c; err = $f.err; expectedMAC = $f.expectedMAC; finished = $f.finished; hs = $f.hs; msg = $f.msg; ok = $f.ok; serverSecret = $f.serverSecret; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; _r = c.readHandshake(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; msg = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _tuple$1 = $assertType(msg, ptrType$29, true); finished = _tuple$1[0]; ok = _tuple$1[1]; /* */ if (!ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!ok) { */ case 2: _r$1 = c.sendAlert(10); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _r$2 = unexpectedMessageError(finished, msg); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 6; case 6: return $24r; /* } */ case 3: _r$3 = hs.suite.finishedHash(c.in$27.trafficSecret, hs.transcript); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } expectedMAC = _r$3; /* */ if (!hmac.Equal(expectedMAC, finished.verifyData)) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!hmac.Equal(expectedMAC, finished.verifyData)) { */ case 8: _r$4 = c.sendAlert(51); /* */ $s = 10; case 10: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; $s = -1; return errors.New("tls: invalid server finished hash"); /* } */ case 9: _r$5 = finished.marshal(); /* */ $s = 11; case 11: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$6 = hs.transcript.Write(_r$5); /* */ $s = 12; case 12: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; _r$7 = hs.suite.deriveSecret(hs.masterSecret, "c ap traffic", hs.transcript); /* */ $s = 13; case 13: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } hs.trafficSecret = _r$7; _r$8 = hs.suite.deriveSecret(hs.masterSecret, "s ap traffic", hs.transcript); /* */ $s = 14; case 14: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } serverSecret = _r$8; $r = c.in$27.setTrafficSecret(hs.suite, serverSecret); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$9 = c.config.writeKeyLog("CLIENT_TRAFFIC_SECRET_0", hs.hello.random, hs.trafficSecret); /* */ $s = 16; case 16: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err = _r$9; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 17; continue; } /* */ $s = 18; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 17: _r$10 = c.sendAlert(80); /* */ $s = 19; case 19: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; $s = -1; return err; /* } */ case 18: _r$11 = c.config.writeKeyLog("SERVER_TRAFFIC_SECRET_0", hs.hello.random, serverSecret); /* */ $s = 20; case 20: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } err = _r$11; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 21; continue; } /* */ $s = 22; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 21: _r$12 = c.sendAlert(80); /* */ $s = 23; case 23: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _r$12; $s = -1; return err; /* } */ case 22: _r$13 = hs.suite.exportKeyingMaterial(hs.masterSecret, hs.transcript); /* */ $s = 24; case 24: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } c.ekm = _r$13; $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: clientHandshakeStateTLS13.ptr.prototype.readServerFinished }; } $f.$24r = $24r; $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$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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.c = c; $f.err = err; $f.expectedMAC = expectedMAC; $f.finished = finished; $f.hs = hs; $f.msg = msg; $f.ok = ok; $f.serverSecret = serverSecret; $f.$s = $s; $f.$r = $r; return $f; }; clientHandshakeStateTLS13.prototype.readServerFinished = function() { return this.$val.readServerFinished(); }; clientHandshakeStateTLS13.ptr.prototype.sendClientCertificate = function() { var $24r, $24r$1, _arg, _arg$1, _r, _r$1, _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, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, c, cert, certMsg, certVerifyMsg, err, err$1, err$2, hs, sig, sigHash, sigType, signOpts, signed, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _arg = $f._arg; _arg$1 = $f._arg$1; _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$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; _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; c = $f.c; cert = $f.cert; certMsg = $f.certMsg; certVerifyMsg = $f.certVerifyMsg; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; hs = $f.hs; sig = $f.sig; sigHash = $f.sigHash; sigType = $f.sigType; signOpts = $f.signOpts; signed = $f.signed; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; if (hs.certReq === ptrType$39.nil) { $s = -1; return $ifaceNil; } _r = c.getClientCertificate(new CertificateRequestInfo.ptr(hs.certReq.certificateAuthorities, hs.certReq.supportedSignatureAlgorithms, c.vers, hs.ctx)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; cert = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } certMsg = new certificateMsgTLS13.ptr(sliceType$5.nil, new Certificate.ptr(sliceType$11.nil, $ifaceNil, sliceType$7.nil, sliceType$5.nil, sliceType$11.nil, ptrType$5.nil), false, false); Certificate.copy(certMsg.certificate, cert); certMsg.scts = hs.certReq.scts && cert.SignedCertificateTimestamps.$length > 0; certMsg.ocspStapling = hs.certReq.ocspStapling && cert.OCSPStaple.$length > 0; _r$1 = certMsg.marshal(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = hs.transcript.Write(_r$1); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; _r$3 = certMsg.marshal(); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _arg = _r$3; _r$4 = c.writeRecord(22, _arg); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$1 = _r$4; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } if (cert.Certificate.$length === 0) { $s = -1; return $ifaceNil; } certVerifyMsg = new certificateVerifyMsg.ptr(sliceType$5.nil, false, 0, sliceType$5.nil); certVerifyMsg.hasSignatureAlgorithm = true; _r$5 = selectSignatureScheme(c.vers, cert, hs.certReq.supportedSignatureAlgorithms); /* */ $s = 6; case 6: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$2 = _r$5; certVerifyMsg.signatureAlgorithm = _tuple$2[0]; err = _tuple$2[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 7: _r$6 = c.sendAlert(40); /* */ $s = 9; case 9: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; $s = -1; return err; /* } */ case 8: _r$7 = typeAndHashFromSignatureScheme(certVerifyMsg.signatureAlgorithm); /* */ $s = 10; case 10: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _tuple$3 = _r$7; sigType = _tuple$3[0]; sigHash = _tuple$3[1]; err = _tuple$3[2]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 11; continue; } /* */ $s = 12; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 11: _r$8 = c.sendAlert(80); /* */ $s = 13; case 13: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } $24r = _r$8; $s = 14; case 14: return $24r; /* } */ case 12: _r$9 = signedMessage(sigHash, "TLS 1.3, client CertificateVerify\x00", hs.transcript); /* */ $s = 15; case 15: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } signed = _r$9; signOpts = (new crypto.Hash(sigHash)); if (sigType === 226) { signOpts = new rsa.PSSOptions.ptr(-1, sigHash); } _r$10 = $assertType(cert.PrivateKey, crypto.Signer).Sign(c.config.rand(), signed, signOpts); /* */ $s = 16; case 16: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$4 = _r$10; sig = _tuple$4[0]; err = _tuple$4[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 17; continue; } /* */ $s = 18; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 17: _r$11 = c.sendAlert(80); /* */ $s = 19; case 19: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _r$11; _r$12 = err.Error(); /* */ $s = 20; case 20: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _r$13 = errors.New("tls: failed to sign handshake: " + _r$12); /* */ $s = 21; case 21: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } $24r$1 = _r$13; $s = 22; case 22: return $24r$1; /* } */ case 18: certVerifyMsg.signature = sig; _r$14 = certVerifyMsg.marshal(); /* */ $s = 23; case 23: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _r$15 = hs.transcript.Write(_r$14); /* */ $s = 24; case 24: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _r$15; _r$16 = certVerifyMsg.marshal(); /* */ $s = 25; case 25: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _arg$1 = _r$16; _r$17 = c.writeRecord(22, _arg$1); /* */ $s = 26; case 26: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } _tuple$5 = _r$17; err$2 = _tuple$5[1]; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return err$2; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: clientHandshakeStateTLS13.ptr.prototype.sendClientCertificate }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._arg = _arg; $f._arg$1 = _arg$1; $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$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._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.c = c; $f.cert = cert; $f.certMsg = certMsg; $f.certVerifyMsg = certVerifyMsg; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.hs = hs; $f.sig = sig; $f.sigHash = sigHash; $f.sigType = sigType; $f.signOpts = signOpts; $f.signed = signed; $f.$s = $s; $f.$r = $r; return $f; }; clientHandshakeStateTLS13.prototype.sendClientCertificate = function() { return this.$val.sendClientCertificate(); }; clientHandshakeStateTLS13.ptr.prototype.sendClientFinished = function() { var _arg, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, c, err, finished, hs, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _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; _tuple = $f._tuple; c = $f.c; err = $f.err; finished = $f.finished; hs = $f.hs; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; _r = hs.suite.finishedHash(c.out.trafficSecret, hs.transcript); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } finished = new finishedMsg.ptr(sliceType$5.nil, _r); _r$1 = finished.marshal(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = hs.transcript.Write(_r$1); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; _r$3 = finished.marshal(); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _arg = _r$3; _r$4 = c.writeRecord(22, _arg); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple = _r$4; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $r = c.out.setTrafficSecret(hs.suite, hs.trafficSecret); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!c.config.SessionTicketsDisabled && !($interfaceIsEqual(c.config.ClientSessionCache, $ifaceNil))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!c.config.SessionTicketsDisabled && !($interfaceIsEqual(c.config.ClientSessionCache, $ifaceNil))) { */ case 7: _r$5 = hs.suite.deriveSecret(hs.masterSecret, "res master", hs.transcript); /* */ $s = 9; case 9: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } c.resumptionSecret = _r$5; /* } */ case 8: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: clientHandshakeStateTLS13.ptr.prototype.sendClientFinished }; } $f._arg = _arg; $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._tuple = _tuple; $f.c = c; $f.err = err; $f.finished = finished; $f.hs = hs; $f.$s = $s; $f.$r = $r; return $f; }; clientHandshakeStateTLS13.prototype.sendClientFinished = function() { return this.$val.sendClientFinished(); }; Conn.ptr.prototype.handleNewSessionTicket = function(msg) { var $24r, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, c, cacheKey, cipherSuite$1, lifetime, msg, session, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; c = $f.c; cacheKey = $f.cacheKey; cipherSuite$1 = $f.cipherSuite$1; lifetime = $f.lifetime; msg = $f.msg; session = $f.session; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; /* */ if (!c.isClient) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!c.isClient) { */ case 1: _r = c.sendAlert(10); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; $s = -1; return errors.New("tls: received new session ticket from a client"); /* } */ case 2: if (c.config.SessionTicketsDisabled || $interfaceIsEqual(c.config.ClientSessionCache, $ifaceNil)) { $s = -1; return $ifaceNil; } if (msg.lifetime === 0) { $s = -1; return $ifaceNil; } lifetime = $mul64((new time.Duration(0, msg.lifetime)), new time.Duration(0, 1000000000)); /* */ if ((lifetime.$high > 140815 || (lifetime.$high === 140815 && lifetime.$low > 4180213760))) { $s = 4; continue; } /* */ $s = 5; continue; /* if ((lifetime.$high > 140815 || (lifetime.$high === 140815 && lifetime.$low > 4180213760))) { */ case 4: _r$1 = c.sendAlert(47); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = -1; return errors.New("tls: received a session ticket with invalid lifetime"); /* } */ case 5: cipherSuite$1 = cipherSuiteTLS13ByID(c.cipherSuite); /* */ if (cipherSuite$1 === ptrType$2.nil || c.resumptionSecret === sliceType$5.nil) { $s = 7; continue; } /* */ $s = 8; continue; /* if (cipherSuite$1 === ptrType$2.nil || c.resumptionSecret === sliceType$5.nil) { */ case 7: _r$2 = c.sendAlert(80); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 10; case 10: return $24r; /* } */ case 8: _r$3 = c.config.time(); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = c.config.time(); /* */ $s = 12; case 12: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = $clone(_r$4, time.Time).Add(lifetime); /* */ $s = 13; case 13: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } session = new ClientSessionState.ptr(msg.label, c.vers, c.cipherSuite, c.resumptionSecret, c.peerCertificates, c.verifiedChains, $clone(_r$3, time.Time), c.ocspResponse, c.scts, msg.nonce, $clone(_r$5, time.Time), msg.ageAdd); _r$6 = c.conn.RemoteAddr(); /* */ $s = 14; case 14: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$7 = clientSessionCacheKey(_r$6, c.config); /* */ $s = 15; case 15: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } cacheKey = _r$7; $r = c.config.ClientSessionCache.Put(cacheKey, session); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.handleNewSessionTicket }; } $f.$24r = $24r; $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.c = c; $f.cacheKey = cacheKey; $f.cipherSuite$1 = cipherSuite$1; $f.lifetime = lifetime; $f.msg = msg; $f.session = session; $f.$s = $s; $f.$r = $r; return $f; }; Conn.prototype.handleNewSessionTicket = function(msg) { return this.$val.handleNewSessionTicket(msg); }; Conn.ptr.prototype.makeClientHello = function() { var $24r, $24r$1, _i, _i$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _ref, _ref$1, _tuple, _tuple$1, _tuple$2, _tuple$3, c, clientHelloVersion, config, configCipherSuites, curveID, err, err$1, hello, l, nextProtosLength, ok, params, preferenceOrder, proto, suite, suiteId, supportedVersions$1, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _i = $f._i; _i$1 = $f._i$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; _r$7 = $f._r$7; _r$8 = $f._r$8; _ref = $f._ref; _ref$1 = $f._ref$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; c = $f.c; clientHelloVersion = $f.clientHelloVersion; config = $f.config; configCipherSuites = $f.configCipherSuites; curveID = $f.curveID; err = $f.err; err$1 = $f.err$1; hello = $f.hello; l = $f.l; nextProtosLength = $f.nextProtosLength; ok = $f.ok; params = $f.params; preferenceOrder = $f.preferenceOrder; proto = $f.proto; suite = $f.suite; suiteId = $f.suiteId; supportedVersions$1 = $f.supportedVersions$1; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; config = c.config; if ((config.ServerName.length === 0) && !config.InsecureSkipVerify) { $s = -1; return [ptrType$26.nil, $ifaceNil, errors.New("tls: either ServerName or InsecureSkipVerify must be specified in the tls.Config")]; } nextProtosLength = 0; _ref = config.NextProtos; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } proto = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); l = proto.length; if ((l === 0) || l > 255) { $s = -1; return [ptrType$26.nil, $ifaceNil, errors.New("tls: invalid NextProtos value")]; } else { nextProtosLength = nextProtosLength + ((1 + l >> 0)) >> 0; } _i++; } if (nextProtosLength > 65535) { $s = -1; return [ptrType$26.nil, $ifaceNil, errors.New("tls: NextProtos values too large")]; } supportedVersions$1 = config.supportedVersions(); if (supportedVersions$1.$length === 0) { $s = -1; return [ptrType$26.nil, $ifaceNil, errors.New("tls: no supported versions satisfy MinVersion and MaxVersion")]; } clientHelloVersion = config.maxSupportedVersion(); if (clientHelloVersion > 771) { clientHelloVersion = 771; } hello = new clientHelloMsg.ptr(sliceType$5.nil, clientHelloVersion, $makeSlice(sliceType$5, 32), $makeSlice(sliceType$5, 32), sliceType$2.nil, new sliceType$5([0]), hostnameInSNI(config.ServerName), true, config.curvePreferences(), new sliceType$5([0]), false, sliceType$5.nil, sliceType$7.nil, sliceType$7.nil, true, sliceType$5.nil, config.NextProtos, true, supportedVersions$1, sliceType$5.nil, sliceType$15.nil, false, sliceType$5.nil, sliceType$16.nil, sliceType$11.nil); if (c.handshakes > 0) { hello.secureRenegotiation = new sliceType$5(c.clientFinished); } preferenceOrder = cipherSuitesPreferenceOrder; if (!hasAESGCMHardwareSupport) { preferenceOrder = cipherSuitesPreferenceOrderNoAES; } configCipherSuites = config.cipherSuites(); hello.cipherSuites = $makeSlice(sliceType$2, 0, configCipherSuites.$length); _ref$1 = preferenceOrder; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } suiteId = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); suite = mutualCipherSuite(configCipherSuites, suiteId); if (suite === ptrType$3.nil) { _i$1++; continue; } if (hello.vers < 771 && !(((suite.flags & 4) === 0))) { _i$1++; continue; } hello.cipherSuites = $append(hello.cipherSuites, suiteId); _i$1++; } _r = io.ReadFull(config.rand(), hello.random); /* */ $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))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: _r$1 = err.Error(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = errors.New("tls: short read from Rand: " + _r$1); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = [ptrType$26.nil, $ifaceNil, _r$2]; $s = 6; case 6: return $24r; /* } */ case 3: _r$3 = io.ReadFull(config.rand(), hello.sessionId); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$1 = _r$3; err$1 = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 8: _r$4 = err$1.Error(); /* */ $s = 10; case 10: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = errors.New("tls: short read from Rand: " + _r$4); /* */ $s = 11; case 11: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $24r$1 = [ptrType$26.nil, $ifaceNil, _r$5]; $s = 12; case 12: return $24r$1; /* } */ case 9: if (hello.vers >= 771) { hello.supportedSignatureAlgorithms = supportedSignatureAlgorithms; } params = $ifaceNil; /* */ if ((x = hello.supportedVersions, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])) === 772) { $s = 13; continue; } /* */ $s = 14; continue; /* if ((x = hello.supportedVersions, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])) === 772) { */ case 13: if (hasAESGCMHardwareSupport) { hello.cipherSuites = $appendSlice(hello.cipherSuites, defaultCipherSuitesTLS13); } else { hello.cipherSuites = $appendSlice(hello.cipherSuites, defaultCipherSuitesTLS13NoAES); } curveID = (x$1 = config.curvePreferences(), (0 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 0])); _r$6 = curveForCurveID(curveID); /* */ $s = 15; case 15: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tuple$2 = _r$6; ok = _tuple$2[1]; if (!((curveID === 29)) && !ok) { $s = -1; return [ptrType$26.nil, $ifaceNil, errors.New("tls: CurvePreferences includes unsupported curve")]; } _r$7 = generateECDHEParameters(config.rand(), curveID); /* */ $s = 16; case 16: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _tuple$3 = _r$7; params = _tuple$3[0]; err = _tuple$3[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$26.nil, $ifaceNil, err]; } _r$8 = params.PublicKey(); /* */ $s = 17; case 17: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } hello.keyShares = new sliceType$15([new keyShare.ptr(curveID, _r$8)]); /* } */ case 14: $s = -1; return [hello, params, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.makeClientHello }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._i = _i; $f._i$1 = _i$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._r$7 = _r$7; $f._r$8 = _r$8; $f._ref = _ref; $f._ref$1 = _ref$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.c = c; $f.clientHelloVersion = clientHelloVersion; $f.config = config; $f.configCipherSuites = configCipherSuites; $f.curveID = curveID; $f.err = err; $f.err$1 = err$1; $f.hello = hello; $f.l = l; $f.nextProtosLength = nextProtosLength; $f.ok = ok; $f.params = params; $f.preferenceOrder = preferenceOrder; $f.proto = proto; $f.suite = suite; $f.suiteId = suiteId; $f.supportedVersions$1 = supportedVersions$1; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; Conn.prototype.makeClientHello = function() { return this.$val.makeClientHello(); }; Conn.ptr.prototype.clientHandshake = function(ctx) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, $24r$5, $24r$6, $24r$7, $24r$8, _arg, _r, _r$1, _r$10, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, binderKey, c, cacheKey, ctx, earlySecret, ecdheParams, err, err$1, err$2, err$3, hello, hs, hs$1, maxVers, msg, ok, serverHello, session, tls11Downgrade, tls12Downgrade, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; $24r$6 = $f.$24r$6; $24r$7 = $f.$24r$7; $24r$8 = $f.$24r$8; _arg = $f._arg; _r = $f._r; _r$1 = $f._r$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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; binderKey = $f.binderKey; c = $f.c; cacheKey = $f.cacheKey; ctx = $f.ctx; earlySecret = $f.earlySecret; ecdheParams = $f.ecdheParams; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; hello = $f.hello; hs = $f.hs; hs$1 = $f.hs$1; maxVers = $f.maxVers; msg = $f.msg; ok = $f.ok; serverHello = $f.serverHello; session = $f.session; tls11Downgrade = $f.tls11Downgrade; tls12Downgrade = $f.tls12Downgrade; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); c = [c]; cacheKey = [cacheKey]; err = [err]; err[0] = $ifaceNil; c[0] = this; if (c[0].config === ptrType$4.nil) { c[0].config = defaultConfig(); } c[0].didResume = false; _r = c[0].makeClientHello(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; hello = _tuple[0]; ecdheParams = _tuple[1]; err[0] = _tuple[2]; /* */ if (!($interfaceIsEqual(err[0], $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err[0], $ifaceNil))) { */ case 2: err[0] = err[0]; $24r = err[0]; $s = 4; case 4: return $24r; /* } */ case 3: c[0].serverName = hello.serverName; _r$1 = c[0].loadSession(hello); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; cacheKey[0] = _tuple$1[0]; session = _tuple$1[1]; earlySecret = _tuple$1[2]; binderKey = _tuple$1[3]; /* */ if (!(cacheKey[0] === "") && !(session === ptrType$37.nil)) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!(cacheKey[0] === "") && !(session === ptrType$37.nil)) { */ case 6: $deferred.push([(function(c, cacheKey, err) { return function $b() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (!($interfaceIsEqual(err[0], $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(err[0], $ifaceNil))) { */ case 1: $r = c[0].config.ClientSessionCache.Put(cacheKey[0], ptrType$37.nil); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$s = $s; $f.$r = $r; return $f; }; })(c, cacheKey, err), []]); /* } */ case 7: _r$2 = hello.marshal(); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg = _r$2; _r$3 = c[0].writeRecord(22, _arg); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$2 = _r$3; err$1 = _tuple$2[1]; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 10; continue; } /* */ $s = 11; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 10: err[0] = err$1; $24r$1 = err[0]; $s = 12; case 12: return $24r$1; /* } */ case 11: _r$4 = c[0].readHandshake(); /* */ $s = 13; case 13: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$3 = _r$4; msg = _tuple$3[0]; err[0] = _tuple$3[1]; /* */ if (!($interfaceIsEqual(err[0], $ifaceNil))) { $s = 14; continue; } /* */ $s = 15; continue; /* if (!($interfaceIsEqual(err[0], $ifaceNil))) { */ case 14: err[0] = err[0]; $24r$2 = err[0]; $s = 16; case 16: return $24r$2; /* } */ case 15: _tuple$4 = $assertType(msg, ptrType$30, true); serverHello = _tuple$4[0]; ok = _tuple$4[1]; /* */ if (!ok) { $s = 17; continue; } /* */ $s = 18; continue; /* if (!ok) { */ case 17: _r$5 = c[0].sendAlert(10); /* */ $s = 19; case 19: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; _r$6 = unexpectedMessageError(serverHello, msg); /* */ $s = 20; case 20: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } err[0] = _r$6; $24r$3 = err[0]; $s = 21; case 21: return $24r$3; /* } */ case 18: _r$7 = c[0].pickTLSVersion(serverHello); /* */ $s = 22; case 22: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } err$2 = _r$7; /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 23; continue; } /* */ $s = 24; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 23: err[0] = err$2; $24r$4 = err[0]; $s = 25; case 25: return $24r$4; /* } */ case 24: maxVers = c[0].config.maxSupportedVersion(); tls12Downgrade = ($bytesToString($subslice(serverHello.random, 24))) === "DOWNGRD\x01"; tls11Downgrade = ($bytesToString($subslice(serverHello.random, 24))) === "DOWNGRD\x00"; /* */ if ((maxVers === 772) && c[0].vers <= 771 && (tls12Downgrade || tls11Downgrade) || (maxVers === 771) && c[0].vers <= 770 && tls11Downgrade) { $s = 26; continue; } /* */ $s = 27; continue; /* if ((maxVers === 772) && c[0].vers <= 771 && (tls12Downgrade || tls11Downgrade) || (maxVers === 771) && c[0].vers <= 770 && tls11Downgrade) { */ case 26: _r$8 = c[0].sendAlert(47); /* */ $s = 28; case 28: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$8; err[0] = errors.New("tls: downgrade attempt detected, possibly due to a MitM attack or a broken middlebox"); $24r$5 = err[0]; $s = 29; case 29: return $24r$5; /* } */ case 27: /* */ if (c[0].vers === 772) { $s = 30; continue; } /* */ $s = 31; continue; /* if (c[0].vers === 772) { */ case 30: hs = new clientHandshakeStateTLS13.ptr(c[0], ctx, serverHello, hello, ecdheParams, session, earlySecret, binderKey, ptrType$39.nil, false, false, ptrType$2.nil, $ifaceNil, sliceType$5.nil, sliceType$5.nil); _r$9 = hs.handshake(); /* */ $s = 32; case 32: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err[0] = _r$9; $24r$6 = err[0]; $s = 33; case 33: return $24r$6; /* } */ case 31: hs$1 = new clientHandshakeState.ptr(c[0], ctx, serverHello, hello, ptrType$3.nil, new finishedHash.ptr($ifaceNil, $ifaceNil, $ifaceNil, $ifaceNil, sliceType$5.nil, 0, $throwNilPointerError), sliceType$5.nil, session); _r$10 = hs$1.handshake(); /* */ $s = 34; case 34: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } err$3 = _r$10; /* */ if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = 35; continue; } /* */ $s = 36; continue; /* if (!($interfaceIsEqual(err$3, $ifaceNil))) { */ case 35: err[0] = err$3; $24r$7 = err[0]; $s = 37; case 37: return $24r$7; /* } */ case 36: /* */ if (!(cacheKey[0] === "") && !(hs$1.session === ptrType$37.nil) && !(session === hs$1.session)) { $s = 38; continue; } /* */ $s = 39; continue; /* if (!(cacheKey[0] === "") && !(hs$1.session === ptrType$37.nil) && !(session === hs$1.session)) { */ case 38: $r = c[0].config.ClientSessionCache.Put(cacheKey[0], hs$1.session); /* */ $s = 40; case 40: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 39: err[0] = $ifaceNil; $24r$8 = err[0]; $s = 41; case 41: return $24r$8; /* */ } 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: Conn.ptr.prototype.clientHandshake }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f.$24r$6 = $24r$6; $f.$24r$7 = $24r$7; $f.$24r$8 = $24r$8; $f._arg = _arg; $f._r = _r; $f._r$1 = _r$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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f.binderKey = binderKey; $f.c = c; $f.cacheKey = cacheKey; $f.ctx = ctx; $f.earlySecret = earlySecret; $f.ecdheParams = ecdheParams; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.hello = hello; $f.hs = hs; $f.hs$1 = hs$1; $f.maxVers = maxVers; $f.msg = msg; $f.ok = ok; $f.serverHello = serverHello; $f.session = session; $f.tls11Downgrade = tls11Downgrade; $f.tls12Downgrade = tls12Downgrade; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Conn.prototype.clientHandshake = function(ctx) { return this.$val.clientHandshake(ctx); }; Conn.ptr.prototype.loadSession = function(hello) { var _i, _i$1, _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, _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, binderKey, c, cacheKey, cipherSuite$1, cipherSuiteOk, earlySecret, err, hello, identity, offeredID, offeredSuite, ok, psk, pskBinders, serverCert, session, ticketAge, transcript, v, versOk, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _i$1 = $f._i$1; _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; _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 = $f._tuple; binderKey = $f.binderKey; c = $f.c; cacheKey = $f.cacheKey; cipherSuite$1 = $f.cipherSuite$1; cipherSuiteOk = $f.cipherSuiteOk; earlySecret = $f.earlySecret; err = $f.err; hello = $f.hello; identity = $f.identity; offeredID = $f.offeredID; offeredSuite = $f.offeredSuite; ok = $f.ok; psk = $f.psk; pskBinders = $f.pskBinders; serverCert = $f.serverCert; session = $f.session; ticketAge = $f.ticketAge; transcript = $f.transcript; v = $f.v; versOk = $f.versOk; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cacheKey = ""; session = ptrType$37.nil; earlySecret = sliceType$5.nil; binderKey = sliceType$5.nil; c = this; if (c.config.SessionTicketsDisabled || $interfaceIsEqual(c.config.ClientSessionCache, $ifaceNil)) { _tmp = ""; _tmp$1 = ptrType$37.nil; _tmp$2 = sliceType$5.nil; _tmp$3 = sliceType$5.nil; cacheKey = _tmp; session = _tmp$1; earlySecret = _tmp$2; binderKey = _tmp$3; $s = -1; return [cacheKey, session, earlySecret, binderKey]; } hello.ticketSupported = true; if ((x = hello.supportedVersions, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])) === 772) { hello.pskModes = new sliceType$5([1]); } if (!((c.handshakes === 0))) { _tmp$4 = ""; _tmp$5 = ptrType$37.nil; _tmp$6 = sliceType$5.nil; _tmp$7 = sliceType$5.nil; cacheKey = _tmp$4; session = _tmp$5; earlySecret = _tmp$6; binderKey = _tmp$7; $s = -1; return [cacheKey, session, earlySecret, binderKey]; } _r = c.conn.RemoteAddr(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = clientSessionCacheKey(_r, c.config); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } cacheKey = _r$1; _r$2 = c.config.ClientSessionCache.Get(cacheKey); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; session = _tuple[0]; ok = _tuple[1]; if (!ok || session === ptrType$37.nil) { _tmp$8 = cacheKey; _tmp$9 = ptrType$37.nil; _tmp$10 = sliceType$5.nil; _tmp$11 = sliceType$5.nil; cacheKey = _tmp$8; session = _tmp$9; earlySecret = _tmp$10; binderKey = _tmp$11; $s = -1; return [cacheKey, session, earlySecret, binderKey]; } versOk = false; _ref = hello.supportedVersions; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (v === session.vers) { versOk = true; break; } _i++; } if (!versOk) { _tmp$12 = cacheKey; _tmp$13 = ptrType$37.nil; _tmp$14 = sliceType$5.nil; _tmp$15 = sliceType$5.nil; cacheKey = _tmp$12; session = _tmp$13; earlySecret = _tmp$14; binderKey = _tmp$15; $s = -1; return [cacheKey, session, earlySecret, binderKey]; } /* */ if (!c.config.InsecureSkipVerify) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!c.config.InsecureSkipVerify) { */ case 4: if (session.verifiedChains.$length === 0) { _tmp$16 = cacheKey; _tmp$17 = ptrType$37.nil; _tmp$18 = sliceType$5.nil; _tmp$19 = sliceType$5.nil; cacheKey = _tmp$16; session = _tmp$17; earlySecret = _tmp$18; binderKey = _tmp$19; $s = -1; return [cacheKey, session, earlySecret, binderKey]; } serverCert = (x$1 = session.serverCertificates, (0 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 0])); _r$3 = c.config.time(); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = $clone(_r$3, time.Time).After($clone(serverCert.NotAfter, time.Time)); /* */ $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 = 6; continue; } /* */ $s = 7; continue; /* if (_r$4) { */ case 6: $r = c.config.ClientSessionCache.Put(cacheKey, ptrType$37.nil); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp$20 = cacheKey; _tmp$21 = ptrType$37.nil; _tmp$22 = sliceType$5.nil; _tmp$23 = sliceType$5.nil; cacheKey = _tmp$20; session = _tmp$21; earlySecret = _tmp$22; binderKey = _tmp$23; $s = -1; return [cacheKey, session, earlySecret, binderKey]; /* } */ case 7: err = serverCert.VerifyHostname(c.config.ServerName); if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$24 = cacheKey; _tmp$25 = ptrType$37.nil; _tmp$26 = sliceType$5.nil; _tmp$27 = sliceType$5.nil; cacheKey = _tmp$24; session = _tmp$25; earlySecret = _tmp$26; binderKey = _tmp$27; $s = -1; return [cacheKey, session, earlySecret, binderKey]; } /* } */ case 5: if (!((session.vers === 772))) { if (mutualCipherSuite(hello.cipherSuites, session.cipherSuite) === ptrType$3.nil) { _tmp$28 = cacheKey; _tmp$29 = ptrType$37.nil; _tmp$30 = sliceType$5.nil; _tmp$31 = sliceType$5.nil; cacheKey = _tmp$28; session = _tmp$29; earlySecret = _tmp$30; binderKey = _tmp$31; $s = -1; return [cacheKey, session, earlySecret, binderKey]; } hello.sessionTicket = session.sessionTicket; $s = -1; return [cacheKey, session, earlySecret, binderKey]; } _r$5 = c.config.time(); /* */ $s = 13; case 13: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$6 = $clone(_r$5, time.Time).After($clone(session.useBy, time.Time)); /* */ $s = 14; case 14: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } /* */ if (_r$6) { $s = 11; continue; } /* */ $s = 12; continue; /* if (_r$6) { */ case 11: $r = c.config.ClientSessionCache.Put(cacheKey, ptrType$37.nil); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp$32 = cacheKey; _tmp$33 = ptrType$37.nil; _tmp$34 = sliceType$5.nil; _tmp$35 = sliceType$5.nil; cacheKey = _tmp$32; session = _tmp$33; earlySecret = _tmp$34; binderKey = _tmp$35; $s = -1; return [cacheKey, session, earlySecret, binderKey]; /* } */ case 12: cipherSuite$1 = cipherSuiteTLS13ByID(session.cipherSuite); if (cipherSuite$1 === ptrType$2.nil) { _tmp$36 = cacheKey; _tmp$37 = ptrType$37.nil; _tmp$38 = sliceType$5.nil; _tmp$39 = sliceType$5.nil; cacheKey = _tmp$36; session = _tmp$37; earlySecret = _tmp$38; binderKey = _tmp$39; $s = -1; return [cacheKey, session, earlySecret, binderKey]; } cipherSuiteOk = false; _ref$1 = hello.cipherSuites; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } offeredID = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); offeredSuite = cipherSuiteTLS13ByID(offeredID); if (!(offeredSuite === ptrType$2.nil) && (offeredSuite.hash === cipherSuite$1.hash)) { cipherSuiteOk = true; break; } _i$1++; } if (!cipherSuiteOk) { _tmp$40 = cacheKey; _tmp$41 = ptrType$37.nil; _tmp$42 = sliceType$5.nil; _tmp$43 = sliceType$5.nil; cacheKey = _tmp$40; session = _tmp$41; earlySecret = _tmp$42; binderKey = _tmp$43; $s = -1; return [cacheKey, session, earlySecret, binderKey]; } _r$7 = c.config.time(); /* */ $s = 16; case 16: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$8 = $clone(_r$7, time.Time).Sub($clone(session.receivedAt, time.Time)); /* */ $s = 17; case 17: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } ticketAge = (($div64(_r$8, new time.Duration(0, 1000000), false).$low >>> 0)); identity = new pskIdentity.ptr(session.sessionTicket, ticketAge + session.ageAdd >>> 0); hello.pskIdentities = new sliceType$16([$clone(identity, pskIdentity)]); hello.pskBinders = new sliceType$11([$makeSlice(sliceType$5, new crypto.Hash(cipherSuite$1.hash).Size())]); _r$9 = cipherSuite$1.expandLabel(session.masterSecret, "resumption", session.nonce, new crypto.Hash(cipherSuite$1.hash).Size()); /* */ $s = 18; case 18: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } psk = _r$9; _r$10 = cipherSuite$1.extract(psk, sliceType$5.nil); /* */ $s = 19; case 19: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } earlySecret = _r$10; _r$11 = cipherSuite$1.deriveSecret(earlySecret, "res binder", $ifaceNil); /* */ $s = 20; case 20: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } binderKey = _r$11; _r$12 = new crypto.Hash(cipherSuite$1.hash).New(); /* */ $s = 21; case 21: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } transcript = _r$12; _r$13 = hello.marshalWithoutBinders(); /* */ $s = 22; case 22: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _r$14 = transcript.Write(_r$13); /* */ $s = 23; case 23: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _r$14; _r$15 = cipherSuite$1.finishedHash(binderKey, transcript); /* */ $s = 24; case 24: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } pskBinders = new sliceType$11([_r$15]); $r = hello.updateBinders(pskBinders); /* */ $s = 25; case 25: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return [cacheKey, session, earlySecret, binderKey]; /* */ } return; } if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.loadSession }; } $f._i = _i; $f._i$1 = _i$1; $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._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 = _tuple; $f.binderKey = binderKey; $f.c = c; $f.cacheKey = cacheKey; $f.cipherSuite$1 = cipherSuite$1; $f.cipherSuiteOk = cipherSuiteOk; $f.earlySecret = earlySecret; $f.err = err; $f.hello = hello; $f.identity = identity; $f.offeredID = offeredID; $f.offeredSuite = offeredSuite; $f.ok = ok; $f.psk = psk; $f.pskBinders = pskBinders; $f.serverCert = serverCert; $f.session = session; $f.ticketAge = ticketAge; $f.transcript = transcript; $f.v = v; $f.versOk = versOk; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; Conn.prototype.loadSession = function(hello) { return this.$val.loadSession(hello); }; Conn.ptr.prototype.pickTLSVersion = function(serverHello) { var $24r, _r, _r$1, _tuple, c, ok, peerVersion, serverHello, vers, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; c = $f.c; ok = $f.ok; peerVersion = $f.peerVersion; serverHello = $f.serverHello; vers = $f.vers; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; peerVersion = serverHello.vers; if (!((serverHello.supportedVersion === 0))) { peerVersion = serverHello.supportedVersion; } _tuple = c.config.mutualVersion(new sliceType$2([peerVersion])); vers = _tuple[0]; ok = _tuple[1]; /* */ if (!ok) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!ok) { */ case 1: _r = c.sendAlert(70); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; _r$1 = fmt.Errorf("tls: server selected unsupported protocol version %x", new sliceType$6([new $Uint16(peerVersion)])); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 5; case 5: return $24r; /* } */ case 2: c.vers = vers; c.haveVers = true; c.in$27.version = vers; c.out.version = vers; $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.pickTLSVersion }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.c = c; $f.ok = ok; $f.peerVersion = peerVersion; $f.serverHello = serverHello; $f.vers = vers; $f.$s = $s; $f.$r = $r; return $f; }; Conn.prototype.pickTLSVersion = function(serverHello) { return this.$val.pickTLSVersion(serverHello); }; clientHandshakeState.ptr.prototype.handshake = function() { var _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, _tuple$2, c, err, err$1, err$10, err$11, err$12, err$2, err$3, err$4, err$5, err$6, err$7, err$8, err$9, hs, isResume, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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$17 = $f._r$17; _r$18 = $f._r$18; _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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; c = $f.c; err = $f.err; err$1 = $f.err$1; err$10 = $f.err$10; err$11 = $f.err$11; err$12 = $f.err$12; err$2 = $f.err$2; err$3 = $f.err$3; err$4 = $f.err$4; err$5 = $f.err$5; err$6 = $f.err$6; err$7 = $f.err$7; err$8 = $f.err$8; err$9 = $f.err$9; hs = $f.hs; isResume = $f.isResume; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; _r = hs.processServerHello(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; isResume = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _r$1 = newFinishedHash(c.vers, hs.suite); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } finishedHash.copy(hs.finishedHash, _r$1); if (isResume || ((c.config.Certificates.$length === 0) && c.config.GetClientCertificate === $throwNilPointerError)) { hs.finishedHash.discardHandshakeBuffer(); } _r$2 = hs.hello.marshal(); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = hs.finishedHash.Write(_r$2); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _r$4 = hs.serverHello.marshal(); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = hs.finishedHash.Write(_r$4); /* */ $s = 6; case 6: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; c.buffering = true; c.didResume = isResume; /* */ if (isResume) { $s = 7; continue; } /* */ $s = 8; continue; /* if (isResume) { */ case 7: _r$6 = hs.establishKeys(); /* */ $s = 10; case 10: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } err$1 = _r$6; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } _r$7 = hs.readSessionTicket(); /* */ $s = 11; case 11: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } err$2 = _r$7; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return err$2; } _r$8 = hs.readFinished(new sliceType$5(c.serverFinished)); /* */ $s = 12; case 12: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } err$3 = _r$8; if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = -1; return err$3; } c.clientFinishedIsFirst = false; /* */ if (!(c.config.VerifyConnection === $throwNilPointerError)) { $s = 13; continue; } /* */ $s = 14; continue; /* if (!(c.config.VerifyConnection === $throwNilPointerError)) { */ case 13: _r$9 = c.config.VerifyConnection($clone(c.connectionStateLocked(), ConnectionState)); /* */ $s = 15; case 15: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err$4 = _r$9; /* */ if (!($interfaceIsEqual(err$4, $ifaceNil))) { $s = 16; continue; } /* */ $s = 17; continue; /* if (!($interfaceIsEqual(err$4, $ifaceNil))) { */ case 16: _r$10 = c.sendAlert(42); /* */ $s = 18; case 18: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; $s = -1; return err$4; /* } */ case 17: /* } */ case 14: _r$11 = hs.sendFinished(new sliceType$5(c.clientFinished)); /* */ $s = 19; case 19: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } err$5 = _r$11; if (!($interfaceIsEqual(err$5, $ifaceNil))) { $s = -1; return err$5; } _r$12 = c.flush(); /* */ $s = 20; case 20: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _tuple$1 = _r$12; err$6 = _tuple$1[1]; if (!($interfaceIsEqual(err$6, $ifaceNil))) { $s = -1; return err$6; } $s = 9; continue; /* } else { */ case 8: _r$13 = hs.doFullHandshake(); /* */ $s = 21; case 21: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } err$7 = _r$13; if (!($interfaceIsEqual(err$7, $ifaceNil))) { $s = -1; return err$7; } _r$14 = hs.establishKeys(); /* */ $s = 22; case 22: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } err$8 = _r$14; if (!($interfaceIsEqual(err$8, $ifaceNil))) { $s = -1; return err$8; } _r$15 = hs.sendFinished(new sliceType$5(c.clientFinished)); /* */ $s = 23; case 23: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } err$9 = _r$15; if (!($interfaceIsEqual(err$9, $ifaceNil))) { $s = -1; return err$9; } _r$16 = c.flush(); /* */ $s = 24; case 24: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _tuple$2 = _r$16; err$10 = _tuple$2[1]; if (!($interfaceIsEqual(err$10, $ifaceNil))) { $s = -1; return err$10; } c.clientFinishedIsFirst = true; _r$17 = hs.readSessionTicket(); /* */ $s = 25; case 25: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } err$11 = _r$17; if (!($interfaceIsEqual(err$11, $ifaceNil))) { $s = -1; return err$11; } _r$18 = hs.readFinished(new sliceType$5(c.serverFinished)); /* */ $s = 26; case 26: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } err$12 = _r$18; if (!($interfaceIsEqual(err$12, $ifaceNil))) { $s = -1; return err$12; } /* } */ case 9: c.ekm = ekmFromMasterSecret(c.vers, hs.suite, hs.masterSecret, hs.hello.random, hs.serverHello.random); atomic.StoreUint32((c.$ptr_handshakeStatus || (c.$ptr_handshakeStatus = new ptrType$24(function() { return this.$target.handshakeStatus; }, function($v) { this.$target.handshakeStatus = $v; }, c))), 1); $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: clientHandshakeState.ptr.prototype.handshake }; } $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$17 = _r$17; $f._r$18 = _r$18; $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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.c = c; $f.err = err; $f.err$1 = err$1; $f.err$10 = err$10; $f.err$11 = err$11; $f.err$12 = err$12; $f.err$2 = err$2; $f.err$3 = err$3; $f.err$4 = err$4; $f.err$5 = err$5; $f.err$6 = err$6; $f.err$7 = err$7; $f.err$8 = err$8; $f.err$9 = err$9; $f.hs = hs; $f.isResume = isResume; $f.$s = $s; $f.$r = $r; return $f; }; clientHandshakeState.prototype.handshake = function() { return this.$val.handshake(); }; clientHandshakeState.ptr.prototype.pickCipherSuite = function() { var _r, hs, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; hs = $f.hs; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; hs.suite = mutualCipherSuite(hs.hello.cipherSuites, hs.serverHello.cipherSuite); /* */ if (hs.suite === ptrType$3.nil) { $s = 1; continue; } /* */ $s = 2; continue; /* if (hs.suite === ptrType$3.nil) { */ case 1: _r = hs.c.sendAlert(40); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; $s = -1; return errors.New("tls: server chose an unconfigured cipher suite"); /* } */ case 2: hs.c.cipherSuite = hs.suite.id; $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: clientHandshakeState.ptr.prototype.pickCipherSuite }; } $f._r = _r; $f.hs = hs; $f.$s = $s; $f.$r = $r; return $f; }; clientHandshakeState.prototype.pickCipherSuite = function() { return this.$val.pickCipherSuite(); }; clientHandshakeState.ptr.prototype.doFullHandshake = function() { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, _arg, _r, _r$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$36, _r$37, _r$38, _r$39, _r$4, _r$40, _r$41, _r$42, _r$43, _r$44, _r$45, _r$46, _r$47, _r$48, _r$49, _r$5, _r$50, _r$6, _r$7, _r$8, _r$9, _tuple, _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$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, _tuple$8, _tuple$9, c, certMsg, certReq, certRequested, certVerify, chainToSend, ckx, cri, cs, err, err$1, err$2, err$3, err$4, err$5, err$6, hs, key, keyAgreement$1, msg, ok, ok$1, preMasterSecret, shd, sigHash, sigType, signOpts, signatureAlgorithm, signed, skx, 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; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; _arg = $f._arg; _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$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$36 = $f._r$36; _r$37 = $f._r$37; _r$38 = $f._r$38; _r$39 = $f._r$39; _r$4 = $f._r$4; _r$40 = $f._r$40; _r$41 = $f._r$41; _r$42 = $f._r$42; _r$43 = $f._r$43; _r$44 = $f._r$44; _r$45 = $f._r$45; _r$46 = $f._r$46; _r$47 = $f._r$47; _r$48 = $f._r$48; _r$49 = $f._r$49; _r$5 = $f._r$5; _r$50 = $f._r$50; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; _tuple = $f._tuple; _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$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; c = $f.c; certMsg = $f.certMsg; certReq = $f.certReq; certRequested = $f.certRequested; certVerify = $f.certVerify; chainToSend = $f.chainToSend; ckx = $f.ckx; cri = $f.cri; cs = $f.cs; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; err$4 = $f.err$4; err$5 = $f.err$5; err$6 = $f.err$6; hs = $f.hs; key = $f.key; keyAgreement$1 = $f.keyAgreement$1; msg = $f.msg; ok = $f.ok; ok$1 = $f.ok$1; preMasterSecret = $f.preMasterSecret; shd = $f.shd; sigHash = $f.sigHash; sigType = $f.sigType; signOpts = $f.signOpts; signatureAlgorithm = $f.signatureAlgorithm; signed = $f.signed; skx = $f.skx; 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: hs = this; c = hs.c; _r = c.readHandshake(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; msg = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _tuple$1 = $assertType(msg, ptrType$34, true); certMsg = _tuple$1[0]; ok = _tuple$1[1]; /* */ if (!ok || (certMsg.certificates.$length === 0)) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!ok || (certMsg.certificates.$length === 0)) { */ case 2: _r$1 = c.sendAlert(10); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _r$2 = unexpectedMessageError(certMsg, msg); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 6; case 6: return $24r; /* } */ case 3: _r$3 = hs.finishedHash.Write(certMsg.marshal()); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _r$4 = c.readHandshake(); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$2 = _r$4; msg = _tuple$2[0]; err = _tuple$2[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _tuple$3 = $assertType(msg, ptrType$40, true); cs = _tuple$3[0]; ok = _tuple$3[1]; /* */ if (ok) { $s = 9; continue; } /* */ $s = 10; continue; /* if (ok) { */ case 9: /* */ if (!hs.serverHello.ocspStapling) { $s = 11; continue; } /* */ $s = 12; continue; /* if (!hs.serverHello.ocspStapling) { */ case 11: _r$5 = c.sendAlert(10); /* */ $s = 13; case 13: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; $s = -1; return errors.New("tls: received unexpected CertificateStatus message"); /* } */ case 12: _r$6 = cs.marshal(); /* */ $s = 14; case 14: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$7 = hs.finishedHash.Write(_r$6); /* */ $s = 15; case 15: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$7; c.ocspResponse = cs.response; _r$8 = c.readHandshake(); /* */ $s = 16; case 16: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _tuple$4 = _r$8; msg = _tuple$4[0]; err = _tuple$4[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } /* } */ case 10: /* */ if (c.handshakes === 0) { $s = 17; continue; } /* */ $s = 18; continue; /* if (c.handshakes === 0) { */ case 17: _r$9 = c.verifyServerCertificate(certMsg.certificates); /* */ $s = 20; case 20: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err$1 = _r$9; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } $s = 19; continue; /* } else { */ case 18: /* */ if (!bytes.Equal((x = c.peerCertificates, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])).Raw, (x$1 = certMsg.certificates, (0 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 0])))) { $s = 21; continue; } /* */ $s = 22; continue; /* if (!bytes.Equal((x = c.peerCertificates, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])).Raw, (x$1 = certMsg.certificates, (0 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 0])))) { */ case 21: _r$10 = c.sendAlert(42); /* */ $s = 23; case 23: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; $s = -1; return errors.New("tls: server's identity changed during renegotiation"); /* } */ case 22: /* } */ case 19: _r$11 = hs.suite.ka(c.vers); /* */ $s = 24; case 24: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } keyAgreement$1 = _r$11; _tuple$5 = $assertType(msg, ptrType$22, true); skx = _tuple$5[0]; ok = _tuple$5[1]; /* */ if (ok) { $s = 25; continue; } /* */ $s = 26; continue; /* if (ok) { */ case 25: _r$12 = hs.finishedHash.Write(skx.marshal()); /* */ $s = 27; case 27: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _r$12; _r$13 = keyAgreement$1.processServerKeyExchange(c.config, hs.hello, hs.serverHello, (x$2 = c.peerCertificates, (0 >= x$2.$length ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + 0])), skx); /* */ $s = 28; case 28: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } err = _r$13; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 29; continue; } /* */ $s = 30; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 29: _r$14 = c.sendAlert(10); /* */ $s = 31; case 31: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _r$14; $s = -1; return err; /* } */ case 30: _r$15 = c.readHandshake(); /* */ $s = 32; case 32: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _tuple$6 = _r$15; msg = _tuple$6[0]; err = _tuple$6[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } /* } */ case 26: chainToSend = ptrType$31.nil; certRequested = false; _tuple$7 = $assertType(msg, ptrType$33, true); certReq = _tuple$7[0]; ok = _tuple$7[1]; /* */ if (ok) { $s = 33; continue; } /* */ $s = 34; continue; /* if (ok) { */ case 33: certRequested = true; _r$16 = hs.finishedHash.Write(certReq.marshal()); /* */ $s = 35; case 35: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _r$16; _r$17 = certificateRequestInfoFromMsg(hs.ctx, c.vers, certReq); /* */ $s = 36; case 36: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } cri = _r$17; _r$18 = c.getClientCertificate(cri); /* */ $s = 37; case 37: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } _tuple$8 = _r$18; chainToSend = _tuple$8[0]; err = _tuple$8[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 38; continue; } /* */ $s = 39; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 38: _r$19 = c.sendAlert(80); /* */ $s = 40; case 40: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } _r$19; $s = -1; return err; /* } */ case 39: _r$20 = c.readHandshake(); /* */ $s = 41; case 41: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } _tuple$9 = _r$20; msg = _tuple$9[0]; err = _tuple$9[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } /* } */ case 34: _tuple$10 = $assertType(msg, ptrType$41, true); shd = _tuple$10[0]; ok = _tuple$10[1]; /* */ if (!ok) { $s = 42; continue; } /* */ $s = 43; continue; /* if (!ok) { */ case 42: _r$21 = c.sendAlert(10); /* */ $s = 44; case 44: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } _r$21; _r$22 = unexpectedMessageError(shd, msg); /* */ $s = 45; case 45: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; } $24r$1 = _r$22; $s = 46; case 46: return $24r$1; /* } */ case 43: _r$23 = hs.finishedHash.Write(shd.marshal()); /* */ $s = 47; case 47: if($c) { $c = false; _r$23 = _r$23.$blk(); } if (_r$23 && _r$23.$blk !== undefined) { break s; } _r$23; /* */ if (certRequested) { $s = 48; continue; } /* */ $s = 49; continue; /* if (certRequested) { */ case 48: certMsg = new certificateMsg.ptr(sliceType$5.nil, sliceType$11.nil); certMsg.certificates = chainToSend.Certificate; _r$24 = hs.finishedHash.Write(certMsg.marshal()); /* */ $s = 50; case 50: if($c) { $c = false; _r$24 = _r$24.$blk(); } if (_r$24 && _r$24.$blk !== undefined) { break s; } _r$24; _r$25 = c.writeRecord(22, certMsg.marshal()); /* */ $s = 51; case 51: if($c) { $c = false; _r$25 = _r$25.$blk(); } if (_r$25 && _r$25.$blk !== undefined) { break s; } _tuple$11 = _r$25; err$2 = _tuple$11[1]; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return err$2; } /* } */ case 49: _r$26 = keyAgreement$1.generateClientKeyExchange(c.config, hs.hello, (x$3 = c.peerCertificates, (0 >= x$3.$length ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + 0]))); /* */ $s = 52; case 52: if($c) { $c = false; _r$26 = _r$26.$blk(); } if (_r$26 && _r$26.$blk !== undefined) { break s; } _tuple$12 = _r$26; preMasterSecret = _tuple$12[0]; ckx = _tuple$12[1]; err = _tuple$12[2]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 53; continue; } /* */ $s = 54; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 53: _r$27 = c.sendAlert(80); /* */ $s = 55; case 55: if($c) { $c = false; _r$27 = _r$27.$blk(); } if (_r$27 && _r$27.$blk !== undefined) { break s; } _r$27; $s = -1; return err; /* } */ case 54: /* */ if (!(ckx === ptrType$23.nil)) { $s = 56; continue; } /* */ $s = 57; continue; /* if (!(ckx === ptrType$23.nil)) { */ case 56: _r$28 = hs.finishedHash.Write(ckx.marshal()); /* */ $s = 58; case 58: if($c) { $c = false; _r$28 = _r$28.$blk(); } if (_r$28 && _r$28.$blk !== undefined) { break s; } _r$28; _r$29 = c.writeRecord(22, ckx.marshal()); /* */ $s = 59; case 59: if($c) { $c = false; _r$29 = _r$29.$blk(); } if (_r$29 && _r$29.$blk !== undefined) { break s; } _tuple$13 = _r$29; err$3 = _tuple$13[1]; if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = -1; return err$3; } /* } */ case 57: /* */ if (!(chainToSend === ptrType$31.nil) && chainToSend.Certificate.$length > 0) { $s = 60; continue; } /* */ $s = 61; continue; /* if (!(chainToSend === ptrType$31.nil) && chainToSend.Certificate.$length > 0) { */ case 60: certVerify = new certificateVerifyMsg.ptr(sliceType$5.nil, false, 0, sliceType$5.nil); _tuple$14 = $assertType(chainToSend.PrivateKey, crypto.Signer, true); key = _tuple$14[0]; ok$1 = _tuple$14[1]; /* */ if (!ok$1) { $s = 62; continue; } /* */ $s = 63; continue; /* if (!ok$1) { */ case 62: _r$30 = c.sendAlert(80); /* */ $s = 64; case 64: if($c) { $c = false; _r$30 = _r$30.$blk(); } if (_r$30 && _r$30.$blk !== undefined) { break s; } _r$30; _r$31 = fmt.Errorf("tls: client certificate private key of type %T does not implement crypto.Signer", new sliceType$6([chainToSend.PrivateKey])); /* */ $s = 65; case 65: if($c) { $c = false; _r$31 = _r$31.$blk(); } if (_r$31 && _r$31.$blk !== undefined) { break s; } $24r$2 = _r$31; $s = 66; case 66: return $24r$2; /* } */ case 63: sigType = 0; sigHash = 0; /* */ if (c.vers >= 771) { $s = 67; continue; } /* */ $s = 68; continue; /* if (c.vers >= 771) { */ case 67: _r$32 = selectSignatureScheme(c.vers, chainToSend, certReq.supportedSignatureAlgorithms); /* */ $s = 70; case 70: if($c) { $c = false; _r$32 = _r$32.$blk(); } if (_r$32 && _r$32.$blk !== undefined) { break s; } _tuple$15 = _r$32; signatureAlgorithm = _tuple$15[0]; err$4 = _tuple$15[1]; /* */ if (!($interfaceIsEqual(err$4, $ifaceNil))) { $s = 71; continue; } /* */ $s = 72; continue; /* if (!($interfaceIsEqual(err$4, $ifaceNil))) { */ case 71: _r$33 = c.sendAlert(47); /* */ $s = 73; case 73: if($c) { $c = false; _r$33 = _r$33.$blk(); } if (_r$33 && _r$33.$blk !== undefined) { break s; } _r$33; $s = -1; return err$4; /* } */ case 72: _r$34 = typeAndHashFromSignatureScheme(signatureAlgorithm); /* */ $s = 74; case 74: if($c) { $c = false; _r$34 = _r$34.$blk(); } if (_r$34 && _r$34.$blk !== undefined) { break s; } _tuple$16 = _r$34; sigType = _tuple$16[0]; sigHash = _tuple$16[1]; err$4 = _tuple$16[2]; /* */ if (!($interfaceIsEqual(err$4, $ifaceNil))) { $s = 75; continue; } /* */ $s = 76; continue; /* if (!($interfaceIsEqual(err$4, $ifaceNil))) { */ case 75: _r$35 = c.sendAlert(80); /* */ $s = 77; case 77: if($c) { $c = false; _r$35 = _r$35.$blk(); } if (_r$35 && _r$35.$blk !== undefined) { break s; } $24r$3 = _r$35; $s = 78; case 78: return $24r$3; /* } */ case 76: certVerify.hasSignatureAlgorithm = true; certVerify.signatureAlgorithm = signatureAlgorithm; $s = 69; continue; /* } else { */ case 68: _r$36 = key.Public(); /* */ $s = 79; case 79: if($c) { $c = false; _r$36 = _r$36.$blk(); } if (_r$36 && _r$36.$blk !== undefined) { break s; } _r$37 = legacyTypeAndHashFromPublicKey(_r$36); /* */ $s = 80; case 80: if($c) { $c = false; _r$37 = _r$37.$blk(); } if (_r$37 && _r$37.$blk !== undefined) { break s; } _tuple$17 = _r$37; sigType = _tuple$17[0]; sigHash = _tuple$17[1]; err = _tuple$17[2]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 81; continue; } /* */ $s = 82; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 81: _r$38 = c.sendAlert(47); /* */ $s = 83; case 83: if($c) { $c = false; _r$38 = _r$38.$blk(); } if (_r$38 && _r$38.$blk !== undefined) { break s; } _r$38; $s = -1; return err; /* } */ case 82: /* } */ case 69: _r$39 = $clone(hs.finishedHash, finishedHash).hashForClientCertificate(sigType, sigHash, hs.masterSecret); /* */ $s = 84; case 84: if($c) { $c = false; _r$39 = _r$39.$blk(); } if (_r$39 && _r$39.$blk !== undefined) { break s; } signed = _r$39; signOpts = (new crypto.Hash(sigHash)); if (sigType === 226) { signOpts = new rsa.PSSOptions.ptr(-1, sigHash); } _r$40 = key.Sign(c.config.rand(), signed, signOpts); /* */ $s = 85; case 85: if($c) { $c = false; _r$40 = _r$40.$blk(); } if (_r$40 && _r$40.$blk !== undefined) { break s; } _tuple$18 = _r$40; certVerify.signature = _tuple$18[0]; err = _tuple$18[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 86; continue; } /* */ $s = 87; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 86: _r$41 = c.sendAlert(80); /* */ $s = 88; case 88: if($c) { $c = false; _r$41 = _r$41.$blk(); } if (_r$41 && _r$41.$blk !== undefined) { break s; } _r$41; $s = -1; return err; /* } */ case 87: _r$42 = certVerify.marshal(); /* */ $s = 89; case 89: if($c) { $c = false; _r$42 = _r$42.$blk(); } if (_r$42 && _r$42.$blk !== undefined) { break s; } _r$43 = hs.finishedHash.Write(_r$42); /* */ $s = 90; case 90: if($c) { $c = false; _r$43 = _r$43.$blk(); } if (_r$43 && _r$43.$blk !== undefined) { break s; } _r$43; _r$44 = certVerify.marshal(); /* */ $s = 91; case 91: if($c) { $c = false; _r$44 = _r$44.$blk(); } if (_r$44 && _r$44.$blk !== undefined) { break s; } _arg = _r$44; _r$45 = c.writeRecord(22, _arg); /* */ $s = 92; case 92: if($c) { $c = false; _r$45 = _r$45.$blk(); } if (_r$45 && _r$45.$blk !== undefined) { break s; } _tuple$19 = _r$45; err$5 = _tuple$19[1]; if (!($interfaceIsEqual(err$5, $ifaceNil))) { $s = -1; return err$5; } /* } */ case 61: _r$46 = masterFromPreMasterSecret(c.vers, hs.suite, preMasterSecret, hs.hello.random, hs.serverHello.random); /* */ $s = 93; case 93: if($c) { $c = false; _r$46 = _r$46.$blk(); } if (_r$46 && _r$46.$blk !== undefined) { break s; } hs.masterSecret = _r$46; _r$47 = c.config.writeKeyLog("CLIENT_RANDOM", hs.hello.random, hs.masterSecret); /* */ $s = 94; case 94: if($c) { $c = false; _r$47 = _r$47.$blk(); } if (_r$47 && _r$47.$blk !== undefined) { break s; } err$6 = _r$47; /* */ if (!($interfaceIsEqual(err$6, $ifaceNil))) { $s = 95; continue; } /* */ $s = 96; continue; /* if (!($interfaceIsEqual(err$6, $ifaceNil))) { */ case 95: _r$48 = c.sendAlert(80); /* */ $s = 97; case 97: if($c) { $c = false; _r$48 = _r$48.$blk(); } if (_r$48 && _r$48.$blk !== undefined) { break s; } _r$48; _r$49 = err$6.Error(); /* */ $s = 98; case 98: if($c) { $c = false; _r$49 = _r$49.$blk(); } if (_r$49 && _r$49.$blk !== undefined) { break s; } _r$50 = errors.New("tls: failed to write to key log: " + _r$49); /* */ $s = 99; case 99: if($c) { $c = false; _r$50 = _r$50.$blk(); } if (_r$50 && _r$50.$blk !== undefined) { break s; } $24r$4 = _r$50; $s = 100; case 100: return $24r$4; /* } */ case 96: hs.finishedHash.discardHandshakeBuffer(); $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: clientHandshakeState.ptr.prototype.doFullHandshake }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f._arg = _arg; $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$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$36 = _r$36; $f._r$37 = _r$37; $f._r$38 = _r$38; $f._r$39 = _r$39; $f._r$4 = _r$4; $f._r$40 = _r$40; $f._r$41 = _r$41; $f._r$42 = _r$42; $f._r$43 = _r$43; $f._r$44 = _r$44; $f._r$45 = _r$45; $f._r$46 = _r$46; $f._r$47 = _r$47; $f._r$48 = _r$48; $f._r$49 = _r$49; $f._r$5 = _r$5; $f._r$50 = _r$50; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f._tuple = _tuple; $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$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.c = c; $f.certMsg = certMsg; $f.certReq = certReq; $f.certRequested = certRequested; $f.certVerify = certVerify; $f.chainToSend = chainToSend; $f.ckx = ckx; $f.cri = cri; $f.cs = cs; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.err$4 = err$4; $f.err$5 = err$5; $f.err$6 = err$6; $f.hs = hs; $f.key = key; $f.keyAgreement$1 = keyAgreement$1; $f.msg = msg; $f.ok = ok; $f.ok$1 = ok$1; $f.preMasterSecret = preMasterSecret; $f.shd = shd; $f.sigHash = sigHash; $f.sigType = sigType; $f.signOpts = signOpts; $f.signatureAlgorithm = signatureAlgorithm; $f.signed = signed; $f.skx = skx; $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; }; clientHandshakeState.prototype.doFullHandshake = function() { return this.$val.doFullHandshake(); }; clientHandshakeState.ptr.prototype.establishKeys = function() { var _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, c, clientCipher, clientHash, clientIV, clientKey, clientMAC, hs, serverCipher, serverHash, serverIV, serverKey, serverMAC, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; c = $f.c; clientCipher = $f.clientCipher; clientHash = $f.clientHash; clientIV = $f.clientIV; clientKey = $f.clientKey; clientMAC = $f.clientMAC; hs = $f.hs; serverCipher = $f.serverCipher; serverHash = $f.serverHash; serverIV = $f.serverIV; serverKey = $f.serverKey; serverMAC = $f.serverMAC; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; _r = keysFromMasterSecret(c.vers, hs.suite, hs.masterSecret, hs.hello.random, hs.serverHello.random, hs.suite.macLen, hs.suite.keyLen, hs.suite.ivLen); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; clientMAC = _tuple[0]; serverMAC = _tuple[1]; clientKey = _tuple[2]; serverKey = _tuple[3]; clientIV = _tuple[4]; serverIV = _tuple[5]; _tmp = $ifaceNil; _tmp$1 = $ifaceNil; clientCipher = _tmp; serverCipher = _tmp$1; _tmp$2 = $ifaceNil; _tmp$3 = $ifaceNil; clientHash = _tmp$2; serverHash = _tmp$3; /* */ if (!(hs.suite.cipher === $throwNilPointerError)) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!(hs.suite.cipher === $throwNilPointerError)) { */ case 2: _r$1 = hs.suite.cipher(clientKey, clientIV, false); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } clientCipher = _r$1; _r$2 = hs.suite.mac(clientMAC); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } clientHash = _r$2; _r$3 = hs.suite.cipher(serverKey, serverIV, true); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } serverCipher = _r$3; _r$4 = hs.suite.mac(serverMAC); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } serverHash = _r$4; $s = 4; continue; /* } else { */ case 3: _r$5 = hs.suite.aead(clientKey, clientIV); /* */ $s = 9; case 9: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } clientCipher = _r$5; _r$6 = hs.suite.aead(serverKey, serverIV); /* */ $s = 10; case 10: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } serverCipher = _r$6; /* } */ case 4: c.in$27.prepareCipherSpec(c.vers, serverCipher, serverHash); c.out.prepareCipherSpec(c.vers, clientCipher, clientHash); $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: clientHandshakeState.ptr.prototype.establishKeys }; } $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._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f.c = c; $f.clientCipher = clientCipher; $f.clientHash = clientHash; $f.clientIV = clientIV; $f.clientKey = clientKey; $f.clientMAC = clientMAC; $f.hs = hs; $f.serverCipher = serverCipher; $f.serverHash = serverHash; $f.serverIV = serverIV; $f.serverKey = serverKey; $f.serverMAC = serverMAC; $f.$s = $s; $f.$r = $r; return $f; }; clientHandshakeState.prototype.establishKeys = function() { return this.$val.establishKeys(); }; clientHandshakeState.ptr.prototype.serverResumedSession = function() { var hs; hs = this; return !(hs.session === ptrType$37.nil) && !(hs.hello.sessionId === sliceType$5.nil) && bytes.Equal(hs.serverHello.sessionId, hs.hello.sessionId); }; clientHandshakeState.prototype.serverResumedSession = function() { return this.$val.serverResumedSession(); }; clientHandshakeState.ptr.prototype.processServerHello = function() { var _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, c, err, err$1, expectedSecureRenegotiation, hs, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; c = $f.c; err = $f.err; err$1 = $f.err$1; expectedSecureRenegotiation = $f.expectedSecureRenegotiation; hs = $f.hs; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; _r = hs.pickCipherSuite(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [false, err]; } /* */ if (!((hs.serverHello.compressionMethod === 0))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!((hs.serverHello.compressionMethod === 0))) { */ case 2: _r$1 = c.sendAlert(10); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = -1; return [false, errors.New("tls: server selected unsupported compression format")]; /* } */ case 3: /* */ if ((c.handshakes === 0) && hs.serverHello.secureRenegotiationSupported) { $s = 5; continue; } /* */ $s = 6; continue; /* if ((c.handshakes === 0) && hs.serverHello.secureRenegotiationSupported) { */ case 5: c.secureRenegotiation = true; /* */ if (!((hs.serverHello.secureRenegotiation.$length === 0))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!((hs.serverHello.secureRenegotiation.$length === 0))) { */ case 7: _r$2 = c.sendAlert(40); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; $s = -1; return [false, errors.New("tls: initial handshake had non-empty renegotiation extension")]; /* } */ case 8: /* } */ case 6: /* */ if (c.handshakes > 0 && c.secureRenegotiation) { $s = 10; continue; } /* */ $s = 11; continue; /* if (c.handshakes > 0 && c.secureRenegotiation) { */ case 10: expectedSecureRenegotiation = arrayType$5.zero(); $copySlice(new sliceType$5(expectedSecureRenegotiation), new sliceType$5(c.clientFinished)); $copySlice($subslice(new sliceType$5(expectedSecureRenegotiation), 12), new sliceType$5(c.serverFinished)); /* */ if (!bytes.Equal(hs.serverHello.secureRenegotiation, new sliceType$5(expectedSecureRenegotiation))) { $s = 12; continue; } /* */ $s = 13; continue; /* if (!bytes.Equal(hs.serverHello.secureRenegotiation, new sliceType$5(expectedSecureRenegotiation))) { */ case 12: _r$3 = c.sendAlert(40); /* */ $s = 14; case 14: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $s = -1; return [false, errors.New("tls: incorrect renegotiation extension contents")]; /* } */ case 13: /* } */ case 11: err$1 = checkALPN(hs.hello.alpnProtocols, hs.serverHello.alpnProtocol); /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 15; continue; } /* */ $s = 16; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 15: _r$4 = c.sendAlert(110); /* */ $s = 17; case 17: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; $s = -1; return [false, err$1]; /* } */ case 16: c.clientProtocol = hs.serverHello.alpnProtocol; c.scts = hs.serverHello.scts; if (!hs.serverResumedSession()) { $s = -1; return [false, $ifaceNil]; } /* */ if (!((hs.session.vers === c.vers))) { $s = 18; continue; } /* */ $s = 19; continue; /* if (!((hs.session.vers === c.vers))) { */ case 18: _r$5 = c.sendAlert(40); /* */ $s = 20; case 20: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; $s = -1; return [false, errors.New("tls: server resumed a session with a different version")]; /* } */ case 19: /* */ if (!((hs.session.cipherSuite === hs.suite.id))) { $s = 21; continue; } /* */ $s = 22; continue; /* if (!((hs.session.cipherSuite === hs.suite.id))) { */ case 21: _r$6 = c.sendAlert(40); /* */ $s = 23; case 23: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; $s = -1; return [false, errors.New("tls: server resumed a session with a different cipher suite")]; /* } */ case 22: hs.masterSecret = hs.session.masterSecret; c.peerCertificates = hs.session.serverCertificates; c.verifiedChains = hs.session.verifiedChains; c.ocspResponse = hs.session.ocspResponse; if ((c.scts.$length === 0) && !((hs.session.scts.$length === 0))) { c.scts = hs.session.scts; } $s = -1; return [true, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: clientHandshakeState.ptr.prototype.processServerHello }; } $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.c = c; $f.err = err; $f.err$1 = err$1; $f.expectedSecureRenegotiation = expectedSecureRenegotiation; $f.hs = hs; $f.$s = $s; $f.$r = $r; return $f; }; clientHandshakeState.prototype.processServerHello = function() { return this.$val.processServerHello(); }; checkALPN = function(clientProtos, serverProto) { var _i, _ref, clientProtos, proto, serverProto; if (serverProto === "") { return $ifaceNil; } if (clientProtos.$length === 0) { return errors.New("tls: server advertised unrequested ALPN extension"); } _ref = clientProtos; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } proto = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (proto === serverProto) { return $ifaceNil; } _i++; } return errors.New("tls: server selected unadvertised ALPN protocol"); }; clientHandshakeState.ptr.prototype.readFinished = function(out) { var $24r, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _tuple, _tuple$1, c, err, err$1, hs, msg, ok, out, serverFinished, verify, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; c = $f.c; err = $f.err; err$1 = $f.err$1; hs = $f.hs; msg = $f.msg; ok = $f.ok; out = $f.out; serverFinished = $f.serverFinished; verify = $f.verify; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; _r = c.readChangeCipherSpec(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _r$1 = c.readHandshake(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; msg = _tuple[0]; err$1 = _tuple[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } _tuple$1 = $assertType(msg, ptrType$29, true); serverFinished = _tuple$1[0]; ok = _tuple$1[1]; /* */ if (!ok) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!ok) { */ case 3: _r$2 = c.sendAlert(10); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; _r$3 = unexpectedMessageError(serverFinished, msg); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = _r$3; $s = 7; case 7: return $24r; /* } */ case 4: _r$4 = $clone(hs.finishedHash, finishedHash).serverSum(hs.masterSecret); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } verify = _r$4; /* */ if (!((verify.$length === serverFinished.verifyData.$length)) || !((subtle.ConstantTimeCompare(verify, serverFinished.verifyData) === 1))) { $s = 9; continue; } /* */ $s = 10; continue; /* if (!((verify.$length === serverFinished.verifyData.$length)) || !((subtle.ConstantTimeCompare(verify, serverFinished.verifyData) === 1))) { */ case 9: _r$5 = c.sendAlert(40); /* */ $s = 11; case 11: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; $s = -1; return errors.New("tls: server's Finished message was incorrect"); /* } */ case 10: _r$6 = serverFinished.marshal(); /* */ $s = 12; case 12: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$7 = hs.finishedHash.Write(_r$6); /* */ $s = 13; case 13: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$7; $copySlice(out, verify); $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: clientHandshakeState.ptr.prototype.readFinished }; } $f.$24r = $24r; $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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.c = c; $f.err = err; $f.err$1 = err$1; $f.hs = hs; $f.msg = msg; $f.ok = ok; $f.out = out; $f.serverFinished = serverFinished; $f.verify = verify; $f.$s = $s; $f.$r = $r; return $f; }; clientHandshakeState.prototype.readFinished = function(out) { return this.$val.readFinished(out); }; clientHandshakeState.ptr.prototype.readSessionTicket = function() { var $24r, _r, _r$1, _r$2, _r$3, _r$4, _tuple, _tuple$1, c, err, hs, msg, ok, sessionTicketMsg, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; c = $f.c; err = $f.err; hs = $f.hs; msg = $f.msg; ok = $f.ok; sessionTicketMsg = $f.sessionTicketMsg; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; if (!hs.serverHello.ticketSupported) { $s = -1; return $ifaceNil; } c = hs.c; _r = c.readHandshake(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; msg = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _tuple$1 = $assertType(msg, ptrType$42, true); sessionTicketMsg = _tuple$1[0]; ok = _tuple$1[1]; /* */ if (!ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!ok) { */ case 2: _r$1 = c.sendAlert(10); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _r$2 = unexpectedMessageError(sessionTicketMsg, msg); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 6; case 6: return $24r; /* } */ case 3: _r$3 = hs.finishedHash.Write(sessionTicketMsg.marshal()); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _r$4 = c.config.time(); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } hs.session = new ClientSessionState.ptr(sessionTicketMsg.ticket, c.vers, hs.suite.id, hs.masterSecret, c.peerCertificates, c.verifiedChains, $clone(_r$4, time.Time), c.ocspResponse, c.scts, sliceType$5.nil, new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$7.nil), 0); $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: clientHandshakeState.ptr.prototype.readSessionTicket }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.c = c; $f.err = err; $f.hs = hs; $f.msg = msg; $f.ok = ok; $f.sessionTicketMsg = sessionTicketMsg; $f.$s = $s; $f.$r = $r; return $f; }; clientHandshakeState.prototype.readSessionTicket = function() { return this.$val.readSessionTicket(); }; clientHandshakeState.ptr.prototype.sendFinished = function(out) { var _arg, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, _tuple$1, c, err, err$1, finished, hs, out, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; c = $f.c; err = $f.err; err$1 = $f.err$1; finished = $f.finished; hs = $f.hs; out = $f.out; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hs = this; c = hs.c; _r = c.writeRecord(20, new sliceType$5([1])); /* */ $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))) { $s = -1; return err; } finished = new finishedMsg.ptr(sliceType$5.nil, sliceType$5.nil); _r$1 = $clone(hs.finishedHash, finishedHash).clientSum(hs.masterSecret); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } finished.verifyData = _r$1; _r$2 = finished.marshal(); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = hs.finishedHash.Write(_r$2); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _r$4 = finished.marshal(); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _arg = _r$4; _r$5 = c.writeRecord(22, _arg); /* */ $s = 6; case 6: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$1 = _r$5; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } $copySlice(out, finished.verifyData); $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: clientHandshakeState.ptr.prototype.sendFinished }; } $f._arg = _arg; $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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.c = c; $f.err = err; $f.err$1 = err$1; $f.finished = finished; $f.hs = hs; $f.out = out; $f.$s = $s; $f.$r = $r; return $f; }; clientHandshakeState.prototype.sendFinished = function(out) { return this.$val.sendFinished(out); }; Conn.ptr.prototype.verifyServerCertificate = function(certificates) { var $24r, $24r$1, _i, _i$1, _r, _r$1, _r$10, _r$11, _r$12, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _ref$1, _ref$2, _tuple, _tuple$1, asn1Data, c, cert, cert$1, certificates, certs, err, err$1, err$2, err$3, i, opts, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; asn1Data = $f.asn1Data; c = $f.c; cert = $f.cert; cert$1 = $f.cert$1; certificates = $f.certificates; certs = $f.certs; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; i = $f.i; opts = $f.opts; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; certs = $makeSlice(sliceType$12, certificates.$length); _ref = certificates; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } i = _i; asn1Data = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r = x509.ParseCertificate(asn1Data); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; cert = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 4: _r$1 = c.sendAlert(42); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _r$2 = err.Error(); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = errors.New("tls: failed to parse certificate from server: " + _r$2); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = _r$3; $s = 9; case 9: return $24r; /* } */ case 5: ((i < 0 || i >= certs.$length) ? ($throwRuntimeError("index out of range"), undefined) : certs.$array[certs.$offset + i] = cert); _i++; $s = 1; continue; case 2: /* */ if (!c.config.InsecureSkipVerify) { $s = 10; continue; } /* */ $s = 11; continue; /* if (!c.config.InsecureSkipVerify) { */ case 10: _r$4 = c.config.time(); /* */ $s = 12; case 12: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } opts = new x509.VerifyOptions.ptr(c.config.ServerName, x509.NewCertPool(), c.config.RootCAs, $clone(_r$4, time.Time), sliceType$14.nil, 0); _ref$1 = $subslice(certs, 1); _i$1 = 0; /* while (true) { */ case 13: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 14; continue; } cert$1 = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); $r = opts.Intermediates.AddCert(cert$1); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i$1++; $s = 13; continue; case 14: err$1 = $ifaceNil; _r$5 = (0 >= certs.$length ? ($throwRuntimeError("index out of range"), undefined) : certs.$array[certs.$offset + 0]).Verify($clone(opts, x509.VerifyOptions)); /* */ $s = 16; case 16: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$1 = _r$5; c.verifiedChains = _tuple$1[0]; err$1 = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 17; continue; } /* */ $s = 18; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 17: _r$6 = c.sendAlert(42); /* */ $s = 19; case 19: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; $s = -1; return err$1; /* } */ case 18: /* } */ case 11: _ref$2 = (0 >= certs.$length ? ($throwRuntimeError("index out of range"), undefined) : certs.$array[certs.$offset + 0]).PublicKey; /* */ if ($assertType(_ref$2, ptrType$11, true)[1] || $assertType(_ref$2, ptrType$12, true)[1] || $assertType(_ref$2, ed25519.PublicKey, true)[1]) { $s = 20; continue; } /* */ $s = 21; continue; /* switch (0) { default: if ($assertType(_ref$2, ptrType$11, true)[1] || $assertType(_ref$2, ptrType$12, true)[1] || $assertType(_ref$2, ed25519.PublicKey, true)[1]) { */ case 20: /* break; */ $s = 22; continue; $s = 22; continue; /* } else { */ case 21: _r$7 = c.sendAlert(43); /* */ $s = 23; case 23: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$7; _r$8 = fmt.Errorf("tls: server's certificate contains an unsupported type of public key: %T", new sliceType$6([(0 >= certs.$length ? ($throwRuntimeError("index out of range"), undefined) : certs.$array[certs.$offset + 0]).PublicKey])); /* */ $s = 24; case 24: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } $24r$1 = _r$8; $s = 25; case 25: return $24r$1; /* } } */ case 22: c.peerCertificates = certs; /* */ if (!(c.config.VerifyPeerCertificate === $throwNilPointerError)) { $s = 26; continue; } /* */ $s = 27; continue; /* if (!(c.config.VerifyPeerCertificate === $throwNilPointerError)) { */ case 26: _r$9 = c.config.VerifyPeerCertificate(certificates, c.verifiedChains); /* */ $s = 28; case 28: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err$2 = _r$9; /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 29; continue; } /* */ $s = 30; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 29: _r$10 = c.sendAlert(42); /* */ $s = 31; case 31: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; $s = -1; return err$2; /* } */ case 30: /* } */ case 27: /* */ if (!(c.config.VerifyConnection === $throwNilPointerError)) { $s = 32; continue; } /* */ $s = 33; continue; /* if (!(c.config.VerifyConnection === $throwNilPointerError)) { */ case 32: _r$11 = c.config.VerifyConnection($clone(c.connectionStateLocked(), ConnectionState)); /* */ $s = 34; case 34: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } err$3 = _r$11; /* */ if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = 35; continue; } /* */ $s = 36; continue; /* if (!($interfaceIsEqual(err$3, $ifaceNil))) { */ case 35: _r$12 = c.sendAlert(42); /* */ $s = 37; case 37: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _r$12; $s = -1; return err$3; /* } */ case 36: /* } */ case 33: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.verifyServerCertificate }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._i = _i; $f._i$1 = _i$1; $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$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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.asn1Data = asn1Data; $f.c = c; $f.cert = cert; $f.cert$1 = cert$1; $f.certificates = certificates; $f.certs = certs; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.i = i; $f.opts = opts; $f.$s = $s; $f.$r = $r; return $f; }; Conn.prototype.verifyServerCertificate = function(certificates) { return this.$val.verifyServerCertificate(certificates); }; certificateRequestInfoFromMsg = function(ctx, vers, certReq) { var _1, _2, _i, _i$1, _r, _ref, _ref$1, _tmp, _tmp$1, _tuple, certReq, certType, cri, ctx, ecAvail, err, rsaAvail, sigScheme, sigType, vers, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _2 = $f._2; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _ref = $f._ref; _ref$1 = $f._ref$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; certReq = $f.certReq; certType = $f.certType; cri = $f.cri; ctx = $f.ctx; ecAvail = $f.ecAvail; err = $f.err; rsaAvail = $f.rsaAvail; sigScheme = $f.sigScheme; sigType = $f.sigType; vers = $f.vers; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cri = new CertificateRequestInfo.ptr(certReq.certificateAuthorities, sliceType$7.nil, vers, ctx); _tmp = false; _tmp$1 = false; rsaAvail = _tmp; ecAvail = _tmp$1; _ref = certReq.certificateTypes; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } certType = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _1 = certType; if (_1 === (1)) { rsaAvail = true; } else if (_1 === (64)) { ecAvail = true; } _i++; } if (!certReq.hasSignatureAlgorithm) { if (rsaAvail && ecAvail) { cri.SignatureSchemes = new sliceType$7([1027, 1283, 1539, 1025, 1281, 1537, 513]); } else if (rsaAvail) { cri.SignatureSchemes = new sliceType$7([1025, 1281, 1537, 513]); } else if (ecAvail) { cri.SignatureSchemes = new sliceType$7([1027, 1283, 1539]); } $s = -1; return cri; } cri.SignatureSchemes = $makeSlice(sliceType$7, 0, certReq.supportedSignatureAlgorithms.$length); _ref$1 = certReq.supportedSignatureAlgorithms; _i$1 = 0; /* while (true) { */ case 1: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 2; continue; } sigScheme = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); _r = typeAndHashFromSignatureScheme(sigScheme); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; sigType = _tuple[0]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { _i$1++; /* continue; */ $s = 1; continue; } _2 = sigType; if ((_2 === (227)) || (_2 === (228))) { if (ecAvail) { cri.SignatureSchemes = $append(cri.SignatureSchemes, sigScheme); } } else if ((_2 === (226)) || (_2 === (225))) { if (rsaAvail) { cri.SignatureSchemes = $append(cri.SignatureSchemes, sigScheme); } } _i$1++; $s = 1; continue; case 2: $s = -1; return cri; /* */ } return; } if ($f === undefined) { $f = { $blk: certificateRequestInfoFromMsg }; } $f._1 = _1; $f._2 = _2; $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._ref = _ref; $f._ref$1 = _ref$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.certReq = certReq; $f.certType = certType; $f.cri = cri; $f.ctx = ctx; $f.ecAvail = ecAvail; $f.err = err; $f.rsaAvail = rsaAvail; $f.sigScheme = sigScheme; $f.sigType = sigType; $f.vers = vers; $f.$s = $s; $f.$r = $r; return $f; }; Conn.ptr.prototype.getClientCertificate = function(cri) { var $24r, _i, _r, _r$1, _ref, c, chain, cri, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; c = $f.c; chain = $f.chain; cri = $f.cri; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: chain = [chain]; c = this; /* */ if (!(c.config.GetClientCertificate === $throwNilPointerError)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(c.config.GetClientCertificate === $throwNilPointerError)) { */ case 1: _r = c.config.GetClientCertificate(cri); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 4; case 4: return $24r; /* } */ case 2: _ref = c.config.Certificates; _i = 0; /* while (true) { */ case 5: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 6; continue; } chain[0] = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), Certificate); _r$1 = cri.SupportsCertificate(chain[0]); /* */ $s = 7; case 7: 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))) { _i++; /* continue; */ $s = 5; continue; } $s = -1; return [chain[0], $ifaceNil]; case 6: $s = -1; return [new Certificate.ptr(sliceType$11.nil, $ifaceNil, sliceType$7.nil, sliceType$5.nil, sliceType$11.nil, ptrType$5.nil), $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.getClientCertificate }; } $f.$24r = $24r; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f.c = c; $f.chain = chain; $f.cri = cri; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; Conn.prototype.getClientCertificate = function(cri) { return this.$val.getClientCertificate(cri); }; clientSessionCacheKey = function(serverAddr, config) { var $24r, _r, config, serverAddr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; config = $f.config; serverAddr = $f.serverAddr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (config.ServerName.length > 0) { $s = -1; return config.ServerName; } _r = serverAddr.String(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: clientSessionCacheKey }; } $f.$24r = $24r; $f._r = _r; $f.config = config; $f.serverAddr = serverAddr; $f.$s = $s; $f.$r = $r; return $f; }; hostnameInSNI = function(name) { var host, i, name; host = name; if (host.length > 0 && (host.charCodeAt(0) === 91) && (host.charCodeAt((host.length - 1 >> 0)) === 93)) { host = $substring(host, 1, (host.length - 1 >> 0)); } i = strings.LastIndex(host, "%"); if (i > 0) { host = $substring(host, 0, i); } if (!(net.ParseIP(host) === net.IP.nil)) { return ""; } while (true) { if (!(name.length > 0 && (name.charCodeAt((name.length - 1 >> 0)) === 46))) { break; } name = $substring(name, 0, (name.length - 1 >> 0)); } return name; }; Conn.ptr.prototype.LocalAddr = function() { var $24r, _r, c, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; c = $f.c; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r = c.conn.LocalAddr(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.LocalAddr }; } $f.$24r = $24r; $f._r = _r; $f.c = c; $f.$s = $s; $f.$r = $r; return $f; }; Conn.prototype.LocalAddr = function() { return this.$val.LocalAddr(); }; Conn.ptr.prototype.RemoteAddr = function() { var $24r, _r, c, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; c = $f.c; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r = c.conn.RemoteAddr(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.RemoteAddr }; } $f.$24r = $24r; $f._r = _r; $f.c = c; $f.$s = $s; $f.$r = $r; return $f; }; Conn.prototype.RemoteAddr = function() { return this.$val.RemoteAddr(); }; Conn.ptr.prototype.SetDeadline = function(t) { var $24r, _r, c, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; c = $f.c; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r = c.conn.SetDeadline($clone(t, time.Time)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.SetDeadline }; } $f.$24r = $24r; $f._r = _r; $f.c = c; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Conn.prototype.SetDeadline = function(t) { return this.$val.SetDeadline(t); }; Conn.ptr.prototype.SetReadDeadline = function(t) { var $24r, _r, c, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; c = $f.c; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r = c.conn.SetReadDeadline($clone(t, time.Time)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.SetReadDeadline }; } $f.$24r = $24r; $f._r = _r; $f.c = c; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Conn.prototype.SetReadDeadline = function(t) { return this.$val.SetReadDeadline(t); }; Conn.ptr.prototype.SetWriteDeadline = function(t) { var $24r, _r, c, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; c = $f.c; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r = c.conn.SetWriteDeadline($clone(t, time.Time)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.SetWriteDeadline }; } $f.$24r = $24r; $f._r = _r; $f.c = c; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Conn.prototype.SetWriteDeadline = function(t) { return this.$val.SetWriteDeadline(t); }; permanentError.ptr.prototype.Error = function() { var $24r, _r, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: permanentError.ptr.prototype.Error }; } $f.$24r = $24r; $f._r = _r; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; permanentError.prototype.Error = function() { return this.$val.Error(); }; permanentError.ptr.prototype.Unwrap = function() { var e; e = this; return e.err; }; permanentError.prototype.Unwrap = function() { return this.$val.Unwrap(); }; permanentError.ptr.prototype.Timeout = function() { var $24r, _r, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; _r = e.err.Timeout(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: permanentError.ptr.prototype.Timeout }; } $f.$24r = $24r; $f._r = _r; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; permanentError.prototype.Timeout = function() { return this.$val.Timeout(); }; permanentError.ptr.prototype.Temporary = function() { var e; e = this; return false; }; permanentError.prototype.Temporary = function() { return this.$val.Temporary(); }; halfConn.ptr.prototype.setErrorLocked = function(err) { var _tuple, e, err, hc, ok; hc = this; _tuple = $assertType(err, net.Error, true); e = _tuple[0]; ok = _tuple[1]; if (ok) { hc.err = new permanentError.ptr(e); } else { hc.err = err; } return hc.err; }; halfConn.prototype.setErrorLocked = function(err) { return this.$val.setErrorLocked(err); }; halfConn.ptr.prototype.prepareCipherSpec = function(version, cipher$1, mac) { var cipher$1, hc, mac, version; hc = this; hc.version = version; hc.nextCipher = cipher$1; hc.nextMac = mac; }; halfConn.prototype.prepareCipherSpec = function(version, cipher$1, mac) { return this.$val.prepareCipherSpec(version, cipher$1, mac); }; halfConn.ptr.prototype.changeCipherSpec = function() { var _i, _ref, hc, i, x; hc = this; if ($interfaceIsEqual(hc.nextCipher, $ifaceNil) || (hc.version === 772)) { return new alert(80); } hc.cipher = hc.nextCipher; hc.mac = hc.nextMac; hc.nextCipher = $ifaceNil; hc.nextMac = $ifaceNil; _ref = hc.seq; _i = 0; while (true) { if (!(_i < 8)) { break; } i = _i; (x = hc.seq, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i] = 0)); _i++; } return $ifaceNil; }; halfConn.prototype.changeCipherSpec = function() { return this.$val.changeCipherSpec(); }; halfConn.ptr.prototype.setTrafficSecret = function(suite, secret) { var _i, _r, _r$1, _ref, _tuple, hc, i, iv, key, secret, suite, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; _tuple = $f._tuple; hc = $f.hc; i = $f.i; iv = $f.iv; key = $f.key; secret = $f.secret; suite = $f.suite; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hc = this; hc.trafficSecret = secret; _r = suite.trafficKey(secret); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; key = _tuple[0]; iv = _tuple[1]; _r$1 = suite.aead(key, iv); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } hc.cipher = _r$1; _ref = hc.seq; _i = 0; while (true) { if (!(_i < 8)) { break; } i = _i; (x = hc.seq, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i] = 0)); _i++; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: halfConn.ptr.prototype.setTrafficSecret }; } $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f._tuple = _tuple; $f.hc = hc; $f.i = i; $f.iv = iv; $f.key = key; $f.secret = secret; $f.suite = suite; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; halfConn.prototype.setTrafficSecret = function(suite, secret) { return this.$val.setTrafficSecret(suite, secret); }; halfConn.ptr.prototype.incSeq = function() { var hc, i, x, x$1, x$2; hc = this; i = 7; while (true) { if (!(i >= 0)) { break; } (x$1 = hc.seq, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i] = ((x = hc.seq, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i])) + (1) << 24 >>> 24))); if (!(((x$2 = hc.seq, ((i < 0 || i >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i])) === 0))) { return; } i = i - (1) >> 0; } $panic(new $String("TLS: sequence number wraparound")); }; halfConn.prototype.incSeq = function() { return this.$val.incSeq(); }; halfConn.ptr.prototype.explicitNonceLen = function() { var $24r, $24r$1, _r, _r$1, _ref, c, c$1, c$2, c$3, hc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; c = $f.c; c$1 = $f.c$1; c$2 = $f.c$2; c$3 = $f.c$3; hc = $f.hc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hc = this; if ($interfaceIsEqual(hc.cipher, $ifaceNil)) { $s = -1; return 0; } _ref = hc.cipher; /* */ if ($assertType(_ref, cipher.Stream, true)[1]) { $s = 1; continue; } /* */ if ($assertType(_ref, aead, true)[1]) { $s = 2; continue; } /* */ if ($assertType(_ref, cbcMode, true)[1]) { $s = 3; continue; } /* */ $s = 4; continue; /* if ($assertType(_ref, cipher.Stream, true)[1]) { */ case 1: c = _ref; $s = -1; return 0; /* } else if ($assertType(_ref, aead, true)[1]) { */ case 2: c$1 = _ref; _r = c$1.explicitNonceLen(); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 7; case 7: return $24r; /* } else if ($assertType(_ref, cbcMode, true)[1]) { */ case 3: c$2 = _ref; /* */ if (hc.version >= 770) { $s = 8; continue; } /* */ $s = 9; continue; /* if (hc.version >= 770) { */ case 8: _r$1 = c$2.BlockSize(); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r$1 = _r$1; $s = 11; case 11: return $24r$1; /* } */ case 9: $s = -1; return 0; /* } else { */ case 4: c$3 = _ref; $panic(new $String("unknown cipher type")); /* } */ case 5: $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: halfConn.ptr.prototype.explicitNonceLen }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f.c = c; $f.c$1 = c$1; $f.c$2 = c$2; $f.c$3 = c$3; $f.hc = hc; $f.$s = $s; $f.$r = $r; return $f; }; halfConn.prototype.explicitNonceLen = function() { return this.$val.explicitNonceLen(); }; extractPadding = function(payload) { var _tmp, _tmp$1, b, good, i, mask, paddingLen, payload, t, t$1, toCheck, toRemove, x, x$1; toRemove = 0; good = 0; if (payload.$length < 1) { _tmp = 0; _tmp$1 = 0; toRemove = _tmp; good = _tmp$1; return [toRemove, good]; } paddingLen = (x = payload.$length - 1 >> 0, ((x < 0 || x >= payload.$length) ? ($throwRuntimeError("index out of range"), undefined) : payload.$array[payload.$offset + x])); t = (((payload.$length - 1 >> 0) >>> 0)) - ((paddingLen >>> 0)) >>> 0; good = ((((((~t >>> 0) >> 0)) >> 31 >> 0) << 24 >>> 24)); toCheck = 256; if (toCheck > payload.$length) { toCheck = payload.$length; } i = 0; while (true) { if (!(i < toCheck)) { break; } t$1 = ((paddingLen >>> 0)) - ((i >>> 0)) >>> 0; mask = ((((((~t$1 >>> 0) >> 0)) >> 31 >> 0) << 24 >>> 24)); b = (x$1 = (payload.$length - 1 >> 0) - i >> 0, ((x$1 < 0 || x$1 >= payload.$length) ? ($throwRuntimeError("index out of range"), undefined) : payload.$array[payload.$offset + x$1])); good = (good & ~(((((mask & paddingLen) >>> 0) ^ ((mask & b) >>> 0)) << 24 >>> 24))) << 24 >>> 24; i = i + (1) >> 0; } good = (good & ((good << 4 << 24 >>> 24))) >>> 0; good = (good & ((good << 2 << 24 >>> 24))) >>> 0; good = (good & ((good << 1 << 24 >>> 24))) >>> 0; good = (((((good << 24 >> 24)) >> 7 << 24 >> 24) << 24 >>> 24)); paddingLen = (paddingLen & (good)) >>> 0; toRemove = ((paddingLen >> 0)) + 1 >> 0; return [toRemove, good]; }; roundUp = function(a, b) { var _r, _r$1, a, b; return a + (_r = ((b - (_r$1 = a % b, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) >> 0)) % b, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) >> 0; }; halfConn.ptr.prototype.decrypt = function(record) { var _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _ref, _tuple, _tuple$1, additionalData, blockSize, c, c$1, c$2, c$3, err, explicitNonceLen, hc, i, localMAC, macAndPaddingGood, macSize, minPayload, n, n$1, nonce, paddingGood, paddingLen, payload, plaintext, record, remoteMAC, typ, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; additionalData = $f.additionalData; blockSize = $f.blockSize; c = $f.c; c$1 = $f.c$1; c$2 = $f.c$2; c$3 = $f.c$3; err = $f.err; explicitNonceLen = $f.explicitNonceLen; hc = $f.hc; i = $f.i; localMAC = $f.localMAC; macAndPaddingGood = $f.macAndPaddingGood; macSize = $f.macSize; minPayload = $f.minPayload; n = $f.n; n$1 = $f.n$1; nonce = $f.nonce; paddingGood = $f.paddingGood; paddingLen = $f.paddingLen; payload = $f.payload; plaintext = $f.plaintext; record = $f.record; remoteMAC = $f.remoteMAC; typ = $f.typ; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hc = this; plaintext = sliceType$5.nil; typ = (((0 >= record.$length ? ($throwRuntimeError("index out of range"), undefined) : record.$array[record.$offset + 0]) << 24 >>> 24)); payload = $subslice(record, 5); if ((hc.version === 772) && (typ === 20)) { $s = -1; return [payload, typ, $ifaceNil]; } paddingGood = 255; paddingLen = 0; _r = hc.explicitNonceLen(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } explicitNonceLen = _r; /* */ if (!($interfaceIsEqual(hc.cipher, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(hc.cipher, $ifaceNil))) { */ case 2: _ref = hc.cipher; /* */ if ($assertType(_ref, cipher.Stream, true)[1]) { $s = 5; continue; } /* */ if ($assertType(_ref, aead, true)[1]) { $s = 6; continue; } /* */ if ($assertType(_ref, cbcMode, true)[1]) { $s = 7; continue; } /* */ $s = 8; continue; /* if ($assertType(_ref, cipher.Stream, true)[1]) { */ case 5: c = _ref; $r = c.XORKeyStream(payload, payload); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 9; continue; /* } else if ($assertType(_ref, aead, true)[1]) { */ case 6: c$1 = _ref; if (payload.$length < explicitNonceLen) { $s = -1; return [sliceType$5.nil, 0, new alert(20)]; } nonce = $subslice(payload, 0, explicitNonceLen); if (nonce.$length === 0) { nonce = new sliceType$5(hc.seq); } payload = $subslice(payload, explicitNonceLen); additionalData = sliceType$5.nil; /* */ if (hc.version === 772) { $s = 11; continue; } /* */ $s = 12; continue; /* if (hc.version === 772) { */ case 11: additionalData = $subslice(record, 0, 5); $s = 13; continue; /* } else { */ case 12: additionalData = $appendSlice($subslice(new sliceType$5(hc.scratchBuf), 0, 0), new sliceType$5(hc.seq)); additionalData = $appendSlice(additionalData, $subslice(record, 0, 3)); _r$1 = c$1.Overhead(); /* */ $s = 14; case 14: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } n = payload.$length - _r$1 >> 0; additionalData = $append(additionalData, (((n >> 8 >> 0) << 24 >>> 24)), ((n << 24 >>> 24))); /* } */ case 13: err = $ifaceNil; _r$2 = c$1.Open($subslice(payload, 0, 0), nonce, payload, additionalData); /* */ $s = 15; case 15: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; plaintext = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType$5.nil, 0, new alert(20)]; } $s = 9; continue; /* } else if ($assertType(_ref, cbcMode, true)[1]) { */ case 7: c$2 = _ref; _r$3 = c$2.BlockSize(); /* */ $s = 16; case 16: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } blockSize = _r$3; _r$4 = hc.mac.Size(); /* */ $s = 17; case 17: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = roundUp(_r$4 + 1 >> 0, blockSize); /* */ $s = 18; case 18: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } minPayload = explicitNonceLen + _r$5 >> 0; if (!(((_r$6 = payload.$length % blockSize, _r$6 === _r$6 ? _r$6 : $throwRuntimeError("integer divide by zero")) === 0)) || payload.$length < minPayload) { $s = -1; return [sliceType$5.nil, 0, new alert(20)]; } /* */ if (explicitNonceLen > 0) { $s = 19; continue; } /* */ $s = 20; continue; /* if (explicitNonceLen > 0) { */ case 19: $r = c$2.SetIV($subslice(payload, 0, explicitNonceLen)); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } payload = $subslice(payload, explicitNonceLen); /* } */ case 20: $r = c$2.CryptBlocks(payload, payload); /* */ $s = 22; case 22: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tuple$1 = extractPadding(payload); paddingLen = _tuple$1[0]; paddingGood = _tuple$1[1]; $s = 9; continue; /* } else { */ case 8: c$3 = _ref; $panic(new $String("unknown cipher type")); /* } */ case 9: if (hc.version === 772) { if (!((typ === 23))) { $s = -1; return [sliceType$5.nil, 0, new alert(10)]; } if (plaintext.$length > 16385) { $s = -1; return [sliceType$5.nil, 0, new alert(22)]; } i = plaintext.$length - 1 >> 0; while (true) { if (!(i >= 0)) { break; } if (!((((i < 0 || i >= plaintext.$length) ? ($throwRuntimeError("index out of range"), undefined) : plaintext.$array[plaintext.$offset + i]) === 0))) { typ = ((((i < 0 || i >= plaintext.$length) ? ($throwRuntimeError("index out of range"), undefined) : plaintext.$array[plaintext.$offset + i]) << 24 >>> 24)); plaintext = $subslice(plaintext, 0, i); break; } if (i === 0) { $s = -1; return [sliceType$5.nil, 0, new alert(10)]; } i = i - (1) >> 0; } } $s = 4; continue; /* } else { */ case 3: plaintext = payload; /* } */ case 4: /* */ if (!($interfaceIsEqual(hc.mac, $ifaceNil))) { $s = 23; continue; } /* */ $s = 24; continue; /* if (!($interfaceIsEqual(hc.mac, $ifaceNil))) { */ case 23: _r$7 = hc.mac.Size(); /* */ $s = 25; case 25: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } macSize = _r$7; if (payload.$length < macSize) { $s = -1; return [sliceType$5.nil, 0, new alert(20)]; } n$1 = (payload.$length - macSize >> 0) - paddingLen >> 0; n$1 = subtle.ConstantTimeSelect((((((n$1 >>> 0)) >>> 31 >>> 0) >> 0)), 0, n$1); (3 >= record.$length ? ($throwRuntimeError("index out of range"), undefined) : record.$array[record.$offset + 3] = (((n$1 >> 8 >> 0) << 24 >>> 24))); (4 >= record.$length ? ($throwRuntimeError("index out of range"), undefined) : record.$array[record.$offset + 4] = ((n$1 << 24 >>> 24))); remoteMAC = $subslice(payload, n$1, (n$1 + macSize >> 0)); _r$8 = tls10MAC(hc.mac, $subslice(new sliceType$5(hc.scratchBuf), 0, 0), new sliceType$5(hc.seq), $subslice(record, 0, 5), $subslice(payload, 0, n$1), $subslice(payload, (n$1 + macSize >> 0))); /* */ $s = 26; case 26: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } localMAC = _r$8; macAndPaddingGood = subtle.ConstantTimeCompare(localMAC, remoteMAC) & ((paddingGood >> 0)); if (!((macAndPaddingGood === 1))) { $s = -1; return [sliceType$5.nil, 0, new alert(20)]; } plaintext = $subslice(payload, 0, n$1); /* } */ case 24: hc.incSeq(); $s = -1; return [plaintext, typ, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: halfConn.ptr.prototype.decrypt }; } $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._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.additionalData = additionalData; $f.blockSize = blockSize; $f.c = c; $f.c$1 = c$1; $f.c$2 = c$2; $f.c$3 = c$3; $f.err = err; $f.explicitNonceLen = explicitNonceLen; $f.hc = hc; $f.i = i; $f.localMAC = localMAC; $f.macAndPaddingGood = macAndPaddingGood; $f.macSize = macSize; $f.minPayload = minPayload; $f.n = n; $f.n$1 = n$1; $f.nonce = nonce; $f.paddingGood = paddingGood; $f.paddingLen = paddingLen; $f.payload = payload; $f.plaintext = plaintext; $f.record = record; $f.remoteMAC = remoteMAC; $f.typ = typ; $f.$s = $s; $f.$r = $r; return $f; }; halfConn.prototype.decrypt = function(record) { return this.$val.decrypt(record); }; sliceForAppend = function(in$1, n) { var head, in$1, n, tail, total; head = sliceType$5.nil; tail = sliceType$5.nil; total = in$1.$length + n >> 0; if (in$1.$capacity >= total) { head = $subslice(in$1, 0, total); } else { head = $makeSlice(sliceType$5, total); $copySlice(head, in$1); } tail = $subslice(head, in$1.$length); return [head, tail]; }; halfConn.ptr.prototype.encrypt = function(record, payload, rand$1) { var _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _ref, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, additionalData, blockSize, c, c$1, c$2, c$3, dst, err, explicitNonce, explicitNonceLen, hc, i, isCBC, mac, mac$1, n, n$1, nonce, paddingLen, payload, plaintextLen, rand$1, record, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; additionalData = $f.additionalData; blockSize = $f.blockSize; c = $f.c; c$1 = $f.c$1; c$2 = $f.c$2; c$3 = $f.c$3; dst = $f.dst; err = $f.err; explicitNonce = $f.explicitNonce; explicitNonceLen = $f.explicitNonceLen; hc = $f.hc; i = $f.i; isCBC = $f.isCBC; mac = $f.mac; mac$1 = $f.mac$1; n = $f.n; n$1 = $f.n$1; nonce = $f.nonce; paddingLen = $f.paddingLen; payload = $f.payload; plaintextLen = $f.plaintextLen; rand$1 = $f.rand$1; record = $f.record; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hc = this; if ($interfaceIsEqual(hc.cipher, $ifaceNil)) { $s = -1; return [$appendSlice(record, payload), $ifaceNil]; } explicitNonce = sliceType$5.nil; _r = hc.explicitNonceLen(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } explicitNonceLen = _r; /* */ if (explicitNonceLen > 0) { $s = 2; continue; } /* */ $s = 3; continue; /* if (explicitNonceLen > 0) { */ case 2: _tuple = sliceForAppend(record, explicitNonceLen); record = _tuple[0]; explicitNonce = _tuple[1]; _tuple$1 = $assertType(hc.cipher, cbcMode, true); isCBC = _tuple$1[1]; /* */ if (!isCBC && explicitNonceLen < 16) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!isCBC && explicitNonceLen < 16) { */ case 4: $copySlice(explicitNonce, new sliceType$5(hc.seq)); $s = 6; continue; /* } else { */ case 5: _r$1 = io.ReadFull(rand$1, explicitNonce); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$2 = _r$1; err = _tuple$2[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType$5.nil, err]; } /* } */ case 6: /* } */ case 3: dst = sliceType$5.nil; _ref = hc.cipher; /* */ if ($assertType(_ref, cipher.Stream, true)[1]) { $s = 8; continue; } /* */ if ($assertType(_ref, aead, true)[1]) { $s = 9; continue; } /* */ if ($assertType(_ref, cbcMode, true)[1]) { $s = 10; continue; } /* */ $s = 11; continue; /* if ($assertType(_ref, cipher.Stream, true)[1]) { */ case 8: c = _ref; _r$2 = tls10MAC(hc.mac, $subslice(new sliceType$5(hc.scratchBuf), 0, 0), new sliceType$5(hc.seq), $subslice(record, 0, 5), payload, sliceType$5.nil); /* */ $s = 13; case 13: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } mac = _r$2; _tuple$3 = sliceForAppend(record, payload.$length + mac.$length >> 0); record = _tuple$3[0]; dst = _tuple$3[1]; $r = c.XORKeyStream($subslice(dst, 0, payload.$length), payload); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = c.XORKeyStream($subslice(dst, payload.$length), mac); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 12; continue; /* } else if ($assertType(_ref, aead, true)[1]) { */ case 9: c$1 = _ref; nonce = explicitNonce; if (nonce.$length === 0) { nonce = new sliceType$5(hc.seq); } /* */ if (hc.version === 772) { $s = 16; continue; } /* */ $s = 17; continue; /* if (hc.version === 772) { */ case 16: record = $appendSlice(record, payload); record = $append(record, (0 >= record.$length ? ($throwRuntimeError("index out of range"), undefined) : record.$array[record.$offset + 0])); (0 >= record.$length ? ($throwRuntimeError("index out of range"), undefined) : record.$array[record.$offset + 0] = 23); _r$3 = c$1.Overhead(); /* */ $s = 19; case 19: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } n = (payload.$length + 1 >> 0) + _r$3 >> 0; (3 >= record.$length ? ($throwRuntimeError("index out of range"), undefined) : record.$array[record.$offset + 3] = (((n >> 8 >> 0) << 24 >>> 24))); (4 >= record.$length ? ($throwRuntimeError("index out of range"), undefined) : record.$array[record.$offset + 4] = ((n << 24 >>> 24))); _r$4 = c$1.Seal($subslice(record, 0, 5), nonce, $subslice(record, 5), $subslice(record, 0, 5)); /* */ $s = 20; case 20: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } record = _r$4; $s = 18; continue; /* } else { */ case 17: additionalData = $appendSlice($subslice(new sliceType$5(hc.scratchBuf), 0, 0), new sliceType$5(hc.seq)); additionalData = $appendSlice(additionalData, $subslice(record, 0, 5)); _r$5 = c$1.Seal(record, nonce, payload, additionalData); /* */ $s = 21; case 21: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } record = _r$5; /* } */ case 18: $s = 12; continue; /* } else if ($assertType(_ref, cbcMode, true)[1]) { */ case 10: c$2 = _ref; _r$6 = tls10MAC(hc.mac, $subslice(new sliceType$5(hc.scratchBuf), 0, 0), new sliceType$5(hc.seq), $subslice(record, 0, 5), payload, sliceType$5.nil); /* */ $s = 22; case 22: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } mac$1 = _r$6; _r$7 = c$2.BlockSize(); /* */ $s = 23; case 23: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } blockSize = _r$7; plaintextLen = payload.$length + mac$1.$length >> 0; paddingLen = blockSize - (_r$8 = plaintextLen % blockSize, _r$8 === _r$8 ? _r$8 : $throwRuntimeError("integer divide by zero")) >> 0; _tuple$4 = sliceForAppend(record, plaintextLen + paddingLen >> 0); record = _tuple$4[0]; dst = _tuple$4[1]; $copySlice(dst, payload); $copySlice($subslice(dst, payload.$length), mac$1); i = plaintextLen; while (true) { if (!(i < dst.$length)) { break; } ((i < 0 || i >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + i] = (((paddingLen - 1 >> 0) << 24 >>> 24))); i = i + (1) >> 0; } /* */ if (explicitNonce.$length > 0) { $s = 24; continue; } /* */ $s = 25; continue; /* if (explicitNonce.$length > 0) { */ case 24: $r = c$2.SetIV(explicitNonce); /* */ $s = 26; case 26: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 25: $r = c$2.CryptBlocks(dst, dst); /* */ $s = 27; case 27: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 12; continue; /* } else { */ case 11: c$3 = _ref; $panic(new $String("unknown cipher type")); /* } */ case 12: n$1 = record.$length - 5 >> 0; (3 >= record.$length ? ($throwRuntimeError("index out of range"), undefined) : record.$array[record.$offset + 3] = (((n$1 >> 8 >> 0) << 24 >>> 24))); (4 >= record.$length ? ($throwRuntimeError("index out of range"), undefined) : record.$array[record.$offset + 4] = ((n$1 << 24 >>> 24))); hc.incSeq(); $s = -1; return [record, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: halfConn.ptr.prototype.encrypt }; } $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._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f.additionalData = additionalData; $f.blockSize = blockSize; $f.c = c; $f.c$1 = c$1; $f.c$2 = c$2; $f.c$3 = c$3; $f.dst = dst; $f.err = err; $f.explicitNonce = explicitNonce; $f.explicitNonceLen = explicitNonceLen; $f.hc = hc; $f.i = i; $f.isCBC = isCBC; $f.mac = mac; $f.mac$1 = mac$1; $f.n = n; $f.n$1 = n$1; $f.nonce = nonce; $f.paddingLen = paddingLen; $f.payload = payload; $f.plaintextLen = plaintextLen; $f.rand$1 = rand$1; $f.record = record; $f.$s = $s; $f.$r = $r; return $f; }; halfConn.prototype.encrypt = function(record, payload, rand$1) { return this.$val.encrypt(record, payload, rand$1); }; RecordHeaderError.ptr.prototype.Error = function() { var e; e = this; return "tls: " + e.Msg; }; RecordHeaderError.prototype.Error = function() { return this.$val.Error(); }; Conn.ptr.prototype.newRecordHeaderError = function(conn, msg) { var c, conn, err, msg; err = new RecordHeaderError.ptr("", arrayType$6.zero(), $ifaceNil); c = this; err.Msg = msg; err.Conn = conn; $copySlice(new sliceType$5(err.RecordHeader), c.rawInput.Bytes()); RecordHeaderError.copy(err, err); return err; }; Conn.prototype.newRecordHeaderError = function(conn, msg) { return this.$val.newRecordHeaderError(conn, msg); }; Conn.ptr.prototype.readRecord = function() { var $24r, _r, c, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; c = $f.c; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r = c.readRecordOrCCS(false); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.readRecord }; } $f.$24r = $24r; $f._r = _r; $f.c = c; $f.$s = $s; $f.$r = $r; return $f; }; Conn.prototype.readRecord = function() { return this.$val.readRecord(); }; Conn.ptr.prototype.readChangeCipherSpec = function() { var $24r, _r, c, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; c = $f.c; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r = c.readRecordOrCCS(true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.readChangeCipherSpec }; } $f.$24r = $24r; $f._r = _r; $f.c = c; $f.$s = $s; $f.$r = $r; return $f; }; Conn.prototype.readChangeCipherSpec = function() { return this.$val.readChangeCipherSpec(); }; Conn.ptr.prototype.readRecordOrCCS = function(expectChangeCipherSpec) { var $24r, $24r$1, $24r$10, $24r$11, $24r$12, $24r$13, $24r$14, $24r$15, $24r$2, $24r$3, $24r$4, $24r$5, $24r$6, $24r$7, $24r$8, $24r$9, _1, _2, _r, _r$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$36, _r$37, _r$38, _r$39, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, _tuple$2, _v, _v$1, c, data, e, e$1, err, err$1, err$2, err$3, expectChangeCipherSpec, handshakeComplete, hdr, msg, msg$1, n, ok, ok$1, record, typ, vers, 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; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$10 = $f.$24r$10; $24r$11 = $f.$24r$11; $24r$12 = $f.$24r$12; $24r$13 = $f.$24r$13; $24r$14 = $f.$24r$14; $24r$15 = $f.$24r$15; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; $24r$6 = $f.$24r$6; $24r$7 = $f.$24r$7; $24r$8 = $f.$24r$8; $24r$9 = $f.$24r$9; _1 = $f._1; _2 = $f._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$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$36 = $f._r$36; _r$37 = $f._r$37; _r$38 = $f._r$38; _r$39 = $f._r$39; _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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _v = $f._v; _v$1 = $f._v$1; c = $f.c; data = $f.data; e = $f.e; e$1 = $f.e$1; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; expectChangeCipherSpec = $f.expectChangeCipherSpec; handshakeComplete = $f.handshakeComplete; hdr = $f.hdr; msg = $f.msg; msg$1 = $f.msg$1; n = $f.n; ok = $f.ok; ok$1 = $f.ok$1; record = $f.record; typ = $f.typ; vers = $f.vers; 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: c = this; if (!($interfaceIsEqual(c.in$27.err, $ifaceNil))) { $s = -1; return c.in$27.err; } handshakeComplete = c.handshakeComplete(); if (!((c.input.Len() === 0))) { $s = -1; return c.in$27.setErrorLocked(errors.New("tls: internal error: attempted to read record with pending application data")); } c.input.Reset(sliceType$5.nil); _r = c.readFromUntil(c.conn, 5); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: if ($interfaceIsEqual(err, io.ErrUnexpectedEOF) && (c.rawInput.Len() === 0)) { err = io.EOF; } _tuple = $assertType(err, net.Error, true); e = _tuple[0]; ok = _tuple[1]; if (!ok) { _v = true; $s = 6; continue s; } _r$1 = e.Temporary(); /* */ $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: c.in$27.setErrorLocked(err); /* } */ case 5: $s = -1; return err; /* } */ case 3: hdr = $subslice(c.rawInput.Bytes(), 0, 5); typ = (((0 >= hdr.$length ? ($throwRuntimeError("index out of range"), undefined) : hdr.$array[hdr.$offset + 0]) << 24 >>> 24)); /* */ if (!handshakeComplete && (typ === 128)) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!handshakeComplete && (typ === 128)) { */ case 8: _r$2 = c.sendAlert(70); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; $s = -1; return c.in$27.setErrorLocked((x = c.newRecordHeaderError($ifaceNil, "unsupported SSLv2 handshake received"), new x.constructor.elem(x))); /* } */ case 9: vers = (((((1 >= hdr.$length ? ($throwRuntimeError("index out of range"), undefined) : hdr.$array[hdr.$offset + 1]) << 16 >>> 16)) << 8 << 16 >>> 16) | (((2 >= hdr.$length ? ($throwRuntimeError("index out of range"), undefined) : hdr.$array[hdr.$offset + 2]) << 16 >>> 16))) >>> 0; n = ((((3 >= hdr.$length ? ($throwRuntimeError("index out of range"), undefined) : hdr.$array[hdr.$offset + 3]) >> 0)) << 8 >> 0) | (((4 >= hdr.$length ? ($throwRuntimeError("index out of range"), undefined) : hdr.$array[hdr.$offset + 4]) >> 0)); /* */ if (c.haveVers && !((c.vers === 772)) && !((vers === c.vers))) { $s = 11; continue; } /* */ $s = 12; continue; /* if (c.haveVers && !((c.vers === 772)) && !((vers === c.vers))) { */ case 11: _r$3 = c.sendAlert(70); /* */ $s = 13; case 13: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _r$4 = fmt.Sprintf("received record with version %x when expecting version %x", new sliceType$6([new $Uint16(vers), new $Uint16(c.vers)])); /* */ $s = 14; case 14: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } msg = _r$4; $s = -1; return c.in$27.setErrorLocked((x$1 = c.newRecordHeaderError($ifaceNil, msg), new x$1.constructor.elem(x$1))); /* } */ case 12: if (!c.haveVers) { if ((!((typ === 21)) && !((typ === 22))) || vers >= 4096) { $s = -1; return c.in$27.setErrorLocked((x$2 = c.newRecordHeaderError(c.conn, "first record does not look like a TLS handshake"), new x$2.constructor.elem(x$2))); } } /* */ if ((c.vers === 772) && n > 16640 || n > 18432) { $s = 15; continue; } /* */ $s = 16; continue; /* if ((c.vers === 772) && n > 16640 || n > 18432) { */ case 15: _r$5 = c.sendAlert(22); /* */ $s = 17; case 17: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; _r$6 = fmt.Sprintf("oversized record received with length %d", new sliceType$6([new $Int(n)])); /* */ $s = 18; case 18: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } msg$1 = _r$6; $s = -1; return c.in$27.setErrorLocked((x$3 = c.newRecordHeaderError($ifaceNil, msg$1), new x$3.constructor.elem(x$3))); /* } */ case 16: _r$7 = c.readFromUntil(c.conn, 5 + n >> 0); /* */ $s = 19; case 19: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } err$1 = _r$7; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 20; continue; } /* */ $s = 21; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 20: _tuple$1 = $assertType(err$1, net.Error, true); e$1 = _tuple$1[0]; ok$1 = _tuple$1[1]; if (!ok$1) { _v$1 = true; $s = 24; continue s; } _r$8 = e$1.Temporary(); /* */ $s = 25; case 25: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _v$1 = !_r$8; case 24: /* */ if (_v$1) { $s = 22; continue; } /* */ $s = 23; continue; /* if (_v$1) { */ case 22: c.in$27.setErrorLocked(err$1); /* } */ case 23: $s = -1; return err$1; /* } */ case 21: record = c.rawInput.Next(5 + n >> 0); _r$9 = c.in$27.decrypt(record); /* */ $s = 26; case 26: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple$2 = _r$9; data = _tuple$2[0]; typ = _tuple$2[1]; err$2 = _tuple$2[2]; /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 27; continue; } /* */ $s = 28; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 27: _r$10 = c.sendAlert($assertType(err$2, alert)); /* */ $s = 29; case 29: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$11 = c.in$27.setErrorLocked(_r$10); /* */ $s = 30; case 30: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } $24r = _r$11; $s = 31; case 31: return $24r; /* } */ case 28: /* */ if (data.$length > 16384) { $s = 32; continue; } /* */ $s = 33; continue; /* if (data.$length > 16384) { */ case 32: _r$12 = c.sendAlert(22); /* */ $s = 34; case 34: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _r$13 = c.in$27.setErrorLocked(_r$12); /* */ $s = 35; case 35: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } $24r$1 = _r$13; $s = 36; case 36: return $24r$1; /* } */ case 33: /* */ if ($interfaceIsEqual(c.in$27.cipher, $ifaceNil) && (typ === 23)) { $s = 37; continue; } /* */ $s = 38; continue; /* if ($interfaceIsEqual(c.in$27.cipher, $ifaceNil) && (typ === 23)) { */ case 37: _r$14 = c.sendAlert(10); /* */ $s = 39; case 39: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _r$15 = c.in$27.setErrorLocked(_r$14); /* */ $s = 40; case 40: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } $24r$2 = _r$15; $s = 41; case 41: return $24r$2; /* } */ case 38: if (!((typ === 21)) && !((typ === 20)) && data.$length > 0) { c.retryCount = 0; } /* */ if ((c.vers === 772) && !((typ === 22)) && c.hand.Len() > 0) { $s = 42; continue; } /* */ $s = 43; continue; /* if ((c.vers === 772) && !((typ === 22)) && c.hand.Len() > 0) { */ case 42: _r$16 = c.sendAlert(10); /* */ $s = 44; case 44: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _r$17 = c.in$27.setErrorLocked(_r$16); /* */ $s = 45; case 45: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } $24r$3 = _r$17; $s = 46; case 46: return $24r$3; /* } */ case 43: _1 = typ; /* */ if (_1 === (21)) { $s = 48; continue; } /* */ if (_1 === (20)) { $s = 49; continue; } /* */ if (_1 === (23)) { $s = 50; continue; } /* */ if (_1 === (22)) { $s = 51; continue; } /* */ $s = 52; continue; /* if (_1 === (21)) { */ case 48: /* */ if (!((data.$length === 2))) { $s = 54; continue; } /* */ $s = 55; continue; /* if (!((data.$length === 2))) { */ case 54: _r$18 = c.sendAlert(10); /* */ $s = 56; case 56: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } _r$19 = c.in$27.setErrorLocked(_r$18); /* */ $s = 57; case 57: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } $24r$4 = _r$19; $s = 58; case 58: return $24r$4; /* } */ case 55: if ((((1 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 1]) << 24 >>> 24)) === 0) { $s = -1; return c.in$27.setErrorLocked(io.EOF); } if (c.vers === 772) { $s = -1; return c.in$27.setErrorLocked(new net.OpError.ptr("remote error", "", $ifaceNil, $ifaceNil, new alert((((1 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 1]) << 24 >>> 24))))); } _2 = (0 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 0]); /* */ if (_2 === (1)) { $s = 60; continue; } /* */ if (_2 === (2)) { $s = 61; continue; } /* */ $s = 62; continue; /* if (_2 === (1)) { */ case 60: _r$20 = c.retryReadRecord(expectChangeCipherSpec); /* */ $s = 64; case 64: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } $24r$5 = _r$20; $s = 65; case 65: return $24r$5; /* } else if (_2 === (2)) { */ case 61: $s = -1; return c.in$27.setErrorLocked(new net.OpError.ptr("remote error", "", $ifaceNil, $ifaceNil, new alert((((1 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 1]) << 24 >>> 24))))); /* } else { */ case 62: _r$21 = c.sendAlert(10); /* */ $s = 66; case 66: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } _r$22 = c.in$27.setErrorLocked(_r$21); /* */ $s = 67; case 67: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; } $24r$6 = _r$22; $s = 68; case 68: return $24r$6; /* } */ case 63: case 59: $s = 53; continue; /* } else if (_1 === (20)) { */ case 49: /* */ if (!((data.$length === 1)) || !(((0 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 0]) === 1))) { $s = 69; continue; } /* */ $s = 70; continue; /* if (!((data.$length === 1)) || !(((0 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 0]) === 1))) { */ case 69: _r$23 = c.sendAlert(50); /* */ $s = 71; case 71: if($c) { $c = false; _r$23 = _r$23.$blk(); } if (_r$23 && _r$23.$blk !== undefined) { break s; } _r$24 = c.in$27.setErrorLocked(_r$23); /* */ $s = 72; case 72: if($c) { $c = false; _r$24 = _r$24.$blk(); } if (_r$24 && _r$24.$blk !== undefined) { break s; } $24r$7 = _r$24; $s = 73; case 73: return $24r$7; /* } */ case 70: /* */ if (c.hand.Len() > 0) { $s = 74; continue; } /* */ $s = 75; continue; /* if (c.hand.Len() > 0) { */ case 74: _r$25 = c.sendAlert(10); /* */ $s = 76; case 76: if($c) { $c = false; _r$25 = _r$25.$blk(); } if (_r$25 && _r$25.$blk !== undefined) { break s; } _r$26 = c.in$27.setErrorLocked(_r$25); /* */ $s = 77; case 77: if($c) { $c = false; _r$26 = _r$26.$blk(); } if (_r$26 && _r$26.$blk !== undefined) { break s; } $24r$8 = _r$26; $s = 78; case 78: return $24r$8; /* } */ case 75: /* */ if (c.vers === 772) { $s = 79; continue; } /* */ $s = 80; continue; /* if (c.vers === 772) { */ case 79: _r$27 = c.retryReadRecord(expectChangeCipherSpec); /* */ $s = 81; case 81: if($c) { $c = false; _r$27 = _r$27.$blk(); } if (_r$27 && _r$27.$blk !== undefined) { break s; } $24r$9 = _r$27; $s = 82; case 82: return $24r$9; /* } */ case 80: /* */ if (!expectChangeCipherSpec) { $s = 83; continue; } /* */ $s = 84; continue; /* if (!expectChangeCipherSpec) { */ case 83: _r$28 = c.sendAlert(10); /* */ $s = 85; case 85: if($c) { $c = false; _r$28 = _r$28.$blk(); } if (_r$28 && _r$28.$blk !== undefined) { break s; } _r$29 = c.in$27.setErrorLocked(_r$28); /* */ $s = 86; case 86: if($c) { $c = false; _r$29 = _r$29.$blk(); } if (_r$29 && _r$29.$blk !== undefined) { break s; } $24r$10 = _r$29; $s = 87; case 87: return $24r$10; /* } */ case 84: err$3 = c.in$27.changeCipherSpec(); /* */ if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = 88; continue; } /* */ $s = 89; continue; /* if (!($interfaceIsEqual(err$3, $ifaceNil))) { */ case 88: _r$30 = c.sendAlert($assertType(err$3, alert)); /* */ $s = 90; case 90: if($c) { $c = false; _r$30 = _r$30.$blk(); } if (_r$30 && _r$30.$blk !== undefined) { break s; } _r$31 = c.in$27.setErrorLocked(_r$30); /* */ $s = 91; case 91: if($c) { $c = false; _r$31 = _r$31.$blk(); } if (_r$31 && _r$31.$blk !== undefined) { break s; } $24r$11 = _r$31; $s = 92; case 92: return $24r$11; /* } */ case 89: $s = 53; continue; /* } else if (_1 === (23)) { */ case 50: /* */ if (!handshakeComplete || expectChangeCipherSpec) { $s = 93; continue; } /* */ $s = 94; continue; /* if (!handshakeComplete || expectChangeCipherSpec) { */ case 93: _r$32 = c.sendAlert(10); /* */ $s = 95; case 95: if($c) { $c = false; _r$32 = _r$32.$blk(); } if (_r$32 && _r$32.$blk !== undefined) { break s; } _r$33 = c.in$27.setErrorLocked(_r$32); /* */ $s = 96; case 96: if($c) { $c = false; _r$33 = _r$33.$blk(); } if (_r$33 && _r$33.$blk !== undefined) { break s; } $24r$12 = _r$33; $s = 97; case 97: return $24r$12; /* } */ case 94: /* */ if (data.$length === 0) { $s = 98; continue; } /* */ $s = 99; continue; /* if (data.$length === 0) { */ case 98: _r$34 = c.retryReadRecord(expectChangeCipherSpec); /* */ $s = 100; case 100: if($c) { $c = false; _r$34 = _r$34.$blk(); } if (_r$34 && _r$34.$blk !== undefined) { break s; } $24r$13 = _r$34; $s = 101; case 101: return $24r$13; /* } */ case 99: c.input.Reset(data); $s = 53; continue; /* } else if (_1 === (22)) { */ case 51: /* */ if ((data.$length === 0) || expectChangeCipherSpec) { $s = 102; continue; } /* */ $s = 103; continue; /* if ((data.$length === 0) || expectChangeCipherSpec) { */ case 102: _r$35 = c.sendAlert(10); /* */ $s = 104; case 104: if($c) { $c = false; _r$35 = _r$35.$blk(); } if (_r$35 && _r$35.$blk !== undefined) { break s; } _r$36 = c.in$27.setErrorLocked(_r$35); /* */ $s = 105; case 105: if($c) { $c = false; _r$36 = _r$36.$blk(); } if (_r$36 && _r$36.$blk !== undefined) { break s; } $24r$14 = _r$36; $s = 106; case 106: return $24r$14; /* } */ case 103: _r$37 = c.hand.Write(data); /* */ $s = 107; case 107: if($c) { $c = false; _r$37 = _r$37.$blk(); } if (_r$37 && _r$37.$blk !== undefined) { break s; } _r$37; $s = 53; continue; /* } else { */ case 52: _r$38 = c.sendAlert(10); /* */ $s = 108; case 108: if($c) { $c = false; _r$38 = _r$38.$blk(); } if (_r$38 && _r$38.$blk !== undefined) { break s; } _r$39 = c.in$27.setErrorLocked(_r$38); /* */ $s = 109; case 109: if($c) { $c = false; _r$39 = _r$39.$blk(); } if (_r$39 && _r$39.$blk !== undefined) { break s; } $24r$15 = _r$39; $s = 110; case 110: return $24r$15; /* } */ case 53: case 47: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.readRecordOrCCS }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$10 = $24r$10; $f.$24r$11 = $24r$11; $f.$24r$12 = $24r$12; $f.$24r$13 = $24r$13; $f.$24r$14 = $24r$14; $f.$24r$15 = $24r$15; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f.$24r$6 = $24r$6; $f.$24r$7 = $24r$7; $f.$24r$8 = $24r$8; $f.$24r$9 = $24r$9; $f._1 = _1; $f._2 = _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$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$36 = _r$36; $f._r$37 = _r$37; $f._r$38 = _r$38; $f._r$39 = _r$39; $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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._v = _v; $f._v$1 = _v$1; $f.c = c; $f.data = data; $f.e = e; $f.e$1 = e$1; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.expectChangeCipherSpec = expectChangeCipherSpec; $f.handshakeComplete = handshakeComplete; $f.hdr = hdr; $f.msg = msg; $f.msg$1 = msg$1; $f.n = n; $f.ok = ok; $f.ok$1 = ok$1; $f.record = record; $f.typ = typ; $f.vers = vers; $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; }; Conn.prototype.readRecordOrCCS = function(expectChangeCipherSpec) { return this.$val.readRecordOrCCS(expectChangeCipherSpec); }; Conn.ptr.prototype.retryReadRecord = function(expectChangeCipherSpec) { var $24r, _r, _r$1, c, expectChangeCipherSpec, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; c = $f.c; expectChangeCipherSpec = $f.expectChangeCipherSpec; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; c.retryCount = c.retryCount + (1) >> 0; /* */ if (c.retryCount > 16) { $s = 1; continue; } /* */ $s = 2; continue; /* if (c.retryCount > 16) { */ case 1: _r = c.sendAlert(10); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; $s = -1; return c.in$27.setErrorLocked(errors.New("tls: too many ignored records")); /* } */ case 2: _r$1 = c.readRecordOrCCS(expectChangeCipherSpec); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 5; case 5: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.retryReadRecord }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f.c = c; $f.expectChangeCipherSpec = expectChangeCipherSpec; $f.$s = $s; $f.$r = $r; return $f; }; Conn.prototype.retryReadRecord = function(expectChangeCipherSpec) { return this.$val.retryReadRecord(expectChangeCipherSpec); }; atLeastReader.ptr.prototype.Read = function(p) { var _r, _tuple, err, n, p, r, 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; _r = $f._r; _tuple = $f._tuple; err = $f.err; n = $f.n; p = $f.p; r = $f.r; 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: r = this; if ((x = r.N, (x.$high < 0 || (x.$high === 0 && x.$low <= 0)))) { $s = -1; return [0, io.EOF]; } _r = r.R.Read(p); /* */ $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]; r.N = (x$1 = r.N, x$2 = (new $Int64(0, n)), new $Int64(x$1.$high - x$2.$high, x$1.$low - x$2.$low)); if ((x$3 = r.N, (x$3.$high > 0 || (x$3.$high === 0 && x$3.$low > 0))) && $interfaceIsEqual(err, io.EOF)) { $s = -1; return [n, io.ErrUnexpectedEOF]; } if ((x$4 = r.N, (x$4.$high < 0 || (x$4.$high === 0 && x$4.$low <= 0))) && $interfaceIsEqual(err, $ifaceNil)) { $s = -1; return [n, io.EOF]; } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: atLeastReader.ptr.prototype.Read }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.n = n; $f.p = p; $f.r = r; $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; }; atLeastReader.prototype.Read = function(p) { return this.$val.Read(p); }; Conn.ptr.prototype.readFromUntil = function(r, n) { var _r, _tuple, c, err, n, needs, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; c = $f.c; err = $f.err; n = $f.n; needs = $f.needs; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (c.rawInput.Len() >= n) { $s = -1; return $ifaceNil; } needs = n - c.rawInput.Len() >> 0; $r = c.rawInput.Grow(needs + 512 >> 0); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r = c.rawInput.ReadFrom(new atLeastReader.ptr(r, (new $Int64(0, needs)))); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; err = _tuple[1]; $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.readFromUntil }; } $f._r = _r; $f._tuple = _tuple; $f.c = c; $f.err = err; $f.n = n; $f.needs = needs; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Conn.prototype.readFromUntil = function(r, n) { return this.$val.readFromUntil(r, n); }; Conn.ptr.prototype.sendAlertLocked = function(err) { var _1, _r, _tuple, c, err, writeErr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _tuple = $f._tuple; c = $f.c; err = $f.err; writeErr = $f.writeErr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _1 = err; if ((_1 === (100)) || (_1 === (0))) { c.tmp[0] = 1; } else { c.tmp[0] = 2; } c.tmp[1] = ((err << 24 >>> 24)); _r = c.writeRecordLocked(21, $subslice(new sliceType$5(c.tmp), 0, 2)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; writeErr = _tuple[1]; if (err === 0) { $s = -1; return writeErr; } $s = -1; return c.out.setErrorLocked(new net.OpError.ptr("local error", "", $ifaceNil, $ifaceNil, new alert(err))); /* */ } return; } if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.sendAlertLocked }; } $f._1 = _1; $f._r = _r; $f._tuple = _tuple; $f.c = c; $f.err = err; $f.writeErr = writeErr; $f.$s = $s; $f.$r = $r; return $f; }; Conn.prototype.sendAlertLocked = function(err) { return this.$val.sendAlertLocked(err); }; Conn.ptr.prototype.sendAlert = function(err) { var $24r, _r, c, err, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; c = $f.c; err = $f.err; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); c = this; $r = c.out.Mutex.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(c.out.Mutex, "Unlock"), []]); _r = c.sendAlertLocked(err); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 3; case 3: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.sendAlert }; } $f.$24r = $24r; $f._r = _r; $f.c = c; $f.err = err; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Conn.prototype.sendAlert = function(err) { return this.$val.sendAlert(err); }; Conn.ptr.prototype.maxPayloadSizeForWrite = function(typ) { var _r, _r$1, _r$2, _r$3, _r$4, _ref, blockSize, c, ciph, ciph$1, ciph$2, ciph$3, n, payloadBytes, pkt, typ, 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; _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; blockSize = $f.blockSize; c = $f.c; ciph = $f.ciph; ciph$1 = $f.ciph$1; ciph$2 = $f.ciph$2; ciph$3 = $f.ciph$3; n = $f.n; payloadBytes = $f.payloadBytes; pkt = $f.pkt; typ = $f.typ; 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: c = this; if (c.config.DynamicRecordSizingDisabled || !((typ === 23))) { $s = -1; return 16384; } if ((x = c.bytesSent, (x.$high > 0 || (x.$high === 0 && x.$low >= 131072)))) { $s = -1; return 16384; } _r = c.out.explicitNonceLen(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } payloadBytes = 1203 - _r >> 0; /* */ if (!($interfaceIsEqual(c.out.cipher, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(c.out.cipher, $ifaceNil))) { */ case 2: _ref = c.out.cipher; /* */ if ($assertType(_ref, cipher.Stream, true)[1]) { $s = 4; continue; } /* */ if ($assertType(_ref, cipher.AEAD, true)[1]) { $s = 5; continue; } /* */ if ($assertType(_ref, cbcMode, true)[1]) { $s = 6; continue; } /* */ $s = 7; continue; /* if ($assertType(_ref, cipher.Stream, true)[1]) { */ case 4: ciph = _ref; _r$1 = c.out.mac.Size(); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } payloadBytes = payloadBytes - (_r$1) >> 0; $s = 8; continue; /* } else if ($assertType(_ref, cipher.AEAD, true)[1]) { */ case 5: ciph$1 = _ref; _r$2 = ciph$1.Overhead(); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } payloadBytes = payloadBytes - (_r$2) >> 0; $s = 8; continue; /* } else if ($assertType(_ref, cbcMode, true)[1]) { */ case 6: ciph$2 = _ref; _r$3 = ciph$2.BlockSize(); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } blockSize = _r$3; payloadBytes = ((payloadBytes & (~((blockSize - 1 >> 0)) >> 0))) - 1 >> 0; _r$4 = c.out.mac.Size(); /* */ $s = 12; case 12: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } payloadBytes = payloadBytes - (_r$4) >> 0; $s = 8; continue; /* } else { */ case 7: ciph$3 = _ref; $panic(new $String("unknown cipher type")); /* } */ case 8: /* } */ case 3: if (c.vers === 772) { payloadBytes = payloadBytes - (1) >> 0; } pkt = c.packetsSent; c.packetsSent = (x$1 = c.packetsSent, x$2 = new $Int64(0, 1), new $Int64(x$1.$high + x$2.$high, x$1.$low + x$2.$low)); if ((pkt.$high > 0 || (pkt.$high === 0 && pkt.$low > 1000))) { $s = -1; return 16384; } n = $imul(payloadBytes, (((x$3 = new $Int64(pkt.$high + 0, pkt.$low + 1), x$3.$low + ((x$3.$high >> 31) * 4294967296)) >> 0))); if (n > 16384) { n = 16384; } $s = -1; return n; /* */ } return; } if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.maxPayloadSizeForWrite }; } $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.blockSize = blockSize; $f.c = c; $f.ciph = ciph; $f.ciph$1 = ciph$1; $f.ciph$2 = ciph$2; $f.ciph$3 = ciph$3; $f.n = n; $f.payloadBytes = payloadBytes; $f.pkt = pkt; $f.typ = typ; $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; }; Conn.prototype.maxPayloadSizeForWrite = function(typ) { return this.$val.maxPayloadSizeForWrite(typ); }; Conn.ptr.prototype.write = function(data) { var _r, _tuple, c, data, err, n, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; c = $f.c; data = $f.data; err = $f.err; n = $f.n; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (c.buffering) { c.sendBuf = $appendSlice(c.sendBuf, data); $s = -1; return [data.$length, $ifaceNil]; } _r = c.conn.Write(data); /* */ $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]; c.bytesSent = (x = c.bytesSent, x$1 = (new $Int64(0, n)), new $Int64(x.$high + x$1.$high, x.$low + x$1.$low)); $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.write }; } $f._r = _r; $f._tuple = _tuple; $f.c = c; $f.data = data; $f.err = err; $f.n = n; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; Conn.prototype.write = function(data) { return this.$val.write(data); }; Conn.ptr.prototype.flush = function() { var _r, _tuple, c, err, n, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; c = $f.c; err = $f.err; n = $f.n; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (c.sendBuf.$length === 0) { $s = -1; return [0, $ifaceNil]; } _r = c.conn.Write(c.sendBuf); /* */ $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]; c.bytesSent = (x = c.bytesSent, x$1 = (new $Int64(0, n)), new $Int64(x.$high + x$1.$high, x.$low + x$1.$low)); c.sendBuf = sliceType$5.nil; c.buffering = false; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.flush }; } $f._r = _r; $f._tuple = _tuple; $f.c = c; $f.err = err; $f.n = n; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; Conn.prototype.flush = function() { return this.$val.flush(); }; Conn.ptr.prototype.writeRecordLocked = function(typ, data) { var $24r, $24r$1, $24r$2, $24r$3, _r, _r$1, _r$2, _r$3, _r$4, _tuple, _tuple$1, _tuple$2, c, data, err, err$1, err$2, m, maxPayload, n, outBuf, outBufPtr, typ, vers, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; c = $f.c; data = $f.data; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; m = $f.m; maxPayload = $f.maxPayload; n = $f.n; outBuf = $f.outBuf; outBufPtr = $f.outBufPtr; typ = $f.typ; vers = $f.vers; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); outBuf = [outBuf]; outBufPtr = [outBufPtr]; c = this; _r = outBufPool.Get(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } outBufPtr[0] = $assertType(_r, ptrType$1); outBuf[0] = outBufPtr[0].$get(); $deferred.push([(function(outBuf, outBufPtr) { return function() { outBufPtr[0].$set(outBuf[0]); outBufPool.Put(outBufPtr[0]); }; })(outBuf, outBufPtr), []]); n = 0; /* while (true) { */ case 2: /* if (!(data.$length > 0)) { break; } */ if(!(data.$length > 0)) { $s = 3; continue; } m = data.$length; _r$1 = c.maxPayloadSizeForWrite(typ); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } maxPayload = _r$1; if (m > maxPayload) { m = maxPayload; } _tuple = sliceForAppend($subslice(outBuf[0], 0, 0), 5); outBuf[0] = _tuple[1]; (0 >= outBuf[0].$length ? ($throwRuntimeError("index out of range"), undefined) : outBuf[0].$array[outBuf[0].$offset + 0] = ((typ << 24 >>> 24))); vers = c.vers; if (vers === 0) { vers = 769; } else if (vers === 772) { vers = 771; } (1 >= outBuf[0].$length ? ($throwRuntimeError("index out of range"), undefined) : outBuf[0].$array[outBuf[0].$offset + 1] = (((vers >>> 8 << 16 >>> 16) << 24 >>> 24))); (2 >= outBuf[0].$length ? ($throwRuntimeError("index out of range"), undefined) : outBuf[0].$array[outBuf[0].$offset + 2] = ((vers << 24 >>> 24))); (3 >= outBuf[0].$length ? ($throwRuntimeError("index out of range"), undefined) : outBuf[0].$array[outBuf[0].$offset + 3] = (((m >> 8 >> 0) << 24 >>> 24))); (4 >= outBuf[0].$length ? ($throwRuntimeError("index out of range"), undefined) : outBuf[0].$array[outBuf[0].$offset + 4] = ((m << 24 >>> 24))); err = $ifaceNil; _r$2 = c.out.encrypt(outBuf[0], $subslice(data, 0, m), c.config.rand()); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; outBuf[0] = _tuple$1[0]; err = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 6: $24r = [n, err]; $s = 8; case 8: return $24r; /* } */ case 7: _r$3 = c.write(outBuf[0]); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$2 = _r$3; err$1 = _tuple$2[1]; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 10; continue; } /* */ $s = 11; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 10: $24r$1 = [n, err$1]; $s = 12; case 12: return $24r$1; /* } */ case 11: n = n + (m) >> 0; data = $subslice(data, m); $s = 2; continue; case 3: /* */ if ((typ === 20) && !((c.vers === 772))) { $s = 13; continue; } /* */ $s = 14; continue; /* if ((typ === 20) && !((c.vers === 772))) { */ case 13: err$2 = c.out.changeCipherSpec(); /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 15; continue; } /* */ $s = 16; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 15: _r$4 = c.sendAlertLocked($assertType(err$2, alert)); /* */ $s = 17; case 17: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r$2 = [n, _r$4]; $s = 18; case 18: return $24r$2; /* } */ case 16: /* } */ case 14: $24r$3 = [n, $ifaceNil]; $s = 19; case 19: return $24r$3; /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.writeRecordLocked }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.c = c; $f.data = data; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.m = m; $f.maxPayload = maxPayload; $f.n = n; $f.outBuf = outBuf; $f.outBufPtr = outBufPtr; $f.typ = typ; $f.vers = vers; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Conn.prototype.writeRecordLocked = function(typ, data) { return this.$val.writeRecordLocked(typ, data); }; Conn.ptr.prototype.writeRecord = function(typ, data) { var $24r, _r, c, data, typ, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; c = $f.c; data = $f.data; typ = $f.typ; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); c = this; $r = c.out.Mutex.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(c.out.Mutex, "Unlock"), []]); _r = c.writeRecordLocked(typ, data); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 3; case 3: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.writeRecord }; } $f.$24r = $24r; $f._r = _r; $f.c = c; $f.data = data; $f.typ = typ; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Conn.prototype.writeRecord = function(typ, data) { return this.$val.writeRecord(typ, data); }; Conn.ptr.prototype.readHandshake = function() { var $24r, $24r$1, $24r$2, _1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, c, data, err, err$1, m, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _1 = $f._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; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; c = $f.c; data = $f.data; err = $f.err; err$1 = $f.err$1; m = $f.m; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; /* while (true) { */ case 1: /* if (!(c.hand.Len() < 4)) { break; } */ if(!(c.hand.Len() < 4)) { $s = 2; continue; } _r = c.readRecord(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [$ifaceNil, err]; } $s = 1; continue; case 2: data = c.hand.Bytes(); n = (((((1 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 1]) >> 0)) << 16 >> 0) | ((((2 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 2]) >> 0)) << 8 >> 0)) | (((3 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 3]) >> 0)); /* */ if (n > 65536) { $s = 4; continue; } /* */ $s = 5; continue; /* if (n > 65536) { */ case 4: _r$1 = c.sendAlertLocked(80); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _r$2 = fmt.Errorf("tls: handshake message of length %d bytes exceeds maximum of %d bytes", new sliceType$6([new $Int(n), new $Int(65536)])); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = c.in$27.setErrorLocked(_r$2); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = [$ifaceNil, _r$3]; $s = 9; case 9: return $24r; /* } */ case 5: /* while (true) { */ case 10: /* if (!(c.hand.Len() < (4 + n >> 0))) { break; } */ if(!(c.hand.Len() < (4 + n >> 0))) { $s = 11; continue; } _r$4 = c.readRecord(); /* */ $s = 12; case 12: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } err$1 = _r$4; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [$ifaceNil, err$1]; } $s = 10; continue; case 11: data = c.hand.Next(4 + n >> 0); m = $ifaceNil; _1 = (0 >= data.$length ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + 0]); /* */ if (_1 === (0)) { $s = 14; continue; } /* */ if (_1 === (1)) { $s = 15; continue; } /* */ if (_1 === (2)) { $s = 16; continue; } /* */ if (_1 === (4)) { $s = 17; continue; } /* */ if (_1 === (11)) { $s = 18; continue; } /* */ if (_1 === (13)) { $s = 19; continue; } /* */ if (_1 === (22)) { $s = 20; continue; } /* */ if (_1 === (12)) { $s = 21; continue; } /* */ if (_1 === (14)) { $s = 22; continue; } /* */ if (_1 === (16)) { $s = 23; continue; } /* */ if (_1 === (15)) { $s = 24; continue; } /* */ if (_1 === (20)) { $s = 25; continue; } /* */ if (_1 === (8)) { $s = 26; continue; } /* */ if (_1 === (5)) { $s = 27; continue; } /* */ if (_1 === (24)) { $s = 28; continue; } /* */ $s = 29; continue; /* if (_1 === (0)) { */ case 14: m = new helloRequestMsg.ptr(); $s = 30; continue; /* } else if (_1 === (1)) { */ case 15: m = new clientHelloMsg.ptr(sliceType$5.nil, 0, sliceType$5.nil, sliceType$5.nil, sliceType$2.nil, sliceType$5.nil, "", false, sliceType$3.nil, sliceType$5.nil, false, sliceType$5.nil, sliceType$7.nil, sliceType$7.nil, false, sliceType$5.nil, sliceType$1.nil, false, sliceType$2.nil, sliceType$5.nil, sliceType$15.nil, false, sliceType$5.nil, sliceType$16.nil, sliceType$11.nil); $s = 30; continue; /* } else if (_1 === (2)) { */ case 16: m = new serverHelloMsg.ptr(sliceType$5.nil, 0, sliceType$5.nil, sliceType$5.nil, 0, 0, false, false, false, sliceType$5.nil, "", sliceType$11.nil, 0, new keyShare.ptr(0, sliceType$5.nil), false, 0, sliceType$5.nil, sliceType$5.nil, 0); $s = 30; continue; /* } else if (_1 === (4)) { */ case 17: if (c.vers === 772) { m = new newSessionTicketMsgTLS13.ptr(sliceType$5.nil, 0, 0, sliceType$5.nil, sliceType$5.nil, 0); } else { m = new newSessionTicketMsg.ptr(sliceType$5.nil, sliceType$5.nil); } $s = 30; continue; /* } else if (_1 === (11)) { */ case 18: if (c.vers === 772) { m = new certificateMsgTLS13.ptr(sliceType$5.nil, new Certificate.ptr(sliceType$11.nil, $ifaceNil, sliceType$7.nil, sliceType$5.nil, sliceType$11.nil, ptrType$5.nil), false, false); } else { m = new certificateMsg.ptr(sliceType$5.nil, sliceType$11.nil); } $s = 30; continue; /* } else if (_1 === (13)) { */ case 19: if (c.vers === 772) { m = new certificateRequestMsgTLS13.ptr(sliceType$5.nil, false, false, sliceType$7.nil, sliceType$7.nil, sliceType$11.nil); } else { m = new certificateRequestMsg.ptr(sliceType$5.nil, c.vers >= 771, sliceType$5.nil, sliceType$7.nil, sliceType$11.nil); } $s = 30; continue; /* } else if (_1 === (22)) { */ case 20: m = new certificateStatusMsg.ptr(sliceType$5.nil, sliceType$5.nil); $s = 30; continue; /* } else if (_1 === (12)) { */ case 21: m = new serverKeyExchangeMsg.ptr(sliceType$5.nil, sliceType$5.nil); $s = 30; continue; /* } else if (_1 === (14)) { */ case 22: m = new serverHelloDoneMsg.ptr(); $s = 30; continue; /* } else if (_1 === (16)) { */ case 23: m = new clientKeyExchangeMsg.ptr(sliceType$5.nil, sliceType$5.nil); $s = 30; continue; /* } else if (_1 === (15)) { */ case 24: m = new certificateVerifyMsg.ptr(sliceType$5.nil, c.vers >= 771, 0, sliceType$5.nil); $s = 30; continue; /* } else if (_1 === (20)) { */ case 25: m = new finishedMsg.ptr(sliceType$5.nil, sliceType$5.nil); $s = 30; continue; /* } else if (_1 === (8)) { */ case 26: m = new encryptedExtensionsMsg.ptr(sliceType$5.nil, ""); $s = 30; continue; /* } else if (_1 === (5)) { */ case 27: m = new endOfEarlyDataMsg.ptr(); $s = 30; continue; /* } else if (_1 === (24)) { */ case 28: m = new keyUpdateMsg.ptr(sliceType$5.nil, false); $s = 30; continue; /* } else { */ case 29: _r$5 = c.sendAlert(10); /* */ $s = 31; case 31: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$6 = c.in$27.setErrorLocked(_r$5); /* */ $s = 32; case 32: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } $24r$1 = [$ifaceNil, _r$6]; $s = 33; case 33: return $24r$1; /* } */ case 30: case 13: data = $appendSlice((sliceType$5.nil), data); _r$7 = m.unmarshal(data); /* */ $s = 36; case 36: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } /* */ if (!_r$7) { $s = 34; continue; } /* */ $s = 35; continue; /* if (!_r$7) { */ case 34: _r$8 = c.sendAlert(10); /* */ $s = 37; case 37: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$9 = c.in$27.setErrorLocked(_r$8); /* */ $s = 38; case 38: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $24r$2 = [$ifaceNil, _r$9]; $s = 39; case 39: return $24r$2; /* } */ case 35: $s = -1; return [m, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.readHandshake }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._1 = _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._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f.c = c; $f.data = data; $f.err = err; $f.err$1 = err$1; $f.m = m; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; Conn.prototype.readHandshake = function() { return this.$val.readHandshake(); }; Conn.ptr.prototype.Write = function(b) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, $24r$5, $24r$6, _r, _r$1, _r$2, _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, b, c, err, err$1, err$2, err$3, m, n, n$1, ok, x, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; $24r$6 = $f.$24r$6; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; b = $f.b; c = $f.c; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; m = $f.m; n = $f.n; n$1 = $f.n$1; ok = $f.ok; x = $f.x; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); c = this; /* while (true) { */ case 1: x = atomic.LoadInt32((c.$ptr_activeCall || (c.$ptr_activeCall = new ptrType$43(function() { return this.$target.activeCall; }, function($v) { this.$target.activeCall = $v; }, c)))); /* */ if (!(((x & 1) === 0))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!(((x & 1) === 0))) { */ case 3: $24r = [0, net.ErrClosed]; $s = 5; case 5: return $24r; /* } */ case 4: if (atomic.CompareAndSwapInt32((c.$ptr_activeCall || (c.$ptr_activeCall = new ptrType$43(function() { return this.$target.activeCall; }, function($v) { this.$target.activeCall = $v; }, c))), x, x + 2 >> 0)) { /* break; */ $s = 2; continue; } $s = 1; continue; case 2: $deferred.push([atomic.AddInt32, [(c.$ptr_activeCall || (c.$ptr_activeCall = new ptrType$43(function() { return this.$target.activeCall; }, function($v) { this.$target.activeCall = $v; }, c))), -2]]); _r = c.Handshake(); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 7: $24r$1 = [0, err]; $s = 9; case 9: return $24r$1; /* } */ case 8: $r = c.out.Mutex.Lock(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(c.out.Mutex, "Unlock"), []]); err$1 = c.out.err; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 11; continue; } /* */ $s = 12; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 11: $24r$2 = [0, err$1]; $s = 13; case 13: return $24r$2; /* } */ case 12: /* */ if (!c.handshakeComplete()) { $s = 14; continue; } /* */ $s = 15; continue; /* if (!c.handshakeComplete()) { */ case 14: $24r$3 = [0, new alert(80)]; $s = 16; case 16: return $24r$3; /* } */ case 15: /* */ if (c.closeNotifySent) { $s = 17; continue; } /* */ $s = 18; continue; /* if (c.closeNotifySent) { */ case 17: $24r$4 = [0, errShutdown]; $s = 19; case 19: return $24r$4; /* } */ case 18: m = 0; /* */ if (b.$length > 1 && (c.vers === 769)) { $s = 20; continue; } /* */ $s = 21; continue; /* if (b.$length > 1 && (c.vers === 769)) { */ case 20: _tuple = $assertType(c.out.cipher, cipher.BlockMode, true); ok = _tuple[1]; /* */ if (ok) { $s = 22; continue; } /* */ $s = 23; continue; /* if (ok) { */ case 22: _r$1 = c.writeRecordLocked(23, $subslice(b, 0, 1)); /* */ $s = 24; case 24: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; n = _tuple$1[0]; err$2 = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 25; continue; } /* */ $s = 26; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 25: $24r$5 = [n, c.out.setErrorLocked(err$2)]; $s = 27; case 27: return $24r$5; /* } */ case 26: _tmp = 1; _tmp$1 = $subslice(b, 1); m = _tmp; b = _tmp$1; /* } */ case 23: /* } */ case 21: _r$2 = c.writeRecordLocked(23, b); /* */ $s = 28; case 28: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$2 = _r$2; n$1 = _tuple$2[0]; err$3 = _tuple$2[1]; $24r$6 = [n$1 + m >> 0, c.out.setErrorLocked(err$3)]; $s = 29; case 29: return $24r$6; /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.Write }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f.$24r$6 = $24r$6; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.b = b; $f.c = c; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.m = m; $f.n = n; $f.n$1 = n$1; $f.ok = ok; $f.x = x; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Conn.prototype.Write = function(b) { return this.$val.Write(b); }; Conn.ptr.prototype.handleRenegotiation = function() { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, $24r$5, $24r$6, $24r$7, _1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _tuple, _tuple$1, c, err, helloReq, msg, ok, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; $24r$6 = $f.$24r$6; $24r$7 = $f.$24r$7; _1 = $f._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; _r$7 = $f._r$7; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; c = $f.c; err = $f.err; helloReq = $f.helloReq; msg = $f.msg; ok = $f.ok; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); c = this; /* */ if (c.vers === 772) { $s = 1; continue; } /* */ $s = 2; continue; /* if (c.vers === 772) { */ case 1: $24r = errors.New("tls: internal error: unexpected renegotiation"); $s = 3; case 3: return $24r; /* } */ case 2: _r = c.readHandshake(); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; msg = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 5: $24r$1 = err; $s = 7; case 7: return $24r$1; /* } */ case 6: _tuple$1 = $assertType(msg, ptrType$44, true); helloReq = _tuple$1[0]; ok = _tuple$1[1]; /* */ if (!ok) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!ok) { */ case 8: _r$1 = c.sendAlert(10); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _r$2 = unexpectedMessageError(helloReq, msg); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r$2 = _r$2; $s = 12; case 12: return $24r$2; /* } */ case 9: /* */ if (!c.isClient) { $s = 13; continue; } /* */ $s = 14; continue; /* if (!c.isClient) { */ case 13: _r$3 = c.sendAlert(100); /* */ $s = 15; case 15: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r$3 = _r$3; $s = 16; case 16: return $24r$3; /* } */ case 14: _1 = c.config.Renegotiation; /* */ if (_1 === (0)) { $s = 18; continue; } /* */ if (_1 === (1)) { $s = 19; continue; } /* */ if (_1 === (2)) { $s = 20; continue; } /* */ $s = 21; continue; /* if (_1 === (0)) { */ case 18: _r$4 = c.sendAlert(100); /* */ $s = 23; case 23: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r$4 = _r$4; $s = 24; case 24: return $24r$4; /* } else if (_1 === (1)) { */ case 19: /* */ if (c.handshakes > 1) { $s = 25; continue; } /* */ $s = 26; continue; /* if (c.handshakes > 1) { */ case 25: _r$5 = c.sendAlert(100); /* */ $s = 27; case 27: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $24r$5 = _r$5; $s = 28; case 28: return $24r$5; /* } */ case 26: $s = 22; continue; /* } else if (_1 === (2)) { */ case 20: $s = 22; continue; /* } else { */ case 21: _r$6 = c.sendAlert(80); /* */ $s = 29; case 29: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; $24r$6 = errors.New("tls: unknown Renegotiation value"); $s = 30; case 30: return $24r$6; /* } */ case 22: case 17: $r = c.handshakeMutex.Lock(); /* */ $s = 31; case 31: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(c.handshakeMutex, "Unlock"), []]); atomic.StoreUint32((c.$ptr_handshakeStatus || (c.$ptr_handshakeStatus = new ptrType$24(function() { return this.$target.handshakeStatus; }, function($v) { this.$target.handshakeStatus = $v; }, c))), 0); _r$7 = c.clientHandshake(context.Background()); /* */ $s = 32; case 32: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } c.handshakeErr = _r$7; if ($interfaceIsEqual(c.handshakeErr, $ifaceNil)) { c.handshakes = c.handshakes + (1) >> 0; } $24r$7 = c.handshakeErr; $s = 33; case 33: return $24r$7; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.handleRenegotiation }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f.$24r$6 = $24r$6; $f.$24r$7 = $24r$7; $f._1 = _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._r$7 = _r$7; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.c = c; $f.err = err; $f.helloReq = helloReq; $f.msg = msg; $f.ok = ok; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Conn.prototype.handleRenegotiation = function() { return this.$val.handleRenegotiation(); }; Conn.ptr.prototype.handlePostHandshakeMessage = function() { var $24r, $24r$1, $24r$2, $24r$3, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _ref, _tuple, c, err, msg, msg$1, msg$2, msg$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$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; _ref = $f._ref; _tuple = $f._tuple; c = $f.c; err = $f.err; msg = $f.msg; msg$1 = $f.msg$1; msg$2 = $f.msg$2; msg$3 = $f.msg$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; /* */ if (!((c.vers === 772))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((c.vers === 772))) { */ case 1: _r = c.handleRenegotiation(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 4; case 4: return $24r; /* } */ case 2: _r$1 = c.readHandshake(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; msg = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } c.retryCount = c.retryCount + (1) >> 0; /* */ if (c.retryCount > 16) { $s = 6; continue; } /* */ $s = 7; continue; /* if (c.retryCount > 16) { */ case 6: _r$2 = c.sendAlert(10); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; $s = -1; return c.in$27.setErrorLocked(errors.New("tls: too many non-advancing records")); /* } */ case 7: _ref = msg; /* */ if ($assertType(_ref, ptrType$45, true)[1]) { $s = 9; continue; } /* */ if ($assertType(_ref, ptrType$46, true)[1]) { $s = 10; continue; } /* */ $s = 11; continue; /* if ($assertType(_ref, ptrType$45, true)[1]) { */ case 9: msg$1 = _ref.$val; _r$3 = c.handleNewSessionTicket(msg$1); /* */ $s = 13; case 13: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r$1 = _r$3; $s = 14; case 14: return $24r$1; /* } else if ($assertType(_ref, ptrType$46, true)[1]) { */ case 10: msg$2 = _ref.$val; _r$4 = c.handleKeyUpdate(msg$2); /* */ $s = 15; case 15: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r$2 = _r$4; $s = 16; case 16: return $24r$2; /* } else { */ case 11: msg$3 = _ref; _r$5 = c.sendAlert(10); /* */ $s = 17; case 17: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; _r$6 = fmt.Errorf("tls: received unexpected handshake message of type %T", new sliceType$6([msg$3])); /* */ $s = 18; case 18: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } $24r$3 = _r$6; $s = 19; case 19: return $24r$3; /* } */ case 12: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.handlePostHandshakeMessage }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$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._ref = _ref; $f._tuple = _tuple; $f.c = c; $f.err = err; $f.msg = msg; $f.msg$1 = msg$1; $f.msg$2 = msg$2; $f.msg$3 = msg$3; $f.$s = $s; $f.$r = $r; return $f; }; Conn.prototype.handlePostHandshakeMessage = function() { return this.$val.handlePostHandshakeMessage(); }; Conn.ptr.prototype.handleKeyUpdate = function(keyUpdate) { var $24r, $24r$1, $24r$2, _arg, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, c, cipherSuite$1, err, keyUpdate, msg, newSecret, newSecret$1, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _arg = $f._arg; _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; _tuple = $f._tuple; c = $f.c; cipherSuite$1 = $f.cipherSuite$1; err = $f.err; keyUpdate = $f.keyUpdate; msg = $f.msg; newSecret = $f.newSecret; newSecret$1 = $f.newSecret$1; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); c = this; cipherSuite$1 = cipherSuiteTLS13ByID(c.cipherSuite); /* */ if (cipherSuite$1 === ptrType$2.nil) { $s = 1; continue; } /* */ $s = 2; continue; /* if (cipherSuite$1 === ptrType$2.nil) { */ case 1: _r = c.sendAlert(80); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = c.in$27.setErrorLocked(_r); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 5; case 5: return $24r; /* } */ case 2: _r$2 = cipherSuite$1.nextTrafficSecret(c.in$27.trafficSecret); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } newSecret = _r$2; $r = c.in$27.setTrafficSecret(cipherSuite$1, newSecret); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (keyUpdate.updateRequested) { $s = 8; continue; } /* */ $s = 9; continue; /* if (keyUpdate.updateRequested) { */ case 8: $r = c.out.Mutex.Lock(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(c.out.Mutex, "Unlock"), []]); msg = new keyUpdateMsg.ptr(sliceType$5.nil, false); _r$3 = msg.marshal(); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _arg = _r$3; _r$4 = c.writeRecordLocked(22, _arg); /* */ $s = 12; case 12: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple = _r$4; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 13; continue; } /* */ $s = 14; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 13: c.out.setErrorLocked(err); $24r$1 = $ifaceNil; $s = 15; case 15: return $24r$1; /* } */ case 14: _r$5 = cipherSuite$1.nextTrafficSecret(c.out.trafficSecret); /* */ $s = 16; case 16: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } newSecret$1 = _r$5; $r = c.out.setTrafficSecret(cipherSuite$1, newSecret$1); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 9: $24r$2 = $ifaceNil; $s = 18; case 18: return $24r$2; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.handleKeyUpdate }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._arg = _arg; $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._tuple = _tuple; $f.c = c; $f.cipherSuite$1 = cipherSuite$1; $f.err = err; $f.keyUpdate = keyUpdate; $f.msg = msg; $f.newSecret = newSecret; $f.newSecret$1 = newSecret$1; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Conn.prototype.handleKeyUpdate = function(keyUpdate) { return this.$val.handleKeyUpdate(keyUpdate); }; Conn.ptr.prototype.Read = function(b) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, $24r$5, _r, _r$1, _r$2, _r$3, _tuple, b, c, err, err$1, err$2, err$3, n, x, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; b = $f.b; c = $f.c; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; n = $f.n; x = $f.x; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); c = this; _r = c.Handshake(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $24r = [0, err]; $s = 4; case 4: return $24r; /* } */ case 3: /* */ if (b.$length === 0) { $s = 5; continue; } /* */ $s = 6; continue; /* if (b.$length === 0) { */ case 5: $24r$1 = [0, $ifaceNil]; $s = 7; case 7: return $24r$1; /* } */ case 6: $r = c.in$27.Mutex.Lock(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(c.in$27.Mutex, "Unlock"), []]); /* while (true) { */ case 9: /* if (!(c.input.Len() === 0)) { break; } */ if(!(c.input.Len() === 0)) { $s = 10; continue; } _r$1 = c.readRecord(); /* */ $s = 11; case 11: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err$1 = _r$1; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 12; continue; } /* */ $s = 13; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 12: $24r$2 = [0, err$1]; $s = 14; case 14: return $24r$2; /* } */ case 13: /* while (true) { */ case 15: /* if (!(c.hand.Len() > 0)) { break; } */ if(!(c.hand.Len() > 0)) { $s = 16; continue; } _r$2 = c.handlePostHandshakeMessage(); /* */ $s = 17; case 17: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } err$2 = _r$2; /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 18; continue; } /* */ $s = 19; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 18: $24r$3 = [0, err$2]; $s = 20; case 20: return $24r$3; /* } */ case 19: $s = 15; continue; case 16: $s = 9; continue; case 10: _tuple = c.input.Read(b); n = _tuple[0]; /* */ if (!((n === 0)) && (c.input.Len() === 0) && c.rawInput.Len() > 0 && ((((x = c.rawInput.Bytes(), (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])) << 24 >>> 24)) === 21)) { $s = 21; continue; } /* */ $s = 22; continue; /* if (!((n === 0)) && (c.input.Len() === 0) && c.rawInput.Len() > 0 && ((((x = c.rawInput.Bytes(), (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])) << 24 >>> 24)) === 21)) { */ case 21: _r$3 = c.readRecord(); /* */ $s = 23; case 23: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } err$3 = _r$3; /* */ if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = 24; continue; } /* */ $s = 25; continue; /* if (!($interfaceIsEqual(err$3, $ifaceNil))) { */ case 24: $24r$4 = [n, err$3]; $s = 26; case 26: return $24r$4; /* } */ case 25: /* } */ case 22: $24r$5 = [n, $ifaceNil]; $s = 27; case 27: return $24r$5; /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.Read }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.b = b; $f.c = c; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.n = n; $f.x = x; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Conn.prototype.Read = function(b) { return this.$val.Read(b); }; Conn.ptr.prototype.Close = function() { var $24r, _r, _r$1, _r$2, _r$3, alertErr, c, err, err$1, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; alertErr = $f.alertErr; c = $f.c; err = $f.err; err$1 = $f.err$1; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; x = 0; while (true) { x = atomic.LoadInt32((c.$ptr_activeCall || (c.$ptr_activeCall = new ptrType$43(function() { return this.$target.activeCall; }, function($v) { this.$target.activeCall = $v; }, c)))); if (!(((x & 1) === 0))) { $s = -1; return net.ErrClosed; } if (atomic.CompareAndSwapInt32((c.$ptr_activeCall || (c.$ptr_activeCall = new ptrType$43(function() { return this.$target.activeCall; }, function($v) { this.$target.activeCall = $v; }, c))), x, x | 1)) { break; } } /* */ if (!((x === 0))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((x === 0))) { */ case 1: _r = c.conn.Close(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 4; case 4: return $24r; /* } */ case 2: alertErr = $ifaceNil; /* */ if (c.handshakeComplete()) { $s = 5; continue; } /* */ $s = 6; continue; /* if (c.handshakeComplete()) { */ case 5: _r$1 = c.closeNotify(); /* */ $s = 7; case 7: 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))) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 8: _r$2 = fmt.Errorf("tls: failed to send closeNotify alert (but connection was closed anyway): %w", new sliceType$6([err])); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } alertErr = _r$2; /* } */ case 9: /* } */ case 6: _r$3 = c.conn.Close(); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } err$1 = _r$3; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } $s = -1; return alertErr; /* */ } return; } if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.Close }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.alertErr = alertErr; $f.c = c; $f.err = err; $f.err$1 = err$1; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Conn.prototype.Close = function() { return this.$val.Close(); }; Conn.ptr.prototype.CloseWrite = function() { var $24r, _r, c, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; c = $f.c; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!c.handshakeComplete()) { $s = -1; return errEarlyCloseWrite; } _r = c.closeNotify(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.CloseWrite }; } $f.$24r = $24r; $f._r = _r; $f.c = c; $f.$s = $s; $f.$r = $r; return $f; }; Conn.prototype.CloseWrite = function() { return this.$val.CloseWrite(); }; Conn.ptr.prototype.closeNotify = function() { var $24r, _r, _r$1, _r$2, _r$3, _r$4, _r$5, c, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; c = $f.c; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); c = this; $r = c.out.Mutex.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(c.out.Mutex, "Unlock"), []]); /* */ if (!c.closeNotifySent) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!c.closeNotifySent) { */ case 2: _r = time.Now(); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = $clone(_r, time.Time).Add(new time.Duration(1, 705032704)); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = c.SetWriteDeadline($clone(_r$1, time.Time)); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; _r$3 = c.sendAlertLocked(0); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } c.closeNotifyErr = _r$3; c.closeNotifySent = true; _r$4 = time.Now(); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = c.SetWriteDeadline($clone(_r$4, time.Time)); /* */ $s = 9; case 9: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; /* } */ case 3: $24r = c.closeNotifyErr; $s = 10; case 10: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.closeNotify }; } $f.$24r = $24r; $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.c = c; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Conn.prototype.closeNotify = function() { return this.$val.closeNotify(); }; Conn.ptr.prototype.Handshake = function() { var $24r, _r, c, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; c = $f.c; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r = c.HandshakeContext(context.Background()); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.Handshake }; } $f.$24r = $24r; $f._r = _r; $f.c = c; $f.$s = $s; $f.$r = $r; return $f; }; Conn.prototype.Handshake = function() { return this.$val.Handshake(); }; Conn.ptr.prototype.HandshakeContext = function(ctx) { var $24r, _r, c, ctx, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; c = $f.c; ctx = $f.ctx; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r = c.handshakeContext(ctx); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.HandshakeContext }; } $f.$24r = $24r; $f._r = _r; $f.c = c; $f.ctx = ctx; $f.$s = $s; $f.$r = $r; return $f; }; Conn.prototype.HandshakeContext = function(ctx) { return this.$val.HandshakeContext(ctx); }; Conn.ptr.prototype.handshakeContext = function(ctx) { var $24r, $24r$1, $24r$2, _r, _r$1, _r$2, _r$3, _tuple, c, cancel, ctx, done, err, handshakeCtx, interruptRes, ret, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; c = $f.c; cancel = $f.cancel; ctx = $f.ctx; done = $f.done; err = $f.err; handshakeCtx = $f.handshakeCtx; interruptRes = $f.interruptRes; ret = $f.ret; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); c = [c]; done = [done]; handshakeCtx = [handshakeCtx]; interruptRes = [interruptRes]; ret = [ret]; ret[0] = $ifaceNil; c[0] = this; _r = context.WithCancel(ctx); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; handshakeCtx[0] = _tuple[0]; cancel = _tuple[1]; $deferred.push([cancel, []]); _r$1 = ctx.Done(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (!(_r$1 === $chanNil)) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!(_r$1 === $chanNil)) { */ case 2: done[0] = new $Chan(structType$1, 0); interruptRes[0] = new $Chan($error, 1); $deferred.push([(function(c, done, handshakeCtx, interruptRes, ret) { return function $b() { var _r$2, ctxErr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$2 = $f._r$2; ctxErr = $f.ctxErr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $close(done[0]); _r$2 = $recv(interruptRes[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } ctxErr = _r$2[0]; if (!($interfaceIsEqual(ctxErr, $ifaceNil))) { ret[0] = ctxErr; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$2 = _r$2; $f.ctxErr = ctxErr; $f.$s = $s; $f.$r = $r; return $f; }; })(c, done, handshakeCtx, interruptRes, ret), []]); $go((function(c, done, handshakeCtx, interruptRes, ret) { return function $b() { var _r$2, _r$3, _r$4, _r$5, _selection, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _selection = $f._selection; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$2 = handshakeCtx[0].Done(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = $select([[_r$2], [done[0]]]); /* */ $s = 2; case 2: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _selection = _r$3; /* */ if (_selection[0] === 0) { $s = 3; continue; } /* */ if (_selection[0] === 1) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_selection[0] === 0) { */ case 3: _r$4 = c[0].conn.Close(); /* */ $s = 6; case 6: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $unused(_r$4); _r$5 = handshakeCtx[0].Err(); /* */ $s = 7; case 7: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $r = $send(interruptRes[0], _r$5); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 5; continue; /* } else if (_selection[0] === 1) { */ case 4: $r = $send(interruptRes[0], $ifaceNil); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._selection = _selection; $f.$s = $s; $f.$r = $r; return $f; }; })(c, done, handshakeCtx, interruptRes, ret), []); /* } */ case 3: $r = c[0].handshakeMutex.Lock(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(c[0].handshakeMutex, "Unlock"), []]); err = c[0].handshakeErr; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 6: ret[0] = err; $24r = ret[0]; $s = 8; case 8: return $24r; /* } */ case 7: /* */ if (c[0].handshakeComplete()) { $s = 9; continue; } /* */ $s = 10; continue; /* if (c[0].handshakeComplete()) { */ case 9: ret[0] = $ifaceNil; $24r$1 = ret[0]; $s = 11; case 11: return $24r$1; /* } */ case 10: $r = c[0].in$27.Mutex.Lock(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(c[0].in$27.Mutex, "Unlock"), []]); _r$2 = c[0].handshakeFn(handshakeCtx[0]); /* */ $s = 13; case 13: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } c[0].handshakeErr = _r$2; /* */ if ($interfaceIsEqual(c[0].handshakeErr, $ifaceNil)) { $s = 14; continue; } /* */ $s = 15; continue; /* if ($interfaceIsEqual(c[0].handshakeErr, $ifaceNil)) { */ case 14: c[0].handshakes = c[0].handshakes + (1) >> 0; $s = 16; continue; /* } else { */ case 15: _r$3 = c[0].flush(); /* */ $s = 17; case 17: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; /* } */ case 16: if ($interfaceIsEqual(c[0].handshakeErr, $ifaceNil) && !c[0].handshakeComplete()) { c[0].handshakeErr = errors.New("tls: internal error: handshake should have had a result"); } ret[0] = c[0].handshakeErr; $24r$2 = ret[0]; $s = 18; case 18: return $24r$2; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return ret[0]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.handshakeContext }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.c = c; $f.cancel = cancel; $f.ctx = ctx; $f.done = done; $f.err = err; $f.handshakeCtx = handshakeCtx; $f.interruptRes = interruptRes; $f.ret = ret; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Conn.prototype.handshakeContext = function(ctx) { return this.$val.handshakeContext(ctx); }; Conn.ptr.prototype.ConnectionState = function() { var $24r, c, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; c = $f.c; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); c = this; $r = c.handshakeMutex.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(c.handshakeMutex, "Unlock"), []]); $24r = c.connectionStateLocked(); $s = 2; case 2: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; return new ConnectionState.ptr(0, false, false, 0, "", false, "", sliceType$12.nil, sliceType$13.nil, sliceType$11.nil, sliceType$5.nil, sliceType$5.nil, $throwNilPointerError); } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.ConnectionState }; } $f.$24r = $24r; $f.c = c; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Conn.prototype.ConnectionState = function() { return this.$val.ConnectionState(); }; Conn.ptr.prototype.connectionStateLocked = function() { var c, state; c = this; state = new ConnectionState.ptr(0, false, false, 0, "", false, "", sliceType$12.nil, sliceType$13.nil, sliceType$11.nil, sliceType$5.nil, sliceType$5.nil, $throwNilPointerError); state.HandshakeComplete = c.handshakeComplete(); state.Version = c.vers; state.NegotiatedProtocol = c.clientProtocol; state.DidResume = c.didResume; state.NegotiatedProtocolIsMutual = true; state.ServerName = c.serverName; state.CipherSuite = c.cipherSuite; state.PeerCertificates = c.peerCertificates; state.VerifiedChains = c.verifiedChains; state.SignedCertificateTimestamps = c.scts; state.OCSPResponse = c.ocspResponse; if (!c.didResume && !((c.vers === 772))) { if (c.clientFinishedIsFirst) { state.TLSUnique = new sliceType$5(c.clientFinished); } else { state.TLSUnique = new sliceType$5(c.serverFinished); } } if (!((c.config.Renegotiation === 0))) { state.ekm = noExportedKeyingMaterial; } else { state.ekm = c.ekm; } return state; }; Conn.prototype.connectionStateLocked = function() { return this.$val.connectionStateLocked(); }; Conn.ptr.prototype.OCSPResponse = function() { var $24r, c, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; c = $f.c; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); c = this; $r = c.handshakeMutex.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(c.handshakeMutex, "Unlock"), []]); $24r = c.ocspResponse; $s = 2; case 2: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; return sliceType$5.nil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.OCSPResponse }; } $f.$24r = $24r; $f.c = c; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Conn.prototype.OCSPResponse = function() { return this.$val.OCSPResponse(); }; Conn.ptr.prototype.VerifyHostname = function(host) { var $24r, $24r$1, $24r$2, $24r$3, c, host, x, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; c = $f.c; host = $f.host; x = $f.x; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); c = this; $r = c.handshakeMutex.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(c.handshakeMutex, "Unlock"), []]); /* */ if (!c.isClient) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!c.isClient) { */ case 2: $24r = errors.New("tls: VerifyHostname called on TLS server connection"); $s = 4; case 4: return $24r; /* } */ case 3: /* */ if (!c.handshakeComplete()) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!c.handshakeComplete()) { */ case 5: $24r$1 = errors.New("tls: handshake has not yet been performed"); $s = 7; case 7: return $24r$1; /* } */ case 6: /* */ if (c.verifiedChains.$length === 0) { $s = 8; continue; } /* */ $s = 9; continue; /* if (c.verifiedChains.$length === 0) { */ case 8: $24r$2 = errors.New("tls: handshake did not verify certificate chain"); $s = 10; case 10: return $24r$2; /* } */ case 9: $24r$3 = (x = c.peerCertificates, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])).VerifyHostname(host); $s = 11; case 11: return $24r$3; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Conn.ptr.prototype.VerifyHostname }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.c = c; $f.host = host; $f.x = x; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Conn.prototype.VerifyHostname = function(host) { return this.$val.VerifyHostname(host); }; Conn.ptr.prototype.handshakeComplete = function() { var c; c = this; return atomic.LoadUint32((c.$ptr_handshakeStatus || (c.$ptr_handshakeStatus = new ptrType$24(function() { return this.$target.handshakeStatus; }, function($v) { this.$target.handshakeStatus = $v; }, c)))) === 1; }; Conn.prototype.handshakeComplete = function() { return this.$val.handshakeComplete(); }; SignatureScheme.prototype.String = function() { var i, x; i = this.$val; if ((i === 513)) { return "PKCS1WithSHA1"; } else if ((i === 515)) { return "ECDSAWithSHA1"; } else if ((i === 1025)) { return "PKCS1WithSHA256"; } else if ((i === 1027)) { return "ECDSAWithP256AndSHA256"; } else if ((i === 1281)) { return "PKCS1WithSHA384"; } else if ((i === 1283)) { return "ECDSAWithP384AndSHA384"; } else if ((i === 1537)) { return "PKCS1WithSHA512"; } else if ((i === 1539)) { return "ECDSAWithP521AndSHA512"; } else if (2052 <= i && i <= 2055) { i = i - (2052) << 16 >>> 16; return $substring("PSSWithSHA256PSSWithSHA384PSSWithSHA512Ed25519", ((i < 0 || i >= _SignatureScheme_index_8.length) ? ($throwRuntimeError("index out of range"), undefined) : _SignatureScheme_index_8[i]), (x = i + 1 << 16 >>> 16, ((x < 0 || x >= _SignatureScheme_index_8.length) ? ($throwRuntimeError("index out of range"), undefined) : _SignatureScheme_index_8[x]))); } else { return "SignatureScheme(" + strconv.FormatInt((new $Int64(0, i)), 10) + ")"; } }; $ptrType(SignatureScheme).prototype.String = function() { return new SignatureScheme(this.$get()).String(); }; CurveID.prototype.String = function() { var i, x; i = this.$val; if (23 <= i && i <= 25) { i = i - (23) << 16 >>> 16; return $substring("CurveP256CurveP384CurveP521", ((i < 0 || i >= _CurveID_index_0.length) ? ($throwRuntimeError("index out of range"), undefined) : _CurveID_index_0[i]), (x = i + 1 << 16 >>> 16, ((x < 0 || x >= _CurveID_index_0.length) ? ($throwRuntimeError("index out of range"), undefined) : _CurveID_index_0[x]))); } else if ((i === 29)) { return "X25519"; } else { return "CurveID(" + strconv.FormatInt((new $Int64(0, i)), 10) + ")"; } }; $ptrType(CurveID).prototype.String = function() { return new CurveID(this.$get()).String(); }; ClientAuthType.prototype.String = function() { var i, x; i = this.$val; if (i < 0 || i >= 5) { return "ClientAuthType(" + strconv.FormatInt((new $Int64(0, i)), 10) + ")"; } return $substring("NoClientCertRequestClientCertRequireAnyClientCertVerifyClientCertIfGivenRequireAndVerifyClientCert", ((i < 0 || i >= _ClientAuthType_index.length) ? ($throwRuntimeError("index out of range"), undefined) : _ClientAuthType_index[i]), (x = i + 1 >> 0, ((x < 0 || x >= _ClientAuthType_index.length) ? ($throwRuntimeError("index out of range"), undefined) : _ClientAuthType_index[x]))); }; $ptrType(ClientAuthType).prototype.String = function() { return new ClientAuthType(this.$get()).String(); }; ConnectionState.ptr.prototype.ExportKeyingMaterial = function(label, context$1, length) { var $24r, _r, context$1, cs, label, length, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; context$1 = $f.context$1; cs = $f.cs; label = $f.label; length = $f.length; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cs = this; _r = cs.ekm(label, context$1, length); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: ConnectionState.ptr.prototype.ExportKeyingMaterial }; } $f.$24r = $24r; $f._r = _r; $f.context$1 = context$1; $f.cs = cs; $f.label = label; $f.length = length; $f.$s = $s; $f.$r = $r; return $f; }; ConnectionState.prototype.ExportKeyingMaterial = function(label, context$1, length) { return this.$val.ExportKeyingMaterial(label, context$1, length); }; requiresClientCert = function(c) { var _1, c; _1 = c; if ((_1 === (2)) || (_1 === (4))) { return true; } else { return false; } }; ClientHelloInfo.ptr.prototype.Context = function() { var c; c = this; return c.ctx; }; ClientHelloInfo.prototype.Context = function() { return this.$val.Context(); }; CertificateRequestInfo.ptr.prototype.Context = function() { var c; c = this; return c.ctx; }; CertificateRequestInfo.prototype.Context = function() { return this.$val.Context(); }; Config.ptr.prototype.ticketKeyFromBytes = function(b) { var _r, b, c, hashed, key, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; b = $f.b; c = $f.c; hashed = $f.hashed; key = $f.key; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: key = new ticketKey.ptr(arrayType$4.zero(), arrayType$4.zero(), arrayType$4.zero(), new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$7.nil)); c = this; hashed = $clone(sha512.Sum512(new sliceType$5(b)), arrayType$7); $copySlice(new sliceType$5(key.keyName), $subslice(new sliceType$5(hashed), 0, 16)); $copySlice(new sliceType$5(key.aesKey), $subslice(new sliceType$5(hashed), 16, 32)); $copySlice(new sliceType$5(key.hmacKey), $subslice(new sliceType$5(hashed), 32, 48)); _r = c.time(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } time.Time.copy(key.created, _r); ticketKey.copy(key, key); $s = -1; return key; /* */ } return; } if ($f === undefined) { $f = { $blk: Config.ptr.prototype.ticketKeyFromBytes }; } $f._r = _r; $f.b = b; $f.c = c; $f.hashed = hashed; $f.key = key; $f.$s = $s; $f.$r = $r; return $f; }; Config.prototype.ticketKeyFromBytes = function(b) { return this.$val.ticketKeyFromBytes(b); }; Config.ptr.prototype.Clone = function() { var $24r, $24r$1, c, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; c = $f.c; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); c = this; /* */ if (c === ptrType$4.nil) { $s = 1; continue; } /* */ $s = 2; continue; /* if (c === ptrType$4.nil) { */ case 1: $24r = ptrType$4.nil; $s = 3; case 3: return $24r; /* } */ case 2: $r = c.mutex.RLock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(c.mutex, "RUnlock"), []]); $24r$1 = new Config.ptr(c.Rand, c.Time, c.Certificates, c.NameToCertificate, c.GetCertificate, c.GetClientCertificate, c.GetConfigForClient, c.VerifyPeerCertificate, c.VerifyConnection, c.RootCAs, c.NextProtos, c.ServerName, c.ClientAuth, c.ClientCAs, c.InsecureSkipVerify, c.CipherSuites, c.PreferServerCipherSuites, c.SessionTicketsDisabled, $clone(c.SessionTicketKey, arrayType), c.ClientSessionCache, c.MinVersion, c.MaxVersion, c.CurvePreferences, c.DynamicRecordSizingDisabled, c.Renegotiation, c.KeyLogWriter, new sync.RWMutex.ptr(new sync.Mutex.ptr(0, 0), 0, 0, 0, 0), c.sessionTicketKeys, c.autoSessionTicketKeys); $s = 5; case 5: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return ptrType$4.nil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Config.ptr.prototype.Clone }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.c = c; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Config.prototype.Clone = function() { return this.$val.Clone(); }; Config.ptr.prototype.initLegacySessionTicketKeyRLocked = function() { var _r, _r$1, _r$2, _tuple, c, err, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; c = $f.c; err = $f.err; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); c = this; /* */ if (!($equal(c.SessionTicketKey, arrayType.zero(), arrayType)) && (bytes.HasPrefix(new sliceType$5(c.SessionTicketKey), deprecatedSessionTicketKey) || c.sessionTicketKeys.$length > 0)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($equal(c.SessionTicketKey, arrayType.zero(), arrayType)) && (bytes.HasPrefix(new sliceType$5(c.SessionTicketKey), deprecatedSessionTicketKey) || c.sessionTicketKeys.$length > 0)) { */ case 1: $s = 3; case 3: return; /* } */ case 2: $r = c.mutex.RUnlock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(c.mutex, "RLock"), []]); $r = c.mutex.Lock(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(c.mutex, "Unlock"), []]); /* */ if ($equal(c.SessionTicketKey, arrayType.zero(), arrayType)) { $s = 6; continue; } /* */ if (!bytes.HasPrefix(new sliceType$5(c.SessionTicketKey), deprecatedSessionTicketKey) && (c.sessionTicketKeys.$length === 0)) { $s = 7; continue; } /* */ $s = 8; continue; /* if ($equal(c.SessionTicketKey, arrayType.zero(), arrayType)) { */ case 6: _r = io.ReadFull(c.rand(), new sliceType$5(c.SessionTicketKey)); /* */ $s = 9; case 9: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 10; continue; } /* */ $s = 11; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 10: _r$1 = fmt.Sprintf("tls: unable to generate random session ticket key: %v", new sliceType$6([err])); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $panic(new $String(_r$1)); /* } */ case 11: $copySlice(new sliceType$5(c.SessionTicketKey), deprecatedSessionTicketKey); $s = 8; continue; /* } else if (!bytes.HasPrefix(new sliceType$5(c.SessionTicketKey), deprecatedSessionTicketKey) && (c.sessionTicketKeys.$length === 0)) { */ case 7: _r$2 = c.ticketKeyFromBytes($clone(c.SessionTicketKey, arrayType)); /* */ $s = 13; case 13: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } c.sessionTicketKeys = new sliceType$4([$clone(_r$2, ticketKey)]); /* } */ case 8: $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Config.ptr.prototype.initLegacySessionTicketKeyRLocked }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.c = c; $f.err = err; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Config.prototype.initLegacySessionTicketKeyRLocked = function() { return this.$val.initLegacySessionTicketKeyRLocked(); }; Config.ptr.prototype.ticketKeys = function(configForClient) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, $24r$5, _i, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _ref, _tuple, _v, _v$1, c, configForClient, err, k, newKey, ret, valid, x, x$1, x$2, x$3, x$4, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; _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; _ref = $f._ref; _tuple = $f._tuple; _v = $f._v; _v$1 = $f._v$1; c = $f.c; configForClient = $f.configForClient; err = $f.err; k = $f.k; newKey = $f.newKey; ret = $f.ret; valid = $f.valid; 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; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); c = this; /* */ if (!(configForClient === ptrType$4.nil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(configForClient === ptrType$4.nil)) { */ case 1: $r = configForClient.mutex.RLock(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (configForClient.SessionTicketsDisabled) { $s = 4; continue; } /* */ $s = 5; continue; /* if (configForClient.SessionTicketsDisabled) { */ case 4: $24r = sliceType$4.nil; $s = 6; case 6: return $24r; /* } */ case 5: $r = configForClient.initLegacySessionTicketKeyRLocked(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!((configForClient.sessionTicketKeys.$length === 0))) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!((configForClient.sessionTicketKeys.$length === 0))) { */ case 8: ret = configForClient.sessionTicketKeys; $r = configForClient.mutex.RUnlock(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $24r$1 = ret; $s = 11; case 11: return $24r$1; /* } */ case 9: $r = configForClient.mutex.RUnlock(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $r = c.mutex.RLock(); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(c.mutex, "RUnlock"), []]); /* */ if (c.SessionTicketsDisabled) { $s = 14; continue; } /* */ $s = 15; continue; /* if (c.SessionTicketsDisabled) { */ case 14: $24r$2 = sliceType$4.nil; $s = 16; case 16: return $24r$2; /* } */ case 15: $r = c.initLegacySessionTicketKeyRLocked(); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!((c.sessionTicketKeys.$length === 0))) { $s = 18; continue; } /* */ $s = 19; continue; /* if (!((c.sessionTicketKeys.$length === 0))) { */ case 18: $24r$3 = c.sessionTicketKeys; $s = 20; case 20: return $24r$3; /* } */ case 19: if (!(c.autoSessionTicketKeys.$length > 0)) { _v = false; $s = 23; continue s; } _r = c.time(); /* */ $s = 24; case 24: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = $clone(_r, time.Time).Sub($clone((x$1 = c.autoSessionTicketKeys, (0 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 0])).created, time.Time)); /* */ $s = 25; case 25: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _v = (x = _r$1, (x.$high < 20116 || (x.$high === 20116 && x.$low < 2437873664))); case 23: /* */ if (_v) { $s = 21; continue; } /* */ $s = 22; continue; /* if (_v) { */ case 21: $24r$4 = c.autoSessionTicketKeys; $s = 26; case 26: return $24r$4; /* } */ case 22: $r = c.mutex.RUnlock(); /* */ $s = 27; case 27: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(c.mutex, "RLock"), []]); $r = c.mutex.Lock(); /* */ $s = 28; case 28: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(c.mutex, "Unlock"), []]); if (c.autoSessionTicketKeys.$length === 0) { _v$1 = true; $s = 31; continue s; } _r$2 = c.time(); /* */ $s = 32; case 32: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = $clone(_r$2, time.Time).Sub($clone((x$3 = c.autoSessionTicketKeys, (0 >= x$3.$length ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + 0])).created, time.Time)); /* */ $s = 33; case 33: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _v$1 = (x$2 = _r$3, (x$2.$high > 20116 || (x$2.$high === 20116 && x$2.$low >= 2437873664))); case 31: /* */ if (_v$1) { $s = 29; continue; } /* */ $s = 30; continue; /* if (_v$1) { */ case 29: newKey = arrayType.zero(); _r$4 = io.ReadFull(c.rand(), new sliceType$5(newKey)); /* */ $s = 34; case 34: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple = _r$4; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 35; continue; } /* */ $s = 36; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 35: _r$5 = fmt.Sprintf("unable to generate random session ticket key: %v", new sliceType$6([err])); /* */ $s = 37; case 37: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $panic(new $String(_r$5)); /* } */ case 36: valid = $makeSlice(sliceType$4, 0, (c.autoSessionTicketKeys.$length + 1 >> 0)); _r$6 = c.ticketKeyFromBytes($clone(newKey, arrayType)); /* */ $s = 38; case 38: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } valid = $append(valid, _r$6); _ref = c.autoSessionTicketKeys; _i = 0; /* while (true) { */ case 39: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 40; continue; } k = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), ticketKey); _r$7 = c.time(); /* */ $s = 43; case 43: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$8 = $clone(_r$7, time.Time).Sub($clone(k.created, time.Time)); /* */ $s = 44; case 44: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } /* */ if ((x$4 = _r$8, (x$4.$high < 140815 || (x$4.$high === 140815 && x$4.$low < 4180213760)))) { $s = 41; continue; } /* */ $s = 42; continue; /* if ((x$4 = _r$8, (x$4.$high < 140815 || (x$4.$high === 140815 && x$4.$low < 4180213760)))) { */ case 41: valid = $append(valid, k); /* } */ case 42: _i++; $s = 39; continue; case 40: c.autoSessionTicketKeys = valid; /* } */ case 30: $24r$5 = c.autoSessionTicketKeys; $s = 45; case 45: return $24r$5; /* */ } return; } } catch(err) { $err = err; $s = -1; return sliceType$4.nil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Config.ptr.prototype.ticketKeys }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $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._ref = _ref; $f._tuple = _tuple; $f._v = _v; $f._v$1 = _v$1; $f.c = c; $f.configForClient = configForClient; $f.err = err; $f.k = k; $f.newKey = newKey; $f.ret = ret; $f.valid = valid; $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.$deferred = $deferred; $f.$r = $r; return $f; } } }; Config.prototype.ticketKeys = function(configForClient) { return this.$val.ticketKeys(configForClient); }; Config.ptr.prototype.SetSessionTicketKeys = function(keys) { var _i, _r, _ref, bytes$1, c, i, keys, newKeys, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _ref = $f._ref; bytes$1 = $f.bytes$1; c = $f.c; i = $f.i; keys = $f.keys; newKeys = $f.newKeys; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (keys.$length === 0) { $panic(new $String("tls: keys must have at least one key")); } newKeys = $makeSlice(sliceType$4, keys.$length); _ref = keys; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } i = _i; bytes$1 = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), arrayType); _r = c.ticketKeyFromBytes($clone(bytes$1, arrayType)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } ticketKey.copy(((i < 0 || i >= newKeys.$length) ? ($throwRuntimeError("index out of range"), undefined) : newKeys.$array[newKeys.$offset + i]), _r); _i++; $s = 1; continue; case 2: $r = c.mutex.Lock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } c.sessionTicketKeys = newKeys; $r = c.mutex.Unlock(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Config.ptr.prototype.SetSessionTicketKeys }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f.bytes$1 = bytes$1; $f.c = c; $f.i = i; $f.keys = keys; $f.newKeys = newKeys; $f.$s = $s; $f.$r = $r; return $f; }; Config.prototype.SetSessionTicketKeys = function(keys) { return this.$val.SetSessionTicketKeys(keys); }; Config.ptr.prototype.rand = function() { var c, r; c = this; r = c.Rand; if ($interfaceIsEqual(r, $ifaceNil)) { return rand.Reader; } return r; }; Config.prototype.rand = function() { return this.$val.rand(); }; Config.ptr.prototype.time = function() { var $24r, _r, c, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; c = $f.c; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; t = c.Time; if (t === $throwNilPointerError) { t = time.Now; } _r = t(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Config.ptr.prototype.time }; } $f.$24r = $24r; $f._r = _r; $f.c = c; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Config.prototype.time = function() { return this.$val.time(); }; Config.ptr.prototype.cipherSuites = function() { var c; c = this; if (!(c.CipherSuites === sliceType$2.nil)) { return c.CipherSuites; } return defaultCipherSuites; }; Config.prototype.cipherSuites = function() { return this.$val.cipherSuites(); }; Config.ptr.prototype.supportedVersions = function() { var _i, _ref, c, v, versions; c = this; versions = $makeSlice(sliceType$2, 0, supportedVersions.$length); _ref = supportedVersions; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (!(c === ptrType$4.nil) && !((c.MinVersion === 0)) && v < c.MinVersion) { _i++; continue; } if (!(c === ptrType$4.nil) && !((c.MaxVersion === 0)) && v > c.MaxVersion) { _i++; continue; } versions = $append(versions, v); _i++; } return versions; }; Config.prototype.supportedVersions = function() { return this.$val.supportedVersions(); }; Config.ptr.prototype.maxSupportedVersion = function() { var c, supportedVersions$1; c = this; supportedVersions$1 = c.supportedVersions(); if (supportedVersions$1.$length === 0) { return 0; } return (0 >= supportedVersions$1.$length ? ($throwRuntimeError("index out of range"), undefined) : supportedVersions$1.$array[supportedVersions$1.$offset + 0]); }; Config.prototype.maxSupportedVersion = function() { return this.$val.maxSupportedVersion(); }; supportedVersionsFromMax = function(maxVersion) { var _i, _ref, maxVersion, v, versions; versions = $makeSlice(sliceType$2, 0, supportedVersions.$length); _ref = supportedVersions; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (v > maxVersion) { _i++; continue; } versions = $append(versions, v); _i++; } return versions; }; Config.ptr.prototype.curvePreferences = function() { var c; c = this; if (c === ptrType$4.nil || (c.CurvePreferences.$length === 0)) { return defaultCurvePreferences; } return c.CurvePreferences; }; Config.prototype.curvePreferences = function() { return this.$val.curvePreferences(); }; Config.ptr.prototype.supportsCurve = function(curve) { var _i, _ref, c, cc, curve; c = this; _ref = c.curvePreferences(); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } cc = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (cc === curve) { return true; } _i++; } return false; }; Config.prototype.supportsCurve = function(curve) { return this.$val.supportsCurve(curve); }; Config.ptr.prototype.mutualVersion = function(peerVersions) { var _i, _i$1, _ref, _ref$1, c, peerVersion, peerVersions, supportedVersions$1, v; c = this; supportedVersions$1 = c.supportedVersions(); _ref = peerVersions; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } peerVersion = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _ref$1 = supportedVersions$1; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } v = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); if (v === peerVersion) { return [v, true]; } _i$1++; } _i++; } return [0, false]; }; Config.prototype.mutualVersion = function(peerVersions) { return this.$val.mutualVersion(peerVersions); }; Config.ptr.prototype.getCertificate = function(clientHello) { var _entry, _entry$1, _i, _r, _r$1, _r$2, _ref, _tuple, _tuple$1, _tuple$2, c, cert, cert$1, cert$2, cert$3, clientHello, err, err$1, labels, name, ok, ok$1, wildcardName, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; c = $f.c; cert = $f.cert; cert$1 = $f.cert$1; cert$2 = $f.cert$2; cert$3 = $f.cert$3; clientHello = $f.clientHello; err = $f.err; err$1 = $f.err$1; labels = $f.labels; name = $f.name; ok = $f.ok; ok$1 = $f.ok$1; wildcardName = $f.wildcardName; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cert = [cert]; c = this; /* */ if (!(c.GetCertificate === $throwNilPointerError) && ((c.Certificates.$length === 0) || clientHello.ServerName.length > 0)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(c.GetCertificate === $throwNilPointerError) && ((c.Certificates.$length === 0) || clientHello.ServerName.length > 0)) { */ case 1: _r = c.GetCertificate(clientHello); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; cert$1 = _tuple[0]; err = _tuple[1]; if (!(cert$1 === ptrType$31.nil) || !($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [cert$1, err]; } /* } */ case 2: if (c.Certificates.$length === 0) { $s = -1; return [ptrType$31.nil, errNoCertificates]; } if (c.Certificates.$length === 1) { $s = -1; return [(x = c.Certificates, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])), $ifaceNil]; } /* */ if (!(c.NameToCertificate === false)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!(c.NameToCertificate === false)) { */ case 4: _r$1 = strings.ToLower(clientHello.ServerName); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } name = _r$1; _tuple$1 = (_entry = c.NameToCertificate[$String.keyFor(name)], _entry !== undefined ? [_entry.v, true] : [ptrType$31.nil, false]); cert$2 = _tuple$1[0]; ok = _tuple$1[1]; if (ok) { $s = -1; return [cert$2, $ifaceNil]; } if (name.length > 0) { labels = strings.Split(name, "."); (0 >= labels.$length ? ($throwRuntimeError("index out of range"), undefined) : labels.$array[labels.$offset + 0] = "*"); wildcardName = strings.Join(labels, "."); _tuple$2 = (_entry$1 = c.NameToCertificate[$String.keyFor(wildcardName)], _entry$1 !== undefined ? [_entry$1.v, true] : [ptrType$31.nil, false]); cert$3 = _tuple$2[0]; ok$1 = _tuple$2[1]; if (ok$1) { $s = -1; return [cert$3, $ifaceNil]; } } /* } */ case 5: _ref = c.Certificates; _i = 0; /* while (true) { */ case 7: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 8; continue; } cert[0] = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), Certificate); _r$2 = clientHello.SupportsCertificate(cert[0]); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } err$1 = _r$2; if ($interfaceIsEqual(err$1, $ifaceNil)) { $s = -1; return [cert[0], $ifaceNil]; } _i++; $s = 7; continue; case 8: $s = -1; return [(x$1 = c.Certificates, (0 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 0])), $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Config.ptr.prototype.getCertificate }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.c = c; $f.cert = cert; $f.cert$1 = cert$1; $f.cert$2 = cert$2; $f.cert$3 = cert$3; $f.clientHello = clientHello; $f.err = err; $f.err$1 = err$1; $f.labels = labels; $f.name = name; $f.ok = ok; $f.ok$1 = ok$1; $f.wildcardName = wildcardName; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; Config.prototype.getCertificate = function(clientHello) { return this.$val.getCertificate(clientHello); }; ClientHelloInfo.ptr.prototype.SupportsCertificate = function(c) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, $24r$5, $24r$6, $24r$7, _1, _i, _r, _r$1, _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, _ref, _ref$1, _tuple, _tuple$1, _tuple$2, _tuple$3, c, c$1, chi, cipherSuite$1, config, curve, curveOk, ecdsaCipherSuite, err, err$1, err$2, ok, ok$1, priv, pub, pub$1, pub$2, pub$3, supportsRSAFallback, vers, x509Cert, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; $24r$6 = $f.$24r$6; $24r$7 = $f.$24r$7; _1 = $f._1; _i = $f._i; _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$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; _ref = $f._ref; _ref$1 = $f._ref$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; c = $f.c; c$1 = $f.c$1; chi = $f.chi; cipherSuite$1 = $f.cipherSuite$1; config = $f.config; curve = $f.curve; curveOk = $f.curveOk; ecdsaCipherSuite = $f.ecdsaCipherSuite; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; ok = $f.ok; ok$1 = $f.ok$1; priv = $f.priv; pub = $f.pub; pub$1 = $f.pub$1; pub$2 = $f.pub$2; pub$3 = $f.pub$3; supportsRSAFallback = $f.supportsRSAFallback; vers = $f.vers; x509Cert = $f.x509Cert; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = [c]; chi = [chi]; config = [config]; ecdsaCipherSuite = [ecdsaCipherSuite]; vers = [vers]; chi[0] = this; config[0] = chi[0].config; if (config[0] === ptrType$4.nil) { config[0] = new Config.ptr($ifaceNil, $throwNilPointerError, sliceType.nil, false, $throwNilPointerError, $throwNilPointerError, $throwNilPointerError, $throwNilPointerError, $throwNilPointerError, ptrType.nil, sliceType$1.nil, "", 0, ptrType.nil, false, sliceType$2.nil, false, false, arrayType.zero(), $ifaceNil, 0, 0, sliceType$3.nil, false, 0, $ifaceNil, new sync.RWMutex.ptr(new sync.Mutex.ptr(0, 0), 0, 0, 0, 0), sliceType$4.nil, sliceType$4.nil); } _tuple = config[0].mutualVersion(chi[0].SupportedVersions); vers[0] = _tuple[0]; ok = _tuple[1]; if (!ok) { $s = -1; return errors.New("no mutually supported protocol versions"); } /* */ if (!(chi[0].ServerName === "")) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(chi[0].ServerName === "")) { */ case 1: _r = c[0].leaf(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple$1 = _r; x509Cert = _tuple$1[0]; err = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 4: _r$1 = fmt.Errorf("failed to parse certificate: %w", new sliceType$6([err])); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 7; case 7: return $24r; /* } */ case 5: err$1 = x509Cert.VerifyHostname(chi[0].ServerName); /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 8: _r$2 = fmt.Errorf("certificate is not valid for requested server name: %w", new sliceType$6([err$1])); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r$1 = _r$2; $s = 11; case 11: return $24r$1; /* } */ case 9: /* } */ case 2: supportsRSAFallback = (function(c, chi, config, ecdsaCipherSuite, vers) { return function $b(unsupported) { var _r$3, _r$4, _tuple$2, _tuple$3, ok$1, ok$2, priv, rsaCipherSuite, unsupported, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; ok$1 = $f.ok$1; ok$2 = $f.ok$2; priv = $f.priv; rsaCipherSuite = $f.rsaCipherSuite; unsupported = $f.unsupported; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (vers[0] === 772) { $s = -1; return unsupported; } _tuple$2 = $assertType(c[0].PrivateKey, crypto.Decrypter, true); priv = _tuple$2[0]; ok$1 = _tuple$2[1]; /* */ if (ok$1) { $s = 1; continue; } /* */ $s = 2; continue; /* if (ok$1) { */ case 1: _r$3 = priv.Public(); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$3 = $assertType(_r$3, ptrType$11, true); ok$2 = _tuple$3[1]; if (!ok$2) { $s = -1; return unsupported; } $s = 3; continue; /* } else { */ case 2: $s = -1; return unsupported; /* } */ case 3: _r$4 = selectCipherSuite(chi[0].CipherSuites, config[0].cipherSuites(), (function(c, chi, config, ecdsaCipherSuite, vers) { return function(c$1) { var c$1; if (!(((c$1.flags & 1) === 0))) { return false; } if (vers[0] < 771 && !(((c$1.flags & 4) === 0))) { return false; } return true; }; })(c, chi, config, ecdsaCipherSuite, vers)); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } rsaCipherSuite = _r$4; if (rsaCipherSuite === ptrType$3.nil) { $s = -1; return unsupported; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.ok$1 = ok$1; $f.ok$2 = ok$2; $f.priv = priv; $f.rsaCipherSuite = rsaCipherSuite; $f.unsupported = unsupported; $f.$s = $s; $f.$r = $r; return $f; }; })(c, chi, config, ecdsaCipherSuite, vers); /* */ if (chi[0].SignatureSchemes.$length > 0) { $s = 12; continue; } /* */ $s = 13; continue; /* if (chi[0].SignatureSchemes.$length > 0) { */ case 12: _r$3 = selectSignatureScheme(vers[0], c[0], chi[0].SignatureSchemes); /* */ $s = 14; case 14: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$2 = _r$3; err$2 = _tuple$2[1]; /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 15; continue; } /* */ $s = 16; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 15: _r$4 = supportsRSAFallback(err$2); /* */ $s = 17; case 17: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r$2 = _r$4; $s = 18; case 18: return $24r$2; /* } */ case 16: /* } */ case 13: if (vers[0] === 772) { $s = -1; return $ifaceNil; } /* */ if (!supportsECDHE(config[0], chi[0].SupportedCurves, chi[0].SupportedPoints)) { $s = 19; continue; } /* */ $s = 20; continue; /* if (!supportsECDHE(config[0], chi[0].SupportedCurves, chi[0].SupportedPoints)) { */ case 19: _r$5 = supportsRSAFallback(errors.New("client doesn't support ECDHE, can only use legacy RSA key exchange")); /* */ $s = 21; case 21: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $24r$3 = _r$5; $s = 22; case 22: return $24r$3; /* } */ case 20: ecdsaCipherSuite[0] = false; _tuple$3 = $assertType(c[0].PrivateKey, crypto.Signer, true); priv = _tuple$3[0]; ok$1 = _tuple$3[1]; /* */ if (ok$1) { $s = 23; continue; } /* */ $s = 24; continue; /* if (ok$1) { */ case 23: _r$6 = priv.Public(); /* */ $s = 26; case 26: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _ref = _r$6; /* */ if ($assertType(_ref, ptrType$12, true)[1]) { $s = 27; continue; } /* */ if ($assertType(_ref, ed25519.PublicKey, true)[1]) { $s = 28; continue; } /* */ if ($assertType(_ref, ptrType$11, true)[1]) { $s = 29; continue; } /* */ $s = 30; continue; /* if ($assertType(_ref, ptrType$12, true)[1]) { */ case 27: pub = _ref.$val; curve = 0; _1 = pub.Curve; _r$7 = elliptic.P256(); /* */ $s = 38; case 38: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } /* */ if ($interfaceIsEqual(_1, (_r$7))) { $s = 33; continue; } _r$8 = elliptic.P384(); /* */ $s = 39; case 39: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } /* */ if ($interfaceIsEqual(_1, (_r$8))) { $s = 34; continue; } _r$9 = elliptic.P521(); /* */ $s = 40; case 40: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } /* */ if ($interfaceIsEqual(_1, (_r$9))) { $s = 35; continue; } /* */ $s = 36; continue; /* if ($interfaceIsEqual(_1, (_r$7))) { */ case 33: curve = 23; $s = 37; continue; /* } else if ($interfaceIsEqual(_1, (_r$8))) { */ case 34: curve = 24; $s = 37; continue; /* } else if ($interfaceIsEqual(_1, (_r$9))) { */ case 35: curve = 25; $s = 37; continue; /* } else { */ case 36: _r$10 = unsupportedCertificateError(c[0]); /* */ $s = 41; case 41: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$11 = supportsRSAFallback(_r$10); /* */ $s = 42; case 42: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } $24r$4 = _r$11; $s = 43; case 43: return $24r$4; /* } */ case 37: case 32: curveOk = false; _ref$1 = chi[0].SupportedCurves; _i = 0; while (true) { if (!(_i < _ref$1.$length)) { break; } c$1 = ((_i < 0 || _i >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i]); if ((c$1 === curve) && config[0].supportsCurve(c$1)) { curveOk = true; break; } _i++; } if (!curveOk) { $s = -1; return errors.New("client doesn't support certificate curve"); } ecdsaCipherSuite[0] = true; $s = 31; continue; /* } else if ($assertType(_ref, ed25519.PublicKey, true)[1]) { */ case 28: pub$1 = _ref.$val; if (vers[0] < 771 || (chi[0].SignatureSchemes.$length === 0)) { $s = -1; return errors.New("connection doesn't support Ed25519"); } ecdsaCipherSuite[0] = true; $s = 31; continue; /* } else if ($assertType(_ref, ptrType$11, true)[1]) { */ case 29: pub$2 = _ref.$val; $s = 31; continue; /* } else { */ case 30: pub$3 = _ref; _r$12 = unsupportedCertificateError(c[0]); /* */ $s = 44; case 44: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _r$13 = supportsRSAFallback(_r$12); /* */ $s = 45; case 45: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } $24r$5 = _r$13; $s = 46; case 46: return $24r$5; /* } */ case 31: $s = 25; continue; /* } else { */ case 24: _r$14 = unsupportedCertificateError(c[0]); /* */ $s = 47; case 47: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _r$15 = supportsRSAFallback(_r$14); /* */ $s = 48; case 48: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } $24r$6 = _r$15; $s = 49; case 49: return $24r$6; /* } */ case 25: _r$16 = selectCipherSuite(chi[0].CipherSuites, config[0].cipherSuites(), (function(c, chi, config, ecdsaCipherSuite, vers) { return function(c$2) { var c$2; if ((c$2.flags & 1) === 0) { return false; } if (!(((c$2.flags & 2) === 0))) { if (!ecdsaCipherSuite[0]) { return false; } } else { if (ecdsaCipherSuite[0]) { return false; } } if (vers[0] < 771 && !(((c$2.flags & 4) === 0))) { return false; } return true; }; })(c, chi, config, ecdsaCipherSuite, vers)); /* */ $s = 50; case 50: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } cipherSuite$1 = _r$16; /* */ if (cipherSuite$1 === ptrType$3.nil) { $s = 51; continue; } /* */ $s = 52; continue; /* if (cipherSuite$1 === ptrType$3.nil) { */ case 51: _r$17 = supportsRSAFallback(errors.New("client doesn't support any cipher suites compatible with the certificate")); /* */ $s = 53; case 53: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } $24r$7 = _r$17; $s = 54; case 54: return $24r$7; /* } */ case 52: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: ClientHelloInfo.ptr.prototype.SupportsCertificate }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f.$24r$6 = $24r$6; $f.$24r$7 = $24r$7; $f._1 = _1; $f._i = _i; $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$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._ref = _ref; $f._ref$1 = _ref$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.c = c; $f.c$1 = c$1; $f.chi = chi; $f.cipherSuite$1 = cipherSuite$1; $f.config = config; $f.curve = curve; $f.curveOk = curveOk; $f.ecdsaCipherSuite = ecdsaCipherSuite; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.ok = ok; $f.ok$1 = ok$1; $f.priv = priv; $f.pub = pub; $f.pub$1 = pub$1; $f.pub$2 = pub$2; $f.pub$3 = pub$3; $f.supportsRSAFallback = supportsRSAFallback; $f.vers = vers; $f.x509Cert = x509Cert; $f.$s = $s; $f.$r = $r; return $f; }; ClientHelloInfo.prototype.SupportsCertificate = function(c) { return this.$val.SupportsCertificate(c); }; CertificateRequestInfo.ptr.prototype.SupportsCertificate = function(c) { var $24r, _i, _i$1, _r, _r$1, _r$2, _ref, _ref$1, _tuple, _tuple$1, c, ca, cert, cri, err, err$1, j, x509Cert, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; _ref$1 = $f._ref$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; c = $f.c; ca = $f.ca; cert = $f.cert; cri = $f.cri; err = $f.err; err$1 = $f.err$1; j = $f.j; x509Cert = $f.x509Cert; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cri = this; _r = selectSignatureScheme(cri.Version, c, cri.SignatureSchemes); /* */ $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))) { $s = -1; return err; } if (cri.AcceptableCAs.$length === 0) { $s = -1; return $ifaceNil; } _ref = c.Certificate; _i = 0; /* while (true) { */ case 2: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 3; continue; } j = _i; cert = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); x509Cert = c.Leaf; /* */ if (!((j === 0)) || x509Cert === ptrType$5.nil) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!((j === 0)) || x509Cert === ptrType$5.nil) { */ case 4: err$1 = $ifaceNil; _r$1 = x509.ParseCertificate(cert); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; x509Cert = _tuple$1[0]; err$1 = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 7: _r$2 = fmt.Errorf("failed to parse certificate #%d in the chain: %w", new sliceType$6([new $Int(j), err$1])); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 10; case 10: return $24r; /* } */ case 8: /* } */ case 5: _ref$1 = cri.AcceptableCAs; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } ca = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); if (bytes.Equal(x509Cert.RawIssuer, ca)) { $s = -1; return $ifaceNil; } _i$1++; } _i++; $s = 2; continue; case 3: $s = -1; return errors.New("chain is not signed by an acceptable CA"); /* */ } return; } if ($f === undefined) { $f = { $blk: CertificateRequestInfo.ptr.prototype.SupportsCertificate }; } $f.$24r = $24r; $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f._ref$1 = _ref$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.c = c; $f.ca = ca; $f.cert = cert; $f.cri = cri; $f.err = err; $f.err$1 = err$1; $f.j = j; $f.x509Cert = x509Cert; $f.$s = $s; $f.$r = $r; return $f; }; CertificateRequestInfo.prototype.SupportsCertificate = function(c) { return this.$val.SupportsCertificate(c); }; Config.ptr.prototype.BuildNameToCertificate = function() { var _i, _i$1, _key, _key$1, _r, _ref, _ref$1, _tuple, c, cert, err, i, san, x, x509Cert, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _i$1 = $f._i$1; _key = $f._key; _key$1 = $f._key$1; _r = $f._r; _ref = $f._ref; _ref$1 = $f._ref$1; _tuple = $f._tuple; c = $f.c; cert = $f.cert; err = $f.err; i = $f.i; san = $f.san; x = $f.x; x509Cert = $f.x509Cert; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; c.NameToCertificate = {}; _ref = c.Certificates; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } i = _i; cert = (x = c.Certificates, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); _r = cert.leaf(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; x509Cert = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _i++; /* continue; */ $s = 1; continue; } if (!(x509Cert.Subject.CommonName === "") && (x509Cert.DNSNames.$length === 0)) { _key = x509Cert.Subject.CommonName; (c.NameToCertificate || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: cert }; } _ref$1 = x509Cert.DNSNames; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } san = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); _key$1 = san; (c.NameToCertificate || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key$1)] = { k: _key$1, v: cert }; _i$1++; } _i++; $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Config.ptr.prototype.BuildNameToCertificate }; } $f._i = _i; $f._i$1 = _i$1; $f._key = _key; $f._key$1 = _key$1; $f._r = _r; $f._ref = _ref; $f._ref$1 = _ref$1; $f._tuple = _tuple; $f.c = c; $f.cert = cert; $f.err = err; $f.i = i; $f.san = san; $f.x = x; $f.x509Cert = x509Cert; $f.$s = $s; $f.$r = $r; return $f; }; Config.prototype.BuildNameToCertificate = function() { return this.$val.BuildNameToCertificate(); }; Config.ptr.prototype.writeKeyLog = function(label, clientRandom, secret) { var _r, _r$1, _tuple, c, clientRandom, err, label, logLine, secret, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; c = $f.c; clientRandom = $f.clientRandom; err = $f.err; label = $f.label; logLine = $f.logLine; secret = $f.secret; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if ($interfaceIsEqual(c.KeyLogWriter, $ifaceNil)) { $s = -1; return $ifaceNil; } _r = fmt.Sprintf("%s %x %x\n", new sliceType$6([new $String(label), clientRandom, secret])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } logLine = (new sliceType$5($stringToBytes(_r))); $r = writerMutex.Lock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = c.KeyLogWriter.Write(logLine); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; err = _tuple[1]; $r = writerMutex.Unlock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: Config.ptr.prototype.writeKeyLog }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.c = c; $f.clientRandom = clientRandom; $f.err = err; $f.label = label; $f.logLine = logLine; $f.secret = secret; $f.$s = $s; $f.$r = $r; return $f; }; Config.prototype.writeKeyLog = function(label, clientRandom, secret) { return this.$val.writeKeyLog(label, clientRandom, secret); }; Certificate.ptr.prototype.leaf = function() { var $24r, _r, c, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; c = $f.c; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!(c.Leaf === ptrType$5.nil)) { $s = -1; return [c.Leaf, $ifaceNil]; } _r = x509.ParseCertificate((x = c.Certificate, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0]))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Certificate.ptr.prototype.leaf }; } $f.$24r = $24r; $f._r = _r; $f.c = c; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Certificate.prototype.leaf = function() { return this.$val.leaf(); }; defaultConfig = function() { return emptyConfig; }; unexpectedMessageError = function(wanted, got) { var $24r, _r, got, wanted, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; got = $f.got; wanted = $f.wanted; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = fmt.Errorf("tls: received unexpected handshake message of type %T when waiting for %T", new sliceType$6([got, wanted])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: unexpectedMessageError }; } $f.$24r = $24r; $f._r = _r; $f.got = got; $f.wanted = wanted; $f.$s = $s; $f.$r = $r; return $f; }; isSupportedSignatureAlgorithm = function(sigAlg, supportedSignatureAlgorithms$1) { var _i, _ref, s, sigAlg, supportedSignatureAlgorithms$1; _ref = supportedSignatureAlgorithms$1; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } s = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (s === sigAlg) { return true; } _i++; } return false; }; selectCipherSuite = function(ids, supportedIDs, ok) { var _i, _i$1, _r, _ref, _ref$1, _v, candidate, id, ids, ok, suppID, supportedIDs, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _ref = $f._ref; _ref$1 = $f._ref$1; _v = $f._v; candidate = $f.candidate; id = $f.id; ids = $f.ids; ok = $f.ok; suppID = $f.suppID; supportedIDs = $f.supportedIDs; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _ref = ids; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } id = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); candidate = cipherSuiteByID(id); if (candidate === ptrType$3.nil) { _v = true; $s = 5; continue s; } _r = ok(candidate); /* */ $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: _i++; /* continue; */ $s = 1; continue; /* } */ case 4: _ref$1 = supportedIDs; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } suppID = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); if (id === suppID) { $s = -1; return candidate; } _i$1++; } _i++; $s = 1; continue; case 2: $s = -1; return ptrType$3.nil; /* */ } return; } if ($f === undefined) { $f = { $blk: selectCipherSuite }; } $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._ref = _ref; $f._ref$1 = _ref$1; $f._v = _v; $f.candidate = candidate; $f.id = id; $f.ids = ids; $f.ok = ok; $f.suppID = suppID; $f.supportedIDs = supportedIDs; $f.$s = $s; $f.$r = $r; return $f; }; aesgcmPreferred = function(ciphers) { var _entry, _entry$1, _i, _ref, c, c$1, cID, ciphers; _ref = ciphers; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } cID = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); c = cipherSuiteByID(cID); if (!(c === ptrType$3.nil)) { return (_entry = aesgcmCiphers[$Uint16.keyFor(cID)], _entry !== undefined ? _entry.v : false); } c$1 = cipherSuiteTLS13ByID(cID); if (!(c$1 === ptrType$2.nil)) { return (_entry$1 = aesgcmCiphers[$Uint16.keyFor(cID)], _entry$1 !== undefined ? _entry$1.v : false); } _i++; } return false; }; cipherRC4 = function(key, iv, isRead) { var _tuple, cipher$1, isRead, iv, key; _tuple = rc4.NewCipher(key); cipher$1 = _tuple[0]; return cipher$1; }; cipher3DES = function(key, iv, isRead) { var $24r, $24r$1, _r, _r$1, _r$2, _tuple, block, isRead, iv, key, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; block = $f.block; isRead = $f.isRead; iv = $f.iv; key = $f.key; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = des.NewTripleDESCipher(key); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; block = _tuple[0]; /* */ if (isRead) { $s = 2; continue; } /* */ $s = 3; continue; /* if (isRead) { */ case 2: _r$1 = cipher.NewCBCDecrypter(block, iv); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 5; case 5: return $24r; /* } */ case 3: _r$2 = cipher.NewCBCEncrypter(block, iv); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r$1 = _r$2; $s = 7; case 7: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: cipher3DES }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.block = block; $f.isRead = isRead; $f.iv = iv; $f.key = key; $f.$s = $s; $f.$r = $r; return $f; }; cipherAES = function(key, iv, isRead) { var $24r, $24r$1, _r, _r$1, _tuple, block, isRead, iv, key, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; block = $f.block; isRead = $f.isRead; iv = $f.iv; key = $f.key; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _tuple = aes.NewCipher(key); block = _tuple[0]; /* */ if (isRead) { $s = 1; continue; } /* */ $s = 2; continue; /* if (isRead) { */ case 1: _r = cipher.NewCBCDecrypter(block, iv); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 4; case 4: return $24r; /* } */ case 2: _r$1 = cipher.NewCBCEncrypter(block, iv); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r$1 = _r$1; $s = 6; case 6: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: cipherAES }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.block = block; $f.isRead = isRead; $f.iv = iv; $f.key = key; $f.$s = $s; $f.$r = $r; return $f; }; macSHA1 = function(key) { var $24r, _r, key, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; key = $f.key; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = hmac.New(newConstantTimeHash(sha1.New), key); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: macSHA1 }; } $f.$24r = $24r; $f._r = _r; $f.key = key; $f.$s = $s; $f.$r = $r; return $f; }; macSHA256 = function(key) { var $24r, _r, key, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; key = $f.key; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = hmac.New(sha256.New, key); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: macSHA256 }; } $f.$24r = $24r; $f._r = _r; $f.key = key; $f.$s = $s; $f.$r = $r; return $f; }; prefixNonceAEAD.ptr.prototype.NonceSize = function() { var f; f = this; return 8; }; prefixNonceAEAD.prototype.NonceSize = function() { return this.$val.NonceSize(); }; prefixNonceAEAD.ptr.prototype.Overhead = function() { var $24r, _r, f, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; _r = f.aead.Overhead(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: prefixNonceAEAD.ptr.prototype.Overhead }; } $f.$24r = $24r; $f._r = _r; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; }; prefixNonceAEAD.prototype.Overhead = function() { return this.$val.Overhead(); }; prefixNonceAEAD.ptr.prototype.explicitNonceLen = function() { var f; f = this; return f.NonceSize(); }; prefixNonceAEAD.prototype.explicitNonceLen = function() { return this.$val.explicitNonceLen(); }; prefixNonceAEAD.ptr.prototype.Seal = function(out, nonce, plaintext, additionalData) { var $24r, _r, additionalData, f, nonce, out, plaintext, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; additionalData = $f.additionalData; f = $f.f; nonce = $f.nonce; out = $f.out; plaintext = $f.plaintext; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; $copySlice($subslice(new sliceType$5(f.nonce), 4), nonce); _r = f.aead.Seal(out, new sliceType$5(f.nonce), plaintext, additionalData); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: prefixNonceAEAD.ptr.prototype.Seal }; } $f.$24r = $24r; $f._r = _r; $f.additionalData = additionalData; $f.f = f; $f.nonce = nonce; $f.out = out; $f.plaintext = plaintext; $f.$s = $s; $f.$r = $r; return $f; }; prefixNonceAEAD.prototype.Seal = function(out, nonce, plaintext, additionalData) { return this.$val.Seal(out, nonce, plaintext, additionalData); }; prefixNonceAEAD.ptr.prototype.Open = function(out, nonce, ciphertext, additionalData) { var $24r, _r, additionalData, ciphertext, f, nonce, out, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; additionalData = $f.additionalData; ciphertext = $f.ciphertext; f = $f.f; nonce = $f.nonce; out = $f.out; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; $copySlice($subslice(new sliceType$5(f.nonce), 4), nonce); _r = f.aead.Open(out, new sliceType$5(f.nonce), ciphertext, additionalData); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: prefixNonceAEAD.ptr.prototype.Open }; } $f.$24r = $24r; $f._r = _r; $f.additionalData = additionalData; $f.ciphertext = ciphertext; $f.f = f; $f.nonce = nonce; $f.out = out; $f.$s = $s; $f.$r = $r; return $f; }; prefixNonceAEAD.prototype.Open = function(out, nonce, ciphertext, additionalData) { return this.$val.Open(out, nonce, ciphertext, additionalData); }; xorNonceAEAD.ptr.prototype.NonceSize = function() { var f; f = this; return 8; }; xorNonceAEAD.prototype.NonceSize = function() { return this.$val.NonceSize(); }; xorNonceAEAD.ptr.prototype.Overhead = function() { var $24r, _r, f, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; _r = f.aead.Overhead(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: xorNonceAEAD.ptr.prototype.Overhead }; } $f.$24r = $24r; $f._r = _r; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; }; xorNonceAEAD.prototype.Overhead = function() { return this.$val.Overhead(); }; xorNonceAEAD.ptr.prototype.explicitNonceLen = function() { var f; f = this; return 0; }; xorNonceAEAD.prototype.explicitNonceLen = function() { return this.$val.explicitNonceLen(); }; xorNonceAEAD.ptr.prototype.Seal = function(out, nonce, plaintext, additionalData) { var _i, _i$1, _index, _index$1, _r, _ref, _ref$1, additionalData, b, b$1, f, i, i$1, nonce, out, plaintext, result, 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; _i = $f._i; _i$1 = $f._i$1; _index = $f._index; _index$1 = $f._index$1; _r = $f._r; _ref = $f._ref; _ref$1 = $f._ref$1; additionalData = $f.additionalData; b = $f.b; b$1 = $f.b$1; f = $f.f; i = $f.i; i$1 = $f.i$1; nonce = $f.nonce; out = $f.out; plaintext = $f.plaintext; result = $f.result; 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: f = this; _ref = nonce; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; b = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _index = 4 + i >> 0; (x$1 = f.nonceMask, ((_index < 0 || _index >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[_index] = (((x = f.nonceMask, ((_index < 0 || _index >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[_index])) ^ (b)) << 24 >>> 24))); _i++; } _r = f.aead.Seal(out, new sliceType$5(f.nonceMask), plaintext, additionalData); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } result = _r; _ref$1 = nonce; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } i$1 = _i$1; b$1 = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); _index$1 = 4 + i$1 >> 0; (x$3 = f.nonceMask, ((_index$1 < 0 || _index$1 >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[_index$1] = (((x$2 = f.nonceMask, ((_index$1 < 0 || _index$1 >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[_index$1])) ^ (b$1)) << 24 >>> 24))); _i$1++; } $s = -1; return result; /* */ } return; } if ($f === undefined) { $f = { $blk: xorNonceAEAD.ptr.prototype.Seal }; } $f._i = _i; $f._i$1 = _i$1; $f._index = _index; $f._index$1 = _index$1; $f._r = _r; $f._ref = _ref; $f._ref$1 = _ref$1; $f.additionalData = additionalData; $f.b = b; $f.b$1 = b$1; $f.f = f; $f.i = i; $f.i$1 = i$1; $f.nonce = nonce; $f.out = out; $f.plaintext = plaintext; $f.result = result; $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; }; xorNonceAEAD.prototype.Seal = function(out, nonce, plaintext, additionalData) { return this.$val.Seal(out, nonce, plaintext, additionalData); }; xorNonceAEAD.ptr.prototype.Open = function(out, nonce, ciphertext, additionalData) { var _i, _i$1, _index, _index$1, _r, _ref, _ref$1, _tuple, additionalData, b, b$1, ciphertext, err, f, i, i$1, nonce, out, result, 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; _i = $f._i; _i$1 = $f._i$1; _index = $f._index; _index$1 = $f._index$1; _r = $f._r; _ref = $f._ref; _ref$1 = $f._ref$1; _tuple = $f._tuple; additionalData = $f.additionalData; b = $f.b; b$1 = $f.b$1; ciphertext = $f.ciphertext; err = $f.err; f = $f.f; i = $f.i; i$1 = $f.i$1; nonce = $f.nonce; out = $f.out; result = $f.result; 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: f = this; _ref = nonce; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; b = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _index = 4 + i >> 0; (x$1 = f.nonceMask, ((_index < 0 || _index >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[_index] = (((x = f.nonceMask, ((_index < 0 || _index >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[_index])) ^ (b)) << 24 >>> 24))); _i++; } _r = f.aead.Open(out, new sliceType$5(f.nonceMask), ciphertext, additionalData); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; result = _tuple[0]; err = _tuple[1]; _ref$1 = nonce; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } i$1 = _i$1; b$1 = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); _index$1 = 4 + i$1 >> 0; (x$3 = f.nonceMask, ((_index$1 < 0 || _index$1 >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[_index$1] = (((x$2 = f.nonceMask, ((_index$1 < 0 || _index$1 >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[_index$1])) ^ (b$1)) << 24 >>> 24))); _i$1++; } $s = -1; return [result, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: xorNonceAEAD.ptr.prototype.Open }; } $f._i = _i; $f._i$1 = _i$1; $f._index = _index; $f._index$1 = _index$1; $f._r = _r; $f._ref = _ref; $f._ref$1 = _ref$1; $f._tuple = _tuple; $f.additionalData = additionalData; $f.b = b; $f.b$1 = b$1; $f.ciphertext = ciphertext; $f.err = err; $f.f = f; $f.i = i; $f.i$1 = i$1; $f.nonce = nonce; $f.out = out; $f.result = result; $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; }; xorNonceAEAD.prototype.Open = function(out, nonce, ciphertext, additionalData) { return this.$val.Open(out, nonce, ciphertext, additionalData); }; aeadAESGCM = function(key, noncePrefix) { var _r, _tuple, _tuple$1, aead$1, aes$1, err, key, noncePrefix, ret, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; aead$1 = $f.aead$1; aes$1 = $f.aes$1; err = $f.err; key = $f.key; noncePrefix = $f.noncePrefix; ret = $f.ret; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (!((noncePrefix.$length === 4))) { $panic(new $String("tls: internal error: wrong nonce length")); } _tuple = aes.NewCipher(key); aes$1 = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $panic(err); } _r = cipher.NewGCM(aes$1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple$1 = _r; aead$1 = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $panic(err); } ret = new prefixNonceAEAD.ptr(arrayType$1.zero(), aead$1); $copySlice(new sliceType$5(ret.nonce), noncePrefix); $s = -1; return ret; /* */ } return; } if ($f === undefined) { $f = { $blk: aeadAESGCM }; } $f._r = _r; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.aead$1 = aead$1; $f.aes$1 = aes$1; $f.err = err; $f.key = key; $f.noncePrefix = noncePrefix; $f.ret = ret; $f.$s = $s; $f.$r = $r; return $f; }; aeadAESGCMTLS13 = function(key, nonceMask) { var _r, _tuple, _tuple$1, aead$1, aes$1, err, key, nonceMask, ret, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; aead$1 = $f.aead$1; aes$1 = $f.aes$1; err = $f.err; key = $f.key; nonceMask = $f.nonceMask; ret = $f.ret; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (!((nonceMask.$length === 12))) { $panic(new $String("tls: internal error: wrong nonce length")); } _tuple = aes.NewCipher(key); aes$1 = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $panic(err); } _r = cipher.NewGCM(aes$1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple$1 = _r; aead$1 = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $panic(err); } ret = new xorNonceAEAD.ptr(arrayType$1.zero(), aead$1); $copySlice(new sliceType$5(ret.nonceMask), nonceMask); $s = -1; return ret; /* */ } return; } if ($f === undefined) { $f = { $blk: aeadAESGCMTLS13 }; } $f._r = _r; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.aead$1 = aead$1; $f.aes$1 = aes$1; $f.err = err; $f.key = key; $f.nonceMask = nonceMask; $f.ret = ret; $f.$s = $s; $f.$r = $r; return $f; }; aeadChaCha20Poly1305 = function(key, nonceMask) { var _tuple, aead$1, err, key, nonceMask, ret; if (!((nonceMask.$length === 12))) { $panic(new $String("tls: internal error: wrong nonce length")); } _tuple = chacha20poly1305.New(key); aead$1 = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $panic(err); } ret = new xorNonceAEAD.ptr(arrayType$1.zero(), aead$1); $copySlice(new sliceType$5(ret.nonceMask), nonceMask); return ret; }; cthWrapper.ptr.prototype.Size = function() { var $24r, _r, c, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; c = $f.c; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r = c.h.Size(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: cthWrapper.ptr.prototype.Size }; } $f.$24r = $24r; $f._r = _r; $f.c = c; $f.$s = $s; $f.$r = $r; return $f; }; cthWrapper.prototype.Size = function() { return this.$val.Size(); }; cthWrapper.ptr.prototype.BlockSize = function() { var $24r, _r, c, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; c = $f.c; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r = c.h.BlockSize(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: cthWrapper.ptr.prototype.BlockSize }; } $f.$24r = $24r; $f._r = _r; $f.c = c; $f.$s = $s; $f.$r = $r; return $f; }; cthWrapper.prototype.BlockSize = function() { return this.$val.BlockSize(); }; cthWrapper.ptr.prototype.Reset = function() { var c, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; c = $f.c; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; $r = c.h.Reset(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: cthWrapper.ptr.prototype.Reset }; } $f.c = c; $f.$s = $s; $f.$r = $r; return $f; }; cthWrapper.prototype.Reset = function() { return this.$val.Reset(); }; cthWrapper.ptr.prototype.Write = function(p) { var $24r, _r, c, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; c = $f.c; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r = c.h.Write(p); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: cthWrapper.ptr.prototype.Write }; } $f.$24r = $24r; $f._r = _r; $f.c = c; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; cthWrapper.prototype.Write = function(p) { return this.$val.Write(p); }; cthWrapper.ptr.prototype.Sum = function(b) { var $24r, _r, b, c, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; b = $f.b; c = $f.c; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r = c.h.ConstantTimeSum(b); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: cthWrapper.ptr.prototype.Sum }; } $f.$24r = $24r; $f._r = _r; $f.b = b; $f.c = c; $f.$s = $s; $f.$r = $r; return $f; }; cthWrapper.prototype.Sum = function(b) { return this.$val.Sum(b); }; newConstantTimeHash = function(h) { var h; return (function $b() { var $24r, _r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = h(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = new cthWrapper.ptr($assertType(_r, constantTimeHash)); $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$24r = $24r; $f._r = _r; $f.$s = $s; $f.$r = $r; return $f; }); }; tls10MAC = function(h, out, seq, header, data, extra) { var _r, _r$1, _r$2, _r$3, _r$4, data, extra, h, header, out, res, seq, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; data = $f.data; extra = $f.extra; h = $f.h; header = $f.header; out = $f.out; res = $f.res; seq = $f.seq; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = h.Reset(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r = h.Write(seq); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; _r$1 = h.Write(header); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _r$2 = h.Write(data); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; _r$3 = h.Sum(out); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } res = _r$3; /* */ if (!(extra === sliceType$5.nil)) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!(extra === sliceType$5.nil)) { */ case 6: _r$4 = h.Write(extra); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; /* } */ case 7: $s = -1; return res; /* */ } return; } if ($f === undefined) { $f = { $blk: tls10MAC }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.data = data; $f.extra = extra; $f.h = h; $f.header = header; $f.out = out; $f.res = res; $f.seq = seq; $f.$s = $s; $f.$r = $r; return $f; }; rsaKA = function(version) { var version, x; return (x = new rsaKeyAgreement.ptr(), new x.constructor.elem(x)); }; ecdheECDSAKA = function(version) { var version; return new ecdheKeyAgreement.ptr(version, false, $ifaceNil, ptrType$23.nil, sliceType$5.nil); }; ecdheRSAKA = function(version) { var version; return new ecdheKeyAgreement.ptr(version, true, $ifaceNil, ptrType$23.nil, sliceType$5.nil); }; mutualCipherSuite = function(have, want) { var _i, _ref, have, id, want; _ref = have; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } id = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (id === want) { return cipherSuiteByID(id); } _i++; } return ptrType$3.nil; }; cipherSuiteByID = function(id) { var _i, _ref, cipherSuite$1, id; _ref = cipherSuites; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } cipherSuite$1 = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (cipherSuite$1.id === id) { return cipherSuite$1; } _i++; } return ptrType$3.nil; }; mutualCipherSuiteTLS13 = function(have, want) { var _i, _ref, have, id, want; _ref = have; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } id = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (id === want) { return cipherSuiteTLS13ByID(id); } _i++; } return ptrType$2.nil; }; cipherSuiteTLS13ByID = function(id) { var _i, _ref, cipherSuite$1, id; _ref = cipherSuitesTLS13; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } cipherSuite$1 = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (cipherSuite$1.id === id) { return cipherSuite$1; } _i++; } return ptrType$2.nil; }; verifyHandshakeSignature = function(sigType, pubkey, hashFunc, signed, sig) { var $24r, $24r$1, $24r$2, $24r$3, _1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _tuple, _tuple$1, _tuple$2, _tuple$3, err, err$1, hashFunc, ok, ok$1, ok$2, ok$3, pubKey, pubKey$1, pubKey$2, pubKey$3, pubkey, sig, sigType, signOpts, signed, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; _1 = $f._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; _r$7 = $f._r$7; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; err = $f.err; err$1 = $f.err$1; hashFunc = $f.hashFunc; ok = $f.ok; ok$1 = $f.ok$1; ok$2 = $f.ok$2; ok$3 = $f.ok$3; pubKey = $f.pubKey; pubKey$1 = $f.pubKey$1; pubKey$2 = $f.pubKey$2; pubKey$3 = $f.pubKey$3; pubkey = $f.pubkey; sig = $f.sig; sigType = $f.sigType; signOpts = $f.signOpts; signed = $f.signed; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _1 = sigType; /* */ if (_1 === (227)) { $s = 2; continue; } /* */ if (_1 === (228)) { $s = 3; continue; } /* */ if (_1 === (225)) { $s = 4; continue; } /* */ if (_1 === (226)) { $s = 5; continue; } /* */ $s = 6; continue; /* if (_1 === (227)) { */ case 2: _tuple = $assertType(pubkey, ptrType$12, true); pubKey = _tuple[0]; ok = _tuple[1]; /* */ if (!ok) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!ok) { */ case 8: _r = fmt.Errorf("expected an ECDSA public key, got %T", new sliceType$6([pubkey])); /* */ $s = 10; case 10: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 11; case 11: return $24r; /* } */ case 9: _r$1 = ecdsa.VerifyASN1(pubKey, signed, sig); /* */ $s = 14; case 14: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (!_r$1) { $s = 12; continue; } /* */ $s = 13; continue; /* if (!_r$1) { */ case 12: $s = -1; return errors.New("ECDSA verification failure"); /* } */ case 13: $s = 7; continue; /* } else if (_1 === (228)) { */ case 3: _tuple$1 = $assertType(pubkey, ed25519.PublicKey, true); pubKey$1 = _tuple$1[0]; ok$1 = _tuple$1[1]; /* */ if (!ok$1) { $s = 15; continue; } /* */ $s = 16; continue; /* if (!ok$1) { */ case 15: _r$2 = fmt.Errorf("expected an Ed25519 public key, got %T", new sliceType$6([pubkey])); /* */ $s = 17; case 17: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r$1 = _r$2; $s = 18; case 18: return $24r$1; /* } */ case 16: _r$3 = ed25519.Verify(pubKey$1, signed, sig); /* */ $s = 21; case 21: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } /* */ if (!_r$3) { $s = 19; continue; } /* */ $s = 20; continue; /* if (!_r$3) { */ case 19: $s = -1; return errors.New("Ed25519 verification failure"); /* } */ case 20: $s = 7; continue; /* } else if (_1 === (225)) { */ case 4: _tuple$2 = $assertType(pubkey, ptrType$11, true); pubKey$2 = _tuple$2[0]; ok$2 = _tuple$2[1]; /* */ if (!ok$2) { $s = 22; continue; } /* */ $s = 23; continue; /* if (!ok$2) { */ case 22: _r$4 = fmt.Errorf("expected an RSA public key, got %T", new sliceType$6([pubkey])); /* */ $s = 24; case 24: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r$2 = _r$4; $s = 25; case 25: return $24r$2; /* } */ case 23: _r$5 = rsa.VerifyPKCS1v15(pubKey$2, hashFunc, signed, sig); /* */ $s = 26; case 26: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } err = _r$5; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $s = 7; continue; /* } else if (_1 === (226)) { */ case 5: _tuple$3 = $assertType(pubkey, ptrType$11, true); pubKey$3 = _tuple$3[0]; ok$3 = _tuple$3[1]; /* */ if (!ok$3) { $s = 27; continue; } /* */ $s = 28; continue; /* if (!ok$3) { */ case 27: _r$6 = fmt.Errorf("expected an RSA public key, got %T", new sliceType$6([pubkey])); /* */ $s = 29; case 29: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } $24r$3 = _r$6; $s = 30; case 30: return $24r$3; /* } */ case 28: signOpts = new rsa.PSSOptions.ptr(-1, 0); _r$7 = rsa.VerifyPSS(pubKey$3, hashFunc, signed, sig, signOpts); /* */ $s = 31; case 31: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } err$1 = _r$7; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } $s = 7; continue; /* } else { */ case 6: $s = -1; return errors.New("internal error: unknown signature type"); /* } */ case 7: case 1: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: verifyHandshakeSignature }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f._1 = _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._r$7 = _r$7; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.err = err; $f.err$1 = err$1; $f.hashFunc = hashFunc; $f.ok = ok; $f.ok$1 = ok$1; $f.ok$2 = ok$2; $f.ok$3 = ok$3; $f.pubKey = pubKey; $f.pubKey$1 = pubKey$1; $f.pubKey$2 = pubKey$2; $f.pubKey$3 = pubKey$3; $f.pubkey = pubkey; $f.sig = sig; $f.sigType = sigType; $f.signOpts = signOpts; $f.signed = signed; $f.$s = $s; $f.$r = $r; return $f; }; signedMessage = function(sigHash, context$1, transcript) { var $24r, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, b, context$1, h, sigHash, transcript, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; b = $f.b; context$1 = $f.context$1; h = $f.h; sigHash = $f.sigHash; transcript = $f.transcript; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (sigHash === directSigning) { $s = 1; continue; } /* */ $s = 2; continue; /* if (sigHash === directSigning) { */ case 1: b = new bytes.Buffer.ptr(sliceType$5.nil, 0, 0); _r = b.Write(signaturePadding); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; _r$1 = io.WriteString(b, context$1); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _r$2 = transcript.Sum(sliceType$5.nil); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = b.Write(_r$2); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $s = -1; return b.Bytes(); /* } */ case 2: _r$4 = new crypto.Hash(sigHash).New(); /* */ $s = 7; case 7: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } h = _r$4; _r$5 = h.Write(signaturePadding); /* */ $s = 8; case 8: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; _r$6 = io.WriteString(h, context$1); /* */ $s = 9; case 9: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; _r$7 = transcript.Sum(sliceType$5.nil); /* */ $s = 10; case 10: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$8 = h.Write(_r$7); /* */ $s = 11; case 11: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$8; _r$9 = h.Sum(sliceType$5.nil); /* */ $s = 12; case 12: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $24r = _r$9; $s = 13; case 13: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: signedMessage }; } $f.$24r = $24r; $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.b = b; $f.context$1 = context$1; $f.h = h; $f.sigHash = sigHash; $f.transcript = transcript; $f.$s = $s; $f.$r = $r; return $f; }; typeAndHashFromSignatureScheme = function(signatureAlgorithm) { var $24r, $24r$1, _1, _2, _r, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, err, hash$1, sigType, signatureAlgorithm, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _1 = $f._1; _2 = $f._2; _r = $f._r; _r$1 = $f._r$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; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tmp$8 = $f._tmp$8; err = $f.err; hash$1 = $f.hash$1; sigType = $f.sigType; signatureAlgorithm = $f.signatureAlgorithm; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sigType = 0; hash$1 = 0; err = $ifaceNil; _1 = signatureAlgorithm; /* */ if ((_1 === (513)) || (_1 === (1025)) || (_1 === (1281)) || (_1 === (1537))) { $s = 2; continue; } /* */ if ((_1 === (2052)) || (_1 === (2053)) || (_1 === (2054))) { $s = 3; continue; } /* */ if ((_1 === (515)) || (_1 === (1027)) || (_1 === (1283)) || (_1 === (1539))) { $s = 4; continue; } /* */ if (_1 === (2055)) { $s = 5; continue; } /* */ $s = 6; continue; /* if ((_1 === (513)) || (_1 === (1025)) || (_1 === (1281)) || (_1 === (1537))) { */ case 2: sigType = 225; $s = 7; continue; /* } else if ((_1 === (2052)) || (_1 === (2053)) || (_1 === (2054))) { */ case 3: sigType = 226; $s = 7; continue; /* } else if ((_1 === (515)) || (_1 === (1027)) || (_1 === (1283)) || (_1 === (1539))) { */ case 4: sigType = 227; $s = 7; continue; /* } else if (_1 === (2055)) { */ case 5: sigType = 228; $s = 7; continue; /* } else { */ case 6: _tmp = 0; _tmp$1 = 0; _r = fmt.Errorf("unsupported signature algorithm: %v", new sliceType$6([new SignatureScheme(signatureAlgorithm)])); /* */ $s = 8; case 8: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tmp$2 = _r; sigType = _tmp; hash$1 = _tmp$1; err = _tmp$2; $24r = [sigType, hash$1, err]; $s = 9; case 9: return $24r; /* } */ case 7: case 1: _2 = signatureAlgorithm; /* */ if ((_2 === (513)) || (_2 === (515))) { $s = 11; continue; } /* */ if ((_2 === (1025)) || (_2 === (2052)) || (_2 === (1027))) { $s = 12; continue; } /* */ if ((_2 === (1281)) || (_2 === (2053)) || (_2 === (1283))) { $s = 13; continue; } /* */ if ((_2 === (1537)) || (_2 === (2054)) || (_2 === (1539))) { $s = 14; continue; } /* */ if (_2 === (2055)) { $s = 15; continue; } /* */ $s = 16; continue; /* if ((_2 === (513)) || (_2 === (515))) { */ case 11: hash$1 = 3; $s = 17; continue; /* } else if ((_2 === (1025)) || (_2 === (2052)) || (_2 === (1027))) { */ case 12: hash$1 = 5; $s = 17; continue; /* } else if ((_2 === (1281)) || (_2 === (2053)) || (_2 === (1283))) { */ case 13: hash$1 = 6; $s = 17; continue; /* } else if ((_2 === (1537)) || (_2 === (2054)) || (_2 === (1539))) { */ case 14: hash$1 = 7; $s = 17; continue; /* } else if (_2 === (2055)) { */ case 15: hash$1 = directSigning; $s = 17; continue; /* } else { */ case 16: _tmp$3 = 0; _tmp$4 = 0; _r$1 = fmt.Errorf("unsupported signature algorithm: %v", new sliceType$6([new SignatureScheme(signatureAlgorithm)])); /* */ $s = 18; case 18: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tmp$5 = _r$1; sigType = _tmp$3; hash$1 = _tmp$4; err = _tmp$5; $24r$1 = [sigType, hash$1, err]; $s = 19; case 19: return $24r$1; /* } */ case 17: case 10: _tmp$6 = sigType; _tmp$7 = hash$1; _tmp$8 = $ifaceNil; sigType = _tmp$6; hash$1 = _tmp$7; err = _tmp$8; $s = -1; return [sigType, hash$1, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: typeAndHashFromSignatureScheme }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._1 = _1; $f._2 = _2; $f._r = _r; $f._r$1 = _r$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._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f._tmp$8 = _tmp$8; $f.err = err; $f.hash$1 = hash$1; $f.sigType = sigType; $f.signatureAlgorithm = signatureAlgorithm; $f.$s = $s; $f.$r = $r; return $f; }; legacyTypeAndHashFromPublicKey = function(pub) { var $24r, $24r$1, _r, _r$1, _ref, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, err, hash$1, pub, sigType, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$10 = $f._tmp$10; _tmp$11 = $f._tmp$11; _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; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; err = $f.err; hash$1 = $f.hash$1; pub = $f.pub; sigType = $f.sigType; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sigType = 0; hash$1 = 0; err = $ifaceNil; _ref = pub; /* */ if ($assertType(_ref, ptrType$11, true)[1]) { $s = 1; continue; } /* */ if ($assertType(_ref, ptrType$12, true)[1]) { $s = 2; continue; } /* */ if ($assertType(_ref, ed25519.PublicKey, true)[1]) { $s = 3; continue; } /* */ $s = 4; continue; /* if ($assertType(_ref, ptrType$11, true)[1]) { */ case 1: _tmp = 225; _tmp$1 = 8; _tmp$2 = $ifaceNil; sigType = _tmp; hash$1 = _tmp$1; err = _tmp$2; $s = -1; return [sigType, hash$1, err]; /* } else if ($assertType(_ref, ptrType$12, true)[1]) { */ case 2: _tmp$3 = 227; _tmp$4 = 3; _tmp$5 = $ifaceNil; sigType = _tmp$3; hash$1 = _tmp$4; err = _tmp$5; $s = -1; return [sigType, hash$1, err]; /* } else if ($assertType(_ref, ed25519.PublicKey, true)[1]) { */ case 3: _tmp$6 = 0; _tmp$7 = 0; _r = fmt.Errorf("tls: Ed25519 public keys are not supported before TLS 1.2", new sliceType$6([])); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tmp$8 = _r; sigType = _tmp$6; hash$1 = _tmp$7; err = _tmp$8; $24r = [sigType, hash$1, err]; $s = 7; case 7: return $24r; /* } else { */ case 4: _tmp$9 = 0; _tmp$10 = 0; _r$1 = fmt.Errorf("tls: unsupported public key: %T", new sliceType$6([pub])); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tmp$11 = _r$1; sigType = _tmp$9; hash$1 = _tmp$10; err = _tmp$11; $24r$1 = [sigType, hash$1, err]; $s = 9; case 9: return $24r$1; /* } */ case 5: $s = -1; return [sigType, hash$1, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: legacyTypeAndHashFromPublicKey }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$10 = _tmp$10; $f._tmp$11 = _tmp$11; $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._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f.err = err; $f.hash$1 = hash$1; $f.pub = pub; $f.sigType = sigType; $f.$s = $s; $f.$r = $r; return $f; }; signatureSchemesForCertificate = function(version, cert) { var _1, _i, _i$1, _r, _r$1, _r$2, _r$3, _ref, _ref$1, _ref$2, _tuple, candidate, cert, filteredSigAlgs, ok, priv, pub, pub$1, pub$2, pub$3, sigAlg, sigAlgs, size, version, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; _ref$1 = $f._ref$1; _ref$2 = $f._ref$2; _tuple = $f._tuple; candidate = $f.candidate; cert = $f.cert; filteredSigAlgs = $f.filteredSigAlgs; ok = $f.ok; priv = $f.priv; pub = $f.pub; pub$1 = $f.pub$1; pub$2 = $f.pub$2; pub$3 = $f.pub$3; sigAlg = $f.sigAlg; sigAlgs = $f.sigAlgs; size = $f.size; version = $f.version; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _tuple = $assertType(cert.PrivateKey, crypto.Signer, true); priv = _tuple[0]; ok = _tuple[1]; if (!ok) { $s = -1; return sliceType$7.nil; } sigAlgs = sliceType$7.nil; _r = priv.Public(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _ref = _r; /* */ if ($assertType(_ref, ptrType$12, true)[1]) { $s = 2; continue; } /* */ if ($assertType(_ref, ptrType$11, true)[1]) { $s = 3; continue; } /* */ if ($assertType(_ref, ed25519.PublicKey, true)[1]) { $s = 4; continue; } /* */ $s = 5; continue; /* switch (0) { default: if ($assertType(_ref, ptrType$12, true)[1]) { */ case 2: pub = _ref.$val; if (!((version === 772))) { sigAlgs = new sliceType$7([1027, 1283, 1539, 515]); /* break; */ $s = 6; continue; } _1 = pub.Curve; _r$1 = elliptic.P256(); /* */ $s = 13; case 13: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if ($interfaceIsEqual(_1, (_r$1))) { $s = 8; continue; } _r$2 = elliptic.P384(); /* */ $s = 14; case 14: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } /* */ if ($interfaceIsEqual(_1, (_r$2))) { $s = 9; continue; } _r$3 = elliptic.P521(); /* */ $s = 15; case 15: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } /* */ if ($interfaceIsEqual(_1, (_r$3))) { $s = 10; continue; } /* */ $s = 11; continue; /* if ($interfaceIsEqual(_1, (_r$1))) { */ case 8: sigAlgs = new sliceType$7([1027]); $s = 12; continue; /* } else if ($interfaceIsEqual(_1, (_r$2))) { */ case 9: sigAlgs = new sliceType$7([1283]); $s = 12; continue; /* } else if ($interfaceIsEqual(_1, (_r$3))) { */ case 10: sigAlgs = new sliceType$7([1539]); $s = 12; continue; /* } else { */ case 11: $s = -1; return sliceType$7.nil; /* } */ case 12: case 7: $s = 6; continue; /* } else if ($assertType(_ref, ptrType$11, true)[1]) { */ case 3: pub$1 = _ref.$val; size = pub$1.Size(); sigAlgs = $makeSlice(sliceType$7, 0, rsaSignatureSchemes.$length); _ref$1 = rsaSignatureSchemes; _i = 0; while (true) { if (!(_i < _ref$1.$length)) { break; } candidate = $clone(((_i < 0 || _i >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i]), structType); if (size >= candidate.minModulusBytes && version <= candidate.maxVersion) { sigAlgs = $append(sigAlgs, candidate.scheme); } _i++; } $s = 6; continue; /* } else if ($assertType(_ref, ed25519.PublicKey, true)[1]) { */ case 4: pub$2 = _ref.$val; sigAlgs = new sliceType$7([2055]); $s = 6; continue; /* } else { */ case 5: pub$3 = _ref; $s = -1; return sliceType$7.nil; /* } } */ case 6: if (!(cert.SupportedSignatureAlgorithms === sliceType$7.nil)) { filteredSigAlgs = sliceType$7.nil; _ref$2 = sigAlgs; _i$1 = 0; while (true) { if (!(_i$1 < _ref$2.$length)) { break; } sigAlg = ((_i$1 < 0 || _i$1 >= _ref$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$2.$array[_ref$2.$offset + _i$1]); if (isSupportedSignatureAlgorithm(sigAlg, cert.SupportedSignatureAlgorithms)) { filteredSigAlgs = $append(filteredSigAlgs, sigAlg); } _i$1++; } $s = -1; return filteredSigAlgs; } $s = -1; return sigAlgs; /* */ } return; } if ($f === undefined) { $f = { $blk: signatureSchemesForCertificate }; } $f._1 = _1; $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._ref = _ref; $f._ref$1 = _ref$1; $f._ref$2 = _ref$2; $f._tuple = _tuple; $f.candidate = candidate; $f.cert = cert; $f.filteredSigAlgs = filteredSigAlgs; $f.ok = ok; $f.priv = priv; $f.pub = pub; $f.pub$1 = pub$1; $f.pub$2 = pub$2; $f.pub$3 = pub$3; $f.sigAlg = sigAlg; $f.sigAlgs = sigAlgs; $f.size = size; $f.version = version; $f.$s = $s; $f.$r = $r; return $f; }; selectSignatureScheme = function(vers, c, peerAlgs) { var $24r, _i, _r, _r$1, _ref, c, peerAlgs, preferredAlg, supportedAlgs, vers, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; c = $f.c; peerAlgs = $f.peerAlgs; preferredAlg = $f.preferredAlg; supportedAlgs = $f.supportedAlgs; vers = $f.vers; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = signatureSchemesForCertificate(vers, c); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } supportedAlgs = _r; /* */ if (supportedAlgs.$length === 0) { $s = 2; continue; } /* */ $s = 3; continue; /* if (supportedAlgs.$length === 0) { */ case 2: _r$1 = unsupportedCertificateError(c); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = [0, _r$1]; $s = 5; case 5: return $24r; /* } */ case 3: if ((peerAlgs.$length === 0) && (vers === 771)) { peerAlgs = new sliceType$7([513, 515]); } _ref = peerAlgs; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } preferredAlg = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (isSupportedSignatureAlgorithm(preferredAlg, supportedAlgs)) { $s = -1; return [preferredAlg, $ifaceNil]; } _i++; } $s = -1; return [0, errors.New("tls: peer doesn't support any of the certificate's signature algorithms")]; /* */ } return; } if ($f === undefined) { $f = { $blk: selectSignatureScheme }; } $f.$24r = $24r; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f.c = c; $f.peerAlgs = peerAlgs; $f.preferredAlg = preferredAlg; $f.supportedAlgs = supportedAlgs; $f.vers = vers; $f.$s = $s; $f.$r = $r; return $f; }; unsupportedCertificateError = function(cert) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, $24r$5, $24r$6, $24r$7, _1, _arg, _r, _r$1, _r$10, _r$11, _r$12, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _ref$1, _tuple, cert, ok, pub, pub$1, pub$2, pub$3, signer, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; $24r$6 = $f.$24r$6; $24r$7 = $f.$24r$7; _1 = $f._1; _arg = $f._arg; _r = $f._r; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _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; _tuple = $f._tuple; cert = $f.cert; ok = $f.ok; pub = $f.pub; pub$1 = $f.pub$1; pub$2 = $f.pub$2; pub$3 = $f.pub$3; signer = $f.signer; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _ref = cert.PrivateKey; /* */ if ($assertType(_ref, rsa.PrivateKey, true)[1] || $assertType(_ref, ecdsa.PrivateKey, true)[1]) { $s = 1; continue; } /* */ if ($assertType(_ref, ptrType$51, true)[1]) { $s = 2; continue; } /* */ $s = 3; continue; /* if ($assertType(_ref, rsa.PrivateKey, true)[1] || $assertType(_ref, ecdsa.PrivateKey, true)[1]) { */ case 1: _r = fmt.Errorf("tls: unsupported certificate: private key is %T, expected *%T", new sliceType$6([cert.PrivateKey, cert.PrivateKey])); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 5; case 5: return $24r; /* } else if ($assertType(_ref, ptrType$51, true)[1]) { */ case 2: _r$1 = fmt.Errorf("tls: unsupported certificate: private key is *ed25519.PrivateKey, expected ed25519.PrivateKey", new sliceType$6([])); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r$1 = _r$1; $s = 7; case 7: return $24r$1; /* } */ case 3: _tuple = $assertType(cert.PrivateKey, crypto.Signer, true); signer = _tuple[0]; ok = _tuple[1]; /* */ if (!ok) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!ok) { */ case 8: _r$2 = fmt.Errorf("tls: certificate private key (%T) does not implement crypto.Signer", new sliceType$6([cert.PrivateKey])); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r$2 = _r$2; $s = 11; case 11: return $24r$2; /* } */ case 9: _r$3 = signer.Public(); /* */ $s = 12; case 12: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _ref$1 = _r$3; /* */ if ($assertType(_ref$1, ptrType$12, true)[1]) { $s = 13; continue; } /* */ if ($assertType(_ref$1, ptrType$11, true)[1]) { $s = 14; continue; } /* */ if ($assertType(_ref$1, ed25519.PublicKey, true)[1]) { $s = 15; continue; } /* */ $s = 16; continue; /* if ($assertType(_ref$1, ptrType$12, true)[1]) { */ case 13: pub = _ref$1.$val; _1 = pub.Curve; _r$4 = elliptic.P256(); /* */ $s = 24; case 24: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } /* */ if ($interfaceIsEqual(_1, (_r$4))) { $s = 19; continue; } _r$5 = elliptic.P384(); /* */ $s = 25; case 25: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } /* */ if ($interfaceIsEqual(_1, (_r$5))) { $s = 20; continue; } _r$6 = elliptic.P521(); /* */ $s = 26; case 26: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } /* */ if ($interfaceIsEqual(_1, (_r$6))) { $s = 21; continue; } /* */ $s = 22; continue; /* if ($interfaceIsEqual(_1, (_r$4))) { */ case 19: $s = 23; continue; /* } else if ($interfaceIsEqual(_1, (_r$5))) { */ case 20: $s = 23; continue; /* } else if ($interfaceIsEqual(_1, (_r$6))) { */ case 21: $s = 23; continue; /* } else { */ case 22: _r$7 = pub.Curve.Params(); /* */ $s = 27; case 27: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _arg = new $String(_r$7.Name); _r$8 = fmt.Errorf("tls: unsupported certificate curve (%s)", new sliceType$6([_arg])); /* */ $s = 28; case 28: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } $24r$3 = _r$8; $s = 29; case 29: return $24r$3; /* } */ case 23: case 18: $s = 17; continue; /* } else if ($assertType(_ref$1, ptrType$11, true)[1]) { */ case 14: pub$1 = _ref$1.$val; _r$9 = fmt.Errorf("tls: certificate RSA key size too small for supported signature algorithms", new sliceType$6([])); /* */ $s = 30; case 30: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } $24r$4 = _r$9; $s = 31; case 31: return $24r$4; /* } else if ($assertType(_ref$1, ed25519.PublicKey, true)[1]) { */ case 15: pub$2 = _ref$1.$val; $s = 17; continue; /* } else { */ case 16: pub$3 = _ref$1; _r$10 = fmt.Errorf("tls: unsupported certificate key (%T)", new sliceType$6([pub$3])); /* */ $s = 32; case 32: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } $24r$5 = _r$10; $s = 33; case 33: return $24r$5; /* } */ case 17: /* */ if (!(cert.SupportedSignatureAlgorithms === sliceType$7.nil)) { $s = 34; continue; } /* */ $s = 35; continue; /* if (!(cert.SupportedSignatureAlgorithms === sliceType$7.nil)) { */ case 34: _r$11 = fmt.Errorf("tls: peer doesn't support the certificate custom signature algorithms", new sliceType$6([])); /* */ $s = 36; case 36: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } $24r$6 = _r$11; $s = 37; case 37: return $24r$6; /* } */ case 35: _r$12 = fmt.Errorf("tls: internal error: unsupported key (%T)", new sliceType$6([cert.PrivateKey])); /* */ $s = 38; case 38: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } $24r$7 = _r$12; $s = 39; case 39: return $24r$7; /* */ } return; } if ($f === undefined) { $f = { $blk: unsupportedCertificateError }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f.$24r$6 = $24r$6; $f.$24r$7 = $24r$7; $f._1 = _1; $f._arg = _arg; $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$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._tuple = _tuple; $f.cert = cert; $f.ok = ok; $f.pub = pub; $f.pub$1 = pub$1; $f.pub$2 = pub$2; $f.pub$3 = pub$3; $f.signer = signer; $f.$s = $s; $f.$r = $r; return $f; }; alert.prototype.String = function() { var _entry, _tuple, e, ok, s; e = this.$val; _tuple = (_entry = alertText[alert.keyFor(e)], _entry !== undefined ? [_entry.v, true] : ["", false]); s = _tuple[0]; ok = _tuple[1]; if (ok) { return "tls: " + s; } return "tls: alert(" + strconv.Itoa(((e >> 0))) + ")"; }; $ptrType(alert).prototype.String = function() { return new alert(this.$get()).String(); }; alert.prototype.Error = function() { var e; e = this.$val; return new alert(e).String(); }; $ptrType(alert).prototype.Error = function() { return new alert(this.$get()).Error(); }; ptrType$52.methods = [{prop: "Accept", name: "Accept", pkg: "", typ: $funcType([], [net.Conn, $error], false)}]; ptrType$53.methods = [{prop: "Dial", name: "Dial", pkg: "", typ: $funcType([$String, $String], [net.Conn, $error], false)}, {prop: "netDialer", name: "netDialer", pkg: "crypto/tls", typ: $funcType([], [ptrType$9], false)}, {prop: "DialContext", name: "DialContext", pkg: "", typ: $funcType([context.Context, $String, $String], [net.Conn, $error], false)}]; ptrType$32.methods = [{prop: "marshal", name: "marshal", pkg: "crypto/tls", typ: $funcType([], [sliceType$5], false)}, {prop: "unmarshal", name: "unmarshal", pkg: "crypto/tls", typ: $funcType([sliceType$5], [$Bool], false)}]; ptrType$54.methods = [{prop: "marshal", name: "marshal", pkg: "crypto/tls", typ: $funcType([], [sliceType$5], false)}, {prop: "unmarshal", name: "unmarshal", pkg: "crypto/tls", typ: $funcType([sliceType$5], [$Bool], false)}]; finishedHash.methods = [{prop: "Sum", name: "Sum", pkg: "", typ: $funcType([], [sliceType$5], false)}, {prop: "clientSum", name: "clientSum", pkg: "crypto/tls", typ: $funcType([sliceType$5], [sliceType$5], false)}, {prop: "serverSum", name: "serverSum", pkg: "crypto/tls", typ: $funcType([sliceType$5], [sliceType$5], false)}, {prop: "hashForClientCertificate", name: "hashForClientCertificate", pkg: "crypto/tls", typ: $funcType([$Uint8, crypto.Hash, sliceType$5], [sliceType$5], false)}]; ptrType$55.methods = [{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$5], [$Int, $error], false)}, {prop: "discardHandshakeBuffer", name: "discardHandshakeBuffer", pkg: "crypto/tls", typ: $funcType([], [], false)}]; ptrType$56.methods = [{prop: "CurveID", name: "CurveID", pkg: "", typ: $funcType([], [CurveID], false)}, {prop: "PublicKey", name: "PublicKey", pkg: "", typ: $funcType([], [sliceType$5], false)}, {prop: "SharedKey", name: "SharedKey", pkg: "", typ: $funcType([sliceType$5], [sliceType$5], false)}]; ptrType$57.methods = [{prop: "CurveID", name: "CurveID", pkg: "", typ: $funcType([], [CurveID], false)}, {prop: "PublicKey", name: "PublicKey", pkg: "", typ: $funcType([], [sliceType$5], false)}, {prop: "SharedKey", name: "SharedKey", pkg: "", typ: $funcType([sliceType$5], [sliceType$5], false)}]; rsaKeyAgreement.methods = [{prop: "generateServerKeyExchange", name: "generateServerKeyExchange", pkg: "crypto/tls", typ: $funcType([ptrType$4, ptrType$31, ptrType$26, ptrType$30], [ptrType$22, $error], false)}, {prop: "processClientKeyExchange", name: "processClientKeyExchange", pkg: "crypto/tls", typ: $funcType([ptrType$4, ptrType$31, ptrType$23, $Uint16], [sliceType$5, $error], false)}, {prop: "processServerKeyExchange", name: "processServerKeyExchange", pkg: "crypto/tls", typ: $funcType([ptrType$4, ptrType$26, ptrType$30, ptrType$5, ptrType$22], [$error], false)}, {prop: "generateClientKeyExchange", name: "generateClientKeyExchange", pkg: "crypto/tls", typ: $funcType([ptrType$4, ptrType$26, ptrType$5], [sliceType$5, ptrType$23, $error], false)}]; ptrType$58.methods = [{prop: "generateServerKeyExchange", name: "generateServerKeyExchange", pkg: "crypto/tls", typ: $funcType([ptrType$4, ptrType$31, ptrType$26, ptrType$30], [ptrType$22, $error], false)}, {prop: "processClientKeyExchange", name: "processClientKeyExchange", pkg: "crypto/tls", typ: $funcType([ptrType$4, ptrType$31, ptrType$23, $Uint16], [sliceType$5, $error], false)}, {prop: "processServerKeyExchange", name: "processServerKeyExchange", pkg: "crypto/tls", typ: $funcType([ptrType$4, ptrType$26, ptrType$30, ptrType$5, ptrType$22], [$error], false)}, {prop: "generateClientKeyExchange", name: "generateClientKeyExchange", pkg: "crypto/tls", typ: $funcType([ptrType$4, ptrType$26, ptrType$5], [sliceType$5, ptrType$23, $error], false)}]; ptrType$59.methods = [{prop: "handshake", name: "handshake", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "processClientHello", name: "processClientHello", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "checkForResumption", name: "checkForResumption", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "pickCertificate", name: "pickCertificate", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "sendDummyChangeCipherSpec", name: "sendDummyChangeCipherSpec", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "doHelloRetryRequest", name: "doHelloRetryRequest", pkg: "crypto/tls", typ: $funcType([CurveID], [$error], false)}, {prop: "sendServerParameters", name: "sendServerParameters", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "requestClientCert", name: "requestClientCert", pkg: "crypto/tls", typ: $funcType([], [$Bool], false)}, {prop: "sendServerCertificate", name: "sendServerCertificate", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "sendServerFinished", name: "sendServerFinished", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "shouldSendSessionTickets", name: "shouldSendSessionTickets", pkg: "crypto/tls", typ: $funcType([], [$Bool], false)}, {prop: "sendSessionTickets", name: "sendSessionTickets", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "readClientCertificate", name: "readClientCertificate", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "readClientFinished", name: "readClientFinished", pkg: "crypto/tls", typ: $funcType([], [$error], false)}]; ptrType$60.methods = [{prop: "handshake", name: "handshake", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "processClientHello", name: "processClientHello", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "pickCipherSuite", name: "pickCipherSuite", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "cipherSuiteOk", name: "cipherSuiteOk", pkg: "crypto/tls", typ: $funcType([ptrType$3], [$Bool], false)}, {prop: "checkForResumption", name: "checkForResumption", pkg: "crypto/tls", typ: $funcType([], [$Bool], false)}, {prop: "doResumeHandshake", name: "doResumeHandshake", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "doFullHandshake", name: "doFullHandshake", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "establishKeys", name: "establishKeys", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "readFinished", name: "readFinished", pkg: "crypto/tls", typ: $funcType([sliceType$5], [$error], false)}, {prop: "sendSessionTicket", name: "sendSessionTicket", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "sendFinished", name: "sendFinished", pkg: "crypto/tls", typ: $funcType([sliceType$5], [$error], false)}]; marshalingFunction.methods = [{prop: "Marshal", name: "Marshal", pkg: "", typ: $funcType([ptrType$15], [$error], false)}]; ptrType$26.methods = [{prop: "marshal", name: "marshal", pkg: "crypto/tls", typ: $funcType([], [sliceType$5], false)}, {prop: "marshalWithoutBinders", name: "marshalWithoutBinders", pkg: "crypto/tls", typ: $funcType([], [sliceType$5], false)}, {prop: "updateBinders", name: "updateBinders", pkg: "crypto/tls", typ: $funcType([sliceType$11], [], false)}, {prop: "unmarshal", name: "unmarshal", pkg: "crypto/tls", typ: $funcType([sliceType$5], [$Bool], false)}]; ptrType$30.methods = [{prop: "marshal", name: "marshal", pkg: "crypto/tls", typ: $funcType([], [sliceType$5], false)}, {prop: "unmarshal", name: "unmarshal", pkg: "crypto/tls", typ: $funcType([sliceType$5], [$Bool], false)}]; ptrType$38.methods = [{prop: "marshal", name: "marshal", pkg: "crypto/tls", typ: $funcType([], [sliceType$5], false)}, {prop: "unmarshal", name: "unmarshal", pkg: "crypto/tls", typ: $funcType([sliceType$5], [$Bool], false)}]; ptrType$61.methods = [{prop: "marshal", name: "marshal", pkg: "crypto/tls", typ: $funcType([], [sliceType$5], false)}, {prop: "unmarshal", name: "unmarshal", pkg: "crypto/tls", typ: $funcType([sliceType$5], [$Bool], false)}]; ptrType$46.methods = [{prop: "marshal", name: "marshal", pkg: "crypto/tls", typ: $funcType([], [sliceType$5], false)}, {prop: "unmarshal", name: "unmarshal", pkg: "crypto/tls", typ: $funcType([sliceType$5], [$Bool], false)}]; ptrType$45.methods = [{prop: "marshal", name: "marshal", pkg: "crypto/tls", typ: $funcType([], [sliceType$5], false)}, {prop: "unmarshal", name: "unmarshal", pkg: "crypto/tls", typ: $funcType([sliceType$5], [$Bool], false)}]; ptrType$39.methods = [{prop: "marshal", name: "marshal", pkg: "crypto/tls", typ: $funcType([], [sliceType$5], false)}, {prop: "unmarshal", name: "unmarshal", pkg: "crypto/tls", typ: $funcType([sliceType$5], [$Bool], false)}]; ptrType$34.methods = [{prop: "marshal", name: "marshal", pkg: "crypto/tls", typ: $funcType([], [sliceType$5], false)}, {prop: "unmarshal", name: "unmarshal", pkg: "crypto/tls", typ: $funcType([sliceType$5], [$Bool], false)}]; ptrType$27.methods = [{prop: "marshal", name: "marshal", pkg: "crypto/tls", typ: $funcType([], [sliceType$5], false)}, {prop: "unmarshal", name: "unmarshal", pkg: "crypto/tls", typ: $funcType([sliceType$5], [$Bool], false)}]; ptrType$22.methods = [{prop: "marshal", name: "marshal", pkg: "crypto/tls", typ: $funcType([], [sliceType$5], false)}, {prop: "unmarshal", name: "unmarshal", pkg: "crypto/tls", typ: $funcType([sliceType$5], [$Bool], false)}]; ptrType$40.methods = [{prop: "marshal", name: "marshal", pkg: "crypto/tls", typ: $funcType([], [sliceType$5], false)}, {prop: "unmarshal", name: "unmarshal", pkg: "crypto/tls", typ: $funcType([sliceType$5], [$Bool], false)}]; ptrType$41.methods = [{prop: "marshal", name: "marshal", pkg: "crypto/tls", typ: $funcType([], [sliceType$5], false)}, {prop: "unmarshal", name: "unmarshal", pkg: "crypto/tls", typ: $funcType([sliceType$5], [$Bool], false)}]; ptrType$23.methods = [{prop: "marshal", name: "marshal", pkg: "crypto/tls", typ: $funcType([], [sliceType$5], false)}, {prop: "unmarshal", name: "unmarshal", pkg: "crypto/tls", typ: $funcType([sliceType$5], [$Bool], false)}]; ptrType$29.methods = [{prop: "marshal", name: "marshal", pkg: "crypto/tls", typ: $funcType([], [sliceType$5], false)}, {prop: "unmarshal", name: "unmarshal", pkg: "crypto/tls", typ: $funcType([sliceType$5], [$Bool], false)}]; ptrType$33.methods = [{prop: "marshal", name: "marshal", pkg: "crypto/tls", typ: $funcType([], [sliceType$5], false)}, {prop: "unmarshal", name: "unmarshal", pkg: "crypto/tls", typ: $funcType([sliceType$5], [$Bool], false)}]; ptrType$28.methods = [{prop: "marshal", name: "marshal", pkg: "crypto/tls", typ: $funcType([], [sliceType$5], false)}, {prop: "unmarshal", name: "unmarshal", pkg: "crypto/tls", typ: $funcType([sliceType$5], [$Bool], false)}]; ptrType$42.methods = [{prop: "marshal", name: "marshal", pkg: "crypto/tls", typ: $funcType([], [sliceType$5], false)}, {prop: "unmarshal", name: "unmarshal", pkg: "crypto/tls", typ: $funcType([sliceType$5], [$Bool], false)}]; ptrType$44.methods = [{prop: "marshal", name: "marshal", pkg: "crypto/tls", typ: $funcType([], [sliceType$5], false)}, {prop: "unmarshal", name: "unmarshal", pkg: "crypto/tls", typ: $funcType([sliceType$5], [$Bool], false)}]; ptrType$62.methods = [{prop: "handshake", name: "handshake", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "checkServerHelloOrHRR", name: "checkServerHelloOrHRR", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "sendDummyChangeCipherSpec", name: "sendDummyChangeCipherSpec", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "processHelloRetryRequest", name: "processHelloRetryRequest", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "processServerHello", name: "processServerHello", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "establishHandshakeKeys", name: "establishHandshakeKeys", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "readServerParameters", name: "readServerParameters", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "readServerCertificate", name: "readServerCertificate", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "readServerFinished", name: "readServerFinished", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "sendClientCertificate", name: "sendClientCertificate", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "sendClientFinished", name: "sendClientFinished", pkg: "crypto/tls", typ: $funcType([], [$error], false)}]; ptrType$63.methods = [{prop: "handshake", name: "handshake", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "pickCipherSuite", name: "pickCipherSuite", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "doFullHandshake", name: "doFullHandshake", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "establishKeys", name: "establishKeys", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "serverResumedSession", name: "serverResumedSession", pkg: "crypto/tls", typ: $funcType([], [$Bool], false)}, {prop: "processServerHello", name: "processServerHello", pkg: "crypto/tls", typ: $funcType([], [$Bool, $error], false)}, {prop: "readFinished", name: "readFinished", pkg: "crypto/tls", typ: $funcType([sliceType$5], [$error], false)}, {prop: "readSessionTicket", name: "readSessionTicket", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "sendFinished", name: "sendFinished", pkg: "crypto/tls", typ: $funcType([sliceType$5], [$error], false)}]; ptrType$6.methods = [{prop: "encryptTicket", name: "encryptTicket", pkg: "crypto/tls", typ: $funcType([sliceType$5], [sliceType$5, $error], false)}, {prop: "decryptTicket", name: "decryptTicket", pkg: "crypto/tls", typ: $funcType([sliceType$5], [sliceType$5, $Bool], false)}, {prop: "serverHandshake", name: "serverHandshake", pkg: "crypto/tls", typ: $funcType([context.Context], [$error], false)}, {prop: "readClientHello", name: "readClientHello", pkg: "crypto/tls", typ: $funcType([context.Context], [ptrType$26, $error], false)}, {prop: "processCertsFromClient", name: "processCertsFromClient", pkg: "crypto/tls", typ: $funcType([Certificate], [$error], false)}, {prop: "handleNewSessionTicket", name: "handleNewSessionTicket", pkg: "crypto/tls", typ: $funcType([ptrType$45], [$error], false)}, {prop: "makeClientHello", name: "makeClientHello", pkg: "crypto/tls", typ: $funcType([], [ptrType$26, ecdheParameters, $error], false)}, {prop: "clientHandshake", name: "clientHandshake", pkg: "crypto/tls", typ: $funcType([context.Context], [$error], false)}, {prop: "loadSession", name: "loadSession", pkg: "crypto/tls", typ: $funcType([ptrType$26], [$String, ptrType$37, sliceType$5, sliceType$5], false)}, {prop: "pickTLSVersion", name: "pickTLSVersion", pkg: "crypto/tls", typ: $funcType([ptrType$30], [$error], false)}, {prop: "verifyServerCertificate", name: "verifyServerCertificate", pkg: "crypto/tls", typ: $funcType([sliceType$11], [$error], false)}, {prop: "getClientCertificate", name: "getClientCertificate", pkg: "crypto/tls", typ: $funcType([ptrType$64], [ptrType$31, $error], false)}, {prop: "LocalAddr", name: "LocalAddr", pkg: "", typ: $funcType([], [net.Addr], false)}, {prop: "RemoteAddr", name: "RemoteAddr", pkg: "", typ: $funcType([], [net.Addr], false)}, {prop: "SetDeadline", name: "SetDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "SetReadDeadline", name: "SetReadDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "SetWriteDeadline", name: "SetWriteDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "newRecordHeaderError", name: "newRecordHeaderError", pkg: "crypto/tls", typ: $funcType([net.Conn, $String], [RecordHeaderError], false)}, {prop: "readRecord", name: "readRecord", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "readChangeCipherSpec", name: "readChangeCipherSpec", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "readRecordOrCCS", name: "readRecordOrCCS", pkg: "crypto/tls", typ: $funcType([$Bool], [$error], false)}, {prop: "retryReadRecord", name: "retryReadRecord", pkg: "crypto/tls", typ: $funcType([$Bool], [$error], false)}, {prop: "readFromUntil", name: "readFromUntil", pkg: "crypto/tls", typ: $funcType([io.Reader, $Int], [$error], false)}, {prop: "sendAlertLocked", name: "sendAlertLocked", pkg: "crypto/tls", typ: $funcType([alert], [$error], false)}, {prop: "sendAlert", name: "sendAlert", pkg: "crypto/tls", typ: $funcType([alert], [$error], false)}, {prop: "maxPayloadSizeForWrite", name: "maxPayloadSizeForWrite", pkg: "crypto/tls", typ: $funcType([recordType], [$Int], false)}, {prop: "write", name: "write", pkg: "crypto/tls", typ: $funcType([sliceType$5], [$Int, $error], false)}, {prop: "flush", name: "flush", pkg: "crypto/tls", typ: $funcType([], [$Int, $error], false)}, {prop: "writeRecordLocked", name: "writeRecordLocked", pkg: "crypto/tls", typ: $funcType([recordType, sliceType$5], [$Int, $error], false)}, {prop: "writeRecord", name: "writeRecord", pkg: "crypto/tls", typ: $funcType([recordType, sliceType$5], [$Int, $error], false)}, {prop: "readHandshake", name: "readHandshake", pkg: "crypto/tls", typ: $funcType([], [$emptyInterface, $error], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$5], [$Int, $error], false)}, {prop: "handleRenegotiation", name: "handleRenegotiation", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "handlePostHandshakeMessage", name: "handlePostHandshakeMessage", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "handleKeyUpdate", name: "handleKeyUpdate", pkg: "crypto/tls", typ: $funcType([ptrType$46], [$error], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$5], [$Int, $error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "CloseWrite", name: "CloseWrite", pkg: "", typ: $funcType([], [$error], false)}, {prop: "closeNotify", name: "closeNotify", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "Handshake", name: "Handshake", pkg: "", typ: $funcType([], [$error], false)}, {prop: "HandshakeContext", name: "HandshakeContext", pkg: "", typ: $funcType([context.Context], [$error], false)}, {prop: "handshakeContext", name: "handshakeContext", pkg: "crypto/tls", typ: $funcType([context.Context], [$error], false)}, {prop: "ConnectionState", name: "ConnectionState", pkg: "", typ: $funcType([], [ConnectionState], false)}, {prop: "connectionStateLocked", name: "connectionStateLocked", pkg: "crypto/tls", typ: $funcType([], [ConnectionState], false)}, {prop: "OCSPResponse", name: "OCSPResponse", pkg: "", typ: $funcType([], [sliceType$5], false)}, {prop: "VerifyHostname", name: "VerifyHostname", pkg: "", typ: $funcType([$String], [$error], false)}, {prop: "handshakeComplete", name: "handshakeComplete", pkg: "crypto/tls", typ: $funcType([], [$Bool], false)}]; ptrType$65.methods = [{prop: "setErrorLocked", name: "setErrorLocked", pkg: "crypto/tls", typ: $funcType([$error], [$error], false)}, {prop: "prepareCipherSpec", name: "prepareCipherSpec", pkg: "crypto/tls", typ: $funcType([$Uint16, $emptyInterface, hash.Hash], [], false)}, {prop: "changeCipherSpec", name: "changeCipherSpec", pkg: "crypto/tls", typ: $funcType([], [$error], false)}, {prop: "setTrafficSecret", name: "setTrafficSecret", pkg: "crypto/tls", typ: $funcType([ptrType$2, sliceType$5], [], false)}, {prop: "incSeq", name: "incSeq", pkg: "crypto/tls", typ: $funcType([], [], false)}, {prop: "explicitNonceLen", name: "explicitNonceLen", pkg: "crypto/tls", typ: $funcType([], [$Int], false)}, {prop: "decrypt", name: "decrypt", pkg: "crypto/tls", typ: $funcType([sliceType$5], [sliceType$5, recordType, $error], false)}, {prop: "encrypt", name: "encrypt", pkg: "crypto/tls", typ: $funcType([sliceType$5, sliceType$5, io.Reader], [sliceType$5, $error], false)}]; ptrType$66.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Unwrap", name: "Unwrap", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Temporary", name: "Temporary", pkg: "", typ: $funcType([], [$Bool], false)}]; RecordHeaderError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$67.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$5], [$Int, $error], false)}]; CurveID.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$68.methods = [{prop: "ExportKeyingMaterial", name: "ExportKeyingMaterial", pkg: "", typ: $funcType([$String, sliceType$5, $Int], [sliceType$5, $error], false)}]; ClientAuthType.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; SignatureScheme.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$69.methods = [{prop: "Context", name: "Context", pkg: "", typ: $funcType([], [context.Context], false)}, {prop: "SupportsCertificate", name: "SupportsCertificate", pkg: "", typ: $funcType([ptrType$31], [$error], false)}]; ptrType$64.methods = [{prop: "Context", name: "Context", pkg: "", typ: $funcType([], [context.Context], false)}, {prop: "SupportsCertificate", name: "SupportsCertificate", pkg: "", typ: $funcType([ptrType$31], [$error], false)}]; ptrType$4.methods = [{prop: "ticketKeyFromBytes", name: "ticketKeyFromBytes", pkg: "crypto/tls", typ: $funcType([arrayType], [ticketKey], false)}, {prop: "Clone", name: "Clone", pkg: "", typ: $funcType([], [ptrType$4], false)}, {prop: "initLegacySessionTicketKeyRLocked", name: "initLegacySessionTicketKeyRLocked", pkg: "crypto/tls", typ: $funcType([], [], false)}, {prop: "ticketKeys", name: "ticketKeys", pkg: "crypto/tls", typ: $funcType([ptrType$4], [sliceType$4], false)}, {prop: "SetSessionTicketKeys", name: "SetSessionTicketKeys", pkg: "", typ: $funcType([sliceType$18], [], false)}, {prop: "rand", name: "rand", pkg: "crypto/tls", typ: $funcType([], [io.Reader], false)}, {prop: "time", name: "time", pkg: "crypto/tls", typ: $funcType([], [time.Time], false)}, {prop: "cipherSuites", name: "cipherSuites", pkg: "crypto/tls", typ: $funcType([], [sliceType$2], false)}, {prop: "supportedVersions", name: "supportedVersions", pkg: "crypto/tls", typ: $funcType([], [sliceType$2], false)}, {prop: "maxSupportedVersion", name: "maxSupportedVersion", pkg: "crypto/tls", typ: $funcType([], [$Uint16], false)}, {prop: "curvePreferences", name: "curvePreferences", pkg: "crypto/tls", typ: $funcType([], [sliceType$3], false)}, {prop: "supportsCurve", name: "supportsCurve", pkg: "crypto/tls", typ: $funcType([CurveID], [$Bool], false)}, {prop: "mutualVersion", name: "mutualVersion", pkg: "crypto/tls", typ: $funcType([sliceType$2], [$Uint16, $Bool], false)}, {prop: "getCertificate", name: "getCertificate", pkg: "crypto/tls", typ: $funcType([ptrType$69], [ptrType$31, $error], false)}, {prop: "BuildNameToCertificate", name: "BuildNameToCertificate", pkg: "", typ: $funcType([], [], false)}, {prop: "writeKeyLog", name: "writeKeyLog", pkg: "crypto/tls", typ: $funcType([$String, sliceType$5, sliceType$5], [$error], false)}]; ptrType$31.methods = [{prop: "leaf", name: "leaf", pkg: "crypto/tls", typ: $funcType([], [ptrType$5, $error], false)}]; ptrType$2.methods = [{prop: "expandLabel", name: "expandLabel", pkg: "crypto/tls", typ: $funcType([sliceType$5, $String, sliceType$5, $Int], [sliceType$5], false)}, {prop: "deriveSecret", name: "deriveSecret", pkg: "crypto/tls", typ: $funcType([sliceType$5, $String, hash.Hash], [sliceType$5], false)}, {prop: "extract", name: "extract", pkg: "crypto/tls", typ: $funcType([sliceType$5, sliceType$5], [sliceType$5], false)}, {prop: "nextTrafficSecret", name: "nextTrafficSecret", pkg: "crypto/tls", typ: $funcType([sliceType$5], [sliceType$5], false)}, {prop: "trafficKey", name: "trafficKey", pkg: "crypto/tls", typ: $funcType([sliceType$5], [sliceType$5, sliceType$5], false)}, {prop: "finishedHash", name: "finishedHash", pkg: "crypto/tls", typ: $funcType([sliceType$5, hash.Hash], [sliceType$5], false)}, {prop: "exportKeyingMaterial", name: "exportKeyingMaterial", pkg: "crypto/tls", typ: $funcType([sliceType$5, hash.Hash], [funcType$2], false)}]; ptrType$71.methods = [{prop: "NonceSize", name: "NonceSize", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Overhead", name: "Overhead", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "explicitNonceLen", name: "explicitNonceLen", pkg: "crypto/tls", typ: $funcType([], [$Int], false)}, {prop: "Seal", name: "Seal", pkg: "", typ: $funcType([sliceType$5, sliceType$5, sliceType$5, sliceType$5], [sliceType$5], false)}, {prop: "Open", name: "Open", pkg: "", typ: $funcType([sliceType$5, sliceType$5, sliceType$5, sliceType$5], [sliceType$5, $error], false)}]; ptrType$72.methods = [{prop: "NonceSize", name: "NonceSize", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Overhead", name: "Overhead", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "explicitNonceLen", name: "explicitNonceLen", pkg: "crypto/tls", typ: $funcType([], [$Int], false)}, {prop: "Seal", name: "Seal", pkg: "", typ: $funcType([sliceType$5, sliceType$5, sliceType$5, sliceType$5], [sliceType$5], false)}, {prop: "Open", name: "Open", pkg: "", typ: $funcType([sliceType$5, sliceType$5, sliceType$5, sliceType$5], [sliceType$5, $error], false)}]; ptrType$73.methods = [{prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "BlockSize", name: "BlockSize", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Reset", name: "Reset", pkg: "", typ: $funcType([], [], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$5], [$Int, $error], false)}, {prop: "Sum", name: "Sum", pkg: "", typ: $funcType([sliceType$5], [sliceType$5], false)}]; alert.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; listener.init("crypto/tls", [{prop: "Listener", name: "Listener", embedded: true, exported: true, typ: net.Listener, tag: ""}, {prop: "config", name: "config", embedded: false, exported: false, typ: ptrType$4, tag: ""}]); Dialer.init("", [{prop: "NetDialer", name: "NetDialer", embedded: false, exported: true, typ: ptrType$9, tag: ""}, {prop: "Config", name: "Config", embedded: false, exported: true, typ: ptrType$4, tag: ""}]); sessionState.init("crypto/tls", [{prop: "vers", name: "vers", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "cipherSuite", name: "cipherSuite", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "createdAt", name: "createdAt", embedded: false, exported: false, typ: $Uint64, tag: ""}, {prop: "masterSecret", name: "masterSecret", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "certificates", name: "certificates", embedded: false, exported: false, typ: sliceType$11, tag: ""}, {prop: "usedOldKey", name: "usedOldKey", embedded: false, exported: false, typ: $Bool, tag: ""}]); sessionStateTLS13.init("crypto/tls", [{prop: "cipherSuite", name: "cipherSuite", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "createdAt", name: "createdAt", embedded: false, exported: false, typ: $Uint64, tag: ""}, {prop: "resumptionSecret", name: "resumptionSecret", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "certificate", name: "certificate", embedded: false, exported: false, typ: Certificate, tag: ""}]); finishedHash.init("crypto/tls", [{prop: "client", name: "client", embedded: false, exported: false, typ: hash.Hash, tag: ""}, {prop: "server", name: "server", embedded: false, exported: false, typ: hash.Hash, tag: ""}, {prop: "clientMD5", name: "clientMD5", embedded: false, exported: false, typ: hash.Hash, tag: ""}, {prop: "serverMD5", name: "serverMD5", embedded: false, exported: false, typ: hash.Hash, tag: ""}, {prop: "buffer", name: "buffer", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "version", name: "version", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "prf", name: "prf", embedded: false, exported: false, typ: funcType, tag: ""}]); ecdheParameters.init([{prop: "CurveID", name: "CurveID", pkg: "", typ: $funcType([], [CurveID], false)}, {prop: "PublicKey", name: "PublicKey", pkg: "", typ: $funcType([], [sliceType$5], false)}, {prop: "SharedKey", name: "SharedKey", pkg: "", typ: $funcType([sliceType$5], [sliceType$5], false)}]); nistParameters.init("crypto/tls", [{prop: "privateKey", name: "privateKey", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "x", name: "x", embedded: false, exported: false, typ: ptrType$21, tag: ""}, {prop: "y", name: "y", embedded: false, exported: false, typ: ptrType$21, tag: ""}, {prop: "curveID", name: "curveID", embedded: false, exported: false, typ: CurveID, tag: ""}]); x25519Parameters.init("crypto/tls", [{prop: "privateKey", name: "privateKey", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "publicKey", name: "publicKey", embedded: false, exported: false, typ: sliceType$5, tag: ""}]); keyAgreement.init([{prop: "generateClientKeyExchange", name: "generateClientKeyExchange", pkg: "crypto/tls", typ: $funcType([ptrType$4, ptrType$26, ptrType$5], [sliceType$5, ptrType$23, $error], false)}, {prop: "generateServerKeyExchange", name: "generateServerKeyExchange", pkg: "crypto/tls", typ: $funcType([ptrType$4, ptrType$31, ptrType$26, ptrType$30], [ptrType$22, $error], false)}, {prop: "processClientKeyExchange", name: "processClientKeyExchange", pkg: "crypto/tls", typ: $funcType([ptrType$4, ptrType$31, ptrType$23, $Uint16], [sliceType$5, $error], false)}, {prop: "processServerKeyExchange", name: "processServerKeyExchange", pkg: "crypto/tls", typ: $funcType([ptrType$4, ptrType$26, ptrType$30, ptrType$5, ptrType$22], [$error], false)}]); rsaKeyAgreement.init("", []); ecdheKeyAgreement.init("crypto/tls", [{prop: "version", name: "version", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "isRSA", name: "isRSA", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "params", name: "params", embedded: false, exported: false, typ: ecdheParameters, tag: ""}, {prop: "ckx", name: "ckx", embedded: false, exported: false, typ: ptrType$23, tag: ""}, {prop: "preMasterSecret", name: "preMasterSecret", embedded: false, exported: false, typ: sliceType$5, tag: ""}]); serverHandshakeStateTLS13.init("crypto/tls", [{prop: "c", name: "c", embedded: false, exported: false, typ: ptrType$6, tag: ""}, {prop: "ctx", name: "ctx", embedded: false, exported: false, typ: context.Context, tag: ""}, {prop: "clientHello", name: "clientHello", embedded: false, exported: false, typ: ptrType$26, tag: ""}, {prop: "hello", name: "hello", embedded: false, exported: false, typ: ptrType$30, tag: ""}, {prop: "sentDummyCCS", name: "sentDummyCCS", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "usingPSK", name: "usingPSK", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "suite", name: "suite", embedded: false, exported: false, typ: ptrType$2, tag: ""}, {prop: "cert", name: "cert", embedded: false, exported: false, typ: ptrType$31, tag: ""}, {prop: "sigAlg", name: "sigAlg", embedded: false, exported: false, typ: SignatureScheme, tag: ""}, {prop: "earlySecret", name: "earlySecret", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "sharedKey", name: "sharedKey", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "handshakeSecret", name: "handshakeSecret", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "masterSecret", name: "masterSecret", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "trafficSecret", name: "trafficSecret", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "transcript", name: "transcript", embedded: false, exported: false, typ: hash.Hash, tag: ""}, {prop: "clientFinished", name: "clientFinished", embedded: false, exported: false, typ: sliceType$5, tag: ""}]); serverHandshakeState.init("crypto/tls", [{prop: "c", name: "c", embedded: false, exported: false, typ: ptrType$6, tag: ""}, {prop: "ctx", name: "ctx", embedded: false, exported: false, typ: context.Context, tag: ""}, {prop: "clientHello", name: "clientHello", embedded: false, exported: false, typ: ptrType$26, tag: ""}, {prop: "hello", name: "hello", embedded: false, exported: false, typ: ptrType$30, tag: ""}, {prop: "suite", name: "suite", embedded: false, exported: false, typ: ptrType$3, tag: ""}, {prop: "ecdheOk", name: "ecdheOk", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "ecSignOk", name: "ecSignOk", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "rsaDecryptOk", name: "rsaDecryptOk", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "rsaSignOk", name: "rsaSignOk", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "sessionState", name: "sessionState", embedded: false, exported: false, typ: ptrType$32, tag: ""}, {prop: "finishedHash", name: "finishedHash", embedded: false, exported: false, typ: finishedHash, tag: ""}, {prop: "masterSecret", name: "masterSecret", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "cert", name: "cert", embedded: false, exported: false, typ: ptrType$31, tag: ""}]); marshalingFunction.init([ptrType$15], [$error], false); clientHelloMsg.init("crypto/tls", [{prop: "raw", name: "raw", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "vers", name: "vers", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "random", name: "random", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "sessionId", name: "sessionId", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "cipherSuites", name: "cipherSuites", embedded: false, exported: false, typ: sliceType$2, tag: ""}, {prop: "compressionMethods", name: "compressionMethods", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "serverName", name: "serverName", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "ocspStapling", name: "ocspStapling", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "supportedCurves", name: "supportedCurves", embedded: false, exported: false, typ: sliceType$3, tag: ""}, {prop: "supportedPoints", name: "supportedPoints", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "ticketSupported", name: "ticketSupported", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "sessionTicket", name: "sessionTicket", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "supportedSignatureAlgorithms", name: "supportedSignatureAlgorithms", embedded: false, exported: false, typ: sliceType$7, tag: ""}, {prop: "supportedSignatureAlgorithmsCert", name: "supportedSignatureAlgorithmsCert", embedded: false, exported: false, typ: sliceType$7, tag: ""}, {prop: "secureRenegotiationSupported", name: "secureRenegotiationSupported", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "secureRenegotiation", name: "secureRenegotiation", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "alpnProtocols", name: "alpnProtocols", embedded: false, exported: false, typ: sliceType$1, tag: ""}, {prop: "scts", name: "scts", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "supportedVersions", name: "supportedVersions", embedded: false, exported: false, typ: sliceType$2, tag: ""}, {prop: "cookie", name: "cookie", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "keyShares", name: "keyShares", embedded: false, exported: false, typ: sliceType$15, tag: ""}, {prop: "earlyData", name: "earlyData", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "pskModes", name: "pskModes", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "pskIdentities", name: "pskIdentities", embedded: false, exported: false, typ: sliceType$16, tag: ""}, {prop: "pskBinders", name: "pskBinders", embedded: false, exported: false, typ: sliceType$11, tag: ""}]); serverHelloMsg.init("crypto/tls", [{prop: "raw", name: "raw", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "vers", name: "vers", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "random", name: "random", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "sessionId", name: "sessionId", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "cipherSuite", name: "cipherSuite", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "compressionMethod", name: "compressionMethod", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "ocspStapling", name: "ocspStapling", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "ticketSupported", name: "ticketSupported", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "secureRenegotiationSupported", name: "secureRenegotiationSupported", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "secureRenegotiation", name: "secureRenegotiation", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "alpnProtocol", name: "alpnProtocol", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "scts", name: "scts", embedded: false, exported: false, typ: sliceType$11, tag: ""}, {prop: "supportedVersion", name: "supportedVersion", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "serverShare", name: "serverShare", embedded: false, exported: false, typ: keyShare, tag: ""}, {prop: "selectedIdentityPresent", name: "selectedIdentityPresent", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "selectedIdentity", name: "selectedIdentity", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "supportedPoints", name: "supportedPoints", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "cookie", name: "cookie", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "selectedGroup", name: "selectedGroup", embedded: false, exported: false, typ: CurveID, tag: ""}]); encryptedExtensionsMsg.init("crypto/tls", [{prop: "raw", name: "raw", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "alpnProtocol", name: "alpnProtocol", embedded: false, exported: false, typ: $String, tag: ""}]); endOfEarlyDataMsg.init("", []); keyUpdateMsg.init("crypto/tls", [{prop: "raw", name: "raw", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "updateRequested", name: "updateRequested", embedded: false, exported: false, typ: $Bool, tag: ""}]); newSessionTicketMsgTLS13.init("crypto/tls", [{prop: "raw", name: "raw", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "lifetime", name: "lifetime", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "ageAdd", name: "ageAdd", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "nonce", name: "nonce", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "label", name: "label", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "maxEarlyData", name: "maxEarlyData", embedded: false, exported: false, typ: $Uint32, tag: ""}]); certificateRequestMsgTLS13.init("crypto/tls", [{prop: "raw", name: "raw", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "ocspStapling", name: "ocspStapling", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "scts", name: "scts", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "supportedSignatureAlgorithms", name: "supportedSignatureAlgorithms", embedded: false, exported: false, typ: sliceType$7, tag: ""}, {prop: "supportedSignatureAlgorithmsCert", name: "supportedSignatureAlgorithmsCert", embedded: false, exported: false, typ: sliceType$7, tag: ""}, {prop: "certificateAuthorities", name: "certificateAuthorities", embedded: false, exported: false, typ: sliceType$11, tag: ""}]); certificateMsg.init("crypto/tls", [{prop: "raw", name: "raw", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "certificates", name: "certificates", embedded: false, exported: false, typ: sliceType$11, tag: ""}]); certificateMsgTLS13.init("crypto/tls", [{prop: "raw", name: "raw", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "certificate", name: "certificate", embedded: false, exported: false, typ: Certificate, tag: ""}, {prop: "ocspStapling", name: "ocspStapling", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "scts", name: "scts", embedded: false, exported: false, typ: $Bool, tag: ""}]); serverKeyExchangeMsg.init("crypto/tls", [{prop: "raw", name: "raw", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "key", name: "key", embedded: false, exported: false, typ: sliceType$5, tag: ""}]); certificateStatusMsg.init("crypto/tls", [{prop: "raw", name: "raw", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "response", name: "response", embedded: false, exported: false, typ: sliceType$5, tag: ""}]); serverHelloDoneMsg.init("", []); clientKeyExchangeMsg.init("crypto/tls", [{prop: "raw", name: "raw", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "ciphertext", name: "ciphertext", embedded: false, exported: false, typ: sliceType$5, tag: ""}]); finishedMsg.init("crypto/tls", [{prop: "raw", name: "raw", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "verifyData", name: "verifyData", embedded: false, exported: false, typ: sliceType$5, tag: ""}]); certificateRequestMsg.init("crypto/tls", [{prop: "raw", name: "raw", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "hasSignatureAlgorithm", name: "hasSignatureAlgorithm", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "certificateTypes", name: "certificateTypes", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "supportedSignatureAlgorithms", name: "supportedSignatureAlgorithms", embedded: false, exported: false, typ: sliceType$7, tag: ""}, {prop: "certificateAuthorities", name: "certificateAuthorities", embedded: false, exported: false, typ: sliceType$11, tag: ""}]); certificateVerifyMsg.init("crypto/tls", [{prop: "raw", name: "raw", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "hasSignatureAlgorithm", name: "hasSignatureAlgorithm", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "signatureAlgorithm", name: "signatureAlgorithm", embedded: false, exported: false, typ: SignatureScheme, tag: ""}, {prop: "signature", name: "signature", embedded: false, exported: false, typ: sliceType$5, tag: ""}]); newSessionTicketMsg.init("crypto/tls", [{prop: "raw", name: "raw", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "ticket", name: "ticket", embedded: false, exported: false, typ: sliceType$5, tag: ""}]); helloRequestMsg.init("", []); clientHandshakeStateTLS13.init("crypto/tls", [{prop: "c", name: "c", embedded: false, exported: false, typ: ptrType$6, tag: ""}, {prop: "ctx", name: "ctx", embedded: false, exported: false, typ: context.Context, tag: ""}, {prop: "serverHello", name: "serverHello", embedded: false, exported: false, typ: ptrType$30, tag: ""}, {prop: "hello", name: "hello", embedded: false, exported: false, typ: ptrType$26, tag: ""}, {prop: "ecdheParams", name: "ecdheParams", embedded: false, exported: false, typ: ecdheParameters, tag: ""}, {prop: "session", name: "session", embedded: false, exported: false, typ: ptrType$37, tag: ""}, {prop: "earlySecret", name: "earlySecret", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "binderKey", name: "binderKey", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "certReq", name: "certReq", embedded: false, exported: false, typ: ptrType$39, tag: ""}, {prop: "usingPSK", name: "usingPSK", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "sentDummyCCS", name: "sentDummyCCS", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "suite", name: "suite", embedded: false, exported: false, typ: ptrType$2, tag: ""}, {prop: "transcript", name: "transcript", embedded: false, exported: false, typ: hash.Hash, tag: ""}, {prop: "masterSecret", name: "masterSecret", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "trafficSecret", name: "trafficSecret", embedded: false, exported: false, typ: sliceType$5, tag: ""}]); clientHandshakeState.init("crypto/tls", [{prop: "c", name: "c", embedded: false, exported: false, typ: ptrType$6, tag: ""}, {prop: "ctx", name: "ctx", embedded: false, exported: false, typ: context.Context, tag: ""}, {prop: "serverHello", name: "serverHello", embedded: false, exported: false, typ: ptrType$30, tag: ""}, {prop: "hello", name: "hello", embedded: false, exported: false, typ: ptrType$26, tag: ""}, {prop: "suite", name: "suite", embedded: false, exported: false, typ: ptrType$3, tag: ""}, {prop: "finishedHash", name: "finishedHash", embedded: false, exported: false, typ: finishedHash, tag: ""}, {prop: "masterSecret", name: "masterSecret", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "session", name: "session", embedded: false, exported: false, typ: ptrType$37, tag: ""}]); Conn.init("crypto/tls", [{prop: "conn", name: "conn", embedded: false, exported: false, typ: net.Conn, tag: ""}, {prop: "isClient", name: "isClient", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "handshakeFn", name: "handshakeFn", embedded: false, exported: false, typ: funcType$1, tag: ""}, {prop: "handshakeStatus", name: "handshakeStatus", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "handshakeMutex", name: "handshakeMutex", embedded: false, exported: false, typ: sync.Mutex, tag: ""}, {prop: "handshakeErr", name: "handshakeErr", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "vers", name: "vers", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "haveVers", name: "haveVers", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "config", name: "config", embedded: false, exported: false, typ: ptrType$4, tag: ""}, {prop: "handshakes", name: "handshakes", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "didResume", name: "didResume", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "cipherSuite", name: "cipherSuite", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "ocspResponse", name: "ocspResponse", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "scts", name: "scts", embedded: false, exported: false, typ: sliceType$11, tag: ""}, {prop: "peerCertificates", name: "peerCertificates", embedded: false, exported: false, typ: sliceType$12, tag: ""}, {prop: "verifiedChains", name: "verifiedChains", embedded: false, exported: false, typ: sliceType$13, tag: ""}, {prop: "serverName", name: "serverName", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "secureRenegotiation", name: "secureRenegotiation", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "ekm", name: "ekm", embedded: false, exported: false, typ: funcType$2, tag: ""}, {prop: "resumptionSecret", name: "resumptionSecret", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "ticketKeys", name: "ticketKeys", embedded: false, exported: false, typ: sliceType$4, tag: ""}, {prop: "clientFinishedIsFirst", name: "clientFinishedIsFirst", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "closeNotifyErr", name: "closeNotifyErr", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "closeNotifySent", name: "closeNotifySent", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "clientFinished", name: "clientFinished", embedded: false, exported: false, typ: arrayType$1, tag: ""}, {prop: "serverFinished", name: "serverFinished", embedded: false, exported: false, typ: arrayType$1, tag: ""}, {prop: "clientProtocol", name: "clientProtocol", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "in$27", name: "in", embedded: false, exported: false, typ: halfConn, tag: ""}, {prop: "out", name: "out", embedded: false, exported: false, typ: halfConn, tag: ""}, {prop: "rawInput", name: "rawInput", embedded: false, exported: false, typ: bytes.Buffer, tag: ""}, {prop: "input", name: "input", embedded: false, exported: false, typ: bytes.Reader, tag: ""}, {prop: "hand", name: "hand", embedded: false, exported: false, typ: bytes.Buffer, tag: ""}, {prop: "buffering", name: "buffering", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "sendBuf", name: "sendBuf", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "bytesSent", name: "bytesSent", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "packetsSent", name: "packetsSent", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "retryCount", name: "retryCount", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "activeCall", name: "activeCall", embedded: false, exported: false, typ: $Int32, tag: ""}, {prop: "tmp", name: "tmp", embedded: false, exported: false, typ: arrayType$4, tag: ""}]); halfConn.init("crypto/tls", [{prop: "Mutex", name: "Mutex", embedded: true, exported: true, typ: sync.Mutex, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "version", name: "version", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "cipher", name: "cipher", embedded: false, exported: false, typ: $emptyInterface, tag: ""}, {prop: "mac", name: "mac", embedded: false, exported: false, typ: hash.Hash, tag: ""}, {prop: "seq", name: "seq", embedded: false, exported: false, typ: arrayType$2, tag: ""}, {prop: "scratchBuf", name: "scratchBuf", embedded: false, exported: false, typ: arrayType$3, tag: ""}, {prop: "nextCipher", name: "nextCipher", embedded: false, exported: false, typ: $emptyInterface, tag: ""}, {prop: "nextMac", name: "nextMac", embedded: false, exported: false, typ: hash.Hash, tag: ""}, {prop: "trafficSecret", name: "trafficSecret", embedded: false, exported: false, typ: sliceType$5, tag: ""}]); permanentError.init("crypto/tls", [{prop: "err", name: "err", embedded: false, exported: false, typ: net.Error, tag: ""}]); cbcMode.init([{prop: "BlockSize", name: "BlockSize", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "CryptBlocks", name: "CryptBlocks", pkg: "", typ: $funcType([sliceType$5, sliceType$5], [], false)}, {prop: "SetIV", name: "SetIV", pkg: "", typ: $funcType([sliceType$5], [], false)}]); RecordHeaderError.init("", [{prop: "Msg", name: "Msg", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "RecordHeader", name: "RecordHeader", embedded: false, exported: true, typ: arrayType$6, tag: ""}, {prop: "Conn", name: "Conn", embedded: false, exported: true, typ: net.Conn, tag: ""}]); atLeastReader.init("", [{prop: "R", name: "R", embedded: false, exported: true, typ: io.Reader, tag: ""}, {prop: "N", name: "N", embedded: false, exported: true, typ: $Int64, tag: ""}]); keyShare.init("crypto/tls", [{prop: "group", name: "group", embedded: false, exported: false, typ: CurveID, tag: ""}, {prop: "data", name: "data", embedded: false, exported: false, typ: sliceType$5, tag: ""}]); pskIdentity.init("crypto/tls", [{prop: "label", name: "label", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "obfuscatedTicketAge", name: "obfuscatedTicketAge", embedded: false, exported: false, typ: $Uint32, tag: ""}]); ConnectionState.init("crypto/tls", [{prop: "Version", name: "Version", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "HandshakeComplete", name: "HandshakeComplete", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "DidResume", name: "DidResume", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "CipherSuite", name: "CipherSuite", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "NegotiatedProtocol", name: "NegotiatedProtocol", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "NegotiatedProtocolIsMutual", name: "NegotiatedProtocolIsMutual", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "ServerName", name: "ServerName", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "PeerCertificates", name: "PeerCertificates", embedded: false, exported: true, typ: sliceType$12, tag: ""}, {prop: "VerifiedChains", name: "VerifiedChains", embedded: false, exported: true, typ: sliceType$13, tag: ""}, {prop: "SignedCertificateTimestamps", name: "SignedCertificateTimestamps", embedded: false, exported: true, typ: sliceType$11, tag: ""}, {prop: "OCSPResponse", name: "OCSPResponse", embedded: false, exported: true, typ: sliceType$5, tag: ""}, {prop: "TLSUnique", name: "TLSUnique", embedded: false, exported: true, typ: sliceType$5, tag: ""}, {prop: "ekm", name: "ekm", embedded: false, exported: false, typ: funcType$2, tag: ""}]); ClientSessionState.init("crypto/tls", [{prop: "sessionTicket", name: "sessionTicket", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "vers", name: "vers", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "cipherSuite", name: "cipherSuite", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "masterSecret", name: "masterSecret", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "serverCertificates", name: "serverCertificates", embedded: false, exported: false, typ: sliceType$12, tag: ""}, {prop: "verifiedChains", name: "verifiedChains", embedded: false, exported: false, typ: sliceType$13, tag: ""}, {prop: "receivedAt", name: "receivedAt", embedded: false, exported: false, typ: time.Time, tag: ""}, {prop: "ocspResponse", name: "ocspResponse", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "scts", name: "scts", embedded: false, exported: false, typ: sliceType$11, tag: ""}, {prop: "nonce", name: "nonce", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "useBy", name: "useBy", embedded: false, exported: false, typ: time.Time, tag: ""}, {prop: "ageAdd", name: "ageAdd", embedded: false, exported: false, typ: $Uint32, tag: ""}]); ClientSessionCache.init([{prop: "Get", name: "Get", pkg: "", typ: $funcType([$String], [ptrType$37, $Bool], false)}, {prop: "Put", name: "Put", pkg: "", typ: $funcType([$String, ptrType$37], [], false)}]); ClientHelloInfo.init("crypto/tls", [{prop: "CipherSuites", name: "CipherSuites", embedded: false, exported: true, typ: sliceType$2, tag: ""}, {prop: "ServerName", name: "ServerName", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "SupportedCurves", name: "SupportedCurves", embedded: false, exported: true, typ: sliceType$3, tag: ""}, {prop: "SupportedPoints", name: "SupportedPoints", embedded: false, exported: true, typ: sliceType$5, tag: ""}, {prop: "SignatureSchemes", name: "SignatureSchemes", embedded: false, exported: true, typ: sliceType$7, tag: ""}, {prop: "SupportedProtos", name: "SupportedProtos", embedded: false, exported: true, typ: sliceType$1, tag: ""}, {prop: "SupportedVersions", name: "SupportedVersions", embedded: false, exported: true, typ: sliceType$2, tag: ""}, {prop: "Conn", name: "Conn", embedded: false, exported: true, typ: net.Conn, tag: ""}, {prop: "config", name: "config", embedded: false, exported: false, typ: ptrType$4, tag: ""}, {prop: "ctx", name: "ctx", embedded: false, exported: false, typ: context.Context, tag: ""}]); CertificateRequestInfo.init("crypto/tls", [{prop: "AcceptableCAs", name: "AcceptableCAs", embedded: false, exported: true, typ: sliceType$11, tag: ""}, {prop: "SignatureSchemes", name: "SignatureSchemes", embedded: false, exported: true, typ: sliceType$7, tag: ""}, {prop: "Version", name: "Version", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "ctx", name: "ctx", embedded: false, exported: false, typ: context.Context, tag: ""}]); Config.init("crypto/tls", [{prop: "Rand", name: "Rand", embedded: false, exported: true, typ: io.Reader, tag: ""}, {prop: "Time", name: "Time", embedded: false, exported: true, typ: funcType$3, tag: ""}, {prop: "Certificates", name: "Certificates", embedded: false, exported: true, typ: sliceType, tag: ""}, {prop: "NameToCertificate", name: "NameToCertificate", embedded: false, exported: true, typ: mapType, tag: ""}, {prop: "GetCertificate", name: "GetCertificate", embedded: false, exported: true, typ: funcType$4, tag: ""}, {prop: "GetClientCertificate", name: "GetClientCertificate", embedded: false, exported: true, typ: funcType$5, tag: ""}, {prop: "GetConfigForClient", name: "GetConfigForClient", embedded: false, exported: true, typ: funcType$6, tag: ""}, {prop: "VerifyPeerCertificate", name: "VerifyPeerCertificate", embedded: false, exported: true, typ: funcType$7, tag: ""}, {prop: "VerifyConnection", name: "VerifyConnection", embedded: false, exported: true, typ: funcType$8, tag: ""}, {prop: "RootCAs", name: "RootCAs", embedded: false, exported: true, typ: ptrType, tag: ""}, {prop: "NextProtos", name: "NextProtos", embedded: false, exported: true, typ: sliceType$1, tag: ""}, {prop: "ServerName", name: "ServerName", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "ClientAuth", name: "ClientAuth", embedded: false, exported: true, typ: ClientAuthType, tag: ""}, {prop: "ClientCAs", name: "ClientCAs", embedded: false, exported: true, typ: ptrType, tag: ""}, {prop: "InsecureSkipVerify", name: "InsecureSkipVerify", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "CipherSuites", name: "CipherSuites", embedded: false, exported: true, typ: sliceType$2, tag: ""}, {prop: "PreferServerCipherSuites", name: "PreferServerCipherSuites", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "SessionTicketsDisabled", name: "SessionTicketsDisabled", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "SessionTicketKey", name: "SessionTicketKey", embedded: false, exported: true, typ: arrayType, tag: ""}, {prop: "ClientSessionCache", name: "ClientSessionCache", embedded: false, exported: true, typ: ClientSessionCache, tag: ""}, {prop: "MinVersion", name: "MinVersion", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "MaxVersion", name: "MaxVersion", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "CurvePreferences", name: "CurvePreferences", embedded: false, exported: true, typ: sliceType$3, tag: ""}, {prop: "DynamicRecordSizingDisabled", name: "DynamicRecordSizingDisabled", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "Renegotiation", name: "Renegotiation", embedded: false, exported: true, typ: RenegotiationSupport, tag: ""}, {prop: "KeyLogWriter", name: "KeyLogWriter", embedded: false, exported: true, typ: io.Writer, tag: ""}, {prop: "mutex", name: "mutex", embedded: false, exported: false, typ: sync.RWMutex, tag: ""}, {prop: "sessionTicketKeys", name: "sessionTicketKeys", embedded: false, exported: false, typ: sliceType$4, tag: ""}, {prop: "autoSessionTicketKeys", name: "autoSessionTicketKeys", embedded: false, exported: false, typ: sliceType$4, tag: ""}]); ticketKey.init("crypto/tls", [{prop: "keyName", name: "keyName", embedded: false, exported: false, typ: arrayType$4, tag: ""}, {prop: "aesKey", name: "aesKey", embedded: false, exported: false, typ: arrayType$4, tag: ""}, {prop: "hmacKey", name: "hmacKey", embedded: false, exported: false, typ: arrayType$4, tag: ""}, {prop: "created", name: "created", embedded: false, exported: false, typ: time.Time, tag: ""}]); Certificate.init("", [{prop: "Certificate", name: "Certificate", embedded: false, exported: true, typ: sliceType$11, tag: ""}, {prop: "PrivateKey", name: "PrivateKey", embedded: false, exported: true, typ: crypto.PrivateKey, tag: ""}, {prop: "SupportedSignatureAlgorithms", name: "SupportedSignatureAlgorithms", embedded: false, exported: true, typ: sliceType$7, tag: ""}, {prop: "OCSPStaple", name: "OCSPStaple", embedded: false, exported: true, typ: sliceType$5, tag: ""}, {prop: "SignedCertificateTimestamps", name: "SignedCertificateTimestamps", embedded: false, exported: true, typ: sliceType$11, tag: ""}, {prop: "Leaf", name: "Leaf", embedded: false, exported: true, typ: ptrType$5, tag: ""}]); cipherSuite.init("crypto/tls", [{prop: "id", name: "id", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "keyLen", name: "keyLen", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "macLen", name: "macLen", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "ivLen", name: "ivLen", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "ka", name: "ka", embedded: false, exported: false, typ: funcType$9, tag: ""}, {prop: "flags", name: "flags", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "cipher", name: "cipher", embedded: false, exported: false, typ: funcType$10, tag: ""}, {prop: "mac", name: "mac", embedded: false, exported: false, typ: funcType$11, tag: ""}, {prop: "aead", name: "aead", embedded: false, exported: false, typ: funcType$12, tag: ""}]); cipherSuiteTLS13.init("crypto/tls", [{prop: "id", name: "id", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "keyLen", name: "keyLen", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "aead", name: "aead", embedded: false, exported: false, typ: funcType$12, tag: ""}, {prop: "hash", name: "hash", embedded: false, exported: false, typ: crypto.Hash, tag: ""}]); aead.init([{prop: "NonceSize", name: "NonceSize", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Open", name: "Open", pkg: "", typ: $funcType([sliceType$5, sliceType$5, sliceType$5, sliceType$5], [sliceType$5, $error], false)}, {prop: "Overhead", name: "Overhead", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Seal", name: "Seal", pkg: "", typ: $funcType([sliceType$5, sliceType$5, sliceType$5, sliceType$5], [sliceType$5], false)}, {prop: "explicitNonceLen", name: "explicitNonceLen", pkg: "crypto/tls", typ: $funcType([], [$Int], false)}]); prefixNonceAEAD.init("crypto/tls", [{prop: "nonce", name: "nonce", embedded: false, exported: false, typ: arrayType$1, tag: ""}, {prop: "aead", name: "aead", embedded: false, exported: false, typ: cipher.AEAD, tag: ""}]); xorNonceAEAD.init("crypto/tls", [{prop: "nonceMask", name: "nonceMask", embedded: false, exported: false, typ: arrayType$1, tag: ""}, {prop: "aead", name: "aead", embedded: false, exported: false, typ: cipher.AEAD, tag: ""}]); constantTimeHash.init([{prop: "BlockSize", name: "BlockSize", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "ConstantTimeSum", name: "ConstantTimeSum", pkg: "", typ: $funcType([sliceType$5], [sliceType$5], 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$5], [sliceType$5], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$5], [$Int, $error], false)}]); cthWrapper.init("crypto/tls", [{prop: "h", name: "h", embedded: false, exported: false, typ: constantTimeHash, tag: ""}]); binaryMarshaler.init([{prop: "MarshalBinary", name: "MarshalBinary", pkg: "", typ: $funcType([], [sliceType$5, $error], false)}, {prop: "UnmarshalBinary", name: "UnmarshalBinary", pkg: "", typ: $funcType([sliceType$5], [$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 = bytes.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = list.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = context.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = crypto.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = aes.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = cipher.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = des.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = ecdsa.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = ed25519.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = elliptic.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = hmac.$init(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = md5.$init(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = rand.$init(); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = rc4.$init(); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = rsa.$init(); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sha1.$init(); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sha256.$init(); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sha512.$init(); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = subtle.$init(); /* */ $s = 19; case 19: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = x509.$init(); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = pem.$init(); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = errors.$init(); /* */ $s = 22; case 22: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = fmt.$init(); /* */ $s = 23; case 23: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = hash.$init(); /* */ $s = 24; case 24: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = cpu.$init(); /* */ $s = 25; case 25: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = io.$init(); /* */ $s = 26; case 26: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = big.$init(); /* */ $s = 27; case 27: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = net.$init(); /* */ $s = 28; case 28: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = os.$init(); /* */ $s = 29; case 29: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = runtime.$init(); /* */ $s = 30; case 30: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strconv.$init(); /* */ $s = 31; case 31: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strings.$init(); /* */ $s = 32; case 32: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sync.$init(); /* */ $s = 33; case 33: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = atomic.$init(); /* */ $s = 34; case 34: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = time.$init(); /* */ $s = 35; case 35: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = chacha20poly1305.$init(); /* */ $s = 36; case 36: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = cryptobyte.$init(); /* */ $s = 37; case 37: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = curve25519.$init(); /* */ $s = 38; case 38: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = hkdf.$init(); /* */ $s = 39; case 39: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } testingOnlyForceDowngradeCanary = false; writerMutex = new sync.Mutex.ptr(0, 0); emptyConfig = new Config.ptr($ifaceNil, $throwNilPointerError, sliceType.nil, false, $throwNilPointerError, $throwNilPointerError, $throwNilPointerError, $throwNilPointerError, $throwNilPointerError, ptrType.nil, sliceType$1.nil, "", 0, ptrType.nil, false, sliceType$2.nil, false, false, arrayType.zero(), $ifaceNil, 0, 0, sliceType$3.nil, false, 0, $ifaceNil, new sync.RWMutex.ptr(new sync.Mutex.ptr(0, 0), 0, 0, 0, 0), sliceType$4.nil, sliceType$4.nil); masterSecretLabel = (new sliceType$5($stringToBytes("master secret"))); keyExpansionLabel = (new sliceType$5($stringToBytes("key expansion"))); clientFinishedLabel = (new sliceType$5($stringToBytes("client finished"))); serverFinishedLabel = (new sliceType$5($stringToBytes("server finished"))); errClientKeyExchange = errors.New("tls: invalid ClientKeyExchange message"); errServerKeyExchange = errors.New("tls: invalid ServerKeyExchange message"); outBufPool = new sync.Pool.ptr(sliceType$6.nil, (function() { return $newDataPointer(sliceType$5.nil, ptrType$1); })); errShutdown = errors.New("tls: protocol is shutdown"); errEarlyCloseWrite = errors.New("tls: CloseWrite called before handshake complete"); _SignatureScheme_index_8 = $toNativeArray($kindUint8, [0, 13, 26, 39, 46]); _CurveID_index_0 = $toNativeArray($kindUint8, [0, 9, 18, 27]); _ClientAuthType_index = $toNativeArray($kindUint8, [0, 12, 29, 49, 72, 98]); directSigning = 0; helloRetryRequestRandom = new sliceType$5([207, 33, 173, 116, 229, 154, 97, 17, 190, 29, 140, 2, 30, 101, 184, 145, 194, 162, 17, 22, 122, 187, 140, 94, 7, 158, 9, 226, 200, 168, 51, 156]); supportedSignatureAlgorithms = new sliceType$7([2052, 1027, 2055, 2053, 2054, 1025, 1281, 1537, 1283, 1539, 513, 515]); deprecatedSessionTicketKey = (new sliceType$5($stringToBytes("DEPRECATED"))); supportedVersions = new sliceType$2([772, 771, 770, 769]); defaultCurvePreferences = new sliceType$3([29, 23, 24, 25]); errNoCertificates = errors.New("tls: no certificates configured"); hasGCMAsmAMD64 = cpu.X86.HasAES && cpu.X86.HasPCLMULQDQ; hasGCMAsmARM64 = cpu.ARM64.HasAES && cpu.ARM64.HasPMULL; hasGCMAsmS390X = cpu.S390X.HasAES && cpu.S390X.HasAESCBC && cpu.S390X.HasAESCTR && (cpu.S390X.HasGHASH || cpu.S390X.HasAESGCM); hasAESGCMHardwareSupport = false && hasGCMAsmAMD64 || false && hasGCMAsmARM64 || false && hasGCMAsmS390X; disabledCipherSuites = new sliceType$2([49187, 49191, 60, 49159, 49169, 5]); aesgcmCiphers = $makeMap($Uint16.keyFor, [{ k: 49199, v: true }, { k: 49200, v: true }, { k: 49195, v: true }, { k: 49196, v: true }, { k: 4865, v: true }, { k: 4866, v: true }]); cipherSuitesTLS13 = new sliceType$8([new cipherSuiteTLS13.ptr(4865, 16, aeadAESGCMTLS13, 5), new cipherSuiteTLS13.ptr(4867, 32, aeadChaCha20Poly1305, 5), new cipherSuiteTLS13.ptr(4866, 32, aeadAESGCMTLS13, 6)]); defaultCipherSuitesTLS13 = new sliceType$2([4865, 4866, 4867]); defaultCipherSuitesTLS13NoAES = new sliceType$2([4867, 4865, 4866]); cipherSuites = new sliceType$9([new cipherSuite.ptr(52392, 32, 0, 12, ecdheRSAKA, 5, $throwNilPointerError, $throwNilPointerError, aeadChaCha20Poly1305), new cipherSuite.ptr(52393, 32, 0, 12, ecdheECDSAKA, 7, $throwNilPointerError, $throwNilPointerError, aeadChaCha20Poly1305), new cipherSuite.ptr(49199, 16, 0, 4, ecdheRSAKA, 5, $throwNilPointerError, $throwNilPointerError, aeadAESGCM), new cipherSuite.ptr(49195, 16, 0, 4, ecdheECDSAKA, 7, $throwNilPointerError, $throwNilPointerError, aeadAESGCM), new cipherSuite.ptr(49200, 32, 0, 4, ecdheRSAKA, 13, $throwNilPointerError, $throwNilPointerError, aeadAESGCM), new cipherSuite.ptr(49196, 32, 0, 4, ecdheECDSAKA, 15, $throwNilPointerError, $throwNilPointerError, aeadAESGCM), new cipherSuite.ptr(49191, 16, 32, 16, ecdheRSAKA, 5, cipherAES, macSHA256, $throwNilPointerError), new cipherSuite.ptr(49171, 16, 20, 16, ecdheRSAKA, 1, cipherAES, macSHA1, $throwNilPointerError), new cipherSuite.ptr(49187, 16, 32, 16, ecdheECDSAKA, 7, cipherAES, macSHA256, $throwNilPointerError), new cipherSuite.ptr(49161, 16, 20, 16, ecdheECDSAKA, 3, cipherAES, macSHA1, $throwNilPointerError), new cipherSuite.ptr(49172, 32, 20, 16, ecdheRSAKA, 1, cipherAES, macSHA1, $throwNilPointerError), new cipherSuite.ptr(49162, 32, 20, 16, ecdheECDSAKA, 3, cipherAES, macSHA1, $throwNilPointerError), new cipherSuite.ptr(156, 16, 0, 4, rsaKA, 4, $throwNilPointerError, $throwNilPointerError, aeadAESGCM), new cipherSuite.ptr(157, 32, 0, 4, rsaKA, 12, $throwNilPointerError, $throwNilPointerError, aeadAESGCM), new cipherSuite.ptr(60, 16, 32, 16, rsaKA, 4, cipherAES, macSHA256, $throwNilPointerError), new cipherSuite.ptr(47, 16, 20, 16, rsaKA, 0, cipherAES, macSHA1, $throwNilPointerError), new cipherSuite.ptr(53, 32, 20, 16, rsaKA, 0, cipherAES, macSHA1, $throwNilPointerError), new cipherSuite.ptr(49170, 24, 20, 8, ecdheRSAKA, 1, cipher3DES, macSHA1, $throwNilPointerError), new cipherSuite.ptr(10, 24, 20, 8, rsaKA, 0, cipher3DES, macSHA1, $throwNilPointerError), new cipherSuite.ptr(5, 16, 20, 0, rsaKA, 0, cipherRC4, macSHA1, $throwNilPointerError), new cipherSuite.ptr(49169, 16, 20, 0, ecdheRSAKA, 1, cipherRC4, macSHA1, $throwNilPointerError), new cipherSuite.ptr(49159, 16, 20, 0, ecdheECDSAKA, 3, cipherRC4, macSHA1, $throwNilPointerError)]); cipherSuitesPreferenceOrder = new sliceType$2([49195, 49199, 49196, 49200, 52393, 52392, 49161, 49171, 49162, 49172, 156, 157, 47, 53, 49170, 10, 49187, 49191, 60, 49159, 49169, 5]); cipherSuitesPreferenceOrderNoAES = new sliceType$2([52393, 52392, 49195, 49199, 49196, 49200, 49161, 49171, 49162, 49172, 156, 157, 47, 53, 49170, 10, 49187, 49191, 60, 49159, 49169, 5]); defaultCipherSuitesLen = cipherSuitesPreferenceOrder.$length - disabledCipherSuites.$length >> 0; defaultCipherSuites = $subslice(cipherSuitesPreferenceOrder, 0, defaultCipherSuitesLen); signaturePadding = new sliceType$5([32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32]); rsaSignatureSchemes = new sliceType$10([new structType.ptr(2052, ($imul(new crypto.Hash(5).Size(), 2)) + 2 >> 0, 772), new structType.ptr(2053, ($imul(new crypto.Hash(6).Size(), 2)) + 2 >> 0, 772), new structType.ptr(2054, ($imul(new crypto.Hash(7).Size(), 2)) + 2 >> 0, 772), new structType.ptr(1025, (19 + new crypto.Hash(5).Size() >> 0) + 11 >> 0, 771), new structType.ptr(1281, (19 + new crypto.Hash(6).Size() >> 0) + 11 >> 0, 771), new structType.ptr(1537, (19 + new crypto.Hash(7).Size() >> 0) + 11 >> 0, 771), new structType.ptr(513, (15 + new crypto.Hash(3).Size() >> 0) + 11 >> 0, 771)]); alertText = $makeMap(alert.keyFor, [{ k: 0, v: "close notify" }, { k: 10, v: "unexpected message" }, { k: 20, v: "bad record MAC" }, { k: 21, v: "decryption failed" }, { k: 22, v: "record overflow" }, { k: 30, v: "decompression failure" }, { k: 40, v: "handshake failure" }, { k: 42, v: "bad certificate" }, { k: 43, v: "unsupported certificate" }, { k: 44, v: "revoked certificate" }, { k: 45, v: "expired certificate" }, { k: 46, v: "unknown certificate" }, { k: 47, v: "illegal parameter" }, { k: 48, v: "unknown certificate authority" }, { k: 49, v: "access denied" }, { k: 50, v: "error decoding message" }, { k: 51, v: "error decrypting message" }, { k: 60, v: "export restriction" }, { k: 70, v: "protocol version not supported" }, { k: 71, v: "insufficient security level" }, { k: 80, v: "internal error" }, { k: 86, v: "inappropriate fallback" }, { k: 90, v: "user canceled" }, { k: 100, v: "no renegotiation" }, { k: 109, v: "missing extension" }, { k: 110, v: "unsupported extension" }, { k: 111, v: "certificate unobtainable" }, { k: 112, v: "unrecognized name" }, { k: 113, v: "bad certificate status response" }, { k: 114, v: "bad certificate hash value" }, { k: 115, v: "unknown PSK identity" }, { k: 116, v: "certificate required" }, { k: 120, v: "no application protocol" }]); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["log"] = (function() { var $pkg = {}, $init, fmt, nosync, io, os, runtime, time, Logger, sliceType, arrayType, ptrType, sliceType$1, ptrType$1, std, New, itoa, Printf, Fatalf; fmt = $packages["fmt"]; nosync = $packages["github.com/gopherjs/gopherjs/nosync"]; io = $packages["io"]; os = $packages["os"]; runtime = $packages["runtime"]; time = $packages["time"]; Logger = $pkg.Logger = $newType(0, $kindStruct, "log.Logger", true, "log", true, function(mu_, prefix_, flag_, out_, buf_) { this.$val = this; if (arguments.length === 0) { this.mu = new nosync.Mutex.ptr(false); this.prefix = ""; this.flag = 0; this.out = $ifaceNil; this.buf = sliceType.nil; return; } this.mu = mu_; this.prefix = prefix_; this.flag = flag_; this.out = out_; this.buf = buf_; }); sliceType = $sliceType($Uint8); arrayType = $arrayType($Uint8, 20); ptrType = $ptrType(sliceType); sliceType$1 = $sliceType($emptyInterface); ptrType$1 = $ptrType(Logger); New = function(out, prefix, flag) { var flag, out, prefix; return new Logger.ptr(new nosync.Mutex.ptr(false), prefix, flag, out, sliceType.nil); }; $pkg.New = New; Logger.ptr.prototype.SetOutput = function(w) { var l, w, $deferred; /* */ var $err = null; try { $deferred = []; $curGoroutine.deferStack.push($deferred); l = this; l.mu.Lock(); $deferred.push([$methodVal(l.mu, "Unlock"), []]); l.out = w; /* */ } catch(err) { $err = err; } finally { $callDeferred($deferred, $err); } }; Logger.prototype.SetOutput = function(w) { return this.$val.SetOutput(w); }; itoa = function(buf, i, wid) { var _q, b, bp, buf, i, q, wid; b = arrayType.zero(); bp = 19; while (true) { if (!(i >= 10 || wid > 1)) { break; } wid = wid - (1) >> 0; q = (_q = i / 10, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); ((bp < 0 || bp >= b.length) ? ($throwRuntimeError("index out of range"), undefined) : b[bp] = ((((48 + i >> 0) - ($imul(q, 10)) >> 0) << 24 >>> 24))); bp = bp - (1) >> 0; i = q; } ((bp < 0 || bp >= b.length) ? ($throwRuntimeError("index out of range"), undefined) : b[bp] = (((48 + i >> 0) << 24 >>> 24))); buf.$set($appendSlice(buf.$get(), $subslice(new sliceType(b), bp))); }; Logger.ptr.prototype.formatHeader = function(buf, t, file, line) { var _q, _r, _r$1, _tuple, _tuple$1, buf, day, file, hour, i, l, line, min, month, sec, short$1, t, year, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _q = $f._q; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; buf = $f.buf; day = $f.day; file = $f.file; hour = $f.hour; i = $f.i; l = $f.l; line = $f.line; min = $f.min; month = $f.month; sec = $f.sec; short$1 = $f.short$1; t = $f.t; year = $f.year; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: l = this; if ((l.flag & 64) === 0) { buf.$set($appendSlice(buf.$get(), l.prefix)); } /* */ if (!(((l.flag & 7) === 0))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(((l.flag & 7) === 0))) { */ case 1: if (!(((l.flag & 32) === 0))) { time.Time.copy(t, $clone(t, time.Time).UTC()); } /* */ if (!(((l.flag & 1) === 0))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!(((l.flag & 1) === 0))) { */ case 3: _r = $clone(t, time.Time).Date(); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; year = _tuple[0]; month = _tuple[1]; day = _tuple[2]; itoa(buf, year, 4); buf.$set($append(buf.$get(), 47)); itoa(buf, ((month >> 0)), 2); buf.$set($append(buf.$get(), 47)); itoa(buf, day, 2); buf.$set($append(buf.$get(), 32)); /* } */ case 4: /* */ if (!(((l.flag & 6) === 0))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!(((l.flag & 6) === 0))) { */ case 6: _r$1 = $clone(t, time.Time).Clock(); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; hour = _tuple$1[0]; min = _tuple$1[1]; sec = _tuple$1[2]; itoa(buf, hour, 2); buf.$set($append(buf.$get(), 58)); itoa(buf, min, 2); buf.$set($append(buf.$get(), 58)); itoa(buf, sec, 2); if (!(((l.flag & 4) === 0))) { buf.$set($append(buf.$get(), 46)); itoa(buf, (_q = $clone(t, time.Time).Nanosecond() / 1000, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")), 6); } buf.$set($append(buf.$get(), 32)); /* } */ case 7: /* } */ case 2: if (!(((l.flag & 24) === 0))) { if (!(((l.flag & 16) === 0))) { short$1 = file; i = file.length - 1 >> 0; while (true) { if (!(i > 0)) { break; } if (file.charCodeAt(i) === 47) { short$1 = $substring(file, (i + 1 >> 0)); break; } i = i - (1) >> 0; } file = short$1; } buf.$set($appendSlice(buf.$get(), file)); buf.$set($append(buf.$get(), 58)); itoa(buf, line, -1); buf.$set($appendSlice(buf.$get(), ": ")); } if (!(((l.flag & 64) === 0))) { buf.$set($appendSlice(buf.$get(), l.prefix)); } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Logger.ptr.prototype.formatHeader }; } $f._q = _q; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.buf = buf; $f.day = day; $f.file = file; $f.hour = hour; $f.i = i; $f.l = l; $f.line = line; $f.min = min; $f.month = month; $f.sec = sec; $f.short$1 = short$1; $f.t = t; $f.year = year; $f.$s = $s; $f.$r = $r; return $f; }; Logger.prototype.formatHeader = function(buf, t, file, line) { return this.$val.formatHeader(buf, t, file, line); }; Logger.ptr.prototype.Output = function(calldepth, s) { var $24r, _r, _r$1, _tuple, _tuple$1, calldepth, err, file, l, line, now, ok, s, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; calldepth = $f.calldepth; err = $f.err; file = $f.file; l = $f.l; line = $f.line; now = $f.now; ok = $f.ok; s = $f.s; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); l = this; _r = time.Now(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } now = $clone(_r, time.Time); file = ""; line = 0; l.mu.Lock(); $deferred.push([$methodVal(l.mu, "Unlock"), []]); if (!(((l.flag & 24) === 0))) { l.mu.Unlock(); ok = false; _tuple = runtime.Caller(calldepth); file = _tuple[1]; line = _tuple[2]; ok = _tuple[3]; if (!ok) { file = "???"; line = 0; } l.mu.Lock(); } l.buf = $subslice(l.buf, 0, 0); $r = l.formatHeader((l.$ptr_buf || (l.$ptr_buf = new ptrType(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, l))), $clone(now, time.Time), file, line); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } l.buf = $appendSlice(l.buf, s); if ((s.length === 0) || !((s.charCodeAt((s.length - 1 >> 0)) === 10))) { l.buf = $append(l.buf, 10); } _r$1 = l.out.Write(l.buf); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; err = _tuple$1[1]; $24r = err; $s = 4; case 4: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Logger.ptr.prototype.Output }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.calldepth = calldepth; $f.err = err; $f.file = file; $f.l = l; $f.line = line; $f.now = now; $f.ok = ok; $f.s = s; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Logger.prototype.Output = function(calldepth, s) { return this.$val.Output(calldepth, s); }; Logger.ptr.prototype.Printf = function(format, v) { var _arg, _r, _r$1, format, l, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _r = $f._r; _r$1 = $f._r$1; format = $f.format; l = $f.l; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: l = this; _r = fmt.Sprintf(format, v); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg = _r; _r$1 = l.Output(2, _arg); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Logger.ptr.prototype.Printf }; } $f._arg = _arg; $f._r = _r; $f._r$1 = _r$1; $f.format = format; $f.l = l; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Logger.prototype.Printf = function(format, v) { return this.$val.Printf(format, v); }; Logger.ptr.prototype.Print = function(v) { var _arg, _r, _r$1, l, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _r = $f._r; _r$1 = $f._r$1; l = $f.l; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: l = this; _r = fmt.Sprint(v); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg = _r; _r$1 = l.Output(2, _arg); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Logger.ptr.prototype.Print }; } $f._arg = _arg; $f._r = _r; $f._r$1 = _r$1; $f.l = l; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Logger.prototype.Print = function(v) { return this.$val.Print(v); }; Logger.ptr.prototype.Println = function(v) { var _arg, _r, _r$1, l, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _r = $f._r; _r$1 = $f._r$1; l = $f.l; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: l = this; _r = fmt.Sprintln(v); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg = _r; _r$1 = l.Output(2, _arg); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Logger.ptr.prototype.Println }; } $f._arg = _arg; $f._r = _r; $f._r$1 = _r$1; $f.l = l; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Logger.prototype.Println = function(v) { return this.$val.Println(v); }; Logger.ptr.prototype.Fatal = function(v) { var _arg, _r, _r$1, l, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _r = $f._r; _r$1 = $f._r$1; l = $f.l; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: l = this; _r = fmt.Sprint(v); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg = _r; _r$1 = l.Output(2, _arg); /* */ $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 = os.Exit(1); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Logger.ptr.prototype.Fatal }; } $f._arg = _arg; $f._r = _r; $f._r$1 = _r$1; $f.l = l; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Logger.prototype.Fatal = function(v) { return this.$val.Fatal(v); }; Logger.ptr.prototype.Fatalf = function(format, v) { var _arg, _r, _r$1, format, l, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _r = $f._r; _r$1 = $f._r$1; format = $f.format; l = $f.l; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: l = this; _r = fmt.Sprintf(format, v); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg = _r; _r$1 = l.Output(2, _arg); /* */ $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 = os.Exit(1); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Logger.ptr.prototype.Fatalf }; } $f._arg = _arg; $f._r = _r; $f._r$1 = _r$1; $f.format = format; $f.l = l; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Logger.prototype.Fatalf = function(format, v) { return this.$val.Fatalf(format, v); }; Logger.ptr.prototype.Fatalln = function(v) { var _arg, _r, _r$1, l, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _r = $f._r; _r$1 = $f._r$1; l = $f.l; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: l = this; _r = fmt.Sprintln(v); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg = _r; _r$1 = l.Output(2, _arg); /* */ $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 = os.Exit(1); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Logger.ptr.prototype.Fatalln }; } $f._arg = _arg; $f._r = _r; $f._r$1 = _r$1; $f.l = l; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Logger.prototype.Fatalln = function(v) { return this.$val.Fatalln(v); }; Logger.ptr.prototype.Panic = function(v) { var _r, _r$1, l, s, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; l = $f.l; s = $f.s; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: l = this; _r = fmt.Sprint(v); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } s = _r; _r$1 = l.Output(2, s); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $panic(new $String(s)); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Logger.ptr.prototype.Panic }; } $f._r = _r; $f._r$1 = _r$1; $f.l = l; $f.s = s; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Logger.prototype.Panic = function(v) { return this.$val.Panic(v); }; Logger.ptr.prototype.Panicf = function(format, v) { var _r, _r$1, format, l, s, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; format = $f.format; l = $f.l; s = $f.s; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: l = this; _r = fmt.Sprintf(format, v); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } s = _r; _r$1 = l.Output(2, s); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $panic(new $String(s)); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Logger.ptr.prototype.Panicf }; } $f._r = _r; $f._r$1 = _r$1; $f.format = format; $f.l = l; $f.s = s; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Logger.prototype.Panicf = function(format, v) { return this.$val.Panicf(format, v); }; Logger.ptr.prototype.Panicln = function(v) { var _r, _r$1, l, s, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; l = $f.l; s = $f.s; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: l = this; _r = fmt.Sprintln(v); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } s = _r; _r$1 = l.Output(2, s); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $panic(new $String(s)); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Logger.ptr.prototype.Panicln }; } $f._r = _r; $f._r$1 = _r$1; $f.l = l; $f.s = s; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Logger.prototype.Panicln = function(v) { return this.$val.Panicln(v); }; Logger.ptr.prototype.Flags = function() { var $24r, l, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; l = $f.l; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); l = this; l.mu.Lock(); $deferred.push([$methodVal(l.mu, "Unlock"), []]); $24r = l.flag; $s = 1; case 1: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; return 0; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Logger.ptr.prototype.Flags }; } $f.$24r = $24r; $f.l = l; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Logger.prototype.Flags = function() { return this.$val.Flags(); }; Logger.ptr.prototype.SetFlags = function(flag) { var flag, l, $deferred; /* */ var $err = null; try { $deferred = []; $curGoroutine.deferStack.push($deferred); l = this; l.mu.Lock(); $deferred.push([$methodVal(l.mu, "Unlock"), []]); l.flag = flag; /* */ } catch(err) { $err = err; } finally { $callDeferred($deferred, $err); } }; Logger.prototype.SetFlags = function(flag) { return this.$val.SetFlags(flag); }; Logger.ptr.prototype.Prefix = function() { var $24r, l, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; l = $f.l; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); l = this; l.mu.Lock(); $deferred.push([$methodVal(l.mu, "Unlock"), []]); $24r = l.prefix; $s = 1; case 1: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; return ""; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Logger.ptr.prototype.Prefix }; } $f.$24r = $24r; $f.l = l; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Logger.prototype.Prefix = function() { return this.$val.Prefix(); }; Logger.ptr.prototype.SetPrefix = function(prefix) { var l, prefix, $deferred; /* */ var $err = null; try { $deferred = []; $curGoroutine.deferStack.push($deferred); l = this; l.mu.Lock(); $deferred.push([$methodVal(l.mu, "Unlock"), []]); l.prefix = prefix; /* */ } catch(err) { $err = err; } finally { $callDeferred($deferred, $err); } }; Logger.prototype.SetPrefix = function(prefix) { return this.$val.SetPrefix(prefix); }; Logger.ptr.prototype.Writer = function() { var $24r, l, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; l = $f.l; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); l = this; l.mu.Lock(); $deferred.push([$methodVal(l.mu, "Unlock"), []]); $24r = l.out; $s = 1; case 1: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Logger.ptr.prototype.Writer }; } $f.$24r = $24r; $f.l = l; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Logger.prototype.Writer = function() { return this.$val.Writer(); }; Printf = function(format, v) { var _arg, _r, _r$1, format, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _r = $f._r; _r$1 = $f._r$1; format = $f.format; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = fmt.Sprintf(format, v); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg = _r; _r$1 = std.Output(2, _arg); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Printf }; } $f._arg = _arg; $f._r = _r; $f._r$1 = _r$1; $f.format = format; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Printf = Printf; Fatalf = function(format, v) { var _arg, _r, _r$1, format, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _r = $f._r; _r$1 = $f._r$1; format = $f.format; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = fmt.Sprintf(format, v); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg = _r; _r$1 = std.Output(2, _arg); /* */ $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 = os.Exit(1); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Fatalf }; } $f._arg = _arg; $f._r = _r; $f._r$1 = _r$1; $f.format = format; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Fatalf = Fatalf; ptrType$1.methods = [{prop: "SetOutput", name: "SetOutput", pkg: "", typ: $funcType([io.Writer], [], false)}, {prop: "formatHeader", name: "formatHeader", pkg: "log", typ: $funcType([ptrType, time.Time, $String, $Int], [], false)}, {prop: "Output", name: "Output", pkg: "", typ: $funcType([$Int, $String], [$error], false)}, {prop: "Printf", name: "Printf", pkg: "", typ: $funcType([$String, sliceType$1], [], true)}, {prop: "Print", name: "Print", pkg: "", typ: $funcType([sliceType$1], [], true)}, {prop: "Println", name: "Println", pkg: "", typ: $funcType([sliceType$1], [], true)}, {prop: "Fatal", name: "Fatal", pkg: "", typ: $funcType([sliceType$1], [], true)}, {prop: "Fatalf", name: "Fatalf", pkg: "", typ: $funcType([$String, sliceType$1], [], true)}, {prop: "Fatalln", name: "Fatalln", pkg: "", typ: $funcType([sliceType$1], [], true)}, {prop: "Panic", name: "Panic", pkg: "", typ: $funcType([sliceType$1], [], true)}, {prop: "Panicf", name: "Panicf", pkg: "", typ: $funcType([$String, sliceType$1], [], true)}, {prop: "Panicln", name: "Panicln", pkg: "", typ: $funcType([sliceType$1], [], true)}, {prop: "Flags", name: "Flags", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "SetFlags", name: "SetFlags", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Prefix", name: "Prefix", pkg: "", typ: $funcType([], [$String], false)}, {prop: "SetPrefix", name: "SetPrefix", pkg: "", typ: $funcType([$String], [], false)}, {prop: "Writer", name: "Writer", pkg: "", typ: $funcType([], [io.Writer], false)}]; Logger.init("log", [{prop: "mu", name: "mu", embedded: false, exported: false, typ: nosync.Mutex, tag: ""}, {prop: "prefix", name: "prefix", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "flag", name: "flag", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "out", name: "out", embedded: false, exported: false, typ: io.Writer, tag: ""}, {prop: "buf", name: "buf", embedded: false, exported: false, typ: sliceType, 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 = fmt.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = nosync.$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 = runtime.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = time.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } std = New(os.Stderr, "", 3); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["mime"] = (function() { var $pkg = {}, $init, bufio, bytes, base64, errors, fmt, io, os, sort, strings, sync, unicode, utf8, sliceType, sliceType$1, sliceType$2, ptrType, mimeGlobs, typeFiles, mimeTypes, mimeTypes$24ptr, mimeTypesLower, mimeTypesLower$24ptr, extensionsMu, extensions, extensions$24ptr, osInitMime, errInvalidWord, maxBase64Len, init, loadMimeGlobsFile, loadMimeFile, initMimeUnix, setExtensionType, FormatMediaType, checkMediaTypeDisposition, ParseMediaType, decode2231Enc, isNotTokenChar, consumeToken, consumeValue, consumeMediaParam, percentHexUnescape, ishex, unhex, isTSpecial, isTokenChar, isToken, needsEncoding; bufio = $packages["bufio"]; bytes = $packages["bytes"]; base64 = $packages["encoding/base64"]; errors = $packages["errors"]; fmt = $packages["fmt"]; io = $packages["io"]; os = $packages["os"]; sort = $packages["sort"]; strings = $packages["strings"]; sync = $packages["sync"]; unicode = $packages["unicode"]; utf8 = $packages["unicode/utf8"]; sliceType = $sliceType($String); sliceType$1 = $sliceType($Uint8); sliceType$2 = $sliceType($emptyInterface); ptrType = $ptrType(strings.Builder); init = function() { osInitMime = initMimeUnix; }; loadMimeGlobsFile = function(filename) { var $24r, $24r$1, _r, _r$1, _r$2, _r$3, _tuple, _tuple$1, err, err$1, extension, f, fields, filename, ok, scanner, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _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; err = $f.err; err$1 = $f.err$1; extension = $f.extension; f = $f.f; fields = $f.fields; filename = $f.filename; ok = $f.ok; scanner = $f.scanner; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); _r = os.Open(filename); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; f = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $24r = err; $s = 4; case 4: return $24r; /* } */ case 3: $deferred.push([$methodVal(f, "Close"), []]); scanner = bufio.NewScanner(f); /* while (true) { */ case 5: _r$1 = scanner.Scan(); /* */ $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)) { break; } */ if(!(_r$1)) { $s = 6; continue; } fields = strings.Split(scanner.Text(), ":"); if (fields.$length < 3 || (0 >= fields.$length ? ($throwRuntimeError("index out of range"), undefined) : fields.$array[fields.$offset + 0]).length < 1 || (2 >= fields.$length ? ($throwRuntimeError("index out of range"), undefined) : fields.$array[fields.$offset + 2]).length < 2) { /* continue; */ $s = 5; continue; } else if (((0 >= fields.$length ? ($throwRuntimeError("index out of range"), undefined) : fields.$array[fields.$offset + 0]).charCodeAt(0) === 35) || !(((2 >= fields.$length ? ($throwRuntimeError("index out of range"), undefined) : fields.$array[fields.$offset + 2]).charCodeAt(0) === 42))) { /* continue; */ $s = 5; continue; } extension = $substring((2 >= fields.$length ? ($throwRuntimeError("index out of range"), undefined) : fields.$array[fields.$offset + 2]), 1); _r$2 = mimeTypes.Load(new $String(extension)); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; ok = _tuple$1[1]; if (ok) { /* continue; */ $s = 5; continue; } _r$3 = setExtensionType(extension, (1 >= fields.$length ? ($throwRuntimeError("index out of range"), undefined) : fields.$array[fields.$offset + 1])); /* */ $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 = 5; continue; case 6: err$1 = scanner.Err(); if (!($interfaceIsEqual(err$1, $ifaceNil))) { $panic(err$1); } $24r$1 = $ifaceNil; $s = 10; case 10: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: loadMimeGlobsFile }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $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.err = err; $f.err$1 = err$1; $f.extension = extension; $f.f = f; $f.fields = fields; $f.filename = filename; $f.ok = ok; $f.scanner = scanner; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; loadMimeFile = function(filename) { var _i, _r, _r$1, _r$2, _r$3, _ref, _tuple, err, err$1, ext, f, fields, filename, mimeType, scanner, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; _tuple = $f._tuple; err = $f.err; err$1 = $f.err$1; ext = $f.ext; f = $f.f; fields = $f.fields; filename = $f.filename; mimeType = $f.mimeType; scanner = $f.scanner; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); _r = os.Open(filename); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; f = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $s = 4; case 4: return; /* } */ case 3: $deferred.push([$methodVal(f, "Close"), []]); scanner = bufio.NewScanner(f); /* while (true) { */ case 5: _r$1 = scanner.Scan(); /* */ $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)) { break; } */ if(!(_r$1)) { $s = 6; continue; } _r$2 = strings.Fields(scanner.Text()); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } fields = _r$2; if (fields.$length <= 1 || ((0 >= fields.$length ? ($throwRuntimeError("index out of range"), undefined) : fields.$array[fields.$offset + 0]).charCodeAt(0) === 35)) { /* continue; */ $s = 5; continue; } mimeType = (0 >= fields.$length ? ($throwRuntimeError("index out of range"), undefined) : fields.$array[fields.$offset + 0]); _ref = $subslice(fields, 1); _i = 0; /* while (true) { */ case 9: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 10; continue; } ext = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (ext.charCodeAt(0) === 35) { /* break; */ $s = 10; continue; } _r$3 = setExtensionType("." + ext, mimeType); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _i++; $s = 9; continue; case 10: $s = 5; continue; case 6: err$1 = scanner.Err(); if (!($interfaceIsEqual(err$1, $ifaceNil))) { $panic(err$1); } $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: loadMimeFile }; } $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._tuple = _tuple; $f.err = err; $f.err$1 = err$1; $f.ext = ext; $f.f = f; $f.fields = fields; $f.filename = filename; $f.mimeType = mimeType; $f.scanner = scanner; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; initMimeUnix = function() { var _i, _i$1, _r, _ref, _ref$1, err, filename, filename$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _ref = $f._ref; _ref$1 = $f._ref$1; err = $f.err; filename = $f.filename; filename$1 = $f.filename$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _ref = mimeGlobs; _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"), undefined) : _ref.$array[_ref.$offset + _i]); _r = loadMimeGlobsFile(filename); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if ($interfaceIsEqual(err, $ifaceNil)) { $s = -1; return; } _i++; $s = 1; continue; case 2: _ref$1 = typeFiles; _i$1 = 0; /* while (true) { */ case 4: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 5; continue; } filename$1 = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); $r = loadMimeFile(filename$1); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i$1++; $s = 4; continue; case 5: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: initMimeUnix }; } $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._ref = _ref; $f._ref$1 = _ref$1; $f.err = err; $f.filename = filename; $f.filename$1 = filename$1; $f.$s = $s; $f.$r = $r; return $f; }; setExtensionType = function(extension, mimeType) { var $24r, $24r$1, $24r$2, _entry, _i, _key, _r, _r$1, _r$2, _r$3, _ref, _tuple, _tuple$1, ei, err, extLower, extension, exts, justType, mimeType, ok, param, v, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _entry = $f._entry; _i = $f._i; _key = $f._key; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; ei = $f.ei; err = $f.err; extLower = $f.extLower; extension = $f.extension; exts = $f.exts; justType = $f.justType; mimeType = $f.mimeType; ok = $f.ok; param = $f.param; v = $f.v; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); _r = ParseMediaType(mimeType); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; justType = _tuple[0]; param = _tuple[1]; err = _tuple[2]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $24r = err; $s = 4; case 4: return $24r; /* } */ case 3: /* */ if (strings.HasPrefix(mimeType, "text/") && (_entry = param[$String.keyFor("charset")], _entry !== undefined ? _entry.v : "") === "") { $s = 5; continue; } /* */ $s = 6; continue; /* if (strings.HasPrefix(mimeType, "text/") && (_entry = param[$String.keyFor("charset")], _entry !== undefined ? _entry.v : "") === "") { */ case 5: _key = "charset"; (param || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: "utf-8" }; _r$1 = FormatMediaType(mimeType, param); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } mimeType = _r$1; /* } */ case 6: _r$2 = strings.ToLower(extension); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } extLower = _r$2; $r = mimeTypes.Store(new $String(extension), new $String(mimeType)); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = mimeTypesLower.Store(new $String(extLower), new $String(mimeType)); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = extensionsMu.Lock(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(extensionsMu, "Unlock"), []]); exts = sliceType.nil; _r$3 = extensions.Load(new $String(justType)); /* */ $s = 12; case 12: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$1 = _r$3; ei = _tuple$1[0]; ok = _tuple$1[1]; if (ok) { exts = $assertType(ei, sliceType); } _ref = exts; _i = 0; /* while (true) { */ case 13: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 14; continue; } v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); /* */ if (v === extLower) { $s = 15; continue; } /* */ $s = 16; continue; /* if (v === extLower) { */ case 15: $24r$1 = $ifaceNil; $s = 17; case 17: return $24r$1; /* } */ case 16: _i++; $s = 13; continue; case 14: $r = extensions.Store(new $String(justType), $append(exts, extLower)); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $24r$2 = $ifaceNil; $s = 19; case 19: return $24r$2; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: setExtensionType }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._entry = _entry; $f._i = _i; $f._key = _key; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.ei = ei; $f.err = err; $f.extLower = extLower; $f.extension = extension; $f.exts = exts; $f.justType = justType; $f.mimeType = mimeType; $f.ok = ok; $f.param = param; $f.v = v; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FormatMediaType = function(t, param) { var _entry, _entry$1, _i, _i$1, _keys, _r, _r$1, _r$10, _r$11, _r$12, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _ref$1, _tmp, _tmp$1, _v, a, attribute, attrs, b, ch, character, index, index$1, major, needEnc, offset, offset$1, param, slash, sub, t, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _i = $f._i; _i$1 = $f._i$1; _keys = $f._keys; _r = $f._r; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _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; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _v = $f._v; a = $f.a; attribute = $f.attribute; attrs = $f.attrs; b = $f.b; ch = $f.ch; character = $f.character; index = $f.index; index$1 = $f.index$1; major = $f.major; needEnc = $f.needEnc; offset = $f.offset; offset$1 = $f.offset$1; param = $f.param; slash = $f.slash; sub = $f.sub; t = $f.t; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = new strings.Builder.ptr(ptrType.nil, sliceType$1.nil); slash = strings.IndexByte(t, 47); /* */ if (slash === -1) { $s = 1; continue; } /* */ $s = 2; continue; /* if (slash === -1) { */ case 1: _r = isToken(t); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (!_r) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!_r) { */ case 4: $s = -1; return ""; /* } */ case 5: _r$1 = strings.ToLower(t); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = b.WriteString(_r$1); /* */ $s = 8; case 8: 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: _tmp = $substring(t, 0, slash); _tmp$1 = $substring(t, (slash + 1 >> 0)); major = _tmp; sub = _tmp$1; _r$3 = isToken(major); /* */ $s = 12; case 12: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } if (!_r$3) { _v = true; $s = 11; continue s; } _r$4 = isToken(sub); /* */ $s = 13; case 13: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _v = !_r$4; case 11: /* */ if (_v) { $s = 9; continue; } /* */ $s = 10; continue; /* if (_v) { */ case 9: $s = -1; return ""; /* } */ case 10: _r$5 = strings.ToLower(major); /* */ $s = 14; case 14: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$6 = b.WriteString(_r$5); /* */ $s = 15; case 15: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; b.WriteByte(47); _r$7 = strings.ToLower(sub); /* */ $s = 16; case 16: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$8 = b.WriteString(_r$7); /* */ $s = 17; case 17: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$8; /* } */ case 3: attrs = $makeSlice(sliceType, 0, $keys(param).length); _ref = param; _i = 0; _keys = $keys(_ref); while (true) { if (!(_i < _keys.length)) { break; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; continue; } a = _entry.k; attrs = $append(attrs, a); _i++; } $r = sort.Strings(attrs); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _ref$1 = attrs; _i$1 = 0; /* while (true) { */ case 19: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 20; continue; } attribute = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); value = (_entry$1 = param[$String.keyFor(attribute)], _entry$1 !== undefined ? _entry$1.v : ""); b.WriteByte(59); b.WriteByte(32); _r$9 = isToken(attribute); /* */ $s = 23; case 23: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } /* */ if (!_r$9) { $s = 21; continue; } /* */ $s = 22; continue; /* if (!_r$9) { */ case 21: $s = -1; return ""; /* } */ case 22: _r$10 = strings.ToLower(attribute); /* */ $s = 24; case 24: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$11 = b.WriteString(_r$10); /* */ $s = 25; case 25: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _r$11; needEnc = needsEncoding(value); if (needEnc) { b.WriteByte(42); } b.WriteByte(61); if (needEnc) { b.WriteString("utf-8''"); offset = 0; index = 0; while (true) { if (!(index < value.length)) { break; } ch = value.charCodeAt(index); if (ch <= 32 || ch >= 127 || (ch === 42) || (ch === 39) || (ch === 37) || isTSpecial(((ch >> 0)))) { b.WriteString($substring(value, offset, index)); offset = index + 1 >> 0; b.WriteByte(37); b.WriteByte("0123456789ABCDEF".charCodeAt((ch >>> 4 << 24 >>> 24))); b.WriteByte("0123456789ABCDEF".charCodeAt(((ch & 15) >>> 0))); } index = index + (1) >> 0; } b.WriteString($substring(value, offset)); _i$1++; /* continue; */ $s = 19; continue; } _r$12 = isToken(value); /* */ $s = 28; case 28: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } /* */ if (_r$12) { $s = 26; continue; } /* */ $s = 27; continue; /* if (_r$12) { */ case 26: b.WriteString(value); _i$1++; /* continue; */ $s = 19; continue; /* } */ case 27: b.WriteByte(34); offset$1 = 0; index$1 = 0; while (true) { if (!(index$1 < value.length)) { break; } character = value.charCodeAt(index$1); if ((character === 34) || (character === 92)) { b.WriteString($substring(value, offset$1, index$1)); offset$1 = index$1; b.WriteByte(92); } index$1 = index$1 + (1) >> 0; } b.WriteString($substring(value, offset$1)); b.WriteByte(34); _i$1++; $s = 19; continue; case 20: $s = -1; return b.String(); /* */ } return; } if ($f === undefined) { $f = { $blk: FormatMediaType }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._i = _i; $f._i$1 = _i$1; $f._keys = _keys; $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$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._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._v = _v; $f.a = a; $f.attribute = attribute; $f.attrs = attrs; $f.b = b; $f.ch = ch; $f.character = character; $f.index = index; $f.index$1 = index$1; $f.major = major; $f.needEnc = needEnc; $f.offset = offset; $f.offset$1 = offset$1; $f.param = param; $f.slash = slash; $f.sub = sub; $f.t = t; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.FormatMediaType = FormatMediaType; checkMediaTypeDisposition = function(s) { var _r, _r$1, _tuple, _tuple$1, rest, s, subtype, typ, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; rest = $f.rest; s = $f.s; subtype = $f.subtype; typ = $f.typ; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = consumeToken(s); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; typ = _tuple[0]; rest = _tuple[1]; if (typ === "") { $s = -1; return errors.New("mime: no media type"); } if (rest === "") { $s = -1; return $ifaceNil; } if (!strings.HasPrefix(rest, "/")) { $s = -1; return errors.New("mime: expected slash after first token"); } _r$1 = consumeToken($substring(rest, 1)); /* */ $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; subtype = _tuple$1[0]; rest = _tuple$1[1]; if (subtype === "") { $s = -1; return errors.New("mime: expected token after slash"); } if (!(rest === "")) { $s = -1; return errors.New("mime: unexpected content after media subtype"); } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: checkMediaTypeDisposition }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.rest = rest; $f.s = s; $f.subtype = subtype; $f.typ = typ; $f.$s = $s; $f.$r = $r; return $f; }; ParseMediaType = function(v) { var _entry, _entry$1, _entry$2, _entry$3, _entry$4, _entry$5, _entry$6, _i, _key, _key$1, _key$2, _key$3, _keys, _r, _r$1, _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, _tmp$6, _tmp$7, _tmp$8, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, _tuple$8, baseName, buf, continuation, decv, decv$1, decv$2, encodedPart, err, exists, i, idx, key, key$1, mediatype, n, ok, ok$1, ok$2, ok$3, ok$4, ok$5, params, pieceMap, pmap, rest, simplePart, singlePartKey, v, v$1, v$2, v$3, valid, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _entry$2 = $f._entry$2; _entry$3 = $f._entry$3; _entry$4 = $f._entry$4; _entry$5 = $f._entry$5; _entry$6 = $f._entry$6; _i = $f._i; _key = $f._key; _key$1 = $f._key$1; _key$2 = $f._key$2; _key$3 = $f._key$3; _keys = $f._keys; _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; _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; _tmp$8 = $f._tmp$8; _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; _tuple$8 = $f._tuple$8; baseName = $f.baseName; buf = $f.buf; continuation = $f.continuation; decv = $f.decv; decv$1 = $f.decv$1; decv$2 = $f.decv$2; encodedPart = $f.encodedPart; err = $f.err; exists = $f.exists; i = $f.i; idx = $f.idx; key = $f.key; key$1 = $f.key$1; mediatype = $f.mediatype; n = $f.n; ok = $f.ok; ok$1 = $f.ok$1; ok$2 = $f.ok$2; ok$3 = $f.ok$3; ok$4 = $f.ok$4; ok$5 = $f.ok$5; params = $f.params; pieceMap = $f.pieceMap; pmap = $f.pmap; rest = $f.rest; simplePart = $f.simplePart; singlePartKey = $f.singlePartKey; v = $f.v; v$1 = $f.v$1; v$2 = $f.v$2; v$3 = $f.v$3; valid = $f.valid; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: mediatype = ""; params = false; err = $ifaceNil; i = strings.Index(v, ";"); if (i === -1) { i = v.length; } _r = strings.ToLower($substring(v, 0, i)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = strings.TrimSpace(_r); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } mediatype = _r$1; _r$2 = checkMediaTypeDisposition(mediatype); /* */ $s = 3; case 3: 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))) { _tmp = ""; _tmp$1 = false; _tmp$2 = err; mediatype = _tmp; params = _tmp$1; err = _tmp$2; $s = -1; return [mediatype, params, err]; } params = {}; continuation = false; v = $substring(v, i); /* while (true) { */ case 4: /* if (!(v.length > 0)) { break; } */ if(!(v.length > 0)) { $s = 5; continue; } _r$3 = strings.TrimLeftFunc(v, unicode.IsSpace); /* */ $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; if (v.length === 0) { /* break; */ $s = 5; continue; } _r$4 = consumeMediaParam(v); /* */ $s = 7; case 7: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple = _r$4; key = _tuple[0]; value = _tuple[1]; rest = _tuple[2]; /* */ if (key === "") { $s = 8; continue; } /* */ $s = 9; continue; /* if (key === "") { */ case 8: _r$5 = strings.TrimSpace(rest); /* */ $s = 12; case 12: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } /* */ if (_r$5 === ";") { $s = 10; continue; } /* */ $s = 11; continue; /* if (_r$5 === ";") { */ case 10: $s = -1; return [mediatype, params, err]; /* } */ case 11: _tmp$3 = mediatype; _tmp$4 = false; _tmp$5 = $pkg.ErrInvalidMediaParameter; mediatype = _tmp$3; params = _tmp$4; err = _tmp$5; $s = -1; return [mediatype, params, err]; /* } */ case 9: pmap = params; idx = strings.Index(key, "*"); if (!((idx === -1))) { baseName = $substring(key, 0, idx); if (continuation === false) { continuation = {}; } ok = false; _tuple$1 = (_entry = continuation[$String.keyFor(baseName)], _entry !== undefined ? [_entry.v, true] : [false, false]); pmap = _tuple$1[0]; ok = _tuple$1[1]; if (!ok) { _key = baseName; (continuation || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: {} }; pmap = (_entry$1 = continuation[$String.keyFor(baseName)], _entry$1 !== undefined ? _entry$1.v : false); } } _tuple$2 = (_entry$2 = pmap[$String.keyFor(key)], _entry$2 !== undefined ? [_entry$2.v, true] : ["", false]); exists = _tuple$2[1]; if (exists) { _tmp$6 = ""; _tmp$7 = false; _tmp$8 = errors.New("mime: duplicate parameter name"); mediatype = _tmp$6; params = _tmp$7; err = _tmp$8; $s = -1; return [mediatype, params, err]; } _key$1 = key; (pmap || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key$1)] = { k: _key$1, v: value }; v = rest; $s = 4; continue; case 5: buf = new strings.Builder.ptr(ptrType.nil, sliceType$1.nil); _ref = continuation; _i = 0; _keys = $keys(_ref); /* while (true) { */ case 13: /* if (!(_i < _keys.length)) { break; } */ if(!(_i < _keys.length)) { $s = 14; continue; } _entry$3 = _ref[_keys[_i]]; if (_entry$3 === undefined) { _i++; /* continue; */ $s = 13; continue; } key$1 = _entry$3.k; pieceMap = _entry$3.v; singlePartKey = key$1 + "*"; _tuple$3 = (_entry$4 = pieceMap[$String.keyFor(singlePartKey)], _entry$4 !== undefined ? [_entry$4.v, true] : ["", false]); v$1 = _tuple$3[0]; ok$1 = _tuple$3[1]; /* */ if (ok$1) { $s = 15; continue; } /* */ $s = 16; continue; /* if (ok$1) { */ case 15: _r$6 = decode2231Enc(v$1); /* */ $s = 17; case 17: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tuple$4 = _r$6; decv = _tuple$4[0]; ok$2 = _tuple$4[1]; if (ok$2) { _key$2 = key$1; (params || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key$2)] = { k: _key$2, v: decv }; } _i++; /* continue; */ $s = 13; continue; /* } */ case 16: buf.Reset(); valid = false; n = 0; /* while (true) { */ case 18: _r$7 = fmt.Sprintf("%s*%d", new sliceType$2([new $String(key$1), new $Int(n)])); /* */ $s = 20; case 20: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } simplePart = _r$7; _tuple$5 = (_entry$5 = pieceMap[$String.keyFor(simplePart)], _entry$5 !== undefined ? [_entry$5.v, true] : ["", false]); v$2 = _tuple$5[0]; ok$3 = _tuple$5[1]; if (ok$3) { valid = true; buf.WriteString(v$2); n = n + (1) >> 0; /* continue; */ $s = 18; continue; } encodedPart = simplePart + "*"; _tuple$6 = (_entry$6 = pieceMap[$String.keyFor(encodedPart)], _entry$6 !== undefined ? [_entry$6.v, true] : ["", false]); v$3 = _tuple$6[0]; ok$4 = _tuple$6[1]; if (!ok$4) { /* break; */ $s = 19; continue; } valid = true; /* */ if (n === 0) { $s = 21; continue; } /* */ $s = 22; continue; /* if (n === 0) { */ case 21: _r$8 = decode2231Enc(v$3); /* */ $s = 24; case 24: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _tuple$7 = _r$8; decv$1 = _tuple$7[0]; ok$5 = _tuple$7[1]; if (ok$5) { buf.WriteString(decv$1); } $s = 23; continue; /* } else { */ case 22: _r$9 = percentHexUnescape(v$3); /* */ $s = 25; case 25: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple$8 = _r$9; decv$2 = _tuple$8[0]; buf.WriteString(decv$2); /* } */ case 23: n = n + (1) >> 0; $s = 18; continue; case 19: if (valid) { _key$3 = key$1; (params || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key$3)] = { k: _key$3, v: buf.String() }; } _i++; $s = 13; continue; case 14: $s = -1; return [mediatype, params, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: ParseMediaType }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._entry$2 = _entry$2; $f._entry$3 = _entry$3; $f._entry$4 = _entry$4; $f._entry$5 = _entry$5; $f._entry$6 = _entry$6; $f._i = _i; $f._key = _key; $f._key$1 = _key$1; $f._key$2 = _key$2; $f._key$3 = _key$3; $f._keys = _keys; $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._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._tmp$8 = _tmp$8; $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._tuple$8 = _tuple$8; $f.baseName = baseName; $f.buf = buf; $f.continuation = continuation; $f.decv = decv; $f.decv$1 = decv$1; $f.decv$2 = decv$2; $f.encodedPart = encodedPart; $f.err = err; $f.exists = exists; $f.i = i; $f.idx = idx; $f.key = key; $f.key$1 = key$1; $f.mediatype = mediatype; $f.n = n; $f.ok = ok; $f.ok$1 = ok$1; $f.ok$2 = ok$2; $f.ok$3 = ok$3; $f.ok$4 = ok$4; $f.ok$5 = ok$5; $f.params = params; $f.pieceMap = pieceMap; $f.pmap = pmap; $f.rest = rest; $f.simplePart = simplePart; $f.singlePartKey = singlePartKey; $f.v = v; $f.v$1 = v$1; $f.v$2 = v$2; $f.v$3 = v$3; $f.valid = valid; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.ParseMediaType = ParseMediaType; decode2231Enc = function(v) { var _r, _r$1, _tuple, charset, encv, err, sv, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; charset = $f.charset; encv = $f.encv; err = $f.err; sv = $f.sv; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sv = strings.SplitN(v, "'", 3); if (!((sv.$length === 3))) { $s = -1; return ["", false]; } _r = strings.ToLower((0 >= sv.$length ? ($throwRuntimeError("index out of range"), undefined) : sv.$array[sv.$offset + 0])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } charset = _r; if (charset.length === 0) { $s = -1; return ["", false]; } if (!(charset === "us-ascii") && !(charset === "utf-8")) { $s = -1; return ["", false]; } _r$1 = percentHexUnescape((2 >= sv.$length ? ($throwRuntimeError("index out of range"), undefined) : sv.$array[sv.$offset + 2])); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; encv = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return ["", false]; } $s = -1; return [encv, true]; /* */ } return; } if ($f === undefined) { $f = { $blk: decode2231Enc }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.charset = charset; $f.encv = encv; $f.err = err; $f.sv = sv; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; isNotTokenChar = function(r) { var r; return !isTokenChar(r); }; consumeToken = function(v) { var _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, notPos, rest, token, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; notPos = $f.notPos; rest = $f.rest; token = $f.token; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: token = ""; rest = ""; _r = strings.IndexFunc(v, isNotTokenChar); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } notPos = _r; if (notPos === -1) { _tmp = v; _tmp$1 = ""; token = _tmp; rest = _tmp$1; $s = -1; return [token, rest]; } if (notPos === 0) { _tmp$2 = ""; _tmp$3 = v; token = _tmp$2; rest = _tmp$3; $s = -1; return [token, rest]; } _tmp$4 = $substring(v, 0, notPos); _tmp$5 = $substring(v, notPos); token = _tmp$4; rest = _tmp$5; $s = -1; return [token, rest]; /* */ } return; } if ($f === undefined) { $f = { $blk: consumeToken }; } $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.notPos = notPos; $f.rest = rest; $f.token = token; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; consumeValue = function(v) { var $24r, _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, buffer, i, r, rest, v, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; buffer = $f.buffer; i = $f.i; r = $f.r; rest = $f.rest; v = $f.v; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: value = ""; rest = ""; if (v === "") { $s = -1; return [value, rest]; } /* */ if (!((v.charCodeAt(0) === 34))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((v.charCodeAt(0) === 34))) { */ case 1: _r = consumeToken(v); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; value = _tuple[0]; rest = _tuple[1]; $24r = [value, rest]; $s = 4; case 4: return $24r; /* } */ case 2: buffer = new strings.Builder.ptr(ptrType.nil, sliceType$1.nil); i = 1; while (true) { if (!(i < v.length)) { break; } r = v.charCodeAt(i); if (r === 34) { _tmp = buffer.String(); _tmp$1 = $substring(v, (i + 1 >> 0)); value = _tmp; rest = _tmp$1; $s = -1; return [value, rest]; } if ((r === 92) && (i + 1 >> 0) < v.length && isTSpecial(((v.charCodeAt((i + 1 >> 0)) >> 0)))) { buffer.WriteByte(v.charCodeAt((i + 1 >> 0))); i = i + (1) >> 0; i = i + (1) >> 0; continue; } if ((r === 13) || (r === 10)) { _tmp$2 = ""; _tmp$3 = v; value = _tmp$2; rest = _tmp$3; $s = -1; return [value, rest]; } buffer.WriteByte(v.charCodeAt(i)); i = i + (1) >> 0; } _tmp$4 = ""; _tmp$5 = v; value = _tmp$4; rest = _tmp$5; $s = -1; return [value, rest]; /* */ } return; } if ($f === undefined) { $f = { $blk: consumeValue }; } $f.$24r = $24r; $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.buffer = buffer; $f.i = i; $f.r = r; $f.rest = rest; $f.v = v; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; consumeMediaParam = function(v) { var _r, _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$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, param, rest, rest2, v, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; _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$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; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; param = $f.param; rest = $f.rest; rest2 = $f.rest2; v = $f.v; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: param = ""; value = ""; rest = ""; _r = strings.TrimLeftFunc(v, unicode.IsSpace); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } rest = _r; if (!strings.HasPrefix(rest, ";")) { _tmp = ""; _tmp$1 = ""; _tmp$2 = v; param = _tmp; value = _tmp$1; rest = _tmp$2; $s = -1; return [param, value, rest]; } rest = $substring(rest, 1); _r$1 = strings.TrimLeftFunc(rest, unicode.IsSpace); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } rest = _r$1; _r$2 = consumeToken(rest); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; param = _tuple[0]; rest = _tuple[1]; _r$3 = strings.ToLower(param); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } param = _r$3; if (param === "") { _tmp$3 = ""; _tmp$4 = ""; _tmp$5 = v; param = _tmp$3; value = _tmp$4; rest = _tmp$5; $s = -1; return [param, value, rest]; } _r$4 = strings.TrimLeftFunc(rest, unicode.IsSpace); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } rest = _r$4; if (!strings.HasPrefix(rest, "=")) { _tmp$6 = ""; _tmp$7 = ""; _tmp$8 = v; param = _tmp$6; value = _tmp$7; rest = _tmp$8; $s = -1; return [param, value, rest]; } rest = $substring(rest, 1); _r$5 = strings.TrimLeftFunc(rest, unicode.IsSpace); /* */ $s = 6; case 6: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } rest = _r$5; _r$6 = consumeValue(rest); /* */ $s = 7; case 7: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tuple$1 = _r$6; value = _tuple$1[0]; rest2 = _tuple$1[1]; if (value === "" && rest2 === rest) { _tmp$9 = ""; _tmp$10 = ""; _tmp$11 = v; param = _tmp$9; value = _tmp$10; rest = _tmp$11; $s = -1; return [param, value, rest]; } rest = rest2; _tmp$12 = param; _tmp$13 = value; _tmp$14 = rest; param = _tmp$12; value = _tmp$13; rest = _tmp$14; $s = -1; return [param, value, rest]; /* */ } return; } if ($f === undefined) { $f = { $blk: consumeMediaParam }; } $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._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$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._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.param = param; $f.rest = rest; $f.rest2 = rest2; $f.v = v; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; percentHexUnescape = function(s) { var $24r, _1, _r, i, i$1, j, percents, s, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _1 = $f._1; _r = $f._r; i = $f.i; i$1 = $f.i$1; j = $f.j; percents = $f.percents; s = $f.s; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: percents = 0; i = 0; /* while (true) { */ case 1: /* if (!(i < s.length)) { break; } */ if(!(i < s.length)) { $s = 2; continue; } if (!((s.charCodeAt(i) === 37))) { i = i + (1) >> 0; /* continue; */ $s = 1; continue; } percents = percents + (1) >> 0; /* */ if ((i + 2 >> 0) >= s.length || !ishex(s.charCodeAt((i + 1 >> 0))) || !ishex(s.charCodeAt((i + 2 >> 0)))) { $s = 3; continue; } /* */ $s = 4; continue; /* if ((i + 2 >> 0) >= s.length || !ishex(s.charCodeAt((i + 1 >> 0))) || !ishex(s.charCodeAt((i + 2 >> 0)))) { */ case 3: s = $substring(s, i); if (s.length > 3) { s = $substring(s, 0, 3); } _r = fmt.Errorf("mime: bogus characters after %%: %q", new sliceType$2([new $String(s)])); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = ["", _r]; $s = 6; case 6: return $24r; /* } */ case 4: i = i + (3) >> 0; $s = 1; continue; case 2: if (percents === 0) { $s = -1; return [s, $ifaceNil]; } t = $makeSlice(sliceType$1, (s.length - ($imul(2, percents)) >> 0)); j = 0; i$1 = 0; while (true) { if (!(i$1 < s.length)) { break; } _1 = s.charCodeAt(i$1); if (_1 === (37)) { ((j < 0 || j >= t.$length) ? ($throwRuntimeError("index out of range"), undefined) : t.$array[t.$offset + j] = (((unhex(s.charCodeAt((i$1 + 1 >> 0))) << 4 << 24 >>> 24) | unhex(s.charCodeAt((i$1 + 2 >> 0)))) >>> 0)); j = j + (1) >> 0; i$1 = i$1 + (3) >> 0; } else { ((j < 0 || j >= t.$length) ? ($throwRuntimeError("index out of range"), undefined) : t.$array[t.$offset + j] = s.charCodeAt(i$1)); j = j + (1) >> 0; i$1 = i$1 + (1) >> 0; } } $s = -1; return [($bytesToString(t)), $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: percentHexUnescape }; } $f.$24r = $24r; $f._1 = _1; $f._r = _r; $f.i = i; $f.i$1 = i$1; $f.j = j; $f.percents = percents; $f.s = s; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; ishex = function(c) { var c; if (48 <= c && c <= 57) { return true; } else if (97 <= c && c <= 102) { return true; } else if (65 <= c && c <= 70) { return true; } return false; }; unhex = function(c) { var c; if (48 <= c && c <= 57) { return c - 48 << 24 >>> 24; } else if (97 <= c && c <= 102) { return (c - 97 << 24 >>> 24) + 10 << 24 >>> 24; } else if (65 <= c && c <= 70) { return (c - 65 << 24 >>> 24) + 10 << 24 >>> 24; } return 0; }; isTSpecial = function(r) { var r; return strings.ContainsRune("()<>@,;:\\\"/[]?=", r); }; isTokenChar = function(r) { var r; return r > 32 && r < 127 && !isTSpecial(r); }; isToken = function(s) { var $24r, _r, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (s === "") { $s = -1; return false; } _r = strings.IndexFunc(s, isNotTokenChar); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r < 0; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: isToken }; } $f.$24r = $24r; $f._r = _r; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; needsEncoding = function(s) { var _i, _ref, _rune, b, s; _ref = s; _i = 0; while (true) { if (!(_i < _ref.length)) { break; } _rune = $decodeRune(_ref, _i); b = _rune[0]; if ((b < 32 || b > 126) && !((b === 9))) { return true; } _i += _rune[1]; } return 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 = bufio.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = bytes.$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 = io.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = os.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sort.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strings.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sync.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = unicode.$init(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = utf8.$init(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } mimeTypes = new sync.Map.ptr(new sync.Mutex.ptr(0, 0), new $packages["sync/atomic"].Value.ptr($ifaceNil), false, 0); mimeTypesLower = new sync.Map.ptr(new sync.Mutex.ptr(0, 0), new $packages["sync/atomic"].Value.ptr($ifaceNil), false, 0); extensionsMu = new sync.Mutex.ptr(0, 0); extensions = new sync.Map.ptr(new sync.Mutex.ptr(0, 0), new $packages["sync/atomic"].Value.ptr($ifaceNil), false, 0); osInitMime = $throwNilPointerError; mimeGlobs = new sliceType(["/usr/local/share/mime/globs2", "/usr/share/mime/globs2"]); typeFiles = new sliceType(["/etc/mime.types", "/etc/apache2/mime.types", "/etc/apache/mime.types", "/etc/httpd/conf/mime.types"]); $pkg.ErrInvalidMediaParameter = errors.New("mime: invalid media parameter"); errInvalidWord = errors.New("mime: invalid RFC 2047 encoded-word"); maxBase64Len = base64.StdEncoding.DecodedLen(63); init(); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["mime/quotedprintable"] = (function() { var $pkg = {}, $init, bufio, bytes, fmt, io, Reader, sliceType, ptrType, sliceType$1, ptrType$2, crlf, lf, softSuffix, NewReader, fromHex, readHexByte, isQPDiscardWhitespace; bufio = $packages["bufio"]; bytes = $packages["bytes"]; fmt = $packages["fmt"]; io = $packages["io"]; Reader = $pkg.Reader = $newType(0, $kindStruct, "quotedprintable.Reader", true, "mime/quotedprintable", true, function(br_, rerr_, line_) { this.$val = this; if (arguments.length === 0) { this.br = ptrType.nil; this.rerr = $ifaceNil; this.line = sliceType.nil; return; } this.br = br_; this.rerr = rerr_; this.line = line_; }); sliceType = $sliceType($Uint8); ptrType = $ptrType(bufio.Reader); sliceType$1 = $sliceType($emptyInterface); ptrType$2 = $ptrType(Reader); NewReader = function(r) { var r; return new Reader.ptr(bufio.NewReader(r), $ifaceNil, sliceType.nil); }; $pkg.NewReader = NewReader; fromHex = function(b) { var $24r, _r, b, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; b = $f.b; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (b >= 48 && b <= 57) { $s = -1; return [b - 48 << 24 >>> 24, $ifaceNil]; } else if (b >= 65 && b <= 70) { $s = -1; return [(b - 65 << 24 >>> 24) + 10 << 24 >>> 24, $ifaceNil]; } else if (b >= 97 && b <= 102) { $s = -1; return [(b - 97 << 24 >>> 24) + 10 << 24 >>> 24, $ifaceNil]; } _r = fmt.Errorf("quotedprintable: invalid hex byte 0x%02x", new sliceType$1([new $Uint8(b)])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = [0, _r]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: fromHex }; } $f.$24r = $24r; $f._r = _r; $f.b = b; $f.$s = $s; $f.$r = $r; return $f; }; readHexByte = function(v) { var _r, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, b, err, hb, lb, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$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; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; b = $f.b; err = $f.err; hb = $f.hb; lb = $f.lb; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = 0; err = $ifaceNil; if (v.$length < 2) { _tmp = 0; _tmp$1 = io.ErrUnexpectedEOF; b = _tmp; err = _tmp$1; $s = -1; return [b, err]; } _tmp$2 = 0; _tmp$3 = 0; hb = _tmp$2; lb = _tmp$3; _r = fromHex((0 >= v.$length ? ($throwRuntimeError("index out of range"), undefined) : v.$array[v.$offset + 0])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; hb = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$4 = 0; _tmp$5 = err; b = _tmp$4; err = _tmp$5; $s = -1; return [b, err]; } _r$1 = fromHex((1 >= v.$length ? ($throwRuntimeError("index out of range"), undefined) : v.$array[v.$offset + 1])); /* */ $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; lb = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$6 = 0; _tmp$7 = err; b = _tmp$6; err = _tmp$7; $s = -1; return [b, err]; } _tmp$8 = ((hb << 4 << 24 >>> 24) | lb) >>> 0; _tmp$9 = $ifaceNil; b = _tmp$8; err = _tmp$9; $s = -1; return [b, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: readHexByte }; } $f._r = _r; $f._r$1 = _r$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._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.b = b; $f.err = err; $f.hb = hb; $f.lb = lb; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; isQPDiscardWhitespace = function(r) { var _1, r; _1 = r; if ((_1 === (10)) || (_1 === (13)) || (_1 === (32)) || (_1 === (9))) { return true; } return false; }; Reader.ptr.prototype.Read = function(p) { var $24r, _r, _r$1, _r$2, _r$3, _r$4, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, _tuple$1, b, err, hasCR, hasLF, n, p, r, rightStripped, wholeLine, x, x$1, x$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _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; _tuple$1 = $f._tuple$1; b = $f.b; err = $f.err; hasCR = $f.hasCR; hasLF = $f.hasLF; n = $f.n; p = $f.p; r = $f.r; rightStripped = $f.rightStripped; wholeLine = $f.wholeLine; 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; r = this; /* while (true) { */ case 1: /* if (!(p.$length > 0)) { break; } */ if(!(p.$length > 0)) { $s = 2; continue; } /* */ if (r.line.$length === 0) { $s = 3; continue; } /* */ $s = 4; continue; /* if (r.line.$length === 0) { */ case 3: if (!($interfaceIsEqual(r.rerr, $ifaceNil))) { _tmp = n; _tmp$1 = r.rerr; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } _r = r.br.ReadSlice(10); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; r.line = _tuple[0]; r.rerr = _tuple[1]; hasLF = bytes.HasSuffix(r.line, lf); hasCR = bytes.HasSuffix(r.line, crlf); wholeLine = r.line; _r$1 = bytes.TrimRightFunc(wholeLine, isQPDiscardWhitespace); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } r.line = _r$1; /* */ if (bytes.HasSuffix(r.line, softSuffix)) { $s = 7; continue; } /* */ if (hasLF) { $s = 8; continue; } /* */ $s = 9; continue; /* if (bytes.HasSuffix(r.line, softSuffix)) { */ case 7: rightStripped = $subslice(wholeLine, r.line.$length); r.line = $subslice(r.line, 0, (r.line.$length - 1 >> 0)); /* */ if (!bytes.HasPrefix(rightStripped, lf) && !bytes.HasPrefix(rightStripped, crlf) && !((rightStripped.$length === 0) && r.line.$length > 0 && $interfaceIsEqual(r.rerr, io.EOF))) { $s = 10; continue; } /* */ $s = 11; continue; /* if (!bytes.HasPrefix(rightStripped, lf) && !bytes.HasPrefix(rightStripped, crlf) && !((rightStripped.$length === 0) && r.line.$length > 0 && $interfaceIsEqual(r.rerr, io.EOF))) { */ case 10: _r$2 = fmt.Errorf("quotedprintable: invalid bytes after =: %q", new sliceType$1([rightStripped])); /* */ $s = 12; case 12: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } r.rerr = _r$2; /* } */ case 11: $s = 9; continue; /* } else if (hasLF) { */ case 8: if (hasCR) { r.line = $append(r.line, 13, 10); } else { r.line = $append(r.line, 10); } /* } */ case 9: /* continue; */ $s = 1; continue; /* } */ case 4: b = (x = r.line, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])); /* */ if ((b === 61)) { $s = 14; continue; } /* */ if ((b === 9) || (b === 13) || (b === 10)) { $s = 15; continue; } /* */ if (b >= 128) { $s = 16; continue; } /* */ if (b < 32 || b > 126) { $s = 17; continue; } /* */ $s = 18; continue; /* if ((b === 61)) { */ case 14: _r$3 = readHexByte($subslice(r.line, 1)); /* */ $s = 19; case 19: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$1 = _r$3; b = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { if (r.line.$length >= 2 && !(((x$1 = r.line, (1 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 1])) === 13)) && !(((x$2 = r.line, (1 >= x$2.$length ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + 1])) === 10))) { b = 61; /* break; */ $s = 13; continue; } _tmp$2 = n; _tmp$3 = err; n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; } r.line = $subslice(r.line, 2); $s = 18; continue; /* } else if ((b === 9) || (b === 13) || (b === 10)) { */ case 15: /* break; */ $s = 13; continue; $s = 18; continue; /* } else if (b >= 128) { */ case 16: /* break; */ $s = 13; continue; $s = 18; continue; /* } else if (b < 32 || b > 126) { */ case 17: _tmp$4 = n; _r$4 = fmt.Errorf("quotedprintable: invalid unescaped byte 0x%02x in body", new sliceType$1([new $Uint8(b)])); /* */ $s = 20; case 20: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tmp$5 = _r$4; n = _tmp$4; err = _tmp$5; $24r = [n, err]; $s = 21; case 21: return $24r; /* } */ case 18: case 13: (0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0] = b); p = $subslice(p, 1); r.line = $subslice(r.line, 1); n = n + (1) >> 0; $s = 1; continue; case 2: _tmp$6 = n; _tmp$7 = $ifaceNil; n = _tmp$6; err = _tmp$7; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.Read }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $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._tuple$1 = _tuple$1; $f.b = b; $f.err = err; $f.hasCR = hasCR; $f.hasLF = hasLF; $f.n = n; $f.p = p; $f.r = r; $f.rightStripped = rightStripped; $f.wholeLine = wholeLine; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.Read = function(p) { return this.$val.Read(p); }; ptrType$2.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}]; Reader.init("mime/quotedprintable", [{prop: "br", name: "br", embedded: false, exported: false, typ: ptrType, tag: ""}, {prop: "rerr", name: "rerr", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "line", name: "line", embedded: false, exported: false, typ: sliceType, 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 = bufio.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = bytes.$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 = io.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } crlf = (new sliceType($stringToBytes("\r\n"))); lf = (new sliceType($stringToBytes("\n"))); softSuffix = (new sliceType($stringToBytes("="))); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["net/textproto"] = (function() { var $pkg = {}, $init, bufio, bytes, fmt, io, net, strconv, strings, sync, Error, ProtocolError, Reader, dotReader, MIMEHeader, sliceType, sliceType$1, ptrType$3, ptrType$4, ptrType$6, sliceType$2, ptrType$7, funcType, commonHeader, commonHeaderOnce, isTokenTable, TrimString, isASCIISpace, isASCIILetter, NewReader, trim, parseCodeLine, noValidation, mustHaveFieldNameColon, CanonicalMIMEHeaderKey, validHeaderFieldByte, canonicalMIMEHeaderKey, initCommonHeader; bufio = $packages["bufio"]; bytes = $packages["bytes"]; fmt = $packages["fmt"]; io = $packages["io"]; net = $packages["net"]; strconv = $packages["strconv"]; strings = $packages["strings"]; sync = $packages["sync"]; Error = $pkg.Error = $newType(0, $kindStruct, "textproto.Error", true, "net/textproto", true, function(Code_, Msg_) { this.$val = this; if (arguments.length === 0) { this.Code = 0; this.Msg = ""; return; } this.Code = Code_; this.Msg = Msg_; }); ProtocolError = $pkg.ProtocolError = $newType(8, $kindString, "textproto.ProtocolError", true, "net/textproto", true, null); Reader = $pkg.Reader = $newType(0, $kindStruct, "textproto.Reader", true, "net/textproto", true, function(R_, dot_, buf_) { this.$val = this; if (arguments.length === 0) { this.R = ptrType$3.nil; this.dot = ptrType$4.nil; this.buf = sliceType.nil; return; } this.R = R_; this.dot = dot_; this.buf = buf_; }); dotReader = $pkg.dotReader = $newType(0, $kindStruct, "textproto.dotReader", true, "net/textproto", false, function(r_, state_) { this.$val = this; if (arguments.length === 0) { this.r = ptrType$6.nil; this.state = 0; return; } this.r = r_; this.state = state_; }); MIMEHeader = $pkg.MIMEHeader = $newType(4, $kindMap, "textproto.MIMEHeader", true, "net/textproto", true, null); sliceType = $sliceType($Uint8); sliceType$1 = $sliceType($emptyInterface); ptrType$3 = $ptrType(bufio.Reader); ptrType$4 = $ptrType(dotReader); ptrType$6 = $ptrType(Reader); sliceType$2 = $sliceType($String); ptrType$7 = $ptrType(Error); funcType = $funcType([sliceType], [$error], false); Error.ptr.prototype.Error = function() { var $24r, _r, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; _r = fmt.Sprintf("%03d %s", new sliceType$1([new $Int(e.Code), new $String(e.Msg)])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Error.ptr.prototype.Error }; } $f.$24r = $24r; $f._r = _r; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; Error.prototype.Error = function() { return this.$val.Error(); }; ProtocolError.prototype.Error = function() { var p; p = this.$val; return (p); }; $ptrType(ProtocolError).prototype.Error = function() { return new ProtocolError(this.$get()).Error(); }; TrimString = function(s) { var s; while (true) { if (!(s.length > 0 && isASCIISpace(s.charCodeAt(0)))) { break; } s = $substring(s, 1); } while (true) { if (!(s.length > 0 && isASCIISpace(s.charCodeAt((s.length - 1 >> 0))))) { break; } s = $substring(s, 0, (s.length - 1 >> 0)); } return s; }; $pkg.TrimString = TrimString; isASCIISpace = function(b) { var b; return (b === 32) || (b === 9) || (b === 10) || (b === 13); }; isASCIILetter = function(b) { var b; b = (b | (32)) >>> 0; return 97 <= b && b <= 122; }; NewReader = function(r) { var r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = commonHeaderOnce.Do(initCommonHeader); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return new Reader.ptr(r, ptrType$4.nil, sliceType.nil); /* */ } return; } if ($f === undefined) { $f = { $blk: NewReader }; } $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.NewReader = NewReader; Reader.ptr.prototype.ReadLine = function() { var _r, _tuple, err, line, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; line = $f.line; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r = r.readLineSlice(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; line = _tuple[0]; err = _tuple[1]; $s = -1; return [($bytesToString(line)), err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.ReadLine }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.line = line; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.ReadLine = function() { return this.$val.ReadLine(); }; Reader.ptr.prototype.ReadLineBytes = function() { var _r, _tuple, buf, err, line, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; buf = $f.buf; err = $f.err; line = $f.line; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r = r.readLineSlice(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; line = _tuple[0]; err = _tuple[1]; if (!(line === sliceType.nil)) { buf = $makeSlice(sliceType, line.$length); $copySlice(buf, line); line = buf; } $s = -1; return [line, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.ReadLineBytes }; } $f._r = _r; $f._tuple = _tuple; $f.buf = buf; $f.err = err; $f.line = line; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.ReadLineBytes = function() { return this.$val.ReadLineBytes(); }; Reader.ptr.prototype.readLineSlice = function() { var _r, _tuple, err, l, line, more, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; l = $f.l; line = $f.line; more = $f.more; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; $r = r.closeDot(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } line = sliceType.nil; /* while (true) { */ case 2: _r = r.R.ReadLine(); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; l = _tuple[0]; more = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType.nil, err]; } if (line === sliceType.nil && !more) { $s = -1; return [l, $ifaceNil]; } line = $appendSlice(line, l); if (!more) { /* break; */ $s = 3; continue; } $s = 2; continue; case 3: $s = -1; return [line, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.readLineSlice }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.l = l; $f.line = line; $f.more = more; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.readLineSlice = function() { return this.$val.readLineSlice(); }; Reader.ptr.prototype.ReadContinuedLine = function() { var _r, _tuple, err, line, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; line = $f.line; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r = r.readContinuedLineSlice(noValidation); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; line = _tuple[0]; err = _tuple[1]; $s = -1; return [($bytesToString(line)), err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.ReadContinuedLine }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.line = line; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.ReadContinuedLine = function() { return this.$val.ReadContinuedLine(); }; trim = function(s) { var i, n, s, x, x$1; i = 0; while (true) { if (!(i < s.$length && ((((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]) === 32) || (((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + i]) === 9)))) { break; } i = i + (1) >> 0; } n = s.$length; while (true) { if (!(n > i && (((x = n - 1 >> 0, ((x < 0 || x >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + x])) === 32) || ((x$1 = n - 1 >> 0, ((x$1 < 0 || x$1 >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + x$1])) === 9)))) { break; } n = n - (1) >> 0; } return $subslice(s, i, n); }; Reader.ptr.prototype.ReadContinuedLineBytes = function() { var _r, _tuple, buf, err, line, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; buf = $f.buf; err = $f.err; line = $f.line; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r = r.readContinuedLineSlice(noValidation); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; line = _tuple[0]; err = _tuple[1]; if (!(line === sliceType.nil)) { buf = $makeSlice(sliceType, line.$length); $copySlice(buf, line); line = buf; } $s = -1; return [line, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.ReadContinuedLineBytes }; } $f._r = _r; $f._tuple = _tuple; $f.buf = buf; $f.err = err; $f.line = line; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.ReadContinuedLineBytes = function() { return this.$val.ReadContinuedLineBytes(); }; Reader.ptr.prototype.readContinuedLineSlice = function(validateFirstLine) { var $24r, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, _tuple$1, _tuple$2, err, err$1, err$2, line, line$1, peek, r, validateFirstLine, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; line = $f.line; line$1 = $f.line$1; peek = $f.peek; r = $f.r; validateFirstLine = $f.validateFirstLine; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; /* */ if (validateFirstLine === $throwNilPointerError) { $s = 1; continue; } /* */ $s = 2; continue; /* if (validateFirstLine === $throwNilPointerError) { */ case 1: _r = fmt.Errorf("missing validateFirstLine func", new sliceType$1([])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = [sliceType.nil, _r]; $s = 4; case 4: return $24r; /* } */ case 2: _r$1 = r.readLineSlice(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; line = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType.nil, err]; } if (line.$length === 0) { $s = -1; return [line, $ifaceNil]; } _r$2 = validateFirstLine(line); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } err$1 = _r$2; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [sliceType.nil, err$1]; } /* */ if (r.R.Buffered() > 1) { $s = 7; continue; } /* */ $s = 8; continue; /* if (r.R.Buffered() > 1) { */ case 7: _r$3 = r.R.Peek(2); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$1 = _r$3; peek = _tuple$1[0]; if (peek.$length > 0 && (isASCIILetter((0 >= peek.$length ? ($throwRuntimeError("index out of range"), undefined) : peek.$array[peek.$offset + 0])) || ((0 >= peek.$length ? ($throwRuntimeError("index out of range"), undefined) : peek.$array[peek.$offset + 0]) === 10)) || (peek.$length === 2) && ((0 >= peek.$length ? ($throwRuntimeError("index out of range"), undefined) : peek.$array[peek.$offset + 0]) === 13) && ((1 >= peek.$length ? ($throwRuntimeError("index out of range"), undefined) : peek.$array[peek.$offset + 1]) === 10)) { $s = -1; return [trim(line), $ifaceNil]; } /* } */ case 8: r.buf = $appendSlice($subslice(r.buf, 0, 0), trim(line)); /* while (true) { */ case 10: _r$4 = r.skipSpace(); /* */ $s = 12; case 12: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } /* if (!(_r$4 > 0)) { break; } */ if(!(_r$4 > 0)) { $s = 11; continue; } _r$5 = r.readLineSlice(); /* */ $s = 13; case 13: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$2 = _r$5; line$1 = _tuple$2[0]; err$2 = _tuple$2[1]; if (!($interfaceIsEqual(err$2, $ifaceNil))) { /* break; */ $s = 11; continue; } r.buf = $append(r.buf, 32); r.buf = $appendSlice(r.buf, trim(line$1)); $s = 10; continue; case 11: $s = -1; return [r.buf, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.readContinuedLineSlice }; } $f.$24r = $24r; $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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.line = line; $f.line$1 = line$1; $f.peek = peek; $f.r = r; $f.validateFirstLine = validateFirstLine; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.readContinuedLineSlice = function(validateFirstLine) { return this.$val.readContinuedLineSlice(validateFirstLine); }; Reader.ptr.prototype.skipSpace = function() { var _r, _tuple, c, err, n, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; c = $f.c; err = $f.err; n = $f.n; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; n = 0; /* while (true) { */ case 1: _r = r.R.ReadByte(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; c = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { /* break; */ $s = 2; continue; } if (!((c === 32)) && !((c === 9))) { r.R.UnreadByte(); /* break; */ $s = 2; continue; } n = n + (1) >> 0; $s = 1; continue; case 2: $s = -1; return n; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.skipSpace }; } $f._r = _r; $f._tuple = _tuple; $f.c = c; $f.err = err; $f.n = n; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.skipSpace = function() { return this.$val.skipSpace(); }; Reader.ptr.prototype.readCodeLine = function(expectCode) { var _r, _tuple, _tuple$1, code, continued, err, expectCode, line, message, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; code = $f.code; continued = $f.continued; err = $f.err; expectCode = $f.expectCode; line = $f.line; message = $f.message; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: code = 0; continued = false; message = ""; err = $ifaceNil; r = this; _r = r.ReadLine(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; line = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [code, continued, message, err]; } _tuple$1 = parseCodeLine(line, expectCode); code = _tuple$1[0]; continued = _tuple$1[1]; message = _tuple$1[2]; err = _tuple$1[3]; $s = -1; return [code, continued, message, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.readCodeLine }; } $f._r = _r; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.code = code; $f.continued = continued; $f.err = err; $f.expectCode = expectCode; $f.line = line; $f.message = message; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.readCodeLine = function(expectCode) { return this.$val.readCodeLine(expectCode); }; parseCodeLine = function(line, expectCode) { var _q, _q$1, _tuple, code, continued, err, expectCode, line, message; code = 0; continued = false; message = ""; err = $ifaceNil; if (line.length < 4 || !((line.charCodeAt(3) === 32)) && !((line.charCodeAt(3) === 45))) { err = new ProtocolError(("short response: " + line)); return [code, continued, message, err]; } continued = line.charCodeAt(3) === 45; _tuple = strconv.Atoi($substring(line, 0, 3)); code = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil)) || code < 100) { err = new ProtocolError(("invalid response code: " + line)); return [code, continued, message, err]; } message = $substring(line, 4); if (1 <= expectCode && expectCode < 10 && !(((_q = code / 100, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) === expectCode)) || 10 <= expectCode && expectCode < 100 && !(((_q$1 = code / 10, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")) === expectCode)) || 100 <= expectCode && expectCode < 1000 && !((code === expectCode))) { err = new Error.ptr(code, message); } return [code, continued, message, err]; }; Reader.ptr.prototype.ReadCodeLine = function(expectCode) { var _r, _tuple, code, continued, err, expectCode, message, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; code = $f.code; continued = $f.continued; err = $f.err; expectCode = $f.expectCode; message = $f.message; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: code = 0; message = ""; err = $ifaceNil; r = this; _r = r.readCodeLine(expectCode); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; code = _tuple[0]; continued = _tuple[1]; message = _tuple[2]; err = _tuple[3]; if ($interfaceIsEqual(err, $ifaceNil) && continued) { err = new ProtocolError(("unexpected multi-line response: " + message)); } $s = -1; return [code, message, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.ReadCodeLine }; } $f._r = _r; $f._tuple = _tuple; $f.code = code; $f.continued = continued; $f.err = err; $f.expectCode = expectCode; $f.message = message; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.ReadCodeLine = function(expectCode) { return this.$val.ReadCodeLine(expectCode); }; Reader.ptr.prototype.ReadResponse = function(expectCode) { var _r, _r$1, _r$2, _tmp, _tmp$1, _tmp$2, _tuple, _tuple$1, _tuple$2, code, code2, continued, err, err$1, expectCode, line, message, moreMessage, multi, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; code = $f.code; code2 = $f.code2; continued = $f.continued; err = $f.err; err$1 = $f.err$1; expectCode = $f.expectCode; line = $f.line; message = $f.message; moreMessage = $f.moreMessage; multi = $f.multi; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: code = 0; message = ""; err = $ifaceNil; r = this; _r = r.readCodeLine(expectCode); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; code = _tuple[0]; continued = _tuple[1]; message = _tuple[2]; err = _tuple[3]; multi = continued; /* while (true) { */ case 2: /* if (!(continued)) { break; } */ if(!(continued)) { $s = 3; continue; } _r$1 = r.ReadLine(); /* */ $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; line = _tuple$1[0]; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { _tmp = 0; _tmp$1 = ""; _tmp$2 = err$1; code = _tmp; message = _tmp$1; err = _tmp$2; $s = -1; return [code, message, err]; } code2 = 0; moreMessage = ""; _tuple$2 = parseCodeLine(line, 0); code2 = _tuple$2[0]; continued = _tuple$2[1]; moreMessage = _tuple$2[2]; err$1 = _tuple$2[3]; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil)) || !((code2 === code))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil)) || !((code2 === code))) { */ case 5: _r$2 = strings.TrimRight(line, "\r\n"); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } message = message + ("\n" + _r$2); continued = true; /* continue; */ $s = 2; continue; /* } */ case 6: message = message + ("\n" + moreMessage); $s = 2; continue; case 3: if (!($interfaceIsEqual(err, $ifaceNil)) && multi && !(message === "")) { err = new Error.ptr(code, message); } $s = -1; return [code, message, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.ReadResponse }; } $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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.code = code; $f.code2 = code2; $f.continued = continued; $f.err = err; $f.err$1 = err$1; $f.expectCode = expectCode; $f.line = line; $f.message = message; $f.moreMessage = moreMessage; $f.multi = multi; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.ReadResponse = function(expectCode) { return this.$val.ReadResponse(expectCode); }; Reader.ptr.prototype.DotReader = function() { var r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; $r = r.closeDot(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } r.dot = new dotReader.ptr(r, 0); $s = -1; return r.dot; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.DotReader }; } $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.DotReader = function() { return this.$val.DotReader(); }; dotReader.ptr.prototype.Read = function(b) { var _1, _r, _tuple, b, br, c, d, err, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _tuple = $f._tuple; b = $f.b; br = $f.br; c = $f.c; d = $f.d; err = $f.err; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; d = this; br = d.r.R; /* while (true) { */ case 1: /* if (!(n < b.$length && !((d.state === 5)))) { break; } */ if(!(n < b.$length && !((d.state === 5)))) { $s = 2; continue; } c = 0; _r = br.ReadByte(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; c = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { if ($interfaceIsEqual(err, io.EOF)) { err = io.ErrUnexpectedEOF; } /* break; */ $s = 2; continue; } switch (0) { default: _1 = d.state; if (_1 === (0)) { if (c === 46) { d.state = 1; /* continue; */ $s = 1; continue; } if (c === 13) { d.state = 3; /* continue; */ $s = 1; continue; } d.state = 4; } else if (_1 === (1)) { if (c === 13) { d.state = 2; /* continue; */ $s = 1; continue; } if (c === 10) { d.state = 5; /* continue; */ $s = 1; continue; } d.state = 4; } else if (_1 === (2)) { if (c === 10) { d.state = 5; /* continue; */ $s = 1; continue; } br.UnreadByte(); c = 13; d.state = 4; } else if (_1 === (3)) { if (c === 10) { d.state = 0; break; } br.UnreadByte(); c = 13; d.state = 4; } else if (_1 === (4)) { if (c === 13) { d.state = 3; /* continue; */ $s = 1; continue; } if (c === 10) { d.state = 0; } } } ((n < 0 || n >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + n] = c); n = n + (1) >> 0; $s = 1; continue; case 2: if ($interfaceIsEqual(err, $ifaceNil) && (d.state === 5)) { err = io.EOF; } if (!($interfaceIsEqual(err, $ifaceNil)) && d.r.dot === d) { d.r.dot = ptrType$4.nil; } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: dotReader.ptr.prototype.Read }; } $f._1 = _1; $f._r = _r; $f._tuple = _tuple; $f.b = b; $f.br = br; $f.c = c; $f.d = d; $f.err = err; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; dotReader.prototype.Read = function(b) { return this.$val.Read(b); }; Reader.ptr.prototype.closeDot = function() { var _r, buf, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; buf = $f.buf; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; if (r.dot === ptrType$4.nil) { $s = -1; return; } buf = $makeSlice(sliceType, 128); /* while (true) { */ case 1: /* if (!(!(r.dot === ptrType$4.nil))) { break; } */ if(!(!(r.dot === ptrType$4.nil))) { $s = 2; continue; } _r = r.dot.Read(buf); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.closeDot }; } $f._r = _r; $f.buf = buf; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.closeDot = function() { return this.$val.closeDot(); }; Reader.ptr.prototype.ReadDotBytes = function() { var $24r, _r, _r$1, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r = r.DotReader(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = io.ReadAll(_r); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.ReadDotBytes }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.ReadDotBytes = function() { return this.$val.ReadDotBytes(); }; Reader.ptr.prototype.ReadDotLines = function() { var _r, _tuple, err, line, r, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; line = $f.line; r = $f.r; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; v = sliceType$2.nil; err = $ifaceNil; /* while (true) { */ case 1: line = ""; _r = r.ReadLine(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; line = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { if ($interfaceIsEqual(err, io.EOF)) { err = io.ErrUnexpectedEOF; } /* break; */ $s = 2; continue; } if (line.length > 0 && (line.charCodeAt(0) === 46)) { if (line.length === 1) { /* break; */ $s = 2; continue; } line = $substring(line, 1); } v = $append(v, line); $s = 1; continue; case 2: $s = -1; return [v, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.ReadDotLines }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.line = line; $f.r = r; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.ReadDotLines = function() { return this.$val.ReadDotLines(); }; Reader.ptr.prototype.ReadMIMEHeader = function() { var _entry, _key, _key$1, _r, _r$1, _r$2, _r$3, _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, buf, err, err$1, err$2, hint, i, key, kv, line, m, r, strs, value, vv, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _key = $f._key; _key$1 = $f._key$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; buf = $f.buf; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; hint = $f.hint; i = $f.i; key = $f.key; kv = $f.kv; line = $f.line; m = $f.m; r = $f.r; strs = $f.strs; value = $f.value; vv = $f.vv; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; strs = sliceType$2.nil; _r = r.upcomingHeaderNewlines(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } hint = _r; if (hint > 0) { strs = $makeSlice(sliceType$2, hint); } m = ((hint < 0 || hint > 2147483647) ? $throwRuntimeError("makemap: size out of range") : {}); _r$1 = r.R.Peek(1); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; buf = _tuple[0]; err = _tuple[1]; /* */ if ($interfaceIsEqual(err, $ifaceNil) && (((0 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 0]) === 32) || ((0 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 0]) === 9))) { $s = 3; continue; } /* */ $s = 4; continue; /* if ($interfaceIsEqual(err, $ifaceNil) && (((0 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 0]) === 32) || ((0 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 0]) === 9))) { */ case 3: _r$2 = r.readLineSlice(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; line = _tuple$1[0]; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [m, err$1]; } $s = -1; return [m, new ProtocolError(("malformed MIME header initial line: " + ($bytesToString(line))))]; /* } */ case 4: /* while (true) { */ case 6: _r$3 = r.readContinuedLineSlice(mustHaveFieldNameColon); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$2 = _r$3; kv = _tuple$2[0]; err$2 = _tuple$2[1]; if (kv.$length === 0) { $s = -1; return [m, err$2]; } i = bytes.IndexByte(kv, 58); if (i < 0) { $s = -1; return [m, new ProtocolError(("malformed MIME header line: " + ($bytesToString(kv))))]; } key = canonicalMIMEHeaderKey($subslice(kv, 0, i)); if (key === "") { /* continue; */ $s = 6; continue; } i = i + (1) >> 0; while (true) { if (!(i < kv.$length && ((((i < 0 || i >= kv.$length) ? ($throwRuntimeError("index out of range"), undefined) : kv.$array[kv.$offset + i]) === 32) || (((i < 0 || i >= kv.$length) ? ($throwRuntimeError("index out of range"), undefined) : kv.$array[kv.$offset + i]) === 9)))) { break; } i = i + (1) >> 0; } value = ($bytesToString($subslice(kv, i))); vv = (_entry = m[$String.keyFor(key)], _entry !== undefined ? _entry.v : sliceType$2.nil); if (vv === sliceType$2.nil && strs.$length > 0) { _tmp = $subslice(strs, 0, 1, 1); _tmp$1 = $subslice(strs, 1); vv = _tmp; strs = _tmp$1; (0 >= vv.$length ? ($throwRuntimeError("index out of range"), undefined) : vv.$array[vv.$offset + 0] = value); _key = key; (m || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: vv }; } else { _key$1 = key; (m || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key$1)] = { k: _key$1, v: $append(vv, value) }; } if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return [m, err$2]; } $s = 6; continue; case 7: $s = -1; return [false, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.ReadMIMEHeader }; } $f._entry = _entry; $f._key = _key; $f._key$1 = _key$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.buf = buf; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.hint = hint; $f.i = i; $f.key = key; $f.kv = kv; $f.line = line; $f.m = m; $f.r = r; $f.strs = strs; $f.value = value; $f.vv = vv; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.ReadMIMEHeader = function() { return this.$val.ReadMIMEHeader(); }; noValidation = function(param) { var param; return $ifaceNil; }; mustHaveFieldNameColon = function(line) { var $24r, _r, line, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; line = $f.line; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (bytes.IndexByte(line, 58) < 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (bytes.IndexByte(line, 58) < 0) { */ case 1: _r = fmt.Sprintf("malformed MIME header: missing colon: %q", new sliceType$1([line])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = new ProtocolError((_r)); $s = 4; case 4: return $24r; /* } */ case 2: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: mustHaveFieldNameColon }; } $f.$24r = $24r; $f._r = _r; $f.line = line; $f.$s = $s; $f.$r = $r; return $f; }; Reader.ptr.prototype.upcomingHeaderNewlines = function() { var _r, _r$1, _tuple, i, n, peek, r, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; i = $f.i; n = $f.n; peek = $f.peek; r = $f.r; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; r = this; _r = r.R.Peek(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; s = r.R.Buffered(); if (s === 0) { $s = -1; return n; } _r$1 = r.R.Peek(s); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; peek = _tuple[0]; while (true) { if (!(peek.$length > 0)) { break; } i = bytes.IndexByte(peek, 10); if (i < 3) { $s = -1; return n; } n = n + (1) >> 0; peek = $subslice(peek, (i + 1 >> 0)); } $s = -1; return n; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.upcomingHeaderNewlines }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.i = i; $f.n = n; $f.peek = peek; $f.r = r; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.upcomingHeaderNewlines = function() { return this.$val.upcomingHeaderNewlines(); }; CanonicalMIMEHeaderKey = function(s) { var c, i, s, upper, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; c = $f.c; i = $f.i; s = $f.s; upper = $f.upper; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = commonHeaderOnce.Do(initCommonHeader); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } upper = true; i = 0; while (true) { if (!(i < s.length)) { break; } c = s.charCodeAt(i); if (!validHeaderFieldByte(c)) { $s = -1; return s; } if (upper && 97 <= c && c <= 122) { $s = -1; return canonicalMIMEHeaderKey((new sliceType($stringToBytes(s)))); } if (!upper && 65 <= c && c <= 90) { $s = -1; return canonicalMIMEHeaderKey((new sliceType($stringToBytes(s)))); } upper = c === 45; i = i + (1) >> 0; } $s = -1; return s; /* */ } return; } if ($f === undefined) { $f = { $blk: CanonicalMIMEHeaderKey }; } $f.c = c; $f.i = i; $f.s = s; $f.upper = upper; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.CanonicalMIMEHeaderKey = CanonicalMIMEHeaderKey; validHeaderFieldByte = function(b) { var b; return ((b >> 0)) < 127 && ((b < 0 || b >= isTokenTable.length) ? ($throwRuntimeError("index out of range"), undefined) : isTokenTable[b]); }; canonicalMIMEHeaderKey = function(a) { var _entry, _i, _i$1, _ref, _ref$1, a, c, c$1, i, upper, v; _ref = a; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } c = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (validHeaderFieldByte(c)) { _i++; continue; } return ($bytesToString(a)); } upper = true; _ref$1 = a; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } i = _i$1; c$1 = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); if (upper && 97 <= c$1 && c$1 <= 122) { c$1 = c$1 - (32) << 24 >>> 24; } else if (!upper && 65 <= c$1 && c$1 <= 90) { c$1 = c$1 + (32) << 24 >>> 24; } ((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i] = c$1); upper = c$1 === 45; _i$1++; } v = (_entry = commonHeader[$String.keyFor(($bytesToString(a)))], _entry !== undefined ? _entry.v : ""); if (!(v === "")) { return v; } return ($bytesToString(a)); }; initCommonHeader = function() { var _i, _key, _ref, v; commonHeader = {}; _ref = new sliceType$2(["Accept", "Accept-Charset", "Accept-Encoding", "Accept-Language", "Accept-Ranges", "Cache-Control", "Cc", "Connection", "Content-Id", "Content-Language", "Content-Length", "Content-Transfer-Encoding", "Content-Type", "Cookie", "Date", "Dkim-Signature", "Etag", "Expires", "From", "Host", "If-Modified-Since", "If-None-Match", "In-Reply-To", "Last-Modified", "Location", "Message-Id", "Mime-Version", "Pragma", "Received", "Return-Path", "Server", "Set-Cookie", "Subject", "To", "User-Agent", "Via", "X-Forwarded-For", "X-Imforwards", "X-Powered-By"]); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _key = v; (commonHeader || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: v }; _i++; } }; MIMEHeader.prototype.Add = function(key, value) { var _entry, _key, _r, h, key, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _key = $f._key; _r = $f._r; h = $f.h; key = $f.key; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: h = this.$val; _r = CanonicalMIMEHeaderKey(key); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } key = _r; _key = key; (h || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: $append((_entry = h[$String.keyFor(key)], _entry !== undefined ? _entry.v : sliceType$2.nil), value) }; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: MIMEHeader.prototype.Add }; } $f._entry = _entry; $f._key = _key; $f._r = _r; $f.h = h; $f.key = key; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(MIMEHeader).prototype.Add = function(key, value) { return new MIMEHeader(this.$get()).Add(key, value); }; MIMEHeader.prototype.Set = function(key, value) { var _key, _r, h, key, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _key = $f._key; _r = $f._r; h = $f.h; key = $f.key; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: h = this.$val; _r = CanonicalMIMEHeaderKey(key); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _key = _r; (h || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: new sliceType$2([value]) }; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: MIMEHeader.prototype.Set }; } $f._key = _key; $f._r = _r; $f.h = h; $f.key = key; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(MIMEHeader).prototype.Set = function(key, value) { return new MIMEHeader(this.$get()).Set(key, value); }; MIMEHeader.prototype.Get = function(key) { var _entry, _r, h, key, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _r = $f._r; h = $f.h; key = $f.key; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: h = this.$val; if (h === false) { $s = -1; return ""; } _r = CanonicalMIMEHeaderKey(key); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } v = (_entry = h[$String.keyFor(_r)], _entry !== undefined ? _entry.v : sliceType$2.nil); if (v.$length === 0) { $s = -1; return ""; } $s = -1; return (0 >= v.$length ? ($throwRuntimeError("index out of range"), undefined) : v.$array[v.$offset + 0]); /* */ } return; } if ($f === undefined) { $f = { $blk: MIMEHeader.prototype.Get }; } $f._entry = _entry; $f._r = _r; $f.h = h; $f.key = key; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(MIMEHeader).prototype.Get = function(key) { return new MIMEHeader(this.$get()).Get(key); }; MIMEHeader.prototype.Values = function(key) { var $24r, _entry, _r, h, key, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _entry = $f._entry; _r = $f._r; h = $f.h; key = $f.key; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: h = this.$val; if (h === false) { $s = -1; return sliceType$2.nil; } _r = CanonicalMIMEHeaderKey(key); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = (_entry = h[$String.keyFor(_r)], _entry !== undefined ? _entry.v : sliceType$2.nil); $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: MIMEHeader.prototype.Values }; } $f.$24r = $24r; $f._entry = _entry; $f._r = _r; $f.h = h; $f.key = key; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(MIMEHeader).prototype.Values = function(key) { return new MIMEHeader(this.$get()).Values(key); }; MIMEHeader.prototype.Del = function(key) { var _r, h, key, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; h = $f.h; key = $f.key; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: h = this.$val; _r = CanonicalMIMEHeaderKey(key); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } delete h[$String.keyFor(_r)]; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: MIMEHeader.prototype.Del }; } $f._r = _r; $f.h = h; $f.key = key; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(MIMEHeader).prototype.Del = function(key) { return new MIMEHeader(this.$get()).Del(key); }; ptrType$7.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; ProtocolError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$6.methods = [{prop: "ReadLine", name: "ReadLine", pkg: "", typ: $funcType([], [$String, $error], false)}, {prop: "ReadLineBytes", name: "ReadLineBytes", pkg: "", typ: $funcType([], [sliceType, $error], false)}, {prop: "readLineSlice", name: "readLineSlice", pkg: "net/textproto", typ: $funcType([], [sliceType, $error], false)}, {prop: "ReadContinuedLine", name: "ReadContinuedLine", pkg: "", typ: $funcType([], [$String, $error], false)}, {prop: "ReadContinuedLineBytes", name: "ReadContinuedLineBytes", pkg: "", typ: $funcType([], [sliceType, $error], false)}, {prop: "readContinuedLineSlice", name: "readContinuedLineSlice", pkg: "net/textproto", typ: $funcType([funcType], [sliceType, $error], false)}, {prop: "skipSpace", name: "skipSpace", pkg: "net/textproto", typ: $funcType([], [$Int], false)}, {prop: "readCodeLine", name: "readCodeLine", pkg: "net/textproto", typ: $funcType([$Int], [$Int, $Bool, $String, $error], false)}, {prop: "ReadCodeLine", name: "ReadCodeLine", pkg: "", typ: $funcType([$Int], [$Int, $String, $error], false)}, {prop: "ReadResponse", name: "ReadResponse", pkg: "", typ: $funcType([$Int], [$Int, $String, $error], false)}, {prop: "DotReader", name: "DotReader", pkg: "", typ: $funcType([], [io.Reader], false)}, {prop: "closeDot", name: "closeDot", pkg: "net/textproto", typ: $funcType([], [], false)}, {prop: "ReadDotBytes", name: "ReadDotBytes", pkg: "", typ: $funcType([], [sliceType, $error], false)}, {prop: "ReadDotLines", name: "ReadDotLines", pkg: "", typ: $funcType([], [sliceType$2, $error], false)}, {prop: "ReadMIMEHeader", name: "ReadMIMEHeader", pkg: "", typ: $funcType([], [MIMEHeader, $error], false)}, {prop: "upcomingHeaderNewlines", name: "upcomingHeaderNewlines", pkg: "net/textproto", typ: $funcType([], [$Int], false)}]; ptrType$4.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}]; MIMEHeader.methods = [{prop: "Add", name: "Add", pkg: "", typ: $funcType([$String, $String], [], false)}, {prop: "Set", name: "Set", pkg: "", typ: $funcType([$String, $String], [], false)}, {prop: "Get", name: "Get", pkg: "", typ: $funcType([$String], [$String], false)}, {prop: "Values", name: "Values", pkg: "", typ: $funcType([$String], [sliceType$2], false)}, {prop: "Del", name: "Del", pkg: "", typ: $funcType([$String], [], false)}]; Error.init("", [{prop: "Code", name: "Code", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Msg", name: "Msg", embedded: false, exported: true, typ: $String, tag: ""}]); Reader.init("net/textproto", [{prop: "R", name: "R", embedded: false, exported: true, typ: ptrType$3, tag: ""}, {prop: "dot", name: "dot", embedded: false, exported: false, typ: ptrType$4, tag: ""}, {prop: "buf", name: "buf", embedded: false, exported: false, typ: sliceType, tag: ""}]); dotReader.init("net/textproto", [{prop: "r", name: "r", embedded: false, exported: false, typ: ptrType$6, tag: ""}, {prop: "state", name: "state", embedded: false, exported: false, typ: $Int, tag: ""}]); MIMEHeader.init($String, sliceType$2); $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 = bufio.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = bytes.$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 = io.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = net.$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 = strings.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sync.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } commonHeader = false; commonHeaderOnce = new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)); isTokenTable = $toNativeArray($kindBool, [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, true, true, true, true, true, false, false, true, true, false, true, true, false, true, true, true, true, true, true, true, true, true, true, false, false, false, false, false, false, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, false, true]); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["mime/multipart"] = (function() { var $pkg = {}, $init, bufio, bytes, rand, errors, fmt, io, math, mime, quotedprintable, textproto, os, filepath, sort, strings, Part, stickyErrorReader, partReader, Reader, Form, FileHeader, File, sectionReadCloser, sliceType, sliceType$1, sliceType$2, ptrType$2, ptrType$3, ptrType$4, ptrType$5, sliceType$3, ptrType$6, sliceType$4, mapType, ptrType$7, mapType$1, mapType$2, ptrType$8, quoteEscaper, emptyParams, NewReader, newPart, scanUntilBoundary, matchAfterPrefix, skipLWSPChar; bufio = $packages["bufio"]; bytes = $packages["bytes"]; rand = $packages["crypto/rand"]; errors = $packages["errors"]; fmt = $packages["fmt"]; io = $packages["io"]; math = $packages["math"]; mime = $packages["mime"]; quotedprintable = $packages["mime/quotedprintable"]; textproto = $packages["net/textproto"]; os = $packages["os"]; filepath = $packages["path/filepath"]; sort = $packages["sort"]; strings = $packages["strings"]; Part = $pkg.Part = $newType(0, $kindStruct, "multipart.Part", true, "mime/multipart", true, function(Header_, mr_, disposition_, dispositionParams_, r_, n_, total_, err_, readErr_) { this.$val = this; if (arguments.length === 0) { this.Header = false; this.mr = ptrType$4.nil; this.disposition = ""; this.dispositionParams = false; this.r = $ifaceNil; this.n = 0; this.total = new $Int64(0, 0); this.err = $ifaceNil; this.readErr = $ifaceNil; return; } this.Header = Header_; this.mr = mr_; this.disposition = disposition_; this.dispositionParams = dispositionParams_; this.r = r_; this.n = n_; this.total = total_; this.err = err_; this.readErr = readErr_; }); stickyErrorReader = $pkg.stickyErrorReader = $newType(0, $kindStruct, "multipart.stickyErrorReader", true, "mime/multipart", false, function(r_, err_) { this.$val = this; if (arguments.length === 0) { this.r = $ifaceNil; this.err = $ifaceNil; return; } this.r = r_; this.err = err_; }); partReader = $pkg.partReader = $newType(0, $kindStruct, "multipart.partReader", true, "mime/multipart", false, function(p_) { this.$val = this; if (arguments.length === 0) { this.p = ptrType$3.nil; return; } this.p = p_; }); Reader = $pkg.Reader = $newType(0, $kindStruct, "multipart.Reader", true, "mime/multipart", true, function(bufReader_, currentPart_, partsRead_, nl_, nlDashBoundary_, dashBoundaryDash_, dashBoundary_) { this.$val = this; if (arguments.length === 0) { this.bufReader = ptrType$2.nil; this.currentPart = ptrType$3.nil; this.partsRead = 0; this.nl = sliceType$1.nil; this.nlDashBoundary = sliceType$1.nil; this.dashBoundaryDash = sliceType$1.nil; this.dashBoundary = sliceType$1.nil; return; } this.bufReader = bufReader_; this.currentPart = currentPart_; this.partsRead = partsRead_; this.nl = nl_; this.nlDashBoundary = nlDashBoundary_; this.dashBoundaryDash = dashBoundaryDash_; this.dashBoundary = dashBoundary_; }); Form = $pkg.Form = $newType(0, $kindStruct, "multipart.Form", true, "mime/multipart", true, function(Value_, File_) { this.$val = this; if (arguments.length === 0) { this.Value = false; this.File = false; return; } this.Value = Value_; this.File = File_; }); FileHeader = $pkg.FileHeader = $newType(0, $kindStruct, "multipart.FileHeader", true, "mime/multipart", true, function(Filename_, Header_, Size_, content_, tmpfile_) { this.$val = this; if (arguments.length === 0) { this.Filename = ""; this.Header = false; this.Size = new $Int64(0, 0); this.content = sliceType$1.nil; this.tmpfile = ""; return; } this.Filename = Filename_; this.Header = Header_; this.Size = Size_; this.content = content_; this.tmpfile = tmpfile_; }); File = $pkg.File = $newType(8, $kindInterface, "multipart.File", true, "mime/multipart", true, null); sectionReadCloser = $pkg.sectionReadCloser = $newType(0, $kindStruct, "multipart.sectionReadCloser", true, "mime/multipart", false, function(SectionReader_) { this.$val = this; if (arguments.length === 0) { this.SectionReader = ptrType$8.nil; return; } this.SectionReader = SectionReader_; }); sliceType = $sliceType($String); sliceType$1 = $sliceType($Uint8); sliceType$2 = $sliceType($emptyInterface); ptrType$2 = $ptrType(bufio.Reader); ptrType$3 = $ptrType(Part); ptrType$4 = $ptrType(Reader); ptrType$5 = $ptrType(Form); sliceType$3 = $sliceType(io.Reader); ptrType$6 = $ptrType(FileHeader); sliceType$4 = $sliceType(ptrType$6); mapType = $mapType($String, $String); ptrType$7 = $ptrType(stickyErrorReader); mapType$1 = $mapType($String, sliceType); mapType$2 = $mapType($String, sliceType$4); ptrType$8 = $ptrType(io.SectionReader); Part.ptr.prototype.FormName = function() { var _entry, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; /* */ if (p.dispositionParams === false) { $s = 1; continue; } /* */ $s = 2; continue; /* if (p.dispositionParams === false) { */ case 1: $r = p.parseContentDisposition(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: if (!(p.disposition === "form-data")) { $s = -1; return ""; } $s = -1; return (_entry = p.dispositionParams[$String.keyFor("name")], _entry !== undefined ? _entry.v : ""); /* */ } return; } if ($f === undefined) { $f = { $blk: Part.ptr.prototype.FormName }; } $f._entry = _entry; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; Part.prototype.FormName = function() { return this.$val.FormName(); }; Part.ptr.prototype.FileName = function() { var _entry, filename, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; filename = $f.filename; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; /* */ if (p.dispositionParams === false) { $s = 1; continue; } /* */ $s = 2; continue; /* if (p.dispositionParams === false) { */ case 1: $r = p.parseContentDisposition(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: filename = (_entry = p.dispositionParams[$String.keyFor("filename")], _entry !== undefined ? _entry.v : ""); if (filename === "") { $s = -1; return ""; } $s = -1; return filepath.Base(filename); /* */ } return; } if ($f === undefined) { $f = { $blk: Part.ptr.prototype.FileName }; } $f._entry = _entry; $f.filename = filename; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; Part.prototype.FileName = function() { return this.$val.FileName(); }; Part.ptr.prototype.parseContentDisposition = function() { var _r, _r$1, _tuple, err, p, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; p = $f.p; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; _r = new textproto.MIMEHeader(p.Header).Get("Content-Disposition"); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } v = _r; err = $ifaceNil; _r$1 = mime.ParseMediaType(v); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; p.disposition = _tuple[0]; p.dispositionParams = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { p.dispositionParams = emptyParams; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Part.ptr.prototype.parseContentDisposition }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.p = p; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Part.prototype.parseContentDisposition = function() { return this.$val.parseContentDisposition(); }; NewReader = function(r, boundary) { var b, boundary, r; b = (new sliceType$1($stringToBytes("\r\n--" + boundary + "--"))); return new Reader.ptr(bufio.NewReaderSize(new stickyErrorReader.ptr(r, $ifaceNil), 4096), ptrType$3.nil, 0, $subslice(b, 0, 2), $subslice(b, 0, (b.$length - 2 >> 0)), $subslice(b, 2), $subslice(b, 2, (b.$length - 2 >> 0))); }; $pkg.NewReader = NewReader; stickyErrorReader.ptr.prototype.Read = function(p) { var _, _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, n, p, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _ = $f._; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; n = $f.n; p = $f.p; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; _ = $ifaceNil; r = this; if (!($interfaceIsEqual(r.err, $ifaceNil))) { _tmp = 0; _tmp$1 = r.err; n = _tmp; _ = _tmp$1; $s = -1; return [n, _]; } _r = r.r.Read(p); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; r.err = _tuple[1]; _tmp$2 = n; _tmp$3 = r.err; n = _tmp$2; _ = _tmp$3; $s = -1; return [n, _]; /* */ } return; } if ($f === undefined) { $f = { $blk: stickyErrorReader.ptr.prototype.Read }; } $f._ = _; $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.n = n; $f.p = p; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; stickyErrorReader.prototype.Read = function(p) { return this.$val.Read(p); }; newPart = function(mr, rawPart) { var _r, _r$1, _r$2, bp, err, mr, rawPart, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; bp = $f.bp; err = $f.err; mr = $f.mr; rawPart = $f.rawPart; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: bp = new Part.ptr({}, mr, "", false, $ifaceNil, 0, new $Int64(0, 0), $ifaceNil, $ifaceNil); _r = bp.populateHeaders(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$3.nil, err]; } bp.r = (x = new partReader.ptr(bp), new x.constructor.elem(x)); /* */ if (!rawPart) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!rawPart) { */ case 2: _r$1 = new textproto.MIMEHeader(bp.Header).Get("Content-Transfer-Encoding"); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = strings.EqualFold(_r$1, "quoted-printable"); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } /* */ if (_r$2) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_r$2) { */ case 4: $r = new textproto.MIMEHeader(bp.Header).Del("Content-Transfer-Encoding"); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } bp.r = quotedprintable.NewReader(bp.r); /* } */ case 5: /* } */ case 3: $s = -1; return [bp, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: newPart }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.bp = bp; $f.err = err; $f.mr = mr; $f.rawPart = rawPart; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Part.ptr.prototype.populateHeaders = function() { var _r, _r$1, _tuple, bp, err, header, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; bp = $f.bp; err = $f.err; header = $f.header; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: bp = this; _r = textproto.NewReader(bp.mr.bufReader); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } r = _r; _r$1 = r.ReadMIMEHeader(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; header = _tuple[0]; err = _tuple[1]; if ($interfaceIsEqual(err, $ifaceNil)) { bp.Header = header; } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: Part.ptr.prototype.populateHeaders }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.bp = bp; $f.err = err; $f.header = header; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Part.prototype.populateHeaders = function() { return this.$val.populateHeaders(); }; Part.ptr.prototype.Read = function(d) { var $24r, _r, _tuple, d, err, n, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _tuple = $f._tuple; d = $f.d; err = $f.err; n = $f.n; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; p = this; _r = p.r.Read(d); /* */ $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]; $24r = [n, err]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Part.ptr.prototype.Read }; } $f.$24r = $24r; $f._r = _r; $f._tuple = _tuple; $f.d = d; $f.err = err; $f.n = n; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; Part.prototype.Read = function(d) { return this.$val.Read(d); }; partReader.ptr.prototype.Read = function(d) { var _r, _r$1, _r$2, _tuple, _tuple$1, _tuple$2, _tuple$3, br, d, n, p, peek, pr, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; br = $f.br; d = $f.d; n = $f.n; p = $f.p; peek = $f.peek; pr = $f.pr; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: pr = this; p = pr.p; br = p.mr.bufReader; /* while (true) { */ case 1: /* if (!((p.n === 0) && $interfaceIsEqual(p.err, $ifaceNil))) { break; } */ if(!((p.n === 0) && $interfaceIsEqual(p.err, $ifaceNil))) { $s = 2; continue; } _r = br.Peek(br.Buffered()); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; peek = _tuple[0]; _tuple$1 = scanUntilBoundary(peek, p.mr.dashBoundary, p.mr.nlDashBoundary, p.total, p.readErr); p.n = _tuple$1[0]; p.err = _tuple$1[1]; /* */ if ((p.n === 0) && $interfaceIsEqual(p.err, $ifaceNil)) { $s = 4; continue; } /* */ $s = 5; continue; /* if ((p.n === 0) && $interfaceIsEqual(p.err, $ifaceNil)) { */ case 4: _r$1 = br.Peek(peek.$length + 1 >> 0); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$2 = _r$1; p.readErr = _tuple$2[1]; if ($interfaceIsEqual(p.readErr, io.EOF)) { p.readErr = io.ErrUnexpectedEOF; } /* } */ case 5: $s = 1; continue; case 2: if (p.n === 0) { $s = -1; return [0, p.err]; } n = d.$length; if (n > p.n) { n = p.n; } _r$2 = br.Read($subslice(d, 0, n)); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$3 = _r$2; n = _tuple$3[0]; p.total = (x = p.total, x$1 = (new $Int64(0, n)), new $Int64(x.$high + x$1.$high, x.$low + x$1.$low)); p.n = p.n - (n) >> 0; if (p.n === 0) { $s = -1; return [n, p.err]; } $s = -1; return [n, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: partReader.ptr.prototype.Read }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.br = br; $f.d = d; $f.n = n; $f.p = p; $f.peek = peek; $f.pr = pr; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; partReader.prototype.Read = function(d) { return this.$val.Read(d); }; scanUntilBoundary = function(buf, dashBoundary, nlDashBoundary, total, readErr) { var _1, _2, buf, dashBoundary, i, i$1, nlDashBoundary, readErr, total; if ((total.$high === 0 && total.$low === 0)) { if (bytes.HasPrefix(buf, dashBoundary)) { _1 = matchAfterPrefix(buf, dashBoundary, readErr); if (_1 === (-1)) { return [dashBoundary.$length, $ifaceNil]; } else if (_1 === (0)) { return [0, $ifaceNil]; } else if (_1 === (1)) { return [0, io.EOF]; } } if (bytes.HasPrefix(dashBoundary, buf)) { return [0, readErr]; } } i = bytes.Index(buf, nlDashBoundary); if (i >= 0) { _2 = matchAfterPrefix($subslice(buf, i), nlDashBoundary, readErr); if (_2 === (-1)) { return [i + nlDashBoundary.$length >> 0, $ifaceNil]; } else if (_2 === (0)) { return [i, $ifaceNil]; } else if (_2 === (1)) { return [i, io.EOF]; } } if (bytes.HasPrefix(nlDashBoundary, buf)) { return [0, readErr]; } i$1 = bytes.LastIndexByte(buf, (0 >= nlDashBoundary.$length ? ($throwRuntimeError("index out of range"), undefined) : nlDashBoundary.$array[nlDashBoundary.$offset + 0])); if (i$1 >= 0 && bytes.HasPrefix(nlDashBoundary, $subslice(buf, i$1))) { return [i$1, $ifaceNil]; } return [buf.$length, readErr]; }; matchAfterPrefix = function(buf, prefix, readErr) { var buf, c, prefix, readErr, x; if (buf.$length === prefix.$length) { if (!($interfaceIsEqual(readErr, $ifaceNil))) { return 1; } return 0; } c = (x = prefix.$length, ((x < 0 || x >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + x])); if ((c === 32) || (c === 9) || (c === 13) || (c === 10) || (c === 45)) { return 1; } return -1; }; Part.ptr.prototype.Close = function() { var _r, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; _r = io.Copy(io.Discard, p); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Part.ptr.prototype.Close }; } $f._r = _r; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; Part.prototype.Close = function() { return this.$val.Close(); }; Reader.ptr.prototype.NextPart = function() { var $24r, _r, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r = r.nextPart(false); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.NextPart }; } $f.$24r = $24r; $f._r = _r; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.NextPart = function() { return this.$val.NextPart(); }; Reader.ptr.prototype.NextRawPart = function() { var $24r, _r, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r = r.nextPart(true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.NextRawPart }; } $f.$24r = $24r; $f._r = _r; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.NextRawPart = function() { return this.$val.NextRawPart(); }; Reader.ptr.prototype.nextPart = function(rawPart) { var $24r, $24r$1, $24r$2, $24r$3, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _tuple, _tuple$1, bp, err, err$1, expectNewPart, line, r, rawPart, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$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; bp = $f.bp; err = $f.err; err$1 = $f.err$1; expectNewPart = $f.expectNewPart; line = $f.line; r = $f.r; rawPart = $f.rawPart; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; /* */ if (!(r.currentPart === ptrType$3.nil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(r.currentPart === ptrType$3.nil)) { */ case 1: _r = r.currentPart.Close(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; /* } */ case 2: /* */ if (($bytesToString(r.dashBoundary)) === "--") { $s = 4; continue; } /* */ $s = 5; continue; /* if (($bytesToString(r.dashBoundary)) === "--") { */ case 4: _r$1 = fmt.Errorf("multipart: boundary is empty", new sliceType$2([])); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = [ptrType$3.nil, _r$1]; $s = 7; case 7: return $24r; /* } */ case 5: expectNewPart = false; /* while (true) { */ case 8: _r$2 = r.bufReader.ReadSlice(10); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; line = _tuple[0]; err = _tuple[1]; if ($interfaceIsEqual(err, io.EOF) && r.isFinalBoundary(line)) { $s = -1; return [ptrType$3.nil, io.EOF]; } /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 11; continue; } /* */ $s = 12; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 11: _r$3 = fmt.Errorf("multipart: NextPart: %v", new sliceType$2([err])); /* */ $s = 13; case 13: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r$1 = [ptrType$3.nil, _r$3]; $s = 14; case 14: return $24r$1; /* } */ case 12: /* */ if (r.isBoundaryDelimiterLine(line)) { $s = 15; continue; } /* */ $s = 16; continue; /* if (r.isBoundaryDelimiterLine(line)) { */ case 15: r.partsRead = r.partsRead + (1) >> 0; _r$4 = newPart(r, rawPart); /* */ $s = 17; case 17: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$1 = _r$4; bp = _tuple$1[0]; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [ptrType$3.nil, err$1]; } r.currentPart = bp; $s = -1; return [bp, $ifaceNil]; /* } */ case 16: if (r.isFinalBoundary(line)) { $s = -1; return [ptrType$3.nil, io.EOF]; } /* */ if (expectNewPart) { $s = 18; continue; } /* */ $s = 19; continue; /* if (expectNewPart) { */ case 18: _r$5 = fmt.Errorf("multipart: expecting a new Part; got line %q", new sliceType$2([new $String(($bytesToString(line)))])); /* */ $s = 20; case 20: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $24r$2 = [ptrType$3.nil, _r$5]; $s = 21; case 21: return $24r$2; /* } */ case 19: if (r.partsRead === 0) { /* continue; */ $s = 8; continue; } if (bytes.Equal(line, r.nl)) { expectNewPart = true; /* continue; */ $s = 8; continue; } _r$6 = fmt.Errorf("multipart: unexpected line in Next(): %q", new sliceType$2([line])); /* */ $s = 22; case 22: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } $24r$3 = [ptrType$3.nil, _r$6]; $s = 23; case 23: return $24r$3; case 9: $s = -1; return [ptrType$3.nil, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.nextPart }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$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.bp = bp; $f.err = err; $f.err$1 = err$1; $f.expectNewPart = expectNewPart; $f.line = line; $f.r = r; $f.rawPart = rawPart; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.nextPart = function(rawPart) { return this.$val.nextPart(rawPart); }; Reader.ptr.prototype.isFinalBoundary = function(line) { var line, mr, rest; mr = this; if (!bytes.HasPrefix(line, mr.dashBoundaryDash)) { return false; } rest = $subslice(line, mr.dashBoundaryDash.$length); rest = skipLWSPChar(rest); return (rest.$length === 0) || bytes.Equal(rest, mr.nl); }; Reader.prototype.isFinalBoundary = function(line) { return this.$val.isFinalBoundary(line); }; Reader.ptr.prototype.isBoundaryDelimiterLine = function(line) { var line, mr, rest, ret; ret = false; mr = this; if (!bytes.HasPrefix(line, mr.dashBoundary)) { ret = false; return ret; } rest = $subslice(line, mr.dashBoundary.$length); rest = skipLWSPChar(rest); if ((mr.partsRead === 0) && (rest.$length === 1) && ((0 >= rest.$length ? ($throwRuntimeError("index out of range"), undefined) : rest.$array[rest.$offset + 0]) === 10)) { mr.nl = $subslice(mr.nl, 1); mr.nlDashBoundary = $subslice(mr.nlDashBoundary, 1); } ret = bytes.Equal(rest, mr.nl); return ret; }; Reader.prototype.isBoundaryDelimiterLine = function(line) { return this.$val.isBoundaryDelimiterLine(line); }; skipLWSPChar = function(b) { var b; while (true) { if (!(b.$length > 0 && (((0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]) === 32) || ((0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]) === 9)))) { break; } b = $subslice(b, 1); } return b; }; Reader.ptr.prototype.ReadForm = function(maxMemory) { var $24r, _r, maxMemory, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; maxMemory = $f.maxMemory; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r = r.readForm(maxMemory); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.ReadForm }; } $f.$24r = $24r; $f._r = _r; $f.maxMemory = maxMemory; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.ReadForm = function(maxMemory) { return this.$val.ReadForm(maxMemory); }; Reader.ptr.prototype.readForm = function(maxMemory) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, $24r$5, $24r$6, _, _entry, _entry$1, _key, _key$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _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, cerr, err, err$1, err$2, err$3, fh, file, filename, form, maxMemory, maxValueBytes, n, n$1, name, p, r, size, x, x$1, x$2, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; $24r$6 = $f.$24r$6; _ = $f._; _entry = $f._entry; _entry$1 = $f._entry$1; _key = $f._key; _key$1 = $f._key$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; _r$7 = $f._r$7; _r$8 = $f._r$8; _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$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; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; b = $f.b; cerr = $f.cerr; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; fh = $f.fh; file = $f.file; filename = $f.filename; form = $f.form; maxMemory = $f.maxMemory; maxValueBytes = $f.maxValueBytes; n = $f.n; n$1 = $f.n$1; name = $f.name; p = $f.p; r = $f.r; size = $f.size; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); err = [err]; form = [form]; _ = ptrType$5.nil; err[0] = $ifaceNil; r = this; form[0] = new Form.ptr({}, {}); $deferred.push([(function(err, form) { return function $b() { var _r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (!($interfaceIsEqual(err[0], $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(err[0], $ifaceNil))) { */ case 1: _r = form[0].RemoveAll(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r = _r; $f.$s = $s; $f.$r = $r; return $f; }; })(err, form), []]); maxValueBytes = new $Int64(maxMemory.$high + 0, maxMemory.$low + 10485760); if ((maxValueBytes.$high < 0 || (maxValueBytes.$high === 0 && maxValueBytes.$low <= 0))) { if ((maxMemory.$high < 0 || (maxMemory.$high === 0 && maxMemory.$low < 0))) { maxValueBytes = new $Int64(0, 0); } else { maxValueBytes = new $Int64(2147483647, 4294967295); } } /* while (true) { */ case 1: b = [b]; _r = r.NextPart(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; p = _tuple[0]; err$1 = _tuple[1]; if ($interfaceIsEqual(err$1, io.EOF)) { /* break; */ $s = 2; continue; } /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 4: _tmp = ptrType$5.nil; _tmp$1 = err$1; _ = _tmp; err[0] = _tmp$1; $24r = [_, err[0]]; $s = 6; case 6: return $24r; /* } */ case 5: _r$1 = p.FormName(); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } name = _r$1; if (name === "") { /* continue; */ $s = 1; continue; } _r$2 = p.FileName(); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } filename = _r$2; b[0] = new bytes.Buffer.ptr(sliceType$1.nil, 0, 0); /* */ if (filename === "") { $s = 9; continue; } /* */ $s = 10; continue; /* if (filename === "") { */ case 9: _r$3 = io.CopyN(b[0], p, new $Int64(maxValueBytes.$high + 0, maxValueBytes.$low + 1)); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$1 = _r$3; n = _tuple$1[0]; err$2 = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err$2, $ifaceNil)) && !($interfaceIsEqual(err$2, io.EOF))) { $s = 12; continue; } /* */ $s = 13; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil)) && !($interfaceIsEqual(err$2, io.EOF))) { */ case 12: _tmp$2 = ptrType$5.nil; _tmp$3 = err$2; _ = _tmp$2; err[0] = _tmp$3; $24r$1 = [_, err[0]]; $s = 14; case 14: return $24r$1; /* } */ case 13: maxValueBytes = (x = n, new $Int64(maxValueBytes.$high - x.$high, maxValueBytes.$low - x.$low)); /* */ if ((maxValueBytes.$high < 0 || (maxValueBytes.$high === 0 && maxValueBytes.$low < 0))) { $s = 15; continue; } /* */ $s = 16; continue; /* if ((maxValueBytes.$high < 0 || (maxValueBytes.$high === 0 && maxValueBytes.$low < 0))) { */ case 15: _tmp$4 = ptrType$5.nil; _tmp$5 = $pkg.ErrMessageTooLarge; _ = _tmp$4; err[0] = _tmp$5; $24r$2 = [_, err[0]]; $s = 17; case 17: return $24r$2; /* } */ case 16: _key = name; (form[0].Value || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: $append((_entry = form[0].Value[$String.keyFor(name)], _entry !== undefined ? _entry.v : sliceType.nil), b[0].String()) }; /* continue; */ $s = 1; continue; /* } */ case 10: fh = new FileHeader.ptr(filename, p.Header, new $Int64(0, 0), sliceType$1.nil, ""); _r$4 = io.CopyN(b[0], p, new $Int64(maxMemory.$high + 0, maxMemory.$low + 1)); /* */ $s = 18; case 18: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$2 = _r$4; n$1 = _tuple$2[0]; err$1 = _tuple$2[1]; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil)) && !($interfaceIsEqual(err$1, io.EOF))) { $s = 19; continue; } /* */ $s = 20; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil)) && !($interfaceIsEqual(err$1, io.EOF))) { */ case 19: _tmp$6 = ptrType$5.nil; _tmp$7 = err$1; _ = _tmp$6; err[0] = _tmp$7; $24r$3 = [_, err[0]]; $s = 21; case 21: return $24r$3; /* } */ case 20: /* */ if ((n$1.$high > maxMemory.$high || (n$1.$high === maxMemory.$high && n$1.$low > maxMemory.$low))) { $s = 22; continue; } /* */ $s = 23; continue; /* if ((n$1.$high > maxMemory.$high || (n$1.$high === maxMemory.$high && n$1.$low > maxMemory.$low))) { */ case 22: _r$5 = os.CreateTemp("", "multipart-"); /* */ $s = 25; case 25: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$3 = _r$5; file = _tuple$3[0]; err$3 = _tuple$3[1]; /* */ if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = 26; continue; } /* */ $s = 27; continue; /* if (!($interfaceIsEqual(err$3, $ifaceNil))) { */ case 26: _tmp$8 = ptrType$5.nil; _tmp$9 = err$3; _ = _tmp$8; err[0] = _tmp$9; $24r$4 = [_, err[0]]; $s = 28; case 28: return $24r$4; /* } */ case 27: _r$6 = io.Copy(file, io.MultiReader(new sliceType$3([b[0], p]))); /* */ $s = 29; case 29: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tuple$4 = _r$6; size = _tuple$4[0]; err$3 = _tuple$4[1]; _r$7 = file.Close(); /* */ $s = 30; case 30: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } cerr = _r$7; if ($interfaceIsEqual(err$3, $ifaceNil)) { err$3 = cerr; } /* */ if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = 31; continue; } /* */ $s = 32; continue; /* if (!($interfaceIsEqual(err$3, $ifaceNil))) { */ case 31: _r$8 = os.Remove(file.Name()); /* */ $s = 33; case 33: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$8; _tmp$10 = ptrType$5.nil; _tmp$11 = err$3; _ = _tmp$10; err[0] = _tmp$11; $24r$5 = [_, err[0]]; $s = 34; case 34: return $24r$5; /* } */ case 32: fh.tmpfile = file.Name(); fh.Size = size; $s = 24; continue; /* } else { */ case 23: fh.content = b[0].Bytes(); fh.Size = (new $Int64(0, fh.content.$length)); maxMemory = (x$1 = n$1, new $Int64(maxMemory.$high - x$1.$high, maxMemory.$low - x$1.$low)); maxValueBytes = (x$2 = n$1, new $Int64(maxValueBytes.$high - x$2.$high, maxValueBytes.$low - x$2.$low)); /* } */ case 24: _key$1 = name; (form[0].File || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key$1)] = { k: _key$1, v: $append((_entry$1 = form[0].File[$String.keyFor(name)], _entry$1 !== undefined ? _entry$1.v : sliceType$4.nil), fh) }; $s = 1; continue; case 2: _tmp$12 = form[0]; _tmp$13 = $ifaceNil; _ = _tmp$12; err[0] = _tmp$13; $24r$6 = [_, err[0]]; $s = 35; case 35: return $24r$6; /* */ } 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: Reader.ptr.prototype.readForm }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f.$24r$6 = $24r$6; $f._ = _; $f._entry = _entry; $f._entry$1 = _entry$1; $f._key = _key; $f._key$1 = _key$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._r$7 = _r$7; $f._r$8 = _r$8; $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$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._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f.b = b; $f.cerr = cerr; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.fh = fh; $f.file = file; $f.filename = filename; $f.form = form; $f.maxMemory = maxMemory; $f.maxValueBytes = maxValueBytes; $f.n = n; $f.n$1 = n$1; $f.name = name; $f.p = p; $f.r = r; $f.size = size; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Reader.prototype.readForm = function(maxMemory) { return this.$val.readForm(maxMemory); }; Form.ptr.prototype.RemoveAll = function() { var _entry, _i, _i$1, _keys, _r, _ref, _ref$1, e, err, f, fh, fhs, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _i = $f._i; _i$1 = $f._i$1; _keys = $f._keys; _r = $f._r; _ref = $f._ref; _ref$1 = $f._ref$1; e = $f.e; err = $f.err; f = $f.f; fh = $f.fh; fhs = $f.fhs; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; err = $ifaceNil; _ref = f.File; _i = 0; _keys = $keys(_ref); /* while (true) { */ case 1: /* if (!(_i < _keys.length)) { break; } */ if(!(_i < _keys.length)) { $s = 2; continue; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; /* continue; */ $s = 1; continue; } fhs = _entry.v; _ref$1 = fhs; _i$1 = 0; /* while (true) { */ case 3: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 4; continue; } fh = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); /* */ if (!(fh.tmpfile === "")) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!(fh.tmpfile === "")) { */ case 5: _r = os.Remove(fh.tmpfile); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } e = _r; if (!($interfaceIsEqual(e, $ifaceNil)) && $interfaceIsEqual(err, $ifaceNil)) { err = e; } /* } */ case 6: _i$1++; $s = 3; continue; case 4: _i++; $s = 1; continue; case 2: $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: Form.ptr.prototype.RemoveAll }; } $f._entry = _entry; $f._i = _i; $f._i$1 = _i$1; $f._keys = _keys; $f._r = _r; $f._ref = _ref; $f._ref$1 = _ref$1; $f.e = e; $f.err = err; $f.f = f; $f.fh = fh; $f.fhs = fhs; $f.$s = $s; $f.$r = $r; return $f; }; Form.prototype.RemoveAll = function() { return this.$val.RemoveAll(); }; FileHeader.ptr.prototype.Open = function() { var $24r, _r, _returncast, b, fh, r, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _returncast = $f._returncast; b = $f.b; fh = $f.fh; r = $f.r; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fh = this; b = fh.content; if (!(b === sliceType$1.nil)) { r = io.NewSectionReader(bytes.NewReader(b), new $Int64(0, 0), (new $Int64(0, b.$length))); $s = -1; return [(x = new sectionReadCloser.ptr(r), new x.constructor.elem(x)), $ifaceNil]; } _r = os.Open(fh.tmpfile); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _returncast = _r; $24r = [_returncast[0], _returncast[1]]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: FileHeader.ptr.prototype.Open }; } $f.$24r = $24r; $f._r = _r; $f._returncast = _returncast; $f.b = b; $f.fh = fh; $f.r = r; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; FileHeader.prototype.Open = function() { return this.$val.Open(); }; sectionReadCloser.ptr.prototype.Close = function() { var rc; rc = this; return $ifaceNil; }; sectionReadCloser.prototype.Close = function() { return this.$val.Close(); }; ptrType$3.methods = [{prop: "FormName", name: "FormName", pkg: "", typ: $funcType([], [$String], false)}, {prop: "FileName", name: "FileName", pkg: "", typ: $funcType([], [$String], false)}, {prop: "parseContentDisposition", name: "parseContentDisposition", pkg: "mime/multipart", typ: $funcType([], [], false)}, {prop: "populateHeaders", name: "populateHeaders", pkg: "mime/multipart", typ: $funcType([], [$error], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}]; ptrType$7.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}]; partReader.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}]; ptrType$4.methods = [{prop: "NextPart", name: "NextPart", pkg: "", typ: $funcType([], [ptrType$3, $error], false)}, {prop: "NextRawPart", name: "NextRawPart", pkg: "", typ: $funcType([], [ptrType$3, $error], false)}, {prop: "nextPart", name: "nextPart", pkg: "mime/multipart", typ: $funcType([$Bool], [ptrType$3, $error], false)}, {prop: "isFinalBoundary", name: "isFinalBoundary", pkg: "mime/multipart", typ: $funcType([sliceType$1], [$Bool], false)}, {prop: "isBoundaryDelimiterLine", name: "isBoundaryDelimiterLine", pkg: "mime/multipart", typ: $funcType([sliceType$1], [$Bool], false)}, {prop: "ReadForm", name: "ReadForm", pkg: "", typ: $funcType([$Int64], [ptrType$5, $error], false)}, {prop: "readForm", name: "readForm", pkg: "mime/multipart", typ: $funcType([$Int64], [ptrType$5, $error], false)}]; ptrType$5.methods = [{prop: "RemoveAll", name: "RemoveAll", pkg: "", typ: $funcType([], [$error], false)}]; ptrType$6.methods = [{prop: "Open", name: "Open", pkg: "", typ: $funcType([], [File, $error], false)}]; sectionReadCloser.methods = [{prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}]; Part.init("mime/multipart", [{prop: "Header", name: "Header", embedded: false, exported: true, typ: textproto.MIMEHeader, tag: ""}, {prop: "mr", name: "mr", embedded: false, exported: false, typ: ptrType$4, tag: ""}, {prop: "disposition", name: "disposition", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "dispositionParams", name: "dispositionParams", embedded: false, exported: false, typ: mapType, tag: ""}, {prop: "r", name: "r", embedded: false, exported: false, typ: io.Reader, tag: ""}, {prop: "n", name: "n", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "total", name: "total", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "readErr", name: "readErr", embedded: false, exported: false, typ: $error, tag: ""}]); stickyErrorReader.init("mime/multipart", [{prop: "r", name: "r", embedded: false, exported: false, typ: io.Reader, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}]); partReader.init("mime/multipart", [{prop: "p", name: "p", embedded: false, exported: false, typ: ptrType$3, tag: ""}]); Reader.init("mime/multipart", [{prop: "bufReader", name: "bufReader", embedded: false, exported: false, typ: ptrType$2, tag: ""}, {prop: "currentPart", name: "currentPart", embedded: false, exported: false, typ: ptrType$3, tag: ""}, {prop: "partsRead", name: "partsRead", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "nl", name: "nl", embedded: false, exported: false, typ: sliceType$1, tag: ""}, {prop: "nlDashBoundary", name: "nlDashBoundary", embedded: false, exported: false, typ: sliceType$1, tag: ""}, {prop: "dashBoundaryDash", name: "dashBoundaryDash", embedded: false, exported: false, typ: sliceType$1, tag: ""}, {prop: "dashBoundary", name: "dashBoundary", embedded: false, exported: false, typ: sliceType$1, tag: ""}]); Form.init("", [{prop: "Value", name: "Value", embedded: false, exported: true, typ: mapType$1, tag: ""}, {prop: "File", name: "File", embedded: false, exported: true, typ: mapType$2, tag: ""}]); FileHeader.init("mime/multipart", [{prop: "Filename", name: "Filename", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Header", name: "Header", embedded: false, exported: true, typ: textproto.MIMEHeader, tag: ""}, {prop: "Size", name: "Size", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "content", name: "content", embedded: false, exported: false, typ: sliceType$1, tag: ""}, {prop: "tmpfile", name: "tmpfile", embedded: false, exported: false, typ: $String, tag: ""}]); File.init([{prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], 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: "Seek", name: "Seek", pkg: "", typ: $funcType([$Int64, $Int], [$Int64, $error], false)}]); sectionReadCloser.init("", [{prop: "SectionReader", name: "SectionReader", embedded: true, exported: true, typ: ptrType$8, 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 = bufio.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = bytes.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = rand.$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 = 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 = mime.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = quotedprintable.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = textproto.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = os.$init(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = filepath.$init(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sort.$init(); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strings.$init(); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } quoteEscaper = strings.NewReplacer(new sliceType(["\\", "\\\\", "\"", "\\\""])); emptyParams = {}; $pkg.ErrMessageTooLarge = errors.New("multipart: message too large"); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["net/http/httptrace"] = (function() { var $pkg = {}, $init, context, tls, nettrace, net, textproto, reflect, time, clientEventContextKey, ClientTrace, WroteRequestInfo, DNSStartInfo, DNSDoneInfo, GotConnInfo, ptrType, sliceType, funcType, funcType$1, funcType$2, funcType$3, funcType$4, funcType$5, funcType$6, funcType$7, funcType$8, funcType$9, sliceType$1, funcType$10, funcType$11, ContextClientTrace; context = $packages["context"]; tls = $packages["crypto/tls"]; nettrace = $packages["internal/nettrace"]; net = $packages["net"]; textproto = $packages["net/textproto"]; reflect = $packages["reflect"]; time = $packages["time"]; clientEventContextKey = $pkg.clientEventContextKey = $newType(0, $kindStruct, "httptrace.clientEventContextKey", true, "net/http/httptrace", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); ClientTrace = $pkg.ClientTrace = $newType(0, $kindStruct, "httptrace.ClientTrace", true, "net/http/httptrace", true, function(GetConn_, GotConn_, PutIdleConn_, GotFirstResponseByte_, Got100Continue_, Got1xxResponse_, DNSStart_, DNSDone_, ConnectStart_, ConnectDone_, TLSHandshakeStart_, TLSHandshakeDone_, WroteHeaderField_, WroteHeaders_, Wait100Continue_, WroteRequest_) { this.$val = this; if (arguments.length === 0) { this.GetConn = $throwNilPointerError; this.GotConn = $throwNilPointerError; this.PutIdleConn = $throwNilPointerError; this.GotFirstResponseByte = $throwNilPointerError; this.Got100Continue = $throwNilPointerError; this.Got1xxResponse = $throwNilPointerError; this.DNSStart = $throwNilPointerError; this.DNSDone = $throwNilPointerError; this.ConnectStart = $throwNilPointerError; this.ConnectDone = $throwNilPointerError; this.TLSHandshakeStart = $throwNilPointerError; this.TLSHandshakeDone = $throwNilPointerError; this.WroteHeaderField = $throwNilPointerError; this.WroteHeaders = $throwNilPointerError; this.Wait100Continue = $throwNilPointerError; this.WroteRequest = $throwNilPointerError; return; } this.GetConn = GetConn_; this.GotConn = GotConn_; this.PutIdleConn = PutIdleConn_; this.GotFirstResponseByte = GotFirstResponseByte_; this.Got100Continue = Got100Continue_; this.Got1xxResponse = Got1xxResponse_; this.DNSStart = DNSStart_; this.DNSDone = DNSDone_; this.ConnectStart = ConnectStart_; this.ConnectDone = ConnectDone_; this.TLSHandshakeStart = TLSHandshakeStart_; this.TLSHandshakeDone = TLSHandshakeDone_; this.WroteHeaderField = WroteHeaderField_; this.WroteHeaders = WroteHeaders_; this.Wait100Continue = Wait100Continue_; this.WroteRequest = WroteRequest_; }); WroteRequestInfo = $pkg.WroteRequestInfo = $newType(0, $kindStruct, "httptrace.WroteRequestInfo", true, "net/http/httptrace", true, function(Err_) { this.$val = this; if (arguments.length === 0) { this.Err = $ifaceNil; return; } this.Err = Err_; }); DNSStartInfo = $pkg.DNSStartInfo = $newType(0, $kindStruct, "httptrace.DNSStartInfo", true, "net/http/httptrace", true, function(Host_) { this.$val = this; if (arguments.length === 0) { this.Host = ""; return; } this.Host = Host_; }); DNSDoneInfo = $pkg.DNSDoneInfo = $newType(0, $kindStruct, "httptrace.DNSDoneInfo", true, "net/http/httptrace", true, function(Addrs_, Err_, Coalesced_) { this.$val = this; if (arguments.length === 0) { this.Addrs = sliceType.nil; this.Err = $ifaceNil; this.Coalesced = false; return; } this.Addrs = Addrs_; this.Err = Err_; this.Coalesced = Coalesced_; }); GotConnInfo = $pkg.GotConnInfo = $newType(0, $kindStruct, "httptrace.GotConnInfo", true, "net/http/httptrace", true, function(Conn_, Reused_, WasIdle_, IdleTime_) { this.$val = this; if (arguments.length === 0) { this.Conn = $ifaceNil; this.Reused = false; this.WasIdle = false; this.IdleTime = new time.Duration(0, 0); return; } this.Conn = Conn_; this.Reused = Reused_; this.WasIdle = WasIdle_; this.IdleTime = IdleTime_; }); ptrType = $ptrType(ClientTrace); sliceType = $sliceType(net.IPAddr); funcType = $funcType([$String], [], false); funcType$1 = $funcType([GotConnInfo], [], false); funcType$2 = $funcType([$error], [], false); funcType$3 = $funcType([], [], false); funcType$4 = $funcType([$Int, textproto.MIMEHeader], [$error], false); funcType$5 = $funcType([DNSStartInfo], [], false); funcType$6 = $funcType([DNSDoneInfo], [], false); funcType$7 = $funcType([$String, $String], [], false); funcType$8 = $funcType([$String, $String, $error], [], false); funcType$9 = $funcType([tls.ConnectionState, $error], [], false); sliceType$1 = $sliceType($String); funcType$10 = $funcType([$String, sliceType$1], [], false); funcType$11 = $funcType([WroteRequestInfo], [], false); ContextClientTrace = function(ctx) { var _r, _tuple, ctx, trace, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; ctx = $f.ctx; trace = $f.trace; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = ctx.Value((x = new clientEventContextKey.ptr(), new x.constructor.elem(x))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = $assertType(_r, ptrType, true); trace = _tuple[0]; $s = -1; return trace; /* */ } return; } if ($f === undefined) { $f = { $blk: ContextClientTrace }; } $f._r = _r; $f._tuple = _tuple; $f.ctx = ctx; $f.trace = trace; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.ContextClientTrace = ContextClientTrace; ptrType.methods = [{prop: "compose", name: "compose", pkg: "net/http/httptrace", typ: $funcType([ptrType], [], false)}, {prop: "hasNetHooks", name: "hasNetHooks", pkg: "net/http/httptrace", typ: $funcType([], [$Bool], false)}]; clientEventContextKey.init("", []); ClientTrace.init("", [{prop: "GetConn", name: "GetConn", embedded: false, exported: true, typ: funcType, tag: ""}, {prop: "GotConn", name: "GotConn", embedded: false, exported: true, typ: funcType$1, tag: ""}, {prop: "PutIdleConn", name: "PutIdleConn", embedded: false, exported: true, typ: funcType$2, tag: ""}, {prop: "GotFirstResponseByte", name: "GotFirstResponseByte", embedded: false, exported: true, typ: funcType$3, tag: ""}, {prop: "Got100Continue", name: "Got100Continue", embedded: false, exported: true, typ: funcType$3, tag: ""}, {prop: "Got1xxResponse", name: "Got1xxResponse", embedded: false, exported: true, typ: funcType$4, tag: ""}, {prop: "DNSStart", name: "DNSStart", embedded: false, exported: true, typ: funcType$5, tag: ""}, {prop: "DNSDone", name: "DNSDone", embedded: false, exported: true, typ: funcType$6, tag: ""}, {prop: "ConnectStart", name: "ConnectStart", embedded: false, exported: true, typ: funcType$7, tag: ""}, {prop: "ConnectDone", name: "ConnectDone", embedded: false, exported: true, typ: funcType$8, tag: ""}, {prop: "TLSHandshakeStart", name: "TLSHandshakeStart", embedded: false, exported: true, typ: funcType$3, tag: ""}, {prop: "TLSHandshakeDone", name: "TLSHandshakeDone", embedded: false, exported: true, typ: funcType$9, tag: ""}, {prop: "WroteHeaderField", name: "WroteHeaderField", embedded: false, exported: true, typ: funcType$10, tag: ""}, {prop: "WroteHeaders", name: "WroteHeaders", embedded: false, exported: true, typ: funcType$3, tag: ""}, {prop: "Wait100Continue", name: "Wait100Continue", embedded: false, exported: true, typ: funcType$3, tag: ""}, {prop: "WroteRequest", name: "WroteRequest", embedded: false, exported: true, typ: funcType$11, tag: ""}]); WroteRequestInfo.init("", [{prop: "Err", name: "Err", embedded: false, exported: true, typ: $error, tag: ""}]); DNSStartInfo.init("", [{prop: "Host", name: "Host", embedded: false, exported: true, typ: $String, tag: ""}]); DNSDoneInfo.init("", [{prop: "Addrs", name: "Addrs", embedded: false, exported: true, typ: sliceType, tag: ""}, {prop: "Err", name: "Err", embedded: false, exported: true, typ: $error, tag: ""}, {prop: "Coalesced", name: "Coalesced", embedded: false, exported: true, typ: $Bool, tag: ""}]); GotConnInfo.init("", [{prop: "Conn", name: "Conn", embedded: false, exported: true, typ: net.Conn, tag: ""}, {prop: "Reused", name: "Reused", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "WasIdle", name: "WasIdle", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "IdleTime", name: "IdleTime", embedded: false, exported: true, typ: time.Duration, 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 = context.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = tls.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = nettrace.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = net.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = textproto.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = reflect.$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; } /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["net/http/internal"] = (function() { var $pkg = {}, $init, bufio, bytes, errors, fmt, io, chunkedReader, chunkedWriter, FlushAfterChunkWriter, ptrType, arrayType, sliceType, sliceType$1, ptrType$1, ptrType$2, ptrType$3, ptrType$4, NewChunkedReader, readChunkLine, trimTrailingWhitespace, isASCIISpace, removeChunkExtension, NewChunkedWriter, parseHexUint; bufio = $packages["bufio"]; bytes = $packages["bytes"]; errors = $packages["errors"]; fmt = $packages["fmt"]; io = $packages["io"]; chunkedReader = $pkg.chunkedReader = $newType(0, $kindStruct, "internal.chunkedReader", true, "net/http/internal", false, function(r_, n_, err_, buf_, checkEnd_) { this.$val = this; if (arguments.length === 0) { this.r = ptrType.nil; this.n = new $Uint64(0, 0); this.err = $ifaceNil; this.buf = arrayType.zero(); this.checkEnd = false; return; } this.r = r_; this.n = n_; this.err = err_; this.buf = buf_; this.checkEnd = checkEnd_; }); chunkedWriter = $pkg.chunkedWriter = $newType(0, $kindStruct, "internal.chunkedWriter", true, "net/http/internal", false, function(Wire_) { this.$val = this; if (arguments.length === 0) { this.Wire = $ifaceNil; return; } this.Wire = Wire_; }); FlushAfterChunkWriter = $pkg.FlushAfterChunkWriter = $newType(0, $kindStruct, "internal.FlushAfterChunkWriter", true, "net/http/internal", true, function(Writer_) { this.$val = this; if (arguments.length === 0) { this.Writer = ptrType$4.nil; return; } this.Writer = Writer_; }); ptrType = $ptrType(bufio.Reader); arrayType = $arrayType($Uint8, 2); sliceType = $sliceType($Uint8); sliceType$1 = $sliceType($emptyInterface); ptrType$1 = $ptrType(FlushAfterChunkWriter); ptrType$2 = $ptrType(chunkedReader); ptrType$3 = $ptrType(chunkedWriter); ptrType$4 = $ptrType(bufio.Writer); NewChunkedReader = function(r) { var _tuple, br, ok, r; _tuple = $assertType(r, ptrType, true); br = _tuple[0]; ok = _tuple[1]; if (!ok) { br = bufio.NewReader(r); } return new chunkedReader.ptr(br, new $Uint64(0, 0), $ifaceNil, arrayType.zero(), false); }; $pkg.NewChunkedReader = NewChunkedReader; chunkedReader.ptr.prototype.beginChunk = function() { var _r, _tuple, _tuple$1, cr, line, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; cr = $f.cr; line = $f.line; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cr = this; line = sliceType.nil; _r = readChunkLine(cr.r); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; line = _tuple[0]; cr.err = _tuple[1]; if (!($interfaceIsEqual(cr.err, $ifaceNil))) { $s = -1; return; } _tuple$1 = parseHexUint(line); cr.n = _tuple$1[0]; cr.err = _tuple$1[1]; if (!($interfaceIsEqual(cr.err, $ifaceNil))) { $s = -1; return; } if ((x = cr.n, (x.$high === 0 && x.$low === 0))) { cr.err = io.EOF; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: chunkedReader.ptr.prototype.beginChunk }; } $f._r = _r; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.cr = cr; $f.line = line; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; chunkedReader.prototype.beginChunk = function() { return this.$val.beginChunk(); }; chunkedReader.ptr.prototype.chunkHeaderAvailable = function() { var _r, _tuple, cr, n, peek, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; cr = $f.cr; n = $f.n; peek = $f.peek; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cr = this; n = cr.r.Buffered(); /* */ if (n > 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (n > 0) { */ case 1: _r = cr.r.Peek(n); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; peek = _tuple[0]; $s = -1; return bytes.IndexByte(peek, 10) >= 0; /* } */ case 2: $s = -1; return false; /* */ } return; } if ($f === undefined) { $f = { $blk: chunkedReader.ptr.prototype.chunkHeaderAvailable }; } $f._r = _r; $f._tuple = _tuple; $f.cr = cr; $f.n = n; $f.peek = peek; $f.$s = $s; $f.$r = $r; return $f; }; chunkedReader.prototype.chunkHeaderAvailable = function() { return this.$val.chunkHeaderAvailable(); }; chunkedReader.ptr.prototype.Read = function(b) { var _r, _r$1, _r$2, _tmp, _tmp$1, _tuple, _tuple$1, _v, b, cr, err, n, n0, rbuf, 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; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _v = $f._v; b = $f.b; cr = $f.cr; err = $f.err; n = $f.n; n0 = $f.n0; rbuf = $f.rbuf; 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: n = 0; err = $ifaceNil; cr = this; /* while (true) { */ case 1: /* if (!($interfaceIsEqual(cr.err, $ifaceNil))) { break; } */ if(!($interfaceIsEqual(cr.err, $ifaceNil))) { $s = 2; continue; } /* */ if (cr.checkEnd) { $s = 3; continue; } /* */ $s = 4; continue; /* if (cr.checkEnd) { */ case 3: if (n > 0 && cr.r.Buffered() < 2) { /* break; */ $s = 2; continue; } _r = io.ReadFull(cr.r, $subslice(new sliceType(cr.buf), 0, 2)); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; cr.err = _tuple[1]; if ($interfaceIsEqual(cr.err, $ifaceNil)) { if (!(($bytesToString(new sliceType(cr.buf))) === "\r\n")) { cr.err = errors.New("malformed chunked encoding"); /* break; */ $s = 2; continue; } } cr.checkEnd = false; /* } */ case 4: /* */ if ((x = cr.n, (x.$high === 0 && x.$low === 0))) { $s = 6; continue; } /* */ $s = 7; continue; /* if ((x = cr.n, (x.$high === 0 && x.$low === 0))) { */ case 6: if (!(n > 0)) { _v = false; $s = 10; continue s; } _r$1 = cr.chunkHeaderAvailable(); /* */ $s = 11; case 11: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _v = !_r$1; case 10: /* */ if (_v) { $s = 8; continue; } /* */ $s = 9; continue; /* if (_v) { */ case 8: /* break; */ $s = 2; continue; /* } */ case 9: $r = cr.beginChunk(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* continue; */ $s = 1; continue; /* } */ case 7: if (b.$length === 0) { /* break; */ $s = 2; continue; } rbuf = b; if ((x$1 = (new $Uint64(0, rbuf.$length)), x$2 = cr.n, (x$1.$high > x$2.$high || (x$1.$high === x$2.$high && x$1.$low > x$2.$low)))) { rbuf = $subslice(rbuf, 0, $flatten64(cr.n)); } n0 = 0; _r$2 = cr.r.Read(rbuf); /* */ $s = 13; case 13: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; n0 = _tuple$1[0]; cr.err = _tuple$1[1]; n = n + (n0) >> 0; b = $subslice(b, n0); cr.n = (x$3 = cr.n, x$4 = (new $Uint64(0, n0)), new $Uint64(x$3.$high - x$4.$high, x$3.$low - x$4.$low)); if ((x$5 = cr.n, (x$5.$high === 0 && x$5.$low === 0)) && $interfaceIsEqual(cr.err, $ifaceNil)) { cr.checkEnd = true; } $s = 1; continue; case 2: _tmp = n; _tmp$1 = cr.err; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: chunkedReader.ptr.prototype.Read }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._v = _v; $f.b = b; $f.cr = cr; $f.err = err; $f.n = n; $f.n0 = n0; $f.rbuf = rbuf; $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; }; chunkedReader.prototype.Read = function(b) { return this.$val.Read(b); }; readChunkLine = function(b) { var _r, _tuple, _tuple$1, b, err, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; b = $f.b; err = $f.err; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = b.ReadSlice(10); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; p = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { if ($interfaceIsEqual(err, io.EOF)) { err = io.ErrUnexpectedEOF; } else if ($interfaceIsEqual(err, bufio.ErrBufferFull)) { err = $pkg.ErrLineTooLong; } $s = -1; return [sliceType.nil, err]; } if (p.$length >= 4096) { $s = -1; return [sliceType.nil, $pkg.ErrLineTooLong]; } p = trimTrailingWhitespace(p); _tuple$1 = removeChunkExtension(p); p = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType.nil, err]; } $s = -1; return [p, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: readChunkLine }; } $f._r = _r; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.b = b; $f.err = err; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; trimTrailingWhitespace = function(b) { var b, x; while (true) { if (!(b.$length > 0 && isASCIISpace((x = b.$length - 1 >> 0, ((x < 0 || x >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + x]))))) { break; } b = $subslice(b, 0, (b.$length - 1 >> 0)); } return b; }; isASCIISpace = function(b) { var b; return (b === 32) || (b === 9) || (b === 10) || (b === 13); }; removeChunkExtension = function(p) { var p, semi; semi = bytes.IndexByte(p, 59); if (semi === -1) { return [p, $ifaceNil]; } return [$subslice(p, 0, semi), $ifaceNil]; }; NewChunkedWriter = function(w) { var w; return new chunkedWriter.ptr(w); }; $pkg.NewChunkedWriter = NewChunkedWriter; chunkedWriter.ptr.prototype.Write = function(data) { var _r, _r$1, _r$2, _r$3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, _tuple$2, _tuple$3, bw, cw, data, err, n, ok, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _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; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; bw = $f.bw; cw = $f.cw; data = $f.data; err = $f.err; n = $f.n; ok = $f.ok; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; cw = this; if (data.$length === 0) { _tmp = 0; _tmp$1 = $ifaceNil; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } _r = fmt.Fprintf(cw.Wire, "%x\r\n", new sliceType$1([new $Int(data.$length)])); /* */ $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))) { _tmp$2 = 0; _tmp$3 = err; n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; } _r$1 = cw.Wire.Write(data); /* */ $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; n = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [n, err]; } if (!((n === data.$length))) { err = io.ErrShortWrite; $s = -1; return [n, err]; } _r$2 = io.WriteString(cw.Wire, "\r\n"); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$2 = _r$2; err = _tuple$2[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [n, err]; } _tuple$3 = $assertType(cw.Wire, ptrType$1, true); bw = _tuple$3[0]; ok = _tuple$3[1]; /* */ if (ok) { $s = 4; continue; } /* */ $s = 5; continue; /* if (ok) { */ case 4: _r$3 = bw.Writer.Flush(); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } err = _r$3; /* } */ case 5: $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: chunkedWriter.ptr.prototype.Write }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $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._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.bw = bw; $f.cw = cw; $f.data = data; $f.err = err; $f.n = n; $f.ok = ok; $f.$s = $s; $f.$r = $r; return $f; }; chunkedWriter.prototype.Write = function(data) { return this.$val.Write(data); }; chunkedWriter.ptr.prototype.Close = function() { var _r, _tuple, cw, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; cw = $f.cw; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cw = this; _r = io.WriteString(cw.Wire, "0\r\n"); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; err = _tuple[1]; $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: chunkedWriter.ptr.prototype.Close }; } $f._r = _r; $f._tuple = _tuple; $f.cw = cw; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; chunkedWriter.prototype.Close = function() { return this.$val.Close(); }; parseHexUint = function(v) { var _i, _ref, _tmp, _tmp$1, _tmp$2, _tmp$3, b, err, i, n, v, x; n = new $Uint64(0, 0); err = $ifaceNil; _ref = v; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; b = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (48 <= b && b <= 57) { b = b - 48 << 24 >>> 24; } else if (97 <= b && b <= 102) { b = (b - 97 << 24 >>> 24) + 10 << 24 >>> 24; } else if (65 <= b && b <= 70) { b = (b - 65 << 24 >>> 24) + 10 << 24 >>> 24; } else { _tmp = new $Uint64(0, 0); _tmp$1 = errors.New("invalid byte in chunk length"); n = _tmp; err = _tmp$1; return [n, err]; } if (i === 16) { _tmp$2 = new $Uint64(0, 0); _tmp$3 = errors.New("http chunk length too large"); n = _tmp$2; err = _tmp$3; return [n, err]; } n = $shiftLeft64(n, (4)); n = (x = (new $Uint64(0, b)), new $Uint64(n.$high | x.$high, (n.$low | x.$low) >>> 0)); _i++; } return [n, err]; }; ptrType$2.methods = [{prop: "beginChunk", name: "beginChunk", pkg: "net/http/internal", typ: $funcType([], [], false)}, {prop: "chunkHeaderAvailable", name: "chunkHeaderAvailable", pkg: "net/http/internal", typ: $funcType([], [$Bool], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}]; ptrType$3.methods = [{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}]; chunkedReader.init("net/http/internal", [{prop: "r", name: "r", embedded: false, exported: false, typ: ptrType, tag: ""}, {prop: "n", name: "n", embedded: false, exported: false, typ: $Uint64, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "buf", name: "buf", embedded: false, exported: false, typ: arrayType, tag: ""}, {prop: "checkEnd", name: "checkEnd", embedded: false, exported: false, typ: $Bool, tag: ""}]); chunkedWriter.init("", [{prop: "Wire", name: "Wire", embedded: false, exported: true, typ: io.Writer, tag: ""}]); FlushAfterChunkWriter.init("", [{prop: "Writer", name: "Writer", embedded: true, exported: true, typ: ptrType$4, 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 = bufio.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = bytes.$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 = io.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $pkg.ErrLineTooLong = errors.New("header line too long"); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["net/http/internal/ascii"] = (function() { var $pkg = {}, $init, strings, unicode, EqualFold, lower, IsPrint, Is, ToLower; strings = $packages["strings"]; unicode = $packages["unicode"]; EqualFold = function(s, t) { var i, s, t; if (!((s.length === t.length))) { return false; } i = 0; while (true) { if (!(i < s.length)) { break; } if (!((lower(s.charCodeAt(i)) === lower(t.charCodeAt(i))))) { return false; } i = i + (1) >> 0; } return true; }; $pkg.EqualFold = EqualFold; lower = function(b) { var b; if (65 <= b && b <= 90) { return b + 32 << 24 >>> 24; } return b; }; IsPrint = function(s) { var i, s; i = 0; while (true) { if (!(i < s.length)) { break; } if (s.charCodeAt(i) < 32 || s.charCodeAt(i) > 126) { return false; } i = i + (1) >> 0; } return true; }; $pkg.IsPrint = IsPrint; Is = function(s) { var i, s; i = 0; while (true) { if (!(i < s.length)) { break; } if (s.charCodeAt(i) > 127) { return false; } i = i + (1) >> 0; } return true; }; $pkg.Is = Is; ToLower = function(s) { var $24r, _r, _tmp, _tmp$1, _tmp$2, _tmp$3, lower$1, ok, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; lower$1 = $f.lower$1; ok = $f.ok; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: lower$1 = ""; ok = false; if (!IsPrint(s)) { _tmp = ""; _tmp$1 = false; lower$1 = _tmp; ok = _tmp$1; $s = -1; return [lower$1, ok]; } _r = strings.ToLower(s); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tmp$2 = _r; _tmp$3 = true; lower$1 = _tmp$2; ok = _tmp$3; $24r = [lower$1, ok]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: ToLower }; } $f.$24r = $24r; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f.lower$1 = lower$1; $f.ok = ok; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.ToLower = ToLower; $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 = strings.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = unicode.$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["vendor/golang.org/x/text/transform"] = (function() { var $pkg = {}, $init, bytes, errors, io, utf8, errInconsistentByteCount, errShortInternal; bytes = $packages["bytes"]; errors = $packages["errors"]; io = $packages["io"]; utf8 = $packages["unicode/utf8"]; $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 = errors.$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 = utf8.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $pkg.ErrShortDst = errors.New("transform: short destination buffer"); $pkg.ErrShortSrc = errors.New("transform: short source buffer"); $pkg.ErrEndOfSpan = errors.New("transform: input and output are not identical"); errInconsistentByteCount = errors.New("transform: inconsistent byte count returned"); errShortInternal = errors.New("transform: short internal buffer"); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["vendor/golang.org/x/text/unicode/bidi"] = (function() { var $pkg = {}, $init, bytes, list, fmt, log, sort, utf8, Class, bidiTrie, Properties, arrayType, sliceType$1, sliceType$2, ptrType$4, bidiValues, bidiIndex, trie, controlByteToClass, newBidiTrie, LookupRune, Lookup, LookupString; bytes = $packages["bytes"]; list = $packages["container/list"]; fmt = $packages["fmt"]; log = $packages["log"]; sort = $packages["sort"]; utf8 = $packages["unicode/utf8"]; Class = $pkg.Class = $newType(4, $kindUint, "bidi.Class", true, "vendor/golang.org/x/text/unicode/bidi", true, null); bidiTrie = $pkg.bidiTrie = $newType(0, $kindStruct, "bidi.bidiTrie", true, "vendor/golang.org/x/text/unicode/bidi", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); Properties = $pkg.Properties = $newType(0, $kindStruct, "bidi.Properties", true, "vendor/golang.org/x/text/unicode/bidi", true, function(entry_, last_) { this.$val = this; if (arguments.length === 0) { this.entry = 0; this.last = 0; return; } this.entry = entry_; this.last = last_; }); arrayType = $arrayType($Uint8, 4); sliceType$1 = $sliceType($Uint8); sliceType$2 = $sliceType(Class); ptrType$4 = $ptrType(bidiTrie); newBidiTrie = function(i) { var i; return new bidiTrie.ptr(); }; bidiTrie.ptr.prototype.lookupValue = function(n, b) { var b, n, t, x; t = this; return ((x = (n << 6 >>> 0) + ((b >>> 0)) >>> 0, ((x < 0 || x >= bidiValues.length) ? ($throwRuntimeError("index out of range"), undefined) : bidiValues[x]))); }; bidiTrie.prototype.lookupValue = function(n, b) { return this.$val.lookupValue(n, b); }; Properties.ptr.prototype.Class = function() { var c, p, x; p = this; c = ((((p.entry & 15) >>> 0) >>> 0)); if (c === 14) { c = (x = (p.last & 15) >>> 0, ((x < 0 || x >= controlByteToClass.length) ? ($throwRuntimeError("index out of range"), undefined) : controlByteToClass[x])); } return c; }; Properties.prototype.Class = function() { return this.$val.Class(); }; Properties.ptr.prototype.IsBracket = function() { var p; p = this; return !((((p.entry & 240) >>> 0) === 0)); }; Properties.prototype.IsBracket = function() { return this.$val.IsBracket(); }; Properties.ptr.prototype.IsOpeningBracket = function() { var p; p = this; return !((((p.entry & 16) >>> 0) === 0)); }; Properties.prototype.IsOpeningBracket = function() { return this.$val.IsOpeningBracket(); }; LookupRune = function(r) { var _tuple, buf, n, p, r, size; p = new Properties.ptr(0, 0); size = 0; buf = arrayType.zero(); n = utf8.EncodeRune(new sliceType$1(buf), r); _tuple = Lookup($subslice(new sliceType$1(buf), 0, n)); Properties.copy(p, _tuple[0]); size = _tuple[1]; return [p, size]; }; $pkg.LookupRune = LookupRune; Lookup = function(s) { var _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$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, c0, c1, c1$1, c1$2, c2, c2$1, c3, i, i$1, i$2, o, o$1, p, s, sz; p = new Properties.ptr(0, 0); sz = 0; c0 = (0 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 0]); if (c0 < 128) { _tmp = new Properties.ptr(((c0 < 0 || c0 >= bidiValues.length) ? ($throwRuntimeError("index out of range"), undefined) : bidiValues[c0]), 0); _tmp$1 = 1; Properties.copy(p, _tmp); sz = _tmp$1; return [p, sz]; } else if (c0 < 194) { _tmp$2 = new Properties.ptr(0, 0); _tmp$3 = 1; Properties.copy(p, _tmp$2); sz = _tmp$3; return [p, sz]; } else if (c0 < 224) { if (s.$length < 2) { _tmp$4 = new Properties.ptr(0, 0); _tmp$5 = 0; Properties.copy(p, _tmp$4); sz = _tmp$5; return [p, sz]; } i = ((c0 < 0 || c0 >= bidiIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : bidiIndex[c0]); c1 = (1 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 1]); if (c1 < 128 || 192 <= c1) { _tmp$6 = new Properties.ptr(0, 0); _tmp$7 = 1; Properties.copy(p, _tmp$6); sz = _tmp$7; return [p, sz]; } _tmp$8 = new Properties.ptr(trie.lookupValue(((i >>> 0)), c1), 0); _tmp$9 = 2; Properties.copy(p, _tmp$8); sz = _tmp$9; return [p, sz]; } else if (c0 < 240) { if (s.$length < 3) { _tmp$10 = new Properties.ptr(0, 0); _tmp$11 = 0; Properties.copy(p, _tmp$10); sz = _tmp$11; return [p, sz]; } i$1 = ((c0 < 0 || c0 >= bidiIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : bidiIndex[c0]); c1$1 = (1 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 1]); if (c1$1 < 128 || 192 <= c1$1) { _tmp$12 = new Properties.ptr(0, 0); _tmp$13 = 1; Properties.copy(p, _tmp$12); sz = _tmp$13; return [p, sz]; } o = (((i$1 >>> 0)) << 6 >>> 0) + ((c1$1 >>> 0)) >>> 0; i$1 = ((o < 0 || o >= bidiIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : bidiIndex[o]); c2 = (2 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 2]); if (c2 < 128 || 192 <= c2) { _tmp$14 = new Properties.ptr(0, 0); _tmp$15 = 1; Properties.copy(p, _tmp$14); sz = _tmp$15; return [p, sz]; } _tmp$16 = new Properties.ptr(trie.lookupValue(((i$1 >>> 0)), c2), c2); _tmp$17 = 3; Properties.copy(p, _tmp$16); sz = _tmp$17; return [p, sz]; } else if (c0 < 248) { if (s.$length < 4) { _tmp$18 = new Properties.ptr(0, 0); _tmp$19 = 0; Properties.copy(p, _tmp$18); sz = _tmp$19; return [p, sz]; } i$2 = ((c0 < 0 || c0 >= bidiIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : bidiIndex[c0]); c1$2 = (1 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 1]); if (c1$2 < 128 || 192 <= c1$2) { _tmp$20 = new Properties.ptr(0, 0); _tmp$21 = 1; Properties.copy(p, _tmp$20); sz = _tmp$21; return [p, sz]; } o$1 = (((i$2 >>> 0)) << 6 >>> 0) + ((c1$2 >>> 0)) >>> 0; i$2 = ((o$1 < 0 || o$1 >= bidiIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : bidiIndex[o$1]); c2$1 = (2 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 2]); if (c2$1 < 128 || 192 <= c2$1) { _tmp$22 = new Properties.ptr(0, 0); _tmp$23 = 1; Properties.copy(p, _tmp$22); sz = _tmp$23; return [p, sz]; } o$1 = (((i$2 >>> 0)) << 6 >>> 0) + ((c2$1 >>> 0)) >>> 0; i$2 = ((o$1 < 0 || o$1 >= bidiIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : bidiIndex[o$1]); c3 = (3 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 3]); if (c3 < 128 || 192 <= c3) { _tmp$24 = new Properties.ptr(0, 0); _tmp$25 = 1; Properties.copy(p, _tmp$24); sz = _tmp$25; return [p, sz]; } _tmp$26 = new Properties.ptr(trie.lookupValue(((i$2 >>> 0)), c3), 0); _tmp$27 = 4; Properties.copy(p, _tmp$26); sz = _tmp$27; return [p, sz]; } _tmp$28 = new Properties.ptr(0, 0); _tmp$29 = 1; Properties.copy(p, _tmp$28); sz = _tmp$29; return [p, sz]; }; $pkg.Lookup = Lookup; LookupString = function(s) { var _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$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, c0, c1, c1$1, c1$2, c2, c2$1, c3, i, i$1, i$2, o, o$1, p, s, sz; p = new Properties.ptr(0, 0); sz = 0; c0 = s.charCodeAt(0); if (c0 < 128) { _tmp = new Properties.ptr(((c0 < 0 || c0 >= bidiValues.length) ? ($throwRuntimeError("index out of range"), undefined) : bidiValues[c0]), 0); _tmp$1 = 1; Properties.copy(p, _tmp); sz = _tmp$1; return [p, sz]; } else if (c0 < 194) { _tmp$2 = new Properties.ptr(0, 0); _tmp$3 = 1; Properties.copy(p, _tmp$2); sz = _tmp$3; return [p, sz]; } else if (c0 < 224) { if (s.length < 2) { _tmp$4 = new Properties.ptr(0, 0); _tmp$5 = 0; Properties.copy(p, _tmp$4); sz = _tmp$5; return [p, sz]; } i = ((c0 < 0 || c0 >= bidiIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : bidiIndex[c0]); c1 = s.charCodeAt(1); if (c1 < 128 || 192 <= c1) { _tmp$6 = new Properties.ptr(0, 0); _tmp$7 = 1; Properties.copy(p, _tmp$6); sz = _tmp$7; return [p, sz]; } _tmp$8 = new Properties.ptr(trie.lookupValue(((i >>> 0)), c1), 0); _tmp$9 = 2; Properties.copy(p, _tmp$8); sz = _tmp$9; return [p, sz]; } else if (c0 < 240) { if (s.length < 3) { _tmp$10 = new Properties.ptr(0, 0); _tmp$11 = 0; Properties.copy(p, _tmp$10); sz = _tmp$11; return [p, sz]; } i$1 = ((c0 < 0 || c0 >= bidiIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : bidiIndex[c0]); c1$1 = s.charCodeAt(1); if (c1$1 < 128 || 192 <= c1$1) { _tmp$12 = new Properties.ptr(0, 0); _tmp$13 = 1; Properties.copy(p, _tmp$12); sz = _tmp$13; return [p, sz]; } o = (((i$1 >>> 0)) << 6 >>> 0) + ((c1$1 >>> 0)) >>> 0; i$1 = ((o < 0 || o >= bidiIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : bidiIndex[o]); c2 = s.charCodeAt(2); if (c2 < 128 || 192 <= c2) { _tmp$14 = new Properties.ptr(0, 0); _tmp$15 = 1; Properties.copy(p, _tmp$14); sz = _tmp$15; return [p, sz]; } _tmp$16 = new Properties.ptr(trie.lookupValue(((i$1 >>> 0)), c2), c2); _tmp$17 = 3; Properties.copy(p, _tmp$16); sz = _tmp$17; return [p, sz]; } else if (c0 < 248) { if (s.length < 4) { _tmp$18 = new Properties.ptr(0, 0); _tmp$19 = 0; Properties.copy(p, _tmp$18); sz = _tmp$19; return [p, sz]; } i$2 = ((c0 < 0 || c0 >= bidiIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : bidiIndex[c0]); c1$2 = s.charCodeAt(1); if (c1$2 < 128 || 192 <= c1$2) { _tmp$20 = new Properties.ptr(0, 0); _tmp$21 = 1; Properties.copy(p, _tmp$20); sz = _tmp$21; return [p, sz]; } o$1 = (((i$2 >>> 0)) << 6 >>> 0) + ((c1$2 >>> 0)) >>> 0; i$2 = ((o$1 < 0 || o$1 >= bidiIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : bidiIndex[o$1]); c2$1 = s.charCodeAt(2); if (c2$1 < 128 || 192 <= c2$1) { _tmp$22 = new Properties.ptr(0, 0); _tmp$23 = 1; Properties.copy(p, _tmp$22); sz = _tmp$23; return [p, sz]; } o$1 = (((i$2 >>> 0)) << 6 >>> 0) + ((c2$1 >>> 0)) >>> 0; i$2 = ((o$1 < 0 || o$1 >= bidiIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : bidiIndex[o$1]); c3 = s.charCodeAt(3); if (c3 < 128 || 192 <= c3) { _tmp$24 = new Properties.ptr(0, 0); _tmp$25 = 1; Properties.copy(p, _tmp$24); sz = _tmp$25; return [p, sz]; } _tmp$26 = new Properties.ptr(trie.lookupValue(((i$2 >>> 0)), c3), 0); _tmp$27 = 4; Properties.copy(p, _tmp$26); sz = _tmp$27; return [p, sz]; } _tmp$28 = new Properties.ptr(0, 0); _tmp$29 = 1; Properties.copy(p, _tmp$28); sz = _tmp$29; return [p, sz]; }; $pkg.LookupString = LookupString; Class.methods = [{prop: "in$", name: "in", pkg: "vendor/golang.org/x/text/unicode/bidi", typ: $funcType([sliceType$2], [$Bool], true)}]; ptrType$4.methods = [{prop: "lookup", name: "lookup", pkg: "vendor/golang.org/x/text/unicode/bidi", typ: $funcType([sliceType$1], [$Uint8, $Int], false)}, {prop: "lookupUnsafe", name: "lookupUnsafe", pkg: "vendor/golang.org/x/text/unicode/bidi", typ: $funcType([sliceType$1], [$Uint8], false)}, {prop: "lookupString", name: "lookupString", pkg: "vendor/golang.org/x/text/unicode/bidi", typ: $funcType([$String], [$Uint8, $Int], false)}, {prop: "lookupStringUnsafe", name: "lookupStringUnsafe", pkg: "vendor/golang.org/x/text/unicode/bidi", typ: $funcType([$String], [$Uint8], false)}, {prop: "lookupValue", name: "lookupValue", pkg: "vendor/golang.org/x/text/unicode/bidi", typ: $funcType([$Uint32, $Uint8], [$Uint8], false)}]; Properties.methods = [{prop: "Class", name: "Class", pkg: "", typ: $funcType([], [Class], false)}, {prop: "IsBracket", name: "IsBracket", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "IsOpeningBracket", name: "IsOpeningBracket", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "reverseBracket", name: "reverseBracket", pkg: "vendor/golang.org/x/text/unicode/bidi", typ: $funcType([$Int32], [$Int32], false)}]; bidiTrie.init("", []); Properties.init("vendor/golang.org/x/text/unicode/bidi", [{prop: "entry", name: "entry", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "last", name: "last", embedded: false, exported: false, 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: $r = bytes.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = list.$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 = log.$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 = utf8.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } bidiValues = $toNativeArray($kindUint8, [11, 11, 11, 11, 11, 11, 11, 11, 11, 8, 7, 8, 9, 7, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 7, 7, 7, 8, 9, 10, 10, 4, 4, 4, 10, 10, 58, 42, 10, 3, 6, 3, 6, 6, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 10, 74, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 10, 74, 10, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 11, 11, 11, 11, 7, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 6, 10, 4, 4, 4, 4, 10, 10, 10, 10, 0, 10, 10, 11, 10, 10, 4, 4, 2, 2, 10, 0, 10, 10, 10, 2, 0, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 10, 10, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 10, 4, 1, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 1, 12, 1, 12, 12, 1, 12, 12, 1, 12, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 5, 5, 5, 5, 5, 10, 10, 13, 4, 4, 13, 6, 13, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 5, 5, 13, 13, 13, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 5, 10, 12, 12, 12, 12, 12, 12, 13, 13, 12, 12, 10, 12, 12, 12, 12, 13, 13, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 12, 12, 12, 12, 12, 12, 12, 12, 12, 1, 1, 10, 10, 10, 10, 1, 1, 1, 12, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 12, 12, 12, 12, 1, 12, 12, 12, 12, 12, 12, 12, 12, 12, 1, 12, 12, 12, 1, 12, 12, 12, 12, 12, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 12, 12, 12, 1, 1, 1, 1, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 5, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 12, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 12, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 12, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 12, 12, 0, 0, 12, 12, 12, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 0, 12, 12, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 12, 0, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 4, 10, 0, 0, 0, 0, 0, 12, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 0, 0, 0, 0, 0, 12, 12, 12, 0, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 12, 0, 12, 58, 42, 58, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 12, 12, 12, 12, 12, 0, 12, 12, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 0, 12, 12, 12, 12, 12, 12, 0, 12, 12, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 4, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 12, 12, 12, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 12, 12, 12, 0, 0, 0, 0, 10, 0, 0, 0, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 12, 12, 12, 12, 12, 12, 12, 0, 12, 0, 12, 0, 0, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 12, 12, 12, 12, 12, 0, 12, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 0, 0, 12, 12, 0, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 12, 12, 0, 0, 0, 12, 0, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 0, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 0, 1, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 7, 14, 14, 14, 14, 14, 6, 4, 4, 4, 4, 4, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 6, 154, 138, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 11, 11, 11, 11, 11, 11, 14, 14, 14, 14, 11, 11, 11, 11, 11, 11, 2, 0, 0, 0, 2, 2, 2, 2, 2, 2, 3, 3, 10, 154, 138, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 10, 154, 138, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 0, 10, 10, 10, 10, 0, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 10, 10, 10, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 0, 10, 0, 10, 0, 10, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 0, 0, 0, 0, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 10, 10, 10, 10, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 3, 4, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 58, 42, 58, 42, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 154, 138, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 58, 42, 58, 42, 58, 42, 58, 42, 58, 42, 58, 42, 58, 42, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 154, 138, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 58, 42, 58, 42, 58, 42, 58, 42, 58, 42, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 122, 106, 154, 138, 186, 170, 154, 138, 122, 106, 218, 42, 58, 202, 154, 138, 122, 106, 154, 138, 186, 170, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 58, 42, 58, 42, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 58, 42, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 58, 42, 58, 42, 58, 42, 58, 42, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 9, 10, 10, 10, 10, 0, 0, 0, 58, 42, 58, 42, 58, 42, 58, 42, 58, 42, 10, 10, 58, 42, 58, 42, 58, 42, 58, 42, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 0, 0, 10, 0, 0, 0, 0, 0, 10, 10, 0, 0, 0, 0, 0, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 10, 10, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 12, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 10, 10, 10, 10, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 12, 12, 12, 12, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 0, 0, 12, 12, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 12, 12, 12, 0, 0, 12, 12, 0, 0, 0, 0, 0, 12, 12, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 12, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 12, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 10, 10, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 10, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 6, 10, 6, 0, 10, 6, 10, 10, 10, 154, 138, 122, 106, 154, 138, 4, 10, 10, 3, 3, 10, 10, 10, 0, 10, 4, 4, 10, 0, 0, 0, 0, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 11, 0, 10, 10, 4, 4, 4, 10, 10, 58, 42, 10, 3, 6, 3, 6, 6, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 10, 74, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 10, 74, 10, 250, 234, 10, 58, 42, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 10, 10, 10, 4, 4, 0, 10, 10, 10, 10, 10, 10, 10, 0, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 11, 11, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 10, 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, 12, 12, 12, 1, 12, 12, 1, 1, 1, 1, 1, 12, 12, 12, 12, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 12, 12, 12, 1, 1, 1, 1, 12, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 12, 12, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 10, 10, 10, 10, 10, 10, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 13, 13, 13, 13, 13, 13, 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, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 12, 12, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 0, 0, 12, 12, 0, 0, 0, 0, 0, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 0, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 0, 0, 12, 0, 12, 12, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 12, 12, 12, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 0, 12, 0, 0, 0, 0, 12, 12, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 12, 12, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 12, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 12, 0, 0, 12, 12, 12, 12, 12, 12, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 0, 0, 12, 12, 12, 12, 0, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 12, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 0, 0, 12, 12, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 0, 0, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 0, 0, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 0, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 12, 12, 12, 12, 12, 12, 12, 0, 12, 12, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 0, 0, 0, 12, 0, 12, 12, 0, 12, 12, 12, 12, 12, 12, 12, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 12, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 4, 4, 4, 4, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 11, 11, 11, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 12, 12, 12, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 0, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 0, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 12, 12, 12, 12, 12, 12, 12, 0, 12, 12, 0, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 12, 12, 12, 12, 12, 12, 12, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 12, 12, 12, 12, 12, 12, 12, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 10, 10, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 10, 10, 10, 10, 10, 0, 0, 0, 10, 10, 10, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11]); bidiIndex = $toNativeArray($kindUint8, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 3, 4, 5, 6, 7, 8, 0, 0, 9, 0, 0, 0, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 3, 4, 5, 6, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 8, 17, 18, 18, 20, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 28, 30, 31, 32, 33, 34, 35, 36, 26, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 54, 0, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 0, 57, 58, 59, 60, 61, 0, 62, 0, 63, 64, 0, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 0, 0, 75, 0, 0, 0, 76, 0, 0, 0, 0, 0, 0, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 86, 86, 86, 88, 89, 90, 86, 91, 92, 93, 94, 86, 86, 86, 86, 86, 86, 95, 86, 86, 96, 86, 97, 0, 0, 0, 0, 86, 86, 98, 99, 86, 86, 86, 86, 86, 100, 101, 86, 0, 0, 0, 102, 0, 103, 0, 104, 105, 106, 107, 108, 86, 86, 86, 109, 110, 0, 111, 112, 0, 0, 0, 113, 114, 115, 116, 117, 0, 118, 0, 119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 121, 0, 0, 0, 0, 122, 123, 124, 125, 126, 0, 127, 0, 128, 129, 0, 130, 131, 132, 133, 134, 135, 136, 137, 138, 0, 139, 0, 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, 142, 14, 14, 14, 14, 14, 14, 143, 14, 14, 144, 145, 146, 14, 147, 148, 149, 0, 150, 0, 0, 0, 0, 151, 86, 152, 153, 0, 0, 0, 154, 0, 155, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 156, 156, 156, 157, 156, 156, 156, 158, 156, 156, 159, 160, 156, 156, 156, 156, 156, 156, 156, 161, 156, 156, 156, 156, 162, 163, 156, 164, 165, 156, 156, 166, 167, 168, 0, 169, 170, 171, 172, 173, 0, 0, 174, 38, 175, 0, 0, 176, 177, 178, 179, 0, 0, 180, 181, 182, 183, 184, 0, 185, 0, 0, 0, 186, 0, 0, 0, 187, 188, 0, 189, 190, 191, 192, 0, 0, 0, 0, 0, 193, 0, 194, 0, 195, 196, 197, 0, 0, 0, 0, 198, 0, 0, 0, 199, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200, 201, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 202, 203, 204, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 205, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 206, 207, 0, 86, 208, 0, 0, 86, 209, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 210, 211, 212, 213, 214, 0, 0, 0, 0, 0, 0, 0, 0, 215, 216, 217, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 218, 0, 0, 0, 201, 0, 0, 0, 0, 0, 0, 219, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 156, 156, 220, 156, 221, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 164, 14, 156, 14, 222, 156, 156, 14, 14, 14, 223, 156, 156, 156, 156, 224, 86, 225, 226, 227, 228, 229, 0, 0, 230, 0, 0, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 231, 86, 108, 86, 232, 233, 234, 235, 0, 86, 236, 86, 237, 86, 238, 239, 240, 86, 86, 241, 242, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 243, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 243, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 10, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 0, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 244, 244, 244, 244, 5, 5, 5, 245, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); trie = newBidiTrie(0); controlByteToClass = $toNativeArray($kindUint, [0, 0, 0, 0, 0, 0, 21, 22, 23, 24, 18, 19, 20, 16, 17, 0]); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["vendor/golang.org/x/text/secure/bidirule"] = (function() { var $pkg = {}, $init, errors, utf8, transform, bidi, ruleState, ruleTransition, Transformer, arrayType, arrayType$1, sliceType, ptrType, transitions, asciiTable, DirectionString, ValidString, init; errors = $packages["errors"]; utf8 = $packages["unicode/utf8"]; transform = $packages["vendor/golang.org/x/text/transform"]; bidi = $packages["vendor/golang.org/x/text/unicode/bidi"]; ruleState = $pkg.ruleState = $newType(1, $kindUint8, "bidirule.ruleState", true, "vendor/golang.org/x/text/secure/bidirule", false, null); ruleTransition = $pkg.ruleTransition = $newType(0, $kindStruct, "bidirule.ruleTransition", true, "vendor/golang.org/x/text/secure/bidirule", false, function(next_, mask_) { this.$val = this; if (arguments.length === 0) { this.next = 0; this.mask = 0; return; } this.next = next_; this.mask = mask_; }); Transformer = $pkg.Transformer = $newType(0, $kindStruct, "bidirule.Transformer", true, "vendor/golang.org/x/text/secure/bidirule", true, function(state_, hasRTL_, seen_) { this.$val = this; if (arguments.length === 0) { this.state = 0; this.hasRTL = false; this.seen = 0; return; } this.state = state_; this.hasRTL = hasRTL_; this.seen = seen_; }); arrayType = $arrayType(bidi.Properties, 128); arrayType$1 = $arrayType(ruleTransition, 2); sliceType = $sliceType($Uint8); ptrType = $ptrType(Transformer); Transformer.ptr.prototype.isFinal = function() { var t; t = this; return (t.state === 2) || (t.state === 4) || (t.state === 0); }; Transformer.prototype.isFinal = function() { return this.$val.isFinal(); }; DirectionString = function(s) { var _tuple, c, e, i, s, sz; i = 0; while (true) { if (!(i < s.length)) { break; } _tuple = bidi.LookupString($substring(s, i)); e = $clone(_tuple[0], bidi.Properties); sz = _tuple[1]; if (sz === 0) { i = i + (1) >> 0; continue; } c = $clone(e, bidi.Properties).Class(); if ((c === 1) || (c === 13) || (c === 5)) { return 1; } i = i + (sz) >> 0; } return 0; }; $pkg.DirectionString = DirectionString; ValidString = function(s) { var _tuple, n, ok, s, t; t = new Transformer.ptr(0, false, 0); _tuple = t.advanceString(s); n = _tuple[0]; ok = _tuple[1]; if (!ok || n < s.length) { return false; } return t.isFinal(); }; $pkg.ValidString = ValidString; Transformer.ptr.prototype.isRTL = function() { var t; t = this; return !((((t.seen & 8226) >>> 0) === 0)); }; Transformer.prototype.isRTL = function() { return this.$val.isRTL(); }; Transformer.ptr.prototype.Reset = function() { var t; t = this; Transformer.copy(t, new Transformer.ptr(0, false, 0)); }; Transformer.prototype.Reset = function() { return this.$val.Reset(); }; Transformer.ptr.prototype.Transform = function(dst, src, atEOF) { var _tmp, _tmp$1, _tmp$2, _tuple, atEOF, dst, err, err1, n, nDst, nSrc, src, t; nDst = 0; nSrc = 0; err = $ifaceNil; t = this; if (dst.$length < src.$length) { src = $subslice(src, 0, dst.$length); atEOF = false; err = transform.ErrShortDst; } _tuple = t.Span(src, atEOF); n = _tuple[0]; err1 = _tuple[1]; $copySlice(dst, $subslice(src, 0, n)); if ($interfaceIsEqual(err, $ifaceNil) || !($interfaceIsEqual(err1, $ifaceNil)) && !($interfaceIsEqual(err1, transform.ErrShortSrc))) { err = err1; } _tmp = n; _tmp$1 = n; _tmp$2 = err; nDst = _tmp; nSrc = _tmp$1; err = _tmp$2; return [nDst, nSrc, err]; }; Transformer.prototype.Transform = function(dst, src, atEOF) { return this.$val.Transform(dst, src, atEOF); }; Transformer.ptr.prototype.Span = function(src, atEOF) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, atEOF, err, n, ok, src, t; n = 0; err = $ifaceNil; t = this; if ((t.state === 5) && t.isRTL()) { _tmp = 0; _tmp$1 = $pkg.ErrInvalid; n = _tmp; err = _tmp$1; return [n, err]; } _tuple = t.advance(src); n = _tuple[0]; ok = _tuple[1]; switch (0) { default: if (!ok) { err = $pkg.ErrInvalid; } else if (n < src.$length) { if (!atEOF) { err = transform.ErrShortSrc; break; } err = $pkg.ErrInvalid; } else if (!t.isFinal()) { err = $pkg.ErrInvalid; } } _tmp$2 = n; _tmp$3 = err; n = _tmp$2; err = _tmp$3; return [n, err]; }; Transformer.prototype.Span = function(src, atEOF) { return this.$val.Span(src, atEOF); }; init = function() { var _i, _ref, _tuple, i, p; _ref = asciiTable; _i = 0; while (true) { if (!(_i < 128)) { break; } i = _i; _tuple = bidi.LookupRune(((i >> 0))); p = $clone(_tuple[0], bidi.Properties); bidi.Properties.copy(((i < 0 || i >= asciiTable.length) ? ($throwRuntimeError("index out of range"), undefined) : asciiTable[i]), p); _i++; } }; Transformer.ptr.prototype.advance = function(s) { var _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, c, e, n, ok, s, sz, t, tr, x, x$1, y; n = 0; ok = false; t = this; e = new bidi.Properties.ptr(0, 0); sz = 0; while (true) { if (!(n < s.$length)) { break; } if (((n < 0 || n >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + n]) < 128) { _tmp = $clone((x = ((n < 0 || n >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + n]), ((x < 0 || x >= asciiTable.length) ? ($throwRuntimeError("index out of range"), undefined) : asciiTable[x])), bidi.Properties); _tmp$1 = 1; bidi.Properties.copy(e, _tmp); sz = _tmp$1; } else { _tuple = bidi.Lookup($subslice(s, n)); bidi.Properties.copy(e, _tuple[0]); sz = _tuple[1]; if (sz <= 1) { if (sz === 1) { _tmp$2 = n; _tmp$3 = false; n = _tmp$2; ok = _tmp$3; return [n, ok]; } _tmp$4 = n; _tmp$5 = true; n = _tmp$4; ok = _tmp$5; return [n, ok]; } } c = (((y = $clone(e, bidi.Properties).Class(), y < 32 ? (1 << y) : 0) << 16 >>> 16)); t.seen = (t.seen | (c)) >>> 0; if (((t.seen & 36) >>> 0) === 36) { t.state = 5; _tmp$6 = n; _tmp$7 = false; n = _tmp$6; ok = _tmp$7; return [n, ok]; } tr = $clone((x$1 = t.state, ((x$1 < 0 || x$1 >= transitions.length) ? ($throwRuntimeError("index out of range"), undefined) : transitions[x$1])), arrayType$1); if (!((((tr[0].mask & c) >>> 0) === 0))) { t.state = tr[0].next; } else if (!((((tr[1].mask & c) >>> 0) === 0))) { t.state = tr[1].next; } else { t.state = 5; if (t.isRTL()) { _tmp$8 = n; _tmp$9 = false; n = _tmp$8; ok = _tmp$9; return [n, ok]; } } n = n + (sz) >> 0; } _tmp$10 = n; _tmp$11 = true; n = _tmp$10; ok = _tmp$11; return [n, ok]; }; Transformer.prototype.advance = function(s) { return this.$val.advance(s); }; Transformer.ptr.prototype.advanceString = function(s) { var _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, c, e, n, ok, s, sz, t, tr, x, x$1, y; n = 0; ok = false; t = this; e = new bidi.Properties.ptr(0, 0); sz = 0; while (true) { if (!(n < s.length)) { break; } if (s.charCodeAt(n) < 128) { _tmp = $clone((x = s.charCodeAt(n), ((x < 0 || x >= asciiTable.length) ? ($throwRuntimeError("index out of range"), undefined) : asciiTable[x])), bidi.Properties); _tmp$1 = 1; bidi.Properties.copy(e, _tmp); sz = _tmp$1; } else { _tuple = bidi.LookupString($substring(s, n)); bidi.Properties.copy(e, _tuple[0]); sz = _tuple[1]; if (sz <= 1) { if (sz === 1) { _tmp$2 = n; _tmp$3 = false; n = _tmp$2; ok = _tmp$3; return [n, ok]; } _tmp$4 = n; _tmp$5 = true; n = _tmp$4; ok = _tmp$5; return [n, ok]; } } c = (((y = $clone(e, bidi.Properties).Class(), y < 32 ? (1 << y) : 0) << 16 >>> 16)); t.seen = (t.seen | (c)) >>> 0; if (((t.seen & 36) >>> 0) === 36) { t.state = 5; _tmp$6 = n; _tmp$7 = false; n = _tmp$6; ok = _tmp$7; return [n, ok]; } tr = $clone((x$1 = t.state, ((x$1 < 0 || x$1 >= transitions.length) ? ($throwRuntimeError("index out of range"), undefined) : transitions[x$1])), arrayType$1); if (!((((tr[0].mask & c) >>> 0) === 0))) { t.state = tr[0].next; } else if (!((((tr[1].mask & c) >>> 0) === 0))) { t.state = tr[1].next; } else { t.state = 5; if (t.isRTL()) { _tmp$8 = n; _tmp$9 = false; n = _tmp$8; ok = _tmp$9; return [n, ok]; } } n = n + (sz) >> 0; } _tmp$10 = n; _tmp$11 = true; n = _tmp$10; ok = _tmp$11; return [n, ok]; }; Transformer.prototype.advanceString = function(s) { return this.$val.advanceString(s); }; ptrType.methods = [{prop: "isFinal", name: "isFinal", pkg: "vendor/golang.org/x/text/secure/bidirule", typ: $funcType([], [$Bool], false)}, {prop: "isRTL", name: "isRTL", pkg: "vendor/golang.org/x/text/secure/bidirule", typ: $funcType([], [$Bool], false)}, {prop: "Reset", name: "Reset", pkg: "", typ: $funcType([], [], false)}, {prop: "Transform", name: "Transform", pkg: "", typ: $funcType([sliceType, sliceType, $Bool], [$Int, $Int, $error], false)}, {prop: "Span", name: "Span", pkg: "", typ: $funcType([sliceType, $Bool], [$Int, $error], false)}, {prop: "advance", name: "advance", pkg: "vendor/golang.org/x/text/secure/bidirule", typ: $funcType([sliceType], [$Int, $Bool], false)}, {prop: "advanceString", name: "advanceString", pkg: "vendor/golang.org/x/text/secure/bidirule", typ: $funcType([$String], [$Int, $Bool], false)}]; ruleTransition.init("vendor/golang.org/x/text/secure/bidirule", [{prop: "next", name: "next", embedded: false, exported: false, typ: ruleState, tag: ""}, {prop: "mask", name: "mask", embedded: false, exported: false, typ: $Uint16, tag: ""}]); Transformer.init("vendor/golang.org/x/text/secure/bidirule", [{prop: "state", name: "state", embedded: false, exported: false, typ: ruleState, tag: ""}, {prop: "hasRTL", name: "hasRTL", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "seen", name: "seen", embedded: false, exported: false, 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: $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = utf8.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = transform.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = bidi.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } asciiTable = arrayType.zero(); $pkg.ErrInvalid = errors.New("bidirule: failed Bidi Rule"); transitions = $toNativeArray($kindArray, [$toNativeArray($kindStruct, [new ruleTransition.ptr(2, 1), new ruleTransition.ptr(4, 8194)]), $toNativeArray($kindStruct, [new ruleTransition.ptr(2, 5), new ruleTransition.ptr(1, 7256)]), $toNativeArray($kindStruct, [new ruleTransition.ptr(2, 4101), new ruleTransition.ptr(1, 3160)]), $toNativeArray($kindStruct, [new ruleTransition.ptr(4, 8230), new ruleTransition.ptr(3, 7256)]), $toNativeArray($kindStruct, [new ruleTransition.ptr(4, 12326), new ruleTransition.ptr(3, 3160)]), $toNativeArray($kindStruct, [new ruleTransition.ptr(5, 0), new ruleTransition.ptr(5, 0)])]); init(); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["vendor/golang.org/x/text/unicode/norm"] = (function() { var $pkg = {}, $init, binary, fmt, io, sync, utf8, transform, valueRange, sparseBlocks, nfcTrie, nfkcTrie, normWriter, normReader, Form, Iter, iterFunc, input, Properties, lookupFunc, formInfo, qcInfo, ssState, streamSafe, reorderBuffer, insertErr, sliceType, sliceType$1, sliceType$2, ptrType, sliceType$3, arrayType, arrayType$1, sliceType$4, ptrType$1, arrayType$2, sliceType$5, arrayType$3, sliceType$6, ptrType$2, ptrType$3, ptrType$4, ptrType$5, ptrType$6, ptrType$7, ptrType$8, ptrType$9, funcType, nfcSparse, nfkcSparse, nfcData, nfkcData, errs, ccc, decomps, nfcValues, nfcIndex, nfcSparseOffset, nfcSparseValues, nfkcValues, nfkcIndex, nfkcSparseOffset, nfkcSparseValues, recompMap, recompMapOnce, formTable, flushTransform, newNfcTrie, newNfkcTrie, cmpNormalBytes, patchTail, appendQuick, doAppend, doAppendInner, lastBoundary, decomposeSegment, lastRuneStart, decomposeToLastBoundary, nextASCIIBytes, nextASCIIString, nextHangul, nextDone, nextMulti, nextMultiNorm, nextDecomposed, doNormDecomposed, nextCGJDecompose, nextComposed, doNormComposed, nextCGJCompose, inputBytes, inputString, buildRecompMap, combine, lookupInfoNFC, lookupInfoNFKC, compInfo, appendFlush, isHangul, isHangulString, isJamoVT, decomposeHangul; binary = $packages["encoding/binary"]; fmt = $packages["fmt"]; io = $packages["io"]; sync = $packages["sync"]; utf8 = $packages["unicode/utf8"]; transform = $packages["vendor/golang.org/x/text/transform"]; valueRange = $pkg.valueRange = $newType(0, $kindStruct, "norm.valueRange", true, "vendor/golang.org/x/text/unicode/norm", false, function(value_, lo_, hi_) { this.$val = this; if (arguments.length === 0) { this.value = 0; this.lo = 0; this.hi = 0; return; } this.value = value_; this.lo = lo_; this.hi = hi_; }); sparseBlocks = $pkg.sparseBlocks = $newType(0, $kindStruct, "norm.sparseBlocks", true, "vendor/golang.org/x/text/unicode/norm", false, function(values_, offset_) { this.$val = this; if (arguments.length === 0) { this.values = sliceType$2.nil; this.offset = sliceType$1.nil; return; } this.values = values_; this.offset = offset_; }); nfcTrie = $pkg.nfcTrie = $newType(0, $kindStruct, "norm.nfcTrie", true, "vendor/golang.org/x/text/unicode/norm", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); nfkcTrie = $pkg.nfkcTrie = $newType(0, $kindStruct, "norm.nfkcTrie", true, "vendor/golang.org/x/text/unicode/norm", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); normWriter = $pkg.normWriter = $newType(0, $kindStruct, "norm.normWriter", true, "vendor/golang.org/x/text/unicode/norm", false, function(rb_, w_, buf_) { this.$val = this; if (arguments.length === 0) { this.rb = new reorderBuffer.ptr(arrayType.zero(), arrayType$1.zero(), 0, 0, 0, new formInfo.ptr(0, false, false, $throwNilPointerError, $throwNilPointerError), new input.ptr("", sliceType$4.nil), 0, new input.ptr("", sliceType$4.nil), sliceType$4.nil, $throwNilPointerError); this.w = $ifaceNil; this.buf = sliceType$4.nil; return; } this.rb = rb_; this.w = w_; this.buf = buf_; }); normReader = $pkg.normReader = $newType(0, $kindStruct, "norm.normReader", true, "vendor/golang.org/x/text/unicode/norm", false, function(rb_, r_, inbuf_, outbuf_, bufStart_, lastBoundary_, err_) { this.$val = this; if (arguments.length === 0) { this.rb = new reorderBuffer.ptr(arrayType.zero(), arrayType$1.zero(), 0, 0, 0, new formInfo.ptr(0, false, false, $throwNilPointerError, $throwNilPointerError), new input.ptr("", sliceType$4.nil), 0, new input.ptr("", sliceType$4.nil), sliceType$4.nil, $throwNilPointerError); this.r = $ifaceNil; this.inbuf = sliceType$4.nil; this.outbuf = sliceType$4.nil; this.bufStart = 0; this.lastBoundary = 0; this.err = $ifaceNil; return; } this.rb = rb_; this.r = r_; this.inbuf = inbuf_; this.outbuf = outbuf_; this.bufStart = bufStart_; this.lastBoundary = lastBoundary_; this.err = err_; }); Form = $pkg.Form = $newType(4, $kindInt, "norm.Form", true, "vendor/golang.org/x/text/unicode/norm", true, null); Iter = $pkg.Iter = $newType(0, $kindStruct, "norm.Iter", true, "vendor/golang.org/x/text/unicode/norm", true, function(rb_, buf_, info_, next_, asciiF_, p_, multiSeg_) { this.$val = this; if (arguments.length === 0) { this.rb = new reorderBuffer.ptr(arrayType.zero(), arrayType$1.zero(), 0, 0, 0, new formInfo.ptr(0, false, false, $throwNilPointerError, $throwNilPointerError), new input.ptr("", sliceType$4.nil), 0, new input.ptr("", sliceType$4.nil), sliceType$4.nil, $throwNilPointerError); this.buf = arrayType$1.zero(); this.info = new Properties.ptr(0, 0, 0, 0, 0, 0, 0); this.next = $throwNilPointerError; this.asciiF = $throwNilPointerError; this.p = 0; this.multiSeg = sliceType$4.nil; return; } this.rb = rb_; this.buf = buf_; this.info = info_; this.next = next_; this.asciiF = asciiF_; this.p = p_; this.multiSeg = multiSeg_; }); iterFunc = $pkg.iterFunc = $newType(4, $kindFunc, "norm.iterFunc", true, "vendor/golang.org/x/text/unicode/norm", false, null); input = $pkg.input = $newType(0, $kindStruct, "norm.input", true, "vendor/golang.org/x/text/unicode/norm", false, function(str_, bytes_) { this.$val = this; if (arguments.length === 0) { this.str = ""; this.bytes = sliceType$4.nil; return; } this.str = str_; this.bytes = bytes_; }); Properties = $pkg.Properties = $newType(0, $kindStruct, "norm.Properties", true, "vendor/golang.org/x/text/unicode/norm", true, function(pos_, size_, ccc_, tccc_, nLead_, flags_, index_) { this.$val = this; if (arguments.length === 0) { this.pos = 0; this.size = 0; this.ccc = 0; this.tccc = 0; this.nLead = 0; this.flags = 0; this.index = 0; return; } this.pos = pos_; this.size = size_; this.ccc = ccc_; this.tccc = tccc_; this.nLead = nLead_; this.flags = flags_; this.index = index_; }); lookupFunc = $pkg.lookupFunc = $newType(4, $kindFunc, "norm.lookupFunc", true, "vendor/golang.org/x/text/unicode/norm", false, null); formInfo = $pkg.formInfo = $newType(0, $kindStruct, "norm.formInfo", true, "vendor/golang.org/x/text/unicode/norm", false, function(form_, composing_, compatibility_, info_, nextMain_) { this.$val = this; if (arguments.length === 0) { this.form = 0; this.composing = false; this.compatibility = false; this.info = $throwNilPointerError; this.nextMain = $throwNilPointerError; return; } this.form = form_; this.composing = composing_; this.compatibility = compatibility_; this.info = info_; this.nextMain = nextMain_; }); qcInfo = $pkg.qcInfo = $newType(1, $kindUint8, "norm.qcInfo", true, "vendor/golang.org/x/text/unicode/norm", false, null); ssState = $pkg.ssState = $newType(4, $kindInt, "norm.ssState", true, "vendor/golang.org/x/text/unicode/norm", false, null); streamSafe = $pkg.streamSafe = $newType(1, $kindUint8, "norm.streamSafe", true, "vendor/golang.org/x/text/unicode/norm", false, null); reorderBuffer = $pkg.reorderBuffer = $newType(0, $kindStruct, "norm.reorderBuffer", true, "vendor/golang.org/x/text/unicode/norm", false, function(rune_, byte$1_, nbyte_, ss_, nrune_, f_, src_, nsrc_, tmpBytes_, out_, flushF_) { this.$val = this; if (arguments.length === 0) { this.rune = arrayType.zero(); this.byte$1 = arrayType$1.zero(); this.nbyte = 0; this.ss = 0; this.nrune = 0; this.f = new formInfo.ptr(0, false, false, $throwNilPointerError, $throwNilPointerError); this.src = new input.ptr("", sliceType$4.nil); this.nsrc = 0; this.tmpBytes = new input.ptr("", sliceType$4.nil); this.out = sliceType$4.nil; this.flushF = $throwNilPointerError; return; } this.rune = rune_; this.byte$1 = byte$1_; this.nbyte = nbyte_; this.ss = ss_; this.nrune = nrune_; this.f = f_; this.src = src_; this.nsrc = nsrc_; this.tmpBytes = tmpBytes_; this.out = out_; this.flushF = flushF_; }); insertErr = $pkg.insertErr = $newType(4, $kindInt, "norm.insertErr", true, "vendor/golang.org/x/text/unicode/norm", false, null); sliceType = $sliceType($error); sliceType$1 = $sliceType($Uint16); sliceType$2 = $sliceType(valueRange); ptrType = $ptrType(formInfo); sliceType$3 = $sliceType(ptrType); arrayType = $arrayType(Properties, 32); arrayType$1 = $arrayType($Uint8, 128); sliceType$4 = $sliceType($Uint8); ptrType$1 = $ptrType(streamSafe); arrayType$2 = $arrayType(Properties, 31); sliceType$5 = $sliceType($emptyInterface); arrayType$3 = $arrayType($Uint8, 8); sliceType$6 = $sliceType(Properties); ptrType$2 = $ptrType(sparseBlocks); ptrType$3 = $ptrType(nfcTrie); ptrType$4 = $ptrType(nfkcTrie); ptrType$5 = $ptrType(normWriter); ptrType$6 = $ptrType(normReader); ptrType$7 = $ptrType(Iter); ptrType$8 = $ptrType(input); ptrType$9 = $ptrType(reorderBuffer); funcType = $funcType([ptrType$9], [$Bool], false); sparseBlocks.ptr.prototype.lookup = function(n, b) { var _q, b, header, hi, lo, m, n, offset, r, t, x, x$1, x$2; t = this; offset = (x = t.offset, ((n < 0 || n >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + n])); header = $clone((x$1 = t.values, ((offset < 0 || offset >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + offset])), valueRange); lo = offset + 1 << 16 >>> 16; hi = lo + ((header.lo << 16 >>> 16)) << 16 >>> 16; while (true) { if (!(lo < hi)) { break; } m = lo + (_q = ((hi - lo << 16 >>> 16)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")) << 16 >>> 16; r = $clone((x$2 = t.values, ((m < 0 || m >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + m])), valueRange); if (r.lo <= b && b <= r.hi) { return r.value + ((((b - r.lo << 24 >>> 24) << 16 >>> 16)) * header.value << 16 >>> 16) << 16 >>> 16; } if (b < r.lo) { hi = m; } else { lo = m + 1 << 16 >>> 16; } } return 0; }; sparseBlocks.prototype.lookup = function(n, b) { return this.$val.lookup(n, b); }; Form.prototype.Reset = function() { }; $ptrType(Form).prototype.Reset = function() { return new Form(this.$get()).Reset(); }; Form.prototype.Transform = function(dst, src, atEOF) { var _r, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, _tuple$1, atEOF, b, dst, eof, err, f, i, n, nDst, nSrc, ns, ok, src, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$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 = $f._tuple; _tuple$1 = $f._tuple$1; atEOF = $f.atEOF; b = $f.b; dst = $f.dst; eof = $f.eof; err = $f.err; f = $f.f; i = $f.i; n = $f.n; nDst = $f.nDst; nSrc = $f.nSrc; ns = $f.ns; ok = $f.ok; src = $f.src; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: nDst = 0; nSrc = 0; err = $ifaceNil; f = this.$val; b = src; eof = atEOF; ns = dst.$length; if (ns < b.$length) { err = transform.ErrShortDst; eof = false; b = $subslice(b, 0, ns); } _r = ((f < 0 || f >= formTable.$length) ? ($throwRuntimeError("index out of range"), undefined) : formTable.$array[formTable.$offset + f]).quickSpan($clone(inputBytes(b), input), 0, b.$length, eof); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; i = _tuple[0]; ok = _tuple[1]; n = $copySlice(dst, $subslice(b, 0, i)); /* */ if (!ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!ok) { */ case 2: _r$1 = new Form(f).transform($subslice(dst, n), $subslice(src, n), atEOF); /* */ $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; nDst = _tuple$1[0]; nSrc = _tuple$1[1]; err = _tuple$1[2]; _tmp = nDst + n >> 0; _tmp$1 = nSrc + n >> 0; _tmp$2 = err; nDst = _tmp; nSrc = _tmp$1; err = _tmp$2; $s = -1; return [nDst, nSrc, err]; /* } */ case 3: if ($interfaceIsEqual(err, $ifaceNil) && n < src.$length && !atEOF) { err = transform.ErrShortSrc; } _tmp$3 = n; _tmp$4 = n; _tmp$5 = err; nDst = _tmp$3; nSrc = _tmp$4; err = _tmp$5; $s = -1; return [nDst, nSrc, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Form.prototype.Transform }; } $f._r = _r; $f._r$1 = _r$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 = _tuple; $f._tuple$1 = _tuple$1; $f.atEOF = atEOF; $f.b = b; $f.dst = dst; $f.eof = eof; $f.err = err; $f.f = f; $f.i = i; $f.n = n; $f.nDst = nDst; $f.nSrc = nSrc; $f.ns = ns; $f.ok = ok; $f.src = src; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Form).prototype.Transform = function(dst, src, atEOF) { return new Form(this.$get()).Transform(dst, src, atEOF); }; flushTransform = function(rb) { var rb; if (rb.out.$length < ($imul(rb.nrune, 4))) { return false; } rb.out = $subslice(rb.out, rb.flushCopy(rb.out)); return true; }; Form.prototype.transform = function(dst, src, atEOF) { var _r, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, atEOF, dst, end, eof, err, f, n, n$1, nDst, nSrc, ok, rb, src, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$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 = $f._tuple; atEOF = $f.atEOF; dst = $f.dst; end = $f.end; eof = $f.eof; err = $f.err; f = $f.f; n = $f.n; n$1 = $f.n$1; nDst = $f.nDst; nSrc = $f.nSrc; ok = $f.ok; rb = $f.rb; src = $f.src; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rb = [rb]; nDst = 0; nSrc = 0; err = $ifaceNil; f = this.$val; rb[0] = new reorderBuffer.ptr(arrayType.zero(), arrayType$1.zero(), 0, 0, 0, new formInfo.ptr(0, false, false, $throwNilPointerError, $throwNilPointerError), new input.ptr("", sliceType$4.nil), 0, new input.ptr("", sliceType$4.nil), sliceType$4.nil, $throwNilPointerError); rb[0].init(f, src); /* while (true) { */ case 1: rb[0].setFlusher($subslice(dst, nDst), flushTransform); _r = decomposeSegment(rb[0], nSrc, atEOF); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } end = _r; if (end < 0) { _tmp = nDst; _tmp$1 = nSrc; _tmp$2 = (x = -end, ((x < 0 || x >= errs.$length) ? ($throwRuntimeError("index out of range"), undefined) : errs.$array[errs.$offset + x])); nDst = _tmp; nSrc = _tmp$1; err = _tmp$2; $s = -1; return [nDst, nSrc, err]; } nDst = dst.$length - rb[0].out.$length >> 0; nSrc = end; end = rb[0].nsrc; eof = atEOF; n = (nSrc + dst.$length >> 0) - nDst >> 0; if (n < end) { err = transform.ErrShortDst; end = n; eof = false; } _r$1 = rb[0].f.quickSpan($clone(rb[0].src, input), nSrc, end, eof); /* */ $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; end = _tuple[0]; ok = _tuple[1]; n$1 = $copySlice($subslice(dst, nDst), $subslice(rb[0].src.bytes, nSrc, end)); nSrc = nSrc + (n$1) >> 0; nDst = nDst + (n$1) >> 0; if (ok) { if ($interfaceIsEqual(err, $ifaceNil) && n$1 < rb[0].nsrc && !atEOF) { err = transform.ErrShortSrc; } _tmp$3 = nDst; _tmp$4 = nSrc; _tmp$5 = err; nDst = _tmp$3; nSrc = _tmp$4; err = _tmp$5; $s = -1; return [nDst, nSrc, err]; } $s = 1; continue; case 2: $s = -1; return [nDst, nSrc, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Form.prototype.transform }; } $f._r = _r; $f._r$1 = _r$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 = _tuple; $f.atEOF = atEOF; $f.dst = dst; $f.end = end; $f.eof = eof; $f.err = err; $f.f = f; $f.n = n; $f.n$1 = n$1; $f.nDst = nDst; $f.nSrc = nSrc; $f.ok = ok; $f.rb = rb; $f.src = src; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Form).prototype.transform = function(dst, src, atEOF) { return new Form(this.$get()).transform(dst, src, atEOF); }; nfcTrie.ptr.prototype.lookup = function(s) { var _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$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, c0, c1, c1$1, c1$2, c2, c2$1, c3, i, i$1, i$2, o, o$1, s, sz, t, v; v = 0; sz = 0; t = this; c0 = (0 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 0]); if (c0 < 128) { _tmp = ((c0 < 0 || c0 >= nfcValues.length) ? ($throwRuntimeError("index out of range"), undefined) : nfcValues[c0]); _tmp$1 = 1; v = _tmp; sz = _tmp$1; return [v, sz]; } else if (c0 < 194) { _tmp$2 = 0; _tmp$3 = 1; v = _tmp$2; sz = _tmp$3; return [v, sz]; } else if (c0 < 224) { if (s.$length < 2) { _tmp$4 = 0; _tmp$5 = 0; v = _tmp$4; sz = _tmp$5; return [v, sz]; } i = ((c0 < 0 || c0 >= nfcIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : nfcIndex[c0]); c1 = (1 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 1]); if (c1 < 128 || 192 <= c1) { _tmp$6 = 0; _tmp$7 = 1; v = _tmp$6; sz = _tmp$7; return [v, sz]; } _tmp$8 = t.lookupValue(((i >>> 0)), c1); _tmp$9 = 2; v = _tmp$8; sz = _tmp$9; return [v, sz]; } else if (c0 < 240) { if (s.$length < 3) { _tmp$10 = 0; _tmp$11 = 0; v = _tmp$10; sz = _tmp$11; return [v, sz]; } i$1 = ((c0 < 0 || c0 >= nfcIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : nfcIndex[c0]); c1$1 = (1 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 1]); if (c1$1 < 128 || 192 <= c1$1) { _tmp$12 = 0; _tmp$13 = 1; v = _tmp$12; sz = _tmp$13; return [v, sz]; } o = (((i$1 >>> 0)) << 6 >>> 0) + ((c1$1 >>> 0)) >>> 0; i$1 = ((o < 0 || o >= nfcIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : nfcIndex[o]); c2 = (2 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 2]); if (c2 < 128 || 192 <= c2) { _tmp$14 = 0; _tmp$15 = 2; v = _tmp$14; sz = _tmp$15; return [v, sz]; } _tmp$16 = t.lookupValue(((i$1 >>> 0)), c2); _tmp$17 = 3; v = _tmp$16; sz = _tmp$17; return [v, sz]; } else if (c0 < 248) { if (s.$length < 4) { _tmp$18 = 0; _tmp$19 = 0; v = _tmp$18; sz = _tmp$19; return [v, sz]; } i$2 = ((c0 < 0 || c0 >= nfcIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : nfcIndex[c0]); c1$2 = (1 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 1]); if (c1$2 < 128 || 192 <= c1$2) { _tmp$20 = 0; _tmp$21 = 1; v = _tmp$20; sz = _tmp$21; return [v, sz]; } o$1 = (((i$2 >>> 0)) << 6 >>> 0) + ((c1$2 >>> 0)) >>> 0; i$2 = ((o$1 < 0 || o$1 >= nfcIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : nfcIndex[o$1]); c2$1 = (2 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 2]); if (c2$1 < 128 || 192 <= c2$1) { _tmp$22 = 0; _tmp$23 = 2; v = _tmp$22; sz = _tmp$23; return [v, sz]; } o$1 = (((i$2 >>> 0)) << 6 >>> 0) + ((c2$1 >>> 0)) >>> 0; i$2 = ((o$1 < 0 || o$1 >= nfcIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : nfcIndex[o$1]); c3 = (3 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 3]); if (c3 < 128 || 192 <= c3) { _tmp$24 = 0; _tmp$25 = 3; v = _tmp$24; sz = _tmp$25; return [v, sz]; } _tmp$26 = t.lookupValue(((i$2 >>> 0)), c3); _tmp$27 = 4; v = _tmp$26; sz = _tmp$27; return [v, sz]; } _tmp$28 = 0; _tmp$29 = 1; v = _tmp$28; sz = _tmp$29; return [v, sz]; }; nfcTrie.prototype.lookup = function(s) { return this.$val.lookup(s); }; nfcTrie.ptr.prototype.lookupString = function(s) { var _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$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, c0, c1, c1$1, c1$2, c2, c2$1, c3, i, i$1, i$2, o, o$1, s, sz, t, v; v = 0; sz = 0; t = this; c0 = s.charCodeAt(0); if (c0 < 128) { _tmp = ((c0 < 0 || c0 >= nfcValues.length) ? ($throwRuntimeError("index out of range"), undefined) : nfcValues[c0]); _tmp$1 = 1; v = _tmp; sz = _tmp$1; return [v, sz]; } else if (c0 < 194) { _tmp$2 = 0; _tmp$3 = 1; v = _tmp$2; sz = _tmp$3; return [v, sz]; } else if (c0 < 224) { if (s.length < 2) { _tmp$4 = 0; _tmp$5 = 0; v = _tmp$4; sz = _tmp$5; return [v, sz]; } i = ((c0 < 0 || c0 >= nfcIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : nfcIndex[c0]); c1 = s.charCodeAt(1); if (c1 < 128 || 192 <= c1) { _tmp$6 = 0; _tmp$7 = 1; v = _tmp$6; sz = _tmp$7; return [v, sz]; } _tmp$8 = t.lookupValue(((i >>> 0)), c1); _tmp$9 = 2; v = _tmp$8; sz = _tmp$9; return [v, sz]; } else if (c0 < 240) { if (s.length < 3) { _tmp$10 = 0; _tmp$11 = 0; v = _tmp$10; sz = _tmp$11; return [v, sz]; } i$1 = ((c0 < 0 || c0 >= nfcIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : nfcIndex[c0]); c1$1 = s.charCodeAt(1); if (c1$1 < 128 || 192 <= c1$1) { _tmp$12 = 0; _tmp$13 = 1; v = _tmp$12; sz = _tmp$13; return [v, sz]; } o = (((i$1 >>> 0)) << 6 >>> 0) + ((c1$1 >>> 0)) >>> 0; i$1 = ((o < 0 || o >= nfcIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : nfcIndex[o]); c2 = s.charCodeAt(2); if (c2 < 128 || 192 <= c2) { _tmp$14 = 0; _tmp$15 = 2; v = _tmp$14; sz = _tmp$15; return [v, sz]; } _tmp$16 = t.lookupValue(((i$1 >>> 0)), c2); _tmp$17 = 3; v = _tmp$16; sz = _tmp$17; return [v, sz]; } else if (c0 < 248) { if (s.length < 4) { _tmp$18 = 0; _tmp$19 = 0; v = _tmp$18; sz = _tmp$19; return [v, sz]; } i$2 = ((c0 < 0 || c0 >= nfcIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : nfcIndex[c0]); c1$2 = s.charCodeAt(1); if (c1$2 < 128 || 192 <= c1$2) { _tmp$20 = 0; _tmp$21 = 1; v = _tmp$20; sz = _tmp$21; return [v, sz]; } o$1 = (((i$2 >>> 0)) << 6 >>> 0) + ((c1$2 >>> 0)) >>> 0; i$2 = ((o$1 < 0 || o$1 >= nfcIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : nfcIndex[o$1]); c2$1 = s.charCodeAt(2); if (c2$1 < 128 || 192 <= c2$1) { _tmp$22 = 0; _tmp$23 = 2; v = _tmp$22; sz = _tmp$23; return [v, sz]; } o$1 = (((i$2 >>> 0)) << 6 >>> 0) + ((c2$1 >>> 0)) >>> 0; i$2 = ((o$1 < 0 || o$1 >= nfcIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : nfcIndex[o$1]); c3 = s.charCodeAt(3); if (c3 < 128 || 192 <= c3) { _tmp$24 = 0; _tmp$25 = 3; v = _tmp$24; sz = _tmp$25; return [v, sz]; } _tmp$26 = t.lookupValue(((i$2 >>> 0)), c3); _tmp$27 = 4; v = _tmp$26; sz = _tmp$27; return [v, sz]; } _tmp$28 = 0; _tmp$29 = 1; v = _tmp$28; sz = _tmp$29; return [v, sz]; }; nfcTrie.prototype.lookupString = function(s) { return this.$val.lookupString(s); }; newNfcTrie = function(i) { var i; return new nfcTrie.ptr(); }; nfcTrie.ptr.prototype.lookupValue = function(n, b) { var b, n, t, x; t = this; if (n < 46) { return ((x = (n << 6 >>> 0) + ((b >>> 0)) >>> 0, ((x < 0 || x >= nfcValues.length) ? ($throwRuntimeError("index out of range"), undefined) : nfcValues[x]))); } else { n = n - (46) >>> 0; return (nfcSparse.lookup(n, b)); } }; nfcTrie.prototype.lookupValue = function(n, b) { return this.$val.lookupValue(n, b); }; nfkcTrie.ptr.prototype.lookup = function(s) { var _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$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, c0, c1, c1$1, c1$2, c2, c2$1, c3, i, i$1, i$2, o, o$1, s, sz, t, v; v = 0; sz = 0; t = this; c0 = (0 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 0]); if (c0 < 128) { _tmp = ((c0 < 0 || c0 >= nfkcValues.length) ? ($throwRuntimeError("index out of range"), undefined) : nfkcValues[c0]); _tmp$1 = 1; v = _tmp; sz = _tmp$1; return [v, sz]; } else if (c0 < 194) { _tmp$2 = 0; _tmp$3 = 1; v = _tmp$2; sz = _tmp$3; return [v, sz]; } else if (c0 < 224) { if (s.$length < 2) { _tmp$4 = 0; _tmp$5 = 0; v = _tmp$4; sz = _tmp$5; return [v, sz]; } i = ((c0 < 0 || c0 >= nfkcIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : nfkcIndex[c0]); c1 = (1 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 1]); if (c1 < 128 || 192 <= c1) { _tmp$6 = 0; _tmp$7 = 1; v = _tmp$6; sz = _tmp$7; return [v, sz]; } _tmp$8 = t.lookupValue(((i >>> 0)), c1); _tmp$9 = 2; v = _tmp$8; sz = _tmp$9; return [v, sz]; } else if (c0 < 240) { if (s.$length < 3) { _tmp$10 = 0; _tmp$11 = 0; v = _tmp$10; sz = _tmp$11; return [v, sz]; } i$1 = ((c0 < 0 || c0 >= nfkcIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : nfkcIndex[c0]); c1$1 = (1 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 1]); if (c1$1 < 128 || 192 <= c1$1) { _tmp$12 = 0; _tmp$13 = 1; v = _tmp$12; sz = _tmp$13; return [v, sz]; } o = (((i$1 >>> 0)) << 6 >>> 0) + ((c1$1 >>> 0)) >>> 0; i$1 = ((o < 0 || o >= nfkcIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : nfkcIndex[o]); c2 = (2 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 2]); if (c2 < 128 || 192 <= c2) { _tmp$14 = 0; _tmp$15 = 2; v = _tmp$14; sz = _tmp$15; return [v, sz]; } _tmp$16 = t.lookupValue(((i$1 >>> 0)), c2); _tmp$17 = 3; v = _tmp$16; sz = _tmp$17; return [v, sz]; } else if (c0 < 248) { if (s.$length < 4) { _tmp$18 = 0; _tmp$19 = 0; v = _tmp$18; sz = _tmp$19; return [v, sz]; } i$2 = ((c0 < 0 || c0 >= nfkcIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : nfkcIndex[c0]); c1$2 = (1 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 1]); if (c1$2 < 128 || 192 <= c1$2) { _tmp$20 = 0; _tmp$21 = 1; v = _tmp$20; sz = _tmp$21; return [v, sz]; } o$1 = (((i$2 >>> 0)) << 6 >>> 0) + ((c1$2 >>> 0)) >>> 0; i$2 = ((o$1 < 0 || o$1 >= nfkcIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : nfkcIndex[o$1]); c2$1 = (2 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 2]); if (c2$1 < 128 || 192 <= c2$1) { _tmp$22 = 0; _tmp$23 = 2; v = _tmp$22; sz = _tmp$23; return [v, sz]; } o$1 = (((i$2 >>> 0)) << 6 >>> 0) + ((c2$1 >>> 0)) >>> 0; i$2 = ((o$1 < 0 || o$1 >= nfkcIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : nfkcIndex[o$1]); c3 = (3 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 3]); if (c3 < 128 || 192 <= c3) { _tmp$24 = 0; _tmp$25 = 3; v = _tmp$24; sz = _tmp$25; return [v, sz]; } _tmp$26 = t.lookupValue(((i$2 >>> 0)), c3); _tmp$27 = 4; v = _tmp$26; sz = _tmp$27; return [v, sz]; } _tmp$28 = 0; _tmp$29 = 1; v = _tmp$28; sz = _tmp$29; return [v, sz]; }; nfkcTrie.prototype.lookup = function(s) { return this.$val.lookup(s); }; nfkcTrie.ptr.prototype.lookupString = function(s) { var _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$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, c0, c1, c1$1, c1$2, c2, c2$1, c3, i, i$1, i$2, o, o$1, s, sz, t, v; v = 0; sz = 0; t = this; c0 = s.charCodeAt(0); if (c0 < 128) { _tmp = ((c0 < 0 || c0 >= nfkcValues.length) ? ($throwRuntimeError("index out of range"), undefined) : nfkcValues[c0]); _tmp$1 = 1; v = _tmp; sz = _tmp$1; return [v, sz]; } else if (c0 < 194) { _tmp$2 = 0; _tmp$3 = 1; v = _tmp$2; sz = _tmp$3; return [v, sz]; } else if (c0 < 224) { if (s.length < 2) { _tmp$4 = 0; _tmp$5 = 0; v = _tmp$4; sz = _tmp$5; return [v, sz]; } i = ((c0 < 0 || c0 >= nfkcIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : nfkcIndex[c0]); c1 = s.charCodeAt(1); if (c1 < 128 || 192 <= c1) { _tmp$6 = 0; _tmp$7 = 1; v = _tmp$6; sz = _tmp$7; return [v, sz]; } _tmp$8 = t.lookupValue(((i >>> 0)), c1); _tmp$9 = 2; v = _tmp$8; sz = _tmp$9; return [v, sz]; } else if (c0 < 240) { if (s.length < 3) { _tmp$10 = 0; _tmp$11 = 0; v = _tmp$10; sz = _tmp$11; return [v, sz]; } i$1 = ((c0 < 0 || c0 >= nfkcIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : nfkcIndex[c0]); c1$1 = s.charCodeAt(1); if (c1$1 < 128 || 192 <= c1$1) { _tmp$12 = 0; _tmp$13 = 1; v = _tmp$12; sz = _tmp$13; return [v, sz]; } o = (((i$1 >>> 0)) << 6 >>> 0) + ((c1$1 >>> 0)) >>> 0; i$1 = ((o < 0 || o >= nfkcIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : nfkcIndex[o]); c2 = s.charCodeAt(2); if (c2 < 128 || 192 <= c2) { _tmp$14 = 0; _tmp$15 = 2; v = _tmp$14; sz = _tmp$15; return [v, sz]; } _tmp$16 = t.lookupValue(((i$1 >>> 0)), c2); _tmp$17 = 3; v = _tmp$16; sz = _tmp$17; return [v, sz]; } else if (c0 < 248) { if (s.length < 4) { _tmp$18 = 0; _tmp$19 = 0; v = _tmp$18; sz = _tmp$19; return [v, sz]; } i$2 = ((c0 < 0 || c0 >= nfkcIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : nfkcIndex[c0]); c1$2 = s.charCodeAt(1); if (c1$2 < 128 || 192 <= c1$2) { _tmp$20 = 0; _tmp$21 = 1; v = _tmp$20; sz = _tmp$21; return [v, sz]; } o$1 = (((i$2 >>> 0)) << 6 >>> 0) + ((c1$2 >>> 0)) >>> 0; i$2 = ((o$1 < 0 || o$1 >= nfkcIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : nfkcIndex[o$1]); c2$1 = s.charCodeAt(2); if (c2$1 < 128 || 192 <= c2$1) { _tmp$22 = 0; _tmp$23 = 2; v = _tmp$22; sz = _tmp$23; return [v, sz]; } o$1 = (((i$2 >>> 0)) << 6 >>> 0) + ((c2$1 >>> 0)) >>> 0; i$2 = ((o$1 < 0 || o$1 >= nfkcIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : nfkcIndex[o$1]); c3 = s.charCodeAt(3); if (c3 < 128 || 192 <= c3) { _tmp$24 = 0; _tmp$25 = 3; v = _tmp$24; sz = _tmp$25; return [v, sz]; } _tmp$26 = t.lookupValue(((i$2 >>> 0)), c3); _tmp$27 = 4; v = _tmp$26; sz = _tmp$27; return [v, sz]; } _tmp$28 = 0; _tmp$29 = 1; v = _tmp$28; sz = _tmp$29; return [v, sz]; }; nfkcTrie.prototype.lookupString = function(s) { return this.$val.lookupString(s); }; newNfkcTrie = function(i) { var i; return new nfkcTrie.ptr(); }; nfkcTrie.ptr.prototype.lookupValue = function(n, b) { var b, n, t, x; t = this; if (n < 92) { return ((x = (n << 6 >>> 0) + ((b >>> 0)) >>> 0, ((x < 0 || x >= nfkcValues.length) ? ($throwRuntimeError("index out of range"), undefined) : nfkcValues[x]))); } else { n = n - (92) >>> 0; return (nfkcSparse.lookup(n, b)); } }; nfkcTrie.prototype.lookupValue = function(n, b) { return this.$val.lookupValue(n, b); }; normWriter.ptr.prototype.Write = function(data) { var _r, _r$1, _r$2, _tmp, _tmp$1, _tuple, bn, data, err, i, m, n, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; bn = $f.bn; data = $f.data; err = $f.err; i = $f.i; m = $f.m; n = $f.n; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; w = this; /* while (true) { */ case 1: /* if (!(data.$length > 0)) { break; } */ if(!(data.$length > 0)) { $s = 2; continue; } m = data.$length; if (m > 4000) { m = 4000; } input.copy(w.rb.src, inputBytes($subslice(data, 0, m))); w.rb.nsrc = m; _r = doAppend(w.rb, w.buf, 0); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } w.buf = _r; data = $subslice(data, m); n = n + (m) >> 0; _r$1 = lastBoundary(w.rb.f, w.buf); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } i = _r$1; if (i === -1) { i = 0; } /* */ if (i > 0) { $s = 5; continue; } /* */ $s = 6; continue; /* if (i > 0) { */ case 5: _r$2 = w.w.Write($subslice(w.buf, 0, i)); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { /* break; */ $s = 2; continue; } bn = $copySlice(w.buf, $subslice(w.buf, i)); w.buf = $subslice(w.buf, 0, bn); /* } */ case 6: $s = 1; continue; case 2: _tmp = n; _tmp$1 = err; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: normWriter.ptr.prototype.Write }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.bn = bn; $f.data = data; $f.err = err; $f.i = i; $f.m = m; $f.n = n; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; normWriter.prototype.Write = function(data) { return this.$val.Write(data); }; normWriter.ptr.prototype.Close = function() { var _r, _tuple, err, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: w = this; /* */ if (w.buf.$length > 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (w.buf.$length > 0) { */ case 1: _r = w.w.Write(w.buf); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } /* } */ case 2: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: normWriter.ptr.prototype.Close }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; normWriter.prototype.Close = function() { return this.$val.Close(); }; Form.prototype.Writer = function(w) { var f, w, wr; f = this.$val; wr = new normWriter.ptr(new reorderBuffer.ptr(arrayType.zero(), arrayType$1.zero(), 0, 0, 0, new formInfo.ptr(0, false, false, $throwNilPointerError, $throwNilPointerError), new input.ptr("", sliceType$4.nil), 0, new input.ptr("", sliceType$4.nil), sliceType$4.nil, $throwNilPointerError), w, sliceType$4.nil); wr.rb.init(f, sliceType$4.nil); return wr; }; $ptrType(Form).prototype.Writer = function(w) { return new Form(this.$get()).Writer(w); }; normReader.ptr.prototype.Read = function(p) { var _r, _r$1, _r$2, _tmp, _tmp$1, _tuple, err, n, n$1, outn, p, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; err = $f.err; n = $f.n; n$1 = $f.n$1; outn = $f.outn; p = $f.p; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; /* while (true) { */ case 1: if ((r.lastBoundary - r.bufStart >> 0) > 0) { n = $copySlice(p, $subslice(r.outbuf, r.bufStart, r.lastBoundary)); r.bufStart = r.bufStart + (n) >> 0; if ((r.lastBoundary - r.bufStart >> 0) > 0) { $s = -1; return [n, $ifaceNil]; } $s = -1; return [n, r.err]; } if (!($interfaceIsEqual(r.err, $ifaceNil))) { $s = -1; return [0, r.err]; } outn = $copySlice(r.outbuf, $subslice(r.outbuf, r.lastBoundary)); r.outbuf = $subslice(r.outbuf, 0, outn); r.bufStart = 0; _r = r.r.Read(r.inbuf); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n$1 = _tuple[0]; err = _tuple[1]; input.copy(r.rb.src, inputBytes($subslice(r.inbuf, 0, n$1))); _tmp = n$1; _tmp$1 = err; r.rb.nsrc = _tmp; r.err = _tmp$1; /* */ if (n$1 > 0) { $s = 4; continue; } /* */ $s = 5; continue; /* if (n$1 > 0) { */ case 4: _r$1 = doAppend(r.rb, r.outbuf, 0); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } r.outbuf = _r$1; /* } */ case 5: /* */ if ($interfaceIsEqual(err, io.EOF)) { $s = 7; continue; } /* */ $s = 8; continue; /* if ($interfaceIsEqual(err, io.EOF)) { */ case 7: r.lastBoundary = r.outbuf.$length; $s = 9; continue; /* } else { */ case 8: _r$2 = lastBoundary(r.rb.f, r.outbuf); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } r.lastBoundary = _r$2; if (r.lastBoundary === -1) { r.lastBoundary = 0; } /* } */ case 9: $s = 1; continue; case 2: $s = -1; return [0, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: normReader.ptr.prototype.Read }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.err = err; $f.n = n; $f.n$1 = n$1; $f.outn = outn; $f.p = p; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; normReader.prototype.Read = function(p) { return this.$val.Read(p); }; Form.prototype.Reader = function(r) { var buf, f, r, rr; f = this.$val; buf = $makeSlice(sliceType$4, 4000); rr = new normReader.ptr(new reorderBuffer.ptr(arrayType.zero(), arrayType$1.zero(), 0, 0, 0, new formInfo.ptr(0, false, false, $throwNilPointerError, $throwNilPointerError), new input.ptr("", sliceType$4.nil), 0, new input.ptr("", sliceType$4.nil), sliceType$4.nil, $throwNilPointerError), r, buf, sliceType$4.nil, 0, 0, $ifaceNil); rr.rb.init(f, buf); return rr; }; $ptrType(Form).prototype.Reader = function(r) { return new Form(this.$get()).Reader(r); }; Form.prototype.Bytes = function(b) { var $24r, _r, _r$1, _tuple, b, f, ft, n, ok, out, rb, src, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; b = $f.b; f = $f.f; ft = $f.ft; n = $f.n; ok = $f.ok; out = $f.out; rb = $f.rb; src = $f.src; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rb = [rb]; f = this.$val; src = $clone(inputBytes(b), input); ft = ((f < 0 || f >= formTable.$length) ? ($throwRuntimeError("index out of range"), undefined) : formTable.$array[formTable.$offset + f]); _r = ft.quickSpan($clone(src, input), 0, b.$length, true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return b; } out = $makeSlice(sliceType$4, n, b.$length); $copySlice(out, $subslice(b, 0, n)); rb[0] = new reorderBuffer.ptr(arrayType.zero(), arrayType$1.zero(), 0, 0, 0, $clone(ft, formInfo), $clone(src, input), b.$length, new input.ptr("", sliceType$4.nil), out, appendFlush); _r$1 = doAppendInner(rb[0], n); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Form.prototype.Bytes }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.b = b; $f.f = f; $f.ft = ft; $f.n = n; $f.ok = ok; $f.out = out; $f.rb = rb; $f.src = src; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Form).prototype.Bytes = function(b) { return new Form(this.$get()).Bytes(b); }; Form.prototype.String = function(s) { var $24r, _r, _r$1, _tuple, f, ft, n, ok, out, rb, s, src, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; f = $f.f; ft = $f.ft; n = $f.n; ok = $f.ok; out = $f.out; rb = $f.rb; s = $f.s; src = $f.src; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rb = [rb]; f = this.$val; src = $clone(inputString(s), input); ft = ((f < 0 || f >= formTable.$length) ? ($throwRuntimeError("index out of range"), undefined) : formTable.$array[formTable.$offset + f]); _r = ft.quickSpan($clone(src, input), 0, s.length, true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return s; } out = $makeSlice(sliceType$4, n, s.length); $copyString(out, $substring(s, 0, n)); rb[0] = new reorderBuffer.ptr(arrayType.zero(), arrayType$1.zero(), 0, 0, 0, $clone(ft, formInfo), $clone(src, input), s.length, new input.ptr("", sliceType$4.nil), out, appendFlush); _r$1 = doAppendInner(rb[0], n); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = ($bytesToString(_r$1)); $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Form.prototype.String }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.f = f; $f.ft = ft; $f.n = n; $f.ok = ok; $f.out = out; $f.rb = rb; $f.s = s; $f.src = src; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Form).prototype.String = function(s) { return new Form(this.$get()).String(s); }; Form.prototype.IsNormal = function(b) { var _r, _r$1, _r$2, _tuple, _tuple$1, b, bp, f, ft, ok, rb, src, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; b = $f.b; bp = $f.bp; f = $f.f; ft = $f.ft; ok = $f.ok; rb = $f.rb; src = $f.src; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rb = [rb]; f = this.$val; src = $clone(inputBytes(b), input); ft = ((f < 0 || f >= formTable.$length) ? ($throwRuntimeError("index out of range"), undefined) : formTable.$array[formTable.$offset + f]); _r = ft.quickSpan($clone(src, input), 0, b.$length, true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; bp = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return true; } rb[0] = new reorderBuffer.ptr(arrayType.zero(), arrayType$1.zero(), 0, 0, 0, $clone(ft, formInfo), $clone(src, input), b.$length, new input.ptr("", sliceType$4.nil), sliceType$4.nil, $throwNilPointerError); rb[0].setFlusher(sliceType$4.nil, cmpNormalBytes); /* while (true) { */ case 2: /* if (!(bp < b.$length)) { break; } */ if(!(bp < b.$length)) { $s = 3; continue; } rb[0].out = $subslice(b, bp); _r$1 = decomposeSegment(rb[0], bp, true); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } bp = _r$1; if (bp < 0) { $s = -1; return false; } _r$2 = rb[0].f.quickSpan($clone(rb[0].src, input), bp, b.$length, true); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; bp = _tuple$1[0]; $s = 2; continue; case 3: $s = -1; return true; /* */ } return; } if ($f === undefined) { $f = { $blk: Form.prototype.IsNormal }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.b = b; $f.bp = bp; $f.f = f; $f.ft = ft; $f.ok = ok; $f.rb = rb; $f.src = src; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Form).prototype.IsNormal = function(b) { return new Form(this.$get()).IsNormal(b); }; cmpNormalBytes = function(rb) { var b, i, info, p, pe, rb, x, x$1; b = rb.out; i = 0; while (true) { if (!(i < rb.nrune)) { break; } info = $clone((x = rb.rune, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i])), Properties); if (((info.size >> 0)) > b.$length) { return false; } p = info.pos; pe = p + info.size << 24 >>> 24; while (true) { if (!(p < pe)) { break; } if (!(((0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]) === (x$1 = rb.byte$1, ((p < 0 || p >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[p]))))) { return false; } b = $subslice(b, 1); p = p + (1) << 24 >>> 24; } i = i + (1) >> 0; } return true; }; Form.prototype.IsNormalString = function(s) { var _r, _r$1, _r$2, _tuple, _tuple$1, bp, f, ft, ok, rb, s, src, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; bp = $f.bp; f = $f.f; ft = $f.ft; ok = $f.ok; rb = $f.rb; s = $f.s; src = $f.src; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: bp = [bp]; rb = [rb]; s = [s]; f = this.$val; src = $clone(inputString(s[0]), input); ft = ((f < 0 || f >= formTable.$length) ? ($throwRuntimeError("index out of range"), undefined) : formTable.$array[formTable.$offset + f]); _r = ft.quickSpan($clone(src, input), 0, s[0].length, true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; bp[0] = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return true; } rb[0] = new reorderBuffer.ptr(arrayType.zero(), arrayType$1.zero(), 0, 0, 0, $clone(ft, formInfo), $clone(src, input), s[0].length, new input.ptr("", sliceType$4.nil), sliceType$4.nil, $throwNilPointerError); rb[0].setFlusher(sliceType$4.nil, (function(bp, rb, s) { return function(rb$1) { var i, info, p, pe, rb$1, x, x$1; i = 0; while (true) { if (!(i < rb$1.nrune)) { break; } info = $clone((x = rb$1.rune, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i])), Properties); if ((bp[0] + ((info.size >> 0)) >> 0) > s[0].length) { return false; } p = info.pos; pe = p + info.size << 24 >>> 24; while (true) { if (!(p < pe)) { break; } if (!((s[0].charCodeAt(bp[0]) === (x$1 = rb$1.byte$1, ((p < 0 || p >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[p]))))) { return false; } bp[0] = bp[0] + (1) >> 0; p = p + (1) << 24 >>> 24; } i = i + (1) >> 0; } return true; }; })(bp, rb, s)); /* while (true) { */ case 2: /* if (!(bp[0] < s[0].length)) { break; } */ if(!(bp[0] < s[0].length)) { $s = 3; continue; } _r$1 = decomposeSegment(rb[0], bp[0], true); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } bp[0] = _r$1; if (bp[0] < 0) { $s = -1; return false; } _r$2 = rb[0].f.quickSpan($clone(rb[0].src, input), bp[0], s[0].length, true); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; bp[0] = _tuple$1[0]; $s = 2; continue; case 3: $s = -1; return true; /* */ } return; } if ($f === undefined) { $f = { $blk: Form.prototype.IsNormalString }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.bp = bp; $f.f = f; $f.ft = ft; $f.ok = ok; $f.rb = rb; $f.s = s; $f.src = src; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Form).prototype.IsNormalString = function(s) { return new Form(this.$get()).IsNormalString(s); }; patchTail = function(rb) { var _r, _r$1, _r$2, _r$3, _tuple, buf, end, extra, info, p, rb, s, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; buf = $f.buf; end = $f.end; extra = $f.extra; info = $f.info; p = $f.p; rb = $f.rb; s = $f.s; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = lastRuneStart(rb.f, rb.out); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; info = $clone(_tuple[0], Properties); p = _tuple[1]; if ((p === -1) || (info.size === 0)) { $s = -1; return true; } end = p + ((info.size >> 0)) >> 0; extra = rb.out.$length - end >> 0; /* */ if (extra > 0) { $s = 2; continue; } /* */ $s = 3; continue; /* if (extra > 0) { */ case 2: x = $makeSlice(sliceType$4, 0); x = $appendSlice(x, $subslice(rb.out, (rb.out.$length - extra >> 0))); rb.out = $subslice(rb.out, 0, end); $r = decomposeToLastBoundary(rb); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = rb.doFlush(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; rb.out = $appendSlice(rb.out, x); $s = -1; return false; /* } */ case 3: buf = $subslice(rb.out, p); rb.out = $subslice(rb.out, 0, p); $r = decomposeToLastBoundary(rb); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } s = (rb.$ptr_ss || (rb.$ptr_ss = new ptrType$1(function() { return this.$target.ss; }, function($v) { this.$target.ss = $v; }, rb))).next($clone(info, Properties)); /* */ if (s === 1) { $s = 7; continue; } /* */ if (s === 2) { $s = 8; continue; } /* */ $s = 9; continue; /* if (s === 1) { */ case 7: _r$2 = rb.doFlush(); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; (rb.$ptr_ss || (rb.$ptr_ss = new ptrType$1(function() { return this.$target.ss; }, function($v) { this.$target.ss = $v; }, rb))).first($clone(info, Properties)); $s = 9; continue; /* } else if (s === 2) { */ case 8: _r$3 = rb.doFlush(); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; rb.insertCGJ(); rb.ss = 0; /* } */ case 9: $r = rb.insertUnsafe($clone(inputBytes(buf), input), 0, $clone(info, Properties)); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return true; /* */ } return; } if ($f === undefined) { $f = { $blk: patchTail }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.buf = buf; $f.end = end; $f.extra = extra; $f.info = info; $f.p = p; $f.rb = rb; $f.s = s; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; appendQuick = function(rb, i) { var _r, _tuple, end, i, rb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; end = $f.end; i = $f.i; rb = $f.rb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (rb.nsrc === i) { $s = -1; return i; } _r = rb.f.quickSpan($clone(rb.src, input), i, rb.nsrc, true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; end = _tuple[0]; rb.out = rb.src.appendSlice(rb.out, i, end); $s = -1; return end; /* */ } return; } if ($f === undefined) { $f = { $blk: appendQuick }; } $f._r = _r; $f._tuple = _tuple; $f.end = end; $f.i = i; $f.rb = rb; $f.$s = $s; $f.$r = $r; return $f; }; Form.prototype.Append = function(out, src) { var $24r, _r, f, out, src, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; f = $f.f; out = $f.out; src = $f.src; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this.$val; _r = new Form(f).doAppend(out, $clone(inputBytes(src), input), src.$length); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Form.prototype.Append }; } $f.$24r = $24r; $f._r = _r; $f.f = f; $f.out = out; $f.src = src; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Form).prototype.Append = function(out, src) { return new Form(this.$get()).Append(out, src); }; Form.prototype.doAppend = function(out, src, n) { var $24r, $24r$1, _r, _r$1, _r$2, _tuple, f, ft, n, out, p, rb, rb$1, src, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; f = $f.f; ft = $f.ft; n = $f.n; out = $f.out; p = $f.p; rb = $f.rb; rb$1 = $f.rb$1; src = $f.src; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rb = [rb]; rb$1 = [rb$1]; f = this.$val; if (n === 0) { $s = -1; return out; } ft = ((f < 0 || f >= formTable.$length) ? ($throwRuntimeError("index out of range"), undefined) : formTable.$array[formTable.$offset + f]); /* */ if (out.$length === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (out.$length === 0) { */ case 1: _r = ft.quickSpan($clone(src, input), 0, n, true); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; p = _tuple[0]; out = src.appendSlice(out, 0, p); if (p === n) { $s = -1; return out; } rb[0] = new reorderBuffer.ptr(arrayType.zero(), arrayType$1.zero(), 0, 0, 0, $clone(ft, formInfo), $clone(src, input), n, new input.ptr("", sliceType$4.nil), out, appendFlush); _r$1 = doAppendInner(rb[0], p); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 5; case 5: return $24r; /* } */ case 2: rb$1[0] = new reorderBuffer.ptr(arrayType.zero(), arrayType$1.zero(), 0, 0, 0, $clone(ft, formInfo), $clone(src, input), n, new input.ptr("", sliceType$4.nil), sliceType$4.nil, $throwNilPointerError); _r$2 = doAppend(rb$1[0], out, 0); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r$1 = _r$2; $s = 7; case 7: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: Form.prototype.doAppend }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.f = f; $f.ft = ft; $f.n = n; $f.out = out; $f.p = p; $f.rb = rb; $f.rb$1 = rb$1; $f.src = src; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Form).prototype.doAppend = function(out, src, n) { return new Form(this.$get()).doAppend(out, src, n); }; doAppend = function(rb, out, p) { var $24r, $24r$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _tmp, _tmp$1, doMerge, fd, info, n, out, p, q, rb, src, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$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; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; doMerge = $f.doMerge; fd = $f.fd; info = $f.info; n = $f.n; out = $f.out; p = $f.p; q = $f.q; rb = $f.rb; src = $f.src; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rb.setFlusher(out, appendFlush); _tmp = $clone(rb.src, input); _tmp$1 = rb.nsrc; src = $clone(_tmp, input); n = _tmp$1; doMerge = out.$length > 0; q = src.skipContinuationBytes(p); /* */ if (q > p) { $s = 1; continue; } /* */ $s = 2; continue; /* if (q > p) { */ case 1: rb.out = src.appendSlice(rb.out, p, q); p = q; _r = patchTail(rb); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } doMerge = _r; /* } */ case 2: fd = rb.f; /* */ if (doMerge) { $s = 4; continue; } /* */ $s = 5; continue; /* if (doMerge) { */ case 4: info = new Properties.ptr(0, 0, 0, 0, 0, 0, 0); /* */ if (p < n) { $s = 6; continue; } /* */ $s = 7; continue; /* if (p < n) { */ case 6: _r$1 = fd.info($clone(src, input), p); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } Properties.copy(info, _r$1); /* */ if (!$clone(info, Properties).BoundaryBefore() || $clone(info, Properties).nLeadingNonStarters() > 0) { $s = 9; continue; } /* */ $s = 10; continue; /* if (!$clone(info, Properties).BoundaryBefore() || $clone(info, Properties).nLeadingNonStarters() > 0) { */ case 9: /* */ if (p === 0) { $s = 11; continue; } /* */ $s = 12; continue; /* if (p === 0) { */ case 11: $r = decomposeToLastBoundary(rb); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 12: _r$2 = decomposeSegment(rb, p, true); /* */ $s = 14; case 14: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } p = _r$2; /* } */ case 10: /* } */ case 7: /* */ if (info.size === 0) { $s = 15; continue; } /* */ $s = 16; continue; /* if (info.size === 0) { */ case 15: _r$3 = rb.doFlush(); /* */ $s = 17; case 17: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $s = -1; return src.appendSlice(rb.out, p, n); /* } */ case 16: /* */ if (rb.nrune > 0) { $s = 18; continue; } /* */ $s = 19; continue; /* if (rb.nrune > 0) { */ case 18: _r$4 = doAppendInner(rb, p); /* */ $s = 20; case 20: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r = _r$4; $s = 21; case 21: return $24r; /* } */ case 19: /* } */ case 5: _r$5 = appendQuick(rb, p); /* */ $s = 22; case 22: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } p = _r$5; _r$6 = doAppendInner(rb, p); /* */ $s = 23; case 23: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } $24r$1 = _r$6; $s = 24; case 24: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: doAppend }; } $f.$24r = $24r; $f.$24r$1 = $24r$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._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.doMerge = doMerge; $f.fd = fd; $f.info = info; $f.n = n; $f.out = out; $f.p = p; $f.q = q; $f.rb = rb; $f.src = src; $f.$s = $s; $f.$r = $r; return $f; }; doAppendInner = function(rb, p) { var _r, _r$1, n, p, rb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; n = $f.n; p = $f.p; rb = $f.rb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = rb.nsrc; /* while (true) { */ case 1: /* if (!(p < n)) { break; } */ if(!(p < n)) { $s = 2; continue; } _r = decomposeSegment(rb, p, true); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } p = _r; _r$1 = appendQuick(rb, p); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } p = _r$1; $s = 1; continue; case 2: $s = -1; return rb.out; /* */ } return; } if ($f === undefined) { $f = { $blk: doAppendInner }; } $f._r = _r; $f._r$1 = _r$1; $f.n = n; $f.p = p; $f.rb = rb; $f.$s = $s; $f.$r = $r; return $f; }; Form.prototype.AppendString = function(out, src) { var $24r, _r, f, out, src, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; f = $f.f; out = $f.out; src = $f.src; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this.$val; _r = new Form(f).doAppend(out, $clone(inputString(src), input), src.length); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Form.prototype.AppendString }; } $f.$24r = $24r; $f._r = _r; $f.f = f; $f.out = out; $f.src = src; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Form).prototype.AppendString = function(out, src) { return new Form(this.$get()).AppendString(out, src); }; Form.prototype.QuickSpan = function(b) { var _r, _tuple, b, f, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; b = $f.b; f = $f.f; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this.$val; _r = ((f < 0 || f >= formTable.$length) ? ($throwRuntimeError("index out of range"), undefined) : formTable.$array[formTable.$offset + f]).quickSpan($clone(inputBytes(b), input), 0, b.$length, true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; $s = -1; return n; /* */ } return; } if ($f === undefined) { $f = { $blk: Form.prototype.QuickSpan }; } $f._r = _r; $f._tuple = _tuple; $f.b = b; $f.f = f; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Form).prototype.QuickSpan = function(b) { return new Form(this.$get()).QuickSpan(b); }; Form.prototype.Span = function(b, atEOF) { var _r, _tmp, _tmp$1, _tuple, atEOF, b, err, f, n, ok, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; atEOF = $f.atEOF; b = $f.b; err = $f.err; f = $f.f; n = $f.n; ok = $f.ok; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; f = this.$val; _r = ((f < 0 || f >= formTable.$length) ? ($throwRuntimeError("index out of range"), undefined) : formTable.$array[formTable.$offset + f]).quickSpan($clone(inputBytes(b), input), 0, b.$length, atEOF); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; ok = _tuple[1]; if (n < b.$length) { if (!ok) { err = transform.ErrEndOfSpan; } else { err = transform.ErrShortSrc; } } _tmp = n; _tmp$1 = err; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Form.prototype.Span }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.atEOF = atEOF; $f.b = b; $f.err = err; $f.f = f; $f.n = n; $f.ok = ok; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Form).prototype.Span = function(b, atEOF) { return new Form(this.$get()).Span(b, atEOF); }; Form.prototype.SpanString = function(s, atEOF) { var _r, _tmp, _tmp$1, _tuple, atEOF, err, f, n, ok, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; atEOF = $f.atEOF; err = $f.err; f = $f.f; n = $f.n; ok = $f.ok; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; f = this.$val; _r = ((f < 0 || f >= formTable.$length) ? ($throwRuntimeError("index out of range"), undefined) : formTable.$array[formTable.$offset + f]).quickSpan($clone(inputString(s), input), 0, s.length, atEOF); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; ok = _tuple[1]; if (n < s.length) { if (!ok) { err = transform.ErrEndOfSpan; } else { err = transform.ErrShortSrc; } } _tmp = n; _tmp$1 = err; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Form.prototype.SpanString }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.atEOF = atEOF; $f.err = err; $f.f = f; $f.n = n; $f.ok = ok; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Form).prototype.SpanString = function(s, atEOF) { return new Form(this.$get()).SpanString(s, atEOF); }; formInfo.ptr.prototype.quickSpan = function(src, i, end, atEOF) { var _1, _r, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, atEOF, end, f, i, info, j, lastCC, lastSegStart, n, ok, src, ss, ss$24ptr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$10 = $f._tmp$10; _tmp$11 = $f._tmp$11; _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; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; atEOF = $f.atEOF; end = $f.end; f = $f.f; i = $f.i; info = $f.info; j = $f.j; lastCC = $f.lastCC; lastSegStart = $f.lastSegStart; n = $f.n; ok = $f.ok; src = $f.src; ss = $f.ss; ss$24ptr = $f.ss$24ptr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; ok = false; f = this; lastCC = 0; ss = 0; lastSegStart = i; n = end; /* while (true) { */ case 1: /* if (!(i < n)) { break; } */ if(!(i < n)) { $s = 2; continue; } j = src.skipASCII(i, n); if (!((i === j))) { i = j; lastSegStart = i - 1 >> 0; lastCC = 0; ss = 0; /* continue; */ $s = 1; continue; } _r = f.info($clone(src, input), i); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } info = $clone(_r, Properties); if (info.size === 0) { if (atEOF) { _tmp = n; _tmp$1 = true; n = _tmp; ok = _tmp$1; $s = -1; return [n, ok]; } _tmp$2 = lastSegStart; _tmp$3 = true; n = _tmp$2; ok = _tmp$3; $s = -1; return [n, ok]; } _1 = (ss$24ptr || (ss$24ptr = new ptrType$1(function() { return ss; }, function($v) { ss = $v; }))).next($clone(info, Properties)); if (_1 === (1)) { lastSegStart = i; } else if (_1 === (2)) { _tmp$4 = lastSegStart; _tmp$5 = false; n = _tmp$4; ok = _tmp$5; $s = -1; return [n, ok]; } else if (_1 === (0)) { if (lastCC > info.ccc) { _tmp$6 = lastSegStart; _tmp$7 = false; n = _tmp$6; ok = _tmp$7; $s = -1; return [n, ok]; } } if (f.composing) { if (!$clone(info, Properties).isYesC()) { /* break; */ $s = 2; continue; } } else { if (!$clone(info, Properties).isYesD()) { /* break; */ $s = 2; continue; } } lastCC = info.ccc; i = i + (((info.size >> 0))) >> 0; $s = 1; continue; case 2: if (i === n) { if (!atEOF) { n = lastSegStart; } _tmp$8 = n; _tmp$9 = true; n = _tmp$8; ok = _tmp$9; $s = -1; return [n, ok]; } _tmp$10 = lastSegStart; _tmp$11 = false; n = _tmp$10; ok = _tmp$11; $s = -1; return [n, ok]; /* */ } return; } if ($f === undefined) { $f = { $blk: formInfo.ptr.prototype.quickSpan }; } $f._1 = _1; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$10 = _tmp$10; $f._tmp$11 = _tmp$11; $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._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f.atEOF = atEOF; $f.end = end; $f.f = f; $f.i = i; $f.info = info; $f.j = j; $f.lastCC = lastCC; $f.lastSegStart = lastSegStart; $f.n = n; $f.ok = ok; $f.src = src; $f.ss = ss; $f.ss$24ptr = ss$24ptr; $f.$s = $s; $f.$r = $r; return $f; }; formInfo.prototype.quickSpan = function(src, i, end, atEOF) { return this.$val.quickSpan(src, i, end, atEOF); }; Form.prototype.QuickSpanString = function(s) { var _r, _tuple, f, n, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; f = $f.f; n = $f.n; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this.$val; _r = ((f < 0 || f >= formTable.$length) ? ($throwRuntimeError("index out of range"), undefined) : formTable.$array[formTable.$offset + f]).quickSpan($clone(inputString(s), input), 0, s.length, true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; $s = -1; return n; /* */ } return; } if ($f === undefined) { $f = { $blk: Form.prototype.QuickSpanString }; } $f._r = _r; $f._tuple = _tuple; $f.f = f; $f.n = n; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Form).prototype.QuickSpanString = function(s) { return new Form(this.$get()).QuickSpanString(s); }; Form.prototype.FirstBoundary = function(b) { var $24r, _r, b, f, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; b = $f.b; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this.$val; _r = new Form(f).firstBoundary($clone(inputBytes(b), input), b.$length); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Form.prototype.FirstBoundary }; } $f.$24r = $24r; $f._r = _r; $f.b = b; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Form).prototype.FirstBoundary = function(b) { return new Form(this.$get()).FirstBoundary(b); }; Form.prototype.firstBoundary = function(src, nsrc) { var _r, f, fd, i, info, nsrc, s, src, ss, ss$24ptr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; f = $f.f; fd = $f.fd; i = $f.i; info = $f.info; nsrc = $f.nsrc; s = $f.s; src = $f.src; ss = $f.ss; ss$24ptr = $f.ss$24ptr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this.$val; i = src.skipContinuationBytes(0); if (i >= nsrc) { $s = -1; return -1; } fd = ((f < 0 || f >= formTable.$length) ? ($throwRuntimeError("index out of range"), undefined) : formTable.$array[formTable.$offset + f]); ss = 0; /* while (true) { */ case 1: _r = fd.info($clone(src, input), i); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } info = $clone(_r, Properties); if (info.size === 0) { $s = -1; return -1; } s = (ss$24ptr || (ss$24ptr = new ptrType$1(function() { return ss; }, function($v) { ss = $v; }))).next($clone(info, Properties)); if (!((s === 0))) { $s = -1; return i; } i = i + (((info.size >> 0))) >> 0; if (i >= nsrc) { if (!$clone(info, Properties).BoundaryAfter() && !new streamSafe(ss).isMax()) { $s = -1; return -1; } $s = -1; return nsrc; } $s = 1; continue; case 2: $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: Form.prototype.firstBoundary }; } $f._r = _r; $f.f = f; $f.fd = fd; $f.i = i; $f.info = info; $f.nsrc = nsrc; $f.s = s; $f.src = src; $f.ss = ss; $f.ss$24ptr = ss$24ptr; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Form).prototype.firstBoundary = function(src, nsrc) { return new Form(this.$get()).firstBoundary(src, nsrc); }; Form.prototype.FirstBoundaryInString = function(s) { var $24r, _r, f, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; f = $f.f; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this.$val; _r = new Form(f).firstBoundary($clone(inputString(s), input), s.length); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Form.prototype.FirstBoundaryInString }; } $f.$24r = $24r; $f._r = _r; $f.f = f; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Form).prototype.FirstBoundaryInString = function(s) { return new Form(this.$get()).FirstBoundaryInString(s); }; Form.prototype.NextBoundary = function(b, atEOF) { var $24r, _r, atEOF, b, f, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; atEOF = $f.atEOF; b = $f.b; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this.$val; _r = new Form(f).nextBoundary($clone(inputBytes(b), input), b.$length, atEOF); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Form.prototype.NextBoundary }; } $f.$24r = $24r; $f._r = _r; $f.atEOF = atEOF; $f.b = b; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Form).prototype.NextBoundary = function(b, atEOF) { return new Form(this.$get()).NextBoundary(b, atEOF); }; Form.prototype.NextBoundaryInString = function(s, atEOF) { var $24r, _r, atEOF, f, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; atEOF = $f.atEOF; f = $f.f; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this.$val; _r = new Form(f).nextBoundary($clone(inputString(s), input), s.length, atEOF); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Form.prototype.NextBoundaryInString }; } $f.$24r = $24r; $f._r = _r; $f.atEOF = atEOF; $f.f = f; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Form).prototype.NextBoundaryInString = function(s, atEOF) { return new Form(this.$get()).NextBoundaryInString(s, atEOF); }; Form.prototype.nextBoundary = function(src, nsrc, atEOF) { var _r, _r$1, atEOF, f, fd, i, info, nsrc, s, src, ss, ss$24ptr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; atEOF = $f.atEOF; f = $f.f; fd = $f.fd; i = $f.i; info = $f.info; nsrc = $f.nsrc; s = $f.s; src = $f.src; ss = $f.ss; ss$24ptr = $f.ss$24ptr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this.$val; if (nsrc === 0) { if (atEOF) { $s = -1; return 0; } $s = -1; return -1; } fd = ((f < 0 || f >= formTable.$length) ? ($throwRuntimeError("index out of range"), undefined) : formTable.$array[formTable.$offset + f]); _r = fd.info($clone(src, input), 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } info = $clone(_r, Properties); if (info.size === 0) { if (atEOF) { $s = -1; return 1; } $s = -1; return -1; } ss = 0; (ss$24ptr || (ss$24ptr = new ptrType$1(function() { return ss; }, function($v) { ss = $v; }))).first($clone(info, Properties)); i = ((info.size >> 0)); /* while (true) { */ case 2: /* if (!(i < nsrc)) { break; } */ if(!(i < nsrc)) { $s = 3; continue; } _r$1 = fd.info($clone(src, input), i); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } Properties.copy(info, _r$1); if (info.size === 0) { if (atEOF) { $s = -1; return i; } $s = -1; return -1; } s = (ss$24ptr || (ss$24ptr = new ptrType$1(function() { return ss; }, function($v) { ss = $v; }))).next($clone(info, Properties)); if (!((s === 0))) { $s = -1; return i; } i = i + (((info.size >> 0))) >> 0; $s = 2; continue; case 3: if (!atEOF && !$clone(info, Properties).BoundaryAfter() && !new streamSafe(ss).isMax()) { $s = -1; return -1; } $s = -1; return nsrc; /* */ } return; } if ($f === undefined) { $f = { $blk: Form.prototype.nextBoundary }; } $f._r = _r; $f._r$1 = _r$1; $f.atEOF = atEOF; $f.f = f; $f.fd = fd; $f.i = i; $f.info = info; $f.nsrc = nsrc; $f.s = s; $f.src = src; $f.ss = ss; $f.ss$24ptr = ss$24ptr; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Form).prototype.nextBoundary = function(src, nsrc, atEOF) { return new Form(this.$get()).nextBoundary(src, nsrc, atEOF); }; Form.prototype.LastBoundary = function(b) { var $24r, _r, b, f, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; b = $f.b; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this.$val; _r = lastBoundary(((f < 0 || f >= formTable.$length) ? ($throwRuntimeError("index out of range"), undefined) : formTable.$array[formTable.$offset + f]), b); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Form.prototype.LastBoundary }; } $f.$24r = $24r; $f._r = _r; $f.b = b; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Form).prototype.LastBoundary = function(b) { return new Form(this.$get()).LastBoundary(b); }; lastBoundary = function(fd, b) { var _r, _r$1, _r$2, _tuple, _tuple$1, _tuple$2, b, fd, i, info, p, ss, ss$24ptr, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; b = $f.b; fd = $f.fd; i = $f.i; info = $f.info; p = $f.p; ss = $f.ss; ss$24ptr = $f.ss$24ptr; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: i = b.$length; _r = lastRuneStart(fd, b); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; info = $clone(_tuple[0], Properties); p = _tuple[1]; if (p === -1) { $s = -1; return -1; } /* */ if (info.size === 0) { $s = 2; continue; } /* */ $s = 3; continue; /* if (info.size === 0) { */ case 2: if (p === 0) { $s = -1; return -1; } i = p; _r$1 = lastRuneStart(fd, $subslice(b, 0, i)); /* */ $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; Properties.copy(info, _tuple$1[0]); p = _tuple$1[1]; if (p === -1) { $s = -1; return i; } /* } */ case 3: if (!(((p + ((info.size >> 0)) >> 0) === i))) { $s = -1; return i; } if ($clone(info, Properties).BoundaryAfter()) { $s = -1; return i; } ss = 0; v = (ss$24ptr || (ss$24ptr = new ptrType$1(function() { return ss; }, function($v) { ss = $v; }))).backwards($clone(info, Properties)); i = p; /* while (true) { */ case 5: /* if (!(i >= 0 && !((v === 1)))) { break; } */ if(!(i >= 0 && !((v === 1)))) { $s = 6; continue; } _r$2 = lastRuneStart(fd, $subslice(b, 0, i)); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$2 = _r$2; Properties.copy(info, _tuple$2[0]); p = _tuple$2[1]; v = (ss$24ptr || (ss$24ptr = new ptrType$1(function() { return ss; }, function($v) { ss = $v; }))).backwards($clone(info, Properties)); if (v === 2) { /* break; */ $s = 6; continue; } if (!(((p + ((info.size >> 0)) >> 0) === i))) { if (p === -1) { $s = -1; return -1; } $s = -1; return i; } i = p; $s = 5; continue; case 6: $s = -1; return i; /* */ } return; } if ($f === undefined) { $f = { $blk: lastBoundary }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.b = b; $f.fd = fd; $f.i = i; $f.info = info; $f.p = p; $f.ss = ss; $f.ss$24ptr = ss$24ptr; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; decomposeSegment = function(rb, sp, atEOF) { var _r, _r$1, _r$2, _r$3, _r$4, atEOF, err, err$1, info, rb, s, s$1, sp, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; atEOF = $f.atEOF; err = $f.err; err$1 = $f.err$1; info = $f.info; rb = $f.rb; s = $f.s; s$1 = $f.s$1; sp = $f.sp; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = rb.f.info($clone(rb.src, input), sp); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } info = $clone(_r, Properties); if (info.size === 0) { $s = -1; return 0; } s = (rb.$ptr_ss || (rb.$ptr_ss = new ptrType$1(function() { return this.$target.ss; }, function($v) { this.$target.ss = $v; }, rb))).next($clone(info, Properties)); /* */ if (s === 1) { $s = 2; continue; } /* */ if (s === 2) { $s = 3; continue; } /* */ $s = 4; continue; /* if (s === 1) { */ case 2: /* */ if (rb.nrune > 0) { $s = 5; continue; } /* */ $s = 6; continue; /* if (rb.nrune > 0) { */ case 5: /* goto end */ $s = 7; continue; /* } */ case 6: $s = 4; continue; /* } else if (s === 2) { */ case 3: rb.insertCGJ(); /* goto end */ $s = 7; continue; /* } */ case 4: _r$1 = rb.insertFlush($clone(rb.src, input), sp, $clone(info, Properties)); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err = _r$1; if (!((err === 0))) { $s = -1; return ((err >> 0)); } /* while (true) { */ case 9: sp = sp + (((info.size >> 0))) >> 0; if (sp >= rb.nsrc) { if (!atEOF && !$clone(info, Properties).BoundaryAfter()) { $s = -1; return -2; } /* break; */ $s = 10; continue; } _r$2 = rb.f.info($clone(rb.src, input), sp); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } Properties.copy(info, _r$2); if (info.size === 0) { if (!atEOF) { $s = -1; return -2; } /* break; */ $s = 10; continue; } s$1 = (rb.$ptr_ss || (rb.$ptr_ss = new ptrType$1(function() { return this.$target.ss; }, function($v) { this.$target.ss = $v; }, rb))).next($clone(info, Properties)); if (s$1 === 1) { /* break; */ $s = 10; continue; } else if (s$1 === 2) { rb.insertCGJ(); /* break; */ $s = 10; continue; } _r$3 = rb.insertFlush($clone(rb.src, input), sp, $clone(info, Properties)); /* */ $s = 12; case 12: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } err$1 = _r$3; if (!((err$1 === 0))) { $s = -1; return ((err$1 >> 0)); } $s = 9; continue; case 10: /* end: */ case 7: _r$4 = rb.doFlush(); /* */ $s = 15; case 15: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } /* */ if (!_r$4) { $s = 13; continue; } /* */ $s = 14; continue; /* if (!_r$4) { */ case 13: $s = -1; return -1; /* } */ case 14: $s = -1; return sp; /* */ } return; } if ($f === undefined) { $f = { $blk: decomposeSegment }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.atEOF = atEOF; $f.err = err; $f.err$1 = err$1; $f.info = info; $f.rb = rb; $f.s = s; $f.s$1 = s$1; $f.sp = sp; $f.$s = $s; $f.$r = $r; return $f; }; lastRuneStart = function(fd, buf) { var $24r, _r, buf, fd, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; buf = $f.buf; fd = $f.fd; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = buf.$length - 1 >> 0; while (true) { if (!(p >= 0 && !utf8.RuneStart(((p < 0 || p >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + p])))) { break; } p = p - (1) >> 0; } if (p < 0) { $s = -1; return [new Properties.ptr(0, 0, 0, 0, 0, 0, 0), -1]; } _r = fd.info($clone(inputBytes(buf), input), p); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = [_r, p]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: lastRuneStart }; } $f.$24r = $24r; $f._r = _r; $f.buf = buf; $f.fd = fd; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; decomposeToLastBoundary = function(rb) { var _r, _r$1, _tuple, _tuple$1, add, buf, cp, fd, i, info, p, padd, rb, ss, ss$24ptr, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; add = $f.add; buf = $f.buf; cp = $f.cp; fd = $f.fd; i = $f.i; info = $f.info; p = $f.p; padd = $f.padd; rb = $f.rb; ss = $f.ss; ss$24ptr = $f.ss$24ptr; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = rb.f; _r = lastRuneStart(fd, rb.out); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; info = $clone(_tuple[0], Properties); i = _tuple[1]; if (!((((info.size >> 0)) === (rb.out.$length - i >> 0)))) { $s = -1; return; } if ($clone(info, Properties).BoundaryAfter()) { $s = -1; return; } add = arrayType$2.zero(); padd = 0; ss = 0; p = rb.out.$length; /* while (true) { */ case 2: Properties.copy(((padd < 0 || padd >= add.length) ? ($throwRuntimeError("index out of range"), undefined) : add[padd]), info); v = (ss$24ptr || (ss$24ptr = new ptrType$1(function() { return ss; }, function($v) { ss = $v; }))).backwards($clone(info, Properties)); if (v === 2) { /* break; */ $s = 3; continue; } padd = padd + (1) >> 0; p = p - (((info.size >> 0))) >> 0; if ((v === 1) || p < 0) { /* break; */ $s = 3; continue; } _r$1 = lastRuneStart(fd, $subslice(rb.out, 0, p)); /* */ $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; Properties.copy(info, _tuple$1[0]); i = _tuple$1[1]; if (!((((info.size >> 0)) === (p - i >> 0)))) { /* break; */ $s = 3; continue; } $s = 2; continue; case 3: rb.ss = ss; buf = arrayType$1.zero(); cp = $subslice(new sliceType$4(buf), 0, $copySlice(new sliceType$4(buf), $subslice(rb.out, p))); rb.out = $subslice(rb.out, 0, p); padd = padd - (1) >> 0; /* while (true) { */ case 5: /* if (!(padd >= 0)) { break; } */ if(!(padd >= 0)) { $s = 6; continue; } Properties.copy(info, ((padd < 0 || padd >= add.length) ? ($throwRuntimeError("index out of range"), undefined) : add[padd])); $r = rb.insertUnsafe($clone(inputBytes(cp), input), 0, $clone(info, Properties)); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } cp = $subslice(cp, info.size); padd = padd - (1) >> 0; $s = 5; continue; case 6: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: decomposeToLastBoundary }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.add = add; $f.buf = buf; $f.cp = cp; $f.fd = fd; $f.i = i; $f.info = info; $f.p = p; $f.padd = padd; $f.rb = rb; $f.ss = ss; $f.ss$24ptr = ss$24ptr; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Iter.ptr.prototype.Init = function(f, src) { var _r, f, i, src, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; f = $f.f; i = $f.i; src = $f.src; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: i = this; i.p = 0; if (src.$length === 0) { i.setDone(); i.rb.nsrc = 0; $s = -1; return; } i.multiSeg = sliceType$4.nil; i.rb.init(f, src); i.next = i.rb.f.nextMain; i.asciiF = nextASCIIBytes; _r = i.rb.f.info($clone(i.rb.src, input), i.p); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } Properties.copy(i.info, _r); (x = i.rb, (x.$ptr_ss || (x.$ptr_ss = new ptrType$1(function() { return this.$target.ss; }, function($v) { this.$target.ss = $v; }, x)))).first($clone(i.info, Properties)); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Iter.ptr.prototype.Init }; } $f._r = _r; $f.f = f; $f.i = i; $f.src = src; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Iter.prototype.Init = function(f, src) { return this.$val.Init(f, src); }; Iter.ptr.prototype.InitString = function(f, src) { var _r, f, i, src, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; f = $f.f; i = $f.i; src = $f.src; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: i = this; i.p = 0; if (src.length === 0) { i.setDone(); i.rb.nsrc = 0; $s = -1; return; } i.multiSeg = sliceType$4.nil; i.rb.initString(f, src); i.next = i.rb.f.nextMain; i.asciiF = nextASCIIString; _r = i.rb.f.info($clone(i.rb.src, input), i.p); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } Properties.copy(i.info, _r); (x = i.rb, (x.$ptr_ss || (x.$ptr_ss = new ptrType$1(function() { return this.$target.ss; }, function($v) { this.$target.ss = $v; }, x)))).first($clone(i.info, Properties)); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Iter.ptr.prototype.InitString }; } $f._r = _r; $f.f = f; $f.i = i; $f.src = src; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Iter.prototype.InitString = function(f, src) { return this.$val.InitString(f, src); }; Iter.ptr.prototype.Seek = function(offset, whence) { var $24r, $24r$1, _1, _r, _r$1, _r$2, abs, i, offset, whence, x, x$1, x$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; abs = $f.abs; i = $f.i; offset = $f.offset; whence = $f.whence; 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: i = this; abs = new $Int64(0, 0); _1 = whence; /* */ if (_1 === (0)) { $s = 2; continue; } /* */ if (_1 === (1)) { $s = 3; continue; } /* */ if (_1 === (2)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_1 === (0)) { */ case 2: abs = offset; $s = 6; continue; /* } else if (_1 === (1)) { */ case 3: abs = (x = (new $Int64(0, i.p)), new $Int64(x.$high + offset.$high, x.$low + offset.$low)); $s = 6; continue; /* } else if (_1 === (2)) { */ case 4: abs = (x$1 = (new $Int64(0, i.rb.nsrc)), new $Int64(x$1.$high + offset.$high, x$1.$low + offset.$low)); $s = 6; continue; /* } else { */ case 5: _r = fmt.Errorf("norm: invalid whence", new sliceType$5([])); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = [new $Int64(0, 0), _r]; $s = 8; case 8: return $24r; /* } */ case 6: case 1: /* */ if ((abs.$high < 0 || (abs.$high === 0 && abs.$low < 0))) { $s = 9; continue; } /* */ $s = 10; continue; /* if ((abs.$high < 0 || (abs.$high === 0 && abs.$low < 0))) { */ case 9: _r$1 = fmt.Errorf("norm: negative position", new sliceType$5([])); /* */ $s = 11; case 11: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r$1 = [new $Int64(0, 0), _r$1]; $s = 12; case 12: return $24r$1; /* } */ case 10: if ((((abs.$low + ((abs.$high >> 31) * 4294967296)) >> 0)) >= i.rb.nsrc) { i.setDone(); $s = -1; return [(new $Int64(0, i.p)), $ifaceNil]; } i.p = (((abs.$low + ((abs.$high >> 31) * 4294967296)) >> 0)); i.multiSeg = sliceType$4.nil; i.next = i.rb.f.nextMain; _r$2 = i.rb.f.info($clone(i.rb.src, input), i.p); /* */ $s = 13; case 13: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } Properties.copy(i.info, _r$2); (x$2 = i.rb, (x$2.$ptr_ss || (x$2.$ptr_ss = new ptrType$1(function() { return this.$target.ss; }, function($v) { this.$target.ss = $v; }, x$2)))).first($clone(i.info, Properties)); $s = -1; return [abs, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Iter.ptr.prototype.Seek }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.abs = abs; $f.i = i; $f.offset = offset; $f.whence = whence; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; }; Iter.prototype.Seek = function(offset, whence) { return this.$val.Seek(offset, whence); }; Iter.ptr.prototype.returnSlice = function(a, b) { var a, b, i; i = this; if (i.rb.src.bytes === sliceType$4.nil) { return $subslice(new sliceType$4(i.buf), 0, $copyString(new sliceType$4(i.buf), $substring(i.rb.src.str, a, b))); } return $subslice(i.rb.src.bytes, a, b); }; Iter.prototype.returnSlice = function(a, b) { return this.$val.returnSlice(a, b); }; Iter.ptr.prototype.Pos = function() { var i; i = this; return i.p; }; Iter.prototype.Pos = function() { return this.$val.Pos(); }; Iter.ptr.prototype.setDone = function() { var i; i = this; i.next = nextDone; i.p = i.rb.nsrc; }; Iter.prototype.setDone = function() { return this.$val.setDone(); }; Iter.ptr.prototype.Done = function() { var i; i = this; return i.p >= i.rb.nsrc; }; Iter.prototype.Done = function() { return this.$val.Done(); }; Iter.ptr.prototype.Next = function() { var $24r, _r, i, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; i = $f.i; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: i = this; _r = i.next(i); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Iter.ptr.prototype.Next }; } $f.$24r = $24r; $f._r = _r; $f.i = i; $f.$s = $s; $f.$r = $r; return $f; }; Iter.prototype.Next = function() { return this.$val.Next(); }; nextASCIIBytes = function(i) { var $24r, _r, _r$1, i, p, p0, p0$1, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; i = $f.i; p = $f.p; p0 = $f.p0; p0$1 = $f.p0$1; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = i.p + 1 >> 0; if (p >= i.rb.nsrc) { p0 = i.p; i.setDone(); $s = -1; return $subslice(i.rb.src.bytes, p0, p); } if ((x = i.rb.src.bytes, ((p < 0 || p >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + p])) < 128) { p0$1 = i.p; i.p = p; $s = -1; return $subslice(i.rb.src.bytes, p0$1, p); } _r = i.rb.f.info($clone(i.rb.src, input), i.p); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } Properties.copy(i.info, _r); i.next = i.rb.f.nextMain; _r$1 = i.next(i); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: nextASCIIBytes }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f.i = i; $f.p = p; $f.p0 = p0; $f.p0$1 = p0$1; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; nextASCIIString = function(i) { var $24r, _r, _r$1, i, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; i = $f.i; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = i.p + 1 >> 0; if (p >= i.rb.nsrc) { i.buf[0] = i.rb.src.str.charCodeAt(i.p); i.setDone(); $s = -1; return $subslice(new sliceType$4(i.buf), 0, 1); } if (i.rb.src.str.charCodeAt(p) < 128) { i.buf[0] = i.rb.src.str.charCodeAt(i.p); i.p = p; $s = -1; return $subslice(new sliceType$4(i.buf), 0, 1); } _r = i.rb.f.info($clone(i.rb.src, input), i.p); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } Properties.copy(i.info, _r); i.next = i.rb.f.nextMain; _r$1 = i.next(i); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: nextASCIIString }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f.i = i; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; nextHangul = function(i) { var $24r, _r, _r$1, i, next, p, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; i = $f.i; next = $f.next; p = $f.p; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = i.p; next = p + 3 >> 0; /* */ if (next >= i.rb.nsrc) { $s = 1; continue; } /* */ if (i.rb.src.hangul(next) === 0) { $s = 2; continue; } /* */ $s = 3; continue; /* if (next >= i.rb.nsrc) { */ case 1: i.setDone(); $s = 3; continue; /* } else if (i.rb.src.hangul(next) === 0) { */ case 2: (x = i.rb, (x.$ptr_ss || (x.$ptr_ss = new ptrType$1(function() { return this.$target.ss; }, function($v) { this.$target.ss = $v; }, x)))).next($clone(i.info, Properties)); _r = i.rb.f.info($clone(i.rb.src, input), i.p); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } Properties.copy(i.info, _r); i.next = i.rb.f.nextMain; _r$1 = i.next(i); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 6; case 6: return $24r; /* } */ case 3: i.p = next; $s = -1; return $subslice(new sliceType$4(i.buf), 0, decomposeHangul(new sliceType$4(i.buf), i.rb.src.hangul(p))); /* */ } return; } if ($f === undefined) { $f = { $blk: nextHangul }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f.i = i; $f.next = next; $f.p = p; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; nextDone = function(i) { var i; return sliceType$4.nil; }; nextMulti = function(i) { var $24r, _r, _r$1, d, i, info, j, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; d = $f.d; i = $f.i; info = $f.info; j = $f.j; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: j = 0; d = i.multiSeg; j = 1; while (true) { if (!(j < d.$length && !utf8.RuneStart(((j < 0 || j >= d.$length) ? ($throwRuntimeError("index out of range"), undefined) : d.$array[d.$offset + j])))) { break; } j = j + (1) >> 0; } /* while (true) { */ case 1: /* if (!(j < d.$length)) { break; } */ if(!(j < d.$length)) { $s = 2; continue; } _r = i.rb.f.info(new input.ptr("", d), j); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } info = $clone(_r, Properties); if ($clone(info, Properties).BoundaryBefore()) { i.multiSeg = $subslice(d, j); $s = -1; return $subslice(d, 0, j); } j = j + (((info.size >> 0))) >> 0; $s = 1; continue; case 2: i.next = i.rb.f.nextMain; _r$1 = i.next(i); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 5; case 5: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: nextMulti }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f.d = d; $f.i = i; $f.info = info; $f.j = j; $f.$s = $s; $f.$r = $r; return $f; }; nextMultiNorm = function(i) { var $24r, _r, _r$1, d, i, info, j, seg, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; d = $f.d; i = $f.i; info = $f.info; j = $f.j; seg = $f.seg; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: j = 0; d = i.multiSeg; /* while (true) { */ case 1: /* if (!(j < d.$length)) { break; } */ if(!(j < d.$length)) { $s = 2; continue; } _r = i.rb.f.info(new input.ptr("", d), j); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } info = $clone(_r, Properties); /* */ if ($clone(info, Properties).BoundaryBefore()) { $s = 4; continue; } /* */ $s = 5; continue; /* if ($clone(info, Properties).BoundaryBefore()) { */ case 4: $r = i.rb.compose(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } seg = $subslice(new sliceType$4(i.buf), 0, i.rb.flushCopy(new sliceType$4(i.buf))); $r = i.rb.insertUnsafe(new input.ptr("", d), j, $clone(info, Properties)); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i.multiSeg = $subslice(d, (j + ((info.size >> 0)) >> 0)); $s = -1; return seg; /* } */ case 5: $r = i.rb.insertUnsafe(new input.ptr("", d), j, $clone(info, Properties)); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } j = j + (((info.size >> 0))) >> 0; $s = 1; continue; case 2: i.multiSeg = sliceType$4.nil; i.next = nextComposed; _r$1 = doNormComposed(i); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 10; case 10: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: nextMultiNorm }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f.d = d; $f.i = i; $f.info = info; $f.j = j; $f.seg = seg; $f.$s = $s; $f.$r = $r; return $f; }; nextDecomposed = function(i) { var $24r, $24r$1, _1, _r, _r$1, _r$2, _r$3, _r$4, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, d, i, inCopyStart, next, outCopyStart, outp, p, p$1, p$2, prevCC, prevCC$1, r, sz, v, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _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; d = $f.d; i = $f.i; inCopyStart = $f.inCopyStart; next = $f.next; outCopyStart = $f.outCopyStart; outp = $f.outp; p = $f.p; p$1 = $f.p$1; p$2 = $f.p$2; prevCC = $f.prevCC; prevCC$1 = $f.prevCC$1; r = $f.r; sz = $f.sz; v = $f.v; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: next = sliceType$4.nil; outp = 0; _tmp = i.p; _tmp$1 = 0; inCopyStart = _tmp; outCopyStart = _tmp$1; /* while (true) { */ case 1: sz = ((i.info.size >> 0)); /* */ if (sz <= 1) { $s = 3; continue; } /* */ $s = 4; continue; /* if (sz <= 1) { */ case 3: i.rb.ss = 0; p = i.p; i.p = i.p + (1) >> 0; if (i.p >= i.rb.nsrc) { i.setDone(); next = i.returnSlice(p, i.p); $s = -1; return next; } else if (i.rb.src._byte(i.p) < 128) { i.next = i.asciiF; next = i.returnSlice(p, i.p); $s = -1; return next; } outp = outp + (1) >> 0; $s = 5; continue; /* } else { */ case 4: d = $clone(i.info, Properties).Decomposition(); /* */ if (!(d === sliceType$4.nil)) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!(d === sliceType$4.nil)) { */ case 6: p$1 = outp + d.$length >> 0; /* */ if (outp > 0) { $s = 9; continue; } /* */ if ($clone(i.info, Properties).multiSegment()) { $s = 10; continue; } /* */ $s = 11; continue; /* if (outp > 0) { */ case 9: i.rb.src.copySlice($subslice(new sliceType$4(i.buf), outCopyStart), inCopyStart, i.p); if (p$1 > 128) { next = $subslice(new sliceType$4(i.buf), 0, outp); $s = -1; return next; } $s = 11; continue; /* } else if ($clone(i.info, Properties).multiSegment()) { */ case 10: /* */ if (i.multiSeg === sliceType$4.nil) { $s = 12; continue; } /* */ $s = 13; continue; /* if (i.multiSeg === sliceType$4.nil) { */ case 12: i.multiSeg = d; i.next = nextMulti; _r = nextMulti(i); /* */ $s = 14; case 14: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } next = _r; $24r = next; $s = 15; case 15: return $24r; /* } */ case 13: d = i.multiSeg; i.multiSeg = sliceType$4.nil; p$1 = d.$length; /* } */ case 11: prevCC = i.info.tccc; i.p = i.p + (sz) >> 0; /* */ if (i.p >= i.rb.nsrc) { $s = 16; continue; } /* */ $s = 17; continue; /* if (i.p >= i.rb.nsrc) { */ case 16: i.setDone(); Properties.copy(i.info, new Properties.ptr(0, 0, 0, 0, 0, 0, 0)); $s = 18; continue; /* } else { */ case 17: _r$1 = i.rb.f.info($clone(i.rb.src, input), i.p); /* */ $s = 19; case 19: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } Properties.copy(i.info, _r$1); /* } */ case 18: _1 = (x = i.rb, (x.$ptr_ss || (x.$ptr_ss = new ptrType$1(function() { return this.$target.ss; }, function($v) { this.$target.ss = $v; }, x)))).next($clone(i.info, Properties)); if (_1 === (2)) { i.next = nextCGJDecompose; if (outp > 0) { $copySlice($subslice(new sliceType$4(i.buf), outp), d); next = $subslice(new sliceType$4(i.buf), 0, p$1); $s = -1; return next; } next = d; $s = -1; return next; } else if (_1 === (1)) { if (outp > 0) { $copySlice($subslice(new sliceType$4(i.buf), outp), d); next = $subslice(new sliceType$4(i.buf), 0, p$1); $s = -1; return next; } next = d; $s = -1; return next; } $copySlice($subslice(new sliceType$4(i.buf), outp), d); outp = p$1; _tmp$2 = i.p; _tmp$3 = outp; inCopyStart = _tmp$2; outCopyStart = _tmp$3; /* */ if (i.info.ccc < prevCC) { $s = 20; continue; } /* */ $s = 21; continue; /* if (i.info.ccc < prevCC) { */ case 20: /* goto doNorm */ $s = 22; continue; /* } */ case 21: /* continue; */ $s = 1; continue; $s = 8; continue; /* } else { */ case 7: r = i.rb.src.hangul(i.p); if (!((r === 0))) { outp = decomposeHangul(new sliceType$4(i.buf), r); i.p = i.p + (3) >> 0; _tmp$4 = i.p; _tmp$5 = outp; inCopyStart = _tmp$4; outCopyStart = _tmp$5; if (i.p >= i.rb.nsrc) { i.setDone(); /* break; */ $s = 2; continue; } else if (!((i.rb.src.hangul(i.p) === 0))) { i.next = nextHangul; next = $subslice(new sliceType$4(i.buf), 0, outp); $s = -1; return next; } } else { p$2 = outp + sz >> 0; if (p$2 > 128) { /* break; */ $s = 2; continue; } outp = p$2; i.p = i.p + (sz) >> 0; } /* } */ case 8: /* } */ case 5: if (i.p >= i.rb.nsrc) { i.setDone(); /* break; */ $s = 2; continue; } prevCC$1 = i.info.tccc; _r$2 = i.rb.f.info($clone(i.rb.src, input), i.p); /* */ $s = 23; case 23: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } Properties.copy(i.info, _r$2); v = (x$1 = i.rb, (x$1.$ptr_ss || (x$1.$ptr_ss = new ptrType$1(function() { return this.$target.ss; }, function($v) { this.$target.ss = $v; }, x$1)))).next($clone(i.info, Properties)); if (v === 1) { /* break; */ $s = 2; continue; } else if (v === 2) { i.next = nextCGJDecompose; /* break; */ $s = 2; continue; } /* */ if (i.info.ccc < prevCC$1) { $s = 24; continue; } /* */ $s = 25; continue; /* if (i.info.ccc < prevCC$1) { */ case 24: /* goto doNorm */ $s = 22; continue; /* } */ case 25: $s = 1; continue; case 2: if (outCopyStart === 0) { next = i.returnSlice(inCopyStart, i.p); $s = -1; return next; } else if (inCopyStart < i.p) { i.rb.src.copySlice($subslice(new sliceType$4(i.buf), outCopyStart), inCopyStart, i.p); } next = $subslice(new sliceType$4(i.buf), 0, outp); $s = -1; return next; /* doNorm: */ case 22: i.rb.src.copySlice($subslice(new sliceType$4(i.buf), outCopyStart), inCopyStart, i.p); _r$3 = i.rb.insertDecomposed($subslice(new sliceType$4(i.buf), 0, outp)); /* */ $s = 26; case 26: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _r$4 = doNormDecomposed(i); /* */ $s = 27; case 27: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } next = _r$4; $24r$1 = next; $s = 28; case 28: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: nextDecomposed }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._1 = _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._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.d = d; $f.i = i; $f.inCopyStart = inCopyStart; $f.next = next; $f.outCopyStart = outCopyStart; $f.outp = outp; $f.p = p; $f.p$1 = p$1; $f.p$2 = p$2; $f.prevCC = prevCC; $f.prevCC$1 = prevCC$1; $f.r = r; $f.sz = sz; $f.v = v; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; doNormDecomposed = function(i) { var _r, i, s, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; i = $f.i; s = $f.s; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* while (true) { */ case 1: $r = i.rb.insertUnsafe($clone(i.rb.src, input), i.p, $clone(i.info, Properties)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i.p = i.p + (((i.info.size >> 0))) >> 0; if (i.p >= i.rb.nsrc) { i.setDone(); /* break; */ $s = 2; continue; } _r = i.rb.f.info($clone(i.rb.src, input), i.p); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } Properties.copy(i.info, _r); if (i.info.ccc === 0) { /* break; */ $s = 2; continue; } s = (x = i.rb, (x.$ptr_ss || (x.$ptr_ss = new ptrType$1(function() { return this.$target.ss; }, function($v) { this.$target.ss = $v; }, x)))).next($clone(i.info, Properties)); if (s === 2) { i.next = nextCGJDecompose; /* break; */ $s = 2; continue; } $s = 1; continue; case 2: $s = -1; return $subslice(new sliceType$4(i.buf), 0, i.rb.flushCopy(new sliceType$4(i.buf))); /* */ } return; } if ($f === undefined) { $f = { $blk: doNormDecomposed }; } $f._r = _r; $f.i = i; $f.s = s; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; nextCGJDecompose = function(i) { var _r, buf, i, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; buf = $f.buf; i = $f.i; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: i.rb.ss = 0; i.rb.insertCGJ(); i.next = nextDecomposed; (x = i.rb, (x.$ptr_ss || (x.$ptr_ss = new ptrType$1(function() { return this.$target.ss; }, function($v) { this.$target.ss = $v; }, x)))).first($clone(i.info, Properties)); _r = doNormDecomposed(i); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } buf = _r; $s = -1; return buf; /* */ } return; } if ($f === undefined) { $f = { $blk: nextCGJDecompose }; } $f._r = _r; $f.buf = buf; $f.i = i; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; nextComposed = function(i) { var $24r, $24r$1, _r, _r$1, _r$2, _r$3, _r$4, _tmp, _tmp$1, d, i, info, outp, p, prevCC, startp, sz, v, x, x$1, x$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; d = $f.d; i = $f.i; info = $f.info; outp = $f.outp; p = $f.p; prevCC = $f.prevCC; startp = $f.startp; sz = $f.sz; 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: _tmp = 0; _tmp$1 = i.p; outp = _tmp; startp = _tmp$1; prevCC = 0; /* while (true) { */ case 1: /* */ if (!$clone(i.info, Properties).isYesC()) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!$clone(i.info, Properties).isYesC()) { */ case 3: /* goto doNorm */ $s = 5; continue; /* } */ case 4: prevCC = i.info.tccc; sz = ((i.info.size >> 0)); if (sz === 0) { sz = 1; } p = outp + sz >> 0; if (p > 128) { /* break; */ $s = 2; continue; } outp = p; i.p = i.p + (sz) >> 0; if (i.p >= i.rb.nsrc) { i.setDone(); /* break; */ $s = 2; continue; } else if (i.rb.src._byte(i.p) < 128) { i.rb.ss = 0; i.next = i.asciiF; /* break; */ $s = 2; continue; } _r = i.rb.f.info($clone(i.rb.src, input), i.p); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } Properties.copy(i.info, _r); v = (x = i.rb, (x.$ptr_ss || (x.$ptr_ss = new ptrType$1(function() { return this.$target.ss; }, function($v) { this.$target.ss = $v; }, x)))).next($clone(i.info, Properties)); if (v === 1) { /* break; */ $s = 2; continue; } else if (v === 2) { i.next = nextCGJCompose; /* break; */ $s = 2; continue; } /* */ if (i.info.ccc < prevCC) { $s = 7; continue; } /* */ $s = 8; continue; /* if (i.info.ccc < prevCC) { */ case 7: /* goto doNorm */ $s = 5; continue; /* } */ case 8: $s = 1; continue; case 2: $s = -1; return i.returnSlice(startp, i.p); /* doNorm: */ case 5: i.p = startp; _r$1 = i.rb.f.info($clone(i.rb.src, input), i.p); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } Properties.copy(i.info, _r$1); (x$1 = i.rb, (x$1.$ptr_ss || (x$1.$ptr_ss = new ptrType$1(function() { return this.$target.ss; }, function($v) { this.$target.ss = $v; }, x$1)))).first($clone(i.info, Properties)); /* */ if ($clone(i.info, Properties).multiSegment()) { $s = 10; continue; } /* */ $s = 11; continue; /* if ($clone(i.info, Properties).multiSegment()) { */ case 10: d = $clone(i.info, Properties).Decomposition(); _r$2 = i.rb.f.info(new input.ptr("", d), 0); /* */ $s = 12; case 12: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } info = $clone(_r$2, Properties); $r = i.rb.insertUnsafe(new input.ptr("", d), 0, $clone(info, Properties)); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i.multiSeg = $subslice(d, ((info.size >> 0))); i.next = nextMultiNorm; _r$3 = nextMultiNorm(i); /* */ $s = 14; case 14: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = _r$3; $s = 15; case 15: return $24r; /* } */ case 11: (x$2 = i.rb, (x$2.$ptr_ss || (x$2.$ptr_ss = new ptrType$1(function() { return this.$target.ss; }, function($v) { this.$target.ss = $v; }, x$2)))).first($clone(i.info, Properties)); $r = i.rb.insertUnsafe($clone(i.rb.src, input), i.p, $clone(i.info, Properties)); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$4 = doNormComposed(i); /* */ $s = 17; case 17: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r$1 = _r$4; $s = 18; case 18: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: nextComposed }; } $f.$24r = $24r; $f.$24r$1 = $24r$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._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.d = d; $f.i = i; $f.info = info; $f.outp = outp; $f.p = p; $f.prevCC = prevCC; $f.startp = startp; $f.sz = sz; $f.v = v; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; }; doNormComposed = function(i) { var _r, i, s, seg, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; i = $f.i; s = $f.s; seg = $f.seg; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* while (true) { */ case 1: i.p = i.p + (((i.info.size >> 0))) >> 0; if (i.p >= i.rb.nsrc) { i.setDone(); /* break; */ $s = 2; continue; } _r = i.rb.f.info($clone(i.rb.src, input), i.p); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } Properties.copy(i.info, _r); s = (x = i.rb, (x.$ptr_ss || (x.$ptr_ss = new ptrType$1(function() { return this.$target.ss; }, function($v) { this.$target.ss = $v; }, x)))).next($clone(i.info, Properties)); if (s === 1) { /* break; */ $s = 2; continue; } else if (s === 2) { i.next = nextCGJCompose; /* break; */ $s = 2; continue; } $r = i.rb.insertUnsafe($clone(i.rb.src, input), i.p, $clone(i.info, Properties)); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 1; continue; case 2: $r = i.rb.compose(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } seg = $subslice(new sliceType$4(i.buf), 0, i.rb.flushCopy(new sliceType$4(i.buf))); $s = -1; return seg; /* */ } return; } if ($f === undefined) { $f = { $blk: doNormComposed }; } $f._r = _r; $f.i = i; $f.s = s; $f.seg = seg; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; nextCGJCompose = function(i) { var $24r, _r, i, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; i = $f.i; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: i.rb.ss = 0; i.rb.insertCGJ(); i.next = nextComposed; (x = i.rb, (x.$ptr_ss || (x.$ptr_ss = new ptrType$1(function() { return this.$target.ss; }, function($v) { this.$target.ss = $v; }, x)))).first($clone(i.info, Properties)); $r = i.rb.insertUnsafe($clone(i.rb.src, input), i.p, $clone(i.info, Properties)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r = doNormComposed(i); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: nextCGJCompose }; } $f.$24r = $24r; $f._r = _r; $f.i = i; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; inputBytes = function(str) { var str; return new input.ptr("", str); }; inputString = function(str) { var str; return new input.ptr(str, sliceType$4.nil); }; input.ptr.prototype.setBytes = function(str) { var in$1, str; in$1 = this; in$1.str = ""; in$1.bytes = str; }; input.prototype.setBytes = function(str) { return this.$val.setBytes(str); }; input.ptr.prototype.setString = function(str) { var in$1, str; in$1 = this; in$1.str = str; in$1.bytes = sliceType$4.nil; }; input.prototype.setString = function(str) { return this.$val.setString(str); }; input.ptr.prototype._byte = function(p) { var in$1, p, x; in$1 = this; if (in$1.bytes === sliceType$4.nil) { return in$1.str.charCodeAt(p); } return (x = in$1.bytes, ((p < 0 || p >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + p])); }; input.prototype._byte = function(p) { return this.$val._byte(p); }; input.ptr.prototype.skipASCII = function(p, max) { var in$1, max, p, x; in$1 = this; if (in$1.bytes === sliceType$4.nil) { while (true) { if (!(p < max && in$1.str.charCodeAt(p) < 128)) { break; } p = p + (1) >> 0; } } else { while (true) { if (!(p < max && (x = in$1.bytes, ((p < 0 || p >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + p])) < 128)) { break; } p = p + (1) >> 0; } } return p; }; input.prototype.skipASCII = function(p, max) { return this.$val.skipASCII(p, max); }; input.ptr.prototype.skipContinuationBytes = function(p) { var in$1, p, x; in$1 = this; if (in$1.bytes === sliceType$4.nil) { while (true) { if (!(p < in$1.str.length && !utf8.RuneStart(in$1.str.charCodeAt(p)))) { break; } p = p + (1) >> 0; } } else { while (true) { if (!(p < in$1.bytes.$length && !utf8.RuneStart((x = in$1.bytes, ((p < 0 || p >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + p]))))) { break; } p = p + (1) >> 0; } } return p; }; input.prototype.skipContinuationBytes = function(p) { return this.$val.skipContinuationBytes(p); }; input.ptr.prototype.appendSlice = function(buf, b, e) { var b, buf, e, i, in$1; in$1 = this; if (!(in$1.bytes === sliceType$4.nil)) { return $appendSlice(buf, $subslice(in$1.bytes, b, e)); } i = b; while (true) { if (!(i < e)) { break; } buf = $append(buf, in$1.str.charCodeAt(i)); i = i + (1) >> 0; } return buf; }; input.prototype.appendSlice = function(buf, b, e) { return this.$val.appendSlice(buf, b, e); }; input.ptr.prototype.copySlice = function(buf, b, e) { var b, buf, e, in$1; in$1 = this; if (in$1.bytes === sliceType$4.nil) { return $copyString(buf, $substring(in$1.str, b, e)); } return $copySlice(buf, $subslice(in$1.bytes, b, e)); }; input.prototype.copySlice = function(buf, b, e) { return this.$val.copySlice(buf, b, e); }; input.ptr.prototype.charinfoNFC = function(p) { var in$1, p; in$1 = this; if (in$1.bytes === sliceType$4.nil) { return nfcData.lookupString($substring(in$1.str, p)); } return nfcData.lookup($subslice(in$1.bytes, p)); }; input.prototype.charinfoNFC = function(p) { return this.$val.charinfoNFC(p); }; input.ptr.prototype.charinfoNFKC = function(p) { var in$1, p; in$1 = this; if (in$1.bytes === sliceType$4.nil) { return nfkcData.lookupString($substring(in$1.str, p)); } return nfkcData.lookup($subslice(in$1.bytes, p)); }; input.prototype.charinfoNFKC = function(p) { return this.$val.charinfoNFKC(p); }; input.ptr.prototype.hangul = function(p) { var _tuple, _tuple$1, in$1, p, r, size; r = 0; in$1 = this; size = 0; if (in$1.bytes === sliceType$4.nil) { if (!isHangulString($substring(in$1.str, p))) { r = 0; return r; } _tuple = utf8.DecodeRuneInString($substring(in$1.str, p)); r = _tuple[0]; size = _tuple[1]; } else { if (!isHangul($subslice(in$1.bytes, p))) { r = 0; return r; } _tuple$1 = utf8.DecodeRune($subslice(in$1.bytes, p)); r = _tuple$1[0]; size = _tuple$1[1]; } if (!((size === 3))) { r = 0; return r; } r = r; return r; }; input.prototype.hangul = function(p) { return this.$val.hangul(p); }; Properties.ptr.prototype.BoundaryBefore = function() { var p; p = this; if ((p.ccc === 0) && !$clone(p, Properties).combinesBackward()) { return true; } return false; }; Properties.prototype.BoundaryBefore = function() { return this.$val.BoundaryBefore(); }; Properties.ptr.prototype.BoundaryAfter = function() { var p; p = this; return $clone(p, Properties).isInert(); }; Properties.prototype.BoundaryAfter = function() { return this.$val.BoundaryAfter(); }; Properties.ptr.prototype.isYesC = function() { var p; p = this; return ((p.flags & 16) >>> 0) === 0; }; Properties.prototype.isYesC = function() { return this.$val.isYesC(); }; Properties.ptr.prototype.isYesD = function() { var p; p = this; return ((p.flags & 4) >>> 0) === 0; }; Properties.prototype.isYesD = function() { return this.$val.isYesD(); }; Properties.ptr.prototype.combinesBackward = function() { var p; p = this; return !((((p.flags & 8) >>> 0) === 0)); }; Properties.prototype.combinesBackward = function() { return this.$val.combinesBackward(); }; Properties.ptr.prototype.hasDecomposition = function() { var p; p = this; return !((((p.flags & 4) >>> 0) === 0)); }; Properties.prototype.hasDecomposition = function() { return this.$val.hasDecomposition(); }; Properties.ptr.prototype.isInert = function() { var p; p = this; return (((p.flags & 63) >>> 0) === 0) && (p.ccc === 0); }; Properties.prototype.isInert = function() { return this.$val.isInert(); }; Properties.ptr.prototype.multiSegment = function() { var p; p = this; return p.index >= 6256 && p.index < 12151; }; Properties.prototype.multiSegment = function() { return this.$val.multiSegment(); }; Properties.ptr.prototype.nLeadingNonStarters = function() { var p; p = this; return p.nLead; }; Properties.prototype.nLeadingNonStarters = function() { return this.$val.nLeadingNonStarters(); }; Properties.ptr.prototype.nTrailingNonStarters = function() { var p; p = this; return ((((p.flags & 3) >>> 0) << 24 >>> 24)); }; Properties.prototype.nTrailingNonStarters = function() { return this.$val.nTrailingNonStarters(); }; Properties.ptr.prototype.Decomposition = function() { var i, n, p; p = this; if (p.index === 0) { return sliceType$4.nil; } i = p.index; n = (((i < 0 || i >= decomps.length) ? ($throwRuntimeError("index out of range"), undefined) : decomps[i]) & 63) >>> 0; i = i + (1) << 16 >>> 16; return $subslice(new sliceType$4(decomps), i, (i + ((n << 16 >>> 16)) << 16 >>> 16)); }; Properties.prototype.Decomposition = function() { return this.$val.Decomposition(); }; Properties.ptr.prototype.Size = function() { var p; p = this; return ((p.size >> 0)); }; Properties.prototype.Size = function() { return this.$val.Size(); }; Properties.ptr.prototype.CCC = function() { var p, x; p = this; if (p.index >= 19087) { return 0; } return (x = p.ccc, ((x < 0 || x >= ccc.length) ? ($throwRuntimeError("index out of range"), undefined) : ccc[x])); }; Properties.prototype.CCC = function() { return this.$val.CCC(); }; Properties.ptr.prototype.LeadCCC = function() { var p, x; p = this; return (x = p.ccc, ((x < 0 || x >= ccc.length) ? ($throwRuntimeError("index out of range"), undefined) : ccc[x])); }; Properties.prototype.LeadCCC = function() { return this.$val.LeadCCC(); }; Properties.ptr.prototype.TrailCCC = function() { var p, x; p = this; return (x = p.tccc, ((x < 0 || x >= ccc.length) ? ($throwRuntimeError("index out of range"), undefined) : ccc[x])); }; Properties.prototype.TrailCCC = function() { return this.$val.TrailCCC(); }; buildRecompMap = function() { var _key, buf, i, key, val; recompMap = {}; buf = arrayType$3.zero(); i = 0; while (true) { if (!(i < 7528)) { break; } $copyString(new sliceType$4(buf), $substring("\x00A\x03\x00\x00\x00\x00\xC0\x00A\x03\x01\x00\x00\x00\xC1\x00A\x03\x02\x00\x00\x00\xC2\x00A\x03\x03\x00\x00\x00\xC3\x00A\x03\b\x00\x00\x00\xC4\x00A\x03\n\x00\x00\x00\xC5\x00C\x03'\x00\x00\x00\xC7\x00E\x03\x00\x00\x00\x00\xC8\x00E\x03\x01\x00\x00\x00\xC9\x00E\x03\x02\x00\x00\x00\xCA\x00E\x03\b\x00\x00\x00\xCB\x00I\x03\x00\x00\x00\x00\xCC\x00I\x03\x01\x00\x00\x00\xCD\x00I\x03\x02\x00\x00\x00\xCE\x00I\x03\b\x00\x00\x00\xCF\x00N\x03\x03\x00\x00\x00\xD1\x00O\x03\x00\x00\x00\x00\xD2\x00O\x03\x01\x00\x00\x00\xD3\x00O\x03\x02\x00\x00\x00\xD4\x00O\x03\x03\x00\x00\x00\xD5\x00O\x03\b\x00\x00\x00\xD6\x00U\x03\x00\x00\x00\x00\xD9\x00U\x03\x01\x00\x00\x00\xDA\x00U\x03\x02\x00\x00\x00\xDB\x00U\x03\b\x00\x00\x00\xDC\x00Y\x03\x01\x00\x00\x00\xDD\x00a\x03\x00\x00\x00\x00\xE0\x00a\x03\x01\x00\x00\x00\xE1\x00a\x03\x02\x00\x00\x00\xE2\x00a\x03\x03\x00\x00\x00\xE3\x00a\x03\b\x00\x00\x00\xE4\x00a\x03\n\x00\x00\x00\xE5\x00c\x03'\x00\x00\x00\xE7\x00e\x03\x00\x00\x00\x00\xE8\x00e\x03\x01\x00\x00\x00\xE9\x00e\x03\x02\x00\x00\x00\xEA\x00e\x03\b\x00\x00\x00\xEB\x00i\x03\x00\x00\x00\x00\xEC\x00i\x03\x01\x00\x00\x00\xED\x00i\x03\x02\x00\x00\x00\xEE\x00i\x03\b\x00\x00\x00\xEF\x00n\x03\x03\x00\x00\x00\xF1\x00o\x03\x00\x00\x00\x00\xF2\x00o\x03\x01\x00\x00\x00\xF3\x00o\x03\x02\x00\x00\x00\xF4\x00o\x03\x03\x00\x00\x00\xF5\x00o\x03\b\x00\x00\x00\xF6\x00u\x03\x00\x00\x00\x00\xF9\x00u\x03\x01\x00\x00\x00\xFA\x00u\x03\x02\x00\x00\x00\xFB\x00u\x03\b\x00\x00\x00\xFC\x00y\x03\x01\x00\x00\x00\xFD\x00y\x03\b\x00\x00\x00\xFF\x00A\x03\x04\x00\x00\x01\x00\x00a\x03\x04\x00\x00\x01\x01\x00A\x03\x06\x00\x00\x01\x02\x00a\x03\x06\x00\x00\x01\x03\x00A\x03(\x00\x00\x01\x04\x00a\x03(\x00\x00\x01\x05\x00C\x03\x01\x00\x00\x01\x06\x00c\x03\x01\x00\x00\x01\x07\x00C\x03\x02\x00\x00\x01\b\x00c\x03\x02\x00\x00\x01\t\x00C\x03\x07\x00\x00\x01\n\x00c\x03\x07\x00\x00\x01\v\x00C\x03\f\x00\x00\x01\f\x00c\x03\f\x00\x00\x01\r\x00D\x03\f\x00\x00\x01\x0E\x00d\x03\f\x00\x00\x01\x0F\x00E\x03\x04\x00\x00\x01\x12\x00e\x03\x04\x00\x00\x01\x13\x00E\x03\x06\x00\x00\x01\x14\x00e\x03\x06\x00\x00\x01\x15\x00E\x03\x07\x00\x00\x01\x16\x00e\x03\x07\x00\x00\x01\x17\x00E\x03(\x00\x00\x01\x18\x00e\x03(\x00\x00\x01\x19\x00E\x03\f\x00\x00\x01\x1A\x00e\x03\f\x00\x00\x01\x1B\x00G\x03\x02\x00\x00\x01\x1C\x00g\x03\x02\x00\x00\x01\x1D\x00G\x03\x06\x00\x00\x01\x1E\x00g\x03\x06\x00\x00\x01\x1F\x00G\x03\x07\x00\x00\x01 \x00g\x03\x07\x00\x00\x01!\x00G\x03'\x00\x00\x01\"\x00g\x03'\x00\x00\x01#\x00H\x03\x02\x00\x00\x01$\x00h\x03\x02\x00\x00\x01%\x00I\x03\x03\x00\x00\x01(\x00i\x03\x03\x00\x00\x01)\x00I\x03\x04\x00\x00\x01*\x00i\x03\x04\x00\x00\x01+\x00I\x03\x06\x00\x00\x01,\x00i\x03\x06\x00\x00\x01-\x00I\x03(\x00\x00\x01.\x00i\x03(\x00\x00\x01/\x00I\x03\x07\x00\x00\x010\x00J\x03\x02\x00\x00\x014\x00j\x03\x02\x00\x00\x015\x00K\x03'\x00\x00\x016\x00k\x03'\x00\x00\x017\x00L\x03\x01\x00\x00\x019\x00l\x03\x01\x00\x00\x01:\x00L\x03'\x00\x00\x01;\x00l\x03'\x00\x00\x01<\x00L\x03\f\x00\x00\x01=\x00l\x03\f\x00\x00\x01>\x00N\x03\x01\x00\x00\x01C\x00n\x03\x01\x00\x00\x01D\x00N\x03'\x00\x00\x01E\x00n\x03'\x00\x00\x01F\x00N\x03\f\x00\x00\x01G\x00n\x03\f\x00\x00\x01H\x00O\x03\x04\x00\x00\x01L\x00o\x03\x04\x00\x00\x01M\x00O\x03\x06\x00\x00\x01N\x00o\x03\x06\x00\x00\x01O\x00O\x03\v\x00\x00\x01P\x00o\x03\v\x00\x00\x01Q\x00R\x03\x01\x00\x00\x01T\x00r\x03\x01\x00\x00\x01U\x00R\x03'\x00\x00\x01V\x00r\x03'\x00\x00\x01W\x00R\x03\f\x00\x00\x01X\x00r\x03\f\x00\x00\x01Y\x00S\x03\x01\x00\x00\x01Z\x00s\x03\x01\x00\x00\x01[\x00S\x03\x02\x00\x00\x01\\\x00s\x03\x02\x00\x00\x01]\x00S\x03'\x00\x00\x01^\x00s\x03'\x00\x00\x01_\x00S\x03\f\x00\x00\x01`\x00s\x03\f\x00\x00\x01a\x00T\x03'\x00\x00\x01b\x00t\x03'\x00\x00\x01c\x00T\x03\f\x00\x00\x01d\x00t\x03\f\x00\x00\x01e\x00U\x03\x03\x00\x00\x01h\x00u\x03\x03\x00\x00\x01i\x00U\x03\x04\x00\x00\x01j\x00u\x03\x04\x00\x00\x01k\x00U\x03\x06\x00\x00\x01l\x00u\x03\x06\x00\x00\x01m\x00U\x03\n\x00\x00\x01n\x00u\x03\n\x00\x00\x01o\x00U\x03\v\x00\x00\x01p\x00u\x03\v\x00\x00\x01q\x00U\x03(\x00\x00\x01r\x00u\x03(\x00\x00\x01s\x00W\x03\x02\x00\x00\x01t\x00w\x03\x02\x00\x00\x01u\x00Y\x03\x02\x00\x00\x01v\x00y\x03\x02\x00\x00\x01w\x00Y\x03\b\x00\x00\x01x\x00Z\x03\x01\x00\x00\x01y\x00z\x03\x01\x00\x00\x01z\x00Z\x03\x07\x00\x00\x01{\x00z\x03\x07\x00\x00\x01|\x00Z\x03\f\x00\x00\x01}\x00z\x03\f\x00\x00\x01~\x00O\x03\x1B\x00\x00\x01\xA0\x00o\x03\x1B\x00\x00\x01\xA1\x00U\x03\x1B\x00\x00\x01\xAF\x00u\x03\x1B\x00\x00\x01\xB0\x00A\x03\f\x00\x00\x01\xCD\x00a\x03\f\x00\x00\x01\xCE\x00I\x03\f\x00\x00\x01\xCF\x00i\x03\f\x00\x00\x01\xD0\x00O\x03\f\x00\x00\x01\xD1\x00o\x03\f\x00\x00\x01\xD2\x00U\x03\f\x00\x00\x01\xD3\x00u\x03\f\x00\x00\x01\xD4\x00\xDC\x03\x04\x00\x00\x01\xD5\x00\xFC\x03\x04\x00\x00\x01\xD6\x00\xDC\x03\x01\x00\x00\x01\xD7\x00\xFC\x03\x01\x00\x00\x01\xD8\x00\xDC\x03\f\x00\x00\x01\xD9\x00\xFC\x03\f\x00\x00\x01\xDA\x00\xDC\x03\x00\x00\x00\x01\xDB\x00\xFC\x03\x00\x00\x00\x01\xDC\x00\xC4\x03\x04\x00\x00\x01\xDE\x00\xE4\x03\x04\x00\x00\x01\xDF\x02&\x03\x04\x00\x00\x01\xE0\x02'\x03\x04\x00\x00\x01\xE1\x00\xC6\x03\x04\x00\x00\x01\xE2\x00\xE6\x03\x04\x00\x00\x01\xE3\x00G\x03\f\x00\x00\x01\xE6\x00g\x03\f\x00\x00\x01\xE7\x00K\x03\f\x00\x00\x01\xE8\x00k\x03\f\x00\x00\x01\xE9\x00O\x03(\x00\x00\x01\xEA\x00o\x03(\x00\x00\x01\xEB\x01\xEA\x03\x04\x00\x00\x01\xEC\x01\xEB\x03\x04\x00\x00\x01\xED\x01\xB7\x03\f\x00\x00\x01\xEE\x02\x92\x03\f\x00\x00\x01\xEF\x00j\x03\f\x00\x00\x01\xF0\x00G\x03\x01\x00\x00\x01\xF4\x00g\x03\x01\x00\x00\x01\xF5\x00N\x03\x00\x00\x00\x01\xF8\x00n\x03\x00\x00\x00\x01\xF9\x00\xC5\x03\x01\x00\x00\x01\xFA\x00\xE5\x03\x01\x00\x00\x01\xFB\x00\xC6\x03\x01\x00\x00\x01\xFC\x00\xE6\x03\x01\x00\x00\x01\xFD\x00\xD8\x03\x01\x00\x00\x01\xFE\x00\xF8\x03\x01\x00\x00\x01\xFF\x00A\x03\x0F\x00\x00\x02\x00\x00a\x03\x0F\x00\x00\x02\x01\x00A\x03\x11\x00\x00\x02\x02\x00a\x03\x11\x00\x00\x02\x03\x00E\x03\x0F\x00\x00\x02\x04\x00e\x03\x0F\x00\x00\x02\x05\x00E\x03\x11\x00\x00\x02\x06\x00e\x03\x11\x00\x00\x02\x07\x00I\x03\x0F\x00\x00\x02\b\x00i\x03\x0F\x00\x00\x02\t\x00I\x03\x11\x00\x00\x02\n\x00i\x03\x11\x00\x00\x02\v\x00O\x03\x0F\x00\x00\x02\f\x00o\x03\x0F\x00\x00\x02\r\x00O\x03\x11\x00\x00\x02\x0E\x00o\x03\x11\x00\x00\x02\x0F\x00R\x03\x0F\x00\x00\x02\x10\x00r\x03\x0F\x00\x00\x02\x11\x00R\x03\x11\x00\x00\x02\x12\x00r\x03\x11\x00\x00\x02\x13\x00U\x03\x0F\x00\x00\x02\x14\x00u\x03\x0F\x00\x00\x02\x15\x00U\x03\x11\x00\x00\x02\x16\x00u\x03\x11\x00\x00\x02\x17\x00S\x03&\x00\x00\x02\x18\x00s\x03&\x00\x00\x02\x19\x00T\x03&\x00\x00\x02\x1A\x00t\x03&\x00\x00\x02\x1B\x00H\x03\f\x00\x00\x02\x1E\x00h\x03\f\x00\x00\x02\x1F\x00A\x03\x07\x00\x00\x02&\x00a\x03\x07\x00\x00\x02'\x00E\x03'\x00\x00\x02(\x00e\x03'\x00\x00\x02)\x00\xD6\x03\x04\x00\x00\x02*\x00\xF6\x03\x04\x00\x00\x02+\x00\xD5\x03\x04\x00\x00\x02,\x00\xF5\x03\x04\x00\x00\x02-\x00O\x03\x07\x00\x00\x02.\x00o\x03\x07\x00\x00\x02/\x02.\x03\x04\x00\x00\x020\x02/\x03\x04\x00\x00\x021\x00Y\x03\x04\x00\x00\x022\x00y\x03\x04\x00\x00\x023\x00\xA8\x03\x01\x00\x00\x03\x85\x03\x91\x03\x01\x00\x00\x03\x86\x03\x95\x03\x01\x00\x00\x03\x88\x03\x97\x03\x01\x00\x00\x03\x89\x03\x99\x03\x01\x00\x00\x03\x8A\x03\x9F\x03\x01\x00\x00\x03\x8C\x03\xA5\x03\x01\x00\x00\x03\x8E\x03\xA9\x03\x01\x00\x00\x03\x8F\x03\xCA\x03\x01\x00\x00\x03\x90\x03\x99\x03\b\x00\x00\x03\xAA\x03\xA5\x03\b\x00\x00\x03\xAB\x03\xB1\x03\x01\x00\x00\x03\xAC\x03\xB5\x03\x01\x00\x00\x03\xAD\x03\xB7\x03\x01\x00\x00\x03\xAE\x03\xB9\x03\x01\x00\x00\x03\xAF\x03\xCB\x03\x01\x00\x00\x03\xB0\x03\xB9\x03\b\x00\x00\x03\xCA\x03\xC5\x03\b\x00\x00\x03\xCB\x03\xBF\x03\x01\x00\x00\x03\xCC\x03\xC5\x03\x01\x00\x00\x03\xCD\x03\xC9\x03\x01\x00\x00\x03\xCE\x03\xD2\x03\x01\x00\x00\x03\xD3\x03\xD2\x03\b\x00\x00\x03\xD4\x04\x15\x03\x00\x00\x00\x04\x00\x04\x15\x03\b\x00\x00\x04\x01\x04\x13\x03\x01\x00\x00\x04\x03\x04\x06\x03\b\x00\x00\x04\x07\x04\x1A\x03\x01\x00\x00\x04\f\x04\x18\x03\x00\x00\x00\x04\r\x04#\x03\x06\x00\x00\x04\x0E\x04\x18\x03\x06\x00\x00\x04\x19\x048\x03\x06\x00\x00\x049\x045\x03\x00\x00\x00\x04P\x045\x03\b\x00\x00\x04Q\x043\x03\x01\x00\x00\x04S\x04V\x03\b\x00\x00\x04W\x04:\x03\x01\x00\x00\x04\\\x048\x03\x00\x00\x00\x04]\x04C\x03\x06\x00\x00\x04^\x04t\x03\x0F\x00\x00\x04v\x04u\x03\x0F\x00\x00\x04w\x04\x16\x03\x06\x00\x00\x04\xC1\x046\x03\x06\x00\x00\x04\xC2\x04\x10\x03\x06\x00\x00\x04\xD0\x040\x03\x06\x00\x00\x04\xD1\x04\x10\x03\b\x00\x00\x04\xD2\x040\x03\b\x00\x00\x04\xD3\x04\x15\x03\x06\x00\x00\x04\xD6\x045\x03\x06\x00\x00\x04\xD7\x04\xD8\x03\b\x00\x00\x04\xDA\x04\xD9\x03\b\x00\x00\x04\xDB\x04\x16\x03\b\x00\x00\x04\xDC\x046\x03\b\x00\x00\x04\xDD\x04\x17\x03\b\x00\x00\x04\xDE\x047\x03\b\x00\x00\x04\xDF\x04\x18\x03\x04\x00\x00\x04\xE2\x048\x03\x04\x00\x00\x04\xE3\x04\x18\x03\b\x00\x00\x04\xE4\x048\x03\b\x00\x00\x04\xE5\x04\x1E\x03\b\x00\x00\x04\xE6\x04>\x03\b\x00\x00\x04\xE7\x04\xE8\x03\b\x00\x00\x04\xEA\x04\xE9\x03\b\x00\x00\x04\xEB\x04-\x03\b\x00\x00\x04\xEC\x04M\x03\b\x00\x00\x04\xED\x04#\x03\x04\x00\x00\x04\xEE\x04C\x03\x04\x00\x00\x04\xEF\x04#\x03\b\x00\x00\x04\xF0\x04C\x03\b\x00\x00\x04\xF1\x04#\x03\v\x00\x00\x04\xF2\x04C\x03\v\x00\x00\x04\xF3\x04'\x03\b\x00\x00\x04\xF4\x04G\x03\b\x00\x00\x04\xF5\x04+\x03\b\x00\x00\x04\xF8\x04K\x03\b\x00\x00\x04\xF9\x06'\x06S\x00\x00\x06\"\x06'\x06T\x00\x00\x06#\x06H\x06T\x00\x00\x06$\x06'\x06U\x00\x00\x06%\x06J\x06T\x00\x00\x06&\x06\xD5\x06T\x00\x00\x06\xC0\x06\xC1\x06T\x00\x00\x06\xC2\x06\xD2\x06T\x00\x00\x06\xD3\t(\t<\x00\x00\t)\t0\t<\x00\x00\t1\t3\t<\x00\x00\t4\t\xC7\t\xBE\x00\x00\t\xCB\t\xC7\t\xD7\x00\x00\t\xCC\vG\vV\x00\x00\vH\vG\v>\x00\x00\vK\vG\vW\x00\x00\vL\v\x92\v\xD7\x00\x00\v\x94\v\xC6\v\xBE\x00\x00\v\xCA\v\xC7\v\xBE\x00\x00\v\xCB\v\xC6\v\xD7\x00\x00\v\xCC\fF\fV\x00\x00\fH\f\xBF\f\xD5\x00\x00\f\xC0\f\xC6\f\xD5\x00\x00\f\xC7\f\xC6\f\xD6\x00\x00\f\xC8\f\xC6\f\xC2\x00\x00\f\xCA\f\xCA\f\xD5\x00\x00\f\xCB\rF\r>\x00\x00\rJ\rG\r>\x00\x00\rK\rF\rW\x00\x00\rL\r\xD9\r\xCA\x00\x00\r\xDA\r\xD9\r\xCF\x00\x00\r\xDC\r\xDC\r\xCA\x00\x00\r\xDD\r\xD9\r\xDF\x00\x00\r\xDE\x10%\x10.\x00\x00\x10&\x1B\x05\x1B5\x00\x00\x1B\x06\x1B\x07\x1B5\x00\x00\x1B\b\x1B\t\x1B5\x00\x00\x1B\n\x1B\v\x1B5\x00\x00\x1B\f\x1B\r\x1B5\x00\x00\x1B\x0E\x1B\x11\x1B5\x00\x00\x1B\x12\x1B:\x1B5\x00\x00\x1B;\x1B<\x1B5\x00\x00\x1B=\x1B>\x1B5\x00\x00\x1B@\x1B?\x1B5\x00\x00\x1BA\x1BB\x1B5\x00\x00\x1BC\x00A\x03%\x00\x00\x1E\x00\x00a\x03%\x00\x00\x1E\x01\x00B\x03\x07\x00\x00\x1E\x02\x00b\x03\x07\x00\x00\x1E\x03\x00B\x03#\x00\x00\x1E\x04\x00b\x03#\x00\x00\x1E\x05\x00B\x031\x00\x00\x1E\x06\x00b\x031\x00\x00\x1E\x07\x00\xC7\x03\x01\x00\x00\x1E\b\x00\xE7\x03\x01\x00\x00\x1E\t\x00D\x03\x07\x00\x00\x1E\n\x00d\x03\x07\x00\x00\x1E\v\x00D\x03#\x00\x00\x1E\f\x00d\x03#\x00\x00\x1E\r\x00D\x031\x00\x00\x1E\x0E\x00d\x031\x00\x00\x1E\x0F\x00D\x03'\x00\x00\x1E\x10\x00d\x03'\x00\x00\x1E\x11\x00D\x03-\x00\x00\x1E\x12\x00d\x03-\x00\x00\x1E\x13\x01\x12\x03\x00\x00\x00\x1E\x14\x01\x13\x03\x00\x00\x00\x1E\x15\x01\x12\x03\x01\x00\x00\x1E\x16\x01\x13\x03\x01\x00\x00\x1E\x17\x00E\x03-\x00\x00\x1E\x18\x00e\x03-\x00\x00\x1E\x19\x00E\x030\x00\x00\x1E\x1A\x00e\x030\x00\x00\x1E\x1B\x02(\x03\x06\x00\x00\x1E\x1C\x02)\x03\x06\x00\x00\x1E\x1D\x00F\x03\x07\x00\x00\x1E\x1E\x00f\x03\x07\x00\x00\x1E\x1F\x00G\x03\x04\x00\x00\x1E \x00g\x03\x04\x00\x00\x1E!\x00H\x03\x07\x00\x00\x1E\"\x00h\x03\x07\x00\x00\x1E#\x00H\x03#\x00\x00\x1E$\x00h\x03#\x00\x00\x1E%\x00H\x03\b\x00\x00\x1E&\x00h\x03\b\x00\x00\x1E'\x00H\x03'\x00\x00\x1E(\x00h\x03'\x00\x00\x1E)\x00H\x03.\x00\x00\x1E*\x00h\x03.\x00\x00\x1E+\x00I\x030\x00\x00\x1E,\x00i\x030\x00\x00\x1E-\x00\xCF\x03\x01\x00\x00\x1E.\x00\xEF\x03\x01\x00\x00\x1E/\x00K\x03\x01\x00\x00\x1E0\x00k\x03\x01\x00\x00\x1E1\x00K\x03#\x00\x00\x1E2\x00k\x03#\x00\x00\x1E3\x00K\x031\x00\x00\x1E4\x00k\x031\x00\x00\x1E5\x00L\x03#\x00\x00\x1E6\x00l\x03#\x00\x00\x1E7\x1E6\x03\x04\x00\x00\x1E8\x1E7\x03\x04\x00\x00\x1E9\x00L\x031\x00\x00\x1E:\x00l\x031\x00\x00\x1E;\x00L\x03-\x00\x00\x1E<\x00l\x03-\x00\x00\x1E=\x00M\x03\x01\x00\x00\x1E>\x00m\x03\x01\x00\x00\x1E?\x00M\x03\x07\x00\x00\x1E@\x00m\x03\x07\x00\x00\x1EA\x00M\x03#\x00\x00\x1EB\x00m\x03#\x00\x00\x1EC\x00N\x03\x07\x00\x00\x1ED\x00n\x03\x07\x00\x00\x1EE\x00N\x03#\x00\x00\x1EF\x00n\x03#\x00\x00\x1EG\x00N\x031\x00\x00\x1EH\x00n\x031\x00\x00\x1EI\x00N\x03-\x00\x00\x1EJ\x00n\x03-\x00\x00\x1EK\x00\xD5\x03\x01\x00\x00\x1EL\x00\xF5\x03\x01\x00\x00\x1EM\x00\xD5\x03\b\x00\x00\x1EN\x00\xF5\x03\b\x00\x00\x1EO\x01L\x03\x00\x00\x00\x1EP\x01M\x03\x00\x00\x00\x1EQ\x01L\x03\x01\x00\x00\x1ER\x01M\x03\x01\x00\x00\x1ES\x00P\x03\x01\x00\x00\x1ET\x00p\x03\x01\x00\x00\x1EU\x00P\x03\x07\x00\x00\x1EV\x00p\x03\x07\x00\x00\x1EW\x00R\x03\x07\x00\x00\x1EX\x00r\x03\x07\x00\x00\x1EY\x00R\x03#\x00\x00\x1EZ\x00r\x03#\x00\x00\x1E[\x1EZ\x03\x04\x00\x00\x1E\\\x1E[\x03\x04\x00\x00\x1E]\x00R\x031\x00\x00\x1E^\x00r\x031\x00\x00\x1E_\x00S\x03\x07\x00\x00\x1E`\x00s\x03\x07\x00\x00\x1Ea\x00S\x03#\x00\x00\x1Eb\x00s\x03#\x00\x00\x1Ec\x01Z\x03\x07\x00\x00\x1Ed\x01[\x03\x07\x00\x00\x1Ee\x01`\x03\x07\x00\x00\x1Ef\x01a\x03\x07\x00\x00\x1Eg\x1Eb\x03\x07\x00\x00\x1Eh\x1Ec\x03\x07\x00\x00\x1Ei\x00T\x03\x07\x00\x00\x1Ej\x00t\x03\x07\x00\x00\x1Ek\x00T\x03#\x00\x00\x1El\x00t\x03#\x00\x00\x1Em\x00T\x031\x00\x00\x1En\x00t\x031\x00\x00\x1Eo\x00T\x03-\x00\x00\x1Ep\x00t\x03-\x00\x00\x1Eq\x00U\x03$\x00\x00\x1Er\x00u\x03$\x00\x00\x1Es\x00U\x030\x00\x00\x1Et\x00u\x030\x00\x00\x1Eu\x00U\x03-\x00\x00\x1Ev\x00u\x03-\x00\x00\x1Ew\x01h\x03\x01\x00\x00\x1Ex\x01i\x03\x01\x00\x00\x1Ey\x01j\x03\b\x00\x00\x1Ez\x01k\x03\b\x00\x00\x1E{\x00V\x03\x03\x00\x00\x1E|\x00v\x03\x03\x00\x00\x1E}\x00V\x03#\x00\x00\x1E~\x00v\x03#\x00\x00\x1E\x7F\x00W\x03\x00\x00\x00\x1E\x80\x00w\x03\x00\x00\x00\x1E\x81\x00W\x03\x01\x00\x00\x1E\x82\x00w\x03\x01\x00\x00\x1E\x83\x00W\x03\b\x00\x00\x1E\x84\x00w\x03\b\x00\x00\x1E\x85\x00W\x03\x07\x00\x00\x1E\x86\x00w\x03\x07\x00\x00\x1E\x87\x00W\x03#\x00\x00\x1E\x88\x00w\x03#\x00\x00\x1E\x89\x00X\x03\x07\x00\x00\x1E\x8A\x00x\x03\x07\x00\x00\x1E\x8B\x00X\x03\b\x00\x00\x1E\x8C\x00x\x03\b\x00\x00\x1E\x8D\x00Y\x03\x07\x00\x00\x1E\x8E\x00y\x03\x07\x00\x00\x1E\x8F\x00Z\x03\x02\x00\x00\x1E\x90\x00z\x03\x02\x00\x00\x1E\x91\x00Z\x03#\x00\x00\x1E\x92\x00z\x03#\x00\x00\x1E\x93\x00Z\x031\x00\x00\x1E\x94\x00z\x031\x00\x00\x1E\x95\x00h\x031\x00\x00\x1E\x96\x00t\x03\b\x00\x00\x1E\x97\x00w\x03\n\x00\x00\x1E\x98\x00y\x03\n\x00\x00\x1E\x99\x01\x7F\x03\x07\x00\x00\x1E\x9B\x00A\x03#\x00\x00\x1E\xA0\x00a\x03#\x00\x00\x1E\xA1\x00A\x03\t\x00\x00\x1E\xA2\x00a\x03\t\x00\x00\x1E\xA3\x00\xC2\x03\x01\x00\x00\x1E\xA4\x00\xE2\x03\x01\x00\x00\x1E\xA5\x00\xC2\x03\x00\x00\x00\x1E\xA6\x00\xE2\x03\x00\x00\x00\x1E\xA7\x00\xC2\x03\t\x00\x00\x1E\xA8\x00\xE2\x03\t\x00\x00\x1E\xA9\x00\xC2\x03\x03\x00\x00\x1E\xAA\x00\xE2\x03\x03\x00\x00\x1E\xAB\x1E\xA0\x03\x02\x00\x00\x1E\xAC\x1E\xA1\x03\x02\x00\x00\x1E\xAD\x01\x02\x03\x01\x00\x00\x1E\xAE\x01\x03\x03\x01\x00\x00\x1E\xAF\x01\x02\x03\x00\x00\x00\x1E\xB0\x01\x03\x03\x00\x00\x00\x1E\xB1\x01\x02\x03\t\x00\x00\x1E\xB2\x01\x03\x03\t\x00\x00\x1E\xB3\x01\x02\x03\x03\x00\x00\x1E\xB4\x01\x03\x03\x03\x00\x00\x1E\xB5\x1E\xA0\x03\x06\x00\x00\x1E\xB6\x1E\xA1\x03\x06\x00\x00\x1E\xB7\x00E\x03#\x00\x00\x1E\xB8\x00e\x03#\x00\x00\x1E\xB9\x00E\x03\t\x00\x00\x1E\xBA\x00e\x03\t\x00\x00\x1E\xBB\x00E\x03\x03\x00\x00\x1E\xBC\x00e\x03\x03\x00\x00\x1E\xBD\x00\xCA\x03\x01\x00\x00\x1E\xBE\x00\xEA\x03\x01\x00\x00\x1E\xBF\x00\xCA\x03\x00\x00\x00\x1E\xC0\x00\xEA\x03\x00\x00\x00\x1E\xC1\x00\xCA\x03\t\x00\x00\x1E\xC2\x00\xEA\x03\t\x00\x00\x1E\xC3\x00\xCA\x03\x03\x00\x00\x1E\xC4\x00\xEA\x03\x03\x00\x00\x1E\xC5\x1E\xB8\x03\x02\x00\x00\x1E\xC6\x1E\xB9\x03\x02\x00\x00\x1E\xC7\x00I\x03\t\x00\x00\x1E\xC8\x00i\x03\t\x00\x00\x1E\xC9\x00I\x03#\x00\x00\x1E\xCA\x00i\x03#\x00\x00\x1E\xCB\x00O\x03#\x00\x00\x1E\xCC\x00o\x03#\x00\x00\x1E\xCD\x00O\x03\t\x00\x00\x1E\xCE\x00o\x03\t\x00\x00\x1E\xCF\x00\xD4\x03\x01\x00\x00\x1E\xD0\x00\xF4\x03\x01\x00\x00\x1E\xD1\x00\xD4\x03\x00\x00\x00\x1E\xD2\x00\xF4\x03\x00\x00\x00\x1E\xD3\x00\xD4\x03\t\x00\x00\x1E\xD4\x00\xF4\x03\t\x00\x00\x1E\xD5\x00\xD4\x03\x03\x00\x00\x1E\xD6\x00\xF4\x03\x03\x00\x00\x1E\xD7\x1E\xCC\x03\x02\x00\x00\x1E\xD8\x1E\xCD\x03\x02\x00\x00\x1E\xD9\x01\xA0\x03\x01\x00\x00\x1E\xDA\x01\xA1\x03\x01\x00\x00\x1E\xDB\x01\xA0\x03\x00\x00\x00\x1E\xDC\x01\xA1\x03\x00\x00\x00\x1E\xDD\x01\xA0\x03\t\x00\x00\x1E\xDE\x01\xA1\x03\t\x00\x00\x1E\xDF\x01\xA0\x03\x03\x00\x00\x1E\xE0\x01\xA1\x03\x03\x00\x00\x1E\xE1\x01\xA0\x03#\x00\x00\x1E\xE2\x01\xA1\x03#\x00\x00\x1E\xE3\x00U\x03#\x00\x00\x1E\xE4\x00u\x03#\x00\x00\x1E\xE5\x00U\x03\t\x00\x00\x1E\xE6\x00u\x03\t\x00\x00\x1E\xE7\x01\xAF\x03\x01\x00\x00\x1E\xE8\x01\xB0\x03\x01\x00\x00\x1E\xE9\x01\xAF\x03\x00\x00\x00\x1E\xEA\x01\xB0\x03\x00\x00\x00\x1E\xEB\x01\xAF\x03\t\x00\x00\x1E\xEC\x01\xB0\x03\t\x00\x00\x1E\xED\x01\xAF\x03\x03\x00\x00\x1E\xEE\x01\xB0\x03\x03\x00\x00\x1E\xEF\x01\xAF\x03#\x00\x00\x1E\xF0\x01\xB0\x03#\x00\x00\x1E\xF1\x00Y\x03\x00\x00\x00\x1E\xF2\x00y\x03\x00\x00\x00\x1E\xF3\x00Y\x03#\x00\x00\x1E\xF4\x00y\x03#\x00\x00\x1E\xF5\x00Y\x03\t\x00\x00\x1E\xF6\x00y\x03\t\x00\x00\x1E\xF7\x00Y\x03\x03\x00\x00\x1E\xF8\x00y\x03\x03\x00\x00\x1E\xF9\x03\xB1\x03\x13\x00\x00\x1F\x00\x03\xB1\x03\x14\x00\x00\x1F\x01\x1F\x00\x03\x00\x00\x00\x1F\x02\x1F\x01\x03\x00\x00\x00\x1F\x03\x1F\x00\x03\x01\x00\x00\x1F\x04\x1F\x01\x03\x01\x00\x00\x1F\x05\x1F\x00\x03B\x00\x00\x1F\x06\x1F\x01\x03B\x00\x00\x1F\x07\x03\x91\x03\x13\x00\x00\x1F\b\x03\x91\x03\x14\x00\x00\x1F\t\x1F\b\x03\x00\x00\x00\x1F\n\x1F\t\x03\x00\x00\x00\x1F\v\x1F\b\x03\x01\x00\x00\x1F\f\x1F\t\x03\x01\x00\x00\x1F\r\x1F\b\x03B\x00\x00\x1F\x0E\x1F\t\x03B\x00\x00\x1F\x0F\x03\xB5\x03\x13\x00\x00\x1F\x10\x03\xB5\x03\x14\x00\x00\x1F\x11\x1F\x10\x03\x00\x00\x00\x1F\x12\x1F\x11\x03\x00\x00\x00\x1F\x13\x1F\x10\x03\x01\x00\x00\x1F\x14\x1F\x11\x03\x01\x00\x00\x1F\x15\x03\x95\x03\x13\x00\x00\x1F\x18\x03\x95\x03\x14\x00\x00\x1F\x19\x1F\x18\x03\x00\x00\x00\x1F\x1A\x1F\x19\x03\x00\x00\x00\x1F\x1B\x1F\x18\x03\x01\x00\x00\x1F\x1C\x1F\x19\x03\x01\x00\x00\x1F\x1D\x03\xB7\x03\x13\x00\x00\x1F \x03\xB7\x03\x14\x00\x00\x1F!\x1F \x03\x00\x00\x00\x1F\"\x1F!\x03\x00\x00\x00\x1F#\x1F \x03\x01\x00\x00\x1F$\x1F!\x03\x01\x00\x00\x1F%\x1F \x03B\x00\x00\x1F&\x1F!\x03B\x00\x00\x1F'\x03\x97\x03\x13\x00\x00\x1F(\x03\x97\x03\x14\x00\x00\x1F)\x1F(\x03\x00\x00\x00\x1F*\x1F)\x03\x00\x00\x00\x1F+\x1F(\x03\x01\x00\x00\x1F,\x1F)\x03\x01\x00\x00\x1F-\x1F(\x03B\x00\x00\x1F.\x1F)\x03B\x00\x00\x1F/\x03\xB9\x03\x13\x00\x00\x1F0\x03\xB9\x03\x14\x00\x00\x1F1\x1F0\x03\x00\x00\x00\x1F2\x1F1\x03\x00\x00\x00\x1F3\x1F0\x03\x01\x00\x00\x1F4\x1F1\x03\x01\x00\x00\x1F5\x1F0\x03B\x00\x00\x1F6\x1F1\x03B\x00\x00\x1F7\x03\x99\x03\x13\x00\x00\x1F8\x03\x99\x03\x14\x00\x00\x1F9\x1F8\x03\x00\x00\x00\x1F:\x1F9\x03\x00\x00\x00\x1F;\x1F8\x03\x01\x00\x00\x1F<\x1F9\x03\x01\x00\x00\x1F=\x1F8\x03B\x00\x00\x1F>\x1F9\x03B\x00\x00\x1F?\x03\xBF\x03\x13\x00\x00\x1F@\x03\xBF\x03\x14\x00\x00\x1FA\x1F@\x03\x00\x00\x00\x1FB\x1FA\x03\x00\x00\x00\x1FC\x1F@\x03\x01\x00\x00\x1FD\x1FA\x03\x01\x00\x00\x1FE\x03\x9F\x03\x13\x00\x00\x1FH\x03\x9F\x03\x14\x00\x00\x1FI\x1FH\x03\x00\x00\x00\x1FJ\x1FI\x03\x00\x00\x00\x1FK\x1FH\x03\x01\x00\x00\x1FL\x1FI\x03\x01\x00\x00\x1FM\x03\xC5\x03\x13\x00\x00\x1FP\x03\xC5\x03\x14\x00\x00\x1FQ\x1FP\x03\x00\x00\x00\x1FR\x1FQ\x03\x00\x00\x00\x1FS\x1FP\x03\x01\x00\x00\x1FT\x1FQ\x03\x01\x00\x00\x1FU\x1FP\x03B\x00\x00\x1FV\x1FQ\x03B\x00\x00\x1FW\x03\xA5\x03\x14\x00\x00\x1FY\x1FY\x03\x00\x00\x00\x1F[\x1FY\x03\x01\x00\x00\x1F]\x1FY\x03B\x00\x00\x1F_\x03\xC9\x03\x13\x00\x00\x1F`\x03\xC9\x03\x14\x00\x00\x1Fa\x1F`\x03\x00\x00\x00\x1Fb\x1Fa\x03\x00\x00\x00\x1Fc\x1F`\x03\x01\x00\x00\x1Fd\x1Fa\x03\x01\x00\x00\x1Fe\x1F`\x03B\x00\x00\x1Ff\x1Fa\x03B\x00\x00\x1Fg\x03\xA9\x03\x13\x00\x00\x1Fh\x03\xA9\x03\x14\x00\x00\x1Fi\x1Fh\x03\x00\x00\x00\x1Fj\x1Fi\x03\x00\x00\x00\x1Fk\x1Fh\x03\x01\x00\x00\x1Fl\x1Fi\x03\x01\x00\x00\x1Fm\x1Fh\x03B\x00\x00\x1Fn\x1Fi\x03B\x00\x00\x1Fo\x03\xB1\x03\x00\x00\x00\x1Fp\x03\xB5\x03\x00\x00\x00\x1Fr\x03\xB7\x03\x00\x00\x00\x1Ft\x03\xB9\x03\x00\x00\x00\x1Fv\x03\xBF\x03\x00\x00\x00\x1Fx\x03\xC5\x03\x00\x00\x00\x1Fz\x03\xC9\x03\x00\x00\x00\x1F|\x1F\x00\x03E\x00\x00\x1F\x80\x1F\x01\x03E\x00\x00\x1F\x81\x1F\x02\x03E\x00\x00\x1F\x82\x1F\x03\x03E\x00\x00\x1F\x83\x1F\x04\x03E\x00\x00\x1F\x84\x1F\x05\x03E\x00\x00\x1F\x85\x1F\x06\x03E\x00\x00\x1F\x86\x1F\x07\x03E\x00\x00\x1F\x87\x1F\b\x03E\x00\x00\x1F\x88\x1F\t\x03E\x00\x00\x1F\x89\x1F\n\x03E\x00\x00\x1F\x8A\x1F\v\x03E\x00\x00\x1F\x8B\x1F\f\x03E\x00\x00\x1F\x8C\x1F\r\x03E\x00\x00\x1F\x8D\x1F\x0E\x03E\x00\x00\x1F\x8E\x1F\x0F\x03E\x00\x00\x1F\x8F\x1F \x03E\x00\x00\x1F\x90\x1F!\x03E\x00\x00\x1F\x91\x1F\"\x03E\x00\x00\x1F\x92\x1F#\x03E\x00\x00\x1F\x93\x1F$\x03E\x00\x00\x1F\x94\x1F%\x03E\x00\x00\x1F\x95\x1F&\x03E\x00\x00\x1F\x96\x1F'\x03E\x00\x00\x1F\x97\x1F(\x03E\x00\x00\x1F\x98\x1F)\x03E\x00\x00\x1F\x99\x1F*\x03E\x00\x00\x1F\x9A\x1F+\x03E\x00\x00\x1F\x9B\x1F,\x03E\x00\x00\x1F\x9C\x1F-\x03E\x00\x00\x1F\x9D\x1F.\x03E\x00\x00\x1F\x9E\x1F/\x03E\x00\x00\x1F\x9F\x1F`\x03E\x00\x00\x1F\xA0\x1Fa\x03E\x00\x00\x1F\xA1\x1Fb\x03E\x00\x00\x1F\xA2\x1Fc\x03E\x00\x00\x1F\xA3\x1Fd\x03E\x00\x00\x1F\xA4\x1Fe\x03E\x00\x00\x1F\xA5\x1Ff\x03E\x00\x00\x1F\xA6\x1Fg\x03E\x00\x00\x1F\xA7\x1Fh\x03E\x00\x00\x1F\xA8\x1Fi\x03E\x00\x00\x1F\xA9\x1Fj\x03E\x00\x00\x1F\xAA\x1Fk\x03E\x00\x00\x1F\xAB\x1Fl\x03E\x00\x00\x1F\xAC\x1Fm\x03E\x00\x00\x1F\xAD\x1Fn\x03E\x00\x00\x1F\xAE\x1Fo\x03E\x00\x00\x1F\xAF\x03\xB1\x03\x06\x00\x00\x1F\xB0\x03\xB1\x03\x04\x00\x00\x1F\xB1\x1Fp\x03E\x00\x00\x1F\xB2\x03\xB1\x03E\x00\x00\x1F\xB3\x03\xAC\x03E\x00\x00\x1F\xB4\x03\xB1\x03B\x00\x00\x1F\xB6\x1F\xB6\x03E\x00\x00\x1F\xB7\x03\x91\x03\x06\x00\x00\x1F\xB8\x03\x91\x03\x04\x00\x00\x1F\xB9\x03\x91\x03\x00\x00\x00\x1F\xBA\x03\x91\x03E\x00\x00\x1F\xBC\x00\xA8\x03B\x00\x00\x1F\xC1\x1Ft\x03E\x00\x00\x1F\xC2\x03\xB7\x03E\x00\x00\x1F\xC3\x03\xAE\x03E\x00\x00\x1F\xC4\x03\xB7\x03B\x00\x00\x1F\xC6\x1F\xC6\x03E\x00\x00\x1F\xC7\x03\x95\x03\x00\x00\x00\x1F\xC8\x03\x97\x03\x00\x00\x00\x1F\xCA\x03\x97\x03E\x00\x00\x1F\xCC\x1F\xBF\x03\x00\x00\x00\x1F\xCD\x1F\xBF\x03\x01\x00\x00\x1F\xCE\x1F\xBF\x03B\x00\x00\x1F\xCF\x03\xB9\x03\x06\x00\x00\x1F\xD0\x03\xB9\x03\x04\x00\x00\x1F\xD1\x03\xCA\x03\x00\x00\x00\x1F\xD2\x03\xB9\x03B\x00\x00\x1F\xD6\x03\xCA\x03B\x00\x00\x1F\xD7\x03\x99\x03\x06\x00\x00\x1F\xD8\x03\x99\x03\x04\x00\x00\x1F\xD9\x03\x99\x03\x00\x00\x00\x1F\xDA\x1F\xFE\x03\x00\x00\x00\x1F\xDD\x1F\xFE\x03\x01\x00\x00\x1F\xDE\x1F\xFE\x03B\x00\x00\x1F\xDF\x03\xC5\x03\x06\x00\x00\x1F\xE0\x03\xC5\x03\x04\x00\x00\x1F\xE1\x03\xCB\x03\x00\x00\x00\x1F\xE2\x03\xC1\x03\x13\x00\x00\x1F\xE4\x03\xC1\x03\x14\x00\x00\x1F\xE5\x03\xC5\x03B\x00\x00\x1F\xE6\x03\xCB\x03B\x00\x00\x1F\xE7\x03\xA5\x03\x06\x00\x00\x1F\xE8\x03\xA5\x03\x04\x00\x00\x1F\xE9\x03\xA5\x03\x00\x00\x00\x1F\xEA\x03\xA1\x03\x14\x00\x00\x1F\xEC\x00\xA8\x03\x00\x00\x00\x1F\xED\x1F|\x03E\x00\x00\x1F\xF2\x03\xC9\x03E\x00\x00\x1F\xF3\x03\xCE\x03E\x00\x00\x1F\xF4\x03\xC9\x03B\x00\x00\x1F\xF6\x1F\xF6\x03E\x00\x00\x1F\xF7\x03\x9F\x03\x00\x00\x00\x1F\xF8\x03\xA9\x03\x00\x00\x00\x1F\xFA\x03\xA9\x03E\x00\x00\x1F\xFC!\x90\x038\x00\x00!\x9A!\x92\x038\x00\x00!\x9B!\x94\x038\x00\x00!\xAE!\xD0\x038\x00\x00!\xCD!\xD4\x038\x00\x00!\xCE!\xD2\x038\x00\x00!\xCF\"\x03\x038\x00\x00\"\x04\"\b\x038\x00\x00\"\t\"\v\x038\x00\x00\"\f\"#\x038\x00\x00\"$\"%\x038\x00\x00\"&\"<\x038\x00\x00\"A\"C\x038\x00\x00\"D\"E\x038\x00\x00\"G\"H\x038\x00\x00\"I\x00=\x038\x00\x00\"`\"a\x038\x00\x00\"b\"M\x038\x00\x00\"m\x00<\x038\x00\x00\"n\x00>\x038\x00\x00\"o\"d\x038\x00\x00\"p\"e\x038\x00\x00\"q\"r\x038\x00\x00\"t\"s\x038\x00\x00\"u\"v\x038\x00\x00\"x\"w\x038\x00\x00\"y\"z\x038\x00\x00\"\x80\"{\x038\x00\x00\"\x81\"\x82\x038\x00\x00\"\x84\"\x83\x038\x00\x00\"\x85\"\x86\x038\x00\x00\"\x88\"\x87\x038\x00\x00\"\x89\"\xA2\x038\x00\x00\"\xAC\"\xA8\x038\x00\x00\"\xAD\"\xA9\x038\x00\x00\"\xAE\"\xAB\x038\x00\x00\"\xAF\"|\x038\x00\x00\"\xE0\"}\x038\x00\x00\"\xE1\"\x91\x038\x00\x00\"\xE2\"\x92\x038\x00\x00\"\xE3\"\xB2\x038\x00\x00\"\xEA\"\xB3\x038\x00\x00\"\xEB\"\xB4\x038\x00\x00\"\xEC\"\xB5\x038\x00\x00\"\xED0K0\x99\x00\x000L0M0\x99\x00\x000N0O0\x99\x00\x000P0Q0\x99\x00\x000R0S0\x99\x00\x000T0U0\x99\x00\x000V0W0\x99\x00\x000X0Y0\x99\x00\x000Z0[0\x99\x00\x000\\0]0\x99\x00\x000^0_0\x99\x00\x000`0a0\x99\x00\x000b0d0\x99\x00\x000e0f0\x99\x00\x000g0h0\x99\x00\x000i0o0\x99\x00\x000p0o0\x9A\x00\x000q0r0\x99\x00\x000s0r0\x9A\x00\x000t0u0\x99\x00\x000v0u0\x9A\x00\x000w0x0\x99\x00\x000y0x0\x9A\x00\x000z0{0\x99\x00\x000|0{0\x9A\x00\x000}0F0\x99\x00\x000\x940\x9D0\x99\x00\x000\x9E0\xAB0\x99\x00\x000\xAC0\xAD0\x99\x00\x000\xAE0\xAF0\x99\x00\x000\xB00\xB10\x99\x00\x000\xB20\xB30\x99\x00\x000\xB40\xB50\x99\x00\x000\xB60\xB70\x99\x00\x000\xB80\xB90\x99\x00\x000\xBA0\xBB0\x99\x00\x000\xBC0\xBD0\x99\x00\x000\xBE0\xBF0\x99\x00\x000\xC00\xC10\x99\x00\x000\xC20\xC40\x99\x00\x000\xC50\xC60\x99\x00\x000\xC70\xC80\x99\x00\x000\xC90\xCF0\x99\x00\x000\xD00\xCF0\x9A\x00\x000\xD10\xD20\x99\x00\x000\xD30\xD20\x9A\x00\x000\xD40\xD50\x99\x00\x000\xD60\xD50\x9A\x00\x000\xD70\xD80\x99\x00\x000\xD90\xD80\x9A\x00\x000\xDA0\xDB0\x99\x00\x000\xDC0\xDB0\x9A\x00\x000\xDD0\xA60\x99\x00\x000\xF40\xEF0\x99\x00\x000\xF70\xF00\x99\x00\x000\xF80\xF10\x99\x00\x000\xF90\xF20\x99\x00\x000\xFA0\xFD0\x99\x00\x000\xFE\x10\x99\x10\xBA\x00\x01\x10\x9A\x10\x9B\x10\xBA\x00\x01\x10\x9C\x10\xA5\x10\xBA\x00\x01\x10\xAB\x111\x11'\x00\x01\x11.\x112\x11'\x00\x01\x11/\x13G\x13>\x00\x01\x13K\x13G\x13W\x00\x01\x13L\x14\xB9\x14\xBA\x00\x01\x14\xBB\x14\xB9\x14\xB0\x00\x01\x14\xBC\x14\xB9\x14\xBD\x00\x01\x14\xBE\x15\xB8\x15\xAF\x00\x01\x15\xBA\x15\xB9\x15\xAF\x00\x01\x15\xBB\x195\x190\x00\x01\x198", i, (i + 8 >> 0))); key = $clone(binary.BigEndian, binary.bigEndian).Uint32($subslice(new sliceType$4(buf), 0, 4)); val = $clone(binary.BigEndian, binary.bigEndian).Uint32($subslice(new sliceType$4(buf), 4)); _key = key; (recompMap || $throwRuntimeError("assignment to entry in nil map"))[$Uint32.keyFor(_key)] = { k: _key, v: ((val >> 0)) }; i = i + (8) >> 0; } }; combine = function(a, b) { var _entry, a, b, key; key = (((((a << 16 >>> 16)) >>> 0)) << 16 >>> 0) + ((((b << 16 >>> 16)) >>> 0)) >>> 0; if (recompMap === false) { $panic(new $String("caller error")); } return (_entry = recompMap[$Uint32.keyFor(key)], _entry !== undefined ? _entry.v : 0); }; lookupInfoNFC = function(b, i) { var _tuple, b, i, sz, v; _tuple = b.charinfoNFC(i); v = _tuple[0]; sz = _tuple[1]; return compInfo(v, sz); }; lookupInfoNFKC = function(b, i) { var _tuple, b, i, sz, v; _tuple = b.charinfoNFKC(i); v = _tuple[0]; sz = _tuple[1]; return compInfo(v, sz); }; Form.prototype.Properties = function(s) { var _tuple, _tuple$1, f, s; f = this.$val; if ((f === 0) || (f === 1)) { _tuple = nfcData.lookup(s); return compInfo(_tuple[0], _tuple[1]); } _tuple$1 = nfkcData.lookup(s); return compInfo(_tuple$1[0], _tuple$1[1]); }; $ptrType(Form).prototype.Properties = function(s) { return new Form(this.$get()).Properties(s); }; Form.prototype.PropertiesString = function(s) { var _tuple, _tuple$1, f, s; f = this.$val; if ((f === 0) || (f === 1)) { _tuple = nfcData.lookupString(s); return compInfo(_tuple[0], _tuple[1]); } _tuple$1 = nfkcData.lookupString(s); return compInfo(_tuple$1[0], _tuple$1[1]); }; $ptrType(Form).prototype.PropertiesString = function(s) { return new Form(this.$get()).PropertiesString(s); }; compInfo = function(v, sz) { var c, f, h, p, p$1, sz, v, x; if (v === 0) { return new Properties.ptr(0, ((sz << 24 >>> 24)), 0, 0, 0, 0, 0); } else if (v >= 32768) { p = new Properties.ptr(0, ((sz << 24 >>> 24)), ((v << 24 >>> 24)), ((v << 24 >>> 24)), 0, (((v >>> 8 << 16 >>> 16) << 24 >>> 24)), 0); if (p.ccc > 0 || $clone(p, Properties).combinesBackward()) { p.nLead = ((((p.flags & 3) >>> 0) << 24 >>> 24)); } return p; } h = ((v < 0 || v >= decomps.length) ? ($throwRuntimeError("index out of range"), undefined) : decomps[v]); f = (((((((h & 192) >>> 0) << 24 >>> 24)) >>> 2 << 24 >>> 24)) | 4) >>> 0; p$1 = new Properties.ptr(0, ((sz << 24 >>> 24)), 0, 0, 0, f, v); if (v >= 11435) { v = v + ((((((h & 63) >>> 0) << 16 >>> 16)) + 1 << 16 >>> 16)) << 16 >>> 16; c = ((v < 0 || v >= decomps.length) ? ($throwRuntimeError("index out of range"), undefined) : decomps[v]); p$1.tccc = c >>> 2 << 24 >>> 24; p$1.flags = (p$1.flags | (((((c & 3) >>> 0) << 24 >>> 24)))) >>> 0; if (v >= 18885) { p$1.nLead = (c & 3) >>> 0; if (v >= 19126) { p$1.flags = (p$1.flags & (3)) >>> 0; p$1.index = 0; return p$1; } p$1.ccc = (x = v + 1 << 16 >>> 16, ((x < 0 || x >= decomps.length) ? ($throwRuntimeError("index out of range"), undefined) : decomps[x])); } } return p$1; }; $ptrType(streamSafe).prototype.first = function(p) { var p, ss; ss = this; ss.$set((($clone(p, Properties).nTrailingNonStarters() << 24 >>> 24))); }; $ptrType(streamSafe).prototype.next = function(p) { var n, p, ss; ss = this; if (ss.$get() > 30) { $panic(new $String("streamSafe was not reset")); } n = $clone(p, Properties).nLeadingNonStarters(); ss.$set(ss.$get() + (((n << 24 >>> 24))) << 24 >>> 24); if (ss.$get() > 30) { ss.$set(0); return 2; } if (n === 0) { ss.$set((($clone(p, Properties).nTrailingNonStarters() << 24 >>> 24))); return 1; } return 0; }; $ptrType(streamSafe).prototype.backwards = function(p) { var c, p, ss; ss = this; if (ss.$get() > 30) { $panic(new $String("streamSafe was not reset")); } c = ss.$get() + (($clone(p, Properties).nTrailingNonStarters() << 24 >>> 24)) << 24 >>> 24; if (c > 30) { return 2; } ss.$set(c); if ($clone(p, Properties).nLeadingNonStarters() === 0) { return 1; } return 0; }; streamSafe.prototype.isMax = function() { var ss; ss = this.$val; return ss === 30; }; $ptrType(streamSafe).prototype.isMax = function() { return new streamSafe(this.$get()).isMax(); }; reorderBuffer.ptr.prototype.init = function(f, src) { var f, rb, src; rb = this; formInfo.copy(rb.f, ((f < 0 || f >= formTable.$length) ? ($throwRuntimeError("index out of range"), undefined) : formTable.$array[formTable.$offset + f])); rb.src.setBytes(src); rb.nsrc = src.$length; rb.ss = 0; }; reorderBuffer.prototype.init = function(f, src) { return this.$val.init(f, src); }; reorderBuffer.ptr.prototype.initString = function(f, src) { var f, rb, src; rb = this; formInfo.copy(rb.f, ((f < 0 || f >= formTable.$length) ? ($throwRuntimeError("index out of range"), undefined) : formTable.$array[formTable.$offset + f])); rb.src.setString(src); rb.nsrc = src.length; rb.ss = 0; }; reorderBuffer.prototype.initString = function(f, src) { return this.$val.initString(f, src); }; reorderBuffer.ptr.prototype.setFlusher = function(out, f) { var f, out, rb; rb = this; rb.out = out; rb.flushF = f; }; reorderBuffer.prototype.setFlusher = function(out, f) { return this.$val.setFlusher(out, f); }; reorderBuffer.ptr.prototype.reset = function() { var rb; rb = this; rb.nrune = 0; rb.nbyte = 0; }; reorderBuffer.prototype.reset = function() { return this.$val.reset(); }; reorderBuffer.ptr.prototype.doFlush = function() { var _r, rb, res, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; rb = $f.rb; res = $f.res; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rb = this; /* */ if (rb.f.composing) { $s = 1; continue; } /* */ $s = 2; continue; /* if (rb.f.composing) { */ case 1: $r = rb.compose(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: _r = rb.flushF(rb); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } res = _r; rb.reset(); $s = -1; return res; /* */ } return; } if ($f === undefined) { $f = { $blk: reorderBuffer.ptr.prototype.doFlush }; } $f._r = _r; $f.rb = rb; $f.res = res; $f.$s = $s; $f.$r = $r; return $f; }; reorderBuffer.prototype.doFlush = function() { return this.$val.doFlush(); }; appendFlush = function(rb) { var end, i, rb, start, x, x$1; i = 0; while (true) { if (!(i < rb.nrune)) { break; } start = (x = rb.rune, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i])).pos; end = start + (x$1 = rb.rune, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i])).size << 24 >>> 24; rb.out = $appendSlice(rb.out, $subslice(new sliceType$4(rb.byte$1), start, end)); i = i + (1) >> 0; } return true; }; reorderBuffer.ptr.prototype.flushCopy = function(buf) { var buf, i, p, rb, runep, x; rb = this; p = 0; i = 0; while (true) { if (!(i < rb.nrune)) { break; } runep = $clone((x = rb.rune, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i])), Properties); p = p + ($copySlice($subslice(buf, p), $subslice(new sliceType$4(rb.byte$1), runep.pos, (runep.pos + runep.size << 24 >>> 24)))) >> 0; i = i + (1) >> 0; } rb.reset(); return p; }; reorderBuffer.prototype.flushCopy = function(buf) { return this.$val.flushCopy(buf); }; reorderBuffer.ptr.prototype.insertOrdered = function(info) { var b, cc, info, n, pos, rb, x, x$1; rb = this; n = rb.nrune; b = new sliceType$6(rb.rune); cc = info.ccc; if (cc > 0) { while (true) { if (!(n > 0)) { break; } if ((x = n - 1 >> 0, ((x < 0 || x >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + x])).ccc <= cc) { break; } Properties.copy(((n < 0 || n >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + n]), (x$1 = n - 1 >> 0, ((x$1 < 0 || x$1 >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + x$1]))); n = n - (1) >> 0; } } rb.nrune = rb.nrune + (1) >> 0; pos = (rb.nbyte); rb.nbyte = rb.nbyte + (4) << 24 >>> 24; info.pos = pos; Properties.copy(((n < 0 || n >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + n]), info); }; reorderBuffer.prototype.insertOrdered = function(info) { return this.$val.insertOrdered(info); }; reorderBuffer.ptr.prototype.insertFlush = function(src, i, info) { var $24r, _r, i, info, rb, rune, src, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; i = $f.i; info = $f.info; rb = $f.rb; rune = $f.rune; src = $f.src; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rb = this; rune = src.hangul(i); if (!((rune === 0))) { rb.decomposeHangul(rune); $s = -1; return 0; } /* */ if ($clone(info, Properties).hasDecomposition()) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($clone(info, Properties).hasDecomposition()) { */ case 1: _r = rb.insertDecomposed($clone(info, Properties).Decomposition()); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 4; case 4: return $24r; /* } */ case 2: rb.insertSingle($clone(src, input), i, $clone(info, Properties)); $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: reorderBuffer.ptr.prototype.insertFlush }; } $f.$24r = $24r; $f._r = _r; $f.i = i; $f.info = info; $f.rb = rb; $f.rune = rune; $f.src = src; $f.$s = $s; $f.$r = $r; return $f; }; reorderBuffer.prototype.insertFlush = function(src, i, info) { return this.$val.insertFlush(src, i, info); }; reorderBuffer.ptr.prototype.insertUnsafe = function(src, i, info) { var _r, i, info, rb, rune, src, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; i = $f.i; info = $f.info; rb = $f.rb; rune = $f.rune; src = $f.src; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rb = this; rune = src.hangul(i); if (!((rune === 0))) { rb.decomposeHangul(rune); } /* */ if ($clone(info, Properties).hasDecomposition()) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($clone(info, Properties).hasDecomposition()) { */ case 1: _r = rb.insertDecomposed($clone(info, Properties).Decomposition()); /* */ $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: rb.insertSingle($clone(src, input), i, $clone(info, Properties)); /* } */ case 3: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: reorderBuffer.ptr.prototype.insertUnsafe }; } $f._r = _r; $f.i = i; $f.info = info; $f.rb = rb; $f.rune = rune; $f.src = src; $f.$s = $s; $f.$r = $r; return $f; }; reorderBuffer.prototype.insertUnsafe = function(src, i, info) { return this.$val.insertUnsafe(src, i, info); }; reorderBuffer.ptr.prototype.insertDecomposed = function(dcomp) { var _r, _r$1, _v, dcomp, i, info, rb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _v = $f._v; dcomp = $f.dcomp; i = $f.i; info = $f.info; rb = $f.rb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rb = this; rb.tmpBytes.setBytes(dcomp); i = 0; /* while (true) { */ case 1: /* if (!(i < dcomp.$length)) { break; } */ if(!(i < dcomp.$length)) { $s = 2; continue; } _r = rb.f.info($clone(rb.tmpBytes, input), i); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } info = $clone(_r, Properties); if (!($clone(info, Properties).BoundaryBefore() && rb.nrune > 0)) { _v = false; $s = 6; continue s; } _r$1 = rb.doFlush(); /* */ $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: $s = -1; return -1; /* } */ case 5: i = i + ($copySlice($subslice(new sliceType$4(rb.byte$1), rb.nbyte), $subslice(dcomp, i, (i + ((info.size >> 0)) >> 0)))) >> 0; rb.insertOrdered($clone(info, Properties)); $s = 1; continue; case 2: $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: reorderBuffer.ptr.prototype.insertDecomposed }; } $f._r = _r; $f._r$1 = _r$1; $f._v = _v; $f.dcomp = dcomp; $f.i = i; $f.info = info; $f.rb = rb; $f.$s = $s; $f.$r = $r; return $f; }; reorderBuffer.prototype.insertDecomposed = function(dcomp) { return this.$val.insertDecomposed(dcomp); }; reorderBuffer.ptr.prototype.insertSingle = function(src, i, info) { var i, info, rb, src; rb = this; src.copySlice($subslice(new sliceType$4(rb.byte$1), rb.nbyte), i, i + ((info.size >> 0)) >> 0); rb.insertOrdered($clone(info, Properties)); }; reorderBuffer.prototype.insertSingle = function(src, i, info) { return this.$val.insertSingle(src, i, info); }; reorderBuffer.ptr.prototype.insertCGJ = function() { var rb; rb = this; rb.insertSingle(new input.ptr("\xCD\x8F", sliceType$4.nil), 0, new Properties.ptr(0, 2, 0, 0, 0, 0, 0)); }; reorderBuffer.prototype.insertCGJ = function() { return this.$val.insertCGJ(); }; reorderBuffer.ptr.prototype.appendRune = function(r) { var bn, r, rb, sz, x, x$1; rb = this; bn = rb.nbyte; sz = utf8.EncodeRune($subslice(new sliceType$4(rb.byte$1), bn), (r)); rb.nbyte = rb.nbyte + (4) << 24 >>> 24; Properties.copy((x = rb.rune, x$1 = rb.nrune, ((x$1 < 0 || x$1 >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[x$1])), new Properties.ptr(bn, ((sz << 24 >>> 24)), 0, 0, 0, 0, 0)); rb.nrune = rb.nrune + (1) >> 0; }; reorderBuffer.prototype.appendRune = function(r) { return this.$val.appendRune(r); }; reorderBuffer.ptr.prototype.assignRune = function(pos, r) { var bn, pos, r, rb, sz, x, x$1; rb = this; bn = (x = rb.rune, ((pos < 0 || pos >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[pos])).pos; sz = utf8.EncodeRune($subslice(new sliceType$4(rb.byte$1), bn), (r)); Properties.copy((x$1 = rb.rune, ((pos < 0 || pos >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[pos])), new Properties.ptr(bn, ((sz << 24 >>> 24)), 0, 0, 0, 0, 0)); }; reorderBuffer.prototype.assignRune = function(pos, r) { return this.$val.assignRune(pos, r); }; reorderBuffer.ptr.prototype.runeAt = function(n) { var _tuple, inf, n, r, rb, x; rb = this; inf = $clone((x = rb.rune, ((n < 0 || n >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[n])), Properties); _tuple = utf8.DecodeRune($subslice(new sliceType$4(rb.byte$1), inf.pos, (inf.pos + inf.size << 24 >>> 24))); r = _tuple[0]; return r; }; reorderBuffer.prototype.runeAt = function(n) { return this.$val.runeAt(n); }; reorderBuffer.ptr.prototype.bytesAt = function(n) { var inf, n, rb, x; rb = this; inf = $clone((x = rb.rune, ((n < 0 || n >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[n])), Properties); return $subslice(new sliceType$4(rb.byte$1), inf.pos, (((inf.pos >> 0)) + ((inf.size >> 0)) >> 0)); }; reorderBuffer.prototype.bytesAt = function(n) { return this.$val.bytesAt(n); }; isHangul = function(b) { var b, b0, b1; if (b.$length < 3) { return false; } b0 = (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]); if (b0 < 234) { return false; } b1 = (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]); if ((b0 === 234)) { return b1 >= 176; } else if (b0 < 237) { return true; } else if (b0 > 237) { return false; } else if (b1 < 158) { return true; } return (b1 === 158) && (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]) < 164; }; isHangulString = function(b) { var b, b0, b1; if (b.length < 3) { return false; } b0 = b.charCodeAt(0); if (b0 < 234) { return false; } b1 = b.charCodeAt(1); if ((b0 === 234)) { return b1 >= 176; } else if (b0 < 237) { return true; } else if (b0 > 237) { return false; } else if (b1 < 158) { return true; } return (b1 === 158) && b.charCodeAt(2) < 164; }; isJamoVT = function(b) { var b; return ((0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]) === 225) && (((((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]) & 252) >>> 0)) === 132); }; decomposeHangul = function(buf, r) { var _q, _q$1, _r, _r$1, buf, r, x; r = r - (44032) >> 0; x = (_r = r % 28, _r === _r ? _r : $throwRuntimeError("integer divide by zero")); r = (_q = r / (28), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); utf8.EncodeRune(buf, 4352 + (_q$1 = r / 21, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")) >> 0); utf8.EncodeRune($subslice(buf, 3), 4449 + (_r$1 = r % 21, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) >> 0); if (!((x === 0))) { utf8.EncodeRune($subslice(buf, 6), 4519 + x >> 0); return 9; } return 6; }; reorderBuffer.ptr.prototype.decomposeHangul = function(r) { var _q, _q$1, _r, _r$1, r, rb, x; rb = this; r = r - (44032) >> 0; x = (_r = r % 28, _r === _r ? _r : $throwRuntimeError("integer divide by zero")); r = (_q = r / (28), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); rb.appendRune(4352 + (_q$1 = r / 21, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")) >> 0); rb.appendRune(4449 + (_r$1 = r % 21, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) >> 0); if (!((x === 0))) { rb.appendRune(4519 + x >> 0); } }; reorderBuffer.prototype.decomposeHangul = function(r) { return this.$val.decomposeHangul(r); }; reorderBuffer.ptr.prototype.combineHangul = function(s, i, k) { var _r, b, bn, cccB, cccC, i, k, l, rb, s, v, x; rb = this; b = new sliceType$6(rb.rune); bn = rb.nrune; while (true) { if (!(i < bn)) { break; } cccB = (x = k - 1 >> 0, ((x < 0 || x >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + x])).ccc; cccC = ((i < 0 || i >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + i]).ccc; if (cccB === 0) { s = k - 1 >> 0; } if (!((s === (k - 1 >> 0))) && cccB >= cccC) { Properties.copy(((k < 0 || k >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + k]), ((i < 0 || i >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + i])); k = k + (1) >> 0; } else { l = rb.runeAt(s); v = rb.runeAt(i); if (4352 <= l && l < 4371 && 4449 <= v && v < 4470) { rb.assignRune(s, (44032 + ($imul(((l - 4352 >> 0)), 588)) >> 0) + ($imul(((v - 4449 >> 0)), 28)) >> 0); } else if (44032 <= l && l < 55204 && 4519 < v && v < 4547 && (((_r = ((l - 44032 >> 0)) % 28, _r === _r ? _r : $throwRuntimeError("integer divide by zero"))) === 0)) { rb.assignRune(s, (l + v >> 0) - 4519 >> 0); } else { Properties.copy(((k < 0 || k >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + k]), ((i < 0 || i >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + i])); k = k + (1) >> 0; } } i = i + (1) >> 0; } rb.nrune = k; }; reorderBuffer.prototype.combineHangul = function(s, i, k) { return this.$val.combineHangul(s, i, k); }; reorderBuffer.ptr.prototype.compose = function() { var _tmp, _tmp$1, b, blocked, bn, cccB, cccC, combined, i, ii, k, rb, s, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; b = $f.b; blocked = $f.blocked; bn = $f.bn; cccB = $f.cccB; cccC = $f.cccC; combined = $f.combined; i = $f.i; ii = $f.ii; k = $f.k; rb = $f.rb; s = $f.s; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rb = this; $r = recompMapOnce.Do(buildRecompMap); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } bn = rb.nrune; if (bn === 0) { $s = -1; return; } k = 1; b = new sliceType$6(rb.rune); _tmp = 0; _tmp$1 = 1; s = _tmp; i = _tmp$1; while (true) { if (!(i < bn)) { break; } if (isJamoVT(rb.bytesAt(i))) { rb.combineHangul(s, i, k); $s = -1; return; } ii = $clone(((i < 0 || i >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + i]), Properties); if ($clone(ii, Properties).combinesBackward()) { cccB = (x = k - 1 >> 0, ((x < 0 || x >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + x])).ccc; cccC = ii.ccc; blocked = false; if (cccB === 0) { s = k - 1 >> 0; } else { blocked = !((s === (k - 1 >> 0))) && cccB >= cccC; } if (!blocked) { combined = combine(rb.runeAt(s), rb.runeAt(i)); if (!((combined === 0))) { rb.assignRune(s, combined); i = i + (1) >> 0; continue; } } } Properties.copy(((k < 0 || k >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + k]), ((i < 0 || i >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + i])); k = k + (1) >> 0; i = i + (1) >> 0; } rb.nrune = k; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: reorderBuffer.ptr.prototype.compose }; } $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.b = b; $f.blocked = blocked; $f.bn = bn; $f.cccB = cccB; $f.cccC = cccC; $f.combined = combined; $f.i = i; $f.ii = ii; $f.k = k; $f.rb = rb; $f.s = s; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; reorderBuffer.prototype.compose = function() { return this.$val.compose(); }; ptrType$2.methods = [{prop: "lookup", name: "lookup", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([$Uint32, $Uint8], [$Uint16], false)}]; ptrType$3.methods = [{prop: "lookup", name: "lookup", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([sliceType$4], [$Uint16, $Int], false)}, {prop: "lookupUnsafe", name: "lookupUnsafe", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([sliceType$4], [$Uint16], false)}, {prop: "lookupString", name: "lookupString", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([$String], [$Uint16, $Int], false)}, {prop: "lookupStringUnsafe", name: "lookupStringUnsafe", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([$String], [$Uint16], false)}, {prop: "lookupValue", name: "lookupValue", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([$Uint32, $Uint8], [$Uint16], false)}]; ptrType$4.methods = [{prop: "lookup", name: "lookup", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([sliceType$4], [$Uint16, $Int], false)}, {prop: "lookupUnsafe", name: "lookupUnsafe", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([sliceType$4], [$Uint16], false)}, {prop: "lookupString", name: "lookupString", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([$String], [$Uint16, $Int], false)}, {prop: "lookupStringUnsafe", name: "lookupStringUnsafe", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([$String], [$Uint16], false)}, {prop: "lookupValue", name: "lookupValue", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([$Uint32, $Uint8], [$Uint16], false)}]; ptrType$5.methods = [{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$4], [$Int, $error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}]; ptrType$6.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$4], [$Int, $error], false)}]; Form.methods = [{prop: "Reset", name: "Reset", pkg: "", typ: $funcType([], [], false)}, {prop: "Transform", name: "Transform", pkg: "", typ: $funcType([sliceType$4, sliceType$4, $Bool], [$Int, $Int, $error], false)}, {prop: "transform", name: "transform", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([sliceType$4, sliceType$4, $Bool], [$Int, $Int, $error], false)}, {prop: "Writer", name: "Writer", pkg: "", typ: $funcType([io.Writer], [io.WriteCloser], false)}, {prop: "Reader", name: "Reader", pkg: "", typ: $funcType([io.Reader], [io.Reader], false)}, {prop: "Bytes", name: "Bytes", pkg: "", typ: $funcType([sliceType$4], [sliceType$4], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([$String], [$String], false)}, {prop: "IsNormal", name: "IsNormal", pkg: "", typ: $funcType([sliceType$4], [$Bool], false)}, {prop: "IsNormalString", name: "IsNormalString", pkg: "", typ: $funcType([$String], [$Bool], false)}, {prop: "Append", name: "Append", pkg: "", typ: $funcType([sliceType$4, sliceType$4], [sliceType$4], true)}, {prop: "doAppend", name: "doAppend", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([sliceType$4, input, $Int], [sliceType$4], false)}, {prop: "AppendString", name: "AppendString", pkg: "", typ: $funcType([sliceType$4, $String], [sliceType$4], false)}, {prop: "QuickSpan", name: "QuickSpan", pkg: "", typ: $funcType([sliceType$4], [$Int], false)}, {prop: "Span", name: "Span", pkg: "", typ: $funcType([sliceType$4, $Bool], [$Int, $error], false)}, {prop: "SpanString", name: "SpanString", pkg: "", typ: $funcType([$String, $Bool], [$Int, $error], false)}, {prop: "QuickSpanString", name: "QuickSpanString", pkg: "", typ: $funcType([$String], [$Int], false)}, {prop: "FirstBoundary", name: "FirstBoundary", pkg: "", typ: $funcType([sliceType$4], [$Int], false)}, {prop: "firstBoundary", name: "firstBoundary", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([input, $Int], [$Int], false)}, {prop: "FirstBoundaryInString", name: "FirstBoundaryInString", pkg: "", typ: $funcType([$String], [$Int], false)}, {prop: "NextBoundary", name: "NextBoundary", pkg: "", typ: $funcType([sliceType$4, $Bool], [$Int], false)}, {prop: "NextBoundaryInString", name: "NextBoundaryInString", pkg: "", typ: $funcType([$String, $Bool], [$Int], false)}, {prop: "nextBoundary", name: "nextBoundary", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([input, $Int, $Bool], [$Int], false)}, {prop: "LastBoundary", name: "LastBoundary", pkg: "", typ: $funcType([sliceType$4], [$Int], false)}, {prop: "Properties", name: "Properties", pkg: "", typ: $funcType([sliceType$4], [Properties], false)}, {prop: "PropertiesString", name: "PropertiesString", pkg: "", typ: $funcType([$String], [Properties], false)}]; ptrType$7.methods = [{prop: "Init", name: "Init", pkg: "", typ: $funcType([Form, sliceType$4], [], false)}, {prop: "InitString", name: "InitString", pkg: "", typ: $funcType([Form, $String], [], false)}, {prop: "Seek", name: "Seek", pkg: "", typ: $funcType([$Int64, $Int], [$Int64, $error], false)}, {prop: "returnSlice", name: "returnSlice", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([$Int, $Int], [sliceType$4], false)}, {prop: "Pos", name: "Pos", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "setDone", name: "setDone", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([], [], false)}, {prop: "Done", name: "Done", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Next", name: "Next", pkg: "", typ: $funcType([], [sliceType$4], false)}]; ptrType$8.methods = [{prop: "setBytes", name: "setBytes", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([sliceType$4], [], false)}, {prop: "setString", name: "setString", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([$String], [], false)}, {prop: "_byte", name: "_byte", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([$Int], [$Uint8], false)}, {prop: "skipASCII", name: "skipASCII", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([$Int, $Int], [$Int], false)}, {prop: "skipContinuationBytes", name: "skipContinuationBytes", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([$Int], [$Int], false)}, {prop: "appendSlice", name: "appendSlice", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([sliceType$4, $Int, $Int], [sliceType$4], false)}, {prop: "copySlice", name: "copySlice", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([sliceType$4, $Int, $Int], [$Int], false)}, {prop: "charinfoNFC", name: "charinfoNFC", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([$Int], [$Uint16, $Int], false)}, {prop: "charinfoNFKC", name: "charinfoNFKC", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([$Int], [$Uint16, $Int], false)}, {prop: "hangul", name: "hangul", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([$Int], [$Int32], false)}]; Properties.methods = [{prop: "BoundaryBefore", name: "BoundaryBefore", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "BoundaryAfter", name: "BoundaryAfter", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "isYesC", name: "isYesC", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([], [$Bool], false)}, {prop: "isYesD", name: "isYesD", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([], [$Bool], false)}, {prop: "combinesForward", name: "combinesForward", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([], [$Bool], false)}, {prop: "combinesBackward", name: "combinesBackward", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([], [$Bool], false)}, {prop: "hasDecomposition", name: "hasDecomposition", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([], [$Bool], false)}, {prop: "isInert", name: "isInert", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([], [$Bool], false)}, {prop: "multiSegment", name: "multiSegment", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([], [$Bool], false)}, {prop: "nLeadingNonStarters", name: "nLeadingNonStarters", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([], [$Uint8], false)}, {prop: "nTrailingNonStarters", name: "nTrailingNonStarters", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([], [$Uint8], false)}, {prop: "Decomposition", name: "Decomposition", pkg: "", typ: $funcType([], [sliceType$4], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "CCC", name: "CCC", pkg: "", typ: $funcType([], [$Uint8], false)}, {prop: "LeadCCC", name: "LeadCCC", pkg: "", typ: $funcType([], [$Uint8], false)}, {prop: "TrailCCC", name: "TrailCCC", pkg: "", typ: $funcType([], [$Uint8], false)}]; ptrType.methods = [{prop: "quickSpan", name: "quickSpan", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([input, $Int, $Int, $Bool], [$Int, $Bool], false)}]; streamSafe.methods = [{prop: "isMax", name: "isMax", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([], [$Bool], false)}]; ptrType$1.methods = [{prop: "first", name: "first", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([Properties], [], false)}, {prop: "next", name: "next", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([Properties], [ssState], false)}, {prop: "backwards", name: "backwards", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([Properties], [ssState], false)}]; ptrType$9.methods = [{prop: "init", name: "init", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([Form, sliceType$4], [], false)}, {prop: "initString", name: "initString", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([Form, $String], [], false)}, {prop: "setFlusher", name: "setFlusher", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([sliceType$4, funcType], [], false)}, {prop: "reset", name: "reset", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([], [], false)}, {prop: "doFlush", name: "doFlush", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([], [$Bool], false)}, {prop: "flush", name: "flush", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([sliceType$4], [sliceType$4], false)}, {prop: "flushCopy", name: "flushCopy", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([sliceType$4], [$Int], false)}, {prop: "insertOrdered", name: "insertOrdered", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([Properties], [], false)}, {prop: "insertFlush", name: "insertFlush", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([input, $Int, Properties], [insertErr], false)}, {prop: "insertUnsafe", name: "insertUnsafe", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([input, $Int, Properties], [], false)}, {prop: "insertDecomposed", name: "insertDecomposed", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([sliceType$4], [insertErr], false)}, {prop: "insertSingle", name: "insertSingle", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([input, $Int, Properties], [], false)}, {prop: "insertCGJ", name: "insertCGJ", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([], [], false)}, {prop: "appendRune", name: "appendRune", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([$Int32], [], false)}, {prop: "assignRune", name: "assignRune", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([$Int, $Int32], [], false)}, {prop: "runeAt", name: "runeAt", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([$Int], [$Int32], false)}, {prop: "bytesAt", name: "bytesAt", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([$Int], [sliceType$4], false)}, {prop: "decomposeHangul", name: "decomposeHangul", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([$Int32], [], false)}, {prop: "combineHangul", name: "combineHangul", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([$Int, $Int, $Int], [], false)}, {prop: "compose", name: "compose", pkg: "vendor/golang.org/x/text/unicode/norm", typ: $funcType([], [], false)}]; valueRange.init("vendor/golang.org/x/text/unicode/norm", [{prop: "value", name: "value", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "lo", name: "lo", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "hi", name: "hi", embedded: false, exported: false, typ: $Uint8, tag: ""}]); sparseBlocks.init("vendor/golang.org/x/text/unicode/norm", [{prop: "values", name: "values", embedded: false, exported: false, typ: sliceType$2, tag: ""}, {prop: "offset", name: "offset", embedded: false, exported: false, typ: sliceType$1, tag: ""}]); nfcTrie.init("", []); nfkcTrie.init("", []); normWriter.init("vendor/golang.org/x/text/unicode/norm", [{prop: "rb", name: "rb", embedded: false, exported: false, typ: reorderBuffer, tag: ""}, {prop: "w", name: "w", embedded: false, exported: false, typ: io.Writer, tag: ""}, {prop: "buf", name: "buf", embedded: false, exported: false, typ: sliceType$4, tag: ""}]); normReader.init("vendor/golang.org/x/text/unicode/norm", [{prop: "rb", name: "rb", embedded: false, exported: false, typ: reorderBuffer, tag: ""}, {prop: "r", name: "r", embedded: false, exported: false, typ: io.Reader, tag: ""}, {prop: "inbuf", name: "inbuf", embedded: false, exported: false, typ: sliceType$4, tag: ""}, {prop: "outbuf", name: "outbuf", embedded: false, exported: false, typ: sliceType$4, tag: ""}, {prop: "bufStart", name: "bufStart", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "lastBoundary", name: "lastBoundary", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}]); Iter.init("vendor/golang.org/x/text/unicode/norm", [{prop: "rb", name: "rb", embedded: false, exported: false, typ: reorderBuffer, tag: ""}, {prop: "buf", name: "buf", embedded: false, exported: false, typ: arrayType$1, tag: ""}, {prop: "info", name: "info", embedded: false, exported: false, typ: Properties, tag: ""}, {prop: "next", name: "next", embedded: false, exported: false, typ: iterFunc, tag: ""}, {prop: "asciiF", name: "asciiF", embedded: false, exported: false, typ: iterFunc, tag: ""}, {prop: "p", name: "p", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "multiSeg", name: "multiSeg", embedded: false, exported: false, typ: sliceType$4, tag: ""}]); iterFunc.init([ptrType$7], [sliceType$4], false); input.init("vendor/golang.org/x/text/unicode/norm", [{prop: "str", name: "str", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "bytes", name: "bytes", embedded: false, exported: false, typ: sliceType$4, tag: ""}]); Properties.init("vendor/golang.org/x/text/unicode/norm", [{prop: "pos", name: "pos", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "size", name: "size", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "ccc", name: "ccc", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "tccc", name: "tccc", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "nLead", name: "nLead", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "flags", name: "flags", embedded: false, exported: false, typ: qcInfo, tag: ""}, {prop: "index", name: "index", embedded: false, exported: false, typ: $Uint16, tag: ""}]); lookupFunc.init([input, $Int], [Properties], false); formInfo.init("vendor/golang.org/x/text/unicode/norm", [{prop: "form", name: "form", embedded: false, exported: false, typ: Form, tag: ""}, {prop: "composing", name: "composing", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "compatibility", name: "compatibility", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "info", name: "info", embedded: false, exported: false, typ: lookupFunc, tag: ""}, {prop: "nextMain", name: "nextMain", embedded: false, exported: false, typ: iterFunc, tag: ""}]); reorderBuffer.init("vendor/golang.org/x/text/unicode/norm", [{prop: "rune", name: "rune", embedded: false, exported: false, typ: arrayType, tag: ""}, {prop: "byte$1", name: "byte", embedded: false, exported: false, typ: arrayType$1, tag: ""}, {prop: "nbyte", name: "nbyte", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "ss", name: "ss", embedded: false, exported: false, typ: streamSafe, tag: ""}, {prop: "nrune", name: "nrune", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "f", name: "f", embedded: false, exported: false, typ: formInfo, tag: ""}, {prop: "src", name: "src", embedded: false, exported: false, typ: input, tag: ""}, {prop: "nsrc", name: "nsrc", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "tmpBytes", name: "tmpBytes", embedded: false, exported: false, typ: input, tag: ""}, {prop: "out", name: "out", embedded: false, exported: false, typ: sliceType$4, tag: ""}, {prop: "flushF", name: "flushF", embedded: false, exported: false, typ: funcType, 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 = binary.$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 = sync.$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; } $r = transform.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } recompMap = false; recompMapOnce = new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)); nfcData = newNfcTrie(0); nfkcData = newNfkcTrie(0); errs = new sliceType([$ifaceNil, transform.ErrShortDst, transform.ErrShortSrc]); ccc = $toNativeArray($kindUint8, [0, 1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 84, 91, 103, 107, 118, 122, 129, 130, 132, 202, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 233, 234, 240]); decomps = $toNativeArray($kindUint8, [0, 65, 32, 65, 33, 65, 34, 65, 35, 65, 36, 65, 37, 65, 38, 65, 39, 65, 40, 65, 41, 65, 42, 65, 43, 65, 44, 65, 45, 65, 46, 65, 47, 65, 48, 65, 49, 65, 50, 65, 51, 65, 52, 65, 53, 65, 54, 65, 55, 65, 56, 65, 57, 65, 58, 65, 59, 65, 60, 65, 61, 65, 62, 65, 63, 65, 64, 65, 65, 65, 66, 65, 67, 65, 68, 65, 69, 65, 70, 65, 71, 65, 72, 65, 73, 65, 74, 65, 75, 65, 76, 65, 77, 65, 78, 65, 79, 65, 80, 65, 81, 65, 82, 65, 83, 65, 84, 65, 85, 65, 86, 65, 87, 65, 88, 65, 89, 65, 90, 65, 91, 65, 92, 65, 93, 65, 94, 65, 95, 65, 96, 65, 97, 65, 98, 65, 99, 65, 100, 65, 101, 65, 102, 65, 103, 65, 104, 65, 105, 65, 106, 65, 107, 65, 108, 65, 109, 65, 110, 65, 111, 65, 112, 65, 113, 65, 114, 65, 115, 65, 116, 65, 117, 65, 118, 65, 119, 65, 120, 65, 121, 65, 122, 65, 123, 65, 124, 65, 125, 65, 126, 66, 194, 162, 66, 194, 163, 66, 194, 165, 66, 194, 166, 66, 194, 172, 66, 194, 183, 66, 195, 134, 66, 195, 176, 66, 196, 166, 66, 196, 167, 66, 196, 177, 66, 197, 139, 66, 197, 147, 66, 198, 142, 66, 198, 144, 66, 198, 171, 66, 200, 162, 66, 200, 183, 66, 201, 144, 66, 201, 145, 66, 201, 146, 66, 201, 148, 66, 201, 149, 66, 201, 153, 66, 201, 155, 66, 201, 156, 66, 201, 159, 66, 201, 161, 66, 201, 163, 66, 201, 165, 66, 201, 166, 66, 201, 168, 66, 201, 169, 66, 201, 170, 66, 201, 171, 66, 201, 173, 66, 201, 175, 66, 201, 176, 66, 201, 177, 66, 201, 178, 66, 201, 179, 66, 201, 180, 66, 201, 181, 66, 201, 184, 66, 201, 185, 66, 201, 187, 66, 202, 129, 66, 202, 130, 66, 202, 131, 66, 202, 137, 66, 202, 138, 66, 202, 139, 66, 202, 140, 66, 202, 141, 66, 202, 144, 66, 202, 145, 66, 202, 146, 66, 202, 149, 66, 202, 157, 66, 202, 159, 66, 202, 185, 66, 206, 145, 66, 206, 146, 66, 206, 147, 66, 206, 148, 66, 206, 149, 66, 206, 150, 66, 206, 151, 66, 206, 152, 66, 206, 153, 66, 206, 154, 66, 206, 155, 66, 206, 156, 66, 206, 157, 66, 206, 158, 66, 206, 159, 66, 206, 160, 66, 206, 161, 66, 206, 163, 66, 206, 164, 66, 206, 165, 66, 206, 166, 66, 206, 167, 66, 206, 168, 66, 206, 169, 66, 206, 177, 66, 206, 178, 66, 206, 179, 66, 206, 180, 66, 206, 181, 66, 206, 182, 66, 206, 183, 66, 206, 184, 66, 206, 185, 66, 206, 186, 66, 206, 187, 66, 206, 188, 66, 206, 189, 66, 206, 190, 66, 206, 191, 66, 207, 128, 66, 207, 129, 66, 207, 130, 66, 207, 131, 66, 207, 132, 66, 207, 133, 66, 207, 134, 66, 207, 135, 66, 207, 136, 66, 207, 137, 66, 207, 156, 66, 207, 157, 66, 208, 189, 66, 209, 138, 66, 209, 140, 66, 215, 144, 66, 215, 145, 66, 215, 146, 66, 215, 147, 66, 215, 148, 66, 215, 155, 66, 215, 156, 66, 215, 157, 66, 215, 162, 66, 215, 168, 66, 215, 170, 66, 216, 161, 66, 216, 167, 66, 216, 168, 66, 216, 169, 66, 216, 170, 66, 216, 171, 66, 216, 172, 66, 216, 173, 66, 216, 174, 66, 216, 175, 66, 216, 176, 66, 216, 177, 66, 216, 178, 66, 216, 179, 66, 216, 180, 66, 216, 181, 66, 216, 182, 66, 216, 183, 66, 216, 184, 66, 216, 185, 66, 216, 186, 66, 217, 129, 66, 217, 130, 66, 217, 131, 66, 217, 132, 66, 217, 133, 66, 217, 134, 66, 217, 135, 66, 217, 136, 66, 217, 137, 66, 217, 138, 66, 217, 174, 66, 217, 175, 66, 217, 177, 66, 217, 185, 66, 217, 186, 66, 217, 187, 66, 217, 190, 66, 217, 191, 66, 218, 128, 66, 218, 131, 66, 218, 132, 66, 218, 134, 66, 218, 135, 66, 218, 136, 66, 218, 140, 66, 218, 141, 66, 218, 142, 66, 218, 145, 66, 218, 152, 66, 218, 161, 66, 218, 164, 66, 218, 166, 66, 218, 169, 66, 218, 173, 66, 218, 175, 66, 218, 177, 66, 218, 179, 66, 218, 186, 66, 218, 187, 66, 218, 190, 66, 219, 129, 66, 219, 133, 66, 219, 134, 66, 219, 135, 66, 219, 136, 66, 219, 137, 66, 219, 139, 66, 219, 140, 66, 219, 144, 66, 219, 146, 67, 224, 188, 139, 67, 225, 131, 156, 67, 225, 132, 128, 67, 225, 132, 129, 67, 225, 132, 130, 67, 225, 132, 131, 67, 225, 132, 132, 67, 225, 132, 133, 67, 225, 132, 134, 67, 225, 132, 135, 67, 225, 132, 136, 67, 225, 132, 137, 67, 225, 132, 138, 67, 225, 132, 139, 67, 225, 132, 140, 67, 225, 132, 141, 67, 225, 132, 142, 67, 225, 132, 143, 67, 225, 132, 144, 67, 225, 132, 145, 67, 225, 132, 146, 67, 225, 132, 148, 67, 225, 132, 149, 67, 225, 132, 154, 67, 225, 132, 156, 67, 225, 132, 157, 67, 225, 132, 158, 67, 225, 132, 160, 67, 225, 132, 161, 67, 225, 132, 162, 67, 225, 132, 163, 67, 225, 132, 167, 67, 225, 132, 169, 67, 225, 132, 171, 67, 225, 132, 172, 67, 225, 132, 173, 67, 225, 132, 174, 67, 225, 132, 175, 67, 225, 132, 178, 67, 225, 132, 182, 67, 225, 133, 128, 67, 225, 133, 135, 67, 225, 133, 140, 67, 225, 133, 151, 67, 225, 133, 152, 67, 225, 133, 153, 67, 225, 133, 160, 67, 225, 134, 132, 67, 225, 134, 133, 67, 225, 134, 136, 67, 225, 134, 145, 67, 225, 134, 146, 67, 225, 134, 148, 67, 225, 134, 158, 67, 225, 134, 161, 67, 225, 135, 135, 67, 225, 135, 136, 67, 225, 135, 140, 67, 225, 135, 142, 67, 225, 135, 147, 67, 225, 135, 151, 67, 225, 135, 153, 67, 225, 135, 157, 67, 225, 135, 159, 67, 225, 135, 177, 67, 225, 135, 178, 67, 225, 180, 130, 67, 225, 180, 150, 67, 225, 180, 151, 67, 225, 180, 156, 67, 225, 180, 157, 67, 225, 180, 165, 67, 225, 181, 187, 67, 225, 182, 133, 67, 226, 128, 130, 67, 226, 128, 131, 67, 226, 128, 144, 67, 226, 128, 147, 67, 226, 128, 148, 67, 226, 130, 169, 67, 226, 134, 144, 67, 226, 134, 145, 67, 226, 134, 146, 67, 226, 134, 147, 67, 226, 136, 130, 67, 226, 136, 135, 67, 226, 136, 145, 67, 226, 136, 146, 67, 226, 148, 130, 67, 226, 150, 160, 67, 226, 151, 139, 67, 226, 166, 133, 67, 226, 166, 134, 67, 226, 181, 161, 67, 227, 128, 129, 67, 227, 128, 130, 67, 227, 128, 136, 67, 227, 128, 137, 67, 227, 128, 138, 67, 227, 128, 139, 67, 227, 128, 140, 67, 227, 128, 141, 67, 227, 128, 142, 67, 227, 128, 143, 67, 227, 128, 144, 67, 227, 128, 145, 67, 227, 128, 146, 67, 227, 128, 148, 67, 227, 128, 149, 67, 227, 128, 150, 67, 227, 128, 151, 67, 227, 130, 161, 67, 227, 130, 162, 67, 227, 130, 163, 67, 227, 130, 164, 67, 227, 130, 165, 67, 227, 130, 166, 67, 227, 130, 167, 67, 227, 130, 168, 67, 227, 130, 169, 67, 227, 130, 170, 67, 227, 130, 171, 67, 227, 130, 173, 67, 227, 130, 175, 67, 227, 130, 177, 67, 227, 130, 179, 67, 227, 130, 181, 67, 227, 130, 183, 67, 227, 130, 185, 67, 227, 130, 187, 67, 227, 130, 189, 67, 227, 130, 191, 67, 227, 131, 129, 67, 227, 131, 131, 67, 227, 131, 132, 67, 227, 131, 134, 67, 227, 131, 136, 67, 227, 131, 138, 67, 227, 131, 139, 67, 227, 131, 140, 67, 227, 131, 141, 67, 227, 131, 142, 67, 227, 131, 143, 67, 227, 131, 146, 67, 227, 131, 149, 67, 227, 131, 152, 67, 227, 131, 155, 67, 227, 131, 158, 67, 227, 131, 159, 67, 227, 131, 160, 67, 227, 131, 161, 67, 227, 131, 162, 67, 227, 131, 163, 67, 227, 131, 164, 67, 227, 131, 165, 67, 227, 131, 166, 67, 227, 131, 167, 67, 227, 131, 168, 67, 227, 131, 169, 67, 227, 131, 170, 67, 227, 131, 171, 67, 227, 131, 172, 67, 227, 131, 173, 67, 227, 131, 175, 67, 227, 131, 176, 67, 227, 131, 177, 67, 227, 131, 178, 67, 227, 131, 179, 67, 227, 131, 187, 67, 227, 131, 188, 67, 227, 146, 158, 67, 227, 146, 185, 67, 227, 146, 187, 67, 227, 147, 159, 67, 227, 148, 149, 67, 227, 155, 174, 67, 227, 155, 188, 67, 227, 158, 129, 67, 227, 160, 175, 67, 227, 161, 162, 67, 227, 161, 188, 67, 227, 163, 135, 67, 227, 163, 163, 67, 227, 164, 156, 67, 227, 164, 186, 67, 227, 168, 174, 67, 227, 169, 172, 67, 227, 171, 164, 67, 227, 172, 136, 67, 227, 172, 153, 67, 227, 173, 137, 67, 227, 174, 157, 67, 227, 176, 152, 67, 227, 177, 142, 67, 227, 180, 179, 67, 227, 182, 150, 67, 227, 186, 172, 67, 227, 186, 184, 67, 227, 188, 155, 67, 227, 191, 188, 67, 228, 128, 136, 67, 228, 128, 152, 67, 228, 128, 185, 67, 228, 129, 134, 67, 228, 130, 150, 67, 228, 131, 163, 67, 228, 132, 175, 67, 228, 136, 130, 67, 228, 136, 167, 67, 228, 138, 160, 67, 228, 140, 129, 67, 228, 140, 180, 67, 228, 141, 153, 67, 228, 143, 149, 67, 228, 143, 153, 67, 228, 144, 139, 67, 228, 145, 171, 67, 228, 148, 171, 67, 228, 149, 157, 67, 228, 149, 161, 67, 228, 149, 171, 67, 228, 151, 151, 67, 228, 151, 185, 67, 228, 152, 181, 67, 228, 154, 190, 67, 228, 155, 135, 67, 228, 166, 149, 67, 228, 167, 166, 67, 228, 169, 174, 67, 228, 169, 182, 67, 228, 170, 178, 67, 228, 172, 179, 67, 228, 175, 142, 67, 228, 179, 142, 67, 228, 179, 173, 67, 228, 179, 184, 67, 228, 181, 150, 67, 228, 184, 128, 67, 228, 184, 129, 67, 228, 184, 131, 67, 228, 184, 137, 67, 228, 184, 138, 67, 228, 184, 139, 67, 228, 184, 141, 67, 228, 184, 153, 67, 228, 184, 166, 67, 228, 184, 168, 67, 228, 184, 173, 67, 228, 184, 178, 67, 228, 184, 182, 67, 228, 184, 184, 67, 228, 184, 185, 67, 228, 184, 189, 67, 228, 184, 191, 67, 228, 185, 129, 67, 228, 185, 153, 67, 228, 185, 157, 67, 228, 186, 130, 67, 228, 186, 133, 67, 228, 186, 134, 67, 228, 186, 140, 67, 228, 186, 148, 67, 228, 186, 160, 67, 228, 186, 164, 67, 228, 186, 174, 67, 228, 186, 186, 67, 228, 187, 128, 67, 228, 187, 140, 67, 228, 187, 164, 67, 228, 188, 129, 67, 228, 188, 145, 67, 228, 189, 160, 67, 228, 190, 128, 67, 228, 190, 134, 67, 228, 190, 139, 67, 228, 190, 174, 67, 228, 190, 187, 67, 228, 190, 191, 67, 229, 128, 130, 67, 229, 128, 171, 67, 229, 129, 186, 67, 229, 130, 153, 67, 229, 131, 143, 67, 229, 131, 154, 67, 229, 131, 167, 67, 229, 132, 170, 67, 229, 132, 191, 67, 229, 133, 128, 67, 229, 133, 133, 67, 229, 133, 141, 67, 229, 133, 148, 67, 229, 133, 164, 67, 229, 133, 165, 67, 229, 133, 167, 67, 229, 133, 168, 67, 229, 133, 169, 67, 229, 133, 171, 67, 229, 133, 173, 67, 229, 133, 183, 67, 229, 134, 128, 67, 229, 134, 130, 67, 229, 134, 141, 67, 229, 134, 146, 67, 229, 134, 149, 67, 229, 134, 150, 67, 229, 134, 151, 67, 229, 134, 153, 67, 229, 134, 164, 67, 229, 134, 171, 67, 229, 134, 172, 67, 229, 134, 181, 67, 229, 134, 183, 67, 229, 135, 137, 67, 229, 135, 140, 67, 229, 135, 156, 67, 229, 135, 158, 67, 229, 135, 160, 67, 229, 135, 181, 67, 229, 136, 128, 67, 229, 136, 131, 67, 229, 136, 135, 67, 229, 136, 151, 67, 229, 136, 157, 67, 229, 136, 169, 67, 229, 136, 186, 67, 229, 136, 187, 67, 229, 137, 134, 67, 229, 137, 141, 67, 229, 137, 178, 67, 229, 137, 183, 67, 229, 138, 137, 67, 229, 138, 155, 67, 229, 138, 163, 67, 229, 138, 179, 67, 229, 138, 180, 67, 229, 139, 135, 67, 229, 139, 137, 67, 229, 139, 146, 67, 229, 139, 158, 67, 229, 139, 164, 67, 229, 139, 181, 67, 229, 139, 185, 67, 229, 139, 186, 67, 229, 140, 133, 67, 229, 140, 134, 67, 229, 140, 149, 67, 229, 140, 151, 67, 229, 140, 154, 67, 229, 140, 184, 67, 229, 140, 187, 67, 229, 140, 191, 67, 229, 141, 129, 67, 229, 141, 132, 67, 229, 141, 133, 67, 229, 141, 137, 67, 229, 141, 145, 67, 229, 141, 148, 67, 229, 141, 154, 67, 229, 141, 156, 67, 229, 141, 169, 67, 229, 141, 176, 67, 229, 141, 179, 67, 229, 141, 181, 67, 229, 141, 189, 67, 229, 141, 191, 67, 229, 142, 130, 67, 229, 142, 182, 67, 229, 143, 131, 67, 229, 143, 136, 67, 229, 143, 138, 67, 229, 143, 140, 67, 229, 143, 159, 67, 229, 143, 163, 67, 229, 143, 165, 67, 229, 143, 171, 67, 229, 143, 175, 67, 229, 143, 177, 67, 229, 143, 179, 67, 229, 144, 134, 67, 229, 144, 136, 67, 229, 144, 141, 67, 229, 144, 143, 67, 229, 144, 157, 67, 229, 144, 184, 67, 229, 144, 185, 67, 229, 145, 130, 67, 229, 145, 136, 67, 229, 145, 168, 67, 229, 146, 158, 67, 229, 146, 162, 67, 229, 146, 189, 67, 229, 147, 182, 67, 229, 148, 144, 67, 229, 149, 143, 67, 229, 149, 147, 67, 229, 149, 149, 67, 229, 149, 163, 67, 229, 150, 132, 67, 229, 150, 135, 67, 229, 150, 153, 67, 229, 150, 157, 67, 229, 150, 171, 67, 229, 150, 179, 67, 229, 150, 182, 67, 229, 151, 128, 67, 229, 151, 130, 67, 229, 151, 162, 67, 229, 152, 134, 67, 229, 153, 145, 67, 229, 153, 168, 67, 229, 153, 180, 67, 229, 155, 151, 67, 229, 155, 155, 67, 229, 155, 185, 67, 229, 156, 150, 67, 229, 156, 151, 67, 229, 156, 159, 67, 229, 156, 176, 67, 229, 158, 139, 67, 229, 159, 142, 67, 229, 159, 180, 67, 229, 160, 141, 67, 229, 160, 177, 67, 229, 160, 178, 67, 229, 161, 128, 67, 229, 161, 154, 67, 229, 161, 158, 67, 229, 162, 168, 67, 229, 162, 172, 67, 229, 162, 179, 67, 229, 163, 152, 67, 229, 163, 159, 67, 229, 163, 171, 67, 229, 163, 174, 67, 229, 163, 176, 67, 229, 163, 178, 67, 229, 163, 183, 67, 229, 164, 130, 67, 229, 164, 134, 67, 229, 164, 138, 67, 229, 164, 149, 67, 229, 164, 154, 67, 229, 164, 156, 67, 229, 164, 162, 67, 229, 164, 167, 67, 229, 164, 169, 67, 229, 165, 132, 67, 229, 165, 136, 67, 229, 165, 145, 67, 229, 165, 148, 67, 229, 165, 162, 67, 229, 165, 179, 67, 229, 167, 152, 67, 229, 167, 172, 67, 229, 168, 155, 67, 229, 168, 167, 67, 229, 169, 162, 67, 229, 169, 166, 67, 229, 170, 181, 67, 229, 172, 136, 67, 229, 172, 168, 67, 229, 172, 190, 67, 229, 173, 144, 67, 229, 173, 151, 67, 229, 173, 166, 67, 229, 174, 128, 67, 229, 174, 133, 67, 229, 174, 151, 67, 229, 175, 131, 67, 229, 175, 152, 67, 229, 175, 167, 67, 229, 175, 174, 67, 229, 175, 179, 67, 229, 175, 184, 67, 229, 175, 191, 67, 229, 176, 134, 67, 229, 176, 143, 67, 229, 176, 162, 67, 229, 176, 184, 67, 229, 176, 191, 67, 229, 177, 160, 67, 229, 177, 162, 67, 229, 177, 164, 67, 229, 177, 165, 67, 229, 177, 174, 67, 229, 177, 177, 67, 229, 178, 141, 67, 229, 179, 128, 67, 229, 180, 153, 67, 229, 181, 131, 67, 229, 181, 144, 67, 229, 181, 171, 67, 229, 181, 174, 67, 229, 181, 188, 67, 229, 182, 178, 67, 229, 182, 186, 67, 229, 183, 155, 67, 229, 183, 161, 67, 229, 183, 162, 67, 229, 183, 165, 67, 229, 183, 166, 67, 229, 183, 177, 67, 229, 183, 189, 67, 229, 183, 190, 67, 229, 184, 168, 67, 229, 184, 189, 67, 229, 185, 169, 67, 229, 185, 178, 67, 229, 185, 180, 67, 229, 185, 186, 67, 229, 185, 188, 67, 229, 185, 191, 67, 229, 186, 166, 67, 229, 186, 176, 67, 229, 186, 179, 67, 229, 186, 182, 67, 229, 187, 137, 67, 229, 187, 138, 67, 229, 187, 146, 67, 229, 187, 147, 67, 229, 187, 153, 67, 229, 187, 172, 67, 229, 187, 180, 67, 229, 187, 190, 67, 229, 188, 132, 67, 229, 188, 139, 67, 229, 188, 147, 67, 229, 188, 162, 67, 229, 189, 144, 67, 229, 189, 147, 67, 229, 189, 161, 67, 229, 189, 162, 67, 229, 189, 169, 67, 229, 189, 171, 67, 229, 189, 179, 67, 229, 190, 139, 67, 229, 190, 140, 67, 229, 190, 151, 67, 229, 190, 154, 67, 229, 190, 169, 67, 229, 190, 173, 67, 229, 191, 131, 67, 229, 191, 141, 67, 229, 191, 151, 67, 229, 191, 181, 67, 229, 191, 185, 67, 230, 128, 146, 67, 230, 128, 156, 67, 230, 129, 181, 67, 230, 130, 129, 67, 230, 130, 148, 67, 230, 131, 135, 67, 230, 131, 152, 67, 230, 131, 161, 67, 230, 132, 136, 67, 230, 133, 132, 67, 230, 133, 136, 67, 230, 133, 140, 67, 230, 133, 142, 67, 230, 133, 160, 67, 230, 133, 168, 67, 230, 133, 186, 67, 230, 134, 142, 67, 230, 134, 144, 67, 230, 134, 164, 67, 230, 134, 175, 67, 230, 134, 178, 67, 230, 135, 158, 67, 230, 135, 178, 67, 230, 135, 182, 67, 230, 136, 128, 67, 230, 136, 136, 67, 230, 136, 144, 67, 230, 136, 155, 67, 230, 136, 174, 67, 230, 136, 180, 67, 230, 136, 182, 67, 230, 137, 139, 67, 230, 137, 147, 67, 230, 137, 157, 67, 230, 138, 149, 67, 230, 138, 177, 67, 230, 139, 137, 67, 230, 139, 143, 67, 230, 139, 147, 67, 230, 139, 148, 67, 230, 139, 188, 67, 230, 139, 190, 67, 230, 140, 135, 67, 230, 140, 189, 67, 230, 141, 144, 67, 230, 141, 149, 67, 230, 141, 168, 67, 230, 141, 187, 67, 230, 142, 131, 67, 230, 142, 160, 67, 230, 142, 169, 67, 230, 143, 132, 67, 230, 143, 133, 67, 230, 143, 164, 67, 230, 144, 156, 67, 230, 144, 162, 67, 230, 145, 146, 67, 230, 145, 169, 67, 230, 145, 183, 67, 230, 145, 190, 67, 230, 146, 154, 67, 230, 146, 157, 67, 230, 147, 132, 67, 230, 148, 175, 67, 230, 148, 180, 67, 230, 149, 143, 67, 230, 149, 150, 67, 230, 149, 172, 67, 230, 149, 184, 67, 230, 150, 135, 67, 230, 150, 151, 67, 230, 150, 153, 67, 230, 150, 164, 67, 230, 150, 176, 67, 230, 150, 185, 67, 230, 151, 133, 67, 230, 151, 160, 67, 230, 151, 162, 67, 230, 151, 163, 67, 230, 151, 165, 67, 230, 152, 147, 67, 230, 152, 160, 67, 230, 153, 137, 67, 230, 153, 180, 67, 230, 154, 136, 67, 230, 154, 145, 67, 230, 154, 156, 67, 230, 154, 180, 67, 230, 155, 134, 67, 230, 155, 176, 67, 230, 155, 180, 67, 230, 155, 184, 67, 230, 156, 128, 67, 230, 156, 136, 67, 230, 156, 137, 67, 230, 156, 151, 67, 230, 156, 155, 67, 230, 156, 161, 67, 230, 156, 168, 67, 230, 157, 142, 67, 230, 157, 147, 67, 230, 157, 150, 67, 230, 157, 158, 67, 230, 157, 187, 67, 230, 158, 133, 67, 230, 158, 151, 67, 230, 159, 179, 67, 230, 159, 186, 67, 230, 160, 151, 67, 230, 160, 159, 67, 230, 160, 170, 67, 230, 161, 146, 67, 230, 162, 129, 67, 230, 162, 133, 67, 230, 162, 142, 67, 230, 162, 168, 67, 230, 164, 148, 67, 230, 165, 130, 67, 230, 166, 163, 67, 230, 167, 170, 67, 230, 168, 130, 67, 230, 168, 147, 67, 230, 170, 168, 67, 230, 171, 147, 67, 230, 171, 155, 67, 230, 172, 132, 67, 230, 172, 160, 67, 230, 172, 161, 67, 230, 173, 148, 67, 230, 173, 162, 67, 230, 173, 163, 67, 230, 173, 178, 67, 230, 173, 183, 67, 230, 173, 185, 67, 230, 174, 159, 67, 230, 174, 174, 67, 230, 174, 179, 67, 230, 174, 186, 67, 230, 174, 187, 67, 230, 175, 139, 67, 230, 175, 141, 67, 230, 175, 148, 67, 230, 175, 155, 67, 230, 176, 143, 67, 230, 176, 148, 67, 230, 176, 180, 67, 230, 177, 142, 67, 230, 177, 167, 67, 230, 178, 136, 67, 230, 178, 191, 67, 230, 179, 140, 67, 230, 179, 141, 67, 230, 179, 165, 67, 230, 179, 168, 67, 230, 180, 150, 67, 230, 180, 155, 67, 230, 180, 158, 67, 230, 180, 180, 67, 230, 180, 190, 67, 230, 181, 129, 67, 230, 181, 169, 67, 230, 181, 170, 67, 230, 181, 183, 67, 230, 181, 184, 67, 230, 182, 133, 67, 230, 183, 139, 67, 230, 183, 154, 67, 230, 183, 170, 67, 230, 183, 185, 67, 230, 184, 154, 67, 230, 184, 175, 67, 230, 185, 174, 67, 230, 186, 128, 67, 230, 186, 156, 67, 230, 186, 186, 67, 230, 187, 135, 67, 230, 187, 139, 67, 230, 187, 145, 67, 230, 187, 155, 67, 230, 188, 143, 67, 230, 188, 148, 67, 230, 188, 162, 67, 230, 188, 163, 67, 230, 189, 174, 67, 230, 191, 134, 67, 230, 191, 171, 67, 230, 191, 190, 67, 231, 128, 155, 67, 231, 128, 158, 67, 231, 128, 185, 67, 231, 129, 138, 67, 231, 129, 171, 67, 231, 129, 176, 67, 231, 129, 183, 67, 231, 129, 189, 67, 231, 130, 153, 67, 231, 130, 173, 67, 231, 131, 136, 67, 231, 131, 153, 67, 231, 132, 161, 67, 231, 133, 133, 67, 231, 133, 137, 67, 231, 133, 174, 67, 231, 134, 156, 67, 231, 135, 142, 67, 231, 135, 144, 67, 231, 136, 144, 67, 231, 136, 155, 67, 231, 136, 168, 67, 231, 136, 170, 67, 231, 136, 171, 67, 231, 136, 181, 67, 231, 136, 182, 67, 231, 136, 187, 67, 231, 136, 191, 67, 231, 137, 135, 67, 231, 137, 144, 67, 231, 137, 153, 67, 231, 137, 155, 67, 231, 137, 162, 67, 231, 137, 185, 67, 231, 138, 128, 67, 231, 138, 149, 67, 231, 138, 172, 67, 231, 138, 175, 67, 231, 139, 128, 67, 231, 139, 188, 67, 231, 140, 170, 67, 231, 141, 181, 67, 231, 141, 186, 67, 231, 142, 132, 67, 231, 142, 135, 67, 231, 142, 137, 67, 231, 142, 139, 67, 231, 142, 165, 67, 231, 142, 178, 67, 231, 143, 158, 67, 231, 144, 134, 67, 231, 144, 137, 67, 231, 144, 162, 67, 231, 145, 135, 67, 231, 145, 156, 67, 231, 145, 169, 67, 231, 145, 177, 67, 231, 146, 133, 67, 231, 146, 137, 67, 231, 146, 152, 67, 231, 147, 138, 67, 231, 147, 156, 67, 231, 147, 166, 67, 231, 148, 134, 67, 231, 148, 152, 67, 231, 148, 159, 67, 231, 148, 164, 67, 231, 148, 168, 67, 231, 148, 176, 67, 231, 148, 178, 67, 231, 148, 179, 67, 231, 148, 183, 67, 231, 148, 187, 67, 231, 148, 190, 67, 231, 149, 153, 67, 231, 149, 165, 67, 231, 149, 176, 67, 231, 150, 139, 67, 231, 150, 146, 67, 231, 151, 162, 67, 231, 152, 144, 67, 231, 152, 157, 67, 231, 152, 159, 67, 231, 153, 130, 67, 231, 153, 169, 67, 231, 153, 182, 67, 231, 153, 189, 67, 231, 154, 174, 67, 231, 154, 191, 67, 231, 155, 138, 67, 231, 155, 155, 67, 231, 155, 163, 67, 231, 155, 167, 67, 231, 155, 174, 67, 231, 155, 180, 67, 231, 156, 129, 67, 231, 156, 158, 67, 231, 156, 159, 67, 231, 157, 128, 67, 231, 157, 138, 67, 231, 158, 139, 67, 231, 158, 167, 67, 231, 159, 155, 67, 231, 159, 162, 67, 231, 159, 179, 67, 231, 161, 142, 67, 231, 161, 171, 67, 231, 162, 140, 67, 231, 162, 145, 67, 231, 163, 138, 67, 231, 163, 140, 67, 231, 163, 187, 67, 231, 164, 170, 67, 231, 164, 186, 67, 231, 164, 188, 67, 231, 164, 190, 67, 231, 165, 136, 67, 231, 165, 137, 67, 231, 165, 144, 67, 231, 165, 150, 67, 231, 165, 157, 67, 231, 165, 158, 67, 231, 165, 165, 67, 231, 165, 191, 67, 231, 166, 129, 67, 231, 166, 141, 67, 231, 166, 142, 67, 231, 166, 143, 67, 231, 166, 174, 67, 231, 166, 184, 67, 231, 166, 190, 67, 231, 167, 138, 67, 231, 167, 152, 67, 231, 167, 171, 67, 231, 168, 156, 67, 231, 169, 128, 67, 231, 169, 138, 67, 231, 169, 143, 67, 231, 169, 180, 67, 231, 169, 186, 67, 231, 170, 129, 67, 231, 170, 177, 67, 231, 171, 139, 67, 231, 171, 174, 67, 231, 171, 185, 67, 231, 172, 160, 67, 231, 174, 143, 67, 231, 175, 128, 67, 231, 175, 134, 67, 231, 175, 137, 67, 231, 176, 190, 67, 231, 177, 160, 67, 231, 177, 179, 67, 231, 177, 187, 67, 231, 178, 146, 67, 231, 178, 190, 67, 231, 179, 146, 67, 231, 179, 150, 67, 231, 179, 163, 67, 231, 179, 167, 67, 231, 179, 168, 67, 231, 179, 184, 67, 231, 180, 128, 67, 231, 180, 144, 67, 231, 180, 162, 67, 231, 180, 175, 67, 231, 181, 130, 67, 231, 181, 155, 67, 231, 181, 163, 67, 231, 182, 160, 67, 231, 182, 190, 67, 231, 183, 135, 67, 231, 183, 180, 67, 231, 184, 130, 67, 231, 184, 137, 67, 231, 184, 183, 67, 231, 185, 129, 67, 231, 185, 133, 67, 231, 188, 182, 67, 231, 188, 190, 67, 231, 189, 145, 67, 231, 189, 178, 67, 231, 189, 185, 67, 231, 189, 186, 67, 231, 190, 133, 67, 231, 190, 138, 67, 231, 190, 149, 67, 231, 190, 154, 67, 231, 190, 189, 67, 231, 191, 186, 67, 232, 128, 129, 67, 232, 128, 133, 67, 232, 128, 140, 67, 232, 128, 146, 67, 232, 128, 179, 67, 232, 129, 134, 67, 232, 129, 160, 67, 232, 129, 175, 67, 232, 129, 176, 67, 232, 129, 190, 67, 232, 129, 191, 67, 232, 130, 137, 67, 232, 130, 139, 67, 232, 130, 173, 67, 232, 130, 178, 67, 232, 132, 131, 67, 232, 132, 190, 67, 232, 135, 152, 67, 232, 135, 163, 67, 232, 135, 168, 67, 232, 135, 170, 67, 232, 135, 173, 67, 232, 135, 179, 67, 232, 135, 188, 67, 232, 136, 129, 67, 232, 136, 132, 67, 232, 136, 140, 67, 232, 136, 152, 67, 232, 136, 155, 67, 232, 136, 159, 67, 232, 137, 174, 67, 232, 137, 175, 67, 232, 137, 178, 67, 232, 137, 184, 67, 232, 137, 185, 67, 232, 138, 139, 67, 232, 138, 145, 67, 232, 138, 157, 67, 232, 138, 177, 67, 232, 138, 179, 67, 232, 138, 189, 67, 232, 139, 165, 67, 232, 139, 166, 67, 232, 140, 157, 67, 232, 140, 163, 67, 232, 140, 182, 67, 232, 141, 146, 67, 232, 141, 147, 67, 232, 141, 163, 67, 232, 142, 173, 67, 232, 142, 189, 67, 232, 143, 137, 67, 232, 143, 138, 67, 232, 143, 140, 67, 232, 143, 156, 67, 232, 143, 167, 67, 232, 143, 175, 67, 232, 143, 177, 67, 232, 144, 189, 67, 232, 145, 137, 67, 232, 145, 151, 67, 232, 147, 174, 67, 232, 147, 177, 67, 232, 147, 179, 67, 232, 147, 188, 67, 232, 148, 150, 67, 232, 149, 164, 67, 232, 151, 141, 67, 232, 151, 186, 67, 232, 152, 134, 67, 232, 152, 146, 67, 232, 152, 173, 67, 232, 152, 191, 67, 232, 153, 141, 67, 232, 153, 144, 67, 232, 153, 156, 67, 232, 153, 167, 67, 232, 153, 169, 67, 232, 153, 171, 67, 232, 154, 136, 67, 232, 154, 169, 67, 232, 155, 162, 67, 232, 156, 142, 67, 232, 156, 168, 67, 232, 157, 171, 67, 232, 157, 185, 67, 232, 158, 134, 67, 232, 158, 186, 67, 232, 159, 161, 67, 232, 160, 129, 67, 232, 160, 159, 67, 232, 161, 128, 67, 232, 161, 140, 67, 232, 161, 160, 67, 232, 161, 163, 67, 232, 163, 130, 67, 232, 163, 143, 67, 232, 163, 151, 67, 232, 163, 158, 67, 232, 163, 161, 67, 232, 163, 184, 67, 232, 163, 186, 67, 232, 164, 144, 67, 232, 165, 129, 67, 232, 165, 164, 67, 232, 165, 190, 67, 232, 166, 134, 67, 232, 166, 139, 67, 232, 166, 150, 67, 232, 167, 146, 67, 232, 167, 163, 67, 232, 168, 128, 67, 232, 170, 160, 67, 232, 170, 170, 67, 232, 170, 191, 67, 232, 171, 139, 67, 232, 171, 146, 67, 232, 171, 150, 67, 232, 171, 173, 67, 232, 171, 184, 67, 232, 171, 190, 67, 232, 172, 129, 67, 232, 172, 185, 67, 232, 173, 152, 67, 232, 174, 128, 67, 232, 174, 138, 67, 232, 176, 183, 67, 232, 177, 134, 67, 232, 177, 136, 67, 232, 177, 149, 67, 232, 177, 184, 67, 232, 178, 157, 67, 232, 178, 161, 67, 232, 178, 169, 67, 232, 178, 171, 67, 232, 179, 129, 67, 232, 179, 130, 67, 232, 179, 135, 67, 232, 179, 136, 67, 232, 179, 147, 67, 232, 180, 136, 67, 232, 180, 155, 67, 232, 181, 164, 67, 232, 181, 176, 67, 232, 181, 183, 67, 232, 182, 179, 67, 232, 182, 188, 67, 232, 183, 139, 67, 232, 183, 175, 67, 232, 183, 176, 67, 232, 186, 171, 67, 232, 187, 138, 67, 232, 187, 148, 67, 232, 188, 166, 67, 232, 188, 170, 67, 232, 188, 184, 67, 232, 188, 187, 67, 232, 189, 162, 67, 232, 190, 155, 67, 232, 190, 158, 67, 232, 190, 176, 67, 232, 190, 181, 67, 232, 190, 182, 67, 233, 128, 163, 67, 233, 128, 184, 67, 233, 129, 138, 67, 233, 129, 169, 67, 233, 129, 178, 67, 233, 129, 188, 67, 233, 130, 143, 67, 233, 130, 145, 67, 233, 130, 148, 67, 233, 131, 142, 67, 233, 131, 158, 67, 233, 131, 177, 67, 233, 131, 189, 67, 233, 132, 145, 67, 233, 132, 155, 67, 233, 133, 137, 67, 233, 133, 141, 67, 233, 133, 170, 67, 233, 134, 153, 67, 233, 134, 180, 67, 233, 135, 134, 67, 233, 135, 140, 67, 233, 135, 143, 67, 233, 135, 145, 67, 233, 136, 180, 67, 233, 136, 184, 67, 233, 137, 182, 67, 233, 137, 188, 67, 233, 139, 151, 67, 233, 139, 152, 67, 233, 140, 132, 67, 233, 141, 138, 67, 233, 143, 185, 67, 233, 144, 149, 67, 233, 149, 183, 67, 233, 150, 128, 67, 233, 150, 139, 67, 233, 150, 173, 67, 233, 150, 183, 67, 233, 152, 156, 67, 233, 152, 174, 67, 233, 153, 139, 67, 233, 153, 141, 67, 233, 153, 181, 67, 233, 153, 184, 67, 233, 153, 188, 67, 233, 154, 134, 67, 233, 154, 163, 67, 233, 154, 182, 67, 233, 154, 183, 67, 233, 154, 184, 67, 233, 154, 185, 67, 233, 155, 131, 67, 233, 155, 162, 67, 233, 155, 163, 67, 233, 155, 168, 67, 233, 155, 182, 67, 233, 155, 183, 67, 233, 156, 163, 67, 233, 156, 178, 67, 233, 157, 136, 67, 233, 157, 145, 67, 233, 157, 150, 67, 233, 157, 158, 67, 233, 157, 162, 67, 233, 157, 169, 67, 233, 159, 139, 67, 233, 159, 155, 67, 233, 159, 160, 67, 233, 159, 173, 67, 233, 159, 179, 67, 233, 159, 191, 67, 233, 160, 129, 67, 233, 160, 133, 67, 233, 160, 139, 67, 233, 160, 152, 67, 233, 160, 169, 67, 233, 160, 187, 67, 233, 161, 158, 67, 233, 162, 168, 67, 233, 163, 155, 67, 233, 163, 159, 67, 233, 163, 162, 67, 233, 163, 175, 67, 233, 163, 188, 67, 233, 164, 168, 67, 233, 164, 169, 67, 233, 166, 150, 67, 233, 166, 153, 67, 233, 166, 167, 67, 233, 166, 172, 67, 233, 167, 130, 67, 233, 167, 177, 67, 233, 167, 190, 67, 233, 169, 170, 67, 233, 170, 168, 67, 233, 171, 152, 67, 233, 171, 159, 67, 233, 172, 146, 67, 233, 172, 165, 67, 233, 172, 175, 67, 233, 172, 178, 67, 233, 172, 188, 67, 233, 173, 154, 67, 233, 173, 175, 67, 233, 177, 128, 67, 233, 177, 151, 67, 233, 179, 165, 67, 233, 179, 189, 67, 233, 181, 167, 67, 233, 182, 180, 67, 233, 183, 186, 67, 233, 184, 158, 67, 233, 185, 181, 67, 233, 185, 191, 67, 233, 186, 151, 67, 233, 186, 159, 67, 233, 186, 165, 67, 233, 186, 187, 67, 233, 187, 131, 67, 233, 187, 141, 67, 233, 187, 142, 67, 233, 187, 145, 67, 233, 187, 185, 67, 233, 187, 189, 67, 233, 187, 190, 67, 233, 188, 133, 67, 233, 188, 142, 67, 233, 188, 143, 67, 233, 188, 147, 67, 233, 188, 150, 67, 233, 188, 160, 67, 233, 188, 187, 67, 233, 189, 131, 67, 233, 189, 138, 67, 233, 189, 146, 67, 233, 190, 141, 67, 233, 190, 142, 67, 233, 190, 156, 67, 233, 190, 159, 67, 233, 190, 160, 67, 234, 156, 167, 67, 234, 157, 175, 67, 234, 172, 183, 67, 234, 173, 146, 68, 240, 160, 132, 162, 68, 240, 160, 148, 156, 68, 240, 160, 148, 165, 68, 240, 160, 149, 139, 68, 240, 160, 152, 186, 68, 240, 160, 160, 132, 68, 240, 160, 163, 158, 68, 240, 160, 168, 172, 68, 240, 160, 173, 163, 68, 240, 161, 147, 164, 68, 240, 161, 154, 168, 68, 240, 161, 155, 170, 68, 240, 161, 167, 136, 68, 240, 161, 172, 152, 68, 240, 161, 180, 139, 68, 240, 161, 183, 164, 68, 240, 161, 183, 166, 68, 240, 162, 134, 131, 68, 240, 162, 134, 159, 68, 240, 162, 140, 177, 68, 240, 162, 155, 148, 68, 240, 162, 161, 132, 68, 240, 162, 161, 138, 68, 240, 162, 172, 140, 68, 240, 162, 175, 177, 68, 240, 163, 128, 138, 68, 240, 163, 138, 184, 68, 240, 163, 141, 159, 68, 240, 163, 142, 147, 68, 240, 163, 142, 156, 68, 240, 163, 143, 131, 68, 240, 163, 143, 149, 68, 240, 163, 145, 173, 68, 240, 163, 154, 163, 68, 240, 163, 162, 167, 68, 240, 163, 170, 141, 68, 240, 163, 171, 186, 68, 240, 163, 178, 188, 68, 240, 163, 180, 158, 68, 240, 163, 187, 145, 68, 240, 163, 189, 158, 68, 240, 163, 190, 142, 68, 240, 164, 137, 163, 68, 240, 164, 139, 174, 68, 240, 164, 142, 171, 68, 240, 164, 152, 136, 68, 240, 164, 156, 181, 68, 240, 164, 160, 148, 68, 240, 164, 176, 182, 68, 240, 164, 178, 146, 68, 240, 164, 190, 161, 68, 240, 164, 190, 184, 68, 240, 165, 129, 132, 68, 240, 165, 131, 178, 68, 240, 165, 131, 179, 68, 240, 165, 132, 153, 68, 240, 165, 132, 179, 68, 240, 165, 137, 137, 68, 240, 165, 144, 157, 68, 240, 165, 152, 166, 68, 240, 165, 154, 154, 68, 240, 165, 155, 133, 68, 240, 165, 165, 188, 68, 240, 165, 170, 167, 68, 240, 165, 174, 171, 68, 240, 165, 178, 128, 68, 240, 165, 179, 144, 68, 240, 165, 190, 134, 68, 240, 166, 135, 154, 68, 240, 166, 136, 168, 68, 240, 166, 137, 135, 68, 240, 166, 139, 153, 68, 240, 166, 140, 190, 68, 240, 166, 147, 154, 68, 240, 166, 148, 163, 68, 240, 166, 150, 168, 68, 240, 166, 158, 167, 68, 240, 166, 158, 181, 68, 240, 166, 172, 188, 68, 240, 166, 176, 182, 68, 240, 166, 179, 149, 68, 240, 166, 181, 171, 68, 240, 166, 188, 172, 68, 240, 166, 190, 177, 68, 240, 167, 131, 146, 68, 240, 167, 143, 138, 68, 240, 167, 153, 167, 68, 240, 167, 162, 174, 68, 240, 167, 165, 166, 68, 240, 167, 178, 168, 68, 240, 167, 187, 147, 68, 240, 167, 188, 175, 68, 240, 168, 151, 146, 68, 240, 168, 151, 173, 68, 240, 168, 156, 174, 68, 240, 168, 175, 186, 68, 240, 168, 181, 183, 68, 240, 169, 133, 133, 68, 240, 169, 135, 159, 68, 240, 169, 136, 154, 68, 240, 169, 144, 138, 68, 240, 169, 146, 150, 68, 240, 169, 150, 182, 68, 240, 169, 172, 176, 68, 240, 170, 131, 142, 68, 240, 170, 132, 133, 68, 240, 170, 136, 142, 68, 240, 170, 138, 145, 68, 240, 170, 142, 146, 68, 240, 170, 152, 128, 66, 33, 33, 66, 33, 63, 66, 46, 46, 66, 48, 44, 66, 48, 46, 66, 49, 44, 66, 49, 46, 66, 49, 48, 66, 49, 49, 66, 49, 50, 66, 49, 51, 66, 49, 52, 66, 49, 53, 66, 49, 54, 66, 49, 55, 66, 49, 56, 66, 49, 57, 66, 50, 44, 66, 50, 46, 66, 50, 48, 66, 50, 49, 66, 50, 50, 66, 50, 51, 66, 50, 52, 66, 50, 53, 66, 50, 54, 66, 50, 55, 66, 50, 56, 66, 50, 57, 66, 51, 44, 66, 51, 46, 66, 51, 48, 66, 51, 49, 66, 51, 50, 66, 51, 51, 66, 51, 52, 66, 51, 53, 66, 51, 54, 66, 51, 55, 66, 51, 56, 66, 51, 57, 66, 52, 44, 66, 52, 46, 66, 52, 48, 66, 52, 49, 66, 52, 50, 66, 52, 51, 66, 52, 52, 66, 52, 53, 66, 52, 54, 66, 52, 55, 66, 52, 56, 66, 52, 57, 66, 53, 44, 66, 53, 46, 66, 53, 48, 66, 54, 44, 66, 54, 46, 66, 55, 44, 66, 55, 46, 66, 56, 44, 66, 56, 46, 66, 57, 44, 66, 57, 46, 66, 61, 61, 66, 63, 33, 66, 63, 63, 66, 65, 85, 66, 66, 113, 66, 67, 68, 66, 68, 74, 66, 68, 90, 66, 68, 122, 66, 71, 66, 66, 71, 121, 66, 72, 80, 66, 72, 86, 66, 72, 103, 66, 72, 122, 66, 73, 73, 66, 73, 74, 66, 73, 85, 66, 73, 86, 66, 73, 88, 66, 75, 66, 66, 75, 75, 66, 75, 77, 66, 76, 74, 66, 76, 106, 66, 77, 66, 66, 77, 67, 66, 77, 68, 66, 77, 82, 66, 77, 86, 66, 77, 87, 66, 78, 74, 66, 78, 106, 66, 78, 111, 66, 80, 72, 66, 80, 82, 66, 80, 97, 66, 82, 115, 66, 83, 68, 66, 83, 77, 66, 83, 83, 66, 83, 118, 66, 84, 77, 66, 86, 73, 66, 87, 67, 66, 87, 90, 66, 87, 98, 66, 88, 73, 66, 99, 99, 66, 99, 100, 66, 99, 109, 66, 100, 66, 66, 100, 97, 66, 100, 108, 66, 100, 109, 66, 100, 122, 66, 101, 86, 66, 102, 102, 66, 102, 105, 66, 102, 108, 66, 102, 109, 66, 104, 97, 66, 105, 105, 66, 105, 106, 66, 105, 110, 66, 105, 118, 66, 105, 120, 66, 107, 65, 66, 107, 86, 66, 107, 87, 66, 107, 103, 66, 107, 108, 66, 107, 109, 66, 107, 116, 66, 108, 106, 66, 108, 109, 66, 108, 110, 66, 108, 120, 66, 109, 50, 66, 109, 51, 66, 109, 65, 66, 109, 86, 66, 109, 87, 66, 109, 98, 66, 109, 103, 66, 109, 108, 66, 109, 109, 66, 109, 115, 66, 110, 65, 66, 110, 70, 66, 110, 86, 66, 110, 87, 66, 110, 106, 66, 110, 109, 66, 110, 115, 66, 111, 86, 66, 112, 65, 66, 112, 70, 66, 112, 86, 66, 112, 87, 66, 112, 99, 66, 112, 115, 66, 115, 114, 66, 115, 116, 66, 118, 105, 66, 120, 105, 67, 40, 49, 41, 67, 40, 50, 41, 67, 40, 51, 41, 67, 40, 52, 41, 67, 40, 53, 41, 67, 40, 54, 41, 67, 40, 55, 41, 67, 40, 56, 41, 67, 40, 57, 41, 67, 40, 65, 41, 67, 40, 66, 41, 67, 40, 67, 41, 67, 40, 68, 41, 67, 40, 69, 41, 67, 40, 70, 41, 67, 40, 71, 41, 67, 40, 72, 41, 67, 40, 73, 41, 67, 40, 74, 41, 67, 40, 75, 41, 67, 40, 76, 41, 67, 40, 77, 41, 67, 40, 78, 41, 67, 40, 79, 41, 67, 40, 80, 41, 67, 40, 81, 41, 67, 40, 82, 41, 67, 40, 83, 41, 67, 40, 84, 41, 67, 40, 85, 41, 67, 40, 86, 41, 67, 40, 87, 41, 67, 40, 88, 41, 67, 40, 89, 41, 67, 40, 90, 41, 67, 40, 97, 41, 67, 40, 98, 41, 67, 40, 99, 41, 67, 40, 100, 41, 67, 40, 101, 41, 67, 40, 102, 41, 67, 40, 103, 41, 67, 40, 104, 41, 67, 40, 105, 41, 67, 40, 106, 41, 67, 40, 107, 41, 67, 40, 108, 41, 67, 40, 109, 41, 67, 40, 110, 41, 67, 40, 111, 41, 67, 40, 112, 41, 67, 40, 113, 41, 67, 40, 114, 41, 67, 40, 115, 41, 67, 40, 116, 41, 67, 40, 117, 41, 67, 40, 118, 41, 67, 40, 119, 41, 67, 40, 120, 41, 67, 40, 121, 41, 67, 40, 122, 41, 67, 46, 46, 46, 67, 49, 48, 46, 67, 49, 49, 46, 67, 49, 50, 46, 67, 49, 51, 46, 67, 49, 52, 46, 67, 49, 53, 46, 67, 49, 54, 46, 67, 49, 55, 46, 67, 49, 56, 46, 67, 49, 57, 46, 67, 50, 48, 46, 67, 58, 58, 61, 67, 61, 61, 61, 67, 67, 111, 46, 67, 70, 65, 88, 67, 71, 72, 122, 67, 71, 80, 97, 67, 73, 73, 73, 67, 76, 84, 68, 67, 76, 194, 183, 67, 77, 72, 122, 67, 77, 80, 97, 67, 77, 206, 169, 67, 80, 80, 77, 67, 80, 80, 86, 67, 80, 84, 69, 67, 84, 69, 76, 67, 84, 72, 122, 67, 86, 73, 73, 67, 88, 73, 73, 67, 97, 47, 99, 67, 97, 47, 115, 67, 97, 202, 190, 67, 98, 97, 114, 67, 99, 47, 111, 67, 99, 47, 117, 67, 99, 97, 108, 67, 99, 109, 50, 67, 99, 109, 51, 67, 100, 109, 50, 67, 100, 109, 51, 67, 101, 114, 103, 67, 102, 102, 105, 67, 102, 102, 108, 67, 103, 97, 108, 67, 104, 80, 97, 67, 105, 105, 105, 67, 107, 72, 122, 67, 107, 80, 97, 67, 107, 109, 50, 67, 107, 109, 51, 67, 107, 206, 169, 67, 108, 111, 103, 67, 108, 194, 183, 67, 109, 105, 108, 67, 109, 109, 50, 67, 109, 109, 51, 67, 109, 111, 108, 67, 114, 97, 100, 67, 118, 105, 105, 67, 120, 105, 105, 67, 194, 176, 67, 67, 194, 176, 70, 67, 202, 188, 110, 67, 206, 188, 65, 67, 206, 188, 70, 67, 206, 188, 86, 67, 206, 188, 87, 67, 206, 188, 103, 67, 206, 188, 108, 67, 206, 188, 109, 67, 206, 188, 115, 68, 40, 49, 48, 41, 68, 40, 49, 49, 41, 68, 40, 49, 50, 41, 68, 40, 49, 51, 41, 68, 40, 49, 52, 41, 68, 40, 49, 53, 41, 68, 40, 49, 54, 41, 68, 40, 49, 55, 41, 68, 40, 49, 56, 41, 68, 40, 49, 57, 41, 68, 40, 50, 48, 41, 68, 48, 231, 130, 185, 68, 49, 226, 129, 132, 68, 49, 230, 151, 165, 68, 49, 230, 156, 136, 68, 49, 231, 130, 185, 68, 50, 230, 151, 165, 68, 50, 230, 156, 136, 68, 50, 231, 130, 185, 68, 51, 230, 151, 165, 68, 51, 230, 156, 136, 68, 51, 231, 130, 185, 68, 52, 230, 151, 165, 68, 52, 230, 156, 136, 68, 52, 231, 130, 185, 68, 53, 230, 151, 165, 68, 53, 230, 156, 136, 68, 53, 231, 130, 185, 68, 54, 230, 151, 165, 68, 54, 230, 156, 136, 68, 54, 231, 130, 185, 68, 55, 230, 151, 165, 68, 55, 230, 156, 136, 68, 55, 231, 130, 185, 68, 56, 230, 151, 165, 68, 56, 230, 156, 136, 68, 56, 231, 130, 185, 68, 57, 230, 151, 165, 68, 57, 230, 156, 136, 68, 57, 231, 130, 185, 68, 86, 73, 73, 73, 68, 97, 46, 109, 46, 68, 107, 99, 97, 108, 68, 112, 46, 109, 46, 68, 118, 105, 105, 105, 68, 213, 165, 214, 130, 68, 213, 180, 213, 165, 68, 213, 180, 213, 171, 68, 213, 180, 213, 173, 68, 213, 180, 213, 182, 68, 213, 190, 213, 182, 68, 215, 144, 215, 156, 68, 216, 167, 217, 180, 68, 216, 168, 216, 172, 68, 216, 168, 216, 173, 68, 216, 168, 216, 174, 68, 216, 168, 216, 177, 68, 216, 168, 216, 178, 68, 216, 168, 217, 133, 68, 216, 168, 217, 134, 68, 216, 168, 217, 135, 68, 216, 168, 217, 137, 68, 216, 168, 217, 138, 68, 216, 170, 216, 172, 68, 216, 170, 216, 173, 68, 216, 170, 216, 174, 68, 216, 170, 216, 177, 68, 216, 170, 216, 178, 68, 216, 170, 217, 133, 68, 216, 170, 217, 134, 68, 216, 170, 217, 135, 68, 216, 170, 217, 137, 68, 216, 170, 217, 138, 68, 216, 171, 216, 172, 68, 216, 171, 216, 177, 68, 216, 171, 216, 178, 68, 216, 171, 217, 133, 68, 216, 171, 217, 134, 68, 216, 171, 217, 135, 68, 216, 171, 217, 137, 68, 216, 171, 217, 138, 68, 216, 172, 216, 173, 68, 216, 172, 217, 133, 68, 216, 172, 217, 137, 68, 216, 172, 217, 138, 68, 216, 173, 216, 172, 68, 216, 173, 217, 133, 68, 216, 173, 217, 137, 68, 216, 173, 217, 138, 68, 216, 174, 216, 172, 68, 216, 174, 216, 173, 68, 216, 174, 217, 133, 68, 216, 174, 217, 137, 68, 216, 174, 217, 138, 68, 216, 179, 216, 172, 68, 216, 179, 216, 173, 68, 216, 179, 216, 174, 68, 216, 179, 216, 177, 68, 216, 179, 217, 133, 68, 216, 179, 217, 135, 68, 216, 179, 217, 137, 68, 216, 179, 217, 138, 68, 216, 180, 216, 172, 68, 216, 180, 216, 173, 68, 216, 180, 216, 174, 68, 216, 180, 216, 177, 68, 216, 180, 217, 133, 68, 216, 180, 217, 135, 68, 216, 180, 217, 137, 68, 216, 180, 217, 138, 68, 216, 181, 216, 173, 68, 216, 181, 216, 174, 68, 216, 181, 216, 177, 68, 216, 181, 217, 133, 68, 216, 181, 217, 137, 68, 216, 181, 217, 138, 68, 216, 182, 216, 172, 68, 216, 182, 216, 173, 68, 216, 182, 216, 174, 68, 216, 182, 216, 177, 68, 216, 182, 217, 133, 68, 216, 182, 217, 137, 68, 216, 182, 217, 138, 68, 216, 183, 216, 173, 68, 216, 183, 217, 133, 68, 216, 183, 217, 137, 68, 216, 183, 217, 138, 68, 216, 184, 217, 133, 68, 216, 185, 216, 172, 68, 216, 185, 217, 133, 68, 216, 185, 217, 137, 68, 216, 185, 217, 138, 68, 216, 186, 216, 172, 68, 216, 186, 217, 133, 68, 216, 186, 217, 137, 68, 216, 186, 217, 138, 68, 217, 129, 216, 172, 68, 217, 129, 216, 173, 68, 217, 129, 216, 174, 68, 217, 129, 217, 133, 68, 217, 129, 217, 137, 68, 217, 129, 217, 138, 68, 217, 130, 216, 173, 68, 217, 130, 217, 133, 68, 217, 130, 217, 137, 68, 217, 130, 217, 138, 68, 217, 131, 216, 167, 68, 217, 131, 216, 172, 68, 217, 131, 216, 173, 68, 217, 131, 216, 174, 68, 217, 131, 217, 132, 68, 217, 131, 217, 133, 68, 217, 131, 217, 137, 68, 217, 131, 217, 138, 68, 217, 132, 216, 167, 68, 217, 132, 216, 172, 68, 217, 132, 216, 173, 68, 217, 132, 216, 174, 68, 217, 132, 217, 133, 68, 217, 132, 217, 135, 68, 217, 132, 217, 137, 68, 217, 132, 217, 138, 68, 217, 133, 216, 167, 68, 217, 133, 216, 172, 68, 217, 133, 216, 173, 68, 217, 133, 216, 174, 68, 217, 133, 217, 133, 68, 217, 133, 217, 137, 68, 217, 133, 217, 138, 68, 217, 134, 216, 172, 68, 217, 134, 216, 173, 68, 217, 134, 216, 174, 68, 217, 134, 216, 177, 68, 217, 134, 216, 178, 68, 217, 134, 217, 133, 68, 217, 134, 217, 134, 68, 217, 134, 217, 135, 68, 217, 134, 217, 137, 68, 217, 134, 217, 138, 68, 217, 135, 216, 172, 68, 217, 135, 217, 133, 68, 217, 135, 217, 137, 68, 217, 135, 217, 138, 68, 217, 136, 217, 180, 68, 217, 138, 216, 172, 68, 217, 138, 216, 173, 68, 217, 138, 216, 174, 68, 217, 138, 216, 177, 68, 217, 138, 216, 178, 68, 217, 138, 217, 133, 68, 217, 138, 217, 134, 68, 217, 138, 217, 135, 68, 217, 138, 217, 137, 68, 217, 138, 217, 138, 68, 217, 138, 217, 180, 68, 219, 135, 217, 180, 69, 40, 225, 132, 128, 41, 69, 40, 225, 132, 130, 41, 69, 40, 225, 132, 131, 41, 69, 40, 225, 132, 133, 41, 69, 40, 225, 132, 134, 41, 69, 40, 225, 132, 135, 41, 69, 40, 225, 132, 137, 41, 69, 40, 225, 132, 139, 41, 69, 40, 225, 132, 140, 41, 69, 40, 225, 132, 142, 41, 69, 40, 225, 132, 143, 41, 69, 40, 225, 132, 144, 41, 69, 40, 225, 132, 145, 41, 69, 40, 225, 132, 146, 41, 69, 40, 228, 184, 128, 41, 69, 40, 228, 184, 131, 41, 69, 40, 228, 184, 137, 41, 69, 40, 228, 185, 157, 41, 69, 40, 228, 186, 140, 41, 69, 40, 228, 186, 148, 41, 69, 40, 228, 187, 163, 41, 69, 40, 228, 188, 129, 41, 69, 40, 228, 188, 145, 41, 69, 40, 229, 133, 171, 41, 69, 40, 229, 133, 173, 41, 69, 40, 229, 138, 180, 41, 69, 40, 229, 141, 129, 41, 69, 40, 229, 141, 148, 41, 69, 40, 229, 144, 141, 41, 69, 40, 229, 145, 188, 41, 69, 40, 229, 155, 155, 41, 69, 40, 229, 156, 159, 41, 69, 40, 229, 173, 166, 41, 69, 40, 230, 151, 165, 41, 69, 40, 230, 156, 136, 41, 69, 40, 230, 156, 137, 41, 69, 40, 230, 156, 168, 41, 69, 40, 230, 160, 170, 41, 69, 40, 230, 176, 180, 41, 69, 40, 231, 129, 171, 41, 69, 40, 231, 137, 185, 41, 69, 40, 231, 155, 163, 41, 69, 40, 231, 164, 190, 41, 69, 40, 231, 165, 157, 41, 69, 40, 231, 165, 173, 41, 69, 40, 232, 135, 170, 41, 69, 40, 232, 135, 179, 41, 69, 40, 232, 178, 161, 41, 69, 40, 232, 179, 135, 41, 69, 40, 233, 135, 145, 41, 69, 48, 226, 129, 132, 51, 69, 49, 48, 230, 151, 165, 69, 49, 48, 230, 156, 136, 69, 49, 48, 231, 130, 185, 69, 49, 49, 230, 151, 165, 69, 49, 49, 230, 156, 136, 69, 49, 49, 231, 130, 185, 69, 49, 50, 230, 151, 165, 69, 49, 50, 230, 156, 136, 69, 49, 50, 231, 130, 185, 69, 49, 51, 230, 151, 165, 69, 49, 51, 231, 130, 185, 69, 49, 52, 230, 151, 165, 69, 49, 52, 231, 130, 185, 69, 49, 53, 230, 151, 165, 69, 49, 53, 231, 130, 185, 69, 49, 54, 230, 151, 165, 69, 49, 54, 231, 130, 185, 69, 49, 55, 230, 151, 165, 69, 49, 55, 231, 130, 185, 69, 49, 56, 230, 151, 165, 69, 49, 56, 231, 130, 185, 69, 49, 57, 230, 151, 165, 69, 49, 57, 231, 130, 185, 69, 49, 226, 129, 132, 50, 69, 49, 226, 129, 132, 51, 69, 49, 226, 129, 132, 52, 69, 49, 226, 129, 132, 53, 69, 49, 226, 129, 132, 54, 69, 49, 226, 129, 132, 55, 69, 49, 226, 129, 132, 56, 69, 49, 226, 129, 132, 57, 69, 50, 48, 230, 151, 165, 69, 50, 48, 231, 130, 185, 69, 50, 49, 230, 151, 165, 69, 50, 49, 231, 130, 185, 69, 50, 50, 230, 151, 165, 69, 50, 50, 231, 130, 185, 69, 50, 51, 230, 151, 165, 69, 50, 51, 231, 130, 185, 69, 50, 52, 230, 151, 165, 69, 50, 52, 231, 130, 185, 69, 50, 53, 230, 151, 165, 69, 50, 54, 230, 151, 165, 69, 50, 55, 230, 151, 165, 69, 50, 56, 230, 151, 165, 69, 50, 57, 230, 151, 165, 69, 50, 226, 129, 132, 51, 69, 50, 226, 129, 132, 53, 69, 51, 48, 230, 151, 165, 69, 51, 49, 230, 151, 165, 69, 51, 226, 129, 132, 52, 69, 51, 226, 129, 132, 53, 69, 51, 226, 129, 132, 56, 69, 52, 226, 129, 132, 53, 69, 53, 226, 129, 132, 54, 69, 53, 226, 129, 132, 56, 69, 55, 226, 129, 132, 56, 69, 65, 226, 136, 149, 109, 69, 86, 226, 136, 149, 109, 69, 109, 226, 136, 149, 115, 70, 49, 226, 129, 132, 49, 48, 70, 67, 226, 136, 149, 107, 103, 70, 109, 226, 136, 149, 115, 50, 70, 216, 168, 216, 173, 217, 138, 70, 216, 168, 216, 174, 217, 138, 70, 216, 170, 216, 172, 217, 133, 70, 216, 170, 216, 172, 217, 137, 70, 216, 170, 216, 172, 217, 138, 70, 216, 170, 216, 173, 216, 172, 70, 216, 170, 216, 173, 217, 133, 70, 216, 170, 216, 174, 217, 133, 70, 216, 170, 216, 174, 217, 137, 70, 216, 170, 216, 174, 217, 138, 70, 216, 170, 217, 133, 216, 172, 70, 216, 170, 217, 133, 216, 173, 70, 216, 170, 217, 133, 216, 174, 70, 216, 170, 217, 133, 217, 137, 70, 216, 170, 217, 133, 217, 138, 70, 216, 172, 216, 173, 217, 137, 70, 216, 172, 216, 173, 217, 138, 70, 216, 172, 217, 133, 216, 173, 70, 216, 172, 217, 133, 217, 137, 70, 216, 172, 217, 133, 217, 138, 70, 216, 173, 216, 172, 217, 138, 70, 216, 173, 217, 133, 217, 137, 70, 216, 173, 217, 133, 217, 138, 70, 216, 179, 216, 172, 216, 173, 70, 216, 179, 216, 172, 217, 137, 70, 216, 179, 216, 173, 216, 172, 70, 216, 179, 216, 174, 217, 137, 70, 216, 179, 216, 174, 217, 138, 70, 216, 179, 217, 133, 216, 172, 70, 216, 179, 217, 133, 216, 173, 70, 216, 179, 217, 133, 217, 133, 70, 216, 180, 216, 172, 217, 138, 70, 216, 180, 216, 173, 217, 133, 70, 216, 180, 216, 173, 217, 138, 70, 216, 180, 217, 133, 216, 174, 70, 216, 180, 217, 133, 217, 133, 70, 216, 181, 216, 173, 216, 173, 70, 216, 181, 216, 173, 217, 138, 70, 216, 181, 217, 132, 217, 137, 70, 216, 181, 217, 132, 219, 146, 70, 216, 181, 217, 133, 217, 133, 70, 216, 182, 216, 173, 217, 137, 70, 216, 182, 216, 173, 217, 138, 70, 216, 182, 216, 174, 217, 133, 70, 216, 183, 217, 133, 216, 173, 70, 216, 183, 217, 133, 217, 133, 70, 216, 183, 217, 133, 217, 138, 70, 216, 185, 216, 172, 217, 133, 70, 216, 185, 217, 133, 217, 133, 70, 216, 185, 217, 133, 217, 137, 70, 216, 185, 217, 133, 217, 138, 70, 216, 186, 217, 133, 217, 133, 70, 216, 186, 217, 133, 217, 137, 70, 216, 186, 217, 133, 217, 138, 70, 217, 129, 216, 174, 217, 133, 70, 217, 129, 217, 133, 217, 138, 70, 217, 130, 217, 132, 219, 146, 70, 217, 130, 217, 133, 216, 173, 70, 217, 130, 217, 133, 217, 133, 70, 217, 130, 217, 133, 217, 138, 70, 217, 131, 217, 133, 217, 133, 70, 217, 131, 217, 133, 217, 138, 70, 217, 132, 216, 172, 216, 172, 70, 217, 132, 216, 172, 217, 133, 70, 217, 132, 216, 172, 217, 138, 70, 217, 132, 216, 173, 217, 133, 70, 217, 132, 216, 173, 217, 137, 70, 217, 132, 216, 173, 217, 138, 70, 217, 132, 216, 174, 217, 133, 70, 217, 132, 217, 133, 216, 173, 70, 217, 132, 217, 133, 217, 138, 70, 217, 133, 216, 172, 216, 173, 70, 217, 133, 216, 172, 216, 174, 70, 217, 133, 216, 172, 217, 133, 70, 217, 133, 216, 172, 217, 138, 70, 217, 133, 216, 173, 216, 172, 70, 217, 133, 216, 173, 217, 133, 70, 217, 133, 216, 173, 217, 138, 70, 217, 133, 216, 174, 216, 172, 70, 217, 133, 216, 174, 217, 133, 70, 217, 133, 216, 174, 217, 138, 70, 217, 133, 217, 133, 217, 138, 70, 217, 134, 216, 172, 216, 173, 70, 217, 134, 216, 172, 217, 133, 70, 217, 134, 216, 172, 217, 137, 70, 217, 134, 216, 172, 217, 138, 70, 217, 134, 216, 173, 217, 133, 70, 217, 134, 216, 173, 217, 137, 70, 217, 134, 216, 173, 217, 138, 70, 217, 134, 217, 133, 217, 137, 70, 217, 134, 217, 133, 217, 138, 70, 217, 135, 217, 133, 216, 172, 70, 217, 135, 217, 133, 217, 133, 70, 217, 138, 216, 172, 217, 138, 70, 217, 138, 216, 173, 217, 138, 70, 217, 138, 217, 133, 217, 133, 70, 217, 138, 217, 133, 217, 138, 70, 217, 138, 217, 148, 216, 167, 70, 217, 138, 217, 148, 216, 172, 70, 217, 138, 217, 148, 216, 173, 70, 217, 138, 217, 148, 216, 174, 70, 217, 138, 217, 148, 216, 177, 70, 217, 138, 217, 148, 216, 178, 70, 217, 138, 217, 148, 217, 133, 70, 217, 138, 217, 148, 217, 134, 70, 217, 138, 217, 148, 217, 135, 70, 217, 138, 217, 148, 217, 136, 70, 217, 138, 217, 148, 217, 137, 70, 217, 138, 217, 148, 217, 138, 70, 217, 138, 217, 148, 219, 134, 70, 217, 138, 217, 148, 219, 135, 70, 217, 138, 217, 148, 219, 136, 70, 217, 138, 217, 148, 219, 144, 70, 217, 138, 217, 148, 219, 149, 70, 224, 185, 141, 224, 184, 178, 70, 224, 186, 171, 224, 186, 153, 70, 224, 186, 171, 224, 186, 161, 70, 224, 187, 141, 224, 186, 178, 70, 224, 189, 128, 224, 190, 181, 70, 224, 189, 130, 224, 190, 183, 70, 224, 189, 140, 224, 190, 183, 70, 224, 189, 145, 224, 190, 183, 70, 224, 189, 150, 224, 190, 183, 70, 224, 189, 155, 224, 190, 183, 70, 224, 190, 144, 224, 190, 181, 70, 224, 190, 146, 224, 190, 183, 70, 224, 190, 156, 224, 190, 183, 70, 224, 190, 161, 224, 190, 183, 70, 224, 190, 166, 224, 190, 183, 70, 224, 190, 171, 224, 190, 183, 70, 226, 128, 178, 226, 128, 178, 70, 226, 128, 181, 226, 128, 181, 70, 226, 136, 171, 226, 136, 171, 70, 226, 136, 174, 226, 136, 174, 70, 227, 129, 187, 227, 129, 139, 70, 227, 130, 136, 227, 130, 138, 70, 227, 130, 173, 227, 131, 173, 70, 227, 130, 179, 227, 130, 179, 70, 227, 130, 179, 227, 131, 136, 70, 227, 131, 136, 227, 131, 179, 70, 227, 131, 138, 227, 131, 142, 70, 227, 131, 155, 227, 131, 179, 70, 227, 131, 159, 227, 131, 170, 70, 227, 131, 170, 227, 131, 169, 70, 227, 131, 172, 227, 131, 160, 70, 228, 187, 164, 229, 146, 140, 70, 229, 164, 167, 230, 173, 163, 70, 229, 185, 179, 230, 136, 144, 70, 230, 152, 142, 230, 178, 187, 70, 230, 152, 173, 229, 146, 140, 71, 114, 97, 100, 226, 136, 149, 115, 71, 227, 128, 148, 83, 227, 128, 149, 72, 40, 225, 132, 128, 225, 133, 161, 41, 72, 40, 225, 132, 130, 225, 133, 161, 41, 72, 40, 225, 132, 131, 225, 133, 161, 41, 72, 40, 225, 132, 133, 225, 133, 161, 41, 72, 40, 225, 132, 134, 225, 133, 161, 41, 72, 40, 225, 132, 135, 225, 133, 161, 41, 72, 40, 225, 132, 137, 225, 133, 161, 41, 72, 40, 225, 132, 139, 225, 133, 161, 41, 72, 40, 225, 132, 140, 225, 133, 161, 41, 72, 40, 225, 132, 140, 225, 133, 174, 41, 72, 40, 225, 132, 142, 225, 133, 161, 41, 72, 40, 225, 132, 143, 225, 133, 161, 41, 72, 40, 225, 132, 144, 225, 133, 161, 41, 72, 40, 225, 132, 145, 225, 133, 161, 41, 72, 40, 225, 132, 146, 225, 133, 161, 41, 72, 114, 97, 100, 226, 136, 149, 115, 50, 72, 216, 167, 217, 131, 216, 168, 216, 177, 72, 216, 167, 217, 132, 217, 132, 217, 135, 72, 216, 177, 216, 179, 217, 136, 217, 132, 72, 216, 177, 219, 140, 216, 167, 217, 132, 72, 216, 181, 217, 132, 216, 185, 217, 133, 72, 216, 185, 217, 132, 217, 138, 217, 135, 72, 217, 133, 216, 173, 217, 133, 216, 175, 72, 217, 136, 216, 179, 217, 132, 217, 133, 73, 226, 128, 178, 226, 128, 178, 226, 128, 178, 73, 226, 128, 181, 226, 128, 181, 226, 128, 181, 73, 226, 136, 171, 226, 136, 171, 226, 136, 171, 73, 226, 136, 174, 226, 136, 174, 226, 136, 174, 73, 227, 128, 148, 228, 184, 137, 227, 128, 149, 73, 227, 128, 148, 228, 186, 140, 227, 128, 149, 73, 227, 128, 148, 229, 139, 157, 227, 128, 149, 73, 227, 128, 148, 229, 174, 137, 227, 128, 149, 73, 227, 128, 148, 230, 137, 147, 227, 128, 149, 73, 227, 128, 148, 230, 149, 151, 227, 128, 149, 73, 227, 128, 148, 230, 156, 172, 227, 128, 149, 73, 227, 128, 148, 231, 130, 185, 227, 128, 149, 73, 227, 128, 148, 231, 155, 151, 227, 128, 149, 73, 227, 130, 162, 227, 131, 188, 227, 131, 171, 73, 227, 130, 164, 227, 131, 179, 227, 131, 129, 73, 227, 130, 166, 227, 130, 169, 227, 131, 179, 73, 227, 130, 170, 227, 131, 179, 227, 130, 185, 73, 227, 130, 170, 227, 131, 188, 227, 131, 160, 73, 227, 130, 171, 227, 130, 164, 227, 131, 170, 73, 227, 130, 177, 227, 131, 188, 227, 130, 185, 73, 227, 130, 179, 227, 131, 171, 227, 131, 138, 73, 227, 130, 187, 227, 131, 179, 227, 131, 129, 73, 227, 130, 187, 227, 131, 179, 227, 131, 136, 73, 227, 131, 134, 227, 130, 153, 227, 130, 183, 73, 227, 131, 136, 227, 130, 153, 227, 131, 171, 73, 227, 131, 142, 227, 131, 131, 227, 131, 136, 73, 227, 131, 143, 227, 130, 164, 227, 131, 132, 73, 227, 131, 146, 227, 130, 153, 227, 131, 171, 73, 227, 131, 146, 227, 130, 154, 227, 130, 179, 73, 227, 131, 149, 227, 131, 169, 227, 131, 179, 73, 227, 131, 152, 227, 130, 154, 227, 130, 189, 73, 227, 131, 152, 227, 131, 171, 227, 131, 132, 73, 227, 131, 155, 227, 131, 188, 227, 131, 171, 73, 227, 131, 155, 227, 131, 188, 227, 131, 179, 73, 227, 131, 158, 227, 130, 164, 227, 131, 171, 73, 227, 131, 158, 227, 131, 131, 227, 131, 143, 73, 227, 131, 158, 227, 131, 171, 227, 130, 175, 73, 227, 131, 164, 227, 131, 188, 227, 131, 171, 73, 227, 131, 166, 227, 130, 162, 227, 131, 179, 73, 227, 131, 175, 227, 131, 131, 227, 131, 136, 76, 226, 128, 178, 226, 128, 178, 226, 128, 178, 226, 128, 178, 76, 226, 136, 171, 226, 136, 171, 226, 136, 171, 226, 136, 171, 76, 227, 130, 162, 227, 131, 171, 227, 131, 149, 227, 130, 161, 76, 227, 130, 168, 227, 131, 188, 227, 130, 171, 227, 131, 188, 76, 227, 130, 171, 227, 130, 153, 227, 131, 173, 227, 131, 179, 76, 227, 130, 171, 227, 130, 153, 227, 131, 179, 227, 131, 158, 76, 227, 130, 171, 227, 131, 169, 227, 131, 131, 227, 131, 136, 76, 227, 130, 171, 227, 131, 173, 227, 131, 170, 227, 131, 188, 76, 227, 130, 173, 227, 130, 153, 227, 131, 139, 227, 131, 188, 76, 227, 130, 173, 227, 131, 165, 227, 131, 170, 227, 131, 188, 76, 227, 130, 175, 227, 130, 153, 227, 131, 169, 227, 131, 160, 76, 227, 130, 175, 227, 131, 173, 227, 131, 188, 227, 131, 141, 76, 227, 130, 181, 227, 130, 164, 227, 130, 175, 227, 131, 171, 76, 227, 130, 191, 227, 130, 153, 227, 131, 188, 227, 130, 185, 76, 227, 131, 143, 227, 130, 154, 227, 131, 188, 227, 131, 132, 76, 227, 131, 146, 227, 130, 154, 227, 130, 175, 227, 131, 171, 76, 227, 131, 149, 227, 130, 163, 227, 131, 188, 227, 131, 136, 76, 227, 131, 152, 227, 130, 153, 227, 131, 188, 227, 130, 191, 76, 227, 131, 152, 227, 130, 154, 227, 131, 139, 227, 131, 146, 76, 227, 131, 152, 227, 130, 154, 227, 131, 179, 227, 130, 185, 76, 227, 131, 155, 227, 130, 153, 227, 131, 171, 227, 131, 136, 76, 227, 131, 158, 227, 130, 164, 227, 130, 175, 227, 131, 173, 76, 227, 131, 159, 227, 130, 175, 227, 131, 173, 227, 131, 179, 76, 227, 131, 161, 227, 131, 188, 227, 131, 136, 227, 131, 171, 76, 227, 131, 170, 227, 131, 131, 227, 131, 136, 227, 131, 171, 76, 227, 131, 171, 227, 131, 146, 227, 130, 154, 227, 131, 188, 76, 230, 160, 170, 229, 188, 143, 228, 188, 154, 231, 164, 190, 78, 40, 225, 132, 139, 225, 133, 169, 225, 132, 146, 225, 133, 174, 41, 79, 216, 172, 217, 132, 32, 216, 172, 217, 132, 216, 167, 217, 132, 217, 135, 79, 227, 130, 162, 227, 131, 143, 227, 130, 154, 227, 131, 188, 227, 131, 136, 79, 227, 130, 162, 227, 131, 179, 227, 131, 152, 227, 130, 154, 227, 130, 162, 79, 227, 130, 173, 227, 131, 173, 227, 131, 175, 227, 131, 131, 227, 131, 136, 79, 227, 130, 181, 227, 131, 179, 227, 131, 129, 227, 131, 188, 227, 131, 160, 79, 227, 131, 143, 227, 130, 153, 227, 131, 188, 227, 131, 172, 227, 131, 171, 79, 227, 131, 152, 227, 130, 175, 227, 130, 191, 227, 131, 188, 227, 131, 171, 79, 227, 131, 155, 227, 130, 154, 227, 130, 164, 227, 131, 179, 227, 131, 136, 79, 227, 131, 158, 227, 131, 179, 227, 130, 183, 227, 131, 167, 227, 131, 179, 79, 227, 131, 161, 227, 130, 171, 227, 130, 153, 227, 131, 136, 227, 131, 179, 79, 227, 131, 171, 227, 131, 188, 227, 131, 149, 227, 130, 153, 227, 131, 171, 81, 40, 225, 132, 139, 225, 133, 169, 225, 132, 140, 225, 133, 165, 225, 134, 171, 41, 82, 227, 130, 173, 227, 130, 153, 227, 131, 171, 227, 130, 191, 227, 130, 153, 227, 131, 188, 82, 227, 130, 173, 227, 131, 173, 227, 130, 175, 227, 130, 153, 227, 131, 169, 227, 131, 160, 82, 227, 130, 173, 227, 131, 173, 227, 131, 161, 227, 131, 188, 227, 131, 136, 227, 131, 171, 82, 227, 130, 175, 227, 130, 153, 227, 131, 169, 227, 131, 160, 227, 131, 136, 227, 131, 179, 82, 227, 130, 175, 227, 131, 171, 227, 130, 187, 227, 130, 153, 227, 130, 164, 227, 131, 173, 82, 227, 131, 143, 227, 130, 154, 227, 131, 188, 227, 130, 187, 227, 131, 179, 227, 131, 136, 82, 227, 131, 146, 227, 130, 154, 227, 130, 162, 227, 130, 185, 227, 131, 136, 227, 131, 171, 82, 227, 131, 149, 227, 130, 153, 227, 131, 131, 227, 130, 183, 227, 130, 167, 227, 131, 171, 82, 227, 131, 159, 227, 131, 170, 227, 131, 143, 227, 130, 153, 227, 131, 188, 227, 131, 171, 82, 227, 131, 172, 227, 131, 179, 227, 131, 136, 227, 130, 177, 227, 130, 153, 227, 131, 179, 97, 216, 181, 217, 132, 217, 137, 32, 216, 167, 217, 132, 217, 132, 217, 135, 32, 216, 185, 217, 132, 217, 138, 217, 135, 32, 217, 136, 216, 179, 217, 132, 217, 133, 6, 224, 167, 135, 224, 166, 190, 1, 6, 224, 167, 135, 224, 167, 151, 1, 6, 224, 173, 135, 224, 172, 190, 1, 6, 224, 173, 135, 224, 173, 150, 1, 6, 224, 173, 135, 224, 173, 151, 1, 6, 224, 174, 146, 224, 175, 151, 1, 6, 224, 175, 134, 224, 174, 190, 1, 6, 224, 175, 134, 224, 175, 151, 1, 6, 224, 175, 135, 224, 174, 190, 1, 6, 224, 178, 191, 224, 179, 149, 1, 6, 224, 179, 134, 224, 179, 149, 1, 6, 224, 179, 134, 224, 179, 150, 1, 6, 224, 181, 134, 224, 180, 190, 1, 6, 224, 181, 134, 224, 181, 151, 1, 6, 224, 181, 135, 224, 180, 190, 1, 6, 224, 183, 153, 224, 183, 159, 1, 6, 225, 128, 165, 225, 128, 174, 1, 6, 225, 172, 133, 225, 172, 181, 1, 6, 225, 172, 135, 225, 172, 181, 1, 6, 225, 172, 137, 225, 172, 181, 1, 6, 225, 172, 139, 225, 172, 181, 1, 6, 225, 172, 141, 225, 172, 181, 1, 6, 225, 172, 145, 225, 172, 181, 1, 6, 225, 172, 186, 225, 172, 181, 1, 6, 225, 172, 188, 225, 172, 181, 1, 6, 225, 172, 190, 225, 172, 181, 1, 6, 225, 172, 191, 225, 172, 181, 1, 6, 225, 173, 130, 225, 172, 181, 1, 8, 240, 145, 132, 177, 240, 145, 132, 167, 1, 8, 240, 145, 132, 178, 240, 145, 132, 167, 1, 8, 240, 145, 141, 135, 240, 145, 140, 190, 1, 8, 240, 145, 141, 135, 240, 145, 141, 151, 1, 8, 240, 145, 146, 185, 240, 145, 146, 176, 1, 8, 240, 145, 146, 185, 240, 145, 146, 186, 1, 8, 240, 145, 146, 185, 240, 145, 146, 189, 1, 8, 240, 145, 150, 184, 240, 145, 150, 175, 1, 8, 240, 145, 150, 185, 240, 145, 150, 175, 1, 8, 240, 145, 164, 181, 240, 145, 164, 176, 1, 9, 224, 179, 134, 224, 179, 130, 224, 179, 149, 2, 9, 224, 183, 153, 224, 183, 143, 224, 183, 138, 22, 68, 68, 90, 204, 140, 205, 68, 68, 122, 204, 140, 205, 68, 100, 122, 204, 140, 205, 70, 217, 132, 216, 167, 217, 147, 205, 70, 217, 132, 216, 167, 217, 148, 205, 70, 217, 132, 216, 167, 217, 149, 185, 70, 225, 132, 128, 225, 133, 161, 1, 70, 225, 132, 130, 225, 133, 161, 1, 70, 225, 132, 131, 225, 133, 161, 1, 70, 225, 132, 133, 225, 133, 161, 1, 70, 225, 132, 134, 225, 133, 161, 1, 70, 225, 132, 135, 225, 133, 161, 1, 70, 225, 132, 137, 225, 133, 161, 1, 70, 225, 132, 139, 225, 133, 161, 1, 70, 225, 132, 139, 225, 133, 174, 1, 70, 225, 132, 140, 225, 133, 161, 1, 70, 225, 132, 142, 225, 133, 161, 1, 70, 225, 132, 143, 225, 133, 161, 1, 70, 225, 132, 144, 225, 133, 161, 1, 70, 225, 132, 145, 225, 133, 161, 1, 70, 225, 132, 146, 225, 133, 161, 1, 73, 227, 131, 161, 227, 130, 171, 227, 130, 153, 17, 76, 225, 132, 140, 225, 133, 174, 225, 132, 139, 225, 133, 180, 1, 76, 227, 130, 173, 227, 130, 153, 227, 130, 171, 227, 130, 153, 17, 76, 227, 130, 179, 227, 131, 188, 227, 131, 155, 227, 130, 154, 17, 76, 227, 131, 164, 227, 131, 188, 227, 131, 136, 227, 130, 153, 17, 79, 225, 132, 142, 225, 133, 161, 225, 134, 183, 225, 132, 128, 225, 133, 169, 1, 79, 227, 130, 164, 227, 131, 139, 227, 131, 179, 227, 130, 175, 227, 130, 153, 17, 79, 227, 130, 183, 227, 131, 170, 227, 131, 179, 227, 130, 175, 227, 130, 153, 17, 79, 227, 131, 152, 227, 130, 154, 227, 131, 188, 227, 130, 183, 227, 130, 153, 17, 79, 227, 131, 155, 227, 130, 154, 227, 131, 179, 227, 131, 136, 227, 130, 153, 17, 82, 227, 130, 168, 227, 130, 185, 227, 130, 175, 227, 131, 188, 227, 131, 136, 227, 130, 153, 17, 82, 227, 131, 149, 227, 130, 161, 227, 131, 169, 227, 131, 131, 227, 131, 136, 227, 130, 153, 17, 134, 224, 179, 134, 224, 179, 130, 1, 134, 224, 183, 153, 224, 183, 143, 1, 3, 60, 204, 184, 5, 3, 61, 204, 184, 5, 3, 62, 204, 184, 5, 3, 65, 204, 128, 205, 3, 65, 204, 129, 205, 3, 65, 204, 131, 205, 3, 65, 204, 132, 205, 3, 65, 204, 137, 205, 3, 65, 204, 140, 205, 3, 65, 204, 143, 205, 3, 65, 204, 145, 205, 3, 65, 204, 165, 185, 3, 65, 204, 168, 169, 3, 66, 204, 135, 205, 3, 66, 204, 163, 185, 3, 66, 204, 177, 185, 3, 67, 204, 129, 205, 3, 67, 204, 130, 205, 3, 67, 204, 135, 205, 3, 67, 204, 140, 205, 3, 68, 204, 135, 205, 3, 68, 204, 140, 205, 3, 68, 204, 163, 185, 3, 68, 204, 167, 169, 3, 68, 204, 173, 185, 3, 68, 204, 177, 185, 3, 69, 204, 128, 205, 3, 69, 204, 129, 205, 3, 69, 204, 131, 205, 3, 69, 204, 134, 205, 3, 69, 204, 135, 205, 3, 69, 204, 136, 205, 3, 69, 204, 137, 205, 3, 69, 204, 140, 205, 3, 69, 204, 143, 205, 3, 69, 204, 145, 205, 3, 69, 204, 168, 169, 3, 69, 204, 173, 185, 3, 69, 204, 176, 185, 3, 70, 204, 135, 205, 3, 71, 204, 129, 205, 3, 71, 204, 130, 205, 3, 71, 204, 132, 205, 3, 71, 204, 134, 205, 3, 71, 204, 135, 205, 3, 71, 204, 140, 205, 3, 71, 204, 167, 169, 3, 72, 204, 130, 205, 3, 72, 204, 135, 205, 3, 72, 204, 136, 205, 3, 72, 204, 140, 205, 3, 72, 204, 163, 185, 3, 72, 204, 167, 169, 3, 72, 204, 174, 185, 3, 73, 204, 128, 205, 3, 73, 204, 129, 205, 3, 73, 204, 130, 205, 3, 73, 204, 131, 205, 3, 73, 204, 132, 205, 3, 73, 204, 134, 205, 3, 73, 204, 135, 205, 3, 73, 204, 137, 205, 3, 73, 204, 140, 205, 3, 73, 204, 143, 205, 3, 73, 204, 145, 205, 3, 73, 204, 163, 185, 3, 73, 204, 168, 169, 3, 73, 204, 176, 185, 3, 74, 204, 130, 205, 3, 75, 204, 129, 205, 3, 75, 204, 140, 205, 3, 75, 204, 163, 185, 3, 75, 204, 167, 169, 3, 75, 204, 177, 185, 3, 76, 204, 129, 205, 3, 76, 204, 140, 205, 3, 76, 204, 167, 169, 3, 76, 204, 173, 185, 3, 76, 204, 177, 185, 3, 77, 204, 129, 205, 3, 77, 204, 135, 205, 3, 77, 204, 163, 185, 3, 78, 204, 128, 205, 3, 78, 204, 129, 205, 3, 78, 204, 131, 205, 3, 78, 204, 135, 205, 3, 78, 204, 140, 205, 3, 78, 204, 163, 185, 3, 78, 204, 167, 169, 3, 78, 204, 173, 185, 3, 78, 204, 177, 185, 3, 79, 204, 128, 205, 3, 79, 204, 129, 205, 3, 79, 204, 134, 205, 3, 79, 204, 137, 205, 3, 79, 204, 139, 205, 3, 79, 204, 140, 205, 3, 79, 204, 143, 205, 3, 79, 204, 145, 205, 3, 80, 204, 129, 205, 3, 80, 204, 135, 205, 3, 82, 204, 129, 205, 3, 82, 204, 135, 205, 3, 82, 204, 140, 205, 3, 82, 204, 143, 205, 3, 82, 204, 145, 205, 3, 82, 204, 167, 169, 3, 82, 204, 177, 185, 3, 83, 204, 130, 205, 3, 83, 204, 135, 205, 3, 83, 204, 166, 185, 3, 83, 204, 167, 169, 3, 84, 204, 135, 205, 3, 84, 204, 140, 205, 3, 84, 204, 163, 185, 3, 84, 204, 166, 185, 3, 84, 204, 167, 169, 3, 84, 204, 173, 185, 3, 84, 204, 177, 185, 3, 85, 204, 128, 205, 3, 85, 204, 129, 205, 3, 85, 204, 130, 205, 3, 85, 204, 134, 205, 3, 85, 204, 137, 205, 3, 85, 204, 138, 205, 3, 85, 204, 139, 205, 3, 85, 204, 140, 205, 3, 85, 204, 143, 205, 3, 85, 204, 145, 205, 3, 85, 204, 163, 185, 3, 85, 204, 164, 185, 3, 85, 204, 168, 169, 3, 85, 204, 173, 185, 3, 85, 204, 176, 185, 3, 86, 204, 131, 205, 3, 86, 204, 163, 185, 3, 87, 204, 128, 205, 3, 87, 204, 129, 205, 3, 87, 204, 130, 205, 3, 87, 204, 135, 205, 3, 87, 204, 136, 205, 3, 87, 204, 163, 185, 3, 88, 204, 135, 205, 3, 88, 204, 136, 205, 3, 89, 204, 128, 205, 3, 89, 204, 129, 205, 3, 89, 204, 130, 205, 3, 89, 204, 131, 205, 3, 89, 204, 132, 205, 3, 89, 204, 135, 205, 3, 89, 204, 136, 205, 3, 89, 204, 137, 205, 3, 89, 204, 163, 185, 3, 90, 204, 129, 205, 3, 90, 204, 130, 205, 3, 90, 204, 135, 205, 3, 90, 204, 140, 205, 3, 90, 204, 163, 185, 3, 90, 204, 177, 185, 3, 97, 204, 128, 205, 3, 97, 204, 129, 205, 3, 97, 204, 131, 205, 3, 97, 204, 132, 205, 3, 97, 204, 137, 205, 3, 97, 204, 140, 205, 3, 97, 204, 143, 205, 3, 97, 204, 145, 205, 3, 97, 204, 165, 185, 3, 97, 204, 168, 169, 3, 98, 204, 135, 205, 3, 98, 204, 163, 185, 3, 98, 204, 177, 185, 3, 99, 204, 129, 205, 3, 99, 204, 130, 205, 3, 99, 204, 135, 205, 3, 99, 204, 140, 205, 3, 100, 204, 135, 205, 3, 100, 204, 140, 205, 3, 100, 204, 163, 185, 3, 100, 204, 167, 169, 3, 100, 204, 173, 185, 3, 100, 204, 177, 185, 3, 101, 204, 128, 205, 3, 101, 204, 129, 205, 3, 101, 204, 131, 205, 3, 101, 204, 134, 205, 3, 101, 204, 135, 205, 3, 101, 204, 136, 205, 3, 101, 204, 137, 205, 3, 101, 204, 140, 205, 3, 101, 204, 143, 205, 3, 101, 204, 145, 205, 3, 101, 204, 168, 169, 3, 101, 204, 173, 185, 3, 101, 204, 176, 185, 3, 102, 204, 135, 205, 3, 103, 204, 129, 205, 3, 103, 204, 130, 205, 3, 103, 204, 132, 205, 3, 103, 204, 134, 205, 3, 103, 204, 135, 205, 3, 103, 204, 140, 205, 3, 103, 204, 167, 169, 3, 104, 204, 130, 205, 3, 104, 204, 135, 205, 3, 104, 204, 136, 205, 3, 104, 204, 140, 205, 3, 104, 204, 163, 185, 3, 104, 204, 167, 169, 3, 104, 204, 174, 185, 3, 104, 204, 177, 185, 3, 105, 204, 128, 205, 3, 105, 204, 129, 205, 3, 105, 204, 130, 205, 3, 105, 204, 131, 205, 3, 105, 204, 132, 205, 3, 105, 204, 134, 205, 3, 105, 204, 137, 205, 3, 105, 204, 140, 205, 3, 105, 204, 143, 205, 3, 105, 204, 145, 205, 3, 105, 204, 163, 185, 3, 105, 204, 168, 169, 3, 105, 204, 176, 185, 3, 106, 204, 130, 205, 3, 106, 204, 140, 205, 3, 107, 204, 129, 205, 3, 107, 204, 140, 205, 3, 107, 204, 163, 185, 3, 107, 204, 167, 169, 3, 107, 204, 177, 185, 3, 108, 204, 129, 205, 3, 108, 204, 140, 205, 3, 108, 204, 167, 169, 3, 108, 204, 173, 185, 3, 108, 204, 177, 185, 3, 109, 204, 129, 205, 3, 109, 204, 135, 205, 3, 109, 204, 163, 185, 3, 110, 204, 128, 205, 3, 110, 204, 129, 205, 3, 110, 204, 131, 205, 3, 110, 204, 135, 205, 3, 110, 204, 140, 205, 3, 110, 204, 163, 185, 3, 110, 204, 167, 169, 3, 110, 204, 173, 185, 3, 110, 204, 177, 185, 3, 111, 204, 128, 205, 3, 111, 204, 129, 205, 3, 111, 204, 134, 205, 3, 111, 204, 137, 205, 3, 111, 204, 139, 205, 3, 111, 204, 140, 205, 3, 111, 204, 143, 205, 3, 111, 204, 145, 205, 3, 112, 204, 129, 205, 3, 112, 204, 135, 205, 3, 114, 204, 129, 205, 3, 114, 204, 135, 205, 3, 114, 204, 140, 205, 3, 114, 204, 143, 205, 3, 114, 204, 145, 205, 3, 114, 204, 167, 169, 3, 114, 204, 177, 185, 3, 115, 204, 130, 205, 3, 115, 204, 135, 205, 3, 115, 204, 166, 185, 3, 115, 204, 167, 169, 3, 116, 204, 135, 205, 3, 116, 204, 136, 205, 3, 116, 204, 140, 205, 3, 116, 204, 163, 185, 3, 116, 204, 166, 185, 3, 116, 204, 167, 169, 3, 116, 204, 173, 185, 3, 116, 204, 177, 185, 3, 117, 204, 128, 205, 3, 117, 204, 129, 205, 3, 117, 204, 130, 205, 3, 117, 204, 134, 205, 3, 117, 204, 137, 205, 3, 117, 204, 138, 205, 3, 117, 204, 139, 205, 3, 117, 204, 140, 205, 3, 117, 204, 143, 205, 3, 117, 204, 145, 205, 3, 117, 204, 163, 185, 3, 117, 204, 164, 185, 3, 117, 204, 168, 169, 3, 117, 204, 173, 185, 3, 117, 204, 176, 185, 3, 118, 204, 131, 205, 3, 118, 204, 163, 185, 3, 119, 204, 128, 205, 3, 119, 204, 129, 205, 3, 119, 204, 130, 205, 3, 119, 204, 135, 205, 3, 119, 204, 136, 205, 3, 119, 204, 138, 205, 3, 119, 204, 163, 185, 3, 120, 204, 135, 205, 3, 120, 204, 136, 205, 3, 121, 204, 128, 205, 3, 121, 204, 129, 205, 3, 121, 204, 130, 205, 3, 121, 204, 131, 205, 3, 121, 204, 132, 205, 3, 121, 204, 135, 205, 3, 121, 204, 136, 205, 3, 121, 204, 137, 205, 3, 121, 204, 138, 205, 3, 121, 204, 163, 185, 3, 122, 204, 129, 205, 3, 122, 204, 130, 205, 3, 122, 204, 135, 205, 3, 122, 204, 140, 205, 3, 122, 204, 163, 185, 3, 122, 204, 177, 185, 4, 194, 168, 204, 128, 206, 4, 194, 168, 204, 129, 206, 4, 194, 168, 205, 130, 206, 4, 195, 134, 204, 129, 205, 4, 195, 134, 204, 132, 205, 4, 195, 152, 204, 129, 205, 4, 195, 166, 204, 129, 205, 4, 195, 166, 204, 132, 205, 4, 195, 184, 204, 129, 205, 4, 197, 191, 204, 135, 205, 4, 198, 183, 204, 140, 205, 4, 202, 146, 204, 140, 205, 4, 206, 145, 204, 128, 205, 4, 206, 145, 204, 129, 205, 4, 206, 145, 204, 132, 205, 4, 206, 145, 204, 134, 205, 4, 206, 145, 205, 133, 221, 4, 206, 149, 204, 128, 205, 4, 206, 149, 204, 129, 205, 4, 206, 151, 204, 128, 205, 4, 206, 151, 204, 129, 205, 4, 206, 151, 205, 133, 221, 4, 206, 153, 204, 128, 205, 4, 206, 153, 204, 129, 205, 4, 206, 153, 204, 132, 205, 4, 206, 153, 204, 134, 205, 4, 206, 153, 204, 136, 205, 4, 206, 159, 204, 128, 205, 4, 206, 159, 204, 129, 205, 4, 206, 161, 204, 148, 205, 4, 206, 165, 204, 128, 205, 4, 206, 165, 204, 129, 205, 4, 206, 165, 204, 132, 205, 4, 206, 165, 204, 134, 205, 4, 206, 165, 204, 136, 205, 4, 206, 169, 204, 128, 205, 4, 206, 169, 204, 129, 205, 4, 206, 169, 205, 133, 221, 4, 206, 177, 204, 132, 205, 4, 206, 177, 204, 134, 205, 4, 206, 177, 205, 133, 221, 4, 206, 181, 204, 128, 205, 4, 206, 181, 204, 129, 205, 4, 206, 183, 205, 133, 221, 4, 206, 185, 204, 128, 205, 4, 206, 185, 204, 129, 205, 4, 206, 185, 204, 132, 205, 4, 206, 185, 204, 134, 205, 4, 206, 185, 205, 130, 205, 4, 206, 191, 204, 128, 205, 4, 206, 191, 204, 129, 205, 4, 207, 129, 204, 147, 205, 4, 207, 129, 204, 148, 205, 4, 207, 133, 204, 128, 205, 4, 207, 133, 204, 129, 205, 4, 207, 133, 204, 132, 205, 4, 207, 133, 204, 134, 205, 4, 207, 133, 205, 130, 205, 4, 207, 137, 205, 133, 221, 4, 207, 146, 204, 129, 205, 4, 207, 146, 204, 136, 205, 4, 208, 134, 204, 136, 205, 4, 208, 144, 204, 134, 205, 4, 208, 144, 204, 136, 205, 4, 208, 147, 204, 129, 205, 4, 208, 149, 204, 128, 205, 4, 208, 149, 204, 134, 205, 4, 208, 149, 204, 136, 205, 4, 208, 150, 204, 134, 205, 4, 208, 150, 204, 136, 205, 4, 208, 151, 204, 136, 205, 4, 208, 152, 204, 128, 205, 4, 208, 152, 204, 132, 205, 4, 208, 152, 204, 134, 205, 4, 208, 152, 204, 136, 205, 4, 208, 154, 204, 129, 205, 4, 208, 158, 204, 136, 205, 4, 208, 163, 204, 132, 205, 4, 208, 163, 204, 134, 205, 4, 208, 163, 204, 136, 205, 4, 208, 163, 204, 139, 205, 4, 208, 167, 204, 136, 205, 4, 208, 171, 204, 136, 205, 4, 208, 173, 204, 136, 205, 4, 208, 176, 204, 134, 205, 4, 208, 176, 204, 136, 205, 4, 208, 179, 204, 129, 205, 4, 208, 181, 204, 128, 205, 4, 208, 181, 204, 134, 205, 4, 208, 181, 204, 136, 205, 4, 208, 182, 204, 134, 205, 4, 208, 182, 204, 136, 205, 4, 208, 183, 204, 136, 205, 4, 208, 184, 204, 128, 205, 4, 208, 184, 204, 132, 205, 4, 208, 184, 204, 134, 205, 4, 208, 184, 204, 136, 205, 4, 208, 186, 204, 129, 205, 4, 208, 190, 204, 136, 205, 4, 209, 131, 204, 132, 205, 4, 209, 131, 204, 134, 205, 4, 209, 131, 204, 136, 205, 4, 209, 131, 204, 139, 205, 4, 209, 135, 204, 136, 205, 4, 209, 139, 204, 136, 205, 4, 209, 141, 204, 136, 205, 4, 209, 150, 204, 136, 205, 4, 209, 180, 204, 143, 205, 4, 209, 181, 204, 143, 205, 4, 211, 152, 204, 136, 205, 4, 211, 153, 204, 136, 205, 4, 211, 168, 204, 136, 205, 4, 211, 169, 204, 136, 205, 4, 216, 167, 217, 147, 205, 4, 216, 167, 217, 148, 205, 4, 216, 167, 217, 149, 185, 4, 217, 136, 217, 148, 205, 4, 217, 138, 217, 148, 205, 4, 219, 129, 217, 148, 205, 4, 219, 146, 217, 148, 205, 4, 219, 149, 217, 148, 205, 5, 65, 204, 130, 204, 128, 206, 5, 65, 204, 130, 204, 129, 206, 5, 65, 204, 130, 204, 131, 206, 5, 65, 204, 130, 204, 137, 206, 5, 65, 204, 134, 204, 128, 206, 5, 65, 204, 134, 204, 129, 206, 5, 65, 204, 134, 204, 131, 206, 5, 65, 204, 134, 204, 137, 206, 5, 65, 204, 135, 204, 132, 206, 5, 65, 204, 136, 204, 132, 206, 5, 65, 204, 138, 204, 129, 206, 5, 65, 204, 163, 204, 130, 206, 5, 65, 204, 163, 204, 134, 206, 5, 67, 204, 167, 204, 129, 206, 5, 69, 204, 130, 204, 128, 206, 5, 69, 204, 130, 204, 129, 206, 5, 69, 204, 130, 204, 131, 206, 5, 69, 204, 130, 204, 137, 206, 5, 69, 204, 132, 204, 128, 206, 5, 69, 204, 132, 204, 129, 206, 5, 69, 204, 163, 204, 130, 206, 5, 69, 204, 167, 204, 134, 206, 5, 73, 204, 136, 204, 129, 206, 5, 76, 204, 163, 204, 132, 206, 5, 79, 204, 130, 204, 128, 206, 5, 79, 204, 130, 204, 129, 206, 5, 79, 204, 130, 204, 131, 206, 5, 79, 204, 130, 204, 137, 206, 5, 79, 204, 131, 204, 129, 206, 5, 79, 204, 131, 204, 132, 206, 5, 79, 204, 131, 204, 136, 206, 5, 79, 204, 132, 204, 128, 206, 5, 79, 204, 132, 204, 129, 206, 5, 79, 204, 135, 204, 132, 206, 5, 79, 204, 136, 204, 132, 206, 5, 79, 204, 155, 204, 128, 206, 5, 79, 204, 155, 204, 129, 206, 5, 79, 204, 155, 204, 131, 206, 5, 79, 204, 155, 204, 137, 206, 5, 79, 204, 155, 204, 163, 186, 5, 79, 204, 163, 204, 130, 206, 5, 79, 204, 168, 204, 132, 206, 5, 82, 204, 163, 204, 132, 206, 5, 83, 204, 129, 204, 135, 206, 5, 83, 204, 140, 204, 135, 206, 5, 83, 204, 163, 204, 135, 206, 5, 85, 204, 131, 204, 129, 206, 5, 85, 204, 132, 204, 136, 206, 5, 85, 204, 136, 204, 128, 206, 5, 85, 204, 136, 204, 129, 206, 5, 85, 204, 136, 204, 132, 206, 5, 85, 204, 136, 204, 140, 206, 5, 85, 204, 155, 204, 128, 206, 5, 85, 204, 155, 204, 129, 206, 5, 85, 204, 155, 204, 131, 206, 5, 85, 204, 155, 204, 137, 206, 5, 85, 204, 155, 204, 163, 186, 5, 97, 204, 130, 204, 128, 206, 5, 97, 204, 130, 204, 129, 206, 5, 97, 204, 130, 204, 131, 206, 5, 97, 204, 130, 204, 137, 206, 5, 97, 204, 134, 204, 128, 206, 5, 97, 204, 134, 204, 129, 206, 5, 97, 204, 134, 204, 131, 206, 5, 97, 204, 134, 204, 137, 206, 5, 97, 204, 135, 204, 132, 206, 5, 97, 204, 136, 204, 132, 206, 5, 97, 204, 138, 204, 129, 206, 5, 97, 204, 163, 204, 130, 206, 5, 97, 204, 163, 204, 134, 206, 5, 99, 204, 167, 204, 129, 206, 5, 101, 204, 130, 204, 128, 206, 5, 101, 204, 130, 204, 129, 206, 5, 101, 204, 130, 204, 131, 206, 5, 101, 204, 130, 204, 137, 206, 5, 101, 204, 132, 204, 128, 206, 5, 101, 204, 132, 204, 129, 206, 5, 101, 204, 163, 204, 130, 206, 5, 101, 204, 167, 204, 134, 206, 5, 105, 204, 136, 204, 129, 206, 5, 108, 204, 163, 204, 132, 206, 5, 111, 204, 130, 204, 128, 206, 5, 111, 204, 130, 204, 129, 206, 5, 111, 204, 130, 204, 131, 206, 5, 111, 204, 130, 204, 137, 206, 5, 111, 204, 131, 204, 129, 206, 5, 111, 204, 131, 204, 132, 206, 5, 111, 204, 131, 204, 136, 206, 5, 111, 204, 132, 204, 128, 206, 5, 111, 204, 132, 204, 129, 206, 5, 111, 204, 135, 204, 132, 206, 5, 111, 204, 136, 204, 132, 206, 5, 111, 204, 155, 204, 128, 206, 5, 111, 204, 155, 204, 129, 206, 5, 111, 204, 155, 204, 131, 206, 5, 111, 204, 155, 204, 137, 206, 5, 111, 204, 155, 204, 163, 186, 5, 111, 204, 163, 204, 130, 206, 5, 111, 204, 168, 204, 132, 206, 5, 114, 204, 163, 204, 132, 206, 5, 115, 204, 129, 204, 135, 206, 5, 115, 204, 140, 204, 135, 206, 5, 115, 204, 163, 204, 135, 206, 5, 117, 204, 131, 204, 129, 206, 5, 117, 204, 132, 204, 136, 206, 5, 117, 204, 136, 204, 128, 206, 5, 117, 204, 136, 204, 129, 206, 5, 117, 204, 136, 204, 132, 206, 5, 117, 204, 136, 204, 140, 206, 5, 117, 204, 155, 204, 128, 206, 5, 117, 204, 155, 204, 129, 206, 5, 117, 204, 155, 204, 131, 206, 5, 117, 204, 155, 204, 137, 206, 5, 117, 204, 155, 204, 163, 186, 5, 225, 190, 191, 204, 128, 206, 5, 225, 190, 191, 204, 129, 206, 5, 225, 190, 191, 205, 130, 206, 5, 225, 191, 190, 204, 128, 206, 5, 225, 191, 190, 204, 129, 206, 5, 225, 191, 190, 205, 130, 206, 5, 226, 134, 144, 204, 184, 5, 5, 226, 134, 146, 204, 184, 5, 5, 226, 134, 148, 204, 184, 5, 5, 226, 135, 144, 204, 184, 5, 5, 226, 135, 146, 204, 184, 5, 5, 226, 135, 148, 204, 184, 5, 5, 226, 136, 131, 204, 184, 5, 5, 226, 136, 136, 204, 184, 5, 5, 226, 136, 139, 204, 184, 5, 5, 226, 136, 163, 204, 184, 5, 5, 226, 136, 165, 204, 184, 5, 5, 226, 136, 188, 204, 184, 5, 5, 226, 137, 131, 204, 184, 5, 5, 226, 137, 133, 204, 184, 5, 5, 226, 137, 136, 204, 184, 5, 5, 226, 137, 141, 204, 184, 5, 5, 226, 137, 161, 204, 184, 5, 5, 226, 137, 164, 204, 184, 5, 5, 226, 137, 165, 204, 184, 5, 5, 226, 137, 178, 204, 184, 5, 5, 226, 137, 179, 204, 184, 5, 5, 226, 137, 182, 204, 184, 5, 5, 226, 137, 183, 204, 184, 5, 5, 226, 137, 186, 204, 184, 5, 5, 226, 137, 187, 204, 184, 5, 5, 226, 137, 188, 204, 184, 5, 5, 226, 137, 189, 204, 184, 5, 5, 226, 138, 130, 204, 184, 5, 5, 226, 138, 131, 204, 184, 5, 5, 226, 138, 134, 204, 184, 5, 5, 226, 138, 135, 204, 184, 5, 5, 226, 138, 145, 204, 184, 5, 5, 226, 138, 146, 204, 184, 5, 5, 226, 138, 162, 204, 184, 5, 5, 226, 138, 168, 204, 184, 5, 5, 226, 138, 169, 204, 184, 5, 5, 226, 138, 171, 204, 184, 5, 5, 226, 138, 178, 204, 184, 5, 5, 226, 138, 179, 204, 184, 5, 5, 226, 138, 180, 204, 184, 5, 5, 226, 138, 181, 204, 184, 5, 6, 206, 145, 204, 147, 205, 133, 222, 6, 206, 145, 204, 148, 205, 133, 222, 6, 206, 149, 204, 147, 204, 128, 206, 6, 206, 149, 204, 147, 204, 129, 206, 6, 206, 149, 204, 148, 204, 128, 206, 6, 206, 149, 204, 148, 204, 129, 206, 6, 206, 151, 204, 147, 205, 133, 222, 6, 206, 151, 204, 148, 205, 133, 222, 6, 206, 153, 204, 147, 204, 128, 206, 6, 206, 153, 204, 147, 204, 129, 206, 6, 206, 153, 204, 147, 205, 130, 206, 6, 206, 153, 204, 148, 204, 128, 206, 6, 206, 153, 204, 148, 204, 129, 206, 6, 206, 153, 204, 148, 205, 130, 206, 6, 206, 159, 204, 147, 204, 128, 206, 6, 206, 159, 204, 147, 204, 129, 206, 6, 206, 159, 204, 148, 204, 128, 206, 6, 206, 159, 204, 148, 204, 129, 206, 6, 206, 165, 204, 148, 204, 128, 206, 6, 206, 165, 204, 148, 204, 129, 206, 6, 206, 165, 204, 148, 205, 130, 206, 6, 206, 169, 204, 147, 205, 133, 222, 6, 206, 169, 204, 148, 205, 133, 222, 6, 206, 177, 204, 128, 205, 133, 222, 6, 206, 177, 204, 129, 205, 133, 222, 6, 206, 177, 204, 147, 205, 133, 222, 6, 206, 177, 204, 148, 205, 133, 222, 6, 206, 177, 205, 130, 205, 133, 222, 6, 206, 181, 204, 147, 204, 128, 206, 6, 206, 181, 204, 147, 204, 129, 206, 6, 206, 181, 204, 148, 204, 128, 206, 6, 206, 181, 204, 148, 204, 129, 206, 6, 206, 183, 204, 128, 205, 133, 222, 6, 206, 183, 204, 129, 205, 133, 222, 6, 206, 183, 204, 147, 205, 133, 222, 6, 206, 183, 204, 148, 205, 133, 222, 6, 206, 183, 205, 130, 205, 133, 222, 6, 206, 185, 204, 136, 204, 128, 206, 6, 206, 185, 204, 136, 204, 129, 206, 6, 206, 185, 204, 136, 205, 130, 206, 6, 206, 185, 204, 147, 204, 128, 206, 6, 206, 185, 204, 147, 204, 129, 206, 6, 206, 185, 204, 147, 205, 130, 206, 6, 206, 185, 204, 148, 204, 128, 206, 6, 206, 185, 204, 148, 204, 129, 206, 6, 206, 185, 204, 148, 205, 130, 206, 6, 206, 191, 204, 147, 204, 128, 206, 6, 206, 191, 204, 147, 204, 129, 206, 6, 206, 191, 204, 148, 204, 128, 206, 6, 206, 191, 204, 148, 204, 129, 206, 6, 207, 133, 204, 136, 204, 128, 206, 6, 207, 133, 204, 136, 204, 129, 206, 6, 207, 133, 204, 136, 205, 130, 206, 6, 207, 133, 204, 147, 204, 128, 206, 6, 207, 133, 204, 147, 204, 129, 206, 6, 207, 133, 204, 147, 205, 130, 206, 6, 207, 133, 204, 148, 204, 128, 206, 6, 207, 133, 204, 148, 204, 129, 206, 6, 207, 133, 204, 148, 205, 130, 206, 6, 207, 137, 204, 128, 205, 133, 222, 6, 207, 137, 204, 129, 205, 133, 222, 6, 207, 137, 204, 147, 205, 133, 222, 6, 207, 137, 204, 148, 205, 133, 222, 6, 207, 137, 205, 130, 205, 133, 222, 6, 224, 164, 168, 224, 164, 188, 13, 6, 224, 164, 176, 224, 164, 188, 13, 6, 224, 164, 179, 224, 164, 188, 13, 6, 224, 177, 134, 224, 177, 150, 137, 6, 224, 183, 153, 224, 183, 138, 21, 6, 227, 129, 134, 227, 130, 153, 17, 6, 227, 129, 139, 227, 130, 153, 17, 6, 227, 129, 141, 227, 130, 153, 17, 6, 227, 129, 143, 227, 130, 153, 17, 6, 227, 129, 145, 227, 130, 153, 17, 6, 227, 129, 147, 227, 130, 153, 17, 6, 227, 129, 149, 227, 130, 153, 17, 6, 227, 129, 151, 227, 130, 153, 17, 6, 227, 129, 153, 227, 130, 153, 17, 6, 227, 129, 155, 227, 130, 153, 17, 6, 227, 129, 157, 227, 130, 153, 17, 6, 227, 129, 159, 227, 130, 153, 17, 6, 227, 129, 161, 227, 130, 153, 17, 6, 227, 129, 164, 227, 130, 153, 17, 6, 227, 129, 166, 227, 130, 153, 17, 6, 227, 129, 168, 227, 130, 153, 17, 6, 227, 129, 175, 227, 130, 153, 17, 6, 227, 129, 175, 227, 130, 154, 17, 6, 227, 129, 178, 227, 130, 153, 17, 6, 227, 129, 178, 227, 130, 154, 17, 6, 227, 129, 181, 227, 130, 153, 17, 6, 227, 129, 181, 227, 130, 154, 17, 6, 227, 129, 184, 227, 130, 153, 17, 6, 227, 129, 184, 227, 130, 154, 17, 6, 227, 129, 187, 227, 130, 153, 17, 6, 227, 129, 187, 227, 130, 154, 17, 6, 227, 130, 157, 227, 130, 153, 17, 6, 227, 130, 166, 227, 130, 153, 17, 6, 227, 130, 171, 227, 130, 153, 17, 6, 227, 130, 173, 227, 130, 153, 17, 6, 227, 130, 175, 227, 130, 153, 17, 6, 227, 130, 177, 227, 130, 153, 17, 6, 227, 130, 179, 227, 130, 153, 17, 6, 227, 130, 181, 227, 130, 153, 17, 6, 227, 130, 183, 227, 130, 153, 17, 6, 227, 130, 185, 227, 130, 153, 17, 6, 227, 130, 187, 227, 130, 153, 17, 6, 227, 130, 189, 227, 130, 153, 17, 6, 227, 130, 191, 227, 130, 153, 17, 6, 227, 131, 129, 227, 130, 153, 17, 6, 227, 131, 132, 227, 130, 153, 17, 6, 227, 131, 134, 227, 130, 153, 17, 6, 227, 131, 136, 227, 130, 153, 17, 6, 227, 131, 143, 227, 130, 153, 17, 6, 227, 131, 143, 227, 130, 154, 17, 6, 227, 131, 146, 227, 130, 153, 17, 6, 227, 131, 146, 227, 130, 154, 17, 6, 227, 131, 149, 227, 130, 153, 17, 6, 227, 131, 149, 227, 130, 154, 17, 6, 227, 131, 152, 227, 130, 153, 17, 6, 227, 131, 152, 227, 130, 154, 17, 6, 227, 131, 155, 227, 130, 153, 17, 6, 227, 131, 155, 227, 130, 154, 17, 6, 227, 131, 175, 227, 130, 153, 17, 6, 227, 131, 176, 227, 130, 153, 17, 6, 227, 131, 177, 227, 130, 153, 17, 6, 227, 131, 178, 227, 130, 153, 17, 6, 227, 131, 189, 227, 130, 153, 17, 8, 206, 145, 204, 147, 204, 128, 205, 133, 223, 8, 206, 145, 204, 147, 204, 129, 205, 133, 223, 8, 206, 145, 204, 147, 205, 130, 205, 133, 223, 8, 206, 145, 204, 148, 204, 128, 205, 133, 223, 8, 206, 145, 204, 148, 204, 129, 205, 133, 223, 8, 206, 145, 204, 148, 205, 130, 205, 133, 223, 8, 206, 151, 204, 147, 204, 128, 205, 133, 223, 8, 206, 151, 204, 147, 204, 129, 205, 133, 223, 8, 206, 151, 204, 147, 205, 130, 205, 133, 223, 8, 206, 151, 204, 148, 204, 128, 205, 133, 223, 8, 206, 151, 204, 148, 204, 129, 205, 133, 223, 8, 206, 151, 204, 148, 205, 130, 205, 133, 223, 8, 206, 169, 204, 147, 204, 128, 205, 133, 223, 8, 206, 169, 204, 147, 204, 129, 205, 133, 223, 8, 206, 169, 204, 147, 205, 130, 205, 133, 223, 8, 206, 169, 204, 148, 204, 128, 205, 133, 223, 8, 206, 169, 204, 148, 204, 129, 205, 133, 223, 8, 206, 169, 204, 148, 205, 130, 205, 133, 223, 8, 206, 177, 204, 147, 204, 128, 205, 133, 223, 8, 206, 177, 204, 147, 204, 129, 205, 133, 223, 8, 206, 177, 204, 147, 205, 130, 205, 133, 223, 8, 206, 177, 204, 148, 204, 128, 205, 133, 223, 8, 206, 177, 204, 148, 204, 129, 205, 133, 223, 8, 206, 177, 204, 148, 205, 130, 205, 133, 223, 8, 206, 183, 204, 147, 204, 128, 205, 133, 223, 8, 206, 183, 204, 147, 204, 129, 205, 133, 223, 8, 206, 183, 204, 147, 205, 130, 205, 133, 223, 8, 206, 183, 204, 148, 204, 128, 205, 133, 223, 8, 206, 183, 204, 148, 204, 129, 205, 133, 223, 8, 206, 183, 204, 148, 205, 130, 205, 133, 223, 8, 207, 137, 204, 147, 204, 128, 205, 133, 223, 8, 207, 137, 204, 147, 204, 129, 205, 133, 223, 8, 207, 137, 204, 147, 205, 130, 205, 133, 223, 8, 207, 137, 204, 148, 204, 128, 205, 133, 223, 8, 207, 137, 204, 148, 204, 129, 205, 133, 223, 8, 207, 137, 204, 148, 205, 130, 205, 133, 223, 8, 240, 145, 130, 153, 240, 145, 130, 186, 13, 8, 240, 145, 130, 155, 240, 145, 130, 186, 13, 8, 240, 145, 130, 165, 240, 145, 130, 186, 13, 66, 194, 180, 1, 67, 32, 204, 129, 205, 67, 32, 204, 131, 205, 67, 32, 204, 132, 205, 67, 32, 204, 133, 205, 67, 32, 204, 134, 205, 67, 32, 204, 135, 205, 67, 32, 204, 136, 205, 67, 32, 204, 138, 205, 67, 32, 204, 139, 205, 67, 32, 204, 147, 205, 67, 32, 204, 148, 205, 67, 32, 204, 167, 169, 67, 32, 204, 168, 169, 67, 32, 204, 179, 185, 67, 32, 205, 130, 205, 67, 32, 205, 133, 221, 67, 32, 217, 139, 93, 67, 32, 217, 140, 97, 67, 32, 217, 141, 101, 67, 32, 217, 142, 105, 67, 32, 217, 143, 109, 67, 32, 217, 144, 113, 67, 32, 217, 145, 117, 67, 32, 217, 146, 121, 67, 65, 204, 138, 205, 67, 115, 204, 135, 205, 68, 32, 227, 130, 153, 17, 68, 32, 227, 130, 154, 17, 68, 194, 168, 204, 129, 206, 68, 206, 145, 204, 129, 205, 68, 206, 149, 204, 129, 205, 68, 206, 151, 204, 129, 205, 68, 206, 153, 204, 129, 205, 68, 206, 159, 204, 129, 205, 68, 206, 165, 204, 129, 205, 68, 206, 165, 204, 136, 205, 68, 206, 169, 204, 129, 205, 68, 206, 177, 204, 129, 205, 68, 206, 181, 204, 129, 205, 68, 206, 183, 204, 129, 205, 68, 206, 185, 204, 129, 205, 68, 206, 191, 204, 129, 205, 68, 207, 133, 204, 129, 205, 68, 207, 137, 204, 129, 205, 68, 215, 144, 214, 183, 53, 68, 215, 144, 214, 184, 57, 68, 215, 144, 214, 188, 69, 68, 215, 145, 214, 188, 69, 68, 215, 145, 214, 191, 77, 68, 215, 146, 214, 188, 69, 68, 215, 147, 214, 188, 69, 68, 215, 148, 214, 188, 69, 68, 215, 149, 214, 185, 61, 68, 215, 149, 214, 188, 69, 68, 215, 150, 214, 188, 69, 68, 215, 152, 214, 188, 69, 68, 215, 153, 214, 180, 41, 68, 215, 153, 214, 188, 69, 68, 215, 154, 214, 188, 69, 68, 215, 155, 214, 188, 69, 68, 215, 155, 214, 191, 77, 68, 215, 156, 214, 188, 69, 68, 215, 158, 214, 188, 69, 68, 215, 160, 214, 188, 69, 68, 215, 161, 214, 188, 69, 68, 215, 163, 214, 188, 69, 68, 215, 164, 214, 188, 69, 68, 215, 164, 214, 191, 77, 68, 215, 166, 214, 188, 69, 68, 215, 167, 214, 188, 69, 68, 215, 168, 214, 188, 69, 68, 215, 169, 214, 188, 69, 68, 215, 169, 215, 129, 81, 68, 215, 169, 215, 130, 85, 68, 215, 170, 214, 188, 69, 68, 215, 178, 214, 183, 53, 68, 216, 167, 217, 139, 93, 68, 216, 167, 217, 147, 205, 68, 216, 167, 217, 148, 205, 68, 216, 167, 217, 149, 185, 68, 216, 176, 217, 176, 125, 68, 216, 177, 217, 176, 125, 68, 217, 128, 217, 139, 93, 68, 217, 128, 217, 142, 105, 68, 217, 128, 217, 143, 109, 68, 217, 128, 217, 144, 113, 68, 217, 128, 217, 145, 117, 68, 217, 128, 217, 146, 121, 68, 217, 135, 217, 176, 125, 68, 217, 136, 217, 148, 205, 68, 217, 137, 217, 176, 125, 68, 217, 138, 217, 148, 205, 68, 219, 146, 217, 148, 205, 68, 219, 149, 217, 148, 205, 69, 32, 204, 136, 204, 128, 206, 69, 32, 204, 136, 204, 129, 206, 69, 32, 204, 136, 205, 130, 206, 69, 32, 204, 147, 204, 128, 206, 69, 32, 204, 147, 204, 129, 206, 69, 32, 204, 147, 205, 130, 206, 69, 32, 204, 148, 204, 128, 206, 69, 32, 204, 148, 204, 129, 206, 69, 32, 204, 148, 205, 130, 206, 69, 32, 217, 140, 217, 145, 118, 69, 32, 217, 141, 217, 145, 118, 69, 32, 217, 142, 217, 145, 118, 69, 32, 217, 143, 217, 145, 118, 69, 32, 217, 144, 217, 145, 118, 69, 32, 217, 145, 217, 176, 126, 69, 226, 171, 157, 204, 184, 5, 70, 206, 185, 204, 136, 204, 129, 206, 70, 207, 133, 204, 136, 204, 129, 206, 70, 215, 169, 214, 188, 215, 129, 82, 70, 215, 169, 214, 188, 215, 130, 86, 70, 217, 128, 217, 142, 217, 145, 118, 70, 217, 128, 217, 143, 217, 145, 118, 70, 217, 128, 217, 144, 217, 145, 118, 70, 224, 164, 149, 224, 164, 188, 13, 70, 224, 164, 150, 224, 164, 188, 13, 70, 224, 164, 151, 224, 164, 188, 13, 70, 224, 164, 156, 224, 164, 188, 13, 70, 224, 164, 161, 224, 164, 188, 13, 70, 224, 164, 162, 224, 164, 188, 13, 70, 224, 164, 171, 224, 164, 188, 13, 70, 224, 164, 175, 224, 164, 188, 13, 70, 224, 166, 161, 224, 166, 188, 13, 70, 224, 166, 162, 224, 166, 188, 13, 70, 224, 166, 175, 224, 166, 188, 13, 70, 224, 168, 150, 224, 168, 188, 13, 70, 224, 168, 151, 224, 168, 188, 13, 70, 224, 168, 156, 224, 168, 188, 13, 70, 224, 168, 171, 224, 168, 188, 13, 70, 224, 168, 178, 224, 168, 188, 13, 70, 224, 168, 184, 224, 168, 188, 13, 70, 224, 172, 161, 224, 172, 188, 13, 70, 224, 172, 162, 224, 172, 188, 13, 70, 224, 190, 178, 224, 190, 128, 161, 70, 224, 190, 179, 224, 190, 128, 161, 70, 227, 131, 134, 227, 130, 153, 17, 72, 240, 157, 133, 151, 240, 157, 133, 165, 177, 72, 240, 157, 133, 152, 240, 157, 133, 165, 177, 72, 240, 157, 134, 185, 240, 157, 133, 165, 177, 72, 240, 157, 134, 186, 240, 157, 133, 165, 177, 73, 224, 190, 178, 224, 189, 177, 224, 190, 128, 162, 73, 224, 190, 179, 224, 189, 177, 224, 190, 128, 162, 76, 240, 157, 133, 152, 240, 157, 133, 165, 240, 157, 133, 174, 178, 76, 240, 157, 133, 152, 240, 157, 133, 165, 240, 157, 133, 175, 178, 76, 240, 157, 133, 152, 240, 157, 133, 165, 240, 157, 133, 176, 178, 76, 240, 157, 133, 152, 240, 157, 133, 165, 240, 157, 133, 177, 178, 76, 240, 157, 133, 152, 240, 157, 133, 165, 240, 157, 133, 178, 178, 76, 240, 157, 134, 185, 240, 157, 133, 165, 240, 157, 133, 174, 178, 76, 240, 157, 134, 185, 240, 157, 133, 165, 240, 157, 133, 175, 178, 76, 240, 157, 134, 186, 240, 157, 133, 165, 240, 157, 133, 174, 178, 76, 240, 157, 134, 186, 240, 157, 133, 165, 240, 157, 133, 175, 178, 131, 65, 204, 130, 205, 131, 65, 204, 134, 205, 131, 65, 204, 135, 205, 131, 65, 204, 136, 205, 131, 65, 204, 138, 205, 131, 65, 204, 163, 185, 131, 67, 204, 167, 169, 131, 69, 204, 130, 205, 131, 69, 204, 132, 205, 131, 69, 204, 163, 185, 131, 69, 204, 167, 169, 131, 73, 204, 136, 205, 131, 76, 204, 163, 185, 131, 79, 204, 130, 205, 131, 79, 204, 131, 205, 131, 79, 204, 132, 205, 131, 79, 204, 135, 205, 131, 79, 204, 136, 205, 131, 79, 204, 155, 177, 131, 79, 204, 163, 185, 131, 79, 204, 168, 169, 131, 82, 204, 163, 185, 131, 83, 204, 129, 205, 131, 83, 204, 140, 205, 131, 83, 204, 163, 185, 131, 85, 204, 131, 205, 131, 85, 204, 132, 205, 131, 85, 204, 136, 205, 131, 85, 204, 155, 177, 131, 97, 204, 130, 205, 131, 97, 204, 134, 205, 131, 97, 204, 135, 205, 131, 97, 204, 136, 205, 131, 97, 204, 138, 205, 131, 97, 204, 163, 185, 131, 99, 204, 167, 169, 131, 101, 204, 130, 205, 131, 101, 204, 132, 205, 131, 101, 204, 163, 185, 131, 101, 204, 167, 169, 131, 105, 204, 136, 205, 131, 108, 204, 163, 185, 131, 111, 204, 130, 205, 131, 111, 204, 131, 205, 131, 111, 204, 132, 205, 131, 111, 204, 135, 205, 131, 111, 204, 136, 205, 131, 111, 204, 155, 177, 131, 111, 204, 163, 185, 131, 111, 204, 168, 169, 131, 114, 204, 163, 185, 131, 115, 204, 129, 205, 131, 115, 204, 140, 205, 131, 115, 204, 163, 185, 131, 117, 204, 131, 205, 131, 117, 204, 132, 205, 131, 117, 204, 136, 205, 131, 117, 204, 155, 177, 132, 206, 145, 204, 147, 205, 132, 206, 145, 204, 148, 205, 132, 206, 149, 204, 147, 205, 132, 206, 149, 204, 148, 205, 132, 206, 151, 204, 147, 205, 132, 206, 151, 204, 148, 205, 132, 206, 153, 204, 147, 205, 132, 206, 153, 204, 148, 205, 132, 206, 159, 204, 147, 205, 132, 206, 159, 204, 148, 205, 132, 206, 165, 204, 148, 205, 132, 206, 169, 204, 147, 205, 132, 206, 169, 204, 148, 205, 132, 206, 177, 204, 128, 205, 132, 206, 177, 204, 129, 205, 132, 206, 177, 204, 147, 205, 132, 206, 177, 204, 148, 205, 132, 206, 177, 205, 130, 205, 132, 206, 181, 204, 147, 205, 132, 206, 181, 204, 148, 205, 132, 206, 183, 204, 128, 205, 132, 206, 183, 204, 129, 205, 132, 206, 183, 204, 147, 205, 132, 206, 183, 204, 148, 205, 132, 206, 183, 205, 130, 205, 132, 206, 185, 204, 136, 205, 132, 206, 185, 204, 147, 205, 132, 206, 185, 204, 148, 205, 132, 206, 191, 204, 147, 205, 132, 206, 191, 204, 148, 205, 132, 207, 133, 204, 136, 205, 132, 207, 133, 204, 147, 205, 132, 207, 133, 204, 148, 205, 132, 207, 137, 204, 128, 205, 132, 207, 137, 204, 129, 205, 132, 207, 137, 204, 147, 205, 132, 207, 137, 204, 148, 205, 132, 207, 137, 205, 130, 205, 134, 206, 145, 204, 147, 204, 128, 206, 134, 206, 145, 204, 147, 204, 129, 206, 134, 206, 145, 204, 147, 205, 130, 206, 134, 206, 145, 204, 148, 204, 128, 206, 134, 206, 145, 204, 148, 204, 129, 206, 134, 206, 145, 204, 148, 205, 130, 206, 134, 206, 151, 204, 147, 204, 128, 206, 134, 206, 151, 204, 147, 204, 129, 206, 134, 206, 151, 204, 147, 205, 130, 206, 134, 206, 151, 204, 148, 204, 128, 206, 134, 206, 151, 204, 148, 204, 129, 206, 134, 206, 151, 204, 148, 205, 130, 206, 134, 206, 169, 204, 147, 204, 128, 206, 134, 206, 169, 204, 147, 204, 129, 206, 134, 206, 169, 204, 147, 205, 130, 206, 134, 206, 169, 204, 148, 204, 128, 206, 134, 206, 169, 204, 148, 204, 129, 206, 134, 206, 169, 204, 148, 205, 130, 206, 134, 206, 177, 204, 147, 204, 128, 206, 134, 206, 177, 204, 147, 204, 129, 206, 134, 206, 177, 204, 147, 205, 130, 206, 134, 206, 177, 204, 148, 204, 128, 206, 134, 206, 177, 204, 148, 204, 129, 206, 134, 206, 177, 204, 148, 205, 130, 206, 134, 206, 183, 204, 147, 204, 128, 206, 134, 206, 183, 204, 147, 204, 129, 206, 134, 206, 183, 204, 147, 205, 130, 206, 134, 206, 183, 204, 148, 204, 128, 206, 134, 206, 183, 204, 148, 204, 129, 206, 134, 206, 183, 204, 148, 205, 130, 206, 134, 207, 137, 204, 147, 204, 128, 206, 134, 207, 137, 204, 147, 204, 129, 206, 134, 207, 137, 204, 147, 205, 130, 206, 134, 207, 137, 204, 148, 204, 128, 206, 134, 207, 137, 204, 148, 204, 129, 206, 134, 207, 137, 204, 148, 205, 130, 206, 66, 204, 128, 205, 51, 66, 204, 129, 205, 51, 66, 204, 147, 205, 51, 67, 225, 133, 161, 1, 0, 67, 225, 133, 162, 1, 0, 67, 225, 133, 163, 1, 0, 67, 225, 133, 164, 1, 0, 67, 225, 133, 165, 1, 0, 67, 225, 133, 166, 1, 0, 67, 225, 133, 167, 1, 0, 67, 225, 133, 168, 1, 0, 67, 225, 133, 169, 1, 0, 67, 225, 133, 170, 1, 0, 67, 225, 133, 171, 1, 0, 67, 225, 133, 172, 1, 0, 67, 225, 133, 173, 1, 0, 67, 225, 133, 174, 1, 0, 67, 225, 133, 175, 1, 0, 67, 225, 133, 176, 1, 0, 67, 225, 133, 177, 1, 0, 67, 225, 133, 178, 1, 0, 67, 225, 133, 179, 1, 0, 67, 225, 133, 180, 1, 0, 67, 225, 133, 181, 1, 0, 67, 225, 134, 170, 1, 0, 67, 225, 134, 172, 1, 0, 67, 225, 134, 173, 1, 0, 67, 225, 134, 176, 1, 0, 67, 225, 134, 177, 1, 0, 67, 225, 134, 178, 1, 0, 67, 225, 134, 179, 1, 0, 67, 225, 134, 180, 1, 0, 67, 225, 134, 181, 1, 0, 68, 204, 136, 204, 129, 206, 51, 67, 227, 130, 153, 17, 4, 67, 227, 130, 154, 17, 4, 70, 224, 189, 177, 224, 189, 178, 162, 39, 70, 224, 189, 177, 224, 189, 180, 166, 39, 70, 224, 189, 177, 224, 190, 128, 162, 39, 0, 1]); nfcValues = $toNativeArray($kindUint16, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40960, 40960, 40960, 0, 0, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 0, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 0, 0, 0, 0, 0, 0, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 0, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12166, 12171, 18079, 12176, 18094, 18099, 40960, 18109, 12281, 12286, 18114, 12306, 12421, 12426, 12431, 18134, 0, 12571, 12606, 12611, 18144, 18149, 18164, 0, 40960, 12746, 12751, 12756, 18214, 12876, 0, 0, 12946, 12951, 18224, 12956, 18239, 18244, 40960, 18254, 13061, 13066, 18259, 13086, 13206, 13211, 13216, 18279, 0, 13356, 13391, 13396, 18289, 18294, 18309, 0, 40960, 13536, 13541, 13546, 18359, 13671, 0, 13696, 12181, 12961, 18084, 18229, 12211, 12991, 12231, 13011, 12236, 13016, 12241, 13021, 12246, 13026, 12256, 13036, 0, 0, 18119, 18264, 12296, 13076, 12301, 13081, 12331, 13111, 12316, 13096, 12356, 13136, 12366, 13146, 12371, 13151, 12381, 13161, 12386, 13166, 0, 0, 12436, 13221, 12441, 13226, 12446, 13231, 12481, 13261, 12451, 0, 0, 0, 12491, 13271, 12511, 13296, 0, 12521, 13306, 12531, 13316, 12526, 13311, 0, 0, 0, 0, 12566, 13351, 12591, 13376, 12581, 13366, 0, 0, 0, 18154, 18299, 12616, 13401, 12626, 13411, 0, 0, 12656, 13441, 12681, 13466, 12666, 13451, 18189, 18334, 12691, 13476, 12706, 13491, 18194, 18339, 12731, 13521, 12716, 13506, 0, 0, 18204, 18349, 18209, 18354, 12761, 13551, 12771, 13561, 12776, 13566, 12806, 13596, 12841, 13631, 12881, 13676, 12901, 12916, 13716, 12926, 13726, 12931, 13731, 40960, 0, 0, 0, 0, 33024, 33024, 33024, 0, 0, 0, 0, 0, 0, 12191, 12971, 12461, 13241, 12631, 13416, 12781, 13571, 14822, 15221, 14815, 15214, 14829, 15228, 14808, 15207, 0, 14535, 14934, 14528, 14927, 13770, 13788, 0, 0, 12376, 13156, 12501, 13286, 18179, 18324, 14759, 15158, 13806, 13812, 13276, 0, 0, 0, 12351, 13131, 0, 0, 12561, 13346, 14542, 14941, 13764, 13782, 13776, 13794, 12196, 12976, 12201, 12981, 12321, 13101, 12326, 13106, 12466, 13246, 12471, 13251, 12636, 13421, 12641, 13426, 12671, 13456, 12676, 13461, 12786, 13576, 12791, 13581, 12701, 13486, 12726, 13516, 0, 0, 12401, 13181, 0, 0, 0, 0, 0, 0, 18089, 18234, 18129, 18274, 14710, 15109, 14675, 15074, 18159, 18304, 14703, 15102, 12891, 13686, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39219, 39219, 39219, 39219, 39219, 33075, 39219, 39219, 39219, 39219, 39219, 39219, 39219, 33075, 33075, 39219, 33075, 39219, 33075, 39219, 39219, 33076, 33070, 33070, 33070, 33070, 33076, 39212, 33070, 33070, 33070, 33070, 33070, 33066, 33066, 39214, 39214, 39214, 39214, 39210, 39210, 33070, 33070, 33070, 33070, 39214, 39214, 33070, 39214, 39214, 33070, 33070, 33025, 33025, 33025, 33025, 39169, 33070, 33070, 33070, 33070, 33075, 33075, 33075, 18885, 18890, 39219, 18895, 19080, 39223, 33075, 33070, 33070, 33070, 33075, 33075, 33075, 33070, 33070, 0, 33075, 33075, 33075, 33070, 33070, 33070, 33070, 33075, 33076, 33070, 33070, 33075, 33077, 33078, 33078, 33077, 33078, 33078, 33077, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 0, 0, 0, 0, 371, 0, 0, 0, 0, 0, 33024, 0, 0, 0, 55, 0, 0, 0, 0, 0, 33024, 13752, 13824, 206, 13854, 13866, 13884, 0, 13914, 0, 13932, 13962, 15903, 40960, 0, 0, 0, 40960, 0, 40960, 0, 40960, 0, 0, 0, 0, 0, 40960, 0, 40960, 0, 0, 0, 40960, 0, 0, 0, 40960, 13902, 13950, 18453, 13998, 18495, 14016, 16007, 40960, 0, 0, 0, 40960, 0, 40960, 0, 40960, 0, 0, 0, 0, 0, 40960, 14136, 14148, 0, 14130, 0, 0, 40960, 14112, 0, 0, 0, 0, 14196, 14172, 14214, 0, 40960, 0, 0, 40960, 0, 40960, 40960, 40960, 40960, 14184, 40960, 0, 0, 0, 40960, 0, 0, 0, 0, 40960, 0, 0, 0, 40960, 0, 0, 0, 40960, 0, 40960, 0, 0, 40960, 0, 0, 40960, 0, 40960, 40960, 40960, 40960, 14316, 40960, 0, 0, 0, 40960, 0, 0, 14154, 14286, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14118, 14250, 14124, 14256, 0, 0, 14142, 14274, 40960, 40960, 14400, 14406, 14160, 14292, 14166, 14298, 0, 0, 14178, 14310, 14190, 14322, 14202, 14334, 40960, 40960, 14412, 14418, 14244, 14376, 14208, 14340, 14220, 14352, 14226, 14358, 14232, 14364, 0, 0, 14238, 14370, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33070, 33075, 33075, 33075, 33075, 33070, 33075, 33075, 33075, 33071, 33070, 33075, 33075, 33075, 33075, 33075, 33075, 33070, 33070, 33070, 33070, 33070, 33070, 33075, 33075, 33070, 33075, 33075, 33071, 33074, 33075, 33030, 33031, 33032, 33033, 33034, 33035, 33036, 33037, 33038, 33039, 33039, 33040, 33041, 33042, 0, 33043, 0, 0, 0, 0, 0, 0, 0, 0, 40960, 0, 40960, 33047, 33048, 33049, 33050, 33051, 33052, 33053, 33054, 39219, 39219, 39214, 33070, 33075, 33075, 33075, 33075, 33075, 33070, 33075, 33075, 33070, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33055, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33070, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 0, 33070, 33075, 33075, 33070, 33075, 33075, 33070, 33075, 33075, 33075, 33070, 33070, 33070, 33047, 33048, 33049, 33075, 33075, 33075, 33070, 33075, 33075, 33070, 33070, 33075, 33075, 33075, 33075, 33075, 0, 0, 0, 0, 0, 40960, 11571, 40960, 11579, 40960, 11587, 40960, 11595, 40960, 11603, 0, 0, 40960, 11611, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33027, 39168, 0, 0, 0, 0, 40960, 11619, 40960, 11627, 40960, 40960, 33075, 33075, 33070, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33070, 33075, 33075, 33078, 33067, 33070, 33066, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33076, 33074, 33074, 33070, 0, 33075, 33077, 33070, 33075, 33070, 12206, 12986, 12216, 12996, 12221, 13001, 12226, 13006, 14563, 14962, 12251, 13031, 12261, 13041, 12276, 13056, 12266, 13046, 12271, 13051, 14598, 14997, 14605, 15004, 12336, 13116, 12341, 13121, 14619, 15018, 12346, 13126, 12361, 13141, 12391, 13171, 12406, 13186, 12396, 13176, 12411, 13191, 12416, 13196, 12486, 13266, 14626, 15025, 12496, 13281, 12506, 13291, 12516, 13301, 18139, 18284, 14633, 15032, 12541, 13326, 12536, 13321, 12546, 13331, 12551, 13336, 12556, 13341, 12576, 13361, 12586, 13371, 12601, 13386, 12596, 13381, 14668, 15067, 14682, 15081, 14689, 15088, 14696, 15095, 12646, 13431, 12651, 13436, 12661, 13446, 18184, 18329, 14766, 15165, 12686, 13471, 12696, 13481, 18199, 18344, 14773, 15172, 14780, 15179, 14787, 15186, 12711, 13496, 12721, 13511, 12741, 13531, 12736, 13526, 12801, 13591, 12816, 13606, 12811, 13601, 14794, 15193, 14801, 15200, 12821, 13611, 12826, 13616, 12831, 13621, 12836, 13626, 12851, 13641, 12846, 13636, 12856, 13651, 12861, 13656, 12866, 13661, 12896, 13691, 12921, 13721, 12936, 13736, 12941, 13741, 13201, 13501, 13646, 13706, 0, 13800, 0, 0, 0, 0, 18104, 18249, 12186, 12966, 14479, 14878, 14472, 14871, 14493, 14892, 14486, 14885, 14549, 14948, 14507, 14906, 14500, 14899, 14521, 14920, 14514, 14913, 14556, 14955, 18124, 18269, 12311, 13091, 12291, 13071, 14577, 14976, 14570, 14969, 14591, 14990, 14584, 14983, 14612, 15011, 12456, 13236, 12476, 13256, 18174, 18319, 12621, 13406, 14647, 15046, 14640, 15039, 14661, 15060, 14654, 15053, 14752, 15151, 14724, 15123, 14717, 15116, 14738, 15137, 14731, 15130, 14745, 15144, 12796, 13586, 12766, 13556, 14843, 15242, 14836, 15235, 14857, 15256, 14850, 15249, 14864, 15263, 12871, 13666, 12911, 13711, 12906, 13701, 12886, 13681, 0, 0, 0, 0, 0, 0, 18459, 18465, 18741, 18765, 18749, 18773, 18757, 18781, 18369, 18375, 18597, 18621, 18605, 18629, 18613, 18637, 18477, 18483, 15823, 15839, 15831, 15847, 0, 0, 18381, 18387, 15615, 15631, 15623, 15639, 0, 0, 18501, 18507, 18789, 18813, 18797, 18821, 18805, 18829, 18393, 18399, 18645, 18669, 18653, 18677, 18661, 18685, 18525, 18531, 15919, 15943, 15927, 15951, 15935, 15959, 18405, 18411, 15663, 15687, 15671, 15695, 15679, 15703, 18537, 18543, 15967, 15983, 15975, 15991, 0, 0, 18417, 18423, 15711, 15727, 15719, 15735, 0, 0, 18555, 18561, 16023, 16047, 16031, 16055, 16039, 16063, 0, 18429, 0, 15743, 0, 15751, 0, 15759, 18579, 18585, 18837, 18861, 18845, 18869, 18853, 18877, 18435, 18441, 18693, 18717, 18701, 18725, 18709, 18733, 18447, 17205, 13992, 17211, 18489, 17217, 14010, 17223, 14040, 17229, 14064, 17235, 18567, 17241, 0, 0, 15799, 15807, 16795, 16825, 16805, 16835, 16815, 16845, 15599, 15607, 16615, 16645, 16625, 16655, 16635, 16665, 15871, 15879, 16855, 16885, 16865, 16895, 16875, 16905, 15647, 15655, 16675, 16705, 16685, 16715, 16695, 16725, 16087, 16095, 16915, 16945, 16925, 16955, 16935, 16965, 15767, 15775, 16735, 16765, 16745, 16775, 16755, 16785, 13980, 13974, 15783, 13986, 15791, 0, 18471, 15815, 13836, 13830, 13818, 17157, 13842, 33024, 470, 41216, 33024, 13758, 15855, 14004, 15863, 0, 18513, 15887, 13848, 17163, 13860, 17169, 13872, 15270, 15277, 15284, 14028, 14022, 15895, 17659, 0, 0, 14034, 15911, 13896, 13890, 13878, 17175, 0, 15291, 15298, 15305, 14082, 14076, 15999, 17667, 14052, 14058, 14088, 16015, 13944, 13938, 13926, 17187, 13920, 13746, 17151, 129, 0, 0, 16071, 14094, 16079, 0, 18591, 16103, 13908, 17181, 13956, 17199, 13968, 17005, 41216, 0, 0, 15389, 0, 40960, 15396, 40960, 0, 15403, 40960, 15410, 0, 0, 0, 40960, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12156, 40960, 15424, 0, 40960, 40960, 0, 0, 0, 0, 0, 0, 0, 15417, 12151, 12161, 15431, 15438, 40960, 40960, 15445, 15452, 40960, 40960, 15459, 15466, 40960, 40960, 40960, 40960, 0, 0, 15473, 15480, 40960, 40960, 15501, 15508, 40960, 40960, 15515, 15522, 0, 0, 0, 0, 0, 0, 0, 40960, 40960, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40960, 0, 0, 0, 0, 0, 40960, 40960, 0, 40960, 15543, 15550, 15557, 15564, 0, 0, 40960, 40960, 40960, 40960, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40960, 0, 0, 0, 0, 40960, 16159, 40960, 16167, 40960, 16175, 40960, 16183, 40960, 16191, 40960, 16199, 40960, 16207, 40960, 16215, 40960, 16223, 40960, 16231, 40960, 16239, 40960, 16247, 0, 40960, 16255, 40960, 16263, 40960, 16271, 0, 0, 0, 0, 0, 40960, 16279, 16287, 40960, 16295, 16303, 40960, 16311, 16319, 40960, 16327, 16335, 40960, 16343, 16351, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16151, 0, 0, 0, 0, 39172, 39172, 33024, 33024, 40960, 16359, 0, 0, 0, 0, 0, 0, 0, 40960, 0, 0, 0, 0, 40960, 16375, 40960, 16383, 40960, 16391, 40960, 16399, 40960, 16407, 40960, 16415, 40960, 16423, 40960, 16431, 40960, 16439, 40960, 16447, 40960, 16455, 40960, 16463, 0, 40960, 16471, 40960, 16479, 40960, 16487, 0, 0, 0, 0, 0, 40960, 16495, 16503, 40960, 16511, 16519, 40960, 16527, 16535, 40960, 16543, 16551, 40960, 16559, 16567, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40960, 40960, 40960, 40960, 0, 16367, 0, 0, 16575, 16583, 16591, 16599, 0, 0, 40960, 16607, 0, 4986, 3326, 5078, 5026, 3674, 1774, 2274, 5678, 5678, 2574, 5218, 2374, 2570, 3058, 4050, 4450, 4762, 4822, 4874, 5150, 3446, 3586, 3758, 3910, 4706, 5194, 5494, 1810, 2230, 3466, 3794, 4758, 5574, 2742, 3706, 4742, 4890, 3110, 4542, 4834, 2850, 3346, 3610, 3870, 5162, 1874, 2026, 2134, 3214, 3458, 3790, 4082, 4474, 4750, 4774, 5066, 5362, 5542, 5570, 4142, 4206, 4390, 4678, 5246, 5582, 4942, 2506, 2878, 4318, 4510, 3842, 4150, 5018, 5354, 2502, 2706, 3450, 3630, 3682, 4374, 4414, 5290, 2130, 4522, 2038, 2034, 4250, 4394, 4702, 5298, 4970, 3114, 3446, 4954, 1786, 2662, 2966, 3890, 4018, 2166, 4158, 1890, 2938, 1754, 3566, 3238, 4370, 2250, 2486, 4094, 4710, 4926, 3514, 5114, 3558, 3130, 4638, 3162, 4014, 1838, 1962, 2030, 3414, 4350, 4598, 4938, 5214, 2142, 2322, 2586, 2866, 3266, 3710, 4162, 5274, 5502, 5586, 5610, 2106, 3318, 3494, 5102, 2814, 3034, 3062, 3206, 3694, 3770, 3946, 4238, 4402, 4502, 5086, 4718, 5126, 5250, 2066, 2110, 2342, 3754, 4854, 4926, 2846, 2958, 3154, 3506, 4314, 3878, 1854, 2434, 2662, 2762, 2970, 3906, 3934, 4462, 4494, 5222, 5350, 5366, 5426, 1878, 4226, 5202, 5326, 2994, 1818, 1914, 2666, 2698, 3250, 3446, 3782, 4046, 4730, 5146, 5670, 3302, 5286, 2102, 3378, 3390, 3602, 3658, 3918, 4010, 4138, 4366, 5438, 1970, 3078, 5302, 1898, 2734, 3634, 5090, 2922, 3002, 3398, 3890, 5310, 2074, 2306, 2714, 3286, 3362, 3426, 3574, 3914, 4030, 4442, 4858, 4870, 5210, 5338, 2182, 3662, 2310, 3786, 3950, 4746, 5314, 5550, 5590, 3386, 3626, 4550, 4282, 4294, 4330, 3866, 3746, 4966, 1846, 4654, 2078, 2062, 2830, 3118, 4342, 2646, 3590, 3314, 5098, 4842, 5294, 4902, 2858, 1930, 2398, 0, 0, 2482, 0, 3298, 0, 0, 2042, 3874, 4070, 4170, 4198, 4202, 4222, 5374, 4334, 4466, 0, 4754, 0, 4950, 0, 0, 5130, 5174, 0, 0, 0, 5458, 5462, 5466, 5566, 5166, 5322, 1882, 1918, 1938, 2126, 2138, 2202, 2382, 2410, 2418, 2478, 2490, 2710, 2718, 2982, 3022, 3030, 3054, 3226, 3274, 3306, 3418, 3614, 3642, 3690, 3774, 3806, 3922, 4146, 4174, 4182, 4178, 4186, 4190, 4194, 4214, 4218, 4254, 4274, 4302, 4402, 4410, 4418, 4438, 4478, 4558, 4610, 4610, 4714, 4882, 4906, 4958, 4962, 5030, 5034, 5122, 5130, 5342, 5410, 5434, 2974, 5921, 4582, 0, 0, 1762, 2022, 1958, 1870, 1934, 1978, 2122, 2150, 2382, 2362, 2378, 2406, 2482, 2498, 2566, 2578, 2606, 2622, 2854, 2862, 2910, 2942, 2990, 3014, 2998, 3030, 3018, 3054, 3082, 3170, 3182, 3190, 3230, 3298, 3346, 3350, 3370, 3498, 3514, 3602, 3678, 3670, 3690, 3718, 3774, 4118, 3810, 3862, 3874, 3938, 3966, 4002, 4038, 4042, 4070, 4074, 4090, 4110, 4106, 4154, 4278, 4302, 4326, 4382, 4402, 4430, 4478, 4658, 4698, 4814, 4886, 4898, 4906, 4930, 4950, 4934, 4958, 4954, 4946, 4962, 4974, 5034, 5094, 5142, 5198, 5230, 5306, 5342, 5374, 5394, 5410, 5422, 5434, 5518, 5678, 5816, 5811, 5861, 1546, 1586, 1590, 5991, 6036, 6156, 5658, 5674, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1790, 1782, 1798, 5706, 1866, 1882, 1886, 1894, 1902, 1906, 1918, 1910, 1462, 5726, 1938, 1942, 1946, 1974, 5711, 1466, 1954, 1986, 5721, 2002, 2010, 1850, 2018, 2022, 6196, 2050, 2058, 1474, 2082, 2086, 2094, 2098, 1478, 2122, 2126, 2138, 2150, 2154, 2158, 2166, 2198, 2202, 2210, 2226, 2234, 2238, 2238, 2238, 5741, 3734, 2258, 2266, 5746, 2278, 2286, 2294, 2334, 2314, 2326, 2330, 2338, 2346, 2350, 2358, 2366, 2370, 2370, 2378, 2386, 2390, 2402, 2438, 2410, 2442, 2414, 2422, 2062, 2514, 2458, 2462, 2466, 2454, 2474, 2470, 2494, 5751, 2522, 2526, 2534, 2546, 2554, 2582, 5756, 5761, 2594, 2598, 2602, 2590, 2610, 1482, 1486, 2618, 2626, 2626, 5766, 2654, 2658, 2662, 2670, 5771, 2678, 2682, 2898, 2690, 1490, 2702, 2718, 2730, 2726, 5781, 2738, 5786, 2750, 2746, 2754, 2770, 2774, 1494, 2790, 2798, 2802, 2806, 1498, 5791, 1502, 2834, 2838, 2842, 2850, 6246, 2874, 5801, 5801, 4570, 2890, 2890, 1506, 5836, 6046, 2906, 2914, 1510, 2934, 2950, 2954, 2962, 2978, 1518, 1514, 2982, 5806, 2986, 3006, 3010, 3014, 3010, 3026, 3030, 3046, 3038, 3042, 3050, 3054, 3058, 3070, 3074, 3098, 3106, 3122, 3142, 5821, 3138, 3126, 3150, 3158, 3178, 5826, 3186, 3174, 3166, 1522, 3194, 3202, 3210, 3198, 1526, 3226, 3234, 5831, 3278, 3330, 3294, 1538, 3306, 1534, 1530, 1990, 1994, 3334, 3310, 4526, 1638, 3346, 3350, 3354, 3374, 3366, 5856, 1542, 3394, 3382, 3410, 3418, 5866, 3422, 3402, 3430, 1546, 3434, 3438, 3442, 3454, 5871, 3462, 1550, 3474, 5876, 3478, 1554, 3490, 3502, 3514, 3518, 5881, 5776, 5886, 3550, 5891, 3562, 3570, 3554, 3582, 3598, 3614, 3602, 3606, 3618, 3622, 5896, 3594, 3646, 3650, 1558, 3670, 3666, 5901, 3638, 3698, 5906, 5911, 3702, 3722, 3718, 3714, 1562, 3726, 3742, 3738, 3750, 5716, 3766, 5916, 3778, 5926, 3798, 3810, 3830, 5931, 3850, 3854, 5936, 5941, 3882, 3898, 1566, 3902, 1570, 1570, 3926, 3930, 3938, 3942, 3954, 1574, 3978, 5946, 4006, 5951, 4018, 5796, 4034, 5956, 5961, 5966, 1578, 1582, 4090, 5976, 5971, 5981, 5986, 4098, 4102, 4102, 4110, 1590, 4114, 1594, 1598, 5996, 4134, 4142, 4154, 1602, 6001, 4190, 6006, 6011, 4222, 4246, 1606, 4254, 4258, 4262, 6016, 6021, 6021, 4286, 1610, 6026, 4306, 4310, 1614, 6031, 4338, 1618, 4354, 4346, 4362, 6041, 4386, 1622, 4398, 4406, 4422, 1626, 6051, 6056, 1630, 6061, 4446, 6066, 4458, 4470, 4478, 6071, 6076, 4498, 6081, 4506, 5841, 1634, 4530, 4534, 1642, 4538, 2614, 6086, 6091, 5846, 5851, 4570, 4574, 5110, 1646, 4618, 4614, 4622, 2114, 4626, 4630, 4634, 4642, 6096, 4638, 4646, 4666, 4670, 4650, 4674, 4694, 4714, 4662, 4682, 4686, 4690, 6101, 6111, 6106, 1650, 4722, 4726, 4734, 6131, 4738, 6116, 1654, 1658, 6121, 6126, 1662, 4770, 4774, 4778, 4782, 4794, 4790, 4802, 4798, 4814, 4806, 4810, 4818, 1666, 4826, 4830, 1670, 4846, 4850, 6136, 4862, 4866, 1674, 4878, 1470, 6141, 6146, 1678, 1682, 4922, 4946, 4974, 4990, 6151, 5010, 5014, 5038, 5050, 6161, 5731, 5062, 5058, 5070, 5736, 5082, 5094, 6166, 6171, 5158, 5170, 5178, 6176, 5182, 5226, 5238, 5242, 5234, 5254, 5258, 6181, 5270, 1686, 5278, 6186, 1690, 5334, 2758, 5358, 6191, 6201, 1694, 1698, 5398, 6206, 1702, 6211, 5422, 5422, 5430, 6216, 5454, 1706, 5470, 5482, 5490, 5498, 1710, 6221, 5518, 5546, 5558, 1714, 1718, 5562, 6226, 1722, 6231, 6236, 6241, 5598, 1726, 5618, 5626, 5630, 5638, 5646, 5654, 6251, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); nfcIndex = $toNativeArray($kindUint8, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 1, 2, 3, 47, 4, 5, 0, 48, 49, 6, 7, 8, 50, 9, 51, 52, 10, 0, 0, 11, 53, 54, 12, 0, 55, 56, 57, 0, 58, 2, 3, 4, 5, 0, 0, 0, 0, 0, 0, 6, 7, 8, 9, 0, 10, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59, 60, 0, 13, 61, 62, 63, 64, 65, 66, 67, 68, 63, 69, 70, 71, 0, 72, 73, 74, 75, 76, 0, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 0, 87, 0, 88, 89, 90, 91, 0, 0, 0, 0, 0, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 93, 0, 0, 94, 0, 0, 95, 0, 96, 0, 0, 0, 97, 98, 99, 100, 14, 101, 102, 103, 104, 0, 0, 105, 0, 0, 0, 15, 16, 17, 18, 19, 20, 21, 22, 23, 106, 0, 0, 107, 108, 0, 109, 110, 111, 24, 25, 112, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 114, 0, 0, 0, 0, 0, 0, 0, 115, 0, 116, 0, 117, 0, 0, 0, 0, 0, 0, 0, 0, 118, 26, 27, 28, 119, 120, 0, 0, 0, 121, 0, 0, 122, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 125, 126, 0, 0, 0, 0, 127, 0, 0, 128, 129, 130, 131, 132, 0, 0, 133, 134, 0, 0, 0, 135, 136, 137, 138, 139, 140, 141, 142, 136, 137, 138, 139, 140, 141, 142, 136, 137, 138, 139, 140, 141, 142, 136, 137, 138, 139, 140, 141, 142, 136, 137, 138, 139, 140, 141, 142, 136, 137, 138, 139, 140, 141, 142, 136, 137, 138, 139, 140, 141, 142, 136, 137, 138, 139, 140, 141, 142, 136, 137, 138, 139, 140, 141, 142, 136, 137, 138, 139, 140, 141, 142, 136, 137, 138, 139, 140, 141, 142, 136, 137, 138, 139, 140, 141, 142, 136, 137, 138, 139, 140, 141, 142, 136, 137, 138, 139, 140, 141, 142, 136, 137, 138, 139, 140, 141, 142, 136, 137, 138, 139, 140, 141, 142, 136, 137, 138, 139, 140, 141, 142, 136, 137, 138, 139, 140, 141, 142, 136, 137, 138, 139, 140, 141, 142, 136, 137, 138, 139, 140, 141, 142, 136, 137, 138, 139, 140, 141, 142, 136, 137, 138, 139, 140, 141, 142, 136, 137, 138, 139, 140, 141, 142, 136, 137, 138, 139, 140, 141, 142, 136, 137, 138, 139, 140, 141, 143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 30, 31, 32, 33, 34, 35, 36, 144, 145, 146, 0, 0, 147, 148, 149, 150, 0, 0, 0, 151, 152, 153, 154, 0, 0, 155, 156, 0, 0, 0, 0, 0, 0, 0, 157, 0, 0, 0, 158, 0, 159, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 0, 0, 161, 0, 0, 0, 0, 0, 0, 0, 0, 162, 0, 0, 0, 0, 0, 163, 0, 0, 164, 0, 0, 0, 165, 166, 0, 167, 131, 0, 168, 169, 0, 0, 170, 171, 172, 0, 0, 0, 173, 174, 175, 0, 0, 176, 177, 116, 0, 178, 0, 179, 0, 0, 0, 180, 0, 0, 0, 181, 182, 0, 183, 184, 185, 186, 0, 0, 0, 0, 0, 116, 0, 0, 0, 0, 187, 188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 189, 190, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 193, 194, 195, 0, 196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 197, 0, 0, 0, 190, 0, 0, 0, 0, 0, 0, 198, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 199, 0, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 201, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 38, 39, 40, 41, 42, 43, 44, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 0, 0, 0, 0, 13, 0, 0, 0, 0, 14, 0, 15, 16, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); nfcSparseOffset = new sliceType$1([0, 5, 9, 11, 13, 24, 40, 42, 47, 58, 73, 86, 94, 99, 104, 106, 114, 121, 124, 132, 136, 140, 142, 144, 153, 157, 164, 169, 172, 182, 185, 192, 200, 203, 205, 208, 210, 215, 232, 244, 246, 252, 254, 256, 258, 260, 262, 264, 267, 270, 272, 275, 278, 282, 288, 290, 299, 301, 304, 306, 317, 321, 335, 338, 344, 350, 361, 365, 367, 369, 371, 373, 375, 381, 385, 387, 389, 397, 401, 404, 406, 408, 411, 414, 416, 418, 420, 422, 428, 431, 433, 440, 446, 452, 460, 466, 472, 478, 482, 496, 505, 508, 511, 513, 516, 518, 522, 527, 529, 531, 536, 542, 544, 546, 548, 554, 557, 559, 561, 567, 570, 578, 585, 588, 591, 593, 596, 604, 608, 615, 618, 624, 626, 629, 631, 634, 639, 641, 643, 645, 647, 649, 652, 654, 656, 658, 660, 662, 675, 685, 687, 689, 695, 697, 699, 702]); nfcSparseValues = $toNativeArray($kindStruct, [new valueRange.ptr(0, 4, 0), new valueRange.ptr(41216, 168, 168), new valueRange.ptr(33024, 175, 175), new valueRange.ptr(33024, 180, 180), new valueRange.ptr(33024, 184, 184), new valueRange.ptr(145, 3, 0), new valueRange.ptr(18169, 160, 161), new valueRange.ptr(18219, 175, 176), new valueRange.ptr(40960, 183, 183), new valueRange.ptr(0, 1, 0), new valueRange.ptr(40960, 146, 146), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33024, 152, 157), new valueRange.ptr(6, 10, 0), new valueRange.ptr(40960, 129, 129), new valueRange.ptr(40960, 133, 133), new valueRange.ptr(40960, 137, 137), new valueRange.ptr(18519, 138, 138), new valueRange.ptr(18549, 139, 139), new valueRange.ptr(14046, 140, 140), new valueRange.ptr(14070, 141, 141), new valueRange.ptr(18573, 142, 142), new valueRange.ptr(40960, 146, 146), new valueRange.ptr(14100, 147, 148), new valueRange.ptr(0, 15, 0), new valueRange.ptr(40960, 131, 131), new valueRange.ptr(40960, 135, 135), new valueRange.ptr(40960, 139, 139), new valueRange.ptr(40960, 141, 141), new valueRange.ptr(14268, 144, 144), new valueRange.ptr(14280, 145, 145), new valueRange.ptr(14262, 147, 147), new valueRange.ptr(40960, 150, 150), new valueRange.ptr(14382, 151, 151), new valueRange.ptr(14328, 156, 156), new valueRange.ptr(14304, 157, 157), new valueRange.ptr(14346, 158, 158), new valueRange.ptr(40960, 180, 181), new valueRange.ptr(14388, 182, 182), new valueRange.ptr(14394, 183, 183), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33075, 131, 135), new valueRange.ptr(1, 4, 0), new valueRange.ptr(33044, 129, 130), new valueRange.ptr(33075, 132, 132), new valueRange.ptr(33070, 133, 133), new valueRange.ptr(33038, 135, 135), new valueRange.ptr(0, 10, 0), new valueRange.ptr(33075, 144, 151), new valueRange.ptr(33050, 152, 152), new valueRange.ptr(33051, 153, 153), new valueRange.ptr(33052, 154, 154), new valueRange.ptr(14424, 162, 162), new valueRange.ptr(14430, 163, 163), new valueRange.ptr(14442, 164, 164), new valueRange.ptr(14436, 165, 165), new valueRange.ptr(14448, 166, 166), new valueRange.ptr(40960, 167, 167), new valueRange.ptr(0, 14, 0), new valueRange.ptr(14466, 128, 128), new valueRange.ptr(40960, 129, 129), new valueRange.ptr(14454, 130, 130), new valueRange.ptr(40960, 146, 146), new valueRange.ptr(14460, 147, 147), new valueRange.ptr(40960, 149, 149), new valueRange.ptr(33075, 150, 156), new valueRange.ptr(33075, 159, 162), new valueRange.ptr(33070, 163, 163), new valueRange.ptr(33075, 164, 164), new valueRange.ptr(33075, 167, 168), new valueRange.ptr(33070, 170, 170), new valueRange.ptr(33075, 171, 172), new valueRange.ptr(33070, 173, 173), new valueRange.ptr(0, 12, 0), new valueRange.ptr(33056, 145, 145), new valueRange.ptr(33075, 176, 176), new valueRange.ptr(33070, 177, 177), new valueRange.ptr(33075, 178, 179), new valueRange.ptr(33070, 180, 180), new valueRange.ptr(33075, 181, 182), new valueRange.ptr(33070, 183, 185), new valueRange.ptr(33075, 186, 186), new valueRange.ptr(33070, 187, 188), new valueRange.ptr(33075, 189, 189), new valueRange.ptr(33070, 190, 190), new valueRange.ptr(33075, 191, 191), new valueRange.ptr(5, 7, 0), new valueRange.ptr(33075, 128, 128), new valueRange.ptr(33075, 129, 129), new valueRange.ptr(33070, 130, 131), new valueRange.ptr(33070, 132, 133), new valueRange.ptr(33070, 134, 135), new valueRange.ptr(33070, 136, 137), new valueRange.ptr(33075, 138, 138), new valueRange.ptr(0, 4, 0), new valueRange.ptr(33075, 171, 177), new valueRange.ptr(33070, 178, 178), new valueRange.ptr(33075, 179, 179), new valueRange.ptr(33070, 189, 189), new valueRange.ptr(0, 4, 0), new valueRange.ptr(33075, 150, 153), new valueRange.ptr(33075, 155, 163), new valueRange.ptr(33075, 165, 167), new valueRange.ptr(33075, 169, 173), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33070, 153, 155), new valueRange.ptr(0, 7, 0), new valueRange.ptr(40960, 168, 168), new valueRange.ptr(16111, 169, 169), new valueRange.ptr(40960, 176, 176), new valueRange.ptr(16119, 177, 177), new valueRange.ptr(40960, 179, 179), new valueRange.ptr(16127, 180, 180), new valueRange.ptr(39171, 188, 188), new valueRange.ptr(8, 6, 0), new valueRange.ptr(33029, 141, 141), new valueRange.ptr(33075, 145, 145), new valueRange.ptr(33070, 146, 146), new valueRange.ptr(33075, 147, 147), new valueRange.ptr(33075, 148, 148), new valueRange.ptr(17715, 152, 159), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33027, 188, 188), new valueRange.ptr(39168, 190, 190), new valueRange.ptr(8, 7, 0), new valueRange.ptr(40960, 135, 135), new valueRange.ptr(11435, 139, 140), new valueRange.ptr(33029, 141, 141), new valueRange.ptr(39168, 151, 151), new valueRange.ptr(17779, 156, 157), new valueRange.ptr(17795, 159, 159), new valueRange.ptr(33075, 190, 190), new valueRange.ptr(0, 3, 0), new valueRange.ptr(17835, 179, 179), new valueRange.ptr(17843, 182, 182), new valueRange.ptr(33027, 188, 188), new valueRange.ptr(8, 3, 0), new valueRange.ptr(33029, 141, 141), new valueRange.ptr(17803, 153, 155), new valueRange.ptr(17827, 158, 158), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33027, 188, 188), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33029, 141, 141), new valueRange.ptr(0, 8, 0), new valueRange.ptr(40960, 135, 135), new valueRange.ptr(11459, 136, 136), new valueRange.ptr(11451, 139, 139), new valueRange.ptr(11467, 140, 140), new valueRange.ptr(33029, 141, 141), new valueRange.ptr(39168, 150, 151), new valueRange.ptr(17851, 156, 156), new valueRange.ptr(17859, 157, 157), new valueRange.ptr(0, 3, 0), new valueRange.ptr(40960, 146, 146), new valueRange.ptr(11475, 148, 148), new valueRange.ptr(39168, 190, 190), new valueRange.ptr(0, 6, 0), new valueRange.ptr(40960, 134, 135), new valueRange.ptr(11483, 138, 138), new valueRange.ptr(11499, 139, 139), new valueRange.ptr(11491, 140, 140), new valueRange.ptr(33029, 141, 141), new valueRange.ptr(39168, 151, 151), new valueRange.ptr(6145, 4, 0), new valueRange.ptr(40960, 134, 134), new valueRange.ptr(16135, 136, 136), new valueRange.ptr(33029, 141, 141), new valueRange.ptr(33057, 149, 150), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33027, 188, 188), new valueRange.ptr(40960, 191, 191), new valueRange.ptr(0, 9, 0), new valueRange.ptr(11507, 128, 128), new valueRange.ptr(39168, 130, 130), new valueRange.ptr(40960, 134, 134), new valueRange.ptr(11515, 135, 135), new valueRange.ptr(11523, 136, 136), new valueRange.ptr(12135, 138, 138), new valueRange.ptr(11759, 139, 139), new valueRange.ptr(33029, 141, 141), new valueRange.ptr(39168, 149, 150), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33029, 187, 188), new valueRange.ptr(39168, 190, 190), new valueRange.ptr(0, 6, 0), new valueRange.ptr(40960, 134, 135), new valueRange.ptr(11531, 138, 138), new valueRange.ptr(11547, 139, 139), new valueRange.ptr(11539, 140, 140), new valueRange.ptr(33029, 141, 141), new valueRange.ptr(39168, 151, 151), new valueRange.ptr(27613, 7, 0), new valueRange.ptr(39173, 138, 138), new valueRange.ptr(39168, 143, 143), new valueRange.ptr(40960, 153, 153), new valueRange.ptr(16143, 154, 154), new valueRange.ptr(12143, 156, 156), new valueRange.ptr(11770, 157, 157), new valueRange.ptr(11555, 158, 159), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33059, 184, 185), new valueRange.ptr(33029, 186, 186), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33060, 136, 139), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33061, 184, 185), new valueRange.ptr(33029, 186, 186), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33062, 136, 139), new valueRange.ptr(0, 4, 0), new valueRange.ptr(33070, 152, 153), new valueRange.ptr(33070, 181, 181), new valueRange.ptr(33070, 183, 183), new valueRange.ptr(33068, 185, 185), new valueRange.ptr(0, 16, 0), new valueRange.ptr(9802, 131, 131), new valueRange.ptr(9809, 141, 141), new valueRange.ptr(9816, 146, 146), new valueRange.ptr(9823, 151, 151), new valueRange.ptr(9830, 156, 156), new valueRange.ptr(9795, 169, 169), new valueRange.ptr(33063, 177, 177), new valueRange.ptr(33064, 178, 178), new valueRange.ptr(19099, 179, 179), new valueRange.ptr(33065, 180, 180), new valueRange.ptr(19108, 181, 181), new valueRange.ptr(17867, 182, 182), new valueRange.ptr(33280, 183, 183), new valueRange.ptr(17875, 184, 184), new valueRange.ptr(33280, 185, 185), new valueRange.ptr(33064, 186, 189), new valueRange.ptr(0, 11, 0), new valueRange.ptr(33064, 128, 128), new valueRange.ptr(19117, 129, 129), new valueRange.ptr(33075, 130, 131), new valueRange.ptr(33029, 132, 132), new valueRange.ptr(33075, 134, 135), new valueRange.ptr(9844, 147, 147), new valueRange.ptr(9851, 157, 157), new valueRange.ptr(9858, 162, 162), new valueRange.ptr(9865, 167, 167), new valueRange.ptr(9872, 172, 172), new valueRange.ptr(9837, 185, 185), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33070, 134, 134), new valueRange.ptr(0, 5, 0), new valueRange.ptr(40960, 165, 165), new valueRange.ptr(11563, 166, 166), new valueRange.ptr(39168, 174, 174), new valueRange.ptr(33027, 183, 183), new valueRange.ptr(33029, 185, 186), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33070, 141, 141), new valueRange.ptr(0, 1, 0), new valueRange.ptr(40960, 128, 146), new valueRange.ptr(0, 1, 0), new valueRange.ptr(47360, 161, 181), new valueRange.ptr(0, 1, 0), new valueRange.ptr(39168, 168, 191), new valueRange.ptr(0, 1, 0), new valueRange.ptr(39168, 128, 130), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33075, 157, 159), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33029, 148, 148), new valueRange.ptr(33029, 180, 180), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33029, 146, 146), new valueRange.ptr(33075, 157, 157), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33074, 169, 169), new valueRange.ptr(4, 2, 0), new valueRange.ptr(33071, 185, 186), new valueRange.ptr(33070, 187, 187), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33075, 151, 151), new valueRange.ptr(33070, 152, 152), new valueRange.ptr(0, 3, 0), new valueRange.ptr(33029, 160, 160), new valueRange.ptr(33075, 181, 188), new valueRange.ptr(33070, 191, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(33075, 176, 180), new valueRange.ptr(33070, 181, 186), new valueRange.ptr(33075, 187, 188), new valueRange.ptr(33070, 189, 189), new valueRange.ptr(33070, 191, 191), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33070, 128, 128), new valueRange.ptr(0, 8, 0), new valueRange.ptr(11635, 128, 128), new valueRange.ptr(11643, 129, 129), new valueRange.ptr(40960, 130, 130), new valueRange.ptr(11651, 131, 131), new valueRange.ptr(33029, 132, 132), new valueRange.ptr(33075, 171, 171), new valueRange.ptr(33070, 172, 172), new valueRange.ptr(33075, 173, 179), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33029, 170, 171), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33027, 166, 166), new valueRange.ptr(33029, 178, 179), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33027, 183, 183), new valueRange.ptr(0, 10, 0), new valueRange.ptr(33075, 144, 146), new valueRange.ptr(33025, 148, 148), new valueRange.ptr(33070, 149, 153), new valueRange.ptr(33075, 154, 155), new valueRange.ptr(33070, 156, 159), new valueRange.ptr(33075, 160, 160), new valueRange.ptr(33025, 162, 168), new valueRange.ptr(33070, 173, 173), new valueRange.ptr(33075, 180, 180), new valueRange.ptr(33075, 184, 185), new valueRange.ptr(4, 3, 0), new valueRange.ptr(1078, 128, 129), new valueRange.ptr(33024, 151, 151), new valueRange.ptr(33024, 190, 190), new valueRange.ptr(0, 13, 0), new valueRange.ptr(33075, 144, 145), new valueRange.ptr(33025, 146, 147), new valueRange.ptr(33075, 148, 151), new valueRange.ptr(33025, 152, 154), new valueRange.ptr(33075, 155, 156), new valueRange.ptr(33075, 161, 161), new valueRange.ptr(33025, 165, 166), new valueRange.ptr(33075, 167, 167), new valueRange.ptr(33070, 168, 168), new valueRange.ptr(33075, 169, 169), new valueRange.ptr(33025, 170, 171), new valueRange.ptr(33070, 172, 175), new valueRange.ptr(33075, 176, 176), new valueRange.ptr(17042, 2, 0), new valueRange.ptr(443, 166, 166), new valueRange.ptr(87, 170, 171), new valueRange.ptr(7, 5, 0), new valueRange.ptr(40960, 144, 144), new valueRange.ptr(40960, 146, 146), new valueRange.ptr(40960, 148, 148), new valueRange.ptr(15312, 154, 155), new valueRange.ptr(15326, 174, 174), new valueRange.ptr(14, 5, 0), new valueRange.ptr(15333, 141, 142), new valueRange.ptr(15340, 143, 143), new valueRange.ptr(40960, 144, 144), new valueRange.ptr(40960, 146, 146), new valueRange.ptr(40960, 148, 148), new valueRange.ptr(25585, 10, 0), new valueRange.ptr(40960, 131, 131), new valueRange.ptr(15354, 132, 132), new valueRange.ptr(40960, 136, 136), new valueRange.ptr(15361, 137, 137), new valueRange.ptr(40960, 139, 139), new valueRange.ptr(15368, 140, 140), new valueRange.ptr(40960, 163, 163), new valueRange.ptr(15375, 164, 165), new valueRange.ptr(15382, 166, 166), new valueRange.ptr(40960, 188, 188), new valueRange.ptr(7, 3, 0), new valueRange.ptr(15487, 160, 161), new valueRange.ptr(15529, 162, 163), new valueRange.ptr(15571, 170, 173), new valueRange.ptr(4, 1, 0), new valueRange.ptr(1166, 169, 170), new valueRange.ptr(0, 1, 0), new valueRange.ptr(17652, 156, 156), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33075, 175, 177), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33029, 191, 191), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33075, 160, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(33069, 170, 170), new valueRange.ptr(33074, 171, 171), new valueRange.ptr(33076, 172, 172), new valueRange.ptr(33071, 173, 173), new valueRange.ptr(33072, 174, 175), new valueRange.ptr(0, 3, 0), new valueRange.ptr(19126, 179, 179), new valueRange.ptr(19126, 181, 182), new valueRange.ptr(19126, 186, 191), new valueRange.ptr(0, 1, 0), new valueRange.ptr(19126, 143, 163), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33024, 174, 190), new valueRange.ptr(0, 7, 0), new valueRange.ptr(33024, 132, 132), new valueRange.ptr(33024, 135, 135), new valueRange.ptr(33024, 144, 144), new valueRange.ptr(33024, 158, 158), new valueRange.ptr(33024, 161, 161), new valueRange.ptr(33024, 178, 178), new valueRange.ptr(33024, 187, 187), new valueRange.ptr(0, 3, 0), new valueRange.ptr(33024, 128, 128), new valueRange.ptr(33024, 139, 139), new valueRange.ptr(33024, 142, 142), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33075, 175, 175), new valueRange.ptr(33075, 180, 189), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33075, 158, 159), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33075, 176, 177), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33029, 134, 134), new valueRange.ptr(33029, 172, 172), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33029, 132, 132), new valueRange.ptr(33075, 160, 177), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33070, 171, 173), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33029, 147, 147), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33027, 179, 179), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33029, 128, 128), new valueRange.ptr(0, 5, 0), new valueRange.ptr(33075, 176, 176), new valueRange.ptr(33075, 178, 179), new valueRange.ptr(33070, 180, 180), new valueRange.ptr(33075, 183, 184), new valueRange.ptr(33075, 190, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33075, 129, 129), new valueRange.ptr(33029, 182, 182), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33029, 173, 173), new valueRange.ptr(0, 6, 0), new valueRange.ptr(58624, 128, 128), new valueRange.ptr(50688, 129, 155), new valueRange.ptr(58624, 156, 156), new valueRange.ptr(50688, 157, 183), new valueRange.ptr(58624, 184, 184), new valueRange.ptr(50688, 185, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(50688, 128, 147), new valueRange.ptr(58624, 148, 148), new valueRange.ptr(50688, 149, 175), new valueRange.ptr(58624, 176, 176), new valueRange.ptr(50688, 177, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(50688, 128, 139), new valueRange.ptr(58624, 140, 140), new valueRange.ptr(50688, 141, 167), new valueRange.ptr(58624, 168, 168), new valueRange.ptr(50688, 169, 191), new valueRange.ptr(0, 7, 0), new valueRange.ptr(50688, 128, 131), new valueRange.ptr(58624, 132, 132), new valueRange.ptr(50688, 133, 159), new valueRange.ptr(58624, 160, 160), new valueRange.ptr(50688, 161, 187), new valueRange.ptr(58624, 188, 188), new valueRange.ptr(50688, 189, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(50688, 128, 151), new valueRange.ptr(58624, 152, 152), new valueRange.ptr(50688, 153, 179), new valueRange.ptr(58624, 180, 180), new valueRange.ptr(50688, 181, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(50688, 128, 143), new valueRange.ptr(58624, 144, 144), new valueRange.ptr(50688, 145, 171), new valueRange.ptr(58624, 172, 172), new valueRange.ptr(50688, 173, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(50688, 128, 135), new valueRange.ptr(58624, 136, 136), new valueRange.ptr(50688, 137, 163), new valueRange.ptr(58624, 164, 164), new valueRange.ptr(50688, 165, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(50688, 128, 135), new valueRange.ptr(58624, 136, 136), new valueRange.ptr(50688, 137, 163), new valueRange.ptr(6, 13, 0), new valueRange.ptr(17319, 157, 157), new valueRange.ptr(33046, 158, 158), new valueRange.ptr(17433, 159, 159), new valueRange.ptr(17415, 170, 171), new valueRange.ptr(17675, 172, 172), new valueRange.ptr(17683, 173, 173), new valueRange.ptr(17247, 174, 177), new valueRange.ptr(17277, 178, 180), new valueRange.ptr(17301, 181, 182), new valueRange.ptr(17313, 184, 184), new valueRange.ptr(17325, 185, 187), new valueRange.ptr(17349, 188, 188), new valueRange.ptr(17355, 190, 190), new valueRange.ptr(6, 8, 0), new valueRange.ptr(17361, 128, 129), new valueRange.ptr(17373, 131, 132), new valueRange.ptr(17391, 134, 137), new valueRange.ptr(17427, 138, 138), new valueRange.ptr(17295, 139, 139), new valueRange.ptr(17271, 140, 140), new valueRange.ptr(17343, 141, 141), new valueRange.ptr(17385, 142, 142), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33024, 164, 165), new valueRange.ptr(33024, 176, 177), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33024, 155, 157), new valueRange.ptr(33280, 158, 163), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33024, 144, 144), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33024, 153, 153), new valueRange.ptr(33280, 178, 180), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33024, 188, 189), new valueRange.ptr(0, 3, 0), new valueRange.ptr(33075, 160, 166), new valueRange.ptr(33070, 167, 173), new valueRange.ptr(33075, 174, 175), new valueRange.ptr(0, 4, 0), new valueRange.ptr(33024, 137, 140), new valueRange.ptr(33024, 176, 178), new valueRange.ptr(33024, 180, 180), new valueRange.ptr(33024, 182, 191), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33024, 129, 140), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33024, 181, 186), new valueRange.ptr(0, 4, 0), new valueRange.ptr(19126, 158, 159), new valueRange.ptr(19126, 163, 163), new valueRange.ptr(19126, 165, 166), new valueRange.ptr(19126, 170, 175), new valueRange.ptr(0, 5, 0), new valueRange.ptr(19126, 130, 135), new valueRange.ptr(19126, 138, 143), new valueRange.ptr(19126, 146, 151), new valueRange.ptr(19126, 154, 156), new valueRange.ptr(33024, 163, 163), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33070, 189, 189), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33070, 160, 160), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33075, 182, 186), new valueRange.ptr(45, 5, 0), new valueRange.ptr(33070, 141, 141), new valueRange.ptr(33075, 143, 143), new valueRange.ptr(33075, 184, 184), new valueRange.ptr(33025, 185, 186), new valueRange.ptr(33029, 191, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33075, 165, 165), new valueRange.ptr(33070, 166, 166), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33075, 164, 167), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33075, 171, 172), new valueRange.ptr(0, 5, 0), new valueRange.ptr(33070, 134, 135), new valueRange.ptr(33075, 136, 138), new valueRange.ptr(33070, 139, 139), new valueRange.ptr(33075, 140, 140), new valueRange.ptr(33070, 141, 144), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33029, 134, 134), new valueRange.ptr(33029, 191, 191), new valueRange.ptr(6142, 7, 0), new valueRange.ptr(40960, 153, 153), new valueRange.ptr(16975, 154, 154), new valueRange.ptr(40960, 155, 155), new valueRange.ptr(16985, 156, 156), new valueRange.ptr(40960, 165, 165), new valueRange.ptr(16995, 171, 171), new valueRange.ptr(33029, 185, 186), new valueRange.ptr(0, 6, 0), new valueRange.ptr(33075, 128, 130), new valueRange.ptr(39168, 167, 167), new valueRange.ptr(11659, 174, 174), new valueRange.ptr(11669, 175, 175), new valueRange.ptr(40960, 177, 178), new valueRange.ptr(33029, 179, 180), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33029, 128, 128), new valueRange.ptr(33027, 138, 138), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33029, 181, 181), new valueRange.ptr(33027, 182, 182), new valueRange.ptr(2, 1, 0), new valueRange.ptr(33027, 169, 170), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33027, 187, 188), new valueRange.ptr(39168, 190, 190), new valueRange.ptr(0, 7, 0), new valueRange.ptr(40960, 135, 135), new valueRange.ptr(11679, 139, 139), new valueRange.ptr(11689, 140, 140), new valueRange.ptr(33029, 141, 141), new valueRange.ptr(39168, 151, 151), new valueRange.ptr(33075, 166, 172), new valueRange.ptr(33075, 176, 180), new valueRange.ptr(0, 3, 0), new valueRange.ptr(33029, 130, 130), new valueRange.ptr(33027, 134, 134), new valueRange.ptr(33075, 158, 158), new valueRange.ptr(27469, 6, 0), new valueRange.ptr(39168, 176, 176), new valueRange.ptr(40960, 185, 185), new valueRange.ptr(39168, 186, 186), new valueRange.ptr(11709, 187, 187), new valueRange.ptr(11699, 188, 189), new valueRange.ptr(11719, 190, 190), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33029, 130, 130), new valueRange.ptr(33027, 131, 131), new valueRange.ptr(0, 5, 0), new valueRange.ptr(39168, 175, 175), new valueRange.ptr(40960, 184, 185), new valueRange.ptr(11729, 186, 186), new valueRange.ptr(11739, 187, 187), new valueRange.ptr(33029, 191, 191), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33027, 128, 128), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33029, 182, 182), new valueRange.ptr(33027, 183, 183), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33029, 171, 171), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33029, 185, 185), new valueRange.ptr(33027, 186, 186), new valueRange.ptr(0, 4, 0), new valueRange.ptr(39168, 176, 176), new valueRange.ptr(40960, 181, 181), new valueRange.ptr(11749, 184, 184), new valueRange.ptr(33029, 189, 190), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33027, 131, 131), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33029, 160, 160), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33029, 180, 180), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33029, 135, 135), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33029, 153, 153), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33027, 130, 130), new valueRange.ptr(33029, 132, 133), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33029, 151, 151), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33025, 176, 180), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33075, 176, 182), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33026, 176, 177), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33025, 158, 158), new valueRange.ptr(0, 12, 0), new valueRange.ptr(17891, 158, 158), new valueRange.ptr(17901, 159, 159), new valueRange.ptr(17953, 160, 160), new valueRange.ptr(17967, 161, 161), new valueRange.ptr(17981, 162, 162), new valueRange.ptr(17995, 163, 163), new valueRange.ptr(18009, 164, 164), new valueRange.ptr(33068, 165, 166), new valueRange.ptr(33025, 167, 169), new valueRange.ptr(33073, 173, 173), new valueRange.ptr(33068, 174, 178), new valueRange.ptr(33070, 187, 191), new valueRange.ptr(0, 9, 0), new valueRange.ptr(33070, 128, 130), new valueRange.ptr(33075, 133, 137), new valueRange.ptr(33070, 138, 139), new valueRange.ptr(33075, 170, 173), new valueRange.ptr(17911, 187, 187), new valueRange.ptr(17921, 188, 188), new valueRange.ptr(18023, 189, 189), new valueRange.ptr(18051, 190, 190), new valueRange.ptr(18037, 191, 191), new valueRange.ptr(0, 1, 0), new valueRange.ptr(18065, 128, 128), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33075, 130, 132), new valueRange.ptr(0, 5, 0), new valueRange.ptr(33075, 128, 134), new valueRange.ptr(33075, 136, 152), new valueRange.ptr(33075, 155, 161), new valueRange.ptr(33075, 163, 164), new valueRange.ptr(33075, 166, 170), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33075, 172, 175), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33070, 144, 150), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33075, 132, 137), new valueRange.ptr(33027, 138, 138), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33024, 147, 147)]); nfcSparse = new sparseBlocks.ptr(new sliceType$2(nfcSparseValues), nfcSparseOffset); nfkcValues = $toNativeArray($kindUint16, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40960, 40960, 40960, 0, 0, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 0, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 0, 0, 0, 0, 0, 0, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 0, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12166, 12171, 18079, 12176, 18094, 18099, 40960, 18109, 12281, 12286, 18114, 12306, 12421, 12426, 12431, 18134, 0, 12571, 12606, 12611, 18144, 18149, 18164, 0, 40960, 12746, 12751, 12756, 18214, 12876, 0, 0, 12946, 12951, 18224, 12956, 18239, 18244, 40960, 18254, 13061, 13066, 18259, 13086, 13206, 13211, 13216, 18279, 0, 13356, 13391, 13396, 18289, 18294, 18309, 0, 40960, 13536, 13541, 13546, 18359, 13671, 0, 13696, 12181, 12961, 18084, 18229, 12211, 12991, 12231, 13011, 12236, 13016, 12241, 13021, 12246, 13026, 12256, 13036, 0, 0, 18119, 18264, 12296, 13076, 12301, 13081, 12331, 13111, 12316, 13096, 12356, 13136, 12366, 13146, 12371, 13151, 12381, 13161, 12386, 13166, 0, 0, 12436, 13221, 12441, 13226, 12446, 13231, 12481, 13261, 12451, 0, 6496, 6637, 12491, 13271, 12511, 13296, 0, 12521, 13306, 12531, 13316, 12526, 13311, 7090, 7226, 0, 0, 12566, 13351, 12591, 13376, 12581, 13366, 7266, 0, 0, 18154, 18299, 12616, 13401, 12626, 13411, 0, 0, 12656, 13441, 12681, 13466, 12666, 13451, 18189, 18334, 12691, 13476, 12706, 13491, 18194, 18339, 12731, 13521, 12716, 13506, 0, 0, 18204, 18349, 18209, 18354, 12761, 13551, 12771, 13561, 12776, 13566, 12806, 13596, 12841, 13631, 12881, 13676, 12901, 12916, 13716, 12926, 13726, 12931, 13731, 167, 0, 0, 0, 0, 11781, 11787, 11793, 6517, 6520, 6670, 6541, 6544, 6724, 12191, 12971, 12461, 13241, 12631, 13416, 12781, 13571, 14822, 15221, 14815, 15214, 14829, 15228, 14808, 15207, 0, 14535, 14934, 14528, 14927, 13770, 13788, 0, 0, 12376, 13156, 12501, 13286, 18179, 18324, 14759, 15158, 13806, 13812, 13276, 6469, 6472, 6613, 12351, 13131, 0, 0, 12561, 13346, 14542, 14941, 13764, 13782, 13776, 13794, 12196, 12976, 12201, 12981, 12321, 13101, 12326, 13106, 12466, 13246, 12471, 13251, 12636, 13421, 12641, 13426, 12671, 13456, 12676, 13461, 12786, 13576, 12791, 13581, 12701, 13486, 12726, 13516, 0, 0, 12401, 13181, 0, 0, 0, 0, 0, 0, 18089, 18234, 18129, 18274, 14710, 15109, 14675, 15074, 18159, 18304, 14703, 15102, 12891, 13686, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39219, 39219, 39219, 39219, 39219, 33075, 39219, 39219, 39219, 39219, 39219, 39219, 39219, 33075, 33075, 39219, 33075, 39219, 33075, 39219, 39219, 33076, 33070, 33070, 33070, 33070, 33076, 39212, 33070, 33070, 33070, 33070, 33070, 33066, 33066, 39214, 39214, 39214, 39214, 39210, 39210, 33070, 33070, 33070, 33070, 39214, 39214, 33070, 39214, 39214, 33070, 33070, 33025, 33025, 33025, 33025, 39169, 33070, 33070, 33070, 33070, 33075, 33075, 33075, 18885, 18890, 39219, 18895, 19080, 39223, 33075, 33070, 33070, 33070, 33075, 33075, 33075, 33070, 33070, 0, 33075, 33075, 33075, 33070, 33070, 33070, 33070, 33075, 33076, 33070, 33070, 33075, 33077, 33078, 33078, 33077, 33078, 33078, 33077, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 0, 0, 0, 0, 371, 0, 0, 0, 0, 0, 17084, 0, 0, 0, 55, 0, 0, 0, 0, 0, 17009, 17554, 13824, 206, 13854, 13866, 13884, 0, 13914, 0, 13932, 13962, 15903, 40960, 0, 0, 0, 40960, 0, 40960, 0, 40960, 0, 0, 0, 0, 0, 40960, 0, 40960, 0, 0, 0, 40960, 0, 0, 0, 40960, 13902, 13950, 18453, 13998, 18495, 14016, 16007, 40960, 0, 0, 0, 40960, 0, 40960, 0, 40960, 0, 0, 0, 0, 0, 40960, 0, 40960, 0, 0, 0, 40960, 0, 0, 0, 40960, 18519, 18549, 14046, 14070, 18573, 0, 449, 467, 431, 17187, 17193, 509, 491, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 473, 494, 497, 0, 395, 458, 0, 0, 0, 425, 0, 0, 0, 0, 0, 0, 14136, 14148, 0, 14130, 0, 0, 40960, 14112, 0, 0, 0, 0, 14196, 14172, 14214, 0, 40960, 0, 0, 40960, 0, 40960, 40960, 40960, 40960, 14184, 40960, 0, 0, 0, 40960, 0, 0, 0, 0, 40960, 0, 0, 0, 40960, 0, 0, 0, 40960, 0, 40960, 0, 0, 40960, 0, 0, 40960, 0, 40960, 40960, 40960, 40960, 14316, 40960, 0, 0, 0, 40960, 0, 0, 14154, 14286, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14118, 14250, 14124, 14256, 0, 0, 14142, 14274, 40960, 40960, 14400, 14406, 14160, 14292, 14166, 14298, 0, 0, 14178, 14310, 14190, 14322, 14202, 14334, 40960, 40960, 14412, 14418, 14244, 14376, 14208, 14340, 14220, 14352, 14226, 14358, 14232, 14364, 0, 0, 14238, 14370, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7527, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33070, 33075, 33075, 33075, 33075, 33070, 33075, 33075, 33075, 33071, 33070, 33075, 33075, 33075, 33075, 33075, 33075, 33070, 33070, 33070, 33070, 33070, 33070, 33075, 33075, 33070, 33075, 33075, 33071, 33074, 33075, 33030, 33031, 33032, 33033, 33034, 33035, 33036, 33037, 33038, 33039, 33039, 33040, 33041, 33042, 0, 33043, 0, 0, 0, 0, 0, 0, 0, 0, 40960, 0, 40960, 33047, 33048, 33049, 33050, 33051, 33052, 33053, 33054, 39219, 39219, 39214, 33070, 33075, 33075, 33075, 33075, 33075, 33070, 33075, 33075, 33070, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33055, 0, 0, 0, 0, 7562, 8217, 8277, 8272, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33070, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 0, 33070, 33075, 33075, 33070, 33075, 33075, 33070, 33075, 33075, 33075, 33070, 33070, 33070, 33047, 33048, 33049, 33075, 33075, 33075, 33070, 33075, 33075, 33070, 33070, 33075, 33075, 33075, 33075, 33075, 0, 0, 0, 0, 0, 40960, 11571, 40960, 11579, 40960, 11587, 40960, 11595, 40960, 11603, 0, 0, 40960, 11611, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33027, 39168, 0, 0, 0, 0, 40960, 11619, 40960, 11627, 40960, 40960, 105, 107, 111, 131, 245, 248, 1046, 133, 137, 139, 260, 263, 266, 143, 0, 151, 155, 224, 159, 254, 1050, 1054, 161, 169, 171, 1062, 299, 173, 1066, 449, 452, 455, 509, 512, 147, 165, 171, 173, 449, 452, 494, 509, 512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 527, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 251, 135, 257, 212, 266, 141, 269, 272, 278, 284, 287, 290, 1070, 365, 296, 1074, 368, 305, 302, 308, 311, 314, 317, 320, 332, 335, 236, 338, 341, 1058, 344, 347, 181, 353, 356, 359, 467, 33075, 33075, 33070, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33070, 33075, 33075, 33078, 33067, 33070, 33066, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33076, 33074, 33074, 33070, 0, 33075, 33077, 33070, 33075, 33070, 12206, 12986, 12216, 12996, 12221, 13001, 12226, 13006, 14563, 14962, 12251, 13031, 12261, 13041, 12276, 13056, 12266, 13046, 12271, 13051, 14598, 14997, 14605, 15004, 12336, 13116, 12341, 13121, 14619, 15018, 12346, 13126, 12361, 13141, 12391, 13171, 12406, 13186, 12396, 13176, 12411, 13191, 12416, 13196, 12486, 13266, 14626, 15025, 12496, 13281, 12506, 13291, 12516, 13301, 18139, 18284, 14633, 15032, 12541, 13326, 12536, 13321, 12546, 13331, 12551, 13336, 12556, 13341, 12576, 13361, 12586, 13371, 12601, 13386, 12596, 13381, 14668, 15067, 14682, 15081, 14689, 15088, 14696, 15095, 12646, 13431, 12651, 13436, 12661, 13446, 18184, 18329, 14766, 15165, 12686, 13471, 12696, 13481, 18199, 18344, 14773, 15172, 14780, 15179, 14787, 15186, 12711, 13496, 12721, 13511, 12741, 13531, 12736, 13526, 12801, 13591, 12816, 13606, 12811, 13601, 14794, 15193, 14801, 15200, 12821, 13611, 12826, 13616, 12831, 13621, 12836, 13626, 12851, 13641, 12846, 13636, 12856, 13651, 12861, 13656, 12866, 13661, 12896, 13691, 12921, 13721, 12936, 13736, 12941, 13741, 13201, 13501, 13646, 13706, 7142, 17134, 0, 0, 0, 0, 18104, 18249, 12186, 12966, 14479, 14878, 14472, 14871, 14493, 14892, 14486, 14885, 14549, 14948, 14507, 14906, 14500, 14899, 14521, 14920, 14514, 14913, 14556, 14955, 18124, 18269, 12311, 13091, 12291, 13071, 14577, 14976, 14570, 14969, 14591, 14990, 14584, 14983, 14612, 15011, 12456, 13236, 12476, 13256, 18174, 18319, 12621, 13406, 14647, 15046, 14640, 15039, 14661, 15060, 14654, 15053, 14752, 15151, 14724, 15123, 14717, 15116, 14738, 15137, 14731, 15130, 14745, 15144, 12796, 13586, 12766, 13556, 14843, 15242, 14836, 15235, 14857, 15256, 14850, 15249, 14864, 15263, 12871, 13666, 12911, 13711, 12906, 13701, 12886, 13681, 0, 0, 0, 0, 0, 0, 18459, 18465, 18741, 18765, 18749, 18773, 18757, 18781, 18369, 18375, 18597, 18621, 18605, 18629, 18613, 18637, 18477, 18483, 15823, 15839, 15831, 15847, 0, 0, 18381, 18387, 15615, 15631, 15623, 15639, 0, 0, 18501, 18507, 18789, 18813, 18797, 18821, 18805, 18829, 18393, 18399, 18645, 18669, 18653, 18677, 18661, 18685, 18525, 18531, 15919, 15943, 15927, 15951, 15935, 15959, 18405, 18411, 15663, 15687, 15671, 15695, 15679, 15703, 18537, 18543, 15967, 15983, 15975, 15991, 0, 0, 18417, 18423, 15711, 15727, 15719, 15735, 0, 0, 18555, 18561, 16023, 16047, 16031, 16055, 16039, 16063, 0, 18429, 0, 15743, 0, 15751, 0, 15759, 18579, 18585, 18837, 18861, 18845, 18869, 18853, 18877, 18435, 18441, 18693, 18717, 18701, 18725, 18709, 18733, 18447, 17205, 13992, 17211, 18489, 17217, 14010, 17223, 14040, 17229, 14064, 17235, 18567, 17241, 0, 0, 15799, 15807, 16795, 16825, 16805, 16835, 16815, 16845, 15599, 15607, 16615, 16645, 16625, 16655, 16635, 16665, 15871, 15879, 16855, 16885, 16865, 16895, 16875, 16905, 15647, 15655, 16675, 16705, 16685, 16715, 16695, 16725, 16087, 16095, 16915, 16945, 16925, 16955, 16935, 16965, 15767, 15775, 16735, 16765, 16745, 16775, 16755, 16785, 13980, 13974, 15783, 13986, 15791, 0, 18471, 15815, 13836, 13830, 13818, 17157, 13842, 17054, 470, 17054, 17079, 17561, 15855, 14004, 15863, 0, 18513, 15887, 13848, 17163, 13860, 17169, 13872, 17568, 17575, 17582, 14028, 14022, 15895, 17659, 0, 0, 14034, 15911, 13896, 13890, 13878, 17175, 0, 17589, 17596, 17603, 14082, 14076, 15999, 17667, 14052, 14058, 14088, 16015, 13944, 13938, 13926, 17187, 13920, 17547, 17554, 129, 0, 0, 16071, 14094, 16079, 0, 18591, 16103, 13908, 17181, 13956, 17199, 13968, 17009, 17059, 0, 7134, 7138, 71, 7258, 0, 7150, 7154, 233, 0, 7262, 143, 81, 81, 81, 145, 218, 83, 83, 89, 153, 0, 93, 6547, 0, 0, 97, 99, 101, 101, 101, 0, 0, 6565, 7118, 6574, 0, 117, 0, 443, 0, 117, 0, 87, 17129, 69, 71, 0, 139, 75, 77, 0, 91, 159, 536, 539, 542, 545, 147, 0, 7070, 491, 452, 380, 419, 1126, 0, 0, 0, 0, 73, 137, 139, 147, 149, 0, 0, 0, 0, 0, 0, 8756, 8768, 8948, 8732, 8864, 8744, 8870, 8894, 8906, 8750, 8912, 8762, 8900, 8918, 8924, 7362, 83, 6493, 7082, 6502, 109, 6577, 7126, 7502, 6505, 113, 6589, 7130, 89, 71, 73, 91, 147, 6634, 7198, 6643, 173, 6760, 7250, 7522, 6646, 177, 6763, 7254, 153, 135, 137, 155, 0, 15389, 0, 40960, 15396, 40960, 0, 15403, 40960, 15410, 0, 0, 0, 40960, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12156, 40960, 15424, 0, 40960, 40960, 0, 0, 0, 0, 0, 0, 0, 15417, 12151, 12161, 15431, 15438, 40960, 40960, 15445, 15452, 40960, 40960, 15459, 15466, 40960, 40960, 40960, 40960, 0, 0, 15473, 15480, 40960, 40960, 15501, 15508, 40960, 40960, 15515, 15522, 0, 0, 0, 0, 0, 0, 0, 40960, 40960, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40960, 0, 0, 0, 0, 0, 40960, 40960, 0, 40960, 15543, 15550, 15557, 15564, 0, 0, 40960, 40960, 40960, 40960, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 37, 39, 41, 43, 45, 47, 49, 51, 6277, 6280, 6283, 6286, 6289, 6292, 6295, 6298, 6301, 6304, 6313, 6766, 6770, 6774, 6778, 6782, 6786, 6790, 6794, 6798, 7302, 7307, 7312, 7317, 7322, 7327, 7332, 7337, 7342, 7347, 7352, 6274, 6310, 6346, 6382, 6418, 6427, 6433, 6439, 6445, 7014, 7018, 7022, 7026, 7030, 7034, 7038, 7042, 7046, 7050, 7054, 6906, 6910, 6914, 6918, 6922, 6926, 6930, 6934, 6938, 6942, 6946, 6950, 6954, 6958, 6962, 6966, 6970, 6974, 6978, 6982, 6986, 6990, 6994, 6998, 7002, 7006, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 1730, 1766, 1778, 1794, 1802, 1814, 1822, 1830, 1842, 1926, 1950, 1966, 1982, 1998, 2014, 2046, 2050, 2054, 2106, 2146, 2162, 2170, 2174, 2186, 2214, 2218, 2242, 2246, 2254, 2270, 2426, 2446, 2510, 2530, 2538, 2542, 2558, 2586, 2630, 2642, 2674, 2686, 2690, 2694, 2718, 2722, 2766, 2778, 2786, 2794, 2810, 2818, 2826, 2870, 2874, 2882, 2886, 2894, 2902, 2918, 2946, 3066, 3086, 3090, 3218, 3222, 3242, 3246, 3254, 3262, 3270, 3282, 3322, 3338, 3358, 3470, 3482, 3498, 3510, 3522, 3530, 3534, 3538, 3542, 3546, 3730, 3802, 3814, 3818, 3822, 3826, 3834, 3838, 3858, 3886, 3894, 3958, 3962, 3970, 3974, 3982, 3986, 4022, 4026, 4054, 4058, 4062, 4066, 4086, 4122, 4126, 4130, 4166, 4230, 4234, 4266, 4282, 4290, 4322, 4358, 4426, 4434, 4454, 4466, 4474, 4482, 4486, 4490, 4514, 4518, 4546, 4554, 4562, 4566, 4578, 4586, 4590, 4594, 4602, 4606, 4766, 4786, 4838, 4842, 4850, 4894, 4902, 4910, 4918, 4978, 4982, 4990, 4994, 4998, 5042, 5046, 5054, 5074, 5078, 5106, 5114, 5118, 5154, 5186, 5206, 5210, 5218, 5262, 5266, 5282, 5318, 5330, 5346, 5370, 5378, 5382, 5386, 5390, 5402, 5406, 5414, 5442, 5446, 5450, 5474, 5478, 5486, 5506, 5510, 5514, 5522, 5526, 0, 0, 0, 0, 0, 0, 40960, 0, 0, 0, 0, 40960, 16159, 40960, 16167, 40960, 16175, 40960, 16183, 40960, 16191, 40960, 16199, 40960, 16207, 40960, 16215, 40960, 16223, 40960, 16231, 40960, 16239, 40960, 16247, 0, 40960, 16255, 40960, 16263, 40960, 16271, 0, 0, 0, 0, 0, 40960, 16279, 16287, 40960, 16295, 16303, 40960, 16311, 16319, 40960, 16327, 16335, 40960, 16343, 16351, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16151, 0, 0, 0, 0, 39172, 39172, 17139, 17145, 40960, 16359, 9914, 0, 0, 0, 0, 0, 0, 40960, 0, 0, 0, 0, 40960, 16375, 40960, 16383, 40960, 16391, 40960, 16399, 40960, 16407, 40960, 16415, 40960, 16423, 40960, 16431, 40960, 16439, 40960, 16447, 40960, 16455, 40960, 16463, 0, 40960, 16471, 40960, 16479, 40960, 16487, 0, 0, 0, 0, 0, 40960, 16495, 16503, 40960, 16511, 16519, 40960, 16527, 16535, 40960, 16543, 16551, 40960, 16559, 16567, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40960, 40960, 40960, 40960, 0, 16367, 0, 0, 16575, 16583, 16591, 16599, 0, 0, 40960, 16607, 9935, 874, 814, 818, 822, 894, 826, 830, 834, 838, 842, 846, 850, 854, 858, 862, 18900, 18906, 18912, 18918, 18924, 18930, 18936, 18942, 18948, 18954, 18960, 18966, 18972, 18978, 18984, 18990, 18996, 19002, 19008, 19014, 19020, 966, 866, 870, 1002, 1006, 1010, 1014, 1018, 1022, 1026, 878, 1030, 1034, 882, 886, 890, 898, 902, 906, 910, 914, 918, 922, 926, 930, 934, 938, 942, 946, 950, 1038, 1042, 954, 958, 962, 970, 974, 978, 982, 986, 990, 994, 998, 0, 0, 0, 1730, 1822, 1742, 2430, 1746, 1770, 1750, 3990, 1802, 1758, 1734, 2562, 2450, 1842, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8282, 8288, 8294, 8300, 8306, 8312, 8318, 8324, 8330, 8336, 8342, 8348, 8354, 8360, 10035, 10044, 10053, 10062, 10071, 10080, 10089, 10098, 10107, 10125, 10134, 10143, 10152, 10161, 10116, 11193, 11002, 0, 8366, 8390, 8378, 8462, 8396, 8426, 8372, 8420, 8384, 8438, 8486, 8516, 8510, 8498, 8576, 8468, 8480, 8504, 8492, 8534, 8450, 8522, 8564, 8540, 8432, 8402, 8456, 8474, 8528, 8408, 8570, 8444, 8546, 8414, 8552, 8558, 2354, 2822, 3242, 4298, 0, 0, 0, 0, 0, 0, 0, 0, 7114, 6316, 6319, 6322, 6325, 6328, 6331, 6334, 6337, 6340, 6349, 6352, 6355, 6358, 6361, 6364, 790, 798, 802, 810, 814, 818, 826, 834, 838, 846, 850, 854, 858, 862, 11823, 11831, 11839, 11847, 11855, 11863, 11871, 11879, 11895, 11903, 11911, 11919, 11927, 11935, 12010, 11954, 11887, 0, 1730, 1822, 1742, 2430, 1826, 1970, 1738, 1966, 1806, 2186, 3338, 3730, 3546, 3358, 5218, 2446, 3282, 3406, 3342, 4174, 2302, 3846, 5002, 4194, 2118, 4242, 3998, 2586, 5138, 1922, 2222, 3578, 5418, 1862, 2006, 3486, 1746, 1770, 1750, 2782, 2290, 2178, 2650, 2638, 4078, 1858, 5022, 2206, 2550, 6367, 6370, 6373, 6376, 6385, 6388, 6391, 6394, 6397, 6400, 6403, 6406, 6409, 6412, 6421, 7372, 7387, 7402, 7417, 7432, 7447, 7462, 7477, 7492, 8594, 8612, 8630, 6487, 7178, 6616, 7086, 1230, 1238, 1246, 1254, 1262, 1266, 1270, 1274, 1278, 1282, 1286, 1290, 1294, 1298, 1302, 1306, 1310, 1318, 1322, 1326, 1330, 1334, 1338, 1342, 1346, 1350, 1354, 1358, 1362, 1366, 1370, 1374, 1378, 1382, 1386, 1394, 1402, 1410, 1414, 1418, 1422, 1426, 1430, 1434, 1438, 1442, 1446, 9984, 11033, 10677, 11049, 10381, 12027, 10391, 10401, 12095, 10690, 10411, 10421, 10431, 10729, 10742, 10703, 10716, 11968, 10755, 10768, 11211, 9921, 11230, 11249, 11065, 10781, 11268, 11287, 10794, 10441, 10451, 11982, 10807, 11081, 12044, 10461, 10471, 10820, 10481, 10491, 9942, 9949, 10501, 10511, 11306, 10833, 11097, 11325, 10846, 10531, 10521, 12115, 10859, 11344, 10541, 11113, 10551, 10885, 10561, 10898, 12061, 10872, 11129, 10911, 9956, 12078, 10571, 10581, 10924, 10591, 10601, 10611, 11145, 10937, 9963, 11363, 11943, 11161, 10950, 11996, 10621, 10631, 10963, 9970, 10976, 11177, 9977, 11382, 10641, 7357, 7377, 7392, 7407, 7422, 7437, 7452, 7467, 7482, 7497, 8600, 8618, 8636, 8648, 8660, 8672, 8684, 8696, 8708, 8720, 8780, 8792, 8804, 8816, 8828, 7194, 6604, 6457, 7146, 6733, 6748, 6610, 7170, 7174, 6499, 9998, 10012, 9991, 10005, 10989, 6736, 6712, 7270, 6688, 6649, 6508, 6523, 6475, 7158, 7512, 6739, 6715, 7274, 7286, 6700, 6658, 6490, 7202, 7094, 7074, 7122, 7290, 6703, 6607, 6661, 6628, 6727, 7294, 6706, 6598, 6664, 7234, 7162, 6682, 7210, 7238, 7166, 6685, 7214, 8942, 8962, 6556, 7206, 7098, 7078, 7246, 10019, 10170, 6751, 6730, 7298, 6709, 6742, 6718, 7278, 6691, 6652, 6535, 6745, 6721, 7282, 6694, 6655, 6538, 7218, 7102, 7507, 6460, 6592, 6595, 8955, 7066, 6601, 6478, 6631, 6481, 6640, 6511, 6514, 6667, 6673, 6676, 7222, 6679, 6697, 7230, 7242, 6550, 7517, 7106, 6553, 6754, 6571, 6586, 8936, 8930, 7367, 7382, 7397, 7412, 7427, 7442, 7457, 7472, 7487, 8588, 8606, 8624, 8642, 8654, 8666, 8678, 8690, 8702, 8714, 8774, 8786, 8798, 8810, 8822, 8834, 8840, 8846, 8852, 8858, 8876, 8882, 7190, 4986, 3326, 5078, 5026, 3674, 1774, 2274, 5678, 5678, 2574, 5218, 2374, 2570, 3058, 4050, 4450, 4762, 4822, 4874, 5150, 3446, 3586, 3758, 3910, 4706, 5194, 5494, 1810, 2230, 3466, 3794, 4758, 5574, 2742, 3706, 4742, 4890, 3110, 4542, 4834, 2850, 3346, 3610, 3870, 5162, 1874, 2026, 2134, 3214, 3458, 3790, 4082, 4474, 4750, 4774, 5066, 5362, 5542, 5570, 4142, 4206, 4390, 4678, 5246, 5582, 4942, 2506, 2878, 4318, 4510, 3842, 4150, 5018, 5354, 2502, 2706, 3450, 3630, 3682, 4374, 4414, 5290, 2130, 4522, 2038, 2034, 4250, 4394, 4702, 5298, 4970, 3114, 3446, 4954, 1786, 2662, 2966, 3890, 4018, 2166, 4158, 1890, 2938, 1754, 3566, 3238, 4370, 2250, 2486, 4094, 4710, 4926, 3514, 5114, 3558, 3130, 4638, 3162, 4014, 1838, 1962, 2030, 3414, 4350, 4598, 4938, 5214, 2142, 2322, 2586, 2866, 3266, 3710, 4162, 5274, 5502, 5586, 5610, 2106, 3318, 3494, 5102, 2814, 3034, 3062, 3206, 3694, 3770, 3946, 4238, 4402, 4502, 5086, 4718, 5126, 5250, 2066, 2110, 2342, 3754, 4854, 4926, 2846, 2958, 3154, 3506, 4314, 3878, 1854, 2434, 2662, 2762, 2970, 3906, 3934, 4462, 4494, 5222, 5350, 5366, 5426, 1878, 4226, 5202, 5326, 2994, 1818, 1914, 2666, 2698, 3250, 3446, 3782, 4046, 4730, 5146, 5670, 3302, 5286, 2102, 3378, 3390, 3602, 3658, 3918, 4010, 4138, 4366, 5438, 1970, 3078, 5302, 1898, 2734, 3634, 5090, 2922, 3002, 3398, 3890, 5310, 2074, 2306, 2714, 3286, 3362, 3426, 3574, 3914, 4030, 4442, 4858, 4870, 5210, 5338, 2182, 3662, 2310, 3786, 3950, 4746, 5314, 5550, 5590, 3386, 3626, 4550, 4282, 4294, 4330, 3866, 3746, 4966, 1846, 4654, 2078, 2062, 2830, 3118, 4342, 2646, 3590, 3314, 5098, 4842, 5294, 4902, 2858, 1930, 2398, 0, 0, 2482, 0, 3298, 0, 0, 2042, 3874, 4070, 4170, 4198, 4202, 4222, 5374, 4334, 4466, 0, 4754, 0, 4950, 0, 0, 5130, 5174, 0, 0, 0, 5458, 5462, 5466, 5566, 5166, 5322, 1882, 1918, 1938, 2126, 2138, 2202, 2382, 2410, 2418, 2478, 2490, 2710, 2718, 2982, 3022, 3030, 3054, 3226, 3274, 3306, 3418, 3614, 3642, 3690, 3774, 3806, 3922, 4146, 4174, 4182, 4178, 4186, 4190, 4194, 4214, 4218, 4254, 4274, 4302, 4402, 4410, 4418, 4438, 4478, 4558, 4610, 4610, 4714, 4882, 4906, 4958, 4962, 5030, 5034, 5122, 5130, 5342, 5410, 5434, 2974, 5921, 4582, 0, 0, 1762, 2022, 1958, 1870, 1934, 1978, 2122, 2150, 2382, 2362, 2378, 2406, 2482, 2498, 2566, 2578, 2606, 2622, 2854, 2862, 2910, 2942, 2990, 3014, 2998, 3030, 3018, 3054, 3082, 3170, 3182, 3190, 3230, 3298, 3346, 3350, 3370, 3498, 3514, 3602, 3678, 3670, 3690, 3718, 3774, 4118, 3810, 3862, 3874, 3938, 3966, 4002, 4038, 4042, 4070, 4074, 4090, 4110, 4106, 4154, 4278, 4302, 4326, 4382, 4402, 4430, 4478, 4658, 4698, 4814, 4886, 4898, 4906, 4930, 4950, 4934, 4958, 4954, 4946, 4962, 4974, 5034, 5094, 5142, 5198, 5230, 5306, 5342, 5374, 5394, 5410, 5422, 5434, 5518, 5678, 5816, 5811, 5861, 1546, 1586, 1590, 5991, 6036, 6156, 5658, 5674, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6619, 6622, 6625, 7182, 7186, 6757, 6757, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7547, 7532, 7537, 7552, 7542, 0, 0, 0, 0, 0, 17319, 33046, 17433, 560, 536, 545, 548, 551, 554, 557, 563, 566, 23, 17415, 17421, 17675, 17683, 17247, 17253, 17259, 17265, 17277, 17283, 17289, 17301, 17307, 0, 17313, 17325, 17331, 17337, 17349, 0, 17355, 0, 17361, 17367, 0, 17373, 17379, 0, 17391, 17397, 17403, 17409, 17427, 17295, 17271, 17343, 17385, 7557, 668, 668, 677, 677, 677, 677, 680, 680, 680, 680, 686, 686, 686, 686, 674, 674, 674, 674, 683, 683, 683, 683, 671, 671, 671, 671, 722, 722, 722, 722, 725, 725, 725, 725, 692, 692, 692, 692, 689, 689, 689, 689, 695, 695, 695, 695, 698, 698, 698, 698, 707, 707, 704, 704, 710, 710, 701, 701, 716, 716, 713, 713, 728, 728, 728, 728, 734, 734, 734, 734, 740, 740, 740, 740, 737, 737, 737, 737, 743, 743, 746, 746, 746, 746, 17541, 17541, 752, 752, 752, 752, 749, 749, 749, 749, 779, 779, 17535, 17535, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 731, 731, 731, 731, 761, 761, 758, 758, 764, 764, 8277, 770, 770, 755, 755, 767, 767, 776, 776, 776, 776, 656, 656, 9648, 9648, 9760, 9760, 9711, 9711, 9739, 9739, 9732, 9732, 9746, 9746, 9753, 9753, 9753, 9718, 9718, 9718, 773, 773, 773, 773, 9655, 9662, 9690, 9718, 9725, 7567, 7572, 7577, 7592, 7607, 7612, 7617, 7622, 7627, 7642, 7657, 7662, 7667, 7682, 7697, 7702, 7707, 7712, 7727, 7732, 7747, 7752, 7757, 7772, 7777, 7782, 7792, 7852, 7867, 7882, 7887, 7892, 7902, 7917, 7922, 7937, 7942, 7947, 7962, 7967, 7982, 7987, 7992, 7997, 8002, 8007, 8012, 8017, 8022, 8027, 8032, 8037, 8042, 8047, 8052, 8057, 8062, 8067, 8077, 8082, 8087, 8092, 8102, 8107, 8117, 8122, 8127, 8132, 8137, 8142, 8147, 8152, 8157, 8172, 8187, 8192, 8197, 8202, 8207, 8212, 8222, 8227, 8232, 8247, 8262, 8267, 17463, 17469, 17523, 17610, 17617, 17624, 17631, 17638, 17645, 9676, 9683, 9690, 9697, 9718, 9725, 7582, 7587, 7592, 7597, 7607, 7612, 7632, 7637, 7642, 7647, 7657, 7662, 7672, 7677, 7682, 7687, 7697, 7702, 8002, 8007, 8022, 8027, 8032, 8052, 8057, 8062, 8067, 8092, 8102, 8107, 8112, 8132, 8162, 8167, 8172, 8177, 8187, 8192, 17523, 8237, 8242, 8247, 8252, 8262, 8267, 9655, 9662, 9669, 9690, 9704, 7567, 7572, 7577, 7592, 7602, 7617, 7622, 7627, 7642, 7652, 7682, 7707, 7712, 7727, 7732, 7747, 7757, 7772, 7777, 7782, 7792, 7852, 7857, 7867, 7882, 7887, 7892, 7902, 7917, 7937, 7942, 7947, 7962, 7967, 7982, 7987, 7992, 7997, 8012, 8017, 8037, 8042, 8047, 8052, 8057, 8077, 8082, 8087, 8092, 8097, 8117, 8122, 8127, 8132, 8147, 8152, 8157, 8172, 8182, 8197, 8202, 17511, 8222, 8227, 8232, 8247, 8257, 9690, 9704, 7592, 7602, 7642, 7652, 7682, 7692, 7792, 7797, 7832, 7837, 8052, 8057, 8092, 8172, 8182, 8247, 8257, 17691, 17699, 17707, 7927, 7932, 7952, 7957, 7972, 7977, 7802, 7807, 7842, 7847, 7737, 7742, 7717, 7722, 7762, 7767, 7872, 7877, 7907, 7912, 7812, 7817, 7822, 7832, 7827, 7787, 7862, 7897, 7927, 7932, 7952, 7957, 7972, 7977, 7802, 7807, 7842, 7847, 7737, 7742, 7717, 7722, 7762, 7767, 7872, 7877, 7907, 7912, 7812, 7817, 7822, 7832, 7827, 7787, 7862, 7897, 7812, 7817, 7822, 7832, 7797, 7837, 7922, 7772, 7777, 7782, 7812, 7817, 7822, 7922, 7937, 17439, 17439, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8983, 9004, 9004, 9011, 9018, 9039, 9046, 9053, 9088, 9088, 9123, 9116, 9144, 9130, 9137, 9172, 9172, 9165, 9179, 9179, 9221, 9221, 9249, 9193, 9193, 9186, 9207, 9207, 9214, 9214, 9256, 9270, 9270, 9277, 9277, 9284, 9291, 9298, 9305, 9305, 9312, 9326, 9340, 9333, 9347, 9347, 9368, 9375, 9424, 9438, 9431, 9403, 9403, 9445, 9445, 9452, 9452, 9494, 9501, 9508, 9466, 9480, 9515, 9522, 0, 0, 9473, 9606, 9613, 9571, 9578, 9550, 9550, 9557, 9599, 9592, 9634, 9634, 8976, 8997, 8990, 9032, 9025, 9067, 9060, 9102, 9074, 9095, 9151, 9228, 9200, 9263, 9417, 9459, 9627, 9620, 9641, 9536, 9382, 9585, 9368, 9424, 9319, 9396, 9543, 9529, 9410, 9389, 9410, 9543, 9081, 9109, 9487, 9354, 8969, 9389, 9298, 9249, 9158, 9564, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9242, 9361, 10188, 10179, 10233, 10215, 10197, 10224, 10242, 9235, 11401, 11017, 10206, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 1158, 1162, 53, 55, 3, 63, 1218, 1222, 7010, 0, 0, 0, 0, 0, 0, 33075, 33075, 33075, 33075, 33075, 33075, 33075, 33070, 33070, 33070, 33070, 33070, 33070, 33070, 33075, 33075, 6262, 1094, 1090, 127, 127, 17, 19, 183, 187, 1210, 1214, 1198, 1202, 1174, 1178, 1166, 1170, 1182, 1186, 1190, 1194, 0, 0, 119, 123, 17024, 17024, 17024, 17024, 127, 127, 127, 25, 1158, 29, 0, 55, 53, 63, 3, 1094, 17, 19, 183, 187, 1210, 1214, 7, 13, 21, 23, 27, 57, 61, 59, 0, 121, 9, 11, 65, 0, 0, 0, 0, 17089, 17475, 17094, 0, 17099, 0, 17104, 17481, 17109, 17487, 17114, 17493, 17119, 17499, 17124, 17505, 569, 17445, 17445, 17451, 17451, 17517, 17517, 17457, 17457, 17529, 17529, 17529, 17529, 572, 572, 575, 575, 575, 575, 578, 578, 581, 581, 581, 581, 584, 584, 584, 584, 587, 587, 587, 587, 590, 590, 590, 590, 593, 593, 593, 593, 596, 596, 599, 599, 602, 602, 605, 605, 608, 608, 608, 608, 611, 611, 611, 611, 614, 614, 614, 614, 617, 617, 617, 617, 620, 620, 620, 620, 623, 623, 623, 623, 626, 626, 626, 626, 629, 629, 629, 629, 632, 632, 632, 632, 635, 635, 635, 635, 638, 638, 638, 638, 641, 641, 641, 641, 644, 644, 644, 644, 647, 647, 647, 647, 650, 650, 650, 650, 653, 653, 656, 656, 659, 659, 659, 659, 11799, 11799, 11807, 11807, 11815, 11815, 8072, 8072, 0, 0, 0, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 149, 151, 153, 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, 181, 183, 185, 187, 189, 1146, 1150, 1162, 1182, 1186, 1158, 1454, 1446, 1226, 1234, 1242, 1250, 1258, 1390, 1398, 1406, 1314, 1458, 1230, 1238, 1246, 1254, 1262, 1266, 1270, 1274, 1278, 1282, 1286, 1290, 1294, 1298, 1302, 1306, 1310, 1318, 1322, 1326, 1330, 1334, 1338, 1342, 1346, 1350, 1354, 1358, 1362, 1366, 1370, 1374, 1378, 1382, 1386, 1394, 1402, 1410, 1414, 1418, 1422, 1426, 1430, 1434, 1450, 19087, 19093, 966, 790, 794, 19026, 798, 19032, 19038, 802, 806, 810, 19044, 19050, 19056, 19062, 19068, 19074, 874, 814, 818, 822, 894, 826, 830, 834, 838, 842, 846, 850, 854, 858, 862, 0, 0, 0, 18900, 18906, 18912, 18918, 18924, 18930, 0, 0, 18936, 18942, 18948, 18954, 18960, 18966, 0, 0, 18972, 18978, 18984, 18990, 18996, 19002, 0, 0, 19008, 19014, 19020, 0, 0, 0, 191, 194, 203, 17019, 200, 197, 1098, 0, 1134, 1102, 1106, 1110, 1114, 1138, 1142, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 131, 133, 135, 137, 139, 141, 143, 145, 147, 149, 151, 153, 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, 181, 221, 242, 0, 0, 374, 377, 380, 383, 386, 389, 392, 395, 398, 401, 404, 407, 410, 413, 416, 419, 422, 395, 425, 428, 431, 434, 437, 440, 512, 515, 518, 1118, 458, 467, 473, 509, 494, 491, 521, 524, 0, 0, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 572, 575, 587, 596, 0, 653, 605, 590, 620, 659, 638, 641, 644, 647, 608, 626, 632, 614, 635, 602, 611, 581, 584, 593, 599, 617, 623, 629, 662, 743, 719, 665, 0, 575, 587, 0, 650, 0, 0, 590, 0, 659, 638, 641, 644, 647, 608, 626, 632, 614, 635, 0, 611, 581, 584, 593, 0, 617, 0, 629, 0, 0, 0, 0, 0, 0, 587, 0, 0, 0, 0, 590, 0, 659, 0, 641, 0, 647, 608, 626, 0, 614, 635, 0, 611, 0, 0, 593, 0, 617, 0, 629, 0, 743, 0, 665, 0, 575, 587, 0, 650, 0, 0, 590, 620, 659, 638, 0, 644, 647, 608, 626, 632, 614, 635, 0, 611, 581, 584, 593, 0, 617, 623, 629, 662, 0, 719, 0, 572, 575, 587, 596, 650, 653, 605, 590, 620, 659, 0, 641, 644, 647, 608, 626, 632, 614, 635, 602, 611, 581, 584, 593, 599, 617, 623, 629, 0, 0, 0, 0, 0, 575, 587, 596, 0, 653, 605, 590, 620, 659, 0, 641, 644, 647, 608, 626, 632, 614, 635, 602, 611, 581, 584, 593, 599, 617, 623, 629, 0, 0, 0, 0, 6268, 6265, 6271, 6307, 6343, 6379, 6415, 6424, 6430, 6436, 6442, 0, 0, 0, 0, 0, 6802, 6806, 6810, 6814, 6818, 6822, 6826, 6830, 6834, 6838, 6842, 6846, 6850, 6854, 6858, 6862, 6866, 6870, 6874, 6878, 6882, 6886, 6890, 6894, 6898, 6902, 10027, 71, 101, 6463, 6583, 0, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 9907, 9928, 1286, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3090, 2634, 2262, 17883, 1822, 2546, 4914, 2562, 1834, 3290, 3762, 3250, 2090, 2926, 1986, 3258, 2070, 4378, 3974, 5006, 2518, 2318, 3686, 3102, 3146, 1730, 1742, 5134, 2782, 1770, 2290, 3134, 5046, 3094, 4210, 4270, 2298, 3654, 3342, 3338, 3994, 2094, 2394, 5190, 0, 0, 0, 0, 1790, 1782, 1798, 5706, 1866, 1882, 1886, 1894, 1902, 1906, 1918, 1910, 1462, 5726, 1938, 1942, 1946, 1974, 5711, 1466, 1954, 1986, 5721, 2002, 2010, 1850, 2018, 2022, 6196, 2050, 2058, 1474, 2082, 2086, 2094, 2098, 1478, 2122, 2126, 2138, 2150, 2154, 2158, 2166, 2198, 2202, 2210, 2226, 2234, 2238, 2238, 2238, 5741, 3734, 2258, 2266, 5746, 2278, 2286, 2294, 2334, 2314, 2326, 2330, 2338, 2346, 2350, 2358, 2366, 2370, 2370, 2378, 2386, 2390, 2402, 2438, 2410, 2442, 2414, 2422, 2062, 2514, 2458, 2462, 2466, 2454, 2474, 2470, 2494, 5751, 2522, 2526, 2534, 2546, 2554, 2582, 5756, 5761, 2594, 2598, 2602, 2590, 2610, 1482, 1486, 2618, 2626, 2626, 5766, 2654, 2658, 2662, 2670, 5771, 2678, 2682, 2898, 2690, 1490, 2702, 2718, 2730, 2726, 5781, 2738, 5786, 2750, 2746, 2754, 2770, 2774, 1494, 2790, 2798, 2802, 2806, 1498, 5791, 1502, 2834, 2838, 2842, 2850, 6246, 2874, 5801, 5801, 4570, 2890, 2890, 1506, 5836, 6046, 2906, 2914, 1510, 2934, 2950, 2954, 2962, 2978, 1518, 1514, 2982, 5806, 2986, 3006, 3010, 3014, 3010, 3026, 3030, 3046, 3038, 3042, 3050, 3054, 3058, 3070, 3074, 3098, 3106, 3122, 3142, 5821, 3138, 3126, 3150, 3158, 3178, 5826, 3186, 3174, 3166, 1522, 3194, 3202, 3210, 3198, 1526, 3226, 3234, 5831, 3278, 3330, 3294, 1538, 3306, 1534, 1530, 1990, 1994, 3334, 3310, 4526, 1638, 3346, 3350, 3354, 3374, 3366, 5856, 1542, 3394, 3382, 3410, 3418, 5866, 3422, 3402, 3430, 1546, 3434, 3438, 3442, 3454, 5871, 3462, 1550, 3474, 5876, 3478, 1554, 3490, 3502, 3514, 3518, 5881, 5776, 5886, 3550, 5891, 3562, 3570, 3554, 3582, 3598, 3614, 3602, 3606, 3618, 3622, 5896, 3594, 3646, 3650, 1558, 3670, 3666, 5901, 3638, 3698, 5906, 5911, 3702, 3722, 3718, 3714, 1562, 3726, 3742, 3738, 3750, 5716, 3766, 5916, 3778, 5926, 3798, 3810, 3830, 5931, 3850, 3854, 5936, 5941, 3882, 3898, 1566, 3902, 1570, 1570, 3926, 3930, 3938, 3942, 3954, 1574, 3978, 5946, 4006, 5951, 4018, 5796, 4034, 5956, 5961, 5966, 1578, 1582, 4090, 5976, 5971, 5981, 5986, 4098, 4102, 4102, 4110, 1590, 4114, 1594, 1598, 5996, 4134, 4142, 4154, 1602, 6001, 4190, 6006, 6011, 4222, 4246, 1606, 4254, 4258, 4262, 6016, 6021, 6021, 4286, 1610, 6026, 4306, 4310, 1614, 6031, 4338, 1618, 4354, 4346, 4362, 6041, 4386, 1622, 4398, 4406, 4422, 1626, 6051, 6056, 1630, 6061, 4446, 6066, 4458, 4470, 4478, 6071, 6076, 4498, 6081, 4506, 5841, 1634, 4530, 4534, 1642, 4538, 2614, 6086, 6091, 5846, 5851, 4570, 4574, 5110, 1646, 4618, 4614, 4622, 2114, 4626, 4630, 4634, 4642, 6096, 4638, 4646, 4666, 4670, 4650, 4674, 4694, 4714, 4662, 4682, 4686, 4690, 6101, 6111, 6106, 1650, 4722, 4726, 4734, 6131, 4738, 6116, 1654, 1658, 6121, 6126, 1662, 4770, 4774, 4778, 4782, 4794, 4790, 4802, 4798, 4814, 4806, 4810, 4818, 1666, 4826, 4830, 1670, 4846, 4850, 6136, 4862, 4866, 1674, 4878, 1470, 6141, 6146, 1678, 1682, 4922, 4946, 4974, 4990, 6151, 5010, 5014, 5038, 5050, 6161, 5731, 5062, 5058, 5070, 5736, 5082, 5094, 6166, 6171, 5158, 5170, 5178, 6176, 5182, 5226, 5238, 5242, 5234, 5254, 5258, 6181, 5270, 1686, 5278, 6186, 1690, 5334, 2758, 5358, 6191, 6201, 1694, 1698, 5398, 6206, 1702, 6211, 5422, 5422, 5430, 6216, 5454, 1706, 5470, 5482, 5490, 5498, 1710, 6221, 5518, 5546, 5558, 1714, 1718, 5562, 6226, 1722, 6231, 6236, 6241, 5598, 1726, 5618, 5626, 5630, 5638, 5646, 5654, 6251, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); nfkcIndex = $toNativeArray($kindUint16, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 1, 2, 3, 93, 4, 5, 0, 94, 95, 6, 7, 8, 9, 10, 96, 97, 11, 0, 0, 12, 98, 99, 13, 0, 100, 101, 102, 0, 103, 2, 3, 4, 5, 0, 0, 0, 0, 0, 0, 6, 7, 8, 9, 0, 10, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 104, 105, 0, 14, 106, 107, 108, 109, 110, 111, 112, 113, 108, 114, 115, 116, 0, 117, 118, 119, 120, 121, 0, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 0, 132, 133, 134, 135, 136, 137, 0, 0, 0, 0, 0, 138, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 139, 0, 0, 140, 0, 0, 141, 0, 142, 0, 0, 0, 143, 144, 145, 146, 15, 147, 148, 149, 150, 0, 0, 151, 152, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 153, 154, 155, 156, 27, 28, 157, 158, 159, 29, 30, 160, 161, 0, 0, 0, 0, 31, 32, 162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 163, 164, 0, 165, 0, 0, 0, 0, 0, 166, 0, 167, 0, 168, 0, 169, 0, 0, 170, 171, 33, 34, 35, 172, 173, 36, 37, 38, 174, 39, 40, 0, 41, 42, 43, 44, 45, 46, 47, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 175, 176, 177, 0, 178, 0, 179, 180, 0, 0, 181, 182, 183, 184, 185, 0, 0, 186, 187, 0, 188, 0, 189, 190, 191, 192, 193, 194, 195, 196, 190, 191, 192, 193, 194, 195, 196, 190, 191, 192, 193, 194, 195, 196, 190, 191, 192, 193, 194, 195, 196, 190, 191, 192, 193, 194, 195, 196, 190, 191, 192, 193, 194, 195, 196, 190, 191, 192, 193, 194, 195, 196, 190, 191, 192, 193, 194, 195, 196, 190, 191, 192, 193, 194, 195, 196, 190, 191, 192, 193, 194, 195, 196, 190, 191, 192, 193, 194, 195, 196, 190, 191, 192, 193, 194, 195, 196, 190, 191, 192, 193, 194, 195, 196, 190, 191, 192, 193, 194, 195, 196, 190, 191, 192, 193, 194, 195, 196, 190, 191, 192, 193, 194, 195, 196, 190, 191, 192, 193, 194, 195, 196, 190, 191, 192, 193, 194, 195, 196, 190, 191, 192, 193, 194, 195, 196, 190, 191, 192, 193, 194, 195, 196, 190, 191, 192, 193, 194, 195, 196, 190, 191, 192, 193, 194, 195, 196, 190, 191, 192, 193, 194, 195, 196, 190, 191, 192, 193, 194, 195, 196, 190, 191, 192, 193, 194, 195, 197, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 198, 73, 74, 75, 0, 0, 0, 0, 0, 0, 0, 199, 0, 0, 0, 200, 0, 201, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 202, 0, 0, 203, 0, 0, 0, 0, 0, 0, 0, 0, 204, 0, 0, 0, 0, 0, 205, 0, 0, 206, 0, 0, 0, 207, 208, 0, 209, 184, 0, 210, 211, 0, 0, 212, 213, 214, 0, 0, 0, 215, 216, 217, 0, 0, 218, 219, 220, 0, 221, 0, 222, 0, 0, 0, 223, 0, 0, 0, 224, 225, 0, 226, 227, 228, 229, 0, 0, 0, 0, 0, 220, 0, 0, 0, 0, 230, 231, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 233, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 234, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, 238, 0, 239, 0, 0, 0, 0, 0, 0, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 76, 250, 251, 252, 253, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 254, 0, 0, 0, 233, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 256, 0, 257, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 78, 79, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, 258, 259, 0, 82, 260, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 261, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 84, 85, 86, 87, 88, 89, 90, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 0, 0, 0, 0, 13, 0, 0, 0, 0, 14, 0, 15, 16, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); nfkcSparseOffset = new sliceType$1([0, 14, 18, 27, 37, 53, 55, 60, 71, 86, 99, 107, 112, 117, 119, 127, 134, 137, 145, 149, 153, 155, 157, 166, 170, 177, 182, 185, 195, 198, 205, 213, 217, 219, 223, 227, 233, 250, 262, 264, 270, 272, 274, 276, 278, 280, 282, 284, 287, 290, 292, 295, 298, 302, 308, 310, 319, 321, 324, 326, 337, 348, 362, 376, 392, 406, 413, 419, 434, 438, 440, 444, 446, 449, 451, 454, 456, 459, 461, 463, 465, 477, 487, 497, 500, 504, 506, 508, 510, 513, 516, 518, 520, 522, 524, 530, 533, 538, 540, 547, 553, 559, 567, 573, 579, 585, 589, 591, 593, 595, 597, 603, 606, 608, 610, 616, 619, 627, 634, 637, 640, 642, 645, 653, 657, 664, 667, 673, 675, 677, 680, 682, 685, 690, 692, 694, 696, 698, 700, 703, 705, 707, 709, 711, 713, 726, 736, 738, 740, 744, 749, 761, 766, 775, 781, 786, 790, 795, 799, 815, 829, 843, 857, 863, 865, 867, 870, 881, 883, 893]); nfkcSparseValues = $toNativeArray($kindStruct, [new valueRange.ptr(2, 13, 0), new valueRange.ptr(1, 160, 160), new valueRange.ptr(17039, 168, 168), new valueRange.ptr(131, 170, 170), new valueRange.ptr(17019, 175, 175), new valueRange.ptr(37, 178, 179), new valueRange.ptr(17009, 180, 180), new valueRange.ptr(479, 181, 181), new valueRange.ptr(17064, 184, 184), new valueRange.ptr(35, 185, 185), new valueRange.ptr(159, 186, 186), new valueRange.ptr(8738, 188, 188), new valueRange.ptr(8726, 189, 189), new valueRange.ptr(8888, 190, 190), new valueRange.ptr(145, 3, 0), new valueRange.ptr(18169, 160, 161), new valueRange.ptr(18219, 175, 176), new valueRange.ptr(40960, 183, 183), new valueRange.ptr(3, 8, 0), new valueRange.ptr(40960, 146, 146), new valueRange.ptr(145, 176, 176), new valueRange.ptr(281, 177, 177), new valueRange.ptr(149, 178, 178), new valueRange.ptr(165, 179, 179), new valueRange.ptr(323, 180, 182), new valueRange.ptr(175, 183, 183), new valueRange.ptr(179, 184, 184), new valueRange.ptr(10, 9, 0), new valueRange.ptr(17029, 152, 152), new valueRange.ptr(17034, 153, 154), new valueRange.ptr(17069, 155, 155), new valueRange.ptr(17014, 156, 156), new valueRange.ptr(17049, 157, 157), new valueRange.ptr(275, 160, 160), new valueRange.ptr(153, 161, 161), new valueRange.ptr(167, 162, 163), new valueRange.ptr(362, 164, 164), new valueRange.ptr(0, 15, 0), new valueRange.ptr(40960, 131, 131), new valueRange.ptr(40960, 135, 135), new valueRange.ptr(40960, 139, 139), new valueRange.ptr(40960, 141, 141), new valueRange.ptr(14268, 144, 144), new valueRange.ptr(14280, 145, 145), new valueRange.ptr(14262, 147, 147), new valueRange.ptr(40960, 150, 150), new valueRange.ptr(14382, 151, 151), new valueRange.ptr(14328, 156, 156), new valueRange.ptr(14304, 157, 157), new valueRange.ptr(14346, 158, 158), new valueRange.ptr(40960, 180, 181), new valueRange.ptr(14388, 182, 182), new valueRange.ptr(14394, 183, 183), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33075, 131, 135), new valueRange.ptr(1, 4, 0), new valueRange.ptr(33044, 129, 130), new valueRange.ptr(33075, 132, 132), new valueRange.ptr(33070, 133, 133), new valueRange.ptr(33038, 135, 135), new valueRange.ptr(0, 10, 0), new valueRange.ptr(33075, 144, 151), new valueRange.ptr(33050, 152, 152), new valueRange.ptr(33051, 153, 153), new valueRange.ptr(33052, 154, 154), new valueRange.ptr(14424, 162, 162), new valueRange.ptr(14430, 163, 163), new valueRange.ptr(14442, 164, 164), new valueRange.ptr(14436, 165, 165), new valueRange.ptr(14448, 166, 166), new valueRange.ptr(40960, 167, 167), new valueRange.ptr(0, 14, 0), new valueRange.ptr(14466, 128, 128), new valueRange.ptr(40960, 129, 129), new valueRange.ptr(14454, 130, 130), new valueRange.ptr(40960, 146, 146), new valueRange.ptr(14460, 147, 147), new valueRange.ptr(40960, 149, 149), new valueRange.ptr(33075, 150, 156), new valueRange.ptr(33075, 159, 162), new valueRange.ptr(33070, 163, 163), new valueRange.ptr(33075, 164, 164), new valueRange.ptr(33075, 167, 168), new valueRange.ptr(33070, 170, 170), new valueRange.ptr(33075, 171, 172), new valueRange.ptr(33070, 173, 173), new valueRange.ptr(0, 12, 0), new valueRange.ptr(33056, 145, 145), new valueRange.ptr(33075, 176, 176), new valueRange.ptr(33070, 177, 177), new valueRange.ptr(33075, 178, 179), new valueRange.ptr(33070, 180, 180), new valueRange.ptr(33075, 181, 182), new valueRange.ptr(33070, 183, 185), new valueRange.ptr(33075, 186, 186), new valueRange.ptr(33070, 187, 188), new valueRange.ptr(33075, 189, 189), new valueRange.ptr(33070, 190, 190), new valueRange.ptr(33075, 191, 191), new valueRange.ptr(5, 7, 0), new valueRange.ptr(33075, 128, 128), new valueRange.ptr(33075, 129, 129), new valueRange.ptr(33070, 130, 131), new valueRange.ptr(33070, 132, 133), new valueRange.ptr(33070, 134, 135), new valueRange.ptr(33070, 136, 137), new valueRange.ptr(33075, 138, 138), new valueRange.ptr(0, 4, 0), new valueRange.ptr(33075, 171, 177), new valueRange.ptr(33070, 178, 178), new valueRange.ptr(33075, 179, 179), new valueRange.ptr(33070, 189, 189), new valueRange.ptr(0, 4, 0), new valueRange.ptr(33075, 150, 153), new valueRange.ptr(33075, 155, 163), new valueRange.ptr(33075, 165, 167), new valueRange.ptr(33075, 169, 173), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33070, 153, 155), new valueRange.ptr(0, 7, 0), new valueRange.ptr(40960, 168, 168), new valueRange.ptr(16111, 169, 169), new valueRange.ptr(40960, 176, 176), new valueRange.ptr(16119, 177, 177), new valueRange.ptr(40960, 179, 179), new valueRange.ptr(16127, 180, 180), new valueRange.ptr(39171, 188, 188), new valueRange.ptr(8, 6, 0), new valueRange.ptr(33029, 141, 141), new valueRange.ptr(33075, 145, 145), new valueRange.ptr(33070, 146, 146), new valueRange.ptr(33075, 147, 147), new valueRange.ptr(33075, 148, 148), new valueRange.ptr(17715, 152, 159), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33027, 188, 188), new valueRange.ptr(39168, 190, 190), new valueRange.ptr(8, 7, 0), new valueRange.ptr(40960, 135, 135), new valueRange.ptr(11435, 139, 140), new valueRange.ptr(33029, 141, 141), new valueRange.ptr(39168, 151, 151), new valueRange.ptr(17779, 156, 157), new valueRange.ptr(17795, 159, 159), new valueRange.ptr(33075, 190, 190), new valueRange.ptr(0, 3, 0), new valueRange.ptr(17835, 179, 179), new valueRange.ptr(17843, 182, 182), new valueRange.ptr(33027, 188, 188), new valueRange.ptr(8, 3, 0), new valueRange.ptr(33029, 141, 141), new valueRange.ptr(17803, 153, 155), new valueRange.ptr(17827, 158, 158), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33027, 188, 188), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33029, 141, 141), new valueRange.ptr(0, 8, 0), new valueRange.ptr(40960, 135, 135), new valueRange.ptr(11459, 136, 136), new valueRange.ptr(11451, 139, 139), new valueRange.ptr(11467, 140, 140), new valueRange.ptr(33029, 141, 141), new valueRange.ptr(39168, 150, 151), new valueRange.ptr(17851, 156, 156), new valueRange.ptr(17859, 157, 157), new valueRange.ptr(0, 3, 0), new valueRange.ptr(40960, 146, 146), new valueRange.ptr(11475, 148, 148), new valueRange.ptr(39168, 190, 190), new valueRange.ptr(0, 6, 0), new valueRange.ptr(40960, 134, 135), new valueRange.ptr(11483, 138, 138), new valueRange.ptr(11499, 139, 139), new valueRange.ptr(11491, 140, 140), new valueRange.ptr(33029, 141, 141), new valueRange.ptr(39168, 151, 151), new valueRange.ptr(6145, 4, 0), new valueRange.ptr(40960, 134, 134), new valueRange.ptr(16135, 136, 136), new valueRange.ptr(33029, 141, 141), new valueRange.ptr(33057, 149, 150), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33027, 188, 188), new valueRange.ptr(40960, 191, 191), new valueRange.ptr(0, 9, 0), new valueRange.ptr(11507, 128, 128), new valueRange.ptr(39168, 130, 130), new valueRange.ptr(40960, 134, 134), new valueRange.ptr(11515, 135, 135), new valueRange.ptr(11523, 136, 136), new valueRange.ptr(12135, 138, 138), new valueRange.ptr(11759, 139, 139), new valueRange.ptr(33029, 141, 141), new valueRange.ptr(39168, 149, 150), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33029, 187, 188), new valueRange.ptr(39168, 190, 190), new valueRange.ptr(0, 6, 0), new valueRange.ptr(40960, 134, 135), new valueRange.ptr(11531, 138, 138), new valueRange.ptr(11547, 139, 139), new valueRange.ptr(11539, 140, 140), new valueRange.ptr(33029, 141, 141), new valueRange.ptr(39168, 151, 151), new valueRange.ptr(27613, 7, 0), new valueRange.ptr(39173, 138, 138), new valueRange.ptr(39168, 143, 143), new valueRange.ptr(40960, 153, 153), new valueRange.ptr(16143, 154, 154), new valueRange.ptr(12143, 156, 156), new valueRange.ptr(11770, 157, 157), new valueRange.ptr(11555, 158, 159), new valueRange.ptr(0, 3, 0), new valueRange.ptr(9767, 179, 179), new valueRange.ptr(33059, 184, 185), new valueRange.ptr(33029, 186, 186), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33060, 136, 139), new valueRange.ptr(0, 3, 0), new valueRange.ptr(9788, 179, 179), new valueRange.ptr(33061, 184, 185), new valueRange.ptr(33029, 186, 186), new valueRange.ptr(0, 3, 0), new valueRange.ptr(33062, 136, 139), new valueRange.ptr(9774, 156, 156), new valueRange.ptr(9781, 157, 157), new valueRange.ptr(0, 5, 0), new valueRange.ptr(782, 140, 140), new valueRange.ptr(33070, 152, 153), new valueRange.ptr(33070, 181, 181), new valueRange.ptr(33070, 183, 183), new valueRange.ptr(33068, 185, 185), new valueRange.ptr(0, 16, 0), new valueRange.ptr(9802, 131, 131), new valueRange.ptr(9809, 141, 141), new valueRange.ptr(9816, 146, 146), new valueRange.ptr(9823, 151, 151), new valueRange.ptr(9830, 156, 156), new valueRange.ptr(9795, 169, 169), new valueRange.ptr(33063, 177, 177), new valueRange.ptr(33064, 178, 178), new valueRange.ptr(19099, 179, 179), new valueRange.ptr(33065, 180, 180), new valueRange.ptr(19108, 181, 181), new valueRange.ptr(17867, 182, 182), new valueRange.ptr(17931, 183, 183), new valueRange.ptr(17875, 184, 184), new valueRange.ptr(17942, 185, 185), new valueRange.ptr(33064, 186, 189), new valueRange.ptr(0, 11, 0), new valueRange.ptr(33064, 128, 128), new valueRange.ptr(19117, 129, 129), new valueRange.ptr(33075, 130, 131), new valueRange.ptr(33029, 132, 132), new valueRange.ptr(33075, 134, 135), new valueRange.ptr(9844, 147, 147), new valueRange.ptr(9851, 157, 157), new valueRange.ptr(9858, 162, 162), new valueRange.ptr(9865, 167, 167), new valueRange.ptr(9872, 172, 172), new valueRange.ptr(9837, 185, 185), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33070, 134, 134), new valueRange.ptr(0, 5, 0), new valueRange.ptr(40960, 165, 165), new valueRange.ptr(11563, 166, 166), new valueRange.ptr(39168, 174, 174), new valueRange.ptr(33027, 183, 183), new valueRange.ptr(33029, 185, 186), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33070, 141, 141), new valueRange.ptr(0, 1, 0), new valueRange.ptr(786, 188, 188), new valueRange.ptr(0, 1, 0), new valueRange.ptr(40960, 128, 146), new valueRange.ptr(0, 1, 0), new valueRange.ptr(47360, 161, 181), new valueRange.ptr(0, 1, 0), new valueRange.ptr(39168, 168, 191), new valueRange.ptr(0, 1, 0), new valueRange.ptr(39168, 128, 130), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33075, 157, 159), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33029, 148, 148), new valueRange.ptr(33029, 180, 180), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33029, 146, 146), new valueRange.ptr(33075, 157, 157), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33074, 169, 169), new valueRange.ptr(4, 2, 0), new valueRange.ptr(33071, 185, 186), new valueRange.ptr(33070, 187, 187), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33075, 151, 151), new valueRange.ptr(33070, 152, 152), new valueRange.ptr(0, 3, 0), new valueRange.ptr(33029, 160, 160), new valueRange.ptr(33075, 181, 188), new valueRange.ptr(33070, 191, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(33075, 176, 180), new valueRange.ptr(33070, 181, 186), new valueRange.ptr(33075, 187, 188), new valueRange.ptr(33070, 189, 189), new valueRange.ptr(33070, 191, 191), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33070, 128, 128), new valueRange.ptr(0, 8, 0), new valueRange.ptr(11635, 128, 128), new valueRange.ptr(11643, 129, 129), new valueRange.ptr(40960, 130, 130), new valueRange.ptr(11651, 131, 131), new valueRange.ptr(33029, 132, 132), new valueRange.ptr(33075, 171, 171), new valueRange.ptr(33070, 172, 172), new valueRange.ptr(33075, 173, 179), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33029, 170, 171), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33027, 166, 166), new valueRange.ptr(33029, 178, 179), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33027, 183, 183), new valueRange.ptr(0, 10, 0), new valueRange.ptr(33075, 144, 146), new valueRange.ptr(33025, 148, 148), new valueRange.ptr(33070, 149, 153), new valueRange.ptr(33075, 154, 155), new valueRange.ptr(33070, 156, 159), new valueRange.ptr(33075, 160, 160), new valueRange.ptr(33025, 162, 168), new valueRange.ptr(33070, 173, 173), new valueRange.ptr(33075, 180, 180), new valueRange.ptr(33075, 184, 185), new valueRange.ptr(2, 10, 0), new valueRange.ptr(67, 172, 172), new valueRange.ptr(209, 173, 173), new valueRange.ptr(69, 174, 174), new valueRange.ptr(73, 176, 177), new valueRange.ptr(230, 178, 178), new valueRange.ptr(79, 179, 186), new valueRange.ptr(95, 188, 188), new valueRange.ptr(239, 189, 189), new valueRange.ptr(97, 190, 190), new valueRange.ptr(101, 191, 191), new valueRange.ptr(0, 13, 0), new valueRange.ptr(1, 128, 138), new valueRange.ptr(1086, 145, 145), new valueRange.ptr(17074, 151, 151), new valueRange.ptr(29, 164, 164), new valueRange.ptr(6262, 165, 165), new valueRange.ptr(7010, 166, 166), new valueRange.ptr(1, 175, 175), new valueRange.ptr(9879, 179, 179), new valueRange.ptr(10251, 180, 180), new valueRange.ptr(9886, 182, 182), new valueRange.ptr(10261, 183, 183), new valueRange.ptr(6256, 188, 188), new valueRange.ptr(17024, 190, 190), new valueRange.ptr(2, 13, 0), new valueRange.ptr(6454, 135, 135), new valueRange.ptr(6451, 136, 136), new valueRange.ptr(6259, 137, 137), new valueRange.ptr(10651, 151, 151), new valueRange.ptr(1, 159, 159), new valueRange.ptr(33, 176, 176), new valueRange.ptr(147, 177, 177), new valueRange.ptr(41, 180, 185), new valueRange.ptr(23, 186, 186), new valueRange.ptr(1130, 187, 187), new valueRange.ptr(59, 188, 188), new valueRange.ptr(17, 189, 190), new valueRange.ptr(157, 191, 191), new valueRange.ptr(2, 15, 0), new valueRange.ptr(33, 128, 137), new valueRange.ptr(23, 138, 138), new valueRange.ptr(1130, 139, 139), new valueRange.ptr(59, 140, 140), new valueRange.ptr(17, 141, 142), new valueRange.ptr(131, 144, 144), new valueRange.ptr(139, 145, 145), new valueRange.ptr(159, 146, 146), new valueRange.ptr(177, 147, 147), new valueRange.ptr(260, 148, 148), new valueRange.ptr(145, 149, 149), new valueRange.ptr(151, 150, 153), new valueRange.ptr(161, 154, 154), new valueRange.ptr(167, 155, 156), new valueRange.ptr(6559, 168, 168), new valueRange.ptr(0, 13, 0), new valueRange.ptr(33075, 144, 145), new valueRange.ptr(33025, 146, 147), new valueRange.ptr(33075, 148, 151), new valueRange.ptr(33025, 152, 154), new valueRange.ptr(33075, 155, 156), new valueRange.ptr(33075, 161, 161), new valueRange.ptr(33025, 165, 166), new valueRange.ptr(33075, 167, 167), new valueRange.ptr(33070, 168, 168), new valueRange.ptr(33075, 169, 169), new valueRange.ptr(33025, 170, 171), new valueRange.ptr(33070, 172, 175), new valueRange.ptr(33075, 176, 176), new valueRange.ptr(7, 6, 0), new valueRange.ptr(8582, 137, 137), new valueRange.ptr(40960, 144, 144), new valueRange.ptr(40960, 146, 146), new valueRange.ptr(40960, 148, 148), new valueRange.ptr(15312, 154, 155), new valueRange.ptr(15326, 174, 174), new valueRange.ptr(14, 5, 0), new valueRange.ptr(15333, 141, 142), new valueRange.ptr(15340, 143, 143), new valueRange.ptr(40960, 144, 144), new valueRange.ptr(40960, 146, 146), new valueRange.ptr(40960, 148, 148), new valueRange.ptr(378, 14, 0), new valueRange.ptr(40960, 131, 131), new valueRange.ptr(15354, 132, 132), new valueRange.ptr(40960, 136, 136), new valueRange.ptr(15361, 137, 137), new valueRange.ptr(40960, 139, 139), new valueRange.ptr(15368, 140, 140), new valueRange.ptr(40960, 163, 163), new valueRange.ptr(15375, 164, 164), new valueRange.ptr(40960, 165, 165), new valueRange.ptr(15382, 166, 166), new valueRange.ptr(9893, 172, 173), new valueRange.ptr(9900, 175, 175), new valueRange.ptr(10281, 176, 176), new valueRange.ptr(40960, 188, 188), new valueRange.ptr(7, 3, 0), new valueRange.ptr(15487, 160, 161), new valueRange.ptr(15529, 162, 163), new valueRange.ptr(15571, 170, 173), new valueRange.ptr(4, 1, 0), new valueRange.ptr(1166, 169, 170), new valueRange.ptr(2, 3, 0), new valueRange.ptr(87, 128, 143), new valueRange.ptr(131, 144, 169), new valueRange.ptr(33, 170, 170), new valueRange.ptr(0, 1, 0), new valueRange.ptr(10664, 140, 140), new valueRange.ptr(614, 2, 0), new valueRange.ptr(7058, 180, 180), new valueRange.ptr(6448, 181, 182), new valueRange.ptr(0, 1, 0), new valueRange.ptr(17652, 156, 156), new valueRange.ptr(0, 2, 0), new valueRange.ptr(149, 188, 188), new valueRange.ptr(109, 189, 189), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33075, 175, 177), new valueRange.ptr(0, 2, 0), new valueRange.ptr(1154, 175, 175), new valueRange.ptr(33029, 191, 191), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33075, 160, 191), new valueRange.ptr(0, 1, 0), new valueRange.ptr(3526, 159, 159), new valueRange.ptr(0, 1, 0), new valueRange.ptr(5682, 179, 179), new valueRange.ptr(4, 11, 0), new valueRange.ptr(5530, 128, 130), new valueRange.ptr(5554, 131, 131), new valueRange.ptr(5578, 132, 133), new valueRange.ptr(5594, 134, 137), new valueRange.ptr(5614, 138, 140), new valueRange.ptr(5634, 141, 141), new valueRange.ptr(5642, 142, 142), new valueRange.ptr(5650, 143, 144), new valueRange.ptr(5662, 145, 147), new valueRange.ptr(5678, 148, 148), new valueRange.ptr(5686, 149, 149), new valueRange.ptr(4, 9, 0), new valueRange.ptr(1, 128, 128), new valueRange.ptr(33069, 170, 170), new valueRange.ptr(33074, 171, 171), new valueRange.ptr(33076, 172, 172), new valueRange.ptr(33071, 173, 173), new valueRange.ptr(33072, 174, 174), new valueRange.ptr(33072, 175, 175), new valueRange.ptr(1206, 182, 182), new valueRange.ptr(2186, 184, 186), new valueRange.ptr(6, 9, 0), new valueRange.ptr(790, 177, 177), new valueRange.ptr(794, 178, 178), new valueRange.ptr(19026, 179, 179), new valueRange.ptr(798, 180, 180), new valueRange.ptr(19032, 181, 182), new valueRange.ptr(802, 183, 183), new valueRange.ptr(806, 184, 184), new valueRange.ptr(810, 185, 185), new valueRange.ptr(19044, 186, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33075, 175, 175), new valueRange.ptr(33075, 180, 189), new valueRange.ptr(0, 3, 0), new valueRange.ptr(530, 156, 156), new valueRange.ptr(533, 157, 157), new valueRange.ptr(33075, 158, 159), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33075, 176, 177), new valueRange.ptr(0, 1, 0), new valueRange.ptr(5694, 176, 176), new valueRange.ptr(12, 1, 0), new valueRange.ptr(215, 184, 185), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33029, 134, 134), new valueRange.ptr(33029, 172, 172), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33029, 132, 132), new valueRange.ptr(33075, 160, 177), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33070, 171, 173), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33029, 147, 147), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33027, 179, 179), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33029, 128, 128), new valueRange.ptr(0, 5, 0), new valueRange.ptr(33075, 176, 176), new valueRange.ptr(33075, 178, 179), new valueRange.ptr(33070, 180, 180), new valueRange.ptr(33075, 183, 184), new valueRange.ptr(33075, 190, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33075, 129, 129), new valueRange.ptr(33029, 182, 182), new valueRange.ptr(8, 4, 0), new valueRange.ptr(5690, 156, 157), new valueRange.ptr(293, 158, 158), new valueRange.ptr(5702, 159, 159), new valueRange.ptr(350, 169, 169), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33029, 173, 173), new valueRange.ptr(0, 6, 0), new valueRange.ptr(58624, 128, 128), new valueRange.ptr(50688, 129, 155), new valueRange.ptr(58624, 156, 156), new valueRange.ptr(50688, 157, 183), new valueRange.ptr(58624, 184, 184), new valueRange.ptr(50688, 185, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(50688, 128, 147), new valueRange.ptr(58624, 148, 148), new valueRange.ptr(50688, 149, 175), new valueRange.ptr(58624, 176, 176), new valueRange.ptr(50688, 177, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(50688, 128, 139), new valueRange.ptr(58624, 140, 140), new valueRange.ptr(50688, 141, 167), new valueRange.ptr(58624, 168, 168), new valueRange.ptr(50688, 169, 191), new valueRange.ptr(0, 7, 0), new valueRange.ptr(50688, 128, 131), new valueRange.ptr(58624, 132, 132), new valueRange.ptr(50688, 133, 159), new valueRange.ptr(58624, 160, 160), new valueRange.ptr(50688, 161, 187), new valueRange.ptr(58624, 188, 188), new valueRange.ptr(50688, 189, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(50688, 128, 151), new valueRange.ptr(58624, 152, 152), new valueRange.ptr(50688, 153, 179), new valueRange.ptr(58624, 180, 180), new valueRange.ptr(50688, 181, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(50688, 128, 143), new valueRange.ptr(58624, 144, 144), new valueRange.ptr(50688, 145, 171), new valueRange.ptr(58624, 172, 172), new valueRange.ptr(50688, 173, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(50688, 128, 135), new valueRange.ptr(58624, 136, 136), new valueRange.ptr(50688, 137, 163), new valueRange.ptr(58624, 164, 164), new valueRange.ptr(50688, 165, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(50688, 128, 135), new valueRange.ptr(58624, 136, 136), new valueRange.ptr(50688, 137, 163), new valueRange.ptr(2, 1, 0), new valueRange.ptr(3, 129, 191), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33070, 189, 189), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33070, 160, 160), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33075, 182, 186), new valueRange.ptr(45, 5, 0), new valueRange.ptr(33070, 141, 141), new valueRange.ptr(33075, 143, 143), new valueRange.ptr(33075, 184, 184), new valueRange.ptr(33025, 185, 186), new valueRange.ptr(33029, 191, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33075, 165, 165), new valueRange.ptr(33070, 166, 166), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33075, 164, 167), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33075, 171, 172), new valueRange.ptr(0, 5, 0), new valueRange.ptr(33070, 134, 135), new valueRange.ptr(33075, 136, 138), new valueRange.ptr(33070, 139, 139), new valueRange.ptr(33075, 140, 140), new valueRange.ptr(33070, 141, 144), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33029, 134, 134), new valueRange.ptr(33029, 191, 191), new valueRange.ptr(6142, 7, 0), new valueRange.ptr(40960, 153, 153), new valueRange.ptr(16975, 154, 154), new valueRange.ptr(40960, 155, 155), new valueRange.ptr(16985, 156, 156), new valueRange.ptr(40960, 165, 165), new valueRange.ptr(16995, 171, 171), new valueRange.ptr(33029, 185, 186), new valueRange.ptr(0, 6, 0), new valueRange.ptr(33075, 128, 130), new valueRange.ptr(39168, 167, 167), new valueRange.ptr(11659, 174, 174), new valueRange.ptr(11669, 175, 175), new valueRange.ptr(40960, 177, 178), new valueRange.ptr(33029, 179, 180), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33029, 128, 128), new valueRange.ptr(33027, 138, 138), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33029, 181, 181), new valueRange.ptr(33027, 182, 182), new valueRange.ptr(2, 1, 0), new valueRange.ptr(33027, 169, 170), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33027, 187, 188), new valueRange.ptr(39168, 190, 190), new valueRange.ptr(0, 7, 0), new valueRange.ptr(40960, 135, 135), new valueRange.ptr(11679, 139, 139), new valueRange.ptr(11689, 140, 140), new valueRange.ptr(33029, 141, 141), new valueRange.ptr(39168, 151, 151), new valueRange.ptr(33075, 166, 172), new valueRange.ptr(33075, 176, 180), new valueRange.ptr(0, 3, 0), new valueRange.ptr(33029, 130, 130), new valueRange.ptr(33027, 134, 134), new valueRange.ptr(33075, 158, 158), new valueRange.ptr(27469, 6, 0), new valueRange.ptr(39168, 176, 176), new valueRange.ptr(40960, 185, 185), new valueRange.ptr(39168, 186, 186), new valueRange.ptr(11709, 187, 187), new valueRange.ptr(11699, 188, 189), new valueRange.ptr(11719, 190, 190), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33029, 130, 130), new valueRange.ptr(33027, 131, 131), new valueRange.ptr(0, 5, 0), new valueRange.ptr(39168, 175, 175), new valueRange.ptr(40960, 184, 185), new valueRange.ptr(11729, 186, 186), new valueRange.ptr(11739, 187, 187), new valueRange.ptr(33029, 191, 191), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33027, 128, 128), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33029, 191, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33029, 182, 182), new valueRange.ptr(33027, 183, 183), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33029, 171, 171), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33029, 185, 185), new valueRange.ptr(33027, 186, 186), new valueRange.ptr(0, 4, 0), new valueRange.ptr(39168, 176, 176), new valueRange.ptr(40960, 181, 181), new valueRange.ptr(11749, 184, 184), new valueRange.ptr(33029, 189, 190), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33027, 131, 131), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33029, 160, 160), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33029, 180, 180), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33029, 135, 135), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33029, 153, 153), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33027, 130, 130), new valueRange.ptr(33029, 132, 133), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33029, 151, 151), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33025, 176, 180), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33075, 176, 182), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33026, 176, 177), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33025, 158, 158), new valueRange.ptr(0, 12, 0), new valueRange.ptr(17891, 158, 158), new valueRange.ptr(17901, 159, 159), new valueRange.ptr(17953, 160, 160), new valueRange.ptr(17967, 161, 161), new valueRange.ptr(17981, 162, 162), new valueRange.ptr(17995, 163, 163), new valueRange.ptr(18009, 164, 164), new valueRange.ptr(33068, 165, 166), new valueRange.ptr(33025, 167, 169), new valueRange.ptr(33073, 173, 173), new valueRange.ptr(33068, 174, 178), new valueRange.ptr(33070, 187, 191), new valueRange.ptr(0, 9, 0), new valueRange.ptr(33070, 128, 130), new valueRange.ptr(33075, 133, 137), new valueRange.ptr(33070, 138, 139), new valueRange.ptr(33075, 170, 173), new valueRange.ptr(17911, 187, 187), new valueRange.ptr(17921, 188, 188), new valueRange.ptr(18023, 189, 189), new valueRange.ptr(18051, 190, 190), new valueRange.ptr(18037, 191, 191), new valueRange.ptr(0, 1, 0), new valueRange.ptr(18065, 128, 128), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33075, 130, 132), new valueRange.ptr(2, 3, 0), new valueRange.ptr(67, 128, 153), new valueRange.ptr(131, 154, 179), new valueRange.ptr(67, 180, 191), new valueRange.ptr(2, 4, 0), new valueRange.ptr(91, 128, 141), new valueRange.ptr(131, 142, 148), new valueRange.ptr(147, 150, 167), new valueRange.ptr(67, 168, 191), new valueRange.ptr(2, 11, 0), new valueRange.ptr(115, 128, 129), new valueRange.ptr(131, 130, 155), new valueRange.ptr(67, 156, 156), new valueRange.ptr(71, 158, 159), new valueRange.ptr(79, 162, 162), new valueRange.ptr(85, 165, 166), new valueRange.ptr(93, 169, 172), new valueRange.ptr(103, 174, 181), new valueRange.ptr(131, 182, 185), new valueRange.ptr(141, 187, 187), new valueRange.ptr(145, 189, 191), new valueRange.ptr(2, 4, 0), new valueRange.ptr(151, 128, 131), new valueRange.ptr(161, 133, 143), new valueRange.ptr(67, 144, 169), new valueRange.ptr(131, 170, 191), new valueRange.ptr(2, 8, 0), new valueRange.ptr(175, 128, 131), new valueRange.ptr(67, 132, 133), new valueRange.ptr(73, 135, 138), new valueRange.ptr(85, 141, 148), new valueRange.ptr(103, 150, 156), new valueRange.ptr(131, 158, 183), new valueRange.ptr(67, 184, 185), new valueRange.ptr(73, 187, 190), new valueRange.ptr(2, 5, 0), new valueRange.ptr(83, 128, 132), new valueRange.ptr(95, 134, 134), new valueRange.ptr(103, 138, 144), new valueRange.ptr(131, 146, 171), new valueRange.ptr(67, 172, 191), new valueRange.ptr(2, 4, 0), new valueRange.ptr(107, 128, 133), new valueRange.ptr(131, 134, 159), new valueRange.ptr(67, 160, 185), new valueRange.ptr(131, 186, 191), new valueRange.ptr(2, 3, 0), new valueRange.ptr(143, 128, 147), new valueRange.ptr(67, 148, 173), new valueRange.ptr(131, 174, 191), new valueRange.ptr(2, 4, 0), new valueRange.ptr(167, 128, 135), new valueRange.ptr(67, 136, 161), new valueRange.ptr(131, 162, 187), new valueRange.ptr(67, 188, 191), new valueRange.ptr(2, 3, 0), new valueRange.ptr(75, 128, 149), new valueRange.ptr(131, 150, 175), new valueRange.ptr(67, 176, 191), new valueRange.ptr(3, 15, 0), new valueRange.ptr(443, 128, 128), new valueRange.ptr(1122, 129, 129), new valueRange.ptr(446, 130, 154), new valueRange.ptr(1118, 155, 155), new valueRange.ptr(458, 156, 156), new valueRange.ptr(467, 157, 157), new valueRange.ptr(473, 158, 158), new valueRange.ptr(509, 159, 159), new valueRange.ptr(494, 160, 160), new valueRange.ptr(491, 161, 161), new valueRange.ptr(374, 162, 178), new valueRange.ptr(395, 179, 179), new valueRange.ptr(425, 180, 186), new valueRange.ptr(1122, 187, 187), new valueRange.ptr(446, 188, 191), new valueRange.ptr(3, 13, 0), new valueRange.ptr(458, 128, 148), new valueRange.ptr(1118, 149, 149), new valueRange.ptr(458, 150, 150), new valueRange.ptr(467, 151, 151), new valueRange.ptr(473, 152, 152), new valueRange.ptr(509, 153, 153), new valueRange.ptr(494, 154, 154), new valueRange.ptr(491, 155, 155), new valueRange.ptr(374, 156, 172), new valueRange.ptr(395, 173, 173), new valueRange.ptr(425, 174, 180), new valueRange.ptr(1122, 181, 181), new valueRange.ptr(446, 182, 191), new valueRange.ptr(3, 13, 0), new valueRange.ptr(476, 128, 142), new valueRange.ptr(1118, 143, 143), new valueRange.ptr(458, 144, 144), new valueRange.ptr(467, 145, 145), new valueRange.ptr(473, 146, 146), new valueRange.ptr(509, 147, 147), new valueRange.ptr(494, 148, 148), new valueRange.ptr(491, 149, 149), new valueRange.ptr(374, 150, 166), new valueRange.ptr(395, 167, 167), new valueRange.ptr(425, 168, 174), new valueRange.ptr(1122, 175, 175), new valueRange.ptr(446, 176, 191), new valueRange.ptr(3, 13, 0), new valueRange.ptr(494, 128, 136), new valueRange.ptr(1118, 137, 137), new valueRange.ptr(458, 138, 138), new valueRange.ptr(467, 139, 139), new valueRange.ptr(473, 140, 140), new valueRange.ptr(509, 141, 141), new valueRange.ptr(494, 142, 142), new valueRange.ptr(491, 143, 143), new valueRange.ptr(374, 144, 160), new valueRange.ptr(395, 161, 161), new valueRange.ptr(425, 162, 168), new valueRange.ptr(1122, 169, 169), new valueRange.ptr(446, 170, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(33075, 128, 134), new valueRange.ptr(33075, 136, 152), new valueRange.ptr(33075, 155, 161), new valueRange.ptr(33075, 163, 164), new valueRange.ptr(33075, 166, 170), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33075, 172, 175), new valueRange.ptr(0, 1, 0), new valueRange.ptr(33070, 144, 150), new valueRange.ptr(0, 2, 0), new valueRange.ptr(33075, 132, 137), new valueRange.ptr(33027, 138, 138), new valueRange.ptr(2, 10, 0), new valueRange.ptr(99, 128, 137), new valueRange.ptr(6484, 138, 138), new valueRange.ptr(6535, 139, 139), new valueRange.ptr(6562, 140, 140), new valueRange.ptr(6568, 141, 141), new valueRange.ptr(7110, 142, 142), new valueRange.ptr(6580, 143, 143), new valueRange.ptr(6526, 170, 170), new valueRange.ptr(6529, 171, 171), new valueRange.ptr(6532, 172, 172), new valueRange.ptr(0, 1, 0), new valueRange.ptr(6466, 144, 144), new valueRange.ptr(40, 9, 0), new valueRange.ptr(10351, 128, 128), new valueRange.ptr(10291, 129, 129), new valueRange.ptr(10301, 130, 130), new valueRange.ptr(10321, 131, 132), new valueRange.ptr(10331, 133, 134), new valueRange.ptr(10311, 135, 135), new valueRange.ptr(10341, 136, 136), new valueRange.ptr(2930, 144, 144), new valueRange.ptr(2282, 145, 145), new valueRange.ptr(2, 1, 0), new valueRange.ptr(33, 176, 185)]); nfkcSparse = new sparseBlocks.ptr(new sliceType$2(nfkcSparseValues), nfkcSparseOffset); formTable = new sliceType$3([new formInfo.ptr(0, true, false, lookupInfoNFC, nextComposed), new formInfo.ptr(1, false, false, lookupInfoNFC, nextDecomposed), new formInfo.ptr(2, true, true, lookupInfoNFKC, nextComposed), new formInfo.ptr(3, false, true, lookupInfoNFKC, nextDecomposed)]); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["vendor/golang.org/x/net/idna"] = (function() { var $pkg = {}, $init, fmt, math, strings, utf8, bidirule, bidi, norm, info, category, valueRange, sparseBlocks, idnaTrie, options, Profile, labelError, runeError, labelIter, joinState, sliceType, sliceType$1, ptrType, arrayType, sliceType$2, sliceType$3, sliceType$4, sliceType$5, sliceType$6, ptrType$1, ptrType$3, funcType, funcType$1, funcType$2, ptrType$4, idnaSparse, trie, mappings, xorData, idnaValues, idnaIndex, idnaSparseOffset, idnaSparseValues, punycode, lookup, joinStates, punyError, decode, encode, decodeDigit, encodeDigit, adapt, ToASCII, validateAndMap, validateFromPunycode, ascii; fmt = $packages["fmt"]; math = $packages["math"]; strings = $packages["strings"]; utf8 = $packages["unicode/utf8"]; bidirule = $packages["vendor/golang.org/x/text/secure/bidirule"]; bidi = $packages["vendor/golang.org/x/text/unicode/bidi"]; norm = $packages["vendor/golang.org/x/text/unicode/norm"]; info = $pkg.info = $newType(2, $kindUint16, "idna.info", true, "vendor/golang.org/x/net/idna", false, null); category = $pkg.category = $newType(2, $kindUint16, "idna.category", true, "vendor/golang.org/x/net/idna", false, null); valueRange = $pkg.valueRange = $newType(0, $kindStruct, "idna.valueRange", true, "vendor/golang.org/x/net/idna", false, function(value_, lo_, hi_) { this.$val = this; if (arguments.length === 0) { this.value = 0; this.lo = 0; this.hi = 0; return; } this.value = value_; this.lo = lo_; this.hi = hi_; }); sparseBlocks = $pkg.sparseBlocks = $newType(0, $kindStruct, "idna.sparseBlocks", true, "vendor/golang.org/x/net/idna", false, function(values_, offset_) { this.$val = this; if (arguments.length === 0) { this.values = sliceType$1.nil; this.offset = sliceType.nil; return; } this.values = values_; this.offset = offset_; }); idnaTrie = $pkg.idnaTrie = $newType(0, $kindStruct, "idna.idnaTrie", true, "vendor/golang.org/x/net/idna", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); options = $pkg.options = $newType(0, $kindStruct, "idna.options", true, "vendor/golang.org/x/net/idna", false, function(transitional_, useSTD3Rules_, checkHyphens_, checkJoiners_, verifyDNSLength_, removeLeadingDots_, trie_, fromPuny_, mapping_, bidirule_) { this.$val = this; if (arguments.length === 0) { this.transitional = false; this.useSTD3Rules = false; this.checkHyphens = false; this.checkJoiners = false; this.verifyDNSLength = false; this.removeLeadingDots = false; this.trie = ptrType.nil; this.fromPuny = $throwNilPointerError; this.mapping = $throwNilPointerError; this.bidirule = $throwNilPointerError; return; } this.transitional = transitional_; this.useSTD3Rules = useSTD3Rules_; this.checkHyphens = checkHyphens_; this.checkJoiners = checkJoiners_; this.verifyDNSLength = verifyDNSLength_; this.removeLeadingDots = removeLeadingDots_; this.trie = trie_; this.fromPuny = fromPuny_; this.mapping = mapping_; this.bidirule = bidirule_; }); Profile = $pkg.Profile = $newType(0, $kindStruct, "idna.Profile", true, "vendor/golang.org/x/net/idna", true, function(options_) { this.$val = this; if (arguments.length === 0) { this.options = new options.ptr(false, false, false, false, false, false, ptrType.nil, $throwNilPointerError, $throwNilPointerError, $throwNilPointerError); return; } this.options = options_; }); labelError = $pkg.labelError = $newType(0, $kindStruct, "idna.labelError", true, "vendor/golang.org/x/net/idna", false, function(label_, code__) { this.$val = this; if (arguments.length === 0) { this.label = ""; this.code_ = ""; return; } this.label = label_; this.code_ = code__; }); runeError = $pkg.runeError = $newType(4, $kindInt32, "idna.runeError", true, "vendor/golang.org/x/net/idna", false, null); labelIter = $pkg.labelIter = $newType(0, $kindStruct, "idna.labelIter", true, "vendor/golang.org/x/net/idna", false, function(orig_, slice_, curStart_, curEnd_, i_) { this.$val = this; if (arguments.length === 0) { this.orig = ""; this.slice = sliceType$6.nil; this.curStart = 0; this.curEnd = 0; this.i = 0; return; } this.orig = orig_; this.slice = slice_; this.curStart = curStart_; this.curEnd = curEnd_; this.i = i_; }); joinState = $pkg.joinState = $newType(1, $kindInt8, "idna.joinState", true, "vendor/golang.org/x/net/idna", false, null); sliceType = $sliceType($Uint16); sliceType$1 = $sliceType(valueRange); ptrType = $ptrType(idnaTrie); arrayType = $arrayType(joinState, 8); sliceType$2 = $sliceType(arrayType); sliceType$3 = $sliceType($Int32); sliceType$4 = $sliceType($Uint8); sliceType$5 = $sliceType($emptyInterface); sliceType$6 = $sliceType($String); ptrType$1 = $ptrType(sparseBlocks); ptrType$3 = $ptrType(Profile); funcType = $funcType([ptrType$3, $String], [$error], false); funcType$1 = $funcType([ptrType$3, $String], [$String, $Bool, $error], false); funcType$2 = $funcType([$String], [$Bool], false); ptrType$4 = $ptrType(labelIter); info.prototype.isMapped = function() { var c; c = this.$val; return !((((c & 3) >>> 0) === 0)); }; $ptrType(info).prototype.isMapped = function() { return new info(this.$get()).isMapped(); }; info.prototype.category = function() { var c, small; c = this.$val; small = (c & 3) >>> 0; if (!((small === 0))) { return ((small << 16 >>> 16)); } return ((((c & 248) >>> 0) << 16 >>> 16)); }; $ptrType(info).prototype.category = function() { return new info(this.$get()).category(); }; info.prototype.joinType = function() { var c; c = this.$val; if (new info(c).isMapped()) { return 0; } return (((c >>> 8 << 16 >>> 16)) & 7) >>> 0; }; $ptrType(info).prototype.joinType = function() { return new info(this.$get()).joinType(); }; info.prototype.isModifier = function() { var c; c = this.$val; return ((c & 4099) >>> 0) === 4096; }; $ptrType(info).prototype.isModifier = function() { return new info(this.$get()).isModifier(); }; info.prototype.isViramaModifier = function() { var c; c = this.$val; return ((c & 6147) >>> 0) === 6144; }; $ptrType(info).prototype.isViramaModifier = function() { return new info(this.$get()).isViramaModifier(); }; info.prototype.appendMapping = function(b, s) { var _index, b, c, index, p, s, s$1; c = this.$val; index = (((c >>> 3 << 16 >>> 16) >> 0)); if (((c & 4) >>> 0) === 0) { s$1 = $substring(mappings, index); return $appendSlice(b, $substring(s$1, 1, (s$1.charCodeAt(0) + 1 << 24 >>> 24))); } b = $appendSlice(b, s); if (((c & 57344) >>> 0) === 57344) { _index = b.$length - 1 >> 0; ((_index < 0 || _index >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + _index] = ((((_index < 0 || _index >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + _index]) ^ (((index << 24 >>> 24)))) << 24 >>> 24)); } else { p = b.$length - ((xorData.charCodeAt(index) >> 0)) >> 0; while (true) { if (!(p < b.$length)) { break; } index = index + (1) >> 0; ((p < 0 || p >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + p] = ((((p < 0 || p >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + p]) ^ (xorData.charCodeAt(index))) << 24 >>> 24)); p = p + (1) >> 0; } } return b; }; $ptrType(info).prototype.appendMapping = function(b, s) { return new info(this.$get()).appendMapping(b, s); }; sparseBlocks.ptr.prototype.lookup = function(n, b) { var _q, b, header, hi, lo, m, n, offset, r, t, x, x$1, x$2; t = this; offset = (x = t.offset, ((n < 0 || n >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + n])); header = $clone((x$1 = t.values, ((offset < 0 || offset >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + offset])), valueRange); lo = offset + 1 << 16 >>> 16; hi = lo + ((header.lo << 16 >>> 16)) << 16 >>> 16; while (true) { if (!(lo < hi)) { break; } m = lo + (_q = ((hi - lo << 16 >>> 16)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")) << 16 >>> 16; r = $clone((x$2 = t.values, ((m < 0 || m >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + m])), valueRange); if (r.lo <= b && b <= r.hi) { return r.value + ((((b - r.lo << 24 >>> 24) << 16 >>> 16)) * header.value << 16 >>> 16) << 16 >>> 16; } if (b < r.lo) { hi = m; } else { lo = m + 1 << 16 >>> 16; } } return 0; }; sparseBlocks.prototype.lookup = function(n, b) { return this.$val.lookup(n, b); }; idnaTrie.ptr.prototype.lookup = function(s) { var _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$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, c0, c1, c1$1, c1$2, c2, c2$1, c3, i, i$1, i$2, o, o$1, s, sz, t, v; v = 0; sz = 0; t = this; c0 = (0 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 0]); if (c0 < 128) { _tmp = ((c0 < 0 || c0 >= idnaValues.length) ? ($throwRuntimeError("index out of range"), undefined) : idnaValues[c0]); _tmp$1 = 1; v = _tmp; sz = _tmp$1; return [v, sz]; } else if (c0 < 194) { _tmp$2 = 0; _tmp$3 = 1; v = _tmp$2; sz = _tmp$3; return [v, sz]; } else if (c0 < 224) { if (s.$length < 2) { _tmp$4 = 0; _tmp$5 = 0; v = _tmp$4; sz = _tmp$5; return [v, sz]; } i = ((c0 < 0 || c0 >= idnaIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : idnaIndex[c0]); c1 = (1 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 1]); if (c1 < 128 || 192 <= c1) { _tmp$6 = 0; _tmp$7 = 1; v = _tmp$6; sz = _tmp$7; return [v, sz]; } _tmp$8 = t.lookupValue(((i >>> 0)), c1); _tmp$9 = 2; v = _tmp$8; sz = _tmp$9; return [v, sz]; } else if (c0 < 240) { if (s.$length < 3) { _tmp$10 = 0; _tmp$11 = 0; v = _tmp$10; sz = _tmp$11; return [v, sz]; } i$1 = ((c0 < 0 || c0 >= idnaIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : idnaIndex[c0]); c1$1 = (1 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 1]); if (c1$1 < 128 || 192 <= c1$1) { _tmp$12 = 0; _tmp$13 = 1; v = _tmp$12; sz = _tmp$13; return [v, sz]; } o = (((i$1 >>> 0)) << 6 >>> 0) + ((c1$1 >>> 0)) >>> 0; i$1 = ((o < 0 || o >= idnaIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : idnaIndex[o]); c2 = (2 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 2]); if (c2 < 128 || 192 <= c2) { _tmp$14 = 0; _tmp$15 = 2; v = _tmp$14; sz = _tmp$15; return [v, sz]; } _tmp$16 = t.lookupValue(((i$1 >>> 0)), c2); _tmp$17 = 3; v = _tmp$16; sz = _tmp$17; return [v, sz]; } else if (c0 < 248) { if (s.$length < 4) { _tmp$18 = 0; _tmp$19 = 0; v = _tmp$18; sz = _tmp$19; return [v, sz]; } i$2 = ((c0 < 0 || c0 >= idnaIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : idnaIndex[c0]); c1$2 = (1 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 1]); if (c1$2 < 128 || 192 <= c1$2) { _tmp$20 = 0; _tmp$21 = 1; v = _tmp$20; sz = _tmp$21; return [v, sz]; } o$1 = (((i$2 >>> 0)) << 6 >>> 0) + ((c1$2 >>> 0)) >>> 0; i$2 = ((o$1 < 0 || o$1 >= idnaIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : idnaIndex[o$1]); c2$1 = (2 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 2]); if (c2$1 < 128 || 192 <= c2$1) { _tmp$22 = 0; _tmp$23 = 2; v = _tmp$22; sz = _tmp$23; return [v, sz]; } o$1 = (((i$2 >>> 0)) << 6 >>> 0) + ((c2$1 >>> 0)) >>> 0; i$2 = ((o$1 < 0 || o$1 >= idnaIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : idnaIndex[o$1]); c3 = (3 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 3]); if (c3 < 128 || 192 <= c3) { _tmp$24 = 0; _tmp$25 = 3; v = _tmp$24; sz = _tmp$25; return [v, sz]; } _tmp$26 = t.lookupValue(((i$2 >>> 0)), c3); _tmp$27 = 4; v = _tmp$26; sz = _tmp$27; return [v, sz]; } _tmp$28 = 0; _tmp$29 = 1; v = _tmp$28; sz = _tmp$29; return [v, sz]; }; idnaTrie.prototype.lookup = function(s) { return this.$val.lookup(s); }; idnaTrie.ptr.prototype.lookupString = function(s) { var _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$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, c0, c1, c1$1, c1$2, c2, c2$1, c3, i, i$1, i$2, o, o$1, s, sz, t, v; v = 0; sz = 0; t = this; c0 = s.charCodeAt(0); if (c0 < 128) { _tmp = ((c0 < 0 || c0 >= idnaValues.length) ? ($throwRuntimeError("index out of range"), undefined) : idnaValues[c0]); _tmp$1 = 1; v = _tmp; sz = _tmp$1; return [v, sz]; } else if (c0 < 194) { _tmp$2 = 0; _tmp$3 = 1; v = _tmp$2; sz = _tmp$3; return [v, sz]; } else if (c0 < 224) { if (s.length < 2) { _tmp$4 = 0; _tmp$5 = 0; v = _tmp$4; sz = _tmp$5; return [v, sz]; } i = ((c0 < 0 || c0 >= idnaIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : idnaIndex[c0]); c1 = s.charCodeAt(1); if (c1 < 128 || 192 <= c1) { _tmp$6 = 0; _tmp$7 = 1; v = _tmp$6; sz = _tmp$7; return [v, sz]; } _tmp$8 = t.lookupValue(((i >>> 0)), c1); _tmp$9 = 2; v = _tmp$8; sz = _tmp$9; return [v, sz]; } else if (c0 < 240) { if (s.length < 3) { _tmp$10 = 0; _tmp$11 = 0; v = _tmp$10; sz = _tmp$11; return [v, sz]; } i$1 = ((c0 < 0 || c0 >= idnaIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : idnaIndex[c0]); c1$1 = s.charCodeAt(1); if (c1$1 < 128 || 192 <= c1$1) { _tmp$12 = 0; _tmp$13 = 1; v = _tmp$12; sz = _tmp$13; return [v, sz]; } o = (((i$1 >>> 0)) << 6 >>> 0) + ((c1$1 >>> 0)) >>> 0; i$1 = ((o < 0 || o >= idnaIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : idnaIndex[o]); c2 = s.charCodeAt(2); if (c2 < 128 || 192 <= c2) { _tmp$14 = 0; _tmp$15 = 2; v = _tmp$14; sz = _tmp$15; return [v, sz]; } _tmp$16 = t.lookupValue(((i$1 >>> 0)), c2); _tmp$17 = 3; v = _tmp$16; sz = _tmp$17; return [v, sz]; } else if (c0 < 248) { if (s.length < 4) { _tmp$18 = 0; _tmp$19 = 0; v = _tmp$18; sz = _tmp$19; return [v, sz]; } i$2 = ((c0 < 0 || c0 >= idnaIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : idnaIndex[c0]); c1$2 = s.charCodeAt(1); if (c1$2 < 128 || 192 <= c1$2) { _tmp$20 = 0; _tmp$21 = 1; v = _tmp$20; sz = _tmp$21; return [v, sz]; } o$1 = (((i$2 >>> 0)) << 6 >>> 0) + ((c1$2 >>> 0)) >>> 0; i$2 = ((o$1 < 0 || o$1 >= idnaIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : idnaIndex[o$1]); c2$1 = s.charCodeAt(2); if (c2$1 < 128 || 192 <= c2$1) { _tmp$22 = 0; _tmp$23 = 2; v = _tmp$22; sz = _tmp$23; return [v, sz]; } o$1 = (((i$2 >>> 0)) << 6 >>> 0) + ((c2$1 >>> 0)) >>> 0; i$2 = ((o$1 < 0 || o$1 >= idnaIndex.length) ? ($throwRuntimeError("index out of range"), undefined) : idnaIndex[o$1]); c3 = s.charCodeAt(3); if (c3 < 128 || 192 <= c3) { _tmp$24 = 0; _tmp$25 = 3; v = _tmp$24; sz = _tmp$25; return [v, sz]; } _tmp$26 = t.lookupValue(((i$2 >>> 0)), c3); _tmp$27 = 4; v = _tmp$26; sz = _tmp$27; return [v, sz]; } _tmp$28 = 0; _tmp$29 = 1; v = _tmp$28; sz = _tmp$29; return [v, sz]; }; idnaTrie.prototype.lookupString = function(s) { return this.$val.lookupString(s); }; idnaTrie.ptr.prototype.lookupValue = function(n, b) { var b, n, t, x; t = this; if (n < 126) { return ((x = (n << 6 >>> 0) + ((b >>> 0)) >>> 0, ((x < 0 || x >= idnaValues.length) ? ($throwRuntimeError("index out of range"), undefined) : idnaValues[x]))); } else { n = n - (126) >>> 0; return (idnaSparse.lookup(n, b)); } }; idnaTrie.prototype.lookupValue = function(n, b) { return this.$val.lookupValue(n, b); }; punyError = function(s) { var s; return new labelError.ptr(s, "A3"); }; decode = function(encoded) { var _i, _q, _r, _ref, _rune, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tuple, bias, digit, encoded, i, k, n, ok, oldI, output, pos, r, t, w, x; if (encoded === "") { return ["", $ifaceNil]; } pos = 1 + strings.LastIndex(encoded, "-") >> 0; if (pos === 1) { return ["", punyError(encoded)]; } if (pos === encoded.length) { return [$substring(encoded, 0, (encoded.length - 1 >> 0)), $ifaceNil]; } output = $makeSlice(sliceType$3, 0, encoded.length); if (!((pos === 0))) { _ref = $substring(encoded, 0, (pos - 1 >> 0)); _i = 0; while (true) { if (!(_i < _ref.length)) { break; } _rune = $decodeRune(_ref, _i); r = _rune[0]; output = $append(output, r); _i += _rune[1]; } } _tmp = 0; _tmp$1 = 128; _tmp$2 = 72; i = _tmp; n = _tmp$1; bias = _tmp$2; while (true) { if (!(pos < encoded.length)) { break; } _tmp$3 = i; _tmp$4 = 1; oldI = _tmp$3; w = _tmp$4; k = 36; while (true) { if (pos === encoded.length) { return ["", punyError(encoded)]; } _tuple = decodeDigit(encoded.charCodeAt(pos)); digit = _tuple[0]; ok = _tuple[1]; if (!ok) { return ["", punyError(encoded)]; } pos = pos + (1) >> 0; i = i + (($imul(digit, w))) >> 0; if (i < 0) { return ["", punyError(encoded)]; } t = k - bias >> 0; if (t < 1) { t = 1; } else if (t > 26) { t = 26; } if (digit < t) { break; } w = $imul(w, ((36 - t >> 0))); if (w >= 59652323) { return ["", punyError(encoded)]; } k = k + (36) >> 0; } x = (((output.$length + 1 >> 0) >> 0)); bias = adapt(i - oldI >> 0, x, oldI === 0); n = n + ((_q = i / x, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))) >> 0; i = (_r = i % (x), _r === _r ? _r : $throwRuntimeError("integer divide by zero")); if (n > 1114111 || output.$length >= 1024) { return ["", punyError(encoded)]; } output = $append(output, 0); $copySlice($subslice(output, (i + 1 >> 0)), $subslice(output, i)); ((i < 0 || i >= output.$length) ? ($throwRuntimeError("index out of range"), undefined) : output.$array[output.$offset + i] = n); i = i + (1) >> 0; } return [($runesToString(output)), $ifaceNil]; }; encode = function(prefix, s) { var _i, _i$1, _i$2, _q, _r, _ref, _ref$1, _ref$2, _rune, _rune$1, _rune$2, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, b, bias, delta, h, k, m, n, output, prefix, q, r, r$1, r$2, remaining, s, t; output = $makeSlice(sliceType$4, prefix.length, ((prefix.length + 1 >> 0) + ($imul(2, s.length)) >> 0)); $copyString(output, prefix); _tmp = 0; _tmp$1 = 128; _tmp$2 = 72; delta = _tmp; n = _tmp$1; bias = _tmp$2; _tmp$3 = 0; _tmp$4 = 0; b = _tmp$3; remaining = _tmp$4; _ref = s; _i = 0; while (true) { if (!(_i < _ref.length)) { break; } _rune = $decodeRune(_ref, _i); r = _rune[0]; if (r < 128) { b = b + (1) >> 0; output = $append(output, ((r << 24 >>> 24))); } else { remaining = remaining + (1) >> 0; } _i += _rune[1]; } h = b; if (b > 0) { output = $append(output, 45); } while (true) { if (!(!((remaining === 0)))) { break; } m = 2147483647; _ref$1 = s; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.length)) { break; } _rune$1 = $decodeRune(_ref$1, _i$1); r$1 = _rune$1[0]; if (m > r$1 && r$1 >= n) { m = r$1; } _i$1 += _rune$1[1]; } delta = delta + (($imul(((m - n >> 0)), ((h + 1 >> 0))))) >> 0; if (delta < 0) { return ["", punyError(s)]; } n = m; _ref$2 = s; _i$2 = 0; while (true) { if (!(_i$2 < _ref$2.length)) { break; } _rune$2 = $decodeRune(_ref$2, _i$2); r$2 = _rune$2[0]; if (r$2 < n) { delta = delta + (1) >> 0; if (delta < 0) { return ["", punyError(s)]; } _i$2 += _rune$2[1]; continue; } if (r$2 > n) { _i$2 += _rune$2[1]; continue; } q = delta; k = 36; while (true) { t = k - bias >> 0; if (t < 1) { t = 1; } else if (t > 26) { t = 26; } if (q < t) { break; } output = $append(output, encodeDigit(t + (_r = ((q - t >> 0)) % ((36 - t >> 0)), _r === _r ? _r : $throwRuntimeError("integer divide by zero")) >> 0)); q = (_q = ((q - t >> 0)) / ((36 - t >> 0)), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); k = k + (36) >> 0; } output = $append(output, encodeDigit(q)); bias = adapt(delta, h + 1 >> 0, h === b); delta = 0; h = h + (1) >> 0; remaining = remaining - (1) >> 0; _i$2 += _rune$2[1]; } delta = delta + (1) >> 0; n = n + (1) >> 0; } return [($bytesToString(output)), $ifaceNil]; }; decodeDigit = function(x) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, digit, ok, x; digit = 0; ok = false; if (48 <= x && x <= 57) { _tmp = (((x - 22 << 24 >>> 24) >> 0)); _tmp$1 = true; digit = _tmp; ok = _tmp$1; return [digit, ok]; } else if (65 <= x && x <= 90) { _tmp$2 = (((x - 65 << 24 >>> 24) >> 0)); _tmp$3 = true; digit = _tmp$2; ok = _tmp$3; return [digit, ok]; } else if (97 <= x && x <= 122) { _tmp$4 = (((x - 97 << 24 >>> 24) >> 0)); _tmp$5 = true; digit = _tmp$4; ok = _tmp$5; return [digit, ok]; } _tmp$6 = 0; _tmp$7 = false; digit = _tmp$6; ok = _tmp$7; return [digit, ok]; }; encodeDigit = function(digit) { var digit; if (0 <= digit && digit < 26) { return (((digit + 97 >> 0) << 24 >>> 24)); } else if (26 <= digit && digit < 36) { return (((digit + 22 >> 0) << 24 >>> 24)); } $panic(new $String("idna: internal error in punycode encoding")); }; adapt = function(delta, numPoints, firstTime) { var _q, _q$1, _q$2, _q$3, _q$4, delta, firstTime, k, numPoints; if (firstTime) { delta = (_q = delta / (700), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); } else { delta = (_q$1 = delta / (2), (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")); } delta = delta + ((_q$2 = delta / numPoints, (_q$2 === _q$2 && _q$2 !== 1/0 && _q$2 !== -1/0) ? _q$2 >> 0 : $throwRuntimeError("integer divide by zero"))) >> 0; k = 0; while (true) { if (!(delta > 455)) { break; } delta = (_q$3 = delta / (35), (_q$3 === _q$3 && _q$3 !== 1/0 && _q$3 !== -1/0) ? _q$3 >> 0 : $throwRuntimeError("integer divide by zero")); k = k + (36) >> 0; } return k + (_q$4 = ($imul(36, delta)) / ((delta + 38 >> 0)), (_q$4 === _q$4 && _q$4 !== 1/0 && _q$4 !== -1/0) ? _q$4 >> 0 : $throwRuntimeError("integer divide by zero")) >> 0; }; ToASCII = function(s) { var $24r, _r, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = $pkg.Punycode.process(s, true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: ToASCII }; } $f.$24r = $24r; $f._r = _r; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.ToASCII = ToASCII; Profile.ptr.prototype.ToASCII = function(s) { var $24r, _r, p, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; p = $f.p; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; _r = p.process(s, true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Profile.ptr.prototype.ToASCII }; } $f.$24r = $24r; $f._r = _r; $f.p = p; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; Profile.prototype.ToASCII = function(s) { return this.$val.ToASCII(s); }; Profile.ptr.prototype.ToUnicode = function(s) { var $24r, _r, p, pp, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; p = $f.p; pp = $f.pp; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; pp = $clone(p, Profile); pp.options.transitional = false; _r = pp.process(s, false); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Profile.ptr.prototype.ToUnicode }; } $f.$24r = $24r; $f._r = _r; $f.p = p; $f.pp = pp; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; Profile.prototype.ToUnicode = function(s) { return this.$val.ToUnicode(s); }; Profile.ptr.prototype.String = function() { var p, s; p = this; s = ""; if (p.options.transitional) { s = "Transitional"; } else { s = "NonTransitional"; } if (p.options.useSTD3Rules) { s = s + (":UseSTD3Rules"); } if (p.options.checkHyphens) { s = s + (":CheckHyphens"); } if (p.options.checkJoiners) { s = s + (":CheckJoiners"); } if (p.options.verifyDNSLength) { s = s + (":VerifyDNSLength"); } return s; }; Profile.prototype.String = function() { return this.$val.String(); }; labelError.ptr.prototype.Error = function() { var $24r, _r, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; _r = fmt.Sprintf("idna: invalid label %q", new sliceType$5([new $String(e.label)])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: labelError.ptr.prototype.Error }; } $f.$24r = $24r; $f._r = _r; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; labelError.prototype.Error = function() { return this.$val.Error(); }; runeError.prototype.Error = function() { var $24r, _r, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this.$val; _r = fmt.Sprintf("idna: disallowed rune %U", new sliceType$5([new runeError(e)])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: runeError.prototype.Error }; } $f.$24r = $24r; $f._r = _r; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(runeError).prototype.Error = function() { return new runeError(this.$get()).Error(); }; Profile.ptr.prototype.process = function(s, toASCII) { var _r, _r$1, _r$2, _tuple, _tuple$1, _tuple$2, a, err, err2, err2$1, isBidi, label, label$1, labels, n, n$1, p, s, toASCII, u, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; a = $f.a; err = $f.err; err2 = $f.err2; err2$1 = $f.err2$1; isBidi = $f.isBidi; label = $f.label; label$1 = $f.label$1; labels = $f.labels; n = $f.n; n$1 = $f.n$1; p = $f.p; s = $f.s; toASCII = $f.toASCII; u = $f.u; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; err = $ifaceNil; isBidi = false; /* */ if (!(p.options.mapping === $throwNilPointerError)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(p.options.mapping === $throwNilPointerError)) { */ case 1: _r = p.options.mapping(p, s); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; s = _tuple[0]; isBidi = _tuple[1]; err = _tuple[2]; /* } */ case 2: if (p.options.removeLeadingDots) { while (true) { if (!(s.length > 0 && (s.charCodeAt(0) === 46))) { break; } s = $substring(s, 1); } } if ($interfaceIsEqual(err, $ifaceNil) && p.options.verifyDNSLength && s === "") { err = new labelError.ptr(s, "A4"); } labels = new labelIter.ptr(s, sliceType$6.nil, 0, 0, 0); /* while (true) { */ case 4: /* if (!(!labels.done())) { break; } */ if(!(!labels.done())) { $s = 5; continue; } label = labels.label(); if (label === "") { if ($interfaceIsEqual(err, $ifaceNil) && p.options.verifyDNSLength) { err = new labelError.ptr(s, "A4"); } labels.next(); /* continue; */ $s = 4; continue; } /* */ if (strings.HasPrefix(label, "xn--")) { $s = 6; continue; } /* */ if ($interfaceIsEqual(err, $ifaceNil)) { $s = 7; continue; } /* */ $s = 8; continue; /* if (strings.HasPrefix(label, "xn--")) { */ case 6: _tuple$1 = decode($substring(label, 4)); u = _tuple$1[0]; err2 = _tuple$1[1]; if (!($interfaceIsEqual(err2, $ifaceNil))) { if ($interfaceIsEqual(err, $ifaceNil)) { err = err2; } labels.next(); /* continue; */ $s = 4; continue; } isBidi = isBidi || !((bidirule.DirectionString(u) === 0)); labels.set(u); /* */ if ($interfaceIsEqual(err, $ifaceNil) && !(p.options.fromPuny === $throwNilPointerError)) { $s = 9; continue; } /* */ $s = 10; continue; /* if ($interfaceIsEqual(err, $ifaceNil) && !(p.options.fromPuny === $throwNilPointerError)) { */ case 9: _r$1 = p.options.fromPuny(p, u); /* */ $s = 11; case 11: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err = _r$1; /* } */ case 10: if ($interfaceIsEqual(err, $ifaceNil)) { err = p.validateLabel(u); } $s = 8; continue; /* } else if ($interfaceIsEqual(err, $ifaceNil)) { */ case 7: err = p.validateLabel(label); /* } */ case 8: labels.next(); $s = 4; continue; case 5: /* */ if (isBidi && !(p.options.bidirule === $throwNilPointerError) && $interfaceIsEqual(err, $ifaceNil)) { $s = 12; continue; } /* */ $s = 13; continue; /* if (isBidi && !(p.options.bidirule === $throwNilPointerError) && $interfaceIsEqual(err, $ifaceNil)) { */ case 12: labels.reset(); /* while (true) { */ case 14: /* if (!(!labels.done())) { break; } */ if(!(!labels.done())) { $s = 15; continue; } _r$2 = p.options.bidirule(labels.label()); /* */ $s = 18; case 18: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } /* */ if (!_r$2) { $s = 16; continue; } /* */ $s = 17; continue; /* if (!_r$2) { */ case 16: err = new labelError.ptr(s, "B"); /* break; */ $s = 15; continue; /* } */ case 17: labels.next(); $s = 14; continue; case 15: /* } */ case 13: if (toASCII) { labels.reset(); while (true) { if (!(!labels.done())) { break; } label$1 = labels.label(); if (!ascii(label$1)) { _tuple$2 = encode("xn--", label$1); a = _tuple$2[0]; err2$1 = _tuple$2[1]; if ($interfaceIsEqual(err, $ifaceNil)) { err = err2$1; } label$1 = a; labels.set(a); } n = label$1.length; if (p.options.verifyDNSLength && $interfaceIsEqual(err, $ifaceNil) && ((n === 0) || n > 63)) { err = new labelError.ptr(label$1, "A4"); } labels.next(); } } s = labels.result(); if (toASCII && p.options.verifyDNSLength && $interfaceIsEqual(err, $ifaceNil)) { n$1 = s.length; if (n$1 > 0 && (s.charCodeAt((n$1 - 1 >> 0)) === 46)) { n$1 = n$1 - (1) >> 0; } if (s.length < 1 || n$1 > 253) { err = new labelError.ptr(s, "A4"); } } $s = -1; return [s, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Profile.ptr.prototype.process }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.a = a; $f.err = err; $f.err2 = err2; $f.err2$1 = err2$1; $f.isBidi = isBidi; $f.label = label; $f.label$1 = label$1; $f.labels = labels; $f.n = n; $f.n$1 = n$1; $f.p = p; $f.s = s; $f.toASCII = toASCII; $f.u = u; $f.$s = $s; $f.$r = $r; return $f; }; Profile.prototype.process = function(s, toASCII) { return this.$val.process(s, toASCII); }; info.prototype.isBidi = function(s) { var _1, _tuple, c, p, s; c = this.$val; if (!new info(c).isMapped()) { return ((c & 6144) >>> 0) === 2048; } _tuple = bidi.LookupString(s); p = $clone(_tuple[0], bidi.Properties); _1 = $clone(p, bidi.Properties).Class(); if ((_1 === (1)) || (_1 === (13)) || (_1 === (5))) { return true; } return false; }; $ptrType(info).prototype.isBidi = function(s) { return new info(this.$get()).isBidi(s); }; validateAndMap = function(p, s) { var _1, _r, _r$1, _r$2, _tmp, _tmp$1, _tmp$2, _tuple, _tuple$1, b, bidi$1, combinedInfoBits, err, i, k, p, r, s, start, sz, v, vm, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; b = $f.b; bidi$1 = $f.bidi$1; combinedInfoBits = $f.combinedInfoBits; err = $f.err; i = $f.i; k = $f.k; p = $f.p; r = $f.r; s = $f.s; start = $f.start; sz = $f.sz; v = $f.v; vm = $f.vm; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: vm = ""; bidi$1 = false; err = $ifaceNil; b = sliceType$4.nil; k = 0; combinedInfoBits = 0; i = 0; while (true) { if (!(i < s.length)) { break; } _tuple = trie.lookupString($substring(s, i)); v = _tuple[0]; sz = _tuple[1]; if (sz === 0) { b = $appendSlice(b, $substring(s, k, i)); b = $appendSlice(b, "\xEF\xBF\xBD"); k = s.length; if ($interfaceIsEqual(err, $ifaceNil)) { err = new runeError(65533); } break; } combinedInfoBits = (combinedInfoBits | (((v << 16 >>> 16)))) >>> 0; bidi$1 = bidi$1 || new info(((v << 16 >>> 16))).isBidi($substring(s, i)); start = i; i = i + (sz) >> 0; _1 = p.simplify(new info(((v << 16 >>> 16))).category()); if (_1 === (8)) { continue; } else if (_1 === (64)) { if ($interfaceIsEqual(err, $ifaceNil)) { _tuple$1 = utf8.DecodeRuneInString($substring(s, start)); r = _tuple$1[0]; err = new runeError(((r >> 0))); } continue; } else if ((_1 === (1)) || (_1 === (3))) { b = $appendSlice(b, $substring(s, k, start)); b = new info(((v << 16 >>> 16))).appendMapping(b, $substring(s, start, i)); } else if (_1 === (192)) { b = $appendSlice(b, $substring(s, k, start)); } else if (_1 === (0)) { b = $appendSlice(b, $substring(s, k, start)); b = $appendSlice(b, "\xEF\xBF\xBD"); } k = i; } /* */ if (k === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (k === 0) { */ case 1: /* */ if (!((((combinedInfoBits & 8192) >>> 0) === 0))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!((((combinedInfoBits & 8192) >>> 0) === 0))) { */ case 4: _r = new norm.Form(0).String(s); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } s = _r; /* } */ case 5: $s = 3; continue; /* } else { */ case 2: b = $appendSlice(b, $substring(s, k)); _r$1 = new norm.Form(0).QuickSpan(b); /* */ $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 === b.$length))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!((_r$1 === b.$length))) { */ case 7: _r$2 = new norm.Form(0).Bytes(b); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } b = _r$2; /* } */ case 8: s = ($bytesToString(b)); /* } */ case 3: _tmp = s; _tmp$1 = bidi$1; _tmp$2 = err; vm = _tmp; bidi$1 = _tmp$1; err = _tmp$2; $s = -1; return [vm, bidi$1, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: validateAndMap }; } $f._1 = _1; $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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.b = b; $f.bidi$1 = bidi$1; $f.combinedInfoBits = combinedInfoBits; $f.err = err; $f.i = i; $f.k = k; $f.p = p; $f.r = r; $f.s = s; $f.start = start; $f.sz = sz; $f.v = v; $f.vm = vm; $f.$s = $s; $f.$r = $r; return $f; }; labelIter.ptr.prototype.reset = function() { var l; l = this; l.curStart = 0; l.curEnd = 0; l.i = 0; }; labelIter.prototype.reset = function() { return this.$val.reset(); }; labelIter.ptr.prototype.done = function() { var l; l = this; return l.curStart >= l.orig.length; }; labelIter.prototype.done = function() { return this.$val.done(); }; labelIter.ptr.prototype.result = function() { var l; l = this; if (!(l.slice === sliceType$6.nil)) { return strings.Join(l.slice, "."); } return l.orig; }; labelIter.prototype.result = function() { return this.$val.result(); }; labelIter.ptr.prototype.label = function() { var l, p, x, x$1; l = this; if (!(l.slice === sliceType$6.nil)) { return (x = l.slice, x$1 = l.i, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])); } p = strings.IndexByte($substring(l.orig, l.curStart), 46); l.curEnd = l.curStart + p >> 0; if (p === -1) { l.curEnd = l.orig.length; } return $substring(l.orig, l.curStart, l.curEnd); }; labelIter.prototype.label = function() { return this.$val.label(); }; labelIter.ptr.prototype.next = function() { var l, x, x$1; l = this; l.i = l.i + (1) >> 0; if (!(l.slice === sliceType$6.nil)) { if (l.i >= l.slice.$length || (l.i === (l.slice.$length - 1 >> 0)) && (x = l.slice, x$1 = l.i, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])) === "") { l.curStart = l.orig.length; } } else { l.curStart = l.curEnd + 1 >> 0; if ((l.curStart === (l.orig.length - 1 >> 0)) && (l.orig.charCodeAt(l.curStart) === 46)) { l.curStart = l.orig.length; } } }; labelIter.prototype.next = function() { return this.$val.next(); }; labelIter.ptr.prototype.set = function(s) { var l, s, x, x$1; l = this; if (l.slice === sliceType$6.nil) { l.slice = strings.Split(l.orig, "."); } (x = l.slice, x$1 = l.i, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1] = s)); }; labelIter.prototype.set = function(s) { return this.$val.set(s); }; Profile.ptr.prototype.simplify = function(cat) { var _1, cat, p; p = this; _1 = cat; if (_1 === (2)) { if (p.options.useSTD3Rules) { cat = 64; } else { cat = 1; } } else if (_1 === (128)) { if (p.options.useSTD3Rules) { cat = 64; } else { cat = 8; } } else if (_1 === (3)) { if (!p.options.transitional) { cat = 8; } } else if ((_1 === (24)) || (_1 === (40))) { cat = 8; } return cat; }; Profile.prototype.simplify = function(cat) { return this.$val.simplify(cat); }; validateFromPunycode = function(p, s) { var _r, _tuple, c, i, p, s, sz, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; c = $f.c; i = $f.i; p = $f.p; s = $f.s; sz = $f.sz; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = new norm.Form(0).IsNormalString(s); /* */ $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: $s = -1; return new labelError.ptr(s, "V1"); /* } */ case 2: i = 0; while (true) { if (!(i < s.length)) { break; } _tuple = trie.lookupString($substring(s, i)); v = _tuple[0]; sz = _tuple[1]; if (sz === 0) { $s = -1; return new runeError(65533); } c = p.simplify(new info(((v << 16 >>> 16))).category()); if (!((c === 8)) && !((c === 3))) { $s = -1; return new labelError.ptr(s, "V6"); } i = i + (sz) >> 0; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: validateFromPunycode }; } $f._r = _r; $f._tuple = _tuple; $f.c = c; $f.i = i; $f.p = p; $f.s = s; $f.sz = sz; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Profile.ptr.prototype.validateLabel = function(s) { var _tuple, _tuple$1, err, i, jt, p, s, st, sz, trie$1, v, x, x$1; err = $ifaceNil; p = this; if (s === "") { if (p.options.verifyDNSLength) { err = new labelError.ptr(s, "A4"); return err; } err = $ifaceNil; return err; } if (p.options.checkHyphens) { if (s.length > 4 && (s.charCodeAt(2) === 45) && (s.charCodeAt(3) === 45)) { err = new labelError.ptr(s, "V2"); return err; } if ((s.charCodeAt(0) === 45) || (s.charCodeAt((s.length - 1 >> 0)) === 45)) { err = new labelError.ptr(s, "V3"); return err; } } if (!p.options.checkJoiners) { err = $ifaceNil; return err; } trie$1 = p.options.trie; _tuple = trie$1.lookupString(s); v = _tuple[0]; sz = _tuple[1]; x = ((v << 16 >>> 16)); if (new info(x).isModifier()) { err = new labelError.ptr(s, "V5"); return err; } if ((strings.Index(s, "\xE2\x80\x8D") === -1) && (strings.Index(s, "\xE2\x80\x8C") === -1)) { err = $ifaceNil; return err; } st = 0; i = 0; while (true) { jt = new info(x).joinType(); if ($substring(s, i, (i + sz >> 0)) === "\xE2\x80\x8D") { jt = 5; } else if ($substring(s, i, (i + sz >> 0)) === "\xE2\x80\x8C") { jt = 6; } st = (x$1 = ((st < 0 || st >= joinStates.$length) ? ($throwRuntimeError("index out of range"), undefined) : joinStates.$array[joinStates.$offset + st]), ((jt < 0 || jt >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[jt])); if (new info(x).isViramaModifier()) { st = ((st < 0 || st >= joinStates.$length) ? ($throwRuntimeError("index out of range"), undefined) : joinStates.$array[joinStates.$offset + st])[7]; } i = i + (sz) >> 0; if (i === s.length) { break; } _tuple$1 = trie$1.lookupString($substring(s, i)); v = _tuple$1[0]; sz = _tuple$1[1]; x = ((v << 16 >>> 16)); } if ((st === 5) || (st === 4)) { err = new labelError.ptr(s, "C"); return err; } err = $ifaceNil; return err; }; Profile.prototype.validateLabel = function(s) { return this.$val.validateLabel(s); }; ascii = function(s) { var i, s; i = 0; while (true) { if (!(i < s.length)) { break; } if (s.charCodeAt(i) >= 128) { return false; } i = i + (1) >> 0; } return true; }; info.methods = [{prop: "isMapped", name: "isMapped", pkg: "vendor/golang.org/x/net/idna", typ: $funcType([], [$Bool], false)}, {prop: "category", name: "category", pkg: "vendor/golang.org/x/net/idna", typ: $funcType([], [category], false)}, {prop: "joinType", name: "joinType", pkg: "vendor/golang.org/x/net/idna", typ: $funcType([], [info], false)}, {prop: "isModifier", name: "isModifier", pkg: "vendor/golang.org/x/net/idna", typ: $funcType([], [$Bool], false)}, {prop: "isViramaModifier", name: "isViramaModifier", pkg: "vendor/golang.org/x/net/idna", typ: $funcType([], [$Bool], false)}, {prop: "appendMapping", name: "appendMapping", pkg: "vendor/golang.org/x/net/idna", typ: $funcType([sliceType$4, $String], [sliceType$4], false)}, {prop: "isBidi", name: "isBidi", pkg: "vendor/golang.org/x/net/idna", typ: $funcType([$String], [$Bool], false)}]; ptrType$1.methods = [{prop: "lookup", name: "lookup", pkg: "vendor/golang.org/x/net/idna", typ: $funcType([$Uint32, $Uint8], [$Uint16], false)}]; ptrType.methods = [{prop: "lookup", name: "lookup", pkg: "vendor/golang.org/x/net/idna", typ: $funcType([sliceType$4], [$Uint16, $Int], false)}, {prop: "lookupUnsafe", name: "lookupUnsafe", pkg: "vendor/golang.org/x/net/idna", typ: $funcType([sliceType$4], [$Uint16], false)}, {prop: "lookupString", name: "lookupString", pkg: "vendor/golang.org/x/net/idna", typ: $funcType([$String], [$Uint16, $Int], false)}, {prop: "lookupStringUnsafe", name: "lookupStringUnsafe", pkg: "vendor/golang.org/x/net/idna", typ: $funcType([$String], [$Uint16], false)}, {prop: "lookupValue", name: "lookupValue", pkg: "vendor/golang.org/x/net/idna", typ: $funcType([$Uint32, $Uint8], [$Uint16], false)}]; ptrType$3.methods = [{prop: "ToASCII", name: "ToASCII", pkg: "", typ: $funcType([$String], [$String, $error], false)}, {prop: "ToUnicode", name: "ToUnicode", pkg: "", typ: $funcType([$String], [$String, $error], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "process", name: "process", pkg: "vendor/golang.org/x/net/idna", typ: $funcType([$String, $Bool], [$String, $error], false)}, {prop: "simplify", name: "simplify", pkg: "vendor/golang.org/x/net/idna", typ: $funcType([category], [category], false)}, {prop: "validateLabel", name: "validateLabel", pkg: "vendor/golang.org/x/net/idna", typ: $funcType([$String], [$error], false)}]; labelError.methods = [{prop: "code", name: "code", pkg: "vendor/golang.org/x/net/idna", typ: $funcType([], [$String], false)}, {prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; runeError.methods = [{prop: "code", name: "code", pkg: "vendor/golang.org/x/net/idna", typ: $funcType([], [$String], false)}, {prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$4.methods = [{prop: "reset", name: "reset", pkg: "vendor/golang.org/x/net/idna", typ: $funcType([], [], false)}, {prop: "done", name: "done", pkg: "vendor/golang.org/x/net/idna", typ: $funcType([], [$Bool], false)}, {prop: "result", name: "result", pkg: "vendor/golang.org/x/net/idna", typ: $funcType([], [$String], false)}, {prop: "label", name: "label", pkg: "vendor/golang.org/x/net/idna", typ: $funcType([], [$String], false)}, {prop: "next", name: "next", pkg: "vendor/golang.org/x/net/idna", typ: $funcType([], [], false)}, {prop: "set", name: "set", pkg: "vendor/golang.org/x/net/idna", typ: $funcType([$String], [], false)}]; valueRange.init("vendor/golang.org/x/net/idna", [{prop: "value", name: "value", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "lo", name: "lo", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "hi", name: "hi", embedded: false, exported: false, typ: $Uint8, tag: ""}]); sparseBlocks.init("vendor/golang.org/x/net/idna", [{prop: "values", name: "values", embedded: false, exported: false, typ: sliceType$1, tag: ""}, {prop: "offset", name: "offset", embedded: false, exported: false, typ: sliceType, tag: ""}]); idnaTrie.init("", []); options.init("vendor/golang.org/x/net/idna", [{prop: "transitional", name: "transitional", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "useSTD3Rules", name: "useSTD3Rules", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "checkHyphens", name: "checkHyphens", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "checkJoiners", name: "checkJoiners", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "verifyDNSLength", name: "verifyDNSLength", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "removeLeadingDots", name: "removeLeadingDots", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "trie", name: "trie", embedded: false, exported: false, typ: ptrType, tag: ""}, {prop: "fromPuny", name: "fromPuny", embedded: false, exported: false, typ: funcType, tag: ""}, {prop: "mapping", name: "mapping", embedded: false, exported: false, typ: funcType$1, tag: ""}, {prop: "bidirule", name: "bidirule", embedded: false, exported: false, typ: funcType$2, tag: ""}]); Profile.init("vendor/golang.org/x/net/idna", [{prop: "options", name: "options", embedded: true, exported: false, typ: options, tag: ""}]); labelError.init("vendor/golang.org/x/net/idna", [{prop: "label", name: "label", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "code_", name: "code_", embedded: false, exported: false, typ: $String, tag: ""}]); labelIter.init("vendor/golang.org/x/net/idna", [{prop: "orig", name: "orig", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "slice", name: "slice", embedded: false, exported: false, typ: sliceType$6, tag: ""}, {prop: "curStart", name: "curStart", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "curEnd", name: "curEnd", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "i", name: "i", embedded: false, exported: false, 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 = fmt.$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 = strings.$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; } $r = bidirule.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = bidi.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = norm.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } trie = new idnaTrie.ptr(); mappings = "\x00\x01 \x03 \xCC\x88\x01a\x03 \xCC\x84\x012\x013\x03 \xCC\x81\x03 \xCC\xA7\x011\x01o\x051\xE2\x81\x844\x051\xE2\x81\x842\x053\xE2\x81\x844\x03i\xCC\x87\x03l\xC2\xB7\x03\xCA\xBCn\x01s\x03d\xC5\xBE\x03\xE2\xB1\xA5\x03\xE2\xB1\xA6\x01h\x01j\x01r\x01w\x01y\x03 \xCC\x86\x03 \xCC\x87\x03 \xCC\x8A\x03 \xCC\xA8\x03 \xCC\x83\x03 \xCC\x8B\x01l\x01x\x04\xCC\x88\xCC\x81\x03 \xCE\xB9\x01;\x05 \xCC\x88\xCC\x81\x04\xD5\xA5\xD6\x82\x04\xD8\xA7\xD9\xB4\x04\xD9\x88\xD9\xB4\x04\xDB\x87\xD9\xB4\x04\xD9\x8A\xD9\xB4\x06\xE0\xA4\x95\xE0\xA4\xBC\x06\xE0\xA4\x96\xE0\xA4\xBC\x06\xE0\xA4\x97\xE0\xA4\xBC\x06\xE0\xA4\x9C\xE0\xA4\xBC\x06\xE0\xA4\xA1\xE0\xA4\xBC\x06\xE0\xA4\xA2\xE0\xA4\xBC\x06\xE0\xA4\xAB\xE0\xA4\xBC\x06\xE0\xA4\xAF\xE0\xA4\xBC\x06\xE0\xA6\xA1\xE0\xA6\xBC\x06\xE0\xA6\xA2\xE0\xA6\xBC\x06\xE0\xA6\xAF\xE0\xA6\xBC\x06\xE0\xA8\xB2\xE0\xA8\xBC\x06\xE0\xA8\xB8\xE0\xA8\xBC\x06\xE0\xA8\x96\xE0\xA8\xBC\x06\xE0\xA8\x97\xE0\xA8\xBC\x06\xE0\xA8\x9C\xE0\xA8\xBC\x06\xE0\xA8\xAB\xE0\xA8\xBC\x06\xE0\xAC\xA1\xE0\xAC\xBC\x06\xE0\xAC\xA2\xE0\xAC\xBC\x06\xE0\xB9\x8D\xE0\xB8\xB2\x06\xE0\xBB\x8D\xE0\xBA\xB2\x06\xE0\xBA\xAB\xE0\xBA\x99\x06\xE0\xBA\xAB\xE0\xBA\xA1\x06\xE0\xBD\x82\xE0\xBE\xB7\x06\xE0\xBD\x8C\xE0\xBE\xB7\x06\xE0\xBD\x91\xE0\xBE\xB7\x06\xE0\xBD\x96\xE0\xBE\xB7\x06\xE0\xBD\x9B\xE0\xBE\xB7\x06\xE0\xBD\x80\xE0\xBE\xB5\x06\xE0\xBD\xB1\xE0\xBD\xB2\x06\xE0\xBD\xB1\xE0\xBD\xB4\x06\xE0\xBE\xB2\xE0\xBE\x80\t\xE0\xBE\xB2\xE0\xBD\xB1\xE0\xBE\x80\x06\xE0\xBE\xB3\xE0\xBE\x80\t\xE0\xBE\xB3\xE0\xBD\xB1\xE0\xBE\x80\x06\xE0\xBD\xB1\xE0\xBE\x80\x06\xE0\xBE\x92\xE0\xBE\xB7\x06\xE0\xBE\x9C\xE0\xBE\xB7\x06\xE0\xBE\xA1\xE0\xBE\xB7\x06\xE0\xBE\xA6\xE0\xBE\xB7\x06\xE0\xBE\xAB\xE0\xBE\xB7\x06\xE0\xBE\x90\xE0\xBE\xB5\x02\xD0\xB2\x02\xD0\xB4\x02\xD0\xBE\x02\xD1\x81\x02\xD1\x82\x02\xD1\x8A\x02\xD1\xA3\x02\xC3\xA6\x01b\x01d\x01e\x02\xC7\x9D\x01g\x01i\x01k\x01m\x01n\x02\xC8\xA3\x01p\x01t\x01u\x02\xC9\x90\x02\xC9\x91\x02\xC9\x99\x02\xC9\x9B\x02\xC9\x9C\x02\xC5\x8B\x02\xC9\x94\x02\xC9\xAF\x01v\x02\xCE\xB2\x02\xCE\xB3\x02\xCE\xB4\x02\xCF\x86\x02\xCF\x87\x02\xCF\x81\x02\xD0\xBD\x02\xC9\x92\x01c\x02\xC9\x95\x02\xC3\xB0\x01f\x02\xC9\x9F\x02\xC9\xA1\x02\xC9\xA5\x02\xC9\xA8\x02\xC9\xA9\x02\xC9\xAA\x02\xCA\x9D\x02\xC9\xAD\x02\xCA\x9F\x02\xC9\xB1\x02\xC9\xB0\x02\xC9\xB2\x02\xC9\xB3\x02\xC9\xB4\x02\xC9\xB5\x02\xC9\xB8\x02\xCA\x82\x02\xCA\x83\x02\xC6\xAB\x02\xCA\x89\x02\xCA\x8A\x02\xCA\x8B\x02\xCA\x8C\x01z\x02\xCA\x90\x02\xCA\x91\x02\xCA\x92\x02\xCE\xB8\x02ss\x02\xCE\xAC\x02\xCE\xAD\x02\xCE\xAE\x02\xCE\xAF\x02\xCF\x8C\x02\xCF\x8D\x02\xCF\x8E\x05\xE1\xBC\x80\xCE\xB9\x05\xE1\xBC\x81\xCE\xB9\x05\xE1\xBC\x82\xCE\xB9\x05\xE1\xBC\x83\xCE\xB9\x05\xE1\xBC\x84\xCE\xB9\x05\xE1\xBC\x85\xCE\xB9\x05\xE1\xBC\x86\xCE\xB9\x05\xE1\xBC\x87\xCE\xB9\x05\xE1\xBC\xA0\xCE\xB9\x05\xE1\xBC\xA1\xCE\xB9\x05\xE1\xBC\xA2\xCE\xB9\x05\xE1\xBC\xA3\xCE\xB9\x05\xE1\xBC\xA4\xCE\xB9\x05\xE1\xBC\xA5\xCE\xB9\x05\xE1\xBC\xA6\xCE\xB9\x05\xE1\xBC\xA7\xCE\xB9\x05\xE1\xBD\xA0\xCE\xB9\x05\xE1\xBD\xA1\xCE\xB9\x05\xE1\xBD\xA2\xCE\xB9\x05\xE1\xBD\xA3\xCE\xB9\x05\xE1\xBD\xA4\xCE\xB9\x05\xE1\xBD\xA5\xCE\xB9\x05\xE1\xBD\xA6\xCE\xB9\x05\xE1\xBD\xA7\xCE\xB9\x05\xE1\xBD\xB0\xCE\xB9\x04\xCE\xB1\xCE\xB9\x04\xCE\xAC\xCE\xB9\x05\xE1\xBE\xB6\xCE\xB9\x02\xCE\xB9\x05 \xCC\x88\xCD\x82\x05\xE1\xBD\xB4\xCE\xB9\x04\xCE\xB7\xCE\xB9\x04\xCE\xAE\xCE\xB9\x05\xE1\xBF\x86\xCE\xB9\x05 \xCC\x93\xCC\x80\x05 \xCC\x93\xCC\x81\x05 \xCC\x93\xCD\x82\x02\xCE\x90\x05 \xCC\x94\xCC\x80\x05 \xCC\x94\xCC\x81\x05 \xCC\x94\xCD\x82\x02\xCE\xB0\x05 \xCC\x88\xCC\x80\x01`\x05\xE1\xBD\xBC\xCE\xB9\x04\xCF\x89\xCE\xB9\x04\xCF\x8E\xCE\xB9\x05\xE1\xBF\xB6\xCE\xB9\x06\xE2\x80\xB2\xE2\x80\xB2\t\xE2\x80\xB2\xE2\x80\xB2\xE2\x80\xB2\x06\xE2\x80\xB5\xE2\x80\xB5\t\xE2\x80\xB5\xE2\x80\xB5\xE2\x80\xB5\x02!!\x02??\x02?!\x02!?\f\xE2\x80\xB2\xE2\x80\xB2\xE2\x80\xB2\xE2\x80\xB2\x010\x014\x015\x016\x017\x018\x019\x01+\x01=\x01(\x01)\x02rs\x02\xC4\xA7\x02no\x01q\x02sm\x02tm\x02\xCF\x89\x02\xC3\xA5\x02\xD7\x90\x02\xD7\x91\x02\xD7\x92\x02\xD7\x93\x02\xCF\x80\x051\xE2\x81\x847\x051\xE2\x81\x849\x061\xE2\x81\x8410\x051\xE2\x81\x843\x052\xE2\x81\x843\x051\xE2\x81\x845\x052\xE2\x81\x845\x053\xE2\x81\x845\x054\xE2\x81\x845\x051\xE2\x81\x846\x055\xE2\x81\x846\x051\xE2\x81\x848\x053\xE2\x81\x848\x055\xE2\x81\x848\x057\xE2\x81\x848\x041\xE2\x81\x84\x02ii\x02iv\x02vi\x04viii\x02ix\x02xi\x050\xE2\x81\x843\x06\xE2\x88\xAB\xE2\x88\xAB\t\xE2\x88\xAB\xE2\x88\xAB\xE2\x88\xAB\x06\xE2\x88\xAE\xE2\x88\xAE\t\xE2\x88\xAE\xE2\x88\xAE\xE2\x88\xAE\x0210\x0211\x0212\x0213\x0214\x0215\x0216\x0217\x0218\x0219\x0220\x04(10)\x04(11)\x04(12)\x04(13)\x04(14)\x04(15)\x04(16)\x04(17)\x04(18)\x04(19)\x04(20)\f\xE2\x88\xAB\xE2\x88\xAB\xE2\x88\xAB\xE2\x88\xAB\x02==\x05\xE2\xAB\x9D\xCC\xB8\x02\xC9\xAB\x02\xC9\xBD\x02\xC8\xBF\x02\xC9\x80\x01.\x04 \xE3\x82\x99\x04 \xE3\x82\x9A\x06\xE3\x82\x88\xE3\x82\x8A\x06\xE3\x82\xB3\xE3\x83\x88\x05(\xE1\x84\x80)\x05(\xE1\x84\x82)\x05(\xE1\x84\x83)\x05(\xE1\x84\x85)\x05(\xE1\x84\x86)\x05(\xE1\x84\x87)\x05(\xE1\x84\x89)\x05(\xE1\x84\x8B)\x05(\xE1\x84\x8C)\x05(\xE1\x84\x8E)\x05(\xE1\x84\x8F)\x05(\xE1\x84\x90)\x05(\xE1\x84\x91)\x05(\xE1\x84\x92)\x05(\xEA\xB0\x80)\x05(\xEB\x82\x98)\x05(\xEB\x8B\xA4)\x05(\xEB\x9D\xBC)\x05(\xEB\xA7\x88)\x05(\xEB\xB0\x94)\x05(\xEC\x82\xAC)\x05(\xEC\x95\x84)\x05(\xEC\x9E\x90)\x05(\xEC\xB0\xA8)\x05(\xEC\xB9\xB4)\x05(\xED\x83\x80)\x05(\xED\x8C\x8C)\x05(\xED\x95\x98)\x05(\xEC\xA3\xBC)\b(\xEC\x98\xA4\xEC\xA0\x84)\b(\xEC\x98\xA4\xED\x9B\x84)\x05(\xE4\xB8\x80)\x05(\xE4\xBA\x8C)\x05(\xE4\xB8\x89)\x05(\xE5\x9B\x9B)\x05(\xE4\xBA\x94)\x05(\xE5\x85\xAD)\x05(\xE4\xB8\x83)\x05(\xE5\x85\xAB)\x05(\xE4\xB9\x9D)\x05(\xE5\x8D\x81)\x05(\xE6\x9C\x88)\x05(\xE7\x81\xAB)\x05(\xE6\xB0\xB4)\x05(\xE6\x9C\xA8)\x05(\xE9\x87\x91)\x05(\xE5\x9C\x9F)\x05(\xE6\x97\xA5)\x05(\xE6\xA0\xAA)\x05(\xE6\x9C\x89)\x05(\xE7\xA4\xBE)\x05(\xE5\x90\x8D)\x05(\xE7\x89\xB9)\x05(\xE8\xB2\xA1)\x05(\xE7\xA5\x9D)\x05(\xE5\x8A\xB4)\x05(\xE4\xBB\xA3)\x05(\xE5\x91\xBC)\x05(\xE5\xAD\xA6)\x05(\xE7\x9B\xA3)\x05(\xE4\xBC\x81)\x05(\xE8\xB3\x87)\x05(\xE5\x8D\x94)\x05(\xE7\xA5\xAD)\x05(\xE4\xBC\x91)\x05(\xE8\x87\xAA)\x05(\xE8\x87\xB3)\x0221\x0222\x0223\x0224\x0225\x0226\x0227\x0228\x0229\x0230\x0231\x0232\x0233\x0234\x0235\x06\xEC\xB0\xB8\xEA\xB3\xA0\x06\xEC\xA3\xBC\xEC\x9D\x98\x0236\x0237\x0238\x0239\x0240\x0241\x0242\x0243\x0244\x0245\x0246\x0247\x0248\x0249\x0250\x041\xE6\x9C\x88\x042\xE6\x9C\x88\x043\xE6\x9C\x88\x044\xE6\x9C\x88\x045\xE6\x9C\x88\x046\xE6\x9C\x88\x047\xE6\x9C\x88\x048\xE6\x9C\x88\x049\xE6\x9C\x88\x0510\xE6\x9C\x88\x0511\xE6\x9C\x88\x0512\xE6\x9C\x88\x02hg\x02ev\x06\xE4\xBB\xA4\xE5\x92\x8C\f\xE3\x82\xA2\xE3\x83\x91\xE3\x83\xBC\xE3\x83\x88\f\xE3\x82\xA2\xE3\x83\xAB\xE3\x83\x95\xE3\x82\xA1\f\xE3\x82\xA2\xE3\x83\xB3\xE3\x83\x9A\xE3\x82\xA2\t\xE3\x82\xA2\xE3\x83\xBC\xE3\x83\xAB\f\xE3\x82\xA4\xE3\x83\x8B\xE3\x83\xB3\xE3\x82\xB0\t\xE3\x82\xA4\xE3\x83\xB3\xE3\x83\x81\t\xE3\x82\xA6\xE3\x82\xA9\xE3\x83\xB3\x0F\xE3\x82\xA8\xE3\x82\xB9\xE3\x82\xAF\xE3\x83\xBC\xE3\x83\x89\f\xE3\x82\xA8\xE3\x83\xBC\xE3\x82\xAB\xE3\x83\xBC\t\xE3\x82\xAA\xE3\x83\xB3\xE3\x82\xB9\t\xE3\x82\xAA\xE3\x83\xBC\xE3\x83\xA0\t\xE3\x82\xAB\xE3\x82\xA4\xE3\x83\xAA\f\xE3\x82\xAB\xE3\x83\xA9\xE3\x83\x83\xE3\x83\x88\f\xE3\x82\xAB\xE3\x83\xAD\xE3\x83\xAA\xE3\x83\xBC\t\xE3\x82\xAC\xE3\x83\xAD\xE3\x83\xB3\t\xE3\x82\xAC\xE3\x83\xB3\xE3\x83\x9E\x06\xE3\x82\xAE\xE3\x82\xAC\t\xE3\x82\xAE\xE3\x83\x8B\xE3\x83\xBC\f\xE3\x82\xAD\xE3\x83\xA5\xE3\x83\xAA\xE3\x83\xBC\f\xE3\x82\xAE\xE3\x83\xAB\xE3\x83\x80\xE3\x83\xBC\x06\xE3\x82\xAD\xE3\x83\xAD\x0F\xE3\x82\xAD\xE3\x83\xAD\xE3\x82\xB0\xE3\x83\xA9\xE3\x83\xA0\x12\xE3\x82\xAD\xE3\x83\xAD\xE3\x83\xA1\xE3\x83\xBC\xE3\x83\x88\xE3\x83\xAB\x0F\xE3\x82\xAD\xE3\x83\xAD\xE3\x83\xAF\xE3\x83\x83\xE3\x83\x88\t\xE3\x82\xB0\xE3\x83\xA9\xE3\x83\xA0\x0F\xE3\x82\xB0\xE3\x83\xA9\xE3\x83\xA0\xE3\x83\x88\xE3\x83\xB3\x0F\xE3\x82\xAF\xE3\x83\xAB\xE3\x82\xBC\xE3\x82\xA4\xE3\x83\xAD\f\xE3\x82\xAF\xE3\x83\xAD\xE3\x83\xBC\xE3\x83\x8D\t\xE3\x82\xB1\xE3\x83\xBC\xE3\x82\xB9\t\xE3\x82\xB3\xE3\x83\xAB\xE3\x83\x8A\t\xE3\x82\xB3\xE3\x83\xBC\xE3\x83\x9D\f\xE3\x82\xB5\xE3\x82\xA4\xE3\x82\xAF\xE3\x83\xAB\x0F\xE3\x82\xB5\xE3\x83\xB3\xE3\x83\x81\xE3\x83\xBC\xE3\x83\xA0\f\xE3\x82\xB7\xE3\x83\xAA\xE3\x83\xB3\xE3\x82\xB0\t\xE3\x82\xBB\xE3\x83\xB3\xE3\x83\x81\t\xE3\x82\xBB\xE3\x83\xB3\xE3\x83\x88\t\xE3\x83\x80\xE3\x83\xBC\xE3\x82\xB9\x06\xE3\x83\x87\xE3\x82\xB7\x06\xE3\x83\x89\xE3\x83\xAB\x06\xE3\x83\x88\xE3\x83\xB3\x06\xE3\x83\x8A\xE3\x83\x8E\t\xE3\x83\x8E\xE3\x83\x83\xE3\x83\x88\t\xE3\x83\x8F\xE3\x82\xA4\xE3\x83\x84\x0F\xE3\x83\x91\xE3\x83\xBC\xE3\x82\xBB\xE3\x83\xB3\xE3\x83\x88\t\xE3\x83\x91\xE3\x83\xBC\xE3\x83\x84\f\xE3\x83\x90\xE3\x83\xBC\xE3\x83\xAC\xE3\x83\xAB\x0F\xE3\x83\x94\xE3\x82\xA2\xE3\x82\xB9\xE3\x83\x88\xE3\x83\xAB\t\xE3\x83\x94\xE3\x82\xAF\xE3\x83\xAB\x06\xE3\x83\x94\xE3\x82\xB3\x06\xE3\x83\x93\xE3\x83\xAB\x0F\xE3\x83\x95\xE3\x82\xA1\xE3\x83\xA9\xE3\x83\x83\xE3\x83\x89\f\xE3\x83\x95\xE3\x82\xA3\xE3\x83\xBC\xE3\x83\x88\x0F\xE3\x83\x96\xE3\x83\x83\xE3\x82\xB7\xE3\x82\xA7\xE3\x83\xAB\t\xE3\x83\x95\xE3\x83\xA9\xE3\x83\xB3\x0F\xE3\x83\x98\xE3\x82\xAF\xE3\x82\xBF\xE3\x83\xBC\xE3\x83\xAB\x06\xE3\x83\x9A\xE3\x82\xBD\t\xE3\x83\x9A\xE3\x83\x8B\xE3\x83\x92\t\xE3\x83\x98\xE3\x83\xAB\xE3\x83\x84\t\xE3\x83\x9A\xE3\x83\xB3\xE3\x82\xB9\t\xE3\x83\x9A\xE3\x83\xBC\xE3\x82\xB8\t\xE3\x83\x99\xE3\x83\xBC\xE3\x82\xBF\f\xE3\x83\x9D\xE3\x82\xA4\xE3\x83\xB3\xE3\x83\x88\t\xE3\x83\x9C\xE3\x83\xAB\xE3\x83\x88\x06\xE3\x83\x9B\xE3\x83\xB3\t\xE3\x83\x9D\xE3\x83\xB3\xE3\x83\x89\t\xE3\x83\x9B\xE3\x83\xBC\xE3\x83\xAB\t\xE3\x83\x9B\xE3\x83\xBC\xE3\x83\xB3\f\xE3\x83\x9E\xE3\x82\xA4\xE3\x82\xAF\xE3\x83\xAD\t\xE3\x83\x9E\xE3\x82\xA4\xE3\x83\xAB\t\xE3\x83\x9E\xE3\x83\x83\xE3\x83\x8F\t\xE3\x83\x9E\xE3\x83\xAB\xE3\x82\xAF\x0F\xE3\x83\x9E\xE3\x83\xB3\xE3\x82\xB7\xE3\x83\xA7\xE3\x83\xB3\f\xE3\x83\x9F\xE3\x82\xAF\xE3\x83\xAD\xE3\x83\xB3\x06\xE3\x83\x9F\xE3\x83\xAA\x0F\xE3\x83\x9F\xE3\x83\xAA\xE3\x83\x90\xE3\x83\xBC\xE3\x83\xAB\x06\xE3\x83\xA1\xE3\x82\xAC\f\xE3\x83\xA1\xE3\x82\xAC\xE3\x83\x88\xE3\x83\xB3\f\xE3\x83\xA1\xE3\x83\xBC\xE3\x83\x88\xE3\x83\xAB\t\xE3\x83\xA4\xE3\x83\xBC\xE3\x83\x89\t\xE3\x83\xA4\xE3\x83\xBC\xE3\x83\xAB\t\xE3\x83\xA6\xE3\x82\xA2\xE3\x83\xB3\f\xE3\x83\xAA\xE3\x83\x83\xE3\x83\x88\xE3\x83\xAB\x06\xE3\x83\xAA\xE3\x83\xA9\t\xE3\x83\xAB\xE3\x83\x94\xE3\x83\xBC\f\xE3\x83\xAB\xE3\x83\xBC\xE3\x83\x96\xE3\x83\xAB\x06\xE3\x83\xAC\xE3\x83\xA0\x0F\xE3\x83\xAC\xE3\x83\xB3\xE3\x83\x88\xE3\x82\xB2\xE3\x83\xB3\t\xE3\x83\xAF\xE3\x83\x83\xE3\x83\x88\x040\xE7\x82\xB9\x041\xE7\x82\xB9\x042\xE7\x82\xB9\x043\xE7\x82\xB9\x044\xE7\x82\xB9\x045\xE7\x82\xB9\x046\xE7\x82\xB9\x047\xE7\x82\xB9\x048\xE7\x82\xB9\x049\xE7\x82\xB9\x0510\xE7\x82\xB9\x0511\xE7\x82\xB9\x0512\xE7\x82\xB9\x0513\xE7\x82\xB9\x0514\xE7\x82\xB9\x0515\xE7\x82\xB9\x0516\xE7\x82\xB9\x0517\xE7\x82\xB9\x0518\xE7\x82\xB9\x0519\xE7\x82\xB9\x0520\xE7\x82\xB9\x0521\xE7\x82\xB9\x0522\xE7\x82\xB9\x0523\xE7\x82\xB9\x0524\xE7\x82\xB9\x02da\x02au\x02ov\x02pc\x02dm\x02iu\x06\xE5\xB9\xB3\xE6\x88\x90\x06\xE6\x98\xAD\xE5\x92\x8C\x06\xE5\xA4\xA7\xE6\xAD\xA3\x06\xE6\x98\x8E\xE6\xB2\xBB\f\xE6\xA0\xAA\xE5\xBC\x8F\xE4\xBC\x9A\xE7\xA4\xBE\x02pa\x02na\x02ma\x02ka\x02kb\x02mb\x02gb\x04kcal\x02pf\x02nf\x02mg\x02kg\x02hz\x02ml\x02dl\x02kl\x02fm\x02nm\x02mm\x02cm\x02km\x02m2\x02m3\x05m\xE2\x88\x95s\x06m\xE2\x88\x95s2\x07rad\xE2\x88\x95s\brad\xE2\x88\x95s2\x02ps\x02ns\x02ms\x02pv\x02nv\x02mv\x02kv\x02pw\x02nw\x02mw\x02kw\x02bq\x02cc\x02cd\x06c\xE2\x88\x95kg\x02db\x02gy\x02ha\x02hp\x02in\x02kk\x02kt\x02lm\x02ln\x02lx\x02ph\x02pr\x02sr\x02sv\x02wb\x05v\xE2\x88\x95m\x05a\xE2\x88\x95m\x041\xE6\x97\xA5\x042\xE6\x97\xA5\x043\xE6\x97\xA5\x044\xE6\x97\xA5\x045\xE6\x97\xA5\x046\xE6\x97\xA5\x047\xE6\x97\xA5\x048\xE6\x97\xA5\x049\xE6\x97\xA5\x0510\xE6\x97\xA5\x0511\xE6\x97\xA5\x0512\xE6\x97\xA5\x0513\xE6\x97\xA5\x0514\xE6\x97\xA5\x0515\xE6\x97\xA5\x0516\xE6\x97\xA5\x0517\xE6\x97\xA5\x0518\xE6\x97\xA5\x0519\xE6\x97\xA5\x0520\xE6\x97\xA5\x0521\xE6\x97\xA5\x0522\xE6\x97\xA5\x0523\xE6\x97\xA5\x0524\xE6\x97\xA5\x0525\xE6\x97\xA5\x0526\xE6\x97\xA5\x0527\xE6\x97\xA5\x0528\xE6\x97\xA5\x0529\xE6\x97\xA5\x0530\xE6\x97\xA5\x0531\xE6\x97\xA5\x02\xD1\x8C\x02\xC9\xA6\x02\xC9\xAC\x02\xCA\x9E\x02\xCA\x87\x02\xC5\x93\x02\xCA\x8D\x04\xF0\xA4\x8B\xAE\x04\xF0\xA2\xA1\x8A\x04\xF0\xA2\xA1\x84\x04\xF0\xA3\x8F\x95\x04\xF0\xA5\x89\x89\x04\xF0\xA5\xB3\x90\x04\xF0\xA7\xBB\x93\x02ff\x02fi\x02fl\x02st\x04\xD5\xB4\xD5\xB6\x04\xD5\xB4\xD5\xA5\x04\xD5\xB4\xD5\xAB\x04\xD5\xBE\xD5\xB6\x04\xD5\xB4\xD5\xAD\x04\xD7\x99\xD6\xB4\x04\xD7\xB2\xD6\xB7\x02\xD7\xA2\x02\xD7\x94\x02\xD7\x9B\x02\xD7\x9C\x02\xD7\x9D\x02\xD7\xA8\x02\xD7\xAA\x04\xD7\xA9\xD7\x81\x04\xD7\xA9\xD7\x82\x06\xD7\xA9\xD6\xBC\xD7\x81\x06\xD7\xA9\xD6\xBC\xD7\x82\x04\xD7\x90\xD6\xB7\x04\xD7\x90\xD6\xB8\x04\xD7\x90\xD6\xBC\x04\xD7\x91\xD6\xBC\x04\xD7\x92\xD6\xBC\x04\xD7\x93\xD6\xBC\x04\xD7\x94\xD6\xBC\x04\xD7\x95\xD6\xBC\x04\xD7\x96\xD6\xBC\x04\xD7\x98\xD6\xBC\x04\xD7\x99\xD6\xBC\x04\xD7\x9A\xD6\xBC\x04\xD7\x9B\xD6\xBC\x04\xD7\x9C\xD6\xBC\x04\xD7\x9E\xD6\xBC\x04\xD7\xA0\xD6\xBC\x04\xD7\xA1\xD6\xBC\x04\xD7\xA3\xD6\xBC\x04\xD7\xA4\xD6\xBC\x04\xD7\xA6\xD6\xBC\x04\xD7\xA7\xD6\xBC\x04\xD7\xA8\xD6\xBC\x04\xD7\xA9\xD6\xBC\x04\xD7\xAA\xD6\xBC\x04\xD7\x95\xD6\xB9\x04\xD7\x91\xD6\xBF\x04\xD7\x9B\xD6\xBF\x04\xD7\xA4\xD6\xBF\x04\xD7\x90\xD7\x9C\x02\xD9\xB1\x02\xD9\xBB\x02\xD9\xBE\x02\xDA\x80\x02\xD9\xBA\x02\xD9\xBF\x02\xD9\xB9\x02\xDA\xA4\x02\xDA\xA6\x02\xDA\x84\x02\xDA\x83\x02\xDA\x86\x02\xDA\x87\x02\xDA\x8D\x02\xDA\x8C\x02\xDA\x8E\x02\xDA\x88\x02\xDA\x98\x02\xDA\x91\x02\xDA\xA9\x02\xDA\xAF\x02\xDA\xB3\x02\xDA\xB1\x02\xDA\xBA\x02\xDA\xBB\x02\xDB\x80\x02\xDB\x81\x02\xDA\xBE\x02\xDB\x92\x02\xDB\x93\x02\xDA\xAD\x02\xDB\x87\x02\xDB\x86\x02\xDB\x88\x02\xDB\x8B\x02\xDB\x85\x02\xDB\x89\x02\xDB\x90\x02\xD9\x89\x04\xD8\xA6\xD8\xA7\x04\xD8\xA6\xDB\x95\x04\xD8\xA6\xD9\x88\x04\xD8\xA6\xDB\x87\x04\xD8\xA6\xDB\x86\x04\xD8\xA6\xDB\x88\x04\xD8\xA6\xDB\x90\x04\xD8\xA6\xD9\x89\x02\xDB\x8C\x04\xD8\xA6\xD8\xAC\x04\xD8\xA6\xD8\xAD\x04\xD8\xA6\xD9\x85\x04\xD8\xA6\xD9\x8A\x04\xD8\xA8\xD8\xAC\x04\xD8\xA8\xD8\xAD\x04\xD8\xA8\xD8\xAE\x04\xD8\xA8\xD9\x85\x04\xD8\xA8\xD9\x89\x04\xD8\xA8\xD9\x8A\x04\xD8\xAA\xD8\xAC\x04\xD8\xAA\xD8\xAD\x04\xD8\xAA\xD8\xAE\x04\xD8\xAA\xD9\x85\x04\xD8\xAA\xD9\x89\x04\xD8\xAA\xD9\x8A\x04\xD8\xAB\xD8\xAC\x04\xD8\xAB\xD9\x85\x04\xD8\xAB\xD9\x89\x04\xD8\xAB\xD9\x8A\x04\xD8\xAC\xD8\xAD\x04\xD8\xAC\xD9\x85\x04\xD8\xAD\xD8\xAC\x04\xD8\xAD\xD9\x85\x04\xD8\xAE\xD8\xAC\x04\xD8\xAE\xD8\xAD\x04\xD8\xAE\xD9\x85\x04\xD8\xB3\xD8\xAC\x04\xD8\xB3\xD8\xAD\x04\xD8\xB3\xD8\xAE\x04\xD8\xB3\xD9\x85\x04\xD8\xB5\xD8\xAD\x04\xD8\xB5\xD9\x85\x04\xD8\xB6\xD8\xAC\x04\xD8\xB6\xD8\xAD\x04\xD8\xB6\xD8\xAE\x04\xD8\xB6\xD9\x85\x04\xD8\xB7\xD8\xAD\x04\xD8\xB7\xD9\x85\x04\xD8\xB8\xD9\x85\x04\xD8\xB9\xD8\xAC\x04\xD8\xB9\xD9\x85\x04\xD8\xBA\xD8\xAC\x04\xD8\xBA\xD9\x85\x04\xD9\x81\xD8\xAC\x04\xD9\x81\xD8\xAD\x04\xD9\x81\xD8\xAE\x04\xD9\x81\xD9\x85\x04\xD9\x81\xD9\x89\x04\xD9\x81\xD9\x8A\x04\xD9\x82\xD8\xAD\x04\xD9\x82\xD9\x85\x04\xD9\x82\xD9\x89\x04\xD9\x82\xD9\x8A\x04\xD9\x83\xD8\xA7\x04\xD9\x83\xD8\xAC\x04\xD9\x83\xD8\xAD\x04\xD9\x83\xD8\xAE\x04\xD9\x83\xD9\x84\x04\xD9\x83\xD9\x85\x04\xD9\x83\xD9\x89\x04\xD9\x83\xD9\x8A\x04\xD9\x84\xD8\xAC\x04\xD9\x84\xD8\xAD\x04\xD9\x84\xD8\xAE\x04\xD9\x84\xD9\x85\x04\xD9\x84\xD9\x89\x04\xD9\x84\xD9\x8A\x04\xD9\x85\xD8\xAC\x04\xD9\x85\xD8\xAD\x04\xD9\x85\xD8\xAE\x04\xD9\x85\xD9\x85\x04\xD9\x85\xD9\x89\x04\xD9\x85\xD9\x8A\x04\xD9\x86\xD8\xAC\x04\xD9\x86\xD8\xAD\x04\xD9\x86\xD8\xAE\x04\xD9\x86\xD9\x85\x04\xD9\x86\xD9\x89\x04\xD9\x86\xD9\x8A\x04\xD9\x87\xD8\xAC\x04\xD9\x87\xD9\x85\x04\xD9\x87\xD9\x89\x04\xD9\x87\xD9\x8A\x04\xD9\x8A\xD8\xAC\x04\xD9\x8A\xD8\xAD\x04\xD9\x8A\xD8\xAE\x04\xD9\x8A\xD9\x85\x04\xD9\x8A\xD9\x89\x04\xD9\x8A\xD9\x8A\x04\xD8\xB0\xD9\xB0\x04\xD8\xB1\xD9\xB0\x04\xD9\x89\xD9\xB0\x05 \xD9\x8C\xD9\x91\x05 \xD9\x8D\xD9\x91\x05 \xD9\x8E\xD9\x91\x05 \xD9\x8F\xD9\x91\x05 \xD9\x90\xD9\x91\x05 \xD9\x91\xD9\xB0\x04\xD8\xA6\xD8\xB1\x04\xD8\xA6\xD8\xB2\x04\xD8\xA6\xD9\x86\x04\xD8\xA8\xD8\xB1\x04\xD8\xA8\xD8\xB2\x04\xD8\xA8\xD9\x86\x04\xD8\xAA\xD8\xB1\x04\xD8\xAA\xD8\xB2\x04\xD8\xAA\xD9\x86\x04\xD8\xAB\xD8\xB1\x04\xD8\xAB\xD8\xB2\x04\xD8\xAB\xD9\x86\x04\xD9\x85\xD8\xA7\x04\xD9\x86\xD8\xB1\x04\xD9\x86\xD8\xB2\x04\xD9\x86\xD9\x86\x04\xD9\x8A\xD8\xB1\x04\xD9\x8A\xD8\xB2\x04\xD9\x8A\xD9\x86\x04\xD8\xA6\xD8\xAE\x04\xD8\xA6\xD9\x87\x04\xD8\xA8\xD9\x87\x04\xD8\xAA\xD9\x87\x04\xD8\xB5\xD8\xAE\x04\xD9\x84\xD9\x87\x04\xD9\x86\xD9\x87\x04\xD9\x87\xD9\xB0\x04\xD9\x8A\xD9\x87\x04\xD8\xAB\xD9\x87\x04\xD8\xB3\xD9\x87\x04\xD8\xB4\xD9\x85\x04\xD8\xB4\xD9\x87\x06\xD9\x80\xD9\x8E\xD9\x91\x06\xD9\x80\xD9\x8F\xD9\x91\x06\xD9\x80\xD9\x90\xD9\x91\x04\xD8\xB7\xD9\x89\x04\xD8\xB7\xD9\x8A\x04\xD8\xB9\xD9\x89\x04\xD8\xB9\xD9\x8A\x04\xD8\xBA\xD9\x89\x04\xD8\xBA\xD9\x8A\x04\xD8\xB3\xD9\x89\x04\xD8\xB3\xD9\x8A\x04\xD8\xB4\xD9\x89\x04\xD8\xB4\xD9\x8A\x04\xD8\xAD\xD9\x89\x04\xD8\xAD\xD9\x8A\x04\xD8\xAC\xD9\x89\x04\xD8\xAC\xD9\x8A\x04\xD8\xAE\xD9\x89\x04\xD8\xAE\xD9\x8A\x04\xD8\xB5\xD9\x89\x04\xD8\xB5\xD9\x8A\x04\xD8\xB6\xD9\x89\x04\xD8\xB6\xD9\x8A\x04\xD8\xB4\xD8\xAC\x04\xD8\xB4\xD8\xAD\x04\xD8\xB4\xD8\xAE\x04\xD8\xB4\xD8\xB1\x04\xD8\xB3\xD8\xB1\x04\xD8\xB5\xD8\xB1\x04\xD8\xB6\xD8\xB1\x04\xD8\xA7\xD9\x8B\x06\xD8\xAA\xD8\xAC\xD9\x85\x06\xD8\xAA\xD8\xAD\xD8\xAC\x06\xD8\xAA\xD8\xAD\xD9\x85\x06\xD8\xAA\xD8\xAE\xD9\x85\x06\xD8\xAA\xD9\x85\xD8\xAC\x06\xD8\xAA\xD9\x85\xD8\xAD\x06\xD8\xAA\xD9\x85\xD8\xAE\x06\xD8\xAC\xD9\x85\xD8\xAD\x06\xD8\xAD\xD9\x85\xD9\x8A\x06\xD8\xAD\xD9\x85\xD9\x89\x06\xD8\xB3\xD8\xAD\xD8\xAC\x06\xD8\xB3\xD8\xAC\xD8\xAD\x06\xD8\xB3\xD8\xAC\xD9\x89\x06\xD8\xB3\xD9\x85\xD8\xAD\x06\xD8\xB3\xD9\x85\xD8\xAC\x06\xD8\xB3\xD9\x85\xD9\x85\x06\xD8\xB5\xD8\xAD\xD8\xAD\x06\xD8\xB5\xD9\x85\xD9\x85\x06\xD8\xB4\xD8\xAD\xD9\x85\x06\xD8\xB4\xD8\xAC\xD9\x8A\x06\xD8\xB4\xD9\x85\xD8\xAE\x06\xD8\xB4\xD9\x85\xD9\x85\x06\xD8\xB6\xD8\xAD\xD9\x89\x06\xD8\xB6\xD8\xAE\xD9\x85\x06\xD8\xB7\xD9\x85\xD8\xAD\x06\xD8\xB7\xD9\x85\xD9\x85\x06\xD8\xB7\xD9\x85\xD9\x8A\x06\xD8\xB9\xD8\xAC\xD9\x85\x06\xD8\xB9\xD9\x85\xD9\x85\x06\xD8\xB9\xD9\x85\xD9\x89\x06\xD8\xBA\xD9\x85\xD9\x85\x06\xD8\xBA\xD9\x85\xD9\x8A\x06\xD8\xBA\xD9\x85\xD9\x89\x06\xD9\x81\xD8\xAE\xD9\x85\x06\xD9\x82\xD9\x85\xD8\xAD\x06\xD9\x82\xD9\x85\xD9\x85\x06\xD9\x84\xD8\xAD\xD9\x85\x06\xD9\x84\xD8\xAD\xD9\x8A\x06\xD9\x84\xD8\xAD\xD9\x89\x06\xD9\x84\xD8\xAC\xD8\xAC\x06\xD9\x84\xD8\xAE\xD9\x85\x06\xD9\x84\xD9\x85\xD8\xAD\x06\xD9\x85\xD8\xAD\xD8\xAC\x06\xD9\x85\xD8\xAD\xD9\x85\x06\xD9\x85\xD8\xAD\xD9\x8A\x06\xD9\x85\xD8\xAC\xD8\xAD\x06\xD9\x85\xD8\xAC\xD9\x85\x06\xD9\x85\xD8\xAE\xD8\xAC\x06\xD9\x85\xD8\xAE\xD9\x85\x06\xD9\x85\xD8\xAC\xD8\xAE\x06\xD9\x87\xD9\x85\xD8\xAC\x06\xD9\x87\xD9\x85\xD9\x85\x06\xD9\x86\xD8\xAD\xD9\x85\x06\xD9\x86\xD8\xAD\xD9\x89\x06\xD9\x86\xD8\xAC\xD9\x85\x06\xD9\x86\xD8\xAC\xD9\x89\x06\xD9\x86\xD9\x85\xD9\x8A\x06\xD9\x86\xD9\x85\xD9\x89\x06\xD9\x8A\xD9\x85\xD9\x85\x06\xD8\xA8\xD8\xAE\xD9\x8A\x06\xD8\xAA\xD8\xAC\xD9\x8A\x06\xD8\xAA\xD8\xAC\xD9\x89\x06\xD8\xAA\xD8\xAE\xD9\x8A\x06\xD8\xAA\xD8\xAE\xD9\x89\x06\xD8\xAA\xD9\x85\xD9\x8A\x06\xD8\xAA\xD9\x85\xD9\x89\x06\xD8\xAC\xD9\x85\xD9\x8A\x06\xD8\xAC\xD8\xAD\xD9\x89\x06\xD8\xAC\xD9\x85\xD9\x89\x06\xD8\xB3\xD8\xAE\xD9\x89\x06\xD8\xB5\xD8\xAD\xD9\x8A\x06\xD8\xB4\xD8\xAD\xD9\x8A\x06\xD8\xB6\xD8\xAD\xD9\x8A\x06\xD9\x84\xD8\xAC\xD9\x8A\x06\xD9\x84\xD9\x85\xD9\x8A\x06\xD9\x8A\xD8\xAD\xD9\x8A\x06\xD9\x8A\xD8\xAC\xD9\x8A\x06\xD9\x8A\xD9\x85\xD9\x8A\x06\xD9\x85\xD9\x85\xD9\x8A\x06\xD9\x82\xD9\x85\xD9\x8A\x06\xD9\x86\xD8\xAD\xD9\x8A\x06\xD8\xB9\xD9\x85\xD9\x8A\x06\xD9\x83\xD9\x85\xD9\x8A\x06\xD9\x86\xD8\xAC\xD8\xAD\x06\xD9\x85\xD8\xAE\xD9\x8A\x06\xD9\x84\xD8\xAC\xD9\x85\x06\xD9\x83\xD9\x85\xD9\x85\x06\xD8\xAC\xD8\xAD\xD9\x8A\x06\xD8\xAD\xD8\xAC\xD9\x8A\x06\xD9\x85\xD8\xAC\xD9\x8A\x06\xD9\x81\xD9\x85\xD9\x8A\x06\xD8\xA8\xD8\xAD\xD9\x8A\x06\xD8\xB3\xD8\xAE\xD9\x8A\x06\xD9\x86\xD8\xAC\xD9\x8A\x06\xD8\xB5\xD9\x84\xDB\x92\x06\xD9\x82\xD9\x84\xDB\x92\b\xD8\xA7\xD9\x84\xD9\x84\xD9\x87\b\xD8\xA7\xD9\x83\xD8\xA8\xD8\xB1\b\xD9\x85\xD8\xAD\xD9\x85\xD8\xAF\b\xD8\xB5\xD9\x84\xD8\xB9\xD9\x85\b\xD8\xB1\xD8\xB3\xD9\x88\xD9\x84\b\xD8\xB9\xD9\x84\xD9\x8A\xD9\x87\b\xD9\x88\xD8\xB3\xD9\x84\xD9\x85\x06\xD8\xB5\xD9\x84\xD9\x89!\xD8\xB5\xD9\x84\xD9\x89 \xD8\xA7\xD9\x84\xD9\x84\xD9\x87 \xD8\xB9\xD9\x84\xD9\x8A\xD9\x87 \xD9\x88\xD8\xB3\xD9\x84\xD9\x85\x0F\xD8\xAC\xD9\x84 \xD8\xAC\xD9\x84\xD8\xA7\xD9\x84\xD9\x87\b\xD8\xB1\xDB\x8C\xD8\xA7\xD9\x84\x01,\x01:\x01!\x01?\x01_\x01{\x01}\x01[\x01]\x01#\x01&\x01*\x01-\x01<\x01>\x01\\\x01$\x01%\x01@\x04\xD9\x80\xD9\x8B\x04\xD9\x80\xD9\x8E\x04\xD9\x80\xD9\x8F\x04\xD9\x80\xD9\x90\x04\xD9\x80\xD9\x91\x04\xD9\x80\xD9\x92\x02\xD8\xA1\x02\xD8\xA2\x02\xD8\xA3\x02\xD8\xA4\x02\xD8\xA5\x02\xD8\xA6\x02\xD8\xA7\x02\xD8\xA8\x02\xD8\xA9\x02\xD8\xAA\x02\xD8\xAB\x02\xD8\xAC\x02\xD8\xAD\x02\xD8\xAE\x02\xD8\xAF\x02\xD8\xB0\x02\xD8\xB1\x02\xD8\xB2\x02\xD8\xB3\x02\xD8\xB4\x02\xD8\xB5\x02\xD8\xB6\x02\xD8\xB7\x02\xD8\xB8\x02\xD8\xB9\x02\xD8\xBA\x02\xD9\x81\x02\xD9\x82\x02\xD9\x83\x02\xD9\x84\x02\xD9\x85\x02\xD9\x86\x02\xD9\x87\x02\xD9\x88\x02\xD9\x8A\x04\xD9\x84\xD8\xA2\x04\xD9\x84\xD8\xA3\x04\xD9\x84\xD8\xA5\x04\xD9\x84\xD8\xA7\x01\"\x01'\x01/\x01^\x01|\x01~\x02\xC2\xA2\x02\xC2\xA3\x02\xC2\xAC\x02\xC2\xA6\x02\xC2\xA5\b\xF0\x9D\x85\x97\xF0\x9D\x85\xA5\b\xF0\x9D\x85\x98\xF0\x9D\x85\xA5\f\xF0\x9D\x85\x98\xF0\x9D\x85\xA5\xF0\x9D\x85\xAE\f\xF0\x9D\x85\x98\xF0\x9D\x85\xA5\xF0\x9D\x85\xAF\f\xF0\x9D\x85\x98\xF0\x9D\x85\xA5\xF0\x9D\x85\xB0\f\xF0\x9D\x85\x98\xF0\x9D\x85\xA5\xF0\x9D\x85\xB1\f\xF0\x9D\x85\x98\xF0\x9D\x85\xA5\xF0\x9D\x85\xB2\b\xF0\x9D\x86\xB9\xF0\x9D\x85\xA5\b\xF0\x9D\x86\xBA\xF0\x9D\x85\xA5\f\xF0\x9D\x86\xB9\xF0\x9D\x85\xA5\xF0\x9D\x85\xAE\f\xF0\x9D\x86\xBA\xF0\x9D\x85\xA5\xF0\x9D\x85\xAE\f\xF0\x9D\x86\xB9\xF0\x9D\x85\xA5\xF0\x9D\x85\xAF\f\xF0\x9D\x86\xBA\xF0\x9D\x85\xA5\xF0\x9D\x85\xAF\x02\xC4\xB1\x02\xC8\xB7\x02\xCE\xB1\x02\xCE\xB5\x02\xCE\xB6\x02\xCE\xB7\x02\xCE\xBA\x02\xCE\xBB\x02\xCE\xBC\x02\xCE\xBD\x02\xCE\xBE\x02\xCE\xBF\x02\xCF\x83\x02\xCF\x84\x02\xCF\x85\x02\xCF\x88\x03\xE2\x88\x87\x03\xE2\x88\x82\x02\xCF\x9D\x02\xD9\xAE\x02\xDA\xA1\x02\xD9\xAF\x020,\x021,\x022,\x023,\x024,\x025,\x026,\x027,\x028,\x029,\x03(a)\x03(b)\x03(c)\x03(d)\x03(e)\x03(f)\x03(g)\x03(h)\x03(i)\x03(j)\x03(k)\x03(l)\x03(m)\x03(n)\x03(o)\x03(p)\x03(q)\x03(r)\x03(s)\x03(t)\x03(u)\x03(v)\x03(w)\x03(x)\x03(y)\x03(z)\x07\xE3\x80\x94s\xE3\x80\x95\x02wz\x02hv\x02sd\x03ppv\x02wc\x02mc\x02md\x02mr\x02dj\x06\xE3\x81\xBB\xE3\x81\x8B\x06\xE3\x82\xB3\xE3\x82\xB3\x03\xE3\x82\xB5\x03\xE6\x89\x8B\x03\xE5\xAD\x97\x03\xE5\x8F\x8C\x03\xE3\x83\x87\x03\xE4\xBA\x8C\x03\xE5\xA4\x9A\x03\xE8\xA7\xA3\x03\xE5\xA4\xA9\x03\xE4\xBA\xA4\x03\xE6\x98\xA0\x03\xE7\x84\xA1\x03\xE6\x96\x99\x03\xE5\x89\x8D\x03\xE5\xBE\x8C\x03\xE5\x86\x8D\x03\xE6\x96\xB0\x03\xE5\x88\x9D\x03\xE7\xB5\x82\x03\xE7\x94\x9F\x03\xE8\xB2\xA9\x03\xE5\xA3\xB0\x03\xE5\x90\xB9\x03\xE6\xBC\x94\x03\xE6\x8A\x95\x03\xE6\x8D\x95\x03\xE4\xB8\x80\x03\xE4\xB8\x89\x03\xE9\x81\x8A\x03\xE5\xB7\xA6\x03\xE4\xB8\xAD\x03\xE5\x8F\xB3\x03\xE6\x8C\x87\x03\xE8\xB5\xB0\x03\xE6\x89\x93\x03\xE7\xA6\x81\x03\xE7\xA9\xBA\x03\xE5\x90\x88\x03\xE6\xBA\x80\x03\xE6\x9C\x89\x03\xE6\x9C\x88\x03\xE7\x94\xB3\x03\xE5\x89\xB2\x03\xE5\x96\xB6\x03\xE9\x85\x8D\t\xE3\x80\x94\xE6\x9C\xAC\xE3\x80\x95\t\xE3\x80\x94\xE4\xB8\x89\xE3\x80\x95\t\xE3\x80\x94\xE4\xBA\x8C\xE3\x80\x95\t\xE3\x80\x94\xE5\xAE\x89\xE3\x80\x95\t\xE3\x80\x94\xE7\x82\xB9\xE3\x80\x95\t\xE3\x80\x94\xE6\x89\x93\xE3\x80\x95\t\xE3\x80\x94\xE7\x9B\x97\xE3\x80\x95\t\xE3\x80\x94\xE5\x8B\x9D\xE3\x80\x95\t\xE3\x80\x94\xE6\x95\x97\xE3\x80\x95\x03\xE5\xBE\x97\x03\xE5\x8F\xAF\x03\xE4\xB8\xBD\x03\xE4\xB8\xB8\x03\xE4\xB9\x81\x03\xE4\xBD\xA0\x03\xE4\xBE\xAE\x03\xE4\xBE\xBB\x03\xE5\x80\x82\x03\xE5\x81\xBA\x03\xE5\x82\x99\x03\xE5\x83\xA7\x03\xE5\x83\x8F\x03\xE3\x92\x9E\x03\xE5\x85\x8D\x03\xE5\x85\x94\x03\xE5\x85\xA4\x03\xE5\x85\xB7\x03\xE3\x92\xB9\x03\xE5\x85\xA7\x03\xE5\x86\x97\x03\xE5\x86\xA4\x03\xE4\xBB\x8C\x03\xE5\x86\xAC\x03\xE5\x86\xB5\x03\xE5\x87\xB5\x03\xE5\x88\x83\x03\xE3\x93\x9F\x03\xE5\x88\xBB\x03\xE5\x89\x86\x03\xE5\x89\xB7\x03\xE3\x94\x95\x03\xE5\x8B\x87\x03\xE5\x8B\x89\x03\xE5\x8B\xA4\x03\xE5\x8B\xBA\x03\xE5\x8C\x85\x03\xE5\x8C\x86\x03\xE5\x8C\x97\x03\xE5\x8D\x89\x03\xE5\x8D\x91\x03\xE5\x8D\x9A\x03\xE5\x8D\xB3\x03\xE5\x8D\xBD\x03\xE5\x8D\xBF\x03\xE7\x81\xB0\x03\xE5\x8F\x8A\x03\xE5\x8F\x9F\x03\xE5\x8F\xAB\x03\xE5\x8F\xB1\x03\xE5\x90\x86\x03\xE5\x92\x9E\x03\xE5\x90\xB8\x03\xE5\x91\x88\x03\xE5\x91\xA8\x03\xE5\x92\xA2\x03\xE5\x93\xB6\x03\xE5\x94\x90\x03\xE5\x95\x93\x03\xE5\x95\xA3\x03\xE5\x96\x84\x03\xE5\x96\x99\x03\xE5\x96\xAB\x03\xE5\x96\xB3\x03\xE5\x97\x82\x03\xE5\x9C\x96\x03\xE5\x98\x86\x03\xE5\x9C\x97\x03\xE5\x99\x91\x03\xE5\x99\xB4\x03\xE5\x88\x87\x03\xE5\xA3\xAE\x03\xE5\x9F\x8E\x03\xE5\x9F\xB4\x03\xE5\xA0\x8D\x03\xE5\x9E\x8B\x03\xE5\xA0\xB2\x03\xE5\xA0\xB1\x03\xE5\xA2\xAC\x03\xE5\xA3\xB2\x03\xE5\xA3\xB7\x03\xE5\xA4\x86\x03\xE5\xA4\xA2\x03\xE5\xA5\xA2\x03\xE5\xA7\xAC\x03\xE5\xA8\x9B\x03\xE5\xA8\xA7\x03\xE5\xA7\x98\x03\xE5\xA9\xA6\x03\xE3\x9B\xAE\x03\xE5\xAC\x88\x03\xE5\xAC\xBE\x03\xE5\xAF\x83\x03\xE5\xAF\x98\x03\xE5\xAF\xA7\x03\xE5\xAF\xB3\x03\xE5\xAF\xBF\x03\xE5\xB0\x86\x03\xE5\xB0\xA2\x03\xE3\x9E\x81\x03\xE5\xB1\xA0\x03\xE5\xB1\xAE\x03\xE5\xB3\x80\x03\xE5\xB2\x8D\x03\xE5\xB5\x83\x03\xE5\xB5\xAE\x03\xE5\xB5\xAB\x03\xE5\xB5\xBC\x03\xE5\xB7\xA1\x03\xE5\xB7\xA2\x03\xE3\xA0\xAF\x03\xE5\xB7\xBD\x03\xE5\xB8\xA8\x03\xE5\xB8\xBD\x03\xE5\xB9\xA9\x03\xE3\xA1\xA2\x03\xE3\xA1\xBC\x03\xE5\xBA\xB0\x03\xE5\xBA\xB3\x03\xE5\xBA\xB6\x03\xE5\xBB\x8A\x03\xE5\xBB\xBE\x03\xE8\x88\x81\x03\xE5\xBC\xA2\x03\xE3\xA3\x87\x03\xE5\xBD\xA2\x03\xE5\xBD\xAB\x03\xE3\xA3\xA3\x03\xE5\xBE\x9A\x03\xE5\xBF\x8D\x03\xE5\xBF\x97\x03\xE5\xBF\xB9\x03\xE6\x82\x81\x03\xE3\xA4\xBA\x03\xE3\xA4\x9C\x03\xE6\x82\x94\x03\xE6\x83\x87\x03\xE6\x85\x88\x03\xE6\x85\x8C\x03\xE6\x85\x8E\x03\xE6\x85\xBA\x03\xE6\x86\x8E\x03\xE6\x86\xB2\x03\xE6\x86\xA4\x03\xE6\x86\xAF\x03\xE6\x87\x9E\x03\xE6\x87\xB2\x03\xE6\x87\xB6\x03\xE6\x88\x90\x03\xE6\x88\x9B\x03\xE6\x89\x9D\x03\xE6\x8A\xB1\x03\xE6\x8B\x94\x03\xE6\x8D\x90\x03\xE6\x8C\xBD\x03\xE6\x8B\xBC\x03\xE6\x8D\xA8\x03\xE6\x8E\x83\x03\xE6\x8F\xA4\x03\xE6\x90\xA2\x03\xE6\x8F\x85\x03\xE6\x8E\xA9\x03\xE3\xA8\xAE\x03\xE6\x91\xA9\x03\xE6\x91\xBE\x03\xE6\x92\x9D\x03\xE6\x91\xB7\x03\xE3\xA9\xAC\x03\xE6\x95\x8F\x03\xE6\x95\xAC\x03\xE6\x97\xA3\x03\xE6\x9B\xB8\x03\xE6\x99\x89\x03\xE3\xAC\x99\x03\xE6\x9A\x91\x03\xE3\xAC\x88\x03\xE3\xAB\xA4\x03\xE5\x86\x92\x03\xE5\x86\x95\x03\xE6\x9C\x80\x03\xE6\x9A\x9C\x03\xE8\x82\xAD\x03\xE4\x8F\x99\x03\xE6\x9C\x97\x03\xE6\x9C\x9B\x03\xE6\x9C\xA1\x03\xE6\x9D\x9E\x03\xE6\x9D\x93\x03\xE3\xAD\x89\x03\xE6\x9F\xBA\x03\xE6\x9E\x85\x03\xE6\xA1\x92\x03\xE6\xA2\x85\x03\xE6\xA2\x8E\x03\xE6\xA0\x9F\x03\xE6\xA4\x94\x03\xE3\xAE\x9D\x03\xE6\xA5\x82\x03\xE6\xA6\xA3\x03\xE6\xA7\xAA\x03\xE6\xAA\xA8\x03\xE6\xAB\x9B\x03\xE3\xB0\x98\x03\xE6\xAC\xA1\x03\xE6\xAD\x94\x03\xE3\xB1\x8E\x03\xE6\xAD\xB2\x03\xE6\xAE\x9F\x03\xE6\xAE\xBA\x03\xE6\xAE\xBB\x03\xE6\xB1\x8E\x03\xE6\xB2\xBF\x03\xE6\xB3\x8D\x03\xE6\xB1\xA7\x03\xE6\xB4\x96\x03\xE6\xB4\xBE\x03\xE6\xB5\xB7\x03\xE6\xB5\x81\x03\xE6\xB5\xA9\x03\xE6\xB5\xB8\x03\xE6\xB6\x85\x03\xE6\xB4\xB4\x03\xE6\xB8\xAF\x03\xE6\xB9\xAE\x03\xE3\xB4\xB3\x03\xE6\xBB\x8B\x03\xE6\xBB\x87\x03\xE6\xB7\xB9\x03\xE6\xBD\xAE\x03\xE6\xBF\x86\x03\xE7\x80\xB9\x03\xE7\x80\x9E\x03\xE7\x80\x9B\x03\xE3\xB6\x96\x03\xE7\x81\x8A\x03\xE7\x81\xBD\x03\xE7\x81\xB7\x03\xE7\x82\xAD\x03\xE7\x85\x85\x03\xE7\x86\x9C\x03\xE7\x88\xA8\x03\xE7\x88\xB5\x03\xE7\x89\x90\x03\xE7\x8A\x80\x03\xE7\x8A\x95\x03\xE7\x8D\xBA\x03\xE7\x8E\x8B\x03\xE3\xBA\xAC\x03\xE7\x8E\xA5\x03\xE3\xBA\xB8\x03\xE7\x91\x87\x03\xE7\x91\x9C\x03\xE7\x91\xB1\x03\xE7\x92\x85\x03\xE7\x93\x8A\x03\xE3\xBC\x9B\x03\xE7\x94\xA4\x03\xE7\x94\xBE\x03\xE7\x95\xB0\x03\xE7\x98\x90\x03\xE3\xBF\xBC\x03\xE4\x80\x88\x03\xE7\x9B\xB4\x03\xE7\x9C\x9E\x03\xE7\x9C\x9F\x03\xE7\x9D\x8A\x03\xE4\x80\xB9\x03\xE7\x9E\x8B\x03\xE4\x81\x86\x03\xE4\x82\x96\x03\xE7\xA1\x8E\x03\xE7\xA2\x8C\x03\xE7\xA3\x8C\x03\xE4\x83\xA3\x03\xE7\xA5\x96\x03\xE7\xA6\x8F\x03\xE7\xA7\xAB\x03\xE4\x84\xAF\x03\xE7\xA9\x80\x03\xE7\xA9\x8A\x03\xE7\xA9\x8F\x03\xE4\x88\x82\x03\xE7\xAF\x86\x03\xE7\xAF\x89\x03\xE4\x88\xA7\x03\xE7\xB3\x92\x03\xE4\x8A\xA0\x03\xE7\xB3\xA8\x03\xE7\xB3\xA3\x03\xE7\xB4\x80\x03\xE7\xB5\xA3\x03\xE4\x8C\x81\x03\xE7\xB7\x87\x03\xE7\xB8\x82\x03\xE7\xB9\x85\x03\xE4\x8C\xB4\x03\xE4\x8D\x99\x03\xE7\xBD\xBA\x03\xE7\xBE\x95\x03\xE7\xBF\xBA\x03\xE8\x80\x85\x03\xE8\x81\xA0\x03\xE8\x81\xB0\x03\xE4\x8F\x95\x03\xE8\x82\xB2\x03\xE8\x84\x83\x03\xE4\x90\x8B\x03\xE8\x84\xBE\x03\xE5\xAA\xB5\x03\xE8\x88\x84\x03\xE8\xBE\x9E\x03\xE4\x91\xAB\x03\xE8\x8A\x91\x03\xE8\x8A\x8B\x03\xE8\x8A\x9D\x03\xE5\x8A\xB3\x03\xE8\x8A\xB1\x03\xE8\x8A\xB3\x03\xE8\x8A\xBD\x03\xE8\x8B\xA6\x03\xE8\x8B\xA5\x03\xE8\x8C\x9D\x03\xE8\x8D\xA3\x03\xE8\x8E\xAD\x03\xE8\x8C\xA3\x03\xE8\x8E\xBD\x03\xE8\x8F\xA7\x03\xE8\x91\x97\x03\xE8\x8D\x93\x03\xE8\x8F\x8A\x03\xE8\x8F\x8C\x03\xE8\x8F\x9C\x03\xE4\x94\xAB\x03\xE8\x93\xB1\x03\xE8\x93\xB3\x03\xE8\x94\x96\x03\xE8\x95\xA4\x03\xE4\x95\x9D\x03\xE4\x95\xA1\x03\xE4\x95\xAB\x03\xE8\x99\x90\x03\xE8\x99\x9C\x03\xE8\x99\xA7\x03\xE8\x99\xA9\x03\xE8\x9A\xA9\x03\xE8\x9A\x88\x03\xE8\x9C\x8E\x03\xE8\x9B\xA2\x03\xE8\x9D\xB9\x03\xE8\x9C\xA8\x03\xE8\x9D\xAB\x03\xE8\x9E\x86\x03\xE8\x9F\xA1\x03\xE8\xA0\x81\x03\xE4\x97\xB9\x03\xE8\xA1\xA0\x03\xE8\xA1\xA3\x03\xE8\xA3\x97\x03\xE8\xA3\x9E\x03\xE4\x98\xB5\x03\xE8\xA3\xBA\x03\xE3\x92\xBB\x03\xE4\x9A\xBE\x03\xE4\x9B\x87\x03\xE8\xAA\xA0\x03\xE8\xAB\xAD\x03\xE8\xAE\x8A\x03\xE8\xB1\x95\x03\xE8\xB2\xAB\x03\xE8\xB3\x81\x03\xE8\xB4\x9B\x03\xE8\xB5\xB7\x03\xE8\xB7\x8B\x03\xE8\xB6\xBC\x03\xE8\xB7\xB0\x03\xE8\xBB\x94\x03\xE8\xBC\xB8\x03\xE9\x82\x94\x03\xE9\x83\xB1\x03\xE9\x84\x91\x03\xE9\x84\x9B\x03\xE9\x88\xB8\x03\xE9\x8B\x97\x03\xE9\x8B\x98\x03\xE9\x89\xBC\x03\xE9\x8F\xB9\x03\xE9\x90\x95\x03\xE9\x96\x8B\x03\xE4\xA6\x95\x03\xE9\x96\xB7\x03\xE4\xA7\xA6\x03\xE9\x9B\x83\x03\xE5\xB6\xB2\x03\xE9\x9C\xA3\x03\xE4\xA9\xAE\x03\xE4\xA9\xB6\x03\xE9\x9F\xA0\x03\xE4\xAA\xB2\x03\xE9\xA0\x8B\x03\xE9\xA0\xA9\x03\xE9\xA3\xA2\x03\xE4\xAC\xB3\x03\xE9\xA4\xA9\x03\xE9\xA6\xA7\x03\xE9\xA7\x82\x03\xE9\xA7\xBE\x03\xE4\xAF\x8E\x03\xE9\xAC\x92\x03\xE9\xB1\x80\x03\xE9\xB3\xBD\x03\xE4\xB3\x8E\x03\xE4\xB3\xAD\x03\xE9\xB5\xA7\x03\xE4\xB3\xB8\x03\xE9\xBA\xBB\x03\xE4\xB5\x96\x03\xE9\xBB\xB9\x03\xE9\xBB\xBE\x03\xE9\xBC\x85\x03\xE9\xBC\x8F\x03\xE9\xBC\x96\x03\xE9\xBC\xBB"; xorData = "\x02\f\t\x02\xB0\xEC\x02\xAD\xD8\x02\xAD\xD9\x02\x06\x07\x02\x0F\x12\x02\x0F\x1F\x02\x0F\x1D\x02\x01\x13\x02\x0F\x16\x02\x0F\v\x02\x0F3\x02\x0F7\x02\x0F?\x02\x0F/\x02\x0F*\x02\f&\x02\f*\x02\f;\x02\f9\x02\f%\x02\xAB\xED\x02\xAB\xE2\x02\xAB\xE3\x02\xA9\xE0\x02\xA9\xE1\x02\xA9\xE6\x02\xA3\xCB\x02\xA3\xC8\x02\xA3\xC9\x02\x01#\x02\x01\b\x02\x0E>\x02\x0E'\x02\x0F\x03\x02\x03\r\x02\x03\t\x02\x03\x17\x02\x03\x0E\x02\x02\x03\x02\x011\x02\x01\x00\x02\x01\x10\x02\x03<\x02\x07\r\x02\x02\f\x02\f0\x02\x01\x03\x02\x01\x01\x02\x01 \x02\x01\"\x02\x01)\x02\x01\n\x02\x01\f\x02\x02\x06\x02\x02\x02\x02\x03\x10\x03\x037 \x03\v+\x03\x021\x00\x02\x01\x04\x02\x01\x02\x02\x019\x02\x03\x1C\x02\x02$\x03\x80p$\x02\x03:\x02\x03\n\x03\xC1r.\x03\xC1r,\x03\xC1r\x02\x02\x02:\x02\x02>\x02\x02,\x02\x02\x10\x02\x02\x00\x03\xC1s<\x03\xC1s*\x03\xC2L$\x03\xC2L;\x02\t)\x02\n\x19\x03\x83\xAB\xE3\x03\x83\xAB\xF2\x03 4\xE0\x03\x81\xAB\xEA\x03\x81\xAB\xF3\x03 4\xEF\x03\x96\xE1\xCD\x03\x84\xE5\xC3\x02\r\x11\x03\x8B\xEC\xCB\x03\x94\xEC\xCF\x03\x9A\xEC\xC2\x03\x8B\xEC\xDB\x03\x94\xEC\xDF\x03\x9A\xEC\xD2\x03\x01\f!\x03\x01\f#\x03\xCA\xA0\x9D\x03\xCA\xA3\x9C\x03\xCA\xA2\x9F\x03\xCA\xA5\x9E\x03\xCA\xA4\x91\x03\xCA\xA7\x90\x03\xCA\xA6\x93\x03\xCA\xA9\x92\x03\xCA\xA8\x95\x03\xCA\xF3\xB5\x03\xCA\xF0\xB4\x03\xCA\xF1\xB7\x03\xCA\xF6\xB6\x03\xCA\xF7\x89\x03\xCA\xF4\x88\x03\xCA\xF5\x8B\x03\xCA\xFA\x8A\x03\xCA\xFB\x8D\x03\xCA\xF8\x8C\x03\xCA\xF9\x8F\x03\xCA\xFE\x8E\x03\xCA\xFF\x81\x03\xCA\xFC\x80\x03\xCA\xFD\x83\x03\xCA\xE2\x82\x03\xCA\xE3\x85\x03\xCA\xE0\x84\x03\xCA\xE1\x87\x03\xCA\xE6\x86\x03\xCA\xE7\x99\x03\xCA\xE4\x98\x03\xCA\xE5\x9B\x03\xCA\xEA\x9A\x03\xCA\xEB\x9D\x03\xCA\xE8\x9C\x03\xD8\x93\x89\x03\xDF\x94\x8B\x02\x010\x03\x03\x04\x1E\x03\x04\x15\x12\x03\v\x05,\x03\x06\x04\x00\x03\x06\x04)\x03\x06\x044\x03\x06\x04<\x03\x06\x05\x1D\x03\x06\x06\x00\x03\x06\x06\n\x03\x06\x06'\x03\x06\x062\x03\x0786\x03\x079/\x03\x079 \x03\x07:\x0E\x03\x07:\x1B\x03\x07:%\x03\x07;/\x03\x07;%\x03\x074\x11\x03\x076\t\x03\x077*\x03\x070\x01\x03\x070\x0F\x03\x070.\x03\x071\x16\x03\x071\x04\x03\x0710\x03\x072\x18\x03\x072-\x03\x073\x14\x03\x073>\x03\x07'\t\x03\x07 \x00\x03\x07\x1F\v\x03\x07\x18#\x03\x07\x18(\x03\x07\x186\x03\x07\x18\x03\x03\x07\x19\x16\x03\x07\x116\x03\x07\x12'\x03\x07\x13\x10\x03\x07\f&\x03\x07\f\b\x03\x07\f\x13\x03\x07\r\x02\x03\x07\r\x1C\x03\x07\v5\x03\x07\v\n\x03\x07\v\x01\x03\x07\v\x0F\x03\x07\x05\x00\x03\x07\x05\t\x03\x07\x05\v\x03\x07\x07\x01\x03\x07\x07\b\x03\x07\x00<\x03\x07\x00+\x03\x07\x01)\x03\x07\x01\x1B\x03\x07\x01\b\x03\x07\x03?\x03\x0445\x03\x044\b\x03\x0454\x03\x04)/\x03\x04)5\x03\x04+\x05\x03\x04+\x14\x03\x04+ \x03\x04+<\x03\x04*&\x03\x04*\"\x03\x04&8\x03\x04!\x01\x03\x04!\"\x03\x04\x11+\x03\x04\x10.\x03\x04\x104\x03\x04\x13=\x03\x04\x12\x04\x03\x04\x12\n\x03\x04\r\x1D\x03\x04\r\x07\x03\x04\r \x03\x05<>\x03\x055<\x03\x055!\x03\x055#\x03\x055&\x03\x054\x1D\x03\x054\x02\x03\x054\x07\x03\x0571\x03\x053\x1A\x03\x053\x16\x03\x05.<\x03\x05.\x07\x03\x05):\x03\x05)<\x03\x05)\f\x03\x05)\x15\x03\x05+-\x03\x05+5\x03\x05$\x1E\x03\x05$\x14\x03\x05'\x04\x03\x05'\x14\x03\x05&\x02\x03\x05\"6\x03\x05\"\f\x03\x05\"\x1C\x03\x05\x19\n\x03\x05\x1B\t\x03\x05\x1B\f\x03\x05\x14\x07\x03\x05\x16?\x03\x05\x16\f\x03\x05\f\x05\x03\x05\x0E\x0F\x03\x05\x01\x0E\x03\x05\x00(\x03\x05\x030\x03\x05\x03\x06\x03\n==\x03\n=1\x03\n=,\x03\n=\f\x03\n??\x03\n<\b\x03\n9!\x03\n9)\x03\n97\x03\n99\x03\n6\n\x03\n6\x1C\x03\n6\x17\x03\n7'\x03\n78\x03\n73\x03\n'\x01\x03\n'&\x03\n\x1F\x0E\x03\n\x1F\x03\x03\n\x1F3\x03\n\x1B/\x03\n\x18\x19\x03\n\x19\x01\x03\n\x16\x14\x03\n\x0E\"\x03\n\x0F\x10\x03\n\x0F\x02\x03\n\x0F \x03\n\f\x04\x03\n\v>\x03\n\v+\x03\n\b/\x03\n\x046\x03\n\x05\x14\x03\n\x00\x04\x03\n\x00\x10\x03\n\x00\x14\x03\v<3\x03\v;*\x03\v9\"\x03\v9)\x03\v97\x03\v+\x10\x03\v((\x03\v&5\x03\v$\x1C\x03\v$\x12\x03\v%\x04\x03\v#<\x03\v#0\x03\v#\r\x03\v#\x19\x03\v!:\x03\v!\x1F\x03\v!\x00\x03\v\x1E5\x03\v\x1C\x1D\x03\v\x1D-\x03\v\x1D(\x03\v\x18.\x03\v\x18 \x03\v\x18\x16\x03\v\x14\x13\x03\v\x15$\x03\v\x15\"\x03\v\x12\x1B\x03\v\x12\x10\x03\v\x132\x03\v\x13=\x03\v\x12\x18\x03\v\f&\x03\v\x061\x03\v\x06:\x03\v\x05#\x03\v\x05<\x03\v\x04\v\x03\v\x04\x04\x03\v\x04\x1B\x03\v\x042\x03\v\x041\x03\v\x03\x03\x03\v\x03\x1D\x03\v\x03/\x03\v\x03+\x03\v\x02\x1B\x03\v\x02\x00\x03\v\x01\x1E\x03\v\x01\b\x03\v\x015\x03\x06\r9\x03\x06\r=\x03\x06\r?\x03\x02\x001\x03\x02\x003\x03\x02\x02\x19\x03\x02\x006\x03\x02\x02\x1B\x03\x02\x004\x03\x02\x00<\x03\x02\x02\n\x03\x02\x02\x0E\x03\x02\x01\x1A\x03\x02\x01\x07\x03\x02\x01\x05\x03\x02\x01\v\x03\x02\x01%\x03\x02\x01\f\x03\x02\x01\x04\x03\x02\x01\x1C\x03\x02\x00.\x03\x02\x002\x03\x02\x00>\x03\x02\x00\x12\x03\x02\x00\x16\x03\x02\x011\x03\x02\x013\x03\x02\x02 \x03\x02\x02%\x03\x02\x02$\x03\x02\x028\x03\x02\x02;\x03\x02\x024\x03\x02\x012\x03\x02\x022\x03\x02\x02/\x03\x02\x01,\x03\x02\x01\x13\x03\x02\x01\x16\x03\x02\x01\x11\x03\x02\x01\x1E\x03\x02\x01\x15\x03\x02\x01\x17\x03\x02\x01\x0F\x03\x02\x01\b\x03\x02\x00?\x03\x02\x03\x07\x03\x02\x03\r\x03\x02\x03\x13\x03\x02\x03\x1D\x03\x02\x03\x1F\x03\x02\x00\x03\x03\x02\x00\r\x03\x02\x00\x01\x03\x02\x00\x1B\x03\x02\x00\x19\x03\x02\x00\x18\x03\x02\x00\x13\x03\x02\x00/\x03\x07>\x12\x03\x07<\x1F\x03\x07>\x1D\x03\x06\x1D\x0E\x03\x07>\x1C\x03\x07>:\x03\x07>\x13\x03\x04\x12+\x03\x07?\x03\x03\x07>\x02\x03\x06\"4\x03\x06\x1A.\x03\x07<%\x03\x06\x1C\v\x03\x0609\x03\x05\x1F\x01\x03\x04'\b\x03\x93\xFD\xF5\x03\x02\r \x03\x02\r#\x03\x02\r!\x03\x02\r&\x03\x02\r\"\x03\x02\r/\x03\x02\r,\x03\x02\r$\x03\x02\r'\x03\x02\r%\x03\x02\r;\x03\x02\r=\x03\x02\r?\x03\t9.\x03\b\v7\x03\b\x02\x14\x03\b\x14\r\x03\b.:\x03\b9'\x03\x0F\v\x18\x03\x0F\x1C1\x03\x0F\x17&\x03\x0F9\x1F\x03\x0F0\f\x03\x0E\n9\x03\x0E\x056\x03\x0E\x1C#\x03\x0F\x13\x0E\x03\x072\x00\x03\x070\r\x03\x072\v\x03\x06\x11\x18\x03\x070\x10\x03\x06\x0F(\x03\x072\x05\x03\x06\x0F,\x03\x073\x15\x03\x06\x07\b\x03\x05\x16\x02\x03\x04\v \x03\x05:8\x03\x05\x16%\x03\n\r\x1F\x03\x06\x16\x10\x03\x05\x1D5\x03\x05*;\x03\x05\x16\x1B\x03\x04.-\x03\x06\x1A\x19\x03\x04\x03,\x03\v87\x03\x04/\n\x03\x06\x00,\x03\x04-\x01\x03\x04\x1E-\x03\x06/(\x03\n\v5\x03\x06\x0E7\x03\x06\x07.\x03\x0597\x03\n*%\x03\x0760\x03\x06\f;\x03\x05'\x00\x03\x072.\x03\x072\b\x03\x06=\x01\x03\x06\x05\x1B\x03\x06\x06\x12\x03\x06$=\x03\x06'\r\x03\x04\x11\x0F\x03\x076,\x03\x06\x07;\x03\x06.,\x03\x86\xF9\xEA\x03\x8F\xFF\xEB\x02\t2\x02\t5\x02\t4\x02\t;\x02\t>\x02\t8\x02\t*\x02\t/\x02\t,\x02\t%\x02\t&\x02\t#\x02\t \x02\b!\x02\b%\x02\b$\x02\b+\x02\b.\x02\b*\x02\b&\x02\b8\x02\b>\x02\b4\x02\b6\x02\b0\x02\b\x10\x02\b\x17\x02\b\x12\x02\b\x1D\x02\b\x1F\x02\b\x13\x02\b\x15\x02\b\x14\x02\b\f\x03\x8B\xFD\xD0\x03\x81\xEC\xC6\x03\x87\xE0\x8A\x03-2\xE3\x03\x80\xEF\xE4\x03-2\xEA\x03\x88\xE6\xEB\x03\x8E\xE6\xE8\x03\x84\xE6\xE9\x03\x97\xE6\xEE\x03-2\xF9\x03-2\xF6\x03\x8E\xE3\xAD\x03\x80\xE3\x92\x03\x88\xE3\x90\x03\x8E\xE3\x90\x03\x80\xE3\x97\x03\x88\xE3\x95\x03\x88\xFE\xCB\x03\x8E\xFE\xCA\x03\x84\xFE\xCD\x03\x91\xEF\xC9\x03-2\xC1\x03-2\xC0\x03-2\xCB\x03\x88@\t\x03\x8E@\b\x03\x8F\xE0\xF5\x03\x8E\xE6\xF9\x03\x8E\xE0\xFA\x03\x93\xFF\xF4\x03\x84\xEE\xD3\x03\v(\x04\x023 \x03\v)\b\x021;\x02\x01*\x03\v#\x10\x03\v 0\x03\v!\x10\x03\v!0\x03\x07\x15\b\x03\t?5\x03\x07\x1F\b\x03\x07\x17\v\x03\t\x1F\x15\x03\v\x1C7\x03\n+#\x03\x06\x1A\x1B\x03\x06\x1A\x14\x03\n\x01\x18\x03\x06#\x1B\x03\n2\f\x03\n\x01\x04\x03\t#;\x03\b='\x03\b\x1A\n\x03\x07\x03\n\x111\x03\t\x1B\t\x03\x073.\x03\x07\x01\x00\x03\t/,\x03\x07#>\x03\x07\x048\x03\n\x1F\"\x03\t8>\x03\t\x11\x00\x03\b/\x17\x03\x06'\"\x03\v\x1A+\x03\n\"\x19\x03\n/1\x03\t74\x03\t\x0F\"\x03\b,\"\x03\b?\x14\x03\x07$5\x03\x07<3\x03\x07=*\x03\x07\x13\x18\x03\x068\n\x03\x06\t\x16\x03\x06\x13\x00\x03\b\x067\x03\b\x01\x03\x03\b\x12\x1D\x03\x07+7\x03\x06(;\x03\x06\x1C?\x03\x07\x0E\x17\x03\n\x06\x1D\x03\n\x19\x07\x03\b\x14$\x03\x07$;\x03\b,$\x03\b\x06\r\x03\x07\x16\n\x03\x06>>\x03\n\x06\x12\x03\n\x14)\x03\t\r\x1F\x03\t\x12\x17\x03\t\x19\x01\x03\b\x11 \x03\b\x1D'\x03\x06<\x1A\x03\n.\x00\x03\x07'\x18\x03\n\"\b\x03\b\r\n\x03\b\x13)\x03\x07*)\x03\x06<,\x03\x07\v\x1A\x03\t.\x14\x03\t\r\x1E\x03\x07\x0E#\x03\v\x1D'\x03\n\n8\x03\t%2\x03\b+&\x03\b0\x12\x03\n)4\x03\b\x06\x1F\x03\v\x1B\x1A\x03\n\x1B\x0F\x03\v\x1D*\x03\t\x16$\x03\t0\x11\x03\b\x11\b\x03\n*(\x03\n\x042\x03\b9,\x03\x074'\x03\x07\x0F\x05\x03\t\v\n\x03\x07\x1B\x01\x03\t\x17:\x03\t.\r\x03\x07.\x11\x03\t+\x15\x03\b0\x13\x03\v\x1F\x19\x03\n \x11\x03\n\"0\x03\t\x07;\x03\b\x16\x1C\x03\x07,\x13\x03\x07\x0E/\x03\x06\"1\x03\n.\n\x03\n7\x02\x03\n\x032\x03\n\x1D.\x03\t1\x06\x03\t\x19:\x03\b\x02/\x03\x060+\x03\x06\x0F-\x03\x06\x1C\x1F\x03\x06\x1D\x07\x03\n,\x11\x03\t=\r\x03\t\v;\x03\x07\x1B/\x03\n\x1F:\x03\t \x1F\x03\t.\x10\x03\t4\v\x03\t\x1A1\x03\b#\x1A\x03\b4\x1D\x03\b\x01\x1F\x03\b\x11\"\x03\x07'8\x03\x07\x1A>\x03\x0757\x03\x06&9\x03\x06+\x11\x03\n.\v\x03\n,>\x03\n4#\x03\b%\x17\x03\x07\x05\"\x03\x07\f\v\x03\n\x1D+\x03\n\x19\x16\x03\t+\x1F\x03\t\b\v\x03\b\x16\x18\x03\b+\x12\x03\v\x1D\f\x03\n=\x10\x03\n\t\r\x03\n\x10\x11\x03\t&0\x03\b(\x1F\x03\b7\x07\x03\b\x185\x03\x07'6\x03\x06.\x05\x03\x06=\x04\x03\x06;;\x03\x06\x06,\x03\v\x18>\x03\b\x00\x18\x03\x06 \x03\x03\x06<\x00\x03\t%\x18\x03\v\x1C<\x03\n%!\x03\n\t\x12\x03\n\x16\x02\x03\t0'\x03\t\x0E=\x03\b \x0E\x03\b>\x03\x03\x074>\x03\x06&?\x03\x06\x19\t\x03\x06?(\x03\n-\x0E\x03\t:3\x03\t8:\x03\t\x12\v\x03\t\x1D\x17\x03\b7\x05\x03\b2\x14\x03\b\x06%\x03\b\x13\x1F\x03\x06\x06\x0E\x03\n\"<\x03\t/<\x03\x06>+\x03\n'?\x03\n\x13\f\x03\t\x10<\x03\x07\x1B=\x03\n\x19\x13\x03\t\"\x1D\x03\t\x07\r\x03\b)\x1C\x03\x06=\x1A\x03\n/4\x03\n7\x11\x03\n\x16:\x03\t?3\x03\t:/\x03\t\x05\n\x03\t\x14\x06\x03\b7\"\x03\b0\x07\x03\b\x1A\x1F\x03\x07\x04(\x03\x07\x04\t\x03\x06 %\x03\x06<\b\x03\n+\x14\x03\t\x1D\x16\x03\n70\x03\b >\x03\b57\x03\x070\n\x03\x06=\x12\x03\x06\x16%\x03\x06\x1D,\x03\t9#\x03\t\x10>\x03\x07 \x1E\x03\b\f<\x03\b\v\x18\x03\b\x15+\x03\b,:\x03\b%\"\x03\x07\n$\x03\v\x1C=\x03\x07+\b\x03\n/\x05\x03\n \x07\x03\n\x12'\x03\t#\x11\x03\b\x1B\x15\x03\n\x06\x01\x03\t\x1C\x1B\x03\t22\x03\x07\x14<\x03\x07\t\x04\x03\x061\x04\x03\x07\x0E\x01\x03\n\x13\x18\x03\n-\f\x03\n?\r\x03\n\t\n\x03\t1&\x03\n/\v\x03\b$<\x03\b3\x1D\x03\b\f$\x03\b\r\x07\x03\b\r?\x03\b\x0E\x14\x03\x065\n\x03\b\x1A#\x03\b\x16#\x03\x0702\x03\x07\x03\x1A\x03\x06(\x1D\x03\x06+\x1B\x03\x06\v\x05\x03\x06\v\x17\x03\x06\f\x04\x03\x06\x1E\x19\x03\x06+0\x03\x062\x18\x03\v\x16\x1E\x03\n+\x16\x03\n-?\x03\n#:\x03\n#\x10\x03\n%$\x03\n>+\x03\n01\x03\n1\x10\x03\n\t9\x03\n\n\x12\x03\n\x19\x1F\x03\n\x19\x12\x03\t*)\x03\t-\x16\x03\t.1\x03\t.2\x03\t<\x0E\x03\t> \x03\t3\x12\x03\t\v\x01\x03\t\x1C2\x03\t\x11\x1C\x03\t\x15%\x03\b,&\x03\b!\"\x03\b9(\x03\b\v\x1A\x03\b\r2\x03\b\f\x04\x03\b\f\x06\x03\b\f\x1F\x03\b\f\f\x03\b\x0F\x1F\x03\b\x0F\x1D\x03\b\x00\x14\x03\b\x03\x14\x03\b\x06\x16\x03\b\x1E#\x03\b\x11\x11\x03\b\x10\x18\x03\b\x14(\x03\x07)\x1E\x03\x07.1\x03\x07 $\x03\x07 '\x03\x078\b\x03\x07\r0\x03\x07\x0F7\x03\x07\x05#\x03\x07\x05\x1A\x03\x07\x1A7\x03\x07\x1D-\x03\x07\x17\x10\x03\x06)\x1F\x03\x062\v\x03\x066\x16\x03\x06\t\x11\x03\t(\x1E\x03\x07!5\x03\v\x11\x16\x03\n/\x04\x03\n,\x1A\x03\v\x173\x03\n,1\x03\n/5\x03\n\"1\x03\n\"\r\x03\n?%\x03\n<,\x03\n?#\x03\n>\x19\x03\n\b&\x03\n\v\x0E\x03\n\f:\x03\n\f+\x03\n\x03\"\x03\n\x06)\x03\n\x11\x10\x03\n\x11\x1A\x03\n\x17-\x03\n\x14(\x03\t)\x1E\x03\t/\t\x03\t.\x00\x03\t,\x07\x03\t/*\x03\t-9\x03\t\"8\x03\t%\t\x03\t:\x12\x03\t;\x1D\x03\t?\x06\x03\t3%\x03\t6\x05\x03\t6\b\x03\t7\x02\x03\t\x07,\x03\t\x04,\x03\t\x1F\x16\x03\t\x11\x03\x03\t\x11\x12\x03\t\x168\x03\b*\x05\x03\b/2\x03\b4:\x03\b\"+\x03\b 0\x03\b&\n\x03\b;\x10\x03\b>$\x03\b>\x18\x03\b29\x03\b2:\x03\b1,\x03\b1<\x03\b1\x1C\x03\b7#\x03\b7*\x03\b\t'\x03\b\x00\x1D\x03\b\x05-\x03\b\x1F4\x03\b\x1D\x04\x03\b\x16\x0F\x03\x07*7\x03\x07'!\x03\x07%\x1B\x03\x077\f\x03\x07\f1\x03\x07\f.\x03\x07\x00\x06\x03\x07\x01\x02\x03\x07\x010\x03\x07\x06=\x03\x07\x01\x03\x03\x07\x01\x13\x03\x07\x06\x06\x03\x07\x05\n\x03\x07\x1F\t\x03\x07\x17:\x03\x06*1\x03\x06-\x1D\x03\x06\"3\x03\x062:\x03\x060$\x03\x066\x1E\x03\x064\x12\x03\x0645\x03\x06\v\x00\x03\x06\v7\x03\x06\x07\x1F\x03\x06\x15\x12\x03\f\x05\x0F\x03\v+\v\x03\v+-\x03\x06\x16\x1B\x03\x06\x15\x17\x03\x89\xCA\xEA\x03\x89\xCA\xE8\x03\f8\x10\x03\f8\x01\x03\f8\x0F\x03\r8%\x03\r8!\x03\f8-\x03\f8/\x03\f8+\x03\f87\x03\f85\x03\f9\t\x03\f9\r\x03\f9\x0F\x03\f9\v\x03\xCFu\f\x03\xCFu\x0F\x03\xCFu\x0E\x03\xCFu\t\x03\f9\x10\x03\r9\f\x03\xCF`;\x03\xCF`>\x03\xCF`9\x03\xCF`8\x03\xCF`7\x03\xCF`*\x03\xCF`-\x03\xCF`,\x03\r\x1B\x1A\x03\r\x1B&\x03\f=.\x03\f=%\x03\f>\x1E\x03\f>\x14\x03\f?\x06\x03\f?\v\x03\f?\f\x03\f?\r\x03\f?\x02\x03\f>\x0F\x03\f>\b\x03\f>\t\x03\f>,\x03\f>\f\x03\f?\x13\x03\f?\x16\x03\f?\x15\x03\f?\x1C\x03\f?\x1F\x03\f?\x1D\x03\f?\x1A\x03\f?\x17\x03\f?\b\x03\f?\t\x03\f?\x0E\x03\f?\x04\x03\f?\x05\x03\f\x03\f=2\x03\f=6\x03\f<\x07\x03\f<\x05\x03\x0E:!\x03\x0E:#\x03\x0E8\t\x03\x0E:&\x03\x0E8\v\x03\x0E:$\x03\x0E:,\x03\x0E8\x1A\x03\x0E8\x1E\x03\x0E:*\x03\x0E:7\x03\x0E:5\x03\x0E:;\x03\x0E:\x15\x03\x0E:<\x03\x0E:4\x03\x0E:'\x03\x0E:-\x03\x0E:%\x03\x0E:?\x03\x0E:=\x03\x0E:)\x03\x0E:/\x03\xCFs'\x03\r=\x0F\x03\r+*\x03\r99\x03\r9;\x03\r9?\x03\r)\r\x03\r(%\x02\x01\x18\x02\x01(\x02\x01\x1E\x03\x0F$!\x03\x0F87\x03\x0F4\x0E\x03\x0F5\x1D\x03\x06'\x03\x03\x0F\b\x18\x03\x0F\r\x1B\x03\x0E2=\x03\x0E;\b\x03\x0E:\v\x03\x0E\x06$\x03\x0E\r)\x03\x0E\x16\x1F\x03\x0E\x16\x1B\x03\r$\n\x03\x05,\x1D\x03\r. \x03\r.#\x03\f(/\x03\t%\x02\x03\r90\x03\r\x0E4\x03\r\r\x0F\x03\f#\x00\x03\f,\x1E\x03\f2\x0E\x03\f\x01\x17\x03\f\t:\x03\x0E\x173\x03\f\b\x03\x03\f\x11\x07\x03\f\x10\x18\x03\f\x1F\x1C\x03\f\x19\x0E\x03\f\x1A\x1F\x03\x0F0>\x03\v->\x03\v<+\x03\v8\x13\x03\v\x043\x03\v\x14\x03\x03\v\x16%\x03\r\"&\x03\v\x1A\x1A\x03\v\x1A\x04\x03\n%9\x03\n&2\x03\n&0\x03\n!\x1A\x03\n!7\x03\n5\x10\x03\n=4\x03\n?\x0E\x03\n>\x10\x03\n\x00 \x03\n\x0F:\x03\n\x0F9\x03\n\v\n\x03\n\x17%\x03\n\x1B-\x03\t-\x1A\x03\t,4\x03\t.,\x03\t)\t\x03\t6!\x03\t1\x1F\x03\t3\x16\x03\f+\x1F\x03\t8 \x03\t8=\x03\f(\x1A\x03\f(\x16\x03\t\n+\x03\t\x16\x12\x03\t\x13\x0E\x03\t\x153\x03\b)!\x03\t\x1A\x01\x03\t\x18\x01\x03\b%#\x03\b>\"\x03\b\x05%\x03\b\x02*\x03\b\x15;\x03\b\x1B7\x03\x0F\x07\x1D\x03\x0F\x04\x03\x03\x070\f\x03\x07;\v\x03\x07\b\x17\x03\x07\x12\x06\x03\x06/-\x03\x0671\x03\x065+\x03\x06>7\x03\x06\x049\x03\x05+\x1E\x03\x05,\x17\x03\x05 \x1D\x03\x05\"\x05\x03\x050\x1D"; idnaValues = $toNativeArray($kindUint16, [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 8, 8, 128, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 128, 128, 128, 128, 128, 128, 128, 57605, 57605, 57605, 57605, 57605, 57605, 57605, 57605, 57605, 57605, 57605, 57605, 57605, 57605, 57605, 57605, 57605, 57605, 57605, 57605, 57605, 57605, 57605, 57605, 57605, 57605, 128, 128, 128, 128, 128, 128, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 128, 128, 128, 128, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 10, 24, 24, 24, 24, 24, 24, 24, 26, 24, 57, 24, 24, 960, 24, 74, 24, 24, 105, 121, 138, 5, 24, 8, 170, 201, 217, 24, 233, 281, 329, 24, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 377, 8, 53, 77, 57357, 8, 57357, 8, 8, 57373, 8, 57405, 8, 57373, 8, 409, 409, 57373, 8, 57405, 8, 57373, 8, 57469, 8, 441, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 101, 57373, 8, 57405, 8, 57373, 8, 473, 8, 125, 57357, 8, 57357, 8, 125, 57469, 8, 149, 173, 57405, 8, 8, 197, 221, 245, 57373, 8, 269, 293, 8, 317, 317, 57357, 8, 8, 8, 269, 341, 8, 365, 57357, 8, 57357, 8, 57357, 8, 389, 57469, 8, 413, 8, 8, 57357, 8, 389, 57597, 8, 437, 461, 57405, 8, 57373, 8, 485, 57357, 8, 8, 8, 57357, 8, 8, 8, 8, 8, 8, 8, 489, 489, 489, 509, 533, 557, 581, 605, 629, 57373, 8, 57597, 8, 57373, 8, 57405, 8, 57373, 8, 57469, 8, 57373, 8, 57405, 8, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 8, 653, 677, 701, 57357, 8, 725, 749, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 773, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 8, 8, 8, 8, 8, 8, 521, 57405, 8, 797, 553, 8, 8, 8, 24, 24, 24, 24, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 24, 24, 24, 24, 24, 24, 666, 698, 730, 762, 794, 826, 24, 24, 941, 857, 473, 873, 965, 24, 24, 24, 24, 24, 24, 24, 8, 24, 8, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 989, 989, 13064, 1013, 889, 1037, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13248, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 57357, 8, 57357, 8, 1061, 8, 57357, 8, 64, 64, 930, 8, 8, 8, 962, 1085, 64, 64, 64, 64, 138, 978, 57685, 1109, 57645, 57661, 57645, 64, 989, 64, 1133, 1157, 8, 57605, 57605, 57605, 57605, 57605, 57605, 57605, 57605, 57605, 57605, 57605, 57605, 57605, 57605, 57605, 1181, 1181, 64, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 57359, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 57541, 1205, 1229, 57533, 57589, 57597, 57501, 57525, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 1253, 57733, 57741, 8, 1277, 989, 24, 57469, 8, 57813, 57357, 8, 8, 1301, 1325, 1325, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 24, 13064, 13064, 13064, 13064, 13064, 13080, 13080, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 64, 57373, 8, 57405, 8, 57373, 8, 57469, 8, 57373, 8, 57405, 8, 57373, 8, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 64, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 2112, 2112, 2112, 2112, 2112, 2112, 24, 24, 2072, 24, 24, 2072, 24, 2072, 24, 24, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 2072, 2880, 64, 2072, 2072, 2568, 2056, 3080, 3080, 3080, 3080, 2568, 3080, 2568, 3080, 2568, 2568, 2568, 2568, 2568, 3080, 3080, 3080, 3080, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2072, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 3080, 2568, 2568, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 2056, 2056, 2056, 2056, 2056, 2056, 2056, 2056, 2056, 2056, 24, 2072, 2072, 2072, 2568, 2568, 13064, 3080, 3080, 3080, 2056, 1065, 1105, 1145, 1185, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 3080, 2568, 2568, 3080, 3080, 3080, 3080, 3080, 3080, 3080, 3080, 3080, 2568, 3080, 2568, 3080, 2568, 2568, 3080, 3080, 2072, 3080, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 2112, 24, 13064, 13064, 13064, 13064, 13064, 13064, 2056, 2056, 13064, 13064, 24, 13064, 13064, 13064, 13064, 3080, 3080, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 2568, 2568, 2568, 2056, 2056, 2568, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 64, 2880, 3080, 13064, 2568, 2568, 2568, 3080, 3080, 3080, 3080, 3080, 2568, 2568, 2568, 2568, 3080, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 3080, 2568, 3080, 2568, 3080, 2568, 2568, 3080, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 3080, 2568, 2568, 2568, 2568, 2568, 3080, 3080, 2568, 3080, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 3080, 2568, 3080, 3080, 3080, 13064, 13064, 13064, 64, 64, 2072, 64, 2568, 2056, 2568, 2568, 2568, 2568, 2056, 3080, 2568, 3080, 3080, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 12296, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 12296, 12296, 12296, 12296, 15112, 12296, 12296, 8, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 1225, 1281, 1337, 1393, 1449, 1505, 1561, 1617, 8, 8, 13064, 13064, 24, 24, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 24, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 13064, 12296, 12296, 64, 8, 8, 8, 8, 8, 8, 8, 8, 64, 64, 8, 8, 64, 64, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 64, 8, 8, 8, 8, 8, 8, 8, 64, 8, 64, 64, 64, 8, 8, 8, 8, 64, 64, 13064, 8, 12296, 12296, 12296, 13064, 13064, 13064, 13064, 64, 64, 12296, 12296, 64, 64, 12296, 12296, 15112, 8, 64, 64, 64, 64, 64, 64, 64, 64, 12296, 64, 64, 64, 64, 1673, 1729, 64, 1785, 8, 8, 13064, 13064, 64, 64, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 8, 24, 13064, 64, 64, 13064, 13064, 12296, 64, 8, 8, 8, 8, 8, 8, 64, 64, 64, 64, 8, 8, 64, 64, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 64, 8, 8, 8, 8, 8, 8, 8, 64, 8, 1841, 64, 8, 1897, 64, 8, 8, 64, 64, 13064, 64, 12296, 12296, 12296, 13064, 13064, 64, 64, 64, 64, 13064, 13064, 64, 64, 13064, 13064, 15112, 64, 64, 64, 13064, 64, 64, 64, 64, 64, 64, 64, 1953, 2009, 2065, 8, 64, 2121, 64, 64, 64, 64, 64, 64, 64, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 13064, 13064, 8, 8, 8, 13064, 24, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 13064, 13064, 12296, 64, 8, 8, 8, 8, 8, 8, 8, 8, 8, 64, 8, 8, 8, 64, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 64, 8, 8, 8, 8, 8, 8, 8, 64, 8, 8, 64, 8, 8, 8, 8, 8, 64, 64, 13064, 8, 12296, 12296, 12296, 13064, 13064, 13064, 13064, 13064, 64, 13064, 13064, 12296, 64, 12296, 12296, 15112, 64, 64, 8, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 8, 8, 13064, 13064, 64, 64, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 24, 24, 64, 64, 64, 64, 64, 64, 64, 8, 13064, 13064, 13064, 13064, 13064, 13064, 64, 13064, 12296, 12296, 64, 8, 8, 8, 8, 8, 8, 8, 8, 64, 64, 8, 8, 64, 64, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 64, 8, 8, 8, 8, 8, 8, 8, 64, 8, 8, 64, 8, 8, 8, 8, 8, 64, 64, 13064, 8, 12296, 13064, 12296, 13064, 13064, 13064, 13064, 64, 64, 12296, 12296, 64, 64, 12296, 12296, 15112, 64, 64, 64, 64, 64, 64, 64, 13064, 13064, 12296, 64, 64, 64, 64, 2177, 2233, 64, 8, 8, 8, 13064, 13064, 64, 64, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 24, 8, 24, 24, 24, 24, 24, 24, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 13064, 8, 64, 8, 8, 8, 8, 8, 8, 64, 64, 64, 8, 8, 8, 64, 8, 8, 8, 8, 64, 64, 64, 8, 8, 64, 8, 64, 8, 8, 64, 64, 64, 8, 8, 64, 64, 64, 8, 8, 8, 64, 64, 64, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 64, 64, 64, 64, 12296, 12296, 13064, 12296, 12296, 12296, 12296, 64, 13064, 13064, 13064, 64, 13064, 13064, 13064, 15112, 64, 64, 64, 64, 64, 64, 64, 13064, 13064, 64, 8, 8, 8, 64, 64, 64, 64, 64, 8, 8, 13064, 13064, 64, 64, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 64, 64, 64, 64, 64, 64, 64, 24, 24, 24, 24, 24, 24, 24, 24, 24, 8, 13064, 12296, 12296, 24, 8, 8, 8, 8, 8, 8, 8, 8, 64, 8, 8, 8, 64, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 64, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 64, 8, 8, 8, 8, 8, 64, 64, 13064, 8, 12296, 13064, 12296, 12296, 12296, 12296, 12296, 64, 13064, 12296, 12296, 64, 12296, 12296, 13064, 15112, 64, 64, 64, 64, 64, 64, 64, 12296, 12296, 64, 64, 64, 64, 64, 64, 64, 8, 64, 8, 8, 13064, 13064, 64, 64, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 64, 8, 8, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 12296, 13064, 13064, 13064, 13064, 64, 12296, 12296, 12296, 64, 12296, 12296, 12296, 15112, 8, 24, 64, 64, 64, 64, 8, 8, 8, 12296, 24, 24, 24, 24, 24, 24, 24, 8, 8, 8, 13064, 13064, 64, 64, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 8, 8, 8, 8, 8, 8, 64, 8, 8, 64, 8, 64, 8, 8, 8, 8, 8, 64, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 64, 8, 64, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 13064, 8, 2345, 13064, 13064, 13064, 13064, 13064, 13064, 15112, 13064, 13064, 8, 64, 64, 8, 8, 8, 2513, 8, 8, 8, 8, 64, 8, 8, 8, 8, 2569, 8, 8, 8, 8, 2625, 8, 8, 8, 8, 2681, 8, 8, 8, 8, 2737, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 2793, 8, 8, 8, 64, 64, 64, 64, 13064, 13064, 2849, 13064, 2905, 2961, 3017, 3097, 3153, 13064, 13064, 13064, 13064, 13064, 12296, 13064, 3233, 13064, 13064, 15112, 24, 13064, 13064, 8, 8, 8, 8, 8, 13064, 13064, 13064, 13064, 13064, 13064, 3289, 13064, 13064, 13064, 13064, 64, 13064, 13064, 13064, 13064, 3345, 13064, 13064, 13064, 13064, 3401, 13064, 13064, 13064, 13064, 3457, 13064, 13064, 13064, 13064, 3513, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 3569, 13064, 13064, 13064, 64, 24, 24, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 57, 3793, 3817, 8, 3833, 3849, 3865, 3889, 585, 3905, 601, 3921, 857, 3937, 3953, 8, 217, 3969, 3993, 617, 4009, 4025, 633, 57, 4041, 4065, 1461, 3817, 3833, 3849, 4089, 4113, 4137, 3889, 8, 3921, 3937, 4161, 217, 4185, 1485, 1485, 3993, 4009, 4025, 1461, 4209, 4233, 1509, 4249, 4273, 4297, 4321, 4345, 3905, 617, 4025, 4233, 4249, 4273, 4369, 4321, 4345, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 4393, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 4417, 4441, 4457, 4481, 4137, 4505, 4521, 4545, 4569, 4593, 4617, 4641, 1533, 4665, 4689, 57725, 4713, 4737, 4761, 4785, 4809, 4833, 4857, 4881, 4905, 4929, 4953, 4977, 5001, 1557, 5025, 5049, 5073, 5089, 5113, 5137, 5161, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 8, 8, 8, 8, 1581, 1613, 8, 8, 5185, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 8, 8, 8, 8, 8, 8, 64, 64, 57413, 57413, 57413, 57413, 57413, 57413, 64, 64, 8, 8, 8, 8, 8, 8, 8, 8, 64, 57413, 64, 57413, 64, 57413, 64, 57413, 8, 8, 8, 8, 8, 8, 8, 8, 57413, 57413, 57413, 57413, 57413, 57413, 57413, 57413, 8, 5209, 8, 5233, 8, 5257, 8, 5281, 8, 5305, 8, 5329, 8, 5353, 64, 64, 5377, 5425, 5473, 5521, 5569, 5617, 5665, 5713, 5377, 5425, 5473, 5521, 5569, 5617, 5665, 5713, 5761, 5809, 5857, 5905, 5953, 6001, 6049, 6097, 5761, 5809, 5857, 5905, 5953, 6001, 6049, 6097, 6145, 6193, 6241, 6289, 6337, 6385, 6433, 6481, 6145, 6193, 6241, 6289, 6337, 6385, 6433, 6481, 8, 8, 6529, 6577, 6617, 64, 8, 6657, 57413, 57413, 1637, 5209, 6577, 1662, 6705, 1694, 1726, 6730, 6777, 6825, 6865, 64, 8, 6905, 1757, 5233, 1781, 5257, 6825, 6954, 7002, 7050, 8, 8, 8, 7097, 64, 64, 8, 8, 57413, 57413, 1805, 5281, 64, 7122, 7170, 7218, 8, 8, 8, 7265, 8, 8, 8, 8, 57413, 57413, 1829, 5329, 57421, 7290, 978, 7338, 64, 64, 7353, 7401, 7441, 64, 8, 7481, 1853, 5305, 1301, 5353, 7401, 1878, 1910, 64, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 960, 3, 3, 832, 2880, 24, 57357, 24, 24, 24, 24, 24, 1942, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 64, 64, 64, 24, 64, 64, 832, 832, 832, 832, 832, 10, 24, 24, 24, 7529, 7585, 24, 7665, 7721, 24, 24, 24, 24, 7802, 24, 1974, 24, 24, 24, 24, 24, 24, 24, 24, 7826, 7850, 7874, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 7897, 24, 24, 24, 24, 24, 24, 24, 10, 960, 832, 832, 832, 960, 64, 64, 64, 64, 64, 832, 832, 832, 832, 832, 832, 8001, 3905, 64, 64, 8017, 8033, 8049, 8065, 8081, 8097, 8114, 2005, 8130, 8146, 8162, 3953, 8001, 201, 105, 121, 8017, 8033, 8049, 8065, 8081, 8097, 8114, 2029, 8130, 8146, 8162, 64, 57, 3849, 217, 873, 4089, 585, 3921, 857, 3937, 3953, 3993, 473, 4009, 64, 64, 64, 24, 24, 24, 24, 24, 24, 24, 24, 8177, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 2054, 2086, 4441, 2117, 24, 2150, 2182, 4113, 24, 2213, 3889, 585, 585, 585, 585, 8201, 3905, 3905, 857, 857, 24, 3953, 8225, 24, 24, 3993, 8249, 617, 617, 617, 24, 24, 8265, 2245, 8289, 24, 5073, 24, 8313, 24, 5073, 24, 3921, 8337, 3817, 4441, 24, 3849, 3849, 4505, 64, 3937, 217, 8361, 8385, 8409, 8433, 3905, 24, 2277, 8457, 4273, 4273, 8457, 2309, 24, 24, 24, 24, 3833, 3833, 3849, 3905, 601, 24, 24, 24, 24, 8, 24, 8481, 8529, 8577, 8633, 8681, 8729, 8777, 8825, 8873, 8921, 8969, 9017, 9065, 9113, 9161, 9209, 3905, 9249, 2333, 9273, 4233, 9297, 2365, 9321, 9361, 873, 9385, 2397, 857, 4441, 3833, 3937, 3905, 9249, 2429, 9273, 4233, 9297, 2461, 9321, 9361, 873, 9385, 2493, 857, 4441, 3833, 3937, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 201, 105, 121, 8017, 8033, 8049, 8065, 8081, 8097, 9729, 9753, 9777, 9801, 9825, 9849, 9873, 9897, 9921, 9945, 9969, 2590, 2622, 2654, 2686, 2718, 2750, 2782, 2814, 2846, 9994, 10034, 10074, 10114, 10154, 10194, 10234, 10274, 10314, 10354, 10394, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 2878, 2910, 2942, 2974, 3006, 3038, 3070, 3102, 3134, 3166, 3198, 3230, 3262, 3294, 3326, 3358, 3390, 3422, 3454, 3486, 3518, 3550, 3582, 3614, 3646, 3678, 57, 3817, 4441, 3833, 3849, 4505, 3889, 585, 3905, 601, 3921, 857, 3937, 3953, 217, 3993, 8249, 617, 473, 4009, 4025, 4233, 633, 873, 649, 5073, 57, 3817, 4441, 3833, 3849, 4505, 3889, 585, 3905, 601, 3921, 857, 3937, 3953, 217, 3993, 8249, 617, 473, 4009, 4025, 4233, 633, 873, 649, 5073, 8001, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 64, 57357, 8, 10609, 3797, 10633, 8, 8, 57469, 8, 57373, 8, 57405, 8, 4065, 4737, 4041, 4417, 8, 57357, 8, 8, 57373, 8, 8, 8, 8, 8, 8, 601, 4233, 10657, 10681, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 8, 24, 24, 24, 24, 24, 24, 57405, 8, 57373, 8, 13064, 13064, 13064, 57357, 8, 64, 64, 64, 64, 64, 24, 24, 24, 24, 24, 24, 24, 10005, 10037, 10069, 10101, 10133, 10165, 10197, 10229, 10261, 10293, 10325, 10357, 10389, 10421, 10453, 10485, 10517, 10549, 10581, 10613, 10645, 10677, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 10, 24, 10705, 24, 24, 8, 8, 8, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 13064, 13064, 13064, 13064, 12312, 12312, 24, 24, 24, 24, 24, 24, 57637, 24, 10709, 10741, 10773, 24, 8, 24, 24, 24, 11093, 11125, 11157, 11189, 11221, 11253, 11253, 11253, 11285, 11285, 11285, 11285, 11317, 11317, 11317, 11349, 11381, 11381, 10901, 10901, 11381, 11381, 11413, 11413, 11381, 11381, 10901, 10901, 11381, 11381, 11349, 11349, 11445, 11445, 11477, 11477, 64, 11509, 11541, 11573, 11573, 11605, 11637, 11669, 11701, 11733, 11765, 11797, 11829, 11861, 11861, 11893, 11925, 11925, 11957, 11989, 11893, 12021, 12053, 12021, 11893, 12085, 12117, 12149, 12181, 12213, 11541, 11509, 12245, 12277, 12309, 12341, 12373, 12405, 12437, 12469, 12501, 12533, 12565, 64, 24, 24, 12597, 12629, 12661, 12693, 12725, 12757, 12789, 12821, 12853, 12885, 12661, 12917, 12949, 12981, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 13986, 14034, 14082, 14130, 13013, 13045, 13077, 13109, 24, 24, 24, 24, 24, 24, 24, 24, 13141, 14177, 14201, 14225, 14249, 14273, 14297, 14321, 14345, 14369, 14393, 14417, 14441, 14465, 14489, 14513, 13173, 13205, 13237, 13269, 13301, 13301, 13333, 13365, 13397, 13429, 13461, 13493, 13525, 13557, 13589, 13621, 13653, 13685, 13717, 13749, 13781, 13813, 13845, 13877, 13909, 13941, 13973, 14005, 14537, 14593, 14037, 24, 14069, 14101, 14133, 14165, 14197, 14229, 14261, 14293, 14325, 14357, 14389, 14421, 14453, 14485, 14517, 14549, 14581, 14613, 14645, 14677, 14709, 14741, 14773, 14805, 14837, 14869, 14901, 14933, 14965, 14997, 15029, 15061, 15093, 15125, 15157, 15189, 15221, 15253, 4757, 15285, 15317, 15349, 15381, 15413, 15445, 15477, 9141, 15509, 15541, 14649, 14673, 14697, 14721, 14745, 14769, 14793, 14817, 14841, 14865, 14889, 14913, 14937, 14961, 14985, 15009, 15049, 15089, 15129, 15169, 15209, 15249, 15289, 15329, 15369, 15417, 15465, 15513, 15573, 15537, 15605, 15637, 15661, 15685, 15709, 15733, 15733, 15709, 15757, 2005, 15781, 15805, 15829, 15853, 15877, 15901, 15925, 15949, 15973, 15997, 16021, 16045, 16045, 16069, 16069, 16093, 16093, 16117, 16141, 16165, 16189, 16213, 16213, 16237, 16237, 16237, 16261, 16285, 16309, 16333, 16309, 16357, 16381, 16261, 16405, 16429, 16429, 16429, 15561, 15617, 15721, 15825, 15929, 16009, 16113, 16193, 16273, 16401, 16505, 16585, 16665, 16745, 16849, 16953, 17033, 17113, 17169, 17249, 17353, 17457, 17513, 17641, 17793, 17921, 18001, 18129, 18257, 18361, 18441, 18521, 18601, 18705, 18833, 18937, 19017, 19097, 19177, 19233, 19289, 19345, 19401, 19481, 19561, 19689, 19769, 19873, 20001, 20081, 20137, 20193, 20321, 20425, 20553, 20633, 20761, 20817, 20897, 20977, 21057, 21137, 21217, 21321, 21401, 21457, 21537, 21617, 21697, 21801, 21881, 21961, 22041, 22169, 22273, 22329, 22457, 22513, 22617, 22721, 22801, 22881, 22961, 23065, 23121, 23201, 23305, 23361, 23489, 23569, 23609, 23649, 23689, 23729, 23769, 23809, 23849, 23889, 23929, 23969, 24017, 24065, 24113, 24161, 24209, 24257, 24305, 24353, 24401, 24449, 24497, 24545, 24593, 24641, 16453, 24689, 24713, 16485, 24737, 24761, 24785, 16517, 16517, 24809, 24833, 24889, 24945, 25001, 25057, 25161, 25185, 16549, 25209, 25233, 25257, 25281, 25305, 16581, 25329, 25369, 25393, 16613, 16613, 25417, 25441, 25465, 16645, 16677, 16709, 16741, 16773, 25489, 25513, 25537, 25561, 25585, 16805, 25609, 25633, 25657, 16837, 16869, 25681, 16901, 16933, 16965, 25705, 16997, 25729, 25777, 25161, 17029, 17061, 17093, 17125, 25833, 25897, 25969, 25993, 17157, 26017, 26041, 26065, 17189, 26089, 26113, 26089, 26137, 26161, 17221, 26185, 26209, 26185, 17253, 17285, 64, 26233, 26257, 26281, 26305, 64, 26361, 26385, 26409, 26433, 26457, 26481, 25657, 26505, 26529, 26553, 17317, 26577, 25281, 17349, 17381, 26601, 64, 17413, 26625, 26649, 26673, 26697, 26721, 26769, 26817, 26857, 26897, 26937, 26977, 27017, 27057, 27097, 27137, 27177, 27225, 27273, 27321, 27369, 27417, 27465, 27513, 27561, 27609, 27657, 27705, 27753, 27801, 27849, 27897, 27945, 27993, 28041, 28089, 28137, 28185, 17445, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 8, 13064, 13080, 13080, 13080, 24, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 24, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 3745, 28233, 13064, 13064, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 8, 8, 8, 8, 8, 8, 8, 8, 8, 24, 24, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 8, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57597, 8, 8, 8, 8, 8, 8, 8, 8, 57373, 8, 57405, 8, 17477, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 8, 24, 24, 57405, 8, 4569, 8, 8, 57357, 8, 57357, 8, 8, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 28257, 4137, 4545, 28281, 4641, 8, 28305, 28329, 4665, 17509, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 57357, 8, 25869, 25901, 25933, 25965, 25997, 26029, 26061, 26093, 26125, 26157, 26189, 26221, 26253, 26285, 8, 8, 26317, 8, 26349, 8, 8, 26381, 26413, 26445, 26477, 26509, 26541, 26573, 26605, 26637, 26669, 8, 26701, 8, 26733, 8, 8, 26765, 26797, 8, 8, 8, 26829, 26861, 26893, 26925, 26957, 26989, 27021, 27053, 27085, 27117, 27149, 27181, 27213, 27245, 27277, 27309, 27341, 27373, 27405, 27437, 27469, 27501, 31437, 31469, 31501, 31533, 31565, 31597, 31629, 31661, 31693, 31725, 31757, 31789, 31821, 31853, 31885, 28441, 28481, 28521, 31917, 31949, 31981, 28561, 28601, 28641, 32013, 32045, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 28681, 28705, 28729, 32077, 32109, 28753, 28753, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 28777, 28817, 28857, 28897, 28937, 64, 64, 64, 64, 64, 28977, 13064, 29017, 29057, 8361, 8433, 29081, 29105, 29129, 29153, 29177, 29201, 8114, 29225, 29265, 29305, 29361, 29417, 29457, 29497, 29537, 29577, 29617, 29657, 29697, 29737, 64, 29777, 29817, 29857, 29897, 29937, 64, 29977, 64, 30017, 30057, 64, 30097, 30137, 64, 30177, 30217, 30257, 30297, 30337, 30377, 30417, 30457, 30497, 30537, 30577, 30577, 30601, 30601, 30601, 30601, 30625, 30625, 30625, 30625, 30649, 30649, 30649, 30649, 30673, 30673, 30673, 30673, 30697, 30697, 30697, 30697, 30721, 30721, 30721, 30721, 30745, 30745, 30745, 30745, 30769, 30769, 30769, 30769, 30793, 30793, 30793, 30793, 30817, 30817, 30817, 30817, 30841, 30841, 30841, 30841, 30865, 30865, 30865, 30865, 30889, 30889, 30913, 30913, 30937, 30937, 30961, 30961, 30985, 30985, 31009, 31009, 31033, 31033, 31033, 31033, 31057, 31057, 31057, 31057, 31081, 31081, 31081, 31081, 31105, 31105, 31105, 31105, 31129, 31129, 31153, 31153, 31153, 31153, 31177, 31177, 31201, 31201, 31201, 31201, 31225, 31225, 31225, 31225, 31249, 31249, 31273, 31273, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 31297, 31297, 31297, 31297, 31321, 31321, 31345, 31345, 31369, 31369, 1145, 31393, 31393, 31417, 31417, 31441, 31441, 31465, 31465, 31465, 31465, 31489, 31489, 31513, 31513, 31553, 31553, 31593, 31593, 31633, 31633, 31673, 31673, 31713, 31713, 31753, 31753, 31753, 31793, 31793, 31793, 31833, 31833, 31833, 31833, 34377, 34417, 34457, 34497, 34537, 34577, 34617, 34657, 34697, 34737, 34777, 34817, 34857, 34897, 34937, 34977, 35017, 35057, 35097, 35137, 35177, 35217, 35257, 35297, 35337, 35377, 35417, 35457, 35497, 35537, 35578, 35626, 35674, 35722, 35770, 35818, 35865, 35905, 31937, 35945, 31793, 31977, 35985, 36025, 32137, 36065, 32177, 32217, 36105, 36145, 32377, 36185, 32417, 32457, 36225, 36265, 32537, 36305, 32577, 32617, 33777, 33817, 33937, 33977, 34017, 34177, 34217, 34257, 34297, 34457, 34497, 34537, 36345, 34697, 36385, 36425, 34937, 36465, 34977, 35017, 35537, 36505, 36545, 35337, 36585, 35377, 35417, 31857, 31897, 36625, 31937, 36665, 32017, 32057, 32097, 32137, 36705, 32257, 32297, 32337, 32377, 36745, 32537, 32657, 32697, 32737, 32777, 32817, 32897, 32937, 32977, 33017, 33057, 33097, 36785, 33137, 33177, 33217, 33257, 33297, 33337, 33417, 33457, 33497, 33537, 33577, 33617, 33657, 33697, 33737, 33857, 33897, 34057, 34097, 34137, 34177, 34217, 34337, 34377, 34417, 34457, 36825, 34577, 34617, 34657, 34697, 34817, 34857, 34897, 34937, 36865, 35057, 35097, 36905, 35217, 35257, 35297, 35337, 36945, 31937, 36665, 32137, 36705, 32377, 36745, 32537, 36985, 33057, 37025, 37065, 37105, 34177, 34217, 34457, 34937, 36865, 35337, 36945, 37145, 37201, 37257, 37313, 37353, 37393, 37433, 37473, 37513, 37553, 37593, 37633, 37673, 37713, 37753, 37793, 37833, 37873, 37913, 37953, 37993, 38033, 38073, 38113, 38153, 38193, 37065, 38233, 38273, 38313, 38353, 37313, 37353, 37393, 37433, 37473, 37513, 37553, 37593, 37633, 37673, 37713, 37753, 37793, 37833, 37873, 37913, 37953, 37993, 38033, 38073, 38113, 38153, 38193, 37065, 38233, 38273, 38313, 38353, 38113, 38153, 38193, 37065, 37025, 37105, 33377, 32937, 32977, 33017, 38113, 38153, 38193, 33377, 33417, 38393, 38393, 24, 24, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 38433, 38489, 38489, 38545, 38601, 38657, 38713, 38769, 38825, 38825, 38881, 38937, 38993, 39049, 39105, 39161, 39161, 39217, 39273, 39273, 39329, 39329, 39385, 39441, 39441, 39497, 39553, 39553, 39609, 39609, 39665, 39721, 39721, 39777, 39777, 39833, 39889, 39945, 40001, 40001, 40057, 40113, 40169, 40225, 40281, 40281, 40337, 40393, 43417, 43473, 43529, 43249, 39945, 39385, 43585, 43641, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 43697, 43753, 43809, 43881, 43953, 44025, 44097, 44169, 44241, 44313, 44370, 44642, 44769, 24, 64, 64, 13248, 13248, 13248, 13248, 13248, 13248, 13248, 13248, 13248, 13248, 13248, 13248, 13248, 13248, 13248, 13248, 44842, 32141, 64, 44858, 962, 44874, 44890, 32173, 32205, 64, 64, 64, 64, 64, 64, 64, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 64, 32237, 32269, 44906, 44906, 8146, 8162, 44922, 44938, 32301, 32333, 32365, 32301, 32397, 32429, 32397, 32461, 32493, 32525, 32493, 32557, 24, 24, 44954, 44970, 32590, 32622, 32654, 32686, 44906, 44906, 44906, 44842, 32717, 64, 64, 962, 44858, 44890, 44874, 32749, 8146, 8162, 44922, 44938, 32461, 32557, 44986, 45002, 45018, 8114, 45033, 45050, 45066, 8130, 64, 45082, 45098, 45114, 45130, 64, 64, 64, 64, 32782, 45145, 32814, 2056, 32846, 64, 32878, 45185, 32910, 45225, 32942, 45265, 32974, 45305, 33006, 45345, 45385, 45409, 45409, 45433, 45433, 45457, 45457, 45481, 45481, 45505, 45505, 45505, 45505, 45529, 45529, 45553, 45553, 45553, 45553, 45577, 45577, 45601, 45601, 45601, 45601, 45625, 45625, 45625, 45625, 45649, 45649, 45649, 45649, 45673, 45673, 45673, 45673, 45697, 45697, 45697, 45697, 45721, 45721, 45745, 45745, 45769, 45769, 45793, 45793, 45817, 45817, 45817, 45817, 45841, 45841, 45841, 45841, 45865, 45865, 45865, 45865, 45889, 45889, 45889, 45889, 45913, 45913, 45913, 45913, 45937, 45937, 45937, 45937, 45961, 45961, 45961, 45961, 45985, 45985, 45985, 45985, 46009, 46009, 46009, 46009, 46033, 46033, 46033, 46033, 46057, 46057, 46057, 46057, 46081, 46081, 46081, 46081, 46105, 46105, 46105, 46105, 46129, 46129, 46129, 46129, 46153, 46153, 46153, 46153, 46177, 46177, 31489, 31489, 46201, 46201, 46201, 46201, 46225, 46225, 46265, 46265, 46305, 46305, 46345, 46345, 64, 64, 960, 64, 44874, 46386, 44986, 45098, 45114, 45002, 46402, 8146, 8162, 45018, 8114, 44842, 45033, 10705, 46418, 8001, 201, 105, 121, 8017, 8033, 8049, 8065, 8081, 8097, 44858, 962, 45050, 8130, 45066, 44890, 45130, 57, 3817, 4441, 3833, 3849, 4505, 3889, 585, 3905, 601, 3921, 857, 3937, 3953, 217, 3993, 8249, 617, 473, 4009, 4025, 4233, 633, 873, 649, 5073, 44954, 45082, 44970, 46434, 44906, 7338, 57, 3817, 4441, 3833, 3849, 4505, 3889, 585, 3905, 601, 3921, 857, 3937, 3953, 217, 3993, 8249, 617, 473, 4009, 4025, 4233, 633, 873, 649, 5073, 44922, 46450, 44938, 46466, 33037, 33069, 10705, 33101, 33101, 33133, 33165, 33197, 33229, 33261, 33293, 33325, 33357, 33389, 33421, 33453, 33485, 33517, 33549, 33581, 33613, 33645, 33677, 33709, 33741, 33773, 33805, 33837, 33869, 33261, 33901, 33933, 33357, 33965, 33997, 34029, 34061, 34093, 34125, 34157, 34189, 34061, 34221, 34061, 34253, 34253, 34285, 34285, 34317, 34125, 34349, 34381, 34349, 34413, 34381, 34445, 34445, 34477, 34477, 34509, 34509, 34381, 33101, 34541, 34573, 64, 34605, 34637, 34669, 34701, 34669, 34733, 34765, 34797, 34797, 34829, 34829, 34861, 34861, 34829, 34829, 34893, 34925, 34957, 34989, 35021, 35053, 35053, 35053, 35085, 35085, 35085, 35085, 34797, 34797, 34797, 64, 64, 64, 34637, 34605, 35117, 34605, 34637, 34605, 64, 64, 35149, 34637, 35181, 35117, 35181, 34637, 64, 64, 35213, 35245, 34989, 35181, 35117, 35181, 64, 64, 35277, 35309, 35277, 64, 64, 64, 46481, 46505, 46529, 35342, 46553, 46577, 35373, 64, 35405, 35437, 35469, 35437, 35501, 35533, 35565, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 832, 832, 832, 64, 64, 64, 64, 2568, 2568, 2568, 2568, 2568, 3080, 2056, 3080, 2072, 3080, 3080, 2056, 2056, 2312, 3080, 3080, 3080, 3080, 3080, 2568, 2568, 2568, 2568, 2312, 2568, 2568, 2568, 2568, 2568, 3080, 2568, 2568, 2568, 3080, 2056, 2056, 3080, 13064, 13064, 64, 64, 64, 64, 2584, 2584, 2584, 2584, 3096, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 64, 64, 64, 64, 64, 64, 64, 64, 64, 2568, 3080, 2568, 3080, 3080, 3080, 2568, 2568, 2568, 3080, 2568, 2568, 3080, 2568, 3080, 3080, 2568, 3080, 64, 64, 64, 64, 64, 64, 64, 2072, 2072, 2072, 2072, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 3096, 3096, 3096, 3096, 2584, 2584, 2072, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 13064, 13064, 12296, 12296, 64, 8, 8, 8, 8, 8, 8, 8, 8, 64, 64, 8, 8, 64, 64, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 64, 8, 8, 8, 8, 8, 8, 8, 64, 8, 8, 64, 8, 8, 8, 8, 8, 64, 13064, 13064, 8, 12296, 12296, 13064, 12296, 12296, 12296, 12296, 64, 64, 12296, 12296, 64, 64, 12296, 12296, 14344, 64, 64, 8, 64, 64, 64, 64, 64, 64, 12296, 64, 64, 64, 64, 64, 8, 8, 8, 8, 8, 12296, 12296, 64, 64, 13064, 13064, 13064, 13064, 13064, 13064, 13064, 64, 64, 64, 13064, 13064, 13064, 13064, 13064, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 8, 8, 8, 8, 8, 8, 8, 64, 64, 8, 64, 64, 8, 8, 8, 8, 8, 8, 8, 8, 64, 8, 8, 64, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 12296, 12296, 12296, 12296, 12296, 12296, 64, 12296, 12296, 64, 64, 13064, 13064, 14344, 15112, 8, 57, 3817, 4441, 3833, 3849, 4505, 3889, 585, 3905, 601, 3921, 857, 3937, 3953, 217, 3993, 8249, 617, 473, 4009, 4025, 4233, 633, 873, 649, 5073, 57, 3817, 4441, 3833, 3849, 4505, 3889, 585, 3905, 601, 3921, 857, 3937, 3953, 217, 3993, 8249, 617, 473, 4009, 4025, 4233, 633, 873, 649, 5073, 57, 3817, 4441, 3833, 3849, 4505, 3889, 585, 3905, 601, 3921, 857, 3937, 3953, 217, 3993, 8249, 617, 473, 4009, 4025, 4233, 633, 873, 649, 5073, 57, 3817, 4441, 3833, 3849, 4505, 3889, 64, 3905, 601, 3921, 857, 3937, 3953, 217, 3993, 8249, 617, 473, 4009, 4025, 4233, 633, 873, 649, 5073, 57, 3817, 4441, 3833, 3849, 4505, 3889, 585, 3905, 601, 3921, 857, 3937, 3953, 217, 3993, 8249, 617, 473, 4009, 4025, 4233, 633, 873, 649, 5073, 57, 3817, 4441, 3833, 3849, 4505, 3889, 585, 3905, 601, 3921, 857, 3937, 3953, 217, 3993, 8249, 617, 473, 4009, 4025, 4233, 633, 873, 649, 5073, 57, 64, 4441, 3833, 64, 64, 3889, 64, 64, 601, 3921, 64, 64, 3953, 217, 3993, 8249, 64, 473, 4009, 4025, 4233, 633, 873, 649, 5073, 57, 3817, 4441, 3833, 64, 4505, 64, 585, 3905, 601, 3921, 857, 3937, 3953, 64, 3993, 8249, 617, 473, 4009, 4025, 4233, 633, 873, 649, 5073, 57, 3817, 4441, 3833, 3849, 4505, 3889, 585, 3905, 601, 3921, 857, 3937, 3953, 217, 3993, 8249, 617, 473, 4009, 4025, 4233, 633, 873, 649, 5073, 57, 3817, 4441, 3833, 3849, 4505, 3889, 585, 3905, 601, 3921, 857, 3937, 3953, 217, 3993, 8249, 617, 473, 4009, 4025, 4233, 633, 873, 649, 5073, 57, 3817, 64, 3833, 3849, 4505, 3889, 64, 64, 601, 3921, 857, 3937, 3953, 217, 3993, 8249, 64, 473, 4009, 4025, 4233, 633, 873, 649, 64, 57, 3817, 4441, 3833, 3849, 4505, 3889, 585, 3905, 601, 3921, 857, 3937, 3953, 217, 3993, 8249, 617, 473, 4009, 4025, 4233, 633, 873, 649, 5073, 57, 3817, 64, 3833, 3849, 4505, 3889, 64, 3905, 601, 3921, 857, 3937, 64, 217, 64, 64, 64, 473, 4009, 4025, 4233, 633, 873, 649, 64, 57, 3817, 4441, 3833, 3849, 4505, 3889, 585, 3905, 601, 3921, 857, 3937, 3953, 217, 3993, 8249, 617, 473, 4009, 4025, 4233, 633, 873, 649, 5073, 57, 3817, 4441, 3833, 3849, 4505, 3889, 585, 3905, 601, 3921, 857, 3937, 3953, 217, 3993, 8249, 617, 473, 4009, 4025, 4233, 633, 873, 649, 5073, 57, 3817, 4441, 3833, 3849, 4505, 3889, 585, 3905, 601, 3921, 857, 3937, 3953, 217, 3993, 8249, 617, 473, 4009, 4025, 4233, 633, 873, 649, 5073, 57, 3817, 4441, 3833, 3849, 4505, 3889, 585, 3905, 601, 3921, 857, 3937, 3953, 217, 3993, 8249, 617, 473, 4009, 4025, 4233, 633, 873, 649, 5073, 57, 3817, 4441, 3833, 3849, 4505, 3889, 585, 3905, 601, 3921, 857, 3937, 3953, 217, 3993, 8249, 617, 473, 4009, 4025, 4233, 633, 873, 649, 5073, 57, 3817, 4441, 3833, 3849, 4505, 3889, 585, 3905, 601, 3921, 857, 3937, 3953, 217, 3993, 8249, 617, 473, 4009, 4025, 4233, 633, 873, 649, 5073, 57, 3817, 4441, 3833, 3849, 4505, 3889, 585, 3905, 601, 3921, 857, 3937, 3953, 217, 3993, 8249, 617, 473, 4009, 4025, 4233, 633, 873, 649, 5073, 57, 3817, 4441, 3833, 3849, 4505, 3889, 585, 3905, 601, 3921, 857, 3937, 3953, 217, 3993, 8249, 617, 473, 4009, 4025, 4233, 633, 873, 649, 5073, 57, 3817, 4441, 3833, 3849, 4505, 3889, 585, 3905, 601, 3921, 857, 3937, 3953, 217, 3993, 8249, 617, 473, 4009, 4025, 4233, 633, 873, 649, 5073, 57, 3817, 4441, 3833, 3849, 4505, 3889, 585, 3905, 601, 3921, 857, 3937, 3953, 217, 3993, 8249, 617, 473, 4009, 4025, 4233, 633, 873, 649, 5073, 57, 3817, 4441, 3833, 3849, 4505, 3889, 585, 3905, 601, 3921, 857, 3937, 3953, 217, 3993, 8249, 617, 473, 4009, 4025, 4233, 633, 873, 649, 5073, 57, 3817, 4441, 3833, 3849, 4505, 3889, 585, 3905, 601, 3921, 857, 3937, 3953, 217, 3993, 8249, 617, 473, 4009, 4025, 4233, 633, 873, 649, 5073, 57, 3817, 4441, 3833, 3849, 4505, 3889, 585, 3905, 601, 3921, 857, 3937, 3953, 217, 3993, 8249, 617, 473, 4009, 4025, 4233, 633, 873, 649, 5073, 47825, 47849, 64, 64, 47873, 4249, 4273, 4297, 47897, 47921, 47945, 5161, 6705, 47969, 47993, 48017, 48041, 48065, 48089, 8457, 4369, 5161, 48113, 48137, 48161, 4321, 4345, 48185, 8313, 48209, 47873, 4249, 4273, 4297, 47897, 47921, 47945, 5161, 6705, 47969, 47993, 48017, 48041, 48065, 48089, 8457, 4369, 48113, 48113, 48137, 48161, 4321, 4345, 48185, 8313, 48241, 47897, 5161, 47969, 4321, 4369, 8457, 47873, 4249, 4273, 4297, 47897, 47921, 47945, 5161, 6705, 47969, 47993, 48017, 48041, 48065, 48089, 8457, 4369, 5161, 48113, 48137, 48161, 4321, 4345, 48185, 8313, 48209, 47873, 4249, 4273, 4297, 47897, 47921, 47945, 5161, 6705, 47969, 47993, 48017, 48041, 48065, 48089, 8457, 4369, 48113, 48113, 48137, 48161, 4321, 4345, 48185, 8313, 48241, 47897, 5161, 47969, 4321, 4369, 8457, 47873, 4249, 4273, 4297, 47897, 47921, 47945, 5161, 6705, 47969, 47993, 48017, 48041, 48065, 48089, 8457, 4369, 5161, 48113, 48137, 48161, 4321, 4345, 48185, 8313, 48209, 47873, 4249, 4273, 4297, 47897, 47921, 47945, 5161, 6705, 47969, 47993, 48017, 48041, 48065, 48089, 8457, 4369, 48113, 48113, 48137, 48161, 4321, 4345, 48185, 8313, 48241, 47897, 5161, 47969, 4321, 4369, 8457, 47873, 4249, 4273, 4297, 47897, 47921, 47945, 5161, 6705, 47969, 47993, 48017, 48041, 48065, 48089, 8457, 4369, 5161, 48113, 48137, 48161, 4321, 4345, 48185, 8313, 48209, 47873, 4249, 4273, 4297, 47897, 47921, 47945, 5161, 6705, 47969, 47993, 48017, 48041, 48065, 48089, 8457, 4369, 48113, 48113, 48137, 48161, 4321, 4345, 48185, 8313, 48241, 47897, 5161, 47969, 4321, 4369, 8457, 47873, 4249, 4273, 4297, 47897, 47921, 47945, 5161, 6705, 47969, 47993, 48017, 48041, 48065, 48089, 8457, 4369, 5161, 48113, 48137, 48161, 4321, 4345, 48185, 8313, 48209, 47873, 4249, 4273, 4297, 47897, 47921, 47945, 5161, 6705, 47969, 47993, 48017, 48041, 48065, 48089, 8457, 4369, 48113, 48113, 48137, 48161, 4321, 4345, 48185, 8313, 48241, 47897, 5161, 47969, 4321, 4369, 8457, 48273, 48273, 64, 64, 8001, 201, 105, 121, 8017, 8033, 8049, 8065, 8081, 8097, 8001, 201, 105, 121, 8017, 8033, 8049, 8065, 8081, 8097, 8001, 201, 105, 121, 8017, 8033, 8049, 8065, 8081, 8097, 8001, 201, 105, 121, 8017, 8033, 8049, 8065, 8081, 8097, 8001, 201, 105, 121, 8017, 8033, 8049, 8065, 8081, 8097, 57621, 57621, 57653, 57653, 57621, 57621, 57717, 57717, 57621, 57621, 57653, 57653, 57621, 57621, 57845, 57845, 57621, 57621, 57653, 57653, 57621, 57621, 57717, 57717, 57621, 57621, 57653, 57653, 57621, 57621, 35645, 35645, 1205, 1205, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 45529, 45553, 45649, 45721, 64, 46177, 45793, 45673, 45913, 46201, 46057, 46081, 46105, 46129, 45817, 45961, 46009, 45865, 46033, 45769, 45841, 45601, 45625, 45697, 45745, 45889, 45937, 45985, 48297, 31129, 48321, 48345, 64, 45553, 45649, 64, 46153, 64, 64, 45673, 64, 46201, 46057, 46081, 46105, 46129, 45817, 45961, 46009, 45865, 46033, 64, 45841, 45601, 45625, 45697, 64, 45889, 64, 45985, 64, 64, 64, 64, 64, 64, 45649, 64, 64, 64, 64, 45673, 64, 46201, 64, 46081, 64, 46129, 45817, 45961, 64, 45865, 46033, 64, 45841, 64, 64, 45697, 64, 45889, 64, 45985, 64, 31129, 64, 48345, 64, 45553, 45649, 64, 46153, 64, 64, 45673, 45913, 46201, 46057, 64, 46105, 46129, 45817, 45961, 46009, 45865, 46033, 64, 45841, 45601, 45625, 45697, 64, 45889, 45937, 45985, 48297, 64, 48321, 64, 45529, 45553, 45649, 45721, 46153, 46177, 45793, 45673, 45913, 46201, 64, 46081, 46105, 46129, 45817, 45961, 46009, 45865, 46033, 45769, 45841, 45601, 45625, 45697, 45745, 45889, 45937, 45985, 64, 64, 64, 64, 64, 45553, 45649, 45721, 64, 46177, 45793, 45673, 45913, 46201, 64, 46081, 46105, 46129, 45817, 45961, 46009, 45865, 46033, 45769, 45841, 45601, 45625, 45697, 45745, 45889, 45937, 45985, 64, 64, 64, 64, 64, 48370, 48394, 48418, 48442, 48466, 48490, 48514, 48538, 48562, 48586, 24, 24, 24, 24, 24, 48610, 48642, 48674, 48706, 48738, 48770, 48802, 48834, 48866, 48898, 48930, 48962, 48994, 49026, 49058, 49090, 49122, 49154, 49186, 49218, 49250, 49282, 49314, 49346, 49378, 49410, 49441, 4441, 617, 26281, 49505, 24, 57, 3817, 4441, 3833, 3849, 4505, 3889, 585, 3905, 601, 3921, 857, 3937, 3953, 217, 3993, 8249, 617, 473, 4009, 4025, 4233, 633, 873, 649, 5073, 49529, 26089, 49553, 5185, 49577, 49609, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 49633, 49657, 49681, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 49729, 49785, 49841, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 49873, 49905, 49937, 49969, 50001, 50033, 50065, 50097, 50129, 50161, 50193, 50225, 50257, 50289, 50321, 50353, 50385, 50417, 50449, 50481, 50513, 50545, 50577, 50609, 50641, 50673, 50705, 50737, 50769, 50801, 50833, 50865, 50897, 50929, 50961, 50993, 51025, 51057, 51089, 51121, 51153, 51185, 51217, 51249, 64, 64, 64, 64, 52065, 52097, 52129, 35669, 52161, 52193, 52225, 52257, 52289, 52321, 52353, 52385, 52417, 35701, 52449, 52481, 52513, 52545, 35733, 52577, 52609, 50321, 35765, 52641, 52673, 52705, 52737, 52769, 35797, 52801, 52833, 52865, 52897, 52929, 51185, 52961, 52993, 53025, 53057, 53089, 53121, 53153, 53185, 53217, 53249, 53281, 53313, 53345, 53377, 53409, 53409, 53409, 35829, 53441, 53473, 53505, 35861, 53537, 53569, 53601, 53633, 53665, 53697, 53729, 53761, 53793, 53825, 53857, 53889, 53921, 53921, 53953, 53985, 54017, 54049, 54081, 54113, 54145, 54177, 54209, 54241, 54273, 54305, 54337, 54369, 54401, 54433, 54465, 54497, 35893, 54529, 54561, 54593, 50033, 54625, 54657, 35925, 35957, 54689, 54721, 54753, 54785, 54817, 54849, 8256, 54881, 54913, 54913, 35989, 54945, 54977, 55009, 55041, 36021, 55073, 55105, 8256, 55137, 55169, 55201, 55233, 55265, 55297, 36053, 55329, 36085, 55361, 55393, 55425, 55457, 55489, 55521, 55553, 55585, 55617, 55649, 55681, 36117, 55713, 55745, 55777, 55809, 55841, 36149, 55873, 36181, 36213, 55905, 55937, 55937, 55969, 36245, 36277, 56001, 56033, 56065, 56097, 56129, 56161, 56193, 56225, 56257, 56289, 56321, 36309, 56353, 56385, 56417, 56449, 56417, 56481, 56513, 56545, 56577, 56609, 56641, 56673, 56705, 56737, 56769, 56801, 56833, 56865, 56897, 36341, 56929, 56961, 56993, 57025, 57057, 36373, 57089, 58881, 58913, 58945, 58977, 59009, 59041, 36661, 59073, 59105, 59137, 59169, 59201, 59233, 36693, 59265, 59297, 36725, 36757, 59329, 59361, 59393, 59425, 59457, 59489, 59521, 59553, 59585, 36789, 59617, 36821, 59649, 8256, 59681, 59713, 59745, 36853, 59777, 59809, 36885, 36917, 59841, 59873, 59905, 59937, 59969, 59969, 60001, 60033, 60065, 60097, 60129, 60161, 60193, 36949, 60225, 36981, 60257, 37013, 60289, 37045, 37077, 37109, 60321, 60353, 60385, 37141, 37173, 37205, 37237, 60417, 60449, 60449, 60481, 60513, 60545, 60577, 60609, 37269, 60641, 60673, 60705, 60737, 37301, 60769, 37333, 37365, 60801, 60833, 60865, 60897, 60929, 60961, 37397, 37429, 37461, 8256, 60993, 37493, 61025, 61057, 61089, 37525, 61121, 61153, 61185, 61217, 61249, 37557, 61281, 61313, 61345, 61377, 61409, 61441, 37589, 37621, 61473, 37653, 61505, 37685, 61537, 61569, 61601, 37717, 37749, 61633, 37781, 61665, 63265, 63297, 63329, 63361, 63393, 38229, 63425, 63457, 63489, 63521, 63553, 38261, 38293, 63585, 63617, 63649, 63681, 63713, 63745, 38325, 63777, 63809, 63841, 63873, 38357, 38389, 63905, 63937, 63969, 38421, 64001, 64033, 26701, 38453, 64065, 64097, 64129, 38485, 64161, 64193, 64225, 64257, 64289, 64321, 64353, 38517, 64385, 64417, 64449, 38549, 64481, 64513, 64545, 64577, 31597, 38581, 64609, 64641, 64673, 38613, 64705, 38645, 64737, 64737, 64769, 38677, 64801, 64833, 64865, 64897, 64929, 64961, 64993, 38709, 65025, 65057, 65089, 65121, 65153, 65185, 38741, 65217, 38773, 38805, 38837, 65249, 65281, 65313, 65345, 65377, 65409, 65441, 65473, 38869, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64]); idnaIndex = $toNativeArray($kindUint16, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 126, 2, 3, 4, 5, 6, 127, 128, 7, 129, 8, 9, 10, 130, 11, 12, 13, 14, 131, 132, 133, 15, 16, 134, 17, 18, 135, 136, 137, 2, 3, 4, 5, 6, 7, 7, 7, 7, 8, 9, 7, 7, 10, 11, 12, 30, 31, 31, 33, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 138, 19, 139, 140, 141, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 142, 143, 30, 31, 32, 144, 33, 145, 146, 147, 148, 34, 149, 150, 35, 36, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 160, 160, 160, 160, 160, 160, 160, 160, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 37, 38, 39, 196, 40, 40, 41, 40, 197, 42, 43, 44, 45, 46, 47, 198, 48, 49, 199, 156, 200, 201, 156, 156, 202, 156, 156, 156, 203, 50, 51, 52, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 204, 205, 156, 206, 156, 207, 208, 156, 209, 53, 40, 54, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 55, 56, 221, 222, 223, 224, 57, 58, 225, 226, 59, 60, 61, 62, 63, 64, 65, 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, 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, 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, 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, 156, 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, 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, 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, 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, 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, 160, 160, 160, 160, 160, 227, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 228, 229, 160, 160, 160, 160, 230, 66, 67, 231, 68, 69, 70, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 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, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 249, 250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 252, 253, 254, 255, 71, 256, 257, 72, 73, 74, 75, 76, 258, 77, 78, 79, 80, 81, 259, 82, 83, 84, 85, 86, 87, 88, 89, 90, 260, 261, 160, 262, 263, 156, 264, 265, 251, 251, 266, 267, 268, 269, 270, 271, 272, 160, 273, 274, 275, 276, 251, 251, 160, 160, 160, 160, 277, 278, 251, 251, 279, 280, 281, 282, 283, 251, 284, 285, 286, 287, 288, 91, 289, 290, 92, 251, 291, 292, 293, 294, 295, 251, 251, 251, 251, 296, 297, 251, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 251, 311, 312, 93, 94, 251, 251, 313, 314, 315, 316, 251, 251, 317, 318, 319, 320, 321, 322, 323, 251, 251, 251, 324, 251, 325, 326, 95, 327, 328, 329, 330, 331, 332, 333, 251, 251, 251, 251, 334, 335, 336, 251, 337, 338, 339, 251, 251, 251, 251, 340, 251, 251, 341, 342, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 343, 251, 156, 344, 160, 160, 160, 345, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 346, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 160, 160, 160, 160, 160, 160, 160, 160, 160, 347, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 160, 160, 160, 160, 160, 160, 160, 160, 333, 348, 251, 349, 350, 351, 352, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 353, 354, 251, 160, 355, 356, 357, 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, 160, 160, 160, 160, 160, 358, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 359, 360, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 160, 160, 160, 160, 361, 362, 160, 160, 160, 160, 160, 363, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 160, 364, 365, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 156, 156, 156, 366, 367, 368, 369, 370, 156, 371, 251, 372, 156, 373, 251, 251, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 156, 156, 156, 156, 156, 156, 156, 156, 374, 375, 376, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 377, 251, 251, 251, 378, 379, 251, 251, 251, 251, 251, 380, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 291, 291, 291, 381, 112, 382, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 383, 384, 251, 385, 251, 251, 251, 113, 114, 115, 386, 251, 251, 251, 251, 387, 156, 388, 389, 116, 117, 390, 391, 118, 392, 251, 251, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 393, 156, 394, 156, 395, 396, 397, 398, 251, 156, 399, 156, 400, 156, 401, 402, 403, 156, 156, 404, 405, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 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, 160, 406, 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, 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, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 407, 160, 160, 160, 408, 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, 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, 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, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 409, 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, 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, 410, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 119, 120, 121, 411, 122, 123, 412, 124, 125, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 413, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 14, 15, 16, 17, 11, 18, 7, 19, 11, 11, 20, 11, 21, 22, 23, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 24, 25, 26, 7, 27, 28, 7, 29, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 414, 415, 251, 251, 416, 416, 416, 417, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 32, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); idnaSparseOffset = new sliceType([0, 8, 25, 37, 39, 44, 51, 62, 74, 78, 93, 98, 108, 120, 133, 139, 148, 164, 178, 189, 202, 219, 229, 236, 249, 266, 273, 284, 299, 313, 323, 325, 330, 333, 336, 338, 350, 361, 369, 375, 381, 386, 391, 394, 398, 404, 409, 421, 431, 437, 454, 464, 467, 475, 478, 491, 499, 503, 510, 518, 534, 546, 549, 559, 571, 583, 595, 603, 608, 621, 638, 642, 653, 657, 666, 674, 680, 685, 688, 692, 698, 702, 706, 710, 716, 724, 731, 742, 752, 756, 759, 765, 769, 771, 774, 776, 779, 789, 792, 807, 811, 816, 819, 823, 828, 833, 839, 856, 872, 878, 882, 897, 902, 910, 920, 931, 939, 956, 965, 981, 994, 1006, 1011, 1024, 1028, 1033, 1035, 1037, 1041, 1043, 1047, 1056, 1062, 1066, 1082, 1092, 1097, 1100, 1106, 1113, 1118, 1122, 1128, 1133, 1142, 1147, 1153, 1160, 1167, 1174, 1178, 1183, 1186, 1191, 1203, 1209, 1214, 1221, 1229, 1234, 1238, 1254, 1261, 1265, 1269, 1276, 1278, 1281, 1284, 1288, 1297, 1301, 1309, 1317, 1325, 1337, 1349, 1355, 1364, 1376, 1383, 1392, 1403, 1410, 1425, 1438, 1451, 1460, 1464, 1479, 1487, 1498, 1507, 1513, 1521, 1530, 1541, 1544, 1556, 1565, 1568, 1573, 1582, 1587, 1600, 1611, 1620, 1630, 1633, 1643, 1652, 1664, 1677, 1690, 1704, 1711, 1715, 1719, 1722, 1727, 1730, 1735, 1738, 1745, 1752, 1756, 1767, 1770, 1773, 1776, 1782, 1788, 1797, 1800, 1803, 1806, 1809, 1816, 1819, 1824, 1834, 1837, 1841, 1856, 1868, 1872, 1877, 1881, 1886, 1890, 1895, 1904, 1915, 1921, 1927, 1933, 1939, 1948, 1951, 1954, 1958, 1962, 1966, 1972, 1978, 1983, 1986, 2002, 2009, 2012, 2017, 2021, 2027, 2034, 2038, 2042, 2051, 2058, 2063, 2067, 2081, 2084, 2087, 2091, 2095, 2098, 2114, 2131, 2134, 2139, 2141, 2143]); idnaSparseValues = $toNativeArray($kindStruct, [new valueRange.ptr(0, 7, 0), new valueRange.ptr(57605, 128, 150), new valueRange.ptr(24, 151, 151), new valueRange.ptr(57605, 152, 158), new valueRange.ptr(31, 159, 159), new valueRange.ptr(8, 160, 182), new valueRange.ptr(24, 183, 183), new valueRange.ptr(8, 184, 191), new valueRange.ptr(0, 16, 0), new valueRange.ptr(8, 128, 128), new valueRange.ptr(57373, 129, 129), new valueRange.ptr(8, 130, 130), new valueRange.ptr(821, 131, 131), new valueRange.ptr(845, 132, 132), new valueRange.ptr(869, 133, 133), new valueRange.ptr(57357, 134, 134), new valueRange.ptr(8, 135, 135), new valueRange.ptr(57357, 136, 136), new valueRange.ptr(8, 137, 137), new valueRange.ptr(57357, 138, 138), new valueRange.ptr(8, 139, 139), new valueRange.ptr(57357, 140, 140), new valueRange.ptr(8, 141, 141), new valueRange.ptr(57357, 142, 142), new valueRange.ptr(8, 143, 191), new valueRange.ptr(0, 11, 0), new valueRange.ptr(8, 128, 175), new valueRange.ptr(585, 176, 176), new valueRange.ptr(893, 177, 177), new valueRange.ptr(601, 178, 178), new valueRange.ptr(617, 179, 179), new valueRange.ptr(845, 180, 180), new valueRange.ptr(917, 181, 181), new valueRange.ptr(57789, 182, 182), new valueRange.ptr(633, 183, 183), new valueRange.ptr(649, 184, 184), new valueRange.ptr(8, 185, 191), new valueRange.ptr(0, 1, 0), new valueRange.ptr(13064, 128, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(1013, 128, 143), new valueRange.ptr(57605, 144, 159), new valueRange.ptr(1181, 160, 175), new valueRange.ptr(8, 176, 191), new valueRange.ptr(0, 6, 0), new valueRange.ptr(57733, 128, 143), new valueRange.ptr(1349, 144, 150), new valueRange.ptr(64, 151, 152), new valueRange.ptr(8, 153, 153), new valueRange.ptr(24, 154, 159), new valueRange.ptr(8, 160, 191), new valueRange.ptr(0, 10, 0), new valueRange.ptr(8, 128, 134), new valueRange.ptr(1025, 135, 135), new valueRange.ptr(8, 136, 136), new valueRange.ptr(24, 137, 138), new valueRange.ptr(64, 139, 140), new valueRange.ptr(24, 141, 143), new valueRange.ptr(64, 144, 144), new valueRange.ptr(13064, 145, 189), new valueRange.ptr(2072, 190, 190), new valueRange.ptr(13064, 191, 191), new valueRange.ptr(0, 11, 0), new valueRange.ptr(2072, 128, 128), new valueRange.ptr(13064, 129, 130), new valueRange.ptr(2072, 131, 131), new valueRange.ptr(13064, 132, 133), new valueRange.ptr(2072, 134, 134), new valueRange.ptr(13064, 135, 135), new valueRange.ptr(64, 136, 143), new valueRange.ptr(2056, 144, 170), new valueRange.ptr(64, 171, 174), new valueRange.ptr(2056, 175, 180), new valueRange.ptr(64, 181, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(2568, 128, 135), new valueRange.ptr(3080, 136, 153), new valueRange.ptr(2568, 154, 191), new valueRange.ptr(0, 14, 0), new valueRange.ptr(13064, 128, 138), new valueRange.ptr(64, 139, 140), new valueRange.ptr(3080, 141, 141), new valueRange.ptr(2568, 142, 152), new valueRange.ptr(3080, 153, 155), new valueRange.ptr(2568, 156, 170), new valueRange.ptr(3080, 171, 172), new valueRange.ptr(2568, 173, 176), new valueRange.ptr(3080, 177, 177), new valueRange.ptr(2568, 178, 178), new valueRange.ptr(3080, 179, 180), new valueRange.ptr(2568, 181, 183), new valueRange.ptr(3080, 184, 185), new valueRange.ptr(2568, 186, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(2056, 128, 165), new valueRange.ptr(13064, 166, 176), new valueRange.ptr(2056, 177, 177), new valueRange.ptr(64, 178, 191), new valueRange.ptr(0, 9, 0), new valueRange.ptr(2056, 128, 137), new valueRange.ptr(2568, 138, 170), new valueRange.ptr(13064, 171, 179), new valueRange.ptr(2056, 180, 181), new valueRange.ptr(24, 182, 185), new valueRange.ptr(2072, 186, 186), new valueRange.ptr(64, 187, 188), new valueRange.ptr(13064, 189, 189), new valueRange.ptr(2072, 190, 191), new valueRange.ptr(0, 11, 0), new valueRange.ptr(2056, 128, 149), new valueRange.ptr(13064, 150, 153), new valueRange.ptr(2056, 154, 154), new valueRange.ptr(13064, 155, 163), new valueRange.ptr(2056, 164, 164), new valueRange.ptr(13064, 165, 167), new valueRange.ptr(2056, 168, 168), new valueRange.ptr(13064, 169, 173), new valueRange.ptr(64, 174, 175), new valueRange.ptr(2072, 176, 190), new valueRange.ptr(64, 191, 191), new valueRange.ptr(0, 12, 0), new valueRange.ptr(64, 128, 159), new valueRange.ptr(2568, 160, 169), new valueRange.ptr(3080, 170, 172), new valueRange.ptr(2056, 173, 173), new valueRange.ptr(3080, 174, 174), new valueRange.ptr(2568, 175, 176), new valueRange.ptr(3080, 177, 178), new valueRange.ptr(2568, 179, 180), new valueRange.ptr(64, 181, 181), new valueRange.ptr(2568, 182, 184), new valueRange.ptr(3080, 185, 185), new valueRange.ptr(2568, 186, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(2568, 128, 135), new valueRange.ptr(64, 136, 146), new valueRange.ptr(13064, 147, 161), new valueRange.ptr(2112, 162, 162), new valueRange.ptr(13064, 163, 191), new valueRange.ptr(0, 8, 0), new valueRange.ptr(13064, 128, 130), new valueRange.ptr(12296, 131, 131), new valueRange.ptr(8, 132, 185), new valueRange.ptr(13064, 186, 186), new valueRange.ptr(12296, 187, 187), new valueRange.ptr(13064, 188, 188), new valueRange.ptr(8, 189, 189), new valueRange.ptr(12296, 190, 191), new valueRange.ptr(0, 15, 0), new valueRange.ptr(13064, 128, 128), new valueRange.ptr(12296, 129, 130), new valueRange.ptr(64, 131, 133), new valueRange.ptr(12296, 134, 136), new valueRange.ptr(64, 137, 137), new valueRange.ptr(12296, 138, 140), new valueRange.ptr(15112, 141, 141), new valueRange.ptr(64, 142, 143), new valueRange.ptr(8, 144, 144), new valueRange.ptr(64, 145, 150), new valueRange.ptr(12296, 151, 151), new valueRange.ptr(64, 152, 165), new valueRange.ptr(8, 166, 175), new valueRange.ptr(24, 176, 186), new valueRange.ptr(64, 187, 191), new valueRange.ptr(0, 13, 0), new valueRange.ptr(13064, 128, 128), new valueRange.ptr(12296, 129, 131), new valueRange.ptr(13064, 132, 132), new valueRange.ptr(8, 133, 140), new valueRange.ptr(64, 141, 141), new valueRange.ptr(8, 142, 144), new valueRange.ptr(64, 145, 145), new valueRange.ptr(8, 146, 168), new valueRange.ptr(64, 169, 169), new valueRange.ptr(8, 170, 185), new valueRange.ptr(64, 186, 188), new valueRange.ptr(8, 189, 189), new valueRange.ptr(13064, 190, 191), new valueRange.ptr(0, 10, 0), new valueRange.ptr(13064, 128, 129), new valueRange.ptr(12296, 130, 131), new valueRange.ptr(8, 132, 140), new valueRange.ptr(64, 141, 141), new valueRange.ptr(8, 142, 144), new valueRange.ptr(64, 145, 145), new valueRange.ptr(8, 146, 186), new valueRange.ptr(15112, 187, 188), new valueRange.ptr(8, 189, 189), new valueRange.ptr(12296, 190, 191), new valueRange.ptr(0, 12, 0), new valueRange.ptr(64, 128, 128), new valueRange.ptr(13064, 129, 129), new valueRange.ptr(12296, 130, 131), new valueRange.ptr(64, 132, 132), new valueRange.ptr(8, 133, 150), new valueRange.ptr(64, 151, 153), new valueRange.ptr(8, 154, 177), new valueRange.ptr(64, 178, 178), new valueRange.ptr(8, 179, 187), new valueRange.ptr(64, 188, 188), new valueRange.ptr(8, 189, 189), new valueRange.ptr(64, 190, 191), new valueRange.ptr(0, 16, 0), new valueRange.ptr(8, 128, 134), new valueRange.ptr(64, 135, 137), new valueRange.ptr(15112, 138, 138), new valueRange.ptr(64, 139, 142), new valueRange.ptr(12296, 143, 145), new valueRange.ptr(13064, 146, 148), new valueRange.ptr(64, 149, 149), new valueRange.ptr(13064, 150, 150), new valueRange.ptr(64, 151, 151), new valueRange.ptr(12296, 152, 159), new valueRange.ptr(64, 160, 165), new valueRange.ptr(8, 166, 175), new valueRange.ptr(64, 176, 177), new valueRange.ptr(12296, 178, 179), new valueRange.ptr(24, 180, 180), new valueRange.ptr(64, 181, 191), new valueRange.ptr(0, 9, 0), new valueRange.ptr(64, 128, 128), new valueRange.ptr(8, 129, 176), new valueRange.ptr(13064, 177, 177), new valueRange.ptr(8, 178, 178), new valueRange.ptr(2289, 179, 179), new valueRange.ptr(13064, 180, 185), new valueRange.ptr(15112, 186, 186), new valueRange.ptr(64, 187, 190), new valueRange.ptr(24, 191, 191), new valueRange.ptr(0, 6, 0), new valueRange.ptr(8, 128, 134), new valueRange.ptr(13064, 135, 142), new valueRange.ptr(24, 143, 143), new valueRange.ptr(8, 144, 153), new valueRange.ptr(24, 154, 155), new valueRange.ptr(64, 156, 191), new valueRange.ptr(0, 12, 0), new valueRange.ptr(8, 128, 132), new valueRange.ptr(64, 133, 133), new valueRange.ptr(8, 134, 134), new valueRange.ptr(64, 135, 135), new valueRange.ptr(13064, 136, 141), new valueRange.ptr(64, 142, 143), new valueRange.ptr(8, 144, 153), new valueRange.ptr(64, 154, 155), new valueRange.ptr(2401, 156, 156), new valueRange.ptr(2457, 157, 157), new valueRange.ptr(8, 158, 159), new valueRange.ptr(64, 160, 191), new valueRange.ptr(0, 16, 0), new valueRange.ptr(8, 128, 128), new valueRange.ptr(24, 129, 138), new valueRange.ptr(8, 139, 139), new valueRange.ptr(57405, 140, 140), new valueRange.ptr(24, 141, 151), new valueRange.ptr(13064, 152, 153), new valueRange.ptr(24, 154, 159), new valueRange.ptr(8, 160, 169), new valueRange.ptr(24, 170, 180), new valueRange.ptr(13064, 181, 181), new valueRange.ptr(24, 182, 182), new valueRange.ptr(13064, 183, 183), new valueRange.ptr(24, 184, 184), new valueRange.ptr(13064, 185, 185), new valueRange.ptr(24, 186, 189), new valueRange.ptr(12296, 190, 191), new valueRange.ptr(0, 6, 0), new valueRange.ptr(24, 128, 133), new valueRange.ptr(13064, 134, 134), new valueRange.ptr(24, 135, 140), new valueRange.ptr(64, 141, 141), new valueRange.ptr(24, 142, 154), new valueRange.ptr(64, 155, 191), new valueRange.ptr(0, 10, 0), new valueRange.ptr(8, 128, 170), new valueRange.ptr(12296, 171, 172), new valueRange.ptr(13064, 173, 176), new valueRange.ptr(12296, 177, 177), new valueRange.ptr(13064, 178, 183), new valueRange.ptr(12296, 184, 184), new valueRange.ptr(15112, 185, 186), new valueRange.ptr(12296, 187, 188), new valueRange.ptr(13064, 189, 190), new valueRange.ptr(8, 191, 191), new valueRange.ptr(0, 14, 0), new valueRange.ptr(8, 128, 137), new valueRange.ptr(24, 138, 143), new valueRange.ptr(8, 144, 149), new valueRange.ptr(12296, 150, 151), new valueRange.ptr(13064, 152, 153), new valueRange.ptr(8, 154, 157), new valueRange.ptr(13064, 158, 160), new valueRange.ptr(8, 161, 161), new valueRange.ptr(12296, 162, 164), new valueRange.ptr(8, 165, 166), new valueRange.ptr(12296, 167, 173), new valueRange.ptr(8, 174, 176), new valueRange.ptr(13064, 177, 180), new valueRange.ptr(8, 181, 191), new valueRange.ptr(0, 13, 0), new valueRange.ptr(8, 128, 129), new valueRange.ptr(13064, 130, 130), new valueRange.ptr(12296, 131, 132), new valueRange.ptr(13064, 133, 134), new valueRange.ptr(12296, 135, 140), new valueRange.ptr(13064, 141, 141), new valueRange.ptr(8, 142, 142), new valueRange.ptr(12296, 143, 143), new valueRange.ptr(8, 144, 153), new valueRange.ptr(12296, 154, 156), new valueRange.ptr(13064, 157, 157), new valueRange.ptr(24, 158, 159), new valueRange.ptr(64, 160, 191), new valueRange.ptr(0, 9, 0), new valueRange.ptr(64, 128, 134), new valueRange.ptr(1373, 135, 135), new valueRange.ptr(64, 136, 140), new valueRange.ptr(1373, 141, 141), new valueRange.ptr(64, 142, 143), new valueRange.ptr(8, 144, 186), new valueRange.ptr(24, 187, 187), new valueRange.ptr(57605, 188, 188), new valueRange.ptr(8, 189, 191), new valueRange.ptr(0, 1, 0), new valueRange.ptr(24, 128, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(24, 128, 158), new valueRange.ptr(64, 159, 160), new valueRange.ptr(8216, 161, 181), new valueRange.ptr(24, 182, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(24, 128, 167), new valueRange.ptr(8216, 168, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(8216, 128, 130), new valueRange.ptr(24, 131, 191), new valueRange.ptr(0, 1, 0), new valueRange.ptr(8, 128, 191), new valueRange.ptr(0, 11, 0), new valueRange.ptr(8, 128, 136), new valueRange.ptr(64, 137, 137), new valueRange.ptr(8, 138, 141), new valueRange.ptr(64, 142, 143), new valueRange.ptr(8, 144, 150), new valueRange.ptr(64, 151, 151), new valueRange.ptr(8, 152, 152), new valueRange.ptr(64, 153, 153), new valueRange.ptr(8, 154, 157), new valueRange.ptr(64, 158, 159), new valueRange.ptr(8, 160, 191), new valueRange.ptr(0, 10, 0), new valueRange.ptr(8, 128, 136), new valueRange.ptr(64, 137, 137), new valueRange.ptr(8, 138, 141), new valueRange.ptr(64, 142, 143), new valueRange.ptr(8, 144, 176), new valueRange.ptr(64, 177, 177), new valueRange.ptr(8, 178, 181), new valueRange.ptr(64, 182, 183), new valueRange.ptr(8, 184, 190), new valueRange.ptr(64, 191, 191), new valueRange.ptr(0, 7, 0), new valueRange.ptr(8, 128, 128), new valueRange.ptr(64, 129, 129), new valueRange.ptr(8, 130, 133), new valueRange.ptr(64, 134, 135), new valueRange.ptr(8, 136, 150), new valueRange.ptr(64, 151, 151), new valueRange.ptr(8, 152, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(8, 128, 144), new valueRange.ptr(64, 145, 145), new valueRange.ptr(8, 146, 149), new valueRange.ptr(64, 150, 151), new valueRange.ptr(8, 152, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(8, 128, 154), new valueRange.ptr(64, 155, 156), new valueRange.ptr(13064, 157, 159), new valueRange.ptr(24, 160, 188), new valueRange.ptr(64, 189, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(8, 128, 143), new valueRange.ptr(24, 144, 153), new valueRange.ptr(64, 154, 159), new valueRange.ptr(8, 160, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(8, 128, 181), new valueRange.ptr(64, 182, 183), new valueRange.ptr(57413, 184, 189), new valueRange.ptr(64, 190, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(24, 128, 128), new valueRange.ptr(8, 129, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(8, 128, 172), new valueRange.ptr(24, 173, 174), new valueRange.ptr(8, 175, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(64, 128, 128), new valueRange.ptr(8, 129, 154), new valueRange.ptr(24, 155, 156), new valueRange.ptr(64, 157, 159), new valueRange.ptr(8, 160, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(8, 128, 170), new valueRange.ptr(24, 171, 176), new valueRange.ptr(8, 177, 184), new valueRange.ptr(64, 185, 191), new valueRange.ptr(0, 11, 0), new valueRange.ptr(8, 128, 140), new valueRange.ptr(64, 141, 141), new valueRange.ptr(8, 142, 145), new valueRange.ptr(13064, 146, 147), new valueRange.ptr(15112, 148, 148), new valueRange.ptr(64, 149, 159), new valueRange.ptr(8, 160, 177), new valueRange.ptr(13064, 178, 179), new valueRange.ptr(15112, 180, 180), new valueRange.ptr(24, 181, 182), new valueRange.ptr(64, 183, 191), new valueRange.ptr(0, 9, 0), new valueRange.ptr(8, 128, 145), new valueRange.ptr(13064, 146, 147), new valueRange.ptr(64, 148, 159), new valueRange.ptr(8, 160, 172), new valueRange.ptr(64, 173, 173), new valueRange.ptr(8, 174, 176), new valueRange.ptr(64, 177, 177), new valueRange.ptr(13064, 178, 179), new valueRange.ptr(64, 180, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(8, 128, 179), new valueRange.ptr(13120, 180, 181), new valueRange.ptr(12296, 182, 182), new valueRange.ptr(13064, 183, 189), new valueRange.ptr(12296, 190, 191), new valueRange.ptr(0, 16, 0), new valueRange.ptr(12296, 128, 133), new valueRange.ptr(13064, 134, 134), new valueRange.ptr(12296, 135, 136), new valueRange.ptr(13064, 137, 145), new valueRange.ptr(15112, 146, 146), new valueRange.ptr(13064, 147, 147), new valueRange.ptr(24, 148, 150), new valueRange.ptr(8, 151, 151), new valueRange.ptr(24, 152, 155), new valueRange.ptr(8, 156, 156), new valueRange.ptr(13064, 157, 157), new valueRange.ptr(64, 158, 159), new valueRange.ptr(8, 160, 169), new valueRange.ptr(64, 170, 175), new valueRange.ptr(24, 176, 185), new valueRange.ptr(64, 186, 191), new valueRange.ptr(0, 9, 0), new valueRange.ptr(24, 128, 133), new valueRange.ptr(64, 134, 134), new valueRange.ptr(536, 135, 135), new valueRange.ptr(24, 136, 138), new valueRange.ptr(13248, 139, 141), new valueRange.ptr(64, 142, 143), new valueRange.ptr(8, 144, 153), new valueRange.ptr(64, 154, 159), new valueRange.ptr(520, 160, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(520, 128, 184), new valueRange.ptr(64, 185, 191), new valueRange.ptr(0, 7, 0), new valueRange.ptr(8, 128, 132), new valueRange.ptr(13064, 133, 134), new valueRange.ptr(520, 135, 168), new valueRange.ptr(13064, 169, 169), new valueRange.ptr(520, 170, 170), new valueRange.ptr(64, 171, 175), new valueRange.ptr(8, 176, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(8, 128, 181), new valueRange.ptr(64, 182, 191), new valueRange.ptr(0, 12, 0), new valueRange.ptr(8, 128, 158), new valueRange.ptr(64, 159, 159), new valueRange.ptr(13064, 160, 162), new valueRange.ptr(12296, 163, 166), new valueRange.ptr(13064, 167, 168), new valueRange.ptr(12296, 169, 171), new valueRange.ptr(64, 172, 175), new valueRange.ptr(12296, 176, 177), new valueRange.ptr(13064, 178, 178), new valueRange.ptr(12296, 179, 184), new valueRange.ptr(13064, 185, 187), new valueRange.ptr(64, 188, 191), new valueRange.ptr(0, 7, 0), new valueRange.ptr(24, 128, 128), new valueRange.ptr(64, 129, 131), new valueRange.ptr(24, 132, 133), new valueRange.ptr(8, 134, 173), new valueRange.ptr(64, 174, 175), new valueRange.ptr(8, 176, 180), new valueRange.ptr(64, 181, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(8, 128, 171), new valueRange.ptr(64, 172, 175), new valueRange.ptr(8, 176, 191), new valueRange.ptr(0, 6, 0), new valueRange.ptr(8, 128, 137), new valueRange.ptr(64, 138, 143), new valueRange.ptr(8, 144, 153), new valueRange.ptr(40, 154, 154), new valueRange.ptr(64, 155, 157), new valueRange.ptr(24, 158, 191), new valueRange.ptr(0, 7, 0), new valueRange.ptr(8, 128, 150), new valueRange.ptr(13064, 151, 152), new valueRange.ptr(12296, 153, 154), new valueRange.ptr(13064, 155, 155), new valueRange.ptr(64, 156, 157), new valueRange.ptr(24, 158, 159), new valueRange.ptr(8, 160, 191), new valueRange.ptr(0, 15, 0), new valueRange.ptr(8, 128, 148), new valueRange.ptr(12296, 149, 149), new valueRange.ptr(13064, 150, 150), new valueRange.ptr(12296, 151, 151), new valueRange.ptr(13064, 152, 158), new valueRange.ptr(64, 159, 159), new valueRange.ptr(15112, 160, 160), new valueRange.ptr(12296, 161, 161), new valueRange.ptr(13064, 162, 162), new valueRange.ptr(12296, 163, 164), new valueRange.ptr(13064, 165, 172), new valueRange.ptr(12296, 173, 178), new valueRange.ptr(13064, 179, 188), new valueRange.ptr(64, 189, 190), new valueRange.ptr(13064, 191, 191), new valueRange.ptr(0, 11, 0), new valueRange.ptr(8, 128, 137), new valueRange.ptr(64, 138, 143), new valueRange.ptr(8, 144, 153), new valueRange.ptr(64, 154, 159), new valueRange.ptr(24, 160, 166), new valueRange.ptr(8, 167, 167), new valueRange.ptr(24, 168, 173), new valueRange.ptr(64, 174, 175), new valueRange.ptr(13064, 176, 189), new valueRange.ptr(13080, 190, 190), new valueRange.ptr(13064, 191, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(13064, 128, 128), new valueRange.ptr(64, 129, 191), new valueRange.ptr(0, 9, 0), new valueRange.ptr(13064, 128, 131), new valueRange.ptr(12296, 132, 132), new valueRange.ptr(8, 133, 179), new valueRange.ptr(13064, 180, 180), new valueRange.ptr(12296, 181, 181), new valueRange.ptr(13064, 182, 186), new valueRange.ptr(12296, 187, 187), new valueRange.ptr(13064, 188, 188), new valueRange.ptr(12296, 189, 191), new valueRange.ptr(0, 11, 0), new valueRange.ptr(12296, 128, 129), new valueRange.ptr(13064, 130, 130), new valueRange.ptr(12296, 131, 131), new valueRange.ptr(14344, 132, 132), new valueRange.ptr(8, 133, 139), new valueRange.ptr(64, 140, 143), new valueRange.ptr(8, 144, 153), new valueRange.ptr(24, 154, 170), new valueRange.ptr(13064, 171, 179), new valueRange.ptr(24, 180, 188), new valueRange.ptr(64, 189, 191), new valueRange.ptr(0, 11, 0), new valueRange.ptr(13064, 128, 129), new valueRange.ptr(12296, 130, 130), new valueRange.ptr(8, 131, 160), new valueRange.ptr(12296, 161, 161), new valueRange.ptr(13064, 162, 165), new valueRange.ptr(12296, 166, 167), new valueRange.ptr(13064, 168, 169), new valueRange.ptr(14344, 170, 170), new valueRange.ptr(15112, 171, 171), new valueRange.ptr(13064, 172, 173), new valueRange.ptr(8, 174, 191), new valueRange.ptr(0, 11, 0), new valueRange.ptr(8, 128, 165), new valueRange.ptr(13064, 166, 166), new valueRange.ptr(12296, 167, 167), new valueRange.ptr(13064, 168, 169), new valueRange.ptr(12296, 170, 172), new valueRange.ptr(13064, 173, 173), new valueRange.ptr(12296, 174, 174), new valueRange.ptr(13064, 175, 177), new valueRange.ptr(14344, 178, 179), new valueRange.ptr(64, 180, 187), new valueRange.ptr(24, 188, 191), new valueRange.ptr(0, 7, 0), new valueRange.ptr(8, 128, 163), new valueRange.ptr(12296, 164, 171), new valueRange.ptr(13064, 172, 179), new valueRange.ptr(12296, 180, 181), new valueRange.ptr(13064, 182, 183), new valueRange.ptr(64, 184, 186), new valueRange.ptr(24, 187, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(8, 128, 137), new valueRange.ptr(64, 138, 140), new valueRange.ptr(8, 141, 189), new valueRange.ptr(24, 190, 191), new valueRange.ptr(0, 12, 0), new valueRange.ptr(3625, 128, 128), new valueRange.ptr(3649, 129, 129), new valueRange.ptr(3673, 130, 130), new valueRange.ptr(3697, 131, 131), new valueRange.ptr(3721, 132, 133), new valueRange.ptr(3745, 134, 134), new valueRange.ptr(3769, 135, 135), new valueRange.ptr(1405, 136, 136), new valueRange.ptr(64, 137, 143), new valueRange.ptr(1437, 144, 186), new valueRange.ptr(64, 187, 188), new valueRange.ptr(1437, 189, 191), new valueRange.ptr(0, 16, 0), new valueRange.ptr(24, 128, 135), new valueRange.ptr(64, 136, 143), new valueRange.ptr(13064, 144, 146), new valueRange.ptr(24, 147, 147), new valueRange.ptr(13064, 148, 160), new valueRange.ptr(12296, 161, 161), new valueRange.ptr(13064, 162, 168), new valueRange.ptr(8, 169, 172), new valueRange.ptr(13064, 173, 173), new valueRange.ptr(8, 174, 179), new valueRange.ptr(13064, 180, 180), new valueRange.ptr(8, 181, 182), new valueRange.ptr(12296, 183, 183), new valueRange.ptr(13064, 184, 185), new valueRange.ptr(8, 186, 186), new valueRange.ptr(64, 187, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(13064, 128, 185), new valueRange.ptr(64, 186, 186), new valueRange.ptr(13064, 187, 191), new valueRange.ptr(0, 10, 0), new valueRange.ptr(8, 128, 135), new valueRange.ptr(57413, 136, 143), new valueRange.ptr(8, 144, 149), new valueRange.ptr(64, 150, 151), new valueRange.ptr(57413, 152, 157), new valueRange.ptr(64, 158, 159), new valueRange.ptr(8, 160, 167), new valueRange.ptr(57413, 168, 175), new valueRange.ptr(8, 176, 183), new valueRange.ptr(57413, 184, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(64, 128, 143), new valueRange.ptr(13080, 144, 176), new valueRange.ptr(64, 177, 191), new valueRange.ptr(0, 8, 0), new valueRange.ptr(24, 128, 130), new valueRange.ptr(64, 131, 131), new valueRange.ptr(8, 132, 132), new valueRange.ptr(24, 133, 136), new valueRange.ptr(9409, 137, 137), new valueRange.ptr(24, 138, 139), new valueRange.ptr(64, 140, 143), new valueRange.ptr(24, 144, 191), new valueRange.ptr(0, 7, 0), new valueRange.ptr(24, 128, 171), new valueRange.ptr(9457, 172, 172), new valueRange.ptr(9513, 173, 173), new valueRange.ptr(24, 174, 174), new valueRange.ptr(9593, 175, 175), new valueRange.ptr(9649, 176, 176), new valueRange.ptr(24, 177, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(24, 128, 159), new valueRange.ptr(128, 160, 160), new valueRange.ptr(24, 161, 173), new valueRange.ptr(128, 174, 175), new valueRange.ptr(24, 176, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(24, 128, 168), new valueRange.ptr(2525, 169, 169), new valueRange.ptr(2557, 170, 170), new valueRange.ptr(24, 171, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(24, 128, 166), new valueRange.ptr(64, 167, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(24, 128, 139), new valueRange.ptr(10433, 140, 140), new valueRange.ptr(24, 141, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(24, 128, 179), new valueRange.ptr(3710, 180, 180), new valueRange.ptr(10538, 181, 181), new valueRange.ptr(3742, 182, 182), new valueRange.ptr(24, 183, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(24, 128, 155), new valueRange.ptr(10561, 156, 156), new valueRange.ptr(24, 157, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(24, 128, 179), new valueRange.ptr(64, 180, 181), new valueRange.ptr(24, 182, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(24, 128, 149), new valueRange.ptr(64, 150, 150), new valueRange.ptr(24, 151, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(57733, 128, 143), new valueRange.ptr(1013, 144, 159), new valueRange.ptr(3773, 160, 174), new valueRange.ptr(64, 175, 175), new valueRange.ptr(8, 176, 191), new valueRange.ptr(0, 7, 0), new valueRange.ptr(8, 128, 165), new valueRange.ptr(64, 166, 166), new valueRange.ptr(8, 167, 167), new valueRange.ptr(64, 168, 172), new valueRange.ptr(8, 173, 173), new valueRange.ptr(64, 174, 175), new valueRange.ptr(8, 176, 191), new valueRange.ptr(0, 6, 0), new valueRange.ptr(8, 128, 167), new valueRange.ptr(64, 168, 174), new valueRange.ptr(57461, 175, 175), new valueRange.ptr(24, 176, 176), new valueRange.ptr(64, 177, 190), new valueRange.ptr(15112, 191, 191), new valueRange.ptr(0, 10, 0), new valueRange.ptr(8, 128, 150), new valueRange.ptr(64, 151, 159), new valueRange.ptr(8, 160, 166), new valueRange.ptr(64, 167, 167), new valueRange.ptr(8, 168, 174), new valueRange.ptr(64, 175, 175), new valueRange.ptr(8, 176, 182), new valueRange.ptr(64, 183, 183), new valueRange.ptr(8, 184, 190), new valueRange.ptr(64, 191, 191), new valueRange.ptr(0, 9, 0), new valueRange.ptr(8, 128, 134), new valueRange.ptr(64, 135, 135), new valueRange.ptr(8, 136, 142), new valueRange.ptr(64, 143, 143), new valueRange.ptr(8, 144, 150), new valueRange.ptr(64, 151, 151), new valueRange.ptr(8, 152, 158), new valueRange.ptr(64, 159, 159), new valueRange.ptr(13064, 160, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(24, 128, 174), new valueRange.ptr(8, 175, 175), new valueRange.ptr(24, 176, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(24, 128, 146), new valueRange.ptr(64, 147, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(24, 128, 153), new valueRange.ptr(64, 154, 154), new valueRange.ptr(24, 155, 158), new valueRange.ptr(3829, 159, 159), new valueRange.ptr(24, 160, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(24, 128, 178), new valueRange.ptr(3861, 179, 179), new valueRange.ptr(64, 180, 191), new valueRange.ptr(32, 1, 0), new valueRange.ptr(3893, 128, 191), new valueRange.ptr(32, 2, 0), new valueRange.ptr(5941, 128, 143), new valueRange.ptr(6421, 144, 191), new valueRange.ptr(32, 1, 0), new valueRange.ptr(7957, 128, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(64, 128, 128), new valueRange.ptr(8, 129, 191), new valueRange.ptr(0, 9, 0), new valueRange.ptr(8, 128, 150), new valueRange.ptr(64, 151, 152), new valueRange.ptr(13064, 153, 154), new valueRange.ptr(10722, 155, 155), new valueRange.ptr(10762, 156, 156), new valueRange.ptr(8, 157, 158), new valueRange.ptr(10801, 159, 159), new valueRange.ptr(24, 160, 160), new valueRange.ptr(8, 161, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(8, 128, 190), new valueRange.ptr(10857, 191, 191), new valueRange.ptr(0, 14, 0), new valueRange.ptr(64, 128, 132), new valueRange.ptr(8, 133, 175), new valueRange.ptr(64, 176, 176), new valueRange.ptr(10805, 177, 177), new valueRange.ptr(10837, 178, 178), new valueRange.ptr(10869, 179, 179), new valueRange.ptr(10901, 180, 180), new valueRange.ptr(10869, 181, 181), new valueRange.ptr(10933, 182, 182), new valueRange.ptr(10965, 183, 183), new valueRange.ptr(10997, 184, 185), new valueRange.ptr(11029, 186, 187), new valueRange.ptr(11061, 188, 189), new valueRange.ptr(11029, 190, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(24, 128, 163), new valueRange.ptr(64, 164, 175), new valueRange.ptr(8, 176, 191), new valueRange.ptr(48, 4, 0), new valueRange.ptr(10914, 128, 157), new valueRange.ptr(12378, 158, 158), new valueRange.ptr(64, 159, 159), new valueRange.ptr(12450, 160, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(8, 128, 188), new valueRange.ptr(64, 189, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(8, 128, 140), new valueRange.ptr(64, 141, 143), new valueRange.ptr(24, 144, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(24, 128, 134), new valueRange.ptr(64, 135, 143), new valueRange.ptr(8, 144, 189), new valueRange.ptr(24, 190, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(8, 128, 140), new valueRange.ptr(24, 141, 143), new valueRange.ptr(8, 144, 171), new valueRange.ptr(64, 172, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(8, 128, 165), new valueRange.ptr(24, 166, 175), new valueRange.ptr(13064, 176, 177), new valueRange.ptr(24, 178, 183), new valueRange.ptr(64, 184, 191), new valueRange.ptr(0, 16, 0), new valueRange.ptr(64, 128, 129), new valueRange.ptr(57357, 130, 130), new valueRange.ptr(8, 131, 131), new valueRange.ptr(1013, 132, 132), new valueRange.ptr(4905, 133, 133), new valueRange.ptr(17533, 134, 134), new valueRange.ptr(57469, 135, 135), new valueRange.ptr(8, 136, 136), new valueRange.ptr(57373, 137, 137), new valueRange.ptr(8, 138, 138), new valueRange.ptr(64, 139, 180), new valueRange.ptr(57373, 181, 181), new valueRange.ptr(8, 182, 183), new valueRange.ptr(8201, 184, 184), new valueRange.ptr(28353, 185, 185), new valueRange.ptr(8, 186, 191), new valueRange.ptr(0, 15, 0), new valueRange.ptr(8, 128, 129), new valueRange.ptr(13064, 130, 130), new valueRange.ptr(8, 131, 133), new valueRange.ptr(15112, 134, 134), new valueRange.ptr(8, 135, 138), new valueRange.ptr(13064, 139, 139), new valueRange.ptr(8, 140, 162), new valueRange.ptr(12296, 163, 164), new valueRange.ptr(13064, 165, 166), new valueRange.ptr(12296, 167, 167), new valueRange.ptr(24, 168, 171), new valueRange.ptr(15112, 172, 172), new valueRange.ptr(64, 173, 175), new valueRange.ptr(24, 176, 185), new valueRange.ptr(64, 186, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(520, 128, 177), new valueRange.ptr(264, 178, 178), new valueRange.ptr(8, 179, 179), new valueRange.ptr(24, 180, 183), new valueRange.ptr(64, 184, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(12296, 128, 129), new valueRange.ptr(8, 130, 179), new valueRange.ptr(12296, 180, 191), new valueRange.ptr(0, 14, 0), new valueRange.ptr(12296, 128, 131), new valueRange.ptr(15112, 132, 132), new valueRange.ptr(13064, 133, 133), new valueRange.ptr(64, 134, 141), new valueRange.ptr(24, 142, 143), new valueRange.ptr(8, 144, 153), new valueRange.ptr(64, 154, 159), new valueRange.ptr(13064, 160, 177), new valueRange.ptr(8, 178, 183), new valueRange.ptr(24, 184, 186), new valueRange.ptr(8, 187, 187), new valueRange.ptr(24, 188, 188), new valueRange.ptr(8, 189, 190), new valueRange.ptr(13064, 191, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(8, 128, 165), new valueRange.ptr(13064, 166, 173), new valueRange.ptr(24, 174, 175), new valueRange.ptr(8, 176, 191), new valueRange.ptr(0, 7, 0), new valueRange.ptr(8, 128, 134), new valueRange.ptr(13064, 135, 145), new valueRange.ptr(12296, 146, 146), new valueRange.ptr(14344, 147, 147), new valueRange.ptr(64, 148, 158), new valueRange.ptr(24, 159, 188), new valueRange.ptr(64, 189, 191), new valueRange.ptr(0, 9, 0), new valueRange.ptr(13064, 128, 130), new valueRange.ptr(12296, 131, 131), new valueRange.ptr(8, 132, 178), new valueRange.ptr(13064, 179, 179), new valueRange.ptr(12296, 180, 181), new valueRange.ptr(13064, 182, 185), new valueRange.ptr(12296, 186, 187), new valueRange.ptr(13064, 188, 189), new valueRange.ptr(12296, 190, 191), new valueRange.ptr(0, 10, 0), new valueRange.ptr(14344, 128, 128), new valueRange.ptr(24, 129, 141), new valueRange.ptr(64, 142, 142), new valueRange.ptr(8, 143, 153), new valueRange.ptr(64, 154, 157), new valueRange.ptr(24, 158, 159), new valueRange.ptr(8, 160, 164), new valueRange.ptr(13064, 165, 165), new valueRange.ptr(8, 166, 190), new valueRange.ptr(64, 191, 191), new valueRange.ptr(0, 7, 0), new valueRange.ptr(8, 128, 168), new valueRange.ptr(13064, 169, 174), new valueRange.ptr(12296, 175, 176), new valueRange.ptr(13064, 177, 178), new valueRange.ptr(12296, 179, 180), new valueRange.ptr(13064, 181, 182), new valueRange.ptr(64, 183, 191), new valueRange.ptr(0, 16, 0), new valueRange.ptr(8, 128, 130), new valueRange.ptr(13064, 131, 131), new valueRange.ptr(8, 132, 139), new valueRange.ptr(13064, 140, 140), new valueRange.ptr(12296, 141, 141), new valueRange.ptr(64, 142, 143), new valueRange.ptr(8, 144, 153), new valueRange.ptr(64, 154, 155), new valueRange.ptr(24, 156, 159), new valueRange.ptr(8, 160, 182), new valueRange.ptr(24, 183, 185), new valueRange.ptr(8, 186, 186), new valueRange.ptr(12296, 187, 187), new valueRange.ptr(13064, 188, 188), new valueRange.ptr(12296, 189, 189), new valueRange.ptr(8, 190, 191), new valueRange.ptr(0, 8, 0), new valueRange.ptr(8, 128, 175), new valueRange.ptr(13064, 176, 176), new valueRange.ptr(8, 177, 177), new valueRange.ptr(13064, 178, 180), new valueRange.ptr(8, 181, 182), new valueRange.ptr(13064, 183, 184), new valueRange.ptr(8, 185, 189), new valueRange.ptr(13064, 190, 191), new valueRange.ptr(0, 15, 0), new valueRange.ptr(8, 128, 128), new valueRange.ptr(13064, 129, 129), new valueRange.ptr(8, 130, 130), new valueRange.ptr(64, 131, 154), new valueRange.ptr(8, 155, 157), new valueRange.ptr(24, 158, 159), new valueRange.ptr(8, 160, 170), new valueRange.ptr(12296, 171, 171), new valueRange.ptr(13064, 172, 173), new valueRange.ptr(12296, 174, 175), new valueRange.ptr(24, 176, 177), new valueRange.ptr(8, 178, 180), new valueRange.ptr(12296, 181, 181), new valueRange.ptr(15112, 182, 182), new valueRange.ptr(64, 183, 191), new valueRange.ptr(0, 12, 0), new valueRange.ptr(64, 128, 128), new valueRange.ptr(8, 129, 134), new valueRange.ptr(64, 135, 136), new valueRange.ptr(8, 137, 142), new valueRange.ptr(64, 143, 144), new valueRange.ptr(8, 145, 150), new valueRange.ptr(64, 151, 159), new valueRange.ptr(8, 160, 166), new valueRange.ptr(64, 167, 167), new valueRange.ptr(8, 168, 174), new valueRange.ptr(64, 175, 175), new valueRange.ptr(8, 176, 191), new valueRange.ptr(0, 11, 0), new valueRange.ptr(8, 128, 154), new valueRange.ptr(24, 155, 155), new valueRange.ptr(17565, 156, 156), new valueRange.ptr(17589, 157, 157), new valueRange.ptr(10609, 158, 158), new valueRange.ptr(57453, 159, 159), new valueRange.ptr(8, 160, 168), new valueRange.ptr(28377, 169, 169), new valueRange.ptr(24, 170, 171), new valueRange.ptr(64, 172, 175), new valueRange.ptr(17613, 176, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(17645, 128, 143), new valueRange.ptr(17677, 144, 159), new valueRange.ptr(17709, 160, 175), new valueRange.ptr(17677, 176, 191), new valueRange.ptr(0, 12, 0), new valueRange.ptr(8, 128, 162), new valueRange.ptr(12296, 163, 164), new valueRange.ptr(13064, 165, 165), new valueRange.ptr(12296, 166, 167), new valueRange.ptr(13064, 168, 168), new valueRange.ptr(12296, 169, 170), new valueRange.ptr(24, 171, 171), new valueRange.ptr(12296, 172, 172), new valueRange.ptr(15112, 173, 173), new valueRange.ptr(64, 174, 175), new valueRange.ptr(8, 176, 185), new valueRange.ptr(64, 186, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(8, 128, 163), new valueRange.ptr(64, 164, 175), new valueRange.ptr(24, 176, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(24, 128, 134), new valueRange.ptr(64, 135, 138), new valueRange.ptr(24, 139, 187), new valueRange.ptr(64, 188, 191), new valueRange.ptr(0, 1, 0), new valueRange.ptr(64, 128, 191), new valueRange.ptr(32, 1, 0), new valueRange.ptr(17741, 128, 191), new valueRange.ptr(32, 3, 0), new valueRange.ptr(19789, 128, 148), new valueRange.ptr(19213, 149, 149), new valueRange.ptr(20461, 150, 191), new valueRange.ptr(32, 1, 0), new valueRange.ptr(21805, 128, 191), new valueRange.ptr(32, 3, 0), new valueRange.ptr(23853, 128, 132), new valueRange.ptr(22157, 133, 133), new valueRange.ptr(24013, 134, 191), new valueRange.ptr(32, 8, 0), new valueRange.ptr(27533, 128, 143), new valueRange.ptr(27981, 144, 144), new valueRange.ptr(28045, 145, 171), new valueRange.ptr(28401, 172, 172), new valueRange.ptr(28909, 173, 173), new valueRange.ptr(64, 174, 174), new valueRange.ptr(64, 175, 175), new valueRange.ptr(28941, 176, 191), new valueRange.ptr(32, 5, 0), new valueRange.ptr(29453, 128, 173), new valueRange.ptr(25965, 174, 174), new valueRange.ptr(30925, 175, 181), new valueRange.ptr(28557, 182, 182), new valueRange.ptr(31149, 183, 191), new valueRange.ptr(40, 3, 0), new valueRange.ptr(31857, 128, 130), new valueRange.ptr(31793, 131, 131), new valueRange.ptr(31977, 132, 191), new valueRange.ptr(56, 15, 0), new valueRange.ptr(40449, 128, 131), new valueRange.ptr(40617, 132, 133), new valueRange.ptr(40673, 134, 135), new valueRange.ptr(40729, 136, 143), new valueRange.ptr(64, 144, 144), new valueRange.ptr(64, 145, 145), new valueRange.ptr(41177, 146, 151), new valueRange.ptr(41457, 152, 156), new valueRange.ptr(41681, 157, 179), new valueRange.ptr(40337, 180, 180), new valueRange.ptr(40449, 181, 181), new valueRange.ptr(42969, 182, 187), new valueRange.ptr(43193, 188, 188), new valueRange.ptr(43081, 189, 189), new valueRange.ptr(43305, 190, 191), new valueRange.ptr(0, 9, 0), new valueRange.ptr(8, 128, 139), new valueRange.ptr(64, 140, 140), new valueRange.ptr(8, 141, 166), new valueRange.ptr(64, 167, 167), new valueRange.ptr(8, 168, 186), new valueRange.ptr(64, 187, 187), new valueRange.ptr(8, 188, 189), new valueRange.ptr(64, 190, 190), new valueRange.ptr(8, 191, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(8, 128, 141), new valueRange.ptr(64, 142, 143), new valueRange.ptr(8, 144, 157), new valueRange.ptr(64, 158, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(8, 128, 186), new valueRange.ptr(64, 187, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(24, 128, 130), new valueRange.ptr(64, 131, 134), new valueRange.ptr(24, 135, 179), new valueRange.ptr(64, 180, 182), new valueRange.ptr(24, 183, 191), new valueRange.ptr(0, 6, 0), new valueRange.ptr(24, 128, 142), new valueRange.ptr(64, 143, 143), new valueRange.ptr(24, 144, 156), new valueRange.ptr(64, 157, 159), new valueRange.ptr(24, 160, 160), new valueRange.ptr(64, 161, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(64, 128, 143), new valueRange.ptr(24, 144, 188), new valueRange.ptr(13064, 189, 189), new valueRange.ptr(64, 190, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(8, 128, 156), new valueRange.ptr(64, 157, 159), new valueRange.ptr(8, 160, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(8, 128, 144), new valueRange.ptr(64, 145, 159), new valueRange.ptr(13064, 160, 160), new valueRange.ptr(24, 161, 187), new valueRange.ptr(64, 188, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(8, 128, 159), new valueRange.ptr(24, 160, 163), new valueRange.ptr(64, 164, 172), new valueRange.ptr(8, 173, 191), new valueRange.ptr(0, 8, 0), new valueRange.ptr(8, 128, 128), new valueRange.ptr(24, 129, 129), new valueRange.ptr(8, 130, 137), new valueRange.ptr(24, 138, 138), new valueRange.ptr(64, 139, 143), new valueRange.ptr(8, 144, 181), new valueRange.ptr(13064, 182, 186), new valueRange.ptr(64, 187, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(8, 128, 157), new valueRange.ptr(64, 158, 158), new valueRange.ptr(24, 159, 159), new valueRange.ptr(8, 160, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(8, 128, 131), new valueRange.ptr(64, 132, 135), new valueRange.ptr(8, 136, 143), new valueRange.ptr(24, 144, 149), new valueRange.ptr(64, 150, 191), new valueRange.ptr(0, 6, 0), new valueRange.ptr(57669, 128, 135), new valueRange.ptr(57797, 136, 143), new valueRange.ptr(57669, 144, 151), new valueRange.ptr(35597, 152, 159), new valueRange.ptr(35621, 160, 167), new valueRange.ptr(8, 168, 191), new valueRange.ptr(0, 6, 0), new valueRange.ptr(8, 128, 157), new valueRange.ptr(64, 158, 159), new valueRange.ptr(8, 160, 169), new valueRange.ptr(64, 170, 175), new valueRange.ptr(35621, 176, 183), new valueRange.ptr(35597, 184, 191), new valueRange.ptr(0, 6, 0), new valueRange.ptr(57669, 128, 135), new valueRange.ptr(57797, 136, 143), new valueRange.ptr(57669, 144, 147), new valueRange.ptr(64, 148, 151), new valueRange.ptr(8, 152, 187), new valueRange.ptr(64, 188, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(8, 128, 167), new valueRange.ptr(64, 168, 175), new valueRange.ptr(8, 176, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(8, 128, 163), new valueRange.ptr(64, 164, 174), new valueRange.ptr(24, 175, 175), new valueRange.ptr(64, 176, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(8, 128, 182), new valueRange.ptr(64, 183, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(8, 128, 149), new valueRange.ptr(64, 150, 159), new valueRange.ptr(8, 160, 167), new valueRange.ptr(64, 168, 191), new valueRange.ptr(0, 11, 0), new valueRange.ptr(2056, 128, 133), new valueRange.ptr(64, 134, 135), new valueRange.ptr(2056, 136, 136), new valueRange.ptr(64, 137, 137), new valueRange.ptr(2056, 138, 181), new valueRange.ptr(64, 182, 182), new valueRange.ptr(2056, 183, 184), new valueRange.ptr(64, 185, 187), new valueRange.ptr(2056, 188, 188), new valueRange.ptr(64, 189, 190), new valueRange.ptr(2056, 191, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(2056, 128, 149), new valueRange.ptr(64, 150, 150), new valueRange.ptr(2072, 151, 159), new valueRange.ptr(2056, 160, 182), new valueRange.ptr(2072, 183, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(2056, 128, 158), new valueRange.ptr(64, 159, 166), new valueRange.ptr(2072, 167, 175), new valueRange.ptr(64, 176, 191), new valueRange.ptr(0, 6, 0), new valueRange.ptr(64, 128, 159), new valueRange.ptr(2056, 160, 178), new valueRange.ptr(64, 179, 179), new valueRange.ptr(2056, 180, 181), new valueRange.ptr(64, 182, 186), new valueRange.ptr(2072, 187, 191), new valueRange.ptr(0, 7, 0), new valueRange.ptr(2056, 128, 149), new valueRange.ptr(2072, 150, 155), new valueRange.ptr(64, 156, 158), new valueRange.ptr(24, 159, 159), new valueRange.ptr(2056, 160, 185), new valueRange.ptr(64, 186, 190), new valueRange.ptr(2072, 191, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(2056, 128, 183), new valueRange.ptr(64, 184, 187), new valueRange.ptr(2072, 188, 189), new valueRange.ptr(2056, 190, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(2072, 128, 143), new valueRange.ptr(64, 144, 145), new valueRange.ptr(2072, 146, 191), new valueRange.ptr(0, 15, 0), new valueRange.ptr(2056, 128, 128), new valueRange.ptr(13064, 129, 131), new valueRange.ptr(64, 132, 132), new valueRange.ptr(13064, 133, 134), new valueRange.ptr(64, 135, 139), new valueRange.ptr(13064, 140, 143), new valueRange.ptr(2056, 144, 147), new valueRange.ptr(64, 148, 148), new valueRange.ptr(2056, 149, 151), new valueRange.ptr(64, 152, 152), new valueRange.ptr(2056, 153, 181), new valueRange.ptr(64, 182, 183), new valueRange.ptr(13064, 184, 186), new valueRange.ptr(64, 187, 190), new valueRange.ptr(15112, 191, 191), new valueRange.ptr(0, 6, 0), new valueRange.ptr(2072, 128, 136), new valueRange.ptr(64, 137, 143), new valueRange.ptr(2072, 144, 152), new valueRange.ptr(64, 153, 159), new valueRange.ptr(2056, 160, 188), new valueRange.ptr(2072, 189, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(2056, 128, 156), new valueRange.ptr(2072, 157, 159), new valueRange.ptr(64, 160, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(2056, 128, 181), new valueRange.ptr(64, 182, 184), new valueRange.ptr(24, 185, 191), new valueRange.ptr(0, 6, 0), new valueRange.ptr(2056, 128, 149), new valueRange.ptr(64, 150, 151), new valueRange.ptr(2072, 152, 159), new valueRange.ptr(2056, 160, 178), new valueRange.ptr(64, 179, 183), new valueRange.ptr(2072, 184, 191), new valueRange.ptr(0, 1, 0), new valueRange.ptr(2056, 128, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(2056, 128, 136), new valueRange.ptr(64, 137, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(989, 128, 178), new valueRange.ptr(64, 179, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(2056, 128, 178), new valueRange.ptr(64, 179, 185), new valueRange.ptr(2072, 186, 191), new valueRange.ptr(0, 8, 0), new valueRange.ptr(2312, 128, 128), new valueRange.ptr(2568, 129, 161), new valueRange.ptr(3080, 162, 162), new valueRange.ptr(2568, 163, 163), new valueRange.ptr(13064, 164, 167), new valueRange.ptr(64, 168, 175), new valueRange.ptr(2056, 176, 185), new valueRange.ptr(64, 186, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(64, 128, 159), new valueRange.ptr(2072, 160, 190), new valueRange.ptr(64, 191, 191), new valueRange.ptr(0, 7, 0), new valueRange.ptr(2056, 128, 169), new valueRange.ptr(64, 170, 170), new valueRange.ptr(13064, 171, 172), new valueRange.ptr(2072, 173, 173), new valueRange.ptr(64, 174, 175), new valueRange.ptr(2056, 176, 177), new valueRange.ptr(64, 178, 191), new valueRange.ptr(0, 7, 0), new valueRange.ptr(2056, 128, 156), new valueRange.ptr(2072, 157, 166), new valueRange.ptr(2056, 167, 167), new valueRange.ptr(64, 168, 175), new valueRange.ptr(2568, 176, 178), new valueRange.ptr(3080, 179, 179), new valueRange.ptr(2568, 180, 191), new valueRange.ptr(0, 7, 0), new valueRange.ptr(2568, 128, 132), new valueRange.ptr(2056, 133, 133), new valueRange.ptr(13064, 134, 144), new valueRange.ptr(2584, 145, 147), new valueRange.ptr(3096, 148, 148), new valueRange.ptr(2072, 149, 153), new valueRange.ptr(64, 154, 191), new valueRange.ptr(0, 11, 0), new valueRange.ptr(64, 128, 175), new valueRange.ptr(2568, 176, 176), new valueRange.ptr(2056, 177, 177), new valueRange.ptr(2568, 178, 179), new valueRange.ptr(3080, 180, 182), new valueRange.ptr(2056, 183, 183), new valueRange.ptr(2568, 184, 184), new valueRange.ptr(3080, 185, 186), new valueRange.ptr(2568, 187, 188), new valueRange.ptr(3080, 189, 189), new valueRange.ptr(2568, 190, 191), new valueRange.ptr(0, 11, 0), new valueRange.ptr(2056, 128, 128), new valueRange.ptr(2568, 129, 129), new valueRange.ptr(3080, 130, 131), new valueRange.ptr(2568, 132, 132), new valueRange.ptr(2072, 133, 136), new valueRange.ptr(3096, 137, 137), new valueRange.ptr(2584, 138, 138), new valueRange.ptr(2328, 139, 139), new valueRange.ptr(64, 140, 159), new valueRange.ptr(2056, 160, 182), new valueRange.ptr(64, 183, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(12296, 128, 128), new valueRange.ptr(13064, 129, 129), new valueRange.ptr(12296, 130, 130), new valueRange.ptr(8, 131, 183), new valueRange.ptr(13064, 184, 191), new valueRange.ptr(0, 8, 0), new valueRange.ptr(13064, 128, 133), new valueRange.ptr(15112, 134, 134), new valueRange.ptr(24, 135, 141), new valueRange.ptr(64, 142, 145), new valueRange.ptr(24, 146, 165), new valueRange.ptr(8, 166, 175), new valueRange.ptr(64, 176, 190), new valueRange.ptr(15112, 191, 191), new valueRange.ptr(0, 11, 0), new valueRange.ptr(13064, 128, 129), new valueRange.ptr(12296, 130, 130), new valueRange.ptr(8, 131, 175), new valueRange.ptr(12296, 176, 178), new valueRange.ptr(13064, 179, 182), new valueRange.ptr(12296, 183, 184), new valueRange.ptr(15112, 185, 185), new valueRange.ptr(13064, 186, 186), new valueRange.ptr(24, 187, 188), new valueRange.ptr(64, 189, 189), new valueRange.ptr(24, 190, 191), new valueRange.ptr(0, 6, 0), new valueRange.ptr(24, 128, 129), new valueRange.ptr(64, 130, 143), new valueRange.ptr(8, 144, 168), new valueRange.ptr(64, 169, 175), new valueRange.ptr(8, 176, 185), new valueRange.ptr(64, 186, 191), new valueRange.ptr(0, 8, 0), new valueRange.ptr(13064, 128, 130), new valueRange.ptr(8, 131, 166), new valueRange.ptr(13064, 167, 171), new valueRange.ptr(12296, 172, 172), new valueRange.ptr(13064, 173, 178), new valueRange.ptr(15112, 179, 180), new valueRange.ptr(64, 181, 181), new valueRange.ptr(8, 182, 191), new valueRange.ptr(0, 10, 0), new valueRange.ptr(24, 128, 131), new valueRange.ptr(8, 132, 132), new valueRange.ptr(12296, 133, 134), new valueRange.ptr(8, 135, 135), new valueRange.ptr(64, 136, 143), new valueRange.ptr(8, 144, 178), new valueRange.ptr(13064, 179, 179), new valueRange.ptr(24, 180, 181), new valueRange.ptr(8, 182, 182), new valueRange.ptr(64, 183, 191), new valueRange.ptr(0, 6, 0), new valueRange.ptr(13064, 128, 129), new valueRange.ptr(12296, 130, 130), new valueRange.ptr(8, 131, 178), new valueRange.ptr(12296, 179, 181), new valueRange.ptr(13064, 182, 190), new valueRange.ptr(12296, 191, 191), new valueRange.ptr(0, 14, 0), new valueRange.ptr(14344, 128, 128), new valueRange.ptr(8, 129, 132), new valueRange.ptr(24, 133, 136), new valueRange.ptr(13064, 137, 140), new valueRange.ptr(24, 141, 141), new valueRange.ptr(12296, 142, 142), new valueRange.ptr(13064, 143, 143), new valueRange.ptr(8, 144, 154), new valueRange.ptr(24, 155, 155), new valueRange.ptr(8, 156, 156), new valueRange.ptr(24, 157, 159), new valueRange.ptr(64, 160, 160), new valueRange.ptr(24, 161, 180), new valueRange.ptr(64, 181, 191), new valueRange.ptr(0, 12, 0), new valueRange.ptr(8, 128, 145), new valueRange.ptr(64, 146, 146), new valueRange.ptr(8, 147, 171), new valueRange.ptr(12296, 172, 174), new valueRange.ptr(13064, 175, 177), new valueRange.ptr(12296, 178, 179), new valueRange.ptr(13064, 180, 180), new valueRange.ptr(14344, 181, 181), new valueRange.ptr(13064, 182, 183), new valueRange.ptr(24, 184, 189), new valueRange.ptr(13064, 190, 190), new valueRange.ptr(64, 191, 191), new valueRange.ptr(0, 12, 0), new valueRange.ptr(8, 128, 134), new valueRange.ptr(64, 135, 135), new valueRange.ptr(8, 136, 136), new valueRange.ptr(64, 137, 137), new valueRange.ptr(8, 138, 141), new valueRange.ptr(64, 142, 142), new valueRange.ptr(8, 143, 157), new valueRange.ptr(64, 158, 158), new valueRange.ptr(8, 159, 168), new valueRange.ptr(24, 169, 169), new valueRange.ptr(64, 170, 175), new valueRange.ptr(8, 176, 191), new valueRange.ptr(0, 8, 0), new valueRange.ptr(8, 128, 158), new valueRange.ptr(13064, 159, 159), new valueRange.ptr(12296, 160, 162), new valueRange.ptr(13064, 163, 169), new valueRange.ptr(15112, 170, 170), new valueRange.ptr(64, 171, 175), new valueRange.ptr(8, 176, 185), new valueRange.ptr(64, 186, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(8, 128, 180), new valueRange.ptr(12296, 181, 183), new valueRange.ptr(13064, 184, 191), new valueRange.ptr(0, 14, 0), new valueRange.ptr(12296, 128, 129), new valueRange.ptr(15112, 130, 130), new valueRange.ptr(13064, 131, 132), new valueRange.ptr(12296, 133, 133), new valueRange.ptr(13064, 134, 134), new valueRange.ptr(8, 135, 138), new valueRange.ptr(24, 139, 143), new valueRange.ptr(8, 144, 153), new valueRange.ptr(24, 154, 155), new valueRange.ptr(64, 156, 156), new valueRange.ptr(24, 157, 157), new valueRange.ptr(13064, 158, 158), new valueRange.ptr(8, 159, 161), new valueRange.ptr(64, 162, 191), new valueRange.ptr(0, 7, 0), new valueRange.ptr(8, 128, 175), new valueRange.ptr(12296, 176, 178), new valueRange.ptr(13064, 179, 184), new valueRange.ptr(12296, 185, 185), new valueRange.ptr(13064, 186, 186), new valueRange.ptr(12296, 187, 190), new valueRange.ptr(13064, 191, 191), new valueRange.ptr(0, 10, 0), new valueRange.ptr(13064, 128, 128), new valueRange.ptr(12296, 129, 129), new valueRange.ptr(15112, 130, 130), new valueRange.ptr(13064, 131, 131), new valueRange.ptr(8, 132, 133), new valueRange.ptr(24, 134, 134), new valueRange.ptr(8, 135, 135), new valueRange.ptr(64, 136, 143), new valueRange.ptr(8, 144, 153), new valueRange.ptr(64, 154, 191), new valueRange.ptr(0, 8, 0), new valueRange.ptr(8, 128, 174), new valueRange.ptr(12296, 175, 177), new valueRange.ptr(13064, 178, 181), new valueRange.ptr(64, 182, 183), new valueRange.ptr(12296, 184, 187), new valueRange.ptr(13064, 188, 189), new valueRange.ptr(12296, 190, 190), new valueRange.ptr(15112, 191, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(13064, 128, 128), new valueRange.ptr(24, 129, 151), new valueRange.ptr(8, 152, 155), new valueRange.ptr(13064, 156, 157), new valueRange.ptr(64, 158, 191), new valueRange.ptr(0, 7, 0), new valueRange.ptr(8, 128, 175), new valueRange.ptr(12296, 176, 178), new valueRange.ptr(13064, 179, 186), new valueRange.ptr(12296, 187, 188), new valueRange.ptr(13064, 189, 189), new valueRange.ptr(12296, 190, 190), new valueRange.ptr(15112, 191, 191), new valueRange.ptr(0, 8, 0), new valueRange.ptr(13064, 128, 128), new valueRange.ptr(24, 129, 131), new valueRange.ptr(8, 132, 132), new valueRange.ptr(64, 133, 143), new valueRange.ptr(8, 144, 153), new valueRange.ptr(64, 154, 159), new valueRange.ptr(24, 160, 172), new valueRange.ptr(64, 173, 191), new valueRange.ptr(0, 10, 0), new valueRange.ptr(8, 128, 170), new valueRange.ptr(13064, 171, 171), new valueRange.ptr(12296, 172, 172), new valueRange.ptr(13064, 173, 173), new valueRange.ptr(12296, 174, 175), new valueRange.ptr(13064, 176, 181), new valueRange.ptr(14344, 182, 182), new valueRange.ptr(13064, 183, 183), new valueRange.ptr(8, 184, 184), new valueRange.ptr(64, 185, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(8, 128, 137), new valueRange.ptr(64, 138, 191), new valueRange.ptr(0, 11, 0), new valueRange.ptr(8, 128, 154), new valueRange.ptr(64, 155, 156), new valueRange.ptr(13064, 157, 159), new valueRange.ptr(12296, 160, 161), new valueRange.ptr(13064, 162, 165), new valueRange.ptr(12296, 166, 166), new valueRange.ptr(13064, 167, 170), new valueRange.ptr(15112, 171, 171), new valueRange.ptr(64, 172, 175), new valueRange.ptr(8, 176, 185), new valueRange.ptr(24, 186, 191), new valueRange.ptr(0, 8, 0), new valueRange.ptr(8, 128, 171), new valueRange.ptr(12296, 172, 174), new valueRange.ptr(13064, 175, 183), new valueRange.ptr(12296, 184, 184), new valueRange.ptr(15112, 185, 185), new valueRange.ptr(13064, 186, 186), new valueRange.ptr(24, 187, 187), new valueRange.ptr(64, 188, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(64, 128, 159), new valueRange.ptr(1181, 160, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(8, 128, 169), new valueRange.ptr(24, 170, 178), new valueRange.ptr(64, 179, 190), new valueRange.ptr(8, 191, 191), new valueRange.ptr(0, 8, 0), new valueRange.ptr(12296, 128, 128), new valueRange.ptr(8, 129, 129), new valueRange.ptr(12296, 130, 130), new valueRange.ptr(13064, 131, 131), new valueRange.ptr(24, 132, 134), new valueRange.ptr(64, 135, 143), new valueRange.ptr(8, 144, 153), new valueRange.ptr(64, 154, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(64, 128, 159), new valueRange.ptr(8, 160, 167), new valueRange.ptr(64, 168, 169), new valueRange.ptr(8, 170, 191), new valueRange.ptr(0, 12, 0), new valueRange.ptr(8, 128, 144), new valueRange.ptr(12296, 145, 147), new valueRange.ptr(13064, 148, 151), new valueRange.ptr(64, 152, 153), new valueRange.ptr(13064, 154, 155), new valueRange.ptr(12296, 156, 159), new valueRange.ptr(15112, 160, 160), new valueRange.ptr(8, 161, 161), new valueRange.ptr(24, 162, 162), new valueRange.ptr(8, 163, 163), new valueRange.ptr(12296, 164, 164), new valueRange.ptr(64, 165, 191), new valueRange.ptr(0, 10, 0), new valueRange.ptr(8, 128, 128), new valueRange.ptr(13064, 129, 138), new valueRange.ptr(8, 139, 178), new valueRange.ptr(13064, 179, 179), new valueRange.ptr(15112, 180, 180), new valueRange.ptr(13064, 181, 184), new valueRange.ptr(12296, 185, 185), new valueRange.ptr(8, 186, 186), new valueRange.ptr(13064, 187, 190), new valueRange.ptr(24, 191, 191), new valueRange.ptr(0, 8, 0), new valueRange.ptr(24, 128, 134), new valueRange.ptr(15112, 135, 135), new valueRange.ptr(64, 136, 143), new valueRange.ptr(8, 144, 144), new valueRange.ptr(13064, 145, 150), new valueRange.ptr(12296, 151, 152), new valueRange.ptr(13064, 153, 155), new valueRange.ptr(8, 156, 191), new valueRange.ptr(0, 9, 0), new valueRange.ptr(8, 128, 137), new valueRange.ptr(13064, 138, 150), new valueRange.ptr(12296, 151, 151), new valueRange.ptr(13064, 152, 152), new valueRange.ptr(15112, 153, 153), new valueRange.ptr(24, 154, 156), new valueRange.ptr(8, 157, 157), new valueRange.ptr(24, 158, 162), new valueRange.ptr(64, 163, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(8, 128, 184), new valueRange.ptr(64, 185, 191), new valueRange.ptr(0, 9, 0), new valueRange.ptr(8, 128, 136), new valueRange.ptr(64, 137, 137), new valueRange.ptr(8, 138, 174), new valueRange.ptr(12296, 175, 175), new valueRange.ptr(13064, 176, 182), new valueRange.ptr(64, 183, 183), new valueRange.ptr(13064, 184, 189), new valueRange.ptr(12296, 190, 190), new valueRange.ptr(15112, 191, 191), new valueRange.ptr(0, 8, 0), new valueRange.ptr(8, 128, 128), new valueRange.ptr(24, 129, 133), new valueRange.ptr(64, 134, 143), new valueRange.ptr(8, 144, 153), new valueRange.ptr(24, 154, 172), new valueRange.ptr(64, 173, 175), new valueRange.ptr(24, 176, 177), new valueRange.ptr(8, 178, 191), new valueRange.ptr(0, 11, 0), new valueRange.ptr(8, 128, 143), new valueRange.ptr(64, 144, 145), new valueRange.ptr(13064, 146, 167), new valueRange.ptr(64, 168, 168), new valueRange.ptr(12296, 169, 169), new valueRange.ptr(13064, 170, 176), new valueRange.ptr(12296, 177, 177), new valueRange.ptr(13064, 178, 179), new valueRange.ptr(12296, 180, 180), new valueRange.ptr(13064, 181, 182), new valueRange.ptr(64, 183, 191), new valueRange.ptr(0, 12, 0), new valueRange.ptr(8, 128, 134), new valueRange.ptr(64, 135, 135), new valueRange.ptr(8, 136, 137), new valueRange.ptr(64, 138, 138), new valueRange.ptr(8, 139, 176), new valueRange.ptr(13064, 177, 182), new valueRange.ptr(64, 183, 185), new valueRange.ptr(13064, 186, 186), new valueRange.ptr(64, 187, 187), new valueRange.ptr(13064, 188, 189), new valueRange.ptr(64, 190, 190), new valueRange.ptr(13064, 191, 191), new valueRange.ptr(0, 12, 0), new valueRange.ptr(13064, 128, 131), new valueRange.ptr(15112, 132, 133), new valueRange.ptr(8, 134, 134), new valueRange.ptr(13064, 135, 135), new valueRange.ptr(64, 136, 143), new valueRange.ptr(8, 144, 153), new valueRange.ptr(64, 154, 159), new valueRange.ptr(8, 160, 165), new valueRange.ptr(64, 166, 166), new valueRange.ptr(8, 167, 168), new valueRange.ptr(64, 169, 169), new valueRange.ptr(8, 170, 191), new valueRange.ptr(0, 13, 0), new valueRange.ptr(8, 128, 137), new valueRange.ptr(12296, 138, 142), new valueRange.ptr(64, 143, 143), new valueRange.ptr(13064, 144, 145), new valueRange.ptr(64, 146, 146), new valueRange.ptr(12296, 147, 148), new valueRange.ptr(13064, 149, 149), new valueRange.ptr(12296, 150, 150), new valueRange.ptr(15112, 151, 151), new valueRange.ptr(8, 152, 152), new valueRange.ptr(64, 153, 159), new valueRange.ptr(8, 160, 169), new valueRange.ptr(64, 170, 191), new valueRange.ptr(0, 6, 0), new valueRange.ptr(64, 128, 159), new valueRange.ptr(8, 160, 178), new valueRange.ptr(13064, 179, 180), new valueRange.ptr(12296, 181, 182), new valueRange.ptr(24, 183, 184), new valueRange.ptr(64, 185, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(64, 128, 175), new valueRange.ptr(8, 176, 176), new valueRange.ptr(64, 177, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(24, 128, 177), new valueRange.ptr(64, 178, 190), new valueRange.ptr(24, 191, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(8, 128, 153), new valueRange.ptr(64, 154, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(24, 128, 174), new valueRange.ptr(64, 175, 175), new valueRange.ptr(24, 176, 180), new valueRange.ptr(64, 181, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(8, 128, 131), new valueRange.ptr(64, 132, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(8, 128, 174), new valueRange.ptr(64, 175, 175), new valueRange.ptr(832, 176, 184), new valueRange.ptr(64, 185, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(8, 128, 134), new valueRange.ptr(64, 135, 191), new valueRange.ptr(0, 6, 0), new valueRange.ptr(8, 128, 158), new valueRange.ptr(64, 159, 159), new valueRange.ptr(8, 160, 169), new valueRange.ptr(64, 170, 173), new valueRange.ptr(24, 174, 175), new valueRange.ptr(64, 176, 191), new valueRange.ptr(0, 6, 0), new valueRange.ptr(64, 128, 143), new valueRange.ptr(8, 144, 173), new valueRange.ptr(64, 174, 175), new valueRange.ptr(13064, 176, 180), new valueRange.ptr(24, 181, 181), new valueRange.ptr(64, 182, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(8, 128, 175), new valueRange.ptr(13064, 176, 182), new valueRange.ptr(24, 183, 191), new valueRange.ptr(0, 10, 0), new valueRange.ptr(8, 128, 131), new valueRange.ptr(24, 132, 133), new valueRange.ptr(64, 134, 143), new valueRange.ptr(8, 144, 153), new valueRange.ptr(64, 154, 154), new valueRange.ptr(24, 155, 161), new valueRange.ptr(64, 162, 162), new valueRange.ptr(8, 163, 183), new valueRange.ptr(64, 184, 188), new valueRange.ptr(8, 189, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(8, 128, 143), new valueRange.ptr(64, 144, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(57605, 128, 159), new valueRange.ptr(8, 160, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(24, 128, 154), new valueRange.ptr(64, 155, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(8, 128, 138), new valueRange.ptr(64, 139, 142), new valueRange.ptr(13064, 143, 143), new valueRange.ptr(8, 144, 144), new valueRange.ptr(12296, 145, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(12296, 128, 135), new valueRange.ptr(64, 136, 142), new valueRange.ptr(13064, 143, 146), new valueRange.ptr(8, 147, 159), new valueRange.ptr(64, 160, 191), new valueRange.ptr(0, 8, 0), new valueRange.ptr(64, 128, 159), new valueRange.ptr(8, 160, 161), new valueRange.ptr(24, 162, 162), new valueRange.ptr(8, 163, 163), new valueRange.ptr(13064, 164, 164), new valueRange.ptr(64, 165, 175), new valueRange.ptr(12296, 176, 177), new valueRange.ptr(64, 178, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(8, 128, 183), new valueRange.ptr(64, 184, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(8, 128, 149), new valueRange.ptr(64, 150, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(8, 128, 136), new valueRange.ptr(64, 137, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(8, 128, 158), new valueRange.ptr(64, 159, 191), new valueRange.ptr(0, 6, 0), new valueRange.ptr(64, 128, 143), new valueRange.ptr(8, 144, 146), new valueRange.ptr(64, 147, 163), new valueRange.ptr(8, 164, 167), new valueRange.ptr(64, 168, 175), new valueRange.ptr(8, 176, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(8, 128, 187), new valueRange.ptr(64, 188, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(8, 128, 170), new valueRange.ptr(64, 171, 175), new valueRange.ptr(8, 176, 188), new valueRange.ptr(64, 189, 191), new valueRange.ptr(0, 9, 0), new valueRange.ptr(8, 128, 136), new valueRange.ptr(64, 137, 143), new valueRange.ptr(8, 144, 153), new valueRange.ptr(64, 154, 155), new valueRange.ptr(24, 156, 156), new valueRange.ptr(13064, 157, 158), new valueRange.ptr(24, 159, 159), new valueRange.ptr(960, 160, 163), new valueRange.ptr(64, 164, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(24, 128, 181), new valueRange.ptr(64, 182, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(24, 128, 166), new valueRange.ptr(64, 167, 168), new valueRange.ptr(24, 169, 191), new valueRange.ptr(0, 14, 0), new valueRange.ptr(24, 128, 157), new valueRange.ptr(46601, 158, 158), new valueRange.ptr(46673, 159, 159), new valueRange.ptr(46745, 160, 160), new valueRange.ptr(46849, 161, 161), new valueRange.ptr(46953, 162, 162), new valueRange.ptr(47057, 163, 163), new valueRange.ptr(47161, 164, 164), new valueRange.ptr(12312, 165, 166), new valueRange.ptr(13080, 167, 169), new valueRange.ptr(24, 170, 172), new valueRange.ptr(12312, 173, 178), new valueRange.ptr(832, 179, 186), new valueRange.ptr(13080, 187, 191), new valueRange.ptr(0, 11, 0), new valueRange.ptr(13080, 128, 130), new valueRange.ptr(24, 131, 132), new valueRange.ptr(13080, 133, 139), new valueRange.ptr(24, 140, 169), new valueRange.ptr(13080, 170, 173), new valueRange.ptr(24, 174, 186), new valueRange.ptr(47265, 187, 187), new valueRange.ptr(47337, 188, 188), new valueRange.ptr(47409, 189, 189), new valueRange.ptr(47513, 190, 190), new valueRange.ptr(47617, 191, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(47721, 128, 128), new valueRange.ptr(24, 129, 168), new valueRange.ptr(64, 169, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(24, 128, 129), new valueRange.ptr(13080, 130, 132), new valueRange.ptr(24, 133, 133), new valueRange.ptr(64, 134, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(64, 128, 159), new valueRange.ptr(24, 160, 179), new valueRange.ptr(64, 180, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(24, 128, 150), new valueRange.ptr(64, 151, 159), new valueRange.ptr(24, 160, 184), new valueRange.ptr(64, 185, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(13064, 128, 182), new valueRange.ptr(24, 183, 186), new valueRange.ptr(13064, 187, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(13064, 128, 172), new valueRange.ptr(24, 173, 180), new valueRange.ptr(13064, 181, 181), new valueRange.ptr(24, 182, 191), new valueRange.ptr(0, 8, 0), new valueRange.ptr(24, 128, 131), new valueRange.ptr(13064, 132, 132), new valueRange.ptr(24, 133, 139), new valueRange.ptr(64, 140, 154), new valueRange.ptr(13064, 155, 159), new valueRange.ptr(64, 160, 160), new valueRange.ptr(13064, 161, 175), new valueRange.ptr(64, 176, 191), new valueRange.ptr(0, 10, 0), new valueRange.ptr(13064, 128, 134), new valueRange.ptr(64, 135, 135), new valueRange.ptr(13064, 136, 152), new valueRange.ptr(64, 153, 154), new valueRange.ptr(13064, 155, 161), new valueRange.ptr(64, 162, 162), new valueRange.ptr(13064, 163, 164), new valueRange.ptr(64, 165, 165), new valueRange.ptr(13064, 166, 170), new valueRange.ptr(64, 171, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(8, 128, 172), new valueRange.ptr(64, 173, 175), new valueRange.ptr(13064, 176, 182), new valueRange.ptr(8, 183, 189), new valueRange.ptr(64, 190, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(8, 128, 137), new valueRange.ptr(64, 138, 141), new valueRange.ptr(8, 142, 142), new valueRange.ptr(24, 143, 143), new valueRange.ptr(64, 144, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(8, 128, 171), new valueRange.ptr(13064, 172, 175), new valueRange.ptr(8, 176, 185), new valueRange.ptr(64, 186, 190), new valueRange.ptr(24, 191, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(2056, 128, 132), new valueRange.ptr(64, 133, 134), new valueRange.ptr(2072, 135, 143), new valueRange.ptr(13064, 144, 150), new valueRange.ptr(64, 151, 191), new valueRange.ptr(0, 8, 0), new valueRange.ptr(2568, 128, 131), new valueRange.ptr(13064, 132, 138), new valueRange.ptr(2824, 139, 139), new valueRange.ptr(64, 140, 143), new valueRange.ptr(2056, 144, 153), new valueRange.ptr(64, 154, 157), new valueRange.ptr(2072, 158, 159), new valueRange.ptr(64, 160, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(64, 128, 176), new valueRange.ptr(2072, 177, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(2072, 128, 180), new valueRange.ptr(64, 181, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(64, 128, 128), new valueRange.ptr(2072, 129, 189), new valueRange.ptr(64, 190, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(64, 128, 175), new valueRange.ptr(24, 176, 177), new valueRange.ptr(64, 178, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(24, 128, 171), new valueRange.ptr(64, 172, 175), new valueRange.ptr(24, 176, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(24, 128, 147), new valueRange.ptr(64, 148, 159), new valueRange.ptr(24, 160, 174), new valueRange.ptr(64, 175, 176), new valueRange.ptr(24, 177, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(64, 128, 128), new valueRange.ptr(24, 129, 143), new valueRange.ptr(64, 144, 144), new valueRange.ptr(24, 145, 181), new valueRange.ptr(64, 182, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(24, 128, 143), new valueRange.ptr(49705, 144, 144), new valueRange.ptr(24, 145, 173), new valueRange.ptr(64, 174, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(64, 128, 165), new valueRange.ptr(24, 166, 191), new valueRange.ptr(0, 15, 0), new valueRange.ptr(51281, 128, 128), new valueRange.ptr(51361, 129, 129), new valueRange.ptr(51441, 130, 130), new valueRange.ptr(51521, 131, 131), new valueRange.ptr(51601, 132, 132), new valueRange.ptr(51681, 133, 133), new valueRange.ptr(51761, 134, 134), new valueRange.ptr(51841, 135, 135), new valueRange.ptr(51921, 136, 136), new valueRange.ptr(64, 137, 143), new valueRange.ptr(52001, 144, 144), new valueRange.ptr(52033, 145, 145), new valueRange.ptr(64, 146, 159), new valueRange.ptr(24, 160, 165), new valueRange.ptr(64, 166, 191), new valueRange.ptr(0, 6, 0), new valueRange.ptr(24, 128, 151), new valueRange.ptr(64, 152, 159), new valueRange.ptr(24, 160, 172), new valueRange.ptr(64, 173, 175), new valueRange.ptr(24, 176, 188), new valueRange.ptr(64, 189, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(24, 128, 179), new valueRange.ptr(64, 180, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(24, 128, 152), new valueRange.ptr(64, 153, 159), new valueRange.ptr(24, 160, 171), new valueRange.ptr(64, 172, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(24, 128, 139), new valueRange.ptr(64, 140, 143), new valueRange.ptr(24, 144, 191), new valueRange.ptr(0, 5, 0), new valueRange.ptr(24, 128, 135), new valueRange.ptr(64, 136, 143), new valueRange.ptr(24, 144, 153), new valueRange.ptr(64, 154, 159), new valueRange.ptr(24, 160, 191), new valueRange.ptr(0, 6, 0), new valueRange.ptr(24, 128, 135), new valueRange.ptr(64, 136, 143), new valueRange.ptr(24, 144, 173), new valueRange.ptr(64, 174, 175), new valueRange.ptr(24, 176, 177), new valueRange.ptr(64, 178, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(24, 128, 184), new valueRange.ptr(64, 185, 185), new valueRange.ptr(24, 186, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(24, 128, 139), new valueRange.ptr(64, 140, 140), new valueRange.ptr(24, 141, 191), new valueRange.ptr(0, 8, 0), new valueRange.ptr(24, 128, 147), new valueRange.ptr(64, 148, 159), new valueRange.ptr(24, 160, 173), new valueRange.ptr(64, 174, 175), new valueRange.ptr(24, 176, 180), new valueRange.ptr(64, 181, 183), new valueRange.ptr(24, 184, 186), new valueRange.ptr(64, 187, 191), new valueRange.ptr(0, 6, 0), new valueRange.ptr(24, 128, 134), new valueRange.ptr(64, 135, 143), new valueRange.ptr(24, 144, 168), new valueRange.ptr(64, 169, 175), new valueRange.ptr(24, 176, 182), new valueRange.ptr(64, 183, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(24, 128, 130), new valueRange.ptr(64, 131, 143), new valueRange.ptr(24, 144, 150), new valueRange.ptr(64, 151, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(24, 128, 146), new valueRange.ptr(64, 147, 147), new valueRange.ptr(24, 148, 191), new valueRange.ptr(0, 13, 0), new valueRange.ptr(24, 128, 138), new valueRange.ptr(64, 139, 175), new valueRange.ptr(8001, 176, 176), new valueRange.ptr(201, 177, 177), new valueRange.ptr(105, 178, 178), new valueRange.ptr(121, 179, 179), new valueRange.ptr(8017, 180, 180), new valueRange.ptr(8033, 181, 181), new valueRange.ptr(8049, 182, 182), new valueRange.ptr(8065, 183, 183), new valueRange.ptr(8081, 184, 184), new valueRange.ptr(8097, 185, 185), new valueRange.ptr(64, 186, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(8, 128, 157), new valueRange.ptr(64, 158, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(8, 128, 180), new valueRange.ptr(64, 181, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(8, 128, 157), new valueRange.ptr(64, 158, 159), new valueRange.ptr(8, 160, 191), new valueRange.ptr(0, 3, 0), new valueRange.ptr(8, 128, 161), new valueRange.ptr(64, 162, 175), new valueRange.ptr(8, 176, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(8, 128, 160), new valueRange.ptr(64, 161, 191), new valueRange.ptr(32, 15, 0), new valueRange.ptr(57121, 128, 137), new valueRange.ptr(36405, 138, 138), new valueRange.ptr(57441, 139, 156), new valueRange.ptr(36437, 157, 157), new valueRange.ptr(58017, 158, 162), new valueRange.ptr(36469, 163, 163), new valueRange.ptr(58177, 164, 171), new valueRange.ptr(32525, 172, 172), new valueRange.ptr(58433, 173, 175), new valueRange.ptr(36501, 176, 176), new valueRange.ptr(58529, 177, 182), new valueRange.ptr(36533, 183, 185), new valueRange.ptr(58721, 186, 186), new valueRange.ptr(36629, 187, 187), new valueRange.ptr(58753, 188, 191), new valueRange.ptr(32, 16, 0), new valueRange.ptr(37813, 128, 128), new valueRange.ptr(61697, 129, 134), new valueRange.ptr(37845, 135, 138), new valueRange.ptr(55905, 139, 139), new valueRange.ptr(61889, 140, 150), new valueRange.ptr(37973, 151, 151), new valueRange.ptr(62241, 152, 163), new valueRange.ptr(38005, 164, 166), new valueRange.ptr(62625, 167, 170), new valueRange.ptr(38101, 171, 171), new valueRange.ptr(62753, 172, 172), new valueRange.ptr(38133, 173, 173), new valueRange.ptr(62785, 174, 175), new valueRange.ptr(38165, 176, 177), new valueRange.ptr(62849, 178, 190), new valueRange.ptr(8256, 191, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(8, 128, 138), new valueRange.ptr(64, 139, 191), new valueRange.ptr(0, 4, 0), new valueRange.ptr(64, 128, 128), new valueRange.ptr(832, 129, 129), new valueRange.ptr(64, 130, 159), new valueRange.ptr(832, 160, 191), new valueRange.ptr(0, 1, 0), new valueRange.ptr(832, 128, 191), new valueRange.ptr(0, 1, 0), new valueRange.ptr(13248, 128, 191), new valueRange.ptr(0, 2, 0), new valueRange.ptr(13248, 128, 175), new valueRange.ptr(64, 176, 191)]); idnaSparse = new sparseBlocks.ptr(new sliceType$1(idnaSparseValues), idnaSparseOffset); punycode = new Profile.ptr(new options.ptr(false, false, false, false, false, false, ptrType.nil, $throwNilPointerError, $throwNilPointerError, $throwNilPointerError)); $pkg.Punycode = punycode; lookup = new Profile.ptr(new options.ptr(true, true, true, true, false, false, trie, validateFromPunycode, validateAndMap, bidirule.ValidString)); $pkg.Lookup = lookup; joinStates = new sliceType$2([$toNativeArray($kindInt8, [0, 2, 2, 0, 0, 5, 5, 1]), $toNativeArray($kindInt8, [0, 2, 2, 0, 0, 0, 0, 0]), $toNativeArray($kindInt8, [0, 2, 2, 2, 0, 5, 4, 3]), $toNativeArray($kindInt8, [0, 2, 2, 2, 0, 0, 0, 0]), $toNativeArray($kindInt8, [0, 5, 2, 4, 0, 5, 5, 4]), $toNativeArray($kindInt8, [5, 5, 5, 5, 5, 5, 5, 5])]); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["vendor/golang.org/x/net/http/httpguts"] = (function() { var $pkg = {}, $init, net, textproto, strings, utf8, idna, isTokenTable, validHostByte, badTrailer, IsTokenRune, HeaderValuesContainsToken, isOWS, trimOWS, headerValueContainsToken, lowerASCII, tokenEqual, isLWS, isCTL, ValidHeaderFieldName, ValidHostHeader, ValidHeaderFieldValue, isASCII, PunycodeHostPort, ValidTrailerHeader; net = $packages["net"]; textproto = $packages["net/textproto"]; strings = $packages["strings"]; utf8 = $packages["unicode/utf8"]; idna = $packages["vendor/golang.org/x/net/idna"]; IsTokenRune = function(r) { var i, r; i = ((r >> 0)); return i < 127 && ((i < 0 || i >= isTokenTable.length) ? ($throwRuntimeError("index out of range"), undefined) : isTokenTable[i]); }; $pkg.IsTokenRune = IsTokenRune; HeaderValuesContainsToken = function(values, token) { var _i, _ref, token, v, values; _ref = values; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (headerValueContainsToken(v, token)) { return true; } _i++; } return false; }; $pkg.HeaderValuesContainsToken = HeaderValuesContainsToken; isOWS = function(b) { var b; return (b === 32) || (b === 9); }; trimOWS = function(x) { var x; while (true) { if (!(x.length > 0 && isOWS(x.charCodeAt(0)))) { break; } x = $substring(x, 1); } while (true) { if (!(x.length > 0 && isOWS(x.charCodeAt((x.length - 1 >> 0))))) { break; } x = $substring(x, 0, (x.length - 1 >> 0)); } return x; }; headerValueContainsToken = function(v, token) { var comma, token, v; comma = strings.IndexByte(v, 44); while (true) { if (!(!((comma === -1)))) { break; } if (tokenEqual(trimOWS($substring(v, 0, comma)), token)) { return true; } v = $substring(v, (comma + 1 >> 0)); comma = strings.IndexByte(v, 44); } return tokenEqual(trimOWS(v), token); }; lowerASCII = function(b) { var b; if (65 <= b && b <= 90) { return b + 32 << 24 >>> 24; } return b; }; tokenEqual = function(t1, t2) { var _i, _ref, _rune, b, i, t1, t2; if (!((t1.length === t2.length))) { return false; } _ref = t1; _i = 0; while (true) { if (!(_i < _ref.length)) { break; } _rune = $decodeRune(_ref, _i); i = _i; b = _rune[0]; if (b >= 128) { return false; } if (!((lowerASCII(((b << 24 >>> 24))) === lowerASCII(t2.charCodeAt(i))))) { return false; } _i += _rune[1]; } return true; }; isLWS = function(b) { var b; return (b === 32) || (b === 9); }; isCTL = function(b) { var b; return b < 32 || (b === 127); }; ValidHeaderFieldName = function(v) { var _i, _ref, _rune, r, v; if (v.length === 0) { return false; } _ref = v; _i = 0; while (true) { if (!(_i < _ref.length)) { break; } _rune = $decodeRune(_ref, _i); r = _rune[0]; if (!IsTokenRune(r)) { return false; } _i += _rune[1]; } return true; }; $pkg.ValidHeaderFieldName = ValidHeaderFieldName; ValidHostHeader = function(h) { var h, i, x; i = 0; while (true) { if (!(i < h.length)) { break; } if (!(x = h.charCodeAt(i), ((x < 0 || x >= validHostByte.length) ? ($throwRuntimeError("index out of range"), undefined) : validHostByte[x]))) { return false; } i = i + (1) >> 0; } return true; }; $pkg.ValidHostHeader = ValidHostHeader; ValidHeaderFieldValue = function(v) { var b, i, v; i = 0; while (true) { if (!(i < v.length)) { break; } b = v.charCodeAt(i); if (isCTL(b) && !isLWS(b)) { return false; } i = i + (1) >> 0; } return true; }; $pkg.ValidHeaderFieldValue = ValidHeaderFieldValue; isASCII = function(s) { var i, s; i = 0; while (true) { if (!(i < s.length)) { break; } if (s.charCodeAt(i) >= 128) { return false; } i = i + (1) >> 0; } return true; }; PunycodeHostPort = function(v) { var _r, _r$1, _tuple, _tuple$1, err, host, port, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; err = $f.err; host = $f.host; port = $f.port; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (isASCII(v)) { $s = -1; return [v, $ifaceNil]; } _r = net.SplitHostPort(v); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; host = _tuple[0]; port = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { host = v; port = ""; } _r$1 = idna.ToASCII(host); /* */ $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; host = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return ["", err]; } if (port === "") { $s = -1; return [host, $ifaceNil]; } $s = -1; return [net.JoinHostPort(host, port), $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: PunycodeHostPort }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.err = err; $f.host = host; $f.port = port; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.PunycodeHostPort = PunycodeHostPort; ValidTrailerHeader = function(name) { var _entry, _r, name, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _r = $f._r; name = $f.name; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = textproto.CanonicalMIMEHeaderKey(name); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } name = _r; if (strings.HasPrefix(name, "If-") || (_entry = badTrailer[$String.keyFor(name)], _entry !== undefined ? _entry.v : false)) { $s = -1; return false; } $s = -1; return true; /* */ } return; } if ($f === undefined) { $f = { $blk: ValidTrailerHeader }; } $f._entry = _entry; $f._r = _r; $f.name = name; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.ValidTrailerHeader = ValidTrailerHeader; $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 = net.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = textproto.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strings.$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; } $r = idna.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } isTokenTable = $toNativeArray($kindBool, [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, true, true, true, true, true, false, false, true, true, false, true, true, false, true, true, true, true, true, true, true, true, true, true, false, false, false, false, false, false, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, false, true]); validHostByte = $toNativeArray($kindBool, [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, false, true, false, false, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, false, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false]); badTrailer = $makeMap($String.keyFor, [{ k: "Authorization", v: true }, { k: "Cache-Control", v: true }, { k: "Connection", v: true }, { k: "Content-Encoding", v: true }, { k: "Content-Length", v: true }, { k: "Content-Range", v: true }, { k: "Content-Type", v: true }, { k: "Expect", v: true }, { k: "Host", v: true }, { k: "Keep-Alive", v: true }, { k: "Max-Forwards", v: true }, { k: "Pragma", v: true }, { k: "Proxy-Authenticate", v: true }, { k: "Proxy-Authorization", v: true }, { k: "Proxy-Connection", v: true }, { k: "Range", v: true }, { k: "Realm", v: true }, { k: "Te", v: true }, { k: "Trailer", v: true }, { k: "Transfer-Encoding", v: true }, { k: "Www-Authenticate", v: true }]); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["vendor/golang.org/x/net/http/httpproxy"] = (function() { var $pkg = {}, $init, errors, fmt, net, url, os, strings, utf8, idna; errors = $packages["errors"]; fmt = $packages["fmt"]; net = $packages["net"]; url = $packages["net/url"]; os = $packages["os"]; strings = $packages["strings"]; utf8 = $packages["unicode/utf8"]; idna = $packages["vendor/golang.org/x/net/idna"]; $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 = net.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = url.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = os.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strings.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = utf8.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = idna.$init(); /* */ $s = 8; case 8: 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["vendor/golang.org/x/net/http2/hpack"] = (function() { var $pkg = {}, $init, bytes, errors, fmt, io, sync, headerFieldTable, pairNameValue, incomparable, node, DecodingError, InvalidIndexError, HeaderField, Decoder, dynamicTable, indexType, Encoder, ptrType, sliceType, sliceType$1, sliceType$2, ptrType$1, arrayType, ptrType$2, funcType, arrayType$1, ptrType$3, mapType, mapType$1, funcType$1, ptrType$4, ptrType$5, ptrType$6, staticTable, staticTableEntries, huffmanCodes, huffmanCodeLen, bufPool, buildRootOnce, lazyRootHuffmanNode, errNeedMore, errVarintOverflow, newStaticTable, huffmanDecode, newInternalNode, getRootHuffmanNode, buildRootHuffmanNode, addDecoderNode, AppendHuffmanString, HuffmanEncodeLength, appendByteToHuffmanCode, NewDecoder, readVarInt, NewEncoder, appendIndexed, appendNewName, appendIndexedName, appendTableSize, appendVarInt, appendHpackString, encodeTypeByte; bytes = $packages["bytes"]; errors = $packages["errors"]; fmt = $packages["fmt"]; io = $packages["io"]; sync = $packages["sync"]; headerFieldTable = $pkg.headerFieldTable = $newType(0, $kindStruct, "hpack.headerFieldTable", true, "vendor/golang.org/x/net/http2/hpack", false, function(ents_, evictCount_, byName_, byNameValue_) { this.$val = this; if (arguments.length === 0) { this.ents = sliceType$2.nil; this.evictCount = new $Uint64(0, 0); this.byName = false; this.byNameValue = false; return; } this.ents = ents_; this.evictCount = evictCount_; this.byName = byName_; this.byNameValue = byNameValue_; }); pairNameValue = $pkg.pairNameValue = $newType(0, $kindStruct, "hpack.pairNameValue", true, "vendor/golang.org/x/net/http2/hpack", false, function(name_, value_) { this.$val = this; if (arguments.length === 0) { this.name = ""; this.value = ""; return; } this.name = name_; this.value = value_; }); incomparable = $pkg.incomparable = $newType(0, $kindArray, "hpack.incomparable", true, "vendor/golang.org/x/net/http2/hpack", false, null); node = $pkg.node = $newType(0, $kindStruct, "hpack.node", true, "vendor/golang.org/x/net/http2/hpack", false, function(_$0_, children_, codeLen_, sym_) { this.$val = this; if (arguments.length === 0) { this._$0 = arrayType$1.zero(); this.children = ptrType$2.nil; this.codeLen = 0; this.sym = 0; return; } this._$0 = _$0_; this.children = children_; this.codeLen = codeLen_; this.sym = sym_; }); DecodingError = $pkg.DecodingError = $newType(0, $kindStruct, "hpack.DecodingError", true, "vendor/golang.org/x/net/http2/hpack", true, function(Err_) { this.$val = this; if (arguments.length === 0) { this.Err = $ifaceNil; return; } this.Err = Err_; }); InvalidIndexError = $pkg.InvalidIndexError = $newType(4, $kindInt, "hpack.InvalidIndexError", true, "vendor/golang.org/x/net/http2/hpack", true, null); HeaderField = $pkg.HeaderField = $newType(0, $kindStruct, "hpack.HeaderField", true, "vendor/golang.org/x/net/http2/hpack", true, function(Name_, Value_, Sensitive_) { this.$val = this; if (arguments.length === 0) { this.Name = ""; this.Value = ""; this.Sensitive = false; return; } this.Name = Name_; this.Value = Value_; this.Sensitive = Sensitive_; }); Decoder = $pkg.Decoder = $newType(0, $kindStruct, "hpack.Decoder", true, "vendor/golang.org/x/net/http2/hpack", true, function(dynTab_, emit_, emitEnabled_, maxStrLen_, buf_, saveBuf_, firstField_) { this.$val = this; if (arguments.length === 0) { this.dynTab = new dynamicTable.ptr(new headerFieldTable.ptr(sliceType$2.nil, new $Uint64(0, 0), false, false), 0, 0, 0); this.emit = $throwNilPointerError; this.emitEnabled = false; this.maxStrLen = 0; this.buf = sliceType$1.nil; this.saveBuf = new bytes.Buffer.ptr(sliceType$1.nil, 0, 0); this.firstField = false; return; } this.dynTab = dynTab_; this.emit = emit_; this.emitEnabled = emitEnabled_; this.maxStrLen = maxStrLen_; this.buf = buf_; this.saveBuf = saveBuf_; this.firstField = firstField_; }); dynamicTable = $pkg.dynamicTable = $newType(0, $kindStruct, "hpack.dynamicTable", true, "vendor/golang.org/x/net/http2/hpack", false, function(table_, size_, maxSize_, allowedMaxSize_) { this.$val = this; if (arguments.length === 0) { this.table = new headerFieldTable.ptr(sliceType$2.nil, new $Uint64(0, 0), false, false); this.size = 0; this.maxSize = 0; this.allowedMaxSize = 0; return; } this.table = table_; this.size = size_; this.maxSize = maxSize_; this.allowedMaxSize = allowedMaxSize_; }); indexType = $pkg.indexType = $newType(4, $kindInt, "hpack.indexType", true, "vendor/golang.org/x/net/http2/hpack", false, null); Encoder = $pkg.Encoder = $newType(0, $kindStruct, "hpack.Encoder", true, "vendor/golang.org/x/net/http2/hpack", true, function(dynTab_, minSize_, maxSizeLimit_, tableSizeUpdate_, w_, buf_) { this.$val = this; if (arguments.length === 0) { this.dynTab = new dynamicTable.ptr(new headerFieldTable.ptr(sliceType$2.nil, new $Uint64(0, 0), false, false), 0, 0, 0); this.minSize = 0; this.maxSizeLimit = 0; this.tableSizeUpdate = false; this.w = $ifaceNil; this.buf = sliceType$1.nil; return; } this.dynTab = dynTab_; this.minSize = minSize_; this.maxSizeLimit = maxSizeLimit_; this.tableSizeUpdate = tableSizeUpdate_; this.w = w_; this.buf = buf_; }); ptrType = $ptrType(node); sliceType = $sliceType($emptyInterface); sliceType$1 = $sliceType($Uint8); sliceType$2 = $sliceType(HeaderField); ptrType$1 = $ptrType(bytes.Buffer); arrayType = $arrayType(ptrType, 256); ptrType$2 = $ptrType(arrayType); funcType = $funcType([], [], false); arrayType$1 = $arrayType(funcType, 0); ptrType$3 = $ptrType(headerFieldTable); mapType = $mapType($String, $Uint64); mapType$1 = $mapType(pairNameValue, $Uint64); funcType$1 = $funcType([HeaderField], [], false); ptrType$4 = $ptrType(Decoder); ptrType$5 = $ptrType(dynamicTable); ptrType$6 = $ptrType(Encoder); headerFieldTable.ptr.prototype.init = function() { var t; t = this; t.byName = {}; t.byNameValue = {}; }; headerFieldTable.prototype.init = function() { return this.$val.init(); }; headerFieldTable.ptr.prototype.len = function() { var t; t = this; return t.ents.$length; }; headerFieldTable.prototype.len = function() { return this.$val.len(); }; headerFieldTable.ptr.prototype.addEntry = function(f) { var _key, _key$1, f, id, t, x, x$1, x$2; t = this; id = (x = (x$1 = (new $Uint64(0, t.len())), x$2 = t.evictCount, new $Uint64(x$1.$high + x$2.$high, x$1.$low + x$2.$low)), new $Uint64(x.$high + 0, x.$low + 1)); _key = f.Name; (t.byName || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: id }; _key$1 = new pairNameValue.ptr(f.Name, f.Value); (t.byNameValue || $throwRuntimeError("assignment to entry in nil map"))[pairNameValue.keyFor(_key$1)] = { k: _key$1, v: id }; t.ents = $append(t.ents, f); }; headerFieldTable.prototype.addEntry = function(f) { return this.$val.addEntry(f); }; headerFieldTable.ptr.prototype.evictOldest = function(n) { var _entry, _entry$1, _r, f, id, k, k$1, n, p, t, 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; _entry = $f._entry; _entry$1 = $f._entry$1; _r = $f._r; f = $f.f; id = $f.id; k = $f.k; k$1 = $f.k$1; n = $f.n; p = $f.p; 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$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; /* */ if (n > t.len()) { $s = 1; continue; } /* */ $s = 2; continue; /* if (n > t.len()) { */ case 1: _r = fmt.Sprintf("evictOldest(%v) on table with %v entries", new sliceType([new $Int(n), new $Int(t.len())])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $panic(new $String(_r)); /* } */ case 2: k = 0; while (true) { if (!(k < n)) { break; } f = $clone((x = t.ents, ((k < 0 || k >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + k])), HeaderField); id = (x$1 = (x$2 = t.evictCount, x$3 = (new $Uint64(0, k)), new $Uint64(x$2.$high + x$3.$high, x$2.$low + x$3.$low)), new $Uint64(x$1.$high + 0, x$1.$low + 1)); if ((x$4 = (_entry = t.byName[$String.keyFor(f.Name)], _entry !== undefined ? _entry.v : new $Uint64(0, 0)), (x$4.$high === id.$high && x$4.$low === id.$low))) { delete t.byName[$String.keyFor(f.Name)]; } p = $clone(new pairNameValue.ptr(f.Name, f.Value), pairNameValue); if ((x$5 = (_entry$1 = t.byNameValue[pairNameValue.keyFor(p)], _entry$1 !== undefined ? _entry$1.v : new $Uint64(0, 0)), (x$5.$high === id.$high && x$5.$low === id.$low))) { delete t.byNameValue[pairNameValue.keyFor(p)]; } k = k + (1) >> 0; } $copySlice(t.ents, $subslice(t.ents, n)); k$1 = t.len() - n >> 0; while (true) { if (!(k$1 < t.len())) { break; } HeaderField.copy((x$6 = t.ents, ((k$1 < 0 || k$1 >= x$6.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$6.$array[x$6.$offset + k$1])), new HeaderField.ptr("", "", false)); k$1 = k$1 + (1) >> 0; } t.ents = $subslice(t.ents, 0, (t.len() - n >> 0)); if ((x$7 = (x$8 = t.evictCount, x$9 = (new $Uint64(0, n)), new $Uint64(x$8.$high + x$9.$high, x$8.$low + x$9.$low)), x$10 = t.evictCount, (x$7.$high < x$10.$high || (x$7.$high === x$10.$high && x$7.$low < x$10.$low)))) { $panic(new $String("evictCount overflow")); } t.evictCount = (x$11 = t.evictCount, x$12 = (new $Uint64(0, n)), new $Uint64(x$11.$high + x$12.$high, x$11.$low + x$12.$low)); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: headerFieldTable.ptr.prototype.evictOldest }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._r = _r; $f.f = f; $f.id = id; $f.k = k; $f.k$1 = k$1; $f.n = n; $f.p = p; $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$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; }; headerFieldTable.prototype.evictOldest = function(n) { return this.$val.evictOldest(n); }; headerFieldTable.ptr.prototype.search = function(f) { var $24r, $24r$1, _entry, _entry$1, _r, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, f, i, id, id$1, nameValueMatch, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _entry = $f._entry; _entry$1 = $f._entry$1; _r = $f._r; _r$1 = $f._r$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; f = $f.f; i = $f.i; id = $f.id; id$1 = $f.id$1; nameValueMatch = $f.nameValueMatch; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: i = new $Uint64(0, 0); nameValueMatch = false; t = this; /* */ if (!f.Sensitive) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!f.Sensitive) { */ case 1: id = (_entry = t.byNameValue[pairNameValue.keyFor(new pairNameValue.ptr(f.Name, f.Value))], _entry !== undefined ? _entry.v : new $Uint64(0, 0)); /* */ if (!((id.$high === 0 && id.$low === 0))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!((id.$high === 0 && id.$low === 0))) { */ case 3: _r = t.idToIndex(id); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tmp = _r; _tmp$1 = true; i = _tmp; nameValueMatch = _tmp$1; $24r = [i, nameValueMatch]; $s = 6; case 6: return $24r; /* } */ case 4: /* } */ case 2: id$1 = (_entry$1 = t.byName[$String.keyFor(f.Name)], _entry$1 !== undefined ? _entry$1.v : new $Uint64(0, 0)); /* */ if (!((id$1.$high === 0 && id$1.$low === 0))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!((id$1.$high === 0 && id$1.$low === 0))) { */ case 7: _r$1 = t.idToIndex(id$1); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tmp$2 = _r$1; _tmp$3 = false; i = _tmp$2; nameValueMatch = _tmp$3; $24r$1 = [i, nameValueMatch]; $s = 10; case 10: return $24r$1; /* } */ case 8: _tmp$4 = new $Uint64(0, 0); _tmp$5 = false; i = _tmp$4; nameValueMatch = _tmp$5; $s = -1; return [i, nameValueMatch]; /* */ } return; } if ($f === undefined) { $f = { $blk: headerFieldTable.ptr.prototype.search }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._entry = _entry; $f._entry$1 = _entry$1; $f._r = _r; $f._r$1 = _r$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.f = f; $f.i = i; $f.id = id; $f.id$1 = id$1; $f.nameValueMatch = nameValueMatch; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; headerFieldTable.prototype.search = function(f) { return this.$val.search(f); }; headerFieldTable.ptr.prototype.idToIndex = function(id) { var _r, id, k, t, 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; _r = $f._r; id = $f.id; k = $f.k; t = $f.t; 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: t = this; /* */ if ((x = t.evictCount, (id.$high < x.$high || (id.$high === x.$high && id.$low <= x.$low)))) { $s = 1; continue; } /* */ $s = 2; continue; /* if ((x = t.evictCount, (id.$high < x.$high || (id.$high === x.$high && id.$low <= x.$low)))) { */ case 1: _r = fmt.Sprintf("id (%v) <= evictCount (%v)", new sliceType([id, t.evictCount])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $panic(new $String(_r)); /* } */ case 2: k = (x$1 = (x$2 = t.evictCount, new $Uint64(id.$high - x$2.$high, id.$low - x$2.$low)), new $Uint64(x$1.$high - 0, x$1.$low - 1)); if (!(t === staticTable)) { $s = -1; return (x$3 = (new $Uint64(0, t.len())), new $Uint64(x$3.$high - k.$high, x$3.$low - k.$low)); } $s = -1; return new $Uint64(k.$high + 0, k.$low + 1); /* */ } return; } if ($f === undefined) { $f = { $blk: headerFieldTable.ptr.prototype.idToIndex }; } $f._r = _r; $f.id = id; $f.k = k; $f.t = t; $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; }; headerFieldTable.prototype.idToIndex = function(id) { return this.$val.idToIndex(id); }; newStaticTable = function() { var _i, _ref, e, t; t = new headerFieldTable.ptr(sliceType$2.nil, new $Uint64(0, 0), false, false); t.init(); _ref = new sliceType$2(staticTableEntries); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } e = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), HeaderField); t.addEntry($clone(e, HeaderField)); _i++; } return t; }; huffmanDecode = function(buf, maxLen, v) { var _i, _r, _r$1, _r$2, _ref, _tmp, _tmp$1, _tmp$2, b, buf, cbits, cur, idx, mask, maxLen, n, rootHuffmanNode, sbits, v, x, x$1, x$2, y, y$1, y$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; b = $f.b; buf = $f.buf; cbits = $f.cbits; cur = $f.cur; idx = $f.idx; mask = $f.mask; maxLen = $f.maxLen; n = $f.n; rootHuffmanNode = $f.rootHuffmanNode; sbits = $f.sbits; v = $f.v; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; y = $f.y; y$1 = $f.y$1; y$2 = $f.y$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = getRootHuffmanNode(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } rootHuffmanNode = _r; n = rootHuffmanNode; _tmp = 0; _tmp$1 = 0; _tmp$2 = 0; cur = _tmp; cbits = _tmp$1; sbits = _tmp$2; _ref = v; _i = 0; /* while (true) { */ case 2: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 3; continue; } b = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); cur = ((cur << 8 >>> 0) | ((b >>> 0))) >>> 0; cbits = cbits + (8) << 24 >>> 24; sbits = sbits + (8) << 24 >>> 24; /* while (true) { */ case 4: /* if (!(cbits >= 8)) { break; } */ if(!(cbits >= 8)) { $s = 5; continue; } idx = ((((y = ((cbits - 8 << 24 >>> 24)), y < 32 ? (cur >>> y) : 0) >>> 0) << 24 >>> 24)); n = (x = n.children, ((idx < 0 || idx >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[idx])); if (n === ptrType.nil) { $s = -1; return $pkg.ErrInvalidHuffman; } /* */ if (n.children === ptrType$2.nil) { $s = 6; continue; } /* */ $s = 7; continue; /* if (n.children === ptrType$2.nil) { */ case 6: if (!((maxLen === 0)) && (buf.Len() === maxLen)) { $s = -1; return $pkg.ErrStringLength; } _r$1 = buf.WriteByte(n.sym); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; cbits = cbits - (n.codeLen) << 24 >>> 24; n = rootHuffmanNode; sbits = cbits; $s = 8; continue; /* } else { */ case 7: cbits = cbits - (8) << 24 >>> 24; /* } */ case 8: $s = 4; continue; case 5: _i++; $s = 2; continue; case 3: /* while (true) { */ case 10: /* if (!(cbits > 0)) { break; } */ if(!(cbits > 0)) { $s = 11; continue; } n = (x$1 = n.children, x$2 = ((((y$1 = ((8 - cbits << 24 >>> 24)), y$1 < 32 ? (cur << y$1) : 0) >>> 0) << 24 >>> 24)), ((x$2 < 0 || x$2 >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[x$2])); if (n === ptrType.nil) { $s = -1; return $pkg.ErrInvalidHuffman; } if (!(n.children === ptrType$2.nil) || n.codeLen > cbits) { /* break; */ $s = 11; continue; } if (!((maxLen === 0)) && (buf.Len() === maxLen)) { $s = -1; return $pkg.ErrStringLength; } _r$2 = buf.WriteByte(n.sym); /* */ $s = 12; case 12: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; cbits = cbits - (n.codeLen) << 24 >>> 24; n = rootHuffmanNode; sbits = cbits; $s = 10; continue; case 11: if (sbits > 7) { $s = -1; return $pkg.ErrInvalidHuffman; } mask = ((((y$2 = cbits, y$2 < 32 ? (1 << y$2) : 0) >>> 0) - 1 >>> 0)); if (!((((cur & mask) >>> 0) === mask))) { $s = -1; return $pkg.ErrInvalidHuffman; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: huffmanDecode }; } $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f.b = b; $f.buf = buf; $f.cbits = cbits; $f.cur = cur; $f.idx = idx; $f.mask = mask; $f.maxLen = maxLen; $f.n = n; $f.rootHuffmanNode = rootHuffmanNode; $f.sbits = sbits; $f.v = v; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.y = y; $f.y$1 = y$1; $f.y$2 = y$2; $f.$s = $s; $f.$r = $r; return $f; }; newInternalNode = function() { return new node.ptr(arrayType$1.zero(), arrayType.zero(), 0, 0); }; getRootHuffmanNode = function() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = buildRootOnce.Do(buildRootHuffmanNode); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return lazyRootHuffmanNode; /* */ } return; } if ($f === undefined) { $f = { $blk: getRootHuffmanNode }; } $f.$s = $s; $f.$r = $r; return $f; }; buildRootHuffmanNode = function() { var _i, _ref, code, i; if (false) { $panic(new $String("unexpected size")); } lazyRootHuffmanNode = newInternalNode(); _ref = huffmanCodes; _i = 0; while (true) { if (!(_i < 256)) { break; } i = _i; code = ((_i < 0 || _i >= _ref.length) ? ($throwRuntimeError("index out of range"), undefined) : _ref[_i]); addDecoderNode(((i << 24 >>> 24)), code, ((i < 0 || i >= huffmanCodeLen.length) ? ($throwRuntimeError("index out of range"), undefined) : huffmanCodeLen[i])); _i++; } }; addDecoderNode = function(sym, code, codeLen) { var _tmp, _tmp$1, code, codeLen, cur, end, i, i$1, shift, start, sym, x, x$1, x$2, x$3, y, y$1, y$2; cur = lazyRootHuffmanNode; while (true) { if (!(codeLen > 8)) { break; } codeLen = codeLen - (8) << 24 >>> 24; i = ((((y = codeLen, y < 32 ? (code >>> y) : 0) >>> 0) << 24 >>> 24)); if ((x = cur.children, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i])) === ptrType.nil) { (x$1 = cur.children, x$1.nilCheck, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i] = newInternalNode())); } cur = (x$2 = cur.children, ((i < 0 || i >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i])); } shift = 8 - codeLen << 24 >>> 24; _tmp = ((((((y$1 = shift, y$1 < 32 ? (code << y$1) : 0) >>> 0) << 24 >>> 24)) >> 0)); _tmp$1 = (((y$2 = shift, y$2 < 32 ? (1 << y$2) : 0) >> 0)); start = _tmp; end = _tmp$1; i$1 = start; while (true) { if (!(i$1 < (start + end >> 0))) { break; } (x$3 = cur.children, x$3.nilCheck, ((i$1 < 0 || i$1 >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[i$1] = new node.ptr(arrayType$1.zero(), ptrType$2.nil, codeLen, sym))); i$1 = i$1 + (1) >> 0; } }; AppendHuffmanString = function(dst, s) { var _index, _tuple, code, dst, i, nbits, rembits, s, t, y; rembits = 8; i = 0; while (true) { if (!(i < s.length)) { break; } if (rembits === 8) { dst = $append(dst, 0); } _tuple = appendByteToHuffmanCode(dst, rembits, s.charCodeAt(i)); dst = _tuple[0]; rembits = _tuple[1]; i = i + (1) >> 0; } if (rembits < 8) { code = 1073741823; nbits = 30; t = ((((y = ((nbits - rembits << 24 >>> 24)), y < 32 ? (code >>> y) : 0) >>> 0) << 24 >>> 24)); _index = dst.$length - 1 >> 0; ((_index < 0 || _index >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + _index] = ((((_index < 0 || _index >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + _index]) | (t)) >>> 0)); } return dst; }; $pkg.AppendHuffmanString = AppendHuffmanString; HuffmanEncodeLength = function(s) { var i, n, s, x, x$1; n = new $Uint64(0, 0); i = 0; while (true) { if (!(i < s.length)) { break; } n = (x = (new $Uint64(0, (x$1 = s.charCodeAt(i), ((x$1 < 0 || x$1 >= huffmanCodeLen.length) ? ($throwRuntimeError("index out of range"), undefined) : huffmanCodeLen[x$1])))), new $Uint64(n.$high + x.$high, n.$low + x.$low)); i = i + (1) >> 0; } return $div64((new $Uint64(n.$high + 0, n.$low + 7)), new $Uint64(0, 8), false); }; $pkg.HuffmanEncodeLength = HuffmanEncodeLength; appendByteToHuffmanCode = function(dst, rembits, c) { var _index, _index$1, c, code, dst, nbits, rembits, t, t$1, y, y$1; code = ((c < 0 || c >= huffmanCodes.length) ? ($throwRuntimeError("index out of range"), undefined) : huffmanCodes[c]); nbits = ((c < 0 || c >= huffmanCodeLen.length) ? ($throwRuntimeError("index out of range"), undefined) : huffmanCodeLen[c]); while (true) { if (rembits > nbits) { t = ((((y = ((rembits - nbits << 24 >>> 24)), y < 32 ? (code << y) : 0) >>> 0) << 24 >>> 24)); _index = dst.$length - 1 >> 0; ((_index < 0 || _index >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + _index] = ((((_index < 0 || _index >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + _index]) | (t)) >>> 0)); rembits = rembits - (nbits) << 24 >>> 24; break; } t$1 = ((((y$1 = ((nbits - rembits << 24 >>> 24)), y$1 < 32 ? (code >>> y$1) : 0) >>> 0) << 24 >>> 24)); _index$1 = dst.$length - 1 >> 0; ((_index$1 < 0 || _index$1 >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + _index$1] = ((((_index$1 < 0 || _index$1 >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + _index$1]) | (t$1)) >>> 0)); nbits = nbits - (rembits) << 24 >>> 24; rembits = 8; if (nbits === 0) { break; } dst = $append(dst, 0); } return [dst, rembits]; }; DecodingError.ptr.prototype.Error = function() { var $24r, _r, de, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; de = $f.de; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: de = this; _r = fmt.Sprintf("decoding error: %v", new sliceType([de.Err])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: DecodingError.ptr.prototype.Error }; } $f.$24r = $24r; $f._r = _r; $f.de = de; $f.$s = $s; $f.$r = $r; return $f; }; DecodingError.prototype.Error = function() { return this.$val.Error(); }; InvalidIndexError.prototype.Error = function() { var $24r, _r, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this.$val; _r = fmt.Sprintf("invalid indexed representation index %d", new sliceType([new $Int(((e >> 0)))])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: InvalidIndexError.prototype.Error }; } $f.$24r = $24r; $f._r = _r; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(InvalidIndexError).prototype.Error = function() { return new InvalidIndexError(this.$get()).Error(); }; HeaderField.ptr.prototype.IsPseudo = function() { var hf; hf = this; return !((hf.Name.length === 0)) && (hf.Name.charCodeAt(0) === 58); }; HeaderField.prototype.IsPseudo = function() { return this.$val.IsPseudo(); }; HeaderField.ptr.prototype.String = function() { var $24r, _r, hf, suffix, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; hf = $f.hf; suffix = $f.suffix; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hf = this; suffix = ""; if (hf.Sensitive) { suffix = " (sensitive)"; } _r = fmt.Sprintf("header field %q = %q%s", new sliceType([new $String(hf.Name), new $String(hf.Value), new $String(suffix)])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: HeaderField.ptr.prototype.String }; } $f.$24r = $24r; $f._r = _r; $f.hf = hf; $f.suffix = suffix; $f.$s = $s; $f.$r = $r; return $f; }; HeaderField.prototype.String = function() { return this.$val.String(); }; HeaderField.ptr.prototype.Size = function() { var hf; hf = this; return ((((hf.Name.length + hf.Value.length >> 0) + 32 >> 0) >>> 0)); }; HeaderField.prototype.Size = function() { return this.$val.Size(); }; NewDecoder = function(maxDynamicTableSize, emitFunc) { var d, emitFunc, maxDynamicTableSize, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; d = $f.d; emitFunc = $f.emitFunc; maxDynamicTableSize = $f.maxDynamicTableSize; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: d = new Decoder.ptr(new dynamicTable.ptr(new headerFieldTable.ptr(sliceType$2.nil, new $Uint64(0, 0), false, false), 0, 0, 0), emitFunc, true, 0, sliceType$1.nil, new bytes.Buffer.ptr(sliceType$1.nil, 0, 0), true); d.dynTab.table.init(); d.dynTab.allowedMaxSize = maxDynamicTableSize; $r = d.dynTab.setMaxSize(maxDynamicTableSize); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return d; /* */ } return; } if ($f === undefined) { $f = { $blk: NewDecoder }; } $f.d = d; $f.emitFunc = emitFunc; $f.maxDynamicTableSize = maxDynamicTableSize; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.NewDecoder = NewDecoder; Decoder.ptr.prototype.SetMaxStringLength = function(n) { var d, n; d = this; d.maxStrLen = n; }; Decoder.prototype.SetMaxStringLength = function(n) { return this.$val.SetMaxStringLength(n); }; Decoder.ptr.prototype.SetEmitFunc = function(emitFunc) { var d, emitFunc; d = this; d.emit = emitFunc; }; Decoder.prototype.SetEmitFunc = function(emitFunc) { return this.$val.SetEmitFunc(emitFunc); }; Decoder.ptr.prototype.SetEmitEnabled = function(v) { var d, v; d = this; d.emitEnabled = v; }; Decoder.prototype.SetEmitEnabled = function(v) { return this.$val.SetEmitEnabled(v); }; Decoder.ptr.prototype.EmitEnabled = function() { var d; d = this; return d.emitEnabled; }; Decoder.prototype.EmitEnabled = function() { return this.$val.EmitEnabled(); }; Decoder.ptr.prototype.SetMaxDynamicTableSize = function(v) { var d, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; d = $f.d; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: d = this; $r = d.dynTab.setMaxSize(v); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Decoder.ptr.prototype.SetMaxDynamicTableSize }; } $f.d = d; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Decoder.prototype.SetMaxDynamicTableSize = function(v) { return this.$val.SetMaxDynamicTableSize(v); }; Decoder.ptr.prototype.SetAllowedMaxDynamicTableSize = function(v) { var d, v; d = this; d.dynTab.allowedMaxSize = v; }; Decoder.prototype.SetAllowedMaxDynamicTableSize = function(v) { return this.$val.SetAllowedMaxDynamicTableSize(v); }; dynamicTable.ptr.prototype.setMaxSize = function(v) { var dt, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; dt = $f.dt; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: dt = this; dt.maxSize = v; $r = dt.evict(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: dynamicTable.ptr.prototype.setMaxSize }; } $f.dt = dt; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; dynamicTable.prototype.setMaxSize = function(v) { return this.$val.setMaxSize(v); }; dynamicTable.ptr.prototype.add = function(f) { var dt, f, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; dt = $f.dt; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: dt = this; dt.table.addEntry($clone(f, HeaderField)); dt.size = dt.size + ($clone(f, HeaderField).Size()) >>> 0; $r = dt.evict(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: dynamicTable.ptr.prototype.add }; } $f.dt = dt; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; }; dynamicTable.prototype.add = function(f) { return this.$val.add(f); }; dynamicTable.ptr.prototype.evict = function() { var dt, n, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; dt = $f.dt; n = $f.n; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: dt = this; n = 0; while (true) { if (!(dt.size > dt.maxSize && n < dt.table.len())) { break; } dt.size = dt.size - ($clone((x = dt.table.ents, ((n < 0 || n >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + n])), HeaderField).Size()) >>> 0; n = n + (1) >> 0; } $r = dt.table.evictOldest(n); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: dynamicTable.ptr.prototype.evict }; } $f.dt = dt; $f.n = n; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; dynamicTable.prototype.evict = function() { return this.$val.evict(); }; Decoder.ptr.prototype.maxTableIndex = function() { var d; d = this; return d.dynTab.table.len() + staticTable.len() >> 0; }; Decoder.prototype.maxTableIndex = function() { return this.$val.maxTableIndex(); }; Decoder.ptr.prototype.at = function(i) { var _tmp, _tmp$1, _tmp$2, _tmp$3, d, dt, hf, i, ok, x, x$1, x$2, x$3, x$4, x$5; hf = new HeaderField.ptr("", "", false); ok = false; d = this; if ((i.$high === 0 && i.$low === 0)) { return [hf, ok]; } if ((x = (new $Uint64(0, staticTable.len())), (i.$high < x.$high || (i.$high === x.$high && i.$low <= x.$low)))) { _tmp = $clone((x$1 = staticTable.ents, x$2 = new $Uint64(i.$high - 0, i.$low - 1), (($flatten64(x$2) < 0 || $flatten64(x$2) >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + $flatten64(x$2)])), HeaderField); _tmp$1 = true; HeaderField.copy(hf, _tmp); ok = _tmp$1; return [hf, ok]; } if ((x$3 = (new $Uint64(0, d.maxTableIndex())), (i.$high > x$3.$high || (i.$high === x$3.$high && i.$low > x$3.$low)))) { return [hf, ok]; } dt = $clone(d.dynTab.table, headerFieldTable); _tmp$2 = $clone((x$4 = dt.ents, x$5 = dt.len() - ((((i.$low >> 0)) - staticTable.len() >> 0)) >> 0, ((x$5 < 0 || x$5 >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + x$5])), HeaderField); _tmp$3 = true; HeaderField.copy(hf, _tmp$2); ok = _tmp$3; return [hf, ok]; }; Decoder.prototype.at = function(i) { return this.$val.at(i); }; Decoder.ptr.prototype.DecodeFull = function(p) { var $24r, $24r$1, $24r$2, _r, _tuple, d, err, err$1, hf, p, saveFunc, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _r = $f._r; _tuple = $f._tuple; d = $f.d; err = $f.err; err$1 = $f.err$1; hf = $f.hf; p = $f.p; saveFunc = $f.saveFunc; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); d = [d]; hf = [hf]; saveFunc = [saveFunc]; d[0] = this; hf[0] = sliceType$2.nil; saveFunc[0] = d[0].emit; $deferred.push([(function(d, hf, saveFunc) { return function() { d[0].emit = saveFunc[0]; }; })(d, hf, saveFunc), []]); d[0].emit = (function(d, hf, saveFunc) { return function(f) { var f; hf[0] = $append(hf[0], f); }; })(d, hf, saveFunc); _r = d[0].Write(p); /* */ $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))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $24r = [sliceType$2.nil, err]; $s = 4; case 4: return $24r; /* } */ case 3: err$1 = d[0].Close(); /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 5: $24r$1 = [sliceType$2.nil, err$1]; $s = 7; case 7: return $24r$1; /* } */ case 6: $24r$2 = [hf[0], $ifaceNil]; $s = 8; case 8: return $24r$2; /* */ } return; } } catch(err) { $err = err; $s = -1; return [sliceType$2.nil, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Decoder.ptr.prototype.DecodeFull }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._r = _r; $f._tuple = _tuple; $f.d = d; $f.err = err; $f.err$1 = err$1; $f.hf = hf; $f.p = p; $f.saveFunc = saveFunc; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Decoder.prototype.DecodeFull = function(p) { return this.$val.DecodeFull(p); }; Decoder.ptr.prototype.Close = function() { var d, x; d = this; if (d.saveBuf.Len() > 0) { d.saveBuf.Reset(); return (x = new DecodingError.ptr(errors.New("truncated headers")), new x.constructor.elem(x)); } d.firstField = true; return $ifaceNil; }; Decoder.prototype.Close = function() { return this.$val.Close(); }; Decoder.ptr.prototype.Write = function(p) { var _r, _r$1, _r$2, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, d, err, n, p, x, x$1, x$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; d = $f.d; err = $f.err; n = $f.n; 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; d = this; if (p.$length === 0) { $s = -1; return [n, err]; } /* */ if (d.saveBuf.Len() === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (d.saveBuf.Len() === 0) { */ case 1: d.buf = p; $s = 3; continue; /* } else { */ case 2: _r = d.saveBuf.Write(p); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; d.buf = d.saveBuf.Bytes(); d.saveBuf.Reset(); /* } */ case 3: /* while (true) { */ case 5: /* if (!(d.buf.$length > 0)) { break; } */ if(!(d.buf.$length > 0)) { $s = 6; continue; } _r$1 = d.parseHeaderFieldRepr(); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err = _r$1; /* */ if ($interfaceIsEqual(err, errNeedMore)) { $s = 8; continue; } /* */ $s = 9; continue; /* if ($interfaceIsEqual(err, errNeedMore)) { */ case 8: if (!((d.maxStrLen === 0)) && (x = (new $Int64(0, d.buf.$length)), x$1 = $mul64(new $Int64(0, 2), ((x$2 = (new $Int64(0, d.maxStrLen)), new $Int64(x$2.$high + 0, x$2.$low + 8)))), (x.$high > x$1.$high || (x.$high === x$1.$high && x.$low > x$1.$low)))) { _tmp = 0; _tmp$1 = $pkg.ErrStringLength; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } _r$2 = d.saveBuf.Write(d.buf); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; _tmp$2 = p.$length; _tmp$3 = $ifaceNil; n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; /* } */ case 9: d.firstField = false; if (!($interfaceIsEqual(err, $ifaceNil))) { /* break; */ $s = 6; continue; } $s = 5; continue; case 6: _tmp$4 = p.$length; _tmp$5 = err; n = _tmp$4; err = _tmp$5; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Decoder.ptr.prototype.Write }; } $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.d = d; $f.err = err; $f.n = n; $f.p = p; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; }; Decoder.prototype.Write = function(p) { return this.$val.Write(p); }; indexType.prototype.indexed = function() { var v; v = this.$val; return v === 0; }; $ptrType(indexType).prototype.indexed = function() { return new indexType(this.$get()).indexed(); }; indexType.prototype.sensitive = function() { var v; v = this.$val; return v === 2; }; $ptrType(indexType).prototype.sensitive = function() { return new indexType(this.$get()).sensitive(); }; Decoder.ptr.prototype.parseHeaderFieldRepr = function() { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, _r, _r$1, _r$2, _r$3, _r$4, b, d, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; b = $f.b; d = $f.d; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: d = this; b = (x = d.buf, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])); /* */ if (!((((b & 128) >>> 0) === 0))) { $s = 2; continue; } /* */ if ((((b & 192) >>> 0) === 64)) { $s = 3; continue; } /* */ if ((((b & 240) >>> 0) === 0)) { $s = 4; continue; } /* */ if ((((b & 240) >>> 0) === 16)) { $s = 5; continue; } /* */ if ((((b & 224) >>> 0) === 32)) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!((((b & 128) >>> 0) === 0))) { */ case 2: _r = d.parseFieldIndexed(); /* */ $s = 8; case 8: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 9; case 9: return $24r; /* } else if ((((b & 192) >>> 0) === 64)) { */ case 3: _r$1 = d.parseFieldLiteral(6, 0); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r$1 = _r$1; $s = 11; case 11: return $24r$1; /* } else if ((((b & 240) >>> 0) === 0)) { */ case 4: _r$2 = d.parseFieldLiteral(4, 1); /* */ $s = 12; case 12: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r$2 = _r$2; $s = 13; case 13: return $24r$2; /* } else if ((((b & 240) >>> 0) === 16)) { */ case 5: _r$3 = d.parseFieldLiteral(4, 2); /* */ $s = 14; case 14: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r$3 = _r$3; $s = 15; case 15: return $24r$3; /* } else if ((((b & 224) >>> 0) === 32)) { */ case 6: _r$4 = d.parseDynamicTableSizeUpdate(); /* */ $s = 16; case 16: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r$4 = _r$4; $s = 17; case 17: return $24r$4; /* } */ case 7: case 1: $s = -1; return (x$1 = new DecodingError.ptr(errors.New("invalid encoding")), new x$1.constructor.elem(x$1)); /* */ } return; } if ($f === undefined) { $f = { $blk: Decoder.ptr.prototype.parseHeaderFieldRepr }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.b = b; $f.d = d; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; Decoder.prototype.parseHeaderFieldRepr = function() { return this.$val.parseHeaderFieldRepr(); }; Decoder.ptr.prototype.parseFieldIndexed = function() { var $24r, _r, _tuple, _tuple$1, buf, d, err, hf, idx, ok, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; buf = $f.buf; d = $f.d; err = $f.err; hf = $f.hf; idx = $f.idx; ok = $f.ok; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: d = this; buf = d.buf; _tuple = readVarInt(7, buf); idx = _tuple[0]; buf = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _tuple$1 = d.at(idx); hf = $clone(_tuple$1[0], HeaderField); ok = _tuple$1[1]; if (!ok) { $s = -1; return (x = new DecodingError.ptr(new InvalidIndexError(((idx.$low >> 0)))), new x.constructor.elem(x)); } d.buf = buf; _r = d.callEmit(new HeaderField.ptr(hf.Name, hf.Value, false)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Decoder.ptr.prototype.parseFieldIndexed }; } $f.$24r = $24r; $f._r = _r; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.buf = buf; $f.d = d; $f.err = err; $f.hf = hf; $f.idx = idx; $f.ok = ok; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Decoder.prototype.parseFieldIndexed = function() { return this.$val.parseFieldIndexed(); }; Decoder.ptr.prototype.parseFieldLiteral = function(n, it) { var $24r, _r, _r$1, _r$2, _tuple, _tuple$1, _tuple$2, _tuple$3, buf, d, err, hf, ihf, it, n, nameIdx, ok, wantStr, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; buf = $f.buf; d = $f.d; err = $f.err; hf = $f.hf; ihf = $f.ihf; it = $f.it; n = $f.n; nameIdx = $f.nameIdx; ok = $f.ok; wantStr = $f.wantStr; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: d = this; buf = d.buf; _tuple = readVarInt(n, buf); nameIdx = _tuple[0]; buf = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } hf = new HeaderField.ptr("", "", false); wantStr = d.emitEnabled || new indexType(it).indexed(); /* */ if ((nameIdx.$high > 0 || (nameIdx.$high === 0 && nameIdx.$low > 0))) { $s = 1; continue; } /* */ $s = 2; continue; /* if ((nameIdx.$high > 0 || (nameIdx.$high === 0 && nameIdx.$low > 0))) { */ case 1: _tuple$1 = d.at(nameIdx); ihf = $clone(_tuple$1[0], HeaderField); ok = _tuple$1[1]; if (!ok) { $s = -1; return (x = new DecodingError.ptr(new InvalidIndexError(((nameIdx.$low >> 0)))), new x.constructor.elem(x)); } hf.Name = ihf.Name; $s = 3; continue; /* } else { */ case 2: _r = d.readString(buf, wantStr); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple$2 = _r; hf.Name = _tuple$2[0]; buf = _tuple$2[1]; err = _tuple$2[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } /* } */ case 3: _r$1 = d.readString(buf, wantStr); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$3 = _r$1; hf.Value = _tuple$3[0]; buf = _tuple$3[1]; err = _tuple$3[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } d.buf = buf; /* */ if (new indexType(it).indexed()) { $s = 6; continue; } /* */ $s = 7; continue; /* if (new indexType(it).indexed()) { */ case 6: $r = d.dynTab.add($clone(hf, HeaderField)); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 7: hf.Sensitive = new indexType(it).sensitive(); _r$2 = d.callEmit($clone(hf, HeaderField)); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 10; case 10: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Decoder.ptr.prototype.parseFieldLiteral }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.buf = buf; $f.d = d; $f.err = err; $f.hf = hf; $f.ihf = ihf; $f.it = it; $f.n = n; $f.nameIdx = nameIdx; $f.ok = ok; $f.wantStr = wantStr; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Decoder.prototype.parseFieldLiteral = function(n, it) { return this.$val.parseFieldLiteral(n, it); }; Decoder.ptr.prototype.callEmit = function(hf) { var d, hf, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; d = $f.d; hf = $f.hf; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: d = this; if (!((d.maxStrLen === 0))) { if (hf.Name.length > d.maxStrLen || hf.Value.length > d.maxStrLen) { $s = -1; return $pkg.ErrStringLength; } } /* */ if (d.emitEnabled) { $s = 1; continue; } /* */ $s = 2; continue; /* if (d.emitEnabled) { */ case 1: $r = d.emit($clone(hf, HeaderField)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Decoder.ptr.prototype.callEmit }; } $f.d = d; $f.hf = hf; $f.$s = $s; $f.$r = $r; return $f; }; Decoder.prototype.callEmit = function(hf) { return this.$val.callEmit(hf); }; Decoder.ptr.prototype.parseDynamicTableSizeUpdate = function() { var _tuple, buf, d, err, size, x, x$1, x$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; buf = $f.buf; d = $f.d; err = $f.err; size = $f.size; 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: d = this; if (!d.firstField && d.dynTab.size > 0) { $s = -1; return (x = new DecodingError.ptr(errors.New("dynamic table size update MUST occur at the beginning of a header block")), new x.constructor.elem(x)); } buf = d.buf; _tuple = readVarInt(5, buf); size = _tuple[0]; buf = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } if ((x$1 = (new $Uint64(0, d.dynTab.allowedMaxSize)), (size.$high > x$1.$high || (size.$high === x$1.$high && size.$low > x$1.$low)))) { $s = -1; return (x$2 = new DecodingError.ptr(errors.New("dynamic table size update too large")), new x$2.constructor.elem(x$2)); } $r = d.dynTab.setMaxSize(((size.$low >>> 0))); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } d.buf = buf; $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Decoder.ptr.prototype.parseDynamicTableSizeUpdate }; } $f._tuple = _tuple; $f.buf = buf; $f.d = d; $f.err = err; $f.size = size; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; }; Decoder.prototype.parseDynamicTableSizeUpdate = function() { return this.$val.parseDynamicTableSizeUpdate(); }; readVarInt = function(n, p) { var _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, b, err, i, m, n, origP, p, remain, x, x$1, x$2, x$3, x$4, x$5; i = new $Uint64(0, 0); remain = sliceType$1.nil; err = $ifaceNil; if (n < 1 || n > 8) { $panic(new $String("bad n")); } if (p.$length === 0) { _tmp = new $Uint64(0, 0); _tmp$1 = p; _tmp$2 = errNeedMore; i = _tmp; remain = _tmp$1; err = _tmp$2; return [i, remain, err]; } i = (new $Uint64(0, (0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0]))); if (n < 8) { i = (x = (x$1 = $shiftLeft64(new $Uint64(0, 1), $flatten64((new $Uint64(0, n)))), new $Uint64(x$1.$high - 0, x$1.$low - 1)), new $Uint64(i.$high & x.$high, (i.$low & x.$low) >>> 0)); } if ((x$2 = (x$3 = $shiftLeft64(new $Uint64(0, 1), $flatten64((new $Uint64(0, n)))), new $Uint64(x$3.$high - 0, x$3.$low - 1)), (i.$high < x$2.$high || (i.$high === x$2.$high && i.$low < x$2.$low)))) { _tmp$3 = i; _tmp$4 = $subslice(p, 1); _tmp$5 = $ifaceNil; i = _tmp$3; remain = _tmp$4; err = _tmp$5; return [i, remain, err]; } origP = p; p = $subslice(p, 1); m = new $Uint64(0, 0); while (true) { if (!(p.$length > 0)) { break; } b = (0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0]); p = $subslice(p, 1); i = (x$4 = $shiftLeft64((new $Uint64(0, ((b & 127) >>> 0))), $flatten64(m)), new $Uint64(i.$high + x$4.$high, i.$low + x$4.$low)); if (((b & 128) >>> 0) === 0) { _tmp$6 = i; _tmp$7 = p; _tmp$8 = $ifaceNil; i = _tmp$6; remain = _tmp$7; err = _tmp$8; return [i, remain, err]; } m = (x$5 = new $Uint64(0, 7), new $Uint64(m.$high + x$5.$high, m.$low + x$5.$low)); if ((m.$high > 0 || (m.$high === 0 && m.$low >= 63))) { _tmp$9 = new $Uint64(0, 0); _tmp$10 = origP; _tmp$11 = new errVarintOverflow.constructor.elem(errVarintOverflow); i = _tmp$9; remain = _tmp$10; err = _tmp$11; return [i, remain, err]; } } _tmp$12 = new $Uint64(0, 0); _tmp$13 = origP; _tmp$14 = errNeedMore; i = _tmp$12; remain = _tmp$13; err = _tmp$14; return [i, remain, err]; }; Decoder.ptr.prototype.readString = function(p, wantStr) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, $24r$5, $24r$6, _r, _r$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$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, buf, d, err, err$1, isHuff, p, remain, s, strLen, wantStr, x, x$1, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; $24r$6 = $f.$24r$6; _r = $f._r; _r$1 = $f._r$1; _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$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _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 = $f._tuple; buf = $f.buf; d = $f.d; err = $f.err; err$1 = $f.err$1; isHuff = $f.isHuff; p = $f.p; remain = $f.remain; s = $f.s; strLen = $f.strLen; wantStr = $f.wantStr; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); s = ""; remain = sliceType$1.nil; err = $ifaceNil; d = this; /* */ if (p.$length === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (p.$length === 0) { */ case 1: _tmp = ""; _tmp$1 = p; _tmp$2 = errNeedMore; s = _tmp; remain = _tmp$1; err = _tmp$2; $24r = [s, remain, err]; $s = 3; case 3: return $24r; /* } */ case 2: isHuff = !(((((0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0]) & 128) >>> 0) === 0)); _tuple = readVarInt(7, p); strLen = _tuple[0]; p = _tuple[1]; err = _tuple[2]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 4: _tmp$3 = ""; _tmp$4 = p; _tmp$5 = err; s = _tmp$3; remain = _tmp$4; err = _tmp$5; $24r$1 = [s, remain, err]; $s = 6; case 6: return $24r$1; /* } */ case 5: /* */ if (!((d.maxStrLen === 0)) && (x = (new $Uint64(0, d.maxStrLen)), (strLen.$high > x.$high || (strLen.$high === x.$high && strLen.$low > x.$low)))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!((d.maxStrLen === 0)) && (x = (new $Uint64(0, d.maxStrLen)), (strLen.$high > x.$high || (strLen.$high === x.$high && strLen.$low > x.$low)))) { */ case 7: _tmp$6 = ""; _tmp$7 = sliceType$1.nil; _tmp$8 = $pkg.ErrStringLength; s = _tmp$6; remain = _tmp$7; err = _tmp$8; $24r$2 = [s, remain, err]; $s = 9; case 9: return $24r$2; /* } */ case 8: /* */ if ((x$1 = (new $Uint64(0, p.$length)), (x$1.$high < strLen.$high || (x$1.$high === strLen.$high && x$1.$low < strLen.$low)))) { $s = 10; continue; } /* */ $s = 11; continue; /* if ((x$1 = (new $Uint64(0, p.$length)), (x$1.$high < strLen.$high || (x$1.$high === strLen.$high && x$1.$low < strLen.$low)))) { */ case 10: _tmp$9 = ""; _tmp$10 = p; _tmp$11 = errNeedMore; s = _tmp$9; remain = _tmp$10; err = _tmp$11; $24r$3 = [s, remain, err]; $s = 12; case 12: return $24r$3; /* } */ case 11: /* */ if (!isHuff) { $s = 13; continue; } /* */ $s = 14; continue; /* if (!isHuff) { */ case 13: if (wantStr) { s = ($bytesToString($subslice(p, 0, $flatten64(strLen)))); } _tmp$12 = s; _tmp$13 = $subslice(p, $flatten64(strLen)); _tmp$14 = $ifaceNil; s = _tmp$12; remain = _tmp$13; err = _tmp$14; $24r$4 = [s, remain, err]; $s = 15; case 15: return $24r$4; /* } */ case 14: /* */ if (wantStr) { $s = 16; continue; } /* */ $s = 17; continue; /* if (wantStr) { */ case 16: _r = bufPool.Get(); /* */ $s = 18; case 18: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } buf = $assertType(_r, ptrType$1); buf.Reset(); $deferred.push([$methodVal(bufPool, "Put"), [buf]]); _r$1 = huffmanDecode(buf, d.maxStrLen, $subslice(p, 0, $flatten64(strLen))); /* */ $s = 19; case 19: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err$1 = _r$1; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 20; continue; } /* */ $s = 21; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 20: buf.Reset(); _tmp$15 = ""; _tmp$16 = sliceType$1.nil; _tmp$17 = err$1; s = _tmp$15; remain = _tmp$16; err = _tmp$17; $24r$5 = [s, remain, err]; $s = 22; case 22: return $24r$5; /* } */ case 21: s = buf.String(); buf.Reset(); /* } */ case 17: _tmp$18 = s; _tmp$19 = $subslice(p, $flatten64(strLen)); _tmp$20 = $ifaceNil; s = _tmp$18; remain = _tmp$19; err = _tmp$20; $24r$6 = [s, remain, err]; $s = 23; case 23: return $24r$6; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [s, remain, err]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Decoder.ptr.prototype.readString }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f.$24r$6 = $24r$6; $f._r = _r; $f._r$1 = _r$1; $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$3 = _tmp$3; $f._tmp$4 = _tmp$4; $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 = _tuple; $f.buf = buf; $f.d = d; $f.err = err; $f.err$1 = err$1; $f.isHuff = isHuff; $f.p = p; $f.remain = remain; $f.s = s; $f.strLen = strLen; $f.wantStr = wantStr; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Decoder.prototype.readString = function(p, wantStr) { return this.$val.readString(p, wantStr); }; NewEncoder = function(w) { var e, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; e = $f.e; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = new Encoder.ptr(new dynamicTable.ptr(new headerFieldTable.ptr(sliceType$2.nil, new $Uint64(0, 0), false, false), 0, 0, 0), 4294967295, 4096, false, w, sliceType$1.nil); e.dynTab.table.init(); $r = e.dynTab.setMaxSize(4096); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return e; /* */ } return; } if ($f === undefined) { $f = { $blk: NewEncoder }; } $f.e = e; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.NewEncoder = NewEncoder; Encoder.ptr.prototype.WriteField = function(f) { var _r, _r$1, _tuple, _tuple$1, e, err, f, idx, indexing, n, nameValueMatch, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; e = $f.e; err = $f.err; f = $f.f; idx = $f.idx; indexing = $f.indexing; n = $f.n; nameValueMatch = $f.nameValueMatch; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; e.buf = $subslice(e.buf, 0, 0); if (e.tableSizeUpdate) { e.tableSizeUpdate = false; if (e.minSize < e.dynTab.maxSize) { e.buf = appendTableSize(e.buf, e.minSize); } e.minSize = 4294967295; e.buf = appendTableSize(e.buf, e.dynTab.maxSize); } _r = e.searchTable($clone(f, HeaderField)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; idx = _tuple[0]; nameValueMatch = _tuple[1]; /* */ if (nameValueMatch) { $s = 2; continue; } /* */ $s = 3; continue; /* if (nameValueMatch) { */ case 2: e.buf = appendIndexed(e.buf, idx); $s = 4; continue; /* } else { */ case 3: indexing = e.shouldIndex($clone(f, HeaderField)); /* */ if (indexing) { $s = 5; continue; } /* */ $s = 6; continue; /* if (indexing) { */ case 5: $r = e.dynTab.add($clone(f, HeaderField)); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 6: if ((idx.$high === 0 && idx.$low === 0)) { e.buf = appendNewName(e.buf, $clone(f, HeaderField), indexing); } else { e.buf = appendIndexedName(e.buf, $clone(f, HeaderField), idx, indexing); } /* } */ case 4: _r$1 = e.w.Write(e.buf); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; n = _tuple$1[0]; err = _tuple$1[1]; if ($interfaceIsEqual(err, $ifaceNil) && !((n === e.buf.$length))) { err = io.ErrShortWrite; } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: Encoder.ptr.prototype.WriteField }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.e = e; $f.err = err; $f.f = f; $f.idx = idx; $f.indexing = indexing; $f.n = n; $f.nameValueMatch = nameValueMatch; $f.$s = $s; $f.$r = $r; return $f; }; Encoder.prototype.WriteField = function(f) { return this.$val.WriteField(f); }; Encoder.ptr.prototype.searchTable = function(f) { var _r, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, _tuple$1, e, f, i, j, nameValueMatch, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$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 = $f._tuple; _tuple$1 = $f._tuple$1; e = $f.e; f = $f.f; i = $f.i; j = $f.j; nameValueMatch = $f.nameValueMatch; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: i = new $Uint64(0, 0); nameValueMatch = false; e = this; _r = staticTable.search($clone(f, HeaderField)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; i = _tuple[0]; nameValueMatch = _tuple[1]; if (nameValueMatch) { _tmp = i; _tmp$1 = true; i = _tmp; nameValueMatch = _tmp$1; $s = -1; return [i, nameValueMatch]; } _r$1 = e.dynTab.table.search($clone(f, HeaderField)); /* */ $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; j = _tuple$1[0]; nameValueMatch = _tuple$1[1]; if (nameValueMatch || ((i.$high === 0 && i.$low === 0) && !((j.$high === 0 && j.$low === 0)))) { _tmp$2 = (x = (new $Uint64(0, staticTable.len())), new $Uint64(j.$high + x.$high, j.$low + x.$low)); _tmp$3 = nameValueMatch; i = _tmp$2; nameValueMatch = _tmp$3; $s = -1; return [i, nameValueMatch]; } _tmp$4 = i; _tmp$5 = false; i = _tmp$4; nameValueMatch = _tmp$5; $s = -1; return [i, nameValueMatch]; /* */ } return; } if ($f === undefined) { $f = { $blk: Encoder.ptr.prototype.searchTable }; } $f._r = _r; $f._r$1 = _r$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 = _tuple; $f._tuple$1 = _tuple$1; $f.e = e; $f.f = f; $f.i = i; $f.j = j; $f.nameValueMatch = nameValueMatch; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Encoder.prototype.searchTable = function(f) { return this.$val.searchTable(f); }; Encoder.ptr.prototype.SetMaxDynamicTableSize = function(v) { var e, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; e = $f.e; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; if (v > e.maxSizeLimit) { v = e.maxSizeLimit; } if (v < e.minSize) { e.minSize = v; } e.tableSizeUpdate = true; $r = e.dynTab.setMaxSize(v); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Encoder.ptr.prototype.SetMaxDynamicTableSize }; } $f.e = e; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Encoder.prototype.SetMaxDynamicTableSize = function(v) { return this.$val.SetMaxDynamicTableSize(v); }; Encoder.ptr.prototype.SetMaxDynamicTableSizeLimit = function(v) { var e, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; e = $f.e; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; e.maxSizeLimit = v; /* */ if (e.dynTab.maxSize > v) { $s = 1; continue; } /* */ $s = 2; continue; /* if (e.dynTab.maxSize > v) { */ case 1: e.tableSizeUpdate = true; $r = e.dynTab.setMaxSize(v); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Encoder.ptr.prototype.SetMaxDynamicTableSizeLimit }; } $f.e = e; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Encoder.prototype.SetMaxDynamicTableSizeLimit = function(v) { return this.$val.SetMaxDynamicTableSizeLimit(v); }; Encoder.ptr.prototype.shouldIndex = function(f) { var e, f; e = this; return !f.Sensitive && $clone(f, HeaderField).Size() <= e.dynTab.maxSize; }; Encoder.prototype.shouldIndex = function(f) { return this.$val.shouldIndex(f); }; appendIndexed = function(dst, i) { var dst, first, i; first = dst.$length; dst = appendVarInt(dst, 7, i); ((first < 0 || first >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + first] = ((((first < 0 || first >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + first]) | (128)) >>> 0)); return dst; }; appendNewName = function(dst, f, indexing) { var dst, f, indexing; dst = $append(dst, encodeTypeByte(indexing, f.Sensitive)); dst = appendHpackString(dst, f.Name); return appendHpackString(dst, f.Value); }; appendIndexedName = function(dst, f, i, indexing) { var dst, f, first, i, indexing, n; first = dst.$length; n = 0; if (indexing) { n = 6; } else { n = 4; } dst = appendVarInt(dst, n, i); ((first < 0 || first >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + first] = ((((first < 0 || first >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + first]) | (encodeTypeByte(indexing, f.Sensitive))) >>> 0)); return appendHpackString(dst, f.Value); }; appendTableSize = function(dst, v) { var dst, first, v; first = dst.$length; dst = appendVarInt(dst, 5, (new $Uint64(0, v))); ((first < 0 || first >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + first] = ((((first < 0 || first >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + first]) | (32)) >>> 0)); return dst; }; appendVarInt = function(dst, n, i) { var dst, i, k, n, x, x$1, x$2; k = ((x = $shiftLeft64(new $Uint64(0, 1), n), new $Uint64(x.$high - 0, x.$low - 1))); if ((i.$high < k.$high || (i.$high === k.$high && i.$low < k.$low))) { return $append(dst, ((i.$low << 24 >>> 24))); } dst = $append(dst, ((k.$low << 24 >>> 24))); i = (x$1 = k, new $Uint64(i.$high - x$1.$high, i.$low - x$1.$low)); while (true) { if (!((i.$high > 0 || (i.$high === 0 && i.$low >= 128)))) { break; } dst = $append(dst, (((x$2 = new $Uint64(i.$high & 0, (i.$low & 127) >>> 0), new $Uint64(0 | x$2.$high, (128 | x$2.$low) >>> 0)).$low << 24 >>> 24))); i = $shiftRightUint64(i, (7)); } return $append(dst, ((i.$low << 24 >>> 24))); }; appendHpackString = function(dst, s) { var dst, first, huffmanLength, s, x; huffmanLength = HuffmanEncodeLength(s); if ((x = (new $Uint64(0, s.length)), (huffmanLength.$high < x.$high || (huffmanLength.$high === x.$high && huffmanLength.$low < x.$low)))) { first = dst.$length; dst = appendVarInt(dst, 7, huffmanLength); dst = AppendHuffmanString(dst, s); ((first < 0 || first >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + first] = ((((first < 0 || first >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + first]) | (128)) >>> 0)); } else { dst = appendVarInt(dst, 7, (new $Uint64(0, s.length))); dst = $appendSlice(dst, s); } return dst; }; encodeTypeByte = function(indexing, sensitive) { var indexing, sensitive; if (sensitive) { return 16; } if (indexing) { return 64; } return 0; }; ptrType$3.methods = [{prop: "init", name: "init", pkg: "vendor/golang.org/x/net/http2/hpack", typ: $funcType([], [], false)}, {prop: "len", name: "len", pkg: "vendor/golang.org/x/net/http2/hpack", typ: $funcType([], [$Int], false)}, {prop: "addEntry", name: "addEntry", pkg: "vendor/golang.org/x/net/http2/hpack", typ: $funcType([HeaderField], [], false)}, {prop: "evictOldest", name: "evictOldest", pkg: "vendor/golang.org/x/net/http2/hpack", typ: $funcType([$Int], [], false)}, {prop: "search", name: "search", pkg: "vendor/golang.org/x/net/http2/hpack", typ: $funcType([HeaderField], [$Uint64, $Bool], false)}, {prop: "idToIndex", name: "idToIndex", pkg: "vendor/golang.org/x/net/http2/hpack", typ: $funcType([$Uint64], [$Uint64], false)}]; DecodingError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; InvalidIndexError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; HeaderField.methods = [{prop: "IsPseudo", name: "IsPseudo", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Uint32], false)}]; ptrType$4.methods = [{prop: "SetMaxStringLength", name: "SetMaxStringLength", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "SetEmitFunc", name: "SetEmitFunc", pkg: "", typ: $funcType([funcType$1], [], false)}, {prop: "SetEmitEnabled", name: "SetEmitEnabled", pkg: "", typ: $funcType([$Bool], [], false)}, {prop: "EmitEnabled", name: "EmitEnabled", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "SetMaxDynamicTableSize", name: "SetMaxDynamicTableSize", pkg: "", typ: $funcType([$Uint32], [], false)}, {prop: "SetAllowedMaxDynamicTableSize", name: "SetAllowedMaxDynamicTableSize", pkg: "", typ: $funcType([$Uint32], [], false)}, {prop: "maxTableIndex", name: "maxTableIndex", pkg: "vendor/golang.org/x/net/http2/hpack", typ: $funcType([], [$Int], false)}, {prop: "at", name: "at", pkg: "vendor/golang.org/x/net/http2/hpack", typ: $funcType([$Uint64], [HeaderField, $Bool], false)}, {prop: "DecodeFull", name: "DecodeFull", pkg: "", typ: $funcType([sliceType$1], [sliceType$2, $error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}, {prop: "parseHeaderFieldRepr", name: "parseHeaderFieldRepr", pkg: "vendor/golang.org/x/net/http2/hpack", typ: $funcType([], [$error], false)}, {prop: "parseFieldIndexed", name: "parseFieldIndexed", pkg: "vendor/golang.org/x/net/http2/hpack", typ: $funcType([], [$error], false)}, {prop: "parseFieldLiteral", name: "parseFieldLiteral", pkg: "vendor/golang.org/x/net/http2/hpack", typ: $funcType([$Uint8, indexType], [$error], false)}, {prop: "callEmit", name: "callEmit", pkg: "vendor/golang.org/x/net/http2/hpack", typ: $funcType([HeaderField], [$error], false)}, {prop: "parseDynamicTableSizeUpdate", name: "parseDynamicTableSizeUpdate", pkg: "vendor/golang.org/x/net/http2/hpack", typ: $funcType([], [$error], false)}, {prop: "readString", name: "readString", pkg: "vendor/golang.org/x/net/http2/hpack", typ: $funcType([sliceType$1, $Bool], [$String, sliceType$1, $error], false)}]; ptrType$5.methods = [{prop: "setMaxSize", name: "setMaxSize", pkg: "vendor/golang.org/x/net/http2/hpack", typ: $funcType([$Uint32], [], false)}, {prop: "add", name: "add", pkg: "vendor/golang.org/x/net/http2/hpack", typ: $funcType([HeaderField], [], false)}, {prop: "evict", name: "evict", pkg: "vendor/golang.org/x/net/http2/hpack", typ: $funcType([], [], false)}]; indexType.methods = [{prop: "indexed", name: "indexed", pkg: "vendor/golang.org/x/net/http2/hpack", typ: $funcType([], [$Bool], false)}, {prop: "sensitive", name: "sensitive", pkg: "vendor/golang.org/x/net/http2/hpack", typ: $funcType([], [$Bool], false)}]; ptrType$6.methods = [{prop: "WriteField", name: "WriteField", pkg: "", typ: $funcType([HeaderField], [$error], false)}, {prop: "searchTable", name: "searchTable", pkg: "vendor/golang.org/x/net/http2/hpack", typ: $funcType([HeaderField], [$Uint64, $Bool], false)}, {prop: "SetMaxDynamicTableSize", name: "SetMaxDynamicTableSize", pkg: "", typ: $funcType([$Uint32], [], false)}, {prop: "SetMaxDynamicTableSizeLimit", name: "SetMaxDynamicTableSizeLimit", pkg: "", typ: $funcType([$Uint32], [], false)}, {prop: "shouldIndex", name: "shouldIndex", pkg: "vendor/golang.org/x/net/http2/hpack", typ: $funcType([HeaderField], [$Bool], false)}]; headerFieldTable.init("vendor/golang.org/x/net/http2/hpack", [{prop: "ents", name: "ents", embedded: false, exported: false, typ: sliceType$2, tag: ""}, {prop: "evictCount", name: "evictCount", embedded: false, exported: false, typ: $Uint64, tag: ""}, {prop: "byName", name: "byName", embedded: false, exported: false, typ: mapType, tag: ""}, {prop: "byNameValue", name: "byNameValue", embedded: false, exported: false, typ: mapType$1, tag: ""}]); pairNameValue.init("vendor/golang.org/x/net/http2/hpack", [{prop: "name", name: "name", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "value", name: "value", embedded: false, exported: false, typ: $String, tag: ""}]); incomparable.init(funcType, 0); node.init("vendor/golang.org/x/net/http2/hpack", [{prop: "_$0", name: "_", embedded: false, exported: false, typ: incomparable, tag: ""}, {prop: "children", name: "children", embedded: false, exported: false, typ: ptrType$2, tag: ""}, {prop: "codeLen", name: "codeLen", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "sym", name: "sym", embedded: false, exported: false, typ: $Uint8, tag: ""}]); DecodingError.init("", [{prop: "Err", name: "Err", embedded: false, exported: true, typ: $error, tag: ""}]); HeaderField.init("", [{prop: "Name", name: "Name", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Value", name: "Value", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Sensitive", name: "Sensitive", embedded: false, exported: true, typ: $Bool, tag: ""}]); Decoder.init("vendor/golang.org/x/net/http2/hpack", [{prop: "dynTab", name: "dynTab", embedded: false, exported: false, typ: dynamicTable, tag: ""}, {prop: "emit", name: "emit", embedded: false, exported: false, typ: funcType$1, tag: ""}, {prop: "emitEnabled", name: "emitEnabled", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "maxStrLen", name: "maxStrLen", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "buf", name: "buf", embedded: false, exported: false, typ: sliceType$1, tag: ""}, {prop: "saveBuf", name: "saveBuf", embedded: false, exported: false, typ: bytes.Buffer, tag: ""}, {prop: "firstField", name: "firstField", embedded: false, exported: false, typ: $Bool, tag: ""}]); dynamicTable.init("vendor/golang.org/x/net/http2/hpack", [{prop: "table", name: "table", embedded: false, exported: false, typ: headerFieldTable, tag: ""}, {prop: "size", name: "size", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "maxSize", name: "maxSize", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "allowedMaxSize", name: "allowedMaxSize", embedded: false, exported: false, typ: $Uint32, tag: ""}]); Encoder.init("vendor/golang.org/x/net/http2/hpack", [{prop: "dynTab", name: "dynTab", embedded: false, exported: false, typ: dynamicTable, tag: ""}, {prop: "minSize", name: "minSize", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "maxSizeLimit", name: "maxSizeLimit", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "tableSizeUpdate", name: "tableSizeUpdate", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "w", name: "w", embedded: false, exported: false, typ: io.Writer, tag: ""}, {prop: "buf", name: "buf", embedded: false, exported: false, typ: sliceType$1, 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 = errors.$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 = io.$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; } buildRootOnce = new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)); lazyRootHuffmanNode = ptrType.nil; staticTableEntries = $toNativeArray($kindStruct, [new HeaderField.ptr(":authority", "", false), new HeaderField.ptr(":method", "GET", false), new HeaderField.ptr(":method", "POST", false), new HeaderField.ptr(":path", "/", false), new HeaderField.ptr(":path", "/index.html", false), new HeaderField.ptr(":scheme", "http", false), new HeaderField.ptr(":scheme", "https", false), new HeaderField.ptr(":status", "200", false), new HeaderField.ptr(":status", "204", false), new HeaderField.ptr(":status", "206", false), new HeaderField.ptr(":status", "304", false), new HeaderField.ptr(":status", "400", false), new HeaderField.ptr(":status", "404", false), new HeaderField.ptr(":status", "500", false), new HeaderField.ptr("accept-charset", "", false), new HeaderField.ptr("accept-encoding", "gzip, deflate", false), new HeaderField.ptr("accept-language", "", false), new HeaderField.ptr("accept-ranges", "", false), new HeaderField.ptr("accept", "", false), new HeaderField.ptr("access-control-allow-origin", "", false), new HeaderField.ptr("age", "", false), new HeaderField.ptr("allow", "", false), new HeaderField.ptr("authorization", "", false), new HeaderField.ptr("cache-control", "", false), new HeaderField.ptr("content-disposition", "", false), new HeaderField.ptr("content-encoding", "", false), new HeaderField.ptr("content-language", "", false), new HeaderField.ptr("content-length", "", false), new HeaderField.ptr("content-location", "", false), new HeaderField.ptr("content-range", "", false), new HeaderField.ptr("content-type", "", false), new HeaderField.ptr("cookie", "", false), new HeaderField.ptr("date", "", false), new HeaderField.ptr("etag", "", false), new HeaderField.ptr("expect", "", false), new HeaderField.ptr("expires", "", false), new HeaderField.ptr("from", "", false), new HeaderField.ptr("host", "", false), new HeaderField.ptr("if-match", "", false), new HeaderField.ptr("if-modified-since", "", false), new HeaderField.ptr("if-none-match", "", false), new HeaderField.ptr("if-range", "", false), new HeaderField.ptr("if-unmodified-since", "", false), new HeaderField.ptr("last-modified", "", false), new HeaderField.ptr("link", "", false), new HeaderField.ptr("location", "", false), new HeaderField.ptr("max-forwards", "", false), new HeaderField.ptr("proxy-authenticate", "", false), new HeaderField.ptr("proxy-authorization", "", false), new HeaderField.ptr("range", "", false), new HeaderField.ptr("referer", "", false), new HeaderField.ptr("refresh", "", false), new HeaderField.ptr("retry-after", "", false), new HeaderField.ptr("server", "", false), new HeaderField.ptr("set-cookie", "", false), new HeaderField.ptr("strict-transport-security", "", false), new HeaderField.ptr("transfer-encoding", "", false), new HeaderField.ptr("user-agent", "", false), new HeaderField.ptr("vary", "", false), new HeaderField.ptr("via", "", false), new HeaderField.ptr("www-authenticate", "", false)]); staticTable = newStaticTable(); huffmanCodes = $toNativeArray($kindUint32, [8184, 8388568, 268435426, 268435427, 268435428, 268435429, 268435430, 268435431, 268435432, 16777194, 1073741820, 268435433, 268435434, 1073741821, 268435435, 268435436, 268435437, 268435438, 268435439, 268435440, 268435441, 268435442, 1073741822, 268435443, 268435444, 268435445, 268435446, 268435447, 268435448, 268435449, 268435450, 268435451, 20, 1016, 1017, 4090, 8185, 21, 248, 2042, 1018, 1019, 249, 2043, 250, 22, 23, 24, 0, 1, 2, 25, 26, 27, 28, 29, 30, 31, 92, 251, 32764, 32, 4091, 1020, 8186, 33, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 252, 115, 253, 8187, 524272, 8188, 16380, 34, 32765, 3, 35, 4, 36, 5, 37, 38, 39, 6, 116, 117, 40, 41, 42, 7, 43, 118, 44, 8, 9, 45, 119, 120, 121, 122, 123, 32766, 2044, 16381, 8189, 268435452, 1048550, 4194258, 1048551, 1048552, 4194259, 4194260, 4194261, 8388569, 4194262, 8388570, 8388571, 8388572, 8388573, 8388574, 16777195, 8388575, 16777196, 16777197, 4194263, 8388576, 16777198, 8388577, 8388578, 8388579, 8388580, 2097116, 4194264, 8388581, 4194265, 8388582, 8388583, 16777199, 4194266, 2097117, 1048553, 4194267, 4194268, 8388584, 8388585, 2097118, 8388586, 4194269, 4194270, 16777200, 2097119, 4194271, 8388587, 8388588, 2097120, 2097121, 4194272, 2097122, 8388589, 4194273, 8388590, 8388591, 1048554, 4194274, 4194275, 4194276, 8388592, 4194277, 4194278, 8388593, 67108832, 67108833, 1048555, 524273, 4194279, 8388594, 4194280, 33554412, 67108834, 67108835, 67108836, 134217694, 134217695, 67108837, 16777201, 33554413, 524274, 2097123, 67108838, 134217696, 134217697, 67108839, 134217698, 16777202, 2097124, 2097125, 67108840, 67108841, 268435453, 134217699, 134217700, 134217701, 1048556, 16777203, 1048557, 2097126, 4194281, 2097127, 2097128, 8388595, 4194282, 4194283, 33554414, 33554415, 16777204, 16777205, 67108842, 8388596, 67108843, 134217702, 67108844, 67108845, 134217703, 134217704, 134217705, 134217706, 134217707, 268435454, 134217708, 134217709, 134217710, 134217711, 134217712, 67108846]); huffmanCodeLen = $toNativeArray($kindUint8, [13, 23, 28, 28, 28, 28, 28, 28, 28, 24, 30, 28, 28, 30, 28, 28, 28, 28, 28, 28, 28, 28, 30, 28, 28, 28, 28, 28, 28, 28, 28, 28, 6, 10, 10, 12, 13, 6, 8, 11, 10, 10, 8, 11, 8, 6, 6, 6, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 8, 15, 6, 12, 10, 13, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 7, 8, 13, 19, 13, 14, 6, 15, 5, 6, 5, 6, 5, 6, 6, 6, 5, 7, 7, 6, 6, 6, 5, 6, 7, 6, 5, 5, 6, 7, 7, 7, 7, 7, 15, 11, 14, 13, 28, 20, 22, 20, 20, 22, 22, 22, 23, 22, 23, 23, 23, 23, 23, 24, 23, 24, 24, 22, 23, 24, 23, 23, 23, 23, 21, 22, 23, 22, 23, 23, 24, 22, 21, 20, 22, 22, 23, 23, 21, 23, 22, 22, 24, 21, 22, 23, 23, 21, 21, 22, 21, 23, 22, 23, 23, 20, 22, 22, 22, 23, 22, 22, 23, 26, 26, 20, 19, 22, 23, 22, 25, 26, 26, 26, 27, 27, 26, 24, 25, 19, 21, 26, 27, 27, 26, 27, 24, 21, 21, 26, 26, 28, 27, 27, 27, 20, 24, 20, 21, 22, 21, 21, 23, 22, 22, 25, 25, 24, 24, 26, 23, 26, 27, 26, 26, 27, 27, 27, 27, 27, 28, 27, 27, 27, 27, 27, 26]); bufPool = new sync.Pool.ptr(sliceType.nil, (function() { return new bytes.Buffer.ptr(sliceType$1.nil, 0, 0); })); $pkg.ErrInvalidHuffman = errors.New("hpack: invalid Huffman-encoded data"); $pkg.ErrStringLength = errors.New("hpack: string too long"); errNeedMore = errors.New("need more data"); errVarintOverflow = new DecodingError.ptr(errors.New("varint integer overflow")); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["net/http"] = (function() { var $pkg = {}, $init, bufio, bytes, gzip, list, context, rand$1, tls, base64, binary, errors, fmt, js, io, fs, ioutil, log, math, rand, mime, multipart, net, httptrace, internal, ascii, textproto, url, os, path, filepath, reflect, runtime, sort, strconv, strings, sync, atomic, time, utf8, httpguts, httpproxy, hpack, idna, Transport, cancelKey, h2Transport, transportRequest, readTrackingBody, transportReadFromServerError, wantConn, wantConnQueue, erringRoundTripper, persistConnWriter, connectMethod, connectMethodKey, persistConn, readWriteCloserBody, nothingWrittenError, responseAndError, requestAndChan, writeRequest, httpError, tLogKey, bodyEOFSignal, gzipReader, tlsHandshakeTimeoutError, fakeLocker, connLRU, errorReader, byteReader, transferWriter, transferReader, unsupportedTEError, body, bodyLocked, finishAsyncByteRead, bufioFlushWriter, socksCommand, socksAuthMethod, socksReply, socksAddr, socksConn, socksDialer, socksUsernamePassword, sniffSig, exactSig, maskedSig, htmlSig, mp4Sig, textSig, Handler, ResponseWriter, conn, chunkWriter, response, atomicBool, writerOnly, readResult, connReader, expectContinueReader, extraHeader, closeWriter, statusError, HandlerFunc, redirectHandler, ServeMux, muxEntry, Server, ConnState, serverHandler, onceCloseListener, globalOptionsHandler, initALPNRequest, loggingConn, checkConnErrorWriter, Response, ProtocolError, Request, requestBodyReadError, maxBytesReader, CookieJar, incomparable, contextKey, noBody, PushOptions, Header, stringWriter, keyValues, headerSorter, http2ClientConnPool, http2clientConnPoolIdleCloser, http2clientConnPool, http2dialCall, http2addConnCall, http2noDialClientConnPool, http2dataBuffer, http2ErrCode, http2ConnectionError, http2StreamError, http2goAwayFlowError, http2connError, http2pseudoHeaderError, http2duplicatePseudoHeaderError, http2headerFieldNameError, http2headerFieldValueError, http2flow, http2FrameType, http2Flags, http2FrameHeader, http2Frame, http2Framer, http2frameCache, http2DataFrame, http2SettingsFrame, http2PingFrame, http2GoAwayFrame, http2UnknownFrame, http2WindowUpdateFrame, http2HeadersFrame, http2HeadersFrameParam, http2PriorityFrame, http2PriorityParam, http2RSTStreamFrame, http2ContinuationFrame, http2PushPromiseFrame, http2PushPromiseParam, http2MetaHeadersFrame, http2goroutineLock, http2streamState, http2Setting, http2SettingID, http2gate, http2closeWaiter, http2bufferedWriter, http2httpError, http2connectionStater, http2sorter, http2incomparable, http2pipe, http2pipeBuffer, http2Server, http2serverInternalState, http2ServeConnOpts, http2serverConn, http2stream, http2readFrameResult, http2frameWriteResult, http2serverMessage, http2requestParam, http2bodyReadMsg, http2requestBody, http2responseWriter, http2responseWriterState, http2chunkWriter, http2startPushRequest, http2Transport, http2ClientConn, http2clientStream, http2stickyErrWriter, http2noCachedConnError, http2RoundTripOpt, http2clientConnIdleState, http2resAndError, http2clientConnReadLoop, http2GoAwayError, http2transportResponseBody, http2erringRoundTripper, http2gzipReader, http2bodyWriterState, http2noDialH2RoundTripper, http2writeFramer, http2writeContext, http2flushFrameWriter, http2writeSettings, http2writeGoAway, http2writeData, http2handlerPanicRST, http2writePingAck, http2writeSettingsAck, http2writeResHeaders, http2writePushPromise, http2write100ContinueHeadersFrame, http2writeWindowUpdate, http2WriteScheduler, http2OpenStreamOptions, http2FrameWriteRequest, http2writeQueue, http2writeQueuePool, http2PriorityWriteSchedulerConfig, http2priorityNodeState, http2priorityNode, http2sortPriorityNodeSiblings, http2priorityWriteScheduler, http2randomWriteScheduler, noTransport, XHRTransport, streamReader, fetchTransport, Cookie, SameSite, Client, RoundTripper, cancelTimerBody, requestTooLarger, baseContexter, I, canceler, closeIdler, ptrType, ptrType$1, sliceType, sliceType$1, ptrType$2, ptrType$3, ptrType$4, sliceType$2, sliceType$3, sliceType$4, ptrType$6, sliceType$5, sliceType$6, ptrType$9, sliceType$7, funcType, arrayType, ptrType$10, ptrType$11, ptrType$12, ptrType$13, ptrType$14, ptrType$15, chanType, ptrType$16, mapType, ptrType$17, ptrType$18, ptrType$19, ptrType$20, ptrType$21, ptrType$22, ptrType$23, ptrType$24, sliceType$8, sliceType$9, ptrType$25, structType, ptrType$26, sliceType$10, sliceType$11, ptrType$27, ptrType$28, ptrType$29, ptrType$30, sliceType$12, ptrType$31, ptrType$32, ptrType$33, funcType$1, sliceType$13, ptrType$34, sliceType$14, arrayType$1, sliceType$15, sliceType$16, ptrType$35, arrayType$2, sliceType$17, ptrType$36, ptrType$37, ptrType$38, ptrType$39, ptrType$40, ptrType$41, ptrType$42, ptrType$43, ptrType$44, ptrType$45, ptrType$46, ptrType$47, structType$1, ptrType$48, ptrType$49, ptrType$50, ptrType$51, ptrType$52, ptrType$53, arrayType$3, arrayType$4, arrayType$5, sliceType$18, ptrType$54, ptrType$55, ptrType$56, ptrType$57, arrayType$6, ptrType$58, sliceType$19, ptrType$59, ptrType$60, ptrType$61, structType$2, ptrType$62, ptrType$63, ptrType$64, ptrType$65, ptrType$66, sliceType$20, ptrType$67, ptrType$68, sliceType$21, ptrType$69, ptrType$70, ptrType$71, ptrType$72, ptrType$73, arrayType$7, ptrType$74, ptrType$75, arrayType$8, sliceType$22, ptrType$76, ptrType$77, ptrType$78, ptrType$79, ptrType$80, ptrType$81, ptrType$82, ptrType$83, ptrType$84, ptrType$85, ptrType$86, ptrType$87, ptrType$88, ptrType$89, ptrType$90, funcType$2, ptrType$91, ptrType$92, ptrType$93, ptrType$94, ptrType$95, ptrType$96, ptrType$97, ptrType$98, ptrType$99, ptrType$100, ptrType$101, ptrType$102, interfaceType, ptrType$103, sliceType$23, ptrType$104, ptrType$105, sliceType$24, ptrType$106, ptrType$107, sliceType$25, ptrType$108, ptrType$109, ptrType$110, funcType$3, mapType$1, funcType$4, sliceType$29, ptrType$113, sliceType$30, ptrType$114, ptrType$115, funcType$5, mapType$2, mapType$3, mapType$4, mapType$5, funcType$6, funcType$7, funcType$8, funcType$9, mapType$6, funcType$10, chanType$1, ptrType$116, ptrType$117, chanType$2, funcType$11, chanType$3, chanType$4, funcType$12, ptrType$118, chanType$5, chanType$6, chanType$7, ptrType$119, funcType$13, funcType$14, ptrType$120, ptrType$121, mapType$7, ptrType$122, chanType$8, ptrType$123, ptrType$124, funcType$15, ptrType$125, ptrType$126, ptrType$127, chanType$9, ptrType$128, chanType$10, ptrType$129, funcType$16, ptrType$130, mapType$8, funcType$17, mapType$9, funcType$18, funcType$19, funcType$20, mapType$10, mapType$11, ptrType$132, ptrType$133, ptrType$134, funcType$21, ptrType$135, mapType$12, mapType$13, mapType$14, mapType$15, mapType$16, ptrType$136, ptrType$137, funcType$22, funcType$23, ptrType$138, ptrType$139, funcType$24, mapType$17, chanType$11, chanType$12, chanType$13, chanType$14, chanType$15, mapType$18, mapType$19, funcType$25, mapType$20, mapType$21, funcType$26, chanType$16, ptrType$140, ptrType$141, ptrType$142, funcType$27, ptrType$143, funcType$28, ptrType$144, mapType$22, ptrType$145, mapType$23, ptrType$146, mapType$24, ptrType$147, ptrType$148, funcType$29, ptrType$151, funcType$30, ptrType$152, errCannotRewind, errKeepAlivesDisabled, errConnBroken, errCloseIdle, errTooManyIdle, errTooManyIdleHost, errCloseIdleConns, errReadLoopExiting, errIdleConnTimeout, errServerClosedIdle, zeroDialer, errCallerOwnsConn, errTimeout, errRequestCanceled, errRequestCanceledConn, testHookEnterRoundTrip, testHookWaitResLoop, testHookRoundTripRetried, testHookPrePendingDial, testHookPostPendingDial, testHookMu, testHookReadLoopBeforeNextRead, portMap, errReadOnClosedResBody, suppressedHeaders304, suppressedHeadersNoBody, singleCRLF, doubleCRLF, errTrailerEOF, nopCloserType, statusText, socksnoDeadline, socksaLongTimeAgo, sniffSignatures, mp4ftype, mp4, crlf, colonSpace, bufioReaderPool, bufioWriter2kPool, bufioWriter2kPool$24ptr, bufioWriter4kPool, bufioWriter4kPool$24ptr, copyBufPool, errTooLarge, extraHeaderKeys, headerContentLength, headerDate, htmlReplacer, defaultServeMux, defaultServeMux$24ptr, stateName, silenceSemWarnContextKey, testHookServerServe, uniqNameMu, uniqNameNext, respExcludeHeader, reqWriteExcludeHeader, multipartByReader, errMissingHost, textprotoReaderPool, aLongTimeAgo, omitBundledHTTP2, headerNewlineToSpace, headerSorterPool, http2dataChunkSizeClasses, http2dataChunkPools, http2errReadEmpty, http2errCodeName, http2errMixPseudoHeaderTypes, http2errPseudoAfterRegular, http2padZeros, http2frameName, http2flagName, http2frameParsers, http2fhBytes, http2ErrFrameTooLarge, http2errStreamID, http2errDepStreamID, http2errPadLength, http2errPadBytes, http2DebugGoroutines, http2goroutineSpace, http2littleBuf, http2commonBuildOnce, http2commonLowerHeader, http2commonCanonHeader, http2VerboseLogs, http2logFrameWrites, http2logFrameReads, http2inTests, http2clientPreface, http2stateName, http2settingName, http2bufWriterPool, http2errTimeout, http2sorterPool, http2errClosedPipeWrite, http2errClientDisconnected, http2errClosedBody, http2errHandlerComplete, http2errStreamClosed, http2responseWriterStatePool, http2testHookOnConn, http2testHookGetServerConn, http2testHookOnPanicMu, http2testHookOnPanic, http2settingsTimerMsg, http2idleTimerMsg, http2shutdownTimerMsg, http2gracefulShutdownMsg, http2errPrefaceTimeout, http2errChanPool, http2writeDataPool, http2errHandlerPanicked, http2goAwayTimeout, http2ErrRecursivePush, http2ErrPushLimitReached, http2connHeaders, http2got1xxFuncForTests, http2ErrNoCachedConn, http2errClientConnClosed, http2errClientConnUnusable, http2errClientConnGotGoAway, http2shutdownEnterWaitStateHook, http2errRequestCanceled, http2errStopReqBodyWrite, http2errStopReqBodyWriteAndCancel, http2errReqBodyTooLong, http2errClosedResponseBody, http2errResponseHeaderListSize, http2errRequestHeaderListSize, http2noBody, errSeeker, errNoOverlap, unixEpochTime, errMissingSeek, errMissingReadDir, cookieNameSanitizer, testHookClientDoResult, x, x$1, x$2, _r, x$4, setupRewindBody, rewindBody, is408Message, newReadWriteCloserBody, nop, canonicalAddr, cloneTLSConfig, newTransferWriter, noResponseBodyExpected, bodyAllowedForStatus, suppressedHeaders, readTransfer, chunked, isIdentity, isUnsupportedTEError, fixLength, shouldClose, fixTrailer, seeUpcomingDoubleCRLF, mergeSetHeader, parseContentLength, isKnownInMemoryReader, StatusText, sockssplitHostPort, socksNewDialer, DetectContentType, isWS, isTT, bufioWriterPool, newBufioReader, putBufioReader, newBufioWriterSize, putBufioWriter, appendTime, http1ServerSupportsRequest, checkWriteHeaderCode, relevantCaller, foreachHeaderElement, writeStatusLine, validNextProto, badRequestError, isCommonNetReadError, registerOnHitEOF, requestBodyRemains, Error, NotFound, NotFoundHandler, Redirect, htmlEscape, RedirectHandler, cleanPath, stripHostPort, appendSorted, newLoggingConn, numLeadingCRorLF, strSliceContains, tlsRecordHeaderLooksLikeHTTP, ReadResponse, fixPragmaCacheControl, isProtocolSwitchResponse, isProtocolSwitchHeader, badStringError, valueOrDefault, idnaASCII, cleanHost, removeZone, ParseHTTPVersion, validMethod, NewRequest, NewRequestWithContext, parseBasicAuth, parseRequestLine, newTextprotoReader, putTextprotoReader, readRequest, MaxBytesReader, copyValues, parsePostForm, requestMethodUsuallyLacksBody, hasPort, removeEmptyPort, isNotToken, stringContainsCTLByte, hexEscapeNonASCII, CanonicalHeaderKey, hasToken, isTokenBoundary, http2asciiEqualFold, http2lower, http2isASCIIPrint, http2asciiToLower, http2isBadCipher, http2filterOutClientConn, http2shouldRetryDial, http2getDataBufferChunk, http2putDataBufferChunk, http2streamError, http2typeFrameParser, http2readFrameHeader, http2NewFramer, http2terminalReadFrameError, http2parseDataFrame, http2validStreamIDOrZero, http2validStreamID, http2parseSettingsFrame, http2parsePingFrame, http2parseGoAwayFrame, http2parseUnknownFrame, http2parseWindowUpdateFrame, http2parseHeadersFrame, http2parsePriorityFrame, http2parseRSTStreamFrame, http2parseContinuationFrame, http2parsePushPromise, http2readByte, http2readUint32, http2summarizeFrame, http2traceHasWroteHeaderField, http2traceWroteHeaderField, http2traceGot1xxResponseFunc, http2newGoroutineLock, http2curGoroutineID, http2parseUintBytes, http2cutoff64, http2buildCommonHeaderMapsOnce, http2buildCommonHeaderMaps, http2lowerHeader, init, http2validWireHeaderFieldName, http2httpCodeString, http2newBufferedWriter, http2mustUint31, http2bodyAllowedForStatus, http2validPseudoPath, http2ConfigureServer, http2serverConnBaseContext, http2errno, http2isClosedConnError, http2checkPriority, http2handleHeaderListTooLong, http2checkWriteHeaderCode, http2cloneHeader, http2foreachHeaderElement, http2checkValidHTTP2RequestHeaders, http2new400Handler, http2h1ServerKeepAlivesDisabled, http2configureTransports, http2awaitRequestCancel, http2isNoCachedConnError, http2authorityAddr, http2shouldRetryRequest, http2canRetryError, http2commaSeparatedTrailers, http2checkConnHeaders, http2actualContentLength, http2shouldSendReqContentLength, http2isEOFOrNetReadError, http2strSliceContains, http2isConnectionCloseRequest, http2registerHTTPSProtocol, http2traceGetConn, http2traceGotConn, http2traceWroteHeaders, http2traceGot100Continue, http2traceWait100Continue, http2traceWroteRequest, http2traceFirstResponseByte, http2writeEndsStream, http2splitHeaderBlock, http2encKV, http2encodeHeaders, http2NewPriorityWriteScheduler, http2NewRandomWriteScheduler, readSetCookies, readCookies, validCookieDomain, validCookieExpires, isCookieDomainName, sanitizeCookieName, sanitizeCookieValue, validCookieValueByte, sanitizeCookiePath, validCookiePathByte, sanitizeOrWarn, parseCookieValue, isCookieNameValid, cloneURLValues, cloneURL, cloneMultipartForm, cloneMultipartFileHeader, cloneOrMakeHeader, refererForURL, send, timeBeforeContextDeadline, knownRoundTripperImpl, setRequestCancel, basicAuth, Get, alwaysFalse, redirectBehavior, urlErrorOp, defaultCheckRedirect, shouldCopyHeaderOnRedirect, isDomainOrSubdomain, stripPassword; bufio = $packages["bufio"]; bytes = $packages["bytes"]; gzip = $packages["compress/gzip"]; list = $packages["container/list"]; context = $packages["context"]; rand$1 = $packages["crypto/rand"]; tls = $packages["crypto/tls"]; base64 = $packages["encoding/base64"]; binary = $packages["encoding/binary"]; errors = $packages["errors"]; fmt = $packages["fmt"]; js = $packages["github.com/gopherjs/gopherjs/js"]; io = $packages["io"]; fs = $packages["io/fs"]; ioutil = $packages["io/ioutil"]; log = $packages["log"]; math = $packages["math"]; rand = $packages["math/rand"]; mime = $packages["mime"]; multipart = $packages["mime/multipart"]; net = $packages["net"]; httptrace = $packages["net/http/httptrace"]; internal = $packages["net/http/internal"]; ascii = $packages["net/http/internal/ascii"]; textproto = $packages["net/textproto"]; url = $packages["net/url"]; os = $packages["os"]; path = $packages["path"]; filepath = $packages["path/filepath"]; reflect = $packages["reflect"]; runtime = $packages["runtime"]; sort = $packages["sort"]; strconv = $packages["strconv"]; strings = $packages["strings"]; sync = $packages["sync"]; atomic = $packages["sync/atomic"]; time = $packages["time"]; utf8 = $packages["unicode/utf8"]; httpguts = $packages["vendor/golang.org/x/net/http/httpguts"]; httpproxy = $packages["vendor/golang.org/x/net/http/httpproxy"]; hpack = $packages["vendor/golang.org/x/net/http2/hpack"]; idna = $packages["vendor/golang.org/x/net/idna"]; Transport = $pkg.Transport = $newType(0, $kindStruct, "http.Transport", true, "net/http", true, function(idleMu_, closeIdle_, idleConn_, idleConnWait_, idleLRU_, reqMu_, reqCanceler_, altMu_, altProto_, connsPerHostMu_, connsPerHost_, connsPerHostWait_, Proxy_, DialContext_, Dial_, DialTLSContext_, DialTLS_, TLSClientConfig_, TLSHandshakeTimeout_, DisableKeepAlives_, DisableCompression_, MaxIdleConns_, MaxIdleConnsPerHost_, MaxConnsPerHost_, IdleConnTimeout_, ResponseHeaderTimeout_, ExpectContinueTimeout_, TLSNextProto_, ProxyConnectHeader_, GetProxyConnectHeader_, MaxResponseHeaderBytes_, WriteBufferSize_, ReadBufferSize_, nextProtoOnce_, h2transport_, tlsNextProtoWasNil_, ForceAttemptHTTP2_) { this.$val = this; if (arguments.length === 0) { this.idleMu = new sync.Mutex.ptr(0, 0); this.closeIdle = false; this.idleConn = false; this.idleConnWait = false; this.idleLRU = new connLRU.ptr(ptrType$3.nil, false); this.reqMu = new sync.Mutex.ptr(0, 0); this.reqCanceler = false; this.altMu = new sync.Mutex.ptr(0, 0); this.altProto = new atomic.Value.ptr($ifaceNil); this.connsPerHostMu = new sync.Mutex.ptr(0, 0); this.connsPerHost = false; this.connsPerHostWait = false; this.Proxy = $throwNilPointerError; this.DialContext = $throwNilPointerError; this.Dial = $throwNilPointerError; this.DialTLSContext = $throwNilPointerError; this.DialTLS = $throwNilPointerError; this.TLSClientConfig = ptrType$4.nil; this.TLSHandshakeTimeout = new time.Duration(0, 0); this.DisableKeepAlives = false; this.DisableCompression = false; this.MaxIdleConns = 0; this.MaxIdleConnsPerHost = 0; this.MaxConnsPerHost = 0; this.IdleConnTimeout = new time.Duration(0, 0); this.ResponseHeaderTimeout = new time.Duration(0, 0); this.ExpectContinueTimeout = new time.Duration(0, 0); this.TLSNextProto = false; this.ProxyConnectHeader = false; this.GetProxyConnectHeader = $throwNilPointerError; this.MaxResponseHeaderBytes = new $Int64(0, 0); this.WriteBufferSize = 0; this.ReadBufferSize = 0; this.nextProtoOnce = new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)); this.h2transport = $ifaceNil; this.tlsNextProtoWasNil = false; this.ForceAttemptHTTP2 = false; return; } this.idleMu = idleMu_; this.closeIdle = closeIdle_; this.idleConn = idleConn_; this.idleConnWait = idleConnWait_; this.idleLRU = idleLRU_; this.reqMu = reqMu_; this.reqCanceler = reqCanceler_; this.altMu = altMu_; this.altProto = altProto_; this.connsPerHostMu = connsPerHostMu_; this.connsPerHost = connsPerHost_; this.connsPerHostWait = connsPerHostWait_; this.Proxy = Proxy_; this.DialContext = DialContext_; this.Dial = Dial_; this.DialTLSContext = DialTLSContext_; this.DialTLS = DialTLS_; this.TLSClientConfig = TLSClientConfig_; this.TLSHandshakeTimeout = TLSHandshakeTimeout_; this.DisableKeepAlives = DisableKeepAlives_; this.DisableCompression = DisableCompression_; this.MaxIdleConns = MaxIdleConns_; this.MaxIdleConnsPerHost = MaxIdleConnsPerHost_; this.MaxConnsPerHost = MaxConnsPerHost_; this.IdleConnTimeout = IdleConnTimeout_; this.ResponseHeaderTimeout = ResponseHeaderTimeout_; this.ExpectContinueTimeout = ExpectContinueTimeout_; this.TLSNextProto = TLSNextProto_; this.ProxyConnectHeader = ProxyConnectHeader_; this.GetProxyConnectHeader = GetProxyConnectHeader_; this.MaxResponseHeaderBytes = MaxResponseHeaderBytes_; this.WriteBufferSize = WriteBufferSize_; this.ReadBufferSize = ReadBufferSize_; this.nextProtoOnce = nextProtoOnce_; this.h2transport = h2transport_; this.tlsNextProtoWasNil = tlsNextProtoWasNil_; this.ForceAttemptHTTP2 = ForceAttemptHTTP2_; }); cancelKey = $pkg.cancelKey = $newType(0, $kindStruct, "http.cancelKey", true, "net/http", false, function(req_) { this.$val = this; if (arguments.length === 0) { this.req = ptrType$11.nil; return; } this.req = req_; }); h2Transport = $pkg.h2Transport = $newType(8, $kindInterface, "http.h2Transport", true, "net/http", false, null); transportRequest = $pkg.transportRequest = $newType(0, $kindStruct, "http.transportRequest", true, "net/http", false, function(Request_, extra_, trace_, cancelKey_, mu_, err_) { this.$val = this; if (arguments.length === 0) { this.Request = ptrType$11.nil; this.extra = false; this.trace = ptrType$19.nil; this.cancelKey = new cancelKey.ptr(ptrType$11.nil); this.mu = new sync.Mutex.ptr(0, 0); this.err = $ifaceNil; return; } this.Request = Request_; this.extra = extra_; this.trace = trace_; this.cancelKey = cancelKey_; this.mu = mu_; this.err = err_; }); readTrackingBody = $pkg.readTrackingBody = $newType(0, $kindStruct, "http.readTrackingBody", true, "net/http", false, function(ReadCloser_, didRead_, didClose_) { this.$val = this; if (arguments.length === 0) { this.ReadCloser = $ifaceNil; this.didRead = false; this.didClose = false; return; } this.ReadCloser = ReadCloser_; this.didRead = didRead_; this.didClose = didClose_; }); transportReadFromServerError = $pkg.transportReadFromServerError = $newType(0, $kindStruct, "http.transportReadFromServerError", true, "net/http", false, function(err_) { this.$val = this; if (arguments.length === 0) { this.err = $ifaceNil; return; } this.err = err_; }); wantConn = $pkg.wantConn = $newType(0, $kindStruct, "http.wantConn", true, "net/http", false, function(cm_, key_, ctx_, ready_, beforeDial_, afterDial_, mu_, pc_, err_) { this.$val = this; if (arguments.length === 0) { this.cm = new connectMethod.ptr(arrayType.zero(), ptrType$17.nil, "", "", false); this.key = new connectMethodKey.ptr("", "", "", false); this.ctx = $ifaceNil; this.ready = $chanNil; this.beforeDial = $throwNilPointerError; this.afterDial = $throwNilPointerError; this.mu = new sync.Mutex.ptr(0, 0); this.pc = ptrType$22.nil; this.err = $ifaceNil; return; } this.cm = cm_; this.key = key_; this.ctx = ctx_; this.ready = ready_; this.beforeDial = beforeDial_; this.afterDial = afterDial_; this.mu = mu_; this.pc = pc_; this.err = err_; }); wantConnQueue = $pkg.wantConnQueue = $newType(0, $kindStruct, "http.wantConnQueue", true, "net/http", false, function(head_, headPos_, tail_) { this.$val = this; if (arguments.length === 0) { this.head = sliceType$8.nil; this.headPos = 0; this.tail = sliceType$8.nil; return; } this.head = head_; this.headPos = headPos_; this.tail = tail_; }); erringRoundTripper = $pkg.erringRoundTripper = $newType(8, $kindInterface, "http.erringRoundTripper", true, "net/http", false, null); persistConnWriter = $pkg.persistConnWriter = $newType(0, $kindStruct, "http.persistConnWriter", true, "net/http", false, function(pc_) { this.$val = this; if (arguments.length === 0) { this.pc = ptrType$22.nil; return; } this.pc = pc_; }); connectMethod = $pkg.connectMethod = $newType(0, $kindStruct, "http.connectMethod", true, "net/http", false, function(_$0_, proxyURL_, targetScheme_, targetAddr_, onlyH1_) { this.$val = this; if (arguments.length === 0) { this._$0 = arrayType.zero(); this.proxyURL = ptrType$17.nil; this.targetScheme = ""; this.targetAddr = ""; this.onlyH1 = false; return; } this._$0 = _$0_; this.proxyURL = proxyURL_; this.targetScheme = targetScheme_; this.targetAddr = targetAddr_; this.onlyH1 = onlyH1_; }); connectMethodKey = $pkg.connectMethodKey = $newType(0, $kindStruct, "http.connectMethodKey", true, "net/http", false, function(proxy_, scheme_, addr_, onlyH1_) { this.$val = this; if (arguments.length === 0) { this.proxy = ""; this.scheme = ""; this.addr = ""; this.onlyH1 = false; return; } this.proxy = proxy_; this.scheme = scheme_; this.addr = addr_; this.onlyH1 = onlyH1_; }); persistConn = $pkg.persistConn = $newType(0, $kindStruct, "http.persistConn", true, "net/http", false, function(alt_, t_, cacheKey_, conn_, tlsState_, br_, bw_, nwrite_, reqch_, writech_, closech_, isProxy_, sawEOF_, readLimit_, writeErrCh_, writeLoopDone_, idleAt_, idleTimer_, mu_, numExpectedResponses_, closed_, canceledErr_, broken_, reused_, mutateHeaderFunc_) { this.$val = this; if (arguments.length === 0) { this.alt = $ifaceNil; this.t = ptrType$27.nil; this.cacheKey = new connectMethodKey.ptr("", "", "", false); this.conn = $ifaceNil; this.tlsState = ptrType$28.nil; this.br = ptrType$29.nil; this.bw = ptrType$14.nil; this.nwrite = new $Int64(0, 0); this.reqch = $chanNil; this.writech = $chanNil; this.closech = $chanNil; this.isProxy = false; this.sawEOF = false; this.readLimit = new $Int64(0, 0); this.writeErrCh = $chanNil; this.writeLoopDone = $chanNil; this.idleAt = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil); this.idleTimer = ptrType$25.nil; this.mu = new sync.Mutex.ptr(0, 0); this.numExpectedResponses = 0; this.closed = $ifaceNil; this.canceledErr = $ifaceNil; this.broken = false; this.reused = false; this.mutateHeaderFunc = $throwNilPointerError; return; } this.alt = alt_; this.t = t_; this.cacheKey = cacheKey_; this.conn = conn_; this.tlsState = tlsState_; this.br = br_; this.bw = bw_; this.nwrite = nwrite_; this.reqch = reqch_; this.writech = writech_; this.closech = closech_; this.isProxy = isProxy_; this.sawEOF = sawEOF_; this.readLimit = readLimit_; this.writeErrCh = writeErrCh_; this.writeLoopDone = writeLoopDone_; this.idleAt = idleAt_; this.idleTimer = idleTimer_; this.mu = mu_; this.numExpectedResponses = numExpectedResponses_; this.closed = closed_; this.canceledErr = canceledErr_; this.broken = broken_; this.reused = reused_; this.mutateHeaderFunc = mutateHeaderFunc_; }); readWriteCloserBody = $pkg.readWriteCloserBody = $newType(0, $kindStruct, "http.readWriteCloserBody", true, "net/http", false, function(_$0_, br_, ReadWriteCloser_) { this.$val = this; if (arguments.length === 0) { this._$0 = arrayType.zero(); this.br = ptrType$29.nil; this.ReadWriteCloser = $ifaceNil; return; } this._$0 = _$0_; this.br = br_; this.ReadWriteCloser = ReadWriteCloser_; }); nothingWrittenError = $pkg.nothingWrittenError = $newType(0, $kindStruct, "http.nothingWrittenError", true, "net/http", false, function(error_) { this.$val = this; if (arguments.length === 0) { this.error = $ifaceNil; return; } this.error = error_; }); responseAndError = $pkg.responseAndError = $newType(0, $kindStruct, "http.responseAndError", true, "net/http", false, function(_$0_, res_, err_) { this.$val = this; if (arguments.length === 0) { this._$0 = arrayType.zero(); this.res = ptrType$18.nil; this.err = $ifaceNil; return; } this._$0 = _$0_; this.res = res_; this.err = err_; }); requestAndChan = $pkg.requestAndChan = $newType(0, $kindStruct, "http.requestAndChan", true, "net/http", false, function(_$0_, req_, cancelKey_, ch_, addedGzip_, continueCh_, callerGone_) { this.$val = this; if (arguments.length === 0) { this._$0 = arrayType.zero(); this.req = ptrType$11.nil; this.cancelKey = new cancelKey.ptr(ptrType$11.nil); this.ch = $chanNil; this.addedGzip = false; this.continueCh = $chanNil; this.callerGone = $chanNil; return; } this._$0 = _$0_; this.req = req_; this.cancelKey = cancelKey_; this.ch = ch_; this.addedGzip = addedGzip_; this.continueCh = continueCh_; this.callerGone = callerGone_; }); writeRequest = $pkg.writeRequest = $newType(0, $kindStruct, "http.writeRequest", true, "net/http", false, function(req_, ch_, continueCh_) { this.$val = this; if (arguments.length === 0) { this.req = ptrType$115.nil; this.ch = $chanNil; this.continueCh = $chanNil; return; } this.req = req_; this.ch = ch_; this.continueCh = continueCh_; }); httpError = $pkg.httpError = $newType(0, $kindStruct, "http.httpError", true, "net/http", false, function(err_, timeout_) { this.$val = this; if (arguments.length === 0) { this.err = ""; this.timeout = false; return; } this.err = err_; this.timeout = timeout_; }); tLogKey = $pkg.tLogKey = $newType(0, $kindStruct, "http.tLogKey", true, "net/http", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); bodyEOFSignal = $pkg.bodyEOFSignal = $newType(0, $kindStruct, "http.bodyEOFSignal", true, "net/http", false, function(body_, mu_, closed_, rerr_, fn_, earlyCloseFn_) { this.$val = this; if (arguments.length === 0) { this.body = $ifaceNil; this.mu = new sync.Mutex.ptr(0, 0); this.closed = false; this.rerr = $ifaceNil; this.fn = $throwNilPointerError; this.earlyCloseFn = $throwNilPointerError; return; } this.body = body_; this.mu = mu_; this.closed = closed_; this.rerr = rerr_; this.fn = fn_; this.earlyCloseFn = earlyCloseFn_; }); gzipReader = $pkg.gzipReader = $newType(0, $kindStruct, "http.gzipReader", true, "net/http", false, function(_$0_, body_, zr_, zerr_) { this.$val = this; if (arguments.length === 0) { this._$0 = arrayType.zero(); this.body = ptrType$32.nil; this.zr = ptrType$33.nil; this.zerr = $ifaceNil; return; } this._$0 = _$0_; this.body = body_; this.zr = zr_; this.zerr = zerr_; }); tlsHandshakeTimeoutError = $pkg.tlsHandshakeTimeoutError = $newType(0, $kindStruct, "http.tlsHandshakeTimeoutError", true, "net/http", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); fakeLocker = $pkg.fakeLocker = $newType(0, $kindStruct, "http.fakeLocker", true, "net/http", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); connLRU = $pkg.connLRU = $newType(0, $kindStruct, "http.connLRU", true, "net/http", false, function(ll_, m_) { this.$val = this; if (arguments.length === 0) { this.ll = ptrType$3.nil; this.m = false; return; } this.ll = ll_; this.m = m_; }); errorReader = $pkg.errorReader = $newType(0, $kindStruct, "http.errorReader", true, "net/http", false, function(err_) { this.$val = this; if (arguments.length === 0) { this.err = $ifaceNil; return; } this.err = err_; }); byteReader = $pkg.byteReader = $newType(0, $kindStruct, "http.byteReader", true, "net/http", false, function(b_, done_) { this.$val = this; if (arguments.length === 0) { this.b = 0; this.done = false; return; } this.b = b_; this.done = done_; }); transferWriter = $pkg.transferWriter = $newType(0, $kindStruct, "http.transferWriter", true, "net/http", false, function(Method_, Body_, BodyCloser_, ResponseToHEAD_, ContentLength_, Close_, TransferEncoding_, Header_, Trailer_, IsResponse_, bodyReadError_, FlushHeaders_, ByteReadCh_) { this.$val = this; if (arguments.length === 0) { this.Method = ""; this.Body = $ifaceNil; this.BodyCloser = $ifaceNil; this.ResponseToHEAD = false; this.ContentLength = new $Int64(0, 0); this.Close = false; this.TransferEncoding = sliceType$2.nil; this.Header = false; this.Trailer = false; this.IsResponse = false; this.bodyReadError = $ifaceNil; this.FlushHeaders = false; this.ByteReadCh = $chanNil; return; } this.Method = Method_; this.Body = Body_; this.BodyCloser = BodyCloser_; this.ResponseToHEAD = ResponseToHEAD_; this.ContentLength = ContentLength_; this.Close = Close_; this.TransferEncoding = TransferEncoding_; this.Header = Header_; this.Trailer = Trailer_; this.IsResponse = IsResponse_; this.bodyReadError = bodyReadError_; this.FlushHeaders = FlushHeaders_; this.ByteReadCh = ByteReadCh_; }); transferReader = $pkg.transferReader = $newType(0, $kindStruct, "http.transferReader", true, "net/http", false, function(Header_, StatusCode_, RequestMethod_, ProtoMajor_, ProtoMinor_, Body_, ContentLength_, Chunked_, Close_, Trailer_) { this.$val = this; if (arguments.length === 0) { this.Header = false; this.StatusCode = 0; this.RequestMethod = ""; this.ProtoMajor = 0; this.ProtoMinor = 0; this.Body = $ifaceNil; this.ContentLength = new $Int64(0, 0); this.Chunked = false; this.Close = false; this.Trailer = false; return; } this.Header = Header_; this.StatusCode = StatusCode_; this.RequestMethod = RequestMethod_; this.ProtoMajor = ProtoMajor_; this.ProtoMinor = ProtoMinor_; this.Body = Body_; this.ContentLength = ContentLength_; this.Chunked = Chunked_; this.Close = Close_; this.Trailer = Trailer_; }); unsupportedTEError = $pkg.unsupportedTEError = $newType(0, $kindStruct, "http.unsupportedTEError", true, "net/http", false, function(err_) { this.$val = this; if (arguments.length === 0) { this.err = ""; return; } this.err = err_; }); body = $pkg.body = $newType(0, $kindStruct, "http.body", true, "net/http", false, function(src_, hdr_, r_, closing_, doEarlyClose_, mu_, sawEOF_, closed_, earlyClose_, onHitEOF_) { this.$val = this; if (arguments.length === 0) { this.src = $ifaceNil; this.hdr = $ifaceNil; this.r = ptrType$29.nil; this.closing = false; this.doEarlyClose = false; this.mu = new sync.Mutex.ptr(0, 0); this.sawEOF = false; this.closed = false; this.earlyClose = false; this.onHitEOF = $throwNilPointerError; return; } this.src = src_; this.hdr = hdr_; this.r = r_; this.closing = closing_; this.doEarlyClose = doEarlyClose_; this.mu = mu_; this.sawEOF = sawEOF_; this.closed = closed_; this.earlyClose = earlyClose_; this.onHitEOF = onHitEOF_; }); bodyLocked = $pkg.bodyLocked = $newType(0, $kindStruct, "http.bodyLocked", true, "net/http", false, function(b_) { this.$val = this; if (arguments.length === 0) { this.b = ptrType$52.nil; return; } this.b = b_; }); finishAsyncByteRead = $pkg.finishAsyncByteRead = $newType(0, $kindStruct, "http.finishAsyncByteRead", true, "net/http", false, function(tw_) { this.$val = this; if (arguments.length === 0) { this.tw = ptrType$35.nil; return; } this.tw = tw_; }); bufioFlushWriter = $pkg.bufioFlushWriter = $newType(0, $kindStruct, "http.bufioFlushWriter", true, "net/http", false, function(w_) { this.$val = this; if (arguments.length === 0) { this.w = $ifaceNil; return; } this.w = w_; }); socksCommand = $pkg.socksCommand = $newType(4, $kindInt, "http.socksCommand", true, "net/http", false, null); socksAuthMethod = $pkg.socksAuthMethod = $newType(4, $kindInt, "http.socksAuthMethod", true, "net/http", false, null); socksReply = $pkg.socksReply = $newType(4, $kindInt, "http.socksReply", true, "net/http", false, null); socksAddr = $pkg.socksAddr = $newType(0, $kindStruct, "http.socksAddr", true, "net/http", false, function(Name_, IP_, Port_) { this.$val = this; if (arguments.length === 0) { this.Name = ""; this.IP = net.IP.nil; this.Port = 0; return; } this.Name = Name_; this.IP = IP_; this.Port = Port_; }); socksConn = $pkg.socksConn = $newType(0, $kindStruct, "http.socksConn", true, "net/http", false, function(Conn_, boundAddr_) { this.$val = this; if (arguments.length === 0) { this.Conn = $ifaceNil; this.boundAddr = $ifaceNil; return; } this.Conn = Conn_; this.boundAddr = boundAddr_; }); socksDialer = $pkg.socksDialer = $newType(0, $kindStruct, "http.socksDialer", true, "net/http", false, function(cmd_, proxyNetwork_, proxyAddress_, ProxyDial_, AuthMethods_, Authenticate_) { this.$val = this; if (arguments.length === 0) { this.cmd = 0; this.proxyNetwork = ""; this.proxyAddress = ""; this.ProxyDial = $throwNilPointerError; this.AuthMethods = sliceType$12.nil; this.Authenticate = $throwNilPointerError; return; } this.cmd = cmd_; this.proxyNetwork = proxyNetwork_; this.proxyAddress = proxyAddress_; this.ProxyDial = ProxyDial_; this.AuthMethods = AuthMethods_; this.Authenticate = Authenticate_; }); socksUsernamePassword = $pkg.socksUsernamePassword = $newType(0, $kindStruct, "http.socksUsernamePassword", true, "net/http", false, function(Username_, Password_) { this.$val = this; if (arguments.length === 0) { this.Username = ""; this.Password = ""; return; } this.Username = Username_; this.Password = Password_; }); sniffSig = $pkg.sniffSig = $newType(8, $kindInterface, "http.sniffSig", true, "net/http", false, null); exactSig = $pkg.exactSig = $newType(0, $kindStruct, "http.exactSig", true, "net/http", false, function(sig_, ct_) { this.$val = this; if (arguments.length === 0) { this.sig = sliceType$3.nil; this.ct = ""; return; } this.sig = sig_; this.ct = ct_; }); maskedSig = $pkg.maskedSig = $newType(0, $kindStruct, "http.maskedSig", true, "net/http", false, function(mask_, pat_, skipWS_, ct_) { this.$val = this; if (arguments.length === 0) { this.mask = sliceType$3.nil; this.pat = sliceType$3.nil; this.skipWS = false; this.ct = ""; return; } this.mask = mask_; this.pat = pat_; this.skipWS = skipWS_; this.ct = ct_; }); htmlSig = $pkg.htmlSig = $newType(12, $kindSlice, "http.htmlSig", true, "net/http", false, null); mp4Sig = $pkg.mp4Sig = $newType(0, $kindStruct, "http.mp4Sig", true, "net/http", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); textSig = $pkg.textSig = $newType(0, $kindStruct, "http.textSig", true, "net/http", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); Handler = $pkg.Handler = $newType(8, $kindInterface, "http.Handler", true, "net/http", true, null); ResponseWriter = $pkg.ResponseWriter = $newType(8, $kindInterface, "http.ResponseWriter", true, "net/http", true, null); conn = $pkg.conn = $newType(0, $kindStruct, "http.conn", true, "net/http", false, function(server_, cancelCtx_, rwc_, remoteAddr_, tlsState_, werr_, r_, bufr_, bufw_, lastMethod_, curReq_, curState_, mu_, hijackedv_) { this.$val = this; if (arguments.length === 0) { this.server = ptrType$46.nil; this.cancelCtx = $throwNilPointerError; this.rwc = $ifaceNil; this.remoteAddr = ""; this.tlsState = ptrType$28.nil; this.werr = $ifaceNil; this.r = ptrType$47.nil; this.bufr = ptrType$29.nil; this.bufw = ptrType$14.nil; this.lastMethod = ""; this.curReq = new atomic.Value.ptr($ifaceNil); this.curState = new structType$1.ptr(new $Uint64(0, 0)); this.mu = new sync.Mutex.ptr(0, 0); this.hijackedv = false; return; } this.server = server_; this.cancelCtx = cancelCtx_; this.rwc = rwc_; this.remoteAddr = remoteAddr_; this.tlsState = tlsState_; this.werr = werr_; this.r = r_; this.bufr = bufr_; this.bufw = bufw_; this.lastMethod = lastMethod_; this.curReq = curReq_; this.curState = curState_; this.mu = mu_; this.hijackedv = hijackedv_; }); chunkWriter = $pkg.chunkWriter = $newType(0, $kindStruct, "http.chunkWriter", true, "net/http", false, function(res_, header_, wroteHeader_, chunking_) { this.$val = this; if (arguments.length === 0) { this.res = ptrType$49.nil; this.header = false; this.wroteHeader = false; this.chunking = false; return; } this.res = res_; this.header = header_; this.wroteHeader = wroteHeader_; this.chunking = chunking_; }); response = $pkg.response = $newType(0, $kindStruct, "http.response", true, "net/http", false, function(conn_, req_, reqBody_, cancelCtx_, wroteHeader_, wroteContinue_, wants10KeepAlive_, wantsClose_, canWriteContinue_, writeContinueMu_, w_, cw_, handlerHeader_, calledHeader_, written_, contentLength_, status_, closeAfterReply_, requestBodyLimitHit_, trailers_, handlerDone_, dateBuf_, clenBuf_, statusBuf_, closeNotifyCh_, didCloseNotify_) { this.$val = this; if (arguments.length === 0) { this.conn = ptrType$53.nil; this.req = ptrType$11.nil; this.reqBody = $ifaceNil; this.cancelCtx = $throwNilPointerError; this.wroteHeader = false; this.wroteContinue = false; this.wants10KeepAlive = false; this.wantsClose = false; this.canWriteContinue = 0; this.writeContinueMu = new sync.Mutex.ptr(0, 0); this.w = ptrType$14.nil; this.cw = new chunkWriter.ptr(ptrType$49.nil, false, false, false); this.handlerHeader = false; this.calledHeader = false; this.written = new $Int64(0, 0); this.contentLength = new $Int64(0, 0); this.status = 0; this.closeAfterReply = false; this.requestBodyLimitHit = false; this.trailers = sliceType$2.nil; this.handlerDone = 0; this.dateBuf = arrayType$3.zero(); this.clenBuf = arrayType$4.zero(); this.statusBuf = arrayType$5.zero(); this.closeNotifyCh = $chanNil; this.didCloseNotify = 0; return; } this.conn = conn_; this.req = req_; this.reqBody = reqBody_; this.cancelCtx = cancelCtx_; this.wroteHeader = wroteHeader_; this.wroteContinue = wroteContinue_; this.wants10KeepAlive = wants10KeepAlive_; this.wantsClose = wantsClose_; this.canWriteContinue = canWriteContinue_; this.writeContinueMu = writeContinueMu_; this.w = w_; this.cw = cw_; this.handlerHeader = handlerHeader_; this.calledHeader = calledHeader_; this.written = written_; this.contentLength = contentLength_; this.status = status_; this.closeAfterReply = closeAfterReply_; this.requestBodyLimitHit = requestBodyLimitHit_; this.trailers = trailers_; this.handlerDone = handlerDone_; this.dateBuf = dateBuf_; this.clenBuf = clenBuf_; this.statusBuf = statusBuf_; this.closeNotifyCh = closeNotifyCh_; this.didCloseNotify = didCloseNotify_; }); atomicBool = $pkg.atomicBool = $newType(4, $kindInt32, "http.atomicBool", true, "net/http", false, null); writerOnly = $pkg.writerOnly = $newType(0, $kindStruct, "http.writerOnly", true, "net/http", false, function(Writer_) { this.$val = this; if (arguments.length === 0) { this.Writer = $ifaceNil; return; } this.Writer = Writer_; }); readResult = $pkg.readResult = $newType(0, $kindStruct, "http.readResult", true, "net/http", false, function(_$0_, n_, err_, b_) { this.$val = this; if (arguments.length === 0) { this._$0 = arrayType.zero(); this.n = 0; this.err = $ifaceNil; this.b = 0; return; } this._$0 = _$0_; this.n = n_; this.err = err_; this.b = b_; }); connReader = $pkg.connReader = $newType(0, $kindStruct, "http.connReader", true, "net/http", false, function(conn_, mu_, hasByte_, byteBuf_, cond_, inRead_, aborted_, remain_) { this.$val = this; if (arguments.length === 0) { this.conn = ptrType$53.nil; this.mu = new sync.Mutex.ptr(0, 0); this.hasByte = false; this.byteBuf = arrayType$2.zero(); this.cond = ptrType$48.nil; this.inRead = false; this.aborted = false; this.remain = new $Int64(0, 0); return; } this.conn = conn_; this.mu = mu_; this.hasByte = hasByte_; this.byteBuf = byteBuf_; this.cond = cond_; this.inRead = inRead_; this.aborted = aborted_; this.remain = remain_; }); expectContinueReader = $pkg.expectContinueReader = $newType(0, $kindStruct, "http.expectContinueReader", true, "net/http", false, function(resp_, readCloser_, closed_, sawEOF_) { this.$val = this; if (arguments.length === 0) { this.resp = ptrType$49.nil; this.readCloser = $ifaceNil; this.closed = 0; this.sawEOF = 0; return; } this.resp = resp_; this.readCloser = readCloser_; this.closed = closed_; this.sawEOF = sawEOF_; }); extraHeader = $pkg.extraHeader = $newType(0, $kindStruct, "http.extraHeader", true, "net/http", false, function(contentType_, connection_, transferEncoding_, date_, contentLength_) { this.$val = this; if (arguments.length === 0) { this.contentType = ""; this.connection = ""; this.transferEncoding = ""; this.date = sliceType$3.nil; this.contentLength = sliceType$3.nil; return; } this.contentType = contentType_; this.connection = connection_; this.transferEncoding = transferEncoding_; this.date = date_; this.contentLength = contentLength_; }); closeWriter = $pkg.closeWriter = $newType(8, $kindInterface, "http.closeWriter", true, "net/http", false, null); statusError = $pkg.statusError = $newType(0, $kindStruct, "http.statusError", true, "net/http", false, function(code_, text_) { this.$val = this; if (arguments.length === 0) { this.code = 0; this.text = ""; return; } this.code = code_; this.text = text_; }); HandlerFunc = $pkg.HandlerFunc = $newType(4, $kindFunc, "http.HandlerFunc", true, "net/http", true, null); redirectHandler = $pkg.redirectHandler = $newType(0, $kindStruct, "http.redirectHandler", true, "net/http", false, function(url_, code_) { this.$val = this; if (arguments.length === 0) { this.url = ""; this.code = 0; return; } this.url = url_; this.code = code_; }); ServeMux = $pkg.ServeMux = $newType(0, $kindStruct, "http.ServeMux", true, "net/http", true, function(mu_, m_, es_, hosts_) { this.$val = this; if (arguments.length === 0) { this.mu = new sync.RWMutex.ptr(new sync.Mutex.ptr(0, 0), 0, 0, 0, 0); this.m = false; this.es = sliceType$1.nil; this.hosts = false; return; } this.mu = mu_; this.m = m_; this.es = es_; this.hosts = hosts_; }); muxEntry = $pkg.muxEntry = $newType(0, $kindStruct, "http.muxEntry", true, "net/http", false, function(h_, pattern_) { this.$val = this; if (arguments.length === 0) { this.h = $ifaceNil; this.pattern = ""; return; } this.h = h_; this.pattern = pattern_; }); Server = $pkg.Server = $newType(0, $kindStruct, "http.Server", true, "net/http", true, function(Addr_, Handler_, TLSConfig_, ReadTimeout_, ReadHeaderTimeout_, WriteTimeout_, IdleTimeout_, MaxHeaderBytes_, TLSNextProto_, ConnState_, ErrorLog_, BaseContext_, ConnContext_, inShutdown_, disableKeepAlives_, nextProtoOnce_, nextProtoErr_, mu_, listeners_, activeConn_, doneChan_, onShutdown_) { this.$val = this; if (arguments.length === 0) { this.Addr = ""; this.Handler = $ifaceNil; this.TLSConfig = ptrType$4.nil; this.ReadTimeout = new time.Duration(0, 0); this.ReadHeaderTimeout = new time.Duration(0, 0); this.WriteTimeout = new time.Duration(0, 0); this.IdleTimeout = new time.Duration(0, 0); this.MaxHeaderBytes = 0; this.TLSNextProto = false; this.ConnState = $throwNilPointerError; this.ErrorLog = ptrType$58.nil; this.BaseContext = $throwNilPointerError; this.ConnContext = $throwNilPointerError; this.inShutdown = 0; this.disableKeepAlives = 0; this.nextProtoOnce = new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)); this.nextProtoErr = $ifaceNil; this.mu = new sync.Mutex.ptr(0, 0); this.listeners = false; this.activeConn = false; this.doneChan = $chanNil; this.onShutdown = sliceType$19.nil; return; } this.Addr = Addr_; this.Handler = Handler_; this.TLSConfig = TLSConfig_; this.ReadTimeout = ReadTimeout_; this.ReadHeaderTimeout = ReadHeaderTimeout_; this.WriteTimeout = WriteTimeout_; this.IdleTimeout = IdleTimeout_; this.MaxHeaderBytes = MaxHeaderBytes_; this.TLSNextProto = TLSNextProto_; this.ConnState = ConnState_; this.ErrorLog = ErrorLog_; this.BaseContext = BaseContext_; this.ConnContext = ConnContext_; this.inShutdown = inShutdown_; this.disableKeepAlives = disableKeepAlives_; this.nextProtoOnce = nextProtoOnce_; this.nextProtoErr = nextProtoErr_; this.mu = mu_; this.listeners = listeners_; this.activeConn = activeConn_; this.doneChan = doneChan_; this.onShutdown = onShutdown_; }); ConnState = $pkg.ConnState = $newType(4, $kindInt, "http.ConnState", true, "net/http", true, null); serverHandler = $pkg.serverHandler = $newType(0, $kindStruct, "http.serverHandler", true, "net/http", false, function(srv_) { this.$val = this; if (arguments.length === 0) { this.srv = ptrType$46.nil; return; } this.srv = srv_; }); onceCloseListener = $pkg.onceCloseListener = $newType(0, $kindStruct, "http.onceCloseListener", true, "net/http", false, function(Listener_, once_, closeErr_) { this.$val = this; if (arguments.length === 0) { this.Listener = $ifaceNil; this.once = new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)); this.closeErr = $ifaceNil; return; } this.Listener = Listener_; this.once = once_; this.closeErr = closeErr_; }); globalOptionsHandler = $pkg.globalOptionsHandler = $newType(0, $kindStruct, "http.globalOptionsHandler", true, "net/http", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); initALPNRequest = $pkg.initALPNRequest = $newType(0, $kindStruct, "http.initALPNRequest", true, "net/http", false, function(ctx_, c_, h_) { this.$val = this; if (arguments.length === 0) { this.ctx = $ifaceNil; this.c = ptrType$30.nil; this.h = new serverHandler.ptr(ptrType$46.nil); return; } this.ctx = ctx_; this.c = c_; this.h = h_; }); loggingConn = $pkg.loggingConn = $newType(0, $kindStruct, "http.loggingConn", true, "net/http", false, function(name_, Conn_) { this.$val = this; if (arguments.length === 0) { this.name = ""; this.Conn = $ifaceNil; return; } this.name = name_; this.Conn = Conn_; }); checkConnErrorWriter = $pkg.checkConnErrorWriter = $newType(0, $kindStruct, "http.checkConnErrorWriter", true, "net/http", false, function(c_) { this.$val = this; if (arguments.length === 0) { this.c = ptrType$53.nil; return; } this.c = c_; }); Response = $pkg.Response = $newType(0, $kindStruct, "http.Response", true, "net/http", true, function(Status_, StatusCode_, Proto_, ProtoMajor_, ProtoMinor_, Header_, Body_, ContentLength_, TransferEncoding_, Close_, Uncompressed_, Trailer_, Request_, TLS_) { this.$val = this; if (arguments.length === 0) { this.Status = ""; this.StatusCode = 0; this.Proto = ""; this.ProtoMajor = 0; this.ProtoMinor = 0; this.Header = false; this.Body = $ifaceNil; this.ContentLength = new $Int64(0, 0); this.TransferEncoding = sliceType$2.nil; this.Close = false; this.Uncompressed = false; this.Trailer = false; this.Request = ptrType$11.nil; this.TLS = ptrType$28.nil; return; } this.Status = Status_; this.StatusCode = StatusCode_; this.Proto = Proto_; this.ProtoMajor = ProtoMajor_; this.ProtoMinor = ProtoMinor_; this.Header = Header_; this.Body = Body_; this.ContentLength = ContentLength_; this.TransferEncoding = TransferEncoding_; this.Close = Close_; this.Uncompressed = Uncompressed_; this.Trailer = Trailer_; this.Request = Request_; this.TLS = TLS_; }); ProtocolError = $pkg.ProtocolError = $newType(0, $kindStruct, "http.ProtocolError", true, "net/http", true, function(ErrorString_) { this.$val = this; if (arguments.length === 0) { this.ErrorString = ""; return; } this.ErrorString = ErrorString_; }); Request = $pkg.Request = $newType(0, $kindStruct, "http.Request", true, "net/http", true, function(Method_, URL_, Proto_, ProtoMajor_, ProtoMinor_, Header_, Body_, GetBody_, ContentLength_, TransferEncoding_, Close_, Host_, Form_, PostForm_, MultipartForm_, Trailer_, RemoteAddr_, RequestURI_, TLS_, Cancel_, Response_, ctx_) { this.$val = this; if (arguments.length === 0) { this.Method = ""; this.URL = ptrType$17.nil; this.Proto = ""; this.ProtoMajor = 0; this.ProtoMinor = 0; this.Header = false; this.Body = $ifaceNil; this.GetBody = $throwNilPointerError; this.ContentLength = new $Int64(0, 0); this.TransferEncoding = sliceType$2.nil; this.Close = false; this.Host = ""; this.Form = false; this.PostForm = false; this.MultipartForm = ptrType$31.nil; this.Trailer = false; this.RemoteAddr = ""; this.RequestURI = ""; this.TLS = ptrType$28.nil; this.Cancel = $chanNil; this.Response = ptrType$18.nil; this.ctx = $ifaceNil; return; } this.Method = Method_; this.URL = URL_; this.Proto = Proto_; this.ProtoMajor = ProtoMajor_; this.ProtoMinor = ProtoMinor_; this.Header = Header_; this.Body = Body_; this.GetBody = GetBody_; this.ContentLength = ContentLength_; this.TransferEncoding = TransferEncoding_; this.Close = Close_; this.Host = Host_; this.Form = Form_; this.PostForm = PostForm_; this.MultipartForm = MultipartForm_; this.Trailer = Trailer_; this.RemoteAddr = RemoteAddr_; this.RequestURI = RequestURI_; this.TLS = TLS_; this.Cancel = Cancel_; this.Response = Response_; this.ctx = ctx_; }); requestBodyReadError = $pkg.requestBodyReadError = $newType(0, $kindStruct, "http.requestBodyReadError", true, "net/http", false, function(error_) { this.$val = this; if (arguments.length === 0) { this.error = $ifaceNil; return; } this.error = error_; }); maxBytesReader = $pkg.maxBytesReader = $newType(0, $kindStruct, "http.maxBytesReader", true, "net/http", false, function(w_, r_, n_, err_) { this.$val = this; if (arguments.length === 0) { this.w = $ifaceNil; this.r = $ifaceNil; this.n = new $Int64(0, 0); this.err = $ifaceNil; return; } this.w = w_; this.r = r_; this.n = n_; this.err = err_; }); CookieJar = $pkg.CookieJar = $newType(8, $kindInterface, "http.CookieJar", true, "net/http", true, null); incomparable = $pkg.incomparable = $newType(0, $kindArray, "http.incomparable", true, "net/http", false, null); contextKey = $pkg.contextKey = $newType(0, $kindStruct, "http.contextKey", true, "net/http", false, function(name_) { this.$val = this; if (arguments.length === 0) { this.name = ""; return; } this.name = name_; }); noBody = $pkg.noBody = $newType(0, $kindStruct, "http.noBody", true, "net/http", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); PushOptions = $pkg.PushOptions = $newType(0, $kindStruct, "http.PushOptions", true, "net/http", true, function(Method_, Header_) { this.$val = this; if (arguments.length === 0) { this.Method = ""; this.Header = false; return; } this.Method = Method_; this.Header = Header_; }); Header = $pkg.Header = $newType(4, $kindMap, "http.Header", true, "net/http", true, null); stringWriter = $pkg.stringWriter = $newType(0, $kindStruct, "http.stringWriter", true, "net/http", false, function(w_) { this.$val = this; if (arguments.length === 0) { this.w = $ifaceNil; return; } this.w = w_; }); keyValues = $pkg.keyValues = $newType(0, $kindStruct, "http.keyValues", true, "net/http", false, function(key_, values_) { this.$val = this; if (arguments.length === 0) { this.key = ""; this.values = sliceType$2.nil; return; } this.key = key_; this.values = values_; }); headerSorter = $pkg.headerSorter = $newType(0, $kindStruct, "http.headerSorter", true, "net/http", false, function(kvs_) { this.$val = this; if (arguments.length === 0) { this.kvs = sliceType$6.nil; return; } this.kvs = kvs_; }); http2ClientConnPool = $pkg.http2ClientConnPool = $newType(8, $kindInterface, "http.http2ClientConnPool", true, "net/http", false, null); http2clientConnPoolIdleCloser = $pkg.http2clientConnPoolIdleCloser = $newType(8, $kindInterface, "http.http2clientConnPoolIdleCloser", true, "net/http", false, null); http2clientConnPool = $pkg.http2clientConnPool = $newType(0, $kindStruct, "http.http2clientConnPool", true, "net/http", false, function(t_, mu_, conns_, dialing_, keys_, addConnCalls_) { this.$val = this; if (arguments.length === 0) { this.t = ptrType$102.nil; this.mu = new sync.Mutex.ptr(0, 0); this.conns = false; this.dialing = false; this.keys = false; this.addConnCalls = false; return; } this.t = t_; this.mu = mu_; this.conns = conns_; this.dialing = dialing_; this.keys = keys_; this.addConnCalls = addConnCalls_; }); http2dialCall = $pkg.http2dialCall = $newType(0, $kindStruct, "http.http2dialCall", true, "net/http", false, function(_$0_, p_, ctx_, done_, res_, err_) { this.$val = this; if (arguments.length === 0) { this._$0 = arrayType.zero(); this.p = ptrType$9.nil; this.ctx = $ifaceNil; this.done = $chanNil; this.res = ptrType$68.nil; this.err = $ifaceNil; return; } this._$0 = _$0_; this.p = p_; this.ctx = ctx_; this.done = done_; this.res = res_; this.err = err_; }); http2addConnCall = $pkg.http2addConnCall = $newType(0, $kindStruct, "http.http2addConnCall", true, "net/http", false, function(_$0_, p_, done_, err_) { this.$val = this; if (arguments.length === 0) { this._$0 = arrayType.zero(); this.p = ptrType$9.nil; this.done = $chanNil; this.err = $ifaceNil; return; } this._$0 = _$0_; this.p = p_; this.done = done_; this.err = err_; }); http2noDialClientConnPool = $pkg.http2noDialClientConnPool = $newType(0, $kindStruct, "http.http2noDialClientConnPool", true, "net/http", false, function(http2clientConnPool_) { this.$val = this; if (arguments.length === 0) { this.http2clientConnPool = ptrType$9.nil; return; } this.http2clientConnPool = http2clientConnPool_; }); http2dataBuffer = $pkg.http2dataBuffer = $newType(0, $kindStruct, "http.http2dataBuffer", true, "net/http", false, function(chunks_, r_, w_, size_, expected_) { this.$val = this; if (arguments.length === 0) { this.chunks = sliceType$5.nil; this.r = 0; this.w = 0; this.size = 0; this.expected = new $Int64(0, 0); return; } this.chunks = chunks_; this.r = r_; this.w = w_; this.size = size_; this.expected = expected_; }); http2ErrCode = $pkg.http2ErrCode = $newType(4, $kindUint32, "http.http2ErrCode", true, "net/http", false, null); http2ConnectionError = $pkg.http2ConnectionError = $newType(4, $kindUint32, "http.http2ConnectionError", true, "net/http", false, null); http2StreamError = $pkg.http2StreamError = $newType(0, $kindStruct, "http.http2StreamError", true, "net/http", false, function(StreamID_, Code_, Cause_) { this.$val = this; if (arguments.length === 0) { this.StreamID = 0; this.Code = 0; this.Cause = $ifaceNil; return; } this.StreamID = StreamID_; this.Code = Code_; this.Cause = Cause_; }); http2goAwayFlowError = $pkg.http2goAwayFlowError = $newType(0, $kindStruct, "http.http2goAwayFlowError", true, "net/http", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); http2connError = $pkg.http2connError = $newType(0, $kindStruct, "http.http2connError", true, "net/http", false, function(Code_, Reason_) { this.$val = this; if (arguments.length === 0) { this.Code = 0; this.Reason = ""; return; } this.Code = Code_; this.Reason = Reason_; }); http2pseudoHeaderError = $pkg.http2pseudoHeaderError = $newType(8, $kindString, "http.http2pseudoHeaderError", true, "net/http", false, null); http2duplicatePseudoHeaderError = $pkg.http2duplicatePseudoHeaderError = $newType(8, $kindString, "http.http2duplicatePseudoHeaderError", true, "net/http", false, null); http2headerFieldNameError = $pkg.http2headerFieldNameError = $newType(8, $kindString, "http.http2headerFieldNameError", true, "net/http", false, null); http2headerFieldValueError = $pkg.http2headerFieldValueError = $newType(8, $kindString, "http.http2headerFieldValueError", true, "net/http", false, null); http2flow = $pkg.http2flow = $newType(0, $kindStruct, "http.http2flow", true, "net/http", false, function(_$0_, n_, conn_) { this.$val = this; if (arguments.length === 0) { this._$0 = arrayType.zero(); this.n = 0; this.conn = ptrType$71.nil; return; } this._$0 = _$0_; this.n = n_; this.conn = conn_; }); http2FrameType = $pkg.http2FrameType = $newType(1, $kindUint8, "http.http2FrameType", true, "net/http", false, null); http2Flags = $pkg.http2Flags = $newType(1, $kindUint8, "http.http2Flags", true, "net/http", false, null); http2FrameHeader = $pkg.http2FrameHeader = $newType(0, $kindStruct, "http.http2FrameHeader", true, "net/http", false, function(valid_, Type_, Flags_, Length_, StreamID_) { this.$val = this; if (arguments.length === 0) { this.valid = false; this.Type = 0; this.Flags = 0; this.Length = 0; this.StreamID = 0; return; } this.valid = valid_; this.Type = Type_; this.Flags = Flags_; this.Length = Length_; this.StreamID = StreamID_; }); http2Frame = $pkg.http2Frame = $newType(8, $kindInterface, "http.http2Frame", true, "net/http", false, null); http2Framer = $pkg.http2Framer = $newType(0, $kindStruct, "http.http2Framer", true, "net/http", false, function(r_, lastFrame_, errDetail_, lastHeaderStream_, maxReadSize_, headerBuf_, getReadBuf_, readBuf_, maxWriteSize_, w_, wbuf_, AllowIllegalWrites_, AllowIllegalReads_, ReadMetaHeaders_, MaxHeaderListSize_, logReads_, logWrites_, debugFramer_, debugFramerBuf_, debugReadLoggerf_, debugWriteLoggerf_, frameCache_) { this.$val = this; if (arguments.length === 0) { this.r = $ifaceNil; this.lastFrame = $ifaceNil; this.errDetail = $ifaceNil; this.lastHeaderStream = 0; this.maxReadSize = 0; this.headerBuf = arrayType$7.zero(); this.getReadBuf = $throwNilPointerError; this.readBuf = sliceType$3.nil; this.maxWriteSize = 0; this.w = $ifaceNil; this.wbuf = sliceType$3.nil; this.AllowIllegalWrites = false; this.AllowIllegalReads = false; this.ReadMetaHeaders = ptrType$74.nil; this.MaxHeaderListSize = 0; this.logReads = false; this.logWrites = false; this.debugFramer = ptrType$72.nil; this.debugFramerBuf = ptrType$40.nil; this.debugReadLoggerf = $throwNilPointerError; this.debugWriteLoggerf = $throwNilPointerError; this.frameCache = ptrType$73.nil; return; } this.r = r_; this.lastFrame = lastFrame_; this.errDetail = errDetail_; this.lastHeaderStream = lastHeaderStream_; this.maxReadSize = maxReadSize_; this.headerBuf = headerBuf_; this.getReadBuf = getReadBuf_; this.readBuf = readBuf_; this.maxWriteSize = maxWriteSize_; this.w = w_; this.wbuf = wbuf_; this.AllowIllegalWrites = AllowIllegalWrites_; this.AllowIllegalReads = AllowIllegalReads_; this.ReadMetaHeaders = ReadMetaHeaders_; this.MaxHeaderListSize = MaxHeaderListSize_; this.logReads = logReads_; this.logWrites = logWrites_; this.debugFramer = debugFramer_; this.debugFramerBuf = debugFramerBuf_; this.debugReadLoggerf = debugReadLoggerf_; this.debugWriteLoggerf = debugWriteLoggerf_; this.frameCache = frameCache_; }); http2frameCache = $pkg.http2frameCache = $newType(0, $kindStruct, "http.http2frameCache", true, "net/http", false, function(dataFrame_) { this.$val = this; if (arguments.length === 0) { this.dataFrame = new http2DataFrame.ptr(new http2FrameHeader.ptr(false, 0, 0, 0, 0), sliceType$3.nil); return; } this.dataFrame = dataFrame_; }); http2DataFrame = $pkg.http2DataFrame = $newType(0, $kindStruct, "http.http2DataFrame", true, "net/http", false, function(http2FrameHeader_, data_) { this.$val = this; if (arguments.length === 0) { this.http2FrameHeader = new http2FrameHeader.ptr(false, 0, 0, 0, 0); this.data = sliceType$3.nil; return; } this.http2FrameHeader = http2FrameHeader_; this.data = data_; }); http2SettingsFrame = $pkg.http2SettingsFrame = $newType(0, $kindStruct, "http.http2SettingsFrame", true, "net/http", false, function(http2FrameHeader_, p_) { this.$val = this; if (arguments.length === 0) { this.http2FrameHeader = new http2FrameHeader.ptr(false, 0, 0, 0, 0); this.p = sliceType$3.nil; return; } this.http2FrameHeader = http2FrameHeader_; this.p = p_; }); http2PingFrame = $pkg.http2PingFrame = $newType(0, $kindStruct, "http.http2PingFrame", true, "net/http", false, function(http2FrameHeader_, Data_) { this.$val = this; if (arguments.length === 0) { this.http2FrameHeader = new http2FrameHeader.ptr(false, 0, 0, 0, 0); this.Data = arrayType$8.zero(); return; } this.http2FrameHeader = http2FrameHeader_; this.Data = Data_; }); http2GoAwayFrame = $pkg.http2GoAwayFrame = $newType(0, $kindStruct, "http.http2GoAwayFrame", true, "net/http", false, function(http2FrameHeader_, LastStreamID_, ErrCode_, debugData_) { this.$val = this; if (arguments.length === 0) { this.http2FrameHeader = new http2FrameHeader.ptr(false, 0, 0, 0, 0); this.LastStreamID = 0; this.ErrCode = 0; this.debugData = sliceType$3.nil; return; } this.http2FrameHeader = http2FrameHeader_; this.LastStreamID = LastStreamID_; this.ErrCode = ErrCode_; this.debugData = debugData_; }); http2UnknownFrame = $pkg.http2UnknownFrame = $newType(0, $kindStruct, "http.http2UnknownFrame", true, "net/http", false, function(http2FrameHeader_, p_) { this.$val = this; if (arguments.length === 0) { this.http2FrameHeader = new http2FrameHeader.ptr(false, 0, 0, 0, 0); this.p = sliceType$3.nil; return; } this.http2FrameHeader = http2FrameHeader_; this.p = p_; }); http2WindowUpdateFrame = $pkg.http2WindowUpdateFrame = $newType(0, $kindStruct, "http.http2WindowUpdateFrame", true, "net/http", false, function(http2FrameHeader_, Increment_) { this.$val = this; if (arguments.length === 0) { this.http2FrameHeader = new http2FrameHeader.ptr(false, 0, 0, 0, 0); this.Increment = 0; return; } this.http2FrameHeader = http2FrameHeader_; this.Increment = Increment_; }); http2HeadersFrame = $pkg.http2HeadersFrame = $newType(0, $kindStruct, "http.http2HeadersFrame", true, "net/http", false, function(http2FrameHeader_, Priority_, headerFragBuf_) { this.$val = this; if (arguments.length === 0) { this.http2FrameHeader = new http2FrameHeader.ptr(false, 0, 0, 0, 0); this.Priority = new http2PriorityParam.ptr(0, false, 0); this.headerFragBuf = sliceType$3.nil; return; } this.http2FrameHeader = http2FrameHeader_; this.Priority = Priority_; this.headerFragBuf = headerFragBuf_; }); http2HeadersFrameParam = $pkg.http2HeadersFrameParam = $newType(0, $kindStruct, "http.http2HeadersFrameParam", true, "net/http", false, function(StreamID_, BlockFragment_, EndStream_, EndHeaders_, PadLength_, Priority_) { this.$val = this; if (arguments.length === 0) { this.StreamID = 0; this.BlockFragment = sliceType$3.nil; this.EndStream = false; this.EndHeaders = false; this.PadLength = 0; this.Priority = new http2PriorityParam.ptr(0, false, 0); return; } this.StreamID = StreamID_; this.BlockFragment = BlockFragment_; this.EndStream = EndStream_; this.EndHeaders = EndHeaders_; this.PadLength = PadLength_; this.Priority = Priority_; }); http2PriorityFrame = $pkg.http2PriorityFrame = $newType(0, $kindStruct, "http.http2PriorityFrame", true, "net/http", false, function(http2FrameHeader_, http2PriorityParam_) { this.$val = this; if (arguments.length === 0) { this.http2FrameHeader = new http2FrameHeader.ptr(false, 0, 0, 0, 0); this.http2PriorityParam = new http2PriorityParam.ptr(0, false, 0); return; } this.http2FrameHeader = http2FrameHeader_; this.http2PriorityParam = http2PriorityParam_; }); http2PriorityParam = $pkg.http2PriorityParam = $newType(0, $kindStruct, "http.http2PriorityParam", true, "net/http", false, function(StreamDep_, Exclusive_, Weight_) { this.$val = this; if (arguments.length === 0) { this.StreamDep = 0; this.Exclusive = false; this.Weight = 0; return; } this.StreamDep = StreamDep_; this.Exclusive = Exclusive_; this.Weight = Weight_; }); http2RSTStreamFrame = $pkg.http2RSTStreamFrame = $newType(0, $kindStruct, "http.http2RSTStreamFrame", true, "net/http", false, function(http2FrameHeader_, ErrCode_) { this.$val = this; if (arguments.length === 0) { this.http2FrameHeader = new http2FrameHeader.ptr(false, 0, 0, 0, 0); this.ErrCode = 0; return; } this.http2FrameHeader = http2FrameHeader_; this.ErrCode = ErrCode_; }); http2ContinuationFrame = $pkg.http2ContinuationFrame = $newType(0, $kindStruct, "http.http2ContinuationFrame", true, "net/http", false, function(http2FrameHeader_, headerFragBuf_) { this.$val = this; if (arguments.length === 0) { this.http2FrameHeader = new http2FrameHeader.ptr(false, 0, 0, 0, 0); this.headerFragBuf = sliceType$3.nil; return; } this.http2FrameHeader = http2FrameHeader_; this.headerFragBuf = headerFragBuf_; }); http2PushPromiseFrame = $pkg.http2PushPromiseFrame = $newType(0, $kindStruct, "http.http2PushPromiseFrame", true, "net/http", false, function(http2FrameHeader_, PromiseID_, headerFragBuf_) { this.$val = this; if (arguments.length === 0) { this.http2FrameHeader = new http2FrameHeader.ptr(false, 0, 0, 0, 0); this.PromiseID = 0; this.headerFragBuf = sliceType$3.nil; return; } this.http2FrameHeader = http2FrameHeader_; this.PromiseID = PromiseID_; this.headerFragBuf = headerFragBuf_; }); http2PushPromiseParam = $pkg.http2PushPromiseParam = $newType(0, $kindStruct, "http.http2PushPromiseParam", true, "net/http", false, function(StreamID_, PromiseID_, BlockFragment_, EndHeaders_, PadLength_) { this.$val = this; if (arguments.length === 0) { this.StreamID = 0; this.PromiseID = 0; this.BlockFragment = sliceType$3.nil; this.EndHeaders = false; this.PadLength = 0; return; } this.StreamID = StreamID_; this.PromiseID = PromiseID_; this.BlockFragment = BlockFragment_; this.EndHeaders = EndHeaders_; this.PadLength = PadLength_; }); http2MetaHeadersFrame = $pkg.http2MetaHeadersFrame = $newType(0, $kindStruct, "http.http2MetaHeadersFrame", true, "net/http", false, function(http2HeadersFrame_, Fields_, Truncated_) { this.$val = this; if (arguments.length === 0) { this.http2HeadersFrame = ptrType$75.nil; this.Fields = sliceType$22.nil; this.Truncated = false; return; } this.http2HeadersFrame = http2HeadersFrame_; this.Fields = Fields_; this.Truncated = Truncated_; }); http2goroutineLock = $pkg.http2goroutineLock = $newType(8, $kindUint64, "http.http2goroutineLock", true, "net/http", false, null); http2streamState = $pkg.http2streamState = $newType(4, $kindInt, "http.http2streamState", true, "net/http", false, null); http2Setting = $pkg.http2Setting = $newType(0, $kindStruct, "http.http2Setting", true, "net/http", false, function(ID_, Val_) { this.$val = this; if (arguments.length === 0) { this.ID = 0; this.Val = 0; return; } this.ID = ID_; this.Val = Val_; }); http2SettingID = $pkg.http2SettingID = $newType(2, $kindUint16, "http.http2SettingID", true, "net/http", false, null); http2gate = $pkg.http2gate = $newType(4, $kindChan, "http.http2gate", true, "net/http", false, null); http2closeWaiter = $pkg.http2closeWaiter = $newType(4, $kindChan, "http.http2closeWaiter", true, "net/http", false, null); http2bufferedWriter = $pkg.http2bufferedWriter = $newType(0, $kindStruct, "http.http2bufferedWriter", true, "net/http", false, function(_$0_, w_, bw_) { this.$val = this; if (arguments.length === 0) { this._$0 = arrayType.zero(); this.w = $ifaceNil; this.bw = ptrType$14.nil; return; } this._$0 = _$0_; this.w = w_; this.bw = bw_; }); http2httpError = $pkg.http2httpError = $newType(0, $kindStruct, "http.http2httpError", true, "net/http", false, function(_$0_, msg_, timeout_) { this.$val = this; if (arguments.length === 0) { this._$0 = arrayType.zero(); this.msg = ""; this.timeout = false; return; } this._$0 = _$0_; this.msg = msg_; this.timeout = timeout_; }); http2connectionStater = $pkg.http2connectionStater = $newType(8, $kindInterface, "http.http2connectionStater", true, "net/http", false, null); http2sorter = $pkg.http2sorter = $newType(0, $kindStruct, "http.http2sorter", true, "net/http", false, function(v_) { this.$val = this; if (arguments.length === 0) { this.v = sliceType$2.nil; return; } this.v = v_; }); http2incomparable = $pkg.http2incomparable = $newType(0, $kindArray, "http.http2incomparable", true, "net/http", false, null); http2pipe = $pkg.http2pipe = $newType(0, $kindStruct, "http.http2pipe", true, "net/http", false, function(mu_, c_, b_, unread_, err_, breakErr_, donec_, readFn_) { this.$val = this; if (arguments.length === 0) { this.mu = new sync.Mutex.ptr(0, 0); this.c = new sync.Cond.ptr(new sync.noCopy.ptr(), $ifaceNil, new sync.notifyList.ptr(0, 0, 0, 0, 0), 0, 0, $chanNil); this.b = $ifaceNil; this.unread = 0; this.err = $ifaceNil; this.breakErr = $ifaceNil; this.donec = $chanNil; this.readFn = $throwNilPointerError; return; } this.mu = mu_; this.c = c_; this.b = b_; this.unread = unread_; this.err = err_; this.breakErr = breakErr_; this.donec = donec_; this.readFn = readFn_; }); http2pipeBuffer = $pkg.http2pipeBuffer = $newType(8, $kindInterface, "http.http2pipeBuffer", true, "net/http", false, null); http2Server = $pkg.http2Server = $newType(0, $kindStruct, "http.http2Server", true, "net/http", false, function(MaxHandlers_, MaxConcurrentStreams_, MaxReadFrameSize_, PermitProhibitedCipherSuites_, IdleTimeout_, MaxUploadBufferPerConnection_, MaxUploadBufferPerStream_, NewWriteScheduler_, state_) { this.$val = this; if (arguments.length === 0) { this.MaxHandlers = 0; this.MaxConcurrentStreams = 0; this.MaxReadFrameSize = 0; this.PermitProhibitedCipherSuites = false; this.IdleTimeout = new time.Duration(0, 0); this.MaxUploadBufferPerConnection = 0; this.MaxUploadBufferPerStream = 0; this.NewWriteScheduler = $throwNilPointerError; this.state = ptrType$60.nil; return; } this.MaxHandlers = MaxHandlers_; this.MaxConcurrentStreams = MaxConcurrentStreams_; this.MaxReadFrameSize = MaxReadFrameSize_; this.PermitProhibitedCipherSuites = PermitProhibitedCipherSuites_; this.IdleTimeout = IdleTimeout_; this.MaxUploadBufferPerConnection = MaxUploadBufferPerConnection_; this.MaxUploadBufferPerStream = MaxUploadBufferPerStream_; this.NewWriteScheduler = NewWriteScheduler_; this.state = state_; }); http2serverInternalState = $pkg.http2serverInternalState = $newType(0, $kindStruct, "http.http2serverInternalState", true, "net/http", false, function(mu_, activeConns_) { this.$val = this; if (arguments.length === 0) { this.mu = new sync.Mutex.ptr(0, 0); this.activeConns = false; return; } this.mu = mu_; this.activeConns = activeConns_; }); http2ServeConnOpts = $pkg.http2ServeConnOpts = $newType(0, $kindStruct, "http.http2ServeConnOpts", true, "net/http", false, function(Context_, BaseConfig_, Handler_) { this.$val = this; if (arguments.length === 0) { this.Context = $ifaceNil; this.BaseConfig = ptrType$46.nil; this.Handler = $ifaceNil; return; } this.Context = Context_; this.BaseConfig = BaseConfig_; this.Handler = Handler_; }); http2serverConn = $pkg.http2serverConn = $newType(0, $kindStruct, "http.http2serverConn", true, "net/http", false, function(srv_, hs_, conn_, bw_, handler_, baseCtx_, framer_, doneServing_, readFrameCh_, wantWriteFrameCh_, wroteFrameCh_, bodyReadCh_, serveMsgCh_, flow_, inflow_, tlsState_, remoteAddrStr_, writeSched_, serveG_, pushEnabled_, sawFirstSettings_, needToSendSettingsAck_, unackedSettings_, queuedControlFrames_, clientMaxStreams_, advMaxStreams_, curClientStreams_, curPushedStreams_, maxClientStreamID_, maxPushPromiseID_, streams_, initialStreamSendWindowSize_, maxFrameSize_, headerTableSize_, peerMaxHeaderListSize_, canonHeader_, writingFrame_, writingFrameAsync_, needsFrameFlush_, inGoAway_, inFrameScheduleLoop_, needToSendGoAway_, goAwayCode_, shutdownTimer_, idleTimer_, headerWriteBuf_, hpackEncoder_, shutdownOnce_) { this.$val = this; if (arguments.length === 0) { this.srv = ptrType$86.nil; this.hs = ptrType$46.nil; this.conn = $ifaceNil; this.bw = ptrType$88.nil; this.handler = $ifaceNil; this.baseCtx = $ifaceNil; this.framer = ptrType$72.nil; this.doneServing = $chanNil; this.readFrameCh = $chanNil; this.wantWriteFrameCh = $chanNil; this.wroteFrameCh = $chanNil; this.bodyReadCh = $chanNil; this.serveMsgCh = $chanNil; this.flow = new http2flow.ptr(arrayType.zero(), 0, ptrType$71.nil); this.inflow = new http2flow.ptr(arrayType.zero(), 0, ptrType$71.nil); this.tlsState = ptrType$28.nil; this.remoteAddrStr = ""; this.writeSched = $ifaceNil; this.serveG = new http2goroutineLock(0, 0); this.pushEnabled = false; this.sawFirstSettings = false; this.needToSendSettingsAck = false; this.unackedSettings = 0; this.queuedControlFrames = 0; this.clientMaxStreams = 0; this.advMaxStreams = 0; this.curClientStreams = 0; this.curPushedStreams = 0; this.maxClientStreamID = 0; this.maxPushPromiseID = 0; this.streams = false; this.initialStreamSendWindowSize = 0; this.maxFrameSize = 0; this.headerTableSize = 0; this.peerMaxHeaderListSize = 0; this.canonHeader = false; this.writingFrame = false; this.writingFrameAsync = false; this.needsFrameFlush = false; this.inGoAway = false; this.inFrameScheduleLoop = false; this.needToSendGoAway = false; this.goAwayCode = 0; this.shutdownTimer = ptrType$25.nil; this.idleTimer = ptrType$25.nil; this.headerWriteBuf = new bytes.Buffer.ptr(sliceType$3.nil, 0, 0); this.hpackEncoder = ptrType$89.nil; this.shutdownOnce = new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)); return; } this.srv = srv_; this.hs = hs_; this.conn = conn_; this.bw = bw_; this.handler = handler_; this.baseCtx = baseCtx_; this.framer = framer_; this.doneServing = doneServing_; this.readFrameCh = readFrameCh_; this.wantWriteFrameCh = wantWriteFrameCh_; this.wroteFrameCh = wroteFrameCh_; this.bodyReadCh = bodyReadCh_; this.serveMsgCh = serveMsgCh_; this.flow = flow_; this.inflow = inflow_; this.tlsState = tlsState_; this.remoteAddrStr = remoteAddrStr_; this.writeSched = writeSched_; this.serveG = serveG_; this.pushEnabled = pushEnabled_; this.sawFirstSettings = sawFirstSettings_; this.needToSendSettingsAck = needToSendSettingsAck_; this.unackedSettings = unackedSettings_; this.queuedControlFrames = queuedControlFrames_; this.clientMaxStreams = clientMaxStreams_; this.advMaxStreams = advMaxStreams_; this.curClientStreams = curClientStreams_; this.curPushedStreams = curPushedStreams_; this.maxClientStreamID = maxClientStreamID_; this.maxPushPromiseID = maxPushPromiseID_; this.streams = streams_; this.initialStreamSendWindowSize = initialStreamSendWindowSize_; this.maxFrameSize = maxFrameSize_; this.headerTableSize = headerTableSize_; this.peerMaxHeaderListSize = peerMaxHeaderListSize_; this.canonHeader = canonHeader_; this.writingFrame = writingFrame_; this.writingFrameAsync = writingFrameAsync_; this.needsFrameFlush = needsFrameFlush_; this.inGoAway = inGoAway_; this.inFrameScheduleLoop = inFrameScheduleLoop_; this.needToSendGoAway = needToSendGoAway_; this.goAwayCode = goAwayCode_; this.shutdownTimer = shutdownTimer_; this.idleTimer = idleTimer_; this.headerWriteBuf = headerWriteBuf_; this.hpackEncoder = hpackEncoder_; this.shutdownOnce = shutdownOnce_; }); http2stream = $pkg.http2stream = $newType(0, $kindStruct, "http.http2stream", true, "net/http", false, function(sc_, id_, body_, cw_, ctx_, cancelCtx_, bodyBytes_, declBodyBytes_, flow_, inflow_, state_, resetQueued_, gotTrailerHeader_, wroteHeaders_, writeDeadline_, trailer_, reqTrailer_) { this.$val = this; if (arguments.length === 0) { this.sc = ptrType$13.nil; this.id = 0; this.body = ptrType$97.nil; this.cw = $chanNil; this.ctx = $ifaceNil; this.cancelCtx = $throwNilPointerError; this.bodyBytes = new $Int64(0, 0); this.declBodyBytes = new $Int64(0, 0); this.flow = new http2flow.ptr(arrayType.zero(), 0, ptrType$71.nil); this.inflow = new http2flow.ptr(arrayType.zero(), 0, ptrType$71.nil); this.state = 0; this.resetQueued = false; this.gotTrailerHeader = false; this.wroteHeaders = false; this.writeDeadline = ptrType$25.nil; this.trailer = false; this.reqTrailer = false; return; } this.sc = sc_; this.id = id_; this.body = body_; this.cw = cw_; this.ctx = ctx_; this.cancelCtx = cancelCtx_; this.bodyBytes = bodyBytes_; this.declBodyBytes = declBodyBytes_; this.flow = flow_; this.inflow = inflow_; this.state = state_; this.resetQueued = resetQueued_; this.gotTrailerHeader = gotTrailerHeader_; this.wroteHeaders = wroteHeaders_; this.writeDeadline = writeDeadline_; this.trailer = trailer_; this.reqTrailer = reqTrailer_; }); http2readFrameResult = $pkg.http2readFrameResult = $newType(0, $kindStruct, "http.http2readFrameResult", true, "net/http", false, function(f_, err_, readMore_) { this.$val = this; if (arguments.length === 0) { this.f = $ifaceNil; this.err = $ifaceNil; this.readMore = $throwNilPointerError; return; } this.f = f_; this.err = err_; this.readMore = readMore_; }); http2frameWriteResult = $pkg.http2frameWriteResult = $newType(0, $kindStruct, "http.http2frameWriteResult", true, "net/http", false, function(_$0_, wr_, err_) { this.$val = this; if (arguments.length === 0) { this._$0 = arrayType.zero(); this.wr = new http2FrameWriteRequest.ptr($ifaceNil, ptrType$10.nil, $chanNil); this.err = $ifaceNil; return; } this._$0 = _$0_; this.wr = wr_; this.err = err_; }); http2serverMessage = $pkg.http2serverMessage = $newType(4, $kindInt, "http.http2serverMessage", true, "net/http", false, null); http2requestParam = $pkg.http2requestParam = $newType(0, $kindStruct, "http.http2requestParam", true, "net/http", false, function(method_, scheme_, authority_, path_, header_) { this.$val = this; if (arguments.length === 0) { this.method = ""; this.scheme = ""; this.authority = ""; this.path = ""; this.header = false; return; } this.method = method_; this.scheme = scheme_; this.authority = authority_; this.path = path_; this.header = header_; }); http2bodyReadMsg = $pkg.http2bodyReadMsg = $newType(0, $kindStruct, "http.http2bodyReadMsg", true, "net/http", false, function(st_, n_) { this.$val = this; if (arguments.length === 0) { this.st = ptrType$10.nil; this.n = 0; return; } this.st = st_; this.n = n_; }); http2requestBody = $pkg.http2requestBody = $newType(0, $kindStruct, "http.http2requestBody", true, "net/http", false, function(_$0_, stream_, conn_, closed_, sawEOF_, pipe_, needsContinue_) { this.$val = this; if (arguments.length === 0) { this._$0 = arrayType.zero(); this.stream = ptrType$10.nil; this.conn = ptrType$13.nil; this.closed = false; this.sawEOF = false; this.pipe = ptrType$97.nil; this.needsContinue = false; return; } this._$0 = _$0_; this.stream = stream_; this.conn = conn_; this.closed = closed_; this.sawEOF = sawEOF_; this.pipe = pipe_; this.needsContinue = needsContinue_; }); http2responseWriter = $pkg.http2responseWriter = $newType(0, $kindStruct, "http.http2responseWriter", true, "net/http", false, function(rws_) { this.$val = this; if (arguments.length === 0) { this.rws = ptrType$99.nil; return; } this.rws = rws_; }); http2responseWriterState = $pkg.http2responseWriterState = $newType(0, $kindStruct, "http.http2responseWriterState", true, "net/http", false, function(stream_, req_, body_, conn_, bw_, handlerHeader_, snapHeader_, trailers_, status_, wroteHeader_, sentHeader_, handlerDone_, dirty_, sentContentLen_, wroteBytes_, closeNotifierMu_, closeNotifierCh_) { this.$val = this; if (arguments.length === 0) { this.stream = ptrType$10.nil; this.req = ptrType$11.nil; this.body = ptrType$12.nil; this.conn = ptrType$13.nil; this.bw = ptrType$14.nil; this.handlerHeader = false; this.snapHeader = false; this.trailers = sliceType$2.nil; this.status = 0; this.wroteHeader = false; this.sentHeader = false; this.handlerDone = false; this.dirty = false; this.sentContentLen = new $Int64(0, 0); this.wroteBytes = new $Int64(0, 0); this.closeNotifierMu = new sync.Mutex.ptr(0, 0); this.closeNotifierCh = $chanNil; return; } this.stream = stream_; this.req = req_; this.body = body_; this.conn = conn_; this.bw = bw_; this.handlerHeader = handlerHeader_; this.snapHeader = snapHeader_; this.trailers = trailers_; this.status = status_; this.wroteHeader = wroteHeader_; this.sentHeader = sentHeader_; this.handlerDone = handlerDone_; this.dirty = dirty_; this.sentContentLen = sentContentLen_; this.wroteBytes = wroteBytes_; this.closeNotifierMu = closeNotifierMu_; this.closeNotifierCh = closeNotifierCh_; }); http2chunkWriter = $pkg.http2chunkWriter = $newType(0, $kindStruct, "http.http2chunkWriter", true, "net/http", false, function(rws_) { this.$val = this; if (arguments.length === 0) { this.rws = ptrType$99.nil; return; } this.rws = rws_; }); http2startPushRequest = $pkg.http2startPushRequest = $newType(0, $kindStruct, "http.http2startPushRequest", true, "net/http", false, function(parent_, method_, url_, header_, done_) { this.$val = this; if (arguments.length === 0) { this.parent = ptrType$10.nil; this.method = ""; this.url = ptrType$17.nil; this.header = false; this.done = $chanNil; return; } this.parent = parent_; this.method = method_; this.url = url_; this.header = header_; this.done = done_; }); http2Transport = $pkg.http2Transport = $newType(0, $kindStruct, "http.http2Transport", true, "net/http", false, function(DialTLS_, TLSClientConfig_, ConnPool_, DisableCompression_, AllowHTTP_, MaxHeaderListSize_, StrictMaxConcurrentStreams_, ReadIdleTimeout_, PingTimeout_, t1_, connPoolOnce_, connPoolOrDef_) { this.$val = this; if (arguments.length === 0) { this.DialTLS = $throwNilPointerError; this.TLSClientConfig = ptrType$4.nil; this.ConnPool = $ifaceNil; this.DisableCompression = false; this.AllowHTTP = false; this.MaxHeaderListSize = 0; this.StrictMaxConcurrentStreams = false; this.ReadIdleTimeout = new time.Duration(0, 0); this.PingTimeout = new time.Duration(0, 0); this.t1 = ptrType$27.nil; this.connPoolOnce = new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)); this.connPoolOrDef = $ifaceNil; return; } this.DialTLS = DialTLS_; this.TLSClientConfig = TLSClientConfig_; this.ConnPool = ConnPool_; this.DisableCompression = DisableCompression_; this.AllowHTTP = AllowHTTP_; this.MaxHeaderListSize = MaxHeaderListSize_; this.StrictMaxConcurrentStreams = StrictMaxConcurrentStreams_; this.ReadIdleTimeout = ReadIdleTimeout_; this.PingTimeout = PingTimeout_; this.t1 = t1_; this.connPoolOnce = connPoolOnce_; this.connPoolOrDef = connPoolOrDef_; }); http2ClientConn = $pkg.http2ClientConn = $newType(0, $kindStruct, "http.http2ClientConn", true, "net/http", false, function(t_, tconn_, tlsState_, reused_, singleUse_, readerDone_, readerErr_, idleTimeout_, idleTimer_, mu_, cond_, flow_, inflow_, closing_, closed_, wantSettingsAck_, goAway_, goAwayDebug_, streams_, nextStreamID_, pendingRequests_, pings_, bw_, br_, fr_, lastActive_, lastIdle_, maxFrameSize_, maxConcurrentStreams_, peerMaxHeaderListSize_, initialWindowSize_, hbuf_, henc_, freeBuf_, wmu_, werr_) { this.$val = this; if (arguments.length === 0) { this.t = ptrType$102.nil; this.tconn = $ifaceNil; this.tlsState = ptrType$28.nil; this.reused = 0; this.singleUse = false; this.readerDone = $chanNil; this.readerErr = $ifaceNil; this.idleTimeout = new time.Duration(0, 0); this.idleTimer = ptrType$25.nil; this.mu = new sync.Mutex.ptr(0, 0); this.cond = ptrType$48.nil; this.flow = new http2flow.ptr(arrayType.zero(), 0, ptrType$71.nil); this.inflow = new http2flow.ptr(arrayType.zero(), 0, ptrType$71.nil); this.closing = false; this.closed = false; this.wantSettingsAck = false; this.goAway = ptrType$82.nil; this.goAwayDebug = ""; this.streams = false; this.nextStreamID = 0; this.pendingRequests = 0; this.pings = false; this.bw = ptrType$14.nil; this.br = ptrType$29.nil; this.fr = ptrType$72.nil; this.lastActive = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil); this.lastIdle = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil); this.maxFrameSize = 0; this.maxConcurrentStreams = 0; this.peerMaxHeaderListSize = new $Uint64(0, 0); this.initialWindowSize = 0; this.hbuf = new bytes.Buffer.ptr(sliceType$3.nil, 0, 0); this.henc = ptrType$89.nil; this.freeBuf = sliceType$5.nil; this.wmu = new sync.Mutex.ptr(0, 0); this.werr = $ifaceNil; return; } this.t = t_; this.tconn = tconn_; this.tlsState = tlsState_; this.reused = reused_; this.singleUse = singleUse_; this.readerDone = readerDone_; this.readerErr = readerErr_; this.idleTimeout = idleTimeout_; this.idleTimer = idleTimer_; this.mu = mu_; this.cond = cond_; this.flow = flow_; this.inflow = inflow_; this.closing = closing_; this.closed = closed_; this.wantSettingsAck = wantSettingsAck_; this.goAway = goAway_; this.goAwayDebug = goAwayDebug_; this.streams = streams_; this.nextStreamID = nextStreamID_; this.pendingRequests = pendingRequests_; this.pings = pings_; this.bw = bw_; this.br = br_; this.fr = fr_; this.lastActive = lastActive_; this.lastIdle = lastIdle_; this.maxFrameSize = maxFrameSize_; this.maxConcurrentStreams = maxConcurrentStreams_; this.peerMaxHeaderListSize = peerMaxHeaderListSize_; this.initialWindowSize = initialWindowSize_; this.hbuf = hbuf_; this.henc = henc_; this.freeBuf = freeBuf_; this.wmu = wmu_; this.werr = werr_; }); http2clientStream = $pkg.http2clientStream = $newType(0, $kindStruct, "http.http2clientStream", true, "net/http", false, function(cc_, req_, trace_, ID_, resc_, bufPipe_, startedWrite_, requestedGzip_, on100_, flow_, inflow_, bytesRemain_, readErr_, stopReqBody_, didReset_, peerReset_, resetErr_, done_, firstByte_, pastHeaders_, pastTrailers_, num1xx_, trailer_, resTrailer_) { this.$val = this; if (arguments.length === 0) { this.cc = ptrType$68.nil; this.req = ptrType$11.nil; this.trace = ptrType$19.nil; this.ID = 0; this.resc = $chanNil; this.bufPipe = new http2pipe.ptr(new sync.Mutex.ptr(0, 0), new sync.Cond.ptr(new sync.noCopy.ptr(), $ifaceNil, new sync.notifyList.ptr(0, 0, 0, 0, 0), 0, 0, $chanNil), $ifaceNil, 0, $ifaceNil, $ifaceNil, $chanNil, $throwNilPointerError); this.startedWrite = false; this.requestedGzip = false; this.on100 = $throwNilPointerError; this.flow = new http2flow.ptr(arrayType.zero(), 0, ptrType$71.nil); this.inflow = new http2flow.ptr(arrayType.zero(), 0, ptrType$71.nil); this.bytesRemain = new $Int64(0, 0); this.readErr = $ifaceNil; this.stopReqBody = $ifaceNil; this.didReset = false; this.peerReset = $chanNil; this.resetErr = $ifaceNil; this.done = $chanNil; this.firstByte = false; this.pastHeaders = false; this.pastTrailers = false; this.num1xx = 0; this.trailer = false; this.resTrailer = ptrType$38.nil; return; } this.cc = cc_; this.req = req_; this.trace = trace_; this.ID = ID_; this.resc = resc_; this.bufPipe = bufPipe_; this.startedWrite = startedWrite_; this.requestedGzip = requestedGzip_; this.on100 = on100_; this.flow = flow_; this.inflow = inflow_; this.bytesRemain = bytesRemain_; this.readErr = readErr_; this.stopReqBody = stopReqBody_; this.didReset = didReset_; this.peerReset = peerReset_; this.resetErr = resetErr_; this.done = done_; this.firstByte = firstByte_; this.pastHeaders = pastHeaders_; this.pastTrailers = pastTrailers_; this.num1xx = num1xx_; this.trailer = trailer_; this.resTrailer = resTrailer_; }); http2stickyErrWriter = $pkg.http2stickyErrWriter = $newType(0, $kindStruct, "http.http2stickyErrWriter", true, "net/http", false, function(w_, err_) { this.$val = this; if (arguments.length === 0) { this.w = $ifaceNil; this.err = ptrType$85.nil; return; } this.w = w_; this.err = err_; }); http2noCachedConnError = $pkg.http2noCachedConnError = $newType(0, $kindStruct, "http.http2noCachedConnError", true, "net/http", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); http2RoundTripOpt = $pkg.http2RoundTripOpt = $newType(0, $kindStruct, "http.http2RoundTripOpt", true, "net/http", false, function(OnlyCachedConn_) { this.$val = this; if (arguments.length === 0) { this.OnlyCachedConn = false; return; } this.OnlyCachedConn = OnlyCachedConn_; }); http2clientConnIdleState = $pkg.http2clientConnIdleState = $newType(0, $kindStruct, "http.http2clientConnIdleState", true, "net/http", false, function(canTakeNewRequest_, freshConn_) { this.$val = this; if (arguments.length === 0) { this.canTakeNewRequest = false; this.freshConn = false; return; } this.canTakeNewRequest = canTakeNewRequest_; this.freshConn = freshConn_; }); http2resAndError = $pkg.http2resAndError = $newType(0, $kindStruct, "http.http2resAndError", true, "net/http", false, function(_$0_, res_, err_) { this.$val = this; if (arguments.length === 0) { this._$0 = arrayType.zero(); this.res = ptrType$18.nil; this.err = $ifaceNil; return; } this._$0 = _$0_; this.res = res_; this.err = err_; }); http2clientConnReadLoop = $pkg.http2clientConnReadLoop = $newType(0, $kindStruct, "http.http2clientConnReadLoop", true, "net/http", false, function(_$0_, cc_, closeWhenIdle_) { this.$val = this; if (arguments.length === 0) { this._$0 = arrayType.zero(); this.cc = ptrType$68.nil; this.closeWhenIdle = false; return; } this._$0 = _$0_; this.cc = cc_; this.closeWhenIdle = closeWhenIdle_; }); http2GoAwayError = $pkg.http2GoAwayError = $newType(0, $kindStruct, "http.http2GoAwayError", true, "net/http", false, function(LastStreamID_, ErrCode_, DebugData_) { this.$val = this; if (arguments.length === 0) { this.LastStreamID = 0; this.ErrCode = 0; this.DebugData = ""; return; } this.LastStreamID = LastStreamID_; this.ErrCode = ErrCode_; this.DebugData = DebugData_; }); http2transportResponseBody = $pkg.http2transportResponseBody = $newType(0, $kindStruct, "http.http2transportResponseBody", true, "net/http", false, function(cs_) { this.$val = this; if (arguments.length === 0) { this.cs = ptrType$104.nil; return; } this.cs = cs_; }); http2erringRoundTripper = $pkg.http2erringRoundTripper = $newType(0, $kindStruct, "http.http2erringRoundTripper", true, "net/http", false, function(err_) { this.$val = this; if (arguments.length === 0) { this.err = $ifaceNil; return; } this.err = err_; }); http2gzipReader = $pkg.http2gzipReader = $newType(0, $kindStruct, "http.http2gzipReader", true, "net/http", false, function(_$0_, body_, zr_, zerr_) { this.$val = this; if (arguments.length === 0) { this._$0 = arrayType.zero(); this.body = $ifaceNil; this.zr = ptrType$33.nil; this.zerr = $ifaceNil; return; } this._$0 = _$0_; this.body = body_; this.zr = zr_; this.zerr = zerr_; }); http2bodyWriterState = $pkg.http2bodyWriterState = $newType(0, $kindStruct, "http.http2bodyWriterState", true, "net/http", false, function(cs_, timer_, fnonce_, fn_, resc_, delay_) { this.$val = this; if (arguments.length === 0) { this.cs = ptrType$104.nil; this.timer = ptrType$25.nil; this.fnonce = ptrType$105.nil; this.fn = $throwNilPointerError; this.resc = $chanNil; this.delay = new time.Duration(0, 0); return; } this.cs = cs_; this.timer = timer_; this.fnonce = fnonce_; this.fn = fn_; this.resc = resc_; this.delay = delay_; }); http2noDialH2RoundTripper = $pkg.http2noDialH2RoundTripper = $newType(0, $kindStruct, "http.http2noDialH2RoundTripper", true, "net/http", false, function(http2Transport_) { this.$val = this; if (arguments.length === 0) { this.http2Transport = ptrType$102.nil; return; } this.http2Transport = http2Transport_; }); http2writeFramer = $pkg.http2writeFramer = $newType(8, $kindInterface, "http.http2writeFramer", true, "net/http", false, null); http2writeContext = $pkg.http2writeContext = $newType(8, $kindInterface, "http.http2writeContext", true, "net/http", false, null); http2flushFrameWriter = $pkg.http2flushFrameWriter = $newType(0, $kindStruct, "http.http2flushFrameWriter", true, "net/http", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); http2writeSettings = $pkg.http2writeSettings = $newType(12, $kindSlice, "http.http2writeSettings", true, "net/http", false, null); http2writeGoAway = $pkg.http2writeGoAway = $newType(0, $kindStruct, "http.http2writeGoAway", true, "net/http", false, function(maxStreamID_, code_) { this.$val = this; if (arguments.length === 0) { this.maxStreamID = 0; this.code = 0; return; } this.maxStreamID = maxStreamID_; this.code = code_; }); http2writeData = $pkg.http2writeData = $newType(0, $kindStruct, "http.http2writeData", true, "net/http", false, function(streamID_, p_, endStream_) { this.$val = this; if (arguments.length === 0) { this.streamID = 0; this.p = sliceType$3.nil; this.endStream = false; return; } this.streamID = streamID_; this.p = p_; this.endStream = endStream_; }); http2handlerPanicRST = $pkg.http2handlerPanicRST = $newType(0, $kindStruct, "http.http2handlerPanicRST", true, "net/http", false, function(StreamID_) { this.$val = this; if (arguments.length === 0) { this.StreamID = 0; return; } this.StreamID = StreamID_; }); http2writePingAck = $pkg.http2writePingAck = $newType(0, $kindStruct, "http.http2writePingAck", true, "net/http", false, function(pf_) { this.$val = this; if (arguments.length === 0) { this.pf = ptrType$81.nil; return; } this.pf = pf_; }); http2writeSettingsAck = $pkg.http2writeSettingsAck = $newType(0, $kindStruct, "http.http2writeSettingsAck", true, "net/http", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); http2writeResHeaders = $pkg.http2writeResHeaders = $newType(0, $kindStruct, "http.http2writeResHeaders", true, "net/http", false, function(streamID_, httpResCode_, h_, trailers_, endStream_, date_, contentType_, contentLength_) { this.$val = this; if (arguments.length === 0) { this.streamID = 0; this.httpResCode = 0; this.h = false; this.trailers = sliceType$2.nil; this.endStream = false; this.date = ""; this.contentType = ""; this.contentLength = ""; return; } this.streamID = streamID_; this.httpResCode = httpResCode_; this.h = h_; this.trailers = trailers_; this.endStream = endStream_; this.date = date_; this.contentType = contentType_; this.contentLength = contentLength_; }); http2writePushPromise = $pkg.http2writePushPromise = $newType(0, $kindStruct, "http.http2writePushPromise", true, "net/http", false, function(streamID_, method_, url_, h_, allocatePromisedID_, promisedID_) { this.$val = this; if (arguments.length === 0) { this.streamID = 0; this.method = ""; this.url = ptrType$17.nil; this.h = false; this.allocatePromisedID = $throwNilPointerError; this.promisedID = 0; return; } this.streamID = streamID_; this.method = method_; this.url = url_; this.h = h_; this.allocatePromisedID = allocatePromisedID_; this.promisedID = promisedID_; }); http2write100ContinueHeadersFrame = $pkg.http2write100ContinueHeadersFrame = $newType(0, $kindStruct, "http.http2write100ContinueHeadersFrame", true, "net/http", false, function(streamID_) { this.$val = this; if (arguments.length === 0) { this.streamID = 0; return; } this.streamID = streamID_; }); http2writeWindowUpdate = $pkg.http2writeWindowUpdate = $newType(0, $kindStruct, "http.http2writeWindowUpdate", true, "net/http", false, function(streamID_, n_) { this.$val = this; if (arguments.length === 0) { this.streamID = 0; this.n = 0; return; } this.streamID = streamID_; this.n = n_; }); http2WriteScheduler = $pkg.http2WriteScheduler = $newType(8, $kindInterface, "http.http2WriteScheduler", true, "net/http", false, null); http2OpenStreamOptions = $pkg.http2OpenStreamOptions = $newType(0, $kindStruct, "http.http2OpenStreamOptions", true, "net/http", false, function(PusherID_) { this.$val = this; if (arguments.length === 0) { this.PusherID = 0; return; } this.PusherID = PusherID_; }); http2FrameWriteRequest = $pkg.http2FrameWriteRequest = $newType(0, $kindStruct, "http.http2FrameWriteRequest", true, "net/http", false, function(write_, stream_, done_) { this.$val = this; if (arguments.length === 0) { this.write = $ifaceNil; this.stream = ptrType$10.nil; this.done = $chanNil; return; } this.write = write_; this.stream = stream_; this.done = done_; }); http2writeQueue = $pkg.http2writeQueue = $newType(0, $kindStruct, "http.http2writeQueue", true, "net/http", false, function(s_) { this.$val = this; if (arguments.length === 0) { this.s = sliceType$24.nil; return; } this.s = s_; }); http2writeQueuePool = $pkg.http2writeQueuePool = $newType(12, $kindSlice, "http.http2writeQueuePool", true, "net/http", false, null); http2PriorityWriteSchedulerConfig = $pkg.http2PriorityWriteSchedulerConfig = $newType(0, $kindStruct, "http.http2PriorityWriteSchedulerConfig", true, "net/http", false, function(MaxClosedNodesInTree_, MaxIdleNodesInTree_, ThrottleOutOfOrderWrites_) { this.$val = this; if (arguments.length === 0) { this.MaxClosedNodesInTree = 0; this.MaxIdleNodesInTree = 0; this.ThrottleOutOfOrderWrites = false; return; } this.MaxClosedNodesInTree = MaxClosedNodesInTree_; this.MaxIdleNodesInTree = MaxIdleNodesInTree_; this.ThrottleOutOfOrderWrites = ThrottleOutOfOrderWrites_; }); http2priorityNodeState = $pkg.http2priorityNodeState = $newType(4, $kindInt, "http.http2priorityNodeState", true, "net/http", false, null); http2priorityNode = $pkg.http2priorityNode = $newType(0, $kindStruct, "http.http2priorityNode", true, "net/http", false, function(q_, id_, weight_, state_, bytes_, subtreeBytes_, parent_, kids_, prev_, next_) { this.$val = this; if (arguments.length === 0) { this.q = new http2writeQueue.ptr(sliceType$24.nil); this.id = 0; this.weight = 0; this.state = 0; this.bytes = new $Int64(0, 0); this.subtreeBytes = new $Int64(0, 0); this.parent = ptrType$107.nil; this.kids = ptrType$107.nil; this.prev = ptrType$107.nil; this.next = ptrType$107.nil; return; } this.q = q_; this.id = id_; this.weight = weight_; this.state = state_; this.bytes = bytes_; this.subtreeBytes = subtreeBytes_; this.parent = parent_; this.kids = kids_; this.prev = prev_; this.next = next_; }); http2sortPriorityNodeSiblings = $pkg.http2sortPriorityNodeSiblings = $newType(12, $kindSlice, "http.http2sortPriorityNodeSiblings", true, "net/http", false, null); http2priorityWriteScheduler = $pkg.http2priorityWriteScheduler = $newType(0, $kindStruct, "http.http2priorityWriteScheduler", true, "net/http", false, function(root_, nodes_, maxID_, closedNodes_, idleNodes_, maxClosedNodesInTree_, maxIdleNodesInTree_, writeThrottleLimit_, enableWriteThrottle_, tmp_, queuePool_) { this.$val = this; if (arguments.length === 0) { this.root = new http2priorityNode.ptr(new http2writeQueue.ptr(sliceType$24.nil), 0, 0, 0, new $Int64(0, 0), new $Int64(0, 0), ptrType$107.nil, ptrType$107.nil, ptrType$107.nil, ptrType$107.nil); this.nodes = false; this.maxID = 0; this.closedNodes = sliceType$25.nil; this.idleNodes = sliceType$25.nil; this.maxClosedNodesInTree = 0; this.maxIdleNodesInTree = 0; this.writeThrottleLimit = 0; this.enableWriteThrottle = false; this.tmp = sliceType$25.nil; this.queuePool = http2writeQueuePool.nil; return; } this.root = root_; this.nodes = nodes_; this.maxID = maxID_; this.closedNodes = closedNodes_; this.idleNodes = idleNodes_; this.maxClosedNodesInTree = maxClosedNodesInTree_; this.maxIdleNodesInTree = maxIdleNodesInTree_; this.writeThrottleLimit = writeThrottleLimit_; this.enableWriteThrottle = enableWriteThrottle_; this.tmp = tmp_; this.queuePool = queuePool_; }); http2randomWriteScheduler = $pkg.http2randomWriteScheduler = $newType(0, $kindStruct, "http.http2randomWriteScheduler", true, "net/http", false, function(zero_, sq_, queuePool_) { this.$val = this; if (arguments.length === 0) { this.zero = new http2writeQueue.ptr(sliceType$24.nil); this.sq = false; this.queuePool = http2writeQueuePool.nil; return; } this.zero = zero_; this.sq = sq_; this.queuePool = queuePool_; }); noTransport = $pkg.noTransport = $newType(0, $kindStruct, "http.noTransport", true, "net/http", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); XHRTransport = $pkg.XHRTransport = $newType(0, $kindStruct, "http.XHRTransport", true, "net/http", true, function(inflight_) { this.$val = this; if (arguments.length === 0) { this.inflight = false; return; } this.inflight = inflight_; }); streamReader = $pkg.streamReader = $newType(0, $kindStruct, "http.streamReader", true, "net/http", false, function(pending_, stream_) { this.$val = this; if (arguments.length === 0) { this.pending = sliceType$3.nil; this.stream = null; return; } this.pending = pending_; this.stream = stream_; }); fetchTransport = $pkg.fetchTransport = $newType(0, $kindStruct, "http.fetchTransport", true, "net/http", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); Cookie = $pkg.Cookie = $newType(0, $kindStruct, "http.Cookie", true, "net/http", true, function(Name_, Value_, Path_, Domain_, Expires_, RawExpires_, MaxAge_, Secure_, HttpOnly_, SameSite_, Raw_, Unparsed_) { this.$val = this; if (arguments.length === 0) { this.Name = ""; this.Value = ""; this.Path = ""; this.Domain = ""; this.Expires = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil); this.RawExpires = ""; this.MaxAge = 0; this.Secure = false; this.HttpOnly = false; this.SameSite = 0; this.Raw = ""; this.Unparsed = sliceType$2.nil; return; } this.Name = Name_; this.Value = Value_; this.Path = Path_; this.Domain = Domain_; this.Expires = Expires_; this.RawExpires = RawExpires_; this.MaxAge = MaxAge_; this.Secure = Secure_; this.HttpOnly = HttpOnly_; this.SameSite = SameSite_; this.Raw = Raw_; this.Unparsed = Unparsed_; }); SameSite = $pkg.SameSite = $newType(4, $kindInt, "http.SameSite", true, "net/http", true, null); Client = $pkg.Client = $newType(0, $kindStruct, "http.Client", true, "net/http", true, function(Transport_, CheckRedirect_, Jar_, Timeout_) { this.$val = this; if (arguments.length === 0) { this.Transport = $ifaceNil; this.CheckRedirect = $throwNilPointerError; this.Jar = $ifaceNil; this.Timeout = new time.Duration(0, 0); return; } this.Transport = Transport_; this.CheckRedirect = CheckRedirect_; this.Jar = Jar_; this.Timeout = Timeout_; }); RoundTripper = $pkg.RoundTripper = $newType(8, $kindInterface, "http.RoundTripper", true, "net/http", true, null); cancelTimerBody = $pkg.cancelTimerBody = $newType(0, $kindStruct, "http.cancelTimerBody", true, "net/http", false, function(stop_, rc_, reqDidTimeout_) { this.$val = this; if (arguments.length === 0) { this.stop = $throwNilPointerError; this.rc = $ifaceNil; this.reqDidTimeout = $throwNilPointerError; return; } this.stop = stop_; this.rc = rc_; this.reqDidTimeout = reqDidTimeout_; }); requestTooLarger = $newType(8, $kindInterface, "http.requestTooLarger", true, "net/http", false, null); baseContexter = $newType(8, $kindInterface, "http.baseContexter", true, "net/http", false, null); I = $newType(8, $kindInterface, "http.I", true, "net/http", true, null); canceler = $newType(8, $kindInterface, "http.canceler", true, "net/http", false, null); closeIdler = $newType(8, $kindInterface, "http.closeIdler", true, "net/http", false, null); ptrType = $ptrType(time.Location); ptrType$1 = $ptrType(net.Resolver); sliceType = $sliceType($emptyInterface); sliceType$1 = $sliceType(muxEntry); ptrType$2 = $ptrType(sync.Mutex); ptrType$3 = $ptrType(list.List); ptrType$4 = $ptrType(tls.Config); sliceType$2 = $sliceType($String); sliceType$3 = $sliceType($Uint8); sliceType$4 = $sliceType(sniffSig); ptrType$6 = $ptrType(sliceType$3); sliceType$5 = $sliceType(sliceType$3); sliceType$6 = $sliceType(keyValues); ptrType$9 = $ptrType(http2clientConnPool); sliceType$7 = $sliceType($Int); funcType = $funcType([], [], false); arrayType = $arrayType(funcType, 0); ptrType$10 = $ptrType(http2stream); ptrType$11 = $ptrType(Request); ptrType$12 = $ptrType(http2requestBody); ptrType$13 = $ptrType(http2serverConn); ptrType$14 = $ptrType(bufio.Writer); ptrType$15 = $ptrType(http2serverMessage); chanType = $chanType($error, false, false); ptrType$16 = $ptrType(http2responseWriter); mapType = $mapType($String, RoundTripper); ptrType$17 = $ptrType(url.URL); ptrType$18 = $ptrType(Response); ptrType$19 = $ptrType(httptrace.ClientTrace); ptrType$20 = $ptrType(readTrackingBody); ptrType$21 = $ptrType(url.Userinfo); ptrType$22 = $ptrType(persistConn); ptrType$23 = $ptrType(list.Element); ptrType$24 = $ptrType(wantConn); sliceType$8 = $sliceType(ptrType$24); sliceType$9 = $sliceType(ptrType$22); ptrType$25 = $ptrType(time.Timer); structType = $structType("", []); ptrType$26 = $ptrType($packages["crypto/x509"].Certificate); sliceType$10 = $sliceType(ptrType$26); sliceType$11 = $sliceType(sliceType$10); ptrType$27 = $ptrType(Transport); ptrType$28 = $ptrType(tls.ConnectionState); ptrType$29 = $ptrType(bufio.Reader); ptrType$30 = $ptrType(tls.Conn); sliceType$12 = $sliceType(socksAuthMethod); ptrType$31 = $ptrType(multipart.Form); ptrType$32 = $ptrType(bodyEOFSignal); ptrType$33 = $ptrType(gzip.Reader); funcType$1 = $funcType([$String, sliceType], [], true); sliceType$13 = $sliceType(tls.Certificate); ptrType$34 = $ptrType($packages["crypto/x509"].CertPool); sliceType$14 = $sliceType($Uint16); arrayType$1 = $arrayType($Uint8, 32); sliceType$15 = $sliceType(tls.CurveID); sliceType$16 = $sliceType(tls.ticketKey); ptrType$35 = $ptrType(transferWriter); arrayType$2 = $arrayType($Uint8, 1); sliceType$17 = $sliceType(io.Reader); ptrType$36 = $ptrType(unsupportedTEError); ptrType$37 = $ptrType(io.LimitedReader); ptrType$38 = $ptrType(Header); ptrType$39 = $ptrType(bytes.Reader); ptrType$40 = $ptrType(bytes.Buffer); ptrType$41 = $ptrType(strings.Reader); ptrType$42 = $ptrType(socksAddr); ptrType$43 = $ptrType(socksConn); ptrType$44 = $ptrType(bufio.ReadWriter); ptrType$45 = $ptrType($Int32); ptrType$46 = $ptrType(Server); ptrType$47 = $ptrType(connReader); structType$1 = $structType("net/http", [{prop: "atomic", name: "atomic", embedded: false, exported: false, typ: $Uint64, tag: ""}]); ptrType$48 = $ptrType(sync.Cond); ptrType$49 = $ptrType(response); ptrType$50 = $ptrType(sync.Pool); ptrType$51 = $ptrType(atomicBool); ptrType$52 = $ptrType(body); ptrType$53 = $ptrType(conn); arrayType$3 = $arrayType($Uint8, 29); arrayType$4 = $arrayType($Uint8, 10); arrayType$5 = $arrayType($Uint8, 3); sliceType$18 = $sliceType($Uintptr); ptrType$54 = $ptrType(runtime.Func); ptrType$55 = $ptrType(expectContinueReader); ptrType$56 = $ptrType($Uint64); ptrType$57 = $ptrType(net.OpError); arrayType$6 = $arrayType($Uint8, 5); ptrType$58 = $ptrType(log.Logger); sliceType$19 = $sliceType(funcType); ptrType$59 = $ptrType(net.Listener); ptrType$60 = $ptrType(http2serverInternalState); ptrType$61 = $ptrType(http2PriorityWriteSchedulerConfig); structType$2 = $structType("", [{prop: "Reader", name: "Reader", embedded: true, exported: true, typ: io.Reader, tag: ""}, {prop: "Closer", name: "Closer", embedded: true, exported: true, typ: io.Closer, tag: ""}]); ptrType$62 = $ptrType(Cookie); ptrType$63 = $ptrType(multipart.Reader); ptrType$64 = $ptrType(textproto.Reader); ptrType$65 = $ptrType(maxBytesReader); ptrType$66 = $ptrType(multipart.FileHeader); sliceType$20 = $sliceType(ptrType$66); ptrType$67 = $ptrType(headerSorter); ptrType$68 = $ptrType(http2ClientConn); sliceType$21 = $sliceType(ptrType$68); ptrType$69 = $ptrType(http2dialCall); ptrType$70 = $ptrType(http2addConnCall); ptrType$71 = $ptrType(http2flow); ptrType$72 = $ptrType(http2Framer); ptrType$73 = $ptrType(http2frameCache); arrayType$7 = $arrayType($Uint8, 9); ptrType$74 = $ptrType(hpack.Decoder); ptrType$75 = $ptrType(http2HeadersFrame); arrayType$8 = $arrayType($Uint8, 8); sliceType$22 = $sliceType(hpack.HeaderField); ptrType$76 = $ptrType(http2MetaHeadersFrame); ptrType$77 = $ptrType(http2ContinuationFrame); ptrType$78 = $ptrType(http2SettingsFrame); ptrType$79 = $ptrType(http2DataFrame); ptrType$80 = $ptrType(http2WindowUpdateFrame); ptrType$81 = $ptrType(http2PingFrame); ptrType$82 = $ptrType(http2GoAwayFrame); ptrType$83 = $ptrType(http2RSTStreamFrame); ptrType$84 = $ptrType(net.Dialer); ptrType$85 = $ptrType($error); ptrType$86 = $ptrType(http2Server); ptrType$87 = $ptrType(http2ServeConnOpts); ptrType$88 = $ptrType(http2bufferedWriter); ptrType$89 = $ptrType(hpack.Encoder); ptrType$90 = $ptrType(os.SyscallError); funcType$2 = $funcType([$Int], [], false); ptrType$91 = $ptrType(http2startPushRequest); ptrType$92 = $ptrType(http2writeData); ptrType$93 = $ptrType(http2writeResHeaders); ptrType$94 = $ptrType(http2writePushPromise); ptrType$95 = $ptrType(http2PriorityFrame); ptrType$96 = $ptrType(http2PushPromiseFrame); ptrType$97 = $ptrType(http2pipe); ptrType$98 = $ptrType(http2closeWaiter); ptrType$99 = $ptrType(http2responseWriterState); ptrType$100 = $ptrType(http2sorter); ptrType$101 = $ptrType(PushOptions); ptrType$102 = $ptrType(http2Transport); interfaceType = $interfaceType([{prop: "IsHTTP2NoCachedConnError", name: "IsHTTP2NoCachedConnError", pkg: "", typ: $funcType([], [], false)}]); ptrType$103 = $ptrType($Uint32); sliceType$23 = $sliceType(http2Setting); ptrType$104 = $ptrType(http2clientStream); ptrType$105 = $ptrType(sync.Once); sliceType$24 = $sliceType(http2FrameWriteRequest); ptrType$106 = $ptrType(http2writeQueue); ptrType$107 = $ptrType(http2priorityNode); sliceType$25 = $sliceType(ptrType$107); ptrType$108 = $ptrType(http2writeQueuePool); ptrType$109 = $ptrType(sliceType$25); ptrType$110 = $ptrType(js.Object); funcType$3 = $funcType([ptrType$110], [], false); mapType$1 = $mapType($String, $emptyInterface); funcType$4 = $funcType([ptrType$110, ptrType$110], [], false); sliceType$29 = $sliceType(ptrType$62); ptrType$113 = $ptrType(strings.Builder); sliceType$30 = $sliceType(ptrType$11); ptrType$114 = $ptrType(url.Error); ptrType$115 = $ptrType(transportRequest); funcType$5 = $funcType([$error], [], false); mapType$2 = $mapType(connectMethodKey, sliceType$9); mapType$3 = $mapType(connectMethodKey, wantConnQueue); mapType$4 = $mapType(cancelKey, funcType$5); mapType$5 = $mapType(connectMethodKey, $Int); funcType$6 = $funcType([ptrType$11], [ptrType$17, $error], false); funcType$7 = $funcType([context.Context, $String, $String], [net.Conn, $error], false); funcType$8 = $funcType([$String, $String], [net.Conn, $error], false); funcType$9 = $funcType([$String, ptrType$30], [RoundTripper], false); mapType$6 = $mapType($String, funcType$9); funcType$10 = $funcType([context.Context, ptrType$17, $String], [Header, $error], false); chanType$1 = $chanType(structType, false, false); ptrType$116 = $ptrType(wantConnQueue); ptrType$117 = $ptrType(connectMethod); chanType$2 = $chanType(structType, false, true); funcType$11 = $funcType([], [$Bool], false); chanType$3 = $chanType(requestAndChan, false, false); chanType$4 = $chanType(writeRequest, false, false); funcType$12 = $funcType([Header], [], false); ptrType$118 = $ptrType(readWriteCloserBody); chanType$5 = $chanType(responseAndError, false, false); chanType$6 = $chanType(structType, true, false); chanType$7 = $chanType($error, true, false); ptrType$119 = $ptrType(httpError); funcType$13 = $funcType([$error], [$error], false); funcType$14 = $funcType([], [$error], false); ptrType$120 = $ptrType(gzipReader); ptrType$121 = $ptrType(connLRU); mapType$7 = $mapType(ptrType$22, ptrType$23); ptrType$122 = $ptrType(byteReader); chanType$8 = $chanType(readResult, false, false); ptrType$123 = $ptrType(transferReader); ptrType$124 = $ptrType(socksDialer); funcType$15 = $funcType([context.Context, io.ReadWriter, socksAuthMethod], [$error], false); ptrType$125 = $ptrType(socksUsernamePassword); ptrType$126 = $ptrType(exactSig); ptrType$127 = $ptrType(maskedSig); chanType$9 = $chanType($Bool, false, true); ptrType$128 = $ptrType(chunkWriter); chanType$10 = $chanType($Bool, false, false); ptrType$129 = $ptrType(redirectHandler); funcType$16 = $funcType([ResponseWriter, ptrType$11], [], false); ptrType$130 = $ptrType(ServeMux); mapType$8 = $mapType($String, muxEntry); funcType$17 = $funcType([ptrType$46, ptrType$30, Handler], [], false); mapType$9 = $mapType($String, funcType$17); funcType$18 = $funcType([net.Conn, ConnState], [], false); funcType$19 = $funcType([net.Listener], [context.Context], false); funcType$20 = $funcType([context.Context, net.Conn], [context.Context], false); mapType$10 = $mapType(ptrType$59, structType); mapType$11 = $mapType(ptrType$53, structType); ptrType$132 = $ptrType(onceCloseListener); ptrType$133 = $ptrType(loggingConn); ptrType$134 = $ptrType(ProtocolError); funcType$21 = $funcType([], [io.ReadCloser, $error], false); ptrType$135 = $ptrType(contextKey); mapType$12 = $mapType($String, $Bool); mapType$13 = $mapType($String, sliceType$21); mapType$14 = $mapType($String, ptrType$69); mapType$15 = $mapType(ptrType$68, sliceType$2); mapType$16 = $mapType($String, ptrType$70); ptrType$136 = $ptrType(http2dataBuffer); ptrType$137 = $ptrType(http2FrameHeader); funcType$22 = $funcType([$Uint32], [sliceType$3], false); funcType$23 = $funcType([http2Setting], [$error], false); ptrType$138 = $ptrType(http2UnknownFrame); ptrType$139 = $ptrType(http2httpError); funcType$24 = $funcType([], [http2WriteScheduler], false); mapType$17 = $mapType(ptrType$13, structType); chanType$11 = $chanType(http2readFrameResult, false, false); chanType$12 = $chanType(http2FrameWriteRequest, false, false); chanType$13 = $chanType(http2frameWriteResult, false, false); chanType$14 = $chanType(http2bodyReadMsg, false, false); chanType$15 = $chanType($emptyInterface, false, false); mapType$18 = $mapType($Uint32, ptrType$10); mapType$19 = $mapType($String, $String); funcType$25 = $funcType([$String, $String, ptrType$4], [net.Conn, $error], false); mapType$20 = $mapType($Uint32, ptrType$104); mapType$21 = $mapType(arrayType$8, chanType$1); funcType$26 = $funcType([$Int, textproto.MIMEHeader], [$error], false); chanType$16 = $chanType(http2resAndError, false, false); ptrType$140 = $ptrType(http2clientConnReadLoop); ptrType$141 = $ptrType(http2gzipReader); ptrType$142 = $ptrType(http2writeGoAway); funcType$27 = $funcType([], [$Uint32, $error], false); ptrType$143 = $ptrType(http2FrameWriteRequest); funcType$28 = $funcType([ptrType$107, $Bool], [$Bool], false); ptrType$144 = $ptrType(http2priorityWriteScheduler); mapType$22 = $mapType($Uint32, ptrType$107); ptrType$145 = $ptrType(http2randomWriteScheduler); mapType$23 = $mapType($Uint32, ptrType$106); ptrType$146 = $ptrType(XHRTransport); mapType$24 = $mapType(ptrType$11, ptrType$110); ptrType$147 = $ptrType(streamReader); ptrType$148 = $ptrType(fetchTransport); funcType$29 = $funcType([ptrType$11], [], false); ptrType$151 = $ptrType(Client); funcType$30 = $funcType([ptrType$11, sliceType$30], [$error], false); ptrType$152 = $ptrType(cancelTimerBody); Transport.ptr.prototype.writeBufferSize = function() { var t; t = this; if (t.WriteBufferSize > 0) { return t.WriteBufferSize; } return 4096; }; Transport.prototype.writeBufferSize = function() { return this.$val.writeBufferSize(); }; Transport.ptr.prototype.readBufferSize = function() { var t; t = this; if (t.ReadBufferSize > 0) { return t.ReadBufferSize; } return 4096; }; Transport.prototype.readBufferSize = function() { return this.$val.readBufferSize(); }; Transport.ptr.prototype.Clone = function() { var _entry, _i, _key, _keys, _r$1, _ref, k, npm, t, t2, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _i = $f._i; _key = $f._key; _keys = $f._keys; _r$1 = $f._r$1; _ref = $f._ref; k = $f.k; npm = $f.npm; t = $f.t; t2 = $f.t2; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; $r = t.nextProtoOnce.Do($methodVal(t, "onceSetNextProtoDefaults")); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } t2 = new Transport.ptr(new sync.Mutex.ptr(0, 0), false, false, false, new connLRU.ptr(ptrType$3.nil, false), new sync.Mutex.ptr(0, 0), false, new sync.Mutex.ptr(0, 0), new atomic.Value.ptr($ifaceNil), new sync.Mutex.ptr(0, 0), false, false, t.Proxy, t.DialContext, t.Dial, t.DialTLSContext, t.DialTLS, ptrType$4.nil, t.TLSHandshakeTimeout, t.DisableKeepAlives, t.DisableCompression, t.MaxIdleConns, t.MaxIdleConnsPerHost, t.MaxConnsPerHost, t.IdleConnTimeout, t.ResponseHeaderTimeout, t.ExpectContinueTimeout, false, new Header(t.ProxyConnectHeader).Clone(), t.GetProxyConnectHeader, t.MaxResponseHeaderBytes, t.WriteBufferSize, t.ReadBufferSize, new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)), $ifaceNil, false, t.ForceAttemptHTTP2); /* */ if (!(t.TLSClientConfig === ptrType$4.nil)) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!(t.TLSClientConfig === ptrType$4.nil)) { */ case 2: _r$1 = t.TLSClientConfig.Clone(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } t2.TLSClientConfig = _r$1; /* } */ case 3: if (!t.tlsNextProtoWasNil) { npm = $makeMap($String.keyFor, []); _ref = t.TLSNextProto; _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; _key = k; (npm || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: v }; _i++; } t2.TLSNextProto = npm; } $s = -1; return t2; /* */ } return; } if ($f === undefined) { $f = { $blk: Transport.ptr.prototype.Clone }; } $f._entry = _entry; $f._i = _i; $f._key = _key; $f._keys = _keys; $f._r$1 = _r$1; $f._ref = _ref; $f.k = k; $f.npm = npm; $f.t = t; $f.t2 = t2; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Transport.prototype.Clone = function() { return this.$val.Clone(); }; Transport.ptr.prototype.hasCustomTLSDialer = function() { var t; t = this; return !(t.DialTLS === $throwNilPointerError) || !(t.DialTLSContext === $throwNilPointerError); }; Transport.prototype.hasCustomTLSDialer = function() { return this.$val.hasCustomTLSDialer(); }; Transport.ptr.prototype.onceSetNextProtoDefaults = function() { var _entry, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _tuple, _tuple$1, _tuple$2, _v, _v$1, altProto, err, h2i, limit1, ok, rv, t, t2, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _v = $f._v; _v$1 = $f._v$1; altProto = $f.altProto; err = $f.err; h2i = $f.h2i; limit1 = $f.limit1; ok = $f.ok; rv = $f.rv; t = $f.t; t2 = $f.t2; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; t.tlsNextProtoWasNil = t.TLSNextProto === false; _r$1 = os.Getenv("GODEBUG"); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = strings.Contains(_r$1, "http2client=0"); /* */ $s = 4; case 4: 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: $s = -1; return; /* } */ case 2: _tuple = $assertType(t.altProto.Load(), mapType, true); altProto = _tuple[0]; _r$3 = reflect.ValueOf((_entry = altProto[$String.keyFor("https")], _entry !== undefined ? _entry.v : $ifaceNil)); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } rv = _r$3; if (!($clone(rv, reflect.Value).IsValid())) { _v$1 = false; $s = 9; continue s; } _r$4 = $clone(rv, reflect.Value).Type().Kind(); /* */ $s = 10; case 10: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _v$1 = _r$4 === 25; case 9: if (!(_v$1)) { _v = false; $s = 8; continue s; } _r$5 = $clone(rv, reflect.Value).Type().NumField(); /* */ $s = 11; case 11: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _v = _r$5 === 1; case 8: /* */ if (_v) { $s = 6; continue; } /* */ $s = 7; continue; /* if (_v) { */ case 6: _r$6 = $clone(rv, reflect.Value).Field(0); /* */ $s = 12; case 12: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } v = _r$6; /* */ if ($clone(v, reflect.Value).CanInterface()) { $s = 13; continue; } /* */ $s = 14; continue; /* if ($clone(v, reflect.Value).CanInterface()) { */ case 13: _r$7 = $clone(v, reflect.Value).Interface(); /* */ $s = 15; case 15: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _tuple$1 = $assertType(_r$7, h2Transport, true); h2i = _tuple$1[0]; ok = _tuple$1[1]; if (ok) { t.h2transport = h2i; $s = -1; return; } /* } */ case 14: /* } */ case 7: if (!(t.TLSNextProto === false)) { $s = -1; return; } if (!t.ForceAttemptHTTP2 && (!(t.TLSClientConfig === ptrType$4.nil) || !(t.Dial === $throwNilPointerError) || !(t.DialContext === $throwNilPointerError) || t.hasCustomTLSDialer())) { $s = -1; return; } if (omitBundledHTTP2) { $s = -1; return; } _r$8 = http2configureTransports(t); /* */ $s = 16; case 16: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _tuple$2 = _r$8; t2 = _tuple$2[0]; err = _tuple$2[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 17; continue; } /* */ $s = 18; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 17: $r = log.Printf("Error enabling Transport HTTP/2 support: %v", new sliceType([err])); /* */ $s = 19; case 19: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 18: t.h2transport = t2; limit1 = t.MaxResponseHeaderBytes; if (!((limit1.$high === 0 && limit1.$low === 0)) && (t2.MaxHeaderListSize === 0)) { if ((limit1.$high > 0 || (limit1.$high === 0 && limit1.$low >= 4294967295))) { t2.MaxHeaderListSize = 4294967295; } else { t2.MaxHeaderListSize = ((limit1.$low >>> 0)); } } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Transport.ptr.prototype.onceSetNextProtoDefaults }; } $f._entry = _entry; $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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._v = _v; $f._v$1 = _v$1; $f.altProto = altProto; $f.err = err; $f.h2i = h2i; $f.limit1 = limit1; $f.ok = ok; $f.rv = rv; $f.t = t; $f.t2 = t2; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Transport.prototype.onceSetNextProtoDefaults = function() { return this.$val.onceSetNextProtoDefaults(); }; transportRequest.ptr.prototype.extraHeaders = function() { var tr; tr = this; if (tr.extra === false) { tr.extra = {}; } return tr.extra; }; transportRequest.prototype.extraHeaders = function() { return this.$val.extraHeaders(); }; transportRequest.ptr.prototype.setError = function(err) { var err, tr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; tr = $f.tr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: tr = this; $r = tr.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if ($interfaceIsEqual(tr.err, $ifaceNil)) { tr.err = err; } $r = tr.mu.Unlock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: transportRequest.ptr.prototype.setError }; } $f.err = err; $f.tr = tr; $f.$s = $s; $f.$r = $r; return $f; }; transportRequest.prototype.setError = function(err) { return this.$val.setError(err); }; Transport.ptr.prototype.useRegisteredProtocol = function(req) { var _r$1, _v, req, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _v = $f._v; req = $f.req; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; if (!(req.URL.Scheme === "https")) { _v = false; $s = 3; continue s; } _r$1 = req.requiresHTTP1(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _v = _r$1; case 3: /* */ if (_v) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v) { */ case 1: $s = -1; return false; /* } */ case 2: $s = -1; return true; /* */ } return; } if ($f === undefined) { $f = { $blk: Transport.ptr.prototype.useRegisteredProtocol }; } $f._r$1 = _r$1; $f._v = _v; $f.req = req; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Transport.prototype.useRegisteredProtocol = function(req) { return this.$val.useRegisteredProtocol(req); }; Transport.ptr.prototype.alternateRoundTripper = function(req) { var _entry, _r$1, _tuple, altProto, req, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _r$1 = $f._r$1; _tuple = $f._tuple; altProto = $f.altProto; req = $f.req; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r$1 = t.useRegisteredProtocol(req); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (!_r$1) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!_r$1) { */ case 1: $s = -1; return $ifaceNil; /* } */ case 2: _tuple = $assertType(t.altProto.Load(), mapType, true); altProto = _tuple[0]; $s = -1; return (_entry = altProto[$String.keyFor(req.URL.Scheme)], _entry !== undefined ? _entry.v : $ifaceNil); /* */ } return; } if ($f === undefined) { $f = { $blk: Transport.ptr.prototype.alternateRoundTripper }; } $f._entry = _entry; $f._r$1 = _r$1; $f._tuple = _tuple; $f.altProto = altProto; $f.req = req; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Transport.prototype.alternateRoundTripper = function(req) { return this.$val.alternateRoundTripper(req); }; Transport.ptr.prototype.roundTrip = function(req) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, _entry, _i, _i$1, _keys, _r$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$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _ref$1, _selection, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, _v, altRT, cancelKey$1, cm, ctx, e, err, err$1, err$2, isHTTP, k, ok, origReq, pconn, req, resp, resp$1, scheme, t, trace, treq, v, vv, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; _entry = $f._entry; _i = $f._i; _i$1 = $f._i$1; _keys = $f._keys; _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$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$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; _selection = $f._selection; _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; _v = $f._v; altRT = $f.altRT; cancelKey$1 = $f.cancelKey$1; cm = $f.cm; ctx = $f.ctx; e = $f.e; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; isHTTP = $f.isHTTP; k = $f.k; ok = $f.ok; origReq = $f.origReq; pconn = $f.pconn; req = $f.req; resp = $f.resp; resp$1 = $f.resp$1; scheme = $f.scheme; t = $f.t; trace = $f.trace; treq = $f.treq; v = $f.v; vv = $f.vv; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; $r = t.nextProtoOnce.Do($methodVal(t, "onceSetNextProtoDefaults")); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } ctx = req.Context(); _r$1 = httptrace.ContextClientTrace(ctx); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } trace = _r$1; /* */ if (req.URL === ptrType$17.nil) { $s = 3; continue; } /* */ $s = 4; continue; /* if (req.URL === ptrType$17.nil) { */ case 3: _r$2 = req.closeBody(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; $s = -1; return [ptrType$18.nil, errors.New("http: nil Request.URL")]; /* } */ case 4: /* */ if (req.Header === false) { $s = 6; continue; } /* */ $s = 7; continue; /* if (req.Header === false) { */ case 6: _r$3 = req.closeBody(); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $s = -1; return [ptrType$18.nil, errors.New("http: nil Request.Header")]; /* } */ case 7: scheme = req.URL.Scheme; isHTTP = scheme === "http" || scheme === "https"; /* */ if (isHTTP) { $s = 9; continue; } /* */ $s = 10; continue; /* if (isHTTP) { */ case 9: _ref = req.Header; _i = 0; _keys = $keys(_ref); /* while (true) { */ case 11: /* if (!(_i < _keys.length)) { break; } */ if(!(_i < _keys.length)) { $s = 12; continue; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; /* continue; */ $s = 11; continue; } k = _entry.k; vv = _entry.v; /* */ if (!httpguts.ValidHeaderFieldName(k)) { $s = 13; continue; } /* */ $s = 14; continue; /* if (!httpguts.ValidHeaderFieldName(k)) { */ case 13: _r$4 = req.closeBody(); /* */ $s = 15; case 15: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; _r$5 = fmt.Errorf("net/http: invalid header field name %q", new sliceType([new $String(k)])); /* */ $s = 16; case 16: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $24r = [ptrType$18.nil, _r$5]; $s = 17; case 17: return $24r; /* } */ case 14: _ref$1 = vv; _i$1 = 0; /* while (true) { */ case 18: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 19; continue; } v = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); /* */ if (!httpguts.ValidHeaderFieldValue(v)) { $s = 20; continue; } /* */ $s = 21; continue; /* if (!httpguts.ValidHeaderFieldValue(v)) { */ case 20: _r$6 = req.closeBody(); /* */ $s = 22; case 22: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; _r$7 = fmt.Errorf("net/http: invalid header field value %q for key %v", new sliceType([new $String(v), new $String(k)])); /* */ $s = 23; case 23: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } $24r$1 = [ptrType$18.nil, _r$7]; $s = 24; case 24: return $24r$1; /* } */ case 21: _i$1++; $s = 18; continue; case 19: _i++; $s = 11; continue; case 12: /* } */ case 10: origReq = req; cancelKey$1 = new cancelKey.ptr(origReq); req = setupRewindBody(req); _r$8 = t.alternateRoundTripper(req); /* */ $s = 25; case 25: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } altRT = _r$8; /* */ if (!($interfaceIsEqual(altRT, $ifaceNil))) { $s = 26; continue; } /* */ $s = 27; continue; /* if (!($interfaceIsEqual(altRT, $ifaceNil))) { */ case 26: _r$9 = altRT.RoundTrip(req); /* */ $s = 28; case 28: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple = _r$9; resp = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $pkg.ErrSkipAltProtocol))) { $s = -1; return [resp, err]; } err$1 = $ifaceNil; _r$10 = rewindBody(req); /* */ $s = 29; case 29: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$1 = _r$10; req = _tuple$1[0]; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [ptrType$18.nil, err$1]; } /* } */ case 27: /* */ if (!isHTTP) { $s = 30; continue; } /* */ $s = 31; continue; /* if (!isHTTP) { */ case 30: _r$11 = req.closeBody(); /* */ $s = 32; case 32: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _r$11; _r$12 = badStringError("unsupported protocol scheme", scheme); /* */ $s = 33; case 33: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } $24r$2 = [ptrType$18.nil, _r$12]; $s = 34; case 34: return $24r$2; /* } */ case 31: if (!(!(req.Method === ""))) { _v = false; $s = 37; continue s; } _r$13 = validMethod(req.Method); /* */ $s = 38; case 38: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _v = !_r$13; case 37: /* */ if (_v) { $s = 35; continue; } /* */ $s = 36; continue; /* if (_v) { */ case 35: _r$14 = req.closeBody(); /* */ $s = 39; case 39: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _r$14; _r$15 = fmt.Errorf("net/http: invalid method %q", new sliceType([new $String(req.Method)])); /* */ $s = 40; case 40: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } $24r$3 = [ptrType$18.nil, _r$15]; $s = 41; case 41: return $24r$3; /* } */ case 36: /* */ if (req.URL.Host === "") { $s = 42; continue; } /* */ $s = 43; continue; /* if (req.URL.Host === "") { */ case 42: _r$16 = req.closeBody(); /* */ $s = 44; case 44: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _r$16; $s = -1; return [ptrType$18.nil, errors.New("http: no Host in request URL")]; /* } */ case 43: /* while (true) { */ case 45: _r$17 = ctx.Done(); /* */ $s = 47; case 47: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } _selection = $select([[_r$17], []]); /* */ if (_selection[0] === 0) { $s = 48; continue; } /* */ if (_selection[0] === 1) { $s = 49; continue; } /* */ $s = 50; continue; /* if (_selection[0] === 0) { */ case 48: _r$18 = req.closeBody(); /* */ $s = 51; case 51: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } _r$18; _r$19 = ctx.Err(); /* */ $s = 52; case 52: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } $24r$4 = [ptrType$18.nil, _r$19]; $s = 53; case 53: return $24r$4; /* } else if (_selection[0] === 1) { */ case 49: /* } */ case 50: treq = new transportRequest.ptr(req, false, trace, $clone(cancelKey$1, cancelKey), new sync.Mutex.ptr(0, 0), $ifaceNil); _r$20 = t.connectMethodForRequest(treq); /* */ $s = 54; case 54: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } _tuple$2 = _r$20; cm = $clone(_tuple$2[0], connectMethod); err$2 = _tuple$2[1]; /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 55; continue; } /* */ $s = 56; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 55: _r$21 = req.closeBody(); /* */ $s = 57; case 57: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } _r$21; $s = -1; return [ptrType$18.nil, err$2]; /* } */ case 56: _r$22 = t.getConn(treq, $clone(cm, connectMethod)); /* */ $s = 58; case 58: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; } _tuple$3 = _r$22; pconn = _tuple$3[0]; err$2 = _tuple$3[1]; /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 59; continue; } /* */ $s = 60; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 59: $r = t.setReqCanceler($clone(cancelKey$1, cancelKey), $throwNilPointerError); /* */ $s = 61; case 61: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$23 = req.closeBody(); /* */ $s = 62; case 62: if($c) { $c = false; _r$23 = _r$23.$blk(); } if (_r$23 && _r$23.$blk !== undefined) { break s; } _r$23; $s = -1; return [ptrType$18.nil, err$2]; /* } */ case 60: resp$1 = ptrType$18.nil; /* */ if (!($interfaceIsEqual(pconn.alt, $ifaceNil))) { $s = 63; continue; } /* */ $s = 64; continue; /* if (!($interfaceIsEqual(pconn.alt, $ifaceNil))) { */ case 63: $r = t.setReqCanceler($clone(cancelKey$1, cancelKey), $throwNilPointerError); /* */ $s = 66; case 66: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$24 = pconn.alt.RoundTrip(req); /* */ $s = 67; case 67: if($c) { $c = false; _r$24 = _r$24.$blk(); } if (_r$24 && _r$24.$blk !== undefined) { break s; } _tuple$4 = _r$24; resp$1 = _tuple$4[0]; err$2 = _tuple$4[1]; $s = 65; continue; /* } else { */ case 64: _r$25 = pconn.roundTrip(treq); /* */ $s = 68; case 68: if($c) { $c = false; _r$25 = _r$25.$blk(); } if (_r$25 && _r$25.$blk !== undefined) { break s; } _tuple$5 = _r$25; resp$1 = _tuple$5[0]; err$2 = _tuple$5[1]; /* } */ case 65: if ($interfaceIsEqual(err$2, $ifaceNil)) { resp$1.Request = origReq; $s = -1; return [resp$1, $ifaceNil]; } /* */ if (http2isNoCachedConnError(err$2)) { $s = 69; continue; } _r$26 = pconn.shouldRetryRequest(req, err$2); /* */ $s = 72; case 72: if($c) { $c = false; _r$26 = _r$26.$blk(); } if (_r$26 && _r$26.$blk !== undefined) { break s; } /* */ if (!_r$26) { $s = 70; continue; } /* */ $s = 71; continue; /* if (http2isNoCachedConnError(err$2)) { */ case 69: _r$27 = t.removeIdleConn(pconn); /* */ $s = 75; case 75: if($c) { $c = false; _r$27 = _r$27.$blk(); } if (_r$27 && _r$27.$blk !== undefined) { break s; } /* */ if (_r$27) { $s = 73; continue; } /* */ $s = 74; continue; /* if (_r$27) { */ case 73: $r = t.decConnsPerHost($clone(pconn.cacheKey, connectMethodKey)); /* */ $s = 76; case 76: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 74: $s = 71; continue; /* } else if (!_r$26) { */ case 70: _tuple$6 = $assertType(err$2, transportReadFromServerError, true); e = $clone(_tuple$6[0], transportReadFromServerError); ok = _tuple$6[1]; if (ok) { err$2 = e.err; } $s = -1; return [ptrType$18.nil, err$2]; /* } */ case 71: $r = testHookRoundTripRetried(); /* */ $s = 77; case 77: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$28 = rewindBody(req); /* */ $s = 78; case 78: if($c) { $c = false; _r$28 = _r$28.$blk(); } if (_r$28 && _r$28.$blk !== undefined) { break s; } _tuple$7 = _r$28; req = _tuple$7[0]; err$2 = _tuple$7[1]; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return [ptrType$18.nil, err$2]; } $s = 45; continue; case 46: $s = -1; return [ptrType$18.nil, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Transport.ptr.prototype.roundTrip }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f._entry = _entry; $f._i = _i; $f._i$1 = _i$1; $f._keys = _keys; $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$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$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._selection = _selection; $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._v = _v; $f.altRT = altRT; $f.cancelKey$1 = cancelKey$1; $f.cm = cm; $f.ctx = ctx; $f.e = e; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.isHTTP = isHTTP; $f.k = k; $f.ok = ok; $f.origReq = origReq; $f.pconn = pconn; $f.req = req; $f.resp = resp; $f.resp$1 = resp$1; $f.scheme = scheme; $f.t = t; $f.trace = trace; $f.treq = treq; $f.v = v; $f.vv = vv; $f.$s = $s; $f.$r = $r; return $f; }; Transport.prototype.roundTrip = function(req) { return this.$val.roundTrip(req); }; readTrackingBody.ptr.prototype.Read = function(data) { var $24r, _r$1, data, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; data = $f.data; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; r.didRead = true; _r$1 = r.ReadCloser.Read(data); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: readTrackingBody.ptr.prototype.Read }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.data = data; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; readTrackingBody.prototype.Read = function(data) { return this.$val.Read(data); }; readTrackingBody.ptr.prototype.Close = function() { var $24r, _r$1, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; r.didClose = true; _r$1 = r.ReadCloser.Close(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: readTrackingBody.ptr.prototype.Close }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; readTrackingBody.prototype.Close = function() { return this.$val.Close(); }; setupRewindBody = function(req) { var newReq, req; if ($interfaceIsEqual(req.Body, $ifaceNil) || $interfaceIsEqual(req.Body, new $pkg.NoBody.constructor.elem($pkg.NoBody))) { return req; } newReq = $clone(req, Request); newReq.Body = new readTrackingBody.ptr(req.Body, false, false); return newReq; }; rewindBody = function(req) { var _r$1, _r$2, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, body$1, err, newReq, req, rewound, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tuple = $f._tuple; body$1 = $f.body$1; err = $f.err; newReq = $f.newReq; req = $f.req; rewound = $f.rewound; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: newReq = [newReq]; rewound = ptrType$11.nil; err = $ifaceNil; if ($interfaceIsEqual(req.Body, $ifaceNil) || $interfaceIsEqual(req.Body, new $pkg.NoBody.constructor.elem($pkg.NoBody)) || (!$assertType(req.Body, ptrType$20).didRead && !$assertType(req.Body, ptrType$20).didClose)) { _tmp = req; _tmp$1 = $ifaceNil; rewound = _tmp; err = _tmp$1; $s = -1; return [rewound, err]; } /* */ if (!$assertType(req.Body, ptrType$20).didClose) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!$assertType(req.Body, ptrType$20).didClose) { */ case 1: _r$1 = req.closeBody(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; /* } */ case 2: if (req.GetBody === $throwNilPointerError) { _tmp$2 = ptrType$11.nil; _tmp$3 = errCannotRewind; rewound = _tmp$2; err = _tmp$3; $s = -1; return [rewound, err]; } _r$2 = req.GetBody(); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; body$1 = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$4 = ptrType$11.nil; _tmp$5 = err; rewound = _tmp$4; err = _tmp$5; $s = -1; return [rewound, err]; } newReq[0] = $clone(req, Request); newReq[0].Body = new readTrackingBody.ptr(body$1, false, false); _tmp$6 = newReq[0]; _tmp$7 = $ifaceNil; rewound = _tmp$6; err = _tmp$7; $s = -1; return [rewound, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: rewindBody }; } $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._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f._tuple = _tuple; $f.body$1 = body$1; $f.err = err; $f.newReq = newReq; $f.req = req; $f.rewound = rewound; $f.$s = $s; $f.$r = $r; return $f; }; persistConn.ptr.prototype.shouldRetryRequest = function(req, err) { var _r$1, _tuple, _tuple$1, err, ok, ok$1, pc, req, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; err = $f.err; ok = $f.ok; ok$1 = $f.ok$1; pc = $f.pc; req = $f.req; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: pc = this; if (http2isNoCachedConnError(err)) { $s = -1; return true; } if ($interfaceIsEqual(err, errMissingHost)) { $s = -1; return false; } _r$1 = pc.isReused(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (!_r$1) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!_r$1) { */ case 1: $s = -1; return false; /* } */ case 2: _tuple = $assertType(err, nothingWrittenError, true); ok = _tuple[1]; if (ok) { $s = -1; return (x$5 = req.outgoingLength(), (x$5.$high === 0 && x$5.$low === 0)) || !(req.GetBody === $throwNilPointerError); } if (!req.isReplayable()) { $s = -1; return false; } _tuple$1 = $assertType(err, transportReadFromServerError, true); ok$1 = _tuple$1[1]; if (ok$1) { $s = -1; return true; } if ($interfaceIsEqual(err, errServerClosedIdle)) { $s = -1; return true; } $s = -1; return false; /* */ } return; } if ($f === undefined) { $f = { $blk: persistConn.ptr.prototype.shouldRetryRequest }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.err = err; $f.ok = ok; $f.ok$1 = ok$1; $f.pc = pc; $f.req = req; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; persistConn.prototype.shouldRetryRequest = function(req, err) { return this.$val.shouldRetryRequest(req, err); }; Transport.ptr.prototype.RegisterProtocol = function(scheme, rt) { var _entry, _entry$1, _i, _key, _key$1, _keys, _ref, _tuple, _tuple$1, exists, k, newMap, oldMap, rt, scheme, t, v, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _i = $f._i; _key = $f._key; _key$1 = $f._key$1; _keys = $f._keys; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; exists = $f.exists; k = $f.k; newMap = $f.newMap; oldMap = $f.oldMap; rt = $f.rt; scheme = $f.scheme; t = $f.t; v = $f.v; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); t = this; $r = t.altMu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(t.altMu, "Unlock"), []]); _tuple = $assertType(t.altProto.Load(), mapType, true); oldMap = _tuple[0]; _tuple$1 = (_entry = oldMap[$String.keyFor(scheme)], _entry !== undefined ? [_entry.v, true] : [$ifaceNil, false]); exists = _tuple$1[1]; if (exists) { $panic(new $String("protocol " + scheme + " already registered")); } newMap = {}; _ref = oldMap; _i = 0; _keys = $keys(_ref); while (true) { if (!(_i < _keys.length)) { break; } _entry$1 = _ref[_keys[_i]]; if (_entry$1 === undefined) { _i++; continue; } k = _entry$1.k; v = _entry$1.v; _key = k; (newMap || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: v }; _i++; } _key$1 = scheme; (newMap || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key$1)] = { k: _key$1, v: rt }; t.altProto.Store(new mapType(newMap)); $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Transport.ptr.prototype.RegisterProtocol }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._i = _i; $f._key = _key; $f._key$1 = _key$1; $f._keys = _keys; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.exists = exists; $f.k = k; $f.newMap = newMap; $f.oldMap = oldMap; $f.rt = rt; $f.scheme = scheme; $f.t = t; $f.v = v; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Transport.prototype.RegisterProtocol = function(scheme, rt) { return this.$val.RegisterProtocol(scheme, rt); }; Transport.ptr.prototype.CloseIdleConnections = function() { var _entry, _i, _i$1, _keys, _ref, _ref$1, conns, m, pconn, t, t2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _i = $f._i; _i$1 = $f._i$1; _keys = $f._keys; _ref = $f._ref; _ref$1 = $f._ref$1; conns = $f.conns; m = $f.m; pconn = $f.pconn; t = $f.t; t2 = $f.t2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; $r = t.nextProtoOnce.Do($methodVal(t, "onceSetNextProtoDefaults")); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = t.idleMu.Lock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } m = t.idleConn; t.idleConn = false; t.closeIdle = true; connLRU.copy(t.idleLRU, new connLRU.ptr(ptrType$3.nil, false)); $r = t.idleMu.Unlock(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _ref = m; _i = 0; _keys = $keys(_ref); /* while (true) { */ case 4: /* if (!(_i < _keys.length)) { break; } */ if(!(_i < _keys.length)) { $s = 5; continue; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; /* continue; */ $s = 4; continue; } conns = _entry.v; _ref$1 = conns; _i$1 = 0; /* while (true) { */ case 6: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 7; continue; } pconn = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); $r = pconn.close(errCloseIdleConns); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i$1++; $s = 6; continue; case 7: _i++; $s = 4; continue; case 5: t2 = t.h2transport; /* */ if (!($interfaceIsEqual(t2, $ifaceNil))) { $s = 9; continue; } /* */ $s = 10; continue; /* if (!($interfaceIsEqual(t2, $ifaceNil))) { */ case 9: $r = t2.CloseIdleConnections(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 10: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Transport.ptr.prototype.CloseIdleConnections }; } $f._entry = _entry; $f._i = _i; $f._i$1 = _i$1; $f._keys = _keys; $f._ref = _ref; $f._ref$1 = _ref$1; $f.conns = conns; $f.m = m; $f.pconn = pconn; $f.t = t; $f.t2 = t2; $f.$s = $s; $f.$r = $r; return $f; }; Transport.prototype.CloseIdleConnections = function() { return this.$val.CloseIdleConnections(); }; Transport.ptr.prototype.CancelRequest = function(req) { var _r$1, req, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; req = $f.req; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r$1 = t.cancelRequest(new cancelKey.ptr(req), errRequestCanceled); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Transport.ptr.prototype.CancelRequest }; } $f._r$1 = _r$1; $f.req = req; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Transport.prototype.CancelRequest = function(req) { return this.$val.CancelRequest(req); }; Transport.ptr.prototype.cancelRequest = function(key, err) { var $24r, _entry, cancel, err, key, t, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _entry = $f._entry; cancel = $f.cancel; err = $f.err; key = $f.key; t = $f.t; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); t = this; $r = t.reqMu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(t.reqMu, "Unlock"), []]); cancel = (_entry = t.reqCanceler[cancelKey.keyFor(key)], _entry !== undefined ? _entry.v : $throwNilPointerError); delete t.reqCanceler[cancelKey.keyFor(key)]; /* */ if (!(cancel === $throwNilPointerError)) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!(cancel === $throwNilPointerError)) { */ case 2: $r = cancel(err); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: $24r = !(cancel === $throwNilPointerError); $s = 5; case 5: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; return false; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Transport.ptr.prototype.cancelRequest }; } $f.$24r = $24r; $f._entry = _entry; $f.cancel = cancel; $f.err = err; $f.key = key; $f.t = t; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Transport.prototype.cancelRequest = function(key, err) { return this.$val.cancelRequest(key, err); }; Transport.ptr.prototype.connectMethodForRequest = function(treq) { var _r$1, _r$2, _r$3, _tmp, _tmp$1, _tuple, cm, err, t, treq, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; cm = $f.cm; err = $f.err; t = $f.t; treq = $f.treq; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cm = new connectMethod.ptr(arrayType.zero(), ptrType$17.nil, "", "", false); err = $ifaceNil; t = this; cm.targetScheme = treq.Request.URL.Scheme; _r$1 = canonicalAddr(treq.Request.URL); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } cm.targetAddr = _r$1; /* */ if (!(t.Proxy === $throwNilPointerError)) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!(t.Proxy === $throwNilPointerError)) { */ case 2: _r$2 = t.Proxy(treq.Request); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; cm.proxyURL = _tuple[0]; err = _tuple[1]; /* } */ case 3: _r$3 = treq.Request.requiresHTTP1(); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } cm.onlyH1 = _r$3; _tmp = $clone(cm, connectMethod); _tmp$1 = err; connectMethod.copy(cm, _tmp); err = _tmp$1; $s = -1; return [cm, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Transport.ptr.prototype.connectMethodForRequest }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.cm = cm; $f.err = err; $f.t = t; $f.treq = treq; $f.$s = $s; $f.$r = $r; return $f; }; Transport.prototype.connectMethodForRequest = function(treq) { return this.$val.connectMethodForRequest(treq); }; connectMethod.ptr.prototype.proxyAuth = function() { var _tuple, cm, password, u, username; cm = this; if (cm.proxyURL === ptrType$17.nil) { return ""; } u = cm.proxyURL.User; if (!(u === ptrType$21.nil)) { username = u.Username(); _tuple = u.Password(); password = _tuple[0]; return "Basic " + basicAuth(username, password); } return ""; }; connectMethod.prototype.proxyAuth = function() { return this.$val.proxyAuth(); }; transportReadFromServerError.ptr.prototype.Unwrap = function() { var e; e = this; return e.err; }; transportReadFromServerError.prototype.Unwrap = function() { return this.$val.Unwrap(); }; transportReadFromServerError.ptr.prototype.Error = function() { var $24r, _r$1, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; _r$1 = fmt.Sprintf("net/http: Transport failed to read from server: %v", new sliceType([e.err])); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: transportReadFromServerError.ptr.prototype.Error }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; transportReadFromServerError.prototype.Error = function() { return this.$val.Error(); }; Transport.ptr.prototype.putOrCloseIdleConn = function(pconn) { var _r$1, err, pconn, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; err = $f.err; pconn = $f.pconn; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r$1 = t.tryPutIdleConn(pconn); /* */ $s = 1; case 1: 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))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $r = pconn.close(err); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Transport.ptr.prototype.putOrCloseIdleConn }; } $f._r$1 = _r$1; $f.err = err; $f.pconn = pconn; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Transport.prototype.putOrCloseIdleConn = function(pconn) { return this.$val.putOrCloseIdleConn(pconn); }; Transport.ptr.prototype.maxIdleConnsPerHost = function() { var t, v; t = this; v = t.MaxIdleConnsPerHost; if (!((v === 0))) { return v; } return 2; }; Transport.prototype.maxIdleConnsPerHost = function() { return this.$val.maxIdleConnsPerHost(); }; Transport.ptr.prototype.tryPutIdleConn = function(pconn) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, $24r$5, $24r$6, _entry, _entry$1, _entry$2, _i, _key, _key$1, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _ref, _tuple, done, exist, idles, key, ok, oldest, pconn, q, t, w, w$1, x$5, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; $24r$6 = $f.$24r$6; _entry = $f._entry; _entry$1 = $f._entry$1; _entry$2 = $f._entry$2; _i = $f._i; _key = $f._key; _key$1 = $f._key$1; _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; _ref = $f._ref; _tuple = $f._tuple; done = $f.done; exist = $f.exist; idles = $f.idles; key = $f.key; ok = $f.ok; oldest = $f.oldest; pconn = $f.pconn; q = $f.q; t = $f.t; w = $f.w; w$1 = $f.w$1; x$5 = $f.x$5; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); t = this; /* */ if (t.DisableKeepAlives || t.MaxIdleConnsPerHost < 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (t.DisableKeepAlives || t.MaxIdleConnsPerHost < 0) { */ case 1: $24r = errKeepAlivesDisabled; $s = 3; case 3: return $24r; /* } */ case 2: _r$1 = pconn.isBroken(); /* */ $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) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_r$1) { */ case 4: $24r$1 = errConnBroken; $s = 7; case 7: return $24r$1; /* } */ case 5: $r = pconn.markReused(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = t.idleMu.Lock(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(t.idleMu, "Unlock"), []]); /* */ if (!($interfaceIsEqual(pconn.alt, $ifaceNil)) && !((_entry = t.idleLRU.m[ptrType$22.keyFor(pconn)], _entry !== undefined ? _entry.v : ptrType$23.nil) === ptrType$23.nil)) { $s = 10; continue; } /* */ $s = 11; continue; /* if (!($interfaceIsEqual(pconn.alt, $ifaceNil)) && !((_entry = t.idleLRU.m[ptrType$22.keyFor(pconn)], _entry !== undefined ? _entry.v : ptrType$23.nil) === ptrType$23.nil)) { */ case 10: $24r$2 = $ifaceNil; $s = 12; case 12: return $24r$2; /* } */ case 11: key = $clone(pconn.cacheKey, connectMethodKey); _tuple = (_entry$1 = t.idleConnWait[connectMethodKey.keyFor(key)], _entry$1 !== undefined ? [_entry$1.v, true] : [new wantConnQueue.ptr(sliceType$8.nil, 0, sliceType$8.nil), false]); q = $clone(_tuple[0], wantConnQueue); ok = _tuple[1]; /* */ if (ok) { $s = 13; continue; } /* */ $s = 14; continue; /* if (ok) { */ case 13: done = false; /* */ if ($interfaceIsEqual(pconn.alt, $ifaceNil)) { $s = 15; continue; } /* */ $s = 16; continue; /* if ($interfaceIsEqual(pconn.alt, $ifaceNil)) { */ case 15: /* while (true) { */ case 18: /* if (!(q.len() > 0)) { break; } */ if(!(q.len() > 0)) { $s = 19; continue; } w = q.popFront(); _r$2 = w.tryDeliver(pconn, $ifaceNil); /* */ $s = 22; case 22: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } /* */ if (_r$2) { $s = 20; continue; } /* */ $s = 21; continue; /* if (_r$2) { */ case 20: done = true; /* break; */ $s = 19; continue; /* } */ case 21: $s = 18; continue; case 19: $s = 17; continue; /* } else { */ case 16: /* while (true) { */ case 23: /* if (!(q.len() > 0)) { break; } */ if(!(q.len() > 0)) { $s = 24; continue; } w$1 = q.popFront(); _r$3 = w$1.tryDeliver(pconn, $ifaceNil); /* */ $s = 25; case 25: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $s = 23; continue; case 24: /* } */ case 17: if (q.len() === 0) { delete t.idleConnWait[connectMethodKey.keyFor(key)]; } else { _key = $clone(key, connectMethodKey); (t.idleConnWait || $throwRuntimeError("assignment to entry in nil map"))[connectMethodKey.keyFor(_key)] = { k: _key, v: $clone(q, wantConnQueue) }; } /* */ if (done) { $s = 26; continue; } /* */ $s = 27; continue; /* if (done) { */ case 26: $24r$3 = $ifaceNil; $s = 28; case 28: return $24r$3; /* } */ case 27: /* } */ case 14: /* */ if (t.closeIdle) { $s = 29; continue; } /* */ $s = 30; continue; /* if (t.closeIdle) { */ case 29: $24r$4 = errCloseIdle; $s = 31; case 31: return $24r$4; /* } */ case 30: if (t.idleConn === false) { t.idleConn = {}; } idles = (_entry$2 = t.idleConn[connectMethodKey.keyFor(key)], _entry$2 !== undefined ? _entry$2.v : sliceType$9.nil); /* */ if (idles.$length >= t.maxIdleConnsPerHost()) { $s = 32; continue; } /* */ $s = 33; continue; /* if (idles.$length >= t.maxIdleConnsPerHost()) { */ case 32: $24r$5 = errTooManyIdleHost; $s = 34; case 34: return $24r$5; /* } */ case 33: _ref = idles; _i = 0; /* while (true) { */ case 35: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 36; continue; } exist = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); /* */ if (exist === pconn) { $s = 37; continue; } /* */ $s = 38; continue; /* if (exist === pconn) { */ case 37: $r = log.Fatalf("dup idle pconn %p in freelist", new sliceType([pconn])); /* */ $s = 39; case 39: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 38: _i++; $s = 35; continue; case 36: _key$1 = $clone(key, connectMethodKey); (t.idleConn || $throwRuntimeError("assignment to entry in nil map"))[connectMethodKey.keyFor(_key$1)] = { k: _key$1, v: $append(idles, pconn) }; t.idleLRU.add(pconn); /* */ if (!((t.MaxIdleConns === 0)) && t.idleLRU.len() > t.MaxIdleConns) { $s = 40; continue; } /* */ $s = 41; continue; /* if (!((t.MaxIdleConns === 0)) && t.idleLRU.len() > t.MaxIdleConns) { */ case 40: oldest = t.idleLRU.removeOldest(); $r = oldest.close(errTooManyIdle); /* */ $s = 42; case 42: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } t.removeIdleConnLocked(oldest); /* } */ case 41: /* */ if ((x$5 = t.IdleConnTimeout, (x$5.$high > 0 || (x$5.$high === 0 && x$5.$low > 0))) && $interfaceIsEqual(pconn.alt, $ifaceNil)) { $s = 43; continue; } /* */ $s = 44; continue; /* if ((x$5 = t.IdleConnTimeout, (x$5.$high > 0 || (x$5.$high === 0 && x$5.$low > 0))) && $interfaceIsEqual(pconn.alt, $ifaceNil)) { */ case 43: /* */ if (!(pconn.idleTimer === ptrType$25.nil)) { $s = 45; continue; } /* */ $s = 46; continue; /* if (!(pconn.idleTimer === ptrType$25.nil)) { */ case 45: _r$4 = pconn.idleTimer.Reset(t.IdleConnTimeout); /* */ $s = 48; case 48: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; $s = 47; continue; /* } else { */ case 46: _r$5 = time.AfterFunc(t.IdleConnTimeout, $methodVal(pconn, "closeConnIfStillIdle")); /* */ $s = 49; case 49: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } pconn.idleTimer = _r$5; /* } */ case 47: /* } */ case 44: _r$6 = time.Now(); /* */ $s = 50; case 50: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } time.Time.copy(pconn.idleAt, _r$6); $24r$6 = $ifaceNil; $s = 51; case 51: return $24r$6; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Transport.ptr.prototype.tryPutIdleConn }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f.$24r$6 = $24r$6; $f._entry = _entry; $f._entry$1 = _entry$1; $f._entry$2 = _entry$2; $f._i = _i; $f._key = _key; $f._key$1 = _key$1; $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._ref = _ref; $f._tuple = _tuple; $f.done = done; $f.exist = exist; $f.idles = idles; $f.key = key; $f.ok = ok; $f.oldest = oldest; $f.pconn = pconn; $f.q = q; $f.t = t; $f.w = w; $f.w$1 = w$1; $f.x$5 = x$5; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Transport.prototype.tryPutIdleConn = function(pconn) { return this.$val.tryPutIdleConn(pconn); }; Transport.ptr.prototype.queueForIdleConn = function(w) { var $24r, $24r$1, $24r$2, $24r$3, _entry, _entry$1, _key, _key$1, _r$1, _r$2, _r$3, _r$4, _tuple, delivered, delivered$1, list$1, ok, oldTime, pconn, q, stop, t, tooOld, w, x$5, x$6, x$7, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; _entry = $f._entry; _entry$1 = $f._entry$1; _key = $f._key; _key$1 = $f._key$1; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; delivered = $f.delivered; delivered$1 = $f.delivered$1; list$1 = $f.list$1; ok = $f.ok; oldTime = $f.oldTime; pconn = $f.pconn; q = $f.q; stop = $f.stop; t = $f.t; tooOld = $f.tooOld; w = $f.w; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); delivered = false; t = this; /* */ if (t.DisableKeepAlives) { $s = 1; continue; } /* */ $s = 2; continue; /* if (t.DisableKeepAlives) { */ case 1: delivered = false; $24r = delivered; $s = 3; case 3: return $24r; /* } */ case 2: $r = t.idleMu.Lock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(t.idleMu, "Unlock"), []]); t.closeIdle = false; /* */ if (w === ptrType$24.nil) { $s = 5; continue; } /* */ $s = 6; continue; /* if (w === ptrType$24.nil) { */ case 5: delivered = false; $24r$1 = delivered; $s = 7; case 7: return $24r$1; /* } */ case 6: oldTime = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil); /* */ if ((x$5 = t.IdleConnTimeout, (x$5.$high > 0 || (x$5.$high === 0 && x$5.$low > 0)))) { $s = 8; continue; } /* */ $s = 9; continue; /* if ((x$5 = t.IdleConnTimeout, (x$5.$high > 0 || (x$5.$high === 0 && x$5.$low > 0)))) { */ case 8: _r$1 = time.Now(); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = $clone(_r$1, time.Time).Add((x$6 = t.IdleConnTimeout, new time.Duration(-x$6.$high, -x$6.$low))); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } time.Time.copy(oldTime, _r$2); /* } */ case 9: _tuple = (_entry = t.idleConn[connectMethodKey.keyFor(w.key)], _entry !== undefined ? [_entry.v, true] : [sliceType$9.nil, false]); list$1 = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 12; continue; } /* */ $s = 13; continue; /* if (ok) { */ case 12: stop = false; delivered$1 = false; /* while (true) { */ case 14: /* if (!(list$1.$length > 0 && !stop)) { break; } */ if(!(list$1.$length > 0 && !stop)) { $s = 15; continue; } pconn = (x$7 = list$1.$length - 1 >> 0, ((x$7 < 0 || x$7 >= list$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : list$1.$array[list$1.$offset + x$7])); tooOld = !$clone(oldTime, time.Time).IsZero() && $clone($clone(pconn.idleAt, time.Time).Round(new time.Duration(0, 0)), time.Time).Before($clone(oldTime, time.Time)); /* */ if (tooOld) { $s = 16; continue; } /* */ $s = 17; continue; /* if (tooOld) { */ case 16: $go($methodVal(pconn, "closeConnIfStillIdle"), []); /* } */ case 17: _r$3 = pconn.isBroken(); /* */ $s = 20; case 20: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } /* */ if (_r$3 || tooOld) { $s = 18; continue; } /* */ $s = 19; continue; /* if (_r$3 || tooOld) { */ case 18: list$1 = $subslice(list$1, 0, (list$1.$length - 1 >> 0)); /* continue; */ $s = 14; continue; /* } */ case 19: _r$4 = w.tryDeliver(pconn, $ifaceNil); /* */ $s = 21; case 21: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } delivered$1 = _r$4; if (delivered$1) { if (!($interfaceIsEqual(pconn.alt, $ifaceNil))) { } else { t.idleLRU.remove(pconn); list$1 = $subslice(list$1, 0, (list$1.$length - 1 >> 0)); } } stop = true; $s = 14; continue; case 15: if (list$1.$length > 0) { _key = $clone(w.key, connectMethodKey); (t.idleConn || $throwRuntimeError("assignment to entry in nil map"))[connectMethodKey.keyFor(_key)] = { k: _key, v: list$1 }; } else { delete t.idleConn[connectMethodKey.keyFor(w.key)]; } /* */ if (stop) { $s = 22; continue; } /* */ $s = 23; continue; /* if (stop) { */ case 22: delivered = delivered$1; $24r$2 = delivered; $s = 24; case 24: return $24r$2; /* } */ case 23: /* } */ case 13: if (t.idleConnWait === false) { t.idleConnWait = {}; } q = $clone((_entry$1 = t.idleConnWait[connectMethodKey.keyFor(w.key)], _entry$1 !== undefined ? _entry$1.v : new wantConnQueue.ptr(sliceType$8.nil, 0, sliceType$8.nil)), wantConnQueue); q.cleanFront(); q.pushBack(w); _key$1 = $clone(w.key, connectMethodKey); (t.idleConnWait || $throwRuntimeError("assignment to entry in nil map"))[connectMethodKey.keyFor(_key$1)] = { k: _key$1, v: $clone(q, wantConnQueue) }; delivered = false; $24r$3 = delivered; $s = 25; case 25: return $24r$3; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return delivered; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Transport.ptr.prototype.queueForIdleConn }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f._entry = _entry; $f._entry$1 = _entry$1; $f._key = _key; $f._key$1 = _key$1; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f.delivered = delivered; $f.delivered$1 = delivered$1; $f.list$1 = list$1; $f.ok = ok; $f.oldTime = oldTime; $f.pconn = pconn; $f.q = q; $f.stop = stop; $f.t = t; $f.tooOld = tooOld; $f.w = w; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Transport.prototype.queueForIdleConn = function(w) { return this.$val.queueForIdleConn(w); }; Transport.ptr.prototype.removeIdleConn = function(pconn) { var $24r, pconn, t, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; pconn = $f.pconn; t = $f.t; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); t = this; $r = t.idleMu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(t.idleMu, "Unlock"), []]); $24r = t.removeIdleConnLocked(pconn); $s = 2; case 2: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; return false; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Transport.ptr.prototype.removeIdleConn }; } $f.$24r = $24r; $f.pconn = pconn; $f.t = t; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Transport.prototype.removeIdleConn = function(pconn) { return this.$val.removeIdleConn(pconn); }; Transport.ptr.prototype.removeIdleConnLocked = function(pconn) { var _1, _entry, _i, _key, _ref, i, key, pconn, pconns, removed, t, v; t = this; if (!(pconn.idleTimer === ptrType$25.nil)) { pconn.idleTimer.Stop(); } t.idleLRU.remove(pconn); key = $clone(pconn.cacheKey, connectMethodKey); pconns = (_entry = t.idleConn[connectMethodKey.keyFor(key)], _entry !== undefined ? _entry.v : sliceType$9.nil); removed = false; _1 = pconns.$length; if (_1 === (0)) { } else if (_1 === (1)) { if ((0 >= pconns.$length ? ($throwRuntimeError("index out of range"), undefined) : pconns.$array[pconns.$offset + 0]) === pconn) { delete t.idleConn[connectMethodKey.keyFor(key)]; removed = true; } } else { _ref = pconns; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (!(v === pconn)) { _i++; continue; } $copySlice($subslice(pconns, i), $subslice(pconns, (i + 1 >> 0))); _key = $clone(key, connectMethodKey); (t.idleConn || $throwRuntimeError("assignment to entry in nil map"))[connectMethodKey.keyFor(_key)] = { k: _key, v: $subslice(pconns, 0, (pconns.$length - 1 >> 0)) }; removed = true; break; } } return removed; }; Transport.prototype.removeIdleConnLocked = function(pconn) { return this.$val.removeIdleConnLocked(pconn); }; Transport.ptr.prototype.setReqCanceler = function(key, fn) { var _key, fn, key, t, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _key = $f._key; fn = $f.fn; key = $f.key; t = $f.t; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); t = this; $r = t.reqMu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(t.reqMu, "Unlock"), []]); if (t.reqCanceler === false) { t.reqCanceler = {}; } if (!(fn === $throwNilPointerError)) { _key = $clone(key, cancelKey); (t.reqCanceler || $throwRuntimeError("assignment to entry in nil map"))[cancelKey.keyFor(_key)] = { k: _key, v: fn }; } else { delete t.reqCanceler[cancelKey.keyFor(key)]; } $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Transport.ptr.prototype.setReqCanceler }; } $f._key = _key; $f.fn = fn; $f.key = key; $f.t = t; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Transport.prototype.setReqCanceler = function(key, fn) { return this.$val.setReqCanceler(key, fn); }; Transport.ptr.prototype.replaceReqCanceler = function(key, fn) { var $24r, $24r$1, _entry, _key, _tuple, fn, key, ok, t, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _entry = $f._entry; _key = $f._key; _tuple = $f._tuple; fn = $f.fn; key = $f.key; ok = $f.ok; t = $f.t; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); t = this; $r = t.reqMu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(t.reqMu, "Unlock"), []]); _tuple = (_entry = t.reqCanceler[cancelKey.keyFor(key)], _entry !== undefined ? [_entry.v, true] : [$throwNilPointerError, false]); ok = _tuple[1]; /* */ if (!ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!ok) { */ case 2: $24r = false; $s = 4; case 4: return $24r; /* } */ case 3: if (!(fn === $throwNilPointerError)) { _key = $clone(key, cancelKey); (t.reqCanceler || $throwRuntimeError("assignment to entry in nil map"))[cancelKey.keyFor(_key)] = { k: _key, v: fn }; } else { delete t.reqCanceler[cancelKey.keyFor(key)]; } $24r$1 = true; $s = 5; case 5: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return false; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Transport.ptr.prototype.replaceReqCanceler }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._entry = _entry; $f._key = _key; $f._tuple = _tuple; $f.fn = fn; $f.key = key; $f.ok = ok; $f.t = t; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Transport.prototype.replaceReqCanceler = function(key, fn) { return this.$val.replaceReqCanceler(key, fn); }; Transport.ptr.prototype.dial = function(ctx, network, addr) { var $24r, $24r$1, _r$1, _r$2, _r$3, _tuple, addr, c, ctx, err, network, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; addr = $f.addr; c = $f.c; ctx = $f.ctx; err = $f.err; network = $f.network; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; /* */ if (!(t.DialContext === $throwNilPointerError)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(t.DialContext === $throwNilPointerError)) { */ case 1: _r$1 = t.DialContext(ctx, network, addr); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 4; case 4: return $24r; /* } */ case 2: /* */ if (!(t.Dial === $throwNilPointerError)) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!(t.Dial === $throwNilPointerError)) { */ case 5: _r$2 = t.Dial(network, addr); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; c = _tuple[0]; err = _tuple[1]; if ($interfaceIsEqual(c, $ifaceNil) && $interfaceIsEqual(err, $ifaceNil)) { err = errors.New("net/http: Transport.Dial hook returned (nil, nil)"); } $s = -1; return [c, err]; /* } */ case 6: _r$3 = zeroDialer.DialContext(ctx, network, addr); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r$1 = _r$3; $s = 9; case 9: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: Transport.ptr.prototype.dial }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.addr = addr; $f.c = c; $f.ctx = ctx; $f.err = err; $f.network = network; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Transport.prototype.dial = function(ctx, network, addr) { return this.$val.dial(ctx, network, addr); }; wantConn.ptr.prototype.waiting = function() { var _selection, w; w = this; _selection = $select([[w.ready], []]); if (_selection[0] === 0) { return false; } else if (_selection[0] === 1) { return true; } }; wantConn.prototype.waiting = function() { return this.$val.waiting(); }; wantConn.ptr.prototype.tryDeliver = function(pc, err) { var $24r, $24r$1, err, pc, w, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; err = $f.err; pc = $f.pc; w = $f.w; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); w = this; $r = w.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(w.mu, "Unlock"), []]); /* */ if (!(w.pc === ptrType$22.nil) || !($interfaceIsEqual(w.err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!(w.pc === ptrType$22.nil) || !($interfaceIsEqual(w.err, $ifaceNil))) { */ case 2: $24r = false; $s = 4; case 4: return $24r; /* } */ case 3: w.pc = pc; w.err = err; if (w.pc === ptrType$22.nil && $interfaceIsEqual(w.err, $ifaceNil)) { $panic(new $String("net/http: internal error: misuse of tryDeliver")); } $close(w.ready); $24r$1 = true; $s = 5; case 5: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return false; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: wantConn.ptr.prototype.tryDeliver }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.err = err; $f.pc = pc; $f.w = w; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; wantConn.prototype.tryDeliver = function(pc, err) { return this.$val.tryDeliver(pc, err); }; wantConn.ptr.prototype.cancel = function(t, err) { var err, pc, t, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; pc = $f.pc; t = $f.t; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: w = this; $r = w.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (w.pc === ptrType$22.nil && $interfaceIsEqual(w.err, $ifaceNil)) { $close(w.ready); } pc = w.pc; w.pc = ptrType$22.nil; w.err = err; $r = w.mu.Unlock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!(pc === ptrType$22.nil)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!(pc === ptrType$22.nil)) { */ case 3: $r = t.putOrCloseIdleConn(pc); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: wantConn.ptr.prototype.cancel }; } $f.err = err; $f.pc = pc; $f.t = t; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; wantConn.prototype.cancel = function(t, err) { return this.$val.cancel(t, err); }; wantConnQueue.ptr.prototype.len = function() { var q; q = this; return (q.head.$length - q.headPos >> 0) + q.tail.$length >> 0; }; wantConnQueue.prototype.len = function() { return this.$val.len(); }; wantConnQueue.ptr.prototype.pushBack = function(w) { var q, w; q = this; q.tail = $append(q.tail, w); }; wantConnQueue.prototype.pushBack = function(w) { return this.$val.pushBack(w); }; wantConnQueue.ptr.prototype.popFront = function() { var _tmp, _tmp$1, _tmp$2, q, w, x$5, x$6, x$7, x$8; q = this; if (q.headPos >= q.head.$length) { if (q.tail.$length === 0) { return ptrType$24.nil; } _tmp = q.tail; _tmp$1 = 0; _tmp$2 = $subslice(q.head, 0, 0); q.head = _tmp; q.headPos = _tmp$1; q.tail = _tmp$2; } w = (x$5 = q.head, x$6 = q.headPos, ((x$6 < 0 || x$6 >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + x$6])); (x$7 = q.head, x$8 = q.headPos, ((x$8 < 0 || x$8 >= x$7.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$7.$array[x$7.$offset + x$8] = ptrType$24.nil)); q.headPos = q.headPos + (1) >> 0; return w; }; wantConnQueue.prototype.popFront = function() { return this.$val.popFront(); }; wantConnQueue.ptr.prototype.peekFront = function() { var q, x$5, x$6, x$7; q = this; if (q.headPos < q.head.$length) { return (x$5 = q.head, x$6 = q.headPos, ((x$6 < 0 || x$6 >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + x$6])); } if (q.tail.$length > 0) { return (x$7 = q.tail, (0 >= x$7.$length ? ($throwRuntimeError("index out of range"), undefined) : x$7.$array[x$7.$offset + 0])); } return ptrType$24.nil; }; wantConnQueue.prototype.peekFront = function() { return this.$val.peekFront(); }; wantConnQueue.ptr.prototype.cleanFront = function() { var cleaned, q, w; cleaned = false; q = this; while (true) { w = q.peekFront(); if (w === ptrType$24.nil || w.waiting()) { cleaned = cleaned; return cleaned; } q.popFront(); cleaned = true; } }; wantConnQueue.prototype.cleanFront = function() { return this.$val.cleanFront(); }; Transport.ptr.prototype.customDialTLS = function(ctx, network, addr) { var _r$1, _r$2, _tuple, _tuple$1, addr, conn$1, ctx, err, network, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; addr = $f.addr; conn$1 = $f.conn$1; ctx = $f.ctx; err = $f.err; network = $f.network; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: conn$1 = $ifaceNil; err = $ifaceNil; t = this; /* */ if (!(t.DialTLSContext === $throwNilPointerError)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(t.DialTLSContext === $throwNilPointerError)) { */ case 1: _r$1 = t.DialTLSContext(ctx, network, addr); /* */ $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; conn$1 = _tuple[0]; err = _tuple[1]; $s = 3; continue; /* } else { */ case 2: _r$2 = t.DialTLS(network, addr); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; conn$1 = _tuple$1[0]; err = _tuple$1[1]; /* } */ case 3: if ($interfaceIsEqual(conn$1, $ifaceNil) && $interfaceIsEqual(err, $ifaceNil)) { err = errors.New("net/http: Transport.DialTLS or DialTLSContext returned (nil, nil)"); } $s = -1; return [conn$1, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Transport.ptr.prototype.customDialTLS }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.addr = addr; $f.conn$1 = conn$1; $f.ctx = ctx; $f.err = err; $f.network = network; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Transport.prototype.customDialTLS = function(ctx, network, addr) { return this.$val.customDialTLS(ctx, network, addr); }; Transport.ptr.prototype.getConn = function(treq, cm) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, $24r$5, $24r$6, $24r$7, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _selection, _selection$1, _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, cancelc, cm, ctx, delivered, err, err$1, err$2, pc, pc$1, req, t, trace, treq, w, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; $24r$6 = $f.$24r$6; $24r$7 = $f.$24r$7; _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; _selection = $f._selection; _selection$1 = $f._selection$1; _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$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; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; cancelc = $f.cancelc; cm = $f.cm; ctx = $f.ctx; delivered = $f.delivered; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; pc = $f.pc; pc$1 = $f.pc$1; req = $f.req; t = $f.t; trace = $f.trace; treq = $f.treq; w = $f.w; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); cancelc = [cancelc]; err = [err]; t = [t]; w = [w]; pc = ptrType$22.nil; err[0] = $ifaceNil; t[0] = this; req = treq.Request; trace = treq.trace; ctx = req.Context(); /* */ if (!(trace === ptrType$19.nil) && !(trace.GetConn === $throwNilPointerError)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(trace === ptrType$19.nil) && !(trace.GetConn === $throwNilPointerError)) { */ case 1: _r$1 = cm.addr(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = trace.GetConn(_r$1); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: w[0] = new wantConn.ptr($clone(cm, connectMethod), $clone(cm.key(), connectMethodKey), ctx, new $Chan(structType, 1), testHookPrePendingDial, testHookPostPendingDial, new sync.Mutex.ptr(0, 0), ptrType$22.nil, $ifaceNil); $deferred.push([(function(cancelc, err, t, w) { return function $b() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (!($interfaceIsEqual(err[0], $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(err[0], $ifaceNil))) { */ case 1: $r = w[0].cancel(t[0], err[0]); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$s = $s; $f.$r = $r; return $f; }; })(cancelc, err, t, w), []]); _r$2 = t[0].queueForIdleConn(w[0]); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } delivered = _r$2; /* */ if (delivered) { $s = 6; continue; } /* */ $s = 7; continue; /* if (delivered) { */ case 6: pc$1 = w[0].pc; /* */ if ($interfaceIsEqual(pc$1.alt, $ifaceNil) && !(trace === ptrType$19.nil) && !(trace.GotConn === $throwNilPointerError)) { $s = 8; continue; } /* */ $s = 9; continue; /* if ($interfaceIsEqual(pc$1.alt, $ifaceNil) && !(trace === ptrType$19.nil) && !(trace.GotConn === $throwNilPointerError)) { */ case 8: _r$3 = pc$1.gotIdleConnTrace($clone(pc$1.idleAt, time.Time)); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $r = trace.GotConn($clone(_r$3, httptrace.GotConnInfo)); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 9: $r = t[0].setReqCanceler($clone(treq.cancelKey, cancelKey), (function(cancelc, err, t, w) { return function(param) { var param; }; })(cancelc, err, t, w)); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp = pc$1; _tmp$1 = $ifaceNil; pc = _tmp; err[0] = _tmp$1; $24r = [pc, err[0]]; $s = 13; case 13: return $24r; /* } */ case 7: cancelc[0] = new $Chan($error, 1); $r = t[0].setReqCanceler($clone(treq.cancelKey, cancelKey), (function(cancelc, err, t, w) { return function $b(err$1) { var err$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err$1 = $f.err$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = $send(cancelc[0], err$1); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.err$1 = err$1; $f.$s = $s; $f.$r = $r; return $f; }; })(cancelc, err, t, w)); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = t[0].queueForDial(w[0]); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$4 = req.Context().Done(); /* */ $s = 16; case 16: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = $select([[w[0].ready], [req.Cancel], [_r$4], [cancelc[0]]]); /* */ $s = 17; case 17: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _selection = _r$5; /* */ if (_selection[0] === 0) { $s = 18; continue; } /* */ if (_selection[0] === 1) { $s = 19; continue; } /* */ if (_selection[0] === 2) { $s = 20; continue; } /* */ if (_selection[0] === 3) { $s = 21; continue; } /* */ $s = 22; continue; /* if (_selection[0] === 0) { */ case 18: /* */ if (!(w[0].pc === ptrType$22.nil) && $interfaceIsEqual(w[0].pc.alt, $ifaceNil) && !(trace === ptrType$19.nil) && !(trace.GotConn === $throwNilPointerError)) { $s = 23; continue; } /* */ $s = 24; continue; /* if (!(w[0].pc === ptrType$22.nil) && $interfaceIsEqual(w[0].pc.alt, $ifaceNil) && !(trace === ptrType$19.nil) && !(trace.GotConn === $throwNilPointerError)) { */ case 23: _r$6 = w[0].pc.isReused(); /* */ $s = 25; case 25: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } $r = trace.GotConn(new httptrace.GotConnInfo.ptr(w[0].pc.conn, _r$6, false, new time.Duration(0, 0))); /* */ $s = 26; case 26: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 24: /* */ if (!($interfaceIsEqual(w[0].err, $ifaceNil))) { $s = 27; continue; } /* */ $s = 28; continue; /* if (!($interfaceIsEqual(w[0].err, $ifaceNil))) { */ case 27: _r$7 = req.Context().Done(); /* */ $s = 29; case 29: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _selection$1 = $select([[req.Cancel], [_r$7], [cancelc[0]], []]); /* */ if (_selection$1[0] === 0) { $s = 30; continue; } /* */ if (_selection$1[0] === 1) { $s = 31; continue; } /* */ if (_selection$1[0] === 2) { $s = 32; continue; } /* */ if (_selection$1[0] === 3) { $s = 33; continue; } /* */ $s = 34; continue; /* if (_selection$1[0] === 0) { */ case 30: _tmp$2 = ptrType$22.nil; _tmp$3 = errRequestCanceledConn; pc = _tmp$2; err[0] = _tmp$3; $24r$1 = [pc, err[0]]; $s = 35; case 35: return $24r$1; /* } else if (_selection$1[0] === 1) { */ case 31: _tmp$4 = ptrType$22.nil; _r$8 = req.Context().Err(); /* */ $s = 36; case 36: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _tmp$5 = _r$8; pc = _tmp$4; err[0] = _tmp$5; $24r$2 = [pc, err[0]]; $s = 37; case 37: return $24r$2; /* } else if (_selection$1[0] === 2) { */ case 32: err$1 = _selection$1[1][0]; if ($interfaceIsEqual(err$1, errRequestCanceled)) { err$1 = errRequestCanceledConn; } _tmp$6 = ptrType$22.nil; _tmp$7 = err$1; pc = _tmp$6; err[0] = _tmp$7; $24r$3 = [pc, err[0]]; $s = 38; case 38: return $24r$3; /* } else if (_selection$1[0] === 3) { */ case 33: /* } */ case 34: /* } */ case 28: _tmp$8 = w[0].pc; _tmp$9 = w[0].err; pc = _tmp$8; err[0] = _tmp$9; $24r$4 = [pc, err[0]]; $s = 39; case 39: return $24r$4; /* } else if (_selection[0] === 1) { */ case 19: _tmp$10 = ptrType$22.nil; _tmp$11 = errRequestCanceledConn; pc = _tmp$10; err[0] = _tmp$11; $24r$5 = [pc, err[0]]; $s = 40; case 40: return $24r$5; /* } else if (_selection[0] === 2) { */ case 20: _tmp$12 = ptrType$22.nil; _r$9 = req.Context().Err(); /* */ $s = 41; case 41: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tmp$13 = _r$9; pc = _tmp$12; err[0] = _tmp$13; $24r$6 = [pc, err[0]]; $s = 42; case 42: return $24r$6; /* } else if (_selection[0] === 3) { */ case 21: err$2 = _selection[1][0]; if ($interfaceIsEqual(err$2, errRequestCanceled)) { err$2 = errRequestCanceledConn; } _tmp$14 = ptrType$22.nil; _tmp$15 = err$2; pc = _tmp$14; err[0] = _tmp$15; $24r$7 = [pc, err[0]]; $s = 43; case 43: return $24r$7; /* } */ case 22: $s = -1; return [pc, err[0]]; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [pc, err[0]]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Transport.ptr.prototype.getConn }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f.$24r$6 = $24r$6; $f.$24r$7 = $24r$7; $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._selection = _selection; $f._selection$1 = _selection$1; $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$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._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f.cancelc = cancelc; $f.cm = cm; $f.ctx = ctx; $f.delivered = delivered; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.pc = pc; $f.pc$1 = pc$1; $f.req = req; $f.t = t; $f.trace = trace; $f.treq = treq; $f.w = w; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Transport.prototype.getConn = function(treq, cm) { return this.$val.getConn(treq, cm); }; Transport.ptr.prototype.queueForDial = function(w) { var _entry, _entry$1, _key, _key$1, n, q, t, w, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _key = $f._key; _key$1 = $f._key$1; n = $f.n; q = $f.q; t = $f.t; w = $f.w; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); t = this; $r = w.beforeDial(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (t.MaxConnsPerHost <= 0) { $s = 2; continue; } /* */ $s = 3; continue; /* if (t.MaxConnsPerHost <= 0) { */ case 2: $go($methodVal(t, "dialConnFor"), [w]); $s = 4; case 4: return; /* } */ case 3: $r = t.connsPerHostMu.Lock(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(t.connsPerHostMu, "Unlock"), []]); n = (_entry = t.connsPerHost[connectMethodKey.keyFor(w.key)], _entry !== undefined ? _entry.v : 0); /* */ if (n < t.MaxConnsPerHost) { $s = 6; continue; } /* */ $s = 7; continue; /* if (n < t.MaxConnsPerHost) { */ case 6: if (t.connsPerHost === false) { t.connsPerHost = {}; } _key = $clone(w.key, connectMethodKey); (t.connsPerHost || $throwRuntimeError("assignment to entry in nil map"))[connectMethodKey.keyFor(_key)] = { k: _key, v: n + 1 >> 0 }; $go($methodVal(t, "dialConnFor"), [w]); $s = 8; case 8: return; /* } */ case 7: if (t.connsPerHostWait === false) { t.connsPerHostWait = {}; } q = $clone((_entry$1 = t.connsPerHostWait[connectMethodKey.keyFor(w.key)], _entry$1 !== undefined ? _entry$1.v : new wantConnQueue.ptr(sliceType$8.nil, 0, sliceType$8.nil)), wantConnQueue); q.cleanFront(); q.pushBack(w); _key$1 = $clone(w.key, connectMethodKey); (t.connsPerHostWait || $throwRuntimeError("assignment to entry in nil map"))[connectMethodKey.keyFor(_key$1)] = { k: _key$1, v: $clone(q, wantConnQueue) }; $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Transport.ptr.prototype.queueForDial }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._key = _key; $f._key$1 = _key$1; $f.n = n; $f.q = q; $f.t = t; $f.w = w; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Transport.prototype.queueForDial = function(w) { return this.$val.queueForDial(w); }; Transport.ptr.prototype.dialConnFor = function(w) { var _r$1, _r$2, _tuple, delivered, err, pc, t, w, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; delivered = $f.delivered; err = $f.err; pc = $f.pc; t = $f.t; w = $f.w; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); t = this; $deferred.push([w.afterDial, []]); _r$1 = t.dialConn(w.ctx, $clone(w.cm, connectMethod)); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; pc = _tuple[0]; err = _tuple[1]; _r$2 = w.tryDeliver(pc, err); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } delivered = _r$2; /* */ if ($interfaceIsEqual(err, $ifaceNil) && (!delivered || !($interfaceIsEqual(pc.alt, $ifaceNil)))) { $s = 3; continue; } /* */ $s = 4; continue; /* if ($interfaceIsEqual(err, $ifaceNil) && (!delivered || !($interfaceIsEqual(pc.alt, $ifaceNil)))) { */ case 3: $r = t.putOrCloseIdleConn(pc); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 6: $r = t.decConnsPerHost($clone(w.key, connectMethodKey)); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 7: $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Transport.ptr.prototype.dialConnFor }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.delivered = delivered; $f.err = err; $f.pc = pc; $f.t = t; $f.w = w; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Transport.prototype.dialConnFor = function(w) { return this.$val.dialConnFor(w); }; Transport.ptr.prototype.decConnsPerHost = function(key) { var _entry, _entry$1, _key, _key$1, done, key, n, q, t, w, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _key = $f._key; _key$1 = $f._key$1; done = $f.done; key = $f.key; n = $f.n; q = $f.q; t = $f.t; w = $f.w; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); t = this; /* */ if (t.MaxConnsPerHost <= 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (t.MaxConnsPerHost <= 0) { */ case 1: $s = 3; case 3: return; /* } */ case 2: $r = t.connsPerHostMu.Lock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(t.connsPerHostMu, "Unlock"), []]); n = (_entry = t.connsPerHost[connectMethodKey.keyFor(key)], _entry !== undefined ? _entry.v : 0); if (n === 0) { $panic(new $String("net/http: internal error: connCount underflow")); } q = $clone((_entry$1 = t.connsPerHostWait[connectMethodKey.keyFor(key)], _entry$1 !== undefined ? _entry$1.v : new wantConnQueue.ptr(sliceType$8.nil, 0, sliceType$8.nil)), wantConnQueue); /* */ if (q.len() > 0) { $s = 5; continue; } /* */ $s = 6; continue; /* if (q.len() > 0) { */ case 5: done = false; /* while (true) { */ case 7: /* if (!(q.len() > 0)) { break; } */ if(!(q.len() > 0)) { $s = 8; continue; } w = q.popFront(); if (w.waiting()) { $go($methodVal(t, "dialConnFor"), [w]); done = true; /* break; */ $s = 8; continue; } $s = 7; continue; case 8: if (q.len() === 0) { delete t.connsPerHostWait[connectMethodKey.keyFor(key)]; } else { _key = $clone(key, connectMethodKey); (t.connsPerHostWait || $throwRuntimeError("assignment to entry in nil map"))[connectMethodKey.keyFor(_key)] = { k: _key, v: $clone(q, wantConnQueue) }; } /* */ if (done) { $s = 9; continue; } /* */ $s = 10; continue; /* if (done) { */ case 9: $s = 11; case 11: return; /* } */ case 10: /* } */ case 6: n = n - (1) >> 0; if (n === 0) { delete t.connsPerHost[connectMethodKey.keyFor(key)]; } else { _key$1 = $clone(key, connectMethodKey); (t.connsPerHost || $throwRuntimeError("assignment to entry in nil map"))[connectMethodKey.keyFor(_key$1)] = { k: _key$1, v: n }; } $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Transport.ptr.prototype.decConnsPerHost }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._key = _key; $f._key$1 = _key$1; $f.done = done; $f.key = key; $f.n = n; $f.q = q; $f.t = t; $f.w = w; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Transport.prototype.decConnsPerHost = function(key) { return this.$val.decConnsPerHost(key); }; persistConn.ptr.prototype.addTLS = function(ctx, name, trace) { var _r$1, _r$2, _r$3, _r$4, _r$5, cfg, cs, ctx, d, err, errc, name, pconn, plainConn, timer, tlsConn, trace, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; cfg = $f.cfg; cs = $f.cs; ctx = $f.ctx; d = $f.d; err = $f.err; errc = $f.errc; name = $f.name; pconn = $f.pconn; plainConn = $f.plainConn; timer = $f.timer; tlsConn = $f.tlsConn; trace = $f.trace; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cs = [cs]; ctx = [ctx]; errc = [errc]; timer = [timer]; tlsConn = [tlsConn]; trace = [trace]; pconn = this; _r$1 = cloneTLSConfig(pconn.t.TLSClientConfig); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } cfg = _r$1; if (cfg.ServerName === "") { cfg.ServerName = name; } if (pconn.cacheKey.onlyH1) { cfg.NextProtos = sliceType$2.nil; } plainConn = pconn.conn; tlsConn[0] = tls.Client(plainConn, cfg); errc[0] = new $Chan($error, 2); timer[0] = ptrType$25.nil; d = pconn.t.TLSHandshakeTimeout; /* */ if (!((d.$high === 0 && d.$low === 0))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!((d.$high === 0 && d.$low === 0))) { */ case 2: _r$2 = time.AfterFunc(d, (function(cs, ctx, errc, timer, tlsConn, trace) { return function $b() { var x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = $send(errc[0], (x$5 = new tlsHandshakeTimeoutError.ptr(), new x$5.constructor.elem(x$5))); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; })(cs, ctx, errc, timer, tlsConn, trace)); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } timer[0] = _r$2; /* } */ case 3: $go((function(cs, ctx, errc, timer, tlsConn, trace) { return function $b() { var _r$3, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (!(trace[0] === ptrType$19.nil) && !(trace[0].TLSHandshakeStart === $throwNilPointerError)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(trace[0] === ptrType$19.nil) && !(trace[0].TLSHandshakeStart === $throwNilPointerError)) { */ case 1: $r = trace[0].TLSHandshakeStart(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: _r$3 = tlsConn[0].HandshakeContext(ctx[0]); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } err = _r$3; if (!(timer[0] === ptrType$25.nil)) { timer[0].Stop(); } $r = $send(errc[0], err); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$3 = _r$3; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; })(cs, ctx, errc, timer, tlsConn, trace), []); _r$3 = $recv(errc[0]); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } err = _r$3[0]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 6: _r$4 = plainConn.Close(); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; /* */ if (!(trace[0] === ptrType$19.nil) && !(trace[0].TLSHandshakeDone === $throwNilPointerError)) { $s = 9; continue; } /* */ $s = 10; continue; /* if (!(trace[0] === ptrType$19.nil) && !(trace[0].TLSHandshakeDone === $throwNilPointerError)) { */ case 9: $r = trace[0].TLSHandshakeDone(new tls.ConnectionState.ptr(0, false, false, 0, "", false, "", sliceType$10.nil, sliceType$11.nil, sliceType$5.nil, sliceType$3.nil, sliceType$3.nil, $throwNilPointerError), err); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 10: $s = -1; return err; /* } */ case 7: _r$5 = tlsConn[0].ConnectionState(); /* */ $s = 12; case 12: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } cs[0] = $clone(_r$5, tls.ConnectionState); /* */ if (!(trace[0] === ptrType$19.nil) && !(trace[0].TLSHandshakeDone === $throwNilPointerError)) { $s = 13; continue; } /* */ $s = 14; continue; /* if (!(trace[0] === ptrType$19.nil) && !(trace[0].TLSHandshakeDone === $throwNilPointerError)) { */ case 13: $r = trace[0].TLSHandshakeDone($clone(cs[0], tls.ConnectionState), $ifaceNil); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 14: pconn.tlsState = cs[0]; pconn.conn = tlsConn[0]; $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: persistConn.ptr.prototype.addTLS }; } $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.cfg = cfg; $f.cs = cs; $f.ctx = ctx; $f.d = d; $f.err = err; $f.errc = errc; $f.name = name; $f.pconn = pconn; $f.plainConn = plainConn; $f.timer = timer; $f.tlsConn = tlsConn; $f.trace = trace; $f.$s = $s; $f.$r = $r; return $f; }; persistConn.prototype.addTLS = function(ctx, name, trace) { return this.$val.addTLS(ctx, name, trace); }; Transport.ptr.prototype.dialConn = function(ctx, cm) { var $24r, $24r$1, $24r$10, $24r$11, $24r$12, $24r$13, $24r$14, $24r$2, $24r$3, $24r$4, $24r$5, $24r$6, $24r$7, $24r$8, $24r$9, _arg, _arg$1, _arg$2, _arg$3, _arg$4, _entry, _r$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$4, _r$5, _r$6, _r$7, _r$8, _r$9, _selection, _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$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, _tuple$8, _tuple$9, alt, auth, cancel, cm, conn$1, conn$2, conn$3, connectCtx, connectReq, cs, ctx, d, didReadResponse, e, err, err$1, err$2, err$3, err$4, err$5, err$6, err$7, f, firstTLSHost, hdr, newCtx, next, ok, ok$1, ok$2, pa, pa$1, pconn, resp, s, t, tc, trace, u, wrapErr, x$5, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$10 = $f.$24r$10; $24r$11 = $f.$24r$11; $24r$12 = $f.$24r$12; $24r$13 = $f.$24r$13; $24r$14 = $f.$24r$14; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; $24r$6 = $f.$24r$6; $24r$7 = $f.$24r$7; $24r$8 = $f.$24r$8; $24r$9 = $f.$24r$9; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _arg$4 = $f._arg$4; _entry = $f._entry; _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$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$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; _selection = $f._selection; _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$4 = $f._tmp$4; _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 = $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; _tuple$8 = $f._tuple$8; _tuple$9 = $f._tuple$9; alt = $f.alt; auth = $f.auth; cancel = $f.cancel; cm = $f.cm; conn$1 = $f.conn$1; conn$2 = $f.conn$2; conn$3 = $f.conn$3; connectCtx = $f.connectCtx; connectReq = $f.connectReq; cs = $f.cs; ctx = $f.ctx; d = $f.d; didReadResponse = $f.didReadResponse; e = $f.e; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; err$4 = $f.err$4; err$5 = $f.err$5; err$6 = $f.err$6; err$7 = $f.err$7; f = $f.f; firstTLSHost = $f.firstTLSHost; hdr = $f.hdr; newCtx = $f.newCtx; next = $f.next; ok = $f.ok; ok$1 = $f.ok$1; ok$2 = $f.ok$2; pa = $f.pa; pa$1 = $f.pa$1; pconn = $f.pconn; resp = $f.resp; s = $f.s; t = $f.t; tc = $f.tc; trace = $f.trace; u = $f.u; wrapErr = $f.wrapErr; x$5 = $f.x$5; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); cm = [cm]; conn$1 = [conn$1]; connectReq = [connectReq]; cs = [cs]; didReadResponse = [didReadResponse]; err = [err]; pa = [pa]; resp = [resp]; pconn = ptrType$22.nil; err$1 = $ifaceNil; t = this; pconn = new persistConn.ptr($ifaceNil, t, $clone(cm[0].key(), connectMethodKey), $ifaceNil, ptrType$28.nil, ptrType$29.nil, ptrType$14.nil, new $Int64(0, 0), new $Chan(requestAndChan, 1), new $Chan(writeRequest, 1), new $Chan(structType, 0), false, false, new $Int64(0, 0), new $Chan($error, 1), new $Chan(structType, 0), new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil), ptrType$25.nil, new sync.Mutex.ptr(0, 0), 0, $ifaceNil, $ifaceNil, false, false, $throwNilPointerError); _r$1 = httptrace.ContextClientTrace(ctx); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } trace = _r$1; wrapErr = (function(cm, conn$1, connectReq, cs, didReadResponse, err, pa, resp) { return function(err$2) { var err$2; if (!(cm[0].proxyURL === ptrType$17.nil)) { return new net.OpError.ptr("proxyconnect", "tcp", $ifaceNil, $ifaceNil, err$2); } return err$2; }; })(cm, conn$1, connectReq, cs, didReadResponse, err, pa, resp); /* */ if (cm[0].scheme() === "https" && t.hasCustomTLSDialer()) { $s = 2; continue; } /* */ $s = 3; continue; /* if (cm[0].scheme() === "https" && t.hasCustomTLSDialer()) { */ case 2: err$2 = $ifaceNil; _arg = ctx; _r$2 = cm[0].addr(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg$1 = _r$2; _r$3 = t.customDialTLS(_arg, "tcp", _arg$1); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; pconn.conn = _tuple[0]; err$2 = _tuple[1]; /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 7: _tmp = ptrType$22.nil; _r$4 = wrapErr(err$2); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tmp$1 = _r$4; pconn = _tmp; err$1 = _tmp$1; $24r = [pconn, err$1]; $s = 10; case 10: return $24r; /* } */ case 8: _tuple$1 = $assertType(pconn.conn, ptrType$30, true); tc = _tuple$1[0]; ok = _tuple$1[1]; /* */ if (ok) { $s = 11; continue; } /* */ $s = 12; continue; /* if (ok) { */ case 11: /* */ if (!(trace === ptrType$19.nil) && !(trace.TLSHandshakeStart === $throwNilPointerError)) { $s = 13; continue; } /* */ $s = 14; continue; /* if (!(trace === ptrType$19.nil) && !(trace.TLSHandshakeStart === $throwNilPointerError)) { */ case 13: $r = trace.TLSHandshakeStart(); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 14: _r$5 = tc.HandshakeContext(ctx); /* */ $s = 16; case 16: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } err$3 = _r$5; /* */ if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = 17; continue; } /* */ $s = 18; continue; /* if (!($interfaceIsEqual(err$3, $ifaceNil))) { */ case 17: $go($methodVal(pconn.conn, "Close"), []); /* */ if (!(trace === ptrType$19.nil) && !(trace.TLSHandshakeDone === $throwNilPointerError)) { $s = 19; continue; } /* */ $s = 20; continue; /* if (!(trace === ptrType$19.nil) && !(trace.TLSHandshakeDone === $throwNilPointerError)) { */ case 19: $r = trace.TLSHandshakeDone(new tls.ConnectionState.ptr(0, false, false, 0, "", false, "", sliceType$10.nil, sliceType$11.nil, sliceType$5.nil, sliceType$3.nil, sliceType$3.nil, $throwNilPointerError), err$3); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 20: _tmp$2 = ptrType$22.nil; _tmp$3 = err$3; pconn = _tmp$2; err$1 = _tmp$3; $24r$1 = [pconn, err$1]; $s = 22; case 22: return $24r$1; /* } */ case 18: _r$6 = tc.ConnectionState(); /* */ $s = 23; case 23: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } cs[0] = $clone(_r$6, tls.ConnectionState); /* */ if (!(trace === ptrType$19.nil) && !(trace.TLSHandshakeDone === $throwNilPointerError)) { $s = 24; continue; } /* */ $s = 25; continue; /* if (!(trace === ptrType$19.nil) && !(trace.TLSHandshakeDone === $throwNilPointerError)) { */ case 24: $r = trace.TLSHandshakeDone($clone(cs[0], tls.ConnectionState), $ifaceNil); /* */ $s = 26; case 26: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 25: pconn.tlsState = cs[0]; /* } */ case 12: $s = 4; continue; /* } else { */ case 3: _arg$2 = ctx; _r$7 = cm[0].addr(); /* */ $s = 27; case 27: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _arg$3 = _r$7; _r$8 = t.dial(_arg$2, "tcp", _arg$3); /* */ $s = 28; case 28: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _tuple$2 = _r$8; conn$2 = _tuple$2[0]; err$4 = _tuple$2[1]; /* */ if (!($interfaceIsEqual(err$4, $ifaceNil))) { $s = 29; continue; } /* */ $s = 30; continue; /* if (!($interfaceIsEqual(err$4, $ifaceNil))) { */ case 29: _tmp$4 = ptrType$22.nil; _r$9 = wrapErr(err$4); /* */ $s = 31; case 31: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tmp$5 = _r$9; pconn = _tmp$4; err$1 = _tmp$5; $24r$2 = [pconn, err$1]; $s = 32; case 32: return $24r$2; /* } */ case 30: pconn.conn = conn$2; /* */ if (cm[0].scheme() === "https") { $s = 33; continue; } /* */ $s = 34; continue; /* if (cm[0].scheme() === "https") { */ case 33: firstTLSHost = ""; _r$10 = cm[0].addr(); /* */ $s = 35; case 35: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$11 = net.SplitHostPort(_r$10); /* */ $s = 36; case 36: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tuple$3 = _r$11; firstTLSHost = _tuple$3[0]; err$4 = _tuple$3[2]; /* */ if (!($interfaceIsEqual(err$4, $ifaceNil))) { $s = 37; continue; } /* */ $s = 38; continue; /* if (!($interfaceIsEqual(err$4, $ifaceNil))) { */ case 37: _tmp$6 = ptrType$22.nil; _r$12 = wrapErr(err$4); /* */ $s = 39; case 39: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _tmp$7 = _r$12; pconn = _tmp$6; err$1 = _tmp$7; $24r$3 = [pconn, err$1]; $s = 40; case 40: return $24r$3; /* } */ case 38: _r$13 = pconn.addTLS(ctx, firstTLSHost, trace); /* */ $s = 41; case 41: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } err$4 = _r$13; /* */ if (!($interfaceIsEqual(err$4, $ifaceNil))) { $s = 42; continue; } /* */ $s = 43; continue; /* if (!($interfaceIsEqual(err$4, $ifaceNil))) { */ case 42: _tmp$8 = ptrType$22.nil; _r$14 = wrapErr(err$4); /* */ $s = 44; case 44: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _tmp$9 = _r$14; pconn = _tmp$8; err$1 = _tmp$9; $24r$4 = [pconn, err$1]; $s = 45; case 45: return $24r$4; /* } */ case 43: /* } */ case 34: /* } */ case 4: /* */ if (cm[0].proxyURL === ptrType$17.nil) { $s = 47; continue; } /* */ if (cm[0].proxyURL.Scheme === "socks5") { $s = 48; continue; } /* */ if (cm[0].targetScheme === "http") { $s = 49; continue; } /* */ if (cm[0].targetScheme === "https") { $s = 50; continue; } /* */ $s = 51; continue; /* if (cm[0].proxyURL === ptrType$17.nil) { */ case 47: $s = 51; continue; /* } else if (cm[0].proxyURL.Scheme === "socks5") { */ case 48: conn$3 = pconn.conn; _r$15 = conn$3.RemoteAddr(); /* */ $s = 52; case 52: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _r$16 = _r$15.String(); /* */ $s = 53; case 53: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _arg$4 = _r$16; _r$17 = socksNewDialer("tcp", _arg$4); /* */ $s = 54; case 54: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } d = _r$17; u = cm[0].proxyURL.User; if (!(u === ptrType$21.nil)) { auth = new socksUsernamePassword.ptr(u.Username(), ""); _tuple$4 = u.Password(); auth.Password = _tuple$4[0]; d.AuthMethods = new sliceType$12([0, 2]); d.Authenticate = $methodVal(auth, "Authenticate"); } _r$18 = d.DialWithConn(ctx, conn$3, "tcp", cm[0].targetAddr); /* */ $s = 55; case 55: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } _tuple$5 = _r$18; err$5 = _tuple$5[1]; /* */ if (!($interfaceIsEqual(err$5, $ifaceNil))) { $s = 56; continue; } /* */ $s = 57; continue; /* if (!($interfaceIsEqual(err$5, $ifaceNil))) { */ case 56: _r$19 = conn$3.Close(); /* */ $s = 58; case 58: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } _r$19; _tmp$10 = ptrType$22.nil; _tmp$11 = err$5; pconn = _tmp$10; err$1 = _tmp$11; $24r$5 = [pconn, err$1]; $s = 59; case 59: return $24r$5; /* } */ case 57: $s = 51; continue; /* } else if (cm[0].targetScheme === "http") { */ case 49: pconn.isProxy = true; pa[0] = cm[0].proxyAuth(); if (!(pa[0] === "")) { pconn.mutateHeaderFunc = (function(cm, conn$1, connectReq, cs, didReadResponse, err, pa, resp) { return function $b(h) { var h, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; h = $f.h; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = new Header(h).Set("Proxy-Authorization", pa[0]); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.h = h; $f.$s = $s; $f.$r = $r; return $f; }; })(cm, conn$1, connectReq, cs, didReadResponse, err, pa, resp); } $s = 51; continue; /* } else if (cm[0].targetScheme === "https") { */ case 50: conn$1[0] = pconn.conn; hdr = false; /* */ if (!(t.GetProxyConnectHeader === $throwNilPointerError)) { $s = 60; continue; } /* */ $s = 61; continue; /* if (!(t.GetProxyConnectHeader === $throwNilPointerError)) { */ case 60: err$6 = $ifaceNil; _r$20 = t.GetProxyConnectHeader(ctx, cm[0].proxyURL, cm[0].targetAddr); /* */ $s = 63; case 63: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } _tuple$6 = _r$20; hdr = _tuple$6[0]; err$6 = _tuple$6[1]; /* */ if (!($interfaceIsEqual(err$6, $ifaceNil))) { $s = 64; continue; } /* */ $s = 65; continue; /* if (!($interfaceIsEqual(err$6, $ifaceNil))) { */ case 64: _r$21 = conn$1[0].Close(); /* */ $s = 66; case 66: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } _r$21; _tmp$12 = ptrType$22.nil; _tmp$13 = err$6; pconn = _tmp$12; err$1 = _tmp$13; $24r$6 = [pconn, err$1]; $s = 67; case 67: return $24r$6; /* } */ case 65: $s = 62; continue; /* } else { */ case 61: hdr = t.ProxyConnectHeader; /* } */ case 62: if (hdr === false) { hdr = {}; } pa$1 = cm[0].proxyAuth(); /* */ if (!(pa$1 === "")) { $s = 68; continue; } /* */ $s = 69; continue; /* if (!(pa$1 === "")) { */ case 68: hdr = new Header(hdr).Clone(); $r = new Header(hdr).Set("Proxy-Authorization", pa$1); /* */ $s = 70; case 70: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 69: connectReq[0] = new Request.ptr("CONNECT", new url.URL.ptr("", cm[0].targetAddr, ptrType$21.nil, "", "", "", false, "", "", ""), "", 0, 0, hdr, $ifaceNil, $throwNilPointerError, new $Int64(0, 0), sliceType$2.nil, false, cm[0].targetAddr, false, false, ptrType$31.nil, false, "", "", ptrType$28.nil, $chanNil, ptrType$18.nil, $ifaceNil); connectCtx = ctx; _r$22 = ctx.Done(); /* */ $s = 73; case 73: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; } /* */ if (_r$22 === $chanNil) { $s = 71; continue; } /* */ $s = 72; continue; /* if (_r$22 === $chanNil) { */ case 71: _r$23 = context.WithTimeout(ctx, new time.Duration(13, 4165425152)); /* */ $s = 74; case 74: if($c) { $c = false; _r$23 = _r$23.$blk(); } if (_r$23 && _r$23.$blk !== undefined) { break s; } _tuple$7 = _r$23; newCtx = _tuple$7[0]; cancel = _tuple$7[1]; $deferred.push([cancel, []]); connectCtx = newCtx; /* } */ case 72: didReadResponse[0] = new $Chan(structType, 0); resp[0] = ptrType$18.nil; err[0] = $ifaceNil; $go((function(cm, conn$1, connectReq, cs, didReadResponse, err, pa, resp) { return function $b() { var _arg$5, _r$24, _r$25, _tuple$8, br, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg$5 = $f._arg$5; _r$24 = $f._r$24; _r$25 = $f._r$25; _tuple$8 = $f._tuple$8; br = $f.br; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); $deferred.push([function(_arg$5) { $close(_arg$5); }, [didReadResponse[0]]]); _r$24 = connectReq[0].Write(conn$1[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r$24 = _r$24.$blk(); } if (_r$24 && _r$24.$blk !== undefined) { break s; } err[0] = _r$24; /* */ if (!($interfaceIsEqual(err[0], $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err[0], $ifaceNil))) { */ case 2: $s = 4; case 4: return; /* } */ case 3: br = bufio.NewReader(conn$1[0]); _r$25 = ReadResponse(br, connectReq[0]); /* */ $s = 5; case 5: if($c) { $c = false; _r$25 = _r$25.$blk(); } if (_r$25 && _r$25.$blk !== undefined) { break s; } _tuple$8 = _r$25; resp[0] = _tuple$8[0]; err[0] = _tuple$8[1]; $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: $b }; } $f._arg$5 = _arg$5; $f._r$24 = _r$24; $f._r$25 = _r$25; $f._tuple$8 = _tuple$8; $f.br = br; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; })(cm, conn$1, connectReq, cs, didReadResponse, err, pa, resp), []); _r$24 = connectCtx.Done(); /* */ $s = 75; case 75: if($c) { $c = false; _r$24 = _r$24.$blk(); } if (_r$24 && _r$24.$blk !== undefined) { break s; } _r$25 = $select([[_r$24], [didReadResponse[0]]]); /* */ $s = 76; case 76: if($c) { $c = false; _r$25 = _r$25.$blk(); } if (_r$25 && _r$25.$blk !== undefined) { break s; } _selection = _r$25; /* */ if (_selection[0] === 0) { $s = 77; continue; } /* */ if (_selection[0] === 1) { $s = 78; continue; } /* */ $s = 79; continue; /* if (_selection[0] === 0) { */ case 77: _r$26 = conn$1[0].Close(); /* */ $s = 80; case 80: if($c) { $c = false; _r$26 = _r$26.$blk(); } if (_r$26 && _r$26.$blk !== undefined) { break s; } _r$26; _r$27 = $recv(didReadResponse[0]); /* */ $s = 81; case 81: if($c) { $c = false; _r$27 = _r$27.$blk(); } if (_r$27 && _r$27.$blk !== undefined) { break s; } _r$27[0]; _tmp$14 = ptrType$22.nil; _r$28 = connectCtx.Err(); /* */ $s = 82; case 82: if($c) { $c = false; _r$28 = _r$28.$blk(); } if (_r$28 && _r$28.$blk !== undefined) { break s; } _tmp$15 = _r$28; pconn = _tmp$14; err$1 = _tmp$15; $24r$7 = [pconn, err$1]; $s = 83; case 83: return $24r$7; /* } else if (_selection[0] === 1) { */ case 78: /* } */ case 79: /* */ if (!($interfaceIsEqual(err[0], $ifaceNil))) { $s = 84; continue; } /* */ $s = 85; continue; /* if (!($interfaceIsEqual(err[0], $ifaceNil))) { */ case 84: _r$29 = conn$1[0].Close(); /* */ $s = 86; case 86: if($c) { $c = false; _r$29 = _r$29.$blk(); } if (_r$29 && _r$29.$blk !== undefined) { break s; } _r$29; _tmp$16 = ptrType$22.nil; _tmp$17 = err[0]; pconn = _tmp$16; err$1 = _tmp$17; $24r$8 = [pconn, err$1]; $s = 87; case 87: return $24r$8; /* } */ case 85: /* */ if (!((resp[0].StatusCode === 200))) { $s = 88; continue; } /* */ $s = 89; continue; /* if (!((resp[0].StatusCode === 200))) { */ case 88: f = strings.SplitN(resp[0].Status, " ", 2); _r$30 = conn$1[0].Close(); /* */ $s = 90; case 90: if($c) { $c = false; _r$30 = _r$30.$blk(); } if (_r$30 && _r$30.$blk !== undefined) { break s; } _r$30; /* */ if (f.$length < 2) { $s = 91; continue; } /* */ $s = 92; continue; /* if (f.$length < 2) { */ case 91: _tmp$18 = ptrType$22.nil; _tmp$19 = errors.New("unknown status code"); pconn = _tmp$18; err$1 = _tmp$19; $24r$9 = [pconn, err$1]; $s = 93; case 93: return $24r$9; /* } */ case 92: _tmp$20 = ptrType$22.nil; _tmp$21 = errors.New((1 >= f.$length ? ($throwRuntimeError("index out of range"), undefined) : f.$array[f.$offset + 1])); pconn = _tmp$20; err$1 = _tmp$21; $24r$10 = [pconn, err$1]; $s = 94; case 94: return $24r$10; /* } */ case 89: /* } */ case 51: case 46: /* */ if (!(cm[0].proxyURL === ptrType$17.nil) && cm[0].targetScheme === "https") { $s = 95; continue; } /* */ $s = 96; continue; /* if (!(cm[0].proxyURL === ptrType$17.nil) && cm[0].targetScheme === "https") { */ case 95: _r$31 = pconn.addTLS(ctx, cm[0].tlsHost(), trace); /* */ $s = 97; case 97: if($c) { $c = false; _r$31 = _r$31.$blk(); } if (_r$31 && _r$31.$blk !== undefined) { break s; } err$7 = _r$31; /* */ if (!($interfaceIsEqual(err$7, $ifaceNil))) { $s = 98; continue; } /* */ $s = 99; continue; /* if (!($interfaceIsEqual(err$7, $ifaceNil))) { */ case 98: _tmp$22 = ptrType$22.nil; _tmp$23 = err$7; pconn = _tmp$22; err$1 = _tmp$23; $24r$11 = [pconn, err$1]; $s = 100; case 100: return $24r$11; /* } */ case 99: /* } */ case 96: s = pconn.tlsState; /* */ if (!(s === ptrType$28.nil) && s.NegotiatedProtocolIsMutual && !(s.NegotiatedProtocol === "")) { $s = 101; continue; } /* */ $s = 102; continue; /* if (!(s === ptrType$28.nil) && s.NegotiatedProtocolIsMutual && !(s.NegotiatedProtocol === "")) { */ case 101: _tuple$8 = (_entry = t.TLSNextProto[$String.keyFor(s.NegotiatedProtocol)], _entry !== undefined ? [_entry.v, true] : [$throwNilPointerError, false]); next = _tuple$8[0]; ok$1 = _tuple$8[1]; /* */ if (ok$1) { $s = 103; continue; } /* */ $s = 104; continue; /* if (ok$1) { */ case 103: _r$32 = next(cm[0].targetAddr, $assertType(pconn.conn, ptrType$30)); /* */ $s = 105; case 105: if($c) { $c = false; _r$32 = _r$32.$blk(); } if (_r$32 && _r$32.$blk !== undefined) { break s; } alt = _r$32; _tuple$9 = $assertType(alt, erringRoundTripper, true); e = _tuple$9[0]; ok$2 = _tuple$9[1]; /* */ if (ok$2) { $s = 106; continue; } /* */ $s = 107; continue; /* if (ok$2) { */ case 106: _tmp$24 = ptrType$22.nil; _r$33 = e.RoundTripErr(); /* */ $s = 108; case 108: if($c) { $c = false; _r$33 = _r$33.$blk(); } if (_r$33 && _r$33.$blk !== undefined) { break s; } _tmp$25 = _r$33; pconn = _tmp$24; err$1 = _tmp$25; $24r$12 = [pconn, err$1]; $s = 109; case 109: return $24r$12; /* } */ case 107: _tmp$26 = new persistConn.ptr(alt, t, $clone(pconn.cacheKey, connectMethodKey), $ifaceNil, ptrType$28.nil, ptrType$29.nil, ptrType$14.nil, new $Int64(0, 0), $chanNil, $chanNil, $chanNil, false, false, new $Int64(0, 0), $chanNil, $chanNil, new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil), ptrType$25.nil, new sync.Mutex.ptr(0, 0), 0, $ifaceNil, $ifaceNil, false, false, $throwNilPointerError); _tmp$27 = $ifaceNil; pconn = _tmp$26; err$1 = _tmp$27; $24r$13 = [pconn, err$1]; $s = 110; case 110: return $24r$13; /* } */ case 104: /* } */ case 102: pconn.br = bufio.NewReaderSize(pconn, t.readBufferSize()); pconn.bw = bufio.NewWriterSize((x$5 = new persistConnWriter.ptr(pconn), new x$5.constructor.elem(x$5)), t.writeBufferSize()); $go($methodVal(pconn, "readLoop"), []); $go($methodVal(pconn, "writeLoop"), []); _tmp$28 = pconn; _tmp$29 = $ifaceNil; pconn = _tmp$28; err$1 = _tmp$29; $24r$14 = [pconn, err$1]; $s = 111; case 111: return $24r$14; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [pconn, err$1]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Transport.ptr.prototype.dialConn }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$10 = $24r$10; $f.$24r$11 = $24r$11; $f.$24r$12 = $24r$12; $f.$24r$13 = $24r$13; $f.$24r$14 = $24r$14; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f.$24r$6 = $24r$6; $f.$24r$7 = $24r$7; $f.$24r$8 = $24r$8; $f.$24r$9 = $24r$9; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._arg$4 = _arg$4; $f._entry = _entry; $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$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$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._selection = _selection; $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$4 = _tmp$4; $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 = _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._tuple$8 = _tuple$8; $f._tuple$9 = _tuple$9; $f.alt = alt; $f.auth = auth; $f.cancel = cancel; $f.cm = cm; $f.conn$1 = conn$1; $f.conn$2 = conn$2; $f.conn$3 = conn$3; $f.connectCtx = connectCtx; $f.connectReq = connectReq; $f.cs = cs; $f.ctx = ctx; $f.d = d; $f.didReadResponse = didReadResponse; $f.e = e; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.err$4 = err$4; $f.err$5 = err$5; $f.err$6 = err$6; $f.err$7 = err$7; $f.f = f; $f.firstTLSHost = firstTLSHost; $f.hdr = hdr; $f.newCtx = newCtx; $f.next = next; $f.ok = ok; $f.ok$1 = ok$1; $f.ok$2 = ok$2; $f.pa = pa; $f.pa$1 = pa$1; $f.pconn = pconn; $f.resp = resp; $f.s = s; $f.t = t; $f.tc = tc; $f.trace = trace; $f.u = u; $f.wrapErr = wrapErr; $f.x$5 = x$5; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Transport.prototype.dialConn = function(ctx, cm) { return this.$val.dialConn(ctx, cm); }; persistConnWriter.ptr.prototype.Write = function(p) { var _r$1, _tuple, err, n, p, w, x$5, x$6, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; n = $f.n; p = $f.p; w = $f.w; x$5 = $f.x$5; x$6 = $f.x$6; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; w = this; _r$1 = w.pc.conn.Write(p); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err = _tuple[1]; w.pc.nwrite = (x$5 = w.pc.nwrite, x$6 = (new $Int64(0, n)), new $Int64(x$5.$high + x$6.$high, x$5.$low + x$6.$low)); $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: persistConnWriter.ptr.prototype.Write }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.n = n; $f.p = p; $f.w = w; $f.x$5 = x$5; $f.x$6 = x$6; $f.$s = $s; $f.$r = $r; return $f; }; persistConnWriter.prototype.Write = function(p) { return this.$val.Write(p); }; persistConnWriter.ptr.prototype.ReadFrom = function(r) { var _r$1, _tuple, err, n, r, w, x$5, x$6, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; n = $f.n; r = $f.r; w = $f.w; x$5 = $f.x$5; x$6 = $f.x$6; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = new $Int64(0, 0); err = $ifaceNil; w = this; _r$1 = io.Copy(w.pc.conn, r); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err = _tuple[1]; w.pc.nwrite = (x$5 = w.pc.nwrite, x$6 = n, new $Int64(x$5.$high + x$6.$high, x$5.$low + x$6.$low)); $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: persistConnWriter.ptr.prototype.ReadFrom }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.n = n; $f.r = r; $f.w = w; $f.x$5 = x$5; $f.x$6 = x$6; $f.$s = $s; $f.$r = $r; return $f; }; persistConnWriter.prototype.ReadFrom = function(r) { return this.$val.ReadFrom(r); }; connectMethod.ptr.prototype.key = function() { var cm, proxyStr, targetAddr; cm = this; proxyStr = ""; targetAddr = cm.targetAddr; if (!(cm.proxyURL === ptrType$17.nil)) { proxyStr = cm.proxyURL.String(); if ((cm.proxyURL.Scheme === "http" || cm.proxyURL.Scheme === "https") && cm.targetScheme === "http") { targetAddr = ""; } } return new connectMethodKey.ptr(proxyStr, cm.targetScheme, targetAddr, cm.onlyH1); }; connectMethod.prototype.key = function() { return this.$val.key(); }; connectMethod.ptr.prototype.scheme = function() { var cm; cm = this; if (!(cm.proxyURL === ptrType$17.nil)) { return cm.proxyURL.Scheme; } return cm.targetScheme; }; connectMethod.prototype.scheme = function() { return this.$val.scheme(); }; connectMethod.ptr.prototype.addr = function() { var $24r, _r$1, cm, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; cm = $f.cm; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cm = this; /* */ if (!(cm.proxyURL === ptrType$17.nil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(cm.proxyURL === ptrType$17.nil)) { */ case 1: _r$1 = canonicalAddr(cm.proxyURL); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 4; case 4: return $24r; /* } */ case 2: $s = -1; return cm.targetAddr; /* */ } return; } if ($f === undefined) { $f = { $blk: connectMethod.ptr.prototype.addr }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.cm = cm; $f.$s = $s; $f.$r = $r; return $f; }; connectMethod.prototype.addr = function() { return this.$val.addr(); }; connectMethod.ptr.prototype.tlsHost = function() { var cm, h; cm = this; h = cm.targetAddr; if (hasPort(h)) { h = $substring(h, 0, strings.LastIndex(h, ":")); } return h; }; connectMethod.prototype.tlsHost = function() { return this.$val.tlsHost(); }; connectMethodKey.ptr.prototype.String = function() { var $24r, _r$1, h1, k, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; h1 = $f.h1; k = $f.k; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: k = this; h1 = ""; if (k.onlyH1) { h1 = ",h1"; } _r$1 = fmt.Sprintf("%s|%s%s|%s", new sliceType([new $String(k.proxy), new $String(k.scheme), new $String(h1), new $String(k.addr)])); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: connectMethodKey.ptr.prototype.String }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.h1 = h1; $f.k = k; $f.$s = $s; $f.$r = $r; return $f; }; connectMethodKey.prototype.String = function() { return this.$val.String(); }; persistConn.ptr.prototype.maxHeaderResponseSize = function() { var pc, v; pc = this; v = pc.t.MaxResponseHeaderBytes; if (!((v.$high === 0 && v.$low === 0))) { return v; } return new $Int64(0, 10485760); }; persistConn.prototype.maxHeaderResponseSize = function() { return this.$val.maxHeaderResponseSize(); }; persistConn.ptr.prototype.Read = function(p) { var $24r, _r$1, _r$2, _tmp, _tmp$1, _tuple, err, n, p, pc, 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; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; err = $f.err; n = $f.n; p = $f.p; pc = $f.pc; 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: n = 0; err = $ifaceNil; pc = this; /* */ if ((x$5 = pc.readLimit, (x$5.$high < 0 || (x$5.$high === 0 && x$5.$low <= 0)))) { $s = 1; continue; } /* */ $s = 2; continue; /* if ((x$5 = pc.readLimit, (x$5.$high < 0 || (x$5.$high === 0 && x$5.$low <= 0)))) { */ case 1: _tmp = 0; _r$1 = fmt.Errorf("read limit of %d bytes exhausted", new sliceType([pc.maxHeaderResponseSize()])); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tmp$1 = _r$1; n = _tmp; err = _tmp$1; $24r = [n, err]; $s = 4; case 4: return $24r; /* } */ case 2: if ((x$6 = (new $Int64(0, p.$length)), x$7 = pc.readLimit, (x$6.$high > x$7.$high || (x$6.$high === x$7.$high && x$6.$low > x$7.$low)))) { p = $subslice(p, 0, $flatten64(pc.readLimit)); } _r$2 = pc.conn.Read(p); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; n = _tuple[0]; err = _tuple[1]; if ($interfaceIsEqual(err, io.EOF)) { pc.sawEOF = true; } pc.readLimit = (x$8 = pc.readLimit, x$9 = (new $Int64(0, n)), new $Int64(x$8.$high - x$9.$high, x$8.$low - x$9.$low)); $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: persistConn.ptr.prototype.Read }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.err = err; $f.n = n; $f.p = p; $f.pc = pc; $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; }; persistConn.prototype.Read = function(p) { return this.$val.Read(p); }; persistConn.ptr.prototype.isBroken = function() { var b, pc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; pc = $f.pc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: pc = this; $r = pc.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } b = !($interfaceIsEqual(pc.closed, $ifaceNil)); $r = pc.mu.Unlock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return b; /* */ } return; } if ($f === undefined) { $f = { $blk: persistConn.ptr.prototype.isBroken }; } $f.b = b; $f.pc = pc; $f.$s = $s; $f.$r = $r; return $f; }; persistConn.prototype.isBroken = function() { return this.$val.isBroken(); }; persistConn.ptr.prototype.canceled = function() { var $24r, pc, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; pc = $f.pc; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); pc = this; $r = pc.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(pc.mu, "Unlock"), []]); $24r = pc.canceledErr; $s = 2; case 2: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: persistConn.ptr.prototype.canceled }; } $f.$24r = $24r; $f.pc = pc; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; persistConn.prototype.canceled = function() { return this.$val.canceled(); }; persistConn.ptr.prototype.isReused = function() { var pc, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; pc = $f.pc; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: pc = this; $r = pc.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } r = pc.reused; $r = pc.mu.Unlock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return r; /* */ } return; } if ($f === undefined) { $f = { $blk: persistConn.ptr.prototype.isReused }; } $f.pc = pc; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; persistConn.prototype.isReused = function() { return this.$val.isReused(); }; persistConn.ptr.prototype.gotIdleConnTrace = function(idleAt) { var $24r, _r$1, idleAt, pc, t, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; idleAt = $f.idleAt; pc = $f.pc; t = $f.t; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); t = new httptrace.GotConnInfo.ptr($ifaceNil, false, false, new time.Duration(0, 0)); pc = this; $r = pc.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(pc.mu, "Unlock"), []]); t.Reused = pc.reused; t.Conn = pc.conn; t.WasIdle = true; /* */ if (!$clone(idleAt, time.Time).IsZero()) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!$clone(idleAt, time.Time).IsZero()) { */ case 2: _r$1 = time.Since($clone(idleAt, time.Time)); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } t.IdleTime = _r$1; /* } */ case 3: $24r = t; $s = 5; case 5: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return t; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: persistConn.ptr.prototype.gotIdleConnTrace }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.idleAt = idleAt; $f.pc = pc; $f.t = t; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; persistConn.prototype.gotIdleConnTrace = function(idleAt) { return this.$val.gotIdleConnTrace(idleAt); }; persistConn.ptr.prototype.cancelRequest = function(err) { var err, pc, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; pc = $f.pc; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); pc = this; $r = pc.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(pc.mu, "Unlock"), []]); pc.canceledErr = err; $r = pc.closeLocked(errRequestCanceled); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: persistConn.ptr.prototype.cancelRequest }; } $f.err = err; $f.pc = pc; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; persistConn.prototype.cancelRequest = function(err) { return this.$val.cancelRequest(err); }; persistConn.ptr.prototype.closeConnIfStillIdle = function() { var _entry, _tuple, ok, pc, t, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _tuple = $f._tuple; ok = $f.ok; pc = $f.pc; t = $f.t; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); pc = this; t = pc.t; $r = t.idleMu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(t.idleMu, "Unlock"), []]); _tuple = (_entry = t.idleLRU.m[ptrType$22.keyFor(pc)], _entry !== undefined ? [_entry.v, true] : [ptrType$23.nil, false]); ok = _tuple[1]; /* */ if (!ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!ok) { */ case 2: $s = 4; case 4: return; /* } */ case 3: t.removeIdleConnLocked(pc); $r = pc.close(errIdleConnTimeout); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: persistConn.ptr.prototype.closeConnIfStillIdle }; } $f._entry = _entry; $f._tuple = _tuple; $f.ok = ok; $f.pc = pc; $f.t = t; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; persistConn.prototype.closeConnIfStillIdle = function() { return this.$val.closeConnIfStillIdle(); }; persistConn.ptr.prototype.mapRoundTripError = function(req, startBytesWritten, err) { var $24r, _r$1, _r$2, _r$3, _r$4, _tuple, cerr, err, ok, pc, req, reqErr, startBytesWritten, x$5, x$6, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; cerr = $f.cerr; err = $f.err; ok = $f.ok; pc = $f.pc; req = $f.req; reqErr = $f.reqErr; startBytesWritten = $f.startBytesWritten; x$5 = $f.x$5; x$6 = $f.x$6; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: pc = this; if ($interfaceIsEqual(err, $ifaceNil)) { $s = -1; return $ifaceNil; } _r$1 = $recv(pc.writeLoopDone); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1[0]; _r$2 = pc.canceled(); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } cerr = _r$2; if (!($interfaceIsEqual(cerr, $ifaceNil))) { $s = -1; return cerr; } $r = req.mu.Lock(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } reqErr = req.err; $r = req.mu.Unlock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (!($interfaceIsEqual(reqErr, $ifaceNil))) { $s = -1; return reqErr; } if ($interfaceIsEqual(err, errServerClosedIdle)) { $s = -1; return err; } _tuple = $assertType(err, transportReadFromServerError, true); ok = _tuple[1]; if (ok) { $s = -1; return err; } _r$3 = pc.isBroken(); /* */ $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) { $s = 5; continue; } /* */ $s = 6; continue; /* if (_r$3) { */ case 5: if ((x$5 = pc.nwrite, (x$5.$high === startBytesWritten.$high && x$5.$low === startBytesWritten.$low))) { $s = -1; return (x$6 = new nothingWrittenError.ptr(err), new x$6.constructor.elem(x$6)); } _r$4 = fmt.Errorf("net/http: HTTP/1.x transport connection broken: %v", new sliceType([err])); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r = _r$4; $s = 9; case 9: return $24r; /* } */ case 6: $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: persistConn.ptr.prototype.mapRoundTripError }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f.cerr = cerr; $f.err = err; $f.ok = ok; $f.pc = pc; $f.req = req; $f.reqErr = reqErr; $f.startBytesWritten = startBytesWritten; $f.x$5 = x$5; $f.x$6 = x$6; $f.$s = $s; $f.$r = $r; return $f; }; persistConn.prototype.mapRoundTripError = function(req, startBytesWritten, err) { return this.$val.mapRoundTripError(req, startBytesWritten, err); }; persistConn.ptr.prototype.readLoop = function() { var _arg, _arg$1, _arg$2, _r$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$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _selection, _selection$1, _selection$2, _selection$3, _tuple, _tuple$1, _v, _v$1, _v$2, _v$3, _v$4, alive, body$1, bodyEOF, bodyWritable, closeErr, eofc, err, hasBody, pc, rc, replaced, replaced$1, resp, testHookReadLoopBeforeNextRead$1, trace, tryPutIdleConn, waitForBodyRead, x$5, x$6, x$7, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _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$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$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; _selection = $f._selection; _selection$1 = $f._selection$1; _selection$2 = $f._selection$2; _selection$3 = $f._selection$3; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _v = $f._v; _v$1 = $f._v$1; _v$2 = $f._v$2; _v$3 = $f._v$3; _v$4 = $f._v$4; alive = $f.alive; body$1 = $f.body$1; bodyEOF = $f.bodyEOF; bodyWritable = $f.bodyWritable; closeErr = $f.closeErr; eofc = $f.eofc; err = $f.err; hasBody = $f.hasBody; pc = $f.pc; rc = $f.rc; replaced = $f.replaced; replaced$1 = $f.replaced$1; resp = $f.resp; testHookReadLoopBeforeNextRead$1 = $f.testHookReadLoopBeforeNextRead$1; trace = $f.trace; tryPutIdleConn = $f.tryPutIdleConn; waitForBodyRead = $f.waitForBodyRead; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); closeErr = [closeErr]; eofc = [eofc]; pc = [pc]; pc[0] = this; closeErr[0] = errReadLoopExiting; $deferred.push([(function(closeErr, eofc, pc) { return function $b() { var _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = pc[0].close(closeErr[0]); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = pc[0].t.removeIdleConn(pc[0]); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }; })(closeErr, eofc, pc), []]); tryPutIdleConn = (function(closeErr, eofc, pc) { return function $b(trace) { var _r$1, err, trace, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; err = $f.err; trace = $f.trace; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = pc[0].t.tryPutIdleConn(pc[0]); /* */ $s = 1; case 1: 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))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: closeErr[0] = err; /* */ if (!(trace === ptrType$19.nil) && !(trace.PutIdleConn === $throwNilPointerError) && !($interfaceIsEqual(err, errKeepAlivesDisabled))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!(trace === ptrType$19.nil) && !(trace.PutIdleConn === $throwNilPointerError) && !($interfaceIsEqual(err, errKeepAlivesDisabled))) { */ case 4: $r = trace.PutIdleConn(err); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: $s = -1; return false; /* } */ case 3: /* */ if (!(trace === ptrType$19.nil) && !(trace.PutIdleConn === $throwNilPointerError)) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!(trace === ptrType$19.nil) && !(trace.PutIdleConn === $throwNilPointerError)) { */ case 7: $r = trace.PutIdleConn($ifaceNil); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 8: $s = -1; return true; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$1 = _r$1; $f.err = err; $f.trace = trace; $f.$s = $s; $f.$r = $r; return $f; }; })(closeErr, eofc, pc); eofc[0] = new $Chan(structType, 0); $deferred.push([function(_arg) { $close(_arg); }, [eofc[0]]]); $r = testHookMu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } testHookReadLoopBeforeNextRead$1 = testHookReadLoopBeforeNextRead; $r = testHookMu.Unlock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } alive = true; /* while (true) { */ case 3: /* if (!(alive)) { break; } */ if(!(alive)) { $s = 4; continue; } waitForBodyRead = [waitForBodyRead]; pc[0].readLimit = pc[0].maxHeaderResponseSize(); _r$1 = pc[0].br.Peek(1); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; err = _tuple[1]; $r = pc[0].mu.Lock(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (pc[0].numExpectedResponses === 0) { $s = 7; continue; } /* */ $s = 8; continue; /* if (pc[0].numExpectedResponses === 0) { */ case 7: $r = pc[0].readLoopPeekFailLocked(err); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = pc[0].mu.Unlock(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 11; case 11: return; /* } */ case 8: $r = pc[0].mu.Unlock(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$2 = $recv(pc[0].reqch); /* */ $s = 13; case 13: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } rc = $clone(_r$2[0], requestAndChan); _r$3 = httptrace.ContextClientTrace(rc.req.Context()); /* */ $s = 14; case 14: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } trace = _r$3; resp = ptrType$18.nil; /* */ if ($interfaceIsEqual(err, $ifaceNil)) { $s = 15; continue; } /* */ $s = 16; continue; /* if ($interfaceIsEqual(err, $ifaceNil)) { */ case 15: _r$4 = pc[0].readResponse($clone(rc, requestAndChan), trace); /* */ $s = 18; case 18: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$1 = _r$4; resp = _tuple$1[0]; err = _tuple$1[1]; $s = 17; continue; /* } else { */ case 16: err = (x$5 = new transportReadFromServerError.ptr(err), new x$5.constructor.elem(x$5)); closeErr[0] = err; /* } */ case 17: /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 19; continue; } /* */ $s = 20; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 19: /* */ if ((x$6 = pc[0].readLimit, (x$6.$high < 0 || (x$6.$high === 0 && x$6.$low <= 0)))) { $s = 21; continue; } /* */ $s = 22; continue; /* if ((x$6 = pc[0].readLimit, (x$6.$high < 0 || (x$6.$high === 0 && x$6.$low <= 0)))) { */ case 21: _r$5 = fmt.Errorf("net/http: server response headers exceeded %d bytes; aborted", new sliceType([pc[0].maxHeaderResponseSize()])); /* */ $s = 23; case 23: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } err = _r$5; /* } */ case 22: _r$6 = $select([[rc.ch, new responseAndError.ptr(arrayType.zero(), ptrType$18.nil, err)], [rc.callerGone]]); /* */ $s = 24; case 24: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _selection = _r$6; /* */ if (_selection[0] === 0) { $s = 25; continue; } /* */ if (_selection[0] === 1) { $s = 26; continue; } /* */ $s = 27; continue; /* if (_selection[0] === 0) { */ case 25: $s = 27; continue; /* } else if (_selection[0] === 1) { */ case 26: $s = 28; case 28: return; /* } */ case 27: $s = 29; case 29: return; /* } */ case 20: pc[0].readLimit = new $Int64(2147483647, 4294967295); $r = pc[0].mu.Lock(); /* */ $s = 30; case 30: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } pc[0].numExpectedResponses = pc[0].numExpectedResponses - (1) >> 0; $r = pc[0].mu.Unlock(); /* */ $s = 31; case 31: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } bodyWritable = resp.bodyIsWritable(); hasBody = !(rc.req.Method === "HEAD") && !((x$7 = resp.ContentLength, (x$7.$high === 0 && x$7.$low === 0))); if (resp.Close || rc.req.Close || resp.StatusCode <= 199 || bodyWritable) { alive = false; } /* */ if (!hasBody || bodyWritable) { $s = 32; continue; } /* */ $s = 33; continue; /* if (!hasBody || bodyWritable) { */ case 32: _r$7 = pc[0].t.replaceReqCanceler($clone(rc.cancelKey, cancelKey), $throwNilPointerError); /* */ $s = 34; case 34: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } replaced = _r$7; if (!(alive && !pc[0].sawEOF)) { _v$1 = false; $s = 36; continue s; } _r$8 = pc[0].wroteRequest(); /* */ $s = 37; case 37: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _v$1 = _r$8; case 36: if (!(_v$1 && replaced)) { _v = false; $s = 35; continue s; } _r$9 = tryPutIdleConn(trace); /* */ $s = 38; case 38: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _v = _r$9; case 35: alive = _v; if (bodyWritable) { closeErr[0] = errCallerOwnsConn; } _r$10 = $select([[rc.ch, new responseAndError.ptr(arrayType.zero(), resp, $ifaceNil)], [rc.callerGone]]); /* */ $s = 39; case 39: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _selection$1 = _r$10; /* */ if (_selection$1[0] === 0) { $s = 40; continue; } /* */ if (_selection$1[0] === 1) { $s = 41; continue; } /* */ $s = 42; continue; /* if (_selection$1[0] === 0) { */ case 40: $s = 42; continue; /* } else if (_selection$1[0] === 1) { */ case 41: $s = 43; case 43: return; /* } */ case 42: $r = testHookReadLoopBeforeNextRead$1(); /* */ $s = 44; case 44: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* continue; */ $s = 3; continue; /* } */ case 33: waitForBodyRead[0] = new $Chan($Bool, 2); body$1 = new bodyEOFSignal.ptr(resp.Body, new sync.Mutex.ptr(0, 0), false, $ifaceNil, (function(closeErr, eofc, pc, waitForBodyRead) { return function $b(err$1) { var _r$11, _r$12, cerr, err$1, isEOF, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$11 = $f._r$11; _r$12 = $f._r$12; cerr = $f.cerr; err$1 = $f.err$1; isEOF = $f.isEOF; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: isEOF = $interfaceIsEqual(err$1, io.EOF); $r = $send(waitForBodyRead[0], isEOF); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (isEOF) { $s = 2; continue; } /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (isEOF) { */ case 2: _r$11 = $recv(eofc[0]); /* */ $s = 5; case 5: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _r$11[0]; $s = 4; continue; /* } else if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 3: _r$12 = pc[0].canceled(); /* */ $s = 6; case 6: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } cerr = _r$12; if (!($interfaceIsEqual(cerr, $ifaceNil))) { $s = -1; return cerr; } /* } */ case 4: $s = -1; return err$1; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$11 = _r$11; $f._r$12 = _r$12; $f.cerr = cerr; $f.err$1 = err$1; $f.isEOF = isEOF; $f.$s = $s; $f.$r = $r; return $f; }; })(closeErr, eofc, pc, waitForBodyRead), (function(closeErr, eofc, pc, waitForBodyRead) { return function $b() { var _r$11, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$11 = $f._r$11; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = $send(waitForBodyRead[0], false); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$11 = $recv(eofc[0]); /* */ $s = 2; case 2: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _r$11[0]; $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$11 = _r$11; $f.$s = $s; $f.$r = $r; return $f; }; })(closeErr, eofc, pc, waitForBodyRead)); resp.Body = body$1; if (!(rc.addedGzip)) { _v$2 = false; $s = 47; continue s; } _r$11 = new Header(resp.Header).Get("Content-Encoding"); /* */ $s = 48; case 48: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _r$12 = ascii.EqualFold(_r$11, "gzip"); /* */ $s = 49; case 49: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _v$2 = _r$12; case 47: /* */ if (_v$2) { $s = 45; continue; } /* */ $s = 46; continue; /* if (_v$2) { */ case 45: resp.Body = new gzipReader.ptr(arrayType.zero(), body$1, ptrType$33.nil, $ifaceNil); $r = new Header(resp.Header).Del("Content-Encoding"); /* */ $s = 50; case 50: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = new Header(resp.Header).Del("Content-Length"); /* */ $s = 51; case 51: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } resp.ContentLength = new $Int64(-1, 4294967295); resp.Uncompressed = true; /* } */ case 46: _r$13 = $select([[rc.ch, new responseAndError.ptr(arrayType.zero(), resp, $ifaceNil)], [rc.callerGone]]); /* */ $s = 52; case 52: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _selection$2 = _r$13; /* */ if (_selection$2[0] === 0) { $s = 53; continue; } /* */ if (_selection$2[0] === 1) { $s = 54; continue; } /* */ $s = 55; continue; /* if (_selection$2[0] === 0) { */ case 53: $s = 55; continue; /* } else if (_selection$2[0] === 1) { */ case 54: $s = 56; case 56: return; /* } */ case 55: _r$14 = rc.req.Context().Done(); /* */ $s = 57; case 57: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _r$15 = $select([[waitForBodyRead[0]], [rc.req.Cancel], [_r$14], [pc[0].closech]]); /* */ $s = 58; case 58: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _selection$3 = _r$15; /* */ if (_selection$3[0] === 0) { $s = 59; continue; } /* */ if (_selection$3[0] === 1) { $s = 60; continue; } /* */ if (_selection$3[0] === 2) { $s = 61; continue; } /* */ if (_selection$3[0] === 3) { $s = 62; continue; } /* */ $s = 63; continue; /* if (_selection$3[0] === 0) { */ case 59: bodyEOF = _selection$3[1][0]; _r$16 = pc[0].t.replaceReqCanceler($clone(rc.cancelKey, cancelKey), $throwNilPointerError); /* */ $s = 64; case 64: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } replaced$1 = _r$16; if (!(alive && bodyEOF && !pc[0].sawEOF)) { _v$4 = false; $s = 66; continue s; } _r$17 = pc[0].wroteRequest(); /* */ $s = 67; case 67: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } _v$4 = _r$17; case 66: if (!(_v$4 && replaced$1)) { _v$3 = false; $s = 65; continue s; } _r$18 = tryPutIdleConn(trace); /* */ $s = 68; case 68: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } _v$3 = _r$18; case 65: alive = _v$3; /* */ if (bodyEOF) { $s = 69; continue; } /* */ $s = 70; continue; /* if (bodyEOF) { */ case 69: $r = $send(eofc[0], $clone(new structType.ptr(), structType)); /* */ $s = 71; case 71: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 70: $s = 63; continue; /* } else if (_selection$3[0] === 1) { */ case 60: alive = false; $r = pc[0].t.CancelRequest(rc.req); /* */ $s = 72; case 72: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 63; continue; /* } else if (_selection$3[0] === 2) { */ case 61: alive = false; _arg$1 = $clone(rc.cancelKey, cancelKey); _r$19 = rc.req.Context().Err(); /* */ $s = 73; case 73: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } _arg$2 = _r$19; _r$20 = pc[0].t.cancelRequest(_arg$1, _arg$2); /* */ $s = 74; case 74: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } _r$20; $s = 63; continue; /* } else if (_selection$3[0] === 3) { */ case 62: alive = false; /* } */ case 63: $r = testHookReadLoopBeforeNextRead$1(); /* */ $s = 75; case 75: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 3; continue; case 4: $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: persistConn.ptr.prototype.readLoop }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $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$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$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._selection = _selection; $f._selection$1 = _selection$1; $f._selection$2 = _selection$2; $f._selection$3 = _selection$3; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._v = _v; $f._v$1 = _v$1; $f._v$2 = _v$2; $f._v$3 = _v$3; $f._v$4 = _v$4; $f.alive = alive; $f.body$1 = body$1; $f.bodyEOF = bodyEOF; $f.bodyWritable = bodyWritable; $f.closeErr = closeErr; $f.eofc = eofc; $f.err = err; $f.hasBody = hasBody; $f.pc = pc; $f.rc = rc; $f.replaced = replaced; $f.replaced$1 = replaced$1; $f.resp = resp; $f.testHookReadLoopBeforeNextRead$1 = testHookReadLoopBeforeNextRead$1; $f.trace = trace; $f.tryPutIdleConn = tryPutIdleConn; $f.waitForBodyRead = waitForBodyRead; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; persistConn.prototype.readLoop = function() { return this.$val.readLoop(); }; persistConn.ptr.prototype.readLoopPeekFailLocked = function(peekErr) { var _r$1, _r$2, _tuple, buf, n, pc, peekErr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; buf = $f.buf; n = $f.n; pc = $f.pc; peekErr = $f.peekErr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: pc = this; if (!($interfaceIsEqual(pc.closed, $ifaceNil))) { $s = -1; return; } n = pc.br.Buffered(); /* */ if (n > 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (n > 0) { */ case 1: _r$1 = pc.br.Peek(n); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; buf = _tuple[0]; /* */ if (is408Message(buf)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (is408Message(buf)) { */ case 4: $r = pc.closeLocked(errServerClosedIdle); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } else { */ case 5: $r = log.Printf("Unsolicited response received on idle HTTP channel starting with %q; err=%v", new sliceType([buf, peekErr])); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 6: /* } */ case 2: /* */ if ($interfaceIsEqual(peekErr, io.EOF)) { $s = 9; continue; } /* */ $s = 10; continue; /* if ($interfaceIsEqual(peekErr, io.EOF)) { */ case 9: $r = pc.closeLocked(errServerClosedIdle); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 11; continue; /* } else { */ case 10: _r$2 = fmt.Errorf("readLoopPeekFailLocked: %v", new sliceType([peekErr])); /* */ $s = 13; case 13: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $r = pc.closeLocked(_r$2); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 11: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: persistConn.ptr.prototype.readLoopPeekFailLocked }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.buf = buf; $f.n = n; $f.pc = pc; $f.peekErr = peekErr; $f.$s = $s; $f.$r = $r; return $f; }; persistConn.prototype.readLoopPeekFailLocked = function(peekErr) { return this.$val.readLoopPeekFailLocked(peekErr); }; is408Message = function(buf) { var buf; if (buf.$length < 12) { return false; } if (!(($bytesToString($subslice(buf, 0, 7))) === "HTTP/1.")) { return false; } return ($bytesToString($subslice(buf, 8, 12))) === " 408"; }; persistConn.ptr.prototype.readResponse = function(rc, trace) { var _r$1, _r$2, _r$3, _r$4, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, continueCh, err, err$1, err$2, is1xx, is1xxNonTerminal, num1xx, pc, peek, rc, resCode, resp, trace, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _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; continueCh = $f.continueCh; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; is1xx = $f.is1xx; is1xxNonTerminal = $f.is1xxNonTerminal; num1xx = $f.num1xx; pc = $f.pc; peek = $f.peek; rc = $f.rc; resCode = $f.resCode; resp = $f.resp; trace = $f.trace; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: resp = ptrType$18.nil; err = $ifaceNil; pc = this; /* */ if (!(trace === ptrType$19.nil) && !(trace.GotFirstResponseByte === $throwNilPointerError)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(trace === ptrType$19.nil) && !(trace.GotFirstResponseByte === $throwNilPointerError)) { */ case 1: _r$1 = pc.br.Peek(1); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; peek = _tuple[0]; err$1 = _tuple[1]; /* */ if ($interfaceIsEqual(err$1, $ifaceNil) && (peek.$length === 1)) { $s = 4; continue; } /* */ $s = 5; continue; /* if ($interfaceIsEqual(err$1, $ifaceNil) && (peek.$length === 1)) { */ case 4: $r = trace.GotFirstResponseByte(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: /* } */ case 2: num1xx = 0; continueCh = rc.continueCh; /* while (true) { */ case 7: _r$2 = ReadResponse(pc.br, rc.req); /* */ $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; resp = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [resp, err]; } resCode = resp.StatusCode; /* */ if (!(continueCh === $chanNil)) { $s = 10; continue; } /* */ $s = 11; continue; /* if (!(continueCh === $chanNil)) { */ case 10: /* */ if (resCode === 100) { $s = 12; continue; } /* */ if (resCode >= 200) { $s = 13; continue; } /* */ $s = 14; continue; /* if (resCode === 100) { */ case 12: /* */ if (!(trace === ptrType$19.nil) && !(trace.Got100Continue === $throwNilPointerError)) { $s = 15; continue; } /* */ $s = 16; continue; /* if (!(trace === ptrType$19.nil) && !(trace.Got100Continue === $throwNilPointerError)) { */ case 15: $r = trace.Got100Continue(); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 16: $r = $send(continueCh, $clone(new structType.ptr(), structType)); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } continueCh = $chanNil; $s = 14; continue; /* } else if (resCode >= 200) { */ case 13: $close(continueCh); continueCh = $chanNil; /* } */ case 14: /* } */ case 11: is1xx = 100 <= resCode && resCode <= 199; is1xxNonTerminal = is1xx && !((resCode === 101)); /* */ if (is1xxNonTerminal) { $s = 19; continue; } /* */ $s = 20; continue; /* if (is1xxNonTerminal) { */ case 19: num1xx = num1xx + (1) >> 0; if (num1xx > 5) { _tmp = ptrType$18.nil; _tmp$1 = errors.New("net/http: too many 1xx informational responses"); resp = _tmp; err = _tmp$1; $s = -1; return [resp, err]; } pc.readLimit = pc.maxHeaderResponseSize(); /* */ if (!(trace === ptrType$19.nil) && !(trace.Got1xxResponse === $throwNilPointerError)) { $s = 21; continue; } /* */ $s = 22; continue; /* if (!(trace === ptrType$19.nil) && !(trace.Got1xxResponse === $throwNilPointerError)) { */ case 21: _r$3 = trace.Got1xxResponse(resCode, (resp.Header)); /* */ $s = 23; case 23: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } err$2 = _r$3; if (!($interfaceIsEqual(err$2, $ifaceNil))) { _tmp$2 = ptrType$18.nil; _tmp$3 = err$2; resp = _tmp$2; err = _tmp$3; $s = -1; return [resp, err]; } /* } */ case 22: /* continue; */ $s = 7; continue; /* } */ case 20: /* break; */ $s = 8; continue; case 8: _r$4 = resp.isProtocolSwitch(); /* */ $s = 26; case 26: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } /* */ if (_r$4) { $s = 24; continue; } /* */ $s = 25; continue; /* if (_r$4) { */ case 24: resp.Body = newReadWriteCloserBody(pc.br, pc.conn); /* } */ case 25: resp.TLS = pc.tlsState; $s = -1; return [resp, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: persistConn.ptr.prototype.readResponse }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $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.continueCh = continueCh; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.is1xx = is1xx; $f.is1xxNonTerminal = is1xxNonTerminal; $f.num1xx = num1xx; $f.pc = pc; $f.peek = peek; $f.rc = rc; $f.resCode = resCode; $f.resp = resp; $f.trace = trace; $f.$s = $s; $f.$r = $r; return $f; }; persistConn.prototype.readResponse = function(rc, trace) { return this.$val.readResponse(rc, trace); }; persistConn.ptr.prototype.waitForContinue = function(continueCh) { var continueCh, pc; pc = this; if (continueCh === $chanNil) { return $throwNilPointerError; } return (function $b() { var $24r, $24r$1, $24r$2, _r$1, _r$2, _selection, _tuple, ok, timer, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _r$1 = $f._r$1; _r$2 = $f._r$2; _selection = $f._selection; _tuple = $f._tuple; ok = $f.ok; timer = $f.timer; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); _r$1 = time.NewTimer(pc.t.ExpectContinueTimeout); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } timer = _r$1; $deferred.push([$methodVal(timer, "Stop"), []]); _r$2 = $select([[continueCh], [timer.C], [pc.closech]]); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _selection = _r$2; /* */ if (_selection[0] === 0) { $s = 3; continue; } /* */ if (_selection[0] === 1) { $s = 4; continue; } /* */ if (_selection[0] === 2) { $s = 5; continue; } /* */ $s = 6; continue; /* if (_selection[0] === 0) { */ case 3: _tuple = _selection[1]; ok = _tuple[1]; $24r = ok; $s = 7; case 7: return $24r; /* } else if (_selection[0] === 1) { */ case 4: $24r$1 = true; $s = 8; case 8: return $24r$1; /* } else if (_selection[0] === 2) { */ case 5: $24r$2 = false; $s = 9; case 9: return $24r$2; /* } */ case 6: $s = -1; return false; /* */ } return; } } catch(err) { $err = err; $s = -1; return false; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: $b }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._selection = _selection; $f._tuple = _tuple; $f.ok = ok; $f.timer = timer; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }); }; persistConn.prototype.waitForContinue = function(continueCh) { return this.$val.waitForContinue(continueCh); }; newReadWriteCloserBody = function(br, rwc) { var body$1, br, rwc; body$1 = new readWriteCloserBody.ptr(arrayType.zero(), ptrType$29.nil, rwc); if (!((br.Buffered() === 0))) { body$1.br = br; } return body$1; }; readWriteCloserBody.ptr.prototype.Read = function(p) { var $24r, _r$1, _r$2, _tmp, _tmp$1, _tuple, _tuple$1, b, err, n, n$1, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; b = $f.b; err = $f.err; n = $f.n; n$1 = $f.n$1; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; b = this; /* */ if (!(b.br === ptrType$29.nil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(b.br === ptrType$29.nil)) { */ case 1: n$1 = b.br.Buffered(); if (p.$length > n$1) { p = $subslice(p, 0, n$1); } _r$1 = b.br.Read(p); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err = _tuple[1]; if (b.br.Buffered() === 0) { b.br = ptrType$29.nil; } _tmp = n; _tmp$1 = err; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; /* } */ case 2: _r$2 = b.ReadWriteCloser.Read(p); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; n = _tuple$1[0]; err = _tuple$1[1]; $24r = [n, err]; $s = 5; case 5: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: readWriteCloserBody.ptr.prototype.Read }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.b = b; $f.err = err; $f.n = n; $f.n$1 = n$1; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; readWriteCloserBody.prototype.Read = function(p) { return this.$val.Read(p); }; persistConn.ptr.prototype.writeLoop = function() { var _arg, _r$1, _r$2, _r$3, _selection, _tuple, bre, err, ok, pc, startBytesWritten, wr, x$5, x$6, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _selection = $f._selection; _tuple = $f._tuple; bre = $f.bre; err = $f.err; ok = $f.ok; pc = $f.pc; startBytesWritten = $f.startBytesWritten; wr = $f.wr; x$5 = $f.x$5; x$6 = $f.x$6; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); pc = this; $deferred.push([function(_arg) { $close(_arg); }, [pc.writeLoopDone]]); /* while (true) { */ case 1: _r$1 = $select([[pc.writech], [pc.closech]]); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _selection = _r$1; /* */ if (_selection[0] === 0) { $s = 4; continue; } /* */ if (_selection[0] === 1) { $s = 5; continue; } /* */ $s = 6; continue; /* if (_selection[0] === 0) { */ case 4: wr = $clone(_selection[1][0], writeRequest); startBytesWritten = pc.nwrite; _r$2 = wr.req.Request.write(pc.bw, pc.isProxy, wr.req.extra, pc.waitForContinue(wr.continueCh)); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } err = _r$2; _tuple = $assertType(err, requestBodyReadError, true); bre = $clone(_tuple[0], requestBodyReadError); ok = _tuple[1]; /* */ if (ok) { $s = 8; continue; } /* */ $s = 9; continue; /* if (ok) { */ case 8: err = bre.error; $r = wr.req.setError(err); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 9: /* */ if ($interfaceIsEqual(err, $ifaceNil)) { $s = 11; continue; } /* */ $s = 12; continue; /* if ($interfaceIsEqual(err, $ifaceNil)) { */ case 11: _r$3 = pc.bw.Flush(); /* */ $s = 13; case 13: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } err = _r$3; /* } */ case 12: if (!($interfaceIsEqual(err, $ifaceNil))) { if ((x$5 = pc.nwrite, (x$5.$high === startBytesWritten.$high && x$5.$low === startBytesWritten.$low))) { err = (x$6 = new nothingWrittenError.ptr(err), new x$6.constructor.elem(x$6)); } } $r = $send(pc.writeErrCh, err); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = $send(wr.ch, err); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 16; continue; } /* */ $s = 17; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 16: $r = pc.close(err); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 19; case 19: return; /* } */ case 17: $s = 6; continue; /* } else if (_selection[0] === 1) { */ case 5: $s = 20; case 20: return; /* } */ case 6: $s = 1; continue; case 2: $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: persistConn.ptr.prototype.writeLoop }; } $f._arg = _arg; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._selection = _selection; $f._tuple = _tuple; $f.bre = bre; $f.err = err; $f.ok = ok; $f.pc = pc; $f.startBytesWritten = startBytesWritten; $f.wr = wr; $f.x$5 = x$5; $f.x$6 = x$6; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; persistConn.prototype.writeLoop = function() { return this.$val.writeLoop(); }; persistConn.ptr.prototype.wroteRequest = function() { var $24r, $24r$1, $24r$2, _r$1, _r$2, _selection, _selection$1, err, err$1, pc, t, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _r$1 = $f._r$1; _r$2 = $f._r$2; _selection = $f._selection; _selection$1 = $f._selection$1; err = $f.err; err$1 = $f.err$1; pc = $f.pc; t = $f.t; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); pc = this; _selection = $select([[pc.writeErrCh], []]); /* */ if (_selection[0] === 0) { $s = 1; continue; } /* */ if (_selection[0] === 1) { $s = 2; continue; } /* */ $s = 3; continue; /* if (_selection[0] === 0) { */ case 1: err = _selection[1][0]; $24r = $interfaceIsEqual(err, $ifaceNil); $s = 4; case 4: return $24r; /* } else if (_selection[0] === 1) { */ case 2: _r$1 = time.NewTimer(new time.Duration(0, 50000000)); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } t = _r$1; $deferred.push([$methodVal(t, "Stop"), []]); _r$2 = $select([[pc.writeErrCh], [t.C]]); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _selection$1 = _r$2; /* */ if (_selection$1[0] === 0) { $s = 7; continue; } /* */ if (_selection$1[0] === 1) { $s = 8; continue; } /* */ $s = 9; continue; /* if (_selection$1[0] === 0) { */ case 7: err$1 = _selection$1[1][0]; $24r$1 = $interfaceIsEqual(err$1, $ifaceNil); $s = 10; case 10: return $24r$1; /* } else if (_selection$1[0] === 1) { */ case 8: $24r$2 = false; $s = 11; case 11: return $24r$2; /* } */ case 9: /* } */ case 3: $s = -1; return false; /* */ } return; } } catch(err) { $err = err; $s = -1; return false; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: persistConn.ptr.prototype.wroteRequest }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._selection = _selection; $f._selection$1 = _selection$1; $f.err = err; $f.err$1 = err$1; $f.pc = pc; $f.t = t; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; persistConn.prototype.wroteRequest = function() { return this.$val.wroteRequest(); }; httpError.ptr.prototype.Error = function() { var e; e = this; return e.err; }; httpError.prototype.Error = function() { return this.$val.Error(); }; httpError.ptr.prototype.Timeout = function() { var e; e = this; return e.timeout; }; httpError.prototype.Timeout = function() { return this.$val.Timeout(); }; httpError.ptr.prototype.Temporary = function() { var e; e = this; return true; }; httpError.prototype.Temporary = function() { return this.$val.Temporary(); }; nop = function() { }; persistConn.ptr.prototype.roundTrip = function(req) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, $24r$5, _arg, _arg$1, _arg$2, _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, _selection, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _v, _v$1, _v$2, _v$3, cancelChan, canceled, continueCh, ctxDoneChan, d, err, err$1, gone, headerFn, pc, pcClosed, re, req, requestedGzip, resc, resp, respHeaderTimer, startBytesWritten, timer, writeErrCh, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _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; _selection = $f._selection; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$10 = $f._tmp$10; _tmp$11 = $f._tmp$11; _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; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _v = $f._v; _v$1 = $f._v$1; _v$2 = $f._v$2; _v$3 = $f._v$3; cancelChan = $f.cancelChan; canceled = $f.canceled; continueCh = $f.continueCh; ctxDoneChan = $f.ctxDoneChan; d = $f.d; err = $f.err; err$1 = $f.err$1; gone = $f.gone; headerFn = $f.headerFn; pc = $f.pc; pcClosed = $f.pcClosed; re = $f.re; req = $f.req; requestedGzip = $f.requestedGzip; resc = $f.resc; resp = $f.resp; respHeaderTimer = $f.respHeaderTimer; startBytesWritten = $f.startBytesWritten; timer = $f.timer; writeErrCh = $f.writeErrCh; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); err = [err]; pc = [pc]; req = [req]; resp = ptrType$18.nil; err[0] = $ifaceNil; pc[0] = this; $r = testHookEnterRoundTrip(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = pc[0].t.replaceReqCanceler($clone(req[0].cancelKey, cancelKey), $methodVal(pc[0], "cancelRequest")); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (!_r$1) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!_r$1) { */ case 2: $r = pc[0].t.putOrCloseIdleConn(pc[0]); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp = ptrType$18.nil; _tmp$1 = errRequestCanceled; resp = _tmp; err[0] = _tmp$1; $24r = [resp, err[0]]; $s = 6; case 6: return $24r; /* } */ case 3: $r = pc[0].mu.Lock(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } pc[0].numExpectedResponses = pc[0].numExpectedResponses + (1) >> 0; headerFn = pc[0].mutateHeaderFunc; $r = pc[0].mu.Unlock(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!(headerFn === $throwNilPointerError)) { $s = 9; continue; } /* */ $s = 10; continue; /* if (!(headerFn === $throwNilPointerError)) { */ case 9: $r = headerFn(req[0].extraHeaders()); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 10: requestedGzip = false; if (!(!pc[0].t.DisableCompression)) { _v$1 = false; $s = 15; continue s; } _r$2 = new Header(req[0].Request.Header).Get("Accept-Encoding"); /* */ $s = 16; case 16: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _v$1 = _r$2 === ""; case 15: if (!(_v$1)) { _v = false; $s = 14; continue s; } _r$3 = new Header(req[0].Request.Header).Get("Range"); /* */ $s = 17; case 17: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _v = _r$3 === ""; case 14: /* */ if (_v && !(req[0].Request.Method === "HEAD")) { $s = 12; continue; } /* */ $s = 13; continue; /* if (_v && !(req[0].Request.Method === "HEAD")) { */ case 12: requestedGzip = true; $r = new Header(req[0].extraHeaders()).Set("Accept-Encoding", "gzip"); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 13: continueCh = $chanNil; if (req[0].Request.ProtoAtLeast(1, 1) && !($interfaceIsEqual(req[0].Request.Body, $ifaceNil)) && req[0].Request.expectsContinue()) { continueCh = new $Chan(structType, 1); } if (!(pc[0].t.DisableKeepAlives && !req[0].Request.wantsClose())) { _v$2 = false; $s = 21; continue s; } _r$4 = isProtocolSwitchHeader(req[0].Request.Header); /* */ $s = 22; case 22: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _v$2 = !_r$4; case 21: /* */ if (_v$2) { $s = 19; continue; } /* */ $s = 20; continue; /* if (_v$2) { */ case 19: $r = new Header(req[0].extraHeaders()).Set("Connection", "close"); /* */ $s = 23; case 23: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 20: gone = new $Chan(structType, 0); $deferred.push([function(_arg) { $close(_arg); }, [gone]]); $deferred.push([(function(err, pc, req) { return function $b() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (!($interfaceIsEqual(err[0], $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(err[0], $ifaceNil))) { */ case 1: $r = pc[0].t.setReqCanceler($clone(req[0].cancelKey, cancelKey), $throwNilPointerError); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$s = $s; $f.$r = $r; return $f; }; })(err, pc, req), []]); startBytesWritten = pc[0].nwrite; writeErrCh = new $Chan($error, 1); $r = $send(pc[0].writech, $clone(new writeRequest.ptr(req[0], writeErrCh, continueCh), writeRequest)); /* */ $s = 24; case 24: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } resc = new $Chan(responseAndError, 0); $r = $send(pc[0].reqch, $clone(new requestAndChan.ptr(arrayType.zero(), req[0].Request, $clone(req[0].cancelKey, cancelKey), resc, requestedGzip, continueCh, gone), requestAndChan)); /* */ $s = 25; case 25: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } respHeaderTimer = $chanNil; cancelChan = req[0].Request.Cancel; _r$5 = req[0].Request.Context().Done(); /* */ $s = 26; case 26: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } ctxDoneChan = _r$5; pcClosed = pc[0].closech; canceled = false; /* while (true) { */ case 27: $r = testHookWaitResLoop(); /* */ $s = 29; case 29: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$6 = $select([[writeErrCh], [pcClosed], [respHeaderTimer], [resc], [cancelChan], [ctxDoneChan]]); /* */ $s = 30; case 30: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _selection = _r$6; /* */ if (_selection[0] === 0) { $s = 31; continue; } /* */ if (_selection[0] === 1) { $s = 32; continue; } /* */ if (_selection[0] === 2) { $s = 33; continue; } /* */ if (_selection[0] === 3) { $s = 34; continue; } /* */ if (_selection[0] === 4) { $s = 35; continue; } /* */ if (_selection[0] === 5) { $s = 36; continue; } /* */ $s = 37; continue; /* if (_selection[0] === 0) { */ case 31: err$1 = _selection[1][0]; /* */ if (false) { $s = 38; continue; } /* */ $s = 39; continue; /* if (false) { */ case 38: $r = req[0].logf("writeErrCh resv: %T/%#v", new sliceType([err$1, err$1])); /* */ $s = 40; case 40: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 39: /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 41; continue; } /* */ $s = 42; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 41: _r$7 = fmt.Errorf("write error: %v", new sliceType([err$1])); /* */ $s = 43; case 43: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } $r = pc[0].close(_r$7); /* */ $s = 44; case 44: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp$2 = ptrType$18.nil; _r$8 = pc[0].mapRoundTripError(req[0], startBytesWritten, err$1); /* */ $s = 45; case 45: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _tmp$3 = _r$8; resp = _tmp$2; err[0] = _tmp$3; $24r$1 = [resp, err[0]]; $s = 46; case 46: return $24r$1; /* } */ case 42: d = pc[0].t.ResponseHeaderTimeout; /* */ if ((d.$high > 0 || (d.$high === 0 && d.$low > 0))) { $s = 47; continue; } /* */ $s = 48; continue; /* if ((d.$high > 0 || (d.$high === 0 && d.$low > 0))) { */ case 47: /* */ if (false) { $s = 49; continue; } /* */ $s = 50; continue; /* if (false) { */ case 49: $r = req[0].logf("starting timer for %v", new sliceType([d])); /* */ $s = 51; case 51: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 50: _r$9 = time.NewTimer(d); /* */ $s = 52; case 52: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } timer = _r$9; $deferred.push([$methodVal(timer, "Stop"), []]); respHeaderTimer = timer.C; /* } */ case 48: $s = 37; continue; /* } else if (_selection[0] === 1) { */ case 32: pcClosed = $chanNil; if (canceled) { _v$3 = true; $s = 55; continue s; } _r$10 = pc[0].t.replaceReqCanceler($clone(req[0].cancelKey, cancelKey), $throwNilPointerError); /* */ $s = 56; case 56: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _v$3 = _r$10; case 55: /* */ if (_v$3) { $s = 53; continue; } /* */ $s = 54; continue; /* if (_v$3) { */ case 53: /* */ if (false) { $s = 57; continue; } /* */ $s = 58; continue; /* if (false) { */ case 57: $r = req[0].logf("closech recv: %T %#v", new sliceType([pc[0].closed, pc[0].closed])); /* */ $s = 59; case 59: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 58: _tmp$4 = ptrType$18.nil; _r$11 = pc[0].mapRoundTripError(req[0], startBytesWritten, pc[0].closed); /* */ $s = 60; case 60: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tmp$5 = _r$11; resp = _tmp$4; err[0] = _tmp$5; $24r$2 = [resp, err[0]]; $s = 61; case 61: return $24r$2; /* } */ case 54: $s = 37; continue; /* } else if (_selection[0] === 2) { */ case 33: /* */ if (false) { $s = 62; continue; } /* */ $s = 63; continue; /* if (false) { */ case 62: $r = req[0].logf("timeout waiting for response headers.", new sliceType([])); /* */ $s = 64; case 64: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 63: $r = pc[0].close(errTimeout); /* */ $s = 65; case 65: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp$6 = ptrType$18.nil; _tmp$7 = errTimeout; resp = _tmp$6; err[0] = _tmp$7; $24r$3 = [resp, err[0]]; $s = 66; case 66: return $24r$3; /* } else if (_selection[0] === 3) { */ case 34: re = $clone(_selection[1][0], responseAndError); /* */ if ((re.res === ptrType$18.nil) === ($interfaceIsEqual(re.err, $ifaceNil))) { $s = 67; continue; } /* */ $s = 68; continue; /* if ((re.res === ptrType$18.nil) === ($interfaceIsEqual(re.err, $ifaceNil))) { */ case 67: _r$12 = fmt.Sprintf("internal error: exactly one of res or err should be set; nil=%v", new sliceType([new $Bool(re.res === ptrType$18.nil)])); /* */ $s = 69; case 69: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } $panic(new $String(_r$12)); /* } */ case 68: /* */ if (false) { $s = 70; continue; } /* */ $s = 71; continue; /* if (false) { */ case 70: $r = req[0].logf("resc recv: %p, %T/%#v", new sliceType([re.res, re.err, re.err])); /* */ $s = 72; case 72: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 71: /* */ if (!($interfaceIsEqual(re.err, $ifaceNil))) { $s = 73; continue; } /* */ $s = 74; continue; /* if (!($interfaceIsEqual(re.err, $ifaceNil))) { */ case 73: _tmp$8 = ptrType$18.nil; _r$13 = pc[0].mapRoundTripError(req[0], startBytesWritten, re.err); /* */ $s = 75; case 75: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _tmp$9 = _r$13; resp = _tmp$8; err[0] = _tmp$9; $24r$4 = [resp, err[0]]; $s = 76; case 76: return $24r$4; /* } */ case 74: _tmp$10 = re.res; _tmp$11 = $ifaceNil; resp = _tmp$10; err[0] = _tmp$11; $24r$5 = [resp, err[0]]; $s = 77; case 77: return $24r$5; /* } else if (_selection[0] === 4) { */ case 35: _r$14 = pc[0].t.cancelRequest($clone(req[0].cancelKey, cancelKey), errRequestCanceled); /* */ $s = 78; case 78: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } canceled = _r$14; cancelChan = $chanNil; $s = 37; continue; /* } else if (_selection[0] === 5) { */ case 36: _arg$1 = $clone(req[0].cancelKey, cancelKey); _r$15 = req[0].Request.Context().Err(); /* */ $s = 79; case 79: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _arg$2 = _r$15; _r$16 = pc[0].t.cancelRequest(_arg$1, _arg$2); /* */ $s = 80; case 80: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } canceled = _r$16; cancelChan = $chanNil; ctxDoneChan = $chanNil; /* } */ case 37: $s = 27; continue; case 28: $s = -1; return [resp, err[0]]; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [resp, err[0]]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: persistConn.ptr.prototype.roundTrip }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $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._selection = _selection; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$10 = _tmp$10; $f._tmp$11 = _tmp$11; $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._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._v = _v; $f._v$1 = _v$1; $f._v$2 = _v$2; $f._v$3 = _v$3; $f.cancelChan = cancelChan; $f.canceled = canceled; $f.continueCh = continueCh; $f.ctxDoneChan = ctxDoneChan; $f.d = d; $f.err = err; $f.err$1 = err$1; $f.gone = gone; $f.headerFn = headerFn; $f.pc = pc; $f.pcClosed = pcClosed; $f.re = re; $f.req = req; $f.requestedGzip = requestedGzip; $f.resc = resc; $f.resp = resp; $f.respHeaderTimer = respHeaderTimer; $f.startBytesWritten = startBytesWritten; $f.timer = timer; $f.writeErrCh = writeErrCh; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; persistConn.prototype.roundTrip = function(req) { return this.$val.roundTrip(req); }; transportRequest.ptr.prototype.logf = function(format, args) { var _r$1, _r$2, _r$3, _tuple, args, format, logf$1, ok, tr, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; args = $f.args; format = $f.format; logf$1 = $f.logf$1; ok = $f.ok; tr = $f.tr; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: tr = this; _r$1 = tr.Request.Context().Value((x$5 = new tLogKey.ptr(), new x$5.constructor.elem(x$5))); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = $assertType(_r$1, funcType$1, true); logf$1 = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (ok) { */ case 2: _r$2 = time.Now(); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = $clone(_r$2, time.Time).Format("2006-01-02T15:04:05.999999999Z07:00"); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $r = logf$1(_r$3 + ": " + format, args); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: transportRequest.ptr.prototype.logf }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.args = args; $f.format = format; $f.logf$1 = logf$1; $f.ok = ok; $f.tr = tr; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; transportRequest.prototype.logf = function(format, args) { return this.$val.logf(format, args); }; persistConn.ptr.prototype.markReused = function() { var pc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; pc = $f.pc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: pc = this; $r = pc.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } pc.reused = true; $r = pc.mu.Unlock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: persistConn.ptr.prototype.markReused }; } $f.pc = pc; $f.$s = $s; $f.$r = $r; return $f; }; persistConn.prototype.markReused = function() { return this.$val.markReused(); }; persistConn.ptr.prototype.close = function(err) { var err, pc, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; pc = $f.pc; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); pc = this; $r = pc.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(pc.mu, "Unlock"), []]); $r = pc.closeLocked(err); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: persistConn.ptr.prototype.close }; } $f.err = err; $f.pc = pc; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; persistConn.prototype.close = function(err) { return this.$val.close(err); }; persistConn.ptr.prototype.closeLocked = function(err) { var _r$1, err, pc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; err = $f.err; pc = $f.pc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: pc = this; if ($interfaceIsEqual(err, $ifaceNil)) { $panic(new $String("nil error")); } pc.broken = true; /* */ if ($interfaceIsEqual(pc.closed, $ifaceNil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($interfaceIsEqual(pc.closed, $ifaceNil)) { */ case 1: pc.closed = err; $r = pc.t.decConnsPerHost($clone(pc.cacheKey, connectMethodKey)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if ($interfaceIsEqual(pc.alt, $ifaceNil)) { $s = 4; continue; } /* */ $s = 5; continue; /* if ($interfaceIsEqual(pc.alt, $ifaceNil)) { */ case 4: /* */ if (!($interfaceIsEqual(err, errCallerOwnsConn))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!($interfaceIsEqual(err, errCallerOwnsConn))) { */ case 6: _r$1 = pc.conn.Close(); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; /* } */ case 7: $close(pc.closech); /* } */ case 5: /* } */ case 2: pc.mutateHeaderFunc = $throwNilPointerError; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: persistConn.ptr.prototype.closeLocked }; } $f._r$1 = _r$1; $f.err = err; $f.pc = pc; $f.$s = $s; $f.$r = $r; return $f; }; persistConn.prototype.closeLocked = function(err) { return this.$val.closeLocked(err); }; canonicalAddr = function(url$1) { var _entry, _r$1, _tuple, addr, err, port, url$1, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _r$1 = $f._r$1; _tuple = $f._tuple; addr = $f.addr; err = $f.err; port = $f.port; url$1 = $f.url$1; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: addr = url$1.Hostname(); _r$1 = idnaASCII(addr); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; v = _tuple[0]; err = _tuple[1]; if ($interfaceIsEqual(err, $ifaceNil)) { addr = v; } port = url$1.Port(); if (port === "") { port = (_entry = portMap[$String.keyFor(url$1.Scheme)], _entry !== undefined ? _entry.v : ""); } $s = -1; return net.JoinHostPort(addr, port); /* */ } return; } if ($f === undefined) { $f = { $blk: canonicalAddr }; } $f._entry = _entry; $f._r$1 = _r$1; $f._tuple = _tuple; $f.addr = addr; $f.err = err; $f.port = port; $f.url$1 = url$1; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; bodyEOFSignal.ptr.prototype.Read = function(p) { var $24r, $24r$1, $24r$2, _r$1, _r$2, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, closed, err, es, n, p, rerr, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _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; closed = $f.closed; err = $f.err; es = $f.es; n = $f.n; p = $f.p; rerr = $f.rerr; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); n = 0; err = $ifaceNil; es = this; $r = es.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp = es.closed; _tmp$1 = es.rerr; closed = _tmp; rerr = _tmp$1; $r = es.mu.Unlock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (closed) { $s = 3; continue; } /* */ $s = 4; continue; /* if (closed) { */ case 3: _tmp$2 = 0; _tmp$3 = errReadOnClosedResBody; n = _tmp$2; err = _tmp$3; $24r = [n, err]; $s = 5; case 5: return $24r; /* } */ case 4: /* */ if (!($interfaceIsEqual(rerr, $ifaceNil))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!($interfaceIsEqual(rerr, $ifaceNil))) { */ case 6: _tmp$4 = 0; _tmp$5 = rerr; n = _tmp$4; err = _tmp$5; $24r$1 = [n, err]; $s = 8; case 8: return $24r$1; /* } */ case 7: _r$1 = es.body.Read(p); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 10; continue; } /* */ $s = 11; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 10: $r = es.mu.Lock(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(es.mu, "Unlock"), []]); if ($interfaceIsEqual(es.rerr, $ifaceNil)) { es.rerr = err; } _r$2 = es.condfn(err); /* */ $s = 13; case 13: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } err = _r$2; /* } */ case 11: $24r$2 = [n, err]; $s = 14; case 14: return $24r$2; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [n, err]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: bodyEOFSignal.ptr.prototype.Read }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $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.closed = closed; $f.err = err; $f.es = es; $f.n = n; $f.p = p; $f.rerr = rerr; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; bodyEOFSignal.prototype.Read = function(p) { return this.$val.Read(p); }; bodyEOFSignal.ptr.prototype.Close = function() { var $24r, $24r$1, $24r$2, _r$1, _r$2, _r$3, err, es, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; err = $f.err; es = $f.es; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); es = this; $r = es.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(es.mu, "Unlock"), []]); /* */ if (es.closed) { $s = 2; continue; } /* */ $s = 3; continue; /* if (es.closed) { */ case 2: $24r = $ifaceNil; $s = 4; case 4: return $24r; /* } */ case 3: es.closed = true; /* */ if (!(es.earlyCloseFn === $throwNilPointerError) && !($interfaceIsEqual(es.rerr, io.EOF))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!(es.earlyCloseFn === $throwNilPointerError) && !($interfaceIsEqual(es.rerr, io.EOF))) { */ case 5: _r$1 = es.earlyCloseFn(); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r$1 = _r$1; $s = 8; case 8: return $24r$1; /* } */ case 6: _r$2 = es.body.Close(); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } err = _r$2; _r$3 = es.condfn(err); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r$2 = _r$3; $s = 11; case 11: return $24r$2; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: bodyEOFSignal.ptr.prototype.Close }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.err = err; $f.es = es; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; bodyEOFSignal.prototype.Close = function() { return this.$val.Close(); }; bodyEOFSignal.ptr.prototype.condfn = function(err) { var _r$1, err, es, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; err = $f.err; es = $f.es; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: es = this; if (es.fn === $throwNilPointerError) { $s = -1; return err; } _r$1 = es.fn(err); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err = _r$1; es.fn = $throwNilPointerError; $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: bodyEOFSignal.ptr.prototype.condfn }; } $f._r$1 = _r$1; $f.err = err; $f.es = es; $f.$s = $s; $f.$r = $r; return $f; }; bodyEOFSignal.prototype.condfn = function(err) { return this.$val.condfn(err); }; gzipReader.ptr.prototype.Read = function(p) { var $24r, _r$1, _r$2, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, err, gz, n, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; err = $f.err; gz = $f.gz; n = $f.n; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; gz = this; /* */ if (gz.zr === ptrType$33.nil) { $s = 1; continue; } /* */ $s = 2; continue; /* if (gz.zr === ptrType$33.nil) { */ case 1: /* */ if ($interfaceIsEqual(gz.zerr, $ifaceNil)) { $s = 3; continue; } /* */ $s = 4; continue; /* if ($interfaceIsEqual(gz.zerr, $ifaceNil)) { */ case 3: _r$1 = gzip.NewReader(gz.body); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; gz.zr = _tuple[0]; gz.zerr = _tuple[1]; /* } */ case 4: if (!($interfaceIsEqual(gz.zerr, $ifaceNil))) { _tmp = 0; _tmp$1 = gz.zerr; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } /* } */ case 2: $r = gz.body.mu.Lock(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (gz.body.closed) { err = errReadOnClosedResBody; } $r = gz.body.mu.Unlock(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$2 = 0; _tmp$3 = err; n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; } _r$2 = gz.zr.Read(p); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; n = _tuple$1[0]; err = _tuple$1[1]; $24r = [n, err]; $s = 9; case 9: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: gzipReader.ptr.prototype.Read }; } $f.$24r = $24r; $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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.err = err; $f.gz = gz; $f.n = n; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; gzipReader.prototype.Read = function(p) { return this.$val.Read(p); }; gzipReader.ptr.prototype.Close = function() { var $24r, _r$1, gz, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; gz = $f.gz; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: gz = this; _r$1 = gz.body.Close(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: gzipReader.ptr.prototype.Close }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.gz = gz; $f.$s = $s; $f.$r = $r; return $f; }; gzipReader.prototype.Close = function() { return this.$val.Close(); }; tlsHandshakeTimeoutError.ptr.prototype.Timeout = function() { return true; }; tlsHandshakeTimeoutError.prototype.Timeout = function() { return this.$val.Timeout(); }; tlsHandshakeTimeoutError.ptr.prototype.Temporary = function() { return true; }; tlsHandshakeTimeoutError.prototype.Temporary = function() { return this.$val.Temporary(); }; tlsHandshakeTimeoutError.ptr.prototype.Error = function() { return "net/http: TLS handshake timeout"; }; tlsHandshakeTimeoutError.prototype.Error = function() { return this.$val.Error(); }; fakeLocker.ptr.prototype.Lock = function() { }; fakeLocker.prototype.Lock = function() { return this.$val.Lock(); }; fakeLocker.ptr.prototype.Unlock = function() { }; fakeLocker.prototype.Unlock = function() { return this.$val.Unlock(); }; cloneTLSConfig = function(cfg) { var $24r, _r$1, cfg, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; cfg = $f.cfg; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (cfg === ptrType$4.nil) { $s = -1; return new tls.Config.ptr($ifaceNil, $throwNilPointerError, sliceType$13.nil, false, $throwNilPointerError, $throwNilPointerError, $throwNilPointerError, $throwNilPointerError, $throwNilPointerError, ptrType$34.nil, sliceType$2.nil, "", 0, ptrType$34.nil, false, sliceType$14.nil, false, false, arrayType$1.zero(), $ifaceNil, 0, 0, sliceType$15.nil, false, 0, $ifaceNil, new sync.RWMutex.ptr(new sync.Mutex.ptr(0, 0), 0, 0, 0, 0), sliceType$16.nil, sliceType$16.nil); } _r$1 = cfg.Clone(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: cloneTLSConfig }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.cfg = cfg; $f.$s = $s; $f.$r = $r; return $f; }; connLRU.ptr.prototype.add = function(pc) { var _entry, _key, _tuple, cl, ele, ok, pc; cl = this; if (cl.ll === ptrType$3.nil) { cl.ll = list.New(); cl.m = {}; } ele = cl.ll.PushFront(pc); _tuple = (_entry = cl.m[ptrType$22.keyFor(pc)], _entry !== undefined ? [_entry.v, true] : [ptrType$23.nil, false]); ok = _tuple[1]; if (ok) { $panic(new $String("persistConn was already in LRU")); } _key = pc; (cl.m || $throwRuntimeError("assignment to entry in nil map"))[ptrType$22.keyFor(_key)] = { k: _key, v: ele }; }; connLRU.prototype.add = function(pc) { return this.$val.add(pc); }; connLRU.ptr.prototype.removeOldest = function() { var cl, ele, pc; cl = this; ele = cl.ll.Back(); pc = $assertType(ele.Value, ptrType$22); cl.ll.Remove(ele); delete cl.m[ptrType$22.keyFor(pc)]; return pc; }; connLRU.prototype.removeOldest = function() { return this.$val.removeOldest(); }; connLRU.ptr.prototype.remove = function(pc) { var _entry, _tuple, cl, ele, ok, pc; cl = this; _tuple = (_entry = cl.m[ptrType$22.keyFor(pc)], _entry !== undefined ? [_entry.v, true] : [ptrType$23.nil, false]); ele = _tuple[0]; ok = _tuple[1]; if (ok) { cl.ll.Remove(ele); delete cl.m[ptrType$22.keyFor(pc)]; } }; connLRU.prototype.remove = function(pc) { return this.$val.remove(pc); }; connLRU.ptr.prototype.len = function() { var cl; cl = this; return $keys(cl.m).length; }; connLRU.prototype.len = function() { return this.$val.len(); }; errorReader.ptr.prototype.Read = function(p) { var _tmp, _tmp$1, err, n, p, r; n = 0; err = $ifaceNil; r = this; _tmp = 0; _tmp$1 = r.err; n = _tmp; err = _tmp$1; return [n, err]; }; errorReader.prototype.Read = function(p) { return this.$val.Read(p); }; byteReader.ptr.prototype.Read = function(p) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, br, err, n, p; n = 0; err = $ifaceNil; br = this; if (br.done) { _tmp = 0; _tmp$1 = io.EOF; n = _tmp; err = _tmp$1; return [n, err]; } if (p.$length === 0) { _tmp$2 = 0; _tmp$3 = $ifaceNil; n = _tmp$2; err = _tmp$3; return [n, err]; } br.done = true; (0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0] = br.b); _tmp$4 = 1; _tmp$5 = io.EOF; n = _tmp$4; err = _tmp$5; return [n, err]; }; byteReader.prototype.Read = function(p) { return this.$val.Read(p); }; newTransferWriter = function(r) { var $24r, _r$1, _r$2, _r$3, _ref, _tmp, _tmp$1, _tmp$2, _tmp$3, _v, _v$1, atLeastHTTP11, err, r, rr, rr$1, t, x$5, x$6, x$7, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; _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; atLeastHTTP11 = $f.atLeastHTTP11; err = $f.err; r = $f.r; rr = $f.rr; rr$1 = $f.rr$1; t = $f.t; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = ptrType$35.nil; err = $ifaceNil; t = new transferWriter.ptr("", $ifaceNil, $ifaceNil, false, new $Int64(0, 0), false, sliceType$2.nil, false, false, false, $ifaceNil, false, $chanNil); atLeastHTTP11 = false; _ref = r; /* */ if ($assertType(_ref, ptrType$11, true)[1]) { $s = 1; continue; } /* */ if ($assertType(_ref, ptrType$18, true)[1]) { $s = 2; continue; } /* */ $s = 3; continue; /* if ($assertType(_ref, ptrType$11, true)[1]) { */ case 1: rr = _ref.$val; /* */ if (!((x$5 = rr.ContentLength, (x$5.$high === 0 && x$5.$low === 0))) && $interfaceIsEqual(rr.Body, $ifaceNil)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!((x$5 = rr.ContentLength, (x$5.$high === 0 && x$5.$low === 0))) && $interfaceIsEqual(rr.Body, $ifaceNil)) { */ case 4: _tmp = ptrType$35.nil; _r$1 = fmt.Errorf("http: Request.ContentLength=%d with nil Body", new sliceType([rr.ContentLength])); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tmp$1 = _r$1; t = _tmp; err = _tmp$1; $24r = [t, err]; $s = 7; case 7: return $24r; /* } */ case 5: t.Method = valueOrDefault(rr.Method, "GET"); t.Close = rr.Close; t.TransferEncoding = rr.TransferEncoding; t.Header = rr.Header; t.Trailer = rr.Trailer; t.Body = rr.Body; t.BodyCloser = rr.Body; t.ContentLength = rr.outgoingLength(); if (!((x$6 = t.ContentLength, (x$6.$high < 0 || (x$6.$high === 0 && x$6.$low < 0))) && (t.TransferEncoding.$length === 0))) { _v = false; $s = 10; continue s; } _r$2 = t.shouldSendChunkedRequestBody(); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _v = _r$2; case 10: /* */ if (_v) { $s = 8; continue; } /* */ $s = 9; continue; /* if (_v) { */ case 8: t.TransferEncoding = new sliceType$2(["chunked"]); /* } */ case 9: if (!(!((x$7 = t.ContentLength, (x$7.$high === 0 && x$7.$low === 0))))) { _v$1 = false; $s = 14; continue s; } _r$3 = isKnownInMemoryReader(t.Body); /* */ $s = 15; case 15: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _v$1 = !_r$3; case 14: /* */ if (_v$1) { $s = 12; continue; } /* */ $s = 13; continue; /* if (_v$1) { */ case 12: t.FlushHeaders = true; /* } */ case 13: atLeastHTTP11 = true; $s = 3; continue; /* } else if ($assertType(_ref, ptrType$18, true)[1]) { */ case 2: rr$1 = _ref.$val; t.IsResponse = true; if (!(rr$1.Request === ptrType$11.nil)) { t.Method = rr$1.Request.Method; } t.Body = rr$1.Body; t.BodyCloser = rr$1.Body; t.ContentLength = rr$1.ContentLength; t.Close = rr$1.Close; t.TransferEncoding = rr$1.TransferEncoding; t.Header = rr$1.Header; t.Trailer = rr$1.Trailer; atLeastHTTP11 = rr$1.ProtoAtLeast(1, 1); t.ResponseToHEAD = noResponseBodyExpected(t.Method); /* } */ case 3: if (t.ResponseToHEAD) { t.Body = $ifaceNil; if (chunked(t.TransferEncoding)) { t.ContentLength = new $Int64(-1, 4294967295); } } else { if (!atLeastHTTP11 || $interfaceIsEqual(t.Body, $ifaceNil)) { t.TransferEncoding = sliceType$2.nil; } if (chunked(t.TransferEncoding)) { t.ContentLength = new $Int64(-1, 4294967295); } else if ($interfaceIsEqual(t.Body, $ifaceNil)) { t.ContentLength = new $Int64(0, 0); } } if (!chunked(t.TransferEncoding)) { t.Trailer = false; } _tmp$2 = t; _tmp$3 = $ifaceNil; t = _tmp$2; err = _tmp$3; $s = -1; return [t, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: newTransferWriter }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._ref = _ref; $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.atLeastHTTP11 = atLeastHTTP11; $f.err = err; $f.r = r; $f.rr = rr; $f.rr$1 = rr$1; $f.t = t; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.$s = $s; $f.$r = $r; return $f; }; transferWriter.ptr.prototype.shouldSendChunkedRequestBody = function() { var t, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; t = $f.t; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; if ((x$5 = t.ContentLength, (x$5.$high > 0 || (x$5.$high === 0 && x$5.$low >= 0))) || $interfaceIsEqual(t.Body, $ifaceNil)) { $s = -1; return false; } if (t.Method === "CONNECT") { $s = -1; return false; } /* */ if (requestMethodUsuallyLacksBody(t.Method)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (requestMethodUsuallyLacksBody(t.Method)) { */ case 1: $r = t.probeRequestBody(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return !($interfaceIsEqual(t.Body, $ifaceNil)); /* } */ case 2: $s = -1; return true; /* */ } return; } if ($f === undefined) { $f = { $blk: transferWriter.ptr.prototype.shouldSendChunkedRequestBody }; } $f.t = t; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; transferWriter.prototype.shouldSendChunkedRequestBody = function() { return this.$val.shouldSendChunkedRequestBody(); }; transferWriter.ptr.prototype.probeRequestBody = function() { var _r$1, _r$2, _selection, rres, t, timer, x$5, x$6, x$7, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _selection = $f._selection; rres = $f.rres; t = $f.t; timer = $f.timer; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = [t]; t[0] = this; t[0].ByteReadCh = new $Chan(readResult, 1); $go((function(t) { return function $b(body$1) { var _r$1, _tuple, body$1, buf, rres, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; body$1 = $f.body$1; buf = $f.buf; rres = $f.rres; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: buf = arrayType$2.zero(); rres = new readResult.ptr(arrayType.zero(), 0, $ifaceNil, 0); _r$1 = body$1.Read(new sliceType$3(buf)); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; rres.n = _tuple[0]; rres.err = _tuple[1]; if (rres.n === 1) { rres.b = buf[0]; } $r = $send(t[0].ByteReadCh, $clone($clone(rres, readResult), readResult)); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.body$1 = body$1; $f.buf = buf; $f.rres = rres; $f.$s = $s; $f.$r = $r; return $f; }; })(t), [t[0].Body]); _r$1 = time.NewTimer(new time.Duration(0, 200000000)); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } timer = _r$1; _r$2 = $select([[t[0].ByteReadCh], [timer.C]]); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _selection = _r$2; if (_selection[0] === 0) { rres = $clone(_selection[1][0], readResult); timer.Stop(); if ((rres.n === 0) && $interfaceIsEqual(rres.err, io.EOF)) { t[0].Body = $ifaceNil; t[0].ContentLength = new $Int64(0, 0); } else if (rres.n === 1) { if (!($interfaceIsEqual(rres.err, $ifaceNil))) { t[0].Body = io.MultiReader(new sliceType$17([new byteReader.ptr(rres.b, false), (x$5 = new errorReader.ptr(rres.err), new x$5.constructor.elem(x$5))])); } else { t[0].Body = io.MultiReader(new sliceType$17([new byteReader.ptr(rres.b, false), t[0].Body])); } } else if (!($interfaceIsEqual(rres.err, $ifaceNil))) { t[0].Body = (x$6 = new errorReader.ptr(rres.err), new x$6.constructor.elem(x$6)); } } else if (_selection[0] === 1) { t[0].Body = io.MultiReader(new sliceType$17([(x$7 = new finishAsyncByteRead.ptr(t[0]), new x$7.constructor.elem(x$7)), t[0].Body])); t[0].FlushHeaders = true; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: transferWriter.ptr.prototype.probeRequestBody }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._selection = _selection; $f.rres = rres; $f.t = t; $f.timer = timer; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.$s = $s; $f.$r = $r; return $f; }; transferWriter.prototype.probeRequestBody = function() { return this.$val.probeRequestBody(); }; noResponseBodyExpected = function(requestMethod) { var requestMethod; return requestMethod === "HEAD"; }; transferWriter.ptr.prototype.shouldSendContentLength = function() { var t, x$5, x$6, x$7; t = this; if (chunked(t.TransferEncoding)) { return false; } if ((x$5 = t.ContentLength, (x$5.$high > 0 || (x$5.$high === 0 && x$5.$low > 0)))) { return true; } if ((x$6 = t.ContentLength, (x$6.$high < 0 || (x$6.$high === 0 && x$6.$low < 0)))) { return false; } if (t.Method === "POST" || t.Method === "PUT" || t.Method === "PATCH") { return true; } if ((x$7 = t.ContentLength, (x$7.$high === 0 && x$7.$low === 0)) && isIdentity(t.TransferEncoding)) { if (t.Method === "GET" || t.Method === "HEAD") { return false; } return true; } return false; }; transferWriter.prototype.shouldSendContentLength = function() { return this.$val.shouldSendContentLength(); }; transferWriter.ptr.prototype.writeHeader = function(w, trace) { var $24r, _1, _entry, _i, _keys, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _ref, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, err, err$1, err$2, err$3, err$4, k, keys, t, trace, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _1 = $f._1; _entry = $f._entry; _i = $f._i; _keys = $f._keys; _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; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; err$4 = $f.err$4; k = $f.k; keys = $f.keys; t = $f.t; trace = $f.trace; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; /* */ if (t.Close && !hasToken(new Header(t.Header).get("Connection"), "close")) { $s = 1; continue; } /* */ $s = 2; continue; /* if (t.Close && !hasToken(new Header(t.Header).get("Connection"), "close")) { */ case 1: _r$1 = io.WriteString(w, "Connection: close\r\n"); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } /* */ if (!(trace === ptrType$19.nil) && !(trace.WroteHeaderField === $throwNilPointerError)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!(trace === ptrType$19.nil) && !(trace.WroteHeaderField === $throwNilPointerError)) { */ case 4: $r = trace.WroteHeaderField("Connection", new sliceType$2(["close"])); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: /* } */ case 2: /* */ if (t.shouldSendContentLength()) { $s = 7; continue; } /* */ if (chunked(t.TransferEncoding)) { $s = 8; continue; } /* */ $s = 9; continue; /* if (t.shouldSendContentLength()) { */ case 7: _r$2 = io.WriteString(w, "Content-Length: "); /* */ $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; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } _r$3 = io.WriteString(w, strconv.FormatInt(t.ContentLength, 10) + "\r\n"); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$2 = _r$3; err$2 = _tuple$2[1]; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return err$2; } /* */ if (!(trace === ptrType$19.nil) && !(trace.WroteHeaderField === $throwNilPointerError)) { $s = 12; continue; } /* */ $s = 13; continue; /* if (!(trace === ptrType$19.nil) && !(trace.WroteHeaderField === $throwNilPointerError)) { */ case 12: $r = trace.WroteHeaderField("Content-Length", new sliceType$2([strconv.FormatInt(t.ContentLength, 10)])); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 13: $s = 9; continue; /* } else if (chunked(t.TransferEncoding)) { */ case 8: _r$4 = io.WriteString(w, "Transfer-Encoding: chunked\r\n"); /* */ $s = 15; case 15: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$3 = _r$4; err$3 = _tuple$3[1]; if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = -1; return err$3; } /* */ if (!(trace === ptrType$19.nil) && !(trace.WroteHeaderField === $throwNilPointerError)) { $s = 16; continue; } /* */ $s = 17; continue; /* if (!(trace === ptrType$19.nil) && !(trace.WroteHeaderField === $throwNilPointerError)) { */ case 16: $r = trace.WroteHeaderField("Transfer-Encoding", new sliceType$2(["chunked"])); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 17: /* } */ case 9: /* */ if (!(t.Trailer === false)) { $s = 19; continue; } /* */ $s = 20; continue; /* if (!(t.Trailer === false)) { */ case 19: keys = $makeSlice(sliceType$2, 0, $keys(t.Trailer).length); _ref = t.Trailer; _i = 0; _keys = $keys(_ref); /* while (true) { */ case 21: /* if (!(_i < _keys.length)) { break; } */ if(!(_i < _keys.length)) { $s = 22; continue; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; /* continue; */ $s = 21; continue; } k = _entry.k; _r$5 = CanonicalHeaderKey(k); /* */ $s = 23; case 23: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } k = _r$5; _1 = k; /* */ if (_1 === ("Transfer-Encoding") || _1 === ("Trailer") || _1 === ("Content-Length")) { $s = 25; continue; } /* */ $s = 26; continue; /* if (_1 === ("Transfer-Encoding") || _1 === ("Trailer") || _1 === ("Content-Length")) { */ case 25: _r$6 = badStringError("invalid Trailer key", k); /* */ $s = 27; case 27: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } $24r = _r$6; $s = 28; case 28: return $24r; /* } */ case 26: case 24: keys = $append(keys, k); _i++; $s = 21; continue; case 22: /* */ if (keys.$length > 0) { $s = 29; continue; } /* */ $s = 30; continue; /* if (keys.$length > 0) { */ case 29: $r = sort.Strings(keys); /* */ $s = 31; case 31: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$7 = io.WriteString(w, "Trailer: " + strings.Join(keys, ",") + "\r\n"); /* */ $s = 32; case 32: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _tuple$4 = _r$7; err$4 = _tuple$4[1]; if (!($interfaceIsEqual(err$4, $ifaceNil))) { $s = -1; return err$4; } /* */ if (!(trace === ptrType$19.nil) && !(trace.WroteHeaderField === $throwNilPointerError)) { $s = 33; continue; } /* */ $s = 34; continue; /* if (!(trace === ptrType$19.nil) && !(trace.WroteHeaderField === $throwNilPointerError)) { */ case 33: $r = trace.WroteHeaderField("Trailer", keys); /* */ $s = 35; case 35: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 34: /* } */ case 30: /* } */ case 20: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: transferWriter.ptr.prototype.writeHeader }; } $f.$24r = $24r; $f._1 = _1; $f._entry = _entry; $f._i = _i; $f._keys = _keys; $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._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.err$4 = err$4; $f.k = k; $f.keys = keys; $f.t = t; $f.trace = trace; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; transferWriter.prototype.writeHeader = function(w, trace) { return this.$val.writeHeader(w, trace); }; transferWriter.ptr.prototype.writeBody = function(w) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, $24r$5, _r$1, _r$10, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, body$1, bw, closed, cw, dst, err, err$1, err$2, ncopy, nextra, ok, t, w, x$5, x$6, x$7, x$8, x$9, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; _r$1 = $f._r$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; _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; body$1 = $f.body$1; bw = $f.bw; closed = $f.closed; cw = $f.cw; dst = $f.dst; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; ncopy = $f.ncopy; nextra = $f.nextra; ok = $f.ok; t = $f.t; w = $f.w; 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; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); closed = [closed]; err = [err]; t = [t]; err[0] = $ifaceNil; t[0] = this; ncopy = new $Int64(0, 0); closed[0] = false; $deferred.push([(function(closed, err, t) { return function $b() { var _r$1, closeErr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; closeErr = $f.closeErr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (closed[0] || $interfaceIsEqual(t[0].BodyCloser, $ifaceNil)) { $s = -1; return; } _r$1 = t[0].BodyCloser.Close(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } closeErr = _r$1; if (!($interfaceIsEqual(closeErr, $ifaceNil)) && $interfaceIsEqual(err[0], $ifaceNil)) { err[0] = closeErr; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$1 = _r$1; $f.closeErr = closeErr; $f.$s = $s; $f.$r = $r; return $f; }; })(closed, err, t), []]); /* */ if (!($interfaceIsEqual(t[0].Body, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(t[0].Body, $ifaceNil))) { */ case 1: _r$1 = t[0].unwrapBody(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } body$1 = _r$1; /* */ if (chunked(t[0].TransferEncoding)) { $s = 4; continue; } /* */ if ((x$5 = t[0].ContentLength, (x$5.$high === -1 && x$5.$low === 4294967295))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (chunked(t[0].TransferEncoding)) { */ case 4: _tuple = $assertType(w, ptrType$14, true); bw = _tuple[0]; ok = _tuple[1]; if (ok && !t[0].IsResponse) { w = new internal.FlushAfterChunkWriter.ptr(bw); } cw = internal.NewChunkedWriter(w); _r$2 = t[0].doBodyCopy(cw, body$1); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; err[0] = _tuple$1[1]; /* */ if ($interfaceIsEqual(err[0], $ifaceNil)) { $s = 9; continue; } /* */ $s = 10; continue; /* if ($interfaceIsEqual(err[0], $ifaceNil)) { */ case 9: _r$3 = cw.Close(); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } err[0] = _r$3; /* } */ case 10: $s = 7; continue; /* } else if ((x$5 = t[0].ContentLength, (x$5.$high === -1 && x$5.$low === 4294967295))) { */ case 5: dst = w; if (t[0].Method === "CONNECT") { dst = (x$6 = new bufioFlushWriter.ptr(dst), new x$6.constructor.elem(x$6)); } _r$4 = t[0].doBodyCopy(dst, body$1); /* */ $s = 12; case 12: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$2 = _r$4; ncopy = _tuple$2[0]; err[0] = _tuple$2[1]; $s = 7; continue; /* } else { */ case 6: _r$5 = t[0].doBodyCopy(w, io.LimitReader(body$1, t[0].ContentLength)); /* */ $s = 13; case 13: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$3 = _r$5; ncopy = _tuple$3[0]; err[0] = _tuple$3[1]; /* */ if (!($interfaceIsEqual(err[0], $ifaceNil))) { $s = 14; continue; } /* */ $s = 15; continue; /* if (!($interfaceIsEqual(err[0], $ifaceNil))) { */ case 14: err[0] = err[0]; $24r = err[0]; $s = 16; case 16: return $24r; /* } */ case 15: nextra = new $Int64(0, 0); _r$6 = t[0].doBodyCopy(io.Discard, body$1); /* */ $s = 17; case 17: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tuple$4 = _r$6; nextra = _tuple$4[0]; err[0] = _tuple$4[1]; ncopy = (x$7 = nextra, new $Int64(ncopy.$high + x$7.$high, ncopy.$low + x$7.$low)); /* } */ case 7: /* */ if (!($interfaceIsEqual(err[0], $ifaceNil))) { $s = 18; continue; } /* */ $s = 19; continue; /* if (!($interfaceIsEqual(err[0], $ifaceNil))) { */ case 18: err[0] = err[0]; $24r$1 = err[0]; $s = 20; case 20: return $24r$1; /* } */ case 19: /* } */ case 2: /* */ if (!($interfaceIsEqual(t[0].BodyCloser, $ifaceNil))) { $s = 21; continue; } /* */ $s = 22; continue; /* if (!($interfaceIsEqual(t[0].BodyCloser, $ifaceNil))) { */ case 21: closed[0] = true; _r$7 = t[0].BodyCloser.Close(); /* */ $s = 23; case 23: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } err$1 = _r$7; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 24; continue; } /* */ $s = 25; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 24: err[0] = err$1; $24r$2 = err[0]; $s = 26; case 26: return $24r$2; /* } */ case 25: /* } */ case 22: /* */ if (!t[0].ResponseToHEAD && !((x$8 = t[0].ContentLength, (x$8.$high === -1 && x$8.$low === 4294967295))) && !((x$9 = t[0].ContentLength, (x$9.$high === ncopy.$high && x$9.$low === ncopy.$low)))) { $s = 27; continue; } /* */ $s = 28; continue; /* if (!t[0].ResponseToHEAD && !((x$8 = t[0].ContentLength, (x$8.$high === -1 && x$8.$low === 4294967295))) && !((x$9 = t[0].ContentLength, (x$9.$high === ncopy.$high && x$9.$low === ncopy.$low)))) { */ case 27: _r$8 = fmt.Errorf("http: ContentLength=%d with Body length %d", new sliceType([t[0].ContentLength, ncopy])); /* */ $s = 29; case 29: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } err[0] = _r$8; $24r$3 = err[0]; $s = 30; case 30: return $24r$3; /* } */ case 28: /* */ if (chunked(t[0].TransferEncoding)) { $s = 31; continue; } /* */ $s = 32; continue; /* if (chunked(t[0].TransferEncoding)) { */ case 31: /* */ if (!(t[0].Trailer === false)) { $s = 33; continue; } /* */ $s = 34; continue; /* if (!(t[0].Trailer === false)) { */ case 33: _r$9 = new Header(t[0].Trailer).Write(w); /* */ $s = 35; case 35: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err$2 = _r$9; /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 36; continue; } /* */ $s = 37; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 36: err[0] = err$2; $24r$4 = err[0]; $s = 38; case 38: return $24r$4; /* } */ case 37: /* } */ case 34: _r$10 = io.WriteString(w, "\r\n"); /* */ $s = 39; case 39: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$5 = _r$10; err[0] = _tuple$5[1]; /* } */ case 32: err[0] = err[0]; $24r$5 = err[0]; $s = 40; case 40: return $24r$5; /* */ } 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: transferWriter.ptr.prototype.writeBody }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f._r$1 = _r$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._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.body$1 = body$1; $f.bw = bw; $f.closed = closed; $f.cw = cw; $f.dst = dst; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.ncopy = ncopy; $f.nextra = nextra; $f.ok = ok; $f.t = t; $f.w = w; $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.$deferred = $deferred; $f.$r = $r; return $f; } } }; transferWriter.prototype.writeBody = function(w) { return this.$val.writeBody(w); }; transferWriter.ptr.prototype.doBodyCopy = function(dst, src) { var _r$1, _tuple, dst, err, n, src, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; dst = $f.dst; err = $f.err; n = $f.n; src = $f.src; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = new $Int64(0, 0); err = $ifaceNil; t = this; _r$1 = io.Copy(dst, src); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil)) && !($interfaceIsEqual(err, io.EOF))) { t.bodyReadError = err; } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: transferWriter.ptr.prototype.doBodyCopy }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.dst = dst; $f.err = err; $f.n = n; $f.src = src; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; transferWriter.prototype.doBodyCopy = function(dst, src) { return this.$val.doBodyCopy(dst, src); }; transferWriter.ptr.prototype.unwrapBody = function() { var $24r, _r$1, _r$2, _r$3, _tuple, ok, r, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; ok = $f.ok; r = $f.r; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; /* */ if ($interfaceIsEqual(reflect.TypeOf(t.Body), nopCloserType)) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($interfaceIsEqual(reflect.TypeOf(t.Body), nopCloserType)) { */ case 1: _r$1 = reflect.ValueOf(t.Body); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = $clone(_r$1, reflect.Value).Field(0); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = $clone(_r$2, reflect.Value).Interface(); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = $assertType(_r$3, io.Reader); $s = 6; case 6: return $24r; /* } */ case 2: _tuple = $assertType(t.Body, ptrType$20, true); r = _tuple[0]; ok = _tuple[1]; if (ok) { r.didRead = true; $s = -1; return r.ReadCloser; } $s = -1; return t.Body; /* */ } return; } if ($f === undefined) { $f = { $blk: transferWriter.ptr.prototype.unwrapBody }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.ok = ok; $f.r = r; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; transferWriter.prototype.unwrapBody = function() { return this.$val.unwrapBody(); }; transferReader.ptr.prototype.protoAtLeast = function(m, n) { var m, n, t; t = this; return t.ProtoMajor > m || ((t.ProtoMajor === m) && t.ProtoMinor >= n); }; transferReader.prototype.protoAtLeast = function(m, n) { return this.$val.protoAtLeast(m, n); }; bodyAllowedForStatus = function(status) { var status; if (status >= 100 && status <= 199) { return false; } else if ((status === 204)) { return false; } else if ((status === 304)) { return false; } return true; }; suppressedHeaders = function(status) { var status; if ((status === 304)) { return suppressedHeaders304; } else if (!bodyAllowedForStatus(status)) { return suppressedHeadersNoBody; } return sliceType$2.nil; }; readTransfer = function(msg, r) { var _r$1, _r$2, _r$3, _r$4, _r$5, _ref, _ref$1, _ref$2, _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, err, err$1, err$2, isResponse, msg, n, r, realLength, rr, rr$1, rr$2, rr$3, rr$4, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; _ref = $f._ref; _ref$1 = $f._ref$1; _ref$2 = $f._ref$2; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; isResponse = $f.isResponse; msg = $f.msg; n = $f.n; r = $f.r; realLength = $f.realLength; rr = $f.rr; rr$1 = $f.rr$1; rr$2 = $f.rr$2; rr$3 = $f.rr$3; rr$4 = $f.rr$4; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; t = new transferReader.ptr(false, 0, "GET", 0, 0, $ifaceNil, new $Int64(0, 0), false, false, false); isResponse = false; _ref = msg; /* */ if ($assertType(_ref, ptrType$18, true)[1]) { $s = 1; continue; } /* */ if ($assertType(_ref, ptrType$11, true)[1]) { $s = 2; continue; } /* */ $s = 3; continue; /* if ($assertType(_ref, ptrType$18, true)[1]) { */ case 1: rr = _ref.$val; t.Header = rr.Header; t.StatusCode = rr.StatusCode; t.ProtoMajor = rr.ProtoMajor; t.ProtoMinor = rr.ProtoMinor; _r$1 = shouldClose(t.ProtoMajor, t.ProtoMinor, t.Header, true); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } t.Close = _r$1; isResponse = true; if (!(rr.Request === ptrType$11.nil)) { t.RequestMethod = rr.Request.Method; } $s = 4; continue; /* } else if ($assertType(_ref, ptrType$11, true)[1]) { */ case 2: rr$1 = _ref.$val; t.Header = rr$1.Header; t.RequestMethod = rr$1.Method; t.ProtoMajor = rr$1.ProtoMajor; t.ProtoMinor = rr$1.ProtoMinor; t.StatusCode = 200; t.Close = rr$1.Close; $s = 4; continue; /* } else { */ case 3: rr$2 = _ref; $panic(new $String("unexpected type")); /* } */ case 4: if ((t.ProtoMajor === 0) && (t.ProtoMinor === 0)) { _tmp = 1; _tmp$1 = 1; t.ProtoMajor = _tmp; t.ProtoMinor = _tmp$1; } _r$2 = t.parseTransferEncoding(); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } err$1 = _r$2; if (!($interfaceIsEqual(err$1, $ifaceNil))) { err = err$1; $s = -1; return err; } _r$3 = fixLength(isResponse, t.StatusCode, t.RequestMethod, t.Header, t.Chunked); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; realLength = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { err = err; $s = -1; return err; } /* */ if (isResponse && t.RequestMethod === "HEAD") { $s = 8; continue; } /* */ $s = 9; continue; /* if (isResponse && t.RequestMethod === "HEAD") { */ case 8: _r$4 = parseContentLength(new Header(t.Header).get("Content-Length")); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$1 = _r$4; n = _tuple$1[0]; err$2 = _tuple$1[1]; if (!($interfaceIsEqual(err$2, $ifaceNil))) { err = err$2; $s = -1; return err; } else { t.ContentLength = n; } $s = 10; continue; /* } else { */ case 9: t.ContentLength = realLength; /* } */ case 10: _r$5 = fixTrailer(t.Header, t.Chunked); /* */ $s = 12; case 12: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$2 = _r$5; t.Trailer = _tuple$2[0]; err = _tuple$2[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { err = err; $s = -1; return err; } _ref$1 = msg; if ($assertType(_ref$1, ptrType$18, true)[1]) { if ((realLength.$high === -1 && realLength.$low === 4294967295) && !t.Chunked && bodyAllowedForStatus(t.StatusCode)) { t.Close = true; } } if (t.Chunked) { if (noResponseBodyExpected(t.RequestMethod) || !bodyAllowedForStatus(t.StatusCode)) { t.Body = new $pkg.NoBody.constructor.elem($pkg.NoBody); } else { t.Body = new body.ptr(internal.NewChunkedReader(r), msg, r, t.Close, false, new sync.Mutex.ptr(0, 0), false, false, false, $throwNilPointerError); } } else if ((realLength.$high === 0 && realLength.$low === 0)) { t.Body = new $pkg.NoBody.constructor.elem($pkg.NoBody); } else if ((realLength.$high > 0 || (realLength.$high === 0 && realLength.$low > 0))) { t.Body = new body.ptr(io.LimitReader(r, realLength), $ifaceNil, ptrType$29.nil, t.Close, false, new sync.Mutex.ptr(0, 0), false, false, false, $throwNilPointerError); } else if (t.Close) { t.Body = new body.ptr(r, $ifaceNil, ptrType$29.nil, t.Close, false, new sync.Mutex.ptr(0, 0), false, false, false, $throwNilPointerError); } else { t.Body = new $pkg.NoBody.constructor.elem($pkg.NoBody); } _ref$2 = msg; if ($assertType(_ref$2, ptrType$11, true)[1]) { rr$3 = _ref$2.$val; rr$3.Body = t.Body; rr$3.ContentLength = t.ContentLength; if (t.Chunked) { rr$3.TransferEncoding = new sliceType$2(["chunked"]); } rr$3.Close = t.Close; rr$3.Trailer = t.Trailer; } else if ($assertType(_ref$2, ptrType$18, true)[1]) { rr$4 = _ref$2.$val; rr$4.Body = t.Body; rr$4.ContentLength = t.ContentLength; if (t.Chunked) { rr$4.TransferEncoding = new sliceType$2(["chunked"]); } rr$4.Close = t.Close; rr$4.Trailer = t.Trailer; } err = $ifaceNil; $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: readTransfer }; } $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._ref = _ref; $f._ref$1 = _ref$1; $f._ref$2 = _ref$2; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.isResponse = isResponse; $f.msg = msg; $f.n = n; $f.r = r; $f.realLength = realLength; $f.rr = rr; $f.rr$1 = rr$1; $f.rr$2 = rr$2; $f.rr$3 = rr$3; $f.rr$4 = rr$4; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; chunked = function(te) { var te; return te.$length > 0 && (0 >= te.$length ? ($throwRuntimeError("index out of range"), undefined) : te.$array[te.$offset + 0]) === "chunked"; }; isIdentity = function(te) { var te; return (te.$length === 1) && (0 >= te.$length ? ($throwRuntimeError("index out of range"), undefined) : te.$array[te.$offset + 0]) === "identity"; }; unsupportedTEError.ptr.prototype.Error = function() { var uste; uste = this; return uste.err; }; unsupportedTEError.prototype.Error = function() { return this.$val.Error(); }; isUnsupportedTEError = function(err) { var _tuple, err, ok; _tuple = $assertType(err, ptrType$36, true); ok = _tuple[1]; return ok; }; transferReader.ptr.prototype.parseTransferEncoding = function() { var $24r, $24r$1, _entry, _r$1, _r$2, _tuple, present, raw, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _entry = $f._entry; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; present = $f.present; raw = $f.raw; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _tuple = (_entry = t.Header[$String.keyFor("Transfer-Encoding")], _entry !== undefined ? [_entry.v, true] : [sliceType$2.nil, false]); raw = _tuple[0]; present = _tuple[1]; if (!present) { $s = -1; return $ifaceNil; } delete t.Header[$String.keyFor("Transfer-Encoding")]; if (!t.protoAtLeast(1, 1)) { $s = -1; return $ifaceNil; } /* */ if (!((raw.$length === 1))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((raw.$length === 1))) { */ case 1: _r$1 = fmt.Sprintf("too many transfer encodings: %q", new sliceType([raw])); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = new unsupportedTEError.ptr(_r$1); $s = 4; case 4: return $24r; /* } */ case 2: /* */ if (!ascii.EqualFold(textproto.TrimString((0 >= raw.$length ? ($throwRuntimeError("index out of range"), undefined) : raw.$array[raw.$offset + 0])), "chunked")) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!ascii.EqualFold(textproto.TrimString((0 >= raw.$length ? ($throwRuntimeError("index out of range"), undefined) : raw.$array[raw.$offset + 0])), "chunked")) { */ case 5: _r$2 = fmt.Sprintf("unsupported transfer encoding: %q", new sliceType([new $String((0 >= raw.$length ? ($throwRuntimeError("index out of range"), undefined) : raw.$array[raw.$offset + 0]))])); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r$1 = new unsupportedTEError.ptr(_r$2); $s = 8; case 8: return $24r$1; /* } */ case 6: delete t.Header[$String.keyFor("Content-Length")]; t.Chunked = true; $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: transferReader.ptr.prototype.parseTransferEncoding }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._entry = _entry; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.present = present; $f.raw = raw; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; transferReader.prototype.parseTransferEncoding = function() { return this.$val.parseTransferEncoding(); }; fixLength = function(isResponse, status, requestMethod, header, chunked$1) { var $24r, $24r$1, _1, _entry, _entry$1, _i, _q, _r$1, _r$2, _r$3, _ref, _tuple, chunked$1, cl, contentLens, ct, err, first, header, isRequest, isResponse, n, requestMethod, status, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _1 = $f._1; _entry = $f._entry; _entry$1 = $f._entry$1; _i = $f._i; _q = $f._q; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; _tuple = $f._tuple; chunked$1 = $f.chunked$1; cl = $f.cl; contentLens = $f.contentLens; ct = $f.ct; err = $f.err; first = $f.first; header = $f.header; isRequest = $f.isRequest; isResponse = $f.isResponse; n = $f.n; requestMethod = $f.requestMethod; status = $f.status; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: isRequest = !isResponse; contentLens = (_entry = header[$String.keyFor("Content-Length")], _entry !== undefined ? _entry.v : sliceType$2.nil); /* */ if (contentLens.$length > 1) { $s = 1; continue; } /* */ $s = 2; continue; /* if (contentLens.$length > 1) { */ case 1: first = textproto.TrimString((0 >= contentLens.$length ? ($throwRuntimeError("index out of range"), undefined) : contentLens.$array[contentLens.$offset + 0])); _ref = $subslice(contentLens, 1); _i = 0; /* while (true) { */ case 3: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 4; continue; } ct = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); /* */ if (!(first === textproto.TrimString(ct))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!(first === textproto.TrimString(ct))) { */ case 5: _r$1 = fmt.Errorf("http: message cannot contain multiple Content-Length headers; got %q", new sliceType([contentLens])); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = [new $Int64(0, 0), _r$1]; $s = 8; case 8: return $24r; /* } */ case 6: _i++; $s = 3; continue; case 4: $r = new Header(header).Del("Content-Length"); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = new Header(header).Add("Content-Length", first); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } contentLens = (_entry$1 = header[$String.keyFor("Content-Length")], _entry$1 !== undefined ? _entry$1.v : sliceType$2.nil); /* } */ case 2: /* */ if (noResponseBodyExpected(requestMethod)) { $s = 11; continue; } /* */ $s = 12; continue; /* if (noResponseBodyExpected(requestMethod)) { */ case 11: /* */ if (isRequest && contentLens.$length > 0 && !((contentLens.$length === 1) && (0 >= contentLens.$length ? ($throwRuntimeError("index out of range"), undefined) : contentLens.$array[contentLens.$offset + 0]) === "0")) { $s = 13; continue; } /* */ $s = 14; continue; /* if (isRequest && contentLens.$length > 0 && !((contentLens.$length === 1) && (0 >= contentLens.$length ? ($throwRuntimeError("index out of range"), undefined) : contentLens.$array[contentLens.$offset + 0]) === "0")) { */ case 13: _r$2 = fmt.Errorf("http: method cannot contain a Content-Length; got %q", new sliceType([contentLens])); /* */ $s = 15; case 15: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r$1 = [new $Int64(0, 0), _r$2]; $s = 16; case 16: return $24r$1; /* } */ case 14: $s = -1; return [new $Int64(0, 0), $ifaceNil]; /* } */ case 12: if ((_q = status / 100, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) === 1) { $s = -1; return [new $Int64(0, 0), $ifaceNil]; } _1 = status; if ((_1 === (204)) || (_1 === (304))) { $s = -1; return [new $Int64(0, 0), $ifaceNil]; } if (chunked$1) { $s = -1; return [new $Int64(-1, 4294967295), $ifaceNil]; } cl = ""; if (contentLens.$length === 1) { cl = textproto.TrimString((0 >= contentLens.$length ? ($throwRuntimeError("index out of range"), undefined) : contentLens.$array[contentLens.$offset + 0])); } /* */ if (!(cl === "")) { $s = 17; continue; } /* */ $s = 18; continue; /* if (!(cl === "")) { */ case 17: _r$3 = parseContentLength(cl); /* */ $s = 19; case 19: 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]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [new $Int64(-1, 4294967295), err]; } $s = -1; return [n, $ifaceNil]; /* } */ case 18: $r = new Header(header).Del("Content-Length"); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (isRequest) { $s = -1; return [new $Int64(0, 0), $ifaceNil]; } $s = -1; return [new $Int64(-1, 4294967295), $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: fixLength }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._1 = _1; $f._entry = _entry; $f._entry$1 = _entry$1; $f._i = _i; $f._q = _q; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._ref = _ref; $f._tuple = _tuple; $f.chunked$1 = chunked$1; $f.cl = cl; $f.contentLens = contentLens; $f.ct = ct; $f.err = err; $f.first = first; $f.header = header; $f.isRequest = isRequest; $f.isResponse = isResponse; $f.n = n; $f.requestMethod = requestMethod; $f.status = status; $f.$s = $s; $f.$r = $r; return $f; }; shouldClose = function(major, minor, header, removeCloseHeader) { var _entry, conv, hasClose, header, major, minor, removeCloseHeader, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; conv = $f.conv; hasClose = $f.hasClose; header = $f.header; major = $f.major; minor = $f.minor; removeCloseHeader = $f.removeCloseHeader; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (major < 1) { $s = -1; return true; } conv = (_entry = header[$String.keyFor("Connection")], _entry !== undefined ? _entry.v : sliceType$2.nil); hasClose = httpguts.HeaderValuesContainsToken(conv, "close"); if ((major === 1) && (minor === 0)) { $s = -1; return hasClose || !httpguts.HeaderValuesContainsToken(conv, "keep-alive"); } /* */ if (hasClose && removeCloseHeader) { $s = 1; continue; } /* */ $s = 2; continue; /* if (hasClose && removeCloseHeader) { */ case 1: $r = new Header(header).Del("Connection"); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return hasClose; /* */ } return; } if ($f === undefined) { $f = { $blk: shouldClose }; } $f._entry = _entry; $f.conv = conv; $f.hasClose = hasClose; $f.header = header; $f.major = major; $f.minor = minor; $f.removeCloseHeader = removeCloseHeader; $f.$s = $s; $f.$r = $r; return $f; }; fixTrailer = function(header, chunked$1) { var _entry, _i, _ref, _tuple, chunked$1, err, header, ok, trailer, v, vv, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _i = $f._i; _ref = $f._ref; _tuple = $f._tuple; chunked$1 = $f.chunked$1; err = $f.err; header = $f.header; ok = $f.ok; trailer = $f.trailer; v = $f.v; vv = $f.vv; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = [err]; trailer = [trailer]; _tuple = (_entry = header[$String.keyFor("Trailer")], _entry !== undefined ? [_entry.v, true] : [sliceType$2.nil, false]); vv = _tuple[0]; ok = _tuple[1]; if (!ok) { $s = -1; return [false, $ifaceNil]; } if (!chunked$1) { $s = -1; return [false, $ifaceNil]; } $r = new Header(header).Del("Trailer"); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } trailer[0] = {}; err[0] = $ifaceNil; _ref = vv; _i = 0; /* while (true) { */ case 2: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 3; continue; } v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); $r = foreachHeaderElement(v, (function(err, trailer) { return function $b(key) { var _1, _key, _r$1, _r$2, key, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _key = $f._key; _r$1 = $f._r$1; _r$2 = $f._r$2; key = $f.key; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = CanonicalHeaderKey(key); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } key = _r$1; _1 = key; /* */ if (_1 === ("Transfer-Encoding") || _1 === ("Trailer") || _1 === ("Content-Length")) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_1 === ("Transfer-Encoding") || _1 === ("Trailer") || _1 === ("Content-Length")) { */ case 3: /* */ if ($interfaceIsEqual(err[0], $ifaceNil)) { $s = 5; continue; } /* */ $s = 6; continue; /* if ($interfaceIsEqual(err[0], $ifaceNil)) { */ case 5: _r$2 = badStringError("bad trailer key", key); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } err[0] = _r$2; $s = -1; return; /* } */ case 6: /* } */ case 4: case 2: _key = key; (trailer[0] || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: sliceType$2.nil }; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._1 = _1; $f._key = _key; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.key = key; $f.$s = $s; $f.$r = $r; return $f; }; })(err, trailer)); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i++; $s = 2; continue; case 3: if (!($interfaceIsEqual(err[0], $ifaceNil))) { $s = -1; return [false, err[0]]; } if ($keys(trailer[0]).length === 0) { $s = -1; return [false, $ifaceNil]; } $s = -1; return [trailer[0], $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: fixTrailer }; } $f._entry = _entry; $f._i = _i; $f._ref = _ref; $f._tuple = _tuple; $f.chunked$1 = chunked$1; $f.err = err; $f.header = header; $f.ok = ok; $f.trailer = trailer; $f.v = v; $f.vv = vv; $f.$s = $s; $f.$r = $r; return $f; }; body.ptr.prototype.Read = function(p) { var $24r, $24r$1, _r$1, _tmp, _tmp$1, _tuple, b, err, n, p, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; b = $f.b; err = $f.err; n = $f.n; p = $f.p; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); n = 0; err = $ifaceNil; b = this; $r = b.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(b.mu, "Unlock"), []]); /* */ if (b.closed) { $s = 2; continue; } /* */ $s = 3; continue; /* if (b.closed) { */ case 2: _tmp = 0; _tmp$1 = $pkg.ErrBodyReadAfterClose; n = _tmp; err = _tmp$1; $24r = [n, err]; $s = 4; case 4: return $24r; /* } */ case 3: _r$1 = b.readLocked(p); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err = _tuple[1]; $24r$1 = [n, err]; $s = 6; case 6: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [n, err]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: body.ptr.prototype.Read }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r$1 = _r$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.n = n; $f.p = p; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; body.prototype.Read = function(p) { return this.$val.Read(p); }; body.ptr.prototype.readLocked = function(p) { var _r$1, _r$2, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, _tuple$2, b, e, err, lr, lr$1, n, ok, ok$1, p, x$5, x$6, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; b = $f.b; e = $f.e; err = $f.err; lr = $f.lr; lr$1 = $f.lr$1; n = $f.n; ok = $f.ok; ok$1 = $f.ok$1; p = $f.p; x$5 = $f.x$5; x$6 = $f.x$6; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; b = this; if (b.sawEOF) { _tmp = 0; _tmp$1 = io.EOF; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } _r$1 = b.src.Read(p); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err = _tuple[1]; /* */ if ($interfaceIsEqual(err, io.EOF)) { $s = 2; continue; } /* */ $s = 3; continue; /* if ($interfaceIsEqual(err, io.EOF)) { */ case 2: b.sawEOF = true; /* */ if (!($interfaceIsEqual(b.hdr, $ifaceNil))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!($interfaceIsEqual(b.hdr, $ifaceNil))) { */ case 4: _r$2 = b.readTrailer(); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } e = _r$2; if (!($interfaceIsEqual(e, $ifaceNil))) { err = e; b.sawEOF = false; b.closed = true; } b.hdr = $ifaceNil; $s = 6; continue; /* } else { */ case 5: _tuple$1 = $assertType(b.src, ptrType$37, true); lr = _tuple$1[0]; ok = _tuple$1[1]; if (ok && (x$5 = lr.N, (x$5.$high > 0 || (x$5.$high === 0 && x$5.$low > 0)))) { err = io.ErrUnexpectedEOF; } /* } */ case 6: /* } */ case 3: if ($interfaceIsEqual(err, $ifaceNil) && n > 0) { _tuple$2 = $assertType(b.src, ptrType$37, true); lr$1 = _tuple$2[0]; ok$1 = _tuple$2[1]; if (ok$1 && (x$6 = lr$1.N, (x$6.$high === 0 && x$6.$low === 0))) { err = io.EOF; b.sawEOF = true; } } /* */ if (b.sawEOF && !(b.onHitEOF === $throwNilPointerError)) { $s = 8; continue; } /* */ $s = 9; continue; /* if (b.sawEOF && !(b.onHitEOF === $throwNilPointerError)) { */ case 8: $r = b.onHitEOF(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 9: _tmp$2 = n; _tmp$3 = err; n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: body.ptr.prototype.readLocked }; } $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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.b = b; $f.e = e; $f.err = err; $f.lr = lr; $f.lr$1 = lr$1; $f.n = n; $f.ok = ok; $f.ok$1 = ok$1; $f.p = p; $f.x$5 = x$5; $f.x$6 = x$6; $f.$s = $s; $f.$r = $r; return $f; }; body.prototype.readLocked = function(p) { return this.$val.readLocked(p); }; seeUpcomingDoubleCRLF = function(r) { var _r$1, _tuple, buf, err, peekSize, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; buf = $f.buf; err = $f.err; peekSize = $f.peekSize; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: peekSize = 4; /* while (true) { */ case 1: _r$1 = r.Peek(peekSize); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; buf = _tuple[0]; err = _tuple[1]; if (bytes.HasSuffix(buf, doubleCRLF)) { $s = -1; return true; } if (!($interfaceIsEqual(err, $ifaceNil))) { /* break; */ $s = 2; continue; } peekSize = peekSize + (1) >> 0; $s = 1; continue; case 2: $s = -1; return false; /* */ } return; } if ($f === undefined) { $f = { $blk: seeUpcomingDoubleCRLF }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.buf = buf; $f.err = err; $f.peekSize = peekSize; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; body.ptr.prototype.readTrailer = function() { var _r$1, _r$2, _r$3, _r$4, _r$5, _ref, _tuple, _tuple$1, b, buf, err, hdr, rr, rr$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; b = $f.b; buf = $f.buf; err = $f.err; hdr = $f.hdr; rr = $f.rr; rr$1 = $f.rr$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; _r$1 = b.r.Peek(2); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; buf = _tuple[0]; err = _tuple[1]; /* */ if (bytes.Equal(buf, singleCRLF)) { $s = 2; continue; } /* */ $s = 3; continue; /* if (bytes.Equal(buf, singleCRLF)) { */ case 2: _r$2 = b.r.Discard(2); /* */ $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 = -1; return $ifaceNil; /* } */ case 3: if (buf.$length < 2) { $s = -1; return errTrailerEOF; } if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _r$3 = seeUpcomingDoubleCRLF(b.r); /* */ $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) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!_r$3) { */ case 5: $s = -1; return errors.New("http: suspiciously long trailer after chunked body"); /* } */ case 6: _r$4 = textproto.NewReader(b.r); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = _r$4.ReadMIMEHeader(); /* */ $s = 9; case 9: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$1 = _r$5; hdr = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { if ($interfaceIsEqual(err, io.EOF)) { $s = -1; return errTrailerEOF; } $s = -1; return err; } _ref = b.hdr; if ($assertType(_ref, ptrType$11, true)[1]) { rr = _ref.$val; mergeSetHeader((rr.$ptr_Trailer || (rr.$ptr_Trailer = new ptrType$38(function() { return this.$target.Trailer; }, function($v) { this.$target.Trailer = $v; }, rr))), (hdr)); } else if ($assertType(_ref, ptrType$18, true)[1]) { rr$1 = _ref.$val; mergeSetHeader((rr$1.$ptr_Trailer || (rr$1.$ptr_Trailer = new ptrType$38(function() { return this.$target.Trailer; }, function($v) { this.$target.Trailer = $v; }, rr$1))), (hdr)); } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: body.ptr.prototype.readTrailer }; } $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._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.b = b; $f.buf = buf; $f.err = err; $f.hdr = hdr; $f.rr = rr; $f.rr$1 = rr$1; $f.$s = $s; $f.$r = $r; return $f; }; body.prototype.readTrailer = function() { return this.$val.readTrailer(); }; mergeSetHeader = function(dst, src) { var _entry, _i, _key, _keys, _ref, dst, k, src, vv; if (dst.$get() === false) { dst.$set(src); return; } _ref = src; _i = 0; _keys = $keys(_ref); while (true) { if (!(_i < _keys.length)) { break; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; continue; } k = _entry.k; vv = _entry.v; _key = k; (dst.$get() || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: vv }; _i++; } }; body.ptr.prototype.unreadDataSizeLocked = function() { var _tuple, b, lr, ok; b = this; _tuple = $assertType(b.src, ptrType$37, true); lr = _tuple[0]; ok = _tuple[1]; if (ok) { return lr.N; } return new $Int64(-1, 4294967295); }; body.prototype.unreadDataSizeLocked = function() { return this.$val.unreadDataSizeLocked(); }; body.ptr.prototype.Close = function() { var $24r, $24r$1, _r$1, _r$2, _tuple, _tuple$1, _tuple$2, b, err, lr, n, ok, x$5, x$6, x$7, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; b = $f.b; err = $f.err; lr = $f.lr; n = $f.n; ok = $f.ok; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); b = this; $r = b.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(b.mu, "Unlock"), []]); /* */ if (b.closed) { $s = 2; continue; } /* */ $s = 3; continue; /* if (b.closed) { */ case 2: $24r = $ifaceNil; $s = 4; case 4: return $24r; /* } */ case 3: err = $ifaceNil; /* */ if (b.sawEOF) { $s = 6; continue; } /* */ if ($interfaceIsEqual(b.hdr, $ifaceNil) && b.closing) { $s = 7; continue; } /* */ if (b.doEarlyClose) { $s = 8; continue; } /* */ $s = 9; continue; /* if (b.sawEOF) { */ case 6: $s = 10; continue; /* } else if ($interfaceIsEqual(b.hdr, $ifaceNil) && b.closing) { */ case 7: $s = 10; continue; /* } else if (b.doEarlyClose) { */ case 8: _tuple = $assertType(b.src, ptrType$37, true); lr = _tuple[0]; ok = _tuple[1]; /* */ if (ok && (x$5 = lr.N, (x$5.$high > 0 || (x$5.$high === 0 && x$5.$low > 262144)))) { $s = 11; continue; } /* */ $s = 12; continue; /* if (ok && (x$5 = lr.N, (x$5.$high > 0 || (x$5.$high === 0 && x$5.$low > 262144)))) { */ case 11: b.earlyClose = true; $s = 13; continue; /* } else { */ case 12: n = new $Int64(0, 0); _r$1 = io.CopyN(io.Discard, (x$6 = new bodyLocked.ptr(b), new x$6.constructor.elem(x$6)), new $Int64(0, 262144)); /* */ $s = 14; case 14: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; n = _tuple$1[0]; err = _tuple$1[1]; if ($interfaceIsEqual(err, io.EOF)) { err = $ifaceNil; } if ((n.$high === 0 && n.$low === 262144)) { b.earlyClose = true; } /* } */ case 13: $s = 10; continue; /* } else { */ case 9: _r$2 = io.Copy(io.Discard, (x$7 = new bodyLocked.ptr(b), new x$7.constructor.elem(x$7))); /* */ $s = 15; case 15: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$2 = _r$2; err = _tuple$2[1]; /* } */ case 10: case 5: b.closed = true; $24r$1 = err; $s = 16; case 16: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: body.ptr.prototype.Close }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.b = b; $f.err = err; $f.lr = lr; $f.n = n; $f.ok = ok; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; body.prototype.Close = function() { return this.$val.Close(); }; body.ptr.prototype.didEarlyClose = function() { var $24r, b, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; b = $f.b; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); b = this; $r = b.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(b.mu, "Unlock"), []]); $24r = b.earlyClose; $s = 2; case 2: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; return false; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: body.ptr.prototype.didEarlyClose }; } $f.$24r = $24r; $f.b = b; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; body.prototype.didEarlyClose = function() { return this.$val.didEarlyClose(); }; body.ptr.prototype.bodyRemains = function() { var $24r, b, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; b = $f.b; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); b = this; $r = b.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(b.mu, "Unlock"), []]); $24r = !b.sawEOF; $s = 2; case 2: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; return false; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: body.ptr.prototype.bodyRemains }; } $f.$24r = $24r; $f.b = b; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; body.prototype.bodyRemains = function() { return this.$val.bodyRemains(); }; body.ptr.prototype.registerOnHitEOF = function(fn) { var b, fn, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; fn = $f.fn; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); b = this; $r = b.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(b.mu, "Unlock"), []]); b.onHitEOF = fn; $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: body.ptr.prototype.registerOnHitEOF }; } $f.b = b; $f.fn = fn; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; body.prototype.registerOnHitEOF = function(fn) { return this.$val.registerOnHitEOF(fn); }; bodyLocked.ptr.prototype.Read = function(p) { var $24r, _r$1, _tmp, _tmp$1, _tuple, bl, err, n, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; bl = $f.bl; err = $f.err; n = $f.n; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; bl = this; if (bl.b.closed) { _tmp = 0; _tmp$1 = $pkg.ErrBodyReadAfterClose; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } _r$1 = bl.b.readLocked(p); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err = _tuple[1]; $24r = [n, err]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: bodyLocked.ptr.prototype.Read }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.bl = bl; $f.err = err; $f.n = n; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; bodyLocked.prototype.Read = function(p) { return this.$val.Read(p); }; parseContentLength = function(cl) { var $24r, _r$1, _tuple, cl, err, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _tuple = $f._tuple; cl = $f.cl; err = $f.err; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cl = textproto.TrimString(cl); if (cl === "") { $s = -1; return [new $Int64(-1, 4294967295), $ifaceNil]; } _tuple = strconv.ParseUint(cl, 10, 63); n = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: _r$1 = badStringError("bad Content-Length", cl); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = [new $Int64(0, 0), _r$1]; $s = 4; case 4: return $24r; /* } */ case 2: $s = -1; return [(new $Int64(n.$high, n.$low)), $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: parseContentLength }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.cl = cl; $f.err = err; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; finishAsyncByteRead.ptr.prototype.Read = function(p) { var _r$1, _tmp, _tmp$1, err, fr, n, p, rres, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; err = $f.err; fr = $f.fr; n = $f.n; p = $f.p; rres = $f.rres; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; fr = this; if (p.$length === 0) { $s = -1; return [n, err]; } _r$1 = $recv(fr.tw.ByteReadCh); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } rres = $clone(_r$1[0], readResult); _tmp = rres.n; _tmp$1 = rres.err; n = _tmp; err = _tmp$1; if (n === 1) { (0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0] = rres.b); } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: finishAsyncByteRead.ptr.prototype.Read }; } $f._r$1 = _r$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.err = err; $f.fr = fr; $f.n = n; $f.p = p; $f.rres = rres; $f.$s = $s; $f.$r = $r; return $f; }; finishAsyncByteRead.prototype.Read = function(p) { return this.$val.Read(p); }; isKnownInMemoryReader = function(r) { var $24r, $24r$1, _r$1, _r$2, _r$3, _r$4, _r$5, _ref, _tuple, ok, r, r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _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; _ref = $f._ref; _tuple = $f._tuple; ok = $f.ok; r = $f.r; r$1 = $f.r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _ref = r; if ($assertType(_ref, ptrType$39, true)[1] || $assertType(_ref, ptrType$40, true)[1] || $assertType(_ref, ptrType$41, true)[1]) { $s = -1; return true; } /* */ if ($interfaceIsEqual(reflect.TypeOf(r), nopCloserType)) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($interfaceIsEqual(reflect.TypeOf(r), nopCloserType)) { */ case 1: _r$1 = reflect.ValueOf(r); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = $clone(_r$1, reflect.Value).Field(0); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = $clone(_r$2, reflect.Value).Interface(); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = isKnownInMemoryReader($assertType(_r$3, io.Reader)); /* */ $s = 6; case 6: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r = _r$4; $s = 7; case 7: return $24r; /* } */ case 2: _tuple = $assertType(r, ptrType$20, true); r$1 = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 8; continue; } /* */ $s = 9; continue; /* if (ok) { */ case 8: _r$5 = isKnownInMemoryReader(r$1.ReadCloser); /* */ $s = 10; case 10: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $24r$1 = _r$5; $s = 11; case 11: return $24r$1; /* } */ case 9: $s = -1; return false; /* */ } return; } if ($f === undefined) { $f = { $blk: isKnownInMemoryReader }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $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._ref = _ref; $f._tuple = _tuple; $f.ok = ok; $f.r = r; $f.r$1 = r$1; $f.$s = $s; $f.$r = $r; return $f; }; bufioFlushWriter.ptr.prototype.Write = function(p) { var _r$1, _r$2, _tuple, _tuple$1, bw, err, ferr, fw, n, ok, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; bw = $f.bw; err = $f.err; ferr = $f.ferr; fw = $f.fw; n = $f.n; ok = $f.ok; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; fw = this; _r$1 = fw.w.Write(p); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err = _tuple[1]; _tuple$1 = $assertType(fw.w, ptrType$14, true); bw = _tuple$1[0]; ok = _tuple$1[1]; /* */ if (n > 0 && ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (n > 0 && ok) { */ case 2: _r$2 = bw.Flush(); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } ferr = _r$2; if (!($interfaceIsEqual(ferr, $ifaceNil)) && $interfaceIsEqual(err, $ifaceNil)) { err = ferr; } /* } */ case 3: $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: bufioFlushWriter.ptr.prototype.Write }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.bw = bw; $f.err = err; $f.ferr = ferr; $f.fw = fw; $f.n = n; $f.ok = ok; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; bufioFlushWriter.prototype.Write = function(p) { return this.$val.Write(p); }; StatusText = function(code) { var _entry, code; return (_entry = statusText[$Int.keyFor(code)], _entry !== undefined ? _entry.v : ""); }; $pkg.StatusText = StatusText; socksDialer.ptr.prototype.connect = function(ctx, c, address) { var $24r, $24r$1, $24r$10, $24r$11, $24r$12, $24r$13, $24r$14, $24r$15, $24r$16, $24r$17, $24r$2, $24r$3, $24r$4, $24r$5, $24r$6, $24r$7, $24r$8, $24r$9, _, _1, _i, _r$1, _r$10, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _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$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, _tuple$7, a, address, am, am$1, ams, b, c, cmdErr, ctx, ctxErr, d, deadline, done, err, err$1, errCh, host, ip, ip4, ip6, l, ok, port, x$5, x$6, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$10 = $f.$24r$10; $24r$11 = $f.$24r$11; $24r$12 = $f.$24r$12; $24r$13 = $f.$24r$13; $24r$14 = $f.$24r$14; $24r$15 = $f.$24r$15; $24r$16 = $f.$24r$16; $24r$17 = $f.$24r$17; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; $24r$6 = $f.$24r$6; $24r$7 = $f.$24r$7; $24r$8 = $f.$24r$8; $24r$9 = $f.$24r$9; _ = $f._; _1 = $f._1; _i = $f._i; _r$1 = $f._r$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$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$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _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 = $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; address = $f.address; am = $f.am; am$1 = $f.am$1; ams = $f.ams; b = $f.b; c = $f.c; cmdErr = $f.cmdErr; ctx = $f.ctx; ctxErr = $f.ctxErr; d = $f.d; deadline = $f.deadline; done = $f.done; err = $f.err; err$1 = $f.err$1; errCh = $f.errCh; host = $f.host; ip = $f.ip; ip4 = $f.ip4; ip6 = $f.ip6; l = $f.l; ok = $f.ok; port = $f.port; x$5 = $f.x$5; x$6 = $f.x$6; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); a = [a]; c = [c]; ctx = [ctx]; ctxErr = [ctxErr]; done = [done]; errCh = [errCh]; _ = $ifaceNil; ctxErr[0] = $ifaceNil; d = this; _r$1 = sockssplitHostPort(address); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; host = _tuple[0]; port = _tuple[1]; err = _tuple[2]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: _tmp = $ifaceNil; _tmp$1 = err; _ = _tmp; ctxErr[0] = _tmp$1; $24r = [_, ctxErr[0]]; $s = 4; case 4: return $24r; /* } */ case 3: _r$2 = ctx[0].Deadline(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; deadline = $clone(_tuple$1[0], time.Time); ok = _tuple$1[1]; /* */ if (ok && !$clone(deadline, time.Time).IsZero()) { $s = 6; continue; } /* */ $s = 7; continue; /* if (ok && !$clone(deadline, time.Time).IsZero()) { */ case 6: _r$3 = c[0].SetDeadline($clone(deadline, time.Time)); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $deferred.push([$methodVal(c[0], "SetDeadline"), [$clone(socksnoDeadline, time.Time)]]); /* } */ case 7: /* */ if (!($interfaceIsEqual(ctx[0], context.Background()))) { $s = 9; continue; } /* */ $s = 10; continue; /* if (!($interfaceIsEqual(ctx[0], context.Background()))) { */ case 9: errCh[0] = new $Chan($error, 1); done[0] = new $Chan(structType, 0); $deferred.push([(function(a, c, ctx, ctxErr, done, errCh) { return function $b() { var _r$4, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$4 = $f._r$4; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $close(done[0]); /* */ if ($interfaceIsEqual(ctxErr[0], $ifaceNil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($interfaceIsEqual(ctxErr[0], $ifaceNil)) { */ case 1: _r$4 = $recv(errCh[0]); /* */ $s = 3; case 3: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } ctxErr[0] = _r$4[0]; /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$4 = _r$4; $f.$s = $s; $f.$r = $r; return $f; }; })(a, c, ctx, ctxErr, done, errCh), []]); $go((function(a, c, ctx, ctxErr, done, errCh) { return function $b() { var _r$4, _r$5, _r$6, _r$7, _selection, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _selection = $f._selection; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$4 = ctx[0].Done(); /* */ $s = 1; case 1: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = $select([[_r$4], [done[0]]]); /* */ $s = 2; case 2: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _selection = _r$5; /* */ if (_selection[0] === 0) { $s = 3; continue; } /* */ if (_selection[0] === 1) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_selection[0] === 0) { */ case 3: _r$6 = c[0].SetDeadline($clone(socksaLongTimeAgo, time.Time)); /* */ $s = 6; case 6: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; _r$7 = ctx[0].Err(); /* */ $s = 7; case 7: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } $r = $send(errCh[0], _r$7); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 5; continue; /* } else if (_selection[0] === 1) { */ case 4: $r = $send(errCh[0], $ifaceNil); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._selection = _selection; $f.$s = $s; $f.$r = $r; return $f; }; })(a, c, ctx, ctxErr, done, errCh), []); /* } */ case 10: b = $makeSlice(sliceType$3, 0, (6 + host.length >> 0)); b = $append(b, 5); /* */ if ((d.AuthMethods.$length === 0) || d.Authenticate === $throwNilPointerError) { $s = 11; continue; } /* */ $s = 12; continue; /* if ((d.AuthMethods.$length === 0) || d.Authenticate === $throwNilPointerError) { */ case 11: b = $append(b, 1, 0); $s = 13; continue; /* } else { */ case 12: ams = d.AuthMethods; /* */ if (ams.$length > 255) { $s = 14; continue; } /* */ $s = 15; continue; /* if (ams.$length > 255) { */ case 14: _tmp$2 = $ifaceNil; _tmp$3 = errors.New("too many authentication methods"); _ = _tmp$2; ctxErr[0] = _tmp$3; $24r$1 = [_, ctxErr[0]]; $s = 16; case 16: return $24r$1; /* } */ case 15: b = $append(b, ((ams.$length << 24 >>> 24))); _ref = ams; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } am = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); b = $append(b, ((am << 24 >>> 24))); _i++; } /* } */ case 13: _r$4 = c[0].Write(b); /* */ $s = 17; case 17: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$2 = _r$4; ctxErr[0] = _tuple$2[1]; /* */ if (!($interfaceIsEqual(ctxErr[0], $ifaceNil))) { $s = 18; continue; } /* */ $s = 19; continue; /* if (!($interfaceIsEqual(ctxErr[0], $ifaceNil))) { */ case 18: $24r$2 = [_, ctxErr[0]]; $s = 20; case 20: return $24r$2; /* } */ case 19: _r$5 = io.ReadFull(c[0], $subslice(b, 0, 2)); /* */ $s = 21; case 21: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$3 = _r$5; ctxErr[0] = _tuple$3[1]; /* */ if (!($interfaceIsEqual(ctxErr[0], $ifaceNil))) { $s = 22; continue; } /* */ $s = 23; continue; /* if (!($interfaceIsEqual(ctxErr[0], $ifaceNil))) { */ case 22: $24r$3 = [_, ctxErr[0]]; $s = 24; case 24: return $24r$3; /* } */ case 23: /* */ if (!(((0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]) === 5))) { $s = 25; continue; } /* */ $s = 26; continue; /* if (!(((0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]) === 5))) { */ case 25: _tmp$4 = $ifaceNil; _tmp$5 = errors.New("unexpected protocol version " + strconv.Itoa((((0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]) >> 0)))); _ = _tmp$4; ctxErr[0] = _tmp$5; $24r$4 = [_, ctxErr[0]]; $s = 27; case 27: return $24r$4; /* } */ case 26: am$1 = (((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]) >> 0)); /* */ if (am$1 === 255) { $s = 28; continue; } /* */ $s = 29; continue; /* if (am$1 === 255) { */ case 28: _tmp$6 = $ifaceNil; _tmp$7 = errors.New("no acceptable authentication methods"); _ = _tmp$6; ctxErr[0] = _tmp$7; $24r$5 = [_, ctxErr[0]]; $s = 30; case 30: return $24r$5; /* } */ case 29: /* */ if (!(d.Authenticate === $throwNilPointerError)) { $s = 31; continue; } /* */ $s = 32; continue; /* if (!(d.Authenticate === $throwNilPointerError)) { */ case 31: _r$6 = d.Authenticate(ctx[0], c[0], am$1); /* */ $s = 33; case 33: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } ctxErr[0] = _r$6; /* */ if (!($interfaceIsEqual(ctxErr[0], $ifaceNil))) { $s = 34; continue; } /* */ $s = 35; continue; /* if (!($interfaceIsEqual(ctxErr[0], $ifaceNil))) { */ case 34: $24r$6 = [_, ctxErr[0]]; $s = 36; case 36: return $24r$6; /* } */ case 35: /* } */ case 32: b = $subslice(b, 0, 0); b = $append(b, 5, ((d.cmd << 24 >>> 24)), 0); ip = net.ParseIP(host); /* */ if (!(ip === net.IP.nil)) { $s = 37; continue; } /* */ $s = 38; continue; /* if (!(ip === net.IP.nil)) { */ case 37: ip4 = ip.To4(); /* */ if (!(ip4 === net.IP.nil)) { $s = 40; continue; } /* */ $s = 41; continue; /* if (!(ip4 === net.IP.nil)) { */ case 40: b = $append(b, 1); b = $appendSlice(b, $convertSliceType(ip4, sliceType$3)); $s = 42; continue; /* } else { */ case 41: ip6 = ip.To16(); /* */ if (!(ip6 === net.IP.nil)) { $s = 43; continue; } /* */ $s = 44; continue; /* if (!(ip6 === net.IP.nil)) { */ case 43: b = $append(b, 4); b = $appendSlice(b, $convertSliceType(ip6, sliceType$3)); $s = 45; continue; /* } else { */ case 44: _tmp$8 = $ifaceNil; _tmp$9 = errors.New("unknown address type"); _ = _tmp$8; ctxErr[0] = _tmp$9; $24r$7 = [_, ctxErr[0]]; $s = 46; case 46: return $24r$7; /* } */ case 45: /* } */ case 42: $s = 39; continue; /* } else { */ case 38: /* */ if (host.length > 255) { $s = 47; continue; } /* */ $s = 48; continue; /* if (host.length > 255) { */ case 47: _tmp$10 = $ifaceNil; _tmp$11 = errors.New("FQDN too long"); _ = _tmp$10; ctxErr[0] = _tmp$11; $24r$8 = [_, ctxErr[0]]; $s = 49; case 49: return $24r$8; /* } */ case 48: b = $append(b, 3); b = $append(b, ((host.length << 24 >>> 24))); b = $appendSlice(b, host); /* } */ case 39: b = $append(b, (((port >> 8 >> 0) << 24 >>> 24)), ((port << 24 >>> 24))); _r$7 = c[0].Write(b); /* */ $s = 50; case 50: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _tuple$4 = _r$7; ctxErr[0] = _tuple$4[1]; /* */ if (!($interfaceIsEqual(ctxErr[0], $ifaceNil))) { $s = 51; continue; } /* */ $s = 52; continue; /* if (!($interfaceIsEqual(ctxErr[0], $ifaceNil))) { */ case 51: $24r$9 = [_, ctxErr[0]]; $s = 53; case 53: return $24r$9; /* } */ case 52: _r$8 = io.ReadFull(c[0], $subslice(b, 0, 4)); /* */ $s = 54; case 54: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _tuple$5 = _r$8; ctxErr[0] = _tuple$5[1]; /* */ if (!($interfaceIsEqual(ctxErr[0], $ifaceNil))) { $s = 55; continue; } /* */ $s = 56; continue; /* if (!($interfaceIsEqual(ctxErr[0], $ifaceNil))) { */ case 55: $24r$10 = [_, ctxErr[0]]; $s = 57; case 57: return $24r$10; /* } */ case 56: /* */ if (!(((0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]) === 5))) { $s = 58; continue; } /* */ $s = 59; continue; /* if (!(((0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]) === 5))) { */ case 58: _tmp$12 = $ifaceNil; _tmp$13 = errors.New("unexpected protocol version " + strconv.Itoa((((0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]) >> 0)))); _ = _tmp$12; ctxErr[0] = _tmp$13; $24r$11 = [_, ctxErr[0]]; $s = 60; case 60: return $24r$11; /* } */ case 59: cmdErr = (((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]) >> 0)); /* */ if (!((cmdErr === 0))) { $s = 61; continue; } /* */ $s = 62; continue; /* if (!((cmdErr === 0))) { */ case 61: _tmp$14 = $ifaceNil; _tmp$15 = errors.New("unknown error " + new socksReply(cmdErr).String()); _ = _tmp$14; ctxErr[0] = _tmp$15; $24r$12 = [_, ctxErr[0]]; $s = 63; case 63: return $24r$12; /* } */ case 62: /* */ if (!(((2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]) === 0))) { $s = 64; continue; } /* */ $s = 65; continue; /* if (!(((2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]) === 0))) { */ case 64: _tmp$16 = $ifaceNil; _tmp$17 = errors.New("non-zero reserved field"); _ = _tmp$16; ctxErr[0] = _tmp$17; $24r$13 = [_, ctxErr[0]]; $s = 66; case 66: return $24r$13; /* } */ case 65: l = 2; a[0] = new socksAddr.ptr("", net.IP.nil, 0); _1 = (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]); /* */ if (_1 === (1)) { $s = 68; continue; } /* */ if (_1 === (4)) { $s = 69; continue; } /* */ if (_1 === (3)) { $s = 70; continue; } /* */ $s = 71; continue; /* if (_1 === (1)) { */ case 68: l = l + (4) >> 0; a[0].IP = $makeSlice(net.IP, 4); $s = 72; continue; /* } else if (_1 === (4)) { */ case 69: l = l + (16) >> 0; a[0].IP = $makeSlice(net.IP, 16); $s = 72; continue; /* } else if (_1 === (3)) { */ case 70: _r$9 = io.ReadFull(c[0], $subslice(b, 0, 1)); /* */ $s = 73; case 73: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tuple$6 = _r$9; err$1 = _tuple$6[1]; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 74; continue; } /* */ $s = 75; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 74: _tmp$18 = $ifaceNil; _tmp$19 = err$1; _ = _tmp$18; ctxErr[0] = _tmp$19; $24r$14 = [_, ctxErr[0]]; $s = 76; case 76: return $24r$14; /* } */ case 75: l = l + ((((0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]) >> 0))) >> 0; $s = 72; continue; /* } else { */ case 71: _tmp$20 = $ifaceNil; _tmp$21 = errors.New("unknown address type " + strconv.Itoa((((3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]) >> 0)))); _ = _tmp$20; ctxErr[0] = _tmp$21; $24r$15 = [_, ctxErr[0]]; $s = 77; case 77: return $24r$15; /* } */ case 72: case 67: if (b.$capacity < l) { b = $makeSlice(sliceType$3, l); } else { b = $subslice(b, 0, l); } _r$10 = io.ReadFull(c[0], b); /* */ $s = 78; case 78: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tuple$7 = _r$10; ctxErr[0] = _tuple$7[1]; /* */ if (!($interfaceIsEqual(ctxErr[0], $ifaceNil))) { $s = 79; continue; } /* */ $s = 80; continue; /* if (!($interfaceIsEqual(ctxErr[0], $ifaceNil))) { */ case 79: $24r$16 = [_, ctxErr[0]]; $s = 81; case 81: return $24r$16; /* } */ case 80: if (!(a[0].IP === net.IP.nil)) { $copySlice(a[0].IP, b); } else { a[0].Name = ($bytesToString($subslice(b, 0, (b.$length - 2 >> 0)))); } a[0].Port = ((((x$5 = b.$length - 2 >> 0, ((x$5 < 0 || x$5 >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + x$5])) >> 0)) << 8 >> 0) | (((x$6 = b.$length - 1 >> 0, ((x$6 < 0 || x$6 >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + x$6])) >> 0)); _tmp$22 = a[0]; _tmp$23 = $ifaceNil; _ = _tmp$22; ctxErr[0] = _tmp$23; $24r$17 = [_, ctxErr[0]]; $s = 82; case 82: return $24r$17; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [_, ctxErr[0]]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: socksDialer.ptr.prototype.connect }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$10 = $24r$10; $f.$24r$11 = $24r$11; $f.$24r$12 = $24r$12; $f.$24r$13 = $24r$13; $f.$24r$14 = $24r$14; $f.$24r$15 = $24r$15; $f.$24r$16 = $24r$16; $f.$24r$17 = $24r$17; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f.$24r$6 = $24r$6; $f.$24r$7 = $24r$7; $f.$24r$8 = $24r$8; $f.$24r$9 = $24r$9; $f._ = _; $f._1 = _1; $f._i = _i; $f._r$1 = _r$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$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$3 = _tmp$3; $f._tmp$4 = _tmp$4; $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 = _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.address = address; $f.am = am; $f.am$1 = am$1; $f.ams = ams; $f.b = b; $f.c = c; $f.cmdErr = cmdErr; $f.ctx = ctx; $f.ctxErr = ctxErr; $f.d = d; $f.deadline = deadline; $f.done = done; $f.err = err; $f.err$1 = err$1; $f.errCh = errCh; $f.host = host; $f.ip = ip; $f.ip4 = ip4; $f.ip6 = ip6; $f.l = l; $f.ok = ok; $f.port = port; $f.x$5 = x$5; $f.x$6 = x$6; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; socksDialer.prototype.connect = function(ctx, c, address) { return this.$val.connect(ctx, c, address); }; sockssplitHostPort = function(address) { var _r$1, _tuple, _tuple$1, address, err, host, port, portnum, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; address = $f.address; err = $f.err; host = $f.host; port = $f.port; portnum = $f.portnum; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = net.SplitHostPort(address); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; host = _tuple[0]; port = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return ["", 0, err]; } _tuple$1 = strconv.Atoi(port); portnum = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return ["", 0, err]; } if (1 > portnum || portnum > 65535) { $s = -1; return ["", 0, errors.New("port number out of range " + port)]; } $s = -1; return [host, portnum, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: sockssplitHostPort }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.address = address; $f.err = err; $f.host = host; $f.port = port; $f.portnum = portnum; $f.$s = $s; $f.$r = $r; return $f; }; socksCommand.prototype.String = function() { var _1, cmd; cmd = this.$val; _1 = cmd; if (_1 === (1)) { return "socks connect"; } else if (_1 === (2)) { return "socks bind"; } else { return "socks " + strconv.Itoa(((cmd >> 0))); } }; $ptrType(socksCommand).prototype.String = function() { return new socksCommand(this.$get()).String(); }; socksReply.prototype.String = function() { var _1, code; code = this.$val; _1 = code; if (_1 === (0)) { return "succeeded"; } else if (_1 === (1)) { return "general SOCKS server failure"; } else if (_1 === (2)) { return "connection not allowed by ruleset"; } else if (_1 === (3)) { return "network unreachable"; } else if (_1 === (4)) { return "host unreachable"; } else if (_1 === (5)) { return "connection refused"; } else if (_1 === (6)) { return "TTL expired"; } else if (_1 === (7)) { return "command not supported"; } else if (_1 === (8)) { return "address type not supported"; } else { return "unknown code: " + strconv.Itoa(((code >> 0))); } }; $ptrType(socksReply).prototype.String = function() { return new socksReply(this.$get()).String(); }; socksAddr.ptr.prototype.Network = function() { var a; a = this; return "socks"; }; socksAddr.prototype.Network = function() { return this.$val.Network(); }; socksAddr.ptr.prototype.String = function() { var a, port; a = this; if (a === ptrType$42.nil) { return ""; } port = strconv.Itoa(a.Port); if (a.IP === net.IP.nil) { return net.JoinHostPort(a.Name, port); } return net.JoinHostPort(a.IP.String(), port); }; socksAddr.prototype.String = function() { return this.$val.String(); }; socksConn.ptr.prototype.BoundAddr = function() { var c; c = this; if (c === ptrType$43.nil) { return $ifaceNil; } return c.boundAddr; }; socksConn.prototype.BoundAddr = function() { return this.$val.BoundAddr(); }; socksDialer.ptr.prototype.DialContext = function(ctx, network, address) { var _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, a, address, c, ctx, d, dd, dst, dst$1, dst$2, dst$3, err, err$1, network, proxy, proxy$1, proxy$2, proxy$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; _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; a = $f.a; address = $f.address; c = $f.c; ctx = $f.ctx; d = $f.d; dd = $f.dd; dst = $f.dst; dst$1 = $f.dst$1; dst$2 = $f.dst$2; dst$3 = $f.dst$3; err = $f.err; err$1 = $f.err$1; network = $f.network; proxy = $f.proxy; proxy$1 = $f.proxy$1; proxy$2 = $f.proxy$2; proxy$3 = $f.proxy$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: d = this; err = d.validateTarget(network, address); /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: _r$1 = d.pathAddrs(address); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; proxy = _tuple[0]; dst = _tuple[1]; $s = -1; return [$ifaceNil, new net.OpError.ptr(new socksCommand(d.cmd).String(), network, proxy, dst, err)]; /* } */ case 2: /* */ if ($interfaceIsEqual(ctx, $ifaceNil)) { $s = 4; continue; } /* */ $s = 5; continue; /* if ($interfaceIsEqual(ctx, $ifaceNil)) { */ case 4: _r$2 = d.pathAddrs(address); /* */ $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; proxy$1 = _tuple$1[0]; dst$1 = _tuple$1[1]; $s = -1; return [$ifaceNil, new net.OpError.ptr(new socksCommand(d.cmd).String(), network, proxy$1, dst$1, errors.New("nil context"))]; /* } */ case 5: err$1 = $ifaceNil; c = $ifaceNil; /* */ if (!(d.ProxyDial === $throwNilPointerError)) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!(d.ProxyDial === $throwNilPointerError)) { */ case 7: _r$3 = d.ProxyDial(ctx, d.proxyNetwork, d.proxyAddress); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$2 = _r$3; c = _tuple$2[0]; err$1 = _tuple$2[1]; $s = 9; continue; /* } else { */ case 8: dd = new net.Dialer.ptr(new time.Duration(0, 0), new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil), $ifaceNil, false, new time.Duration(0, 0), new time.Duration(0, 0), ptrType$1.nil, $chanNil, $throwNilPointerError); _r$4 = dd.DialContext(ctx, d.proxyNetwork, d.proxyAddress); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$3 = _r$4; c = _tuple$3[0]; err$1 = _tuple$3[1]; /* } */ case 9: /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 12; continue; } /* */ $s = 13; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 12: _r$5 = d.pathAddrs(address); /* */ $s = 14; case 14: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$4 = _r$5; proxy$2 = _tuple$4[0]; dst$2 = _tuple$4[1]; $s = -1; return [$ifaceNil, new net.OpError.ptr(new socksCommand(d.cmd).String(), network, proxy$2, dst$2, err$1)]; /* } */ case 13: _r$6 = d.connect(ctx, c, address); /* */ $s = 15; case 15: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tuple$5 = _r$6; a = _tuple$5[0]; err$1 = _tuple$5[1]; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 16; continue; } /* */ $s = 17; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 16: _r$7 = c.Close(); /* */ $s = 18; case 18: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$7; _r$8 = d.pathAddrs(address); /* */ $s = 19; case 19: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _tuple$6 = _r$8; proxy$3 = _tuple$6[0]; dst$3 = _tuple$6[1]; $s = -1; return [$ifaceNil, new net.OpError.ptr(new socksCommand(d.cmd).String(), network, proxy$3, dst$3, err$1)]; /* } */ case 17: $s = -1; return [new socksConn.ptr(c, a), $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: socksDialer.ptr.prototype.DialContext }; } $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._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.a = a; $f.address = address; $f.c = c; $f.ctx = ctx; $f.d = d; $f.dd = dd; $f.dst = dst; $f.dst$1 = dst$1; $f.dst$2 = dst$2; $f.dst$3 = dst$3; $f.err = err; $f.err$1 = err$1; $f.network = network; $f.proxy = proxy; $f.proxy$1 = proxy$1; $f.proxy$2 = proxy$2; $f.proxy$3 = proxy$3; $f.$s = $s; $f.$r = $r; return $f; }; socksDialer.prototype.DialContext = function(ctx, network, address) { return this.$val.DialContext(ctx, network, address); }; socksDialer.ptr.prototype.DialWithConn = function(ctx, c, network, address) { var _r$1, _r$2, _r$3, _r$4, _tuple, _tuple$1, _tuple$2, _tuple$3, a, address, c, ctx, d, dst, dst$1, dst$2, err, err$1, network, proxy, proxy$1, proxy$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; a = $f.a; address = $f.address; c = $f.c; ctx = $f.ctx; d = $f.d; dst = $f.dst; dst$1 = $f.dst$1; dst$2 = $f.dst$2; err = $f.err; err$1 = $f.err$1; network = $f.network; proxy = $f.proxy; proxy$1 = $f.proxy$1; proxy$2 = $f.proxy$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: d = this; err = d.validateTarget(network, address); /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: _r$1 = d.pathAddrs(address); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; proxy = _tuple[0]; dst = _tuple[1]; $s = -1; return [$ifaceNil, new net.OpError.ptr(new socksCommand(d.cmd).String(), network, proxy, dst, err)]; /* } */ case 2: /* */ if ($interfaceIsEqual(ctx, $ifaceNil)) { $s = 4; continue; } /* */ $s = 5; continue; /* if ($interfaceIsEqual(ctx, $ifaceNil)) { */ case 4: _r$2 = d.pathAddrs(address); /* */ $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; proxy$1 = _tuple$1[0]; dst$1 = _tuple$1[1]; $s = -1; return [$ifaceNil, new net.OpError.ptr(new socksCommand(d.cmd).String(), network, proxy$1, dst$1, errors.New("nil context"))]; /* } */ case 5: _r$3 = d.connect(ctx, c, address); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$2 = _r$3; a = _tuple$2[0]; err$1 = _tuple$2[1]; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 8: _r$4 = d.pathAddrs(address); /* */ $s = 10; case 10: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$3 = _r$4; proxy$2 = _tuple$3[0]; dst$2 = _tuple$3[1]; $s = -1; return [$ifaceNil, new net.OpError.ptr(new socksCommand(d.cmd).String(), network, proxy$2, dst$2, err$1)]; /* } */ case 9: $s = -1; return [a, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: socksDialer.ptr.prototype.DialWithConn }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.a = a; $f.address = address; $f.c = c; $f.ctx = ctx; $f.d = d; $f.dst = dst; $f.dst$1 = dst$1; $f.dst$2 = dst$2; $f.err = err; $f.err$1 = err$1; $f.network = network; $f.proxy = proxy; $f.proxy$1 = proxy$1; $f.proxy$2 = proxy$2; $f.$s = $s; $f.$r = $r; return $f; }; socksDialer.prototype.DialWithConn = function(ctx, c, network, address) { return this.$val.DialWithConn(ctx, c, network, address); }; socksDialer.ptr.prototype.Dial = function(network, address) { var _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, address, c, d, dst, dst$1, err, err$1, err$2, network, proxy, proxy$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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 = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; address = $f.address; c = $f.c; d = $f.d; dst = $f.dst; dst$1 = $f.dst$1; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; network = $f.network; proxy = $f.proxy; proxy$1 = $f.proxy$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: d = this; err = d.validateTarget(network, address); /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: _r$1 = d.pathAddrs(address); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; proxy = _tuple[0]; dst = _tuple[1]; $s = -1; return [$ifaceNil, new net.OpError.ptr(new socksCommand(d.cmd).String(), network, proxy, dst, err)]; /* } */ case 2: err$1 = $ifaceNil; c = $ifaceNil; /* */ if (!(d.ProxyDial === $throwNilPointerError)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!(d.ProxyDial === $throwNilPointerError)) { */ case 4: _r$2 = d.ProxyDial(context.Background(), d.proxyNetwork, d.proxyAddress); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; c = _tuple$1[0]; err$1 = _tuple$1[1]; $s = 6; continue; /* } else { */ case 5: _tuple$2 = net.Dial(d.proxyNetwork, d.proxyAddress); c = _tuple$2[0]; err$1 = _tuple$2[1]; /* } */ case 6: /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 8: _r$3 = d.pathAddrs(address); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$3 = _r$3; proxy$1 = _tuple$3[0]; dst$1 = _tuple$3[1]; $s = -1; return [$ifaceNil, new net.OpError.ptr(new socksCommand(d.cmd).String(), network, proxy$1, dst$1, err$1)]; /* } */ case 9: _r$4 = d.DialWithConn(context.Background(), c, network, address); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$4 = _r$4; err$2 = _tuple$4[1]; /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 12; continue; } /* */ $s = 13; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 12: _r$5 = c.Close(); /* */ $s = 14; case 14: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; $s = -1; return [$ifaceNil, err$2]; /* } */ case 13: $s = -1; return [c, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: socksDialer.ptr.prototype.Dial }; } $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 = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f.address = address; $f.c = c; $f.d = d; $f.dst = dst; $f.dst$1 = dst$1; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.network = network; $f.proxy = proxy; $f.proxy$1 = proxy$1; $f.$s = $s; $f.$r = $r; return $f; }; socksDialer.prototype.Dial = function(network, address) { return this.$val.Dial(network, address); }; socksDialer.ptr.prototype.validateTarget = function(network, address) { var _1, _2, address, d, network; d = this; _1 = network; if (_1 === ("tcp") || _1 === ("tcp6") || _1 === ("tcp4")) { } else { return errors.New("network not implemented"); } _2 = d.cmd; if ((_2 === (1)) || (_2 === (2))) { } else { return errors.New("command not implemented"); } return $ifaceNil; }; socksDialer.prototype.validateTarget = function(network, address) { return this.$val.validateTarget(network, address); }; socksDialer.ptr.prototype.pathAddrs = function(address) { var _i, _r$1, _ref, _tmp, _tmp$1, _tmp$2, _tuple, a, address, d, dst, err, err$1, host, i, port, proxy, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r$1 = $f._r$1; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tuple = $f._tuple; a = $f.a; address = $f.address; d = $f.d; dst = $f.dst; err = $f.err; err$1 = $f.err$1; host = $f.host; i = $f.i; port = $f.port; proxy = $f.proxy; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: proxy = $ifaceNil; dst = $ifaceNil; err = $ifaceNil; d = this; _ref = new sliceType$2([d.proxyAddress, address]); _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } i = _i; s = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r$1 = sockssplitHostPort(s); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; host = _tuple[0]; port = _tuple[1]; err$1 = _tuple[2]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { _tmp = $ifaceNil; _tmp$1 = $ifaceNil; _tmp$2 = err$1; proxy = _tmp; dst = _tmp$1; err = _tmp$2; $s = -1; return [proxy, dst, err]; } a = new socksAddr.ptr("", net.IP.nil, port); a.IP = net.ParseIP(host); if (a.IP === net.IP.nil) { a.Name = host; } if (i === 0) { proxy = a; } else { dst = a; } _i++; $s = 1; continue; case 2: $s = -1; return [proxy, dst, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: socksDialer.ptr.prototype.pathAddrs }; } $f._i = _i; $f._r$1 = _r$1; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tuple = _tuple; $f.a = a; $f.address = address; $f.d = d; $f.dst = dst; $f.err = err; $f.err$1 = err$1; $f.host = host; $f.i = i; $f.port = port; $f.proxy = proxy; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; socksDialer.prototype.pathAddrs = function(address) { return this.$val.pathAddrs(address); }; socksNewDialer = function(network, address) { var address, network; return new socksDialer.ptr(1, network, address, $throwNilPointerError, sliceType$12.nil, $throwNilPointerError); }; socksUsernamePassword.ptr.prototype.Authenticate = function(ctx, rw, auth) { var _1, _r$1, _r$2, _tuple, _tuple$1, auth, b, ctx, err, err$1, rw, up, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; auth = $f.auth; b = $f.b; ctx = $f.ctx; err = $f.err; err$1 = $f.err$1; rw = $f.rw; up = $f.up; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: up = this; _1 = auth; /* */ if (_1 === (0)) { $s = 2; continue; } /* */ if (_1 === (2)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_1 === (0)) { */ case 2: $s = -1; return $ifaceNil; /* } else if (_1 === (2)) { */ case 3: if ((up.Username.length === 0) || up.Username.length > 255 || (up.Password.length === 0) || up.Password.length > 255) { $s = -1; return errors.New("invalid username/password"); } b = new sliceType$3([1]); b = $append(b, ((up.Username.length << 24 >>> 24))); b = $appendSlice(b, up.Username); b = $append(b, ((up.Password.length << 24 >>> 24))); b = $appendSlice(b, up.Password); _r$1 = rw.Write(b); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _r$2 = io.ReadFull(rw, $subslice(b, 0, 2)); /* */ $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; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } if (!(((0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]) === 1))) { $s = -1; return errors.New("invalid username/password version"); } if (!(((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]) === 0))) { $s = -1; return errors.New("username/password authentication failed"); } $s = -1; return $ifaceNil; /* } */ case 4: case 1: $s = -1; return errors.New("unsupported authentication method " + strconv.Itoa(((auth >> 0)))); /* */ } return; } if ($f === undefined) { $f = { $blk: socksUsernamePassword.ptr.prototype.Authenticate }; } $f._1 = _1; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.auth = auth; $f.b = b; $f.ctx = ctx; $f.err = err; $f.err$1 = err$1; $f.rw = rw; $f.up = up; $f.$s = $s; $f.$r = $r; return $f; }; socksUsernamePassword.prototype.Authenticate = function(ctx, rw, auth) { return this.$val.Authenticate(ctx, rw, auth); }; DetectContentType = function(data) { var _i, _r$1, _ref, ct, data, firstNonWS, sig, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r$1 = $f._r$1; _ref = $f._ref; ct = $f.ct; data = $f.data; firstNonWS = $f.firstNonWS; sig = $f.sig; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (data.$length > 512) { data = $subslice(data, 0, 512); } firstNonWS = 0; while (true) { if (!(firstNonWS < data.$length && isWS(((firstNonWS < 0 || firstNonWS >= data.$length) ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + firstNonWS])))) { break; } firstNonWS = firstNonWS + (1) >> 0; } _ref = sniffSignatures; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } sig = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r$1 = sig.match(data, firstNonWS); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } ct = _r$1; if (!(ct === "")) { $s = -1; return ct; } _i++; $s = 1; continue; case 2: $s = -1; return "application/octet-stream"; /* */ } return; } if ($f === undefined) { $f = { $blk: DetectContentType }; } $f._i = _i; $f._r$1 = _r$1; $f._ref = _ref; $f.ct = ct; $f.data = data; $f.firstNonWS = firstNonWS; $f.sig = sig; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.DetectContentType = DetectContentType; isWS = function(b) { var _1, b; _1 = b; if ((_1 === (9)) || (_1 === (10)) || (_1 === (12)) || (_1 === (13)) || (_1 === (32))) { return true; } return false; }; isTT = function(b) { var _1, b; _1 = b; if ((_1 === (32)) || (_1 === (62))) { return true; } return false; }; exactSig.ptr.prototype.match = function(data, firstNonWS) { var data, e, firstNonWS; e = this; if (bytes.HasPrefix(data, e.sig)) { return e.ct; } return ""; }; exactSig.prototype.match = function(data, firstNonWS) { return this.$val.match(data, firstNonWS); }; maskedSig.ptr.prototype.match = function(data, firstNonWS) { var _i, _ref, data, firstNonWS, i, m, maskedData, pb, x$5; m = this; if (m.skipWS) { data = $subslice(data, firstNonWS); } if (!((m.pat.$length === m.mask.$length))) { return ""; } if (data.$length < m.pat.$length) { return ""; } _ref = m.pat; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; pb = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); maskedData = (((i < 0 || i >= data.$length) ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + i]) & (x$5 = m.mask, ((i < 0 || i >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + i]))) >>> 0; if (!((maskedData === pb))) { return ""; } _i++; } return m.ct; }; maskedSig.prototype.match = function(data, firstNonWS) { return this.$val.match(data, firstNonWS); }; htmlSig.prototype.match = function(data, firstNonWS) { var _i, _ref, b, data, db, firstNonWS, h, i, x$5; h = this; data = $subslice(data, firstNonWS); if (data.$length < (h.$length + 1 >> 0)) { return ""; } _ref = h; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; b = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); db = ((i < 0 || i >= data.$length) ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + i]); if (65 <= b && b <= 90) { db = (db & (223)) >>> 0; } if (!((b === db))) { return ""; } _i++; } if (!isTT((x$5 = h.$length, ((x$5 < 0 || x$5 >= data.$length) ? ($throwRuntimeError("index out of range"), undefined) : data.$array[data.$offset + x$5])))) { return ""; } return "text/html; charset=utf-8"; }; $ptrType(htmlSig).prototype.match = function(data, firstNonWS) { return this.$get().match(data, firstNonWS); }; mp4Sig.ptr.prototype.match = function(data, firstNonWS) { var _r$1, boxSize, data, firstNonWS, st; if (data.$length < 12) { return ""; } boxSize = (($clone(binary.BigEndian, binary.bigEndian).Uint32($subslice(data, 0, 4)) >> 0)); if (data.$length < boxSize || !(((_r$1 = boxSize % 4, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) === 0))) { return ""; } if (!bytes.Equal($subslice(data, 4, 8), mp4ftype)) { return ""; } st = 8; while (true) { if (!(st < boxSize)) { break; } if (st === 12) { st = st + (4) >> 0; continue; } if (bytes.Equal($subslice(data, st, (st + 3 >> 0)), mp4)) { return "video/mp4"; } st = st + (4) >> 0; } return ""; }; mp4Sig.prototype.match = function(data, firstNonWS) { return this.$val.match(data, firstNonWS); }; textSig.ptr.prototype.match = function(data, firstNonWS) { var _i, _ref, b, data, firstNonWS; _ref = $subslice(data, firstNonWS); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } b = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if ((b <= 8) || ((b === 11)) || (14 <= b && b <= 26) || (28 <= b && b <= 31)) { return ""; } _i++; } return "text/plain; charset=utf-8"; }; textSig.prototype.match = function(data, firstNonWS) { return this.$val.match(data, firstNonWS); }; conn.ptr.prototype.hijacked = function() { var $24r, c, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; c = $f.c; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); c = this; $r = c.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(c.mu, "Unlock"), []]); $24r = c.hijackedv; $s = 2; case 2: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; return false; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: conn.ptr.prototype.hijacked }; } $f.$24r = $24r; $f.c = c; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; conn.prototype.hijacked = function() { return this.$val.hijacked(); }; conn.ptr.prototype.hijackLocked = function() { var $24r, _r$1, _r$2, _r$3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, buf, c, err, err$1, rwc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _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; buf = $f.buf; c = $f.c; err = $f.err; err$1 = $f.err$1; rwc = $f.rwc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rwc = $ifaceNil; buf = ptrType$44.nil; err = $ifaceNil; c = this; if (c.hijackedv) { _tmp = $ifaceNil; _tmp$1 = ptrType$44.nil; _tmp$2 = $pkg.ErrHijacked; rwc = _tmp; buf = _tmp$1; err = _tmp$2; $s = -1; return [rwc, buf, err]; } $r = c.r.abortPendingRead(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } c.hijackedv = true; rwc = c.rwc; _r$1 = rwc.SetDeadline(new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil)); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; buf = bufio.NewReadWriter(c.bufr, bufio.NewWriter(rwc)); /* */ if (c.r.hasByte) { $s = 3; continue; } /* */ $s = 4; continue; /* if (c.r.hasByte) { */ case 3: _r$2 = c.bufr.Peek(c.bufr.Buffered() + 1 >> 0); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; err$1 = _tuple[1]; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 6: _tmp$3 = $ifaceNil; _tmp$4 = ptrType$44.nil; _r$3 = fmt.Errorf("unexpected Peek failure reading buffered byte: %v", new sliceType([err$1])); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tmp$5 = _r$3; rwc = _tmp$3; buf = _tmp$4; err = _tmp$5; $24r = [rwc, buf, err]; $s = 9; case 9: return $24r; /* } */ case 7: /* } */ case 4: $r = c.setState(rwc, 3, true); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return [rwc, buf, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: conn.ptr.prototype.hijackLocked }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $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.buf = buf; $f.c = c; $f.err = err; $f.err$1 = err$1; $f.rwc = rwc; $f.$s = $s; $f.$r = $r; return $f; }; conn.prototype.hijackLocked = function() { return this.$val.hijackLocked(); }; chunkWriter.ptr.prototype.Write = function(p) { var _r$1, _r$2, _r$3, _r$4, _r$5, _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, cw, err, n, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; cw = $f.cw; err = $f.err; n = $f.n; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; cw = this; /* */ if (!cw.wroteHeader) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!cw.wroteHeader) { */ case 1: $r = cw.writeHeader(p); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: if (cw.res.req.Method === "HEAD") { _tmp = p.$length; _tmp$1 = $ifaceNil; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } /* */ if (cw.chunking) { $s = 4; continue; } /* */ $s = 5; continue; /* if (cw.chunking) { */ case 4: _r$1 = fmt.Fprintf(cw.res.conn.bufw, "%x\r\n", new sliceType([new $Int(p.$length)])); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 7: _r$2 = cw.res.conn.rwc.Close(); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; $s = -1; return [n, err]; /* } */ case 8: /* } */ case 5: _r$3 = cw.res.conn.bufw.Write(p); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$1 = _r$3; n = _tuple$1[0]; err = _tuple$1[1]; /* */ if (cw.chunking && $interfaceIsEqual(err, $ifaceNil)) { $s = 11; continue; } /* */ $s = 12; continue; /* if (cw.chunking && $interfaceIsEqual(err, $ifaceNil)) { */ case 11: _r$4 = cw.res.conn.bufw.Write(crlf); /* */ $s = 13; case 13: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$2 = _r$4; err = _tuple$2[1]; /* } */ case 12: /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 14; continue; } /* */ $s = 15; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 14: _r$5 = cw.res.conn.rwc.Close(); /* */ $s = 16; case 16: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; /* } */ case 15: $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: chunkWriter.ptr.prototype.Write }; } $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._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.cw = cw; $f.err = err; $f.n = n; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; chunkWriter.prototype.Write = function(p) { return this.$val.Write(p); }; chunkWriter.ptr.prototype.flush = function() { var _r$1, cw, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; cw = $f.cw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cw = this; /* */ if (!cw.wroteHeader) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!cw.wroteHeader) { */ case 1: $r = cw.writeHeader(sliceType$3.nil); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: _r$1 = cw.res.conn.bufw.Flush(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: chunkWriter.ptr.prototype.flush }; } $f._r$1 = _r$1; $f.cw = cw; $f.$s = $s; $f.$r = $r; return $f; }; chunkWriter.prototype.flush = function() { return this.$val.flush(); }; chunkWriter.ptr.prototype.close = function() { var _r$1, _r$2, _r$3, _r$4, bw, cw, trailers, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; bw = $f.bw; cw = $f.cw; trailers = $f.trailers; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cw = this; /* */ if (!cw.wroteHeader) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!cw.wroteHeader) { */ case 1: $r = cw.writeHeader(sliceType$3.nil); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: /* */ if (cw.chunking) { $s = 4; continue; } /* */ $s = 5; continue; /* if (cw.chunking) { */ case 4: bw = cw.res.conn.bufw; _r$1 = bw.WriteString("0\r\n"); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _r$2 = cw.res.finalTrailers(); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } trailers = _r$2; /* */ if (!(trailers === false)) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!(trailers === false)) { */ case 8: _r$3 = new Header(trailers).Write(bw); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; /* } */ case 9: _r$4 = bw.WriteString("\r\n"); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; /* } */ case 5: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: chunkWriter.ptr.prototype.close }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.bw = bw; $f.cw = cw; $f.trailers = trailers; $f.$s = $s; $f.$r = $r; return $f; }; chunkWriter.prototype.close = function() { return this.$val.close(); }; response.ptr.prototype.finalTrailers = function() { var _entry, _entry$1, _i, _i$1, _i$2, _key, _keys, _ref, _ref$1, _ref$2, k, k$1, t, v, vv, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _i = $f._i; _i$1 = $f._i$1; _i$2 = $f._i$2; _key = $f._key; _keys = $f._keys; _ref = $f._ref; _ref$1 = $f._ref$1; _ref$2 = $f._ref$2; k = $f.k; k$1 = $f.k$1; t = $f.t; v = $f.v; vv = $f.vv; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: w = this; t = false; _ref = w.handlerHeader; _i = 0; _keys = $keys(_ref); while (true) { if (!(_i < _keys.length)) { break; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; continue; } k = _entry.k; vv = _entry.v; if (strings.HasPrefix(k, "Trailer:")) { if (t === false) { t = {}; } _key = strings.TrimPrefix(k, "Trailer:"); (t || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: vv }; } _i++; } _ref$1 = w.trailers; _i$1 = 0; /* while (true) { */ case 1: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 2; continue; } k$1 = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); if (t === false) { t = {}; } _ref$2 = (_entry$1 = w.handlerHeader[$String.keyFor(k$1)], _entry$1 !== undefined ? _entry$1.v : sliceType$2.nil); _i$2 = 0; /* while (true) { */ case 3: /* if (!(_i$2 < _ref$2.$length)) { break; } */ if(!(_i$2 < _ref$2.$length)) { $s = 4; continue; } v = ((_i$2 < 0 || _i$2 >= _ref$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$2.$array[_ref$2.$offset + _i$2]); $r = new Header(t).Add(k$1, v); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i$2++; $s = 3; continue; case 4: _i$1++; $s = 1; continue; case 2: $s = -1; return t; /* */ } return; } if ($f === undefined) { $f = { $blk: response.ptr.prototype.finalTrailers }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._i = _i; $f._i$1 = _i$1; $f._i$2 = _i$2; $f._key = _key; $f._keys = _keys; $f._ref = _ref; $f._ref$1 = _ref$1; $f._ref$2 = _ref$2; $f.k = k; $f.k$1 = k$1; $f.t = t; $f.v = v; $f.vv = vv; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; response.prototype.finalTrailers = function() { return this.$val.finalTrailers(); }; $ptrType(atomicBool).prototype.isSet = function() { var _ptr, b; b = this; return !((atomic.LoadInt32(((_ptr = b, new ptrType$45(function() { return (_ptr.$get() >> 0); }, function($v) { _ptr.$set(($v >> 0)); }, _ptr.$target)))) === 0)); }; $ptrType(atomicBool).prototype.setTrue = function() { var _ptr, b; b = this; atomic.StoreInt32(((_ptr = b, new ptrType$45(function() { return (_ptr.$get() >> 0); }, function($v) { _ptr.$set(($v >> 0)); }, _ptr.$target))), 1); }; $ptrType(atomicBool).prototype.setFalse = function() { var _ptr, b; b = this; atomic.StoreInt32(((_ptr = b, new ptrType$45(function() { return (_ptr.$get() >> 0); }, function($v) { _ptr.$set(($v >> 0)); }, _ptr.$target))), 0); }; response.ptr.prototype.declareTrailer = function(k) { var _r$1, _r$2, k, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; k = $f.k; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: w = this; _r$1 = CanonicalHeaderKey(k); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } k = _r$1; _r$2 = httpguts.ValidTrailerHeader(k); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } /* */ if (!_r$2) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!_r$2) { */ case 2: $s = -1; return; /* } */ case 3: w.trailers = $append(w.trailers, k); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: response.ptr.prototype.declareTrailer }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f.k = k; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; response.prototype.declareTrailer = function(k) { return this.$val.declareTrailer(k); }; response.ptr.prototype.requestTooLarge = function() { var w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: w = this; w.closeAfterReply = true; w.requestBodyLimitHit = true; /* */ if (!w.wroteHeader) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!w.wroteHeader) { */ case 1: $r = new Header(w.Header()).Set("Connection", "close"); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: response.ptr.prototype.requestTooLarge }; } $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; response.prototype.requestTooLarge = function() { return this.$val.requestTooLarge(); }; response.ptr.prototype.ReadFrom = function(src) { var $24r, $24r$1, $24r$2, $24r$3, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, buf, bufp, err, err$1, err$2, n, n0, n0$1, n0$2, ok, rf, src, w, x$10, x$11, x$12, x$5, x$6, x$7, x$8, x$9, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$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; _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; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; buf = $f.buf; bufp = $f.bufp; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; n = $f.n; n0 = $f.n0; n0$1 = $f.n0$1; n0$2 = $f.n0$2; ok = $f.ok; rf = $f.rf; src = $f.src; w = $f.w; x$10 = $f.x$10; x$11 = $f.x$11; x$12 = $f.x$12; 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; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); n = new $Int64(0, 0); err = $ifaceNil; w = this; _r$1 = copyBufPool.Get(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } bufp = $assertType(_r$1, ptrType$6); buf = bufp.$get(); $deferred.push([$methodVal(copyBufPool, "Put"), [bufp]]); _tuple = $assertType(w.conn.rwc, io.ReaderFrom, true); rf = _tuple[0]; ok = _tuple[1]; /* */ if (!ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!ok) { */ case 2: _r$2 = io.CopyBuffer((x$5 = new writerOnly.ptr(w), new x$5.constructor.elem(x$5)), src, buf); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; n = _tuple$1[0]; err = _tuple$1[1]; $24r = [n, err]; $s = 5; case 5: return $24r; /* } */ case 3: /* */ if (!w.cw.wroteHeader) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!w.cw.wroteHeader) { */ case 6: _r$3 = io.CopyBuffer((x$6 = new writerOnly.ptr(w), new x$6.constructor.elem(x$6)), io.LimitReader(src, new $Int64(0, 512)), buf); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$2 = _r$3; n0 = _tuple$2[0]; err$1 = _tuple$2[1]; n = (x$7 = n0, new $Int64(n.$high + x$7.$high, n.$low + x$7.$low)); /* */ if (!($interfaceIsEqual(err$1, $ifaceNil)) || (n0.$high < 0 || (n0.$high === 0 && n0.$low < 512))) { $s = 9; continue; } /* */ $s = 10; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil)) || (n0.$high < 0 || (n0.$high === 0 && n0.$low < 512))) { */ case 9: _tmp = n; _tmp$1 = err$1; n = _tmp; err = _tmp$1; $24r$1 = [n, err]; $s = 11; case 11: return $24r$1; /* } */ case 10: /* } */ case 7: _r$4 = w.w.Flush(); /* */ $s = 12; case 12: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; $r = w.cw.flush(); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!w.cw.chunking && w.bodyAllowed()) { $s = 14; continue; } /* */ $s = 15; continue; /* if (!w.cw.chunking && w.bodyAllowed()) { */ case 14: _r$5 = rf.ReadFrom(src); /* */ $s = 16; case 16: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$3 = _r$5; n0$1 = _tuple$3[0]; err$2 = _tuple$3[1]; n = (x$8 = n0$1, new $Int64(n.$high + x$8.$high, n.$low + x$8.$low)); w.written = (x$9 = w.written, x$10 = n0$1, new $Int64(x$9.$high + x$10.$high, x$9.$low + x$10.$low)); _tmp$2 = n; _tmp$3 = err$2; n = _tmp$2; err = _tmp$3; $24r$2 = [n, err]; $s = 17; case 17: return $24r$2; /* } */ case 15: _r$6 = io.CopyBuffer((x$11 = new writerOnly.ptr(w), new x$11.constructor.elem(x$11)), src, buf); /* */ $s = 18; case 18: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tuple$4 = _r$6; n0$2 = _tuple$4[0]; err = _tuple$4[1]; n = (x$12 = n0$2, new $Int64(n.$high + x$12.$high, n.$low + x$12.$low)); _tmp$4 = n; _tmp$5 = err; n = _tmp$4; err = _tmp$5; $24r$3 = [n, err]; $s = 19; case 19: return $24r$3; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [n, err]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: response.ptr.prototype.ReadFrom }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$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._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._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f.buf = buf; $f.bufp = bufp; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.n = n; $f.n0 = n0; $f.n0$1 = n0$1; $f.n0$2 = n0$2; $f.ok = ok; $f.rf = rf; $f.src = src; $f.w = w; $f.x$10 = x$10; $f.x$11 = x$11; $f.x$12 = x$12; $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.$deferred = $deferred; $f.$r = $r; return $f; } } }; response.prototype.ReadFrom = function(src) { return this.$val.ReadFrom(src); }; Server.ptr.prototype.newConn = function(rwc) { var _r$1, c, rwc, srv, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; c = $f.c; rwc = $f.rwc; srv = $f.srv; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: srv = this; c = new conn.ptr(srv, $throwNilPointerError, rwc, "", ptrType$28.nil, $ifaceNil, ptrType$47.nil, ptrType$29.nil, ptrType$14.nil, "", new atomic.Value.ptr($ifaceNil), new structType$1.ptr(new $Uint64(0, 0)), new sync.Mutex.ptr(0, 0), false); /* */ if (false) { $s = 1; continue; } /* */ $s = 2; continue; /* if (false) { */ case 1: _r$1 = newLoggingConn("server", c.rwc); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } c.rwc = _r$1; /* } */ case 2: $s = -1; return c; /* */ } return; } if ($f === undefined) { $f = { $blk: Server.ptr.prototype.newConn }; } $f._r$1 = _r$1; $f.c = c; $f.rwc = rwc; $f.srv = srv; $f.$s = $s; $f.$r = $r; return $f; }; Server.prototype.newConn = function(rwc) { return this.$val.newConn(rwc); }; connReader.ptr.prototype.lock = function() { var cr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; cr = $f.cr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cr = this; $r = cr.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (cr.cond === ptrType$48.nil) { cr.cond = sync.NewCond(cr.mu); } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: connReader.ptr.prototype.lock }; } $f.cr = cr; $f.$s = $s; $f.$r = $r; return $f; }; connReader.prototype.lock = function() { return this.$val.lock(); }; connReader.ptr.prototype.unlock = function() { var cr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; cr = $f.cr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cr = this; $r = cr.mu.Unlock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: connReader.ptr.prototype.unlock }; } $f.cr = cr; $f.$s = $s; $f.$r = $r; return $f; }; connReader.prototype.unlock = function() { return this.$val.unlock(); }; connReader.ptr.prototype.startBackgroundRead = function() { var _r$1, cr, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; cr = $f.cr; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); cr = this; $r = cr.lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(cr, "unlock"), []]); if (cr.inRead) { $panic(new $String("invalid concurrent Body.Read call")); } /* */ if (cr.hasByte) { $s = 2; continue; } /* */ $s = 3; continue; /* if (cr.hasByte) { */ case 2: $s = 4; case 4: return; /* } */ case 3: cr.inRead = true; _r$1 = cr.conn.rwc.SetReadDeadline(new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil)); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $go($methodVal(cr, "backgroundRead"), []); $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: connReader.ptr.prototype.startBackgroundRead }; } $f._r$1 = _r$1; $f.cr = cr; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; connReader.prototype.startBackgroundRead = function() { return this.$val.startBackgroundRead(); }; connReader.ptr.prototype.backgroundRead = function() { var _r$1, _r$2, _tuple, _tuple$1, _v, cr, err, n, ne, ok, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _v = $f._v; cr = $f.cr; err = $f.err; n = $f.n; ne = $f.ne; ok = $f.ok; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cr = this; _r$1 = cr.conn.rwc.Read(new sliceType$3(cr.byteBuf)); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err = _tuple[1]; $r = cr.lock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (n === 1) { cr.hasByte = true; } _tuple$1 = $assertType(err, net.Error, true); ne = _tuple$1[0]; ok = _tuple$1[1]; if (!(ok && cr.aborted)) { _v = false; $s = 6; continue s; } _r$2 = ne.Timeout(); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _v = _r$2; case 6: /* */ if (_v) { $s = 3; continue; } /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_v) { */ case 3: $s = 5; continue; /* } else if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 4: $r = cr.handleReadError(err); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: cr.aborted = false; cr.inRead = false; $r = cr.unlock(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = cr.cond.Broadcast(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: connReader.ptr.prototype.backgroundRead }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._v = _v; $f.cr = cr; $f.err = err; $f.n = n; $f.ne = ne; $f.ok = ok; $f.$s = $s; $f.$r = $r; return $f; }; connReader.prototype.backgroundRead = function() { return this.$val.backgroundRead(); }; connReader.ptr.prototype.abortPendingRead = function() { var _r$1, _r$2, cr, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; cr = $f.cr; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); cr = this; $r = cr.lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(cr, "unlock"), []]); /* */ if (!cr.inRead) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!cr.inRead) { */ case 2: $s = 4; case 4: return; /* } */ case 3: cr.aborted = true; _r$1 = cr.conn.rwc.SetReadDeadline($clone(aLongTimeAgo, time.Time)); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; /* while (true) { */ case 6: /* if (!(cr.inRead)) { break; } */ if(!(cr.inRead)) { $s = 7; continue; } $r = cr.cond.Wait(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 6; continue; case 7: _r$2 = cr.conn.rwc.SetReadDeadline(new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil)); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: connReader.ptr.prototype.abortPendingRead }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f.cr = cr; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; connReader.prototype.abortPendingRead = function() { return this.$val.abortPendingRead(); }; connReader.ptr.prototype.setReadLimit = function(remain) { var cr, remain; cr = this; cr.remain = remain; }; connReader.prototype.setReadLimit = function(remain) { return this.$val.setReadLimit(remain); }; connReader.ptr.prototype.setInfiniteReadLimit = function() { var cr; cr = this; cr.remain = new $Int64(2147483647, 4294967295); }; connReader.prototype.setInfiniteReadLimit = function() { return this.$val.setInfiniteReadLimit(); }; connReader.ptr.prototype.hitReadLimit = function() { var cr, x$5; cr = this; return (x$5 = cr.remain, (x$5.$high < 0 || (x$5.$high === 0 && x$5.$low <= 0))); }; connReader.prototype.hitReadLimit = function() { return this.$val.hitReadLimit(); }; connReader.ptr.prototype.handleReadError = function(param) { var cr, param, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; cr = $f.cr; param = $f.param; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cr = this; $r = cr.conn.cancelCtx(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = cr.closeNotify(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: connReader.ptr.prototype.handleReadError }; } $f.cr = cr; $f.param = param; $f.$s = $s; $f.$r = $r; return $f; }; connReader.prototype.handleReadError = function(param) { return this.$val.handleReadError(param); }; connReader.ptr.prototype.closeNotify = function() { var _tuple, cr, res, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; cr = $f.cr; res = $f.res; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cr = this; _tuple = $assertType(cr.conn.curReq.Load(), ptrType$49, true); res = _tuple[0]; /* */ if (!(res === ptrType$49.nil) && atomic.CompareAndSwapInt32((res.$ptr_didCloseNotify || (res.$ptr_didCloseNotify = new ptrType$45(function() { return this.$target.didCloseNotify; }, function($v) { this.$target.didCloseNotify = $v; }, res))), 0, 1)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(res === ptrType$49.nil) && atomic.CompareAndSwapInt32((res.$ptr_didCloseNotify || (res.$ptr_didCloseNotify = new ptrType$45(function() { return this.$target.didCloseNotify; }, function($v) { this.$target.didCloseNotify = $v; }, res))), 0, 1)) { */ case 1: $r = $send(res.closeNotifyCh, true); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: connReader.ptr.prototype.closeNotify }; } $f._tuple = _tuple; $f.cr = cr; $f.res = res; $f.$s = $s; $f.$r = $r; return $f; }; connReader.prototype.closeNotify = function() { return this.$val.closeNotify(); }; connReader.ptr.prototype.Read = function(p) { var _r$1, _r$2, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, cr, err, n, p, x$5, x$6, x$7, x$8, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tuple = $f._tuple; cr = $f.cr; err = $f.err; n = $f.n; p = $f.p; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; x$8 = $f.x$8; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; cr = this; $r = cr.lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (cr.inRead) { $s = 2; continue; } /* */ $s = 3; continue; /* if (cr.inRead) { */ case 2: $r = cr.unlock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = cr.conn.hijacked(); /* */ $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: $panic(new $String("invalid Body.Read call. After hijacked, the original Request must not be used")); /* } */ case 6: $panic(new $String("invalid concurrent Body.Read call")); /* } */ case 3: /* */ if (cr.hitReadLimit()) { $s = 8; continue; } /* */ $s = 9; continue; /* if (cr.hitReadLimit()) { */ case 8: $r = cr.unlock(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp = 0; _tmp$1 = io.EOF; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; /* } */ case 9: /* */ if (p.$length === 0) { $s = 11; continue; } /* */ $s = 12; continue; /* if (p.$length === 0) { */ case 11: $r = cr.unlock(); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp$2 = 0; _tmp$3 = $ifaceNil; n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; /* } */ case 12: if ((x$5 = (new $Int64(0, p.$length)), x$6 = cr.remain, (x$5.$high > x$6.$high || (x$5.$high === x$6.$high && x$5.$low > x$6.$low)))) { p = $subslice(p, 0, $flatten64(cr.remain)); } /* */ if (cr.hasByte) { $s = 14; continue; } /* */ $s = 15; continue; /* if (cr.hasByte) { */ case 14: (0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0] = cr.byteBuf[0]); cr.hasByte = false; $r = cr.unlock(); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp$4 = 1; _tmp$5 = $ifaceNil; n = _tmp$4; err = _tmp$5; $s = -1; return [n, err]; /* } */ case 15: cr.inRead = true; $r = cr.unlock(); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$2 = cr.conn.rwc.Read(p); /* */ $s = 18; case 18: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; n = _tuple[0]; err = _tuple[1]; $r = cr.lock(); /* */ $s = 19; case 19: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } cr.inRead = false; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 20; continue; } /* */ $s = 21; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 20: $r = cr.handleReadError(err); /* */ $s = 22; case 22: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 21: cr.remain = (x$7 = cr.remain, x$8 = (new $Int64(0, n)), new $Int64(x$7.$high - x$8.$high, x$7.$low - x$8.$low)); $r = cr.unlock(); /* */ $s = 23; case 23: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = cr.cond.Broadcast(); /* */ $s = 24; case 24: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp$6 = n; _tmp$7 = err; n = _tmp$6; err = _tmp$7; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: connReader.ptr.prototype.Read }; } $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._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f._tuple = _tuple; $f.cr = cr; $f.err = err; $f.n = n; $f.p = p; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.x$8 = x$8; $f.$s = $s; $f.$r = $r; return $f; }; connReader.prototype.Read = function(p) { return this.$val.Read(p); }; bufioWriterPool = function(size) { var _1, size; _1 = size; if (_1 === (2048)) { return bufioWriter2kPool; } else if (_1 === (4096)) { return bufioWriter4kPool; } return ptrType$50.nil; }; newBufioReader = function(r) { var _r$1, br, r, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; br = $f.br; r = $f.r; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = bufioReaderPool.Get(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } v = _r$1; if (!($interfaceIsEqual(v, $ifaceNil))) { br = $assertType(v, ptrType$29); br.Reset(r); $s = -1; return br; } $s = -1; return bufio.NewReader(r); /* */ } return; } if ($f === undefined) { $f = { $blk: newBufioReader }; } $f._r$1 = _r$1; $f.br = br; $f.r = r; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; putBufioReader = function(br) { var br; br.Reset($ifaceNil); bufioReaderPool.Put(br); }; newBufioWriterSize = function(w, size) { var _r$1, bw, pool, size, v, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; bw = $f.bw; pool = $f.pool; size = $f.size; v = $f.v; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: pool = bufioWriterPool(size); /* */ if (!(pool === ptrType$50.nil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(pool === ptrType$50.nil)) { */ case 1: _r$1 = pool.Get(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } v = _r$1; if (!($interfaceIsEqual(v, $ifaceNil))) { bw = $assertType(v, ptrType$14); bw.Reset(w); $s = -1; return bw; } /* } */ case 2: $s = -1; return bufio.NewWriterSize(w, size); /* */ } return; } if ($f === undefined) { $f = { $blk: newBufioWriterSize }; } $f._r$1 = _r$1; $f.bw = bw; $f.pool = pool; $f.size = size; $f.v = v; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; putBufioWriter = function(bw) { var bw, pool; bw.Reset($ifaceNil); pool = bufioWriterPool(bw.Available()); if (!(pool === ptrType$50.nil)) { pool.Put(bw); } }; Server.ptr.prototype.maxHeaderBytes = function() { var srv; srv = this; if (srv.MaxHeaderBytes > 0) { return srv.MaxHeaderBytes; } return 1048576; }; Server.prototype.maxHeaderBytes = function() { return this.$val.maxHeaderBytes(); }; Server.ptr.prototype.initialReadLimitSize = function() { var srv, x$5; srv = this; return (x$5 = (new $Int64(0, srv.maxHeaderBytes())), new $Int64(x$5.$high + 0, x$5.$low + 4096)); }; Server.prototype.initialReadLimitSize = function() { return this.$val.initialReadLimitSize(); }; expectContinueReader.ptr.prototype.Read = function(p) { var _r$1, _r$2, _r$3, _r$4, _tmp, _tmp$1, _tuple, _v, ecr, err, n, p, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _v = $f._v; ecr = $f.ecr; err = $f.err; n = $f.n; p = $f.p; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; ecr = this; if ((ecr.$ptr_closed || (ecr.$ptr_closed = new ptrType$51(function() { return this.$target.closed; }, function($v) { this.$target.closed = $v; }, ecr))).isSet()) { _tmp = 0; _tmp$1 = $pkg.ErrBodyReadAfterClose; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } w = ecr.resp; if (!(!w.wroteContinue && (w.$ptr_canWriteContinue || (w.$ptr_canWriteContinue = new ptrType$51(function() { return this.$target.canWriteContinue; }, function($v) { this.$target.canWriteContinue = $v; }, w))).isSet())) { _v = false; $s = 3; continue s; } _r$1 = w.conn.hijacked(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _v = !_r$1; case 3: /* */ if (_v) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v) { */ case 1: w.wroteContinue = true; $r = w.writeContinueMu.Lock(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if ((w.$ptr_canWriteContinue || (w.$ptr_canWriteContinue = new ptrType$51(function() { return this.$target.canWriteContinue; }, function($v) { this.$target.canWriteContinue = $v; }, w))).isSet()) { $s = 6; continue; } /* */ $s = 7; continue; /* if ((w.$ptr_canWriteContinue || (w.$ptr_canWriteContinue = new ptrType$51(function() { return this.$target.canWriteContinue; }, function($v) { this.$target.canWriteContinue = $v; }, w))).isSet()) { */ case 6: _r$2 = w.conn.bufw.WriteString("HTTP/1.1 100 Continue\r\n\r\n"); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; _r$3 = w.conn.bufw.Flush(); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; (w.$ptr_canWriteContinue || (w.$ptr_canWriteContinue = new ptrType$51(function() { return this.$target.canWriteContinue; }, function($v) { this.$target.canWriteContinue = $v; }, w))).setFalse(); /* } */ case 7: $r = w.writeContinueMu.Unlock(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: _r$4 = ecr.readCloser.Read(p); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple = _r$4; n = _tuple[0]; err = _tuple[1]; if ($interfaceIsEqual(err, io.EOF)) { (ecr.$ptr_sawEOF || (ecr.$ptr_sawEOF = new ptrType$51(function() { return this.$target.sawEOF; }, function($v) { this.$target.sawEOF = $v; }, ecr))).setTrue(); } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: expectContinueReader.ptr.prototype.Read }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._v = _v; $f.ecr = ecr; $f.err = err; $f.n = n; $f.p = p; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; expectContinueReader.prototype.Read = function(p) { return this.$val.Read(p); }; expectContinueReader.ptr.prototype.Close = function() { var $24r, _r$1, ecr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; ecr = $f.ecr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ecr = this; (ecr.$ptr_closed || (ecr.$ptr_closed = new ptrType$51(function() { return this.$target.closed; }, function($v) { this.$target.closed = $v; }, ecr))).setTrue(); _r$1 = ecr.readCloser.Close(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: expectContinueReader.ptr.prototype.Close }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.ecr = ecr; $f.$s = $s; $f.$r = $r; return $f; }; expectContinueReader.prototype.Close = function() { return this.$val.Close(); }; appendTime = function(b, t) { var _q, _q$1, _q$2, _q$3, _q$4, _q$5, _q$6, _r$1, _r$10, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, b, day, dd, hh, mm, mn, mon, ss, t, yy, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _q = $f._q; _q$1 = $f._q$1; _q$2 = $f._q$2; _q$3 = $f._q$3; _q$4 = $f._q$4; _q$5 = $f._q$5; _q$6 = $f._q$6; _r$1 = $f._r$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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; b = $f.b; day = $f.day; dd = $f.dd; hh = $f.hh; mm = $f.mm; mn = $f.mn; mon = $f.mon; ss = $f.ss; t = $f.t; yy = $f.yy; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: time.Time.copy(t, $clone(t, time.Time).UTC()); _r$1 = $clone(t, time.Time).Date(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; yy = _tuple[0]; mm = _tuple[1]; dd = _tuple[2]; _r$2 = $clone(t, time.Time).Clock(); /* */ $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; hh = _tuple$1[0]; mn = _tuple$1[1]; ss = _tuple$1[2]; _r$3 = $clone(t, time.Time).Weekday(); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } day = $substring("SunMonTueWedThuFriSat", ($imul(3, _r$3))); mon = $substring("JanFebMarAprMayJunJulAugSepOctNovDec", ($imul(3, ((mm - 1 >> 0))))); $s = -1; return $append(b, day.charCodeAt(0), day.charCodeAt(1), day.charCodeAt(2), 44, 32, (((48 + (_q = dd / 10, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0) << 24 >>> 24)), (((48 + (_r$4 = dd % 10, _r$4 === _r$4 ? _r$4 : $throwRuntimeError("integer divide by zero")) >> 0) << 24 >>> 24)), 32, mon.charCodeAt(0), mon.charCodeAt(1), mon.charCodeAt(2), 32, (((48 + (_q$1 = yy / 1000, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")) >> 0) << 24 >>> 24)), (((48 + (_r$5 = ((_q$2 = yy / 100, (_q$2 === _q$2 && _q$2 !== 1/0 && _q$2 !== -1/0) ? _q$2 >> 0 : $throwRuntimeError("integer divide by zero"))) % 10, _r$5 === _r$5 ? _r$5 : $throwRuntimeError("integer divide by zero")) >> 0) << 24 >>> 24)), (((48 + (_r$6 = ((_q$3 = yy / 10, (_q$3 === _q$3 && _q$3 !== 1/0 && _q$3 !== -1/0) ? _q$3 >> 0 : $throwRuntimeError("integer divide by zero"))) % 10, _r$6 === _r$6 ? _r$6 : $throwRuntimeError("integer divide by zero")) >> 0) << 24 >>> 24)), (((48 + (_r$7 = yy % 10, _r$7 === _r$7 ? _r$7 : $throwRuntimeError("integer divide by zero")) >> 0) << 24 >>> 24)), 32, (((48 + (_q$4 = hh / 10, (_q$4 === _q$4 && _q$4 !== 1/0 && _q$4 !== -1/0) ? _q$4 >> 0 : $throwRuntimeError("integer divide by zero")) >> 0) << 24 >>> 24)), (((48 + (_r$8 = hh % 10, _r$8 === _r$8 ? _r$8 : $throwRuntimeError("integer divide by zero")) >> 0) << 24 >>> 24)), 58, (((48 + (_q$5 = mn / 10, (_q$5 === _q$5 && _q$5 !== 1/0 && _q$5 !== -1/0) ? _q$5 >> 0 : $throwRuntimeError("integer divide by zero")) >> 0) << 24 >>> 24)), (((48 + (_r$9 = mn % 10, _r$9 === _r$9 ? _r$9 : $throwRuntimeError("integer divide by zero")) >> 0) << 24 >>> 24)), 58, (((48 + (_q$6 = ss / 10, (_q$6 === _q$6 && _q$6 !== 1/0 && _q$6 !== -1/0) ? _q$6 >> 0 : $throwRuntimeError("integer divide by zero")) >> 0) << 24 >>> 24)), (((48 + (_r$10 = ss % 10, _r$10 === _r$10 ? _r$10 : $throwRuntimeError("integer divide by zero")) >> 0) << 24 >>> 24)), 32, 71, 77, 84); /* */ } return; } if ($f === undefined) { $f = { $blk: appendTime }; } $f._q = _q; $f._q$1 = _q$1; $f._q$2 = _q$2; $f._q$3 = _q$3; $f._q$4 = _q$4; $f._q$5 = _q$5; $f._q$6 = _q$6; $f._r$1 = _r$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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.b = b; $f.day = day; $f.dd = dd; $f.hh = hh; $f.mm = mm; $f.mn = mn; $f.mon = mon; $f.ss = ss; $f.t = t; $f.yy = yy; $f.$s = $s; $f.$r = $r; return $f; }; conn.ptr.prototype.readRequest = function(ctx) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, $24r$5, $24r$6, $24r$7, $24r$8, _entry, _entry$1, _i, _i$1, _keys, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _ref$1, _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, _tuple$3, _tuple$4, body$1, c, cancelCtx, ctx, d, d$1, d$2, err, haveHost, hdrDeadline, hosts, isH2Upgrade, k, ok, peek, req, t0, v, vv, w, wholeReqDeadline, x$5, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; $24r$6 = $f.$24r$6; $24r$7 = $f.$24r$7; $24r$8 = $f.$24r$8; _entry = $f._entry; _entry$1 = $f._entry$1; _i = $f._i; _i$1 = $f._i$1; _keys = $f._keys; _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; _ref$1 = $f._ref$1; _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$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; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; body$1 = $f.body$1; c = $f.c; cancelCtx = $f.cancelCtx; ctx = $f.ctx; d = $f.d; d$1 = $f.d$1; d$2 = $f.d$2; err = $f.err; haveHost = $f.haveHost; hdrDeadline = $f.hdrDeadline; hosts = $f.hosts; isH2Upgrade = $f.isH2Upgrade; k = $f.k; ok = $f.ok; peek = $f.peek; req = $f.req; t0 = $f.t0; v = $f.v; vv = $f.vv; w = $f.w; wholeReqDeadline = $f.wholeReqDeadline; x$5 = $f.x$5; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); c = [c]; d = [d]; w = ptrType$49.nil; err = $ifaceNil; c[0] = this; _r$1 = c[0].hijacked(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (_r$1) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_r$1) { */ case 1: _tmp = ptrType$49.nil; _tmp$1 = $pkg.ErrHijacked; w = _tmp; err = _tmp$1; $24r = [w, err]; $s = 4; case 4: return $24r; /* } */ case 2: wholeReqDeadline = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil); hdrDeadline = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil); _r$2 = time.Now(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } t0 = $clone(_r$2, time.Time); d$1 = c[0].server.readHeaderTimeout(); if ((d$1.$high > 0 || (d$1.$high === 0 && d$1.$low > 0))) { time.Time.copy(hdrDeadline, $clone(t0, time.Time).Add(d$1)); } d$2 = c[0].server.ReadTimeout; if ((d$2.$high > 0 || (d$2.$high === 0 && d$2.$low > 0))) { time.Time.copy(wholeReqDeadline, $clone(t0, time.Time).Add(d$2)); } _r$3 = c[0].rwc.SetReadDeadline($clone(hdrDeadline, time.Time)); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; d[0] = c[0].server.WriteTimeout; /* */ if ((d[0].$high > 0 || (d[0].$high === 0 && d[0].$low > 0))) { $s = 7; continue; } /* */ $s = 8; continue; /* if ((d[0].$high > 0 || (d[0].$high === 0 && d[0].$low > 0))) { */ case 7: $deferred.push([(function(c, d) { return function $b() { var _r$4, _r$5, _r$6, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$4 = time.Now(); /* */ $s = 1; case 1: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = $clone(_r$4, time.Time).Add(d[0]); /* */ $s = 2; case 2: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$6 = c[0].rwc.SetWriteDeadline($clone(_r$5, time.Time)); /* */ $s = 3; case 3: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f.$s = $s; $f.$r = $r; return $f; }; })(c, d), []]); /* } */ case 8: c[0].r.setReadLimit(c[0].server.initialReadLimitSize()); /* */ if (c[0].lastMethod === "POST") { $s = 9; continue; } /* */ $s = 10; continue; /* if (c[0].lastMethod === "POST") { */ case 9: _r$4 = c[0].bufr.Peek(4); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple = _r$4; peek = _tuple[0]; _r$5 = c[0].bufr.Discard(numLeadingCRorLF(peek)); /* */ $s = 12; case 12: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; /* } */ case 10: _r$6 = readRequest(c[0].bufr); /* */ $s = 13; case 13: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tuple$1 = _r$6; req = _tuple$1[0]; err = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 14; continue; } /* */ $s = 15; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 14: /* */ if (c[0].r.hitReadLimit()) { $s = 16; continue; } /* */ $s = 17; continue; /* if (c[0].r.hitReadLimit()) { */ case 16: _tmp$2 = ptrType$49.nil; _tmp$3 = errTooLarge; w = _tmp$2; err = _tmp$3; $24r$1 = [w, err]; $s = 18; case 18: return $24r$1; /* } */ case 17: _tmp$4 = ptrType$49.nil; _tmp$5 = err; w = _tmp$4; err = _tmp$5; $24r$2 = [w, err]; $s = 19; case 19: return $24r$2; /* } */ case 15: /* */ if (!http1ServerSupportsRequest(req)) { $s = 20; continue; } /* */ $s = 21; continue; /* if (!http1ServerSupportsRequest(req)) { */ case 20: _tmp$6 = ptrType$49.nil; _tmp$7 = (x$5 = new statusError.ptr(505, "unsupported protocol version"), new x$5.constructor.elem(x$5)); w = _tmp$6; err = _tmp$7; $24r$3 = [w, err]; $s = 22; case 22: return $24r$3; /* } */ case 21: c[0].lastMethod = req.Method; c[0].r.setInfiniteReadLimit(); _tuple$2 = (_entry = req.Header[$String.keyFor("Host")], _entry !== undefined ? [_entry.v, true] : [sliceType$2.nil, false]); hosts = _tuple$2[0]; haveHost = _tuple$2[1]; isH2Upgrade = req.isH2Upgrade(); /* */ if (req.ProtoAtLeast(1, 1) && (!haveHost || (hosts.$length === 0)) && !isH2Upgrade && !(req.Method === "CONNECT")) { $s = 23; continue; } /* */ $s = 24; continue; /* if (req.ProtoAtLeast(1, 1) && (!haveHost || (hosts.$length === 0)) && !isH2Upgrade && !(req.Method === "CONNECT")) { */ case 23: _tmp$8 = ptrType$49.nil; _tmp$9 = badRequestError("missing required Host header"); w = _tmp$8; err = _tmp$9; $24r$4 = [w, err]; $s = 25; case 25: return $24r$4; /* } */ case 24: /* */ if ((hosts.$length === 1) && !httpguts.ValidHostHeader((0 >= hosts.$length ? ($throwRuntimeError("index out of range"), undefined) : hosts.$array[hosts.$offset + 0]))) { $s = 26; continue; } /* */ $s = 27; continue; /* if ((hosts.$length === 1) && !httpguts.ValidHostHeader((0 >= hosts.$length ? ($throwRuntimeError("index out of range"), undefined) : hosts.$array[hosts.$offset + 0]))) { */ case 26: _tmp$10 = ptrType$49.nil; _tmp$11 = badRequestError("malformed Host header"); w = _tmp$10; err = _tmp$11; $24r$5 = [w, err]; $s = 28; case 28: return $24r$5; /* } */ case 27: _ref = req.Header; _i = 0; _keys = $keys(_ref); /* while (true) { */ case 29: /* if (!(_i < _keys.length)) { break; } */ if(!(_i < _keys.length)) { $s = 30; continue; } _entry$1 = _ref[_keys[_i]]; if (_entry$1 === undefined) { _i++; /* continue; */ $s = 29; continue; } k = _entry$1.k; vv = _entry$1.v; /* */ if (!httpguts.ValidHeaderFieldName(k)) { $s = 31; continue; } /* */ $s = 32; continue; /* if (!httpguts.ValidHeaderFieldName(k)) { */ case 31: _tmp$12 = ptrType$49.nil; _tmp$13 = badRequestError("invalid header name"); w = _tmp$12; err = _tmp$13; $24r$6 = [w, err]; $s = 33; case 33: return $24r$6; /* } */ case 32: _ref$1 = vv; _i$1 = 0; /* while (true) { */ case 34: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 35; continue; } v = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); /* */ if (!httpguts.ValidHeaderFieldValue(v)) { $s = 36; continue; } /* */ $s = 37; continue; /* if (!httpguts.ValidHeaderFieldValue(v)) { */ case 36: _tmp$14 = ptrType$49.nil; _tmp$15 = badRequestError("invalid header value"); w = _tmp$14; err = _tmp$15; $24r$7 = [w, err]; $s = 38; case 38: return $24r$7; /* } */ case 37: _i$1++; $s = 34; continue; case 35: _i++; $s = 29; continue; case 30: delete req.Header[$String.keyFor("Host")]; _r$7 = context.WithCancel(ctx); /* */ $s = 39; case 39: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _tuple$3 = _r$7; ctx = _tuple$3[0]; cancelCtx = _tuple$3[1]; req.ctx = ctx; req.RemoteAddr = c[0].remoteAddr; req.TLS = c[0].tlsState; _tuple$4 = $assertType(req.Body, ptrType$52, true); body$1 = _tuple$4[0]; ok = _tuple$4[1]; if (ok) { body$1.doEarlyClose = true; } /* */ if (!$clone(hdrDeadline, time.Time).Equal($clone(wholeReqDeadline, time.Time))) { $s = 40; continue; } /* */ $s = 41; continue; /* if (!$clone(hdrDeadline, time.Time).Equal($clone(wholeReqDeadline, time.Time))) { */ case 40: _r$8 = c[0].rwc.SetReadDeadline($clone(wholeReqDeadline, time.Time)); /* */ $s = 42; case 42: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$8; /* } */ case 41: w = new response.ptr(c[0], req, req.Body, cancelCtx, false, false, req.wantsHttp10KeepAlive(), req.wantsClose(), 0, new sync.Mutex.ptr(0, 0), ptrType$14.nil, new chunkWriter.ptr(ptrType$49.nil, false, false, false), {}, false, new $Int64(0, 0), new $Int64(-1, 4294967295), 0, false, false, sliceType$2.nil, 0, arrayType$3.zero(), arrayType$4.zero(), arrayType$5.zero(), new $Chan($Bool, 1), 0); if (isH2Upgrade) { w.closeAfterReply = true; } w.cw.res = w; _r$9 = newBufioWriterSize(w.cw, 2048); /* */ $s = 43; case 43: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } w.w = _r$9; _tmp$16 = w; _tmp$17 = $ifaceNil; w = _tmp$16; err = _tmp$17; $24r$8 = [w, err]; $s = 44; case 44: return $24r$8; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [w, err]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: conn.ptr.prototype.readRequest }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f.$24r$6 = $24r$6; $f.$24r$7 = $24r$7; $f.$24r$8 = $24r$8; $f._entry = _entry; $f._entry$1 = _entry$1; $f._i = _i; $f._i$1 = _i$1; $f._keys = _keys; $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._ref$1 = _ref$1; $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$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._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f.body$1 = body$1; $f.c = c; $f.cancelCtx = cancelCtx; $f.ctx = ctx; $f.d = d; $f.d$1 = d$1; $f.d$2 = d$2; $f.err = err; $f.haveHost = haveHost; $f.hdrDeadline = hdrDeadline; $f.hosts = hosts; $f.isH2Upgrade = isH2Upgrade; $f.k = k; $f.ok = ok; $f.peek = peek; $f.req = req; $f.t0 = t0; $f.v = v; $f.vv = vv; $f.w = w; $f.wholeReqDeadline = wholeReqDeadline; $f.x$5 = x$5; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; conn.prototype.readRequest = function(ctx) { return this.$val.readRequest(ctx); }; http1ServerSupportsRequest = function(req) { var req; if (req.ProtoMajor === 1) { return true; } if ((req.ProtoMajor === 2) && (req.ProtoMinor === 0) && req.Method === "PRI" && req.RequestURI === "*") { return true; } return false; }; response.ptr.prototype.Header = function() { var w; w = this; if (w.cw.header === false && w.wroteHeader && !w.cw.wroteHeader) { w.cw.header = new Header(w.handlerHeader).Clone(); } w.calledHeader = true; return w.handlerHeader; }; response.prototype.Header = function() { return this.$val.Header(); }; checkWriteHeaderCode = function(code) { var _r$1, code, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; code = $f.code; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (code < 100 || code > 999) { $s = 1; continue; } /* */ $s = 2; continue; /* if (code < 100 || code > 999) { */ case 1: _r$1 = fmt.Sprintf("invalid WriteHeader code %v", new sliceType([new $Int(code)])); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $panic(new $String(_r$1)); /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: checkWriteHeaderCode }; } $f._r$1 = _r$1; $f.code = code; $f.$s = $s; $f.$r = $r; return $f; }; relevantCaller = function() { var _tuple, frame, frame$1, frames, more, n, pc; pc = $makeSlice(sliceType$18, 16); n = runtime.Callers(1, pc); frames = runtime.CallersFrames($subslice(pc, 0, n)); frame = new runtime.Frame.ptr(0, ptrType$54.nil, "", "", 0, 0); while (true) { _tuple = frames.Next(); frame$1 = $clone(_tuple[0], runtime.Frame); more = _tuple[1]; if (!strings.HasPrefix(frame$1.Function, "net/http.")) { return frame$1; } if (!more) { break; } } return frame; }; response.ptr.prototype.WriteHeader = function(code) { var _r$1, _tuple, caller, caller$1, cl, code, err, v, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; caller = $f.caller; caller$1 = $f.caller$1; cl = $f.cl; code = $f.code; err = $f.err; v = $f.v; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: w = this; _r$1 = w.conn.hijacked(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (_r$1) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_r$1) { */ case 1: caller = $clone(relevantCaller(), runtime.Frame); $r = w.conn.server.logf("http: response.WriteHeader on hijacked connection from %s (%s:%d)", new sliceType([new $String(caller.Function), new $String(path.Base(caller.File)), new $Int(caller.Line)])); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 2: /* */ if (w.wroteHeader) { $s = 5; continue; } /* */ $s = 6; continue; /* if (w.wroteHeader) { */ case 5: caller$1 = $clone(relevantCaller(), runtime.Frame); $r = w.conn.server.logf("http: superfluous response.WriteHeader call from %s (%s:%d)", new sliceType([new $String(caller$1.Function), new $String(path.Base(caller$1.File)), new $Int(caller$1.Line)])); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 6: $r = checkWriteHeaderCode(code); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } w.wroteHeader = true; w.status = code; if (w.calledHeader && w.cw.header === false) { w.cw.header = new Header(w.handlerHeader).Clone(); } cl = new Header(w.handlerHeader).get("Content-Length"); /* */ if (!(cl === "")) { $s = 9; continue; } /* */ $s = 10; continue; /* if (!(cl === "")) { */ case 9: _tuple = strconv.ParseInt(cl, 10, 64); v = _tuple[0]; err = _tuple[1]; /* */ if ($interfaceIsEqual(err, $ifaceNil) && (v.$high > 0 || (v.$high === 0 && v.$low >= 0))) { $s = 11; continue; } /* */ $s = 12; continue; /* if ($interfaceIsEqual(err, $ifaceNil) && (v.$high > 0 || (v.$high === 0 && v.$low >= 0))) { */ case 11: w.contentLength = v; $s = 13; continue; /* } else { */ case 12: $r = w.conn.server.logf("http: invalid Content-Length of %q", new sliceType([new $String(cl)])); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = new Header(w.handlerHeader).Del("Content-Length"); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 13: /* } */ case 10: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: response.ptr.prototype.WriteHeader }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.caller = caller; $f.caller$1 = caller$1; $f.cl = cl; $f.code = code; $f.err = err; $f.v = v; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; response.prototype.WriteHeader = function(code) { return this.$val.WriteHeader(code); }; extraHeader.ptr.prototype.Write = function(w) { var _i, _r$1, _r$10, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, h, i, v, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r$1 = $f._r$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; h = $f.h; i = $f.i; v = $f.v; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: h = this; /* */ if (!(h.date === sliceType$3.nil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(h.date === sliceType$3.nil)) { */ case 1: _r$1 = w.Write(headerDate); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _r$2 = w.Write(h.date); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; _r$3 = w.Write(crlf); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; /* } */ case 2: /* */ if (!(h.contentLength === sliceType$3.nil)) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!(h.contentLength === sliceType$3.nil)) { */ case 6: _r$4 = w.Write(headerContentLength); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; _r$5 = w.Write(h.contentLength); /* */ $s = 9; case 9: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; _r$6 = w.Write(crlf); /* */ $s = 10; case 10: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; /* } */ case 7: _ref = new sliceType$2([h.contentType, h.connection, h.transferEncoding]); _i = 0; /* while (true) { */ case 11: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 12; continue; } i = _i; v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); /* */ if (!(v === "")) { $s = 13; continue; } /* */ $s = 14; continue; /* if (!(v === "")) { */ case 13: _r$7 = w.Write(((i < 0 || i >= extraHeaderKeys.$length) ? ($throwRuntimeError("index out of range"), undefined) : extraHeaderKeys.$array[extraHeaderKeys.$offset + i])); /* */ $s = 15; case 15: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$7; _r$8 = w.Write(colonSpace); /* */ $s = 16; case 16: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$8; _r$9 = w.WriteString(v); /* */ $s = 17; case 17: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$9; _r$10 = w.Write(crlf); /* */ $s = 18; case 18: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; /* } */ case 14: _i++; $s = 11; continue; case 12: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: extraHeader.ptr.prototype.Write }; } $f._i = _i; $f._r$1 = _r$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.h = h; $f.i = i; $f.v = v; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; extraHeader.prototype.Write = function(w) { return this.$val.Write(w); }; chunkWriter.ptr.prototype.writeHeader = function(p) { var _1, _arg, _arg$1, _entry, _entry$1, _entry$2, _entry$3, _i, _i$1, _i$2, _key, _keys, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _ref$1, _ref$2, _ref$3, _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, _tuple$3, _v, bdy, bdy$1, bdy$2, ce, code, connectionHeaderSet, cw, delConnectionHeader, delHeader, discard, ecr, err, excludeHeader, hasCE, hasCL, hasTE, haveType, header, isHEAD, k, k$1, keepAlivesEnabled, ok, owned, p, sentLength, setHeader, te, tooBig, trailers, v, w, x$5, x$6, x$7, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _arg = $f._arg; _arg$1 = $f._arg$1; _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; _i$2 = $f._i$2; _key = $f._key; _keys = $f._keys; _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; _ref$1 = $f._ref$1; _ref$2 = $f._ref$2; _ref$3 = $f._ref$3; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _v = $f._v; bdy = $f.bdy; bdy$1 = $f.bdy$1; bdy$2 = $f.bdy$2; ce = $f.ce; code = $f.code; connectionHeaderSet = $f.connectionHeaderSet; cw = $f.cw; delConnectionHeader = $f.delConnectionHeader; delHeader = $f.delHeader; discard = $f.discard; ecr = $f.ecr; err = $f.err; excludeHeader = $f.excludeHeader; hasCE = $f.hasCE; hasCL = $f.hasCL; hasTE = $f.hasTE; haveType = $f.haveType; header = $f.header; isHEAD = $f.isHEAD; k = $f.k; k$1 = $f.k$1; keepAlivesEnabled = $f.keepAlivesEnabled; ok = $f.ok; owned = $f.owned; p = $f.p; sentLength = $f.sentLength; setHeader = $f.setHeader; te = $f.te; tooBig = $f.tooBig; trailers = $f.trailers; v = $f.v; w = $f.w; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: excludeHeader = [excludeHeader]; header = [header]; owned = [owned]; cw = this; if (cw.wroteHeader) { $s = -1; return; } cw.wroteHeader = true; w = cw.res; keepAlivesEnabled = w.conn.server.doKeepAlives(); isHEAD = w.req.Method === "HEAD"; header[0] = cw.header; owned[0] = !(header[0] === false); if (!owned[0]) { header[0] = w.handlerHeader; } excludeHeader[0] = false; delHeader = (function(excludeHeader, header, owned) { return function $b(key) { var _entry, _key, _tuple, key, ok, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _key = $f._key; _tuple = $f._tuple; key = $f.key; ok = $f.ok; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (owned[0]) { $s = 1; continue; } /* */ $s = 2; continue; /* if (owned[0]) { */ case 1: $r = new Header(header[0]).Del(key); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 2: _tuple = (_entry = header[0][$String.keyFor(key)], _entry !== undefined ? [_entry.v, true] : [sliceType$2.nil, false]); ok = _tuple[1]; if (!ok) { $s = -1; return; } if (excludeHeader[0] === false) { excludeHeader[0] = {}; } _key = key; (excludeHeader[0] || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: true }; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._entry = _entry; $f._key = _key; $f._tuple = _tuple; $f.key = key; $f.ok = ok; $f.$s = $s; $f.$r = $r; return $f; }; })(excludeHeader, header, owned); setHeader = new extraHeader.ptr("", "", "", sliceType$3.nil, sliceType$3.nil); trailers = false; _ref = cw.header; _i = 0; _keys = $keys(_ref); while (true) { if (!(_i < _keys.length)) { break; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; continue; } k = _entry.k; if (strings.HasPrefix(k, "Trailer:")) { if (excludeHeader[0] === false) { excludeHeader[0] = {}; } _key = k; (excludeHeader[0] || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: true }; trailers = true; } _i++; } _ref$1 = (_entry$1 = cw.header[$String.keyFor("Trailer")], _entry$1 !== undefined ? _entry$1.v : sliceType$2.nil); _i$1 = 0; /* while (true) { */ case 1: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 2; continue; } v = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); trailers = true; $r = foreachHeaderElement(v, $methodVal(cw.res, "declareTrailer")); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i$1++; $s = 1; continue; case 2: te = new Header(header[0]).get("Transfer-Encoding"); hasTE = !(te === ""); if ((w.$ptr_handlerDone || (w.$ptr_handlerDone = new ptrType$51(function() { return this.$target.handlerDone; }, function($v) { this.$target.handlerDone = $v; }, w))).isSet() && !trailers && !hasTE && bodyAllowedForStatus(w.status) && new Header(header[0]).get("Content-Length") === "" && (!isHEAD || p.$length > 0)) { w.contentLength = (new $Int64(0, p.$length)); setHeader.contentLength = strconv.AppendInt($subslice(new sliceType$3(cw.res.clenBuf), 0, 0), (new $Int64(0, p.$length)), 10); } if (w.wants10KeepAlive && keepAlivesEnabled) { sentLength = !(new Header(header[0]).get("Content-Length") === ""); if (sentLength && new Header(header[0]).get("Connection") === "keep-alive") { w.closeAfterReply = false; } } hasCL = !((x$5 = w.contentLength, (x$5.$high === -1 && x$5.$low === 4294967295))); if (w.wants10KeepAlive && (isHEAD || hasCL || !bodyAllowedForStatus(w.status))) { _tuple = (_entry$2 = header[0][$String.keyFor("Connection")], _entry$2 !== undefined ? [_entry$2.v, true] : [sliceType$2.nil, false]); connectionHeaderSet = _tuple[1]; if (!connectionHeaderSet) { setHeader.connection = "keep-alive"; } } else if (!w.req.ProtoAtLeast(1, 1) || w.wantsClose) { w.closeAfterReply = true; } if (new Header(header[0]).get("Connection") === "close" || !keepAlivesEnabled) { w.closeAfterReply = true; } _tuple$1 = $assertType(w.req.Body, ptrType$55, true); ecr = _tuple$1[0]; ok = _tuple$1[1]; if (ok && !(ecr.$ptr_sawEOF || (ecr.$ptr_sawEOF = new ptrType$51(function() { return this.$target.sawEOF; }, function($v) { this.$target.sawEOF = $v; }, ecr))).isSet()) { w.closeAfterReply = true; } /* */ if (!((x$6 = w.req.ContentLength, (x$6.$high === 0 && x$6.$low === 0))) && !w.closeAfterReply) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!((x$6 = w.req.ContentLength, (x$6.$high === 0 && x$6.$low === 0))) && !w.closeAfterReply) { */ case 4: _tmp = false; _tmp$1 = false; discard = _tmp; tooBig = _tmp$1; _ref$2 = w.req.Body; /* */ if ($assertType(_ref$2, ptrType$55, true)[1]) { $s = 6; continue; } /* */ if ($assertType(_ref$2, ptrType$52, true)[1]) { $s = 7; continue; } /* */ $s = 8; continue; /* if ($assertType(_ref$2, ptrType$55, true)[1]) { */ case 6: bdy = _ref$2.$val; if (bdy.resp.wroteContinue) { discard = true; } $s = 9; continue; /* } else if ($assertType(_ref$2, ptrType$52, true)[1]) { */ case 7: bdy$1 = _ref$2.$val; $r = bdy$1.mu.Lock(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (bdy$1.closed) { if (!bdy$1.sawEOF) { w.closeAfterReply = true; } } else if ((x$7 = bdy$1.unreadDataSizeLocked(), (x$7.$high > 0 || (x$7.$high === 0 && x$7.$low >= 262144)))) { tooBig = true; } else { discard = true; } $r = bdy$1.mu.Unlock(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 9; continue; /* } else { */ case 8: bdy$2 = _ref$2; discard = true; /* } */ case 9: /* */ if (discard) { $s = 12; continue; } /* */ $s = 13; continue; /* if (discard) { */ case 12: _r$1 = io.CopyN(io.Discard, w.reqBody, new $Int64(0, 262145)); /* */ $s = 14; case 14: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$2 = _r$1; err = _tuple$2[1]; _1 = err; /* */ if ($interfaceIsEqual(_1, $ifaceNil)) { $s = 16; continue; } /* */ if ($interfaceIsEqual(_1, ($pkg.ErrBodyReadAfterClose))) { $s = 17; continue; } /* */ if ($interfaceIsEqual(_1, (io.EOF))) { $s = 18; continue; } /* */ $s = 19; continue; /* if ($interfaceIsEqual(_1, $ifaceNil)) { */ case 16: tooBig = true; $s = 20; continue; /* } else if ($interfaceIsEqual(_1, ($pkg.ErrBodyReadAfterClose))) { */ case 17: $s = 20; continue; /* } else if ($interfaceIsEqual(_1, (io.EOF))) { */ case 18: _r$2 = w.reqBody.Close(); /* */ $s = 21; case 21: 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))) { w.closeAfterReply = true; } $s = 20; continue; /* } else { */ case 19: w.closeAfterReply = true; /* } */ case 20: case 15: /* } */ case 13: /* */ if (tooBig) { $s = 22; continue; } /* */ $s = 23; continue; /* if (tooBig) { */ case 22: $r = w.requestTooLarge(); /* */ $s = 24; case 24: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = delHeader("Connection"); /* */ $s = 25; case 25: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } setHeader.connection = "close"; /* } */ case 23: /* } */ case 5: code = w.status; /* */ if (bodyAllowedForStatus(code)) { $s = 26; continue; } /* */ $s = 27; continue; /* if (bodyAllowedForStatus(code)) { */ case 26: _tuple$3 = (_entry$3 = header[0][$String.keyFor("Content-Type")], _entry$3 !== undefined ? [_entry$3.v, true] : [sliceType$2.nil, false]); haveType = _tuple$3[1]; _r$3 = new Header(header[0]).Get("Content-Encoding"); /* */ $s = 29; case 29: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } ce = _r$3; hasCE = ce.length > 0; /* */ if (!hasCE && !haveType && !hasTE && p.$length > 0) { $s = 30; continue; } /* */ $s = 31; continue; /* if (!hasCE && !haveType && !hasTE && p.$length > 0) { */ case 30: _r$4 = DetectContentType(p); /* */ $s = 32; case 32: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } setHeader.contentType = _r$4; /* } */ case 31: $s = 28; continue; /* } else { */ case 27: _ref$3 = suppressedHeaders(code); _i$2 = 0; /* while (true) { */ case 33: /* if (!(_i$2 < _ref$3.$length)) { break; } */ if(!(_i$2 < _ref$3.$length)) { $s = 34; continue; } k$1 = ((_i$2 < 0 || _i$2 >= _ref$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$3.$array[_ref$3.$offset + _i$2]); $r = delHeader(k$1); /* */ $s = 35; case 35: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i$2++; $s = 33; continue; case 34: /* } */ case 28: /* */ if (!new Header(header[0]).has("Date")) { $s = 36; continue; } /* */ $s = 37; continue; /* if (!new Header(header[0]).has("Date")) { */ case 36: _arg = $subslice(new sliceType$3(cw.res.dateBuf), 0, 0); _r$5 = time.Now(); /* */ $s = 38; case 38: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg$1 = $clone(_r$5, time.Time); _r$6 = appendTime(_arg, _arg$1); /* */ $s = 39; case 39: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } setHeader.date = _r$6; /* } */ case 37: /* */ if (hasCL && hasTE && !(te === "identity")) { $s = 40; continue; } /* */ $s = 41; continue; /* if (hasCL && hasTE && !(te === "identity")) { */ case 40: $r = w.conn.server.logf("http: WriteHeader called with both Transfer-Encoding of %q and a Content-Length of %d", new sliceType([new $String(te), w.contentLength])); /* */ $s = 42; case 42: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = delHeader("Content-Length"); /* */ $s = 43; case 43: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } hasCL = false; /* } */ case 41: /* */ if (w.req.Method === "HEAD" || !bodyAllowedForStatus(code)) { $s = 44; continue; } /* */ if (code === 204) { $s = 45; continue; } /* */ if (hasCL) { $s = 46; continue; } /* */ if (w.req.ProtoAtLeast(1, 1)) { $s = 47; continue; } /* */ $s = 48; continue; /* if (w.req.Method === "HEAD" || !bodyAllowedForStatus(code)) { */ case 44: $s = 49; continue; /* } else if (code === 204) { */ case 45: $r = delHeader("Transfer-Encoding"); /* */ $s = 50; case 50: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 49; continue; /* } else if (hasCL) { */ case 46: $r = delHeader("Transfer-Encoding"); /* */ $s = 51; case 51: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 49; continue; /* } else if (w.req.ProtoAtLeast(1, 1)) { */ case 47: /* */ if (hasTE && te === "identity") { $s = 52; continue; } /* */ $s = 53; continue; /* if (hasTE && te === "identity") { */ case 52: cw.chunking = false; w.closeAfterReply = true; $s = 54; continue; /* } else { */ case 53: cw.chunking = true; setHeader.transferEncoding = "chunked"; /* */ if (hasTE && te === "chunked") { $s = 55; continue; } /* */ $s = 56; continue; /* if (hasTE && te === "chunked") { */ case 55: $r = delHeader("Transfer-Encoding"); /* */ $s = 57; case 57: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 56: /* } */ case 54: $s = 49; continue; /* } else { */ case 48: w.closeAfterReply = true; $r = delHeader("Transfer-Encoding"); /* */ $s = 58; case 58: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 49: /* */ if (cw.chunking) { $s = 59; continue; } /* */ $s = 60; continue; /* if (cw.chunking) { */ case 59: $r = delHeader("Content-Length"); /* */ $s = 61; case 61: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 60: if (!w.req.ProtoAtLeast(1, 0)) { $s = -1; return; } if (!(w.closeAfterReply && (!keepAlivesEnabled || !hasToken(new Header(cw.header).get("Connection"), "close")))) { _v = false; $s = 62; continue s; } _r$7 = isProtocolSwitchResponse(w.status, header[0]); /* */ $s = 63; case 63: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _v = !_r$7; case 62: delConnectionHeader = _v; /* */ if (delConnectionHeader) { $s = 64; continue; } /* */ $s = 65; continue; /* if (delConnectionHeader) { */ case 64: $r = delHeader("Connection"); /* */ $s = 66; case 66: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (w.req.ProtoAtLeast(1, 1)) { setHeader.connection = "close"; } /* } */ case 65: $r = writeStatusLine(w.conn.bufw, w.req.ProtoAtLeast(1, 1), code, new sliceType$3(w.statusBuf)); /* */ $s = 67; case 67: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$8 = new Header(cw.header).WriteSubset(w.conn.bufw, excludeHeader[0]); /* */ $s = 68; case 68: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$8; $r = $clone(setHeader, extraHeader).Write(w.conn.bufw); /* */ $s = 69; case 69: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$9 = w.conn.bufw.Write(crlf); /* */ $s = 70; case 70: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$9; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: chunkWriter.ptr.prototype.writeHeader }; } $f._1 = _1; $f._arg = _arg; $f._arg$1 = _arg$1; $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._i$2 = _i$2; $f._key = _key; $f._keys = _keys; $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._ref$1 = _ref$1; $f._ref$2 = _ref$2; $f._ref$3 = _ref$3; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._v = _v; $f.bdy = bdy; $f.bdy$1 = bdy$1; $f.bdy$2 = bdy$2; $f.ce = ce; $f.code = code; $f.connectionHeaderSet = connectionHeaderSet; $f.cw = cw; $f.delConnectionHeader = delConnectionHeader; $f.delHeader = delHeader; $f.discard = discard; $f.ecr = ecr; $f.err = err; $f.excludeHeader = excludeHeader; $f.hasCE = hasCE; $f.hasCL = hasCL; $f.hasTE = hasTE; $f.haveType = haveType; $f.header = header; $f.isHEAD = isHEAD; $f.k = k; $f.k$1 = k$1; $f.keepAlivesEnabled = keepAlivesEnabled; $f.ok = ok; $f.owned = owned; $f.p = p; $f.sentLength = sentLength; $f.setHeader = setHeader; $f.te = te; $f.tooBig = tooBig; $f.trailers = trailers; $f.v = v; $f.w = w; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.$s = $s; $f.$r = $r; return $f; }; chunkWriter.prototype.writeHeader = function(p) { return this.$val.writeHeader(p); }; foreachHeaderElement = function(v, fn) { var _i, _ref, f, fn, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _ref = $f._ref; f = $f.f; fn = $f.fn; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = textproto.TrimString(v); if (v === "") { $s = -1; return; } /* */ if (!strings.Contains(v, ",")) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!strings.Contains(v, ",")) { */ case 1: $r = fn(v); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 2: _ref = strings.Split(v, ","); _i = 0; /* while (true) { */ case 4: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 5; continue; } f = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); f = textproto.TrimString(f); /* */ if (!(f === "")) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!(f === "")) { */ case 6: $r = fn(f); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 7: _i++; $s = 4; continue; case 5: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: foreachHeaderElement }; } $f._i = _i; $f._ref = _ref; $f.f = f; $f.fn = fn; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; writeStatusLine = function(bw, is11, code, scratch) { var _entry, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _tuple, bw, code, is11, ok, scratch, text, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _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 = $f._tuple; bw = $f.bw; code = $f.code; is11 = $f.is11; ok = $f.ok; scratch = $f.scratch; text = $f.text; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (is11) { $s = 1; continue; } /* */ $s = 2; continue; /* if (is11) { */ case 1: _r$1 = bw.WriteString("HTTP/1.1 "); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = 3; continue; /* } else { */ case 2: _r$2 = bw.WriteString("HTTP/1.0 "); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; /* } */ case 3: _tuple = (_entry = statusText[$Int.keyFor(code)], _entry !== undefined ? [_entry.v, true] : ["", false]); text = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 6; continue; } /* */ $s = 7; continue; /* if (ok) { */ case 6: _r$3 = bw.Write(strconv.AppendInt($subslice(scratch, 0, 0), (new $Int64(0, code)), 10)); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _r$4 = bw.WriteByte(32); /* */ $s = 10; case 10: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; _r$5 = bw.WriteString(text); /* */ $s = 11; case 11: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; _r$6 = bw.WriteString("\r\n"); /* */ $s = 12; case 12: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; $s = 8; continue; /* } else { */ case 7: _r$7 = fmt.Fprintf(bw, "%03d status code %d\r\n", new sliceType([new $Int(code), new $Int(code)])); /* */ $s = 13; case 13: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$7; /* } */ case 8: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: writeStatusLine }; } $f._entry = _entry; $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 = _tuple; $f.bw = bw; $f.code = code; $f.is11 = is11; $f.ok = ok; $f.scratch = scratch; $f.text = text; $f.$s = $s; $f.$r = $r; return $f; }; response.ptr.prototype.bodyAllowed = function() { var w; w = this; if (!w.wroteHeader) { $panic(new $String("")); } return bodyAllowedForStatus(w.status); }; response.prototype.bodyAllowed = function() { return this.$val.bodyAllowed(); }; response.ptr.prototype.Write = function(data) { var $24r, _r$1, _tuple, data, err, n, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _tuple = $f._tuple; data = $f.data; err = $f.err; n = $f.n; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; w = this; _r$1 = w.write(data.$length, data, ""); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err = _tuple[1]; $24r = [n, err]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: response.ptr.prototype.Write }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.data = data; $f.err = err; $f.n = n; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; response.prototype.Write = function(data) { return this.$val.Write(data); }; response.ptr.prototype.WriteString = function(data) { var $24r, _r$1, _tuple, data, err, n, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _tuple = $f._tuple; data = $f.data; err = $f.err; n = $f.n; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; w = this; _r$1 = w.write(data.length, sliceType$3.nil, data); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err = _tuple[1]; $24r = [n, err]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: response.ptr.prototype.WriteString }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.data = data; $f.err = err; $f.n = n; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; response.prototype.WriteString = function(data) { return this.$val.WriteString(data); }; response.ptr.prototype.write = function(lenData, dataB, dataS) { var $24r, $24r$1, _r$1, _r$2, _r$3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, _tuple$1, caller, dataB, dataS, err, lenData, n, w, 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; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _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; _tuple$1 = $f._tuple$1; caller = $f.caller; dataB = $f.dataB; dataS = $f.dataS; err = $f.err; lenData = $f.lenData; n = $f.n; w = $f.w; 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: n = 0; err = $ifaceNil; w = this; _r$1 = w.conn.hijacked(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (_r$1) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_r$1) { */ case 1: /* */ if (lenData > 0) { $s = 4; continue; } /* */ $s = 5; continue; /* if (lenData > 0) { */ case 4: caller = $clone(relevantCaller(), runtime.Frame); $r = w.conn.server.logf("http: response.Write on hijacked connection from %s (%s:%d)", new sliceType([new $String(caller.Function), new $String(path.Base(caller.File)), new $Int(caller.Line)])); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: _tmp = 0; _tmp$1 = $pkg.ErrHijacked; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; /* } */ case 2: /* */ if ((w.$ptr_canWriteContinue || (w.$ptr_canWriteContinue = new ptrType$51(function() { return this.$target.canWriteContinue; }, function($v) { this.$target.canWriteContinue = $v; }, w))).isSet()) { $s = 7; continue; } /* */ $s = 8; continue; /* if ((w.$ptr_canWriteContinue || (w.$ptr_canWriteContinue = new ptrType$51(function() { return this.$target.canWriteContinue; }, function($v) { this.$target.canWriteContinue = $v; }, w))).isSet()) { */ case 7: $r = w.writeContinueMu.Lock(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } (w.$ptr_canWriteContinue || (w.$ptr_canWriteContinue = new ptrType$51(function() { return this.$target.canWriteContinue; }, function($v) { this.$target.canWriteContinue = $v; }, w))).setFalse(); $r = w.writeContinueMu.Unlock(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 8: /* */ if (!w.wroteHeader) { $s = 11; continue; } /* */ $s = 12; continue; /* if (!w.wroteHeader) { */ case 11: $r = w.WriteHeader(200); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 12: if (lenData === 0) { _tmp$2 = 0; _tmp$3 = $ifaceNil; n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; } if (!w.bodyAllowed()) { _tmp$4 = 0; _tmp$5 = $pkg.ErrBodyNotAllowed; n = _tmp$4; err = _tmp$5; $s = -1; return [n, err]; } w.written = (x$5 = w.written, x$6 = (new $Int64(0, lenData)), new $Int64(x$5.$high + x$6.$high, x$5.$low + x$6.$low)); if (!((x$7 = w.contentLength, (x$7.$high === -1 && x$7.$low === 4294967295))) && (x$8 = w.written, x$9 = w.contentLength, (x$8.$high > x$9.$high || (x$8.$high === x$9.$high && x$8.$low > x$9.$low)))) { _tmp$6 = 0; _tmp$7 = $pkg.ErrContentLength; n = _tmp$6; err = _tmp$7; $s = -1; return [n, err]; } /* */ if (!(dataB === sliceType$3.nil)) { $s = 14; continue; } /* */ $s = 15; continue; /* if (!(dataB === sliceType$3.nil)) { */ case 14: _r$2 = w.w.Write(dataB); /* */ $s = 17; case 17: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; n = _tuple[0]; err = _tuple[1]; $24r = [n, err]; $s = 18; case 18: return $24r; /* } else { */ case 15: _r$3 = w.w.WriteString(dataS); /* */ $s = 19; case 19: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$1 = _r$3; n = _tuple$1[0]; err = _tuple$1[1]; $24r$1 = [n, err]; $s = 20; case 20: return $24r$1; /* } */ case 16: $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: response.ptr.prototype.write }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $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._tuple$1 = _tuple$1; $f.caller = caller; $f.dataB = dataB; $f.dataS = dataS; $f.err = err; $f.lenData = lenData; $f.n = n; $f.w = w; $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; }; response.prototype.write = function(lenData, dataB, dataS) { return this.$val.write(lenData, dataB, dataS); }; response.ptr.prototype.finishRequest = function() { var _r$1, _r$2, _r$3, _r$4, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: w = this; (w.$ptr_handlerDone || (w.$ptr_handlerDone = new ptrType$51(function() { return this.$target.handlerDone; }, function($v) { this.$target.handlerDone = $v; }, w))).setTrue(); /* */ if (!w.wroteHeader) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!w.wroteHeader) { */ case 1: $r = w.WriteHeader(200); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: _r$1 = w.w.Flush(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; putBufioWriter(w.w); $r = w.cw.close(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$2 = w.conn.bufw.Flush(); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; $r = w.conn.r.abortPendingRead(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$3 = w.reqBody.Close(); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; /* */ if (!(w.req.MultipartForm === ptrType$31.nil)) { $s = 9; continue; } /* */ $s = 10; continue; /* if (!(w.req.MultipartForm === ptrType$31.nil)) { */ case 9: _r$4 = w.req.MultipartForm.RemoveAll(); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; /* } */ case 10: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: response.ptr.prototype.finishRequest }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; response.prototype.finishRequest = function() { return this.$val.finishRequest(); }; response.ptr.prototype.shouldReuseConnection = function() { var _r$1, w, x$5, x$6, x$7, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; w = $f.w; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: w = this; if (w.closeAfterReply) { $s = -1; return false; } if (!(w.req.Method === "HEAD") && !((x$5 = w.contentLength, (x$5.$high === -1 && x$5.$low === 4294967295))) && w.bodyAllowed() && !((x$6 = w.contentLength, x$7 = w.written, (x$6.$high === x$7.$high && x$6.$low === x$7.$low)))) { $s = -1; return false; } if (!($interfaceIsEqual(w.conn.werr, $ifaceNil))) { $s = -1; return false; } _r$1 = w.closedRequestBodyEarly(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (_r$1) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_r$1) { */ case 1: $s = -1; return false; /* } */ case 2: $s = -1; return true; /* */ } return; } if ($f === undefined) { $f = { $blk: response.ptr.prototype.shouldReuseConnection }; } $f._r$1 = _r$1; $f.w = w; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.$s = $s; $f.$r = $r; return $f; }; response.prototype.shouldReuseConnection = function() { return this.$val.shouldReuseConnection(); }; response.ptr.prototype.closedRequestBodyEarly = function() { var $24r, _r$1, _tuple, _v, body$1, ok, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _tuple = $f._tuple; _v = $f._v; body$1 = $f.body$1; ok = $f.ok; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: w = this; _tuple = $assertType(w.req.Body, ptrType$52, true); body$1 = _tuple[0]; ok = _tuple[1]; if (!(ok)) { _v = false; $s = 1; continue s; } _r$1 = body$1.didEarlyClose(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _v = _r$1; case 1: $24r = _v; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: response.ptr.prototype.closedRequestBodyEarly }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._v = _v; $f.body$1 = body$1; $f.ok = ok; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; response.prototype.closedRequestBodyEarly = function() { return this.$val.closedRequestBodyEarly(); }; response.ptr.prototype.Flush = function() { var _r$1, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: w = this; /* */ if (!w.wroteHeader) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!w.wroteHeader) { */ case 1: $r = w.WriteHeader(200); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: _r$1 = w.w.Flush(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $r = w.cw.flush(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: response.ptr.prototype.Flush }; } $f._r$1 = _r$1; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; response.prototype.Flush = function() { return this.$val.Flush(); }; conn.ptr.prototype.finalFlush = function() { var _r$1, c, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; c = $f.c; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!(c.bufr === ptrType$29.nil)) { putBufioReader(c.bufr); c.bufr = ptrType$29.nil; } /* */ if (!(c.bufw === ptrType$14.nil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(c.bufw === ptrType$14.nil)) { */ case 1: _r$1 = c.bufw.Flush(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; putBufioWriter(c.bufw); c.bufw = ptrType$14.nil; /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: conn.ptr.prototype.finalFlush }; } $f._r$1 = _r$1; $f.c = c; $f.$s = $s; $f.$r = $r; return $f; }; conn.prototype.finalFlush = function() { return this.$val.finalFlush(); }; conn.ptr.prototype.close = function() { var _r$1, c, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; c = $f.c; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; $r = c.finalFlush(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = c.rwc.Close(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: conn.ptr.prototype.close }; } $f._r$1 = _r$1; $f.c = c; $f.$s = $s; $f.$r = $r; return $f; }; conn.prototype.close = function() { return this.$val.close(); }; conn.ptr.prototype.closeWriteAndWait = function() { var _r$1, _tuple, c, ok, tcp, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; c = $f.c; ok = $f.ok; tcp = $f.tcp; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; $r = c.finalFlush(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tuple = $assertType(c.rwc, closeWriter, true); tcp = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (ok) { */ case 2: _r$1 = tcp.CloseWrite(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; /* } */ case 3: $r = time.Sleep(new time.Duration(0, 500000000)); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: conn.ptr.prototype.closeWriteAndWait }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.c = c; $f.ok = ok; $f.tcp = tcp; $f.$s = $s; $f.$r = $r; return $f; }; conn.prototype.closeWriteAndWait = function() { return this.$val.closeWriteAndWait(); }; validNextProto = function(proto) { var _1, proto; _1 = proto; if (_1 === ("") || _1 === ("http/1.1") || _1 === ("http/1.0")) { return false; } return true; }; conn.ptr.prototype.setState = function(nc, state, runHook) { var _1, _r$1, _r$2, c, hook, nc, packedState, runHook, srv, state, x$5, x$6, x$7, x$8, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r$1 = $f._r$1; _r$2 = $f._r$2; c = $f.c; hook = $f.hook; nc = $f.nc; packedState = $f.packedState; runHook = $f.runHook; srv = $f.srv; state = $f.state; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; x$8 = $f.x$8; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; srv = c.server; _1 = state; /* */ if (_1 === (0)) { $s = 2; continue; } /* */ if ((_1 === (3)) || (_1 === (4))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_1 === (0)) { */ case 2: $r = srv.trackConn(c, true); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 4; continue; /* } else if ((_1 === (3)) || (_1 === (4))) { */ case 3: $r = srv.trackConn(c, false); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: case 1: if (state > 255 || state < 0) { $panic(new $String("internal error")); } _r$1 = time.Now(); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = $clone(_r$1, time.Time).Unix(); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } packedState = (x$5 = ((x$6 = $shiftLeft64(_r$2, 8), new $Uint64(x$6.$high, x$6.$low))), x$7 = (new $Uint64(0, state)), new $Uint64(x$5.$high | x$7.$high, (x$5.$low | x$7.$low) >>> 0)); atomic.StoreUint64((x$8 = c.curState, (x$8.$ptr_atomic || (x$8.$ptr_atomic = new ptrType$56(function() { return this.$target.atomic; }, function($v) { this.$target.atomic = $v; }, x$8)))), packedState); if (!runHook) { $s = -1; return; } hook = srv.ConnState; /* */ if (!(hook === $throwNilPointerError)) { $s = 9; continue; } /* */ $s = 10; continue; /* if (!(hook === $throwNilPointerError)) { */ case 9: $r = hook(nc, state); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 10: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: conn.ptr.prototype.setState }; } $f._1 = _1; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.c = c; $f.hook = hook; $f.nc = nc; $f.packedState = packedState; $f.runHook = runHook; $f.srv = srv; $f.state = state; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.x$8 = x$8; $f.$s = $s; $f.$r = $r; return $f; }; conn.prototype.setState = function(nc, state, runHook) { return this.$val.setState(nc, state, runHook); }; conn.ptr.prototype.getState = function() { var _tmp, _tmp$1, c, packedState, state, unixSec, x$5, x$6; state = 0; unixSec = new $Int64(0, 0); c = this; packedState = atomic.LoadUint64((x$5 = c.curState, (x$5.$ptr_atomic || (x$5.$ptr_atomic = new ptrType$56(function() { return this.$target.atomic; }, function($v) { this.$target.atomic = $v; }, x$5))))); _tmp = ((new $Uint64(packedState.$high & 0, (packedState.$low & 255) >>> 0).$low >> 0)); _tmp$1 = ((x$6 = $shiftRightUint64(packedState, 8), new $Int64(x$6.$high, x$6.$low))); state = _tmp; unixSec = _tmp$1; return [state, unixSec]; }; conn.prototype.getState = function() { return this.$val.getState(); }; badRequestError = function(e) { var e, x$5; return (x$5 = new statusError.ptr(400, e), new x$5.constructor.elem(x$5)); }; statusError.ptr.prototype.Error = function() { var e; e = this; return StatusText(e.code) + ": " + e.text; }; statusError.prototype.Error = function() { return this.$val.Error(); }; isCommonNetReadError = function(err) { var _r$1, _tuple, _tuple$1, _v, err, neterr, oe, ok, ok$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _v = $f._v; err = $f.err; neterr = $f.neterr; oe = $f.oe; ok = $f.ok; ok$1 = $f.ok$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if ($interfaceIsEqual(err, io.EOF)) { $s = -1; return true; } _tuple = $assertType(err, net.Error, true); neterr = _tuple[0]; ok = _tuple[1]; if (!(ok)) { _v = false; $s = 3; continue s; } _r$1 = neterr.Timeout(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _v = _r$1; case 3: /* */ if (_v) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v) { */ case 1: $s = -1; return true; /* } */ case 2: _tuple$1 = $assertType(err, ptrType$57, true); oe = _tuple$1[0]; ok$1 = _tuple$1[1]; if (ok$1 && oe.Op === "read") { $s = -1; return true; } $s = -1; return false; /* */ } return; } if ($f === undefined) { $f = { $blk: isCommonNetReadError }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._v = _v; $f.err = err; $f.neterr = neterr; $f.oe = oe; $f.ok = ok; $f.ok$1 = ok$1; $f.$s = $s; $f.$r = $r; return $f; }; conn.ptr.prototype.serve = function(ctx) { var _arg, _arg$1, _arg$2, _arg$3, _arg$4, _entry, _r$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$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _v, c, cancelCtx, code, ctx, d, d$1, d$2, err, err$1, err$2, fn, h, ok, ok$1, ok$2, proto, publicErr, re, req, tlsConn, v, w, x$5, x$6, x$7, x$8, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _arg$4 = $f._arg$4; _entry = $f._entry; _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$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$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; _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; _v = $f._v; c = $f.c; cancelCtx = $f.cancelCtx; code = $f.code; ctx = $f.ctx; d = $f.d; d$1 = $f.d$1; d$2 = $f.d$2; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; fn = $f.fn; h = $f.h; ok = $f.ok; ok$1 = $f.ok$1; ok$2 = $f.ok$2; proto = $f.proto; publicErr = $f.publicErr; re = $f.re; req = $f.req; tlsConn = $f.tlsConn; v = $f.v; w = $f.w; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; x$8 = $f.x$8; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); c = [c]; c[0] = this; _r$1 = c[0].rwc.RemoteAddr(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = _r$1.String(); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } c[0].remoteAddr = _r$2; _arg = ctx; _arg$1 = $pkg.LocalAddrContextKey; _r$3 = c[0].rwc.LocalAddr(); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _arg$2 = _r$3; _r$4 = context.WithValue(_arg, _arg$1, _arg$2); /* */ $s = 4; case 4: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } ctx = _r$4; $deferred.push([(function(c) { return function $b() { var _r$5, buf, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$5 = $f._r$5; buf = $f.buf; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $recover(); /* */ if (!($interfaceIsEqual(err, $ifaceNil)) && !($interfaceIsEqual(err, $pkg.ErrAbortHandler))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(err, $ifaceNil)) && !($interfaceIsEqual(err, $pkg.ErrAbortHandler))) { */ case 1: buf = $makeSlice(sliceType$3, 65536); buf = $subslice(buf, 0, runtime.Stack(buf, false)); $r = c[0].server.logf("http: panic serving %v: %v\n%s", new sliceType([new $String(c[0].remoteAddr), err, buf])); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: _r$5 = c[0].hijacked(); /* */ $s = 6; case 6: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } /* */ if (!_r$5) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!_r$5) { */ case 4: $r = c[0].close(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = c[0].setState(c[0].rwc, 4, true); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$5 = _r$5; $f.buf = buf; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; })(c), []]); _tuple = $assertType(c[0].rwc, ptrType$30, true); tlsConn = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 5; continue; } /* */ $s = 6; continue; /* if (ok) { */ case 5: d = c[0].server.ReadTimeout; /* */ if ((d.$high > 0 || (d.$high === 0 && d.$low > 0))) { $s = 7; continue; } /* */ $s = 8; continue; /* if ((d.$high > 0 || (d.$high === 0 && d.$low > 0))) { */ case 7: _r$5 = time.Now(); /* */ $s = 9; case 9: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$6 = $clone(_r$5, time.Time).Add(d); /* */ $s = 10; case 10: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$7 = c[0].rwc.SetReadDeadline($clone(_r$6, time.Time)); /* */ $s = 11; case 11: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$7; /* } */ case 8: d$1 = c[0].server.WriteTimeout; /* */ if ((d$1.$high > 0 || (d$1.$high === 0 && d$1.$low > 0))) { $s = 12; continue; } /* */ $s = 13; continue; /* if ((d$1.$high > 0 || (d$1.$high === 0 && d$1.$low > 0))) { */ case 12: _r$8 = time.Now(); /* */ $s = 14; case 14: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$9 = $clone(_r$8, time.Time).Add(d$1); /* */ $s = 15; case 15: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$10 = c[0].rwc.SetWriteDeadline($clone(_r$9, time.Time)); /* */ $s = 16; case 16: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; /* } */ case 13: _r$11 = tlsConn.HandshakeContext(ctx); /* */ $s = 17; case 17: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } err = _r$11; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 18; continue; } /* */ $s = 19; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 18: _tuple$1 = $assertType(err, tls.RecordHeaderError, true); re = $clone(_tuple$1[0], tls.RecordHeaderError); ok$1 = _tuple$1[1]; /* */ if (ok$1 && !($interfaceIsEqual(re.Conn, $ifaceNil)) && tlsRecordHeaderLooksLikeHTTP($clone(re.RecordHeader, arrayType$6))) { $s = 20; continue; } /* */ $s = 21; continue; /* if (ok$1 && !($interfaceIsEqual(re.Conn, $ifaceNil)) && tlsRecordHeaderLooksLikeHTTP($clone(re.RecordHeader, arrayType$6))) { */ case 20: _r$12 = io.WriteString(re.Conn, "HTTP/1.0 400 Bad Request\r\n\r\nClient sent an HTTP request to an HTTPS server.\n"); /* */ $s = 22; case 22: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _r$12; _r$13 = re.Conn.Close(); /* */ $s = 23; case 23: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _r$13; $s = 24; case 24: return; /* } */ case 21: _r$14 = c[0].rwc.RemoteAddr(); /* */ $s = 25; case 25: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _arg$3 = _r$14; _arg$4 = err; $r = c[0].server.logf("http: TLS handshake error from %s: %v", new sliceType([_arg$3, _arg$4])); /* */ $s = 26; case 26: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 27; case 27: return; /* } */ case 19: c[0].tlsState = new tls.ConnectionState.ptr(0, false, false, 0, "", false, "", sliceType$10.nil, sliceType$11.nil, sliceType$5.nil, sliceType$3.nil, sliceType$3.nil, $throwNilPointerError); _r$15 = tlsConn.ConnectionState(); /* */ $s = 28; case 28: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } tls.ConnectionState.copy(c[0].tlsState, _r$15); proto = c[0].tlsState.NegotiatedProtocol; /* */ if (validNextProto(proto)) { $s = 29; continue; } /* */ $s = 30; continue; /* if (validNextProto(proto)) { */ case 29: fn = (_entry = c[0].server.TLSNextProto[$String.keyFor(proto)], _entry !== undefined ? _entry.v : $throwNilPointerError); /* */ if (!(fn === $throwNilPointerError)) { $s = 31; continue; } /* */ $s = 32; continue; /* if (!(fn === $throwNilPointerError)) { */ case 31: h = new initALPNRequest.ptr(ctx, tlsConn, new serverHandler.ptr(c[0].server)); $r = c[0].setState(c[0].rwc, 1, false); /* */ $s = 33; case 33: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = fn(c[0].server, tlsConn, new h.constructor.elem(h)); /* */ $s = 34; case 34: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 32: $s = 35; case 35: return; /* } */ case 30: /* } */ case 6: _r$16 = context.WithCancel(ctx); /* */ $s = 36; case 36: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _tuple$2 = _r$16; ctx = _tuple$2[0]; cancelCtx = _tuple$2[1]; c[0].cancelCtx = cancelCtx; $deferred.push([cancelCtx, []]); c[0].r = new connReader.ptr(c[0], new sync.Mutex.ptr(0, 0), false, arrayType$2.zero(), ptrType$48.nil, false, false, new $Int64(0, 0)); _r$17 = newBufioReader(c[0].r); /* */ $s = 37; case 37: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } c[0].bufr = _r$17; _r$18 = newBufioWriterSize((x$5 = new checkConnErrorWriter.ptr(c[0]), new x$5.constructor.elem(x$5)), 4096); /* */ $s = 38; case 38: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } c[0].bufw = _r$18; /* while (true) { */ case 39: _r$19 = c[0].readRequest(ctx); /* */ $s = 41; case 41: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } _tuple$3 = _r$19; w = _tuple$3[0]; err$1 = _tuple$3[1]; /* */ if (!((x$6 = c[0].r.remain, x$7 = c[0].server.initialReadLimitSize(), (x$6.$high === x$7.$high && x$6.$low === x$7.$low)))) { $s = 42; continue; } /* */ $s = 43; continue; /* if (!((x$6 = c[0].r.remain, x$7 = c[0].server.initialReadLimitSize(), (x$6.$high === x$7.$high && x$6.$low === x$7.$low)))) { */ case 42: $r = c[0].setState(c[0].rwc, 1, true); /* */ $s = 44; case 44: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 43: /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 45; continue; } /* */ $s = 46; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 45: /* */ if ($interfaceIsEqual(err$1, errTooLarge)) { $s = 48; continue; } /* */ if (isUnsupportedTEError(err$1)) { $s = 49; continue; } _r$20 = isCommonNetReadError(err$1); /* */ $s = 53; case 53: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } /* */ if (_r$20) { $s = 50; continue; } /* */ $s = 51; continue; /* if ($interfaceIsEqual(err$1, errTooLarge)) { */ case 48: _r$21 = fmt.Fprintf(c[0].rwc, "HTTP/1.1 431 Request Header Fields Too Large\r\nContent-Type: text/plain; charset=utf-8\r\nConnection: close\r\n\r\n431 Request Header Fields Too Large", new sliceType([])); /* */ $s = 54; case 54: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } _r$21; $r = c[0].closeWriteAndWait(); /* */ $s = 55; case 55: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 56; case 56: return; /* } else if (isUnsupportedTEError(err$1)) { */ case 49: code = 501; _r$22 = fmt.Fprintf(c[0].rwc, "HTTP/1.1 %d %s%sUnsupported transfer encoding", new sliceType([new $Int(code), new $String(StatusText(code)), new $String("\r\nContent-Type: text/plain; charset=utf-8\r\nConnection: close\r\n\r\n")])); /* */ $s = 57; case 57: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; } _r$22; $s = 58; case 58: return; /* } else if (_r$20) { */ case 50: $s = 59; case 59: return; /* } else { */ case 51: _tuple$4 = $assertType(err$1, statusError, true); v = $clone(_tuple$4[0], statusError); ok$2 = _tuple$4[1]; /* */ if (ok$2) { $s = 60; continue; } /* */ $s = 61; continue; /* if (ok$2) { */ case 60: _r$23 = fmt.Fprintf(c[0].rwc, "HTTP/1.1 %d %s: %s%s%d %s: %s", new sliceType([new $Int(v.code), new $String(StatusText(v.code)), new $String(v.text), new $String("\r\nContent-Type: text/plain; charset=utf-8\r\nConnection: close\r\n\r\n"), new $Int(v.code), new $String(StatusText(v.code)), new $String(v.text)])); /* */ $s = 62; case 62: if($c) { $c = false; _r$23 = _r$23.$blk(); } if (_r$23 && _r$23.$blk !== undefined) { break s; } _r$23; $s = 63; case 63: return; /* } */ case 61: publicErr = "400 Bad Request"; _r$24 = fmt.Fprintf(c[0].rwc, "HTTP/1.1 " + publicErr + "\r\nContent-Type: text/plain; charset=utf-8\r\nConnection: close\r\n\r\n" + publicErr, new sliceType([])); /* */ $s = 64; case 64: if($c) { $c = false; _r$24 = _r$24.$blk(); } if (_r$24 && _r$24.$blk !== undefined) { break s; } _r$24; $s = 65; case 65: return; /* } */ case 52: case 47: /* } */ case 46: req = w.req; /* */ if (req.expectsContinue()) { $s = 66; continue; } /* */ if (!(new Header(req.Header).get("Expect") === "")) { $s = 67; continue; } /* */ $s = 68; continue; /* if (req.expectsContinue()) { */ case 66: if (req.ProtoAtLeast(1, 1) && !((x$8 = req.ContentLength, (x$8.$high === 0 && x$8.$low === 0)))) { req.Body = new expectContinueReader.ptr(w, req.Body, 0, 0); (w.$ptr_canWriteContinue || (w.$ptr_canWriteContinue = new ptrType$51(function() { return this.$target.canWriteContinue; }, function($v) { this.$target.canWriteContinue = $v; }, w))).setTrue(); } $s = 68; continue; /* } else if (!(new Header(req.Header).get("Expect") === "")) { */ case 67: $r = w.sendExpectationFailed(); /* */ $s = 69; case 69: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 70; case 70: return; /* } */ case 68: c[0].curReq.Store(w); _r$25 = requestBodyRemains(req.Body); /* */ $s = 74; case 74: if($c) { $c = false; _r$25 = _r$25.$blk(); } if (_r$25 && _r$25.$blk !== undefined) { break s; } /* */ if (_r$25) { $s = 71; continue; } /* */ $s = 72; continue; /* if (_r$25) { */ case 71: $r = registerOnHitEOF(req.Body, $methodVal(w.conn.r, "startBackgroundRead")); /* */ $s = 75; case 75: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 73; continue; /* } else { */ case 72: $r = w.conn.r.startBackgroundRead(); /* */ $s = 76; case 76: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 73: $r = new serverHandler.ptr(c[0].server).ServeHTTP(w, w.req); /* */ $s = 77; case 77: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = w.cancelCtx(); /* */ $s = 78; case 78: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$26 = c[0].hijacked(); /* */ $s = 81; case 81: if($c) { $c = false; _r$26 = _r$26.$blk(); } if (_r$26 && _r$26.$blk !== undefined) { break s; } /* */ if (_r$26) { $s = 79; continue; } /* */ $s = 80; continue; /* if (_r$26) { */ case 79: $s = 82; case 82: return; /* } */ case 80: $r = w.finishRequest(); /* */ $s = 83; case 83: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$27 = w.shouldReuseConnection(); /* */ $s = 86; case 86: if($c) { $c = false; _r$27 = _r$27.$blk(); } if (_r$27 && _r$27.$blk !== undefined) { break s; } /* */ if (!_r$27) { $s = 84; continue; } /* */ $s = 85; continue; /* if (!_r$27) { */ case 84: if (w.requestBodyLimitHit) { _v = true; $s = 89; continue s; } _r$28 = w.closedRequestBodyEarly(); /* */ $s = 90; case 90: if($c) { $c = false; _r$28 = _r$28.$blk(); } if (_r$28 && _r$28.$blk !== undefined) { break s; } _v = _r$28; case 89: /* */ if (_v) { $s = 87; continue; } /* */ $s = 88; continue; /* if (_v) { */ case 87: $r = c[0].closeWriteAndWait(); /* */ $s = 91; case 91: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 88: $s = 92; case 92: return; /* } */ case 85: $r = c[0].setState(c[0].rwc, 2, true); /* */ $s = 93; case 93: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } c[0].curReq.Store((ptrType$49.nil)); /* */ if (!w.conn.server.doKeepAlives()) { $s = 94; continue; } /* */ $s = 95; continue; /* if (!w.conn.server.doKeepAlives()) { */ case 94: $s = 96; case 96: return; /* } */ case 95: d$2 = c[0].server.idleTimeout(); /* */ if (!((d$2.$high === 0 && d$2.$low === 0))) { $s = 97; continue; } /* */ $s = 98; continue; /* if (!((d$2.$high === 0 && d$2.$low === 0))) { */ case 97: _r$29 = time.Now(); /* */ $s = 99; case 99: if($c) { $c = false; _r$29 = _r$29.$blk(); } if (_r$29 && _r$29.$blk !== undefined) { break s; } _r$30 = $clone(_r$29, time.Time).Add(d$2); /* */ $s = 100; case 100: if($c) { $c = false; _r$30 = _r$30.$blk(); } if (_r$30 && _r$30.$blk !== undefined) { break s; } _r$31 = c[0].rwc.SetReadDeadline($clone(_r$30, time.Time)); /* */ $s = 101; case 101: if($c) { $c = false; _r$31 = _r$31.$blk(); } if (_r$31 && _r$31.$blk !== undefined) { break s; } _r$31; _r$32 = c[0].bufr.Peek(4); /* */ $s = 102; case 102: if($c) { $c = false; _r$32 = _r$32.$blk(); } if (_r$32 && _r$32.$blk !== undefined) { break s; } _tuple$5 = _r$32; err$2 = _tuple$5[1]; /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 103; continue; } /* */ $s = 104; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 103: $s = 105; case 105: return; /* } */ case 104: /* } */ case 98: _r$33 = c[0].rwc.SetReadDeadline(new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil)); /* */ $s = 106; case 106: if($c) { $c = false; _r$33 = _r$33.$blk(); } if (_r$33 && _r$33.$blk !== undefined) { break s; } _r$33; $s = 39; continue; case 40: $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: conn.ptr.prototype.serve }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._arg$4 = _arg$4; $f._entry = _entry; $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$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$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._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._v = _v; $f.c = c; $f.cancelCtx = cancelCtx; $f.code = code; $f.ctx = ctx; $f.d = d; $f.d$1 = d$1; $f.d$2 = d$2; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.fn = fn; $f.h = h; $f.ok = ok; $f.ok$1 = ok$1; $f.ok$2 = ok$2; $f.proto = proto; $f.publicErr = publicErr; $f.re = re; $f.req = req; $f.tlsConn = tlsConn; $f.v = v; $f.w = w; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.x$8 = x$8; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; conn.prototype.serve = function(ctx) { return this.$val.serve(ctx); }; response.ptr.prototype.sendExpectationFailed = function() { var w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: w = this; $r = new Header(w.Header()).Set("Connection", "close"); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = w.WriteHeader(417); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = w.finishRequest(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: response.ptr.prototype.sendExpectationFailed }; } $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; response.prototype.sendExpectationFailed = function() { return this.$val.sendExpectationFailed(); }; response.ptr.prototype.Hijack = function() { var $24r, _r$1, _tmp, _tmp$1, _tmp$2, _tuple, buf, c, err, rwc, w, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tuple = $f._tuple; buf = $f.buf; c = $f.c; err = $f.err; rwc = $f.rwc; w = $f.w; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); rwc = $ifaceNil; buf = ptrType$44.nil; err = $ifaceNil; w = this; if ((w.$ptr_handlerDone || (w.$ptr_handlerDone = new ptrType$51(function() { return this.$target.handlerDone; }, function($v) { this.$target.handlerDone = $v; }, w))).isSet()) { $panic(new $String("net/http: Hijack called after ServeHTTP finished")); } /* */ if (w.wroteHeader) { $s = 1; continue; } /* */ $s = 2; continue; /* if (w.wroteHeader) { */ case 1: $r = w.cw.flush(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: c = w.conn; $r = c.mu.Lock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(c.mu, "Unlock"), []]); _r$1 = c.hijackLocked(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; rwc = _tuple[0]; buf = _tuple[1]; err = _tuple[2]; if ($interfaceIsEqual(err, $ifaceNil)) { putBufioWriter(w.w); w.w = ptrType$14.nil; } _tmp = rwc; _tmp$1 = buf; _tmp$2 = err; rwc = _tmp; buf = _tmp$1; err = _tmp$2; $24r = [rwc, buf, err]; $s = 6; case 6: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [rwc, buf, err]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: response.ptr.prototype.Hijack }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tuple = _tuple; $f.buf = buf; $f.c = c; $f.err = err; $f.rwc = rwc; $f.w = w; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; response.prototype.Hijack = function() { return this.$val.Hijack(); }; response.ptr.prototype.CloseNotify = function() { var w; w = this; if ((w.$ptr_handlerDone || (w.$ptr_handlerDone = new ptrType$51(function() { return this.$target.handlerDone; }, function($v) { this.$target.handlerDone = $v; }, w))).isSet()) { $panic(new $String("net/http: CloseNotify called after ServeHTTP finished")); } return w.closeNotifyCh; }; response.prototype.CloseNotify = function() { return this.$val.CloseNotify(); }; registerOnHitEOF = function(rc, fn) { var _r$1, _ref, fn, rc, v, v$1, v$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _ref = $f._ref; fn = $f.fn; rc = $f.rc; v = $f.v; v$1 = $f.v$1; v$2 = $f.v$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _ref = rc; /* */ if ($assertType(_ref, ptrType$55, true)[1]) { $s = 1; continue; } /* */ if ($assertType(_ref, ptrType$52, true)[1]) { $s = 2; continue; } /* */ $s = 3; continue; /* if ($assertType(_ref, ptrType$55, true)[1]) { */ case 1: v = _ref.$val; $r = registerOnHitEOF(v.readCloser, fn); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 4; continue; /* } else if ($assertType(_ref, ptrType$52, true)[1]) { */ case 2: v$1 = _ref.$val; $r = v$1.registerOnHitEOF(fn); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 4; continue; /* } else { */ case 3: v$2 = _ref; _r$1 = fmt.Sprintf("%T", new sliceType([rc])); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $panic(new $String("unexpected type " + _r$1)); /* } */ case 4: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: registerOnHitEOF }; } $f._r$1 = _r$1; $f._ref = _ref; $f.fn = fn; $f.rc = rc; $f.v = v; $f.v$1 = v$1; $f.v$2 = v$2; $f.$s = $s; $f.$r = $r; return $f; }; requestBodyRemains = function(rc) { var $24r, $24r$1, _r$1, _r$2, _r$3, _ref, rc, v, v$1, v$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; rc = $f.rc; v = $f.v; v$1 = $f.v$1; v$2 = $f.v$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if ($interfaceIsEqual(rc, new $pkg.NoBody.constructor.elem($pkg.NoBody))) { $s = -1; return false; } _ref = rc; /* */ if ($assertType(_ref, ptrType$55, true)[1]) { $s = 1; continue; } /* */ if ($assertType(_ref, ptrType$52, true)[1]) { $s = 2; continue; } /* */ $s = 3; continue; /* if ($assertType(_ref, ptrType$55, true)[1]) { */ case 1: v = _ref.$val; _r$1 = requestBodyRemains(v.readCloser); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 6; case 6: return $24r; /* } else if ($assertType(_ref, ptrType$52, true)[1]) { */ case 2: v$1 = _ref.$val; _r$2 = v$1.bodyRemains(); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r$1 = _r$2; $s = 8; case 8: return $24r$1; /* } else { */ case 3: v$2 = _ref; _r$3 = fmt.Sprintf("%T", new sliceType([rc])); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $panic(new $String("unexpected type " + _r$3)); /* } */ case 4: $s = -1; return false; /* */ } return; } if ($f === undefined) { $f = { $blk: requestBodyRemains }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._ref = _ref; $f.rc = rc; $f.v = v; $f.v$1 = v$1; $f.v$2 = v$2; $f.$s = $s; $f.$r = $r; return $f; }; HandlerFunc.prototype.ServeHTTP = function(w, r) { var f, r, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; f = $f.f; r = $f.r; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this.$val; $r = f(w, r); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: HandlerFunc.prototype.ServeHTTP }; } $f.f = f; $f.r = r; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(HandlerFunc).prototype.ServeHTTP = function(w, r) { return new HandlerFunc(this.$get()).ServeHTTP(w, r); }; Error = function(w, error, code) { var _r$1, _r$2, _r$3, code, error, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; code = $f.code; error = $f.error; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = w.Header(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = new Header(_r$1).Set("Content-Type", "text/plain; charset=utf-8"); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$2 = w.Header(); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $r = new Header(_r$2).Set("X-Content-Type-Options", "nosniff"); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = w.WriteHeader(code); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$3 = fmt.Fprintln(w, new sliceType([new $String(error)])); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Error }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.code = code; $f.error = error; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Error = Error; NotFound = function(w, r) { var r, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; r = $f.r; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = Error(w, "404 page not found", 404); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: NotFound }; } $f.r = r; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.NotFound = NotFound; NotFoundHandler = function() { return new HandlerFunc((NotFound)); }; $pkg.NotFoundHandler = NotFoundHandler; Redirect = function(w, r, url$1, code) { var _entry, _entry$1, _r$1, _r$2, _r$3, _r$4, _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, body$1, code, err, h, hadCT, i, olddir, oldpath, query, r, trailing, u, url$1, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; body$1 = $f.body$1; code = $f.code; err = $f.err; h = $f.h; hadCT = $f.hadCT; i = $f.i; olddir = $f.olddir; oldpath = $f.oldpath; query = $f.query; r = $f.r; trailing = $f.trailing; u = $f.u; url$1 = $f.url$1; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = url.Parse(url$1); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; u = _tuple[0]; err = _tuple[1]; if ($interfaceIsEqual(err, $ifaceNil)) { if (u.Scheme === "" && u.Host === "") { oldpath = r.URL.Path; if (oldpath === "") { oldpath = "/"; } if (url$1 === "" || !((url$1.charCodeAt(0) === 47))) { _tuple$1 = path.Split(oldpath); olddir = _tuple$1[0]; url$1 = olddir + url$1; } query = ""; i = strings.Index(url$1, "?"); if (!((i === -1))) { _tmp = $substring(url$1, 0, i); _tmp$1 = $substring(url$1, i); url$1 = _tmp; query = _tmp$1; } trailing = strings.HasSuffix(url$1, "/"); url$1 = path.Clean(url$1); if (trailing && !strings.HasSuffix(url$1, "/")) { url$1 = url$1 + ("/"); } url$1 = url$1 + (query); } } _r$2 = w.Header(); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } h = _r$2; _tuple$2 = (_entry = h[$String.keyFor("Content-Type")], _entry !== undefined ? [_entry.v, true] : [sliceType$2.nil, false]); hadCT = _tuple$2[1]; $r = new Header(h).Set("Location", hexEscapeNonASCII(url$1)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!hadCT && (r.Method === "GET" || r.Method === "HEAD")) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!hadCT && (r.Method === "GET" || r.Method === "HEAD")) { */ case 4: $r = new Header(h).Set("Content-Type", "text/html; charset=utf-8"); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: $r = w.WriteHeader(code); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!hadCT && r.Method === "GET") { $s = 8; continue; } /* */ $s = 9; continue; /* if (!hadCT && r.Method === "GET") { */ case 8: _r$3 = htmlEscape(url$1); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } body$1 = "" + (_entry$1 = statusText[$Int.keyFor(code)], _entry$1 !== undefined ? _entry$1.v : "") + ".\n"; _r$4 = fmt.Fprintln(w, new sliceType([new $String(body$1)])); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; /* } */ case 9: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Redirect }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.body$1 = body$1; $f.code = code; $f.err = err; $f.h = h; $f.hadCT = hadCT; $f.i = i; $f.olddir = olddir; $f.oldpath = oldpath; $f.query = query; $f.r = r; $f.trailing = trailing; $f.u = u; $f.url$1 = url$1; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Redirect = Redirect; htmlEscape = function(s) { var $24r, _r$1, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = htmlReplacer.Replace(s); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: htmlEscape }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; redirectHandler.ptr.prototype.ServeHTTP = function(w, r) { var r, rh, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; r = $f.r; rh = $f.rh; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rh = this; $r = Redirect(w, r, rh.url, rh.code); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: redirectHandler.ptr.prototype.ServeHTTP }; } $f.r = r; $f.rh = rh; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; redirectHandler.prototype.ServeHTTP = function(w, r) { return this.$val.ServeHTTP(w, r); }; RedirectHandler = function(url$1, code) { var code, url$1; return new redirectHandler.ptr(url$1, code); }; $pkg.RedirectHandler = RedirectHandler; cleanPath = function(p) { var np, p; if (p === "") { return "/"; } if (!((p.charCodeAt(0) === 47))) { p = "/" + p; } np = path.Clean(p); if ((p.charCodeAt((p.length - 1 >> 0)) === 47) && !(np === "/")) { if ((p.length === (np.length + 1 >> 0)) && strings.HasPrefix(p, np)) { np = p; } else { np = np + ("/"); } } return np; }; stripHostPort = function(h) { var _r$1, _tuple, err, h, host, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; h = $f.h; host = $f.host; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (strings.IndexByte(h, 58) === -1) { $s = -1; return h; } _r$1 = net.SplitHostPort(h); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; host = _tuple[0]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return h; } $s = -1; return host; /* */ } return; } if ($f === undefined) { $f = { $blk: stripHostPort }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.h = h; $f.host = host; $f.$s = $s; $f.$r = $r; return $f; }; ServeMux.ptr.prototype.match = function(path$1) { var _entry, _i, _ref, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, e, h, mux, ok, path$1, pattern, v; h = $ifaceNil; pattern = ""; mux = this; _tuple = (_entry = mux.m[$String.keyFor(path$1)], _entry !== undefined ? [_entry.v, true] : [new muxEntry.ptr($ifaceNil, ""), false]); v = $clone(_tuple[0], muxEntry); ok = _tuple[1]; if (ok) { _tmp = v.h; _tmp$1 = v.pattern; h = _tmp; pattern = _tmp$1; return [h, pattern]; } _ref = mux.es; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } e = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), muxEntry); if (strings.HasPrefix(path$1, e.pattern)) { _tmp$2 = e.h; _tmp$3 = e.pattern; h = _tmp$2; pattern = _tmp$3; return [h, pattern]; } _i++; } _tmp$4 = $ifaceNil; _tmp$5 = ""; h = _tmp$4; pattern = _tmp$5; return [h, pattern]; }; ServeMux.prototype.match = function(path$1) { return this.$val.match(path$1); }; ServeMux.ptr.prototype.redirectToPathSlash = function(host, path$1, u) { var host, mux, path$1, shouldRedirect, u, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; host = $f.host; mux = $f.mux; path$1 = $f.path$1; shouldRedirect = $f.shouldRedirect; u = $f.u; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: mux = this; $r = mux.mu.RLock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } shouldRedirect = mux.shouldRedirectRLocked(host, path$1); $r = mux.mu.RUnlock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (!shouldRedirect) { $s = -1; return [u, false]; } path$1 = path$1 + "/"; u = new url.URL.ptr("", "", ptrType$21.nil, "", path$1, "", false, u.RawQuery, "", ""); $s = -1; return [u, true]; /* */ } return; } if ($f === undefined) { $f = { $blk: ServeMux.ptr.prototype.redirectToPathSlash }; } $f.host = host; $f.mux = mux; $f.path$1 = path$1; $f.shouldRedirect = shouldRedirect; $f.u = u; $f.$s = $s; $f.$r = $r; return $f; }; ServeMux.prototype.redirectToPathSlash = function(host, path$1, u) { return this.$val.redirectToPathSlash(host, path$1, u); }; ServeMux.ptr.prototype.shouldRedirectRLocked = function(host, path$1) { var _entry, _entry$1, _i, _i$1, _ref, _ref$1, _tuple, _tuple$1, c, c$1, exist, exist$1, host, mux, n, p, path$1; mux = this; p = new sliceType$2([path$1, host + path$1]); _ref = p; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } c = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _tuple = (_entry = mux.m[$String.keyFor(c)], _entry !== undefined ? [_entry.v, true] : [new muxEntry.ptr($ifaceNil, ""), false]); exist = _tuple[1]; if (exist) { return false; } _i++; } n = path$1.length; if (n === 0) { return false; } _ref$1 = p; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } c$1 = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); _tuple$1 = (_entry$1 = mux.m[$String.keyFor(c$1 + "/")], _entry$1 !== undefined ? [_entry$1.v, true] : [new muxEntry.ptr($ifaceNil, ""), false]); exist$1 = _tuple$1[1]; if (exist$1) { return !((path$1.charCodeAt((n - 1 >> 0)) === 47)); } _i$1++; } return false; }; ServeMux.prototype.shouldRedirectRLocked = function(host, path$1) { return this.$val.shouldRedirectRLocked(host, path$1); }; ServeMux.ptr.prototype.Handler = function(r) { var $24r, $24r$1, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, h, host, mux, ok, ok$1, path$1, pattern, r, u, u$1, u$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _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$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; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; h = $f.h; host = $f.host; mux = $f.mux; ok = $f.ok; ok$1 = $f.ok$1; path$1 = $f.path$1; pattern = $f.pattern; r = $f.r; u = $f.u; u$1 = $f.u$1; u$2 = $f.u$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: h = $ifaceNil; pattern = ""; mux = this; /* */ if (r.Method === "CONNECT") { $s = 1; continue; } /* */ $s = 2; continue; /* if (r.Method === "CONNECT") { */ case 1: _r$1 = mux.redirectToPathSlash(r.URL.Host, r.URL.Path, r.URL); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; u = _tuple[0]; ok = _tuple[1]; if (ok) { _tmp = RedirectHandler(u.String(), 301); _tmp$1 = u.Path; h = _tmp; pattern = _tmp$1; $s = -1; return [h, pattern]; } _r$2 = mux.handler(r.Host, r.URL.Path); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; h = _tuple$1[0]; pattern = _tuple$1[1]; $24r = [h, pattern]; $s = 5; case 5: return $24r; /* } */ case 2: _r$3 = stripHostPort(r.Host); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } host = _r$3; path$1 = cleanPath(r.URL.Path); _r$4 = mux.redirectToPathSlash(host, path$1, r.URL); /* */ $s = 7; case 7: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$2 = _r$4; u$1 = _tuple$2[0]; ok$1 = _tuple$2[1]; if (ok$1) { _tmp$2 = RedirectHandler(u$1.String(), 301); _tmp$3 = u$1.Path; h = _tmp$2; pattern = _tmp$3; $s = -1; return [h, pattern]; } /* */ if (!(path$1 === r.URL.Path)) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!(path$1 === r.URL.Path)) { */ case 8: _r$5 = mux.handler(host, path$1); /* */ $s = 10; case 10: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$3 = _r$5; pattern = _tuple$3[1]; u$2 = new url.URL.ptr("", "", ptrType$21.nil, "", path$1, "", false, r.URL.RawQuery, "", ""); _tmp$4 = RedirectHandler(u$2.String(), 301); _tmp$5 = pattern; h = _tmp$4; pattern = _tmp$5; $s = -1; return [h, pattern]; /* } */ case 9: _r$6 = mux.handler(host, r.URL.Path); /* */ $s = 11; case 11: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tuple$4 = _r$6; h = _tuple$4[0]; pattern = _tuple$4[1]; $24r$1 = [h, pattern]; $s = 12; case 12: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: ServeMux.ptr.prototype.Handler }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $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$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._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f.h = h; $f.host = host; $f.mux = mux; $f.ok = ok; $f.ok$1 = ok$1; $f.path$1 = path$1; $f.pattern = pattern; $f.r = r; $f.u = u; $f.u$1 = u$1; $f.u$2 = u$2; $f.$s = $s; $f.$r = $r; return $f; }; ServeMux.prototype.Handler = function(r) { return this.$val.Handler(r); }; ServeMux.ptr.prototype.handler = function(host, path$1) { var $24r, _tmp, _tmp$1, _tuple, _tuple$1, h, host, mux, path$1, pattern, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; h = $f.h; host = $f.host; mux = $f.mux; path$1 = $f.path$1; pattern = $f.pattern; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); h = $ifaceNil; pattern = ""; mux = this; $r = mux.mu.RLock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(mux.mu, "RUnlock"), []]); if (mux.hosts) { _tuple = mux.match(host + path$1); h = _tuple[0]; pattern = _tuple[1]; } if ($interfaceIsEqual(h, $ifaceNil)) { _tuple$1 = mux.match(path$1); h = _tuple$1[0]; pattern = _tuple$1[1]; } if ($interfaceIsEqual(h, $ifaceNil)) { _tmp = NotFoundHandler(); _tmp$1 = ""; h = _tmp; pattern = _tmp$1; } $24r = [h, pattern]; $s = 2; case 2: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [h, pattern]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: ServeMux.ptr.prototype.handler }; } $f.$24r = $24r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.h = h; $f.host = host; $f.mux = mux; $f.path$1 = path$1; $f.pattern = pattern; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; ServeMux.prototype.handler = function(host, path$1) { return this.$val.handler(host, path$1); }; ServeMux.ptr.prototype.ServeHTTP = function(w, r) { var _r$1, _r$2, _tuple, h, mux, r, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; h = $f.h; mux = $f.mux; r = $f.r; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: mux = this; /* */ if (r.RequestURI === "*") { $s = 1; continue; } /* */ $s = 2; continue; /* if (r.RequestURI === "*") { */ case 1: /* */ if (r.ProtoAtLeast(1, 1)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (r.ProtoAtLeast(1, 1)) { */ case 3: _r$1 = w.Header(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = new Header(_r$1).Set("Connection", "close"); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: $r = w.WriteHeader(400); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 2: _r$2 = mux.Handler(r); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; h = _tuple[0]; $r = h.ServeHTTP(w, r); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: ServeMux.ptr.prototype.ServeHTTP }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.h = h; $f.mux = mux; $f.r = r; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; ServeMux.prototype.ServeHTTP = function(w, r) { return this.$val.ServeHTTP(w, r); }; ServeMux.ptr.prototype.Handle = function(pattern, handler) { var _entry, _key, _r$1, _tuple, e, exist, handler, mux, pattern, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _key = $f._key; _r$1 = $f._r$1; _tuple = $f._tuple; e = $f.e; exist = $f.exist; handler = $f.handler; mux = $f.mux; pattern = $f.pattern; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); mux = this; $r = mux.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(mux.mu, "Unlock"), []]); if (pattern === "") { $panic(new $String("http: invalid pattern")); } if ($interfaceIsEqual(handler, $ifaceNil)) { $panic(new $String("http: nil handler")); } _tuple = (_entry = mux.m[$String.keyFor(pattern)], _entry !== undefined ? [_entry.v, true] : [new muxEntry.ptr($ifaceNil, ""), false]); exist = _tuple[1]; if (exist) { $panic(new $String("http: multiple registrations for " + pattern)); } if (mux.m === false) { mux.m = {}; } e = new muxEntry.ptr(handler, pattern); _key = pattern; (mux.m || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: $clone(e, muxEntry) }; /* */ if (pattern.charCodeAt((pattern.length - 1 >> 0)) === 47) { $s = 2; continue; } /* */ $s = 3; continue; /* if (pattern.charCodeAt((pattern.length - 1 >> 0)) === 47) { */ case 2: _r$1 = appendSorted(mux.es, $clone(e, muxEntry)); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } mux.es = _r$1; /* } */ case 3: if (!((pattern.charCodeAt(0) === 47))) { mux.hosts = true; } $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: ServeMux.ptr.prototype.Handle }; } $f._entry = _entry; $f._key = _key; $f._r$1 = _r$1; $f._tuple = _tuple; $f.e = e; $f.exist = exist; $f.handler = handler; $f.mux = mux; $f.pattern = pattern; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; ServeMux.prototype.Handle = function(pattern, handler) { return this.$val.Handle(pattern, handler); }; appendSorted = function(es, e) { var _r$1, e, es, i, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; e = $f.e; es = $f.es; i = $f.i; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = [e]; es = [es]; n = es[0].$length; _r$1 = sort.Search(n, (function(e, es) { return function(i) { var i; return ((i < 0 || i >= es[0].$length) ? ($throwRuntimeError("index out of range"), undefined) : es[0].$array[es[0].$offset + i]).pattern.length < e[0].pattern.length; }; })(e, es)); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } i = _r$1; if (i === n) { $s = -1; return $append(es[0], e[0]); } es[0] = $append(es[0], new muxEntry.ptr($ifaceNil, "")); $copySlice($subslice(es[0], (i + 1 >> 0)), $subslice(es[0], i)); muxEntry.copy(((i < 0 || i >= es[0].$length) ? ($throwRuntimeError("index out of range"), undefined) : es[0].$array[es[0].$offset + i]), e[0]); $s = -1; return es[0]; /* */ } return; } if ($f === undefined) { $f = { $blk: appendSorted }; } $f._r$1 = _r$1; $f.e = e; $f.es = es; $f.i = i; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; ServeMux.ptr.prototype.HandleFunc = function(pattern, handler) { var handler, mux, pattern, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; handler = $f.handler; mux = $f.mux; pattern = $f.pattern; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: mux = this; if (handler === $throwNilPointerError) { $panic(new $String("http: nil handler")); } $r = mux.Handle(pattern, new HandlerFunc((handler))); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: ServeMux.ptr.prototype.HandleFunc }; } $f.handler = handler; $f.mux = mux; $f.pattern = pattern; $f.$s = $s; $f.$r = $r; return $f; }; ServeMux.prototype.HandleFunc = function(pattern, handler) { return this.$val.HandleFunc(pattern, handler); }; Server.ptr.prototype.getDoneChan = function() { var $24r, s, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; s = $f.s; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); s = this; $r = s.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(s.mu, "Unlock"), []]); $24r = s.getDoneChanLocked(); $s = 2; case 2: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; return $chanNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Server.ptr.prototype.getDoneChan }; } $f.$24r = $24r; $f.s = s; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Server.prototype.getDoneChan = function() { return this.$val.getDoneChan(); }; Server.ptr.prototype.getDoneChanLocked = function() { var s; s = this; if (s.doneChan === $chanNil) { s.doneChan = new $Chan(structType, 0); } return s.doneChan; }; Server.prototype.getDoneChanLocked = function() { return this.$val.getDoneChanLocked(); }; Server.ptr.prototype.closeDoneChanLocked = function() { var _selection, ch, s; s = this; ch = s.getDoneChanLocked(); _selection = $select([[ch], []]); if (_selection[0] === 0) { } else if (_selection[0] === 1) { $close(ch); } }; Server.prototype.closeDoneChanLocked = function() { return this.$val.closeDoneChanLocked(); }; Server.ptr.prototype.Close = function() { var $24r, _entry, _i, _keys, _r$1, _r$2, _ref, c, err, srv, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _entry = $f._entry; _i = $f._i; _keys = $f._keys; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; c = $f.c; err = $f.err; srv = $f.srv; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); srv = this; (srv.$ptr_inShutdown || (srv.$ptr_inShutdown = new ptrType$51(function() { return this.$target.inShutdown; }, function($v) { this.$target.inShutdown = $v; }, srv))).setTrue(); $r = srv.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(srv.mu, "Unlock"), []]); srv.closeDoneChanLocked(); _r$1 = srv.closeListenersLocked(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err = _r$1; _ref = srv.activeConn; _i = 0; _keys = $keys(_ref); /* while (true) { */ case 3: /* if (!(_i < _keys.length)) { break; } */ if(!(_i < _keys.length)) { $s = 4; continue; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; /* continue; */ $s = 3; continue; } c = _entry.k; _r$2 = c.rwc.Close(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; delete srv.activeConn[ptrType$53.keyFor(c)]; _i++; $s = 3; continue; case 4: $24r = err; $s = 6; case 6: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Server.ptr.prototype.Close }; } $f.$24r = $24r; $f._entry = _entry; $f._i = _i; $f._keys = _keys; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f.c = c; $f.err = err; $f.srv = srv; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Server.prototype.Close = function() { return this.$val.Close(); }; Server.ptr.prototype.Shutdown = function(ctx) { var $24r, $24r$1, _i, _r$1, _r$10, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _selection, _v, ctx, f, lnerr, nextPollInterval, pollIntervalBase, srv, timer, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _i = $f._i; _r$1 = $f._r$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; _selection = $f._selection; _v = $f._v; ctx = $f.ctx; f = $f.f; lnerr = $f.lnerr; nextPollInterval = $f.nextPollInterval; pollIntervalBase = $f.pollIntervalBase; srv = $f.srv; timer = $f.timer; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); pollIntervalBase = [pollIntervalBase]; srv = this; (srv.$ptr_inShutdown || (srv.$ptr_inShutdown = new ptrType$51(function() { return this.$target.inShutdown; }, function($v) { this.$target.inShutdown = $v; }, srv))).setTrue(); $r = srv.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = srv.closeListenersLocked(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } lnerr = _r$1; srv.closeDoneChanLocked(); _ref = srv.onShutdown; _i = 0; /* while (true) { */ case 3: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 4; continue; } f = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); $go(f, []); _i++; $s = 3; continue; case 4: $r = srv.mu.Unlock(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } pollIntervalBase[0] = new time.Duration(0, 1000000); nextPollInterval = (function(pollIntervalBase) { return function $b() { var _r$2, interval, x$5, x$6, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$2 = $f._r$2; interval = $f.interval; x$5 = $f.x$5; x$6 = $f.x$6; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$2 = rand.Intn((((x$6 = $div64(pollIntervalBase[0], new time.Duration(0, 10), false), x$6.$low + ((x$6.$high >> 31) * 4294967296)) >> 0))); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } interval = (x$5 = (new time.Duration(0, _r$2)), new time.Duration(pollIntervalBase[0].$high + x$5.$high, pollIntervalBase[0].$low + x$5.$low)); pollIntervalBase[0] = $mul64(pollIntervalBase[0], (new time.Duration(0, 2))); if ((pollIntervalBase[0].$high > 0 || (pollIntervalBase[0].$high === 0 && pollIntervalBase[0].$low > 500000000))) { pollIntervalBase[0] = new time.Duration(0, 500000000); } $s = -1; return interval; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$2 = _r$2; $f.interval = interval; $f.x$5 = x$5; $f.x$6 = x$6; $f.$s = $s; $f.$r = $r; return $f; }; })(pollIntervalBase); _r$2 = nextPollInterval(); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = time.NewTimer(_r$2); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } timer = _r$3; $deferred.push([$methodVal(timer, "Stop"), []]); /* while (true) { */ case 8: _r$4 = srv.closeIdleConns(); /* */ $s = 13; case 13: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } if (!(_r$4)) { _v = false; $s = 12; continue s; } _r$5 = srv.numListeners(); /* */ $s = 14; case 14: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _v = _r$5 === 0; case 12: /* */ if (_v) { $s = 10; continue; } /* */ $s = 11; continue; /* if (_v) { */ case 10: $24r = lnerr; $s = 15; case 15: return $24r; /* } */ case 11: _r$6 = ctx.Done(); /* */ $s = 16; case 16: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$7 = $select([[_r$6], [timer.C]]); /* */ $s = 17; case 17: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _selection = _r$7; /* */ if (_selection[0] === 0) { $s = 18; continue; } /* */ if (_selection[0] === 1) { $s = 19; continue; } /* */ $s = 20; continue; /* if (_selection[0] === 0) { */ case 18: _r$8 = ctx.Err(); /* */ $s = 21; case 21: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } $24r$1 = _r$8; $s = 22; case 22: return $24r$1; /* } else if (_selection[0] === 1) { */ case 19: _r$9 = nextPollInterval(); /* */ $s = 23; case 23: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$10 = timer.Reset(_r$9); /* */ $s = 24; case 24: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; /* } */ case 20: $s = 8; continue; case 9: $s = -1; return $ifaceNil; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Server.ptr.prototype.Shutdown }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._i = _i; $f._r$1 = _r$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._selection = _selection; $f._v = _v; $f.ctx = ctx; $f.f = f; $f.lnerr = lnerr; $f.nextPollInterval = nextPollInterval; $f.pollIntervalBase = pollIntervalBase; $f.srv = srv; $f.timer = timer; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Server.prototype.Shutdown = function(ctx) { return this.$val.Shutdown(ctx); }; Server.ptr.prototype.RegisterOnShutdown = function(f) { var f, srv, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; f = $f.f; srv = $f.srv; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: srv = this; $r = srv.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } srv.onShutdown = $append(srv.onShutdown, f); $r = srv.mu.Unlock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Server.ptr.prototype.RegisterOnShutdown }; } $f.f = f; $f.srv = srv; $f.$s = $s; $f.$r = $r; return $f; }; Server.prototype.RegisterOnShutdown = function(f) { return this.$val.RegisterOnShutdown(f); }; Server.ptr.prototype.numListeners = function() { var $24r, s, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; s = $f.s; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); s = this; $r = s.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(s.mu, "Unlock"), []]); $24r = $keys(s.listeners).length; $s = 2; case 2: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; return 0; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Server.ptr.prototype.numListeners }; } $f.$24r = $24r; $f.s = s; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Server.prototype.numListeners = function() { return this.$val.numListeners(); }; Server.ptr.prototype.closeIdleConns = function() { var $24r, _entry, _i, _keys, _r$1, _r$2, _r$3, _ref, _tuple, _v, c, quiescent, s, st, unixSec, x$5, x$6, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _entry = $f._entry; _i = $f._i; _keys = $f._keys; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; _tuple = $f._tuple; _v = $f._v; c = $f.c; quiescent = $f.quiescent; s = $f.s; st = $f.st; unixSec = $f.unixSec; x$5 = $f.x$5; x$6 = $f.x$6; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); s = this; $r = s.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(s.mu, "Unlock"), []]); quiescent = true; _ref = s.activeConn; _i = 0; _keys = $keys(_ref); /* while (true) { */ case 2: /* if (!(_i < _keys.length)) { break; } */ if(!(_i < _keys.length)) { $s = 3; continue; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; /* continue; */ $s = 2; continue; } c = _entry.k; _tuple = c.getState(); st = _tuple[0]; unixSec = _tuple[1]; if (!(st === 0)) { _v = false; $s = 6; continue s; } _r$1 = time.Now(); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = $clone(_r$1, time.Time).Unix(); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _v = (x$5 = (x$6 = _r$2, new $Int64(x$6.$high - 0, x$6.$low - 5)), (unixSec.$high < x$5.$high || (unixSec.$high === x$5.$high && unixSec.$low < x$5.$low))); case 6: /* */ if (_v) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_v) { */ case 4: st = 2; /* } */ case 5: if (!((st === 2)) || (unixSec.$high === 0 && unixSec.$low === 0)) { quiescent = false; _i++; /* continue; */ $s = 2; continue; } _r$3 = c.rwc.Close(); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; delete s.activeConn[ptrType$53.keyFor(c)]; _i++; $s = 2; continue; case 3: $24r = quiescent; $s = 10; case 10: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; return false; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Server.ptr.prototype.closeIdleConns }; } $f.$24r = $24r; $f._entry = _entry; $f._i = _i; $f._keys = _keys; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._ref = _ref; $f._tuple = _tuple; $f._v = _v; $f.c = c; $f.quiescent = quiescent; $f.s = s; $f.st = st; $f.unixSec = unixSec; $f.x$5 = x$5; $f.x$6 = x$6; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Server.prototype.closeIdleConns = function() { return this.$val.closeIdleConns(); }; Server.ptr.prototype.closeListenersLocked = function() { var _entry, _i, _keys, _r$1, _ref, cerr, err, ln, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _i = $f._i; _keys = $f._keys; _r$1 = $f._r$1; _ref = $f._ref; cerr = $f.cerr; err = $f.err; ln = $f.ln; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; err = $ifaceNil; _ref = s.listeners; _i = 0; _keys = $keys(_ref); /* while (true) { */ case 1: /* if (!(_i < _keys.length)) { break; } */ if(!(_i < _keys.length)) { $s = 2; continue; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; /* continue; */ $s = 1; continue; } ln = _entry.k; _r$1 = (ln.$get()).Close(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } cerr = _r$1; if (!($interfaceIsEqual(cerr, $ifaceNil)) && $interfaceIsEqual(err, $ifaceNil)) { err = cerr; } _i++; $s = 1; continue; case 2: $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: Server.ptr.prototype.closeListenersLocked }; } $f._entry = _entry; $f._i = _i; $f._keys = _keys; $f._r$1 = _r$1; $f._ref = _ref; $f.cerr = cerr; $f.err = err; $f.ln = ln; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; Server.prototype.closeListenersLocked = function() { return this.$val.closeListenersLocked(); }; ConnState.prototype.String = function() { var _entry, c; c = this.$val; return (_entry = stateName[ConnState.keyFor(c)], _entry !== undefined ? _entry.v : ""); }; $ptrType(ConnState).prototype.String = function() { return new ConnState(this.$get()).String(); }; serverHandler.ptr.prototype.ServeHTTP = function(rw, req) { var _r$1, _r$2, allowQuerySemicolonsInUse, handler, req, rw, sh, x$5, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; allowQuerySemicolonsInUse = $f.allowQuerySemicolonsInUse; handler = $f.handler; req = $f.req; rw = $f.rw; sh = $f.sh; x$5 = $f.x$5; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); allowQuerySemicolonsInUse = [allowQuerySemicolonsInUse]; sh = [sh]; sh[0] = this; handler = sh[0].srv.Handler; if ($interfaceIsEqual(handler, $ifaceNil)) { handler = $pkg.DefaultServeMux; } if (req.RequestURI === "*" && req.Method === "OPTIONS") { handler = (x$5 = new globalOptionsHandler.ptr(), new x$5.constructor.elem(x$5)); } /* */ if (!(req.URL === ptrType$17.nil) && strings.Contains(req.URL.RawQuery, ";")) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(req.URL === ptrType$17.nil) && strings.Contains(req.URL.RawQuery, ";")) { */ case 1: allowQuerySemicolonsInUse[0] = 0; _r$1 = context.WithValue(req.Context(), silenceSemWarnContextKey, new funcType((function(allowQuerySemicolonsInUse, sh) { return function() { atomic.StoreInt32((allowQuerySemicolonsInUse.$ptr || (allowQuerySemicolonsInUse.$ptr = new ptrType$45(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, allowQuerySemicolonsInUse))), 1); }; })(allowQuerySemicolonsInUse, sh))); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = req.WithContext(_r$1); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } req = _r$2; $deferred.push([(function(allowQuerySemicolonsInUse, sh) { return function $b() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (atomic.LoadInt32((allowQuerySemicolonsInUse.$ptr || (allowQuerySemicolonsInUse.$ptr = new ptrType$45(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, allowQuerySemicolonsInUse)))) === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (atomic.LoadInt32((allowQuerySemicolonsInUse.$ptr || (allowQuerySemicolonsInUse.$ptr = new ptrType$45(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, allowQuerySemicolonsInUse)))) === 0) { */ case 1: $r = sh[0].srv.logf("http: URL query contains semicolon, which is no longer a supported separator; parts of the query may be stripped when parsed; see golang.org/issue/25192", new sliceType([])); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$s = $s; $f.$r = $r; return $f; }; })(allowQuerySemicolonsInUse, sh), []]); /* } */ case 2: $r = handler.ServeHTTP(rw, req); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: serverHandler.ptr.prototype.ServeHTTP }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f.allowQuerySemicolonsInUse = allowQuerySemicolonsInUse; $f.handler = handler; $f.req = req; $f.rw = rw; $f.sh = sh; $f.x$5 = x$5; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; serverHandler.prototype.ServeHTTP = function(rw, req) { return this.$val.ServeHTTP(rw, req); }; Server.ptr.prototype.ListenAndServe = function() { var $24r, _r$1, _tuple, addr, err, ln, srv, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _tuple = $f._tuple; addr = $f.addr; err = $f.err; ln = $f.ln; srv = $f.srv; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: srv = this; if (srv.shuttingDown()) { $s = -1; return $pkg.ErrServerClosed; } addr = srv.Addr; if (addr === "") { addr = ":http"; } _tuple = net.Listen("tcp", addr); ln = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _r$1 = srv.Serve(ln); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Server.ptr.prototype.ListenAndServe }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.addr = addr; $f.err = err; $f.ln = ln; $f.srv = srv; $f.$s = $s; $f.$r = $r; return $f; }; Server.prototype.ListenAndServe = function() { return this.$val.ListenAndServe(); }; Server.ptr.prototype.shouldConfigureHTTP2ForServe = function() { var srv; srv = this; if (srv.TLSConfig === ptrType$4.nil) { return true; } return strSliceContains(srv.TLSConfig.NextProtos, "h2"); }; Server.prototype.shouldConfigureHTTP2ForServe = function() { return this.$val.shouldConfigureHTTP2ForServe(); }; Server.ptr.prototype.Serve = function(l) { var $24r, $24r$1, $24r$2, $24r$3, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _selection, _tuple, _tuple$1, _v, baseCtx, c, cc, connCtx, ctx, err, err$1, fn, l, max, ne, ok, origListener, rw, srv, tempDelay, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$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; _r$8 = $f._r$8; _r$9 = $f._r$9; _selection = $f._selection; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _v = $f._v; baseCtx = $f.baseCtx; c = $f.c; cc = $f.cc; connCtx = $f.connCtx; ctx = $f.ctx; err = $f.err; err$1 = $f.err$1; fn = $f.fn; l = $f.l; max = $f.max; ne = $f.ne; ok = $f.ok; origListener = $f.origListener; rw = $f.rw; srv = $f.srv; tempDelay = $f.tempDelay; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); l = [l]; srv = this; fn = testHookServerServe; /* */ if (!(fn === $throwNilPointerError)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(fn === $throwNilPointerError)) { */ case 1: $r = fn(srv, l[0]); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: origListener = l[0]; l[0] = new onceCloseListener.ptr(l[0], new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)), $ifaceNil); $deferred.push([$methodVal(l[0], "Close"), []]); _r$1 = srv.setupHTTP2_Serve(); /* */ $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; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 5: $24r = err; $s = 7; case 7: return $24r; /* } */ case 6: _r$2 = srv.trackListener((l.$ptr || (l.$ptr = new ptrType$59(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, l))), true); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } /* */ if (!_r$2) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!_r$2) { */ case 8: $24r$1 = $pkg.ErrServerClosed; $s = 11; case 11: return $24r$1; /* } */ case 9: $deferred.push([$methodVal(srv, "trackListener"), [(l.$ptr || (l.$ptr = new ptrType$59(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, l))), false]]); baseCtx = context.Background(); /* */ if (!(srv.BaseContext === $throwNilPointerError)) { $s = 12; continue; } /* */ $s = 13; continue; /* if (!(srv.BaseContext === $throwNilPointerError)) { */ case 12: _r$3 = srv.BaseContext(origListener); /* */ $s = 14; case 14: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } baseCtx = _r$3; if ($interfaceIsEqual(baseCtx, $ifaceNil)) { $panic(new $String("BaseContext returned a nil context")); } /* } */ case 13: tempDelay = new time.Duration(0, 0); _r$4 = context.WithValue(baseCtx, $pkg.ServerContextKey, srv); /* */ $s = 15; case 15: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } ctx = _r$4; /* while (true) { */ case 16: _r$5 = l[0].Accept(); /* */ $s = 18; case 18: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple = _r$5; rw = _tuple[0]; err$1 = _tuple[1]; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 19; continue; } /* */ $s = 20; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 19: _r$6 = srv.getDoneChan(); /* */ $s = 21; case 21: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _selection = $select([[_r$6], []]); /* */ if (_selection[0] === 0) { $s = 22; continue; } /* */ if (_selection[0] === 1) { $s = 23; continue; } /* */ $s = 24; continue; /* if (_selection[0] === 0) { */ case 22: $24r$2 = $pkg.ErrServerClosed; $s = 25; case 25: return $24r$2; /* } else if (_selection[0] === 1) { */ case 23: /* } */ case 24: _tuple$1 = $assertType(err$1, net.Error, true); ne = _tuple$1[0]; ok = _tuple$1[1]; if (!(ok)) { _v = false; $s = 28; continue s; } _r$7 = ne.Temporary(); /* */ $s = 29; case 29: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _v = _r$7; case 28: /* */ if (_v) { $s = 26; continue; } /* */ $s = 27; continue; /* if (_v) { */ case 26: if ((tempDelay.$high === 0 && tempDelay.$low === 0)) { tempDelay = new time.Duration(0, 5000000); } else { tempDelay = $mul64(tempDelay, (new time.Duration(0, 2))); } max = new time.Duration(0, 1000000000); if ((tempDelay.$high > max.$high || (tempDelay.$high === max.$high && tempDelay.$low > max.$low))) { tempDelay = max; } $r = srv.logf("http: Accept error: %v; retrying in %v", new sliceType([err$1, tempDelay])); /* */ $s = 30; case 30: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = time.Sleep(tempDelay); /* */ $s = 31; case 31: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* continue; */ $s = 16; continue; /* } */ case 27: $24r$3 = err$1; $s = 32; case 32: return $24r$3; /* } */ case 20: connCtx = ctx; cc = srv.ConnContext; /* */ if (!(cc === $throwNilPointerError)) { $s = 33; continue; } /* */ $s = 34; continue; /* if (!(cc === $throwNilPointerError)) { */ case 33: _r$8 = cc(connCtx, rw); /* */ $s = 35; case 35: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } connCtx = _r$8; if ($interfaceIsEqual(connCtx, $ifaceNil)) { $panic(new $String("ConnContext returned nil")); } /* } */ case 34: tempDelay = new time.Duration(0, 0); _r$9 = srv.newConn(rw); /* */ $s = 36; case 36: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } c = _r$9; $r = c.setState(c.rwc, 0, true); /* */ $s = 37; case 37: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $go($methodVal(c, "serve"), [connCtx]); $s = 16; continue; case 17: $s = -1; return $ifaceNil; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Server.ptr.prototype.Serve }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$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._r$8 = _r$8; $f._r$9 = _r$9; $f._selection = _selection; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._v = _v; $f.baseCtx = baseCtx; $f.c = c; $f.cc = cc; $f.connCtx = connCtx; $f.ctx = ctx; $f.err = err; $f.err$1 = err$1; $f.fn = fn; $f.l = l; $f.max = max; $f.ne = ne; $f.ok = ok; $f.origListener = origListener; $f.rw = rw; $f.srv = srv; $f.tempDelay = tempDelay; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Server.prototype.Serve = function(l) { return this.$val.Serve(l); }; Server.ptr.prototype.ServeTLS = function(l, certFile, keyFile) { var $24r, _r$1, _r$2, _r$3, _r$4, _tuple, certFile, config, configHasCert, err, err$1, keyFile, l, srv, tlsListener, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; certFile = $f.certFile; config = $f.config; configHasCert = $f.configHasCert; err = $f.err; err$1 = $f.err$1; keyFile = $f.keyFile; l = $f.l; srv = $f.srv; tlsListener = $f.tlsListener; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: srv = this; _r$1 = srv.setupHTTP2_ServeTLS(); /* */ $s = 1; case 1: 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))) { $s = -1; return err; } _r$2 = cloneTLSConfig(srv.TLSConfig); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } config = _r$2; if (!strSliceContains(config.NextProtos, "http/1.1")) { config.NextProtos = $append(config.NextProtos, "http/1.1"); } configHasCert = config.Certificates.$length > 0 || !(config.GetCertificate === $throwNilPointerError); /* */ if (!configHasCert || !(certFile === "") || !(keyFile === "")) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!configHasCert || !(certFile === "") || !(keyFile === "")) { */ case 3: err$1 = $ifaceNil; config.Certificates = $makeSlice(sliceType$13, 1); _r$3 = tls.LoadX509KeyPair(certFile, keyFile); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; tls.Certificate.copy((x$5 = config.Certificates, (0 >= x$5.$length ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + 0])), _tuple[0]); err$1 = _tuple[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } /* } */ case 4: tlsListener = tls.NewListener(l, config); _r$4 = srv.Serve(tlsListener); /* */ $s = 6; case 6: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r = _r$4; $s = 7; case 7: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Server.ptr.prototype.ServeTLS }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f.certFile = certFile; $f.config = config; $f.configHasCert = configHasCert; $f.err = err; $f.err$1 = err$1; $f.keyFile = keyFile; $f.l = l; $f.srv = srv; $f.tlsListener = tlsListener; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; Server.prototype.ServeTLS = function(l, certFile, keyFile) { return this.$val.ServeTLS(l, certFile, keyFile); }; Server.ptr.prototype.trackListener = function(ln, add) { var $24r, $24r$1, _key, add, ln, s, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _key = $f._key; add = $f.add; ln = $f.ln; s = $f.s; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); s = this; $r = s.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(s.mu, "Unlock"), []]); if (s.listeners === false) { s.listeners = {}; } /* */ if (add) { $s = 2; continue; } /* */ $s = 3; continue; /* if (add) { */ case 2: /* */ if (s.shuttingDown()) { $s = 5; continue; } /* */ $s = 6; continue; /* if (s.shuttingDown()) { */ case 5: $24r = false; $s = 7; case 7: return $24r; /* } */ case 6: _key = ln; (s.listeners || $throwRuntimeError("assignment to entry in nil map"))[ptrType$59.keyFor(_key)] = { k: _key, v: new structType.ptr() }; $s = 4; continue; /* } else { */ case 3: delete s.listeners[ptrType$59.keyFor(ln)]; /* } */ case 4: $24r$1 = true; $s = 8; case 8: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return false; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Server.ptr.prototype.trackListener }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._key = _key; $f.add = add; $f.ln = ln; $f.s = s; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Server.prototype.trackListener = function(ln, add) { return this.$val.trackListener(ln, add); }; Server.ptr.prototype.trackConn = function(c, add) { var _key, add, c, s, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _key = $f._key; add = $f.add; c = $f.c; s = $f.s; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); s = this; $r = s.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(s.mu, "Unlock"), []]); if (s.activeConn === false) { s.activeConn = {}; } if (add) { _key = c; (s.activeConn || $throwRuntimeError("assignment to entry in nil map"))[ptrType$53.keyFor(_key)] = { k: _key, v: new structType.ptr() }; } else { delete s.activeConn[ptrType$53.keyFor(c)]; } $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Server.ptr.prototype.trackConn }; } $f._key = _key; $f.add = add; $f.c = c; $f.s = s; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Server.prototype.trackConn = function(c, add) { return this.$val.trackConn(c, add); }; Server.ptr.prototype.idleTimeout = function() { var s, x$5; s = this; if (!((x$5 = s.IdleTimeout, (x$5.$high === 0 && x$5.$low === 0)))) { return s.IdleTimeout; } return s.ReadTimeout; }; Server.prototype.idleTimeout = function() { return this.$val.idleTimeout(); }; Server.ptr.prototype.readHeaderTimeout = function() { var s, x$5; s = this; if (!((x$5 = s.ReadHeaderTimeout, (x$5.$high === 0 && x$5.$low === 0)))) { return s.ReadHeaderTimeout; } return s.ReadTimeout; }; Server.prototype.readHeaderTimeout = function() { return this.$val.readHeaderTimeout(); }; Server.ptr.prototype.doKeepAlives = function() { var s; s = this; return (atomic.LoadInt32((s.$ptr_disableKeepAlives || (s.$ptr_disableKeepAlives = new ptrType$45(function() { return this.$target.disableKeepAlives; }, function($v) { this.$target.disableKeepAlives = $v; }, s)))) === 0) && !s.shuttingDown(); }; Server.prototype.doKeepAlives = function() { return this.$val.doKeepAlives(); }; Server.ptr.prototype.shuttingDown = function() { var s; s = this; return (s.$ptr_inShutdown || (s.$ptr_inShutdown = new ptrType$51(function() { return this.$target.inShutdown; }, function($v) { this.$target.inShutdown = $v; }, s))).isSet(); }; Server.prototype.shuttingDown = function() { return this.$val.shuttingDown(); }; Server.ptr.prototype.SetKeepAlivesEnabled = function(v) { var _r$1, srv, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; srv = $f.srv; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: srv = this; if (v) { atomic.StoreInt32((srv.$ptr_disableKeepAlives || (srv.$ptr_disableKeepAlives = new ptrType$45(function() { return this.$target.disableKeepAlives; }, function($v) { this.$target.disableKeepAlives = $v; }, srv))), 0); $s = -1; return; } atomic.StoreInt32((srv.$ptr_disableKeepAlives || (srv.$ptr_disableKeepAlives = new ptrType$45(function() { return this.$target.disableKeepAlives; }, function($v) { this.$target.disableKeepAlives = $v; }, srv))), 1); _r$1 = srv.closeIdleConns(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Server.ptr.prototype.SetKeepAlivesEnabled }; } $f._r$1 = _r$1; $f.srv = srv; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Server.prototype.SetKeepAlivesEnabled = function(v) { return this.$val.SetKeepAlivesEnabled(v); }; Server.ptr.prototype.logf = function(format, args) { var args, format, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; args = $f.args; format = $f.format; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; /* */ if (!(s.ErrorLog === ptrType$58.nil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(s.ErrorLog === ptrType$58.nil)) { */ case 1: $r = s.ErrorLog.Printf(format, args); /* */ $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 = log.Printf(format, args); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Server.ptr.prototype.logf }; } $f.args = args; $f.format = format; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; Server.prototype.logf = function(format, args) { return this.$val.logf(format, args); }; Server.ptr.prototype.ListenAndServeTLS = function(certFile, keyFile) { var $24r, $24r$1, $24r$2, _r$1, _tuple, addr, certFile, err, keyFile, ln, srv, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _r$1 = $f._r$1; _tuple = $f._tuple; addr = $f.addr; certFile = $f.certFile; err = $f.err; keyFile = $f.keyFile; ln = $f.ln; srv = $f.srv; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); srv = this; /* */ if (srv.shuttingDown()) { $s = 1; continue; } /* */ $s = 2; continue; /* if (srv.shuttingDown()) { */ case 1: $24r = $pkg.ErrServerClosed; $s = 3; case 3: return $24r; /* } */ case 2: addr = srv.Addr; if (addr === "") { addr = ":https"; } _tuple = net.Listen("tcp", addr); ln = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 4: $24r$1 = err; $s = 6; case 6: return $24r$1; /* } */ case 5: $deferred.push([$methodVal(ln, "Close"), []]); _r$1 = srv.ServeTLS(ln, certFile, keyFile); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r$2 = _r$1; $s = 8; case 8: return $24r$2; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Server.ptr.prototype.ListenAndServeTLS }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._r$1 = _r$1; $f._tuple = _tuple; $f.addr = addr; $f.certFile = certFile; $f.err = err; $f.keyFile = keyFile; $f.ln = ln; $f.srv = srv; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Server.prototype.ListenAndServeTLS = function(certFile, keyFile) { return this.$val.ListenAndServeTLS(certFile, keyFile); }; Server.ptr.prototype.setupHTTP2_ServeTLS = function() { var srv, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; srv = $f.srv; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: srv = this; $r = srv.nextProtoOnce.Do($methodVal(srv, "onceSetNextProtoDefaults")); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return srv.nextProtoErr; /* */ } return; } if ($f === undefined) { $f = { $blk: Server.ptr.prototype.setupHTTP2_ServeTLS }; } $f.srv = srv; $f.$s = $s; $f.$r = $r; return $f; }; Server.prototype.setupHTTP2_ServeTLS = function() { return this.$val.setupHTTP2_ServeTLS(); }; Server.ptr.prototype.setupHTTP2_Serve = function() { var srv, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; srv = $f.srv; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: srv = this; $r = srv.nextProtoOnce.Do($methodVal(srv, "onceSetNextProtoDefaults_Serve")); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return srv.nextProtoErr; /* */ } return; } if ($f === undefined) { $f = { $blk: Server.ptr.prototype.setupHTTP2_Serve }; } $f.srv = srv; $f.$s = $s; $f.$r = $r; return $f; }; Server.prototype.setupHTTP2_Serve = function() { return this.$val.setupHTTP2_Serve(); }; Server.ptr.prototype.onceSetNextProtoDefaults_Serve = function() { var srv, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; srv = $f.srv; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: srv = this; /* */ if (srv.shouldConfigureHTTP2ForServe()) { $s = 1; continue; } /* */ $s = 2; continue; /* if (srv.shouldConfigureHTTP2ForServe()) { */ case 1: $r = srv.onceSetNextProtoDefaults(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Server.ptr.prototype.onceSetNextProtoDefaults_Serve }; } $f.srv = srv; $f.$s = $s; $f.$r = $r; return $f; }; Server.prototype.onceSetNextProtoDefaults_Serve = function() { return this.$val.onceSetNextProtoDefaults_Serve(); }; Server.ptr.prototype.onceSetNextProtoDefaults = function() { var _r$1, _r$2, _r$3, _v, conf, srv, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _v = $f._v; conf = $f.conf; srv = $f.srv; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: srv = this; if (omitBundledHTTP2) { _v = true; $s = 3; continue s; } _r$1 = os.Getenv("GODEBUG"); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = strings.Contains(_r$1, "http2server=0"); /* */ $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 3: /* */ if (_v) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v) { */ case 1: $s = -1; return; /* } */ case 2: /* */ if (srv.TLSNextProto === false) { $s = 6; continue; } /* */ $s = 7; continue; /* if (srv.TLSNextProto === false) { */ case 6: conf = new http2Server.ptr(0, 0, 0, false, new time.Duration(0, 0), 0, 0, (function() { return http2NewPriorityWriteScheduler(ptrType$61.nil); }), ptrType$60.nil); _r$3 = http2ConfigureServer(srv, conf); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } srv.nextProtoErr = _r$3; /* } */ case 7: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Server.ptr.prototype.onceSetNextProtoDefaults }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._v = _v; $f.conf = conf; $f.srv = srv; $f.$s = $s; $f.$r = $r; return $f; }; Server.prototype.onceSetNextProtoDefaults = function() { return this.$val.onceSetNextProtoDefaults(); }; onceCloseListener.ptr.prototype.Close = function() { var oc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; oc = $f.oc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: oc = this; $r = oc.once.Do($methodVal(oc, "close")); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return oc.closeErr; /* */ } return; } if ($f === undefined) { $f = { $blk: onceCloseListener.ptr.prototype.Close }; } $f.oc = oc; $f.$s = $s; $f.$r = $r; return $f; }; onceCloseListener.prototype.Close = function() { return this.$val.Close(); }; onceCloseListener.ptr.prototype.close = function() { var _r$1, oc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; oc = $f.oc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: oc = this; _r$1 = oc.Listener.Close(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } oc.closeErr = _r$1; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: onceCloseListener.ptr.prototype.close }; } $f._r$1 = _r$1; $f.oc = oc; $f.$s = $s; $f.$r = $r; return $f; }; onceCloseListener.prototype.close = function() { return this.$val.close(); }; globalOptionsHandler.ptr.prototype.ServeHTTP = function(w, r) { var _r$1, _r$2, mb, r, w, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; mb = $f.mb; r = $f.r; w = $f.w; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = w.Header(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = new Header(_r$1).Set("Content-Length", "0"); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!((x$5 = r.ContentLength, (x$5.$high === 0 && x$5.$low === 0)))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!((x$5 = r.ContentLength, (x$5.$high === 0 && x$5.$low === 0)))) { */ case 3: mb = MaxBytesReader(w, r.Body, new $Int64(0, 4096)); _r$2 = io.Copy(io.Discard, mb); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; /* } */ case 4: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: globalOptionsHandler.ptr.prototype.ServeHTTP }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f.mb = mb; $f.r = r; $f.w = w; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; globalOptionsHandler.prototype.ServeHTTP = function(w, r) { return this.$val.ServeHTTP(w, r); }; initALPNRequest.ptr.prototype.BaseContext = function() { var h; h = this; return h.ctx; }; initALPNRequest.prototype.BaseContext = function() { return this.$val.BaseContext(); }; initALPNRequest.ptr.prototype.ServeHTTP = function(rw, req) { var _r$1, _r$2, _r$3, h, req, rw, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; h = $f.h; req = $f.req; rw = $f.rw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: h = this; /* */ if (req.TLS === ptrType$28.nil) { $s = 1; continue; } /* */ $s = 2; continue; /* if (req.TLS === ptrType$28.nil) { */ case 1: req.TLS = new tls.ConnectionState.ptr(0, false, false, 0, "", false, "", sliceType$10.nil, sliceType$11.nil, sliceType$5.nil, sliceType$3.nil, sliceType$3.nil, $throwNilPointerError); _r$1 = h.c.ConnectionState(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } tls.ConnectionState.copy(req.TLS, _r$1); /* } */ case 2: if ($interfaceIsEqual(req.Body, $ifaceNil)) { req.Body = new $pkg.NoBody.constructor.elem($pkg.NoBody); } /* */ if (req.RemoteAddr === "") { $s = 4; continue; } /* */ $s = 5; continue; /* if (req.RemoteAddr === "") { */ case 4: _r$2 = h.c.RemoteAddr(); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = _r$2.String(); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } req.RemoteAddr = _r$3; /* } */ case 5: $r = $clone(h.h, serverHandler).ServeHTTP(rw, req); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: initALPNRequest.ptr.prototype.ServeHTTP }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.h = h; $f.req = req; $f.rw = rw; $f.$s = $s; $f.$r = $r; return $f; }; initALPNRequest.prototype.ServeHTTP = function(rw, req) { return this.$val.ServeHTTP(rw, req); }; newLoggingConn = function(baseName, c) { var $24r, _entry, _entry$1, _key, _r$1, baseName, c, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _entry = $f._entry; _entry$1 = $f._entry$1; _key = $f._key; _r$1 = $f._r$1; baseName = $f.baseName; c = $f.c; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); $r = uniqNameMu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(uniqNameMu, "Unlock"), []]); _key = baseName; (uniqNameNext || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: (_entry = uniqNameNext[$String.keyFor(baseName)], _entry !== undefined ? _entry.v : 0) + (1) >> 0 }; _r$1 = fmt.Sprintf("%s-%d", new sliceType([new $String(baseName), new $Int((_entry$1 = uniqNameNext[$String.keyFor(baseName)], _entry$1 !== undefined ? _entry$1.v : 0))])); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = new loggingConn.ptr(_r$1, c); $s = 3; case 3: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: newLoggingConn }; } $f.$24r = $24r; $f._entry = _entry; $f._entry$1 = _entry$1; $f._key = _key; $f._r$1 = _r$1; $f.baseName = baseName; $f.c = c; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; loggingConn.ptr.prototype.Write = function(p) { var _r$1, _tuple, c, err, n, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; c = $f.c; err = $f.err; n = $f.n; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; c = this; $r = log.Printf("%s.Write(%d) = ....", new sliceType([new $String(c.name), new $Int(p.$length)])); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = c.Conn.Write(p); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err = _tuple[1]; $r = log.Printf("%s.Write(%d) = %d, %v", new sliceType([new $String(c.name), new $Int(p.$length), new $Int(n), err])); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: loggingConn.ptr.prototype.Write }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.c = c; $f.err = err; $f.n = n; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; loggingConn.prototype.Write = function(p) { return this.$val.Write(p); }; loggingConn.ptr.prototype.Read = function(p) { var _r$1, _tuple, c, err, n, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; c = $f.c; err = $f.err; n = $f.n; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; c = this; $r = log.Printf("%s.Read(%d) = ....", new sliceType([new $String(c.name), new $Int(p.$length)])); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = c.Conn.Read(p); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err = _tuple[1]; $r = log.Printf("%s.Read(%d) = %d, %v", new sliceType([new $String(c.name), new $Int(p.$length), new $Int(n), err])); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: loggingConn.ptr.prototype.Read }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.c = c; $f.err = err; $f.n = n; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; loggingConn.prototype.Read = function(p) { return this.$val.Read(p); }; loggingConn.ptr.prototype.Close = function() { var _r$1, c, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; c = $f.c; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; c = this; $r = log.Printf("%s.Close() = ...", new sliceType([new $String(c.name)])); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = c.Conn.Close(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err = _r$1; $r = log.Printf("%s.Close() = %v", new sliceType([new $String(c.name), err])); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: loggingConn.ptr.prototype.Close }; } $f._r$1 = _r$1; $f.c = c; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; loggingConn.prototype.Close = function() { return this.$val.Close(); }; checkConnErrorWriter.ptr.prototype.Write = function(p) { var _r$1, _tuple, err, n, p, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; n = $f.n; p = $f.p; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; w = this; _r$1 = w.c.rwc.Write(p); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil)) && $interfaceIsEqual(w.c.werr, $ifaceNil)) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil)) && $interfaceIsEqual(w.c.werr, $ifaceNil)) { */ case 2: w.c.werr = err; $r = w.c.cancelCtx(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: checkConnErrorWriter.ptr.prototype.Write }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.n = n; $f.p = p; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; checkConnErrorWriter.prototype.Write = function(p) { return this.$val.Write(p); }; numLeadingCRorLF = function(v) { var _i, _ref, b, n, v; n = 0; _ref = v; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } b = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if ((b === 13) || (b === 10)) { n = n + (1) >> 0; _i++; continue; } break; } return n; }; strSliceContains = function(ss, s) { var _i, _ref, s, ss, v; _ref = ss; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (v === s) { return true; } _i++; } return false; }; tlsRecordHeaderLooksLikeHTTP = function(hdr) { var _1, hdr; _1 = ($bytesToString(new sliceType$3(hdr))); if (_1 === ("GET /") || _1 === ("HEAD ") || _1 === ("POST ") || _1 === ("PUT /") || _1 === ("OPTIO")) { return true; } return false; }; Transport.ptr.prototype.RoundTrip = function(req) { var $24r, _r$1, req, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; req = $f.req; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r$1 = t.roundTrip(req); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Transport.ptr.prototype.RoundTrip }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.req = req; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Transport.prototype.RoundTrip = function(req) { return this.$val.RoundTrip(req); }; Response.ptr.prototype.Cookies = function() { var $24r, _r$1, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r$1 = readSetCookies(r.Header); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Response.ptr.prototype.Cookies }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Response.prototype.Cookies = function() { return this.$val.Cookies(); }; Response.ptr.prototype.Location = function() { var $24r, $24r$1, _r$1, _r$2, _r$3, lv, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; lv = $f.lv; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r$1 = new Header(r.Header).Get("Location"); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } lv = _r$1; if (lv === "") { $s = -1; return [ptrType$17.nil, $pkg.ErrNoLocation]; } /* */ if (!(r.Request === ptrType$11.nil) && !(r.Request.URL === ptrType$17.nil)) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!(r.Request === ptrType$11.nil) && !(r.Request.URL === ptrType$17.nil)) { */ case 2: _r$2 = r.Request.URL.Parse(lv); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 5; case 5: return $24r; /* } */ case 3: _r$3 = url.Parse(lv); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r$1 = _r$3; $s = 7; case 7: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: Response.ptr.prototype.Location }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.lv = lv; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Response.prototype.Location = function() { return this.$val.Location(); }; ReadResponse = function(r, req) { var $24r, $24r$1, $24r$2, $24r$3, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, _tuple$2, _tuple$3, err, i, i$1, line, mimeHeader, ok, r, req, resp, statusCode, tp, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$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; _r$8 = $f._r$8; _r$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; err = $f.err; i = $f.i; i$1 = $f.i$1; line = $f.line; mimeHeader = $f.mimeHeader; ok = $f.ok; r = $f.r; req = $f.req; resp = $f.resp; statusCode = $f.statusCode; tp = $f.tp; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = textproto.NewReader(r); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } tp = _r$1; resp = new Response.ptr("", 0, "", 0, 0, false, $ifaceNil, new $Int64(0, 0), sliceType$2.nil, false, false, false, req, ptrType$28.nil); _r$2 = tp.ReadLine(); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; line = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { if ($interfaceIsEqual(err, io.EOF)) { err = io.ErrUnexpectedEOF; } $s = -1; return [ptrType$18.nil, err]; } i = strings.IndexByte(line, 32); /* */ if (i === -1) { $s = 3; continue; } /* */ $s = 4; continue; /* if (i === -1) { */ case 3: _r$3 = badStringError("malformed HTTP response", line); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = [ptrType$18.nil, _r$3]; $s = 7; case 7: return $24r; /* } else { */ case 4: resp.Proto = $substring(line, 0, i); _r$4 = strings.TrimLeft($substring(line, (i + 1 >> 0)), " "); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } resp.Status = _r$4; /* } */ case 5: statusCode = resp.Status; i$1 = strings.IndexByte(resp.Status, 32); if (!((i$1 === -1))) { statusCode = $substring(resp.Status, 0, i$1); } /* */ if (!((statusCode.length === 3))) { $s = 9; continue; } /* */ $s = 10; continue; /* if (!((statusCode.length === 3))) { */ case 9: _r$5 = badStringError("malformed HTTP status code", statusCode); /* */ $s = 11; case 11: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $24r$1 = [ptrType$18.nil, _r$5]; $s = 12; case 12: return $24r$1; /* } */ case 10: _tuple$1 = strconv.Atoi(statusCode); resp.StatusCode = _tuple$1[0]; err = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil)) || resp.StatusCode < 0) { $s = 13; continue; } /* */ $s = 14; continue; /* if (!($interfaceIsEqual(err, $ifaceNil)) || resp.StatusCode < 0) { */ case 13: _r$6 = badStringError("malformed HTTP status code", statusCode); /* */ $s = 15; case 15: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } $24r$2 = [ptrType$18.nil, _r$6]; $s = 16; case 16: return $24r$2; /* } */ case 14: ok = false; _tuple$2 = ParseHTTPVersion(resp.Proto); resp.ProtoMajor = _tuple$2[0]; resp.ProtoMinor = _tuple$2[1]; ok = _tuple$2[2]; /* */ if (!ok) { $s = 17; continue; } /* */ $s = 18; continue; /* if (!ok) { */ case 17: _r$7 = badStringError("malformed HTTP version", resp.Proto); /* */ $s = 19; case 19: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } $24r$3 = [ptrType$18.nil, _r$7]; $s = 20; case 20: return $24r$3; /* } */ case 18: _r$8 = tp.ReadMIMEHeader(); /* */ $s = 21; case 21: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _tuple$3 = _r$8; mimeHeader = _tuple$3[0]; err = _tuple$3[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { if ($interfaceIsEqual(err, io.EOF)) { err = io.ErrUnexpectedEOF; } $s = -1; return [ptrType$18.nil, err]; } resp.Header = (mimeHeader); fixPragmaCacheControl(resp.Header); _r$9 = readTransfer(resp, r); /* */ $s = 22; case 22: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err = _r$9; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$18.nil, err]; } $s = -1; return [resp, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: ReadResponse }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$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._r$8 = _r$8; $f._r$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.err = err; $f.i = i; $f.i$1 = i$1; $f.line = line; $f.mimeHeader = mimeHeader; $f.ok = ok; $f.r = r; $f.req = req; $f.resp = resp; $f.statusCode = statusCode; $f.tp = tp; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.ReadResponse = ReadResponse; fixPragmaCacheControl = function(header) { var _entry, _entry$1, _key, _tuple, _tuple$1, header, hp, ok, presentcc; _tuple = (_entry = header[$String.keyFor("Pragma")], _entry !== undefined ? [_entry.v, true] : [sliceType$2.nil, false]); hp = _tuple[0]; ok = _tuple[1]; if (ok && hp.$length > 0 && (0 >= hp.$length ? ($throwRuntimeError("index out of range"), undefined) : hp.$array[hp.$offset + 0]) === "no-cache") { _tuple$1 = (_entry$1 = header[$String.keyFor("Cache-Control")], _entry$1 !== undefined ? [_entry$1.v, true] : [sliceType$2.nil, false]); presentcc = _tuple$1[1]; if (!presentcc) { _key = "Cache-Control"; (header || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: new sliceType$2(["no-cache"]) }; } } }; Response.ptr.prototype.ProtoAtLeast = function(major, minor) { var major, minor, r; r = this; return r.ProtoMajor > major || (r.ProtoMajor === major) && r.ProtoMinor >= minor; }; Response.prototype.ProtoAtLeast = function(major, minor) { return this.$val.ProtoAtLeast(major, minor); }; Response.ptr.prototype.Write = function(w) { var _entry, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, buf, contentLengthAlreadySent, err, err$1, err$2, err$3, err$4, n, ok, r, r1, text, tw, w, x$5, x$6, x$7, x$8, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _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; _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; buf = $f.buf; contentLengthAlreadySent = $f.contentLengthAlreadySent; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; err$4 = $f.err$4; n = $f.n; ok = $f.ok; r = $f.r; r1 = $f.r1; text = $f.text; tw = $f.tw; w = $f.w; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; x$8 = $f.x$8; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; text = r.Status; if (text === "") { ok = false; _tuple = (_entry = statusText[$Int.keyFor(r.StatusCode)], _entry !== undefined ? [_entry.v, true] : ["", false]); text = _tuple[0]; ok = _tuple[1]; if (!ok) { text = "status code " + strconv.Itoa(r.StatusCode); } } else { text = strings.TrimPrefix(text, strconv.Itoa(r.StatusCode) + " "); } _r$1 = fmt.Fprintf(w, "HTTP/%d.%d %03d %s\r\n", new sliceType([new $Int(r.ProtoMajor), new $Int(r.ProtoMinor), new $Int(r.StatusCode), new $String(text)])); /* */ $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; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } r1 = new Response.ptr("", 0, "", 0, 0, false, $ifaceNil, new $Int64(0, 0), sliceType$2.nil, false, false, false, ptrType$11.nil, ptrType$28.nil); Response.copy(r1, r); /* */ if ((x$5 = r1.ContentLength, (x$5.$high === 0 && x$5.$low === 0)) && !($interfaceIsEqual(r1.Body, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if ((x$5 = r1.ContentLength, (x$5.$high === 0 && x$5.$low === 0)) && !($interfaceIsEqual(r1.Body, $ifaceNil))) { */ case 2: buf = arrayType$2.zero(); _r$2 = r1.Body.Read(new sliceType$3(buf)); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$2 = _r$2; n = _tuple$2[0]; err$1 = _tuple$2[1]; if (!($interfaceIsEqual(err$1, $ifaceNil)) && !($interfaceIsEqual(err$1, io.EOF))) { $s = -1; return err$1; } if (n === 0) { r1.Body = new $pkg.NoBody.constructor.elem($pkg.NoBody); } else { r1.ContentLength = new $Int64(-1, 4294967295); r1.Body = (x$6 = new structType$2.ptr(io.MultiReader(new sliceType$17([bytes.NewReader($subslice(new sliceType$3(buf), 0, 1)), r.Body])), r.Body), new x$6.constructor.elem(x$6)); } /* } */ case 3: if ((x$7 = r1.ContentLength, (x$7.$high === -1 && x$7.$low === 4294967295)) && !r1.Close && r1.ProtoAtLeast(1, 1) && !chunked(r1.TransferEncoding) && !r1.Uncompressed) { r1.Close = true; } _r$3 = newTransferWriter(r1); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$3 = _r$3; tw = _tuple$3[0]; err$2 = _tuple$3[1]; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return err$2; } _r$4 = tw.writeHeader(w, ptrType$19.nil); /* */ $s = 6; case 6: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } err$2 = _r$4; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return err$2; } _r$5 = new Header(r.Header).WriteSubset(w, respExcludeHeader); /* */ $s = 7; case 7: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } err$2 = _r$5; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return err$2; } contentLengthAlreadySent = tw.shouldSendContentLength(); /* */ if ((x$8 = r1.ContentLength, (x$8.$high === 0 && x$8.$low === 0)) && !chunked(r1.TransferEncoding) && !contentLengthAlreadySent && bodyAllowedForStatus(r.StatusCode)) { $s = 8; continue; } /* */ $s = 9; continue; /* if ((x$8 = r1.ContentLength, (x$8.$high === 0 && x$8.$low === 0)) && !chunked(r1.TransferEncoding) && !contentLengthAlreadySent && bodyAllowedForStatus(r.StatusCode)) { */ case 8: _r$6 = io.WriteString(w, "Content-Length: 0\r\n"); /* */ $s = 10; case 10: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tuple$4 = _r$6; err$3 = _tuple$4[1]; if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = -1; return err$3; } /* } */ case 9: _r$7 = io.WriteString(w, "\r\n"); /* */ $s = 11; case 11: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _tuple$5 = _r$7; err$4 = _tuple$5[1]; if (!($interfaceIsEqual(err$4, $ifaceNil))) { $s = -1; return err$4; } _r$8 = tw.writeBody(w); /* */ $s = 12; case 12: 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 = -1; return err$2; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Response.ptr.prototype.Write }; } $f._entry = _entry; $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._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.buf = buf; $f.contentLengthAlreadySent = contentLengthAlreadySent; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.err$4 = err$4; $f.n = n; $f.ok = ok; $f.r = r; $f.r1 = r1; $f.text = text; $f.tw = tw; $f.w = w; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.x$8 = x$8; $f.$s = $s; $f.$r = $r; return $f; }; Response.prototype.Write = function(w) { return this.$val.Write(w); }; Response.ptr.prototype.closeBody = function() { var _r$1, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; /* */ if (!($interfaceIsEqual(r.Body, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(r.Body, $ifaceNil))) { */ case 1: _r$1 = r.Body.Close(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Response.ptr.prototype.closeBody }; } $f._r$1 = _r$1; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Response.prototype.closeBody = function() { return this.$val.closeBody(); }; Response.ptr.prototype.bodyIsWritable = function() { var _tuple, ok, r; r = this; _tuple = $assertType(r.Body, io.Writer, true); ok = _tuple[1]; return ok; }; Response.prototype.bodyIsWritable = function() { return this.$val.bodyIsWritable(); }; Response.ptr.prototype.isProtocolSwitch = function() { var $24r, _r$1, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r$1 = isProtocolSwitchResponse(r.StatusCode, r.Header); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Response.ptr.prototype.isProtocolSwitch }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Response.prototype.isProtocolSwitch = function() { return this.$val.isProtocolSwitch(); }; isProtocolSwitchResponse = function(code, h) { var $24r, _r$1, _v, code, h, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _v = $f._v; code = $f.code; h = $f.h; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (!(code === 101)) { _v = false; $s = 1; continue s; } _r$1 = isProtocolSwitchHeader(h); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _v = _r$1; case 1: $24r = _v; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: isProtocolSwitchResponse }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._v = _v; $f.code = code; $f.h = h; $f.$s = $s; $f.$r = $r; return $f; }; isProtocolSwitchHeader = function(h) { var $24r, _entry, _r$1, h, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _entry = $f._entry; _r$1 = $f._r$1; h = $f.h; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = new Header(h).Get("Upgrade"); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = !(_r$1 === "") && httpguts.HeaderValuesContainsToken((_entry = h[$String.keyFor("Connection")], _entry !== undefined ? _entry.v : sliceType$2.nil), "Upgrade"); $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: isProtocolSwitchHeader }; } $f.$24r = $24r; $f._entry = _entry; $f._r$1 = _r$1; $f.h = h; $f.$s = $s; $f.$r = $r; return $f; }; ProtocolError.ptr.prototype.Error = function() { var pe; pe = this; return pe.ErrorString; }; ProtocolError.prototype.Error = function() { return this.$val.Error(); }; badStringError = function(what, val) { var $24r, _r$1, val, what, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; val = $f.val; what = $f.what; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = fmt.Errorf("%s %q", new sliceType([new $String(what), new $String(val)])); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: badStringError }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.val = val; $f.what = what; $f.$s = $s; $f.$r = $r; return $f; }; Request.ptr.prototype.Context = function() { var r; r = this; if (!($interfaceIsEqual(r.ctx, $ifaceNil))) { return r.ctx; } return context.Background(); }; Request.prototype.Context = function() { return this.$val.Context(); }; Request.ptr.prototype.WithContext = function(ctx) { var ctx, r, r2; r = this; if ($interfaceIsEqual(ctx, $ifaceNil)) { $panic(new $String("nil context")); } r2 = new Request.ptr("", ptrType$17.nil, "", 0, 0, false, $ifaceNil, $throwNilPointerError, new $Int64(0, 0), sliceType$2.nil, false, "", false, false, ptrType$31.nil, false, "", "", ptrType$28.nil, $chanNil, ptrType$18.nil, $ifaceNil); Request.copy(r2, r); r2.ctx = ctx; r2.URL = cloneURL(r.URL); return r2; }; Request.prototype.WithContext = function(ctx) { return this.$val.WithContext(ctx); }; Request.ptr.prototype.Clone = function(ctx) { var ctx, r, r2, s, s2; r = this; if ($interfaceIsEqual(ctx, $ifaceNil)) { $panic(new $String("nil context")); } r2 = new Request.ptr("", ptrType$17.nil, "", 0, 0, false, $ifaceNil, $throwNilPointerError, new $Int64(0, 0), sliceType$2.nil, false, "", false, false, ptrType$31.nil, false, "", "", ptrType$28.nil, $chanNil, ptrType$18.nil, $ifaceNil); Request.copy(r2, r); r2.ctx = ctx; r2.URL = cloneURL(r.URL); if (!(r.Header === false)) { r2.Header = new Header(r.Header).Clone(); } if (!(r.Trailer === false)) { r2.Trailer = new Header(r.Trailer).Clone(); } s = r.TransferEncoding; if (!(s === sliceType$2.nil)) { s2 = $makeSlice(sliceType$2, s.$length); $copySlice(s2, s); r2.TransferEncoding = s2; } r2.Form = cloneURLValues(r.Form); r2.PostForm = cloneURLValues(r.PostForm); r2.MultipartForm = cloneMultipartForm(r.MultipartForm); return r2; }; Request.prototype.Clone = function(ctx) { return this.$val.Clone(ctx); }; Request.ptr.prototype.ProtoAtLeast = function(major, minor) { var major, minor, r; r = this; return r.ProtoMajor > major || (r.ProtoMajor === major) && r.ProtoMinor >= minor; }; Request.prototype.ProtoAtLeast = function(major, minor) { return this.$val.ProtoAtLeast(major, minor); }; Request.ptr.prototype.UserAgent = function() { var $24r, _r$1, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r$1 = new Header(r.Header).Get("User-Agent"); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Request.ptr.prototype.UserAgent }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Request.prototype.UserAgent = function() { return this.$val.UserAgent(); }; Request.ptr.prototype.Cookies = function() { var $24r, _r$1, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r$1 = readCookies(r.Header, ""); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Request.ptr.prototype.Cookies }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Request.prototype.Cookies = function() { return this.$val.Cookies(); }; Request.ptr.prototype.Cookie = function(name) { var _i, _r$1, _ref, c, name, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r$1 = $f._r$1; _ref = $f._ref; c = $f.c; name = $f.name; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r$1 = readCookies(r.Header, name); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _ref = _r$1; _i = 0; /* while (true) { */ case 2: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 3; continue; } c = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); $s = -1; return [c, $ifaceNil]; case 3: $s = -1; return [ptrType$62.nil, $pkg.ErrNoCookie]; /* */ } return; } if ($f === undefined) { $f = { $blk: Request.ptr.prototype.Cookie }; } $f._i = _i; $f._r$1 = _r$1; $f._ref = _ref; $f.c = c; $f.name = name; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Request.prototype.Cookie = function(name) { return this.$val.Cookie(name); }; Request.ptr.prototype.AddCookie = function(c) { var _arg, _arg$1, _r$1, _r$2, _r$3, _r$4, c, c$1, r, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; c = $f.c; c$1 = $f.c$1; r = $f.r; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r$1 = sanitizeCookieName(c.Name); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg = new $String(_r$1); _r$2 = sanitizeCookieValue(c.Value); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg$1 = new $String(_r$2); _r$3 = fmt.Sprintf("%s=%s", new sliceType([_arg, _arg$1])); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } s = _r$3; _r$4 = new Header(r.Header).Get("Cookie"); /* */ $s = 4; case 4: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } c$1 = _r$4; /* */ if (!(c$1 === "")) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!(c$1 === "")) { */ case 5: $r = new Header(r.Header).Set("Cookie", c$1 + "; " + s); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 7; continue; /* } else { */ case 6: $r = new Header(r.Header).Set("Cookie", s); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 7: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Request.ptr.prototype.AddCookie }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.c = c; $f.c$1 = c$1; $f.r = r; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; Request.prototype.AddCookie = function(c) { return this.$val.AddCookie(c); }; Request.ptr.prototype.Referer = function() { var $24r, _r$1, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r$1 = new Header(r.Header).Get("Referer"); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Request.ptr.prototype.Referer }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Request.prototype.Referer = function() { return this.$val.Referer(); }; Request.ptr.prototype.MultipartReader = function() { var $24r, _r$1, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; if (r.MultipartForm === multipartByReader) { $s = -1; return [ptrType$63.nil, errors.New("http: MultipartReader called twice")]; } if (!(r.MultipartForm === ptrType$31.nil)) { $s = -1; return [ptrType$63.nil, errors.New("http: multipart handled by ParseMultipartForm")]; } r.MultipartForm = multipartByReader; _r$1 = r.multipartReader(true); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Request.ptr.prototype.MultipartReader }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Request.prototype.MultipartReader = function() { return this.$val.MultipartReader(); }; Request.ptr.prototype.multipartReader = function(allowMixed) { var _entry, _r$1, _r$2, _tuple, _tuple$1, allowMixed, boundary, d, err, ok, params, r, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; allowMixed = $f.allowMixed; boundary = $f.boundary; d = $f.d; err = $f.err; ok = $f.ok; params = $f.params; r = $f.r; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r$1 = new Header(r.Header).Get("Content-Type"); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } v = _r$1; if (v === "") { $s = -1; return [ptrType$63.nil, $pkg.ErrNotMultipart]; } _r$2 = mime.ParseMediaType(v); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; d = _tuple[0]; params = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil)) || !(d === "multipart/form-data" || allowMixed && d === "multipart/mixed")) { $s = -1; return [ptrType$63.nil, $pkg.ErrNotMultipart]; } _tuple$1 = (_entry = params[$String.keyFor("boundary")], _entry !== undefined ? [_entry.v, true] : ["", false]); boundary = _tuple$1[0]; ok = _tuple$1[1]; if (!ok) { $s = -1; return [ptrType$63.nil, $pkg.ErrMissingBoundary]; } $s = -1; return [multipart.NewReader(r.Body, boundary), $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Request.ptr.prototype.multipartReader }; } $f._entry = _entry; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.allowMixed = allowMixed; $f.boundary = boundary; $f.d = d; $f.err = err; $f.ok = ok; $f.params = params; $f.r = r; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Request.prototype.multipartReader = function(allowMixed) { return this.$val.multipartReader(allowMixed); }; Request.ptr.prototype.isH2Upgrade = function() { var r; r = this; return r.Method === "PRI" && ($keys(r.Header).length === 0) && r.URL.Path === "*" && r.Proto === "HTTP/2.0"; }; Request.prototype.isH2Upgrade = function() { return this.$val.isH2Upgrade(); }; valueOrDefault = function(value, def) { var def, value; if (!(value === "")) { return value; } return def; }; Request.ptr.prototype.Write = function(w) { var $24r, _r$1, r, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; r = $f.r; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r$1 = r.write(w, false, false, $throwNilPointerError); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Request.ptr.prototype.Write }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.r = r; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; Request.prototype.Write = function(w) { return this.$val.Write(w); }; Request.ptr.prototype.WriteProxy = function(w) { var $24r, _r$1, r, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; r = $f.r; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r$1 = r.write(w, true, false, $throwNilPointerError); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Request.ptr.prototype.WriteProxy }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.r = r; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; Request.prototype.WriteProxy = function(w) { return this.$val.WriteProxy(w); }; Request.ptr.prototype.write = function(w, usingProxy, extraHeaders, waitForContinue) { var $24r, $24r$1, $24r$10, $24r$11, $24r$12, $24r$13, $24r$14, $24r$15, $24r$2, $24r$3, $24r$4, $24r$5, $24r$6, $24r$7, $24r$8, $24r$9, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, bw, bw$1, bw$2, closed, err, err$1, extraHeaders, host, ok, ok$1, ok$2, r, ruri, trace, tw, userAgent, usingProxy, w, waitForContinue, x$5, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$10 = $f.$24r$10; $24r$11 = $f.$24r$11; $24r$12 = $f.$24r$12; $24r$13 = $f.$24r$13; $24r$14 = $f.$24r$14; $24r$15 = $f.$24r$15; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; $24r$6 = $f.$24r$6; $24r$7 = $f.$24r$7; $24r$8 = $f.$24r$8; $24r$9 = $f.$24r$9; _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$17 = $f._r$17; _r$18 = $f._r$18; _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; _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; bw = $f.bw; bw$1 = $f.bw$1; bw$2 = $f.bw$2; closed = $f.closed; err = $f.err; err$1 = $f.err$1; extraHeaders = $f.extraHeaders; host = $f.host; ok = $f.ok; ok$1 = $f.ok$1; ok$2 = $f.ok$2; r = $f.r; ruri = $f.ruri; trace = $f.trace; tw = $f.tw; userAgent = $f.userAgent; usingProxy = $f.usingProxy; w = $f.w; waitForContinue = $f.waitForContinue; x$5 = $f.x$5; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); closed = [closed]; err = [err]; r = [r]; trace = [trace]; err[0] = $ifaceNil; r[0] = this; _r$1 = httptrace.ContextClientTrace(r[0].Context()); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } trace[0] = _r$1; /* */ if (!(trace[0] === ptrType$19.nil) && !(trace[0].WroteRequest === $throwNilPointerError)) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!(trace[0] === ptrType$19.nil) && !(trace[0].WroteRequest === $throwNilPointerError)) { */ case 2: $deferred.push([(function(closed, err, r, trace) { return function $b() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = trace[0].WroteRequest(new httptrace.WroteRequestInfo.ptr(err[0])); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$s = $s; $f.$r = $r; return $f; }; })(closed, err, r, trace), []]); /* } */ case 3: closed[0] = false; $deferred.push([(function(closed, err, r, trace) { return function $b() { var _r$2, closeErr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$2 = $f._r$2; closeErr = $f.closeErr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (closed[0]) { $s = -1; return; } _r$2 = r[0].closeBody(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } closeErr = _r$2; if (!($interfaceIsEqual(closeErr, $ifaceNil)) && $interfaceIsEqual(err[0], $ifaceNil)) { err[0] = closeErr; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$2 = _r$2; $f.closeErr = closeErr; $f.$s = $s; $f.$r = $r; return $f; }; })(closed, err, r, trace), []]); _r$2 = cleanHost(r[0].Host); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } host = _r$2; /* */ if (host === "") { $s = 5; continue; } /* */ $s = 6; continue; /* if (host === "") { */ case 5: /* */ if (r[0].URL === ptrType$17.nil) { $s = 7; continue; } /* */ $s = 8; continue; /* if (r[0].URL === ptrType$17.nil) { */ case 7: err[0] = errMissingHost; $24r = err[0]; $s = 9; case 9: return $24r; /* } */ case 8: _r$3 = cleanHost(r[0].URL.Host); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } host = _r$3; /* } */ case 6: host = removeZone(host); ruri = r[0].URL.RequestURI(); if (usingProxy && !(r[0].URL.Scheme === "") && r[0].URL.Opaque === "") { ruri = r[0].URL.Scheme + "://" + host + ruri; } else if (r[0].Method === "CONNECT" && r[0].URL.Path === "") { ruri = host; if (!(r[0].URL.Opaque === "")) { ruri = r[0].URL.Opaque; } } /* */ if (stringContainsCTLByte(ruri)) { $s = 11; continue; } /* */ $s = 12; continue; /* if (stringContainsCTLByte(ruri)) { */ case 11: err[0] = errors.New("net/http: can't write control character in Request.URL"); $24r$1 = err[0]; $s = 13; case 13: return $24r$1; /* } */ case 12: bw = ptrType$14.nil; _tuple = $assertType(w, io.ByteWriter, true); ok = _tuple[1]; if (!ok) { bw = bufio.NewWriter(w); w = bw; } _r$4 = fmt.Fprintf(w, "%s %s HTTP/1.1\r\n", new sliceType([new $String(valueOrDefault(r[0].Method, "GET")), new $String(ruri)])); /* */ $s = 14; case 14: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$1 = _r$4; err[0] = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err[0], $ifaceNil))) { $s = 15; continue; } /* */ $s = 16; continue; /* if (!($interfaceIsEqual(err[0], $ifaceNil))) { */ case 15: err[0] = err[0]; $24r$2 = err[0]; $s = 17; case 17: return $24r$2; /* } */ case 16: _r$5 = fmt.Fprintf(w, "Host: %s\r\n", new sliceType([new $String(host)])); /* */ $s = 18; case 18: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$2 = _r$5; err[0] = _tuple$2[1]; /* */ if (!($interfaceIsEqual(err[0], $ifaceNil))) { $s = 19; continue; } /* */ $s = 20; continue; /* if (!($interfaceIsEqual(err[0], $ifaceNil))) { */ case 19: err[0] = err[0]; $24r$3 = err[0]; $s = 21; case 21: return $24r$3; /* } */ case 20: /* */ if (!(trace[0] === ptrType$19.nil) && !(trace[0].WroteHeaderField === $throwNilPointerError)) { $s = 22; continue; } /* */ $s = 23; continue; /* if (!(trace[0] === ptrType$19.nil) && !(trace[0].WroteHeaderField === $throwNilPointerError)) { */ case 22: $r = trace[0].WroteHeaderField("Host", new sliceType$2([host])); /* */ $s = 24; case 24: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 23: userAgent = "Go-http-client/1.1"; /* */ if (new Header(r[0].Header).has("User-Agent")) { $s = 25; continue; } /* */ $s = 26; continue; /* if (new Header(r[0].Header).has("User-Agent")) { */ case 25: _r$6 = new Header(r[0].Header).Get("User-Agent"); /* */ $s = 27; case 27: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } userAgent = _r$6; /* } */ case 26: /* */ if (!(userAgent === "")) { $s = 28; continue; } /* */ $s = 29; continue; /* if (!(userAgent === "")) { */ case 28: _r$7 = fmt.Fprintf(w, "User-Agent: %s\r\n", new sliceType([new $String(userAgent)])); /* */ $s = 30; case 30: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _tuple$3 = _r$7; err[0] = _tuple$3[1]; /* */ if (!($interfaceIsEqual(err[0], $ifaceNil))) { $s = 31; continue; } /* */ $s = 32; continue; /* if (!($interfaceIsEqual(err[0], $ifaceNil))) { */ case 31: err[0] = err[0]; $24r$4 = err[0]; $s = 33; case 33: return $24r$4; /* } */ case 32: /* */ if (!(trace[0] === ptrType$19.nil) && !(trace[0].WroteHeaderField === $throwNilPointerError)) { $s = 34; continue; } /* */ $s = 35; continue; /* if (!(trace[0] === ptrType$19.nil) && !(trace[0].WroteHeaderField === $throwNilPointerError)) { */ case 34: $r = trace[0].WroteHeaderField("User-Agent", new sliceType$2([userAgent])); /* */ $s = 36; case 36: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 35: /* } */ case 29: _r$8 = newTransferWriter(r[0]); /* */ $s = 37; case 37: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _tuple$4 = _r$8; tw = _tuple$4[0]; err[0] = _tuple$4[1]; /* */ if (!($interfaceIsEqual(err[0], $ifaceNil))) { $s = 38; continue; } /* */ $s = 39; continue; /* if (!($interfaceIsEqual(err[0], $ifaceNil))) { */ case 38: err[0] = err[0]; $24r$5 = err[0]; $s = 40; case 40: return $24r$5; /* } */ case 39: _r$9 = tw.writeHeader(w, trace[0]); /* */ $s = 41; case 41: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err[0] = _r$9; /* */ if (!($interfaceIsEqual(err[0], $ifaceNil))) { $s = 42; continue; } /* */ $s = 43; continue; /* if (!($interfaceIsEqual(err[0], $ifaceNil))) { */ case 42: err[0] = err[0]; $24r$6 = err[0]; $s = 44; case 44: return $24r$6; /* } */ case 43: _r$10 = new Header(r[0].Header).writeSubset(w, reqWriteExcludeHeader, trace[0]); /* */ $s = 45; case 45: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } err[0] = _r$10; /* */ if (!($interfaceIsEqual(err[0], $ifaceNil))) { $s = 46; continue; } /* */ $s = 47; continue; /* if (!($interfaceIsEqual(err[0], $ifaceNil))) { */ case 46: err[0] = err[0]; $24r$7 = err[0]; $s = 48; case 48: return $24r$7; /* } */ case 47: /* */ if (!(extraHeaders === false)) { $s = 49; continue; } /* */ $s = 50; continue; /* if (!(extraHeaders === false)) { */ case 49: _r$11 = new Header(extraHeaders).write(w, trace[0]); /* */ $s = 51; case 51: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } err[0] = _r$11; /* */ if (!($interfaceIsEqual(err[0], $ifaceNil))) { $s = 52; continue; } /* */ $s = 53; continue; /* if (!($interfaceIsEqual(err[0], $ifaceNil))) { */ case 52: err[0] = err[0]; $24r$8 = err[0]; $s = 54; case 54: return $24r$8; /* } */ case 53: /* } */ case 50: _r$12 = io.WriteString(w, "\r\n"); /* */ $s = 55; case 55: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _tuple$5 = _r$12; err[0] = _tuple$5[1]; /* */ if (!($interfaceIsEqual(err[0], $ifaceNil))) { $s = 56; continue; } /* */ $s = 57; continue; /* if (!($interfaceIsEqual(err[0], $ifaceNil))) { */ case 56: err[0] = err[0]; $24r$9 = err[0]; $s = 58; case 58: return $24r$9; /* } */ case 57: /* */ if (!(trace[0] === ptrType$19.nil) && !(trace[0].WroteHeaders === $throwNilPointerError)) { $s = 59; continue; } /* */ $s = 60; continue; /* if (!(trace[0] === ptrType$19.nil) && !(trace[0].WroteHeaders === $throwNilPointerError)) { */ case 59: $r = trace[0].WroteHeaders(); /* */ $s = 61; case 61: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 60: /* */ if (!(waitForContinue === $throwNilPointerError)) { $s = 62; continue; } /* */ $s = 63; continue; /* if (!(waitForContinue === $throwNilPointerError)) { */ case 62: _tuple$6 = $assertType(w, ptrType$14, true); bw$1 = _tuple$6[0]; ok$1 = _tuple$6[1]; /* */ if (ok$1) { $s = 64; continue; } /* */ $s = 65; continue; /* if (ok$1) { */ case 64: _r$13 = bw$1.Flush(); /* */ $s = 66; case 66: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } err[0] = _r$13; /* */ if (!($interfaceIsEqual(err[0], $ifaceNil))) { $s = 67; continue; } /* */ $s = 68; continue; /* if (!($interfaceIsEqual(err[0], $ifaceNil))) { */ case 67: err[0] = err[0]; $24r$10 = err[0]; $s = 69; case 69: return $24r$10; /* } */ case 68: /* } */ case 65: /* */ if (!(trace[0] === ptrType$19.nil) && !(trace[0].Wait100Continue === $throwNilPointerError)) { $s = 70; continue; } /* */ $s = 71; continue; /* if (!(trace[0] === ptrType$19.nil) && !(trace[0].Wait100Continue === $throwNilPointerError)) { */ case 70: $r = trace[0].Wait100Continue(); /* */ $s = 72; case 72: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 71: _r$14 = waitForContinue(); /* */ $s = 75; case 75: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } /* */ if (!_r$14) { $s = 73; continue; } /* */ $s = 74; continue; /* if (!_r$14) { */ case 73: closed[0] = true; _r$15 = r[0].closeBody(); /* */ $s = 76; case 76: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _r$15; err[0] = $ifaceNil; $24r$11 = err[0]; $s = 77; case 77: return $24r$11; /* } */ case 74: /* } */ case 63: _tuple$7 = $assertType(w, ptrType$14, true); bw$2 = _tuple$7[0]; ok$2 = _tuple$7[1]; /* */ if (ok$2 && tw.FlushHeaders) { $s = 78; continue; } /* */ $s = 79; continue; /* if (ok$2 && tw.FlushHeaders) { */ case 78: _r$16 = bw$2.Flush(); /* */ $s = 80; case 80: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } err$1 = _r$16; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 81; continue; } /* */ $s = 82; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 81: err[0] = err$1; $24r$12 = err[0]; $s = 83; case 83: return $24r$12; /* } */ case 82: /* } */ case 79: closed[0] = true; _r$17 = tw.writeBody(w); /* */ $s = 84; case 84: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } err[0] = _r$17; /* */ if (!($interfaceIsEqual(err[0], $ifaceNil))) { $s = 85; continue; } /* */ $s = 86; continue; /* if (!($interfaceIsEqual(err[0], $ifaceNil))) { */ case 85: if ($interfaceIsEqual(tw.bodyReadError, err[0])) { err[0] = (x$5 = new requestBodyReadError.ptr(err[0]), new x$5.constructor.elem(x$5)); } err[0] = err[0]; $24r$13 = err[0]; $s = 87; case 87: return $24r$13; /* } */ case 86: /* */ if (!(bw === ptrType$14.nil)) { $s = 88; continue; } /* */ $s = 89; continue; /* if (!(bw === ptrType$14.nil)) { */ case 88: _r$18 = bw.Flush(); /* */ $s = 90; case 90: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } err[0] = _r$18; $24r$14 = err[0]; $s = 91; case 91: return $24r$14; /* } */ case 89: err[0] = $ifaceNil; $24r$15 = err[0]; $s = 92; case 92: return $24r$15; /* */ } 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: Request.ptr.prototype.write }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$10 = $24r$10; $f.$24r$11 = $24r$11; $f.$24r$12 = $24r$12; $f.$24r$13 = $24r$13; $f.$24r$14 = $24r$14; $f.$24r$15 = $24r$15; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f.$24r$6 = $24r$6; $f.$24r$7 = $24r$7; $f.$24r$8 = $24r$8; $f.$24r$9 = $24r$9; $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$17 = _r$17; $f._r$18 = _r$18; $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._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.bw = bw; $f.bw$1 = bw$1; $f.bw$2 = bw$2; $f.closed = closed; $f.err = err; $f.err$1 = err$1; $f.extraHeaders = extraHeaders; $f.host = host; $f.ok = ok; $f.ok$1 = ok$1; $f.ok$2 = ok$2; $f.r = r; $f.ruri = ruri; $f.trace = trace; $f.tw = tw; $f.userAgent = userAgent; $f.usingProxy = usingProxy; $f.w = w; $f.waitForContinue = waitForContinue; $f.x$5 = x$5; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Request.prototype.write = function(w, usingProxy, extraHeaders, waitForContinue) { return this.$val.write(w, usingProxy, extraHeaders, waitForContinue); }; idnaASCII = function(v) { var $24r, _r$1, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (ascii.Is(v)) { $s = -1; return [v, $ifaceNil]; } _r$1 = idna.Lookup.ToASCII(v); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: idnaASCII }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; cleanHost = function(in$1) { var _r$1, _r$2, _r$3, _tuple, _tuple$1, _tuple$2, a, a$1, err, err$1, host, i, in$1, port, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; a = $f.a; a$1 = $f.a$1; err = $f.err; err$1 = $f.err$1; host = $f.host; i = $f.i; in$1 = $f.in$1; port = $f.port; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: i = strings.IndexAny(in$1, " /"); if (!((i === -1))) { in$1 = $substring(in$1, 0, i); } _r$1 = net.SplitHostPort(in$1); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; host = _tuple[0]; port = _tuple[1]; err = _tuple[2]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: _r$2 = idnaASCII(in$1); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; a = _tuple$1[0]; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return in$1; } $s = -1; return a; /* } */ case 3: _r$3 = idnaASCII(host); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$2 = _r$3; a$1 = _tuple$2[0]; err = _tuple$2[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return in$1; } $s = -1; return net.JoinHostPort(a$1, port); /* */ } return; } if ($f === undefined) { $f = { $blk: cleanHost }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.a = a; $f.a$1 = a$1; $f.err = err; $f.err$1 = err$1; $f.host = host; $f.i = i; $f.in$1 = in$1; $f.port = port; $f.$s = $s; $f.$r = $r; return $f; }; removeZone = function(host) { var host, i, j; if (!strings.HasPrefix(host, "[")) { return host; } i = strings.LastIndex(host, "]"); if (i < 0) { return host; } j = strings.LastIndex($substring(host, 0, i), "%"); if (j < 0) { return host; } return $substring(host, 0, j) + $substring(host, i); }; ParseHTTPVersion = function(vers) { var _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$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, dot, err, major, minor, ok, vers; major = 0; minor = 0; ok = false; _1 = vers; if (_1 === ("HTTP/1.1")) { _tmp = 1; _tmp$1 = 1; _tmp$2 = true; major = _tmp; minor = _tmp$1; ok = _tmp$2; return [major, minor, ok]; } else if (_1 === ("HTTP/1.0")) { _tmp$3 = 1; _tmp$4 = 0; _tmp$5 = true; major = _tmp$3; minor = _tmp$4; ok = _tmp$5; return [major, minor, ok]; } if (!strings.HasPrefix(vers, "HTTP/")) { _tmp$6 = 0; _tmp$7 = 0; _tmp$8 = false; major = _tmp$6; minor = _tmp$7; ok = _tmp$8; return [major, minor, ok]; } dot = strings.Index(vers, "."); if (dot < 0) { _tmp$9 = 0; _tmp$10 = 0; _tmp$11 = false; major = _tmp$9; minor = _tmp$10; ok = _tmp$11; return [major, minor, ok]; } _tuple = strconv.Atoi($substring(vers, 5, dot)); major = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil)) || major < 0 || major > 1000000) { _tmp$12 = 0; _tmp$13 = 0; _tmp$14 = false; major = _tmp$12; minor = _tmp$13; ok = _tmp$14; return [major, minor, ok]; } _tuple$1 = strconv.Atoi($substring(vers, (dot + 1 >> 0))); minor = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil)) || minor < 0 || minor > 1000000) { _tmp$15 = 0; _tmp$16 = 0; _tmp$17 = false; major = _tmp$15; minor = _tmp$16; ok = _tmp$17; return [major, minor, ok]; } _tmp$18 = major; _tmp$19 = minor; _tmp$20 = true; major = _tmp$18; minor = _tmp$19; ok = _tmp$20; return [major, minor, ok]; }; $pkg.ParseHTTPVersion = ParseHTTPVersion; validMethod = function(method) { var $24r, _r$1, _v, method, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _v = $f._v; method = $f.method; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (!(method.length > 0)) { _v = false; $s = 1; continue s; } _r$1 = strings.IndexFunc(method, isNotToken); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _v = _r$1 === -1; case 1: $24r = _v; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: validMethod }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._v = _v; $f.method = method; $f.$s = $s; $f.$r = $r; return $f; }; NewRequest = function(method, url$1, body$1) { var $24r, _r$1, body$1, method, url$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; body$1 = $f.body$1; method = $f.method; url$1 = $f.url$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = NewRequestWithContext(context.Background(), method, url$1, body$1); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: NewRequest }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.body$1 = body$1; $f.method = method; $f.url$1 = url$1; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.NewRequest = NewRequest; NewRequestWithContext = function(ctx, method, url$1, body$1) { var $24r, _r$1, _r$2, _r$3, _ref, _tuple, _tuple$1, body$1, buf, ctx, err, method, ok, rc, req, snapshot, snapshot$1, u, url$1, v, v$1, v$2, v$3, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; body$1 = $f.body$1; buf = $f.buf; ctx = $f.ctx; err = $f.err; method = $f.method; ok = $f.ok; rc = $f.rc; req = $f.req; snapshot = $f.snapshot; snapshot$1 = $f.snapshot$1; u = $f.u; url$1 = $f.url$1; v = $f.v; v$1 = $f.v$1; v$2 = $f.v$2; v$3 = $f.v$3; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: buf = [buf]; snapshot = [snapshot]; snapshot$1 = [snapshot$1]; if (method === "") { method = "GET"; } _r$1 = validMethod(method); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (!_r$1) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!_r$1) { */ case 1: _r$2 = fmt.Errorf("net/http: invalid method %q", new sliceType([new $String(method)])); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = [ptrType$11.nil, _r$2]; $s = 5; case 5: return $24r; /* } */ case 2: if ($interfaceIsEqual(ctx, $ifaceNil)) { $s = -1; return [ptrType$11.nil, errors.New("net/http: nil Context")]; } _r$3 = url.Parse(url$1); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; u = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$11.nil, err]; } _tuple$1 = $assertType(body$1, io.ReadCloser, true); rc = _tuple$1[0]; ok = _tuple$1[1]; if (!ok && !($interfaceIsEqual(body$1, $ifaceNil))) { rc = io.NopCloser(body$1); } u.Host = removeEmptyPort(u.Host); req = new Request.ptr(method, u, "HTTP/1.1", 1, 1, {}, rc, $throwNilPointerError, new $Int64(0, 0), sliceType$2.nil, false, u.Host, false, false, ptrType$31.nil, false, "", "", ptrType$28.nil, $chanNil, ptrType$18.nil, ctx); if (!($interfaceIsEqual(body$1, $ifaceNil))) { _ref = body$1; if ($assertType(_ref, ptrType$40, true)[1]) { v = _ref.$val; req.ContentLength = (new $Int64(0, v.Len())); buf[0] = v.Bytes(); req.GetBody = (function(buf, snapshot, snapshot$1) { return function() { var r; r = bytes.NewReader(buf[0]); return [io.NopCloser(r), $ifaceNil]; }; })(buf, snapshot, snapshot$1); } else if ($assertType(_ref, ptrType$39, true)[1]) { v$1 = _ref.$val; req.ContentLength = (new $Int64(0, v$1.Len())); snapshot[0] = $clone(v$1, bytes.Reader); req.GetBody = (function(buf, snapshot, snapshot$1) { return function() { var r; r = $clone(snapshot[0], bytes.Reader); return [io.NopCloser(r), $ifaceNil]; }; })(buf, snapshot, snapshot$1); } else if ($assertType(_ref, ptrType$41, true)[1]) { v$2 = _ref.$val; req.ContentLength = (new $Int64(0, v$2.Len())); snapshot$1[0] = $clone(v$2, strings.Reader); req.GetBody = (function(buf, snapshot, snapshot$1) { return function() { var r; r = $clone(snapshot$1[0], strings.Reader); return [io.NopCloser(r), $ifaceNil]; }; })(buf, snapshot, snapshot$1); } else { v$3 = _ref; } if (!(req.GetBody === $throwNilPointerError) && (x$5 = req.ContentLength, (x$5.$high === 0 && x$5.$low === 0))) { req.Body = new $pkg.NoBody.constructor.elem($pkg.NoBody); req.GetBody = (function(buf, snapshot, snapshot$1) { return function() { return [new $pkg.NoBody.constructor.elem($pkg.NoBody), $ifaceNil]; }; })(buf, snapshot, snapshot$1); } } $s = -1; return [req, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: NewRequestWithContext }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.body$1 = body$1; $f.buf = buf; $f.ctx = ctx; $f.err = err; $f.method = method; $f.ok = ok; $f.rc = rc; $f.req = req; $f.snapshot = snapshot; $f.snapshot$1 = snapshot$1; $f.u = u; $f.url$1 = url$1; $f.v = v; $f.v$1 = v$1; $f.v$2 = v$2; $f.v$3 = v$3; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.NewRequestWithContext = NewRequestWithContext; Request.ptr.prototype.BasicAuth = function() { var _r$1, _tuple, auth, ok, password, r, username, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; auth = $f.auth; ok = $f.ok; password = $f.password; r = $f.r; username = $f.username; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: username = ""; password = ""; ok = false; r = this; _r$1 = new Header(r.Header).Get("Authorization"); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } auth = _r$1; if (auth === "") { $s = -1; return [username, password, ok]; } _tuple = parseBasicAuth(auth); username = _tuple[0]; password = _tuple[1]; ok = _tuple[2]; $s = -1; return [username, password, ok]; /* */ } return; } if ($f === undefined) { $f = { $blk: Request.ptr.prototype.BasicAuth }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.auth = auth; $f.ok = ok; $f.password = password; $f.r = r; $f.username = username; $f.$s = $s; $f.$r = $r; return $f; }; Request.prototype.BasicAuth = function() { return this.$val.BasicAuth(); }; parseBasicAuth = function(auth) { var _tmp, _tmp$1, _tmp$2, _tuple, auth, c, cs, err, ok, password, s, username; username = ""; password = ""; ok = false; if (auth.length < 6 || !ascii.EqualFold($substring(auth, 0, 6), "Basic ")) { return [username, password, ok]; } _tuple = base64.StdEncoding.DecodeString($substring(auth, 6)); c = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [username, password, ok]; } cs = ($bytesToString(c)); s = strings.IndexByte(cs, 58); if (s < 0) { return [username, password, ok]; } _tmp = $substring(cs, 0, s); _tmp$1 = $substring(cs, (s + 1 >> 0)); _tmp$2 = true; username = _tmp; password = _tmp$1; ok = _tmp$2; return [username, password, ok]; }; Request.ptr.prototype.SetBasicAuth = function(username, password) { var password, r, username, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; password = $f.password; r = $f.r; username = $f.username; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; $r = new Header(r.Header).Set("Authorization", "Basic " + basicAuth(username, password)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Request.ptr.prototype.SetBasicAuth }; } $f.password = password; $f.r = r; $f.username = username; $f.$s = $s; $f.$r = $r; return $f; }; Request.prototype.SetBasicAuth = function(username, password) { return this.$val.SetBasicAuth(username, password); }; parseRequestLine = function(line) { var _tmp, _tmp$1, _tmp$2, _tmp$3, line, method, ok, proto, requestURI, s1, s2; method = ""; requestURI = ""; proto = ""; ok = false; s1 = strings.Index(line, " "); s2 = strings.Index($substring(line, (s1 + 1 >> 0)), " "); if (s1 < 0 || s2 < 0) { return [method, requestURI, proto, ok]; } s2 = s2 + ((s1 + 1 >> 0)) >> 0; _tmp = $substring(line, 0, s1); _tmp$1 = $substring(line, (s1 + 1 >> 0), s2); _tmp$2 = $substring(line, (s2 + 1 >> 0)); _tmp$3 = true; method = _tmp; requestURI = _tmp$1; proto = _tmp$2; ok = _tmp$3; return [method, requestURI, proto, ok]; }; newTextprotoReader = function(br) { var $24r, _r$1, _r$2, br, tr, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; br = $f.br; tr = $f.tr; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = textprotoReaderPool.Get(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } v = _r$1; if (!($interfaceIsEqual(v, $ifaceNil))) { tr = $assertType(v, ptrType$64); tr.R = br; $s = -1; return tr; } _r$2 = textproto.NewReader(br); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: newTextprotoReader }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.br = br; $f.tr = tr; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; putTextprotoReader = function(r) { var r; r.R = ptrType$29.nil; textprotoReaderPool.Put(r); }; readRequest = function(b) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, $24r$5, $24r$6, $24r$7, $24r$8, _entry, _r$1, _r$10, _r$11, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _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, _tuple$3, _tuple$4, b, err, justAuthority, mimeHeader, ok, rawurl, req, s, tp, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; $24r$6 = $f.$24r$6; $24r$7 = $f.$24r$7; $24r$8 = $f.$24r$8; _entry = $f._entry; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _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$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$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; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; b = $f.b; err = $f.err; justAuthority = $f.justAuthority; mimeHeader = $f.mimeHeader; ok = $f.ok; rawurl = $f.rawurl; req = $f.req; s = $f.s; tp = $f.tp; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); err = [err]; tp = [tp]; req = ptrType$11.nil; err[0] = $ifaceNil; _r$1 = newTextprotoReader(b); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } tp[0] = _r$1; req = new Request.ptr("", ptrType$17.nil, "", 0, 0, false, $ifaceNil, $throwNilPointerError, new $Int64(0, 0), sliceType$2.nil, false, "", false, false, ptrType$31.nil, false, "", "", ptrType$28.nil, $chanNil, ptrType$18.nil, $ifaceNil); s = ""; _r$2 = tp[0].ReadLine(); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; s = _tuple[0]; err[0] = _tuple[1]; /* */ if (!($interfaceIsEqual(err[0], $ifaceNil))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!($interfaceIsEqual(err[0], $ifaceNil))) { */ case 3: _tmp = ptrType$11.nil; _tmp$1 = err[0]; req = _tmp; err[0] = _tmp$1; $24r = [req, err[0]]; $s = 5; case 5: return $24r; /* } */ case 4: $deferred.push([(function(err, tp) { return function() { putTextprotoReader(tp[0]); if ($interfaceIsEqual(err[0], io.EOF)) { err[0] = io.ErrUnexpectedEOF; } }; })(err, tp), []]); ok = false; _tuple$1 = parseRequestLine(s); req.Method = _tuple$1[0]; req.RequestURI = _tuple$1[1]; req.Proto = _tuple$1[2]; ok = _tuple$1[3]; /* */ if (!ok) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!ok) { */ case 6: _tmp$2 = ptrType$11.nil; _r$3 = badStringError("malformed HTTP request", s); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tmp$3 = _r$3; req = _tmp$2; err[0] = _tmp$3; $24r$1 = [req, err[0]]; $s = 9; case 9: return $24r$1; /* } */ case 7: _r$4 = validMethod(req.Method); /* */ $s = 12; case 12: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } /* */ if (!_r$4) { $s = 10; continue; } /* */ $s = 11; continue; /* if (!_r$4) { */ case 10: _tmp$4 = ptrType$11.nil; _r$5 = badStringError("invalid method", req.Method); /* */ $s = 13; case 13: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tmp$5 = _r$5; req = _tmp$4; err[0] = _tmp$5; $24r$2 = [req, err[0]]; $s = 14; case 14: return $24r$2; /* } */ case 11: rawurl = req.RequestURI; _tuple$2 = ParseHTTPVersion(req.Proto); req.ProtoMajor = _tuple$2[0]; req.ProtoMinor = _tuple$2[1]; ok = _tuple$2[2]; /* */ if (!ok) { $s = 15; continue; } /* */ $s = 16; continue; /* if (!ok) { */ case 15: _tmp$6 = ptrType$11.nil; _r$6 = badStringError("malformed HTTP version", req.Proto); /* */ $s = 17; case 17: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tmp$7 = _r$6; req = _tmp$6; err[0] = _tmp$7; $24r$3 = [req, err[0]]; $s = 18; case 18: return $24r$3; /* } */ case 16: justAuthority = req.Method === "CONNECT" && !strings.HasPrefix(rawurl, "/"); if (justAuthority) { rawurl = "http://" + rawurl; } _r$7 = url.ParseRequestURI(rawurl); /* */ $s = 19; case 19: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _tuple$3 = _r$7; req.URL = _tuple$3[0]; err[0] = _tuple$3[1]; /* */ if (!($interfaceIsEqual(err[0], $ifaceNil))) { $s = 20; continue; } /* */ $s = 21; continue; /* if (!($interfaceIsEqual(err[0], $ifaceNil))) { */ case 20: _tmp$8 = ptrType$11.nil; _tmp$9 = err[0]; req = _tmp$8; err[0] = _tmp$9; $24r$4 = [req, err[0]]; $s = 22; case 22: return $24r$4; /* } */ case 21: if (justAuthority) { req.URL.Scheme = ""; } _r$8 = tp[0].ReadMIMEHeader(); /* */ $s = 23; case 23: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _tuple$4 = _r$8; mimeHeader = _tuple$4[0]; err[0] = _tuple$4[1]; /* */ if (!($interfaceIsEqual(err[0], $ifaceNil))) { $s = 24; continue; } /* */ $s = 25; continue; /* if (!($interfaceIsEqual(err[0], $ifaceNil))) { */ case 24: _tmp$10 = ptrType$11.nil; _tmp$11 = err[0]; req = _tmp$10; err[0] = _tmp$11; $24r$5 = [req, err[0]]; $s = 26; case 26: return $24r$5; /* } */ case 25: req.Header = (mimeHeader); /* */ if ((_entry = req.Header[$String.keyFor("Host")], _entry !== undefined ? _entry.v : sliceType$2.nil).$length > 1) { $s = 27; continue; } /* */ $s = 28; continue; /* if ((_entry = req.Header[$String.keyFor("Host")], _entry !== undefined ? _entry.v : sliceType$2.nil).$length > 1) { */ case 27: _tmp$12 = ptrType$11.nil; _r$9 = fmt.Errorf("too many Host headers", new sliceType([])); /* */ $s = 29; case 29: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _tmp$13 = _r$9; req = _tmp$12; err[0] = _tmp$13; $24r$6 = [req, err[0]]; $s = 30; case 30: return $24r$6; /* } */ case 28: req.Host = req.URL.Host; if (req.Host === "") { req.Host = new Header(req.Header).get("Host"); } fixPragmaCacheControl(req.Header); _r$10 = shouldClose(req.ProtoMajor, req.ProtoMinor, req.Header, false); /* */ $s = 31; case 31: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } req.Close = _r$10; _r$11 = readTransfer(req, b); /* */ $s = 32; case 32: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } err[0] = _r$11; /* */ if (!($interfaceIsEqual(err[0], $ifaceNil))) { $s = 33; continue; } /* */ $s = 34; continue; /* if (!($interfaceIsEqual(err[0], $ifaceNil))) { */ case 33: _tmp$14 = ptrType$11.nil; _tmp$15 = err[0]; req = _tmp$14; err[0] = _tmp$15; $24r$7 = [req, err[0]]; $s = 35; case 35: return $24r$7; /* } */ case 34: if (req.isH2Upgrade()) { req.ContentLength = new $Int64(-1, 4294967295); req.Close = true; } _tmp$16 = req; _tmp$17 = $ifaceNil; req = _tmp$16; err[0] = _tmp$17; $24r$8 = [req, err[0]]; $s = 36; case 36: return $24r$8; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [req, err[0]]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: readRequest }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f.$24r$6 = $24r$6; $f.$24r$7 = $24r$7; $f.$24r$8 = $24r$8; $f._entry = _entry; $f._r$1 = _r$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $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$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$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._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f.b = b; $f.err = err; $f.justAuthority = justAuthority; $f.mimeHeader = mimeHeader; $f.ok = ok; $f.rawurl = rawurl; $f.req = req; $f.s = s; $f.tp = tp; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; MaxBytesReader = function(w, r, n) { var n, r, w; if ((n.$high < 0 || (n.$high === 0 && n.$low < 0))) { n = new $Int64(0, 0); } return new maxBytesReader.ptr(w, r, n, $ifaceNil); }; $pkg.MaxBytesReader = MaxBytesReader; maxBytesReader.ptr.prototype.Read = function(p) { var _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, _tuple$1, err, l, n, ok, p, res, x$10, x$11, x$12, x$13, 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; _r$1 = $f._r$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; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; err = $f.err; l = $f.l; n = $f.n; ok = $f.ok; p = $f.p; res = $f.res; x$10 = $f.x$10; x$11 = $f.x$11; x$12 = $f.x$12; x$13 = $f.x$13; 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: n = 0; err = $ifaceNil; l = this; if (!($interfaceIsEqual(l.err, $ifaceNil))) { _tmp = 0; _tmp$1 = l.err; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } if (p.$length === 0) { _tmp$2 = 0; _tmp$3 = $ifaceNil; n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; } if ((x$5 = (new $Int64(0, p.$length)), x$6 = (x$7 = l.n, new $Int64(x$7.$high + 0, x$7.$low + 1)), (x$5.$high > x$6.$high || (x$5.$high === x$6.$high && x$5.$low > x$6.$low)))) { p = $subslice(p, 0, $flatten64((x$8 = l.n, new $Int64(x$8.$high + 0, x$8.$low + 1)))); } _r$1 = l.r.Read(p); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err = _tuple[1]; if ((x$9 = (new $Int64(0, n)), x$10 = l.n, (x$9.$high < x$10.$high || (x$9.$high === x$10.$high && x$9.$low <= x$10.$low)))) { l.n = (x$11 = l.n, x$12 = (new $Int64(0, n)), new $Int64(x$11.$high - x$12.$high, x$11.$low - x$12.$low)); l.err = err; _tmp$4 = n; _tmp$5 = err; n = _tmp$4; err = _tmp$5; $s = -1; return [n, err]; } n = (((x$13 = l.n, x$13.$low + ((x$13.$high >> 31) * 4294967296)) >> 0)); l.n = new $Int64(0, 0); _tuple$1 = $assertType(l.w, requestTooLarger, true); res = _tuple$1[0]; ok = _tuple$1[1]; /* */ if (ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (ok) { */ case 2: $r = res.requestTooLarge(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: l.err = errors.New("http: request body too large"); _tmp$6 = n; _tmp$7 = l.err; n = _tmp$6; err = _tmp$7; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: maxBytesReader.ptr.prototype.Read }; } $f._r$1 = _r$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._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.err = err; $f.l = l; $f.n = n; $f.ok = ok; $f.p = p; $f.res = res; $f.x$10 = x$10; $f.x$11 = x$11; $f.x$12 = x$12; $f.x$13 = x$13; $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; }; maxBytesReader.prototype.Read = function(p) { return this.$val.Read(p); }; maxBytesReader.ptr.prototype.Close = function() { var $24r, _r$1, l, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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.r.Close(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: maxBytesReader.ptr.prototype.Close }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.l = l; $f.$s = $s; $f.$r = $r; return $f; }; maxBytesReader.prototype.Close = function() { return this.$val.Close(); }; copyValues = function(dst, src) { var _entry, _entry$1, _i, _key, _keys, _ref, dst, k, src, vs; _ref = src; _i = 0; _keys = $keys(_ref); while (true) { if (!(_i < _keys.length)) { break; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; continue; } k = _entry.k; vs = _entry.v; _key = k; (dst || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: $appendSlice((_entry$1 = dst[$String.keyFor(k)], _entry$1 !== undefined ? _entry$1.v : sliceType$2.nil), vs) }; _i++; } }; parsePostForm = function(r) { var _r$1, _r$2, _r$3, _r$4, _tuple, _tuple$1, _tuple$2, _tuple$3, b, ct, e, err, maxFormSize, ok, r, reader, vs, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; b = $f.b; ct = $f.ct; e = $f.e; err = $f.err; maxFormSize = $f.maxFormSize; ok = $f.ok; r = $f.r; reader = $f.reader; vs = $f.vs; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: vs = false; err = $ifaceNil; if ($interfaceIsEqual(r.Body, $ifaceNil)) { err = errors.New("missing form body"); $s = -1; return [vs, err]; } _r$1 = new Header(r.Header).Get("Content-Type"); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } ct = _r$1; if (ct === "") { ct = "application/octet-stream"; } _r$2 = mime.ParseMediaType(ct); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; ct = _tuple[0]; err = _tuple[2]; /* */ if (ct === "application/x-www-form-urlencoded") { $s = 4; continue; } /* */ if (ct === "multipart/form-data") { $s = 5; continue; } /* */ $s = 6; continue; /* if (ct === "application/x-www-form-urlencoded") { */ case 4: reader = r.Body; maxFormSize = new $Int64(2147483647, 4294967295); _tuple$1 = $assertType(r.Body, ptrType$65, true); ok = _tuple$1[1]; if (!ok) { maxFormSize = new $Int64(0, 10485760); reader = io.LimitReader(r.Body, new $Int64(maxFormSize.$high + 0, maxFormSize.$low + 1)); } _r$3 = io.ReadAll(reader); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$2 = _r$3; b = _tuple$2[0]; e = _tuple$2[1]; if (!($interfaceIsEqual(e, $ifaceNil))) { if ($interfaceIsEqual(err, $ifaceNil)) { err = e; } /* break; */ $s = 3; continue; } if ((x$5 = (new $Int64(0, b.$length)), (x$5.$high > maxFormSize.$high || (x$5.$high === maxFormSize.$high && x$5.$low > maxFormSize.$low)))) { err = errors.New("http: POST too large"); $s = -1; return [vs, err]; } _r$4 = url.ParseQuery(($bytesToString(b))); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$3 = _r$4; vs = _tuple$3[0]; e = _tuple$3[1]; if ($interfaceIsEqual(err, $ifaceNil)) { err = e; } $s = 6; continue; /* } else if (ct === "multipart/form-data") { */ case 5: /* } */ case 6: case 3: $s = -1; return [vs, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: parsePostForm }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.b = b; $f.ct = ct; $f.e = e; $f.err = err; $f.maxFormSize = maxFormSize; $f.ok = ok; $f.r = r; $f.reader = reader; $f.vs = vs; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; Request.ptr.prototype.ParseForm = function() { var _r$1, _r$2, _tuple, _tuple$1, e, err, newValues, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; e = $f.e; err = $f.err; newValues = $f.newValues; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; err = $ifaceNil; /* */ if (r.PostForm === false) { $s = 1; continue; } /* */ $s = 2; continue; /* if (r.PostForm === false) { */ case 1: /* */ if (r.Method === "POST" || r.Method === "PUT" || r.Method === "PATCH") { $s = 3; continue; } /* */ $s = 4; continue; /* if (r.Method === "POST" || r.Method === "PUT" || r.Method === "PATCH") { */ case 3: _r$1 = parsePostForm(r); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; r.PostForm = _tuple[0]; err = _tuple[1]; /* } */ case 4: if (r.PostForm === false) { r.PostForm = {}; } /* } */ case 2: /* */ if (r.Form === false) { $s = 6; continue; } /* */ $s = 7; continue; /* if (r.Form === false) { */ case 6: if ($keys(r.PostForm).length > 0) { r.Form = {}; copyValues(r.Form, r.PostForm); } newValues = false; /* */ if (!(r.URL === ptrType$17.nil)) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!(r.URL === ptrType$17.nil)) { */ case 8: e = $ifaceNil; _r$2 = url.ParseQuery(r.URL.RawQuery); /* */ $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; newValues = _tuple$1[0]; e = _tuple$1[1]; if ($interfaceIsEqual(err, $ifaceNil)) { err = e; } /* } */ case 9: if (newValues === false) { newValues = {}; } if (r.Form === false) { r.Form = newValues; } else { copyValues(r.Form, newValues); } /* } */ case 7: $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: Request.ptr.prototype.ParseForm }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.e = e; $f.err = err; $f.newValues = newValues; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Request.prototype.ParseForm = function() { return this.$val.ParseForm(); }; Request.ptr.prototype.ParseMultipartForm = function(maxMemory) { var _entry, _entry$1, _entry$2, _i, _key, _key$1, _keys, _r$1, _r$2, _r$3, _ref, _tuple, _tuple$1, err, f, k, maxMemory, mr, parseFormErr, r, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _entry$2 = $f._entry$2; _i = $f._i; _key = $f._key; _key$1 = $f._key$1; _keys = $f._keys; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; err = $f.err; f = $f.f; k = $f.k; maxMemory = $f.maxMemory; mr = $f.mr; parseFormErr = $f.parseFormErr; r = $f.r; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; if (r.MultipartForm === multipartByReader) { $s = -1; return errors.New("http: multipart handled by MultipartReader"); } parseFormErr = $ifaceNil; /* */ if (r.Form === false) { $s = 1; continue; } /* */ $s = 2; continue; /* if (r.Form === false) { */ case 1: _r$1 = r.ParseForm(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } parseFormErr = _r$1; /* } */ case 2: if (!(r.MultipartForm === ptrType$31.nil)) { $s = -1; return $ifaceNil; } _r$2 = r.multipartReader(false); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; mr = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _r$3 = mr.ReadForm(maxMemory); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$1 = _r$3; f = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } if (r.PostForm === false) { r.PostForm = {}; } _ref = f.Value; _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; _key = k; (r.Form || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: $appendSlice((_entry$1 = r.Form[$String.keyFor(k)], _entry$1 !== undefined ? _entry$1.v : sliceType$2.nil), v) }; _key$1 = k; (r.PostForm || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key$1)] = { k: _key$1, v: $appendSlice((_entry$2 = r.PostForm[$String.keyFor(k)], _entry$2 !== undefined ? _entry$2.v : sliceType$2.nil), v) }; _i++; } r.MultipartForm = f; $s = -1; return parseFormErr; /* */ } return; } if ($f === undefined) { $f = { $blk: Request.ptr.prototype.ParseMultipartForm }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._entry$2 = _entry$2; $f._i = _i; $f._key = _key; $f._key$1 = _key$1; $f._keys = _keys; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.err = err; $f.f = f; $f.k = k; $f.maxMemory = maxMemory; $f.mr = mr; $f.parseFormErr = parseFormErr; $f.r = r; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Request.prototype.ParseMultipartForm = function(maxMemory) { return this.$val.ParseMultipartForm(maxMemory); }; Request.ptr.prototype.FormValue = function(key) { var _entry, _r$1, key, r, vs, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _r$1 = $f._r$1; key = $f.key; r = $f.r; vs = $f.vs; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; /* */ if (r.Form === false) { $s = 1; continue; } /* */ $s = 2; continue; /* if (r.Form === false) { */ case 1: _r$1 = r.ParseMultipartForm(new $Int64(0, 33554432)); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; /* } */ case 2: vs = (_entry = r.Form[$String.keyFor(key)], _entry !== undefined ? _entry.v : sliceType$2.nil); if (vs.$length > 0) { $s = -1; return (0 >= vs.$length ? ($throwRuntimeError("index out of range"), undefined) : vs.$array[vs.$offset + 0]); } $s = -1; return ""; /* */ } return; } if ($f === undefined) { $f = { $blk: Request.ptr.prototype.FormValue }; } $f._entry = _entry; $f._r$1 = _r$1; $f.key = key; $f.r = r; $f.vs = vs; $f.$s = $s; $f.$r = $r; return $f; }; Request.prototype.FormValue = function(key) { return this.$val.FormValue(key); }; Request.ptr.prototype.PostFormValue = function(key) { var _entry, _r$1, key, r, vs, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _r$1 = $f._r$1; key = $f.key; r = $f.r; vs = $f.vs; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; /* */ if (r.PostForm === false) { $s = 1; continue; } /* */ $s = 2; continue; /* if (r.PostForm === false) { */ case 1: _r$1 = r.ParseMultipartForm(new $Int64(0, 33554432)); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; /* } */ case 2: vs = (_entry = r.PostForm[$String.keyFor(key)], _entry !== undefined ? _entry.v : sliceType$2.nil); if (vs.$length > 0) { $s = -1; return (0 >= vs.$length ? ($throwRuntimeError("index out of range"), undefined) : vs.$array[vs.$offset + 0]); } $s = -1; return ""; /* */ } return; } if ($f === undefined) { $f = { $blk: Request.ptr.prototype.PostFormValue }; } $f._entry = _entry; $f._r$1 = _r$1; $f.key = key; $f.r = r; $f.vs = vs; $f.$s = $s; $f.$r = $r; return $f; }; Request.prototype.PostFormValue = function(key) { return this.$val.PostFormValue(key); }; Request.ptr.prototype.FormFile = function(key) { var _entry, _r$1, _r$2, _tuple, err, err$1, f, fhs, key, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; err = $f.err; err$1 = $f.err$1; f = $f.f; fhs = $f.fhs; key = $f.key; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; if (r.MultipartForm === multipartByReader) { $s = -1; return [$ifaceNil, ptrType$66.nil, errors.New("http: multipart handled by MultipartReader")]; } /* */ if (r.MultipartForm === ptrType$31.nil) { $s = 1; continue; } /* */ $s = 2; continue; /* if (r.MultipartForm === ptrType$31.nil) { */ case 1: _r$1 = r.ParseMultipartForm(new $Int64(0, 33554432)); /* */ $s = 3; case 3: 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))) { $s = -1; return [$ifaceNil, ptrType$66.nil, err]; } /* } */ case 2: /* */ if (!(r.MultipartForm === ptrType$31.nil) && !(r.MultipartForm.File === false)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!(r.MultipartForm === ptrType$31.nil) && !(r.MultipartForm.File === false)) { */ case 4: fhs = (_entry = r.MultipartForm.File[$String.keyFor(key)], _entry !== undefined ? _entry.v : sliceType$20.nil); /* */ if (fhs.$length > 0) { $s = 6; continue; } /* */ $s = 7; continue; /* if (fhs.$length > 0) { */ case 6: _r$2 = (0 >= fhs.$length ? ($throwRuntimeError("index out of range"), undefined) : fhs.$array[fhs.$offset + 0]).Open(); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; f = _tuple[0]; err$1 = _tuple[1]; $s = -1; return [f, (0 >= fhs.$length ? ($throwRuntimeError("index out of range"), undefined) : fhs.$array[fhs.$offset + 0]), err$1]; /* } */ case 7: /* } */ case 5: $s = -1; return [$ifaceNil, ptrType$66.nil, $pkg.ErrMissingFile]; /* */ } return; } if ($f === undefined) { $f = { $blk: Request.ptr.prototype.FormFile }; } $f._entry = _entry; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.err = err; $f.err$1 = err$1; $f.f = f; $f.fhs = fhs; $f.key = key; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Request.prototype.FormFile = function(key) { return this.$val.FormFile(key); }; Request.ptr.prototype.expectsContinue = function() { var r; r = this; return hasToken(new Header(r.Header).get("Expect"), "100-continue"); }; Request.prototype.expectsContinue = function() { return this.$val.expectsContinue(); }; Request.ptr.prototype.wantsHttp10KeepAlive = function() { var r; r = this; if (!((r.ProtoMajor === 1)) || !((r.ProtoMinor === 0))) { return false; } return hasToken(new Header(r.Header).get("Connection"), "keep-alive"); }; Request.prototype.wantsHttp10KeepAlive = function() { return this.$val.wantsHttp10KeepAlive(); }; Request.ptr.prototype.wantsClose = function() { var r; r = this; if (r.Close) { return true; } return hasToken(new Header(r.Header).get("Connection"), "close"); }; Request.prototype.wantsClose = function() { return this.$val.wantsClose(); }; Request.ptr.prototype.closeBody = function() { var $24r, _r$1, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; if ($interfaceIsEqual(r.Body, $ifaceNil)) { $s = -1; return $ifaceNil; } _r$1 = r.Body.Close(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Request.ptr.prototype.closeBody }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Request.prototype.closeBody = function() { return this.$val.closeBody(); }; Request.ptr.prototype.isReplayable = function() { var _1, r; r = this; if ($interfaceIsEqual(r.Body, $ifaceNil) || $interfaceIsEqual(r.Body, new $pkg.NoBody.constructor.elem($pkg.NoBody)) || !(r.GetBody === $throwNilPointerError)) { _1 = valueOrDefault(r.Method, "GET"); if (_1 === ("GET") || _1 === ("HEAD") || _1 === ("OPTIONS") || _1 === ("TRACE")) { return true; } if (new Header(r.Header).has("Idempotency-Key") || new Header(r.Header).has("X-Idempotency-Key")) { return true; } } return false; }; Request.prototype.isReplayable = function() { return this.$val.isReplayable(); }; Request.ptr.prototype.outgoingLength = function() { var r, x$5; r = this; if ($interfaceIsEqual(r.Body, $ifaceNil) || $interfaceIsEqual(r.Body, new $pkg.NoBody.constructor.elem($pkg.NoBody))) { return new $Int64(0, 0); } if (!((x$5 = r.ContentLength, (x$5.$high === 0 && x$5.$low === 0)))) { return r.ContentLength; } return new $Int64(-1, 4294967295); }; Request.prototype.outgoingLength = function() { return this.$val.outgoingLength(); }; requestMethodUsuallyLacksBody = function(method) { var _1, method; _1 = method; if (_1 === ("GET") || _1 === ("HEAD") || _1 === ("DELETE") || _1 === ("OPTIONS") || _1 === ("PROPFIND") || _1 === ("SEARCH")) { return true; } return false; }; Request.ptr.prototype.requiresHTTP1 = function() { var $24r, _r$1, _r$2, _r$3, _r$4, _v, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _v = $f._v; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r$1 = new Header(r.Header).Get("Connection"); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = hasToken(_r$1, "upgrade"); /* */ $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)) { _v = false; $s = 1; continue s; } _r$3 = new Header(r.Header).Get("Upgrade"); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = ascii.EqualFold(_r$3, "websocket"); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _v = _r$4; case 1: $24r = _v; $s = 6; case 6: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Request.ptr.prototype.requiresHTTP1 }; } $f.$24r = $24r; $f._r$1 = _r$1; $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.$r = $r; return $f; }; Request.prototype.requiresHTTP1 = function() { return this.$val.requiresHTTP1(); }; contextKey.ptr.prototype.String = function() { var k; k = this; return "net/http context value " + k.name; }; contextKey.prototype.String = function() { return this.$val.String(); }; hasPort = function(s) { var s; return strings.LastIndex(s, ":") > strings.LastIndex(s, "]"); }; removeEmptyPort = function(host) { var host; if (hasPort(host)) { return strings.TrimSuffix(host, ":"); } return host; }; isNotToken = function(r) { var r; return !httpguts.IsTokenRune(r); }; stringContainsCTLByte = function(s) { var b, i, s; i = 0; while (true) { if (!(i < s.length)) { break; } b = s.charCodeAt(i); if (b < 32 || (b === 127)) { return true; } i = i + (1) >> 0; } return false; }; hexEscapeNonASCII = function(s) { var b, i, i$1, newLen, s; newLen = 0; i = 0; while (true) { if (!(i < s.length)) { break; } if (s.charCodeAt(i) >= 128) { newLen = newLen + (3) >> 0; } else { newLen = newLen + (1) >> 0; } i = i + (1) >> 0; } if (newLen === s.length) { return s; } b = $makeSlice(sliceType$3, 0, newLen); i$1 = 0; while (true) { if (!(i$1 < s.length)) { break; } if (s.charCodeAt(i$1) >= 128) { b = $append(b, 37); b = strconv.AppendInt(b, (new $Int64(0, s.charCodeAt(i$1))), 16); } else { b = $append(b, s.charCodeAt(i$1)); } i$1 = i$1 + (1) >> 0; } return ($bytesToString(b)); }; noBody.ptr.prototype.Read = function(param) { var param; return [0, io.EOF]; }; noBody.prototype.Read = function(param) { return this.$val.Read(param); }; noBody.ptr.prototype.Close = function() { return $ifaceNil; }; noBody.prototype.Close = function() { return this.$val.Close(); }; noBody.ptr.prototype.WriteTo = function(param) { var param; return [new $Int64(0, 0), $ifaceNil]; }; noBody.prototype.WriteTo = function(param) { return this.$val.WriteTo(param); }; Header.prototype.Add = function(key, value) { var h, key, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; h = $f.h; key = $f.key; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: h = this.$val; $r = new textproto.MIMEHeader((h)).Add(key, value); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Header.prototype.Add }; } $f.h = h; $f.key = key; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Header).prototype.Add = function(key, value) { return new Header(this.$get()).Add(key, value); }; Header.prototype.Set = function(key, value) { var h, key, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; h = $f.h; key = $f.key; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: h = this.$val; $r = new textproto.MIMEHeader((h)).Set(key, value); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Header.prototype.Set }; } $f.h = h; $f.key = key; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Header).prototype.Set = function(key, value) { return new Header(this.$get()).Set(key, value); }; Header.prototype.Get = function(key) { var $24r, _r$1, h, key, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; h = $f.h; key = $f.key; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: h = this.$val; _r$1 = new textproto.MIMEHeader((h)).Get(key); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Header.prototype.Get }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.h = h; $f.key = key; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Header).prototype.Get = function(key) { return new Header(this.$get()).Get(key); }; Header.prototype.Values = function(key) { var $24r, _r$1, h, key, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; h = $f.h; key = $f.key; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: h = this.$val; _r$1 = new textproto.MIMEHeader((h)).Values(key); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Header.prototype.Values }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.h = h; $f.key = key; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Header).prototype.Values = function(key) { return new Header(this.$get()).Values(key); }; Header.prototype.get = function(key) { var _entry, h, key, v; h = this.$val; v = (_entry = h[$String.keyFor(key)], _entry !== undefined ? _entry.v : sliceType$2.nil); if (v.$length > 0) { return (0 >= v.$length ? ($throwRuntimeError("index out of range"), undefined) : v.$array[v.$offset + 0]); } return ""; }; $ptrType(Header).prototype.get = function(key) { return new Header(this.$get()).get(key); }; Header.prototype.has = function(key) { var _entry, _tuple, h, key, ok; h = this.$val; _tuple = (_entry = h[$String.keyFor(key)], _entry !== undefined ? [_entry.v, true] : [sliceType$2.nil, false]); ok = _tuple[1]; return ok; }; $ptrType(Header).prototype.has = function(key) { return new Header(this.$get()).has(key); }; Header.prototype.Del = function(key) { var h, key, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; h = $f.h; key = $f.key; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: h = this.$val; $r = new textproto.MIMEHeader((h)).Del(key); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Header.prototype.Del }; } $f.h = h; $f.key = key; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Header).prototype.Del = function(key) { return new Header(this.$get()).Del(key); }; Header.prototype.Write = function(w) { var $24r, _r$1, h, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; h = $f.h; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: h = this.$val; _r$1 = new Header(h).write(w, ptrType$19.nil); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Header.prototype.Write }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.h = h; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Header).prototype.Write = function(w) { return new Header(this.$get()).Write(w); }; Header.prototype.write = function(w, trace) { var $24r, _r$1, h, trace, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; h = $f.h; trace = $f.trace; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: h = this.$val; _r$1 = new Header(h).writeSubset(w, false, trace); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Header.prototype.write }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.h = h; $f.trace = trace; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Header).prototype.write = function(w, trace) { return new Header(this.$get()).write(w, trace); }; Header.prototype.Clone = function() { var _entry, _entry$1, _i, _i$1, _key, _keys, _keys$1, _ref, _ref$1, h, h2, k, n, nv, sv, vv, vv$1, x$5; h = this.$val; if (h === false) { return false; } nv = 0; _ref = h; _i = 0; _keys = $keys(_ref); while (true) { if (!(_i < _keys.length)) { break; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; continue; } vv = _entry.v; nv = nv + (vv.$length) >> 0; _i++; } sv = $makeSlice(sliceType$2, nv); h2 = (x$5 = $keys(h).length, ((x$5 < 0 || x$5 > 2147483647) ? $throwRuntimeError("makemap: size out of range") : {})); _ref$1 = h; _i$1 = 0; _keys$1 = $keys(_ref$1); while (true) { if (!(_i$1 < _keys$1.length)) { break; } _entry$1 = _ref$1[_keys$1[_i$1]]; if (_entry$1 === undefined) { _i$1++; continue; } k = _entry$1.k; vv$1 = _entry$1.v; n = $copySlice(sv, vv$1); _key = k; (h2 || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: $subslice(sv, 0, n, n) }; sv = $subslice(sv, n); _i$1++; } return h2; }; $ptrType(Header).prototype.Clone = function() { return new Header(this.$get()).Clone(); }; stringWriter.ptr.prototype.WriteString = function(s) { var $24r, _r$1, _tuple, err, n, s, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; n = $f.n; s = $f.s; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; w = this; _r$1 = w.w.Write((new sliceType$3($stringToBytes(s)))); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err = _tuple[1]; $24r = [n, err]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: stringWriter.ptr.prototype.WriteString }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.n = n; $f.s = s; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; stringWriter.prototype.WriteString = function(s) { return this.$val.WriteString(s); }; headerSorter.ptr.prototype.Len = function() { var s; s = this; return s.kvs.$length; }; headerSorter.prototype.Len = function() { return this.$val.Len(); }; headerSorter.ptr.prototype.Swap = function(i, j) { var _tmp, _tmp$1, i, j, s, x$5, x$6, x$7, x$8; s = this; _tmp = $clone((x$5 = s.kvs, ((j < 0 || j >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + j])), keyValues); _tmp$1 = $clone((x$6 = s.kvs, ((i < 0 || i >= x$6.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$6.$array[x$6.$offset + i])), keyValues); keyValues.copy((x$7 = s.kvs, ((i < 0 || i >= x$7.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$7.$array[x$7.$offset + i])), _tmp); keyValues.copy((x$8 = s.kvs, ((j < 0 || j >= x$8.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$8.$array[x$8.$offset + j])), _tmp$1); }; headerSorter.prototype.Swap = function(i, j) { return this.$val.Swap(i, j); }; headerSorter.ptr.prototype.Less = function(i, j) { var i, j, s, x$5, x$6; s = this; return (x$5 = s.kvs, ((i < 0 || i >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + i])).key < (x$6 = s.kvs, ((j < 0 || j >= x$6.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$6.$array[x$6.$offset + j])).key; }; headerSorter.prototype.Less = function(i, j) { return this.$val.Less(i, j); }; Header.prototype.sortedKeyValues = function(exclude) { var _entry, _entry$1, _i, _keys, _r$1, _ref, _tmp, _tmp$1, exclude, h, hs, k, kvs, vv, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _i = $f._i; _keys = $f._keys; _r$1 = $f._r$1; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; exclude = $f.exclude; h = $f.h; hs = $f.hs; k = $f.k; kvs = $f.kvs; vv = $f.vv; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: kvs = sliceType$6.nil; hs = ptrType$67.nil; h = this.$val; _r$1 = headerSorterPool.Get(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } hs = $assertType(_r$1, ptrType$67); if (hs.kvs.$capacity < $keys(h).length) { hs.kvs = $makeSlice(sliceType$6, 0, $keys(h).length); } kvs = $subslice(hs.kvs, 0, 0); _ref = h; _i = 0; _keys = $keys(_ref); while (true) { if (!(_i < _keys.length)) { break; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; continue; } k = _entry.k; vv = _entry.v; if (!(_entry$1 = exclude[$String.keyFor(k)], _entry$1 !== undefined ? _entry$1.v : false)) { kvs = $append(kvs, new keyValues.ptr(k, vv)); } _i++; } hs.kvs = kvs; $r = sort.Sort(hs); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp = kvs; _tmp$1 = hs; kvs = _tmp; hs = _tmp$1; $s = -1; return [kvs, hs]; /* */ } return; } if ($f === undefined) { $f = { $blk: Header.prototype.sortedKeyValues }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._i = _i; $f._keys = _keys; $f._r$1 = _r$1; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.exclude = exclude; $f.h = h; $f.hs = hs; $f.k = k; $f.kvs = kvs; $f.vv = vv; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Header).prototype.sortedKeyValues = function(exclude) { return new Header(this.$get()).sortedKeyValues(exclude); }; Header.prototype.WriteSubset = function(w, exclude) { var $24r, _r$1, exclude, h, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; exclude = $f.exclude; h = $f.h; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: h = this.$val; _r$1 = new Header(h).writeSubset(w, exclude, ptrType$19.nil); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Header.prototype.WriteSubset }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.exclude = exclude; $f.h = h; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Header).prototype.WriteSubset = function(w, exclude) { return new Header(this.$get()).WriteSubset(w, exclude); }; Header.prototype.writeSubset = function(w, exclude, trace) { var _i, _i$1, _i$2, _r$1, _r$2, _r$3, _ref, _ref$1, _ref$2, _tuple, _tuple$1, _tuple$2, err, exclude, formattedVals, h, kv, kvs, ok, s, sorter, trace, v, w, ws, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _i$1 = $f._i$1; _i$2 = $f._i$2; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; _ref$1 = $f._ref$1; _ref$2 = $f._ref$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; err = $f.err; exclude = $f.exclude; formattedVals = $f.formattedVals; h = $f.h; kv = $f.kv; kvs = $f.kvs; ok = $f.ok; s = $f.s; sorter = $f.sorter; trace = $f.trace; v = $f.v; w = $f.w; ws = $f.ws; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: h = this.$val; _tuple = $assertType(w, io.StringWriter, true); ws = _tuple[0]; ok = _tuple[1]; if (!ok) { ws = (x$5 = new stringWriter.ptr(w), new x$5.constructor.elem(x$5)); } _r$1 = new Header(h).sortedKeyValues(exclude); /* */ $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; kvs = _tuple$1[0]; sorter = _tuple$1[1]; formattedVals = sliceType$2.nil; _ref = kvs; _i = 0; /* while (true) { */ case 2: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 3; continue; } kv = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), keyValues); _ref$1 = kv.values; _i$1 = 0; /* while (true) { */ case 4: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 5; continue; } v = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); _r$2 = headerNewlineToSpace.Replace(v); /* */ $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; v = textproto.TrimString(v); _ref$2 = new sliceType$2([kv.key, ": ", v, "\r\n"]); _i$2 = 0; /* while (true) { */ case 7: /* if (!(_i$2 < _ref$2.$length)) { break; } */ if(!(_i$2 < _ref$2.$length)) { $s = 8; continue; } s = ((_i$2 < 0 || _i$2 >= _ref$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$2.$array[_ref$2.$offset + _i$2]); _r$3 = ws.WriteString(s); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$2 = _r$3; err = _tuple$2[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { headerSorterPool.Put(sorter); $s = -1; return err; } _i$2++; $s = 7; continue; case 8: if (!(trace === ptrType$19.nil) && !(trace.WroteHeaderField === $throwNilPointerError)) { formattedVals = $append(formattedVals, v); } _i$1++; $s = 4; continue; case 5: /* */ if (!(trace === ptrType$19.nil) && !(trace.WroteHeaderField === $throwNilPointerError)) { $s = 10; continue; } /* */ $s = 11; continue; /* if (!(trace === ptrType$19.nil) && !(trace.WroteHeaderField === $throwNilPointerError)) { */ case 10: $r = trace.WroteHeaderField(kv.key, formattedVals); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } formattedVals = sliceType$2.nil; /* } */ case 11: _i++; $s = 2; continue; case 3: headerSorterPool.Put(sorter); $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Header.prototype.writeSubset }; } $f._i = _i; $f._i$1 = _i$1; $f._i$2 = _i$2; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._ref = _ref; $f._ref$1 = _ref$1; $f._ref$2 = _ref$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.err = err; $f.exclude = exclude; $f.formattedVals = formattedVals; $f.h = h; $f.kv = kv; $f.kvs = kvs; $f.ok = ok; $f.s = s; $f.sorter = sorter; $f.trace = trace; $f.v = v; $f.w = w; $f.ws = ws; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(Header).prototype.writeSubset = function(w, exclude, trace) { return new Header(this.$get()).writeSubset(w, exclude, trace); }; CanonicalHeaderKey = function(s) { var $24r, _r$1, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = textproto.CanonicalMIMEHeaderKey(s); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: CanonicalHeaderKey }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.CanonicalHeaderKey = CanonicalHeaderKey; hasToken = function(v, token) { var b, endPos, sp, token, v; if (token.length > v.length || token === "") { return false; } if (v === token) { return true; } sp = 0; while (true) { if (!(sp <= (v.length - token.length >> 0))) { break; } b = v.charCodeAt(sp); if (!((b === token.charCodeAt(0))) && !((((b | 32) >>> 0) === token.charCodeAt(0)))) { sp = sp + (1) >> 0; continue; } if (sp > 0 && !isTokenBoundary(v.charCodeAt((sp - 1 >> 0)))) { sp = sp + (1) >> 0; continue; } endPos = sp + token.length >> 0; if (!((endPos === v.length)) && !isTokenBoundary(v.charCodeAt(endPos))) { sp = sp + (1) >> 0; continue; } if (ascii.EqualFold($substring(v, sp, (sp + token.length >> 0)), token)) { return true; } sp = sp + (1) >> 0; } return false; }; isTokenBoundary = function(b) { var b; return (b === 32) || (b === 44) || (b === 9); }; http2asciiEqualFold = function(s, t) { var i, s, t; if (!((s.length === t.length))) { return false; } i = 0; while (true) { if (!(i < s.length)) { break; } if (!((http2lower(s.charCodeAt(i)) === http2lower(t.charCodeAt(i))))) { return false; } i = i + (1) >> 0; } return true; }; http2lower = function(b) { var b; if (65 <= b && b <= 90) { return b + 32 << 24 >>> 24; } return b; }; http2isASCIIPrint = function(s) { var i, s; i = 0; while (true) { if (!(i < s.length)) { break; } if (s.charCodeAt(i) < 32 || s.charCodeAt(i) > 126) { return false; } i = i + (1) >> 0; } return true; }; http2asciiToLower = function(s) { var $24r, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, lower, ok, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; lower = $f.lower; ok = $f.ok; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: lower = ""; ok = false; if (!http2isASCIIPrint(s)) { _tmp = ""; _tmp$1 = false; lower = _tmp; ok = _tmp$1; $s = -1; return [lower, ok]; } _r$1 = strings.ToLower(s); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tmp$2 = _r$1; _tmp$3 = true; lower = _tmp$2; ok = _tmp$3; $24r = [lower, ok]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2asciiToLower }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f.lower = lower; $f.ok = ok; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; http2isBadCipher = function(cipher) { var _1, cipher; _1 = cipher; if ((_1 === (0)) || (_1 === (1)) || (_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6)) || (_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12)) || (_1 === (13)) || (_1 === (14)) || (_1 === (15)) || (_1 === (16)) || (_1 === (17)) || (_1 === (18)) || (_1 === (19)) || (_1 === (20)) || (_1 === (21)) || (_1 === (22)) || (_1 === (23)) || (_1 === (24)) || (_1 === (25)) || (_1 === (26)) || (_1 === (27)) || (_1 === (30)) || (_1 === (31)) || (_1 === (32)) || (_1 === (33)) || (_1 === (34)) || (_1 === (35)) || (_1 === (36)) || (_1 === (37)) || (_1 === (38)) || (_1 === (39)) || (_1 === (40)) || (_1 === (41)) || (_1 === (42)) || (_1 === (43)) || (_1 === (44)) || (_1 === (45)) || (_1 === (46)) || (_1 === (47)) || (_1 === (48)) || (_1 === (49)) || (_1 === (50)) || (_1 === (51)) || (_1 === (52)) || (_1 === (53)) || (_1 === (54)) || (_1 === (55)) || (_1 === (56)) || (_1 === (57)) || (_1 === (58)) || (_1 === (59)) || (_1 === (60)) || (_1 === (61)) || (_1 === (62)) || (_1 === (63)) || (_1 === (64)) || (_1 === (65)) || (_1 === (66)) || (_1 === (67)) || (_1 === (68)) || (_1 === (69)) || (_1 === (70)) || (_1 === (103)) || (_1 === (104)) || (_1 === (105)) || (_1 === (106)) || (_1 === (107)) || (_1 === (108)) || (_1 === (109)) || (_1 === (132)) || (_1 === (133)) || (_1 === (134)) || (_1 === (135)) || (_1 === (136)) || (_1 === (137)) || (_1 === (138)) || (_1 === (139)) || (_1 === (140)) || (_1 === (141)) || (_1 === (142)) || (_1 === (143)) || (_1 === (144)) || (_1 === (145)) || (_1 === (146)) || (_1 === (147)) || (_1 === (148)) || (_1 === (149)) || (_1 === (150)) || (_1 === (151)) || (_1 === (152)) || (_1 === (153)) || (_1 === (154)) || (_1 === (155)) || (_1 === (156)) || (_1 === (157)) || (_1 === (160)) || (_1 === (161)) || (_1 === (164)) || (_1 === (165)) || (_1 === (166)) || (_1 === (167)) || (_1 === (168)) || (_1 === (169)) || (_1 === (172)) || (_1 === (173)) || (_1 === (174)) || (_1 === (175)) || (_1 === (176)) || (_1 === (177)) || (_1 === (178)) || (_1 === (179)) || (_1 === (180)) || (_1 === (181)) || (_1 === (182)) || (_1 === (183)) || (_1 === (184)) || (_1 === (185)) || (_1 === (186)) || (_1 === (187)) || (_1 === (188)) || (_1 === (189)) || (_1 === (190)) || (_1 === (191)) || (_1 === (192)) || (_1 === (193)) || (_1 === (194)) || (_1 === (195)) || (_1 === (196)) || (_1 === (197)) || (_1 === (255)) || (_1 === (49153)) || (_1 === (49154)) || (_1 === (49155)) || (_1 === (49156)) || (_1 === (49157)) || (_1 === (49158)) || (_1 === (49159)) || (_1 === (49160)) || (_1 === (49161)) || (_1 === (49162)) || (_1 === (49163)) || (_1 === (49164)) || (_1 === (49165)) || (_1 === (49166)) || (_1 === (49167)) || (_1 === (49168)) || (_1 === (49169)) || (_1 === (49170)) || (_1 === (49171)) || (_1 === (49172)) || (_1 === (49173)) || (_1 === (49174)) || (_1 === (49175)) || (_1 === (49176)) || (_1 === (49177)) || (_1 === (49178)) || (_1 === (49179)) || (_1 === (49180)) || (_1 === (49181)) || (_1 === (49182)) || (_1 === (49183)) || (_1 === (49184)) || (_1 === (49185)) || (_1 === (49186)) || (_1 === (49187)) || (_1 === (49188)) || (_1 === (49189)) || (_1 === (49190)) || (_1 === (49191)) || (_1 === (49192)) || (_1 === (49193)) || (_1 === (49194)) || (_1 === (49197)) || (_1 === (49198)) || (_1 === (49201)) || (_1 === (49202)) || (_1 === (49203)) || (_1 === (49204)) || (_1 === (49205)) || (_1 === (49206)) || (_1 === (49207)) || (_1 === (49208)) || (_1 === (49209)) || (_1 === (49210)) || (_1 === (49211)) || (_1 === (49212)) || (_1 === (49213)) || (_1 === (49214)) || (_1 === (49215)) || (_1 === (49216)) || (_1 === (49217)) || (_1 === (49218)) || (_1 === (49219)) || (_1 === (49220)) || (_1 === (49221)) || (_1 === (49222)) || (_1 === (49223)) || (_1 === (49224)) || (_1 === (49225)) || (_1 === (49226)) || (_1 === (49227)) || (_1 === (49228)) || (_1 === (49229)) || (_1 === (49230)) || (_1 === (49231)) || (_1 === (49232)) || (_1 === (49233)) || (_1 === (49236)) || (_1 === (49237)) || (_1 === (49240)) || (_1 === (49241)) || (_1 === (49242)) || (_1 === (49243)) || (_1 === (49246)) || (_1 === (49247)) || (_1 === (49250)) || (_1 === (49251)) || (_1 === (49252)) || (_1 === (49253)) || (_1 === (49254)) || (_1 === (49255)) || (_1 === (49256)) || (_1 === (49257)) || (_1 === (49258)) || (_1 === (49259)) || (_1 === (49262)) || (_1 === (49263)) || (_1 === (49264)) || (_1 === (49265)) || (_1 === (49266)) || (_1 === (49267)) || (_1 === (49268)) || (_1 === (49269)) || (_1 === (49270)) || (_1 === (49271)) || (_1 === (49272)) || (_1 === (49273)) || (_1 === (49274)) || (_1 === (49275)) || (_1 === (49278)) || (_1 === (49279)) || (_1 === (49282)) || (_1 === (49283)) || (_1 === (49284)) || (_1 === (49285)) || (_1 === (49288)) || (_1 === (49289)) || (_1 === (49292)) || (_1 === (49293)) || (_1 === (49294)) || (_1 === (49295)) || (_1 === (49298)) || (_1 === (49299)) || (_1 === (49300)) || (_1 === (49301)) || (_1 === (49302)) || (_1 === (49303)) || (_1 === (49304)) || (_1 === (49305)) || (_1 === (49306)) || (_1 === (49307)) || (_1 === (49308)) || (_1 === (49309)) || (_1 === (49312)) || (_1 === (49313)) || (_1 === (49316)) || (_1 === (49317)) || (_1 === (49320)) || (_1 === (49321))) { return true; } else { return false; } }; http2clientConnPool.ptr.prototype.GetClientConn = function(req, addr) { var $24r, _r$1, addr, p, req, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; addr = $f.addr; p = $f.p; req = $f.req; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; _r$1 = p.getClientConn(req, addr, true); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2clientConnPool.ptr.prototype.GetClientConn }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.addr = addr; $f.p = p; $f.req = req; $f.$s = $s; $f.$r = $r; return $f; }; http2clientConnPool.prototype.GetClientConn = function(req, addr) { return this.$val.GetClientConn(req, addr); }; http2clientConnPool.ptr.prototype.shouldTraceGetConn = function(st) { var _tuple, ok, p, st; p = this; _tuple = $assertType(p.t.ConnPool, http2noDialClientConnPool, true); ok = _tuple[1]; if (!ok) { return true; } return !st.freshConn; }; http2clientConnPool.prototype.shouldTraceGetConn = function(st) { return this.$val.shouldTraceGetConn(st); }; http2clientConnPool.ptr.prototype.getClientConn = function(req, addr, dialOnMiss) { var _entry, _i, _r$1, _r$2, _r$3, _r$4, _ref, _tuple, addr, call, cc, cc$1, dialOnMiss, err, p, req, st, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _i = $f._i; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _ref = $f._ref; _tuple = $f._tuple; addr = $f.addr; call = $f.call; cc = $f.cc; cc$1 = $f.cc$1; dialOnMiss = $f.dialOnMiss; err = $f.err; p = $f.p; req = $f.req; st = $f.st; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; /* */ if (http2isConnectionCloseRequest(req) && dialOnMiss) { $s = 1; continue; } /* */ $s = 2; continue; /* if (http2isConnectionCloseRequest(req) && dialOnMiss) { */ case 1: $r = http2traceGetConn(req, addr); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = p.t.dialClientConn(req.Context(), addr, true); /* */ $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; cc = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$68.nil, err]; } $s = -1; return [cc, $ifaceNil]; /* } */ case 2: /* while (true) { */ case 5: $r = p.mu.Lock(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _ref = (_entry = p.conns[$String.keyFor(addr)], _entry !== undefined ? _entry.v : sliceType$21.nil); _i = 0; /* while (true) { */ case 8: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 9; continue; } cc$1 = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r$2 = cc$1.idleState(); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } st = $clone(_r$2, http2clientConnIdleState); /* */ if (st.canTakeNewRequest) { $s = 11; continue; } /* */ $s = 12; continue; /* if (st.canTakeNewRequest) { */ case 11: /* */ if (p.shouldTraceGetConn($clone(st, http2clientConnIdleState))) { $s = 13; continue; } /* */ $s = 14; continue; /* if (p.shouldTraceGetConn($clone(st, http2clientConnIdleState))) { */ case 13: $r = http2traceGetConn(req, addr); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 14: $r = p.mu.Unlock(); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return [cc$1, $ifaceNil]; /* } */ case 12: _i++; $s = 8; continue; case 9: /* */ if (!dialOnMiss) { $s = 17; continue; } /* */ $s = 18; continue; /* if (!dialOnMiss) { */ case 17: $r = p.mu.Unlock(); /* */ $s = 19; case 19: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return [ptrType$68.nil, http2ErrNoCachedConn]; /* } */ case 18: $r = http2traceGetConn(req, addr); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } call = p.getStartDialLocked(req.Context(), addr); $r = p.mu.Unlock(); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$3 = $recv(call.done); /* */ $s = 22; case 22: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3[0]; _r$4 = http2shouldRetryDial(call, req); /* */ $s = 25; case 25: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } /* */ if (_r$4) { $s = 23; continue; } /* */ $s = 24; continue; /* if (_r$4) { */ case 23: /* continue; */ $s = 5; continue; /* } */ case 24: $s = -1; return [call.res, call.err]; case 6: $s = -1; return [ptrType$68.nil, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: http2clientConnPool.ptr.prototype.getClientConn }; } $f._entry = _entry; $f._i = _i; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._ref = _ref; $f._tuple = _tuple; $f.addr = addr; $f.call = call; $f.cc = cc; $f.cc$1 = cc$1; $f.dialOnMiss = dialOnMiss; $f.err = err; $f.p = p; $f.req = req; $f.st = st; $f.$s = $s; $f.$r = $r; return $f; }; http2clientConnPool.prototype.getClientConn = function(req, addr, dialOnMiss) { return this.$val.getClientConn(req, addr, dialOnMiss); }; http2clientConnPool.ptr.prototype.getStartDialLocked = function(ctx, addr) { var _entry, _key, _tuple, addr, call, call$1, ctx, ok, p; p = this; _tuple = (_entry = p.dialing[$String.keyFor(addr)], _entry !== undefined ? [_entry.v, true] : [ptrType$69.nil, false]); call = _tuple[0]; ok = _tuple[1]; if (ok) { return call; } call$1 = new http2dialCall.ptr(arrayType.zero(), p, ctx, new $Chan(structType, 0), ptrType$68.nil, $ifaceNil); if (p.dialing === false) { p.dialing = {}; } _key = addr; (p.dialing || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: call$1 }; $go($methodVal(call$1, "dial"), [call$1.ctx, addr]); return call$1; }; http2clientConnPool.prototype.getStartDialLocked = function(ctx, addr) { return this.$val.getStartDialLocked(ctx, addr); }; http2dialCall.ptr.prototype.dial = function(ctx, addr) { var _r$1, _tuple, addr, c, ctx, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; addr = $f.addr; c = $f.c; ctx = $f.ctx; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r$1 = c.p.t.dialClientConn(ctx, addr, false); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; c.res = _tuple[0]; c.err = _tuple[1]; $close(c.done); $r = c.p.mu.Lock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } delete c.p.dialing[$String.keyFor(addr)]; if ($interfaceIsEqual(c.err, $ifaceNil)) { c.p.addConnLocked(addr, c.res); } $r = c.p.mu.Unlock(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2dialCall.ptr.prototype.dial }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.addr = addr; $f.c = c; $f.ctx = ctx; $f.$s = $s; $f.$r = $r; return $f; }; http2dialCall.prototype.dial = function(ctx, addr) { return this.$val.dial(ctx, addr); }; http2clientConnPool.ptr.prototype.addConnIfNeeded = function(key, t, c) { var _entry, _entry$1, _i, _key, _r$1, _r$2, _ref, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, c, call, cc, dup, err, key, p, t, used, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _i = $f._i; _key = $f._key; _r$1 = $f._r$1; _r$2 = $f._r$2; _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; c = $f.c; call = $f.call; cc = $f.cc; dup = $f.dup; err = $f.err; key = $f.key; p = $f.p; t = $f.t; used = $f.used; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: used = false; err = $ifaceNil; p = this; $r = p.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _ref = (_entry = p.conns[$String.keyFor(key)], _entry !== undefined ? _entry.v : sliceType$21.nil); _i = 0; /* while (true) { */ case 2: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 3; continue; } cc = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r$1 = cc.CanTakeNewRequest(); /* */ $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) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_r$1) { */ case 4: $r = p.mu.Unlock(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp = false; _tmp$1 = $ifaceNil; used = _tmp; err = _tmp$1; $s = -1; return [used, err]; /* } */ case 5: _i++; $s = 2; continue; case 3: _tuple = (_entry$1 = p.addConnCalls[$String.keyFor(key)], _entry$1 !== undefined ? [_entry$1.v, true] : [ptrType$70.nil, false]); call = _tuple[0]; dup = _tuple[1]; /* */ if (!dup) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!dup) { */ case 8: if (p.addConnCalls === false) { p.addConnCalls = {}; } call = new http2addConnCall.ptr(arrayType.zero(), p, new $Chan(structType, 0), $ifaceNil); _key = key; (p.addConnCalls || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: call }; $go($methodVal(call, "run"), [t, key, c]); /* } */ case 9: $r = p.mu.Unlock(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$2 = $recv(call.done); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2[0]; if (!($interfaceIsEqual(call.err, $ifaceNil))) { _tmp$2 = false; _tmp$3 = call.err; used = _tmp$2; err = _tmp$3; $s = -1; return [used, err]; } _tmp$4 = !dup; _tmp$5 = $ifaceNil; used = _tmp$4; err = _tmp$5; $s = -1; return [used, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: http2clientConnPool.ptr.prototype.addConnIfNeeded }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._i = _i; $f._key = _key; $f._r$1 = _r$1; $f._r$2 = _r$2; $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.c = c; $f.call = call; $f.cc = cc; $f.dup = dup; $f.err = err; $f.key = key; $f.p = p; $f.t = t; $f.used = used; $f.$s = $s; $f.$r = $r; return $f; }; http2clientConnPool.prototype.addConnIfNeeded = function(key, t, c) { return this.$val.addConnIfNeeded(key, t, c); }; http2addConnCall.ptr.prototype.run = function(t, key, tc) { var _r$1, _tuple, c, cc, err, key, p, t, tc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; c = $f.c; cc = $f.cc; err = $f.err; key = $f.key; p = $f.p; t = $f.t; tc = $f.tc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r$1 = t.NewClientConn(tc); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; cc = _tuple[0]; err = _tuple[1]; p = c.p; $r = p.mu.Lock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (!($interfaceIsEqual(err, $ifaceNil))) { c.err = err; } else { p.addConnLocked(key, cc); } delete p.addConnCalls[$String.keyFor(key)]; $r = p.mu.Unlock(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $close(c.done); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2addConnCall.ptr.prototype.run }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.c = c; $f.cc = cc; $f.err = err; $f.key = key; $f.p = p; $f.t = t; $f.tc = tc; $f.$s = $s; $f.$r = $r; return $f; }; http2addConnCall.prototype.run = function(t, key, tc) { return this.$val.run(t, key, tc); }; http2clientConnPool.ptr.prototype.addConnLocked = function(key, cc) { var _entry, _entry$1, _entry$2, _i, _key, _key$1, _ref, cc, key, p, v; p = this; _ref = (_entry = p.conns[$String.keyFor(key)], _entry !== undefined ? _entry.v : sliceType$21.nil); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (v === cc) { return; } _i++; } if (p.conns === false) { p.conns = {}; } if (p.keys === false) { p.keys = {}; } _key = key; (p.conns || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: $append((_entry$1 = p.conns[$String.keyFor(key)], _entry$1 !== undefined ? _entry$1.v : sliceType$21.nil), cc) }; _key$1 = cc; (p.keys || $throwRuntimeError("assignment to entry in nil map"))[ptrType$68.keyFor(_key$1)] = { k: _key$1, v: $append((_entry$2 = p.keys[ptrType$68.keyFor(cc)], _entry$2 !== undefined ? _entry$2.v : sliceType$2.nil), key) }; }; http2clientConnPool.prototype.addConnLocked = function(key, cc) { return this.$val.addConnLocked(key, cc); }; http2clientConnPool.ptr.prototype.MarkDead = function(cc) { var _entry, _entry$1, _i, _key, _ref, _tuple, cc, key, newList, ok, p, vv, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _i = $f._i; _key = $f._key; _ref = $f._ref; _tuple = $f._tuple; cc = $f.cc; key = $f.key; newList = $f.newList; ok = $f.ok; p = $f.p; vv = $f.vv; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); p = this; $r = p.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(p.mu, "Unlock"), []]); _ref = (_entry = p.keys[ptrType$68.keyFor(cc)], _entry !== undefined ? _entry.v : sliceType$2.nil); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } key = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _tuple = (_entry$1 = p.conns[$String.keyFor(key)], _entry$1 !== undefined ? [_entry$1.v, true] : [sliceType$21.nil, false]); vv = _tuple[0]; ok = _tuple[1]; if (!ok) { _i++; continue; } newList = http2filterOutClientConn(vv, cc); if (newList.$length > 0) { _key = key; (p.conns || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: newList }; } else { delete p.conns[$String.keyFor(key)]; } _i++; } delete p.keys[ptrType$68.keyFor(cc)]; $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2clientConnPool.ptr.prototype.MarkDead }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._i = _i; $f._key = _key; $f._ref = _ref; $f._tuple = _tuple; $f.cc = cc; $f.key = key; $f.newList = newList; $f.ok = ok; $f.p = p; $f.vv = vv; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2clientConnPool.prototype.MarkDead = function(cc) { return this.$val.MarkDead(cc); }; http2clientConnPool.ptr.prototype.closeIdleConnections = function() { var _entry, _i, _i$1, _keys, _ref, _ref$1, cc, p, vv, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _i = $f._i; _i$1 = $f._i$1; _keys = $f._keys; _ref = $f._ref; _ref$1 = $f._ref$1; cc = $f.cc; p = $f.p; vv = $f.vv; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); p = this; $r = p.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(p.mu, "Unlock"), []]); _ref = p.conns; _i = 0; _keys = $keys(_ref); /* while (true) { */ case 2: /* if (!(_i < _keys.length)) { break; } */ if(!(_i < _keys.length)) { $s = 3; continue; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; /* continue; */ $s = 2; continue; } vv = _entry.v; _ref$1 = vv; _i$1 = 0; /* while (true) { */ case 4: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 5; continue; } cc = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); $r = cc.closeIfIdle(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i$1++; $s = 4; continue; case 5: _i++; $s = 2; continue; case 3: $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2clientConnPool.ptr.prototype.closeIdleConnections }; } $f._entry = _entry; $f._i = _i; $f._i$1 = _i$1; $f._keys = _keys; $f._ref = _ref; $f._ref$1 = _ref$1; $f.cc = cc; $f.p = p; $f.vv = vv; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2clientConnPool.prototype.closeIdleConnections = function() { return this.$val.closeIdleConnections(); }; http2filterOutClientConn = function(in$1, exclude) { var _i, _ref, exclude, in$1, out, v, x$5; out = $subslice(in$1, 0, 0); _ref = in$1; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (!(v === exclude)) { out = $append(out, v); } _i++; } if (!((in$1.$length === out.$length))) { (x$5 = in$1.$length - 1 >> 0, ((x$5 < 0 || x$5 >= in$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + x$5] = ptrType$68.nil)); } return out; }; http2noDialClientConnPool.ptr.prototype.GetClientConn = function(req, addr) { var $24r, _r$1, addr, p, req, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; addr = $f.addr; p = $f.p; req = $f.req; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; _r$1 = p.http2clientConnPool.getClientConn(req, addr, false); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2noDialClientConnPool.ptr.prototype.GetClientConn }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.addr = addr; $f.p = p; $f.req = req; $f.$s = $s; $f.$r = $r; return $f; }; http2noDialClientConnPool.prototype.GetClientConn = function(req, addr) { return this.$val.GetClientConn(req, addr); }; http2shouldRetryDial = function(call, req) { var $24r, _r$1, _r$2, _r$3, _v, call, req, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _v = $f._v; call = $f.call; req = $f.req; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if ($interfaceIsEqual(call.err, $ifaceNil)) { $s = -1; return false; } if ($interfaceIsEqual(call.ctx, req.Context())) { $s = -1; return false; } _r$1 = errors.Is(call.err, context.Canceled); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } if (!(!_r$1)) { _v = false; $s = 3; continue s; } _r$2 = errors.Is(call.err, context.DeadlineExceeded); /* */ $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 3: /* */ if (_v) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v) { */ case 1: $s = -1; return false; /* } */ case 2: _r$3 = call.ctx.Err(); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = !($interfaceIsEqual(_r$3, $ifaceNil)); $s = 7; case 7: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2shouldRetryDial }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._v = _v; $f.call = call; $f.req = req; $f.$s = $s; $f.$r = $r; return $f; }; http2getDataBufferChunk = function(size) { var $24r, _r$1, i, size, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; i = $f.i; size = $f.size; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: i = 0; while (true) { if (!(i < (http2dataChunkSizeClasses.$length - 1 >> 0))) { break; } if ((x$5 = (new $Int64(0, ((i < 0 || i >= http2dataChunkSizeClasses.$length) ? ($throwRuntimeError("index out of range"), undefined) : http2dataChunkSizeClasses.$array[http2dataChunkSizeClasses.$offset + i]))), (size.$high < x$5.$high || (size.$high === x$5.$high && size.$low <= x$5.$low)))) { break; } i = i + (1) >> 0; } _r$1 = ((i < 0 || i >= http2dataChunkPools.length) ? ($throwRuntimeError("index out of range"), undefined) : http2dataChunkPools[i]).Get(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = $assertType(_r$1, sliceType$3); $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2getDataBufferChunk }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.i = i; $f.size = size; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; http2putDataBufferChunk = function(p) { var _i, _r$1, _ref, i, n, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r$1 = $f._r$1; _ref = $f._ref; i = $f.i; n = $f.n; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _ref = http2dataChunkSizeClasses; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; n = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (p.$length === n) { ((i < 0 || i >= http2dataChunkPools.length) ? ($throwRuntimeError("index out of range"), undefined) : http2dataChunkPools[i]).Put(p); $s = -1; return; } _i++; } _r$1 = fmt.Sprintf("unexpected buffer len=%v", new sliceType([new $Int(p.$length)])); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $panic(new $String(_r$1)); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2putDataBufferChunk }; } $f._i = _i; $f._r$1 = _r$1; $f._ref = _ref; $f.i = i; $f.n = n; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; http2dataBuffer.ptr.prototype.Read = function(p) { var b, end, n, ntotal, p, readFrom, x$5, x$6, x$7, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; end = $f.end; n = $f.n; ntotal = $f.ntotal; p = $f.p; readFrom = $f.readFrom; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; if (b.size === 0) { $s = -1; return [0, http2errReadEmpty]; } ntotal = 0; /* while (true) { */ case 1: /* if (!(p.$length > 0 && b.size > 0)) { break; } */ if(!(p.$length > 0 && b.size > 0)) { $s = 2; continue; } readFrom = b.bytesFromFirstChunk(); n = $copySlice(p, readFrom); p = $subslice(p, n); ntotal = ntotal + (n) >> 0; b.r = b.r + (n) >> 0; b.size = b.size - (n) >> 0; /* */ if (b.r === (x$5 = b.chunks, (0 >= x$5.$length ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + 0])).$length) { $s = 3; continue; } /* */ $s = 4; continue; /* if (b.r === (x$5 = b.chunks, (0 >= x$5.$length ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + 0])).$length) { */ case 3: $r = http2putDataBufferChunk((x$6 = b.chunks, (0 >= x$6.$length ? ($throwRuntimeError("index out of range"), undefined) : x$6.$array[x$6.$offset + 0]))); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } end = b.chunks.$length - 1 >> 0; $copySlice($subslice(b.chunks, 0, end), $subslice(b.chunks, 1)); (x$7 = b.chunks, ((end < 0 || end >= x$7.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$7.$array[x$7.$offset + end] = sliceType$3.nil)); b.chunks = $subslice(b.chunks, 0, end); b.r = 0; /* } */ case 4: $s = 1; continue; case 2: $s = -1; return [ntotal, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: http2dataBuffer.ptr.prototype.Read }; } $f.b = b; $f.end = end; $f.n = n; $f.ntotal = ntotal; $f.p = p; $f.readFrom = readFrom; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.$s = $s; $f.$r = $r; return $f; }; http2dataBuffer.prototype.Read = function(p) { return this.$val.Read(p); }; http2dataBuffer.ptr.prototype.bytesFromFirstChunk = function() { var b, x$5, x$6; b = this; if (b.chunks.$length === 1) { return $subslice((x$5 = b.chunks, (0 >= x$5.$length ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + 0])), b.r, b.w); } return $subslice((x$6 = b.chunks, (0 >= x$6.$length ? ($throwRuntimeError("index out of range"), undefined) : x$6.$array[x$6.$offset + 0])), b.r); }; http2dataBuffer.prototype.bytesFromFirstChunk = function() { return this.$val.bytesFromFirstChunk(); }; http2dataBuffer.ptr.prototype.Len = function() { var b; b = this; return b.size; }; http2dataBuffer.prototype.Len = function() { return this.$val.Len(); }; http2dataBuffer.ptr.prototype.Write = function(p) { var _r$1, b, chunk, n, ntotal, p, want, x$5, x$6, x$7, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; b = $f.b; chunk = $f.chunk; n = $f.n; ntotal = $f.ntotal; p = $f.p; want = $f.want; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; ntotal = p.$length; /* while (true) { */ case 1: /* if (!(p.$length > 0)) { break; } */ if(!(p.$length > 0)) { $s = 2; continue; } want = (new $Int64(0, p.$length)); if ((x$5 = b.expected, (x$5.$high > want.$high || (x$5.$high === want.$high && x$5.$low > want.$low)))) { want = b.expected; } _r$1 = b.lastChunkOrAlloc(want); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } chunk = _r$1; n = $copySlice($subslice(chunk, b.w), p); p = $subslice(p, n); b.w = b.w + (n) >> 0; b.size = b.size + (n) >> 0; b.expected = (x$6 = b.expected, x$7 = (new $Int64(0, n)), new $Int64(x$6.$high - x$7.$high, x$6.$low - x$7.$low)); $s = 1; continue; case 2: $s = -1; return [ntotal, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: http2dataBuffer.ptr.prototype.Write }; } $f._r$1 = _r$1; $f.b = b; $f.chunk = chunk; $f.n = n; $f.ntotal = ntotal; $f.p = p; $f.want = want; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.$s = $s; $f.$r = $r; return $f; }; http2dataBuffer.prototype.Write = function(p) { return this.$val.Write(p); }; http2dataBuffer.ptr.prototype.lastChunkOrAlloc = function(want) { var _r$1, b, chunk, last, want, x$5, x$6, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; b = $f.b; chunk = $f.chunk; last = $f.last; want = $f.want; x$5 = $f.x$5; x$6 = $f.x$6; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; if (!((b.chunks.$length === 0))) { last = (x$5 = b.chunks, x$6 = b.chunks.$length - 1 >> 0, ((x$6 < 0 || x$6 >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + x$6])); if (b.w < last.$length) { $s = -1; return last; } } _r$1 = http2getDataBufferChunk(want); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } chunk = _r$1; b.chunks = $append(b.chunks, chunk); b.w = 0; $s = -1; return chunk; /* */ } return; } if ($f === undefined) { $f = { $blk: http2dataBuffer.ptr.prototype.lastChunkOrAlloc }; } $f._r$1 = _r$1; $f.b = b; $f.chunk = chunk; $f.last = last; $f.want = want; $f.x$5 = x$5; $f.x$6 = x$6; $f.$s = $s; $f.$r = $r; return $f; }; http2dataBuffer.prototype.lastChunkOrAlloc = function(want) { return this.$val.lastChunkOrAlloc(want); }; http2ErrCode.prototype.String = function() { var $24r, _entry, _r$1, _tuple, e, ok, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _entry = $f._entry; _r$1 = $f._r$1; _tuple = $f._tuple; e = $f.e; ok = $f.ok; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this.$val; _tuple = (_entry = http2errCodeName[http2ErrCode.keyFor(e)], _entry !== undefined ? [_entry.v, true] : ["", false]); s = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return s; } _r$1 = fmt.Sprintf("unknown error code 0x%x", new sliceType([new $Uint32(((e >>> 0)))])); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2ErrCode.prototype.String }; } $f.$24r = $24r; $f._entry = _entry; $f._r$1 = _r$1; $f._tuple = _tuple; $f.e = e; $f.ok = ok; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(http2ErrCode).prototype.String = function() { return new http2ErrCode(this.$get()).String(); }; http2ConnectionError.prototype.Error = function() { var $24r, _r$1, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this.$val; _r$1 = fmt.Sprintf("connection error: %s", new sliceType([new http2ErrCode(((e >>> 0)))])); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2ConnectionError.prototype.Error }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(http2ConnectionError).prototype.Error = function() { return new http2ConnectionError(this.$get()).Error(); }; http2streamError = function(id, code) { var code, id; return new http2StreamError.ptr(id, code, $ifaceNil); }; http2StreamError.ptr.prototype.Error = function() { var $24r, $24r$1, _r$1, _r$2, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r$1 = $f._r$1; _r$2 = $f._r$2; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; /* */ if (!($interfaceIsEqual(e.Cause, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(e.Cause, $ifaceNil))) { */ case 1: _r$1 = fmt.Sprintf("stream error: stream ID %d; %v; %v", new sliceType([new $Uint32(e.StreamID), new http2ErrCode(e.Code), e.Cause])); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 4; case 4: return $24r; /* } */ case 2: _r$2 = fmt.Sprintf("stream error: stream ID %d; %v", new sliceType([new $Uint32(e.StreamID), new http2ErrCode(e.Code)])); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r$1 = _r$2; $s = 6; case 6: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: http2StreamError.ptr.prototype.Error }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; http2StreamError.prototype.Error = function() { return this.$val.Error(); }; http2goAwayFlowError.ptr.prototype.Error = function() { return "connection exceeded flow control window size"; }; http2goAwayFlowError.prototype.Error = function() { return this.$val.Error(); }; http2connError.ptr.prototype.Error = function() { var $24r, _r$1, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; _r$1 = fmt.Sprintf("http2: connection error: %v: %v", new sliceType([new http2ErrCode(e.Code), new $String(e.Reason)])); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2connError.ptr.prototype.Error }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; http2connError.prototype.Error = function() { return this.$val.Error(); }; http2pseudoHeaderError.prototype.Error = function() { var $24r, _r$1, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this.$val; _r$1 = fmt.Sprintf("invalid pseudo-header %q", new sliceType([new $String((e))])); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2pseudoHeaderError.prototype.Error }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(http2pseudoHeaderError).prototype.Error = function() { return new http2pseudoHeaderError(this.$get()).Error(); }; http2duplicatePseudoHeaderError.prototype.Error = function() { var $24r, _r$1, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this.$val; _r$1 = fmt.Sprintf("duplicate pseudo-header %q", new sliceType([new $String((e))])); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2duplicatePseudoHeaderError.prototype.Error }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(http2duplicatePseudoHeaderError).prototype.Error = function() { return new http2duplicatePseudoHeaderError(this.$get()).Error(); }; http2headerFieldNameError.prototype.Error = function() { var $24r, _r$1, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this.$val; _r$1 = fmt.Sprintf("invalid header field name %q", new sliceType([new $String((e))])); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2headerFieldNameError.prototype.Error }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(http2headerFieldNameError).prototype.Error = function() { return new http2headerFieldNameError(this.$get()).Error(); }; http2headerFieldValueError.prototype.Error = function() { var $24r, _r$1, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this.$val; _r$1 = fmt.Sprintf("invalid header field value %q", new sliceType([new $String((e))])); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2headerFieldValueError.prototype.Error }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(http2headerFieldValueError).prototype.Error = function() { return new http2headerFieldValueError(this.$get()).Error(); }; http2flow.ptr.prototype.setConnFlow = function(cf) { var cf, f; f = this; f.conn = cf; }; http2flow.prototype.setConnFlow = function(cf) { return this.$val.setConnFlow(cf); }; http2flow.ptr.prototype.available = function() { var f, n; f = this; n = f.n; if (!(f.conn === ptrType$71.nil) && f.conn.n < n) { n = f.conn.n; } return n; }; http2flow.prototype.available = function() { return this.$val.available(); }; http2flow.ptr.prototype.take = function(n) { var f, n; f = this; if (n > f.available()) { $panic(new $String("internal error: took too much")); } f.n = f.n - (n) >> 0; if (!(f.conn === ptrType$71.nil)) { f.conn.n = f.conn.n - (n) >> 0; } }; http2flow.prototype.take = function(n) { return this.$val.take(n); }; http2flow.ptr.prototype.add = function(n) { var f, n, sum; f = this; sum = f.n + n >> 0; if ((sum > n) === (f.n > 0)) { f.n = sum; return true; } return false; }; http2flow.prototype.add = function(n) { return this.$val.add(n); }; http2FrameType.prototype.String = function() { var $24r, _entry, _r$1, _tuple, ok, s, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _entry = $f._entry; _r$1 = $f._r$1; _tuple = $f._tuple; ok = $f.ok; s = $f.s; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this.$val; _tuple = (_entry = http2frameName[http2FrameType.keyFor(t)], _entry !== undefined ? [_entry.v, true] : ["", false]); s = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return s; } _r$1 = fmt.Sprintf("UNKNOWN_FRAME_TYPE_%d", new sliceType([new $Uint8(((t << 24 >>> 24)))])); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2FrameType.prototype.String }; } $f.$24r = $24r; $f._entry = _entry; $f._r$1 = _r$1; $f._tuple = _tuple; $f.ok = ok; $f.s = s; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(http2FrameType).prototype.String = function() { return new http2FrameType(this.$get()).String(); }; http2Flags.prototype.Has = function(v) { var f, v; f = this.$val; return (((f & v) >>> 0)) === v; }; $ptrType(http2Flags).prototype.Has = function(v) { return new http2Flags(this.$get()).Has(v); }; http2typeFrameParser = function(t) { var _entry, f, t; f = (_entry = http2frameParsers[http2FrameType.keyFor(t)], _entry !== undefined ? _entry.v : $throwNilPointerError); if (!(f === $throwNilPointerError)) { return f; } return http2parseUnknownFrame; }; http2FrameHeader.ptr.prototype.Header = function() { var h; h = this; return h; }; http2FrameHeader.prototype.Header = function() { return this.$val.Header(); }; http2FrameHeader.ptr.prototype.String = function() { var _r$1, _r$2, buf, h, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; buf = $f.buf; h = $f.h; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: buf = [buf]; h = this; buf[0] = new bytes.Buffer.ptr(sliceType$3.nil, 0, 0); _r$1 = buf[0].WriteString("[FrameHeader "); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $r = $clone(h, http2FrameHeader).writeDebug(buf[0]); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$2 = buf[0].WriteByte(93); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; $s = -1; return buf[0].String(); /* */ } return; } if ($f === undefined) { $f = { $blk: http2FrameHeader.ptr.prototype.String }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f.buf = buf; $f.h = h; $f.$s = $s; $f.$r = $r; return $f; }; http2FrameHeader.prototype.String = function() { return this.$val.String(); }; http2FrameHeader.ptr.prototype.writeDebug = function(buf) { var _entry, _entry$1, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, buf, h, i, name, set, y, y$1, y$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _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; buf = $f.buf; h = $f.h; i = $f.i; name = $f.name; set = $f.set; y = $f.y; y$1 = $f.y$1; y$2 = $f.y$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: h = this; _r$1 = new http2FrameType(h.Type).String(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = buf.WriteString(_r$1); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; /* */ if (!((h.Flags === 0))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!((h.Flags === 0))) { */ case 3: _r$3 = buf.WriteString(" flags="); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; set = 0; i = 0; /* while (true) { */ case 6: /* if (!(i < 8)) { break; } */ if(!(i < 8)) { $s = 7; continue; } if (((h.Flags & (((y = i, y < 32 ? (1 << y) : 0) << 24 >>> 24))) >>> 0) === 0) { i = i + (1) << 24 >>> 24; /* continue; */ $s = 6; continue; } set = set + (1) >> 0; /* */ if (set > 1) { $s = 8; continue; } /* */ $s = 9; continue; /* if (set > 1) { */ case 8: _r$4 = buf.WriteByte(124); /* */ $s = 10; case 10: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; /* } */ case 9: name = (_entry = (_entry$1 = http2flagName[http2FrameType.keyFor(h.Type)], _entry$1 !== undefined ? _entry$1.v : false)[http2Flags.keyFor((((y$1 = i, y$1 < 32 ? (1 << y$1) : 0) << 24 >>> 24)))], _entry !== undefined ? _entry.v : ""); /* */ if (!(name === "")) { $s = 11; continue; } /* */ $s = 12; continue; /* if (!(name === "")) { */ case 11: _r$5 = buf.WriteString(name); /* */ $s = 14; case 14: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; $s = 13; continue; /* } else { */ case 12: _r$6 = fmt.Fprintf(buf, "0x%x", new sliceType([new $Int(((y$2 = i, y$2 < 32 ? (1 << y$2) : 0) >> 0))])); /* */ $s = 15; case 15: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; /* } */ case 13: i = i + (1) << 24 >>> 24; $s = 6; continue; case 7: /* } */ case 4: /* */ if (!((h.StreamID === 0))) { $s = 16; continue; } /* */ $s = 17; continue; /* if (!((h.StreamID === 0))) { */ case 16: _r$7 = fmt.Fprintf(buf, " stream=%d", new sliceType([new $Uint32(h.StreamID)])); /* */ $s = 18; case 18: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$7; /* } */ case 17: _r$8 = fmt.Fprintf(buf, " len=%d", new sliceType([new $Uint32(h.Length)])); /* */ $s = 19; case 19: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$8; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2FrameHeader.ptr.prototype.writeDebug }; } $f._entry = _entry; $f._entry$1 = _entry$1; $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.buf = buf; $f.h = h; $f.i = i; $f.name = name; $f.set = set; $f.y = y; $f.y$1 = y$1; $f.y$2 = y$2; $f.$s = $s; $f.$r = $r; return $f; }; http2FrameHeader.prototype.writeDebug = function(buf) { return this.$val.writeDebug(buf); }; http2FrameHeader.ptr.prototype.checkValid = function() { var h; h = this; if (!h.valid) { $panic(new $String("Frame accessor called on non-owned Frame")); } }; http2FrameHeader.prototype.checkValid = function() { return this.$val.checkValid(); }; http2FrameHeader.ptr.prototype.invalidate = function() { var h; h = this; h.valid = false; }; http2FrameHeader.prototype.invalidate = function() { return this.$val.invalidate(); }; http2readFrameHeader = function(buf, r) { var _r$1, _tuple, buf, err, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; buf = $f.buf; err = $f.err; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = io.ReadFull(r, $subslice(buf, 0, 9)); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [new http2FrameHeader.ptr(false, 0, 0, 0, 0), err]; } $s = -1; return [new http2FrameHeader.ptr(true, (((3 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 3]) << 24 >>> 24)), (((4 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 4]) << 24 >>> 24)), ((((((((0 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 0]) >>> 0)) << 16 >>> 0) | ((((1 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 1]) >>> 0)) << 8 >>> 0)) >>> 0) | (((2 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 2]) >>> 0))) >>> 0), ($clone(binary.BigEndian, binary.bigEndian).Uint32($subslice(buf, 5)) & 2147483647) >>> 0), $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: http2readFrameHeader }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.buf = buf; $f.err = err; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; http2Framer.ptr.prototype.maxHeaderListSize = function() { var fr; fr = this; if (fr.MaxHeaderListSize === 0) { return 16777216; } return fr.MaxHeaderListSize; }; http2Framer.prototype.maxHeaderListSize = function() { return this.$val.maxHeaderListSize(); }; http2Framer.ptr.prototype.startWrite = function(ftype, flags, streamID) { var f, flags, ftype, streamID; f = this; f.wbuf = $append($subslice(f.wbuf, 0, 0), 0, 0, 0, ((ftype << 24 >>> 24)), ((flags << 24 >>> 24)), (((streamID >>> 24 >>> 0) << 24 >>> 24)), (((streamID >>> 16 >>> 0) << 24 >>> 24)), (((streamID >>> 8 >>> 0) << 24 >>> 24)), ((streamID << 24 >>> 24))); }; http2Framer.prototype.startWrite = function(ftype, flags, streamID) { return this.$val.startWrite(ftype, flags, streamID); }; http2Framer.ptr.prototype.endWrite = function() { var _r$1, _tuple, err, f, length, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; f = $f.f; length = $f.length; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; length = f.wbuf.$length - 9 >> 0; if (length >= 16777216) { $s = -1; return http2ErrFrameTooLarge; } $unused($append($subslice(f.wbuf, 0, 0), (((length >> 16 >> 0) << 24 >>> 24)), (((length >> 8 >> 0) << 24 >>> 24)), ((length << 24 >>> 24)))); /* */ if (f.logWrites) { $s = 1; continue; } /* */ $s = 2; continue; /* if (f.logWrites) { */ case 1: $r = f.logWrite(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: _r$1 = f.w.Write(f.wbuf); /* */ $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; n = _tuple[0]; err = _tuple[1]; if ($interfaceIsEqual(err, $ifaceNil) && !((n === f.wbuf.$length))) { err = io.ErrShortWrite; } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: http2Framer.ptr.prototype.endWrite }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.f = f; $f.length = length; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; http2Framer.prototype.endWrite = function() { return this.$val.endWrite(); }; http2Framer.ptr.prototype.logWrite = function() { var _arg, _arg$1, _r$1, _r$2, _r$3, _tuple, err, f, fr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; err = $f.err; f = $f.f; fr = $f.fr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; if (f.debugFramer === ptrType$72.nil) { f.debugFramerBuf = new bytes.Buffer.ptr(sliceType$3.nil, 0, 0); f.debugFramer = http2NewFramer($ifaceNil, f.debugFramerBuf); f.debugFramer.logReads = false; f.debugFramer.AllowIllegalReads = true; } _r$1 = f.debugFramerBuf.Write(f.wbuf); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _r$2 = f.debugFramer.ReadFrame(); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; fr = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 3: $r = f.debugWriteLoggerf("http2: Framer %p: failed to decode just-written frame", new sliceType([f])); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 4: _arg = f; _r$3 = http2summarizeFrame(fr); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _arg$1 = new $String(_r$3); $r = f.debugWriteLoggerf("http2: Framer %p: wrote %v", new sliceType([_arg, _arg$1])); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2Framer.ptr.prototype.logWrite }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.err = err; $f.f = f; $f.fr = fr; $f.$s = $s; $f.$r = $r; return $f; }; http2Framer.prototype.logWrite = function() { return this.$val.logWrite(); }; http2Framer.ptr.prototype.writeByte = function(v) { var f, v; f = this; f.wbuf = $append(f.wbuf, v); }; http2Framer.prototype.writeByte = function(v) { return this.$val.writeByte(v); }; http2Framer.ptr.prototype.writeBytes = function(v) { var f, v; f = this; f.wbuf = $appendSlice(f.wbuf, v); }; http2Framer.prototype.writeBytes = function(v) { return this.$val.writeBytes(v); }; http2Framer.ptr.prototype.writeUint16 = function(v) { var f, v; f = this; f.wbuf = $append(f.wbuf, (((v >>> 8 << 16 >>> 16) << 24 >>> 24)), ((v << 24 >>> 24))); }; http2Framer.prototype.writeUint16 = function(v) { return this.$val.writeUint16(v); }; http2Framer.ptr.prototype.writeUint32 = function(v) { var f, v; f = this; f.wbuf = $append(f.wbuf, (((v >>> 24 >>> 0) << 24 >>> 24)), (((v >>> 16 >>> 0) << 24 >>> 24)), (((v >>> 8 >>> 0) << 24 >>> 24)), ((v << 24 >>> 24))); }; http2Framer.prototype.writeUint32 = function(v) { return this.$val.writeUint32(v); }; http2Framer.ptr.prototype.SetReuseFrames = function() { var fr; fr = this; if (!(fr.frameCache === ptrType$73.nil)) { return; } fr.frameCache = new http2frameCache.ptr(new http2DataFrame.ptr(new http2FrameHeader.ptr(false, 0, 0, 0, 0), sliceType$3.nil)); }; http2Framer.prototype.SetReuseFrames = function() { return this.$val.SetReuseFrames(); }; http2frameCache.ptr.prototype.getDataFrame = function() { var fc; fc = this; if (fc === ptrType$73.nil) { return new http2DataFrame.ptr(new http2FrameHeader.ptr(false, 0, 0, 0, 0), sliceType$3.nil); } return fc.dataFrame; }; http2frameCache.prototype.getDataFrame = function() { return this.$val.getDataFrame(); }; http2NewFramer = function(w, r) { var fr, r, w; fr = new http2Framer.ptr(r, $ifaceNil, $ifaceNil, 0, 0, arrayType$7.zero(), $throwNilPointerError, sliceType$3.nil, 0, w, sliceType$3.nil, false, false, ptrType$74.nil, 0, http2logFrameReads, http2logFrameWrites, ptrType$72.nil, ptrType$40.nil, log.Printf, log.Printf, ptrType$73.nil); fr.getReadBuf = (function(size) { var size; if (fr.readBuf.$capacity >= ((size >> 0))) { return $subslice(fr.readBuf, 0, size); } fr.readBuf = $makeSlice(sliceType$3, size); return fr.readBuf; }); fr.SetMaxReadFrameSize(16777215); return fr; }; http2Framer.ptr.prototype.SetMaxReadFrameSize = function(v) { var fr, v; fr = this; if (v > 16777215) { v = 16777215; } fr.maxReadSize = v; }; http2Framer.prototype.SetMaxReadFrameSize = function(v) { return this.$val.SetMaxReadFrameSize(v); }; http2Framer.ptr.prototype.ErrorDetail = function() { var fr; fr = this; return fr.errDetail; }; http2Framer.prototype.ErrorDetail = function() { return this.$val.ErrorDetail(); }; http2terminalReadFrameError = function(err) { var _tuple, err, ok; _tuple = $assertType(err, http2StreamError, true); ok = _tuple[1]; if (ok) { return false; } return !($interfaceIsEqual(err, $ifaceNil)); }; http2Framer.ptr.prototype.ReadFrame = function() { var $24r, _arg, _arg$1, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _returncast, _tuple, _tuple$1, _tuple$2, _tuple$3, ce, err, err$1, err$2, f, fh, fr, ok, payload, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _arg = $f._arg; _arg$1 = $f._arg$1; _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; _returncast = $f._returncast; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; ce = $f.ce; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; f = $f.f; fh = $f.fh; fr = $f.fr; ok = $f.ok; payload = $f.payload; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fr = this; fr.errDetail = $ifaceNil; /* */ if (!($interfaceIsEqual(fr.lastFrame, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(fr.lastFrame, $ifaceNil))) { */ case 1: $r = fr.lastFrame.invalidate(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: _r$1 = http2readFrameHeader(new sliceType$3(fr.headerBuf), fr.r); /* */ $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; fh = $clone(_tuple[0], http2FrameHeader); err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [$ifaceNil, err]; } if (fh.Length > fr.maxReadSize) { $s = -1; return [$ifaceNil, http2ErrFrameTooLarge]; } _r$2 = fr.getReadBuf(fh.Length); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } payload = _r$2; _r$3 = io.ReadFull(fr.r, payload); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$1 = _r$3; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [$ifaceNil, err$1]; } _r$4 = http2typeFrameParser(fh.Type)(fr.frameCache, $clone(fh, http2FrameHeader), payload); /* */ $s = 7; case 7: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$2 = _r$4; f = _tuple$2[0]; err = _tuple$2[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tuple$3 = $assertType(err, http2connError, true); ce = $clone(_tuple$3[0], http2connError); ok = _tuple$3[1]; if (ok) { $s = -1; return [$ifaceNil, fr.connError(ce.Code, ce.Reason)]; } $s = -1; return [$ifaceNil, err]; } _r$5 = fr.checkFrameOrder(f); /* */ $s = 8; case 8: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } err$2 = _r$5; if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return [$ifaceNil, err$2]; } /* */ if (fr.logReads) { $s = 9; continue; } /* */ $s = 10; continue; /* if (fr.logReads) { */ case 9: _arg = fr; _r$6 = http2summarizeFrame(f); /* */ $s = 11; case 11: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _arg$1 = new $String(_r$6); $r = fr.debugReadLoggerf("http2: Framer %p: read %v", new sliceType([_arg, _arg$1])); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 10: /* */ if ((fh.Type === 1) && !(fr.ReadMetaHeaders === ptrType$74.nil)) { $s = 13; continue; } /* */ $s = 14; continue; /* if ((fh.Type === 1) && !(fr.ReadMetaHeaders === ptrType$74.nil)) { */ case 13: _r$7 = fr.readMetaFrame($assertType(f, ptrType$75)); /* */ $s = 15; case 15: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _returncast = _r$7; $24r = [_returncast[0], _returncast[1]]; $s = 16; case 16: return $24r; /* } */ case 14: $s = -1; return [f, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: http2Framer.ptr.prototype.ReadFrame }; } $f.$24r = $24r; $f._arg = _arg; $f._arg$1 = _arg$1; $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._returncast = _returncast; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.ce = ce; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.f = f; $f.fh = fh; $f.fr = fr; $f.ok = ok; $f.payload = payload; $f.$s = $s; $f.$r = $r; return $f; }; http2Framer.prototype.ReadFrame = function() { return this.$val.ReadFrame(); }; http2Framer.ptr.prototype.connError = function(code, reason) { var code, fr, reason; fr = this; fr.errDetail = errors.New(reason); return new http2ConnectionError(((code >>> 0))); }; http2Framer.prototype.connError = function(code, reason) { return this.$val.connError(code, reason); }; http2Framer.ptr.prototype.checkFrameOrder = function(f) { var $24r, $24r$1, $24r$2, _1, _arg, _arg$1, _arg$2, _arg$3, _arg$4, _arg$5, _arg$6, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, f, fh, fr, last, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _1 = $f._1; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _arg$4 = $f._arg$4; _arg$5 = $f._arg$5; _arg$6 = $f._arg$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; _r$7 = $f._r$7; _r$8 = $f._r$8; f = $f.f; fh = $f.fh; fr = $f.fr; last = $f.last; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fr = this; last = fr.lastFrame; fr.lastFrame = f; if (fr.AllowIllegalReads) { $s = -1; return $ifaceNil; } _r$1 = f.Header(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } fh = $clone(_r$1, http2FrameHeader); /* */ if (!((fr.lastHeaderStream === 0))) { $s = 2; continue; } /* */ if (fh.Type === 9) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!((fr.lastHeaderStream === 0))) { */ case 2: /* */ if (!((fh.Type === 9))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!((fh.Type === 9))) { */ case 5: _arg = new http2FrameType(fh.Type); _arg$1 = new $Uint32(fh.StreamID); _r$2 = last.Header(); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg$2 = new http2FrameType(_r$2.Type); _arg$3 = new $Uint32(fr.lastHeaderStream); _r$3 = fmt.Sprintf("got %s for stream %d; expected CONTINUATION following %s for stream %d", new sliceType([_arg, _arg$1, _arg$2, _arg$3])); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _arg$4 = _r$3; _r$4 = fr.connError(1, _arg$4); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r = _r$4; $s = 10; case 10: return $24r; /* } */ case 6: /* */ if (!((fh.StreamID === fr.lastHeaderStream))) { $s = 11; continue; } /* */ $s = 12; continue; /* if (!((fh.StreamID === fr.lastHeaderStream))) { */ case 11: _r$5 = fmt.Sprintf("got CONTINUATION for stream %d; expected stream %d", new sliceType([new $Uint32(fh.StreamID), new $Uint32(fr.lastHeaderStream)])); /* */ $s = 13; case 13: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg$5 = _r$5; _r$6 = fr.connError(1, _arg$5); /* */ $s = 14; case 14: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } $24r$1 = _r$6; $s = 15; case 15: return $24r$1; /* } */ case 12: $s = 4; continue; /* } else if (fh.Type === 9) { */ case 3: _r$7 = fmt.Sprintf("unexpected CONTINUATION for stream %d", new sliceType([new $Uint32(fh.StreamID)])); /* */ $s = 16; case 16: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _arg$6 = _r$7; _r$8 = fr.connError(1, _arg$6); /* */ $s = 17; case 17: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } $24r$2 = _r$8; $s = 18; case 18: return $24r$2; /* } */ case 4: _1 = fh.Type; if ((_1 === (1)) || (_1 === (9))) { if (new http2Flags(fh.Flags).Has(4)) { fr.lastHeaderStream = 0; } else { fr.lastHeaderStream = fh.StreamID; } } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2Framer.ptr.prototype.checkFrameOrder }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._1 = _1; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._arg$4 = _arg$4; $f._arg$5 = _arg$5; $f._arg$6 = _arg$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._r$7 = _r$7; $f._r$8 = _r$8; $f.f = f; $f.fh = fh; $f.fr = fr; $f.last = last; $f.$s = $s; $f.$r = $r; return $f; }; http2Framer.prototype.checkFrameOrder = function(f) { return this.$val.checkFrameOrder(f); }; http2DataFrame.ptr.prototype.StreamEnded = function() { var f; f = this; return new http2Flags(f.http2FrameHeader.Flags).Has(1); }; http2DataFrame.prototype.StreamEnded = function() { return this.$val.StreamEnded(); }; http2DataFrame.ptr.prototype.Data = function() { var f; f = this; f.http2FrameHeader.checkValid(); return f.data; }; http2DataFrame.prototype.Data = function() { return this.$val.Data(); }; http2parseDataFrame = function(fc, fh, payload) { var _tuple, err, f, fc, fh, padSize, payload, x$5, x$6; if (fh.StreamID === 0) { return [$ifaceNil, (x$5 = new http2connError.ptr(1, "DATA frame with stream ID 0"), new x$5.constructor.elem(x$5))]; } f = fc.getDataFrame(); http2FrameHeader.copy(f.http2FrameHeader, fh); padSize = 0; if (new http2Flags(fh.Flags).Has(8)) { err = $ifaceNil; _tuple = http2readByte(payload); payload = _tuple[0]; padSize = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [$ifaceNil, err]; } } if (((padSize >> 0)) > payload.$length) { return [$ifaceNil, (x$6 = new http2connError.ptr(1, "pad size larger than data payload"), new x$6.constructor.elem(x$6))]; } f.data = $subslice(payload, 0, (payload.$length - ((padSize >> 0)) >> 0)); return [f, $ifaceNil]; }; http2validStreamIDOrZero = function(streamID) { var streamID; return ((streamID & 2147483648) >>> 0) === 0; }; http2validStreamID = function(streamID) { var streamID; return !((streamID === 0)) && (((streamID & 2147483648) >>> 0) === 0); }; http2Framer.ptr.prototype.WriteData = function(streamID, endStream, data) { var $24r, _r$1, data, endStream, f, streamID, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; data = $f.data; endStream = $f.endStream; f = $f.f; streamID = $f.streamID; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; _r$1 = f.WriteDataPadded(streamID, endStream, data, sliceType$3.nil); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2Framer.ptr.prototype.WriteData }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.data = data; $f.endStream = endStream; $f.f = f; $f.streamID = streamID; $f.$s = $s; $f.$r = $r; return $f; }; http2Framer.prototype.WriteData = function(streamID, endStream, data) { return this.$val.WriteData(streamID, endStream, data); }; http2Framer.ptr.prototype.WriteDataPadded = function(streamID, endStream, data, pad) { var $24r, _i, _r$1, _ref, b, data, endStream, f, flags, pad, streamID, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _i = $f._i; _r$1 = $f._r$1; _ref = $f._ref; b = $f.b; data = $f.data; endStream = $f.endStream; f = $f.f; flags = $f.flags; pad = $f.pad; streamID = $f.streamID; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; if (!http2validStreamID(streamID) && !f.AllowIllegalWrites) { $s = -1; return http2errStreamID; } if (pad.$length > 0) { if (pad.$length > 255) { $s = -1; return http2errPadLength; } if (!f.AllowIllegalWrites) { _ref = pad; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } b = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (!((b === 0))) { $s = -1; return http2errPadBytes; } _i++; } } } flags = 0; if (endStream) { flags = (flags | (1)) >>> 0; } if (!(pad === sliceType$3.nil)) { flags = (flags | (8)) >>> 0; } f.startWrite(0, flags, streamID); if (!(pad === sliceType$3.nil)) { f.wbuf = $append(f.wbuf, ((pad.$length << 24 >>> 24))); } f.wbuf = $appendSlice(f.wbuf, data); f.wbuf = $appendSlice(f.wbuf, pad); _r$1 = f.endWrite(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2Framer.ptr.prototype.WriteDataPadded }; } $f.$24r = $24r; $f._i = _i; $f._r$1 = _r$1; $f._ref = _ref; $f.b = b; $f.data = data; $f.endStream = endStream; $f.f = f; $f.flags = flags; $f.pad = pad; $f.streamID = streamID; $f.$s = $s; $f.$r = $r; return $f; }; http2Framer.prototype.WriteDataPadded = function(streamID, endStream, data, pad) { return this.$val.WriteDataPadded(streamID, endStream, data, pad); }; http2parseSettingsFrame = function(param, fh, p) { var _r$1, _tuple, f, fh, ok, p, param, v; if (new http2Flags(fh.Flags).Has(1) && fh.Length > 0) { return [$ifaceNil, new http2ConnectionError(6)]; } if (!((fh.StreamID === 0))) { return [$ifaceNil, new http2ConnectionError(1)]; } if (!(((_r$1 = p.$length % 6, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) === 0))) { return [$ifaceNil, new http2ConnectionError(6)]; } f = new http2SettingsFrame.ptr($clone(fh, http2FrameHeader), p); _tuple = f.Value(4); v = _tuple[0]; ok = _tuple[1]; if (ok && v > 2147483647) { return [$ifaceNil, new http2ConnectionError(3)]; } return [f, $ifaceNil]; }; http2SettingsFrame.ptr.prototype.IsAck = function() { var f; f = this; return new http2Flags(f.http2FrameHeader.Flags).Has(1); }; http2SettingsFrame.prototype.IsAck = function() { return this.$val.IsAck(); }; http2SettingsFrame.ptr.prototype.Value = function(id) { var _tmp, _tmp$1, _tmp$2, _tmp$3, f, i, id, ok, s, v; v = 0; ok = false; f = this; f.http2FrameHeader.checkValid(); i = 0; while (true) { if (!(i < f.NumSettings())) { break; } s = $clone(f.Setting(i), http2Setting); if (s.ID === id) { _tmp = s.Val; _tmp$1 = true; v = _tmp; ok = _tmp$1; return [v, ok]; } i = i + (1) >> 0; } _tmp$2 = 0; _tmp$3 = false; v = _tmp$2; ok = _tmp$3; return [v, ok]; }; http2SettingsFrame.prototype.Value = function(id) { return this.$val.Value(id); }; http2SettingsFrame.ptr.prototype.Setting = function(i) { var buf, f, i; f = this; buf = f.p; return new http2Setting.ptr((($clone(binary.BigEndian, binary.bigEndian).Uint16($subslice(buf, ($imul(i, 6)), (($imul(i, 6)) + 2 >> 0))) << 16 >>> 16)), $clone(binary.BigEndian, binary.bigEndian).Uint32($subslice(buf, (($imul(i, 6)) + 2 >> 0), (($imul(i, 6)) + 6 >> 0)))); }; http2SettingsFrame.prototype.Setting = function(i) { return this.$val.Setting(i); }; http2SettingsFrame.ptr.prototype.NumSettings = function() { var _q, f; f = this; return (_q = f.p.$length / 6, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); }; http2SettingsFrame.prototype.NumSettings = function() { return this.$val.NumSettings(); }; http2SettingsFrame.ptr.prototype.HasDuplicates = function() { var _entry, _key, f, i, i$1, id, idi, idj, j, num, seen; f = this; num = f.NumSettings(); if (num === 0) { return false; } if (num < 10) { i = 0; while (true) { if (!(i < num)) { break; } idi = f.Setting(i).ID; j = i + 1 >> 0; while (true) { if (!(j < num)) { break; } idj = f.Setting(j).ID; if (idi === idj) { return true; } j = j + (1) >> 0; } i = i + (1) >> 0; } return false; } seen = $makeMap(http2SettingID.keyFor, []); i$1 = 0; while (true) { if (!(i$1 < num)) { break; } id = f.Setting(i$1).ID; if ((_entry = seen[http2SettingID.keyFor(id)], _entry !== undefined ? _entry.v : false)) { return true; } _key = id; (seen || $throwRuntimeError("assignment to entry in nil map"))[http2SettingID.keyFor(_key)] = { k: _key, v: true }; i$1 = i$1 + (1) >> 0; } return false; }; http2SettingsFrame.prototype.HasDuplicates = function() { return this.$val.HasDuplicates(); }; http2SettingsFrame.ptr.prototype.ForeachSetting = function(fn) { var _r$1, err, f, fn, i, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; err = $f.err; f = $f.f; fn = $f.fn; i = $f.i; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; f.http2FrameHeader.checkValid(); i = 0; /* while (true) { */ case 1: /* if (!(i < f.NumSettings())) { break; } */ if(!(i < f.NumSettings())) { $s = 2; continue; } _r$1 = fn($clone(f.Setting(i), http2Setting)); /* */ $s = 3; case 3: 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))) { $s = -1; return err; } i = i + (1) >> 0; $s = 1; continue; case 2: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2SettingsFrame.ptr.prototype.ForeachSetting }; } $f._r$1 = _r$1; $f.err = err; $f.f = f; $f.fn = fn; $f.i = i; $f.$s = $s; $f.$r = $r; return $f; }; http2SettingsFrame.prototype.ForeachSetting = function(fn) { return this.$val.ForeachSetting(fn); }; http2Framer.ptr.prototype.WriteSettings = function(settings) { var $24r, _i, _r$1, _ref, f, s, settings, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _i = $f._i; _r$1 = $f._r$1; _ref = $f._ref; f = $f.f; s = $f.s; settings = $f.settings; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; f.startWrite(4, 0, 0); _ref = settings; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } s = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), http2Setting); f.writeUint16(((s.ID << 16 >>> 16))); f.writeUint32(s.Val); _i++; } _r$1 = f.endWrite(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2Framer.ptr.prototype.WriteSettings }; } $f.$24r = $24r; $f._i = _i; $f._r$1 = _r$1; $f._ref = _ref; $f.f = f; $f.s = s; $f.settings = settings; $f.$s = $s; $f.$r = $r; return $f; }; http2Framer.prototype.WriteSettings = function(settings) { return this.$val.WriteSettings(settings); }; http2Framer.ptr.prototype.WriteSettingsAck = function() { var $24r, _r$1, f, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; f.startWrite(4, 1, 0); _r$1 = f.endWrite(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2Framer.ptr.prototype.WriteSettingsAck }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; }; http2Framer.prototype.WriteSettingsAck = function() { return this.$val.WriteSettingsAck(); }; http2PingFrame.ptr.prototype.IsAck = function() { var f; f = this; return new http2Flags(f.http2FrameHeader.Flags).Has(1); }; http2PingFrame.prototype.IsAck = function() { return this.$val.IsAck(); }; http2parsePingFrame = function(param, fh, payload) { var f, fh, param, payload; if (!((payload.$length === 8))) { return [$ifaceNil, new http2ConnectionError(6)]; } if (!((fh.StreamID === 0))) { return [$ifaceNil, new http2ConnectionError(1)]; } f = new http2PingFrame.ptr($clone(fh, http2FrameHeader), arrayType$8.zero()); $copySlice(new sliceType$3(f.Data), payload); return [f, $ifaceNil]; }; http2Framer.ptr.prototype.WritePing = function(ack, data) { var $24r, _r$1, ack, data, f, flags, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; ack = $f.ack; data = $f.data; f = $f.f; flags = $f.flags; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; flags = 0; if (ack) { flags = 1; } f.startWrite(6, flags, 0); f.writeBytes(new sliceType$3(data)); _r$1 = f.endWrite(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2Framer.ptr.prototype.WritePing }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.ack = ack; $f.data = data; $f.f = f; $f.flags = flags; $f.$s = $s; $f.$r = $r; return $f; }; http2Framer.prototype.WritePing = function(ack, data) { return this.$val.WritePing(ack, data); }; http2GoAwayFrame.ptr.prototype.DebugData = function() { var f; f = this; f.http2FrameHeader.checkValid(); return f.debugData; }; http2GoAwayFrame.prototype.DebugData = function() { return this.$val.DebugData(); }; http2parseGoAwayFrame = function(param, fh, p) { var fh, p, param; if (!((fh.StreamID === 0))) { return [$ifaceNil, new http2ConnectionError(1)]; } if (p.$length < 8) { return [$ifaceNil, new http2ConnectionError(6)]; } return [new http2GoAwayFrame.ptr($clone(fh, http2FrameHeader), ($clone(binary.BigEndian, binary.bigEndian).Uint32($subslice(p, 0, 4)) & 2147483647) >>> 0, (($clone(binary.BigEndian, binary.bigEndian).Uint32($subslice(p, 4, 8)) >>> 0)), $subslice(p, 8)), $ifaceNil]; }; http2Framer.ptr.prototype.WriteGoAway = function(maxStreamID, code, debugData) { var $24r, _r$1, code, debugData, f, maxStreamID, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; code = $f.code; debugData = $f.debugData; f = $f.f; maxStreamID = $f.maxStreamID; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; f.startWrite(7, 0, 0); f.writeUint32((maxStreamID & 2147483647) >>> 0); f.writeUint32(((code >>> 0))); f.writeBytes(debugData); _r$1 = f.endWrite(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2Framer.ptr.prototype.WriteGoAway }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.code = code; $f.debugData = debugData; $f.f = f; $f.maxStreamID = maxStreamID; $f.$s = $s; $f.$r = $r; return $f; }; http2Framer.prototype.WriteGoAway = function(maxStreamID, code, debugData) { return this.$val.WriteGoAway(maxStreamID, code, debugData); }; http2UnknownFrame.ptr.prototype.Payload = function() { var f; f = this; f.http2FrameHeader.checkValid(); return f.p; }; http2UnknownFrame.prototype.Payload = function() { return this.$val.Payload(); }; http2parseUnknownFrame = function(param, fh, p) { var fh, p, param; return [new http2UnknownFrame.ptr($clone(fh, http2FrameHeader), p), $ifaceNil]; }; http2parseWindowUpdateFrame = function(param, fh, p) { var fh, inc, p, param, x$5; if (!((p.$length === 4))) { return [$ifaceNil, new http2ConnectionError(6)]; } inc = ($clone(binary.BigEndian, binary.bigEndian).Uint32($subslice(p, 0, 4)) & 2147483647) >>> 0; if (inc === 0) { if (fh.StreamID === 0) { return [$ifaceNil, new http2ConnectionError(1)]; } return [$ifaceNil, (x$5 = http2streamError(fh.StreamID, 1), new x$5.constructor.elem(x$5))]; } return [new http2WindowUpdateFrame.ptr($clone(fh, http2FrameHeader), inc), $ifaceNil]; }; http2Framer.ptr.prototype.WriteWindowUpdate = function(streamID, incr) { var $24r, _r$1, f, incr, streamID, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; f = $f.f; incr = $f.incr; streamID = $f.streamID; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; if ((incr < 1 || incr > 2147483647) && !f.AllowIllegalWrites) { $s = -1; return errors.New("illegal window increment value"); } f.startWrite(8, 0, streamID); f.writeUint32(incr); _r$1 = f.endWrite(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2Framer.ptr.prototype.WriteWindowUpdate }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.f = f; $f.incr = incr; $f.streamID = streamID; $f.$s = $s; $f.$r = $r; return $f; }; http2Framer.prototype.WriteWindowUpdate = function(streamID, incr) { return this.$val.WriteWindowUpdate(streamID, incr); }; http2HeadersFrame.ptr.prototype.HeaderBlockFragment = function() { var f; f = this; f.http2FrameHeader.checkValid(); return f.headerFragBuf; }; http2HeadersFrame.prototype.HeaderBlockFragment = function() { return this.$val.HeaderBlockFragment(); }; http2HeadersFrame.ptr.prototype.HeadersEnded = function() { var f; f = this; return new http2Flags(f.http2FrameHeader.Flags).Has(4); }; http2HeadersFrame.prototype.HeadersEnded = function() { return this.$val.HeadersEnded(); }; http2HeadersFrame.ptr.prototype.StreamEnded = function() { var f; f = this; return new http2Flags(f.http2FrameHeader.Flags).Has(1); }; http2HeadersFrame.prototype.StreamEnded = function() { return this.$val.StreamEnded(); }; http2HeadersFrame.ptr.prototype.HasPriority = function() { var f; f = this; return new http2Flags(f.http2FrameHeader.Flags).Has(32); }; http2HeadersFrame.prototype.HasPriority = function() { return this.$val.HasPriority(); }; http2parseHeadersFrame = function(param, fh, p) { var _, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, err, fh, hf, p, padLength, param, v, x$5, x$6; _ = $ifaceNil; err = $ifaceNil; hf = new http2HeadersFrame.ptr($clone(fh, http2FrameHeader), new http2PriorityParam.ptr(0, false, 0), sliceType$3.nil); if (fh.StreamID === 0) { _tmp = $ifaceNil; _tmp$1 = (x$5 = new http2connError.ptr(1, "HEADERS frame with stream ID 0"), new x$5.constructor.elem(x$5)); _ = _tmp; err = _tmp$1; return [_, err]; } padLength = 0; if (new http2Flags(fh.Flags).Has(8)) { _tuple = http2readByte(p); p = _tuple[0]; padLength = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [_, err]; } } if (new http2Flags(fh.Flags).Has(32)) { v = 0; _tuple$1 = http2readUint32(p); p = _tuple$1[0]; v = _tuple$1[1]; err = _tuple$1[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$2 = $ifaceNil; _tmp$3 = err; _ = _tmp$2; err = _tmp$3; return [_, err]; } hf.Priority.StreamDep = (v & 2147483647) >>> 0; hf.Priority.Exclusive = !((v === hf.Priority.StreamDep)); _tuple$2 = http2readByte(p); p = _tuple$2[0]; hf.Priority.Weight = _tuple$2[1]; err = _tuple$2[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$4 = $ifaceNil; _tmp$5 = err; _ = _tmp$4; err = _tmp$5; return [_, err]; } } if ((p.$length - ((padLength >> 0)) >> 0) <= 0) { _tmp$6 = $ifaceNil; _tmp$7 = (x$6 = http2streamError(fh.StreamID, 1), new x$6.constructor.elem(x$6)); _ = _tmp$6; err = _tmp$7; return [_, err]; } hf.headerFragBuf = $subslice(p, 0, (p.$length - ((padLength >> 0)) >> 0)); _tmp$8 = hf; _tmp$9 = $ifaceNil; _ = _tmp$8; err = _tmp$9; return [_, err]; }; http2Framer.ptr.prototype.WriteHeaders = function(p) { var $24r, _r$1, f, flags, p, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; f = $f.f; flags = $f.flags; p = $f.p; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; if (!http2validStreamID(p.StreamID) && !f.AllowIllegalWrites) { $s = -1; return http2errStreamID; } flags = 0; if (!((p.PadLength === 0))) { flags = (flags | (8)) >>> 0; } if (p.EndStream) { flags = (flags | (1)) >>> 0; } if (p.EndHeaders) { flags = (flags | (4)) >>> 0; } if (!$clone(p.Priority, http2PriorityParam).IsZero()) { flags = (flags | (32)) >>> 0; } f.startWrite(1, flags, p.StreamID); if (!((p.PadLength === 0))) { f.writeByte(p.PadLength); } if (!$clone(p.Priority, http2PriorityParam).IsZero()) { v = p.Priority.StreamDep; if (!http2validStreamIDOrZero(v) && !f.AllowIllegalWrites) { $s = -1; return http2errDepStreamID; } if (p.Priority.Exclusive) { v = (v | (2147483648)) >>> 0; } f.writeUint32(v); f.writeByte(p.Priority.Weight); } f.wbuf = $appendSlice(f.wbuf, p.BlockFragment); f.wbuf = $appendSlice(f.wbuf, $subslice(http2padZeros, 0, p.PadLength)); _r$1 = f.endWrite(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2Framer.ptr.prototype.WriteHeaders }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.f = f; $f.flags = flags; $f.p = p; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; http2Framer.prototype.WriteHeaders = function(p) { return this.$val.WriteHeaders(p); }; http2PriorityParam.ptr.prototype.IsZero = function() { var p; p = this; return $equal(p, new http2PriorityParam.ptr(0, false, 0), http2PriorityParam); }; http2PriorityParam.prototype.IsZero = function() { return this.$val.IsZero(); }; http2parsePriorityFrame = function(param, fh, payload) { var $24r, _r$1, fh, param, payload, streamID, v, x$5, x$6, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; fh = $f.fh; param = $f.param; payload = $f.payload; streamID = $f.streamID; v = $f.v; x$5 = $f.x$5; x$6 = $f.x$6; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (fh.StreamID === 0) { $s = -1; return [$ifaceNil, (x$5 = new http2connError.ptr(1, "PRIORITY frame with stream ID 0"), new x$5.constructor.elem(x$5))]; } /* */ if (!((payload.$length === 5))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((payload.$length === 5))) { */ case 1: _r$1 = fmt.Sprintf("PRIORITY frame payload size was %d; want 5", new sliceType([new $Int(payload.$length)])); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = [$ifaceNil, (x$6 = new http2connError.ptr(6, _r$1), new x$6.constructor.elem(x$6))]; $s = 4; case 4: return $24r; /* } */ case 2: v = $clone(binary.BigEndian, binary.bigEndian).Uint32($subslice(payload, 0, 4)); streamID = (v & 2147483647) >>> 0; $s = -1; return [new http2PriorityFrame.ptr($clone(fh, http2FrameHeader), new http2PriorityParam.ptr(streamID, !((streamID === v)), (4 >= payload.$length ? ($throwRuntimeError("index out of range"), undefined) : payload.$array[payload.$offset + 4]))), $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: http2parsePriorityFrame }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.fh = fh; $f.param = param; $f.payload = payload; $f.streamID = streamID; $f.v = v; $f.x$5 = x$5; $f.x$6 = x$6; $f.$s = $s; $f.$r = $r; return $f; }; http2Framer.ptr.prototype.WritePriority = function(streamID, p) { var $24r, _r$1, f, p, streamID, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; f = $f.f; p = $f.p; streamID = $f.streamID; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; if (!http2validStreamID(streamID) && !f.AllowIllegalWrites) { $s = -1; return http2errStreamID; } if (!http2validStreamIDOrZero(p.StreamDep)) { $s = -1; return http2errDepStreamID; } f.startWrite(2, 0, streamID); v = p.StreamDep; if (p.Exclusive) { v = (v | (2147483648)) >>> 0; } f.writeUint32(v); f.writeByte(p.Weight); _r$1 = f.endWrite(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2Framer.ptr.prototype.WritePriority }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.f = f; $f.p = p; $f.streamID = streamID; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; http2Framer.prototype.WritePriority = function(streamID, p) { return this.$val.WritePriority(streamID, p); }; http2parseRSTStreamFrame = function(param, fh, p) { var fh, p, param; if (!((p.$length === 4))) { return [$ifaceNil, new http2ConnectionError(6)]; } if (fh.StreamID === 0) { return [$ifaceNil, new http2ConnectionError(1)]; } return [new http2RSTStreamFrame.ptr($clone(fh, http2FrameHeader), (($clone(binary.BigEndian, binary.bigEndian).Uint32($subslice(p, 0, 4)) >>> 0))), $ifaceNil]; }; http2Framer.ptr.prototype.WriteRSTStream = function(streamID, code) { var $24r, _r$1, code, f, streamID, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; code = $f.code; f = $f.f; streamID = $f.streamID; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; if (!http2validStreamID(streamID) && !f.AllowIllegalWrites) { $s = -1; return http2errStreamID; } f.startWrite(3, 0, streamID); f.writeUint32(((code >>> 0))); _r$1 = f.endWrite(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2Framer.ptr.prototype.WriteRSTStream }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.code = code; $f.f = f; $f.streamID = streamID; $f.$s = $s; $f.$r = $r; return $f; }; http2Framer.prototype.WriteRSTStream = function(streamID, code) { return this.$val.WriteRSTStream(streamID, code); }; http2parseContinuationFrame = function(param, fh, p) { var fh, p, param, x$5; if (fh.StreamID === 0) { return [$ifaceNil, (x$5 = new http2connError.ptr(1, "CONTINUATION frame with stream ID 0"), new x$5.constructor.elem(x$5))]; } return [new http2ContinuationFrame.ptr($clone(fh, http2FrameHeader), p), $ifaceNil]; }; http2ContinuationFrame.ptr.prototype.HeaderBlockFragment = function() { var f; f = this; f.http2FrameHeader.checkValid(); return f.headerFragBuf; }; http2ContinuationFrame.prototype.HeaderBlockFragment = function() { return this.$val.HeaderBlockFragment(); }; http2ContinuationFrame.ptr.prototype.HeadersEnded = function() { var f; f = this; return new http2Flags(f.http2FrameHeader.Flags).Has(4); }; http2ContinuationFrame.prototype.HeadersEnded = function() { return this.$val.HeadersEnded(); }; http2Framer.ptr.prototype.WriteContinuation = function(streamID, endHeaders, headerBlockFragment) { var $24r, _r$1, endHeaders, f, flags, headerBlockFragment, streamID, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; endHeaders = $f.endHeaders; f = $f.f; flags = $f.flags; headerBlockFragment = $f.headerBlockFragment; streamID = $f.streamID; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; if (!http2validStreamID(streamID) && !f.AllowIllegalWrites) { $s = -1; return http2errStreamID; } flags = 0; if (endHeaders) { flags = (flags | (4)) >>> 0; } f.startWrite(9, flags, streamID); f.wbuf = $appendSlice(f.wbuf, headerBlockFragment); _r$1 = f.endWrite(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2Framer.ptr.prototype.WriteContinuation }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.endHeaders = endHeaders; $f.f = f; $f.flags = flags; $f.headerBlockFragment = headerBlockFragment; $f.streamID = streamID; $f.$s = $s; $f.$r = $r; return $f; }; http2Framer.prototype.WriteContinuation = function(streamID, endHeaders, headerBlockFragment) { return this.$val.WriteContinuation(streamID, endHeaders, headerBlockFragment); }; http2PushPromiseFrame.ptr.prototype.HeaderBlockFragment = function() { var f; f = this; f.http2FrameHeader.checkValid(); return f.headerFragBuf; }; http2PushPromiseFrame.prototype.HeaderBlockFragment = function() { return this.$val.HeaderBlockFragment(); }; http2PushPromiseFrame.ptr.prototype.HeadersEnded = function() { var f; f = this; return new http2Flags(f.http2FrameHeader.Flags).Has(4); }; http2PushPromiseFrame.prototype.HeadersEnded = function() { return this.$val.HeadersEnded(); }; http2parsePushPromise = function(param, fh, p) { var _, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, _tuple$1, err, fh, p, padLength, param, pp; _ = $ifaceNil; err = $ifaceNil; pp = new http2PushPromiseFrame.ptr($clone(fh, http2FrameHeader), 0, sliceType$3.nil); if (pp.http2FrameHeader.StreamID === 0) { _tmp = $ifaceNil; _tmp$1 = new http2ConnectionError(1); _ = _tmp; err = _tmp$1; return [_, err]; } padLength = 0; if (new http2Flags(fh.Flags).Has(8)) { _tuple = http2readByte(p); p = _tuple[0]; padLength = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [_, err]; } } _tuple$1 = http2readUint32(p); p = _tuple$1[0]; pp.PromiseID = _tuple$1[1]; err = _tuple$1[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [_, err]; } pp.PromiseID = (pp.PromiseID & 2147483647) >>> 0; if (((padLength >> 0)) > p.$length) { _tmp$2 = $ifaceNil; _tmp$3 = new http2ConnectionError(1); _ = _tmp$2; err = _tmp$3; return [_, err]; } pp.headerFragBuf = $subslice(p, 0, (p.$length - ((padLength >> 0)) >> 0)); _tmp$4 = pp; _tmp$5 = $ifaceNil; _ = _tmp$4; err = _tmp$5; return [_, err]; }; http2Framer.ptr.prototype.WritePushPromise = function(p) { var $24r, _r$1, f, flags, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; f = $f.f; flags = $f.flags; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; if (!http2validStreamID(p.StreamID) && !f.AllowIllegalWrites) { $s = -1; return http2errStreamID; } flags = 0; if (!((p.PadLength === 0))) { flags = (flags | (8)) >>> 0; } if (p.EndHeaders) { flags = (flags | (4)) >>> 0; } f.startWrite(5, flags, p.StreamID); if (!((p.PadLength === 0))) { f.writeByte(p.PadLength); } if (!http2validStreamID(p.PromiseID) && !f.AllowIllegalWrites) { $s = -1; return http2errStreamID; } f.writeUint32(p.PromiseID); f.wbuf = $appendSlice(f.wbuf, p.BlockFragment); f.wbuf = $appendSlice(f.wbuf, $subslice(http2padZeros, 0, p.PadLength)); _r$1 = f.endWrite(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2Framer.ptr.prototype.WritePushPromise }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.f = f; $f.flags = flags; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; http2Framer.prototype.WritePushPromise = function(p) { return this.$val.WritePushPromise(p); }; http2Framer.ptr.prototype.WriteRawFrame = function(t, flags, streamID, payload) { var $24r, _r$1, f, flags, payload, streamID, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; f = $f.f; flags = $f.flags; payload = $f.payload; streamID = $f.streamID; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; f.startWrite(t, flags, streamID); f.writeBytes(payload); _r$1 = f.endWrite(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2Framer.ptr.prototype.WriteRawFrame }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.f = f; $f.flags = flags; $f.payload = payload; $f.streamID = streamID; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; http2Framer.prototype.WriteRawFrame = function(t, flags, streamID, payload) { return this.$val.WriteRawFrame(t, flags, streamID, payload); }; http2readByte = function(p) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, b, err, p, remain; remain = sliceType$3.nil; b = 0; err = $ifaceNil; if (p.$length === 0) { _tmp = sliceType$3.nil; _tmp$1 = 0; _tmp$2 = io.ErrUnexpectedEOF; remain = _tmp; b = _tmp$1; err = _tmp$2; return [remain, b, err]; } _tmp$3 = $subslice(p, 1); _tmp$4 = (0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0]); _tmp$5 = $ifaceNil; remain = _tmp$3; b = _tmp$4; err = _tmp$5; return [remain, b, err]; }; http2readUint32 = function(p) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, err, p, remain, v; remain = sliceType$3.nil; v = 0; err = $ifaceNil; if (p.$length < 4) { _tmp = sliceType$3.nil; _tmp$1 = 0; _tmp$2 = io.ErrUnexpectedEOF; remain = _tmp; v = _tmp$1; err = _tmp$2; return [remain, v, err]; } _tmp$3 = $subslice(p, 4); _tmp$4 = $clone(binary.BigEndian, binary.bigEndian).Uint32($subslice(p, 0, 4)); _tmp$5 = $ifaceNil; remain = _tmp$3; v = _tmp$4; err = _tmp$5; return [remain, v, err]; }; http2MetaHeadersFrame.ptr.prototype.PseudoValue = function(pseudo) { var _i, _ref, hf, mh, pseudo; mh = this; _ref = mh.Fields; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } hf = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), hpack.HeaderField); if (!$clone(hf, hpack.HeaderField).IsPseudo()) { return ""; } if ($substring(hf.Name, 1) === pseudo) { return hf.Value; } _i++; } return ""; }; http2MetaHeadersFrame.prototype.PseudoValue = function(pseudo) { return this.$val.PseudoValue(pseudo); }; http2MetaHeadersFrame.ptr.prototype.RegularFields = function() { var _i, _ref, hf, i, mh; mh = this; _ref = mh.Fields; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; hf = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), hpack.HeaderField); if (!$clone(hf, hpack.HeaderField).IsPseudo()) { return $subslice(mh.Fields, i); } _i++; } return sliceType$22.nil; }; http2MetaHeadersFrame.prototype.RegularFields = function() { return this.$val.RegularFields(); }; http2MetaHeadersFrame.ptr.prototype.PseudoFields = function() { var _i, _ref, hf, i, mh; mh = this; _ref = mh.Fields; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; hf = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), hpack.HeaderField); if (!$clone(hf, hpack.HeaderField).IsPseudo()) { return $subslice(mh.Fields, 0, i); } _i++; } return mh.Fields; }; http2MetaHeadersFrame.prototype.PseudoFields = function() { return this.$val.PseudoFields(); }; http2MetaHeadersFrame.ptr.prototype.checkPseudos = function() { var _1, _i, _i$1, _ref, _ref$1, _tmp, _tmp$1, hf, hf2, i, isRequest, isResponse, mh, pf; mh = this; _tmp = false; _tmp$1 = false; isRequest = _tmp; isResponse = _tmp$1; pf = mh.PseudoFields(); _ref = pf; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; hf = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), hpack.HeaderField); _1 = hf.Name; if (_1 === (":method") || _1 === (":path") || _1 === (":scheme") || _1 === (":authority")) { isRequest = true; } else if (_1 === (":status")) { isResponse = true; } else { return new http2pseudoHeaderError((hf.Name)); } _ref$1 = $subslice(pf, 0, i); _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } hf2 = $clone(((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]), hpack.HeaderField); if (hf.Name === hf2.Name) { return new http2duplicatePseudoHeaderError((hf.Name)); } _i$1++; } _i++; } if (isRequest && isResponse) { return http2errMixPseudoHeaderTypes; } return $ifaceNil; }; http2MetaHeadersFrame.prototype.checkPseudos = function() { return this.$val.checkPseudos(); }; http2Framer.ptr.prototype.maxHeaderStringLen = function() { var fr, v; fr = this; v = fr.maxHeaderListSize(); if (((((v >> 0)) >>> 0)) === v) { return ((v >> 0)); } return 0; }; http2Framer.prototype.maxHeaderStringLen = function() { return this.$val.maxHeaderStringLen(); }; http2Framer.ptr.prototype.readMetaFrame = function(hf) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, $24r$5, $24r$6, _r$1, _r$2, _r$3, _r$4, _tuple, _tuple$1, err, err$1, err$2, err$3, f, fr, frag, hc, hdec, hf, invalid, mh, remainSize, sawRegular, x$5, x$6, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; $24r$6 = $f.$24r$6; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; f = $f.f; fr = $f.fr; frag = $f.frag; hc = $f.hc; hdec = $f.hdec; hf = $f.hf; invalid = $f.invalid; mh = $f.mh; remainSize = $f.remainSize; sawRegular = $f.sawRegular; x$5 = $f.x$5; x$6 = $f.x$6; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); fr = [fr]; hdec = [hdec]; invalid = [invalid]; mh = [mh]; remainSize = [remainSize]; sawRegular = [sawRegular]; fr[0] = this; /* */ if (fr[0].AllowIllegalReads) { $s = 1; continue; } /* */ $s = 2; continue; /* if (fr[0].AllowIllegalReads) { */ case 1: $24r = [ptrType$76.nil, errors.New("illegal use of AllowIllegalReads with ReadMetaHeaders")]; $s = 3; case 3: return $24r; /* } */ case 2: mh[0] = new http2MetaHeadersFrame.ptr(hf, sliceType$22.nil, false); remainSize[0] = fr[0].maxHeaderListSize(); sawRegular[0] = false; invalid[0] = $ifaceNil; hdec[0] = fr[0].ReadMetaHeaders; hdec[0].SetEmitEnabled(true); hdec[0].SetMaxStringLength(fr[0].maxHeaderStringLen()); hdec[0].SetEmitFunc((function(fr, hdec, invalid, mh, remainSize, sawRegular) { return function $b(hf$1) { var hf$1, isPseudo, size, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; hf$1 = $f.hf$1; isPseudo = $f.isPseudo; size = $f.size; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (http2VerboseLogs && fr[0].logReads) { $s = 1; continue; } /* */ $s = 2; continue; /* if (http2VerboseLogs && fr[0].logReads) { */ case 1: $r = fr[0].debugReadLoggerf("http2: decoded hpack field %+v", new sliceType([new hf$1.constructor.elem(hf$1)])); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: if (!httpguts.ValidHeaderFieldValue(hf$1.Value)) { invalid[0] = new http2headerFieldValueError((hf$1.Value)); } isPseudo = strings.HasPrefix(hf$1.Name, ":"); if (isPseudo) { if (sawRegular[0]) { invalid[0] = http2errPseudoAfterRegular; } } else { sawRegular[0] = true; if (!http2validWireHeaderFieldName(hf$1.Name)) { invalid[0] = new http2headerFieldNameError((hf$1.Name)); } } if (!($interfaceIsEqual(invalid[0], $ifaceNil))) { hdec[0].SetEmitEnabled(false); $s = -1; return; } size = $clone(hf$1, hpack.HeaderField).Size(); if (size > remainSize[0]) { hdec[0].SetEmitEnabled(false); mh[0].Truncated = true; $s = -1; return; } remainSize[0] = remainSize[0] - (size) >>> 0; mh[0].Fields = $append(mh[0].Fields, hf$1); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.hf$1 = hf$1; $f.isPseudo = isPseudo; $f.size = size; $f.$s = $s; $f.$r = $r; return $f; }; })(fr, hdec, invalid, mh, remainSize, sawRegular)); $deferred.push([$methodVal(hdec[0], "SetEmitFunc"), [(function(fr, hdec, invalid, mh, remainSize, sawRegular) { return function(hf$1) { var hf$1; }; })(fr, hdec, invalid, mh, remainSize, sawRegular)]]); hc = hf; /* while (true) { */ case 4: _r$1 = hc.HeaderBlockFragment(); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } frag = _r$1; _r$2 = hdec[0].Write(frag); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 8: $24r$1 = [ptrType$76.nil, new http2ConnectionError(9)]; $s = 10; case 10: return $24r$1; /* } */ case 9: _r$3 = hc.HeadersEnded(); /* */ $s = 13; case 13: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } /* */ if (_r$3) { $s = 11; continue; } /* */ $s = 12; continue; /* if (_r$3) { */ case 11: /* break; */ $s = 5; continue; /* } */ case 12: _r$4 = fr[0].ReadFrame(); /* */ $s = 14; case 14: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$1 = _r$4; f = _tuple$1[0]; err$1 = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 15; continue; } /* */ $s = 16; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 15: $24r$2 = [ptrType$76.nil, err$1]; $s = 18; case 18: return $24r$2; /* } else { */ case 16: hc = $assertType(f, ptrType$77); /* } */ case 17: $s = 4; continue; case 5: mh[0].http2HeadersFrame.headerFragBuf = sliceType$3.nil; mh[0].http2HeadersFrame.http2FrameHeader.invalidate(); err$2 = hdec[0].Close(); /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 19; continue; } /* */ $s = 20; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 19: $24r$3 = [ptrType$76.nil, new http2ConnectionError(9)]; $s = 21; case 21: return $24r$3; /* } */ case 20: /* */ if (!($interfaceIsEqual(invalid[0], $ifaceNil))) { $s = 22; continue; } /* */ $s = 23; continue; /* if (!($interfaceIsEqual(invalid[0], $ifaceNil))) { */ case 22: fr[0].errDetail = invalid[0]; /* */ if (http2VerboseLogs) { $s = 24; continue; } /* */ $s = 25; continue; /* if (http2VerboseLogs) { */ case 24: $r = log.Printf("http2: invalid header: %v", new sliceType([invalid[0]])); /* */ $s = 26; case 26: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 25: $24r$4 = [ptrType$76.nil, (x$5 = new http2StreamError.ptr(mh[0].http2HeadersFrame.http2FrameHeader.StreamID, 1, invalid[0]), new x$5.constructor.elem(x$5))]; $s = 27; case 27: return $24r$4; /* } */ case 23: err$3 = mh[0].checkPseudos(); /* */ if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = 28; continue; } /* */ $s = 29; continue; /* if (!($interfaceIsEqual(err$3, $ifaceNil))) { */ case 28: fr[0].errDetail = err$3; /* */ if (http2VerboseLogs) { $s = 30; continue; } /* */ $s = 31; continue; /* if (http2VerboseLogs) { */ case 30: $r = log.Printf("http2: invalid pseudo headers: %v", new sliceType([err$3])); /* */ $s = 32; case 32: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 31: $24r$5 = [ptrType$76.nil, (x$6 = new http2StreamError.ptr(mh[0].http2HeadersFrame.http2FrameHeader.StreamID, 1, err$3), new x$6.constructor.elem(x$6))]; $s = 33; case 33: return $24r$5; /* } */ case 29: $24r$6 = [mh[0], $ifaceNil]; $s = 34; case 34: return $24r$6; /* */ } return; } } catch(err) { $err = err; $s = -1; return [ptrType$76.nil, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2Framer.ptr.prototype.readMetaFrame }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f.$24r$6 = $24r$6; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.f = f; $f.fr = fr; $f.frag = frag; $f.hc = hc; $f.hdec = hdec; $f.hf = hf; $f.invalid = invalid; $f.mh = mh; $f.remainSize = remainSize; $f.sawRegular = sawRegular; $f.x$5 = x$5; $f.x$6 = x$6; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2Framer.prototype.readMetaFrame = function(hf) { return this.$val.readMetaFrame(hf); }; http2summarizeFrame = function(f) { var _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, buf, data, f, f$1, f$2, f$3, f$4, f$5, f$6, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; buf = $f.buf; data = $f.data; f = $f.f; f$1 = $f.f$1; 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; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: buf = [buf]; n = [n]; buf[0] = new bytes.Buffer.ptr(sliceType$3.nil, 0, 0); _r$1 = f.Header(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = $clone(_r$1, http2FrameHeader).writeDebug(buf[0]); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _ref = f; /* */ if ($assertType(_ref, ptrType$78, true)[1]) { $s = 3; continue; } /* */ if ($assertType(_ref, ptrType$79, true)[1]) { $s = 4; continue; } /* */ if ($assertType(_ref, ptrType$80, true)[1]) { $s = 5; continue; } /* */ if ($assertType(_ref, ptrType$81, true)[1]) { $s = 6; continue; } /* */ if ($assertType(_ref, ptrType$82, true)[1]) { $s = 7; continue; } /* */ if ($assertType(_ref, ptrType$83, true)[1]) { $s = 8; continue; } /* */ $s = 9; continue; /* if ($assertType(_ref, ptrType$78, true)[1]) { */ case 3: f$1 = _ref.$val; n[0] = 0; _r$2 = f$1.ForeachSetting((function(buf, n) { return function $b(s) { var _r$2, _r$3, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$2 = $f._r$2; _r$3 = $f._r$3; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n[0] = n[0] + (1) >> 0; /* */ if (n[0] === 1) { $s = 1; continue; } /* */ $s = 2; continue; /* if (n[0] === 1) { */ case 1: _r$2 = buf[0].WriteString(", settings:"); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; /* } */ case 2: _r$3 = fmt.Fprintf(buf[0], " %v=%v,", new sliceType([new http2SettingID(s.ID), new $Uint32(s.Val)])); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$2 = _r$2; $f._r$3 = _r$3; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; })(buf, n)); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; if (n[0] > 0) { buf[0].Truncate(buf[0].Len() - 1 >> 0); } $s = 9; continue; /* } else if ($assertType(_ref, ptrType$79, true)[1]) { */ case 4: f$2 = _ref.$val; data = f$2.Data(); if (data.$length > 256) { data = $subslice(data, 0, 256); } _r$3 = fmt.Fprintf(buf[0], " data=%q", new sliceType([data])); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; /* */ if (f$2.Data().$length > 256) { $s = 12; continue; } /* */ $s = 13; continue; /* if (f$2.Data().$length > 256) { */ case 12: _r$4 = fmt.Fprintf(buf[0], " (%d bytes omitted)", new sliceType([new $Int((f$2.Data().$length - 256 >> 0))])); /* */ $s = 14; case 14: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; /* } */ case 13: $s = 9; continue; /* } else if ($assertType(_ref, ptrType$80, true)[1]) { */ case 5: f$3 = _ref.$val; /* */ if (f$3.http2FrameHeader.StreamID === 0) { $s = 15; continue; } /* */ $s = 16; continue; /* if (f$3.http2FrameHeader.StreamID === 0) { */ case 15: _r$5 = buf[0].WriteString(" (conn)"); /* */ $s = 17; case 17: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; /* } */ case 16: _r$6 = fmt.Fprintf(buf[0], " incr=%v", new sliceType([new $Uint32(f$3.Increment)])); /* */ $s = 18; case 18: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; $s = 9; continue; /* } else if ($assertType(_ref, ptrType$81, true)[1]) { */ case 6: f$4 = _ref.$val; _r$7 = fmt.Fprintf(buf[0], " ping=%q", new sliceType([new sliceType$3(f$4.Data)])); /* */ $s = 19; case 19: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$7; $s = 9; continue; /* } else if ($assertType(_ref, ptrType$82, true)[1]) { */ case 7: f$5 = _ref.$val; _r$8 = fmt.Fprintf(buf[0], " LastStreamID=%v ErrCode=%v Debug=%q", new sliceType([new $Uint32(f$5.LastStreamID), new http2ErrCode(f$5.ErrCode), f$5.debugData])); /* */ $s = 20; case 20: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$8; $s = 9; continue; /* } else if ($assertType(_ref, ptrType$83, true)[1]) { */ case 8: f$6 = _ref.$val; _r$9 = fmt.Fprintf(buf[0], " ErrCode=%v", new sliceType([new http2ErrCode(f$6.ErrCode)])); /* */ $s = 21; case 21: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$9; /* } */ case 9: $s = -1; return buf[0].String(); /* */ } return; } if ($f === undefined) { $f = { $blk: http2summarizeFrame }; } $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.buf = buf; $f.data = data; $f.f = f; $f.f$1 = f$1; $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.n = n; $f.$s = $s; $f.$r = $r; return $f; }; http2traceHasWroteHeaderField = function(trace) { var trace; return !(trace === ptrType$19.nil) && !(trace.WroteHeaderField === $throwNilPointerError); }; http2traceWroteHeaderField = function(trace, k, v) { var k, trace, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; k = $f.k; trace = $f.trace; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (!(trace === ptrType$19.nil) && !(trace.WroteHeaderField === $throwNilPointerError)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(trace === ptrType$19.nil) && !(trace.WroteHeaderField === $throwNilPointerError)) { */ case 1: $r = trace.WroteHeaderField(k, new sliceType$2([v])); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2traceWroteHeaderField }; } $f.k = k; $f.trace = trace; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; http2traceGot1xxResponseFunc = function(trace) { var trace; if (!(trace === ptrType$19.nil)) { return trace.Got1xxResponse; } return $throwNilPointerError; }; http2Transport.ptr.prototype.dialTLSWithContext = function(ctx, network, addr, cfg) { var _r$1, _tuple, addr, cfg, cn, ctx, dialer, err, network, t, tlsCn, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; addr = $f.addr; cfg = $f.cfg; cn = $f.cn; ctx = $f.ctx; dialer = $f.dialer; err = $f.err; network = $f.network; t = $f.t; tlsCn = $f.tlsCn; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; dialer = new tls.Dialer.ptr(ptrType$84.nil, cfg); _r$1 = dialer.DialContext(ctx, network, addr); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; cn = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$30.nil, err]; } tlsCn = $assertType(cn, ptrType$30); $s = -1; return [tlsCn, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: http2Transport.ptr.prototype.dialTLSWithContext }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.addr = addr; $f.cfg = cfg; $f.cn = cn; $f.ctx = ctx; $f.dialer = dialer; $f.err = err; $f.network = network; $f.t = t; $f.tlsCn = tlsCn; $f.$s = $s; $f.$r = $r; return $f; }; http2Transport.prototype.dialTLSWithContext = function(ctx, network, addr, cfg) { return this.$val.dialTLSWithContext(ctx, network, addr, cfg); }; http2newGoroutineLock = function() { var $24r, _r$1, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (!http2DebugGoroutines) { $s = -1; return new http2goroutineLock(0, 0); } _r$1 = http2curGoroutineID(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = ((x$5 = _r$1, new http2goroutineLock(x$5.$high, x$5.$low))); $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2newGoroutineLock }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; http2goroutineLock.prototype.check = function() { var _r$1, g, x$5, x$6, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; g = $f.g; x$5 = $f.x$5; x$6 = $f.x$6; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: g = this; if (!http2DebugGoroutines) { $s = -1; return; } _r$1 = http2curGoroutineID(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (!((x$5 = _r$1, x$6 = (new $Uint64(g.$high, g.$low)), (x$5.$high === x$6.$high && x$5.$low === x$6.$low)))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((x$5 = _r$1, x$6 = (new $Uint64(g.$high, g.$low)), (x$5.$high === x$6.$high && x$5.$low === x$6.$low)))) { */ case 1: $panic(new $String("running on the wrong goroutine")); /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2goroutineLock.prototype.check }; } $f._r$1 = _r$1; $f.g = g; $f.x$5 = x$5; $f.x$6 = x$6; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(http2goroutineLock).prototype.check = function() { return this.$get().check(); }; http2goroutineLock.prototype.checkNotOn = function() { var _r$1, g, x$5, x$6, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; g = $f.g; x$5 = $f.x$5; x$6 = $f.x$6; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: g = this; if (!http2DebugGoroutines) { $s = -1; return; } _r$1 = http2curGoroutineID(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if ((x$5 = _r$1, x$6 = (new $Uint64(g.$high, g.$low)), (x$5.$high === x$6.$high && x$5.$low === x$6.$low))) { $s = 1; continue; } /* */ $s = 2; continue; /* if ((x$5 = _r$1, x$6 = (new $Uint64(g.$high, g.$low)), (x$5.$high === x$6.$high && x$5.$low === x$6.$low))) { */ case 1: $panic(new $String("running on the wrong goroutine")); /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2goroutineLock.prototype.checkNotOn }; } $f._r$1 = _r$1; $f.g = g; $f.x$5 = x$5; $f.x$6 = x$6; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(http2goroutineLock).prototype.checkNotOn = function() { return this.$get().checkNotOn(); }; http2curGoroutineID = function() { var $24r, _r$1, _r$2, _r$3, _tuple, b, bp, err, i, n, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; b = $f.b; bp = $f.bp; err = $f.err; i = $f.i; n = $f.n; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); _r$1 = http2littleBuf.Get(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } bp = $assertType(_r$1, ptrType$6); $deferred.push([$methodVal(http2littleBuf, "Put"), [bp]]); b = bp.$get(); b = $subslice(b, 0, runtime.Stack(b, false)); b = bytes.TrimPrefix(b, http2goroutineSpace); i = bytes.IndexByte(b, 32); /* */ if (i < 0) { $s = 2; continue; } /* */ $s = 3; continue; /* if (i < 0) { */ case 2: _r$2 = fmt.Sprintf("No space found in %q", new sliceType([b])); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $panic(new $String(_r$2)); /* } */ case 3: b = $subslice(b, 0, i); _tuple = http2parseUintBytes(b, 10, 64); n = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 5: _r$3 = fmt.Sprintf("Failed to parse goroutine ID out of %q: %v", new sliceType([b, err])); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $panic(new $String(_r$3)); /* } */ case 6: $24r = n; $s = 8; case 8: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; return new $Uint64(0, 0); } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2curGoroutineID }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.b = b; $f.bp = bp; $f.err = err; $f.i = i; $f.n = n; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2parseUintBytes = function(s, base, bitSize) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, base, bitSize, cutoff, d, err, i, maxVal, n, n1, s, s0, v, x$5, x$6, $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; } s0 = s; /* */ 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 = strconv.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 (((0 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 0]) === 48) && s.$length > 1 && (((1 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 1]) === 120) || ((1 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 1]) === 88))) { $s = 9; continue; } /* */ if (((0 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 0]) === 48)) { $s = 10; continue; } /* */ $s = 11; continue; /* if (((0 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 0]) === 48) && s.$length > 1 && (((1 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 1]) === 120) || ((1 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 1]) === 88))) { */ case 9: base = 16; s = $subslice(s, 2); /* */ if (s.$length < 1) { $s = 13; continue; } /* */ $s = 14; continue; /* if (s.$length < 1) { */ case 13: err = strconv.ErrSyntax; /* goto Error */ $s = 7; continue; /* } */ case 14: $s = 12; continue; /* } else if (((0 >= s.$length ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 0]) === 48)) { */ case 10: base = 8; $s = 12; continue; /* } else { */ case 11: base = 10; /* } */ case 12: case 8: $s = 6; continue; /* } else { */ case 5: err = errors.New("invalid base " + strconv.Itoa(base)); /* goto Error */ $s = 7; continue; /* } */ case 6: case 1: n = new $Uint64(0, 0); cutoff = http2cutoff64(base); maxVal = (x$5 = $shiftLeft64(new $Uint64(0, 1), ((bitSize >>> 0))), new $Uint64(x$5.$high - 0, x$5.$low - 1)); i = 0; /* while (true) { */ case 15: /* if (!(i < s.$length)) { break; } */ if(!(i < s.$length)) { $s = 16; continue; } v = 0; d = ((i < 0 || i >= s.$length) ? ($throwRuntimeError("index out of range"), undefined) : s.$array[s.$offset + 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 = strconv.ErrSyntax; /* goto Error */ $s = 7; continue; /* } */ case 22: case 17: /* */ if (((v >> 0)) >= base) { $s = 23; continue; } /* */ $s = 24; continue; /* if (((v >> 0)) >= base) { */ case 23: n = new $Uint64(0, 0); err = strconv.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 = strconv.ErrRange; /* goto Error */ $s = 7; continue; /* } */ case 26: n = $mul64(n, ((new $Uint64(0, base)))); n1 = (x$6 = (new $Uint64(0, v)), new $Uint64(n.$high + x$6.$high, n.$low + x$6.$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 = strconv.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; $s = -1; return [n, err]; /* Error: */ case 7: _tmp$4 = n; _tmp$5 = new strconv.NumError.ptr("ParseUint", ($bytesToString(s0)), err); n = _tmp$4; err = _tmp$5; $s = -1; return [n, err]; /* */ } return; } }; http2cutoff64 = function(base) { var base, x$5; if (base < 2) { return new $Uint64(0, 0); } return (x$5 = $div64(new $Uint64(4294967295, 4294967295), (new $Uint64(0, base)), false), new $Uint64(x$5.$high + 0, x$5.$low + 1)); }; http2buildCommonHeaderMapsOnce = function() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = http2commonBuildOnce.Do(http2buildCommonHeaderMaps); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2buildCommonHeaderMapsOnce }; } $f.$s = $s; $f.$r = $r; return $f; }; http2buildCommonHeaderMaps = function() { var _i, _key, _key$1, _r$1, _ref, chk, common, v, x$5, x$6, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _key = $f._key; _key$1 = $f._key$1; _r$1 = $f._r$1; _ref = $f._ref; chk = $f.chk; common = $f.common; v = $f.v; x$5 = $f.x$5; x$6 = $f.x$6; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: common = new sliceType$2(["accept", "accept-charset", "accept-encoding", "accept-language", "accept-ranges", "age", "access-control-allow-origin", "allow", "authorization", "cache-control", "content-disposition", "content-encoding", "content-language", "content-length", "content-location", "content-range", "content-type", "cookie", "date", "etag", "expect", "expires", "from", "host", "if-match", "if-modified-since", "if-none-match", "if-unmodified-since", "last-modified", "link", "location", "max-forwards", "proxy-authenticate", "proxy-authorization", "range", "referer", "refresh", "retry-after", "server", "set-cookie", "strict-transport-security", "trailer", "transfer-encoding", "user-agent", "vary", "via", "www-authenticate"]); http2commonLowerHeader = (x$5 = common.$length, ((x$5 < 0 || x$5 > 2147483647) ? $throwRuntimeError("makemap: size out of range") : {})); http2commonCanonHeader = (x$6 = common.$length, ((x$6 < 0 || x$6 > 2147483647) ? $throwRuntimeError("makemap: size out of range") : {})); _ref = common; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r$1 = CanonicalHeaderKey(v); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } chk = _r$1; _key = chk; (http2commonLowerHeader || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: v }; _key$1 = v; (http2commonCanonHeader || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key$1)] = { k: _key$1, v: chk }; _i++; $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2buildCommonHeaderMaps }; } $f._i = _i; $f._key = _key; $f._key$1 = _key$1; $f._r$1 = _r$1; $f._ref = _ref; $f.chk = chk; $f.common = common; $f.v = v; $f.x$5 = x$5; $f.x$6 = x$6; $f.$s = $s; $f.$r = $r; return $f; }; http2lowerHeader = function(v) { var $24r, _entry, _r$1, _tmp, _tmp$1, _tuple, _tuple$1, ascii$1, lower, ok, s, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _entry = $f._entry; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; ascii$1 = $f.ascii$1; lower = $f.lower; ok = $f.ok; s = $f.s; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: lower = ""; ascii$1 = false; $r = http2buildCommonHeaderMapsOnce(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tuple = (_entry = http2commonLowerHeader[$String.keyFor(v)], _entry !== undefined ? [_entry.v, true] : ["", false]); s = _tuple[0]; ok = _tuple[1]; if (ok) { _tmp = s; _tmp$1 = true; lower = _tmp; ascii$1 = _tmp$1; $s = -1; return [lower, ascii$1]; } _r$1 = http2asciiToLower(v); /* */ $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; lower = _tuple$1[0]; ascii$1 = _tuple$1[1]; $24r = [lower, ascii$1]; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2lowerHeader }; } $f.$24r = $24r; $f._entry = _entry; $f._r$1 = _r$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.ascii$1 = ascii$1; $f.lower = lower; $f.ok = ok; $f.s = s; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; init = function() { var _r$1, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = os.Getenv("GODEBUG"); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } e = _r$1; if (strings.Contains(e, "http2debug=1")) { http2VerboseLogs = true; } if (strings.Contains(e, "http2debug=2")) { http2VerboseLogs = true; http2logFrameWrites = true; http2logFrameReads = true; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: init }; } $f._r$1 = _r$1; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; http2streamState.prototype.String = function() { var st; st = this.$val; return ((st < 0 || st >= http2stateName.length) ? ($throwRuntimeError("index out of range"), undefined) : http2stateName[st]); }; $ptrType(http2streamState).prototype.String = function() { return new http2streamState(this.$get()).String(); }; http2Setting.ptr.prototype.String = function() { var $24r, _r$1, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; _r$1 = fmt.Sprintf("[%v = %d]", new sliceType([new http2SettingID(s.ID), new $Uint32(s.Val)])); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2Setting.ptr.prototype.String }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; http2Setting.prototype.String = function() { return this.$val.String(); }; http2Setting.ptr.prototype.Valid = function() { var _1, s; s = this; _1 = s.ID; if (_1 === (2)) { if (!((s.Val === 1)) && !((s.Val === 0))) { return new http2ConnectionError(1); } } else if (_1 === (4)) { if (s.Val > 2147483647) { return new http2ConnectionError(3); } } else if (_1 === (5)) { if (s.Val < 16384 || s.Val > 16777215) { return new http2ConnectionError(1); } } return $ifaceNil; }; http2Setting.prototype.Valid = function() { return this.$val.Valid(); }; http2SettingID.prototype.String = function() { var $24r, _entry, _r$1, _tuple, ok, s, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _entry = $f._entry; _r$1 = $f._r$1; _tuple = $f._tuple; ok = $f.ok; s = $f.s; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this.$val; _tuple = (_entry = http2settingName[http2SettingID.keyFor(s)], _entry !== undefined ? [_entry.v, true] : ["", false]); v = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return v; } _r$1 = fmt.Sprintf("UNKNOWN_SETTING_%d", new sliceType([new $Uint16(((s << 16 >>> 16)))])); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2SettingID.prototype.String }; } $f.$24r = $24r; $f._entry = _entry; $f._r$1 = _r$1; $f._tuple = _tuple; $f.ok = ok; $f.s = s; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(http2SettingID).prototype.String = function() { return new http2SettingID(this.$get()).String(); }; http2validWireHeaderFieldName = function(v) { var _i, _ref, _rune, r, v; if (v.length === 0) { return false; } _ref = v; _i = 0; while (true) { if (!(_i < _ref.length)) { break; } _rune = $decodeRune(_ref, _i); r = _rune[0]; if (!httpguts.IsTokenRune(r)) { return false; } if (65 <= r && r <= 90) { return false; } _i += _rune[1]; } return true; }; http2httpCodeString = function(code) { var _1, code; _1 = code; if (_1 === (200)) { return "200"; } else if (_1 === (404)) { return "404"; } return strconv.Itoa(code); }; http2gate.prototype.Done = function() { var g, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; g = $f.g; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: g = this.$val; $r = $send(g, $clone(new structType.ptr(), structType)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2gate.prototype.Done }; } $f.g = g; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(http2gate).prototype.Done = function() { return new http2gate(this.$get()).Done(); }; http2gate.prototype.Wait = function() { var _r$1, g, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; g = $f.g; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: g = this.$val; _r$1 = $recv(g); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1[0]; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2gate.prototype.Wait }; } $f._r$1 = _r$1; $f.g = g; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(http2gate).prototype.Wait = function() { return new http2gate(this.$get()).Wait(); }; $ptrType(http2closeWaiter).prototype.Init = function() { var cw; cw = this; cw.$set(new $Chan(structType, 0)); }; http2closeWaiter.prototype.Close = function() { var cw; cw = this.$val; $close(cw); }; $ptrType(http2closeWaiter).prototype.Close = function() { return new http2closeWaiter(this.$get()).Close(); }; http2closeWaiter.prototype.Wait = function() { var _r$1, cw, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; cw = $f.cw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cw = this.$val; _r$1 = $recv(cw); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1[0]; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2closeWaiter.prototype.Wait }; } $f._r$1 = _r$1; $f.cw = cw; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(http2closeWaiter).prototype.Wait = function() { return new http2closeWaiter(this.$get()).Wait(); }; http2newBufferedWriter = function(w) { var w; return new http2bufferedWriter.ptr(arrayType.zero(), w, ptrType$14.nil); }; http2bufferedWriter.ptr.prototype.Available = function() { var w; w = this; if (w.bw === ptrType$14.nil) { return 4096; } return w.bw.Available(); }; http2bufferedWriter.prototype.Available = function() { return this.$val.Available(); }; http2bufferedWriter.ptr.prototype.Write = function(p) { var $24r, _r$1, _r$2, _tuple, bw, err, n, p, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; bw = $f.bw; err = $f.err; n = $f.n; p = $f.p; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; w = this; /* */ if (w.bw === ptrType$14.nil) { $s = 1; continue; } /* */ $s = 2; continue; /* if (w.bw === ptrType$14.nil) { */ case 1: _r$1 = http2bufWriterPool.Get(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } bw = $assertType(_r$1, ptrType$14); bw.Reset(w.w); w.bw = bw; /* } */ case 2: _r$2 = w.bw.Write(p); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; n = _tuple[0]; err = _tuple[1]; $24r = [n, err]; $s = 5; case 5: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2bufferedWriter.ptr.prototype.Write }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.bw = bw; $f.err = err; $f.n = n; $f.p = p; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; http2bufferedWriter.prototype.Write = function(p) { return this.$val.Write(p); }; http2bufferedWriter.ptr.prototype.Flush = function() { var _r$1, bw, err, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; bw = $f.bw; err = $f.err; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: w = this; bw = w.bw; if (bw === ptrType$14.nil) { $s = -1; return $ifaceNil; } _r$1 = bw.Flush(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err = _r$1; bw.Reset($ifaceNil); http2bufWriterPool.Put(bw); w.bw = ptrType$14.nil; $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: http2bufferedWriter.ptr.prototype.Flush }; } $f._r$1 = _r$1; $f.bw = bw; $f.err = err; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; http2bufferedWriter.prototype.Flush = function() { return this.$val.Flush(); }; http2mustUint31 = function(v) { var v; if (v < 0 || v > 2147483647) { $panic(new $String("out of range")); } return ((v >>> 0)); }; http2bodyAllowedForStatus = function(status) { var status; if (status >= 100 && status <= 199) { return false; } else if ((status === 204)) { return false; } else if ((status === 304)) { return false; } return true; }; http2httpError.ptr.prototype.Error = function() { var e; e = this; return e.msg; }; http2httpError.prototype.Error = function() { return this.$val.Error(); }; http2httpError.ptr.prototype.Timeout = function() { var e; e = this; return e.timeout; }; http2httpError.prototype.Timeout = function() { return this.$val.Timeout(); }; http2httpError.ptr.prototype.Temporary = function() { var e; e = this; return true; }; http2httpError.prototype.Temporary = function() { return this.$val.Temporary(); }; http2sorter.ptr.prototype.Len = function() { var s; s = this; return s.v.$length; }; http2sorter.prototype.Len = function() { return this.$val.Len(); }; http2sorter.ptr.prototype.Swap = function(i, j) { var _tmp, _tmp$1, i, j, s, x$5, x$6, x$7, x$8; s = this; _tmp = (x$5 = s.v, ((j < 0 || j >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + j])); _tmp$1 = (x$6 = s.v, ((i < 0 || i >= x$6.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$6.$array[x$6.$offset + i])); (x$7 = s.v, ((i < 0 || i >= x$7.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$7.$array[x$7.$offset + i] = _tmp)); (x$8 = s.v, ((j < 0 || j >= x$8.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$8.$array[x$8.$offset + j] = _tmp$1)); }; http2sorter.prototype.Swap = function(i, j) { return this.$val.Swap(i, j); }; http2sorter.ptr.prototype.Less = function(i, j) { var i, j, s, x$5, x$6; s = this; return (x$5 = s.v, ((i < 0 || i >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + i])) < (x$6 = s.v, ((j < 0 || j >= x$6.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$6.$array[x$6.$offset + j])); }; http2sorter.prototype.Less = function(i, j) { return this.$val.Less(i, j); }; http2sorter.ptr.prototype.Keys = function(h) { var _entry, _i, _keys, _ref, h, k, keys, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _i = $f._i; _keys = $f._keys; _ref = $f._ref; h = $f.h; k = $f.k; keys = $f.keys; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; keys = $subslice(s.v, 0, 0); _ref = h; _i = 0; _keys = $keys(_ref); while (true) { if (!(_i < _keys.length)) { break; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; continue; } k = _entry.k; keys = $append(keys, k); _i++; } s.v = keys; $r = sort.Sort(s); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return keys; /* */ } return; } if ($f === undefined) { $f = { $blk: http2sorter.ptr.prototype.Keys }; } $f._entry = _entry; $f._i = _i; $f._keys = _keys; $f._ref = _ref; $f.h = h; $f.k = k; $f.keys = keys; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; http2sorter.prototype.Keys = function(h) { return this.$val.Keys(h); }; http2sorter.ptr.prototype.SortStrings = function(ss) { var s, save, ss, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; s = $f.s; save = $f.save; ss = $f.ss; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; save = s.v; s.v = ss; $r = sort.Sort(s); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } s.v = save; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2sorter.ptr.prototype.SortStrings }; } $f.s = s; $f.save = save; $f.ss = ss; $f.$s = $s; $f.$r = $r; return $f; }; http2sorter.prototype.SortStrings = function(ss) { return this.$val.SortStrings(ss); }; http2validPseudoPath = function(v) { var v; return (v.length > 0 && (v.charCodeAt(0) === 47)) || v === "*"; }; http2pipe.ptr.prototype.Len = function() { var $24r, $24r$1, _r$1, p, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r$1 = $f._r$1; p = $f.p; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); p = this; $r = p.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(p.mu, "Unlock"), []]); /* */ if ($interfaceIsEqual(p.b, $ifaceNil)) { $s = 2; continue; } /* */ $s = 3; continue; /* if ($interfaceIsEqual(p.b, $ifaceNil)) { */ case 2: $24r = p.unread; $s = 4; case 4: return $24r; /* } */ case 3: _r$1 = p.b.Len(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r$1 = _r$1; $s = 6; case 6: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return 0; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2pipe.ptr.prototype.Len }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r$1 = _r$1; $f.p = p; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2pipe.prototype.Len = function() { return this.$val.Len(); }; http2pipe.ptr.prototype.Read = function(d) { var $24r, $24r$1, $24r$2, _r$1, _r$2, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _v, d, err, n, p, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _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; _tuple = $f._tuple; _v = $f._v; d = $f.d; err = $f.err; n = $f.n; p = $f.p; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); n = 0; err = $ifaceNil; p = this; $r = p.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(p.mu, "Unlock"), []]); if ($interfaceIsEqual(p.c.L, $ifaceNil)) { p.c.L = p.mu; } /* while (true) { */ case 2: /* */ if (!($interfaceIsEqual(p.breakErr, $ifaceNil))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!($interfaceIsEqual(p.breakErr, $ifaceNil))) { */ case 4: _tmp = 0; _tmp$1 = p.breakErr; n = _tmp; err = _tmp$1; $24r = [n, err]; $s = 6; case 6: return $24r; /* } */ case 5: if (!(!($interfaceIsEqual(p.b, $ifaceNil)))) { _v = false; $s = 9; continue s; } _r$1 = p.b.Len(); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _v = _r$1 > 0; case 9: /* */ if (_v) { $s = 7; continue; } /* */ $s = 8; continue; /* if (_v) { */ case 7: _r$2 = p.b.Read(d); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; n = _tuple[0]; err = _tuple[1]; $24r$1 = [n, err]; $s = 12; case 12: return $24r$1; /* } */ case 8: /* */ if (!($interfaceIsEqual(p.err, $ifaceNil))) { $s = 13; continue; } /* */ $s = 14; continue; /* if (!($interfaceIsEqual(p.err, $ifaceNil))) { */ case 13: /* */ if (!(p.readFn === $throwNilPointerError)) { $s = 15; continue; } /* */ $s = 16; continue; /* if (!(p.readFn === $throwNilPointerError)) { */ case 15: $r = p.readFn(); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } p.readFn = $throwNilPointerError; /* } */ case 16: p.b = $ifaceNil; _tmp$2 = 0; _tmp$3 = p.err; n = _tmp$2; err = _tmp$3; $24r$2 = [n, err]; $s = 18; case 18: return $24r$2; /* } */ case 14: $r = p.c.Wait(); /* */ $s = 19; case 19: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 2; continue; case 3: $s = -1; return [n, err]; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [n, err]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2pipe.ptr.prototype.Read }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $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._tuple = _tuple; $f._v = _v; $f.d = d; $f.err = err; $f.n = n; $f.p = p; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2pipe.prototype.Read = function(d) { return this.$val.Read(d); }; http2pipe.ptr.prototype.Write = function(d) { var $24r, $24r$1, $24r$2, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, d, err, n, p, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; d = $f.d; err = $f.err; n = $f.n; p = $f.p; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); n = 0; err = $ifaceNil; p = this; $r = p.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(p.mu, "Unlock"), []]); if ($interfaceIsEqual(p.c.L, $ifaceNil)) { p.c.L = p.mu; } $deferred.push([$methodVal(p.c, "Signal"), []]); /* */ if (!($interfaceIsEqual(p.err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(p.err, $ifaceNil))) { */ case 2: _tmp = 0; _tmp$1 = http2errClosedPipeWrite; n = _tmp; err = _tmp$1; $24r = [n, err]; $s = 4; case 4: return $24r; /* } */ case 3: /* */ if (!($interfaceIsEqual(p.breakErr, $ifaceNil))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(p.breakErr, $ifaceNil))) { */ case 5: p.unread = p.unread + (d.$length) >> 0; _tmp$2 = d.$length; _tmp$3 = $ifaceNil; n = _tmp$2; err = _tmp$3; $24r$1 = [n, err]; $s = 7; case 7: return $24r$1; /* } */ case 6: _r$1 = p.b.Write(d); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err = _tuple[1]; $24r$2 = [n, err]; $s = 9; case 9: return $24r$2; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [n, err]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2pipe.ptr.prototype.Write }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._r$1 = _r$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f.d = d; $f.err = err; $f.n = n; $f.p = p; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2pipe.prototype.Write = function(d) { return this.$val.Write(d); }; http2pipe.ptr.prototype.CloseWithError = function(err) { var err, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; $r = p.closeWithError((p.$ptr_err || (p.$ptr_err = new ptrType$85(function() { return this.$target.err; }, function($v) { this.$target.err = $v; }, p))), err, $throwNilPointerError); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2pipe.ptr.prototype.CloseWithError }; } $f.err = err; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; http2pipe.prototype.CloseWithError = function(err) { return this.$val.CloseWithError(err); }; http2pipe.ptr.prototype.BreakWithError = function(err) { var err, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; $r = p.closeWithError((p.$ptr_breakErr || (p.$ptr_breakErr = new ptrType$85(function() { return this.$target.breakErr; }, function($v) { this.$target.breakErr = $v; }, p))), err, $throwNilPointerError); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2pipe.ptr.prototype.BreakWithError }; } $f.err = err; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; http2pipe.prototype.BreakWithError = function(err) { return this.$val.BreakWithError(err); }; http2pipe.ptr.prototype.closeWithErrorAndCode = function(err, fn) { var err, fn, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; fn = $f.fn; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; $r = p.closeWithError((p.$ptr_err || (p.$ptr_err = new ptrType$85(function() { return this.$target.err; }, function($v) { this.$target.err = $v; }, p))), err, fn); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2pipe.ptr.prototype.closeWithErrorAndCode }; } $f.err = err; $f.fn = fn; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; http2pipe.prototype.closeWithErrorAndCode = function(err, fn) { return this.$val.closeWithErrorAndCode(err, fn); }; http2pipe.ptr.prototype.closeWithError = function(dst, err, fn) { var _r$1, dst, err, fn, p, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; dst = $f.dst; err = $f.err; fn = $f.fn; p = $f.p; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); p = this; if ($interfaceIsEqual(err, $ifaceNil)) { $panic(new $String("err must be non-nil")); } $r = p.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(p.mu, "Unlock"), []]); if ($interfaceIsEqual(p.c.L, $ifaceNil)) { p.c.L = p.mu; } $deferred.push([$methodVal(p.c, "Signal"), []]); /* */ if (!($interfaceIsEqual(dst.$get(), $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(dst.$get(), $ifaceNil))) { */ case 2: $s = 4; case 4: return; /* } */ case 3: p.readFn = fn; /* */ if (dst === (p.$ptr_breakErr || (p.$ptr_breakErr = new ptrType$85(function() { return this.$target.breakErr; }, function($v) { this.$target.breakErr = $v; }, p)))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (dst === (p.$ptr_breakErr || (p.$ptr_breakErr = new ptrType$85(function() { return this.$target.breakErr; }, function($v) { this.$target.breakErr = $v; }, p)))) { */ case 5: /* */ if (!($interfaceIsEqual(p.b, $ifaceNil))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!($interfaceIsEqual(p.b, $ifaceNil))) { */ case 7: _r$1 = p.b.Len(); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } p.unread = p.unread + (_r$1) >> 0; /* } */ case 8: p.b = $ifaceNil; /* } */ case 6: dst.$set(err); p.closeDoneLocked(); $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2pipe.ptr.prototype.closeWithError }; } $f._r$1 = _r$1; $f.dst = dst; $f.err = err; $f.fn = fn; $f.p = p; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2pipe.prototype.closeWithError = function(dst, err, fn) { return this.$val.closeWithError(dst, err, fn); }; http2pipe.ptr.prototype.closeDoneLocked = function() { var _selection, p; p = this; if (p.donec === $chanNil) { return; } _selection = $select([[p.donec], []]); if (_selection[0] === 0) { } else if (_selection[0] === 1) { $close(p.donec); } }; http2pipe.prototype.closeDoneLocked = function() { return this.$val.closeDoneLocked(); }; http2pipe.ptr.prototype.Err = function() { var $24r, $24r$1, p, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; p = $f.p; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); p = this; $r = p.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(p.mu, "Unlock"), []]); /* */ if (!($interfaceIsEqual(p.breakErr, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(p.breakErr, $ifaceNil))) { */ case 2: $24r = p.breakErr; $s = 4; case 4: return $24r; /* } */ case 3: $24r$1 = p.err; $s = 5; case 5: return $24r$1; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2pipe.ptr.prototype.Err }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.p = p; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2pipe.prototype.Err = function() { return this.$val.Err(); }; http2pipe.ptr.prototype.Done = function() { var $24r, p, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; p = $f.p; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); p = this; $r = p.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(p.mu, "Unlock"), []]); if (p.donec === $chanNil) { p.donec = new $Chan(structType, 0); if (!($interfaceIsEqual(p.err, $ifaceNil)) || !($interfaceIsEqual(p.breakErr, $ifaceNil))) { p.closeDoneLocked(); } } $24r = p.donec; $s = 2; case 2: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; return $chanNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2pipe.ptr.prototype.Done }; } $f.$24r = $24r; $f.p = p; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2pipe.prototype.Done = function() { return this.$val.Done(); }; http2Server.ptr.prototype.initialConnRecvWindowSize = function() { var s; s = this; if (s.MaxUploadBufferPerConnection > 65535) { return s.MaxUploadBufferPerConnection; } return 1048576; }; http2Server.prototype.initialConnRecvWindowSize = function() { return this.$val.initialConnRecvWindowSize(); }; http2Server.ptr.prototype.initialStreamRecvWindowSize = function() { var s; s = this; if (s.MaxUploadBufferPerStream > 0) { return s.MaxUploadBufferPerStream; } return 1048576; }; http2Server.prototype.initialStreamRecvWindowSize = function() { return this.$val.initialStreamRecvWindowSize(); }; http2Server.ptr.prototype.maxReadFrameSize = function() { var s, v; s = this; v = s.MaxReadFrameSize; if (v >= 16384 && v <= 16777215) { return v; } return 1048576; }; http2Server.prototype.maxReadFrameSize = function() { return this.$val.maxReadFrameSize(); }; http2Server.ptr.prototype.maxConcurrentStreams = function() { var s, v; s = this; v = s.MaxConcurrentStreams; if (v > 0) { return v; } return 250; }; http2Server.prototype.maxConcurrentStreams = function() { return this.$val.maxConcurrentStreams(); }; http2Server.ptr.prototype.maxQueuedControlFrames = function() { var s; s = this; return 10000; }; http2Server.prototype.maxQueuedControlFrames = function() { return this.$val.maxQueuedControlFrames(); }; http2serverInternalState.ptr.prototype.registerConn = function(sc) { var _key, s, sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _key = $f._key; s = $f.s; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; if (s === ptrType$60.nil) { $s = -1; return; } $r = s.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _key = sc; (s.activeConns || $throwRuntimeError("assignment to entry in nil map"))[ptrType$13.keyFor(_key)] = { k: _key, v: new structType.ptr() }; $r = s.mu.Unlock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverInternalState.ptr.prototype.registerConn }; } $f._key = _key; $f.s = s; $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; http2serverInternalState.prototype.registerConn = function(sc) { return this.$val.registerConn(sc); }; http2serverInternalState.ptr.prototype.unregisterConn = function(sc) { var s, sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; s = $f.s; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; if (s === ptrType$60.nil) { $s = -1; return; } $r = s.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } delete s.activeConns[ptrType$13.keyFor(sc)]; $r = s.mu.Unlock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverInternalState.ptr.prototype.unregisterConn }; } $f.s = s; $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; http2serverInternalState.prototype.unregisterConn = function(sc) { return this.$val.unregisterConn(sc); }; http2serverInternalState.ptr.prototype.startGracefulShutdown = function() { var _entry, _i, _keys, _ref, s, sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _i = $f._i; _keys = $f._keys; _ref = $f._ref; s = $f.s; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; if (s === ptrType$60.nil) { $s = -1; return; } $r = s.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _ref = s.activeConns; _i = 0; _keys = $keys(_ref); /* while (true) { */ case 2: /* if (!(_i < _keys.length)) { break; } */ if(!(_i < _keys.length)) { $s = 3; continue; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; /* continue; */ $s = 2; continue; } sc = _entry.k; $r = sc.startGracefulShutdown(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i++; $s = 2; continue; case 3: $r = s.mu.Unlock(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverInternalState.ptr.prototype.startGracefulShutdown }; } $f._entry = _entry; $f._i = _i; $f._keys = _keys; $f._ref = _ref; $f.s = s; $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; http2serverInternalState.prototype.startGracefulShutdown = function() { return this.$val.startGracefulShutdown(); }; http2ConfigureServer = function(s, conf) { var $24r, _1, _i, _i$1, _key, _r$1, _ref, _ref$1, _tmp, _tmp$1, conf, cs, h1, h2, haveNPN, haveRequired, p, protoHandler, s, x$5, x$6, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _1 = $f._1; _i = $f._i; _i$1 = $f._i$1; _key = $f._key; _r$1 = $f._r$1; _ref = $f._ref; _ref$1 = $f._ref$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; conf = $f.conf; cs = $f.cs; h1 = $f.h1; h2 = $f.h2; haveNPN = $f.haveNPN; haveRequired = $f.haveRequired; p = $f.p; protoHandler = $f.protoHandler; s = $f.s; x$5 = $f.x$5; x$6 = $f.x$6; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: conf = [conf]; if (s === ptrType$46.nil) { $panic(new $String("nil *http.Server")); } if (conf[0] === ptrType$86.nil) { conf[0] = new http2Server.ptr(0, 0, 0, false, new time.Duration(0, 0), 0, 0, $throwNilPointerError, ptrType$60.nil); } conf[0].state = new http2serverInternalState.ptr(new sync.Mutex.ptr(0, 0), {}); _tmp = s; _tmp$1 = conf[0]; h1 = _tmp; h2 = _tmp$1; if ((x$5 = h2.IdleTimeout, (x$5.$high === 0 && x$5.$low === 0))) { if (!((x$6 = h1.IdleTimeout, (x$6.$high === 0 && x$6.$low === 0)))) { h2.IdleTimeout = h1.IdleTimeout; } else { h2.IdleTimeout = h1.ReadTimeout; } } $r = s.RegisterOnShutdown($methodVal(conf[0].state, "startGracefulShutdown")); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (s.TLSConfig === ptrType$4.nil) { $s = 2; continue; } /* */ if (!(s.TLSConfig.CipherSuites === sliceType$14.nil) && s.TLSConfig.MinVersion < 772) { $s = 3; continue; } /* */ $s = 4; continue; /* if (s.TLSConfig === ptrType$4.nil) { */ case 2: s.TLSConfig = new tls.Config.ptr($ifaceNil, $throwNilPointerError, sliceType$13.nil, false, $throwNilPointerError, $throwNilPointerError, $throwNilPointerError, $throwNilPointerError, $throwNilPointerError, ptrType$34.nil, sliceType$2.nil, "", 0, ptrType$34.nil, false, sliceType$14.nil, false, false, arrayType$1.zero(), $ifaceNil, 0, 0, sliceType$15.nil, false, 0, $ifaceNil, new sync.RWMutex.ptr(new sync.Mutex.ptr(0, 0), 0, 0, 0, 0), sliceType$16.nil, sliceType$16.nil); $s = 4; continue; /* } else if (!(s.TLSConfig.CipherSuites === sliceType$14.nil) && s.TLSConfig.MinVersion < 772) { */ case 3: haveRequired = false; _ref = s.TLSConfig.CipherSuites; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } cs = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _1 = cs; if ((_1 === (49199)) || (_1 === (49195))) { haveRequired = true; } _i++; } /* */ if (!haveRequired) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!haveRequired) { */ case 5: _r$1 = fmt.Errorf("http2: TLSConfig.CipherSuites is missing an HTTP/2-required AES_128_GCM_SHA256 cipher (need at least one of TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 or TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256)", new sliceType([])); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 8; case 8: return $24r; /* } */ case 6: /* } */ case 4: s.TLSConfig.PreferServerCipherSuites = true; haveNPN = false; _ref$1 = s.TLSConfig.NextProtos; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } p = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); if (p === "h2") { haveNPN = true; break; } _i$1++; } if (!haveNPN) { s.TLSConfig.NextProtos = $append(s.TLSConfig.NextProtos, "h2"); } if (s.TLSNextProto === false) { s.TLSNextProto = $makeMap($String.keyFor, []); } protoHandler = (function(conf) { return function $b(hs, c, h) { var _r$2, _tuple, bc, c, ctx, h, hs, ok, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$2 = $f._r$2; _tuple = $f._tuple; bc = $f.bc; c = $f.c; ctx = $f.ctx; h = $f.h; hs = $f.hs; ok = $f.ok; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (!(http2testHookOnConn === $throwNilPointerError)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(http2testHookOnConn === $throwNilPointerError)) { */ case 1: $r = http2testHookOnConn(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: ctx = $ifaceNil; _tuple = $assertType(h, baseContexter, true); bc = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 4; continue; } /* */ $s = 5; continue; /* if (ok) { */ case 4: _r$2 = bc.BaseContext(); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } ctx = _r$2; /* } */ case 5: $r = conf[0].ServeConn(c, new http2ServeConnOpts.ptr(ctx, hs, h)); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$2 = _r$2; $f._tuple = _tuple; $f.bc = bc; $f.c = c; $f.ctx = ctx; $f.h = h; $f.hs = hs; $f.ok = ok; $f.$s = $s; $f.$r = $r; return $f; }; })(conf); _key = "h2"; (s.TLSNextProto || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: protoHandler }; $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2ConfigureServer }; } $f.$24r = $24r; $f._1 = _1; $f._i = _i; $f._i$1 = _i$1; $f._key = _key; $f._r$1 = _r$1; $f._ref = _ref; $f._ref$1 = _ref$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.conf = conf; $f.cs = cs; $f.h1 = h1; $f.h2 = h2; $f.haveNPN = haveNPN; $f.haveRequired = haveRequired; $f.p = p; $f.protoHandler = protoHandler; $f.s = s; $f.x$5 = x$5; $f.x$6 = x$6; $f.$s = $s; $f.$r = $r; return $f; }; http2ServeConnOpts.ptr.prototype.context = function() { var o; o = this; if (!(o === ptrType$87.nil) && !($interfaceIsEqual(o.Context, $ifaceNil))) { return o.Context; } return context.Background(); }; http2ServeConnOpts.prototype.context = function() { return this.$val.context(); }; http2ServeConnOpts.ptr.prototype.baseConfig = function() { var o; o = this; if (!(o === ptrType$87.nil) && !(o.BaseConfig === ptrType$46.nil)) { return o.BaseConfig; } return new Server.ptr("", $ifaceNil, ptrType$4.nil, new time.Duration(0, 0), new time.Duration(0, 0), new time.Duration(0, 0), new time.Duration(0, 0), 0, false, $throwNilPointerError, ptrType$58.nil, $throwNilPointerError, $throwNilPointerError, 0, 0, new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)), $ifaceNil, new sync.Mutex.ptr(0, 0), false, false, $chanNil, sliceType$19.nil); }; http2ServeConnOpts.prototype.baseConfig = function() { return this.$val.baseConfig(); }; http2ServeConnOpts.ptr.prototype.handler = function() { var o; o = this; if (!(o === ptrType$87.nil)) { if (!($interfaceIsEqual(o.Handler, $ifaceNil))) { return o.Handler; } if (!(o.BaseConfig === ptrType$46.nil) && !($interfaceIsEqual(o.BaseConfig.Handler, $ifaceNil))) { return o.BaseConfig.Handler; } } return $pkg.DefaultServeMux; }; http2ServeConnOpts.prototype.handler = function() { return this.$val.handler(); }; http2Server.ptr.prototype.ServeConn = function(c, opts) { var _arg, _r$1, _r$10, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, baseCtx, c, cancel, fr, hook, ok, opts, s, sc, tc, x$5, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _r$1 = $f._r$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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; baseCtx = $f.baseCtx; c = $f.c; cancel = $f.cancel; fr = $f.fr; hook = $f.hook; ok = $f.ok; opts = $f.opts; s = $f.s; sc = $f.sc; tc = $f.tc; x$5 = $f.x$5; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); s = this; _r$1 = http2serverConnBaseContext(c, opts); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; baseCtx = _tuple[0]; cancel = _tuple[1]; $deferred.push([cancel, []]); _r$2 = c.RemoteAddr(); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = _r$2.String(); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = http2newGoroutineLock(); /* */ $s = 4; case 4: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } sc = new http2serverConn.ptr(s, opts.baseConfig(), c, http2newBufferedWriter(c), opts.handler(), baseCtx, ptrType$72.nil, new $Chan(structType, 0), new $Chan(http2readFrameResult, 0), new $Chan(http2FrameWriteRequest, 8), new $Chan(http2frameWriteResult, 1), new $Chan(http2bodyReadMsg, 0), new $Chan($emptyInterface, 8), new http2flow.ptr(arrayType.zero(), 0, ptrType$71.nil), new http2flow.ptr(arrayType.zero(), 0, ptrType$71.nil), ptrType$28.nil, _r$3, $ifaceNil, _r$4, true, false, false, 0, 0, 4294967295, s.maxConcurrentStreams(), 0, 0, 0, 0, {}, 65535, 16384, 4096, 0, false, false, false, false, false, false, false, 0, ptrType$25.nil, ptrType$25.nil, new bytes.Buffer.ptr(sliceType$3.nil, 0, 0), ptrType$89.nil, new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0))); $r = s.state.registerConn(sc); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(s.state, "unregisterConn"), [sc]]); /* */ if (!((x$5 = sc.hs.WriteTimeout, (x$5.$high === 0 && x$5.$low === 0)))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!((x$5 = sc.hs.WriteTimeout, (x$5.$high === 0 && x$5.$low === 0)))) { */ case 6: _r$5 = sc.conn.SetWriteDeadline(new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil)); /* */ $s = 8; case 8: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; /* } */ case 7: /* */ if (!(s.NewWriteScheduler === $throwNilPointerError)) { $s = 9; continue; } /* */ $s = 10; continue; /* if (!(s.NewWriteScheduler === $throwNilPointerError)) { */ case 9: _r$6 = s.NewWriteScheduler(); /* */ $s = 12; case 12: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } sc.writeSched = _r$6; $s = 11; continue; /* } else { */ case 10: sc.writeSched = http2NewRandomWriteScheduler(); /* } */ case 11: sc.flow.add(65535); sc.inflow.add(65535); _r$7 = hpack.NewEncoder(sc.headerWriteBuf); /* */ $s = 13; case 13: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } sc.hpackEncoder = _r$7; fr = http2NewFramer(sc.bw, c); _r$8 = hpack.NewDecoder(4096, $throwNilPointerError); /* */ $s = 14; case 14: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } fr.ReadMetaHeaders = _r$8; fr.MaxHeaderListSize = sc.maxHeaderListSize(); fr.SetMaxReadFrameSize(s.maxReadFrameSize()); sc.framer = fr; _tuple$1 = $assertType(c, http2connectionStater, true); tc = _tuple$1[0]; ok = _tuple$1[1]; /* */ if (ok) { $s = 15; continue; } /* */ $s = 16; continue; /* if (ok) { */ case 15: sc.tlsState = new tls.ConnectionState.ptr(0, false, false, 0, "", false, "", sliceType$10.nil, sliceType$11.nil, sliceType$5.nil, sliceType$3.nil, sliceType$3.nil, $throwNilPointerError); _r$9 = tc.ConnectionState(); /* */ $s = 17; case 17: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } tls.ConnectionState.copy(sc.tlsState, _r$9); /* */ if (sc.tlsState.Version < 771) { $s = 18; continue; } /* */ $s = 19; continue; /* if (sc.tlsState.Version < 771) { */ case 18: $r = sc.rejectConn(12, "TLS version too low"); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 21; case 21: return; /* } */ case 19: if (sc.tlsState.ServerName === "") { } /* */ if (!s.PermitProhibitedCipherSuites && http2isBadCipher(sc.tlsState.CipherSuite)) { $s = 22; continue; } /* */ $s = 23; continue; /* if (!s.PermitProhibitedCipherSuites && http2isBadCipher(sc.tlsState.CipherSuite)) { */ case 22: _r$10 = fmt.Sprintf("Prohibited TLS 1.2 Cipher Suite: %x", new sliceType([new $Uint16(sc.tlsState.CipherSuite)])); /* */ $s = 24; case 24: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _arg = _r$10; $r = sc.rejectConn(12, _arg); /* */ $s = 25; case 25: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 26; case 26: return; /* } */ case 23: /* } */ case 16: hook = http2testHookGetServerConn; /* */ if (!(hook === $throwNilPointerError)) { $s = 27; continue; } /* */ $s = 28; continue; /* if (!(hook === $throwNilPointerError)) { */ case 27: $r = hook(sc); /* */ $s = 29; case 29: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 28: $r = sc.serve(); /* */ $s = 30; case 30: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2Server.ptr.prototype.ServeConn }; } $f._arg = _arg; $f._r$1 = _r$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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.baseCtx = baseCtx; $f.c = c; $f.cancel = cancel; $f.fr = fr; $f.hook = hook; $f.ok = ok; $f.opts = opts; $f.s = s; $f.sc = sc; $f.tc = tc; $f.x$5 = x$5; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2Server.prototype.ServeConn = function(c, opts) { return this.$val.ServeConn(c, opts); }; http2serverConnBaseContext = function(c, opts) { var _arg, _arg$1, _arg$2, _r$1, _r$2, _r$3, _r$4, _tuple, c, cancel, ctx, hs, opts, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; c = $f.c; cancel = $f.cancel; ctx = $f.ctx; hs = $f.hs; opts = $f.opts; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ctx = $ifaceNil; cancel = $throwNilPointerError; _r$1 = context.WithCancel(opts.context()); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; ctx = _tuple[0]; cancel = _tuple[1]; _arg = ctx; _arg$1 = $pkg.LocalAddrContextKey; _r$2 = c.LocalAddr(); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg$2 = _r$2; _r$3 = context.WithValue(_arg, _arg$1, _arg$2); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } ctx = _r$3; hs = opts.baseConfig(); /* */ if (!(hs === ptrType$46.nil)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!(hs === ptrType$46.nil)) { */ case 4: _r$4 = context.WithValue(ctx, $pkg.ServerContextKey, hs); /* */ $s = 6; case 6: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } ctx = _r$4; /* } */ case 5: $s = -1; return [ctx, cancel]; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConnBaseContext }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f.c = c; $f.cancel = cancel; $f.ctx = ctx; $f.hs = hs; $f.opts = opts; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.ptr.prototype.rejectConn = function(err, debug) { var _r$1, _r$2, _r$3, debug, err, sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; debug = $f.debug; err = $f.err; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.vlogf("http2: server rejecting conn: %v, %s", new sliceType([new http2ErrCode(err), new $String(debug)])); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = sc.framer.WriteGoAway(0, err, (new sliceType$3($stringToBytes(debug)))); /* */ $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$2 = sc.bw.Flush(); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; _r$3 = sc.conn.Close(); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.rejectConn }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.debug = debug; $f.err = err; $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.rejectConn = function(err, debug) { return this.$val.rejectConn(err, debug); }; http2serverConn.ptr.prototype.maxHeaderListSize = function() { var n, sc; sc = this; n = sc.hs.MaxHeaderBytes; if (n <= 0) { n = 1048576; } return (((n + 320 >> 0) >>> 0)); }; http2serverConn.prototype.maxHeaderListSize = function() { return this.$val.maxHeaderListSize(); }; http2serverConn.ptr.prototype.curOpenStreams = function() { var sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return sc.curClientStreams + sc.curPushedStreams >>> 0; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.curOpenStreams }; } $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.curOpenStreams = function() { return this.$val.curOpenStreams(); }; http2serverConn.ptr.prototype.Framer = function() { var sc; sc = this; return sc.framer; }; http2serverConn.prototype.Framer = function() { return this.$val.Framer(); }; http2serverConn.ptr.prototype.CloseConn = function() { var $24r, _r$1, sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; _r$1 = sc.conn.Close(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.CloseConn }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.CloseConn = function() { return this.$val.CloseConn(); }; http2serverConn.ptr.prototype.Flush = function() { var $24r, _r$1, sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; _r$1 = sc.bw.Flush(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.Flush }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.Flush = function() { return this.$val.Flush(); }; http2serverConn.ptr.prototype.HeaderEncoder = function() { var sc; sc = this; return [sc.hpackEncoder, sc.headerWriteBuf]; }; http2serverConn.prototype.HeaderEncoder = function() { return this.$val.HeaderEncoder(); }; http2serverConn.ptr.prototype.state = function(streamID) { var _entry, _r$1, _tuple, ok, sc, st, streamID, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _r$1 = $f._r$1; _tuple = $f._tuple; ok = $f.ok; sc = $f.sc; st = $f.st; streamID = $f.streamID; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tuple = (_entry = sc.streams[$Uint32.keyFor(streamID)], _entry !== undefined ? [_entry.v, true] : [ptrType$10.nil, false]); st = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return [st.state, st]; } if ((_r$1 = streamID % 2, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) === 1) { if (streamID <= sc.maxClientStreamID) { $s = -1; return [4, ptrType$10.nil]; } } else { if (streamID <= sc.maxPushPromiseID) { $s = -1; return [4, ptrType$10.nil]; } } $s = -1; return [0, ptrType$10.nil]; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.state }; } $f._entry = _entry; $f._r$1 = _r$1; $f._tuple = _tuple; $f.ok = ok; $f.sc = sc; $f.st = st; $f.streamID = streamID; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.state = function(streamID) { return this.$val.state(streamID); }; http2serverConn.ptr.prototype.setConnState = function(state) { var sc, state, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; sc = $f.sc; state = $f.state; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; /* */ if (!(sc.hs.ConnState === $throwNilPointerError)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(sc.hs.ConnState === $throwNilPointerError)) { */ case 1: $r = sc.hs.ConnState(sc.conn, state); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.setConnState }; } $f.sc = sc; $f.state = state; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.setConnState = function(state) { return this.$val.setConnState(state); }; http2serverConn.ptr.prototype.vlogf = function(format, args) { var args, format, sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; args = $f.args; format = $f.format; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; /* */ if (http2VerboseLogs) { $s = 1; continue; } /* */ $s = 2; continue; /* if (http2VerboseLogs) { */ case 1: $r = sc.logf(format, args); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.vlogf }; } $f.args = args; $f.format = format; $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.vlogf = function(format, args) { return this.$val.vlogf(format, args); }; http2serverConn.ptr.prototype.logf = function(format, args) { var args, format, lg, sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; args = $f.args; format = $f.format; lg = $f.lg; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; lg = sc.hs.ErrorLog; /* */ if (!(lg === ptrType$58.nil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(lg === ptrType$58.nil)) { */ case 1: $r = lg.Printf(format, args); /* */ $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 = log.Printf(format, args); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.logf }; } $f.args = args; $f.format = format; $f.lg = lg; $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.logf = function(format, args) { return this.$val.logf(format, args); }; http2errno = function(v) { var _r$1, rv, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; rv = $f.rv; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = reflect.ValueOf(v); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } rv = _r$1; if ($clone(rv, reflect.Value).Kind() === 12) { $s = -1; return (($clone(rv, reflect.Value).Uint().$low >>> 0)); } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: http2errno }; } $f._r$1 = _r$1; $f.rv = rv; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; http2isClosedConnError = function(err) { var _r$1, _r$2, _tuple, _tuple$1, err, n, oe, ok, ok$1, se, str, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; err = $f.err; n = $f.n; oe = $f.oe; ok = $f.ok; ok$1 = $f.ok$1; se = $f.se; str = $f.str; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if ($interfaceIsEqual(err, $ifaceNil)) { $s = -1; return false; } _r$1 = err.Error(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } str = _r$1; if (strings.Contains(str, "use of closed network connection")) { $s = -1; return true; } /* */ if (false) { $s = 2; continue; } /* */ $s = 3; continue; /* if (false) { */ case 2: _tuple = $assertType(err, ptrType$57, true); oe = _tuple[0]; ok = _tuple[1]; /* */ if (ok && oe.Op === "read") { $s = 4; continue; } /* */ $s = 5; continue; /* if (ok && oe.Op === "read") { */ case 4: _tuple$1 = $assertType(oe.Err, ptrType$90, true); se = _tuple$1[0]; ok$1 = _tuple$1[1]; /* */ if (ok$1 && se.Syscall === "wsarecv") { $s = 6; continue; } /* */ $s = 7; continue; /* if (ok$1 && se.Syscall === "wsarecv") { */ case 6: _r$2 = http2errno(se.Err); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } n = _r$2; if ((n === 10054) || (n === 10053)) { $s = -1; return true; } /* } */ case 7: /* } */ case 5: /* } */ case 3: $s = -1; return false; /* */ } return; } if ($f === undefined) { $f = { $blk: http2isClosedConnError }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.err = err; $f.n = n; $f.oe = oe; $f.ok = ok; $f.ok$1 = ok$1; $f.se = se; $f.str = str; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.ptr.prototype.condlogf = function(err, format, args) { var _r$1, _v, args, err, format, sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _v = $f._v; args = $f.args; err = $f.err; format = $f.format; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; if ($interfaceIsEqual(err, $ifaceNil)) { $s = -1; return; } if ($interfaceIsEqual(err, io.EOF) || $interfaceIsEqual(err, io.ErrUnexpectedEOF)) { _v = true; $s = 4; continue s; } _r$1 = http2isClosedConnError(err); /* */ $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; case 4: /* */ if (_v || $interfaceIsEqual(err, http2errPrefaceTimeout)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v || $interfaceIsEqual(err, http2errPrefaceTimeout)) { */ case 1: $r = sc.vlogf(format, args); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 3; continue; /* } else { */ case 2: $r = sc.logf(format, args); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.condlogf }; } $f._r$1 = _r$1; $f._v = _v; $f.args = args; $f.err = err; $f.format = format; $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.condlogf = function(err, format, args) { return this.$val.condlogf(err, format, args); }; http2serverConn.ptr.prototype.canonicalHeader = function(v) { var _entry, _entry$1, _key, _r$1, _tuple, _tuple$1, cv, ok, sc, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _key = $f._key; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; cv = $f.cv; ok = $f.ok; sc = $f.sc; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = http2buildCommonHeaderMapsOnce(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tuple = (_entry = http2commonCanonHeader[$String.keyFor(v)], _entry !== undefined ? [_entry.v, true] : ["", false]); cv = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return cv; } _tuple$1 = (_entry$1 = sc.canonHeader[$String.keyFor(v)], _entry$1 !== undefined ? [_entry$1.v, true] : ["", false]); cv = _tuple$1[0]; ok = _tuple$1[1]; if (ok) { $s = -1; return cv; } if (sc.canonHeader === false) { sc.canonHeader = {}; } _r$1 = CanonicalHeaderKey(v); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } cv = _r$1; _key = v; (sc.canonHeader || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: cv }; $s = -1; return cv; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.canonicalHeader }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._key = _key; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.cv = cv; $f.ok = ok; $f.sc = sc; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.canonicalHeader = function(v) { return this.$val.canonicalHeader(v); }; http2serverConn.ptr.prototype.readFrames = function() { var _r$1, _r$2, _r$3, _selection, _selection$1, _tuple, err, f, gate, gateDone, sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _selection = $f._selection; _selection$1 = $f._selection$1; _tuple = $f._tuple; err = $f.err; f = $f.f; gate = $f.gate; gateDone = $f.gateDone; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; gate = new $Chan(structType, 0); gateDone = $methodVal(new http2gate(gate), "Done"); /* while (true) { */ case 1: _r$1 = sc.framer.ReadFrame(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; f = _tuple[0]; err = _tuple[1]; _r$2 = $select([[sc.readFrameCh, new http2readFrameResult.ptr(f, err, gateDone)], [sc.doneServing]]); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _selection = _r$2; if (_selection[0] === 0) { } else if (_selection[0] === 1) { $s = -1; return; } _r$3 = $select([[gate], [sc.doneServing]]); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _selection$1 = _r$3; if (_selection$1[0] === 0) { } else if (_selection$1[0] === 1) { $s = -1; return; } if (http2terminalReadFrameError(err)) { $s = -1; return; } $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.readFrames }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._selection = _selection; $f._selection$1 = _selection$1; $f._tuple = _tuple; $f.err = err; $f.f = f; $f.gate = gate; $f.gateDone = gateDone; $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.readFrames = function() { return this.$val.readFrames(); }; http2serverConn.ptr.prototype.writeFrameAsync = function(wr) { var _r$1, err, sc, wr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; err = $f.err; sc = $f.sc; wr = $f.wr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; _r$1 = wr.write.writeFrame(sc); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err = _r$1; $r = $send(sc.wroteFrameCh, $clone(new http2frameWriteResult.ptr(arrayType.zero(), $clone(wr, http2FrameWriteRequest), err), http2frameWriteResult)); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.writeFrameAsync }; } $f._r$1 = _r$1; $f.err = err; $f.sc = sc; $f.wr = wr; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.writeFrameAsync = function(wr) { return this.$val.writeFrameAsync(wr); }; http2serverConn.ptr.prototype.closeAllStreamsOnConnClose = function() { var _entry, _i, _keys, _ref, sc, st, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _i = $f._i; _keys = $f._keys; _ref = $f._ref; sc = $f.sc; st = $f.st; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _ref = sc.streams; _i = 0; _keys = $keys(_ref); /* while (true) { */ case 2: /* if (!(_i < _keys.length)) { break; } */ if(!(_i < _keys.length)) { $s = 3; continue; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; /* continue; */ $s = 2; continue; } st = _entry.v; $r = sc.closeStream(st, http2errClientDisconnected); /* */ $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; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.closeAllStreamsOnConnClose }; } $f._entry = _entry; $f._i = _i; $f._keys = _keys; $f._ref = _ref; $f.sc = sc; $f.st = st; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.closeAllStreamsOnConnClose = function() { return this.$val.closeAllStreamsOnConnClose(); }; http2serverConn.ptr.prototype.stopShutdownTimer = function() { var sc, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; sc = $f.sc; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } t = sc.shutdownTimer; if (!(t === ptrType$25.nil)) { t.Stop(); } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.stopShutdownTimer }; } $f.sc = sc; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.stopShutdownTimer = function() { return this.$val.stopShutdownTimer(); }; http2serverConn.ptr.prototype.notePanic = function() { var _r$1, e, sc, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; e = $f.e; sc = $f.sc; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); sc = this; /* */ if (!(http2testHookOnPanicMu === ptrType$2.nil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(http2testHookOnPanicMu === ptrType$2.nil)) { */ case 1: $r = http2testHookOnPanicMu.Lock(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(http2testHookOnPanicMu, "Unlock"), []]); /* } */ case 2: /* */ if (!(http2testHookOnPanic === $throwNilPointerError)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!(http2testHookOnPanic === $throwNilPointerError)) { */ case 4: e = $recover(); /* */ if (!($interfaceIsEqual(e, $ifaceNil))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!($interfaceIsEqual(e, $ifaceNil))) { */ case 6: _r$1 = http2testHookOnPanic(sc, e); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (_r$1) { $s = 8; continue; } /* */ $s = 9; continue; /* if (_r$1) { */ case 8: $panic(e); /* } */ case 9: /* } */ case 7: /* } */ case 5: $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.notePanic }; } $f._r$1 = _r$1; $f.e = e; $f.sc = sc; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2serverConn.prototype.notePanic = function() { return this.$val.notePanic(); }; http2serverConn.ptr.prototype.serve = function() { var _1, _arg, _arg$1, _arg$2, _arg$3, _arg$4, _arg$5, _arg$6, _arg$7, _r$1, _r$10, _r$11, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _selection, _selection$1, _tuple, _v, diff, err, gracefulShutdownComplete, loopNum, m, msg, ok, res, res$1, sc, se, sentGoAway, settingsTimer, v, v$1, v$2, v$3, wr, wroteRes, x$5, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _arg$4 = $f._arg$4; _arg$5 = $f._arg$5; _arg$6 = $f._arg$6; _arg$7 = $f._arg$7; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _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; _selection = $f._selection; _selection$1 = $f._selection$1; _tuple = $f._tuple; _v = $f._v; diff = $f.diff; err = $f.err; gracefulShutdownComplete = $f.gracefulShutdownComplete; loopNum = $f.loopNum; m = $f.m; msg = $f.msg; ok = $f.ok; res = $f.res; res$1 = $f.res$1; sc = $f.sc; se = $f.se; sentGoAway = $f.sentGoAway; settingsTimer = $f.settingsTimer; v = $f.v; v$1 = $f.v$1; v$2 = $f.v$2; v$3 = $f.v$3; wr = $f.wr; wroteRes = $f.wroteRes; x$5 = $f.x$5; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); sc = this; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(sc, "notePanic"), []]); $deferred.push([$methodVal(sc.conn, "Close"), []]); $deferred.push([$methodVal(sc, "closeAllStreamsOnConnClose"), []]); $deferred.push([$methodVal(sc, "stopShutdownTimer"), []]); $deferred.push([function(_arg) { $close(_arg); }, [sc.doneServing]]); /* */ if (http2VerboseLogs) { $s = 2; continue; } /* */ $s = 3; continue; /* if (http2VerboseLogs) { */ case 2: _r$1 = sc.conn.RemoteAddr(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$1 = _r$1; _arg$2 = sc.hs; $r = sc.vlogf("http2: server connection from %v on %p", new sliceType([_arg$1, _arg$2])); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: $r = sc.writeFrame(new http2FrameWriteRequest.ptr(new http2writeSettings([new http2Setting.ptr(5, sc.srv.maxReadFrameSize()), new http2Setting.ptr(3, sc.advMaxStreams), new http2Setting.ptr(6, sc.maxHeaderListSize()), new http2Setting.ptr(4, ((sc.srv.initialStreamRecvWindowSize() >>> 0)))]), ptrType$10.nil, $chanNil)); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } sc.unackedSettings = sc.unackedSettings + (1) >> 0; diff = sc.srv.initialConnRecvWindowSize() - 65535 >> 0; /* */ if (diff > 0) { $s = 7; continue; } /* */ $s = 8; continue; /* if (diff > 0) { */ case 7: $r = sc.sendWindowUpdate(ptrType$10.nil, ((diff >> 0))); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 8: _r$2 = sc.readPreface(); /* */ $s = 10; case 10: 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))) { $s = 11; continue; } /* */ $s = 12; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 11: _arg$3 = err; _r$3 = sc.conn.RemoteAddr(); /* */ $s = 13; case 13: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _arg$4 = _r$3; _arg$5 = err; $r = sc.condlogf(_arg$3, "http2: server: error reading preface from client %v: %v", new sliceType([_arg$4, _arg$5])); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 15; case 15: return; /* } */ case 12: $r = sc.setConnState(1); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sc.setConnState(2); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!((x$5 = sc.srv.IdleTimeout, (x$5.$high === 0 && x$5.$low === 0)))) { $s = 18; continue; } /* */ $s = 19; continue; /* if (!((x$5 = sc.srv.IdleTimeout, (x$5.$high === 0 && x$5.$low === 0)))) { */ case 18: _r$4 = time.AfterFunc(sc.srv.IdleTimeout, $methodVal(sc, "onIdleTimer")); /* */ $s = 20; case 20: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } sc.idleTimer = _r$4; $deferred.push([$methodVal(sc.idleTimer, "Stop"), []]); /* } */ case 19: $go($methodVal(sc, "readFrames"), []); _r$5 = time.AfterFunc(new time.Duration(0, 2000000000), $methodVal(sc, "onSettingsTimer")); /* */ $s = 21; case 21: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } settingsTimer = _r$5; $deferred.push([$methodVal(settingsTimer, "Stop"), []]); loopNum = 0; /* while (true) { */ case 22: loopNum = loopNum + (1) >> 0; _r$6 = $select([[sc.wantWriteFrameCh], [sc.wroteFrameCh], [sc.readFrameCh], [sc.bodyReadCh], [sc.serveMsgCh]]); /* */ $s = 24; case 24: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _selection = _r$6; /* */ if (_selection[0] === 0) { $s = 25; continue; } /* */ if (_selection[0] === 1) { $s = 26; continue; } /* */ if (_selection[0] === 2) { $s = 27; continue; } /* */ if (_selection[0] === 3) { $s = 28; continue; } /* */ if (_selection[0] === 4) { $s = 29; continue; } /* */ $s = 30; continue; /* switch (0) { default: if (_selection[0] === 0) { */ case 25: wr = $clone(_selection[1][0], http2FrameWriteRequest); _tuple = $assertType(wr.write, http2StreamError, true); se = $clone(_tuple[0], http2StreamError); ok = _tuple[1]; /* */ if (ok) { $s = 31; continue; } /* */ $s = 32; continue; /* if (ok) { */ case 31: $r = sc.resetStream($clone(se, http2StreamError)); /* */ $s = 33; case 33: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* break; */ $s = 30; continue; /* } */ case 32: $r = sc.writeFrame($clone(wr, http2FrameWriteRequest)); /* */ $s = 34; case 34: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 30; continue; /* } else if (_selection[0] === 1) { */ case 26: res = $clone(_selection[1][0], http2frameWriteResult); $r = sc.wroteFrame($clone(res, http2frameWriteResult)); /* */ $s = 35; case 35: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 30; continue; /* } else if (_selection[0] === 2) { */ case 27: res$1 = $clone(_selection[1][0], http2readFrameResult); /* */ if (sc.writingFrameAsync) { $s = 36; continue; } /* */ $s = 37; continue; /* if (sc.writingFrameAsync) { */ case 36: _selection$1 = $select([[sc.wroteFrameCh], []]); /* */ if (_selection$1[0] === 0) { $s = 38; continue; } /* */ if (_selection$1[0] === 1) { $s = 39; continue; } /* */ $s = 40; continue; /* if (_selection$1[0] === 0) { */ case 38: wroteRes = $clone(_selection$1[1][0], http2frameWriteResult); $r = sc.wroteFrame($clone(wroteRes, http2frameWriteResult)); /* */ $s = 41; case 41: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 40; continue; /* } else if (_selection$1[0] === 1) { */ case 39: /* } */ case 40: /* } */ case 37: _r$7 = sc.processFrameFromReader($clone(res$1, http2readFrameResult)); /* */ $s = 44; case 44: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } /* */ if (!_r$7) { $s = 42; continue; } /* */ $s = 43; continue; /* if (!_r$7) { */ case 42: $s = 45; case 45: return; /* } */ case 43: $r = res$1.readMore(); /* */ $s = 46; case 46: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (!(settingsTimer === ptrType$25.nil)) { settingsTimer.Stop(); settingsTimer = ptrType$25.nil; } $s = 30; continue; /* } else if (_selection[0] === 3) { */ case 28: m = $clone(_selection[1][0], http2bodyReadMsg); $r = sc.noteBodyRead(m.st, m.n); /* */ $s = 47; case 47: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 30; continue; /* } else if (_selection[0] === 4) { */ case 29: msg = _selection[1][0]; _ref = msg; /* */ if ($assertType(_ref, funcType$2, true)[1]) { $s = 48; continue; } /* */ if ($assertType(_ref, ptrType$15, true)[1]) { $s = 49; continue; } /* */ if ($assertType(_ref, ptrType$91, true)[1]) { $s = 50; continue; } /* */ $s = 51; continue; /* if ($assertType(_ref, funcType$2, true)[1]) { */ case 48: v = _ref.$val; $r = v(loopNum); /* */ $s = 53; case 53: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 52; continue; /* } else if ($assertType(_ref, ptrType$15, true)[1]) { */ case 49: v$1 = _ref.$val; _1 = v$1; /* */ if (_1 === (http2settingsTimerMsg)) { $s = 55; continue; } /* */ if (_1 === (http2idleTimerMsg)) { $s = 56; continue; } /* */ if (_1 === (http2shutdownTimerMsg)) { $s = 57; continue; } /* */ if (_1 === (http2gracefulShutdownMsg)) { $s = 58; continue; } /* */ $s = 59; continue; /* if (_1 === (http2settingsTimerMsg)) { */ case 55: _r$8 = sc.conn.RemoteAddr(); /* */ $s = 61; case 61: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _arg$6 = _r$8; $r = sc.logf("timeout waiting for SETTINGS frames from %v", new sliceType([_arg$6])); /* */ $s = 62; case 62: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 63; case 63: return; /* } else if (_1 === (http2idleTimerMsg)) { */ case 56: $r = sc.vlogf("connection is idle", new sliceType([])); /* */ $s = 64; case 64: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sc.goAway(0); /* */ $s = 65; case 65: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 60; continue; /* } else if (_1 === (http2shutdownTimerMsg)) { */ case 57: _r$9 = sc.conn.RemoteAddr(); /* */ $s = 66; case 66: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _arg$7 = _r$9; $r = sc.vlogf("GOAWAY close timer fired; closing conn from %v", new sliceType([_arg$7])); /* */ $s = 67; case 67: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 68; case 68: return; /* } else if (_1 === (http2gracefulShutdownMsg)) { */ case 58: $r = sc.startGracefulShutdownInternal(); /* */ $s = 69; case 69: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 60; continue; /* } else { */ case 59: $panic(new $String("unknown timer")); /* } */ case 60: case 54: $s = 52; continue; /* } else if ($assertType(_ref, ptrType$91, true)[1]) { */ case 50: v$2 = _ref.$val; $r = sc.startPush(v$2); /* */ $s = 70; case 70: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 52; continue; /* } else { */ case 51: v$3 = _ref; _r$10 = fmt.Sprintf("unexpected type %T", new sliceType([v$3])); /* */ $s = 71; case 71: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } $panic(new $String(_r$10)); /* } */ case 52: /* } } */ case 30: /* */ if (sc.queuedControlFrames > sc.srv.maxQueuedControlFrames()) { $s = 72; continue; } /* */ $s = 73; continue; /* if (sc.queuedControlFrames > sc.srv.maxQueuedControlFrames()) { */ case 72: $r = sc.vlogf("http2: too many control frames in send queue, closing connection", new sliceType([])); /* */ $s = 74; case 74: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 75; case 75: return; /* } */ case 73: sentGoAway = sc.inGoAway && !sc.needToSendGoAway && !sc.writingFrame; if (!(sc.goAwayCode === 0)) { _v = false; $s = 76; continue s; } _r$11 = sc.curOpenStreams(); /* */ $s = 77; case 77: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _v = _r$11 === 0; case 76: gracefulShutdownComplete = _v; /* */ if (sentGoAway && sc.shutdownTimer === ptrType$25.nil && (!((sc.goAwayCode === 0)) || gracefulShutdownComplete)) { $s = 78; continue; } /* */ $s = 79; continue; /* if (sentGoAway && sc.shutdownTimer === ptrType$25.nil && (!((sc.goAwayCode === 0)) || gracefulShutdownComplete)) { */ case 78: $r = sc.shutDownIn(http2goAwayTimeout); /* */ $s = 80; case 80: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 79: $s = 22; continue; case 23: $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.serve }; } $f._1 = _1; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._arg$4 = _arg$4; $f._arg$5 = _arg$5; $f._arg$6 = _arg$6; $f._arg$7 = _arg$7; $f._r$1 = _r$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $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._selection = _selection; $f._selection$1 = _selection$1; $f._tuple = _tuple; $f._v = _v; $f.diff = diff; $f.err = err; $f.gracefulShutdownComplete = gracefulShutdownComplete; $f.loopNum = loopNum; $f.m = m; $f.msg = msg; $f.ok = ok; $f.res = res; $f.res$1 = res$1; $f.sc = sc; $f.se = se; $f.sentGoAway = sentGoAway; $f.settingsTimer = settingsTimer; $f.v = v; $f.v$1 = v$1; $f.v$2 = v$2; $f.v$3 = v$3; $f.wr = wr; $f.wroteRes = wroteRes; $f.x$5 = x$5; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2serverConn.prototype.serve = function() { return this.$val.serve(); }; http2serverConn.ptr.prototype.onSettingsTimer = function() { var sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.sendServeMsg(http2settingsTimerMsg); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.onSettingsTimer }; } $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.onSettingsTimer = function() { return this.$val.onSettingsTimer(); }; http2serverConn.ptr.prototype.onIdleTimer = function() { var sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.sendServeMsg(http2idleTimerMsg); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.onIdleTimer }; } $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.onIdleTimer = function() { return this.$val.onIdleTimer(); }; http2serverConn.ptr.prototype.onShutdownTimer = function() { var sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.sendServeMsg(http2shutdownTimerMsg); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.onShutdownTimer }; } $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.onShutdownTimer = function() { return this.$val.onShutdownTimer(); }; http2serverConn.ptr.prototype.sendServeMsg = function(msg) { var _r$1, _selection, msg, sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _selection = $f._selection; msg = $f.msg; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.checkNotOn(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = $select([[sc.serveMsgCh, msg], [sc.doneServing]]); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _selection = _r$1; if (_selection[0] === 0) { } else if (_selection[0] === 1) { } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.sendServeMsg }; } $f._r$1 = _r$1; $f._selection = _selection; $f.msg = msg; $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.sendServeMsg = function(msg) { return this.$val.sendServeMsg(msg); }; http2serverConn.ptr.prototype.readPreface = function() { var $24r, $24r$1, _arg, _r$1, _r$2, _r$3, _selection, err, errc, sc, timer, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _arg = $f._arg; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _selection = $f._selection; err = $f.err; errc = $f.errc; sc = $f.sc; timer = $f.timer; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); errc = [errc]; sc = [sc]; sc[0] = this; errc[0] = new $Chan($error, 1); $go((function(errc, sc) { return function $b() { var _r$1, _r$2, _tuple, buf, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; buf = $f.buf; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: buf = $makeSlice(sliceType$3, 24); _r$1 = io.ReadFull(sc[0].conn, buf); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ if (!bytes.Equal(buf, http2clientPreface)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $r = $send(errc[0], err); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 5; continue; /* } else if (!bytes.Equal(buf, http2clientPreface)) { */ case 3: _r$2 = fmt.Errorf("bogus greeting %q", new sliceType([buf])); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $r = $send(errc[0], _r$2); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 5; continue; /* } else { */ case 4: $r = $send(errc[0], $ifaceNil); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.buf = buf; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; })(errc, sc), []); _r$1 = time.NewTimer(new time.Duration(2, 1410065408)); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } timer = _r$1; $deferred.push([$methodVal(timer, "Stop"), []]); _r$2 = $select([[timer.C], [errc[0]]]); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _selection = _r$2; /* */ if (_selection[0] === 0) { $s = 3; continue; } /* */ if (_selection[0] === 1) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_selection[0] === 0) { */ case 3: $24r = http2errPrefaceTimeout; $s = 6; case 6: return $24r; /* } else if (_selection[0] === 1) { */ case 4: err = _selection[1][0]; /* */ if ($interfaceIsEqual(err, $ifaceNil)) { $s = 7; continue; } /* */ $s = 8; continue; /* if ($interfaceIsEqual(err, $ifaceNil)) { */ case 7: /* */ if (http2VerboseLogs) { $s = 9; continue; } /* */ $s = 10; continue; /* if (http2VerboseLogs) { */ case 9: _r$3 = sc[0].conn.RemoteAddr(); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _arg = _r$3; $r = sc[0].vlogf("http2: server: client %v said hello", new sliceType([_arg])); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 10: /* } */ case 8: $24r$1 = err; $s = 13; case 13: return $24r$1; /* } */ case 5: $s = -1; return $ifaceNil; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.readPreface }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._arg = _arg; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._selection = _selection; $f.err = err; $f.errc = errc; $f.sc = sc; $f.timer = timer; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2serverConn.prototype.readPreface = function() { return this.$val.readPreface(); }; http2serverConn.ptr.prototype.writeDataFromHandler = function(stream, data, endStream) { var _r$1, _r$2, _r$3, _r$4, _selection, _selection$1, ch, data, endStream, err, frameWriteDone, sc, stream, writeArg, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _selection = $f._selection; _selection$1 = $f._selection$1; ch = $f.ch; data = $f.data; endStream = $f.endStream; err = $f.err; frameWriteDone = $f.frameWriteDone; sc = $f.sc; stream = $f.stream; writeArg = $f.writeArg; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; _r$1 = http2errChanPool.Get(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } ch = $assertType(_r$1, chanType); _r$2 = http2writeDataPool.Get(); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } writeArg = $assertType(_r$2, ptrType$92); http2writeData.copy(writeArg, new http2writeData.ptr(stream.id, data, endStream)); _r$3 = sc.writeFrameFromHandler(new http2FrameWriteRequest.ptr(writeArg, stream, ch)); /* */ $s = 3; case 3: 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 = -1; return err; } frameWriteDone = false; _r$4 = $select([[ch], [sc.doneServing], [stream.cw]]); /* */ $s = 4; case 4: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _selection = _r$4; if (_selection[0] === 0) { err = _selection[1][0]; frameWriteDone = true; } else if (_selection[0] === 1) { $s = -1; return http2errClientDisconnected; } else if (_selection[0] === 2) { _selection$1 = $select([[ch], []]); if (_selection$1[0] === 0) { err = _selection$1[1][0]; frameWriteDone = true; } else if (_selection$1[0] === 1) { $s = -1; return http2errStreamClosed; } } http2errChanPool.Put(new chanType(ch)); if (frameWriteDone) { http2writeDataPool.Put(writeArg); } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.writeDataFromHandler }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._selection = _selection; $f._selection$1 = _selection$1; $f.ch = ch; $f.data = data; $f.endStream = endStream; $f.err = err; $f.frameWriteDone = frameWriteDone; $f.sc = sc; $f.stream = stream; $f.writeArg = writeArg; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.writeDataFromHandler = function(stream, data, endStream) { return this.$val.writeDataFromHandler(stream, data, endStream); }; http2serverConn.ptr.prototype.writeFrameFromHandler = function(wr) { var _r$1, _selection, sc, wr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _selection = $f._selection; sc = $f.sc; wr = $f.wr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.checkNotOn(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = $select([[sc.wantWriteFrameCh, $clone(wr, http2FrameWriteRequest)], [sc.doneServing]]); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _selection = _r$1; if (_selection[0] === 0) { $s = -1; return $ifaceNil; } else if (_selection[0] === 1) { $s = -1; return http2errClientDisconnected; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.writeFrameFromHandler }; } $f._r$1 = _r$1; $f._selection = _selection; $f.sc = sc; $f.wr = wr; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.writeFrameFromHandler = function(wr) { return this.$val.writeFrameFromHandler(wr); }; http2serverConn.ptr.prototype.writeFrame = function(wr) { var _r$1, _r$2, _ref, _tuple, _tuple$1, ignoreWrite, isReset, sc, state, wr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; ignoreWrite = $f.ignoreWrite; isReset = $f.isReset; sc = $f.sc; state = $f.state; wr = $f.wr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } ignoreWrite = false; /* */ if (!(($clone(wr, http2FrameWriteRequest).StreamID() === 0))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!(($clone(wr, http2FrameWriteRequest).StreamID() === 0))) { */ case 2: _tuple = $assertType(wr.write, http2StreamError, true); isReset = _tuple[1]; _r$1 = sc.state($clone(wr, http2FrameWriteRequest).StreamID()); /* */ $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; state = _tuple$1[0]; if ((state === 4) && !isReset) { ignoreWrite = true; } /* } */ case 3: _ref = wr.write; if ($assertType(_ref, ptrType$93, true)[1]) { wr.stream.wroteHeaders = true; } else if ($assertType(_ref, http2write100ContinueHeadersFrame, true)[1]) { if (wr.stream.wroteHeaders) { if (!(wr.done === $chanNil)) { $panic(new $String("wr.done != nil for write100ContinueHeadersFrame")); } ignoreWrite = true; } } /* */ if (!ignoreWrite) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!ignoreWrite) { */ case 5: /* */ if ($clone(wr, http2FrameWriteRequest).isControl()) { $s = 7; continue; } /* */ $s = 8; continue; /* if ($clone(wr, http2FrameWriteRequest).isControl()) { */ case 7: sc.queuedControlFrames = sc.queuedControlFrames + (1) >> 0; /* */ if (sc.queuedControlFrames < 0) { $s = 9; continue; } /* */ $s = 10; continue; /* if (sc.queuedControlFrames < 0) { */ case 9: _r$2 = sc.conn.Close(); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; /* } */ case 10: /* } */ case 8: $r = sc.writeSched.Push($clone(wr, http2FrameWriteRequest)); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 6: $r = sc.scheduleFrameWrite(); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.writeFrame }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.ignoreWrite = ignoreWrite; $f.isReset = isReset; $f.sc = sc; $f.state = state; $f.wr = wr; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.writeFrame = function(wr) { return this.$val.writeFrame(wr); }; http2serverConn.ptr.prototype.startFrameWrite = function(wr) { var _1, _r$1, _r$2, _r$3, _r$4, _r$5, _ref, _tuple, _tuple$1, err, err$1, ok, sc, st, wpp, wr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _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; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; err = $f.err; err$1 = $f.err$1; ok = $f.ok; sc = $f.sc; st = $f.st; wpp = $f.wpp; wr = $f.wr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (sc.writingFrame) { $panic(new $String("internal error: can only be writing one frame at a time")); } st = wr.stream; /* */ if (!(st === ptrType$10.nil)) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!(st === ptrType$10.nil)) { */ case 2: _1 = st.state; /* */ if (_1 === (2)) { $s = 5; continue; } /* */ if (_1 === (4)) { $s = 6; continue; } /* */ $s = 7; continue; /* if (_1 === (2)) { */ case 5: _ref = wr.write; /* */ if ($assertType(_ref, http2StreamError, true)[1] || $assertType(_ref, http2handlerPanicRST, true)[1] || $assertType(_ref, http2writeWindowUpdate, true)[1]) { $s = 8; continue; } /* */ $s = 9; continue; /* if ($assertType(_ref, http2StreamError, true)[1] || $assertType(_ref, http2handlerPanicRST, true)[1] || $assertType(_ref, http2writeWindowUpdate, true)[1]) { */ case 8: $s = 10; continue; /* } else { */ case 9: _r$1 = fmt.Sprintf("internal error: attempt to send frame on a half-closed-local stream: %v", new sliceType([new wr.constructor.elem(wr)])); /* */ $s = 11; case 11: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $panic(new $String(_r$1)); /* } */ case 10: $s = 7; continue; /* } else if (_1 === (4)) { */ case 6: _r$2 = fmt.Sprintf("internal error: attempt to send frame on a closed stream: %v", new sliceType([new wr.constructor.elem(wr)])); /* */ $s = 12; case 12: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $panic(new $String(_r$2)); /* } */ case 7: case 4: /* } */ case 3: _tuple = $assertType(wr.write, ptrType$94, true); wpp = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 13; continue; } /* */ $s = 14; continue; /* if (ok) { */ case 13: err = $ifaceNil; _r$3 = wpp.allocatePromisedID(); /* */ $s = 15; case 15: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$1 = _r$3; wpp.promisedID = _tuple$1[0]; err = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 16; continue; } /* */ $s = 17; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 16: sc.writingFrameAsync = false; $r = wr.replyToWriter(err); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 17: /* } */ case 14: sc.writingFrame = true; sc.needsFrameFlush = true; _r$4 = wr.write.staysWithinBuffer(sc.bw.Available()); /* */ $s = 22; case 22: 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: sc.writingFrameAsync = false; _r$5 = wr.write.writeFrame(sc); /* */ $s = 23; case 23: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } err$1 = _r$5; $r = sc.wroteFrame(new http2frameWriteResult.ptr(arrayType.zero(), $clone(wr, http2FrameWriteRequest), err$1)); /* */ $s = 24; case 24: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 21; continue; /* } else { */ case 20: sc.writingFrameAsync = true; $go($methodVal(sc, "writeFrameAsync"), [$clone(wr, http2FrameWriteRequest)]); /* } */ case 21: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.startFrameWrite }; } $f._1 = _1; $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._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.err = err; $f.err$1 = err$1; $f.ok = ok; $f.sc = sc; $f.st = st; $f.wpp = wpp; $f.wr = wr; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.startFrameWrite = function(wr) { return this.$val.startFrameWrite(wr); }; http2serverConn.ptr.prototype.wroteFrame = function(res) { var _1, _entry, _ref, _tuple, ok, res, sc, st, st$1, v, v$1, wr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _entry = $f._entry; _ref = $f._ref; _tuple = $f._tuple; ok = $f.ok; res = $f.res; sc = $f.sc; st = $f.st; st$1 = $f.st$1; v = $f.v; v$1 = $f.v$1; wr = $f.wr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (!sc.writingFrame) { $panic(new $String("internal error: expected to be already writing a frame")); } sc.writingFrame = false; sc.writingFrameAsync = false; wr = $clone(res.wr, http2FrameWriteRequest); /* */ if (http2writeEndsStream(wr.write)) { $s = 2; continue; } /* */ $s = 3; continue; /* if (http2writeEndsStream(wr.write)) { */ case 2: st = wr.stream; if (st === ptrType$10.nil) { $panic(new $String("internal error: expecting non-nil stream")); } _1 = st.state; /* */ if (_1 === (1)) { $s = 6; continue; } /* */ if (_1 === (3)) { $s = 7; continue; } /* */ $s = 8; continue; /* if (_1 === (1)) { */ case 6: st.state = 2; $r = sc.resetStream($clone(http2streamError(st.id, 0), http2StreamError)); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 8; continue; /* } else if (_1 === (3)) { */ case 7: $r = sc.closeStream(st, http2errHandlerComplete); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 8: case 5: $s = 4; continue; /* } else { */ case 3: _ref = wr.write; /* */ if ($assertType(_ref, http2StreamError, true)[1]) { $s = 11; continue; } /* */ if ($assertType(_ref, http2handlerPanicRST, true)[1]) { $s = 12; continue; } /* */ $s = 13; continue; /* if ($assertType(_ref, http2StreamError, true)[1]) { */ case 11: v = $clone(_ref.$val, http2StreamError); _tuple = (_entry = sc.streams[$Uint32.keyFor(v.StreamID)], _entry !== undefined ? [_entry.v, true] : [ptrType$10.nil, false]); st$1 = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 14; continue; } /* */ $s = 15; continue; /* if (ok) { */ case 14: $r = sc.closeStream(st$1, new v.constructor.elem(v)); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 15: $s = 13; continue; /* } else if ($assertType(_ref, http2handlerPanicRST, true)[1]) { */ case 12: v$1 = $clone(_ref.$val, http2handlerPanicRST); $r = sc.closeStream(wr.stream, http2errHandlerPanicked); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 13: /* } */ case 4: $r = wr.replyToWriter(res.err); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sc.scheduleFrameWrite(); /* */ $s = 19; case 19: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.wroteFrame }; } $f._1 = _1; $f._entry = _entry; $f._ref = _ref; $f._tuple = _tuple; $f.ok = ok; $f.res = res; $f.sc = sc; $f.st = st; $f.st$1 = st$1; $f.v = v; $f.v$1 = v$1; $f.wr = wr; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.wroteFrame = function(res) { return this.$val.wroteFrame(res); }; http2serverConn.ptr.prototype.scheduleFrameWrite = function() { var _r$1, _tuple, ok, sc, wr, x$5, x$6, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; ok = $f.ok; sc = $f.sc; wr = $f.wr; x$5 = $f.x$5; x$6 = $f.x$6; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (sc.writingFrame || sc.inFrameScheduleLoop) { $s = -1; return; } sc.inFrameScheduleLoop = true; /* while (true) { */ case 2: /* if (!(!sc.writingFrameAsync)) { break; } */ if(!(!sc.writingFrameAsync)) { $s = 3; continue; } /* */ if (sc.needToSendGoAway) { $s = 4; continue; } /* */ $s = 5; continue; /* if (sc.needToSendGoAway) { */ case 4: sc.needToSendGoAway = false; $r = sc.startFrameWrite(new http2FrameWriteRequest.ptr(new http2writeGoAway.ptr(sc.maxClientStreamID, sc.goAwayCode), ptrType$10.nil, $chanNil)); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* continue; */ $s = 2; continue; /* } */ case 5: /* */ if (sc.needToSendSettingsAck) { $s = 7; continue; } /* */ $s = 8; continue; /* if (sc.needToSendSettingsAck) { */ case 7: sc.needToSendSettingsAck = false; $r = sc.startFrameWrite(new http2FrameWriteRequest.ptr((x$5 = new http2writeSettingsAck.ptr(), new x$5.constructor.elem(x$5)), ptrType$10.nil, $chanNil)); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* continue; */ $s = 2; continue; /* } */ case 8: /* */ if (!sc.inGoAway || (sc.goAwayCode === 0)) { $s = 10; continue; } /* */ $s = 11; continue; /* if (!sc.inGoAway || (sc.goAwayCode === 0)) { */ case 10: _r$1 = sc.writeSched.Pop(); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; wr = $clone(_tuple[0], http2FrameWriteRequest); ok = _tuple[1]; /* */ if (ok) { $s = 13; continue; } /* */ $s = 14; continue; /* if (ok) { */ case 13: if ($clone(wr, http2FrameWriteRequest).isControl()) { sc.queuedControlFrames = sc.queuedControlFrames - (1) >> 0; } $r = sc.startFrameWrite($clone(wr, http2FrameWriteRequest)); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* continue; */ $s = 2; continue; /* } */ case 14: /* } */ case 11: /* */ if (sc.needsFrameFlush) { $s = 16; continue; } /* */ $s = 17; continue; /* if (sc.needsFrameFlush) { */ case 16: $r = sc.startFrameWrite(new http2FrameWriteRequest.ptr((x$6 = new http2flushFrameWriter.ptr(), new x$6.constructor.elem(x$6)), ptrType$10.nil, $chanNil)); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } sc.needsFrameFlush = false; /* continue; */ $s = 2; continue; /* } */ case 17: /* break; */ $s = 3; continue; case 3: sc.inFrameScheduleLoop = false; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.scheduleFrameWrite }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.ok = ok; $f.sc = sc; $f.wr = wr; $f.x$5 = x$5; $f.x$6 = x$6; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.scheduleFrameWrite = function() { return this.$val.scheduleFrameWrite(); }; http2serverConn.ptr.prototype.startGracefulShutdown = function() { var sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = [sc]; sc[0] = this; $r = sc[0].serveG.checkNotOn(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sc[0].shutdownOnce.Do((function(sc) { return function $b() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = sc[0].sendServeMsg(http2gracefulShutdownMsg); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$s = $s; $f.$r = $r; return $f; }; })(sc)); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.startGracefulShutdown }; } $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.startGracefulShutdown = function() { return this.$val.startGracefulShutdown(); }; http2serverConn.ptr.prototype.startGracefulShutdownInternal = function() { var sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.goAway(0); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.startGracefulShutdownInternal }; } $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.startGracefulShutdownInternal = function() { return this.$val.startGracefulShutdownInternal(); }; http2serverConn.ptr.prototype.goAway = function(code) { var code, sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; code = $f.code; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (sc.inGoAway) { $s = -1; return; } sc.inGoAway = true; sc.needToSendGoAway = true; sc.goAwayCode = code; $r = sc.scheduleFrameWrite(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.goAway }; } $f.code = code; $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.goAway = function(code) { return this.$val.goAway(code); }; http2serverConn.ptr.prototype.shutDownIn = function(d) { var _r$1, d, sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; d = $f.d; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = time.AfterFunc(d, $methodVal(sc, "onShutdownTimer")); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } sc.shutdownTimer = _r$1; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.shutDownIn }; } $f._r$1 = _r$1; $f.d = d; $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.shutDownIn = function(d) { return this.$val.shutDownIn(d); }; http2serverConn.ptr.prototype.resetStream = function(se) { var _entry, _tuple, ok, sc, se, st, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _tuple = $f._tuple; ok = $f.ok; sc = $f.sc; se = $f.se; st = $f.st; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sc.writeFrame(new http2FrameWriteRequest.ptr(new se.constructor.elem(se), ptrType$10.nil, $chanNil)); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tuple = (_entry = sc.streams[$Uint32.keyFor(se.StreamID)], _entry !== undefined ? [_entry.v, true] : [ptrType$10.nil, false]); st = _tuple[0]; ok = _tuple[1]; if (ok) { st.resetQueued = true; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.resetStream }; } $f._entry = _entry; $f._tuple = _tuple; $f.ok = ok; $f.sc = sc; $f.se = se; $f.st = st; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.resetStream = function(se) { return this.$val.resetStream(se); }; http2serverConn.ptr.prototype.processFrameFromReader = function(res) { var _arg, _arg$1, _arg$2, _arg$3, _arg$4, _r$1, _r$2, _r$3, _r$4, _r$5, _ref, _v, clientGone, err, ev, ev$1, ev$2, ev$3, f, res, sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _arg$4 = $f._arg$4; _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; _ref = $f._ref; _v = $f._v; clientGone = $f.clientGone; err = $f.err; ev = $f.ev; ev$1 = $f.ev$1; ev$2 = $f.ev$2; ev$3 = $f.ev$3; f = $f.f; res = $f.res; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } err = res.err; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: /* */ if ($interfaceIsEqual(err, http2ErrFrameTooLarge)) { $s = 5; continue; } /* */ $s = 6; continue; /* if ($interfaceIsEqual(err, http2ErrFrameTooLarge)) { */ case 5: $r = sc.goAway(6); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return true; /* } */ case 6: if ($interfaceIsEqual(err, io.EOF) || $interfaceIsEqual(err, io.ErrUnexpectedEOF)) { _v = true; $s = 8; continue s; } _r$1 = http2isClosedConnError(err); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _v = _r$1; case 8: clientGone = _v; if (clientGone) { $s = -1; return false; } $s = 4; continue; /* } else { */ case 3: f = res.f; /* */ if (http2VerboseLogs) { $s = 10; continue; } /* */ $s = 11; continue; /* if (http2VerboseLogs) { */ case 10: _r$2 = http2summarizeFrame(f); /* */ $s = 12; case 12: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg = new $String(_r$2); $r = sc.vlogf("http2: server read frame %v", new sliceType([_arg])); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 11: _r$3 = sc.processFrame(f); /* */ $s = 14; case 14: 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 = -1; return true; } /* } */ case 4: _ref = err; /* */ if ($assertType(_ref, http2StreamError, true)[1]) { $s = 15; continue; } /* */ if ($assertType(_ref, http2goAwayFlowError, true)[1]) { $s = 16; continue; } /* */ if ($assertType(_ref, http2ConnectionError, true)[1]) { $s = 17; continue; } /* */ $s = 18; continue; /* if ($assertType(_ref, http2StreamError, true)[1]) { */ case 15: ev = $clone(_ref.$val, http2StreamError); $r = sc.resetStream($clone(ev, http2StreamError)); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return true; /* } else if ($assertType(_ref, http2goAwayFlowError, true)[1]) { */ case 16: ev$1 = $clone(_ref.$val, http2goAwayFlowError); $r = sc.goAway(3); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return true; /* } else if ($assertType(_ref, http2ConnectionError, true)[1]) { */ case 17: ev$2 = _ref.$val; _r$4 = sc.conn.RemoteAddr(); /* */ $s = 22; case 22: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _arg$1 = _r$4; _arg$2 = new http2ConnectionError(ev$2); $r = sc.logf("http2: server connection error from %v: %v", new sliceType([_arg$1, _arg$2])); /* */ $s = 23; case 23: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sc.goAway(((ev$2 >>> 0))); /* */ $s = 24; case 24: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return true; /* } else { */ case 18: ev$3 = _ref; /* */ if (!($interfaceIsEqual(res.err, $ifaceNil))) { $s = 25; continue; } /* */ $s = 26; continue; /* if (!($interfaceIsEqual(res.err, $ifaceNil))) { */ case 25: _r$5 = sc.conn.RemoteAddr(); /* */ $s = 28; case 28: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg$3 = _r$5; _arg$4 = err; $r = sc.vlogf("http2: server closing client connection; error reading frame from client %s: %v", new sliceType([_arg$3, _arg$4])); /* */ $s = 29; case 29: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 27; continue; /* } else { */ case 26: $r = sc.logf("http2: server closing client connection: %v", new sliceType([err])); /* */ $s = 30; case 30: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 27: $s = -1; return false; /* } */ case 19: $s = -1; return false; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.processFrameFromReader }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._arg$4 = _arg$4; $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._ref = _ref; $f._v = _v; $f.clientGone = clientGone; $f.err = err; $f.ev = ev; $f.ev$1 = ev$1; $f.ev$2 = ev$2; $f.ev$3 = ev$3; $f.f = f; $f.res = res; $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.processFrameFromReader = function(res) { return this.$val.processFrameFromReader(res); }; http2serverConn.ptr.prototype.processFrame = function(f) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, $24r$5, $24r$6, $24r$7, _arg, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _tuple, f, f$1, f$10, f$2, f$3, f$4, f$5, f$6, f$7, f$8, f$9, ok, sc, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; $24r$6 = $f.$24r$6; $24r$7 = $f.$24r$7; _arg = $f._arg; _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; f = $f.f; f$1 = $f.f$1; f$10 = $f.f$10; 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; ok = $f.ok; sc = $f.sc; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (!sc.sawFirstSettings) { _tuple = $assertType(f, ptrType$78, true); ok = _tuple[1]; if (!ok) { $s = -1; return new http2ConnectionError(1); } sc.sawFirstSettings = true; } _ref = f; /* */ if ($assertType(_ref, ptrType$78, true)[1]) { $s = 2; continue; } /* */ if ($assertType(_ref, ptrType$76, true)[1]) { $s = 3; continue; } /* */ if ($assertType(_ref, ptrType$80, true)[1]) { $s = 4; continue; } /* */ if ($assertType(_ref, ptrType$81, true)[1]) { $s = 5; continue; } /* */ if ($assertType(_ref, ptrType$79, true)[1]) { $s = 6; continue; } /* */ if ($assertType(_ref, ptrType$83, true)[1]) { $s = 7; continue; } /* */ if ($assertType(_ref, ptrType$95, true)[1]) { $s = 8; continue; } /* */ if ($assertType(_ref, ptrType$82, true)[1]) { $s = 9; continue; } /* */ if ($assertType(_ref, ptrType$96, true)[1]) { $s = 10; continue; } /* */ $s = 11; continue; /* if ($assertType(_ref, ptrType$78, true)[1]) { */ case 2: f$1 = _ref.$val; _r$1 = sc.processSettings(f$1); /* */ $s = 13; case 13: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 14; case 14: return $24r; /* } else if ($assertType(_ref, ptrType$76, true)[1]) { */ case 3: f$2 = _ref.$val; _r$2 = sc.processHeaders(f$2); /* */ $s = 15; case 15: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r$1 = _r$2; $s = 16; case 16: return $24r$1; /* } else if ($assertType(_ref, ptrType$80, true)[1]) { */ case 4: f$3 = _ref.$val; _r$3 = sc.processWindowUpdate(f$3); /* */ $s = 17; case 17: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r$2 = _r$3; $s = 18; case 18: return $24r$2; /* } else if ($assertType(_ref, ptrType$81, true)[1]) { */ case 5: f$4 = _ref.$val; _r$4 = sc.processPing(f$4); /* */ $s = 19; case 19: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r$3 = _r$4; $s = 20; case 20: return $24r$3; /* } else if ($assertType(_ref, ptrType$79, true)[1]) { */ case 6: f$5 = _ref.$val; _r$5 = sc.processData(f$5); /* */ $s = 21; case 21: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $24r$4 = _r$5; $s = 22; case 22: return $24r$4; /* } else if ($assertType(_ref, ptrType$83, true)[1]) { */ case 7: f$6 = _ref.$val; _r$6 = sc.processResetStream(f$6); /* */ $s = 23; case 23: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } $24r$5 = _r$6; $s = 24; case 24: return $24r$5; /* } else if ($assertType(_ref, ptrType$95, true)[1]) { */ case 8: f$7 = _ref.$val; _r$7 = sc.processPriority(f$7); /* */ $s = 25; case 25: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } $24r$6 = _r$7; $s = 26; case 26: return $24r$6; /* } else if ($assertType(_ref, ptrType$82, true)[1]) { */ case 9: f$8 = _ref.$val; _r$8 = sc.processGoAway(f$8); /* */ $s = 27; case 27: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } $24r$7 = _r$8; $s = 28; case 28: return $24r$7; /* } else if ($assertType(_ref, ptrType$96, true)[1]) { */ case 10: f$9 = _ref.$val; $s = -1; return new http2ConnectionError(1); /* } else { */ case 11: f$10 = _ref; _r$9 = f$10.Header(); /* */ $s = 29; case 29: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _arg = (x$5 = _r$9, new x$5.constructor.elem(x$5)); $r = sc.vlogf("http2: server ignoring frame: %v", new sliceType([_arg])); /* */ $s = 30; case 30: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $ifaceNil; /* } */ case 12: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.processFrame }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f.$24r$6 = $24r$6; $f.$24r$7 = $24r$7; $f._arg = _arg; $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.f = f; $f.f$1 = f$1; $f.f$10 = f$10; $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.ok = ok; $f.sc = sc; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.processFrame = function(f) { return this.$val.processFrame(f); }; http2serverConn.ptr.prototype.processPing = function(f) { var f, sc, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; f = $f.f; sc = $f.sc; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (f.IsAck()) { $s = -1; return $ifaceNil; } if (!((f.http2FrameHeader.StreamID === 0))) { $s = -1; return new http2ConnectionError(1); } if (sc.inGoAway && !((sc.goAwayCode === 0))) { $s = -1; return $ifaceNil; } $r = sc.writeFrame(new http2FrameWriteRequest.ptr((x$5 = new http2writePingAck.ptr(f), new x$5.constructor.elem(x$5)), ptrType$10.nil, $chanNil)); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.processPing }; } $f.f = f; $f.sc = sc; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.processPing = function(f) { return this.$val.processPing(f); }; http2serverConn.ptr.prototype.processWindowUpdate = function(f) { var _r$1, _tuple, f, sc, st, state, x$5, x$6, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; f = $f.f; sc = $f.sc; st = $f.st; state = $f.state; x$5 = $f.x$5; x$6 = $f.x$6; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!((f.http2FrameHeader.StreamID === 0))) { $s = 3; continue; } /* */ if (!sc.flow.add(((f.Increment >> 0)))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!((f.http2FrameHeader.StreamID === 0))) { */ case 3: _r$1 = sc.state(f.http2FrameHeader.StreamID); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; state = _tuple[0]; st = _tuple[1]; if (state === 0) { $s = -1; return new http2ConnectionError(1); } if (st === ptrType$10.nil) { $s = -1; return $ifaceNil; } if (!st.flow.add(((f.Increment >> 0)))) { $s = -1; return (x$5 = http2streamError(f.http2FrameHeader.StreamID, 3), new x$5.constructor.elem(x$5)); } $s = 5; continue; /* } else if (!sc.flow.add(((f.Increment >> 0)))) { */ case 4: $s = -1; return (x$6 = new http2goAwayFlowError.ptr(), new x$6.constructor.elem(x$6)); /* } */ case 5: case 2: $r = sc.scheduleFrameWrite(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.processWindowUpdate }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.f = f; $f.sc = sc; $f.st = st; $f.state = state; $f.x$5 = x$5; $f.x$6 = x$6; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.processWindowUpdate = function(f) { return this.$val.processWindowUpdate(f); }; http2serverConn.ptr.prototype.processResetStream = function(f) { var _r$1, _tuple, f, sc, st, state, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; f = $f.f; sc = $f.sc; st = $f.st; state = $f.state; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = sc.state(f.http2FrameHeader.StreamID); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; state = _tuple[0]; st = _tuple[1]; if (state === 0) { $s = -1; return new http2ConnectionError(1); } /* */ if (!(st === ptrType$10.nil)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!(st === ptrType$10.nil)) { */ case 3: $r = st.cancelCtx(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sc.closeStream(st, (x$5 = http2streamError(f.http2FrameHeader.StreamID, f.ErrCode), 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; } /* } */ case 4: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.processResetStream }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.f = f; $f.sc = sc; $f.st = st; $f.state = state; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.processResetStream = function(f) { return this.$val.processResetStream(f); }; http2serverConn.ptr.prototype.closeStream = function(st, err) { var _arg, _arg$1, _r$1, _r$2, _r$3, _r$4, err, p, sc, st, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; err = $f.err; p = $f.p; sc = $f.sc; st = $f.st; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if ((st.state === 0) || (st.state === 4)) { $s = 2; continue; } /* */ $s = 3; continue; /* if ((st.state === 0) || (st.state === 4)) { */ case 2: _r$1 = fmt.Sprintf("invariant; can't close stream in state %v", new sliceType([new http2streamState(st.state)])); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $panic(new $String(_r$1)); /* } */ case 3: st.state = 4; if (!(st.writeDeadline === ptrType$25.nil)) { st.writeDeadline.Stop(); } if (st.isPushed()) { sc.curPushedStreams = sc.curPushedStreams - (1) >>> 0; } else { sc.curClientStreams = sc.curClientStreams - (1) >>> 0; } delete sc.streams[$Uint32.keyFor(st.id)]; /* */ if ($keys(sc.streams).length === 0) { $s = 5; continue; } /* */ $s = 6; continue; /* if ($keys(sc.streams).length === 0) { */ case 5: $r = sc.setConnState(2); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!((x$5 = sc.srv.IdleTimeout, (x$5.$high === 0 && x$5.$low === 0)))) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!((x$5 = sc.srv.IdleTimeout, (x$5.$high === 0 && x$5.$low === 0)))) { */ case 8: _r$2 = sc.idleTimer.Reset(sc.srv.IdleTimeout); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; /* } */ case 9: _r$3 = http2h1ServerKeepAlivesDisabled(sc.hs); /* */ $s = 13; case 13: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } /* */ if (_r$3) { $s = 11; continue; } /* */ $s = 12; continue; /* if (_r$3) { */ case 11: $r = sc.startGracefulShutdownInternal(); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 12: /* } */ case 6: p = st.body; /* */ if (!(p === ptrType$97.nil)) { $s = 15; continue; } /* */ $s = 16; continue; /* if (!(p === ptrType$97.nil)) { */ case 15: _arg = ptrType$10.nil; _r$4 = p.Len(); /* */ $s = 17; case 17: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _arg$1 = _r$4; $r = sc.sendWindowUpdate(_arg, _arg$1); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = p.CloseWithError(err); /* */ $s = 19; case 19: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 16: new http2closeWaiter(st.cw).Close(); $r = sc.writeSched.CloseStream(st.id); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.closeStream }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.err = err; $f.p = p; $f.sc = sc; $f.st = st; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.closeStream = function(st, err) { return this.$val.closeStream(st, err); }; http2serverConn.ptr.prototype.processSettings = function(f) { var _r$1, err, f, sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; err = $f.err; f = $f.f; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (f.IsAck()) { sc.unackedSettings = sc.unackedSettings - (1) >> 0; if (sc.unackedSettings < 0) { $s = -1; return new http2ConnectionError(1); } $s = -1; return $ifaceNil; } if (f.NumSettings() > 100 || f.HasDuplicates()) { $s = -1; return new http2ConnectionError(1); } _r$1 = f.ForeachSetting($methodVal(sc, "processSetting")); /* */ $s = 2; case 2: 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))) { $s = -1; return err; } sc.needToSendSettingsAck = true; $r = sc.scheduleFrameWrite(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.processSettings }; } $f._r$1 = _r$1; $f.err = err; $f.f = f; $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.processSettings = function(f) { return this.$val.processSettings(f); }; http2serverConn.ptr.prototype.processSetting = function(s) { var $24r, _1, _r$1, err, s, sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _1 = $f._1; _r$1 = $f._r$1; err = $f.err; s = $f.s; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } err = $clone(s, http2Setting).Valid(); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } /* */ if (http2VerboseLogs) { $s = 2; continue; } /* */ $s = 3; continue; /* if (http2VerboseLogs) { */ case 2: $r = sc.vlogf("http2: server processing setting %v", new sliceType([new s.constructor.elem(s)])); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: _1 = s.ID; /* */ if (_1 === (1)) { $s = 6; continue; } /* */ if (_1 === (2)) { $s = 7; continue; } /* */ if (_1 === (3)) { $s = 8; continue; } /* */ if (_1 === (4)) { $s = 9; continue; } /* */ if (_1 === (5)) { $s = 10; continue; } /* */ if (_1 === (6)) { $s = 11; continue; } /* */ if (http2VerboseLogs) { $s = 12; continue; } /* */ $s = 13; continue; /* if (_1 === (1)) { */ case 6: sc.headerTableSize = s.Val; $r = sc.hpackEncoder.SetMaxDynamicTableSize(s.Val); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 13; continue; /* } else if (_1 === (2)) { */ case 7: sc.pushEnabled = !((s.Val === 0)); $s = 13; continue; /* } else if (_1 === (3)) { */ case 8: sc.clientMaxStreams = s.Val; $s = 13; continue; /* } else if (_1 === (4)) { */ case 9: _r$1 = sc.processSettingInitialWindowSize(s.Val); /* */ $s = 15; case 15: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 16; case 16: return $24r; /* } else if (_1 === (5)) { */ case 10: sc.maxFrameSize = ((s.Val >> 0)); $s = 13; continue; /* } else if (_1 === (6)) { */ case 11: sc.peerMaxHeaderListSize = s.Val; $s = 13; continue; /* } else if (http2VerboseLogs) { */ case 12: $r = sc.vlogf("http2: server ignoring unknown setting %v", new sliceType([new s.constructor.elem(s)])); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 13: case 5: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.processSetting }; } $f.$24r = $24r; $f._1 = _1; $f._r$1 = _r$1; $f.err = err; $f.s = s; $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.processSetting = function(s) { return this.$val.processSetting(s); }; http2serverConn.ptr.prototype.processSettingInitialWindowSize = function(val) { var _entry, _i, _keys, _ref, growth, old, sc, st, val, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _i = $f._i; _keys = $f._keys; _ref = $f._ref; growth = $f.growth; old = $f.old; sc = $f.sc; st = $f.st; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } old = sc.initialStreamSendWindowSize; sc.initialStreamSendWindowSize = ((val >> 0)); growth = ((val >> 0)) - old >> 0; _ref = sc.streams; _i = 0; _keys = $keys(_ref); while (true) { if (!(_i < _keys.length)) { break; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; continue; } st = _entry.v; if (!st.flow.add(growth)) { $s = -1; return new http2ConnectionError(3); } _i++; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.processSettingInitialWindowSize }; } $f._entry = _entry; $f._i = _i; $f._keys = _keys; $f._ref = _ref; $f.growth = growth; $f.old = old; $f.sc = sc; $f.st = st; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.processSettingInitialWindowSize = function(val) { return this.$val.processSettingInitialWindowSize(val); }; http2serverConn.ptr.prototype.processData = function(f) { var _r$1, _r$2, _r$3, _tuple, _tuple$1, data, err, f, id, pad, sc, st, state, wrote, x$10, x$11, x$12, x$13, x$14, x$15, x$16, 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; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; data = $f.data; err = $f.err; f = $f.f; id = $f.id; pad = $f.pad; sc = $f.sc; st = $f.st; state = $f.state; wrote = $f.wrote; 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$16 = $f.x$16; 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: sc = this; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } id = $clone(f.http2FrameHeader, http2FrameHeader).Header().StreamID; if (sc.inGoAway && (!((sc.goAwayCode === 0)) || id > sc.maxClientStreamID)) { $s = -1; return $ifaceNil; } data = f.Data(); _r$1 = sc.state(id); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; state = _tuple[0]; st = _tuple[1]; if ((id === 0) || (state === 0)) { $s = -1; return new http2ConnectionError(1); } /* */ if (st === ptrType$10.nil || !((state === 1)) || st.gotTrailerHeader || st.resetQueued) { $s = 3; continue; } /* */ $s = 4; continue; /* if (st === ptrType$10.nil || !((state === 1)) || st.gotTrailerHeader || st.resetQueued) { */ case 3: if (sc.inflow.available() < ((f.http2FrameHeader.Length >> 0))) { $s = -1; return (x$5 = http2streamError(id, 3), new x$5.constructor.elem(x$5)); } sc.inflow.take(((f.http2FrameHeader.Length >> 0))); $r = sc.sendWindowUpdate(ptrType$10.nil, ((f.http2FrameHeader.Length >> 0))); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (!(st === ptrType$10.nil) && st.resetQueued) { $s = -1; return $ifaceNil; } $s = -1; return (x$6 = http2streamError(id, 5), new x$6.constructor.elem(x$6)); /* } */ case 4: if (st.body === ptrType$97.nil) { $panic(new $String("internal error: should have a body in this state")); } /* */ if (!((x$7 = st.declBodyBytes, (x$7.$high === -1 && x$7.$low === 4294967295))) && (x$8 = (x$9 = st.bodyBytes, x$10 = (new $Int64(0, data.$length)), new $Int64(x$9.$high + x$10.$high, x$9.$low + x$10.$low)), x$11 = st.declBodyBytes, (x$8.$high > x$11.$high || (x$8.$high === x$11.$high && x$8.$low > x$11.$low)))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!((x$7 = st.declBodyBytes, (x$7.$high === -1 && x$7.$low === 4294967295))) && (x$8 = (x$9 = st.bodyBytes, x$10 = (new $Int64(0, data.$length)), new $Int64(x$9.$high + x$10.$high, x$9.$low + x$10.$low)), x$11 = st.declBodyBytes, (x$8.$high > x$11.$high || (x$8.$high === x$11.$high && x$8.$low > x$11.$low)))) { */ case 6: _r$2 = fmt.Errorf("sender tried to send more than declared Content-Length of %d bytes", new sliceType([st.declBodyBytes])); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $r = st.body.CloseWithError(_r$2); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return (x$12 = http2streamError(id, 1), new x$12.constructor.elem(x$12)); /* } */ case 7: /* */ if (f.http2FrameHeader.Length > 0) { $s = 10; continue; } /* */ $s = 11; continue; /* if (f.http2FrameHeader.Length > 0) { */ case 10: if (st.inflow.available() < ((f.http2FrameHeader.Length >> 0))) { $s = -1; return (x$13 = http2streamError(id, 3), new x$13.constructor.elem(x$13)); } st.inflow.take(((f.http2FrameHeader.Length >> 0))); /* */ if (data.$length > 0) { $s = 12; continue; } /* */ $s = 13; continue; /* if (data.$length > 0) { */ case 12: _r$3 = st.body.Write(data); /* */ $s = 14; case 14: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$1 = _r$3; wrote = _tuple$1[0]; err = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 15; continue; } /* */ $s = 16; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 15: $r = sc.sendWindowUpdate(ptrType$10.nil, ((f.http2FrameHeader.Length >> 0)) - wrote >> 0); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return (x$14 = http2streamError(id, 5), new x$14.constructor.elem(x$14)); /* } */ case 16: if (!((wrote === data.$length))) { $panic(new $String("internal error: bad Writer")); } st.bodyBytes = (x$15 = st.bodyBytes, x$16 = (new $Int64(0, data.$length)), new $Int64(x$15.$high + x$16.$high, x$15.$low + x$16.$low)); /* } */ case 13: pad = ((f.http2FrameHeader.Length >> 0)) - ((data.$length >> 0)) >> 0; /* */ if (pad > 0) { $s = 18; continue; } /* */ $s = 19; continue; /* if (pad > 0) { */ case 18: $r = sc.sendWindowUpdate32(ptrType$10.nil, pad); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sc.sendWindowUpdate32(st, pad); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 19: /* } */ case 11: /* */ if (f.StreamEnded()) { $s = 22; continue; } /* */ $s = 23; continue; /* if (f.StreamEnded()) { */ case 22: $r = st.endStream(); /* */ $s = 24; case 24: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 23: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.processData }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.data = data; $f.err = err; $f.f = f; $f.id = id; $f.pad = pad; $f.sc = sc; $f.st = st; $f.state = state; $f.wrote = wrote; $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$16 = x$16; $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; }; http2serverConn.prototype.processData = function(f) { return this.$val.processData(f); }; http2serverConn.ptr.prototype.processGoAway = function(f) { var f, sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; f = $f.f; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!((f.ErrCode === 0))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!((f.ErrCode === 0))) { */ case 2: $r = sc.logf("http2: received GOAWAY %+v, starting graceful shutdown", new sliceType([f])); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 4; continue; /* } else { */ case 3: $r = sc.vlogf("http2: received GOAWAY %+v, starting graceful shutdown", new sliceType([f])); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: $r = sc.startGracefulShutdownInternal(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } sc.pushEnabled = false; $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.processGoAway }; } $f.f = f; $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.processGoAway = function(f) { return this.$val.processGoAway(f); }; http2stream.ptr.prototype.isPushed = function() { var _r$1, st; st = this; return (_r$1 = st.id % 2, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) === 0; }; http2stream.prototype.isPushed = function() { return this.$val.isPushed(); }; http2stream.ptr.prototype.endStream = function() { var _r$1, sc, st, x$5, x$6, x$7, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; sc = $f.sc; st = $f.st; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: st = this; sc = st.sc; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!((x$5 = st.declBodyBytes, (x$5.$high === -1 && x$5.$low === 4294967295))) && !((x$6 = st.declBodyBytes, x$7 = st.bodyBytes, (x$6.$high === x$7.$high && x$6.$low === x$7.$low)))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!((x$5 = st.declBodyBytes, (x$5.$high === -1 && x$5.$low === 4294967295))) && !((x$6 = st.declBodyBytes, x$7 = st.bodyBytes, (x$6.$high === x$7.$high && x$6.$low === x$7.$low)))) { */ case 2: _r$1 = fmt.Errorf("request declared a Content-Length of %d but only wrote %d bytes", new sliceType([st.declBodyBytes, st.bodyBytes])); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = st.body.CloseWithError(_r$1); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 4; continue; /* } else { */ case 3: $r = st.body.closeWithErrorAndCode(io.EOF, $methodVal(st, "copyTrailersToHandlerRequest")); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = st.body.CloseWithError(io.EOF); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: st.state = 3; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2stream.ptr.prototype.endStream }; } $f._r$1 = _r$1; $f.sc = sc; $f.st = st; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.$s = $s; $f.$r = $r; return $f; }; http2stream.prototype.endStream = function() { return this.$val.endStream(); }; http2stream.ptr.prototype.copyTrailersToHandlerRequest = function() { var _entry, _entry$1, _i, _key, _keys, _ref, _tuple, k, ok, st, vv; st = this; _ref = st.trailer; _i = 0; _keys = $keys(_ref); while (true) { if (!(_i < _keys.length)) { break; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; continue; } k = _entry.k; vv = _entry.v; _tuple = (_entry$1 = st.reqTrailer[$String.keyFor(k)], _entry$1 !== undefined ? [_entry$1.v, true] : [sliceType$2.nil, false]); ok = _tuple[1]; if (ok) { _key = k; (st.reqTrailer || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: vv }; } _i++; } }; http2stream.prototype.copyTrailersToHandlerRequest = function() { return this.$val.copyTrailersToHandlerRequest(); }; http2stream.ptr.prototype.onWriteTimeout = function() { var _r$1, st, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; st = $f.st; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: st = this; _r$1 = st.sc.writeFrameFromHandler(new http2FrameWriteRequest.ptr((x$5 = http2streamError(st.id, 2), new x$5.constructor.elem(x$5)), ptrType$10.nil, $chanNil)); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2stream.ptr.prototype.onWriteTimeout }; } $f._r$1 = _r$1; $f.st = st; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; http2stream.prototype.onWriteTimeout = function() { return this.$val.onWriteTimeout(); }; http2serverConn.ptr.prototype.processHeaders = function(f) { var $24r, _entry, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _tuple, err, err$1, err$2, f, handler, id, initialState, req, rw, sc, st, st$1, x$5, x$6, x$7, x$8, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _entry = $f._entry; _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; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; f = $f.f; handler = $f.handler; id = $f.id; initialState = $f.initialState; req = $f.req; rw = $f.rw; sc = $f.sc; st = $f.st; st$1 = $f.st$1; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; x$8 = $f.x$8; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } id = f.http2HeadersFrame.http2FrameHeader.StreamID; if (sc.inGoAway) { $s = -1; return $ifaceNil; } if (!(((_r$1 = id % 2, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) === 1))) { $s = -1; return new http2ConnectionError(1); } st = (_entry = sc.streams[$Uint32.keyFor(f.http2HeadersFrame.http2FrameHeader.StreamID)], _entry !== undefined ? _entry.v : ptrType$10.nil); /* */ if (!(st === ptrType$10.nil)) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!(st === ptrType$10.nil)) { */ case 2: if (st.resetQueued) { $s = -1; return $ifaceNil; } if (st.state === 3) { $s = -1; return (x$5 = http2streamError(id, 5), new x$5.constructor.elem(x$5)); } _r$2 = st.processTrailerHeaders(f); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 5; case 5: return $24r; /* } */ case 3: if (id <= sc.maxClientStreamID) { $s = -1; return new http2ConnectionError(1); } sc.maxClientStreamID = id; if (!(sc.idleTimer === ptrType$25.nil)) { sc.idleTimer.Stop(); } if ((sc.curClientStreams + 1 >>> 0) > sc.advMaxStreams) { if (sc.unackedSettings === 0) { $s = -1; return (x$6 = http2streamError(id, 1), new x$6.constructor.elem(x$6)); } $s = -1; return (x$7 = http2streamError(id, 7), new x$7.constructor.elem(x$7)); } initialState = 1; if (f.http2HeadersFrame.StreamEnded()) { initialState = 3; } _r$3 = sc.newStream(id, 0, initialState); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } st$1 = _r$3; /* */ if (f.http2HeadersFrame.HasPriority()) { $s = 7; continue; } /* */ $s = 8; continue; /* if (f.http2HeadersFrame.HasPriority()) { */ case 7: err = http2checkPriority(f.http2HeadersFrame.http2FrameHeader.StreamID, $clone(f.http2HeadersFrame.Priority, http2PriorityParam)); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $r = sc.writeSched.AdjustStream(st$1.id, $clone(f.http2HeadersFrame.Priority, http2PriorityParam)); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 8: _r$4 = sc.newWriterAndRequest(st$1, f); /* */ $s = 10; case 10: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple = _r$4; rw = _tuple[0]; req = _tuple[1]; err$1 = _tuple[2]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } st$1.reqTrailer = req.Trailer; if (!(st$1.reqTrailer === false)) { st$1.trailer = {}; } st$1.body = $assertType(req.Body, ptrType$12).pipe; st$1.declBodyBytes = req.ContentLength; handler = $methodVal(sc.handler, "ServeHTTP"); /* */ if (f.Truncated) { $s = 11; continue; } /* */ $s = 12; continue; /* if (f.Truncated) { */ case 11: handler = http2handleHeaderListTooLong; $s = 13; continue; /* } else { */ case 12: _r$5 = http2checkValidHTTP2RequestHeaders(req.Header); /* */ $s = 14; case 14: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } err$2 = _r$5; if (!($interfaceIsEqual(err$2, $ifaceNil))) { handler = http2new400Handler(err$2); } /* } */ case 13: /* */ if (!((x$8 = sc.hs.ReadTimeout, (x$8.$high === 0 && x$8.$low === 0)))) { $s = 15; continue; } /* */ $s = 16; continue; /* if (!((x$8 = sc.hs.ReadTimeout, (x$8.$high === 0 && x$8.$low === 0)))) { */ case 15: _r$6 = sc.conn.SetReadDeadline(new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil)); /* */ $s = 17; case 17: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; /* } */ case 16: $go($methodVal(sc, "runHandler"), [rw, req, handler]); $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.processHeaders }; } $f.$24r = $24r; $f._entry = _entry; $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.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.f = f; $f.handler = handler; $f.id = id; $f.initialState = initialState; $f.req = req; $f.rw = rw; $f.sc = sc; $f.st = st; $f.st$1 = st$1; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.x$8 = x$8; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.processHeaders = function(f) { return this.$val.processHeaders(f); }; http2stream.ptr.prototype.processTrailerHeaders = function(f) { var _entry, _i, _key, _r$1, _r$2, _ref, f, hf, key, sc, st, x$5, x$6, x$7, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _i = $f._i; _key = $f._key; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; f = $f.f; hf = $f.hf; key = $f.key; sc = $f.sc; st = $f.st; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: st = this; sc = st.sc; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (st.gotTrailerHeader) { $s = -1; return new http2ConnectionError(1); } st.gotTrailerHeader = true; if (!f.http2HeadersFrame.StreamEnded()) { $s = -1; return (x$5 = http2streamError(st.id, 1), new x$5.constructor.elem(x$5)); } if (f.PseudoFields().$length > 0) { $s = -1; return (x$6 = http2streamError(st.id, 1), new x$6.constructor.elem(x$6)); } /* */ if (!(st.trailer === false)) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!(st.trailer === false)) { */ case 2: _ref = f.RegularFields(); _i = 0; /* while (true) { */ case 4: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 5; continue; } hf = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), hpack.HeaderField); _r$1 = sc.canonicalHeader(hf.Name); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } key = _r$1; _r$2 = httpguts.ValidTrailerHeader(key); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } /* */ if (!_r$2) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!_r$2) { */ case 7: $s = -1; return (x$7 = http2streamError(st.id, 1), new x$7.constructor.elem(x$7)); /* } */ case 8: _key = key; (st.trailer || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: $append((_entry = st.trailer[$String.keyFor(key)], _entry !== undefined ? _entry.v : sliceType$2.nil), hf.Value) }; _i++; $s = 4; continue; case 5: /* } */ case 3: $r = st.endStream(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2stream.ptr.prototype.processTrailerHeaders }; } $f._entry = _entry; $f._i = _i; $f._key = _key; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f.f = f; $f.hf = hf; $f.key = key; $f.sc = sc; $f.st = st; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.$s = $s; $f.$r = $r; return $f; }; http2stream.prototype.processTrailerHeaders = function(f) { return this.$val.processTrailerHeaders(f); }; http2checkPriority = function(streamID, p) { var p, streamID, x$5; if (streamID === p.StreamDep) { return (x$5 = http2streamError(streamID, 1), new x$5.constructor.elem(x$5)); } return $ifaceNil; }; http2serverConn.ptr.prototype.processPriority = function(f) { var err, f, sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; f = $f.f; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; if (sc.inGoAway) { $s = -1; return $ifaceNil; } err = http2checkPriority(f.http2FrameHeader.StreamID, $clone(f.http2PriorityParam, http2PriorityParam)); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $r = sc.writeSched.AdjustStream(f.http2FrameHeader.StreamID, $clone(f.http2PriorityParam, http2PriorityParam)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.processPriority }; } $f.err = err; $f.f = f; $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.processPriority = function(f) { return this.$val.processPriority(f); }; http2serverConn.ptr.prototype.newStream = function(id, pusherID, state) { var _key, _r$1, _r$2, _r$3, _tuple, cancelCtx, ctx, id, pusherID, sc, st, state, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _key = $f._key; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; cancelCtx = $f.cancelCtx; ctx = $f.ctx; id = $f.id; pusherID = $f.pusherID; sc = $f.sc; st = $f.st; state = $f.state; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (id === 0) { $panic(new $String("internal error: cannot create stream with id 0")); } _r$1 = context.WithCancel(sc.baseCtx); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; ctx = _tuple[0]; cancelCtx = _tuple[1]; st = new http2stream.ptr(sc, id, ptrType$97.nil, $chanNil, ctx, cancelCtx, new $Int64(0, 0), new $Int64(0, 0), new http2flow.ptr(arrayType.zero(), 0, ptrType$71.nil), new http2flow.ptr(arrayType.zero(), 0, ptrType$71.nil), state, false, false, false, ptrType$25.nil, false, false); (st.$ptr_cw || (st.$ptr_cw = new ptrType$98(function() { return this.$target.cw; }, function($v) { this.$target.cw = $v; }, st))).Init(); st.flow.conn = sc.flow; st.flow.add(sc.initialStreamSendWindowSize); st.inflow.conn = sc.inflow; st.inflow.add(sc.srv.initialStreamRecvWindowSize()); /* */ if (!((x$5 = sc.hs.WriteTimeout, (x$5.$high === 0 && x$5.$low === 0)))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!((x$5 = sc.hs.WriteTimeout, (x$5.$high === 0 && x$5.$low === 0)))) { */ case 3: _r$2 = time.AfterFunc(sc.hs.WriteTimeout, $methodVal(st, "onWriteTimeout")); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } st.writeDeadline = _r$2; /* } */ case 4: _key = id; (sc.streams || $throwRuntimeError("assignment to entry in nil map"))[$Uint32.keyFor(_key)] = { k: _key, v: st }; $r = sc.writeSched.OpenStream(st.id, new http2OpenStreamOptions.ptr(pusherID)); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (st.isPushed()) { sc.curPushedStreams = sc.curPushedStreams + (1) >>> 0; } else { sc.curClientStreams = sc.curClientStreams + (1) >>> 0; } _r$3 = sc.curOpenStreams(); /* */ $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 === 1) { $s = 7; continue; } /* */ $s = 8; continue; /* if (_r$3 === 1) { */ case 7: $r = sc.setConnState(1); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 8: $s = -1; return st; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.newStream }; } $f._key = _key; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.cancelCtx = cancelCtx; $f.ctx = ctx; $f.id = id; $f.pusherID = pusherID; $f.sc = sc; $f.st = st; $f.state = state; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.newStream = function(id, pusherID, state) { return this.$val.newStream(id, pusherID, state); }; http2serverConn.ptr.prototype.newWriterAndRequest = function(st, f) { var _entry, _i, _r$1, _r$2, _r$3, _ref, _tuple, _tuple$1, _tuple$2, bodyOpen, cl, err, err$1, f, hf, isConnect, ok, req, rp, rw, sc, st, vv, x$5, x$6, x$7, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _i = $f._i; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; bodyOpen = $f.bodyOpen; cl = $f.cl; err = $f.err; err$1 = $f.err$1; f = $f.f; hf = $f.hf; isConnect = $f.isConnect; ok = $f.ok; req = $f.req; rp = $f.rp; rw = $f.rw; sc = $f.sc; st = $f.st; vv = $f.vv; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } rp = new http2requestParam.ptr(f.PseudoValue("method"), f.PseudoValue("scheme"), f.PseudoValue("authority"), f.PseudoValue("path"), false); isConnect = rp.method === "CONNECT"; if (isConnect) { if (!(rp.path === "") || !(rp.scheme === "") || rp.authority === "") { $s = -1; return [ptrType$16.nil, ptrType$11.nil, (x$5 = http2streamError(f.http2HeadersFrame.http2FrameHeader.StreamID, 1), new x$5.constructor.elem(x$5))]; } } else if (rp.method === "" || rp.path === "" || (!(rp.scheme === "https") && !(rp.scheme === "http"))) { $s = -1; return [ptrType$16.nil, ptrType$11.nil, (x$6 = http2streamError(f.http2HeadersFrame.http2FrameHeader.StreamID, 1), new x$6.constructor.elem(x$6))]; } bodyOpen = !f.http2HeadersFrame.StreamEnded(); if (rp.method === "HEAD" && bodyOpen) { $s = -1; return [ptrType$16.nil, ptrType$11.nil, (x$7 = http2streamError(f.http2HeadersFrame.http2FrameHeader.StreamID, 1), new x$7.constructor.elem(x$7))]; } rp.header = {}; _ref = f.RegularFields(); _i = 0; /* while (true) { */ case 2: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 3; continue; } hf = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), hpack.HeaderField); _r$1 = sc.canonicalHeader(hf.Name); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = new Header(rp.header).Add(_r$1, hf.Value); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i++; $s = 2; continue; case 3: /* */ if (rp.authority === "") { $s = 6; continue; } /* */ $s = 7; continue; /* if (rp.authority === "") { */ case 6: _r$2 = new Header(rp.header).Get("Host"); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } rp.authority = _r$2; /* } */ case 7: _r$3 = sc.newWriterAndRequestNoBody(st, $clone(rp, http2requestParam)); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; rw = _tuple[0]; req = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$16.nil, ptrType$11.nil, err]; } if (bodyOpen) { _tuple$1 = (_entry = rp.header[$String.keyFor("Content-Length")], _entry !== undefined ? [_entry.v, true] : [sliceType$2.nil, false]); vv = _tuple$1[0]; ok = _tuple$1[1]; if (ok) { _tuple$2 = strconv.ParseUint((0 >= vv.$length ? ($throwRuntimeError("index out of range"), undefined) : vv.$array[vv.$offset + 0]), 10, 63); cl = _tuple$2[0]; err$1 = _tuple$2[1]; if ($interfaceIsEqual(err$1, $ifaceNil)) { req.ContentLength = (new $Int64(cl.$high, cl.$low)); } else { req.ContentLength = new $Int64(0, 0); } } else { req.ContentLength = new $Int64(-1, 4294967295); } $assertType(req.Body, ptrType$12).pipe = new http2pipe.ptr(new sync.Mutex.ptr(0, 0), new sync.Cond.ptr(new sync.noCopy.ptr(), $ifaceNil, new sync.notifyList.ptr(0, 0, 0, 0, 0), 0, 0, $chanNil), new http2dataBuffer.ptr(sliceType$5.nil, 0, 0, 0, req.ContentLength), 0, $ifaceNil, $ifaceNil, $chanNil, $throwNilPointerError); } $s = -1; return [rw, req, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.newWriterAndRequest }; } $f._entry = _entry; $f._i = _i; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.bodyOpen = bodyOpen; $f.cl = cl; $f.err = err; $f.err$1 = err$1; $f.f = f; $f.hf = hf; $f.isConnect = isConnect; $f.ok = ok; $f.req = req; $f.rp = rp; $f.rw = rw; $f.sc = sc; $f.st = st; $f.vv = vv; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.newWriterAndRequest = function(st, f) { return this.$val.newWriterAndRequest(st, f); }; http2serverConn.ptr.prototype.newWriterAndRequestNoBody = function(st, rp) { var _1, _entry, _entry$1, _i, _i$1, _key, _r$1, _r$2, _r$3, _r$4, _ref, _ref$1, _tuple, body$1, bwSave, cookies, err, key, needsContinue, req, requestURI, rp, rw, rws, sc, st, tlsState, trailer, url_, v, x$5, x$6, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _entry = $f._entry; _entry$1 = $f._entry$1; _i = $f._i; _i$1 = $f._i$1; _key = $f._key; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _ref = $f._ref; _ref$1 = $f._ref$1; _tuple = $f._tuple; body$1 = $f.body$1; bwSave = $f.bwSave; cookies = $f.cookies; err = $f.err; key = $f.key; needsContinue = $f.needsContinue; req = $f.req; requestURI = $f.requestURI; rp = $f.rp; rw = $f.rw; rws = $f.rws; sc = $f.sc; st = $f.st; tlsState = $f.tlsState; trailer = $f.trailer; url_ = $f.url_; v = $f.v; x$5 = $f.x$5; x$6 = $f.x$6; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } tlsState = ptrType$28.nil; if (rp.scheme === "https") { tlsState = sc.tlsState; } _r$1 = new Header(rp.header).Get("Expect"); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } needsContinue = _r$1 === "100-continue"; /* */ if (needsContinue) { $s = 3; continue; } /* */ $s = 4; continue; /* if (needsContinue) { */ case 3: $r = new Header(rp.header).Del("Expect"); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: cookies = (_entry = rp.header[$String.keyFor("Cookie")], _entry !== undefined ? _entry.v : sliceType$2.nil); /* */ if (cookies.$length > 1) { $s = 6; continue; } /* */ $s = 7; continue; /* if (cookies.$length > 1) { */ case 6: $r = new Header(rp.header).Set("Cookie", strings.Join(cookies, "; ")); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 7: trailer = false; _ref = (_entry$1 = rp.header[$String.keyFor("Trailer")], _entry$1 !== undefined ? _entry$1.v : sliceType$2.nil); _i = 0; /* while (true) { */ case 9: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 10; continue; } v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _ref$1 = strings.Split(v, ","); _i$1 = 0; /* while (true) { */ case 11: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 12; continue; } key = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); _r$2 = CanonicalHeaderKey(textproto.TrimString(key)); /* */ $s = 13; case 13: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } key = _r$2; _1 = key; if (_1 === ("Transfer-Encoding") || _1 === ("Trailer") || _1 === ("Content-Length")) { } else { if (trailer === false) { trailer = {}; } _key = key; (trailer || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: sliceType$2.nil }; } _i$1++; $s = 11; continue; case 12: _i++; $s = 9; continue; case 10: delete rp.header[$String.keyFor("Trailer")]; url_ = ptrType$17.nil; requestURI = ""; /* */ if (rp.method === "CONNECT") { $s = 14; continue; } /* */ $s = 15; continue; /* if (rp.method === "CONNECT") { */ case 14: url_ = new url.URL.ptr("", "", ptrType$21.nil, rp.authority, "", "", false, "", "", ""); requestURI = rp.authority; $s = 16; continue; /* } else { */ case 15: err = $ifaceNil; _r$3 = url.ParseRequestURI(rp.path); /* */ $s = 17; case 17: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; url_ = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$16.nil, ptrType$11.nil, (x$5 = http2streamError(st.id, 1), new x$5.constructor.elem(x$5))]; } requestURI = rp.path; /* } */ case 16: body$1 = new http2requestBody.ptr(arrayType.zero(), st, sc, false, false, ptrType$97.nil, needsContinue); req = new Request.ptr(rp.method, url_, "HTTP/2.0", 2, 0, rp.header, body$1, $throwNilPointerError, new $Int64(0, 0), sliceType$2.nil, false, rp.authority, false, false, ptrType$31.nil, trailer, sc.remoteAddrStr, requestURI, tlsState, $chanNil, ptrType$18.nil, $ifaceNil); req = req.WithContext(st.ctx); _r$4 = http2responseWriterStatePool.Get(); /* */ $s = 18; case 18: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } rws = $assertType(_r$4, ptrType$99); bwSave = rws.bw; http2responseWriterState.copy(rws, new http2responseWriterState.ptr(ptrType$10.nil, ptrType$11.nil, ptrType$12.nil, ptrType$13.nil, ptrType$14.nil, false, false, sliceType$2.nil, 0, false, false, false, false, new $Int64(0, 0), new $Int64(0, 0), new sync.Mutex.ptr(0, 0), $chanNil)); rws.conn = sc; rws.bw = bwSave; rws.bw.Reset((x$6 = new http2chunkWriter.ptr(rws), new x$6.constructor.elem(x$6))); rws.stream = st; rws.req = req; rws.body = body$1; rw = new http2responseWriter.ptr(rws); $s = -1; return [rw, req, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.newWriterAndRequestNoBody }; } $f._1 = _1; $f._entry = _entry; $f._entry$1 = _entry$1; $f._i = _i; $f._i$1 = _i$1; $f._key = _key; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._ref = _ref; $f._ref$1 = _ref$1; $f._tuple = _tuple; $f.body$1 = body$1; $f.bwSave = bwSave; $f.cookies = cookies; $f.err = err; $f.key = key; $f.needsContinue = needsContinue; $f.req = req; $f.requestURI = requestURI; $f.rp = rp; $f.rw = rw; $f.rws = rws; $f.sc = sc; $f.st = st; $f.tlsState = tlsState; $f.trailer = trailer; $f.url_ = url_; $f.v = v; $f.x$5 = x$5; $f.x$6 = x$6; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.newWriterAndRequestNoBody = function(st, rp) { return this.$val.newWriterAndRequestNoBody(st, rp); }; http2serverConn.ptr.prototype.runHandler = function(rw, req, handler) { var didPanic, handler, req, rw, sc, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; didPanic = $f.didPanic; handler = $f.handler; req = $f.req; rw = $f.rw; sc = $f.sc; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); didPanic = [didPanic]; rw = [rw]; sc = [sc]; sc[0] = this; didPanic[0] = true; $deferred.push([(function(didPanic, rw, sc) { return function $b() { var _arg, _arg$1, _arg$2, _r$1, _r$2, buf, e, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _r$1 = $f._r$1; _r$2 = $f._r$2; buf = $f.buf; e = $f.e; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = rw[0].rws.stream.cancelCtx(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (didPanic[0]) { $s = 2; continue; } /* */ $s = 3; continue; /* if (didPanic[0]) { */ case 2: e = $recover(); _r$1 = sc[0].writeFrameFromHandler(new http2FrameWriteRequest.ptr((x$5 = new http2handlerPanicRST.ptr(rw[0].rws.stream.id), new x$5.constructor.elem(x$5)), rw[0].rws.stream, $chanNil)); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; /* */ if (!($interfaceIsEqual(e, $ifaceNil)) && !($interfaceIsEqual(e, $pkg.ErrAbortHandler))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(e, $ifaceNil)) && !($interfaceIsEqual(e, $pkg.ErrAbortHandler))) { */ case 5: buf = $makeSlice(sliceType$3, 65536); buf = $subslice(buf, 0, runtime.Stack(buf, false)); _r$2 = sc[0].conn.RemoteAddr(); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg = _r$2; _arg$1 = e; _arg$2 = buf; $r = sc[0].logf("http2: panic serving %v: %v\n%s", new sliceType([_arg, _arg$1, _arg$2])); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 6: $s = -1; return; /* } */ case 3: $r = rw[0].handlerDone(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.buf = buf; $f.e = e; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; })(didPanic, rw, sc), []]); $r = handler(rw[0], req); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } didPanic[0] = false; $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.runHandler }; } $f.didPanic = didPanic; $f.handler = handler; $f.req = req; $f.rw = rw; $f.sc = sc; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2serverConn.prototype.runHandler = function(rw, req, handler) { return this.$val.runHandler(rw, req, handler); }; http2handleHeaderListTooLong = function(w, r) { var _r$1, r, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; r = $f.r; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = w.WriteHeader(431); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = io.WriteString(w, "

HTTP Error 431

Request Header Field(s) Too Large

"); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2handleHeaderListTooLong }; } $f._r$1 = _r$1; $f.r = r; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.ptr.prototype.writeHeaders = function(st, headerData) { var _r$1, _r$2, _r$3, _selection, err, err$1, errc, headerData, sc, st, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _selection = $f._selection; err = $f.err; err$1 = $f.err$1; errc = $f.errc; headerData = $f.headerData; sc = $f.sc; st = $f.st; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.checkNotOn(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } errc = $chanNil; /* */ if (!(headerData.h === false)) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!(headerData.h === false)) { */ case 2: _r$1 = http2errChanPool.Get(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } errc = $assertType(_r$1, chanType); /* } */ case 3: _r$2 = sc.writeFrameFromHandler(new http2FrameWriteRequest.ptr(headerData, st, errc)); /* */ $s = 5; case 5: 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))) { $s = -1; return err; } /* */ if (!(errc === $chanNil)) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!(errc === $chanNil)) { */ case 6: _r$3 = $select([[errc], [sc.doneServing], [st.cw]]); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _selection = _r$3; if (_selection[0] === 0) { err$1 = _selection[1][0]; http2errChanPool.Put(new chanType(errc)); $s = -1; return err$1; } else if (_selection[0] === 1) { $s = -1; return http2errClientDisconnected; } else if (_selection[0] === 2) { $s = -1; return http2errStreamClosed; } /* } */ case 7: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.writeHeaders }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._selection = _selection; $f.err = err; $f.err$1 = err$1; $f.errc = errc; $f.headerData = headerData; $f.sc = sc; $f.st = st; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.writeHeaders = function(st, headerData) { return this.$val.writeHeaders(st, headerData); }; http2serverConn.ptr.prototype.write100ContinueHeaders = function(st) { var _r$1, sc, st, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; sc = $f.sc; st = $f.st; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; _r$1 = sc.writeFrameFromHandler(new http2FrameWriteRequest.ptr((x$5 = new http2write100ContinueHeadersFrame.ptr(st.id), new x$5.constructor.elem(x$5)), st, $chanNil)); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.write100ContinueHeaders }; } $f._r$1 = _r$1; $f.sc = sc; $f.st = st; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.write100ContinueHeaders = function(st) { return this.$val.write100ContinueHeaders(st); }; http2serverConn.ptr.prototype.noteBodyReadFromHandler = function(st, n, err) { var _r$1, _selection, err, n, sc, st, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _selection = $f._selection; err = $f.err; n = $f.n; sc = $f.sc; st = $f.st; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.checkNotOn(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (n > 0) { $s = 2; continue; } /* */ $s = 3; continue; /* if (n > 0) { */ case 2: _r$1 = $select([[sc.bodyReadCh, new http2bodyReadMsg.ptr(st, n)], [sc.doneServing]]); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _selection = _r$1; if (_selection[0] === 0) { } else if (_selection[0] === 1) { } /* } */ case 3: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.noteBodyReadFromHandler }; } $f._r$1 = _r$1; $f._selection = _selection; $f.err = err; $f.n = n; $f.sc = sc; $f.st = st; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.noteBodyReadFromHandler = function(st, n, err) { return this.$val.noteBodyReadFromHandler(st, n, err); }; http2serverConn.ptr.prototype.noteBodyRead = function(st, n) { var n, sc, st, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; n = $f.n; sc = $f.sc; st = $f.st; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sc.sendWindowUpdate(ptrType$10.nil, n); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!((st.state === 3)) && !((st.state === 4))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!((st.state === 3)) && !((st.state === 4))) { */ case 3: $r = sc.sendWindowUpdate(st, n); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.noteBodyRead }; } $f.n = n; $f.sc = sc; $f.st = st; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.noteBodyRead = function(st, n) { return this.$val.noteBodyRead(st, n); }; http2serverConn.ptr.prototype.sendWindowUpdate = function(st, n) { var n, sc, st, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; n = $f.n; sc = $f.sc; st = $f.st; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* while (true) { */ case 2: /* if (!(n >= 2147483647)) { break; } */ if(!(n >= 2147483647)) { $s = 3; continue; } $r = sc.sendWindowUpdate32(st, 2147483647); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } n = n - (2147483647) >> 0; $s = 2; continue; case 3: $r = sc.sendWindowUpdate32(st, ((n >> 0))); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.sendWindowUpdate }; } $f.n = n; $f.sc = sc; $f.st = st; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.sendWindowUpdate = function(st, n) { return this.$val.sendWindowUpdate(st, n); }; http2serverConn.ptr.prototype.sendWindowUpdate32 = function(st, n) { var n, ok, sc, st, streamID, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; n = $f.n; ok = $f.ok; sc = $f.sc; st = $f.st; streamID = $f.streamID; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; $r = sc.serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (n === 0) { $s = -1; return; } if (n < 0) { $panic(new $String("negative update")); } streamID = 0; if (!(st === ptrType$10.nil)) { streamID = st.id; } $r = sc.writeFrame(new http2FrameWriteRequest.ptr((x$5 = new http2writeWindowUpdate.ptr(streamID, ((n >>> 0))), new x$5.constructor.elem(x$5)), st, $chanNil)); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } ok = false; if (st === ptrType$10.nil) { ok = sc.inflow.add(n); } else { ok = st.inflow.add(n); } if (!ok) { $panic(new $String("internal error; sent too many window updates without decrements?")); } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.sendWindowUpdate32 }; } $f.n = n; $f.ok = ok; $f.sc = sc; $f.st = st; $f.streamID = streamID; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.sendWindowUpdate32 = function(st, n) { return this.$val.sendWindowUpdate32(st, n); }; http2requestBody.ptr.prototype.Close = function() { var b, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; /* */ if (!(b.pipe === ptrType$97.nil) && !b.closed) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(b.pipe === ptrType$97.nil) && !b.closed) { */ case 1: $r = b.pipe.BreakWithError(http2errClosedBody); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: b.closed = true; $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2requestBody.ptr.prototype.Close }; } $f.b = b; $f.$s = $s; $f.$r = $r; return $f; }; http2requestBody.prototype.Close = function() { return this.$val.Close(); }; http2requestBody.ptr.prototype.Read = function(p) { var _r$1, _tmp, _tmp$1, _tuple, b, err, n, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; b = $f.b; err = $f.err; n = $f.n; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; b = this; /* */ if (b.needsContinue) { $s = 1; continue; } /* */ $s = 2; continue; /* if (b.needsContinue) { */ case 1: b.needsContinue = false; $r = b.conn.write100ContinueHeaders(b.stream); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: if (b.pipe === ptrType$97.nil || b.sawEOF) { _tmp = 0; _tmp$1 = io.EOF; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } _r$1 = b.pipe.Read(p); /* */ $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; n = _tuple[0]; err = _tuple[1]; if ($interfaceIsEqual(err, io.EOF)) { b.sawEOF = true; } if (b.conn === ptrType$13.nil && http2inTests) { $s = -1; return [n, err]; } $r = b.conn.noteBodyReadFromHandler(b.stream, n, err); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: http2requestBody.ptr.prototype.Read }; } $f._r$1 = _r$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.n = n; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; http2requestBody.prototype.Read = function(p) { return this.$val.Read(p); }; http2chunkWriter.ptr.prototype.Write = function(p) { var $24r, _r$1, _tuple, cw, err, n, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _tuple = $f._tuple; cw = $f.cw; err = $f.err; n = $f.n; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; cw = this; _r$1 = cw.rws.writeChunk(p); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err = _tuple[1]; $24r = [n, err]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2chunkWriter.ptr.prototype.Write }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.cw = cw; $f.err = err; $f.n = n; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; http2chunkWriter.prototype.Write = function(p) { return this.$val.Write(p); }; http2responseWriterState.ptr.prototype.hasTrailers = function() { var rws; rws = this; return rws.trailers.$length > 0; }; http2responseWriterState.prototype.hasTrailers = function() { return this.$val.hasTrailers(); }; http2responseWriterState.ptr.prototype.hasNonemptyTrailers = function() { var _entry, _i, _ref, _tuple, ok, rws, trailer; rws = this; _ref = rws.trailers; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } trailer = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _tuple = (_entry = rws.handlerHeader[$String.keyFor(trailer)], _entry !== undefined ? [_entry.v, true] : [sliceType$2.nil, false]); ok = _tuple[1]; if (ok) { return true; } _i++; } return false; }; http2responseWriterState.prototype.hasNonemptyTrailers = function() { return this.$val.hasNonemptyTrailers(); }; http2responseWriterState.ptr.prototype.declareTrailer = function(k) { var _r$1, _r$2, k, rws, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; k = $f.k; rws = $f.rws; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rws = this; _r$1 = CanonicalHeaderKey(k); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } k = _r$1; _r$2 = httpguts.ValidTrailerHeader(k); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } /* */ if (!_r$2) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!_r$2) { */ case 2: $r = rws.conn.logf("ignoring invalid trailer %q", new sliceType([new $String(k)])); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 3: if (!http2strSliceContains(rws.trailers, k)) { rws.trailers = $append(rws.trailers, k); } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2responseWriterState.ptr.prototype.declareTrailer }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f.k = k; $f.rws = rws; $f.$s = $s; $f.$r = $r; return $f; }; http2responseWriterState.prototype.declareTrailer = function(k) { return this.$val.declareTrailer(k); }; http2responseWriterState.ptr.prototype.writeChunk = function(p) { var _entry, _entry$1, _entry$2, _entry$3, _i, _r$1, _r$10, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _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, _tuple, _tuple$1, _tuple$2, _tuple$3, ce, cl, clen, ctype, date, endStream, endStream$1, err, err$1, err$2, hasCE, hasContentType, hasNonemptyTrailers, isHeadResp, n, ok, ok$1, p, rws, v, v$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _entry$2 = $f._entry$2; _entry$3 = $f._entry$3; _i = $f._i; _r$1 = $f._r$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$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$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; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; ce = $f.ce; cl = $f.cl; clen = $f.clen; ctype = $f.ctype; date = $f.date; endStream = $f.endStream; endStream$1 = $f.endStream$1; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; hasCE = $f.hasCE; hasContentType = $f.hasContentType; hasNonemptyTrailers = $f.hasNonemptyTrailers; isHeadResp = $f.isHeadResp; n = $f.n; ok = $f.ok; ok$1 = $f.ok$1; p = $f.p; rws = $f.rws; v = $f.v; v$1 = $f.v$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; rws = this; /* */ if (!rws.wroteHeader) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!rws.wroteHeader) { */ case 1: $r = rws.writeHeader(200); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: isHeadResp = rws.req.Method === "HEAD"; /* */ if (!rws.sentHeader) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!rws.sentHeader) { */ case 4: rws.sentHeader = true; _tmp = ""; _tmp$1 = ""; ctype = _tmp; clen = _tmp$1; _r$1 = new Header(rws.snapHeader).Get("Content-Length"); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } clen = _r$1; /* */ if (!(clen === "")) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!(clen === "")) { */ case 7: $r = new Header(rws.snapHeader).Del("Content-Length"); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tuple = strconv.ParseUint(clen, 10, 63); cl = _tuple[0]; err$1 = _tuple[1]; if ($interfaceIsEqual(err$1, $ifaceNil)) { rws.sentContentLen = (new $Int64(cl.$high, cl.$low)); } else { clen = ""; } /* } */ case 8: if (clen === "" && rws.handlerDone && http2bodyAllowedForStatus(rws.status) && (p.$length > 0 || !isHeadResp)) { clen = strconv.Itoa(p.$length); } _tuple$1 = (_entry = rws.snapHeader[$String.keyFor("Content-Type")], _entry !== undefined ? [_entry.v, true] : [sliceType$2.nil, false]); hasContentType = _tuple$1[1]; _r$2 = new Header(rws.snapHeader).Get("Content-Encoding"); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } ce = _r$2; hasCE = ce.length > 0; /* */ if (!hasCE && !hasContentType && http2bodyAllowedForStatus(rws.status) && p.$length > 0) { $s = 11; continue; } /* */ $s = 12; continue; /* if (!hasCE && !hasContentType && http2bodyAllowedForStatus(rws.status) && p.$length > 0) { */ case 11: _r$3 = DetectContentType(p); /* */ $s = 13; case 13: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } ctype = _r$3; /* } */ case 12: date = ""; _tuple$2 = (_entry$1 = rws.snapHeader[$String.keyFor("Date")], _entry$1 !== undefined ? [_entry$1.v, true] : [sliceType$2.nil, false]); ok = _tuple$2[1]; /* */ if (!ok) { $s = 14; continue; } /* */ $s = 15; continue; /* if (!ok) { */ case 14: _r$4 = time.Now(); /* */ $s = 16; case 16: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = $clone(_r$4, time.Time).UTC(); /* */ $s = 17; case 17: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$6 = $clone(_r$5, time.Time).Format("Mon, 02 Jan 2006 15:04:05 GMT"); /* */ $s = 18; case 18: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } date = _r$6; /* } */ case 15: _ref = (_entry$2 = rws.snapHeader[$String.keyFor("Trailer")], _entry$2 !== undefined ? _entry$2.v : sliceType$2.nil); _i = 0; /* while (true) { */ case 19: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 20; continue; } v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); $r = http2foreachHeaderElement(v, $methodVal(rws, "declareTrailer")); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i++; $s = 19; continue; case 20: _tuple$3 = (_entry$3 = rws.snapHeader[$String.keyFor("Connection")], _entry$3 !== undefined ? [_entry$3.v, true] : [sliceType$2.nil, false]); ok$1 = _tuple$3[1]; /* */ if (ok$1) { $s = 22; continue; } /* */ $s = 23; continue; /* if (ok$1) { */ case 22: _r$7 = new Header(rws.snapHeader).Get("Connection"); /* */ $s = 24; case 24: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } v$1 = _r$7; delete rws.snapHeader[$String.keyFor("Connection")]; /* */ if (v$1 === "close") { $s = 25; continue; } /* */ $s = 26; continue; /* if (v$1 === "close") { */ case 25: $r = rws.conn.startGracefulShutdown(); /* */ $s = 27; case 27: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 26: /* } */ case 23: endStream = (rws.handlerDone && !rws.hasTrailers() && (p.$length === 0)) || isHeadResp; _r$8 = rws.conn.writeHeaders(rws.stream, new http2writeResHeaders.ptr(rws.stream.id, rws.status, rws.snapHeader, sliceType$2.nil, endStream, date, ctype, clen)); /* */ $s = 28; case 28: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } err = _r$8; if (!($interfaceIsEqual(err, $ifaceNil))) { rws.dirty = true; _tmp$2 = 0; _tmp$3 = err; n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; } if (endStream) { _tmp$4 = 0; _tmp$5 = $ifaceNil; n = _tmp$4; err = _tmp$5; $s = -1; return [n, err]; } /* } */ case 5: if (isHeadResp) { _tmp$6 = p.$length; _tmp$7 = $ifaceNil; n = _tmp$6; err = _tmp$7; $s = -1; return [n, err]; } if ((p.$length === 0) && !rws.handlerDone) { _tmp$8 = 0; _tmp$9 = $ifaceNil; n = _tmp$8; err = _tmp$9; $s = -1; return [n, err]; } /* */ if (rws.handlerDone) { $s = 29; continue; } /* */ $s = 30; continue; /* if (rws.handlerDone) { */ case 29: $r = rws.promoteUndeclaredTrailers(); /* */ $s = 31; case 31: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 30: hasNonemptyTrailers = rws.hasNonemptyTrailers(); endStream$1 = rws.handlerDone && !hasNonemptyTrailers; /* */ if (p.$length > 0 || endStream$1) { $s = 32; continue; } /* */ $s = 33; continue; /* if (p.$length > 0 || endStream$1) { */ case 32: _r$9 = rws.conn.writeDataFromHandler(rws.stream, p, endStream$1); /* */ $s = 34; case 34: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err$2 = _r$9; if (!($interfaceIsEqual(err$2, $ifaceNil))) { rws.dirty = true; _tmp$10 = 0; _tmp$11 = err$2; n = _tmp$10; err = _tmp$11; $s = -1; return [n, err]; } /* } */ case 33: /* */ if (rws.handlerDone && hasNonemptyTrailers) { $s = 35; continue; } /* */ $s = 36; continue; /* if (rws.handlerDone && hasNonemptyTrailers) { */ case 35: _r$10 = rws.conn.writeHeaders(rws.stream, new http2writeResHeaders.ptr(rws.stream.id, 0, rws.handlerHeader, rws.trailers, true, "", "", "")); /* */ $s = 37; case 37: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } err = _r$10; if (!($interfaceIsEqual(err, $ifaceNil))) { rws.dirty = true; } _tmp$12 = p.$length; _tmp$13 = err; n = _tmp$12; err = _tmp$13; $s = -1; return [n, err]; /* } */ case 36: _tmp$14 = p.$length; _tmp$15 = $ifaceNil; n = _tmp$14; err = _tmp$15; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: http2responseWriterState.ptr.prototype.writeChunk }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._entry$2 = _entry$2; $f._entry$3 = _entry$3; $f._i = _i; $f._r$1 = _r$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$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$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._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.ce = ce; $f.cl = cl; $f.clen = clen; $f.ctype = ctype; $f.date = date; $f.endStream = endStream; $f.endStream$1 = endStream$1; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.hasCE = hasCE; $f.hasContentType = hasContentType; $f.hasNonemptyTrailers = hasNonemptyTrailers; $f.isHeadResp = isHeadResp; $f.n = n; $f.ok = ok; $f.ok$1 = ok$1; $f.p = p; $f.rws = rws; $f.v = v; $f.v$1 = v$1; $f.$s = $s; $f.$r = $r; return $f; }; http2responseWriterState.prototype.writeChunk = function(p) { return this.$val.writeChunk(p); }; http2responseWriterState.ptr.prototype.promoteUndeclaredTrailers = function() { var _entry, _i, _key, _keys, _r$1, _r$2, _ref, k, rws, sorter, trailerKey, vv, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _i = $f._i; _key = $f._key; _keys = $f._keys; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; k = $f.k; rws = $f.rws; sorter = $f.sorter; trailerKey = $f.trailerKey; vv = $f.vv; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rws = this; _ref = rws.handlerHeader; _i = 0; _keys = $keys(_ref); /* while (true) { */ case 1: /* if (!(_i < _keys.length)) { break; } */ if(!(_i < _keys.length)) { $s = 2; continue; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; /* continue; */ $s = 1; continue; } k = _entry.k; vv = _entry.v; if (!strings.HasPrefix(k, "Trailer:")) { _i++; /* continue; */ $s = 1; continue; } trailerKey = strings.TrimPrefix(k, "Trailer:"); $r = rws.declareTrailer(trailerKey); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = CanonicalHeaderKey(trailerKey); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _key = _r$1; (rws.handlerHeader || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: vv }; _i++; $s = 1; continue; case 2: /* */ if (rws.trailers.$length > 1) { $s = 5; continue; } /* */ $s = 6; continue; /* if (rws.trailers.$length > 1) { */ case 5: _r$2 = http2sorterPool.Get(); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } sorter = $assertType(_r$2, ptrType$100); $r = sorter.SortStrings(rws.trailers); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } http2sorterPool.Put(sorter); /* } */ case 6: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2responseWriterState.ptr.prototype.promoteUndeclaredTrailers }; } $f._entry = _entry; $f._i = _i; $f._key = _key; $f._keys = _keys; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f.k = k; $f.rws = rws; $f.sorter = sorter; $f.trailerKey = trailerKey; $f.vv = vv; $f.$s = $s; $f.$r = $r; return $f; }; http2responseWriterState.prototype.promoteUndeclaredTrailers = function() { return this.$val.promoteUndeclaredTrailers(); }; http2responseWriter.ptr.prototype.Flush = function() { var _r$1, _r$2, err, rws, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; err = $f.err; rws = $f.rws; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: w = this; rws = w.rws; if (rws === ptrType$99.nil) { $panic(new $String("Header called after Handler finished")); } /* */ if (rws.bw.Buffered() > 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (rws.bw.Buffered() > 0) { */ case 1: _r$1 = rws.bw.Flush(); /* */ $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; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return; } $s = 3; continue; /* } else { */ case 2: _r$2 = rws.writeChunk(sliceType$3.nil); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; /* } */ case 3: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2responseWriter.ptr.prototype.Flush }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f.err = err; $f.rws = rws; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; http2responseWriter.prototype.Flush = function() { return this.$val.Flush(); }; http2responseWriter.ptr.prototype.CloseNotify = function() { var ch, cw, rws, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; ch = $f.ch; cw = $f.cw; rws = $f.rws; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ch = [ch]; cw = [cw]; w = this; rws = w.rws; if (rws === ptrType$99.nil) { $panic(new $String("CloseNotify called after Handler finished")); } $r = rws.closeNotifierMu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } ch[0] = rws.closeNotifierCh; /* */ if (ch[0] === $chanNil) { $s = 2; continue; } /* */ $s = 3; continue; /* if (ch[0] === $chanNil) { */ case 2: ch[0] = new $Chan($Bool, 1); rws.closeNotifierCh = ch[0]; cw[0] = rws.stream.cw; $go((function(ch, cw) { return function $b() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = new http2closeWaiter(cw[0]).Wait(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = $send(ch[0], true); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$s = $s; $f.$r = $r; return $f; }; })(ch, cw), []); /* } */ case 3: $r = rws.closeNotifierMu.Unlock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return ch[0]; /* */ } return; } if ($f === undefined) { $f = { $blk: http2responseWriter.ptr.prototype.CloseNotify }; } $f.ch = ch; $f.cw = cw; $f.rws = rws; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; http2responseWriter.prototype.CloseNotify = function() { return this.$val.CloseNotify(); }; http2responseWriter.ptr.prototype.Header = function() { var rws, w; w = this; rws = w.rws; if (rws === ptrType$99.nil) { $panic(new $String("Header called after Handler finished")); } if (rws.handlerHeader === false) { rws.handlerHeader = {}; } return rws.handlerHeader; }; http2responseWriter.prototype.Header = function() { return this.$val.Header(); }; http2checkWriteHeaderCode = function(code) { var _r$1, code, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; code = $f.code; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (code < 100 || code > 999) { $s = 1; continue; } /* */ $s = 2; continue; /* if (code < 100 || code > 999) { */ case 1: _r$1 = fmt.Sprintf("invalid WriteHeader code %v", new sliceType([new $Int(code)])); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $panic(new $String(_r$1)); /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2checkWriteHeaderCode }; } $f._r$1 = _r$1; $f.code = code; $f.$s = $s; $f.$r = $r; return $f; }; http2responseWriter.ptr.prototype.WriteHeader = function(code) { var code, rws, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; code = $f.code; rws = $f.rws; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: w = this; rws = w.rws; if (rws === ptrType$99.nil) { $panic(new $String("WriteHeader called after Handler finished")); } $r = rws.writeHeader(code); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2responseWriter.ptr.prototype.WriteHeader }; } $f.code = code; $f.rws = rws; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; http2responseWriter.prototype.WriteHeader = function(code) { return this.$val.WriteHeader(code); }; http2responseWriterState.ptr.prototype.writeHeader = function(code) { var code, rws, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; code = $f.code; rws = $f.rws; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rws = this; /* */ if (!rws.wroteHeader) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!rws.wroteHeader) { */ case 1: $r = http2checkWriteHeaderCode(code); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } rws.wroteHeader = true; rws.status = code; if ($keys(rws.handlerHeader).length > 0) { rws.snapHeader = http2cloneHeader(rws.handlerHeader); } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2responseWriterState.ptr.prototype.writeHeader }; } $f.code = code; $f.rws = rws; $f.$s = $s; $f.$r = $r; return $f; }; http2responseWriterState.prototype.writeHeader = function(code) { return this.$val.writeHeader(code); }; http2cloneHeader = function(h) { var _entry, _i, _key, _keys, _ref, h, h2, k, vv, vv2, x$5; h2 = (x$5 = $keys(h).length, ((x$5 < 0 || x$5 > 2147483647) ? $throwRuntimeError("makemap: size out of range") : {})); _ref = h; _i = 0; _keys = $keys(_ref); while (true) { if (!(_i < _keys.length)) { break; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; continue; } k = _entry.k; vv = _entry.v; vv2 = $makeSlice(sliceType$2, vv.$length); $copySlice(vv2, vv); _key = k; (h2 || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: vv2 }; _i++; } return h2; }; http2responseWriter.ptr.prototype.Write = function(p) { var $24r, _r$1, _tuple, err, n, p, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; n = $f.n; p = $f.p; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; w = this; _r$1 = w.write(p.$length, p, ""); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err = _tuple[1]; $24r = [n, err]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2responseWriter.ptr.prototype.Write }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.n = n; $f.p = p; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; http2responseWriter.prototype.Write = function(p) { return this.$val.Write(p); }; http2responseWriter.ptr.prototype.WriteString = function(s) { var $24r, _r$1, _tuple, err, n, s, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; n = $f.n; s = $f.s; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; w = this; _r$1 = w.write(s.length, sliceType$3.nil, s); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err = _tuple[1]; $24r = [n, err]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2responseWriter.ptr.prototype.WriteString }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.n = n; $f.s = s; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; http2responseWriter.prototype.WriteString = function(s) { return this.$val.WriteString(s); }; http2responseWriter.ptr.prototype.write = function(lenData, dataB, dataS) { var $24r, $24r$1, _r$1, _r$2, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, dataB, dataS, err, lenData, n, rws, w, x$10, x$11, 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; $24r = $f.$24r; $24r$1 = $f.$24r$1; _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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; dataB = $f.dataB; dataS = $f.dataS; err = $f.err; lenData = $f.lenData; n = $f.n; rws = $f.rws; w = $f.w; x$10 = $f.x$10; x$11 = $f.x$11; 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: n = 0; err = $ifaceNil; w = this; rws = w.rws; if (rws === ptrType$99.nil) { $panic(new $String("Write called after Handler finished")); } /* */ if (!rws.wroteHeader) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!rws.wroteHeader) { */ case 1: $r = w.WriteHeader(200); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: if (!http2bodyAllowedForStatus(rws.status)) { _tmp = 0; _tmp$1 = $pkg.ErrBodyNotAllowed; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } rws.wroteBytes = (x$5 = rws.wroteBytes, x$6 = (x$7 = (new $Int64(0, dataB.$length)), x$8 = (new $Int64(0, dataS.length)), new $Int64(x$7.$high + x$8.$high, x$7.$low + x$8.$low)), new $Int64(x$5.$high + x$6.$high, x$5.$low + x$6.$low)); if (!((x$9 = rws.sentContentLen, (x$9.$high === 0 && x$9.$low === 0))) && (x$10 = rws.wroteBytes, x$11 = rws.sentContentLen, (x$10.$high > x$11.$high || (x$10.$high === x$11.$high && x$10.$low > x$11.$low)))) { _tmp$2 = 0; _tmp$3 = errors.New("http2: handler wrote more than declared Content-Length"); n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; } /* */ if (!(dataB === sliceType$3.nil)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!(dataB === sliceType$3.nil)) { */ case 4: _r$1 = rws.bw.Write(dataB); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err = _tuple[1]; $24r = [n, err]; $s = 8; case 8: return $24r; /* } else { */ case 5: _r$2 = rws.bw.WriteString(dataS); /* */ $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; n = _tuple$1[0]; err = _tuple$1[1]; $24r$1 = [n, err]; $s = 10; case 10: return $24r$1; /* } */ case 6: $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: http2responseWriter.ptr.prototype.write }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.dataB = dataB; $f.dataS = dataS; $f.err = err; $f.lenData = lenData; $f.n = n; $f.rws = rws; $f.w = w; $f.x$10 = x$10; $f.x$11 = x$11; $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; }; http2responseWriter.prototype.write = function(lenData, dataB, dataS) { return this.$val.write(lenData, dataB, dataS); }; http2responseWriter.ptr.prototype.handlerDone = function() { var dirty, rws, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; dirty = $f.dirty; rws = $f.rws; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: w = this; rws = w.rws; dirty = rws.dirty; rws.handlerDone = true; $r = w.Flush(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } w.rws = ptrType$99.nil; if (!dirty) { http2responseWriterStatePool.Put(rws); } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2responseWriter.ptr.prototype.handlerDone }; } $f.dirty = dirty; $f.rws = rws; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; http2responseWriter.prototype.handlerDone = function() { return this.$val.handlerDone(); }; http2responseWriter.ptr.prototype.Push = function(target, opts) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, _entry, _i, _keys, _r$1, _r$10, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _selection, _selection$1, _tuple, err, err$1, err$2, k, msg, opts, sc, st, target, u, w, wantScheme, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; _entry = $f._entry; _i = $f._i; _keys = $f._keys; _r$1 = $f._r$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; _selection = $f._selection; _selection$1 = $f._selection$1; _tuple = $f._tuple; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; k = $f.k; msg = $f.msg; opts = $f.opts; sc = $f.sc; st = $f.st; target = $f.target; u = $f.u; w = $f.w; wantScheme = $f.wantScheme; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: w = this; st = w.rws.stream; sc = st.sc; $r = sc.serveG.checkNotOn(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (st.isPushed()) { $s = -1; return http2ErrRecursivePush; } if (opts === ptrType$101.nil) { opts = new PushOptions.ptr("", false); } if (opts.Method === "") { opts.Method = "GET"; } if (opts.Header === false) { opts.Header = $makeMap($String.keyFor, []); } wantScheme = "http"; if (!(w.rws.req.TLS === ptrType$28.nil)) { wantScheme = "https"; } _r$1 = url.Parse(target); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; u = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } /* */ if (u.Scheme === "") { $s = 3; continue; } /* */ $s = 4; continue; /* if (u.Scheme === "") { */ case 3: /* */ if (!strings.HasPrefix(target, "/")) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!strings.HasPrefix(target, "/")) { */ case 6: _r$2 = fmt.Errorf("target must be an absolute URL or an absolute path: %q", new sliceType([new $String(target)])); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 9; case 9: return $24r; /* } */ case 7: u.Scheme = wantScheme; u.Host = w.rws.req.Host; $s = 5; continue; /* } else { */ case 4: /* */ if (!(u.Scheme === wantScheme)) { $s = 10; continue; } /* */ $s = 11; continue; /* if (!(u.Scheme === wantScheme)) { */ case 10: _r$3 = fmt.Errorf("cannot push URL with scheme %q from request with scheme %q", new sliceType([new $String(u.Scheme), new $String(wantScheme)])); /* */ $s = 12; case 12: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r$1 = _r$3; $s = 13; case 13: return $24r$1; /* } */ case 11: if (u.Host === "") { $s = -1; return errors.New("URL must have a host"); } /* } */ case 5: _ref = opts.Header; _i = 0; _keys = $keys(_ref); /* while (true) { */ case 14: /* if (!(_i < _keys.length)) { break; } */ if(!(_i < _keys.length)) { $s = 15; continue; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; /* continue; */ $s = 14; continue; } k = _entry.k; /* */ if (strings.HasPrefix(k, ":")) { $s = 16; continue; } /* */ $s = 17; continue; /* if (strings.HasPrefix(k, ":")) { */ case 16: _r$4 = fmt.Errorf("promised request headers cannot include pseudo header %q", new sliceType([new $String(k)])); /* */ $s = 18; case 18: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r$2 = _r$4; $s = 19; case 19: return $24r$2; /* } */ case 17: /* */ if (http2asciiEqualFold(k, "content-length") || http2asciiEqualFold(k, "content-encoding") || http2asciiEqualFold(k, "trailer") || http2asciiEqualFold(k, "te") || http2asciiEqualFold(k, "expect") || http2asciiEqualFold(k, "host")) { $s = 20; continue; } /* */ $s = 21; continue; /* if (http2asciiEqualFold(k, "content-length") || http2asciiEqualFold(k, "content-encoding") || http2asciiEqualFold(k, "trailer") || http2asciiEqualFold(k, "te") || http2asciiEqualFold(k, "expect") || http2asciiEqualFold(k, "host")) { */ case 20: _r$5 = fmt.Errorf("promised request headers cannot include %q", new sliceType([new $String(k)])); /* */ $s = 22; case 22: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $24r$3 = _r$5; $s = 23; case 23: return $24r$3; /* } */ case 21: _i++; $s = 14; continue; case 15: _r$6 = http2checkValidHTTP2RequestHeaders(opts.Header); /* */ $s = 24; case 24: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } err$1 = _r$6; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } /* */ if (!(opts.Method === "GET") && !(opts.Method === "HEAD")) { $s = 25; continue; } /* */ $s = 26; continue; /* if (!(opts.Method === "GET") && !(opts.Method === "HEAD")) { */ case 25: _r$7 = fmt.Errorf("method %q must be GET or HEAD", new sliceType([new $String(opts.Method)])); /* */ $s = 27; case 27: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } $24r$4 = _r$7; $s = 28; case 28: return $24r$4; /* } */ case 26: _r$8 = http2errChanPool.Get(); /* */ $s = 29; case 29: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } msg = new http2startPushRequest.ptr(st, opts.Method, u, http2cloneHeader(opts.Header), $assertType(_r$8, chanType)); _r$9 = $select([[sc.doneServing], [st.cw], [sc.serveMsgCh, msg]]); /* */ $s = 30; case 30: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _selection = _r$9; /* */ if (_selection[0] === 0) { $s = 31; continue; } /* */ if (_selection[0] === 1) { $s = 32; continue; } /* */ if (_selection[0] === 2) { $s = 33; continue; } /* */ $s = 34; continue; /* if (_selection[0] === 0) { */ case 31: $s = -1; return http2errClientDisconnected; /* } else if (_selection[0] === 1) { */ case 32: $s = -1; return http2errStreamClosed; /* } else if (_selection[0] === 2) { */ case 33: /* } */ case 34: _r$10 = $select([[sc.doneServing], [st.cw], [msg.done]]); /* */ $s = 35; case 35: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _selection$1 = _r$10; if (_selection$1[0] === 0) { $s = -1; return http2errClientDisconnected; } else if (_selection$1[0] === 1) { $s = -1; return http2errStreamClosed; } else if (_selection$1[0] === 2) { err$2 = _selection$1[1][0]; http2errChanPool.Put(new chanType(msg.done)); $s = -1; return err$2; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2responseWriter.ptr.prototype.Push }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f._entry = _entry; $f._i = _i; $f._keys = _keys; $f._r$1 = _r$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._selection = _selection; $f._selection$1 = _selection$1; $f._tuple = _tuple; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.k = k; $f.msg = msg; $f.opts = opts; $f.sc = sc; $f.st = st; $f.target = target; $f.u = u; $f.w = w; $f.wantScheme = wantScheme; $f.$s = $s; $f.$r = $r; return $f; }; http2responseWriter.prototype.Push = function(target, opts) { return this.$val.Push(target, opts); }; http2serverConn.ptr.prototype.startPush = function(msg) { var allocatePromisedID, msg, sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; allocatePromisedID = $f.allocatePromisedID; msg = $f.msg; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: msg = [msg]; sc = [sc]; sc[0] = this; $r = sc[0].serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!((msg[0].parent.state === 1)) && !((msg[0].parent.state === 3))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!((msg[0].parent.state === 1)) && !((msg[0].parent.state === 3))) { */ case 2: $r = $send(msg[0].done, http2errStreamClosed); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 3: /* */ if (!sc[0].pushEnabled) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!sc[0].pushEnabled) { */ case 5: $r = $send(msg[0].done, $pkg.ErrNotSupported); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 6: allocatePromisedID = (function(msg, sc) { return function $b() { var _r$1, _r$2, _r$3, _tuple, err, promised, promisedID, req, rw, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; err = $f.err; promised = $f.promised; promisedID = $f.promisedID; req = $f.req; rw = $f.rw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = sc[0].serveG.check(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (!sc[0].pushEnabled) { $s = -1; return [0, $pkg.ErrNotSupported]; } if ((sc[0].curPushedStreams + 1 >>> 0) > sc[0].clientMaxStreams) { $s = -1; return [0, http2ErrPushLimitReached]; } /* */ if ((sc[0].maxPushPromiseID + 2 >>> 0) >= 2147483648) { $s = 2; continue; } /* */ $s = 3; continue; /* if ((sc[0].maxPushPromiseID + 2 >>> 0) >= 2147483648) { */ case 2: $r = sc[0].startGracefulShutdownInternal(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return [0, http2ErrPushLimitReached]; /* } */ case 3: sc[0].maxPushPromiseID = sc[0].maxPushPromiseID + (2) >>> 0; promisedID = sc[0].maxPushPromiseID; _r$1 = sc[0].newStream(promisedID, msg[0].parent.id, 3); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } promised = _r$1; _r$2 = sc[0].newWriterAndRequestNoBody(promised, new http2requestParam.ptr(msg[0].method, msg[0].url.Scheme, msg[0].url.Host, msg[0].url.RequestURI(), http2cloneHeader(msg[0].header))); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; rw = _tuple[0]; req = _tuple[1]; err = _tuple[2]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 7: _r$3 = fmt.Sprintf("newWriterAndRequestNoBody(%+v): %v", new sliceType([msg[0].url, err])); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $panic(new $String(_r$3)); /* } */ case 8: $go($methodVal(sc[0], "runHandler"), [rw, req, $methodVal(sc[0].handler, "ServeHTTP")]); $s = -1; return [promisedID, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.err = err; $f.promised = promised; $f.promisedID = promisedID; $f.req = req; $f.rw = rw; $f.$s = $s; $f.$r = $r; return $f; }; })(msg, sc); $r = sc[0].writeFrame(new http2FrameWriteRequest.ptr(new http2writePushPromise.ptr(msg[0].parent.id, msg[0].method, msg[0].url, msg[0].header, allocatePromisedID, 0), msg[0].parent, msg[0].done)); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2serverConn.ptr.prototype.startPush }; } $f.allocatePromisedID = allocatePromisedID; $f.msg = msg; $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; http2serverConn.prototype.startPush = function(msg) { return this.$val.startPush(msg); }; http2foreachHeaderElement = function(v, fn) { var _i, _ref, f, fn, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _ref = $f._ref; f = $f.f; fn = $f.fn; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = textproto.TrimString(v); if (v === "") { $s = -1; return; } /* */ if (!strings.Contains(v, ",")) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!strings.Contains(v, ",")) { */ case 1: $r = fn(v); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 2: _ref = strings.Split(v, ","); _i = 0; /* while (true) { */ case 4: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 5; continue; } f = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); f = textproto.TrimString(f); /* */ if (!(f === "")) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!(f === "")) { */ case 6: $r = fn(f); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 7: _i++; $s = 4; continue; case 5: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2foreachHeaderElement }; } $f._i = _i; $f._ref = _ref; $f.f = f; $f.fn = fn; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; http2checkValidHTTP2RequestHeaders = function(h) { var $24r, _entry, _entry$1, _i, _r$1, _ref, _tuple, h, k, ok, te, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _entry = $f._entry; _entry$1 = $f._entry$1; _i = $f._i; _r$1 = $f._r$1; _ref = $f._ref; _tuple = $f._tuple; h = $f.h; k = $f.k; ok = $f.ok; te = $f.te; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _ref = http2connHeaders; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } k = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _tuple = (_entry = h[$String.keyFor(k)], _entry !== undefined ? [_entry.v, true] : [sliceType$2.nil, false]); ok = _tuple[1]; /* */ if (ok) { $s = 3; continue; } /* */ $s = 4; continue; /* if (ok) { */ case 3: _r$1 = fmt.Errorf("request header %q is not valid in HTTP/2", new sliceType([new $String(k)])); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 6; case 6: return $24r; /* } */ case 4: _i++; $s = 1; continue; case 2: te = (_entry$1 = h[$String.keyFor("Te")], _entry$1 !== undefined ? _entry$1.v : sliceType$2.nil); if (te.$length > 0 && (te.$length > 1 || (!((0 >= te.$length ? ($throwRuntimeError("index out of range"), undefined) : te.$array[te.$offset + 0]) === "trailers") && !((0 >= te.$length ? ($throwRuntimeError("index out of range"), undefined) : te.$array[te.$offset + 0]) === "")))) { $s = -1; return errors.New("request header \"TE\" may only be \"trailers\" in HTTP/2"); } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2checkValidHTTP2RequestHeaders }; } $f.$24r = $24r; $f._entry = _entry; $f._entry$1 = _entry$1; $f._i = _i; $f._r$1 = _r$1; $f._ref = _ref; $f._tuple = _tuple; $f.h = h; $f.k = k; $f.ok = ok; $f.te = te; $f.$s = $s; $f.$r = $r; return $f; }; http2new400Handler = function(err) { var err; return (function $b(w, r) { var _arg, _arg$1, _r$1, r, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _r$1 = $f._r$1; r = $f.r; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _arg = w; _r$1 = err.Error(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$1 = _r$1; $r = Error(_arg, _arg$1, 400); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._r$1 = _r$1; $f.r = r; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }); }; http2h1ServerKeepAlivesDisabled = function(hs) { var $24r, _r$1, _tuple, hs, hs$1, ok, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _tuple = $f._tuple; hs = $f.hs; hs$1 = $f.hs$1; ok = $f.ok; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: x$5 = hs; _tuple = $assertType(x$5, I, true); hs$1 = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 1; continue; } /* */ $s = 2; continue; /* if (ok) { */ case 1: _r$1 = hs$1.doKeepAlives(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = !_r$1; $s = 4; case 4: return $24r; /* } */ case 2: $s = -1; return false; /* */ } return; } if ($f === undefined) { $f = { $blk: http2h1ServerKeepAlivesDisabled }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.hs = hs; $f.hs$1 = hs$1; $f.ok = ok; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; http2Transport.ptr.prototype.maxHeaderListSize = function() { var t; t = this; if (t.MaxHeaderListSize === 0) { return 10485760; } if (t.MaxHeaderListSize === 4294967295) { return 0; } return t.MaxHeaderListSize; }; http2Transport.prototype.maxHeaderListSize = function() { return this.$val.maxHeaderListSize(); }; http2Transport.ptr.prototype.disableCompression = function() { var t; t = this; return t.DisableCompression || (!(t.t1 === ptrType$27.nil) && t.t1.DisableCompression); }; http2Transport.prototype.disableCompression = function() { return this.$val.disableCompression(); }; http2Transport.ptr.prototype.pingTimeout = function() { var t, x$5; t = this; if ((x$5 = t.PingTimeout, (x$5.$high === 0 && x$5.$low === 0))) { return new time.Duration(3, 2115098112); } return t.PingTimeout; }; http2Transport.prototype.pingTimeout = function() { return this.$val.pingTimeout(); }; http2configureTransports = function(t1) { var _key, _r$1, connPool, err, m, t1, t2, upgradeFn, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _key = $f._key; _r$1 = $f._r$1; connPool = $f.connPool; err = $f.err; m = $f.m; t1 = $f.t1; t2 = $f.t2; upgradeFn = $f.upgradeFn; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: connPool = [connPool]; t2 = [t2]; connPool[0] = new http2clientConnPool.ptr(ptrType$102.nil, new sync.Mutex.ptr(0, 0), false, false, false, false); t2[0] = new http2Transport.ptr($throwNilPointerError, ptrType$4.nil, (x$5 = new http2noDialClientConnPool.ptr(connPool[0]), new x$5.constructor.elem(x$5)), false, false, 0, false, new time.Duration(0, 0), new time.Duration(0, 0), t1, new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)), $ifaceNil); connPool[0].t = t2[0]; _r$1 = http2registerHTTPSProtocol(t1, new http2noDialH2RoundTripper.ptr(t2[0])); /* */ $s = 1; case 1: 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))) { $s = -1; return [ptrType$102.nil, err]; } if (t1.TLSClientConfig === ptrType$4.nil) { t1.TLSClientConfig = new tls.Config.ptr($ifaceNil, $throwNilPointerError, sliceType$13.nil, false, $throwNilPointerError, $throwNilPointerError, $throwNilPointerError, $throwNilPointerError, $throwNilPointerError, ptrType$34.nil, sliceType$2.nil, "", 0, ptrType$34.nil, false, sliceType$14.nil, false, false, arrayType$1.zero(), $ifaceNil, 0, 0, sliceType$15.nil, false, 0, $ifaceNil, new sync.RWMutex.ptr(new sync.Mutex.ptr(0, 0), 0, 0, 0, 0), sliceType$16.nil, sliceType$16.nil); } if (!http2strSliceContains(t1.TLSClientConfig.NextProtos, "h2")) { t1.TLSClientConfig.NextProtos = $appendSlice(new sliceType$2(["h2"]), t1.TLSClientConfig.NextProtos); } if (!http2strSliceContains(t1.TLSClientConfig.NextProtos, "http/1.1")) { t1.TLSClientConfig.NextProtos = $append(t1.TLSClientConfig.NextProtos, "http/1.1"); } upgradeFn = (function(connPool, t2) { return function $b(authority, c) { var _r$2, _r$3, _tuple, addr, authority, c, err$1, used, x$6, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; addr = $f.addr; authority = $f.authority; c = $f.c; err$1 = $f.err$1; used = $f.used; x$6 = $f.x$6; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$2 = http2authorityAddr("https", authority); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } addr = _r$2; _r$3 = connPool[0].addConnIfNeeded(addr, t2[0], c); /* */ $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; used = _tuple[0]; err$1 = _tuple[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $go($methodVal(c, "Close"), []); $s = -1; return (x$6 = new http2erringRoundTripper.ptr(err$1), new x$6.constructor.elem(x$6)); } else if (!used) { $go($methodVal(c, "Close"), []); } $s = -1; return t2[0]; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.addr = addr; $f.authority = authority; $f.c = c; $f.err$1 = err$1; $f.used = used; $f.x$6 = x$6; $f.$s = $s; $f.$r = $r; return $f; }; })(connPool, t2); m = t1.TLSNextProto; if ($keys(m).length === 0) { t1.TLSNextProto = $makeMap($String.keyFor, [{ k: "h2", v: upgradeFn }]); } else { _key = "h2"; (m || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: upgradeFn }; } $s = -1; return [t2[0], $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: http2configureTransports }; } $f._key = _key; $f._r$1 = _r$1; $f.connPool = connPool; $f.err = err; $f.m = m; $f.t1 = t1; $f.t2 = t2; $f.upgradeFn = upgradeFn; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; http2Transport.ptr.prototype.connPool = function() { var t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; $r = t.connPoolOnce.Do($methodVal(t, "initConnPool")); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return t.connPoolOrDef; /* */ } return; } if ($f === undefined) { $f = { $blk: http2Transport.ptr.prototype.connPool }; } $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; http2Transport.prototype.connPool = function() { return this.$val.connPool(); }; http2Transport.ptr.prototype.initConnPool = function() { var t; t = this; if (!($interfaceIsEqual(t.ConnPool, $ifaceNil))) { t.connPoolOrDef = t.ConnPool; } else { t.connPoolOrDef = new http2clientConnPool.ptr(t, new sync.Mutex.ptr(0, 0), false, false, false, false); } }; http2Transport.prototype.initConnPool = function() { return this.$val.initConnPool(); }; http2awaitRequestCancel = function(req, done) { var $24r, _r$1, _r$2, _r$3, _r$4, _selection, _v, ctx, done, req, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _selection = $f._selection; _v = $f._v; ctx = $f.ctx; done = $f.done; req = $f.req; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ctx = req.Context(); if (!(req.Cancel === $chanNil)) { _v = false; $s = 3; continue s; } _r$1 = ctx.Done(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _v = _r$1 === $chanNil; case 3: /* */ if (_v) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v) { */ case 1: $s = -1; return $ifaceNil; /* } */ case 2: _r$2 = ctx.Done(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = $select([[req.Cancel], [_r$2], [done]]); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _selection = _r$3; /* */ if (_selection[0] === 0) { $s = 7; continue; } /* */ if (_selection[0] === 1) { $s = 8; continue; } /* */ if (_selection[0] === 2) { $s = 9; continue; } /* */ $s = 10; continue; /* if (_selection[0] === 0) { */ case 7: $s = -1; return http2errRequestCanceled; /* } else if (_selection[0] === 1) { */ case 8: _r$4 = ctx.Err(); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r = _r$4; $s = 12; case 12: return $24r; /* } else if (_selection[0] === 2) { */ case 9: $s = -1; return $ifaceNil; /* } */ case 10: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2awaitRequestCancel }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._selection = _selection; $f._v = _v; $f.ctx = ctx; $f.done = done; $f.req = req; $f.$s = $s; $f.$r = $r; return $f; }; http2clientStream.ptr.prototype.get1xxTraceFunc = function() { var cs, fn; cs = this; fn = http2got1xxFuncForTests; if (!(fn === $throwNilPointerError)) { return fn; } return http2traceGot1xxResponseFunc(cs.trace); }; http2clientStream.prototype.get1xxTraceFunc = function() { return this.$val.get1xxTraceFunc(); }; http2clientStream.ptr.prototype.awaitRequestCancel = function(req) { var _r$1, cs, err, req, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; cs = $f.cs; err = $f.err; req = $f.req; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cs = this; _r$1 = http2awaitRequestCancel(req, cs.done); /* */ $s = 1; case 1: 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))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $r = cs.cancelStream(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = cs.bufPipe.CloseWithError(err); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2clientStream.ptr.prototype.awaitRequestCancel }; } $f._r$1 = _r$1; $f.cs = cs; $f.err = err; $f.req = req; $f.$s = $s; $f.$r = $r; return $f; }; http2clientStream.prototype.awaitRequestCancel = function(req) { return this.$val.awaitRequestCancel(req); }; http2clientStream.ptr.prototype.cancelStream = function() { var cc, cs, didReset, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; cc = $f.cc; cs = $f.cs; didReset = $f.didReset; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cs = this; cc = cs.cc; $r = cc.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } didReset = cs.didReset; cs.didReset = true; $r = cc.mu.Unlock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!didReset) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!didReset) { */ case 3: $r = cc.writeStreamReset(cs.ID, 8, $ifaceNil); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = cc.forgetStreamID(cs.ID); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2clientStream.ptr.prototype.cancelStream }; } $f.cc = cc; $f.cs = cs; $f.didReset = didReset; $f.$s = $s; $f.$r = $r; return $f; }; http2clientStream.prototype.cancelStream = function() { return this.$val.cancelStream(); }; http2clientStream.ptr.prototype.checkResetOrDone = function() { var _selection, cs; cs = this; _selection = $select([[cs.peerReset], [cs.done], []]); if (_selection[0] === 0) { return cs.resetErr; } else if (_selection[0] === 1) { return http2errStreamClosed; } else if (_selection[0] === 2) { return $ifaceNil; } }; http2clientStream.prototype.checkResetOrDone = function() { return this.$val.checkResetOrDone(); }; http2clientStream.ptr.prototype.getStartedWrite = function() { var $24r, cc, cs, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; cc = $f.cc; cs = $f.cs; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); cs = this; cc = cs.cc; $r = cc.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(cc.mu, "Unlock"), []]); $24r = cs.startedWrite; $s = 2; case 2: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; return false; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2clientStream.ptr.prototype.getStartedWrite }; } $f.$24r = $24r; $f.cc = cc; $f.cs = cs; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2clientStream.prototype.getStartedWrite = function() { return this.$val.getStartedWrite(); }; http2clientStream.ptr.prototype.abortRequestBodyWrite = function(err) { var cc, cs, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; cc = $f.cc; cs = $f.cs; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cs = this; if ($interfaceIsEqual(err, $ifaceNil)) { $panic(new $String("nil error")); } cc = cs.cc; $r = cc.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } cs.stopReqBody = err; $r = cc.cond.Broadcast(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = cc.mu.Unlock(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2clientStream.ptr.prototype.abortRequestBodyWrite }; } $f.cc = cc; $f.cs = cs; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; http2clientStream.prototype.abortRequestBodyWrite = function(err) { return this.$val.abortRequestBodyWrite(err); }; http2stickyErrWriter.ptr.prototype.Write = function(p) { var _r$1, _tmp, _tmp$1, _tuple, err, n, p, sew, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; err = $f.err; n = $f.n; p = $f.p; sew = $f.sew; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; sew = this; if (!($interfaceIsEqual(sew.err.$get(), $ifaceNil))) { _tmp = 0; _tmp$1 = sew.err.$get(); n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } _r$1 = sew.w.Write(p); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err = _tuple[1]; sew.err.$set(err); $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: http2stickyErrWriter.ptr.prototype.Write }; } $f._r$1 = _r$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.err = err; $f.n = n; $f.p = p; $f.sew = sew; $f.$s = $s; $f.$r = $r; return $f; }; http2stickyErrWriter.prototype.Write = function(p) { return this.$val.Write(p); }; http2noCachedConnError.ptr.prototype.IsHTTP2NoCachedConnError = function() { }; http2noCachedConnError.prototype.IsHTTP2NoCachedConnError = function() { return this.$val.IsHTTP2NoCachedConnError(); }; http2noCachedConnError.ptr.prototype.Error = function() { return "http2: no cached connection was available"; }; http2noCachedConnError.prototype.Error = function() { return this.$val.Error(); }; http2isNoCachedConnError = function(err) { var _tuple, err, ok; _tuple = $assertType(err, interfaceType, true); ok = _tuple[1]; return ok; }; http2Transport.ptr.prototype.RoundTrip = function(req) { var $24r, _r$1, req, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; req = $f.req; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r$1 = t.RoundTripOpt(req, new http2RoundTripOpt.ptr(false)); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2Transport.ptr.prototype.RoundTrip }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.req = req; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; http2Transport.prototype.RoundTrip = function(req) { return this.$val.RoundTrip(req); }; http2authorityAddr = function(scheme, authority) { var _r$1, _r$2, _tuple, _tuple$1, a, addr, authority, err, err$1, host, port, scheme, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; a = $f.a; addr = $f.addr; authority = $f.authority; err = $f.err; err$1 = $f.err$1; host = $f.host; port = $f.port; scheme = $f.scheme; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: addr = ""; _r$1 = net.SplitHostPort(authority); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; host = _tuple[0]; port = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { port = "443"; if (scheme === "http") { port = "80"; } host = authority; } _r$2 = idna.ToASCII(host); /* */ $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; a = _tuple$1[0]; err$1 = _tuple$1[1]; if ($interfaceIsEqual(err$1, $ifaceNil)) { host = a; } if (strings.HasPrefix(host, "[") && strings.HasSuffix(host, "]")) { addr = host + ":" + port; $s = -1; return addr; } addr = net.JoinHostPort(host, port); $s = -1; return addr; /* */ } return; } if ($f === undefined) { $f = { $blk: http2authorityAddr }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.a = a; $f.addr = addr; $f.authority = authority; $f.err = err; $f.err$1 = err$1; $f.host = host; $f.port = port; $f.scheme = scheme; $f.$s = $s; $f.$r = $r; return $f; }; http2Transport.ptr.prototype.RoundTripOpt = function(req, opt) { var $24r, _r$1, _r$10, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _selection, _tuple, _tuple$1, _tuple$2, addr, backoff, cc, err, gotErrAfterReqBodyWrite, opt, req, res, retry, reused, t, y, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$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; _selection = $f._selection; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; addr = $f.addr; backoff = $f.backoff; cc = $f.cc; err = $f.err; gotErrAfterReqBodyWrite = $f.gotErrAfterReqBodyWrite; opt = $f.opt; req = $f.req; res = $f.res; retry = $f.retry; reused = $f.reused; t = $f.t; y = $f.y; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; if (!(req.URL.Scheme === "https" || (req.URL.Scheme === "http" && t.AllowHTTP))) { $s = -1; return [ptrType$18.nil, errors.New("http2: unsupported scheme")]; } _r$1 = http2authorityAddr(req.URL.Scheme, req.URL.Host); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } addr = _r$1; retry = 0; /* while (true) { */ case 2: _r$2 = t.connPool(); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = _r$2.GetClientConn(req, addr); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; cc = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 6: $r = t.vlogf("http2: Transport failed to get client conn for %s: %v", new sliceType([new $String(addr), err])); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return [ptrType$18.nil, err]; /* } */ case 7: reused = !atomic.CompareAndSwapUint32((cc.$ptr_reused || (cc.$ptr_reused = new ptrType$103(function() { return this.$target.reused; }, function($v) { this.$target.reused = $v; }, cc))), 0, 1); $r = http2traceGotConn(req, cc, reused); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$4 = cc.roundTrip(req); /* */ $s = 10; case 10: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$1 = _r$4; res = _tuple$1[0]; gotErrAfterReqBodyWrite = _tuple$1[1]; err = _tuple$1[2]; /* */ if (!($interfaceIsEqual(err, $ifaceNil)) && retry <= 6) { $s = 11; continue; } /* */ $s = 12; continue; /* if (!($interfaceIsEqual(err, $ifaceNil)) && retry <= 6) { */ case 11: _r$5 = http2shouldRetryRequest(req, err, gotErrAfterReqBodyWrite); /* */ $s = 13; case 13: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$2 = _r$5; req = _tuple$2[0]; err = _tuple$2[1]; /* */ if ($interfaceIsEqual(err, $ifaceNil)) { $s = 14; continue; } /* */ $s = 15; continue; /* if ($interfaceIsEqual(err, $ifaceNil)) { */ case 14: if (retry === 0) { retry = retry + (1) >> 0; /* continue; */ $s = 2; continue; } backoff = (((y = ((((retry >>> 0)) - 1 >>> 0)), y < 32 ? (1 << y) : 0) >>> 0)); _r$6 = rand.Float64(); /* */ $s = 16; case 16: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } backoff = backoff + (backoff * (0.1 * _r$6)); _r$7 = time.After($mul64(new time.Duration(0, 1000000000), (new time.Duration(0, backoff)))); /* */ $s = 17; case 17: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$8 = req.Context().Done(); /* */ $s = 18; case 18: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$9 = $select([[_r$7], [_r$8]]); /* */ $s = 19; case 19: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _selection = _r$9; /* */ if (_selection[0] === 0) { $s = 20; continue; } /* */ if (_selection[0] === 1) { $s = 21; continue; } /* */ $s = 22; continue; /* if (_selection[0] === 0) { */ case 20: retry = retry + (1) >> 0; /* continue; */ $s = 2; continue; $s = 22; continue; /* } else if (_selection[0] === 1) { */ case 21: _r$10 = req.Context().Err(); /* */ $s = 23; case 23: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } $24r = [ptrType$18.nil, _r$10]; $s = 24; case 24: return $24r; /* } */ case 22: /* } */ case 15: /* } */ case 12: /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 25; continue; } /* */ $s = 26; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 25: $r = t.vlogf("RoundTrip failure: %v", new sliceType([err])); /* */ $s = 27; case 27: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return [ptrType$18.nil, err]; /* } */ case 26: $s = -1; return [res, $ifaceNil]; case 3: $s = -1; return [ptrType$18.nil, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: http2Transport.ptr.prototype.RoundTripOpt }; } $f.$24r = $24r; $f._r$1 = _r$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._selection = _selection; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.addr = addr; $f.backoff = backoff; $f.cc = cc; $f.err = err; $f.gotErrAfterReqBodyWrite = gotErrAfterReqBodyWrite; $f.opt = opt; $f.req = req; $f.res = res; $f.retry = retry; $f.reused = reused; $f.t = t; $f.y = y; $f.$s = $s; $f.$r = $r; return $f; }; http2Transport.prototype.RoundTripOpt = function(req, opt) { return this.$val.RoundTripOpt(req, opt); }; http2Transport.ptr.prototype.CloseIdleConnections = function() { var _r$1, _tuple, cp, ok, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; cp = $f.cp; ok = $f.ok; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r$1 = t.connPool(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = $assertType(_r$1, http2clientConnPoolIdleCloser, true); cp = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (ok) { */ case 2: $r = cp.closeIdleConnections(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2Transport.ptr.prototype.CloseIdleConnections }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.cp = cp; $f.ok = ok; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; http2Transport.prototype.CloseIdleConnections = function() { return this.$val.CloseIdleConnections(); }; http2shouldRetryRequest = function(req, err, afterBodyWrite) { var $24r, _r$1, _r$2, _tuple, afterBodyWrite, body$1, err, err$1, newReq, req, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; afterBodyWrite = $f.afterBodyWrite; body$1 = $f.body$1; err = $f.err; err$1 = $f.err$1; newReq = $f.newReq; req = $f.req; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: newReq = [newReq]; if (!http2canRetryError(err)) { $s = -1; return [ptrType$11.nil, err]; } if ($interfaceIsEqual(req.Body, $ifaceNil) || $interfaceIsEqual(req.Body, new $pkg.NoBody.constructor.elem($pkg.NoBody))) { $s = -1; return [req, $ifaceNil]; } /* */ if (!(req.GetBody === $throwNilPointerError)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(req.GetBody === $throwNilPointerError)) { */ case 1: _r$1 = req.GetBody(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; body$1 = _tuple[0]; err$1 = _tuple[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [ptrType$11.nil, err$1]; } newReq[0] = $clone(req, Request); newReq[0].Body = body$1; $s = -1; return [newReq[0], $ifaceNil]; /* } */ case 2: if (!afterBodyWrite) { $s = -1; return [req, $ifaceNil]; } _r$2 = fmt.Errorf("http2: Transport: cannot retry err [%v] after Request.Body was written; define Request.GetBody to avoid this error", new sliceType([err])); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = [ptrType$11.nil, _r$2]; $s = 5; case 5: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2shouldRetryRequest }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.afterBodyWrite = afterBodyWrite; $f.body$1 = body$1; $f.err = err; $f.err$1 = err$1; $f.newReq = newReq; $f.req = req; $f.$s = $s; $f.$r = $r; return $f; }; http2canRetryError = function(err) { var _tuple, err, ok, se; if ($interfaceIsEqual(err, http2errClientConnUnusable) || $interfaceIsEqual(err, http2errClientConnGotGoAway)) { return true; } _tuple = $assertType(err, http2StreamError, true); se = $clone(_tuple[0], http2StreamError); ok = _tuple[1]; if (ok) { return se.Code === 7; } return false; }; http2Transport.ptr.prototype.dialClientConn = function(ctx, addr, singleUse) { var $24r, _arg, _arg$1, _r$1, _r$2, _r$3, _r$4, _tuple, _tuple$1, addr, ctx, err, host, singleUse, t, tconn, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _arg = $f._arg; _arg$1 = $f._arg$1; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; addr = $f.addr; ctx = $f.ctx; err = $f.err; host = $f.host; singleUse = $f.singleUse; t = $f.t; tconn = $f.tconn; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r$1 = net.SplitHostPort(addr); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; host = _tuple[0]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$68.nil, err]; } _arg = addr; _r$2 = t.newTLSConfig(host); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg$1 = _r$2; _r$3 = t.dialTLS(ctx)("tcp", _arg, _arg$1); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$1 = _r$3; tconn = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$68.nil, err]; } _r$4 = t.newClientConn(tconn, singleUse); /* */ $s = 4; case 4: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r = _r$4; $s = 5; case 5: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2Transport.ptr.prototype.dialClientConn }; } $f.$24r = $24r; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.addr = addr; $f.ctx = ctx; $f.err = err; $f.host = host; $f.singleUse = singleUse; $f.t = t; $f.tconn = tconn; $f.$s = $s; $f.$r = $r; return $f; }; http2Transport.prototype.dialClientConn = function(ctx, addr, singleUse) { return this.$val.dialClientConn(ctx, addr, singleUse); }; http2Transport.ptr.prototype.newTLSConfig = function(host) { var _r$1, cfg, host, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; cfg = $f.cfg; host = $f.host; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; cfg = new tls.Config.ptr($ifaceNil, $throwNilPointerError, sliceType$13.nil, false, $throwNilPointerError, $throwNilPointerError, $throwNilPointerError, $throwNilPointerError, $throwNilPointerError, ptrType$34.nil, sliceType$2.nil, "", 0, ptrType$34.nil, false, sliceType$14.nil, false, false, arrayType$1.zero(), $ifaceNil, 0, 0, sliceType$15.nil, false, 0, $ifaceNil, new sync.RWMutex.ptr(new sync.Mutex.ptr(0, 0), 0, 0, 0, 0), sliceType$16.nil, sliceType$16.nil); /* */ if (!(t.TLSClientConfig === ptrType$4.nil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(t.TLSClientConfig === ptrType$4.nil)) { */ case 1: _r$1 = t.TLSClientConfig.Clone(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } tls.Config.copy(cfg, _r$1); /* } */ case 2: if (!http2strSliceContains(cfg.NextProtos, "h2")) { cfg.NextProtos = $appendSlice(new sliceType$2(["h2"]), cfg.NextProtos); } if (cfg.ServerName === "") { cfg.ServerName = host; } $s = -1; return cfg; /* */ } return; } if ($f === undefined) { $f = { $blk: http2Transport.ptr.prototype.newTLSConfig }; } $f._r$1 = _r$1; $f.cfg = cfg; $f.host = host; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; http2Transport.prototype.newTLSConfig = function(host) { return this.$val.newTLSConfig(host); }; http2Transport.ptr.prototype.dialTLS = function(ctx) { var ctx, t; t = this; if (!(t.DialTLS === $throwNilPointerError)) { return t.DialTLS; } return (function $b(network, addr, cfg) { var $24r, _r$1, _r$2, _r$3, _tuple, addr, cfg, err, network, p, state, tlsCn, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; addr = $f.addr; cfg = $f.cfg; err = $f.err; network = $f.network; p = $f.p; state = $f.state; tlsCn = $f.tlsCn; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = t.dialTLSWithContext(ctx, network, addr, cfg); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; tlsCn = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [$ifaceNil, err]; } _r$2 = tlsCn.ConnectionState(); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } state = $clone(_r$2, tls.ConnectionState); p = state.NegotiatedProtocol; /* */ if (!(p === "h2")) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!(p === "h2")) { */ case 3: _r$3 = fmt.Errorf("http2: unexpected ALPN protocol %q; want %q", new sliceType([new $String(p), new $String("h2")])); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = [$ifaceNil, _r$3]; $s = 6; case 6: return $24r; /* } */ case 4: if (!state.NegotiatedProtocolIsMutual) { $s = -1; return [$ifaceNil, errors.New("http2: could not negotiate protocol mutually")]; } $s = -1; return [tlsCn, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.addr = addr; $f.cfg = cfg; $f.err = err; $f.network = network; $f.p = p; $f.state = state; $f.tlsCn = tlsCn; $f.$s = $s; $f.$r = $r; return $f; }); }; http2Transport.prototype.dialTLS = function(ctx) { return this.$val.dialTLS(ctx); }; http2Transport.ptr.prototype.disableKeepAlives = function() { var t; t = this; return !(t.t1 === ptrType$27.nil) && t.t1.DisableKeepAlives; }; http2Transport.prototype.disableKeepAlives = function() { return this.$val.disableKeepAlives(); }; http2Transport.ptr.prototype.expectContinueTimeout = function() { var t; t = this; if (t.t1 === ptrType$27.nil) { return new time.Duration(0, 0); } return t.t1.ExpectContinueTimeout; }; http2Transport.prototype.expectContinueTimeout = function() { return this.$val.expectContinueTimeout(); }; http2Transport.ptr.prototype.NewClientConn = function(c) { var $24r, _r$1, c, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; c = $f.c; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r$1 = t.newClientConn(c, t.disableKeepAlives()); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2Transport.ptr.prototype.NewClientConn }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.c = c; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; http2Transport.prototype.NewClientConn = function(c) { return this.$val.NewClientConn(c); }; http2Transport.ptr.prototype.newClientConn = function(c, singleUse) { var _arg, _arg$1, _r$1, _r$10, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, c, cc, cs, d, initialSettings, max, ok, singleUse, state, t, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _r$1 = $f._r$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; _tuple = $f._tuple; c = $f.c; cc = $f.cc; cs = $f.cs; d = $f.d; initialSettings = $f.initialSettings; max = $f.max; ok = $f.ok; singleUse = $f.singleUse; state = $f.state; t = $f.t; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: state = [state]; t = this; cc = new http2ClientConn.ptr(t, c, ptrType$28.nil, 0, singleUse, new $Chan(structType, 0), $ifaceNil, new time.Duration(0, 0), ptrType$25.nil, new sync.Mutex.ptr(0, 0), ptrType$48.nil, new http2flow.ptr(arrayType.zero(), 0, ptrType$71.nil), new http2flow.ptr(arrayType.zero(), 0, ptrType$71.nil), false, false, true, ptrType$82.nil, "", {}, 1, 0, {}, ptrType$14.nil, ptrType$29.nil, ptrType$72.nil, new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil), new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil), 16384, 1000, new $Uint64(4294967295, 4294967295), 65535, new bytes.Buffer.ptr(sliceType$3.nil, 0, 0), ptrType$89.nil, sliceType$5.nil, new sync.Mutex.ptr(0, 0), $ifaceNil); d = t.idleConnTimeout(); /* */ if (!((d.$high === 0 && d.$low === 0))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((d.$high === 0 && d.$low === 0))) { */ case 1: cc.idleTimeout = d; _r$1 = time.AfterFunc(d, $methodVal(cc, "onIdleTimeout")); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } cc.idleTimer = _r$1; /* } */ case 2: /* */ if (http2VerboseLogs) { $s = 4; continue; } /* */ $s = 5; continue; /* if (http2VerboseLogs) { */ case 4: _arg = cc; _r$2 = c.RemoteAddr(); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg$1 = _r$2; $r = t.vlogf("http2: Transport creating client conn %p to %v", new sliceType([_arg, _arg$1])); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: cc.cond = sync.NewCond(cc.mu); cc.flow.add(65535); cc.bw = bufio.NewWriter((x$5 = new http2stickyErrWriter.ptr(c, (cc.$ptr_werr || (cc.$ptr_werr = new ptrType$85(function() { return this.$target.werr; }, function($v) { this.$target.werr = $v; }, cc)))), new x$5.constructor.elem(x$5))); cc.br = bufio.NewReader(c); cc.fr = http2NewFramer(cc.bw, cc.br); _r$3 = hpack.NewDecoder(4096, $throwNilPointerError); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } cc.fr.ReadMetaHeaders = _r$3; cc.fr.MaxHeaderListSize = t.maxHeaderListSize(); _r$4 = hpack.NewEncoder(cc.hbuf); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } cc.henc = _r$4; if (t.AllowHTTP) { cc.nextStreamID = 3; } _tuple = $assertType(c, http2connectionStater, true); cs = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 10; continue; } /* */ $s = 11; continue; /* if (ok) { */ case 10: _r$5 = cs.ConnectionState(); /* */ $s = 12; case 12: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } state[0] = $clone(_r$5, tls.ConnectionState); cc.tlsState = state[0]; /* } */ case 11: initialSettings = new sliceType$23([new http2Setting.ptr(2, 0), new http2Setting.ptr(4, 4194304)]); max = t.maxHeaderListSize(); if (!((max === 0))) { initialSettings = $append(initialSettings, new http2Setting.ptr(6, max)); } _r$6 = cc.bw.Write(http2clientPreface); /* */ $s = 13; case 13: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; _r$7 = cc.fr.WriteSettings(initialSettings); /* */ $s = 14; case 14: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$7; _r$8 = cc.fr.WriteWindowUpdate(0, 1073741824); /* */ $s = 15; case 15: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$8; cc.inflow.add(1073807359); _r$9 = cc.bw.Flush(); /* */ $s = 16; case 16: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$9; /* */ if (!($interfaceIsEqual(cc.werr, $ifaceNil))) { $s = 17; continue; } /* */ $s = 18; continue; /* if (!($interfaceIsEqual(cc.werr, $ifaceNil))) { */ case 17: _r$10 = cc.Close(); /* */ $s = 19; case 19: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; $s = -1; return [ptrType$68.nil, cc.werr]; /* } */ case 18: $go($methodVal(cc, "readLoop"), []); $s = -1; return [cc, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: http2Transport.ptr.prototype.newClientConn }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._r$1 = _r$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._tuple = _tuple; $f.c = c; $f.cc = cc; $f.cs = cs; $f.d = d; $f.initialSettings = initialSettings; $f.max = max; $f.ok = ok; $f.singleUse = singleUse; $f.state = state; $f.t = t; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; http2Transport.prototype.newClientConn = function(c, singleUse) { return this.$val.newClientConn(c, singleUse); }; http2ClientConn.ptr.prototype.healthCheck = function() { var _r$1, _r$2, _r$3, _r$4, _tuple, cancel, cc, ctx, err, pingTimeout, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; cancel = $f.cancel; cc = $f.cc; ctx = $f.ctx; err = $f.err; pingTimeout = $f.pingTimeout; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); cc = this; pingTimeout = cc.t.pingTimeout(); _r$1 = context.WithTimeout(context.Background(), pingTimeout); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; ctx = _tuple[0]; cancel = _tuple[1]; $deferred.push([cancel, []]); _r$2 = cc.Ping(ctx); /* */ $s = 2; case 2: 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))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 3: _r$3 = cc.closeForLostPing(); /* */ $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 = cc.t.connPool(); /* */ $s = 6; case 6: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $r = _r$4.MarkDead(cc); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 8; case 8: return; /* } */ case 4: $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2ClientConn.ptr.prototype.healthCheck }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f.cancel = cancel; $f.cc = cc; $f.ctx = ctx; $f.err = err; $f.pingTimeout = pingTimeout; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2ClientConn.prototype.healthCheck = function() { return this.$val.healthCheck(); }; http2ClientConn.ptr.prototype.setGoAway = function(f) { var _entry, _i, _keys, _ref, _selection, cc, cs, f, last, old, streamID, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _i = $f._i; _keys = $f._keys; _ref = $f._ref; _selection = $f._selection; cc = $f.cc; cs = $f.cs; f = $f.f; last = $f.last; old = $f.old; streamID = $f.streamID; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); cc = this; $r = cc.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(cc.mu, "Unlock"), []]); old = cc.goAway; cc.goAway = f; if (cc.goAwayDebug === "") { cc.goAwayDebug = ($bytesToString(f.DebugData())); } if (!(old === ptrType$82.nil) && !((old.ErrCode === 0))) { cc.goAway.ErrCode = old.ErrCode; } last = f.LastStreamID; _ref = cc.streams; _i = 0; _keys = $keys(_ref); while (true) { if (!(_i < _keys.length)) { break; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; continue; } streamID = _entry.k; cs = _entry.v; if (streamID > last) { _selection = $select([[cs.resc, new http2resAndError.ptr(arrayType.zero(), ptrType$18.nil, http2errClientConnGotGoAway)], []]); if (_selection[0] === 0) { } else if (_selection[0] === 1) { } } _i++; } $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2ClientConn.ptr.prototype.setGoAway }; } $f._entry = _entry; $f._i = _i; $f._keys = _keys; $f._ref = _ref; $f._selection = _selection; $f.cc = cc; $f.cs = cs; $f.f = f; $f.last = last; $f.old = old; $f.streamID = streamID; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2ClientConn.prototype.setGoAway = function(f) { return this.$val.setGoAway(f); }; http2ClientConn.ptr.prototype.CanTakeNewRequest = function() { var $24r, _r$1, cc, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; cc = $f.cc; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); cc = this; $r = cc.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(cc.mu, "Unlock"), []]); _r$1 = cc.canTakeNewRequestLocked(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 3; case 3: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; return false; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2ClientConn.ptr.prototype.CanTakeNewRequest }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.cc = cc; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2ClientConn.prototype.CanTakeNewRequest = function() { return this.$val.CanTakeNewRequest(); }; http2ClientConn.ptr.prototype.idleState = function() { var $24r, _r$1, cc, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; cc = $f.cc; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); cc = this; $r = cc.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(cc.mu, "Unlock"), []]); _r$1 = cc.idleStateLocked(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 3; case 3: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; return new http2clientConnIdleState.ptr(false, false); } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2ClientConn.ptr.prototype.idleState }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.cc = cc; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2ClientConn.prototype.idleState = function() { return this.$val.idleState(); }; http2ClientConn.ptr.prototype.idleStateLocked = function() { var _r$1, _v, cc, maxConcurrentOkay, st, 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; _r$1 = $f._r$1; _v = $f._v; cc = $f.cc; maxConcurrentOkay = $f.maxConcurrentOkay; st = $f.st; 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: st = new http2clientConnIdleState.ptr(false, false); cc = this; if (cc.singleUse && cc.nextStreamID > 1) { $s = -1; return st; } maxConcurrentOkay = false; if (cc.t.StrictMaxConcurrentStreams) { maxConcurrentOkay = true; } else { maxConcurrentOkay = (x$5 = (new $Int64(0, ($keys(cc.streams).length + 1 >> 0))), x$6 = (new $Int64(0, cc.maxConcurrentStreams)), (x$5.$high < x$6.$high || (x$5.$high === x$6.$high && x$5.$low < x$6.$low))); } if (!(cc.goAway === ptrType$82.nil && !cc.closed && !cc.closing && maxConcurrentOkay && (x$7 = (x$8 = (new $Int64(0, cc.nextStreamID)), x$9 = $mul64(new $Int64(0, 2), (new $Int64(0, cc.pendingRequests))), new $Int64(x$8.$high + x$9.$high, x$8.$low + x$9.$low)), (x$7.$high < 0 || (x$7.$high === 0 && x$7.$low < 2147483647))))) { _v = false; $s = 1; continue s; } _r$1 = cc.tooIdleLocked(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _v = !_r$1; case 1: st.canTakeNewRequest = _v; st.freshConn = (cc.nextStreamID === 1) && st.canTakeNewRequest; $s = -1; return st; /* */ } return; } if ($f === undefined) { $f = { $blk: http2ClientConn.ptr.prototype.idleStateLocked }; } $f._r$1 = _r$1; $f._v = _v; $f.cc = cc; $f.maxConcurrentOkay = maxConcurrentOkay; $f.st = st; $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; }; http2ClientConn.prototype.idleStateLocked = function() { return this.$val.idleStateLocked(); }; http2ClientConn.ptr.prototype.canTakeNewRequestLocked = function() { var _r$1, cc, st, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; cc = $f.cc; st = $f.st; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cc = this; _r$1 = cc.idleStateLocked(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } st = $clone(_r$1, http2clientConnIdleState); $s = -1; return st.canTakeNewRequest; /* */ } return; } if ($f === undefined) { $f = { $blk: http2ClientConn.ptr.prototype.canTakeNewRequestLocked }; } $f._r$1 = _r$1; $f.cc = cc; $f.st = st; $f.$s = $s; $f.$r = $r; return $f; }; http2ClientConn.prototype.canTakeNewRequestLocked = function() { return this.$val.canTakeNewRequestLocked(); }; http2ClientConn.ptr.prototype.tooIdleLocked = function() { var $24r, _r$1, _v, cc, x$5, x$6, x$7, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _v = $f._v; cc = $f.cc; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cc = this; if (!(!((x$5 = cc.idleTimeout, (x$5.$high === 0 && x$5.$low === 0))) && !$clone(cc.lastIdle, time.Time).IsZero())) { _v = false; $s = 1; continue s; } _r$1 = time.Since($clone($clone(cc.lastIdle, time.Time).Round(new time.Duration(0, 0)), time.Time)); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _v = (x$6 = _r$1, x$7 = cc.idleTimeout, (x$6.$high > x$7.$high || (x$6.$high === x$7.$high && x$6.$low > x$7.$low))); case 1: $24r = _v; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2ClientConn.ptr.prototype.tooIdleLocked }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._v = _v; $f.cc = cc; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.$s = $s; $f.$r = $r; return $f; }; http2ClientConn.prototype.tooIdleLocked = function() { return this.$val.tooIdleLocked(); }; http2ClientConn.ptr.prototype.onIdleTimeout = function() { var cc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; cc = $f.cc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cc = this; $r = cc.closeIfIdle(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2ClientConn.ptr.prototype.onIdleTimeout }; } $f.cc = cc; $f.$s = $s; $f.$r = $r; return $f; }; http2ClientConn.prototype.onIdleTimeout = function() { return this.$val.onIdleTimeout(); }; http2ClientConn.ptr.prototype.closeIfIdle = function() { var _r$1, cc, nextID, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; cc = $f.cc; nextID = $f.nextID; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cc = this; $r = cc.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if ($keys(cc.streams).length > 0) { $s = 2; continue; } /* */ $s = 3; continue; /* if ($keys(cc.streams).length > 0) { */ case 2: $r = cc.mu.Unlock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 3: cc.closed = true; nextID = cc.nextStreamID; $r = cc.mu.Unlock(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (http2VerboseLogs) { $s = 6; continue; } /* */ $s = 7; continue; /* if (http2VerboseLogs) { */ case 6: $r = cc.vlogf("http2: Transport closing idle conn %p (forSingleUse=%v, maxStream=%v)", new sliceType([cc, new $Bool(cc.singleUse), new $Uint32((nextID - 2 >>> 0))])); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 7: _r$1 = cc.tconn.Close(); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2ClientConn.ptr.prototype.closeIfIdle }; } $f._r$1 = _r$1; $f.cc = cc; $f.nextID = nextID; $f.$s = $s; $f.$r = $r; return $f; }; http2ClientConn.prototype.closeIfIdle = function() { return this.$val.closeIfIdle(); }; http2ClientConn.ptr.prototype.Shutdown = function(ctx) { var $24r, _r$1, _r$2, _r$3, _r$4, _selection, cancelled, cc, ctx, done, err, err$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _selection = $f._selection; cancelled = $f.cancelled; cc = $f.cc; ctx = $f.ctx; done = $f.done; err = $f.err; err$1 = $f.err$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cancelled = [cancelled]; cc = [cc]; done = [done]; cc[0] = this; _r$1 = cc[0].sendGoAway(); /* */ $s = 1; case 1: 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))) { $s = -1; return err; } done[0] = new $Chan($error, 1); cancelled[0] = false; $go((function(cancelled, cc, done) { return function $b() { var _r$2, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$2 = $f._r$2; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); $r = cc[0].mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(cc[0].mu, "Unlock"), []]); /* while (true) { */ case 2: /* */ if (($keys(cc[0].streams).length === 0) || cc[0].closed) { $s = 4; continue; } /* */ $s = 5; continue; /* if (($keys(cc[0].streams).length === 0) || cc[0].closed) { */ case 4: cc[0].closed = true; _r$2 = cc[0].tconn.Close(); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $r = $send(done[0], _r$2); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* break; */ $s = 3; continue; /* } */ case 5: if (cancelled[0]) { /* break; */ $s = 3; continue; } $r = cc[0].cond.Wait(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 2; continue; case 3: $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: $b }; } $f._r$2 = _r$2; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; })(cancelled, cc, done), []); $r = http2shutdownEnterWaitStateHook(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$2 = ctx.Done(); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = $select([[done[0]], [_r$2]]); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _selection = _r$3; /* */ if (_selection[0] === 0) { $s = 5; continue; } /* */ if (_selection[0] === 1) { $s = 6; continue; } /* */ $s = 7; continue; /* if (_selection[0] === 0) { */ case 5: err$1 = _selection[1][0]; $s = -1; return err$1; /* } else if (_selection[0] === 1) { */ case 6: $r = cc[0].mu.Lock(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } cancelled[0] = true; $r = cc[0].cond.Broadcast(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = cc[0].mu.Unlock(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$4 = ctx.Err(); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r = _r$4; $s = 12; case 12: return $24r; /* } */ case 7: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2ClientConn.ptr.prototype.Shutdown }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._selection = _selection; $f.cancelled = cancelled; $f.cc = cc; $f.ctx = ctx; $f.done = done; $f.err = err; $f.err$1 = err$1; $f.$s = $s; $f.$r = $r; return $f; }; http2ClientConn.prototype.Shutdown = function(ctx) { return this.$val.Shutdown(ctx); }; http2ClientConn.ptr.prototype.sendGoAway = function() { var $24r, $24r$1, $24r$2, $24r$3, _r$1, _r$2, cc, err, err$1, maxStreamID, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; _r$1 = $f._r$1; _r$2 = $f._r$2; cc = $f.cc; err = $f.err; err$1 = $f.err$1; maxStreamID = $f.maxStreamID; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); cc = this; $r = cc.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(cc.mu, "Unlock"), []]); $r = cc.wmu.Lock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(cc.wmu, "Unlock"), []]); /* */ if (cc.closing) { $s = 3; continue; } /* */ $s = 4; continue; /* if (cc.closing) { */ case 3: $24r = $ifaceNil; $s = 5; case 5: return $24r; /* } */ case 4: maxStreamID = cc.nextStreamID; _r$1 = cc.fr.WriteGoAway(maxStreamID, 0, sliceType$3.nil); /* */ $s = 6; case 6: 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))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 7: $24r$1 = err; $s = 9; case 9: return $24r$1; /* } */ case 8: _r$2 = cc.bw.Flush(); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } err$1 = _r$2; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 11; continue; } /* */ $s = 12; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 11: $24r$2 = err$1; $s = 13; case 13: return $24r$2; /* } */ case 12: cc.closing = true; $24r$3 = $ifaceNil; $s = 14; case 14: return $24r$3; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2ClientConn.ptr.prototype.sendGoAway }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.cc = cc; $f.err = err; $f.err$1 = err$1; $f.maxStreamID = maxStreamID; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2ClientConn.prototype.sendGoAway = function() { return this.$val.sendGoAway(); }; http2ClientConn.ptr.prototype.closeForError = function(err) { var $24r, _entry, _i, _keys, _r$1, _ref, _selection, cc, cs, err, id, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _entry = $f._entry; _i = $f._i; _keys = $f._keys; _r$1 = $f._r$1; _ref = $f._ref; _selection = $f._selection; cc = $f.cc; cs = $f.cs; err = $f.err; id = $f.id; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); cc = this; $r = cc.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(cc.cond, "Broadcast"), []]); $deferred.push([$methodVal(cc.mu, "Unlock"), []]); _ref = cc.streams; _i = 0; _keys = $keys(_ref); /* while (true) { */ case 2: /* if (!(_i < _keys.length)) { break; } */ if(!(_i < _keys.length)) { $s = 3; continue; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; /* continue; */ $s = 2; continue; } id = _entry.k; cs = _entry.v; _selection = $select([[cs.resc, new http2resAndError.ptr(arrayType.zero(), ptrType$18.nil, err)], []]); if (_selection[0] === 0) { } else if (_selection[0] === 1) { } $r = cs.bufPipe.CloseWithError(err); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } delete cc.streams[$Uint32.keyFor(id)]; _i++; $s = 2; continue; case 3: cc.closed = true; _r$1 = cc.tconn.Close(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 6; case 6: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2ClientConn.ptr.prototype.closeForError }; } $f.$24r = $24r; $f._entry = _entry; $f._i = _i; $f._keys = _keys; $f._r$1 = _r$1; $f._ref = _ref; $f._selection = _selection; $f.cc = cc; $f.cs = cs; $f.err = err; $f.id = id; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2ClientConn.prototype.closeForError = function(err) { return this.$val.closeForError(err); }; http2ClientConn.ptr.prototype.Close = function() { var $24r, _r$1, cc, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; cc = $f.cc; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cc = this; err = errors.New("http2: client connection force closed via ClientConn.Close"); _r$1 = cc.closeForError(err); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2ClientConn.ptr.prototype.Close }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.cc = cc; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; http2ClientConn.prototype.Close = function() { return this.$val.Close(); }; http2ClientConn.ptr.prototype.closeForLostPing = function() { var $24r, _r$1, cc, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; cc = $f.cc; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cc = this; err = errors.New("http2: client connection lost"); _r$1 = cc.closeForError(err); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2ClientConn.ptr.prototype.closeForLostPing }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.cc = cc; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; http2ClientConn.prototype.closeForLostPing = function() { return this.$val.closeForLostPing(); }; http2ClientConn.ptr.prototype.frameScratchBuffer = function() { var _i, _ref, buf, cc, i, size, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _ref = $f._ref; buf = $f.buf; cc = $f.cc; i = $f.i; size = $f.size; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cc = this; $r = cc.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } size = cc.maxFrameSize; if (size > 524288) { size = 524288; } _ref = cc.freeBuf; _i = 0; /* while (true) { */ case 2: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 3; continue; } i = _i; buf = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); /* */ if (buf.$length >= ((size >> 0))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (buf.$length >= ((size >> 0))) { */ case 4: (x$5 = cc.freeBuf, ((i < 0 || i >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + i] = sliceType$3.nil)); $r = cc.mu.Unlock(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $subslice(buf, 0, size); /* } */ case 5: _i++; $s = 2; continue; case 3: $r = cc.mu.Unlock(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $makeSlice(sliceType$3, size); /* */ } return; } if ($f === undefined) { $f = { $blk: http2ClientConn.ptr.prototype.frameScratchBuffer }; } $f._i = _i; $f._ref = _ref; $f.buf = buf; $f.cc = cc; $f.i = i; $f.size = size; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; http2ClientConn.prototype.frameScratchBuffer = function() { return this.$val.frameScratchBuffer(); }; http2ClientConn.ptr.prototype.putFrameScratchBuffer = function(buf) { var _i, _ref, buf, cc, i, old, x$5, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _ref = $f._ref; buf = $f.buf; cc = $f.cc; i = $f.i; old = $f.old; x$5 = $f.x$5; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); cc = this; $r = cc.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(cc.mu, "Unlock"), []]); /* */ if (cc.freeBuf.$length < 4) { $s = 2; continue; } /* */ $s = 3; continue; /* if (cc.freeBuf.$length < 4) { */ case 2: cc.freeBuf = $append(cc.freeBuf, buf); $s = 4; case 4: return; /* } */ case 3: _ref = cc.freeBuf; _i = 0; /* while (true) { */ case 5: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 6; continue; } i = _i; old = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); /* */ if (old === sliceType$3.nil) { $s = 7; continue; } /* */ $s = 8; continue; /* if (old === sliceType$3.nil) { */ case 7: (x$5 = cc.freeBuf, ((i < 0 || i >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + i] = buf)); $s = 9; case 9: return; /* } */ case 8: _i++; $s = 5; continue; case 6: $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2ClientConn.ptr.prototype.putFrameScratchBuffer }; } $f._i = _i; $f._ref = _ref; $f.buf = buf; $f.cc = cc; $f.i = i; $f.old = old; $f.x$5 = x$5; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2ClientConn.prototype.putFrameScratchBuffer = function(buf) { return this.$val.putFrameScratchBuffer(buf); }; http2commaSeparatedTrailers = function(req) { var $24r, _1, _entry, _i, _keys, _r$1, _r$2, _ref, k, keys, req, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _1 = $f._1; _entry = $f._entry; _i = $f._i; _keys = $f._keys; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; k = $f.k; keys = $f.keys; req = $f.req; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: keys = $makeSlice(sliceType$2, 0, $keys(req.Trailer).length); _ref = req.Trailer; _i = 0; _keys = $keys(_ref); /* while (true) { */ case 1: /* if (!(_i < _keys.length)) { break; } */ if(!(_i < _keys.length)) { $s = 2; continue; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; /* continue; */ $s = 1; continue; } k = _entry.k; _r$1 = CanonicalHeaderKey(k); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } k = _r$1; _1 = k; /* */ if (_1 === ("Transfer-Encoding") || _1 === ("Trailer") || _1 === ("Content-Length")) { $s = 5; continue; } /* */ $s = 6; continue; /* if (_1 === ("Transfer-Encoding") || _1 === ("Trailer") || _1 === ("Content-Length")) { */ case 5: _r$2 = fmt.Errorf("invalid Trailer key %q", new sliceType([new $String(k)])); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = ["", _r$2]; $s = 8; case 8: return $24r; /* } */ case 6: case 4: keys = $append(keys, k); _i++; $s = 1; continue; case 2: /* */ if (keys.$length > 0) { $s = 9; continue; } /* */ $s = 10; continue; /* if (keys.$length > 0) { */ case 9: $r = sort.Strings(keys); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return [strings.Join(keys, ","), $ifaceNil]; /* } */ case 10: $s = -1; return ["", $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: http2commaSeparatedTrailers }; } $f.$24r = $24r; $f._1 = _1; $f._entry = _entry; $f._i = _i; $f._keys = _keys; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f.k = k; $f.keys = keys; $f.req = req; $f.$s = $s; $f.$r = $r; return $f; }; http2ClientConn.ptr.prototype.responseHeaderTimeout = function() { var cc; cc = this; if (!(cc.t.t1 === ptrType$27.nil)) { return cc.t.t1.ResponseHeaderTimeout; } return new time.Duration(0, 0); }; http2ClientConn.prototype.responseHeaderTimeout = function() { return this.$val.responseHeaderTimeout(); }; http2checkConnHeaders = function(req) { var $24r, $24r$1, $24r$2, _entry, _entry$1, _entry$2, _r$1, _r$2, _r$3, _r$4, req, v, vv, vv$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _entry = $f._entry; _entry$1 = $f._entry$1; _entry$2 = $f._entry$2; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; req = $f.req; v = $f.v; vv = $f.vv; vv$1 = $f.vv$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = new Header(req.Header).Get("Upgrade"); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } v = _r$1; /* */ if (!(v === "")) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!(v === "")) { */ case 2: _r$2 = fmt.Errorf("http2: invalid Upgrade request header: %q", new sliceType([(_entry = req.Header[$String.keyFor("Upgrade")], _entry !== undefined ? _entry.v : sliceType$2.nil)])); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 5; case 5: return $24r; /* } */ case 3: vv = (_entry$1 = req.Header[$String.keyFor("Transfer-Encoding")], _entry$1 !== undefined ? _entry$1.v : sliceType$2.nil); /* */ if (vv.$length > 0 && (vv.$length > 1 || !((0 >= vv.$length ? ($throwRuntimeError("index out of range"), undefined) : vv.$array[vv.$offset + 0]) === "") && !((0 >= vv.$length ? ($throwRuntimeError("index out of range"), undefined) : vv.$array[vv.$offset + 0]) === "chunked"))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (vv.$length > 0 && (vv.$length > 1 || !((0 >= vv.$length ? ($throwRuntimeError("index out of range"), undefined) : vv.$array[vv.$offset + 0]) === "") && !((0 >= vv.$length ? ($throwRuntimeError("index out of range"), undefined) : vv.$array[vv.$offset + 0]) === "chunked"))) { */ case 6: _r$3 = fmt.Errorf("http2: invalid Transfer-Encoding request header: %q", new sliceType([vv])); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r$1 = _r$3; $s = 9; case 9: return $24r$1; /* } */ case 7: vv$1 = (_entry$2 = req.Header[$String.keyFor("Connection")], _entry$2 !== undefined ? _entry$2.v : sliceType$2.nil); /* */ if (vv$1.$length > 0 && (vv$1.$length > 1 || !((0 >= vv$1.$length ? ($throwRuntimeError("index out of range"), undefined) : vv$1.$array[vv$1.$offset + 0]) === "") && !http2asciiEqualFold((0 >= vv$1.$length ? ($throwRuntimeError("index out of range"), undefined) : vv$1.$array[vv$1.$offset + 0]), "close") && !http2asciiEqualFold((0 >= vv$1.$length ? ($throwRuntimeError("index out of range"), undefined) : vv$1.$array[vv$1.$offset + 0]), "keep-alive"))) { $s = 10; continue; } /* */ $s = 11; continue; /* if (vv$1.$length > 0 && (vv$1.$length > 1 || !((0 >= vv$1.$length ? ($throwRuntimeError("index out of range"), undefined) : vv$1.$array[vv$1.$offset + 0]) === "") && !http2asciiEqualFold((0 >= vv$1.$length ? ($throwRuntimeError("index out of range"), undefined) : vv$1.$array[vv$1.$offset + 0]), "close") && !http2asciiEqualFold((0 >= vv$1.$length ? ($throwRuntimeError("index out of range"), undefined) : vv$1.$array[vv$1.$offset + 0]), "keep-alive"))) { */ case 10: _r$4 = fmt.Errorf("http2: invalid Connection request header: %q", new sliceType([vv$1])); /* */ $s = 12; case 12: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r$2 = _r$4; $s = 13; case 13: return $24r$2; /* } */ case 11: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2checkConnHeaders }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._entry = _entry; $f._entry$1 = _entry$1; $f._entry$2 = _entry$2; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.req = req; $f.v = v; $f.vv = vv; $f.vv$1 = vv$1; $f.$s = $s; $f.$r = $r; return $f; }; http2actualContentLength = function(req) { var req, x$5; if ($interfaceIsEqual(req.Body, $ifaceNil) || $interfaceIsEqual(req.Body, new $pkg.NoBody.constructor.elem($pkg.NoBody))) { return new $Int64(0, 0); } if (!((x$5 = req.ContentLength, (x$5.$high === 0 && x$5.$low === 0)))) { return req.ContentLength; } return new $Int64(-1, 4294967295); }; http2ClientConn.ptr.prototype.RoundTrip = function(req) { var _r$1, _tuple, cc, err, req, resp, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; cc = $f.cc; err = $f.err; req = $f.req; resp = $f.resp; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cc = this; _r$1 = cc.roundTrip(req); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; resp = _tuple[0]; err = _tuple[2]; $s = -1; return [resp, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: http2ClientConn.ptr.prototype.RoundTrip }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.cc = cc; $f.err = err; $f.req = req; $f.resp = resp; $f.$s = $s; $f.$r = $r; return $f; }; http2ClientConn.prototype.RoundTrip = function(req) { return this.$val.RoundTrip(req); }; http2ClientConn.ptr.prototype.roundTrip = function(req) { var $24r, $24r$1, $24r$10, $24r$11, $24r$2, $24r$3, $24r$4, $24r$5, $24r$6, $24r$7, $24r$8, $24r$9, _r$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$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _selection, _selection$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$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _v, _v$1, body$1, bodyWriter, bodyWritten, cc, contentLen, cs, ctx, d, d$1, endStream, err, err$1, err$2, err$3, gotErrAfterReqBodyWrite, handleReadLoopResponse, hasBody, hasTrailers, hdrs, re, re$1, readLoopResCh, req, requestedGzip, res, respHeaderTimer, timer, timer$1, trailers, werr, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$10 = $f.$24r$10; $24r$11 = $f.$24r$11; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; $24r$6 = $f.$24r$6; $24r$7 = $f.$24r$7; $24r$8 = $f.$24r$8; $24r$9 = $f.$24r$9; _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$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$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; _selection = $f._selection; _selection$1 = $f._selection$1; _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$4 = $f._tmp$4; _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 = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _v = $f._v; _v$1 = $f._v$1; body$1 = $f.body$1; bodyWriter = $f.bodyWriter; bodyWritten = $f.bodyWritten; cc = $f.cc; contentLen = $f.contentLen; cs = $f.cs; ctx = $f.ctx; d = $f.d; d$1 = $f.d$1; endStream = $f.endStream; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; gotErrAfterReqBodyWrite = $f.gotErrAfterReqBodyWrite; handleReadLoopResponse = $f.handleReadLoopResponse; hasBody = $f.hasBody; hasTrailers = $f.hasTrailers; hdrs = $f.hdrs; re = $f.re; re$1 = $f.re$1; readLoopResCh = $f.readLoopResCh; req = $f.req; requestedGzip = $f.requestedGzip; res = $f.res; respHeaderTimer = $f.respHeaderTimer; timer = $f.timer; timer$1 = $f.timer$1; trailers = $f.trailers; werr = $f.werr; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); bodyWriter = [bodyWriter]; bodyWritten = [bodyWritten]; cc = [cc]; cs = [cs]; hasBody = [hasBody]; req = [req]; res = ptrType$18.nil; gotErrAfterReqBodyWrite = false; err = $ifaceNil; cc[0] = this; _r$1 = http2checkConnHeaders(req[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err$1 = _r$1; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 2: _tmp = ptrType$18.nil; _tmp$1 = false; _tmp$2 = err$1; res = _tmp; gotErrAfterReqBodyWrite = _tmp$1; err = _tmp$2; $24r = [res, gotErrAfterReqBodyWrite, err]; $s = 4; case 4: return $24r; /* } */ case 3: if (!(cc[0].idleTimer === ptrType$25.nil)) { cc[0].idleTimer.Stop(); } _r$2 = http2commaSeparatedTrailers(req[0]); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; trailers = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 6: _tmp$3 = ptrType$18.nil; _tmp$4 = false; _tmp$5 = err; res = _tmp$3; gotErrAfterReqBodyWrite = _tmp$4; err = _tmp$5; $24r$1 = [res, gotErrAfterReqBodyWrite, err]; $s = 8; case 8: return $24r$1; /* } */ case 7: hasTrailers = !(trailers === ""); $r = cc[0].mu.Lock(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$3 = cc[0].awaitOpenSlotForRequest(req[0]); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } err$2 = _r$3; /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 11; continue; } /* */ $s = 12; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 11: $r = cc[0].mu.Unlock(); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp$6 = ptrType$18.nil; _tmp$7 = false; _tmp$8 = err$2; res = _tmp$6; gotErrAfterReqBodyWrite = _tmp$7; err = _tmp$8; $24r$2 = [res, gotErrAfterReqBodyWrite, err]; $s = 14; case 14: return $24r$2; /* } */ case 12: body$1 = req[0].Body; contentLen = http2actualContentLength(req[0]); hasBody[0] = !((contentLen.$high === 0 && contentLen.$low === 0)); requestedGzip = false; if (!(!cc[0].t.disableCompression())) { _v$1 = false; $s = 18; continue s; } _r$4 = new Header(req[0].Header).Get("Accept-Encoding"); /* */ $s = 19; case 19: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _v$1 = _r$4 === ""; case 18: if (!(_v$1)) { _v = false; $s = 17; continue s; } _r$5 = new Header(req[0].Header).Get("Range"); /* */ $s = 20; case 20: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _v = _r$5 === ""; case 17: /* */ if (_v && !(req[0].Method === "HEAD")) { $s = 15; continue; } /* */ $s = 16; continue; /* if (_v && !(req[0].Method === "HEAD")) { */ case 15: requestedGzip = true; /* } */ case 16: _r$6 = cc[0].encodeHeaders(req[0], requestedGzip, trailers, contentLen); /* */ $s = 21; case 21: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tuple$1 = _r$6; hdrs = _tuple$1[0]; err = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 22; continue; } /* */ $s = 23; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 22: $r = cc[0].mu.Unlock(); /* */ $s = 24; case 24: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp$9 = ptrType$18.nil; _tmp$10 = false; _tmp$11 = err; res = _tmp$9; gotErrAfterReqBodyWrite = _tmp$10; err = _tmp$11; $24r$3 = [res, gotErrAfterReqBodyWrite, err]; $s = 25; case 25: return $24r$3; /* } */ case 23: cs[0] = cc[0].newStream(); cs[0].req = req[0]; _r$7 = httptrace.ContextClientTrace(req[0].Context()); /* */ $s = 26; case 26: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } cs[0].trace = _r$7; cs[0].requestedGzip = requestedGzip; _r$8 = cc[0].t.getBodyWriterState(cs[0], body$1); /* */ $s = 27; case 27: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } bodyWriter[0] = $clone(_r$8, http2bodyWriterState); cs[0].on100 = $methodVal($clone(bodyWriter[0], http2bodyWriterState), "on100"); $deferred.push([(function(bodyWriter, bodyWritten, cc, cs, hasBody, req) { return function $b() { var _r$9, werr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$9 = $f._r$9; werr = $f.werr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = cc[0].wmu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } werr = cc[0].werr; $r = cc[0].wmu.Unlock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!($interfaceIsEqual(werr, $ifaceNil))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!($interfaceIsEqual(werr, $ifaceNil))) { */ case 3: _r$9 = cc[0].Close(); /* */ $s = 5; case 5: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$9; /* } */ case 4: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$9 = _r$9; $f.werr = werr; $f.$s = $s; $f.$r = $r; return $f; }; })(bodyWriter, bodyWritten, cc, cs, hasBody, req), []]); $r = cc[0].wmu.Lock(); /* */ $s = 28; case 28: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } endStream = !hasBody[0] && !hasTrailers; _r$9 = cc[0].writeHeaders(cs[0].ID, endStream, ((cc[0].maxFrameSize >> 0)), hdrs); /* */ $s = 29; case 29: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } werr = _r$9; $r = cc[0].wmu.Unlock(); /* */ $s = 30; case 30: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = http2traceWroteHeaders(cs[0].trace); /* */ $s = 31; case 31: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = cc[0].mu.Unlock(); /* */ $s = 32; case 32: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!($interfaceIsEqual(werr, $ifaceNil))) { $s = 33; continue; } /* */ $s = 34; continue; /* if (!($interfaceIsEqual(werr, $ifaceNil))) { */ case 33: /* */ if (hasBody[0]) { $s = 35; continue; } /* */ $s = 36; continue; /* if (hasBody[0]) { */ case 35: _r$10 = req[0].Body.Close(); /* */ $s = 37; case 37: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; $r = $clone(bodyWriter[0], http2bodyWriterState).cancel(); /* */ $s = 38; case 38: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 36: $r = cc[0].forgetStreamID(cs[0].ID); /* */ $s = 39; case 39: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = http2traceWroteRequest(cs[0].trace, werr); /* */ $s = 40; case 40: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp$12 = ptrType$18.nil; _tmp$13 = false; _tmp$14 = werr; res = _tmp$12; gotErrAfterReqBodyWrite = _tmp$13; err = _tmp$14; $24r$4 = [res, gotErrAfterReqBodyWrite, err]; $s = 41; case 41: return $24r$4; /* } */ case 34: respHeaderTimer = $chanNil; /* */ if (hasBody[0]) { $s = 42; continue; } /* */ $s = 43; continue; /* if (hasBody[0]) { */ case 42: $r = $clone(bodyWriter[0], http2bodyWriterState).scheduleBodyWrite(); /* */ $s = 45; case 45: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 44; continue; /* } else { */ case 43: $r = http2traceWroteRequest(cs[0].trace, $ifaceNil); /* */ $s = 46; case 46: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } d = cc[0].responseHeaderTimeout(); /* */ if (!((d.$high === 0 && d.$low === 0))) { $s = 47; continue; } /* */ $s = 48; continue; /* if (!((d.$high === 0 && d.$low === 0))) { */ case 47: _r$11 = time.NewTimer(d); /* */ $s = 49; case 49: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } timer = _r$11; $deferred.push([$methodVal(timer, "Stop"), []]); respHeaderTimer = timer.C; /* } */ case 48: /* } */ case 44: readLoopResCh = cs[0].resc; bodyWritten[0] = false; ctx = req[0].Context(); handleReadLoopResponse = (function(bodyWriter, bodyWritten, cc, cs, hasBody, req) { return function $b(re) { var $24r$5, _r$12, _r$13, re, res$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r$5 = $f.$24r$5; _r$12 = $f._r$12; _r$13 = $f._r$13; re = $f.re; res$1 = $f.res$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: res$1 = re.res; /* */ if (!($interfaceIsEqual(re.err, $ifaceNil)) || res$1.StatusCode > 299) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(re.err, $ifaceNil)) || res$1.StatusCode > 299) { */ case 1: $r = $clone(bodyWriter[0], http2bodyWriterState).cancel(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = cs[0].abortRequestBodyWrite(http2errStopReqBodyWrite); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (hasBody[0] && !bodyWritten[0]) { $s = 5; continue; } /* */ $s = 6; continue; /* if (hasBody[0] && !bodyWritten[0]) { */ case 5: _r$12 = $recv(bodyWriter[0].resc); /* */ $s = 7; case 7: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _r$12[0]; /* } */ case 6: /* } */ case 2: /* */ if (!($interfaceIsEqual(re.err, $ifaceNil))) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!($interfaceIsEqual(re.err, $ifaceNil))) { */ case 8: $r = cc[0].forgetStreamID(cs[0].ID); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$13 = cs[0].getStartedWrite(); /* */ $s = 11; case 11: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } $24r$5 = [ptrType$18.nil, _r$13, re.err]; $s = 12; case 12: return $24r$5; /* } */ case 9: res$1.Request = req[0]; res$1.TLS = cc[0].tlsState; $s = -1; return [res$1, false, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$24r$5 = $24r$5; $f._r$12 = _r$12; $f._r$13 = _r$13; $f.re = re; $f.res$1 = res$1; $f.$s = $s; $f.$r = $r; return $f; }; })(bodyWriter, bodyWritten, cc, cs, hasBody, req); /* while (true) { */ case 50: _r$12 = ctx.Done(); /* */ $s = 52; case 52: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _r$13 = $select([[readLoopResCh], [respHeaderTimer], [_r$12], [req[0].Cancel], [cs[0].peerReset], [bodyWriter[0].resc]]); /* */ $s = 53; case 53: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _selection = _r$13; /* */ if (_selection[0] === 0) { $s = 54; continue; } /* */ if (_selection[0] === 1) { $s = 55; continue; } /* */ if (_selection[0] === 2) { $s = 56; continue; } /* */ if (_selection[0] === 3) { $s = 57; continue; } /* */ if (_selection[0] === 4) { $s = 58; continue; } /* */ if (_selection[0] === 5) { $s = 59; continue; } /* */ $s = 60; continue; /* if (_selection[0] === 0) { */ case 54: re = $clone(_selection[1][0], http2resAndError); _r$14 = handleReadLoopResponse($clone(re, http2resAndError)); /* */ $s = 61; case 61: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _tuple$2 = _r$14; res = _tuple$2[0]; gotErrAfterReqBodyWrite = _tuple$2[1]; err = _tuple$2[2]; $24r$5 = [res, gotErrAfterReqBodyWrite, err]; $s = 62; case 62: return $24r$5; /* } else if (_selection[0] === 1) { */ case 55: /* */ if (!hasBody[0] || bodyWritten[0]) { $s = 63; continue; } /* */ $s = 64; continue; /* if (!hasBody[0] || bodyWritten[0]) { */ case 63: $r = cc[0].writeStreamReset(cs[0].ID, 8, $ifaceNil); /* */ $s = 66; case 66: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 65; continue; /* } else { */ case 64: $r = $clone(bodyWriter[0], http2bodyWriterState).cancel(); /* */ $s = 67; case 67: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = cs[0].abortRequestBodyWrite(http2errStopReqBodyWriteAndCancel); /* */ $s = 68; case 68: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$15 = $recv(bodyWriter[0].resc); /* */ $s = 69; case 69: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _r$15[0]; /* } */ case 65: $r = cc[0].forgetStreamID(cs[0].ID); /* */ $s = 70; case 70: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp$15 = ptrType$18.nil; _r$16 = cs[0].getStartedWrite(); /* */ $s = 71; case 71: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _tmp$16 = _r$16; _tmp$17 = http2errTimeout; res = _tmp$15; gotErrAfterReqBodyWrite = _tmp$16; err = _tmp$17; $24r$6 = [res, gotErrAfterReqBodyWrite, err]; $s = 72; case 72: return $24r$6; /* } else if (_selection[0] === 2) { */ case 56: /* */ if (!hasBody[0] || bodyWritten[0]) { $s = 73; continue; } /* */ $s = 74; continue; /* if (!hasBody[0] || bodyWritten[0]) { */ case 73: $r = cc[0].writeStreamReset(cs[0].ID, 8, $ifaceNil); /* */ $s = 76; case 76: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 75; continue; /* } else { */ case 74: $r = $clone(bodyWriter[0], http2bodyWriterState).cancel(); /* */ $s = 77; case 77: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = cs[0].abortRequestBodyWrite(http2errStopReqBodyWriteAndCancel); /* */ $s = 78; case 78: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$17 = $recv(bodyWriter[0].resc); /* */ $s = 79; case 79: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } _r$17[0]; /* } */ case 75: $r = cc[0].forgetStreamID(cs[0].ID); /* */ $s = 80; case 80: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp$18 = ptrType$18.nil; _r$18 = cs[0].getStartedWrite(); /* */ $s = 81; case 81: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } _tmp$19 = _r$18; _r$19 = ctx.Err(); /* */ $s = 82; case 82: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } _tmp$20 = _r$19; res = _tmp$18; gotErrAfterReqBodyWrite = _tmp$19; err = _tmp$20; $24r$7 = [res, gotErrAfterReqBodyWrite, err]; $s = 83; case 83: return $24r$7; /* } else if (_selection[0] === 3) { */ case 57: /* */ if (!hasBody[0] || bodyWritten[0]) { $s = 84; continue; } /* */ $s = 85; continue; /* if (!hasBody[0] || bodyWritten[0]) { */ case 84: $r = cc[0].writeStreamReset(cs[0].ID, 8, $ifaceNil); /* */ $s = 87; case 87: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 86; continue; /* } else { */ case 85: $r = $clone(bodyWriter[0], http2bodyWriterState).cancel(); /* */ $s = 88; case 88: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = cs[0].abortRequestBodyWrite(http2errStopReqBodyWriteAndCancel); /* */ $s = 89; case 89: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$20 = $recv(bodyWriter[0].resc); /* */ $s = 90; case 90: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } _r$20[0]; /* } */ case 86: $r = cc[0].forgetStreamID(cs[0].ID); /* */ $s = 91; case 91: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp$21 = ptrType$18.nil; _r$21 = cs[0].getStartedWrite(); /* */ $s = 92; case 92: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } _tmp$22 = _r$21; _tmp$23 = http2errRequestCanceled; res = _tmp$21; gotErrAfterReqBodyWrite = _tmp$22; err = _tmp$23; $24r$8 = [res, gotErrAfterReqBodyWrite, err]; $s = 93; case 93: return $24r$8; /* } else if (_selection[0] === 4) { */ case 58: _tmp$24 = ptrType$18.nil; _r$22 = cs[0].getStartedWrite(); /* */ $s = 94; case 94: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; } _tmp$25 = _r$22; _tmp$26 = cs[0].resetErr; res = _tmp$24; gotErrAfterReqBodyWrite = _tmp$25; err = _tmp$26; $24r$9 = [res, gotErrAfterReqBodyWrite, err]; $s = 95; case 95: return $24r$9; /* } else if (_selection[0] === 5) { */ case 59: err$3 = _selection[1][0]; bodyWritten[0] = true; _selection$1 = $select([[readLoopResCh], []]); /* */ if (_selection$1[0] === 0) { $s = 96; continue; } /* */ if (_selection$1[0] === 1) { $s = 97; continue; } /* */ $s = 98; continue; /* if (_selection$1[0] === 0) { */ case 96: re$1 = $clone(_selection$1[1][0], http2resAndError); _r$23 = handleReadLoopResponse($clone(re$1, http2resAndError)); /* */ $s = 99; case 99: if($c) { $c = false; _r$23 = _r$23.$blk(); } if (_r$23 && _r$23.$blk !== undefined) { break s; } _tuple$3 = _r$23; res = _tuple$3[0]; gotErrAfterReqBodyWrite = _tuple$3[1]; err = _tuple$3[2]; $24r$10 = [res, gotErrAfterReqBodyWrite, err]; $s = 100; case 100: return $24r$10; /* } else if (_selection$1[0] === 1) { */ case 97: /* } */ case 98: /* */ if (!($interfaceIsEqual(err$3, $ifaceNil))) { $s = 101; continue; } /* */ $s = 102; continue; /* if (!($interfaceIsEqual(err$3, $ifaceNil))) { */ case 101: $r = cc[0].forgetStreamID(cs[0].ID); /* */ $s = 103; case 103: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp$27 = ptrType$18.nil; _r$24 = cs[0].getStartedWrite(); /* */ $s = 104; case 104: if($c) { $c = false; _r$24 = _r$24.$blk(); } if (_r$24 && _r$24.$blk !== undefined) { break s; } _tmp$28 = _r$24; _tmp$29 = err$3; res = _tmp$27; gotErrAfterReqBodyWrite = _tmp$28; err = _tmp$29; $24r$11 = [res, gotErrAfterReqBodyWrite, err]; $s = 105; case 105: return $24r$11; /* } */ case 102: d$1 = cc[0].responseHeaderTimeout(); /* */ if (!((d$1.$high === 0 && d$1.$low === 0))) { $s = 106; continue; } /* */ $s = 107; continue; /* if (!((d$1.$high === 0 && d$1.$low === 0))) { */ case 106: _r$25 = time.NewTimer(d$1); /* */ $s = 108; case 108: if($c) { $c = false; _r$25 = _r$25.$blk(); } if (_r$25 && _r$25.$blk !== undefined) { break s; } timer$1 = _r$25; $deferred.push([$methodVal(timer$1, "Stop"), []]); respHeaderTimer = timer$1.C; /* } */ case 107: /* } */ case 60: $s = 50; continue; case 51: $s = -1; return [res, gotErrAfterReqBodyWrite, err]; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [res, gotErrAfterReqBodyWrite, err]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2ClientConn.ptr.prototype.roundTrip }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$10 = $24r$10; $f.$24r$11 = $24r$11; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f.$24r$6 = $24r$6; $f.$24r$7 = $24r$7; $f.$24r$8 = $24r$8; $f.$24r$9 = $24r$9; $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$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$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._selection = _selection; $f._selection$1 = _selection$1; $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$4 = _tmp$4; $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 = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._v = _v; $f._v$1 = _v$1; $f.body$1 = body$1; $f.bodyWriter = bodyWriter; $f.bodyWritten = bodyWritten; $f.cc = cc; $f.contentLen = contentLen; $f.cs = cs; $f.ctx = ctx; $f.d = d; $f.d$1 = d$1; $f.endStream = endStream; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.gotErrAfterReqBodyWrite = gotErrAfterReqBodyWrite; $f.handleReadLoopResponse = handleReadLoopResponse; $f.hasBody = hasBody; $f.hasTrailers = hasTrailers; $f.hdrs = hdrs; $f.re = re; $f.re$1 = re$1; $f.readLoopResCh = readLoopResCh; $f.req = req; $f.requestedGzip = requestedGzip; $f.res = res; $f.respHeaderTimer = respHeaderTimer; $f.timer = timer; $f.timer$1 = timer$1; $f.trailers = trailers; $f.werr = werr; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2ClientConn.prototype.roundTrip = function(req) { return this.$val.roundTrip(req); }; http2ClientConn.ptr.prototype.awaitOpenSlotForRequest = function(req) { var _r$1, _r$2, _v, cc, req, waitingForConn, waitingForConnErr, x$5, x$6, x$7, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _v = $f._v; cc = $f.cc; req = $f.req; waitingForConn = $f.waitingForConn; waitingForConnErr = $f.waitingForConnErr; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cc = [cc]; req = [req]; waitingForConn = [waitingForConn]; waitingForConnErr = [waitingForConnErr]; cc[0] = this; waitingForConn[0] = $chanNil; waitingForConnErr[0] = $ifaceNil; /* while (true) { */ case 1: _r$1 = time.Now(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } time.Time.copy(cc[0].lastActive, _r$1); if (cc[0].closed) { _v = true; $s = 6; continue s; } _r$2 = cc[0].canTakeNewRequestLocked(); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _v = !_r$2; case 6: /* */ if (_v) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_v) { */ case 4: if (!(waitingForConn[0] === $chanNil)) { $close(waitingForConn[0]); } $s = -1; return http2errClientConnUnusable; /* } */ case 5: time.Time.copy(cc[0].lastIdle, new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil)); if ((x$5 = (x$6 = (new $Int64(0, $keys(cc[0].streams).length)), new $Int64(x$6.$high + 0, x$6.$low + 1)), x$7 = (new $Int64(0, cc[0].maxConcurrentStreams)), (x$5.$high < x$7.$high || (x$5.$high === x$7.$high && x$5.$low <= x$7.$low)))) { if (!(waitingForConn[0] === $chanNil)) { $close(waitingForConn[0]); } $s = -1; return $ifaceNil; } /* */ if (waitingForConn[0] === $chanNil) { $s = 8; continue; } /* */ $s = 9; continue; /* if (waitingForConn[0] === $chanNil) { */ case 8: waitingForConn[0] = new $Chan(structType, 0); $go((function(cc, req, waitingForConn, waitingForConnErr) { return function $b() { var _r$3, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$3 = $f._r$3; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$3 = http2awaitRequestCancel(req[0], waitingForConn[0]); /* */ $s = 1; case 1: 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 = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $r = cc[0].mu.Lock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } waitingForConnErr[0] = err; $r = cc[0].cond.Broadcast(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = cc[0].mu.Unlock(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$3 = _r$3; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; })(cc, req, waitingForConn, waitingForConnErr), []); /* } */ case 9: cc[0].pendingRequests = cc[0].pendingRequests + (1) >> 0; $r = cc[0].cond.Wait(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } cc[0].pendingRequests = cc[0].pendingRequests - (1) >> 0; if (!($interfaceIsEqual(waitingForConnErr[0], $ifaceNil))) { $s = -1; return waitingForConnErr[0]; } $s = 1; continue; case 2: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2ClientConn.ptr.prototype.awaitOpenSlotForRequest }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._v = _v; $f.cc = cc; $f.req = req; $f.waitingForConn = waitingForConn; $f.waitingForConnErr = waitingForConnErr; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.$s = $s; $f.$r = $r; return $f; }; http2ClientConn.prototype.awaitOpenSlotForRequest = function(req) { return this.$val.awaitOpenSlotForRequest(req); }; http2ClientConn.ptr.prototype.writeHeaders = function(streamID, endStream, maxFrameSize, hdrs) { var _r$1, _r$2, _r$3, cc, chunk, endHeaders, endStream, first, hdrs, maxFrameSize, streamID, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; cc = $f.cc; chunk = $f.chunk; endHeaders = $f.endHeaders; endStream = $f.endStream; first = $f.first; hdrs = $f.hdrs; maxFrameSize = $f.maxFrameSize; streamID = $f.streamID; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cc = this; first = true; /* while (true) { */ case 1: /* if (!(hdrs.$length > 0 && $interfaceIsEqual(cc.werr, $ifaceNil))) { break; } */ if(!(hdrs.$length > 0 && $interfaceIsEqual(cc.werr, $ifaceNil))) { $s = 2; continue; } chunk = hdrs; if (chunk.$length > maxFrameSize) { chunk = $subslice(chunk, 0, maxFrameSize); } hdrs = $subslice(hdrs, chunk.$length); endHeaders = hdrs.$length === 0; /* */ if (first) { $s = 3; continue; } /* */ $s = 4; continue; /* if (first) { */ case 3: _r$1 = cc.fr.WriteHeaders(new http2HeadersFrameParam.ptr(streamID, chunk, endStream, endHeaders, 0, new http2PriorityParam.ptr(0, false, 0))); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; first = false; $s = 5; continue; /* } else { */ case 4: _r$2 = cc.fr.WriteContinuation(streamID, endHeaders, chunk); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; /* } */ case 5: $s = 1; continue; case 2: _r$3 = cc.bw.Flush(); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $s = -1; return cc.werr; /* */ } return; } if ($f === undefined) { $f = { $blk: http2ClientConn.ptr.prototype.writeHeaders }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.cc = cc; $f.chunk = chunk; $f.endHeaders = endHeaders; $f.endStream = endStream; $f.first = first; $f.hdrs = hdrs; $f.maxFrameSize = maxFrameSize; $f.streamID = streamID; $f.$s = $s; $f.$r = $r; return $f; }; http2ClientConn.prototype.writeHeaders = function(streamID, endStream, maxFrameSize, hdrs) { return this.$val.writeHeaders(streamID, endStream, maxFrameSize, hdrs); }; http2clientStream.ptr.prototype.writeRequestBody = function(body$1, bodyCloser) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, $24r$5, $24r$6, $24r$7, $24r$8, _r$1, _r$10, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, _tuple$2, _tuple$3, allowed, body$1, bodyCloser, buf, cc, cs, data, err, err$1, ferr, hasContentLen, hasTrailers, maxFrameSize, n, n1, remain, remainLen, req, sawEOF, sentEnd, trls, x$5, x$6, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; $24r$6 = $f.$24r$6; $24r$7 = $f.$24r$7; $24r$8 = $f.$24r$8; _r$1 = $f._r$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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; allowed = $f.allowed; body$1 = $f.body$1; bodyCloser = $f.bodyCloser; buf = $f.buf; cc = $f.cc; cs = $f.cs; data = $f.data; err = $f.err; err$1 = $f.err$1; ferr = $f.ferr; hasContentLen = $f.hasContentLen; hasTrailers = $f.hasTrailers; maxFrameSize = $f.maxFrameSize; n = $f.n; n1 = $f.n1; remain = $f.remain; remainLen = $f.remainLen; req = $f.req; sawEOF = $f.sawEOF; sentEnd = $f.sentEnd; trls = $f.trls; x$5 = $f.x$5; x$6 = $f.x$6; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); bodyCloser = [bodyCloser]; cs = [cs]; err = [err]; err[0] = $ifaceNil; cs[0] = this; cc = cs[0].cc; sentEnd = false; _r$1 = cc.frameScratchBuffer(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } buf = _r$1; $deferred.push([$methodVal(cc, "putFrameScratchBuffer"), [buf]]); $deferred.push([(function(bodyCloser, cs, err) { return function $b() { var _r$2, cerr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$2 = $f._r$2; cerr = $f.cerr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = http2traceWroteRequest(cs[0].trace, err[0]); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$2 = bodyCloser[0].Close(); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } cerr = _r$2; if ($interfaceIsEqual(err[0], $ifaceNil)) { err[0] = cerr; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$2 = _r$2; $f.cerr = cerr; $f.$s = $s; $f.$r = $r; return $f; }; })(bodyCloser, cs, err), []]); req = cs[0].req; hasTrailers = !(req.Trailer === false); remainLen = http2actualContentLength(req); hasContentLen = !((remainLen.$high === -1 && remainLen.$low === 4294967295)); sawEOF = false; /* while (true) { */ case 2: /* if (!(!sawEOF)) { break; } */ if(!(!sawEOF)) { $s = 3; continue; } _r$2 = body$1.Read($subslice(buf, 0, (buf.$length - 1 >> 0))); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; n = _tuple[0]; err$1 = _tuple[1]; /* */ if (hasContentLen) { $s = 5; continue; } /* */ $s = 6; continue; /* if (hasContentLen) { */ case 5: remainLen = (x$5 = (new $Int64(0, n)), new $Int64(remainLen.$high - x$5.$high, remainLen.$low - x$5.$low)); /* */ if ((remainLen.$high === 0 && remainLen.$low === 0) && $interfaceIsEqual(err$1, $ifaceNil)) { $s = 7; continue; } /* */ $s = 8; continue; /* if ((remainLen.$high === 0 && remainLen.$low === 0) && $interfaceIsEqual(err$1, $ifaceNil)) { */ case 7: n1 = 0; _r$3 = body$1.Read($subslice(buf, n)); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$1 = _r$3; n1 = _tuple$1[0]; err$1 = _tuple$1[1]; remainLen = (x$6 = (new $Int64(0, n1)), new $Int64(remainLen.$high - x$6.$high, remainLen.$low - x$6.$low)); /* } */ case 8: /* */ if ((remainLen.$high < 0 || (remainLen.$high === 0 && remainLen.$low < 0))) { $s = 10; continue; } /* */ $s = 11; continue; /* if ((remainLen.$high < 0 || (remainLen.$high === 0 && remainLen.$low < 0))) { */ case 10: err$1 = http2errReqBodyTooLong; $r = cc.writeStreamReset(cs[0].ID, 8, err$1); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } err[0] = err$1; $24r = err[0]; $s = 13; case 13: return $24r; /* } */ case 11: /* } */ case 6: /* */ if ($interfaceIsEqual(err$1, io.EOF)) { $s = 14; continue; } /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 15; continue; } /* */ $s = 16; continue; /* if ($interfaceIsEqual(err$1, io.EOF)) { */ case 14: sawEOF = true; err$1 = $ifaceNil; $s = 16; continue; /* } else if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 15: $r = cc.writeStreamReset(cs[0].ID, 8, err$1); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } err[0] = err$1; $24r$1 = err[0]; $s = 18; case 18: return $24r$1; /* } */ case 16: remain = $subslice(buf, 0, n); /* while (true) { */ case 19: /* if (!(remain.$length > 0 && $interfaceIsEqual(err$1, $ifaceNil))) { break; } */ if(!(remain.$length > 0 && $interfaceIsEqual(err$1, $ifaceNil))) { $s = 20; continue; } allowed = 0; _r$4 = cs[0].awaitFlowControl(remain.$length); /* */ $s = 21; case 21: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$2 = _r$4; allowed = _tuple$2[0]; err$1 = _tuple$2[1]; /* */ if ($interfaceIsEqual(err$1, http2errStopReqBodyWrite)) { $s = 23; continue; } /* */ if ($interfaceIsEqual(err$1, http2errStopReqBodyWriteAndCancel)) { $s = 24; continue; } /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 25; continue; } /* */ $s = 26; continue; /* if ($interfaceIsEqual(err$1, http2errStopReqBodyWrite)) { */ case 23: err[0] = err$1; $24r$2 = err[0]; $s = 27; case 27: return $24r$2; /* } else if ($interfaceIsEqual(err$1, http2errStopReqBodyWriteAndCancel)) { */ case 24: $r = cc.writeStreamReset(cs[0].ID, 8, $ifaceNil); /* */ $s = 28; case 28: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } err[0] = err$1; $24r$3 = err[0]; $s = 29; case 29: return $24r$3; /* } else if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 25: err[0] = err$1; $24r$4 = err[0]; $s = 30; case 30: return $24r$4; /* } */ case 26: case 22: $r = cc.wmu.Lock(); /* */ $s = 31; case 31: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } data = $subslice(remain, 0, allowed); remain = $subslice(remain, allowed); sentEnd = sawEOF && (remain.$length === 0) && !hasTrailers; _r$5 = cc.fr.WriteData(cs[0].ID, sentEnd, data); /* */ $s = 32; case 32: 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 = 33; continue; } /* */ $s = 34; continue; /* if ($interfaceIsEqual(err$1, $ifaceNil)) { */ case 33: _r$6 = cc.bw.Flush(); /* */ $s = 35; case 35: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } err$1 = _r$6; /* } */ case 34: $r = cc.wmu.Unlock(); /* */ $s = 36; case 36: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 19; continue; case 20: /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 37; continue; } /* */ $s = 38; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 37: err[0] = err$1; $24r$5 = err[0]; $s = 39; case 39: return $24r$5; /* } */ case 38: $s = 2; continue; case 3: /* */ if (sentEnd) { $s = 40; continue; } /* */ $s = 41; continue; /* if (sentEnd) { */ case 40: err[0] = $ifaceNil; $24r$6 = err[0]; $s = 42; case 42: return $24r$6; /* } */ case 41: trls = sliceType$3.nil; /* */ if (hasTrailers) { $s = 43; continue; } /* */ $s = 44; continue; /* if (hasTrailers) { */ case 43: $r = cc.mu.Lock(); /* */ $s = 45; case 45: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$7 = cc.encodeTrailers(req); /* */ $s = 46; case 46: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _tuple$3 = _r$7; trls = _tuple$3[0]; err[0] = _tuple$3[1]; $r = cc.mu.Unlock(); /* */ $s = 47; case 47: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!($interfaceIsEqual(err[0], $ifaceNil))) { $s = 48; continue; } /* */ $s = 49; continue; /* if (!($interfaceIsEqual(err[0], $ifaceNil))) { */ case 48: $r = cc.writeStreamReset(cs[0].ID, 2, err[0]); /* */ $s = 50; case 50: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = cc.forgetStreamID(cs[0].ID); /* */ $s = 51; case 51: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } err[0] = err[0]; $24r$7 = err[0]; $s = 52; case 52: return $24r$7; /* } */ case 49: /* } */ case 44: $r = cc.mu.Lock(); /* */ $s = 53; case 53: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } maxFrameSize = ((cc.maxFrameSize >> 0)); $r = cc.mu.Unlock(); /* */ $s = 54; case 54: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = cc.wmu.Lock(); /* */ $s = 55; case 55: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(cc.wmu, "Unlock"), []]); /* */ if (trls.$length > 0) { $s = 56; continue; } /* */ $s = 57; continue; /* if (trls.$length > 0) { */ case 56: _r$8 = cc.writeHeaders(cs[0].ID, true, maxFrameSize, trls); /* */ $s = 59; case 59: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } err[0] = _r$8; $s = 58; continue; /* } else { */ case 57: _r$9 = cc.fr.WriteData(cs[0].ID, true, sliceType$3.nil); /* */ $s = 60; case 60: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err[0] = _r$9; /* } */ case 58: _r$10 = cc.bw.Flush(); /* */ $s = 61; case 61: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } ferr = _r$10; if (!($interfaceIsEqual(ferr, $ifaceNil)) && $interfaceIsEqual(err[0], $ifaceNil)) { err[0] = ferr; } err[0] = err[0]; $24r$8 = err[0]; $s = 62; case 62: return $24r$8; /* */ } 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: http2clientStream.ptr.prototype.writeRequestBody }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f.$24r$6 = $24r$6; $f.$24r$7 = $24r$7; $f.$24r$8 = $24r$8; $f._r$1 = _r$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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.allowed = allowed; $f.body$1 = body$1; $f.bodyCloser = bodyCloser; $f.buf = buf; $f.cc = cc; $f.cs = cs; $f.data = data; $f.err = err; $f.err$1 = err$1; $f.ferr = ferr; $f.hasContentLen = hasContentLen; $f.hasTrailers = hasTrailers; $f.maxFrameSize = maxFrameSize; $f.n = n; $f.n1 = n1; $f.remain = remain; $f.remainLen = remainLen; $f.req = req; $f.sawEOF = sawEOF; $f.sentEnd = sentEnd; $f.trls = trls; $f.x$5 = x$5; $f.x$6 = x$6; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2clientStream.prototype.writeRequestBody = function(body$1, bodyCloser) { return this.$val.writeRequestBody(body$1, bodyCloser); }; http2clientStream.ptr.prototype.awaitFlowControl = function(maxBytes) { var $24r, $24r$1, $24r$2, $24r$3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, a, cc, cs, err, err$1, maxBytes, take, taken, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; _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; a = $f.a; cc = $f.cc; cs = $f.cs; err = $f.err; err$1 = $f.err$1; maxBytes = $f.maxBytes; take = $f.take; taken = $f.taken; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); taken = 0; err = $ifaceNil; cs = this; cc = cs.cc; $r = cc.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(cc.mu, "Unlock"), []]); /* while (true) { */ case 2: /* */ if (cc.closed) { $s = 4; continue; } /* */ $s = 5; continue; /* if (cc.closed) { */ case 4: _tmp = 0; _tmp$1 = http2errClientConnClosed; taken = _tmp; err = _tmp$1; $24r = [taken, err]; $s = 6; case 6: return $24r; /* } */ case 5: /* */ if (!($interfaceIsEqual(cs.stopReqBody, $ifaceNil))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!($interfaceIsEqual(cs.stopReqBody, $ifaceNil))) { */ case 7: _tmp$2 = 0; _tmp$3 = cs.stopReqBody; taken = _tmp$2; err = _tmp$3; $24r$1 = [taken, err]; $s = 9; case 9: return $24r$1; /* } */ case 8: err$1 = cs.checkResetOrDone(); /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 10; continue; } /* */ $s = 11; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 10: _tmp$4 = 0; _tmp$5 = err$1; taken = _tmp$4; err = _tmp$5; $24r$2 = [taken, err]; $s = 12; case 12: return $24r$2; /* } */ case 11: a = cs.flow.available(); /* */ if (a > 0) { $s = 13; continue; } /* */ $s = 14; continue; /* if (a > 0) { */ case 13: take = a; if (((take >> 0)) > maxBytes) { take = ((maxBytes >> 0)); } if (take > ((cc.maxFrameSize >> 0))) { take = ((cc.maxFrameSize >> 0)); } cs.flow.take(take); _tmp$6 = take; _tmp$7 = $ifaceNil; taken = _tmp$6; err = _tmp$7; $24r$3 = [taken, err]; $s = 15; case 15: return $24r$3; /* } */ case 14: $r = cc.cond.Wait(); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 2; continue; case 3: $s = -1; return [taken, err]; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [taken, err]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2clientStream.ptr.prototype.awaitFlowControl }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $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.a = a; $f.cc = cc; $f.cs = cs; $f.err = err; $f.err$1 = err$1; $f.maxBytes = maxBytes; $f.take = take; $f.taken = taken; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2clientStream.prototype.awaitFlowControl = function(maxBytes) { return this.$val.awaitFlowControl(maxBytes); }; http2ClientConn.ptr.prototype.encodeHeaders = function(req, addGzipHeader, trailers, contentLength) { var $24r, $24r$1, $24r$2, $24r$3, _entry, _i, _i$1, _keys, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _ref, _ref$1, _tuple, addGzipHeader, cc, contentLength, enumerateHeaders, err, hlSize, host, k, orig, path$1, req, trace, traceHeaders, trailers, v, vv, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; _entry = $f._entry; _i = $f._i; _i$1 = $f._i$1; _keys = $f._keys; _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; _ref = $f._ref; _ref$1 = $f._ref$1; _tuple = $f._tuple; addGzipHeader = $f.addGzipHeader; cc = $f.cc; contentLength = $f.contentLength; enumerateHeaders = $f.enumerateHeaders; err = $f.err; hlSize = $f.hlSize; host = $f.host; k = $f.k; orig = $f.orig; path$1 = $f.path$1; req = $f.req; trace = $f.trace; traceHeaders = $f.traceHeaders; trailers = $f.trailers; v = $f.v; vv = $f.vv; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: addGzipHeader = [addGzipHeader]; cc = [cc]; contentLength = [contentLength]; hlSize = [hlSize]; host = [host]; path$1 = [path$1]; req = [req]; trace = [trace]; traceHeaders = [traceHeaders]; trailers = [trailers]; cc[0] = this; cc[0].hbuf.Reset(); host[0] = req[0].Host; if (host[0] === "") { host[0] = req[0].URL.Host; } _r$1 = httpguts.PunycodeHostPort(host[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; host[0] = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [sliceType$3.nil, err]; } path$1[0] = ""; /* */ if (!(req[0].Method === "CONNECT")) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!(req[0].Method === "CONNECT")) { */ case 2: path$1[0] = req[0].URL.RequestURI(); /* */ if (!http2validPseudoPath(path$1[0])) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!http2validPseudoPath(path$1[0])) { */ case 4: orig = path$1[0]; path$1[0] = strings.TrimPrefix(path$1[0], req[0].URL.Scheme + "://" + host[0]); /* */ if (!http2validPseudoPath(path$1[0])) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!http2validPseudoPath(path$1[0])) { */ case 6: /* */ if (!(req[0].URL.Opaque === "")) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!(req[0].URL.Opaque === "")) { */ case 8: _r$2 = fmt.Errorf("invalid request :path %q from URL.Opaque = %q", new sliceType([new $String(orig), new $String(req[0].URL.Opaque)])); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = [sliceType$3.nil, _r$2]; $s = 12; case 12: return $24r; /* } else { */ case 9: _r$3 = fmt.Errorf("invalid request :path %q", new sliceType([new $String(orig)])); /* */ $s = 13; case 13: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r$1 = [sliceType$3.nil, _r$3]; $s = 14; case 14: return $24r$1; /* } */ case 10: /* } */ case 7: /* } */ case 5: /* } */ case 3: _ref = req[0].Header; _i = 0; _keys = $keys(_ref); /* while (true) { */ case 15: /* if (!(_i < _keys.length)) { break; } */ if(!(_i < _keys.length)) { $s = 16; continue; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; /* continue; */ $s = 15; continue; } k = _entry.k; vv = _entry.v; /* */ if (!httpguts.ValidHeaderFieldName(k)) { $s = 17; continue; } /* */ $s = 18; continue; /* if (!httpguts.ValidHeaderFieldName(k)) { */ case 17: _r$4 = fmt.Errorf("invalid HTTP header name %q", new sliceType([new $String(k)])); /* */ $s = 19; case 19: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r$2 = [sliceType$3.nil, _r$4]; $s = 20; case 20: return $24r$2; /* } */ case 18: _ref$1 = vv; _i$1 = 0; /* while (true) { */ case 21: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 22; continue; } v = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); /* */ if (!httpguts.ValidHeaderFieldValue(v)) { $s = 23; continue; } /* */ $s = 24; continue; /* if (!httpguts.ValidHeaderFieldValue(v)) { */ case 23: _r$5 = fmt.Errorf("invalid HTTP header value %q for header %q", new sliceType([new $String(v), new $String(k)])); /* */ $s = 25; case 25: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $24r$3 = [sliceType$3.nil, _r$5]; $s = 26; case 26: return $24r$3; /* } */ case 24: _i$1++; $s = 21; continue; case 22: _i++; $s = 15; continue; case 16: enumerateHeaders = (function(addGzipHeader, cc, contentLength, hlSize, host, path$1, req, trace, traceHeaders, trailers) { return function $b(f) { var _entry$1, _i$2, _i$3, _i$4, _keys$1, _ref$2, _ref$3, _ref$4, didUA, f, k$1, m, p, v$1, v$2, vv$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry$1 = $f._entry$1; _i$2 = $f._i$2; _i$3 = $f._i$3; _i$4 = $f._i$4; _keys$1 = $f._keys$1; _ref$2 = $f._ref$2; _ref$3 = $f._ref$3; _ref$4 = $f._ref$4; didUA = $f.didUA; f = $f.f; k$1 = $f.k$1; m = $f.m; p = $f.p; v$1 = $f.v$1; v$2 = $f.v$2; vv$1 = $f.vv$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = f(":authority", host[0]); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } m = req[0].Method; if (m === "") { m = "GET"; } $r = f(":method", m); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!(req[0].Method === "CONNECT")) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!(req[0].Method === "CONNECT")) { */ case 3: $r = f(":path", path$1[0]); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = f(":scheme", req[0].URL.Scheme); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: /* */ if (!(trailers[0] === "")) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!(trailers[0] === "")) { */ case 7: $r = f("trailer", trailers[0]); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 8: didUA = false; _ref$2 = req[0].Header; _i$2 = 0; _keys$1 = $keys(_ref$2); /* while (true) { */ case 10: /* if (!(_i$2 < _keys$1.length)) { break; } */ if(!(_i$2 < _keys$1.length)) { $s = 11; continue; } _entry$1 = _ref$2[_keys$1[_i$2]]; if (_entry$1 === undefined) { _i$2++; /* continue; */ $s = 10; continue; } k$1 = _entry$1.k; vv$1 = _entry$1.v; /* */ if (http2asciiEqualFold(k$1, "host") || http2asciiEqualFold(k$1, "content-length")) { $s = 12; continue; } /* */ if (http2asciiEqualFold(k$1, "connection") || http2asciiEqualFold(k$1, "proxy-connection") || http2asciiEqualFold(k$1, "transfer-encoding") || http2asciiEqualFold(k$1, "upgrade") || http2asciiEqualFold(k$1, "keep-alive")) { $s = 13; continue; } /* */ if (http2asciiEqualFold(k$1, "user-agent")) { $s = 14; continue; } /* */ if (http2asciiEqualFold(k$1, "cookie")) { $s = 15; continue; } /* */ $s = 16; continue; /* if (http2asciiEqualFold(k$1, "host") || http2asciiEqualFold(k$1, "content-length")) { */ case 12: _i$2++; /* continue; */ $s = 10; continue; $s = 16; continue; /* } else if (http2asciiEqualFold(k$1, "connection") || http2asciiEqualFold(k$1, "proxy-connection") || http2asciiEqualFold(k$1, "transfer-encoding") || http2asciiEqualFold(k$1, "upgrade") || http2asciiEqualFold(k$1, "keep-alive")) { */ case 13: _i$2++; /* continue; */ $s = 10; continue; $s = 16; continue; /* } else if (http2asciiEqualFold(k$1, "user-agent")) { */ case 14: didUA = true; if (vv$1.$length < 1) { _i$2++; /* continue; */ $s = 10; continue; } vv$1 = $subslice(vv$1, 0, 1); if ((0 >= vv$1.$length ? ($throwRuntimeError("index out of range"), undefined) : vv$1.$array[vv$1.$offset + 0]) === "") { _i$2++; /* continue; */ $s = 10; continue; } $s = 16; continue; /* } else if (http2asciiEqualFold(k$1, "cookie")) { */ case 15: _ref$3 = vv$1; _i$3 = 0; /* while (true) { */ case 17: /* if (!(_i$3 < _ref$3.$length)) { break; } */ if(!(_i$3 < _ref$3.$length)) { $s = 18; continue; } v$1 = ((_i$3 < 0 || _i$3 >= _ref$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$3.$array[_ref$3.$offset + _i$3]); /* while (true) { */ case 19: p = strings.IndexByte(v$1, 59); if (p < 0) { /* break; */ $s = 20; continue; } $r = f("cookie", $substring(v$1, 0, p)); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } p = p + (1) >> 0; while (true) { if (!((p + 1 >> 0) <= v$1.length && (v$1.charCodeAt(p) === 32))) { break; } p = p + (1) >> 0; } v$1 = $substring(v$1, p); $s = 19; continue; case 20: /* */ if (v$1.length > 0) { $s = 22; continue; } /* */ $s = 23; continue; /* if (v$1.length > 0) { */ case 22: $r = f("cookie", v$1); /* */ $s = 24; case 24: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 23: _i$3++; $s = 17; continue; case 18: _i$2++; /* continue; */ $s = 10; continue; /* } */ case 16: _ref$4 = vv$1; _i$4 = 0; /* while (true) { */ case 25: /* if (!(_i$4 < _ref$4.$length)) { break; } */ if(!(_i$4 < _ref$4.$length)) { $s = 26; continue; } v$2 = ((_i$4 < 0 || _i$4 >= _ref$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$4.$array[_ref$4.$offset + _i$4]); $r = f(k$1, v$2); /* */ $s = 27; case 27: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i$4++; $s = 25; continue; case 26: _i$2++; $s = 10; continue; case 11: /* */ if (http2shouldSendReqContentLength(req[0].Method, contentLength[0])) { $s = 28; continue; } /* */ $s = 29; continue; /* if (http2shouldSendReqContentLength(req[0].Method, contentLength[0])) { */ case 28: $r = f("content-length", strconv.FormatInt(contentLength[0], 10)); /* */ $s = 30; case 30: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 29: /* */ if (addGzipHeader[0]) { $s = 31; continue; } /* */ $s = 32; continue; /* if (addGzipHeader[0]) { */ case 31: $r = f("accept-encoding", "gzip"); /* */ $s = 33; case 33: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 32: /* */ if (!didUA) { $s = 34; continue; } /* */ $s = 35; continue; /* if (!didUA) { */ case 34: $r = f("user-agent", "Go-http-client/2.0"); /* */ $s = 36; case 36: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 35: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._entry$1 = _entry$1; $f._i$2 = _i$2; $f._i$3 = _i$3; $f._i$4 = _i$4; $f._keys$1 = _keys$1; $f._ref$2 = _ref$2; $f._ref$3 = _ref$3; $f._ref$4 = _ref$4; $f.didUA = didUA; $f.f = f; $f.k$1 = k$1; $f.m = m; $f.p = p; $f.v$1 = v$1; $f.v$2 = v$2; $f.vv$1 = vv$1; $f.$s = $s; $f.$r = $r; return $f; }; })(addGzipHeader, cc, contentLength, hlSize, host, path$1, req, trace, traceHeaders, trailers); hlSize[0] = new $Uint64(0, 0); $r = enumerateHeaders((function(addGzipHeader, cc, contentLength, hlSize, host, path$1, req, trace, traceHeaders, trailers) { return function(name, value) { var hf, name, value, x$5; hf = new hpack.HeaderField.ptr(name, value, false); hlSize[0] = (x$5 = (new $Uint64(0, $clone(hf, hpack.HeaderField).Size())), new $Uint64(hlSize[0].$high + x$5.$high, hlSize[0].$low + x$5.$low)); }; })(addGzipHeader, cc, contentLength, hlSize, host, path$1, req, trace, traceHeaders, trailers)); /* */ $s = 27; case 27: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if ((x$5 = cc[0].peerMaxHeaderListSize, (hlSize[0].$high > x$5.$high || (hlSize[0].$high === x$5.$high && hlSize[0].$low > x$5.$low)))) { $s = -1; return [sliceType$3.nil, http2errRequestHeaderListSize]; } _r$6 = httptrace.ContextClientTrace(req[0].Context()); /* */ $s = 28; case 28: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } trace[0] = _r$6; traceHeaders[0] = http2traceHasWroteHeaderField(trace[0]); $r = enumerateHeaders((function(addGzipHeader, cc, contentLength, hlSize, host, path$1, req, trace, traceHeaders, trailers) { return function $b(name, value) { var _r$7, _tuple$1, ascii$1, name, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$7 = $f._r$7; _tuple$1 = $f._tuple$1; ascii$1 = $f.ascii$1; name = $f.name; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$7 = http2asciiToLower(name); /* */ $s = 1; case 1: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _tuple$1 = _r$7; name = _tuple$1[0]; ascii$1 = _tuple$1[1]; if (!ascii$1) { $s = -1; return; } $r = cc[0].writeHeader(name, value); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (traceHeaders[0]) { $s = 3; continue; } /* */ $s = 4; continue; /* if (traceHeaders[0]) { */ case 3: $r = http2traceWroteHeaderField(trace[0], name, value); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$7 = _r$7; $f._tuple$1 = _tuple$1; $f.ascii$1 = ascii$1; $f.name = name; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; })(addGzipHeader, cc, contentLength, hlSize, host, path$1, req, trace, traceHeaders, trailers)); /* */ $s = 29; case 29: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return [cc[0].hbuf.Bytes(), $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: http2ClientConn.ptr.prototype.encodeHeaders }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f._entry = _entry; $f._i = _i; $f._i$1 = _i$1; $f._keys = _keys; $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._ref = _ref; $f._ref$1 = _ref$1; $f._tuple = _tuple; $f.addGzipHeader = addGzipHeader; $f.cc = cc; $f.contentLength = contentLength; $f.enumerateHeaders = enumerateHeaders; $f.err = err; $f.hlSize = hlSize; $f.host = host; $f.k = k; $f.orig = orig; $f.path$1 = path$1; $f.req = req; $f.trace = trace; $f.traceHeaders = traceHeaders; $f.trailers = trailers; $f.v = v; $f.vv = vv; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; http2ClientConn.prototype.encodeHeaders = function(req, addGzipHeader, trailers, contentLength) { return this.$val.encodeHeaders(req, addGzipHeader, trailers, contentLength); }; http2shouldSendReqContentLength = function(method, contentLength) { var _1, contentLength, method; if ((contentLength.$high > 0 || (contentLength.$high === 0 && contentLength.$low > 0))) { return true; } if ((contentLength.$high < 0 || (contentLength.$high === 0 && contentLength.$low < 0))) { return false; } _1 = method; if (_1 === ("POST") || _1 === ("PUT") || _1 === ("PATCH")) { return true; } else { return false; } }; http2ClientConn.ptr.prototype.encodeTrailers = function(req) { var _entry, _entry$1, _i, _i$1, _i$2, _i$3, _keys, _keys$1, _r$1, _ref, _ref$1, _ref$2, _ref$3, _tuple, ascii$1, cc, hf, hlSize, k, k$1, lowKey, req, v, v$1, vv, vv$1, x$5, x$6, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _i = $f._i; _i$1 = $f._i$1; _i$2 = $f._i$2; _i$3 = $f._i$3; _keys = $f._keys; _keys$1 = $f._keys$1; _r$1 = $f._r$1; _ref = $f._ref; _ref$1 = $f._ref$1; _ref$2 = $f._ref$2; _ref$3 = $f._ref$3; _tuple = $f._tuple; ascii$1 = $f.ascii$1; cc = $f.cc; hf = $f.hf; hlSize = $f.hlSize; k = $f.k; k$1 = $f.k$1; lowKey = $f.lowKey; req = $f.req; v = $f.v; v$1 = $f.v$1; vv = $f.vv; vv$1 = $f.vv$1; x$5 = $f.x$5; x$6 = $f.x$6; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cc = this; cc.hbuf.Reset(); hlSize = new $Uint64(0, 0); _ref = req.Trailer; _i = 0; _keys = $keys(_ref); while (true) { if (!(_i < _keys.length)) { break; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; continue; } k = _entry.k; vv = _entry.v; _ref$1 = vv; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } v = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); hf = new hpack.HeaderField.ptr(k, v, false); hlSize = (x$5 = (new $Uint64(0, $clone(hf, hpack.HeaderField).Size())), new $Uint64(hlSize.$high + x$5.$high, hlSize.$low + x$5.$low)); _i$1++; } _i++; } if ((x$6 = cc.peerMaxHeaderListSize, (hlSize.$high > x$6.$high || (hlSize.$high === x$6.$high && hlSize.$low > x$6.$low)))) { $s = -1; return [sliceType$3.nil, http2errRequestHeaderListSize]; } _ref$2 = req.Trailer; _i$2 = 0; _keys$1 = $keys(_ref$2); /* while (true) { */ case 1: /* if (!(_i$2 < _keys$1.length)) { break; } */ if(!(_i$2 < _keys$1.length)) { $s = 2; continue; } _entry$1 = _ref$2[_keys$1[_i$2]]; if (_entry$1 === undefined) { _i$2++; /* continue; */ $s = 1; continue; } k$1 = _entry$1.k; vv$1 = _entry$1.v; _r$1 = http2asciiToLower(k$1); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; lowKey = _tuple[0]; ascii$1 = _tuple[1]; if (!ascii$1) { _i$2++; /* continue; */ $s = 1; continue; } _ref$3 = vv$1; _i$3 = 0; /* while (true) { */ case 4: /* if (!(_i$3 < _ref$3.$length)) { break; } */ if(!(_i$3 < _ref$3.$length)) { $s = 5; continue; } v$1 = ((_i$3 < 0 || _i$3 >= _ref$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$3.$array[_ref$3.$offset + _i$3]); $r = cc.writeHeader(lowKey, v$1); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i$3++; $s = 4; continue; case 5: _i$2++; $s = 1; continue; case 2: $s = -1; return [cc.hbuf.Bytes(), $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: http2ClientConn.ptr.prototype.encodeTrailers }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._i = _i; $f._i$1 = _i$1; $f._i$2 = _i$2; $f._i$3 = _i$3; $f._keys = _keys; $f._keys$1 = _keys$1; $f._r$1 = _r$1; $f._ref = _ref; $f._ref$1 = _ref$1; $f._ref$2 = _ref$2; $f._ref$3 = _ref$3; $f._tuple = _tuple; $f.ascii$1 = ascii$1; $f.cc = cc; $f.hf = hf; $f.hlSize = hlSize; $f.k = k; $f.k$1 = k$1; $f.lowKey = lowKey; $f.req = req; $f.v = v; $f.v$1 = v$1; $f.vv = vv; $f.vv$1 = vv$1; $f.x$5 = x$5; $f.x$6 = x$6; $f.$s = $s; $f.$r = $r; return $f; }; http2ClientConn.prototype.encodeTrailers = function(req) { return this.$val.encodeTrailers(req); }; http2ClientConn.ptr.prototype.writeHeader = function(name, value) { var _r$1, cc, name, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; cc = $f.cc; name = $f.name; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cc = this; /* */ if (http2VerboseLogs) { $s = 1; continue; } /* */ $s = 2; continue; /* if (http2VerboseLogs) { */ case 1: $r = log.Printf("http2: Transport encoding header %q = %q", new sliceType([new $String(name), new $String(value)])); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: _r$1 = cc.henc.WriteField(new hpack.HeaderField.ptr(name, value, false)); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2ClientConn.ptr.prototype.writeHeader }; } $f._r$1 = _r$1; $f.cc = cc; $f.name = name; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; http2ClientConn.prototype.writeHeader = function(name, value) { return this.$val.writeHeader(name, value); }; http2ClientConn.ptr.prototype.newStream = function() { var _key, cc, cs; cc = this; cs = new http2clientStream.ptr(cc, ptrType$11.nil, ptrType$19.nil, cc.nextStreamID, new $Chan(http2resAndError, 1), new http2pipe.ptr(new sync.Mutex.ptr(0, 0), new sync.Cond.ptr(new sync.noCopy.ptr(), $ifaceNil, new sync.notifyList.ptr(0, 0, 0, 0, 0), 0, 0, $chanNil), $ifaceNil, 0, $ifaceNil, $ifaceNil, $chanNil, $throwNilPointerError), false, false, $throwNilPointerError, new http2flow.ptr(arrayType.zero(), 0, ptrType$71.nil), new http2flow.ptr(arrayType.zero(), 0, ptrType$71.nil), new $Int64(0, 0), $ifaceNil, $ifaceNil, false, new $Chan(structType, 0), $ifaceNil, new $Chan(structType, 0), false, false, false, 0, false, ptrType$38.nil); cs.flow.add(((cc.initialWindowSize >> 0))); cs.flow.setConnFlow(cc.flow); cs.inflow.add(4194304); cs.inflow.setConnFlow(cc.inflow); cc.nextStreamID = cc.nextStreamID + (2) >>> 0; _key = cs.ID; (cc.streams || $throwRuntimeError("assignment to entry in nil map"))[$Uint32.keyFor(_key)] = { k: _key, v: cs }; return cs; }; http2ClientConn.prototype.newStream = function() { return this.$val.newStream(); }; http2ClientConn.ptr.prototype.forgetStreamID = function(id) { var _r$1, cc, id, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; cc = $f.cc; id = $f.id; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cc = this; _r$1 = cc.streamByID(id, true); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2ClientConn.ptr.prototype.forgetStreamID }; } $f._r$1 = _r$1; $f.cc = cc; $f.id = id; $f.$s = $s; $f.$r = $r; return $f; }; http2ClientConn.prototype.forgetStreamID = function(id) { return this.$val.forgetStreamID(id); }; http2ClientConn.ptr.prototype.streamByID = function(id, andRemove) { var $24r, _entry, _r$1, _r$2, _r$3, andRemove, cc, cs, id, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _entry = $f._entry; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; andRemove = $f.andRemove; cc = $f.cc; cs = $f.cs; id = $f.id; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); cc = this; $r = cc.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(cc.mu, "Unlock"), []]); cs = (_entry = cc.streams[$Uint32.keyFor(id)], _entry !== undefined ? _entry.v : ptrType$104.nil); /* */ if (andRemove && !(cs === ptrType$104.nil) && !cc.closed) { $s = 2; continue; } /* */ $s = 3; continue; /* if (andRemove && !(cs === ptrType$104.nil) && !cc.closed) { */ case 2: _r$1 = time.Now(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } time.Time.copy(cc.lastActive, _r$1); delete cc.streams[$Uint32.keyFor(id)]; /* */ if (($keys(cc.streams).length === 0) && !(cc.idleTimer === ptrType$25.nil)) { $s = 5; continue; } /* */ $s = 6; continue; /* if (($keys(cc.streams).length === 0) && !(cc.idleTimer === ptrType$25.nil)) { */ case 5: _r$2 = cc.idleTimer.Reset(cc.idleTimeout); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; _r$3 = time.Now(); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } time.Time.copy(cc.lastIdle, _r$3); /* } */ case 6: $close(cs.done); $r = cc.cond.Broadcast(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: $24r = cs; $s = 10; case 10: return $24r; /* */ } return; } } catch(err) { $err = err; $s = -1; return ptrType$104.nil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2ClientConn.ptr.prototype.streamByID }; } $f.$24r = $24r; $f._entry = _entry; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.andRemove = andRemove; $f.cc = cc; $f.cs = cs; $f.id = id; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2ClientConn.prototype.streamByID = function(id, andRemove) { return this.$val.streamByID(id, andRemove); }; http2ClientConn.ptr.prototype.readLoop = function() { var _r$1, _r$2, _tuple, cc, ce, ok, rl, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; cc = $f.cc; ce = $f.ce; ok = $f.ok; rl = $f.rl; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); cc = this; rl = new http2clientConnReadLoop.ptr(arrayType.zero(), cc, false); $deferred.push([$methodVal(rl, "cleanup"), []]); _r$1 = rl.run(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } cc.readerErr = _r$1; _tuple = $assertType(cc.readerErr, http2ConnectionError, true); ce = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (ok) { */ case 2: $r = cc.wmu.Lock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$2 = cc.fr.WriteGoAway(0, ((ce >>> 0)), sliceType$3.nil); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; $r = cc.wmu.Unlock(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2ClientConn.ptr.prototype.readLoop }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.cc = cc; $f.ce = ce; $f.ok = ok; $f.rl = rl; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2ClientConn.prototype.readLoop = function() { return this.$val.readLoop(); }; http2GoAwayError.ptr.prototype.Error = function() { var $24r, _r$1, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; _r$1 = fmt.Sprintf("http2: server sent GOAWAY and closed the connection; LastStreamID=%v, ErrCode=%v, debug=%q", new sliceType([new $Uint32(e.LastStreamID), new http2ErrCode(e.ErrCode), new $String(e.DebugData)])); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2GoAwayError.ptr.prototype.Error }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; http2GoAwayError.prototype.Error = function() { return this.$val.Error(); }; http2isEOFOrNetReadError = function(err) { var _tuple, err, ne, ok; if ($interfaceIsEqual(err, io.EOF)) { return true; } _tuple = $assertType(err, ptrType$57, true); ne = _tuple[0]; ok = _tuple[1]; return ok && ne.Op === "read"; }; http2clientConnReadLoop.ptr.prototype.cleanup = function() { var _arg, _entry, _i, _keys, _r$1, _ref, _selection, cc, cs, err, rl, x$5, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _entry = $f._entry; _i = $f._i; _keys = $f._keys; _r$1 = $f._r$1; _ref = $f._ref; _selection = $f._selection; cc = $f.cc; cs = $f.cs; err = $f.err; rl = $f.rl; x$5 = $f.x$5; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); rl = this; cc = rl.cc; $deferred.push([$methodVal(cc.tconn, "Close"), []]); _r$1 = cc.t.connPool(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $deferred.push([$methodVal(_r$1, "MarkDead"), [cc]]); $deferred.push([function(_arg) { $close(_arg); }, [cc.readerDone]]); if (!(cc.idleTimer === ptrType$25.nil)) { cc.idleTimer.Stop(); } err = cc.readerErr; $r = cc.mu.Lock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (!(cc.goAway === ptrType$82.nil) && http2isEOFOrNetReadError(err)) { err = (x$5 = new http2GoAwayError.ptr(cc.goAway.LastStreamID, cc.goAway.ErrCode, cc.goAwayDebug), new x$5.constructor.elem(x$5)); } else if ($interfaceIsEqual(err, io.EOF)) { err = io.ErrUnexpectedEOF; } _ref = cc.streams; _i = 0; _keys = $keys(_ref); /* while (true) { */ case 3: /* if (!(_i < _keys.length)) { break; } */ if(!(_i < _keys.length)) { $s = 4; continue; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; /* continue; */ $s = 3; continue; } cs = _entry.v; $r = cs.bufPipe.CloseWithError(err); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _selection = $select([[cs.resc, new http2resAndError.ptr(arrayType.zero(), ptrType$18.nil, err)], []]); if (_selection[0] === 0) { } else if (_selection[0] === 1) { } $close(cs.done); _i++; $s = 3; continue; case 4: cc.closed = true; $r = cc.cond.Broadcast(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = cc.mu.Unlock(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2clientConnReadLoop.ptr.prototype.cleanup }; } $f._arg = _arg; $f._entry = _entry; $f._i = _i; $f._keys = _keys; $f._r$1 = _r$1; $f._ref = _ref; $f._selection = _selection; $f.cc = cc; $f.cs = cs; $f.err = err; $f.rl = rl; $f.x$5 = x$5; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2clientConnReadLoop.prototype.cleanup = function() { return this.$val.cleanup(); }; http2clientConnReadLoop.ptr.prototype.run = function() { var $24r, $24r$1, $24r$2, _arg, _arg$1, _arg$2, _arg$3, _r$1, _r$10, _r$11, _r$12, _r$13, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _tuple, _tuple$1, _tuple$2, cc, cs, err, f, f$1, f$2, f$3, f$4, f$5, f$6, f$7, f$8, f$9, gotReply, gotSettings, maybeIdle, ok, ok$1, readIdleTimeout, rl, se, t, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _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$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; _tuple$2 = $f._tuple$2; cc = $f.cc; cs = $f.cs; err = $f.err; f = $f.f; f$1 = $f.f$1; 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; gotReply = $f.gotReply; gotSettings = $f.gotSettings; maybeIdle = $f.maybeIdle; ok = $f.ok; ok$1 = $f.ok$1; readIdleTimeout = $f.readIdleTimeout; rl = $f.rl; se = $f.se; t = $f.t; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); rl = this; cc = rl.cc; rl.closeWhenIdle = cc.t.disableKeepAlives() || cc.singleUse; gotReply = false; gotSettings = false; readIdleTimeout = cc.t.ReadIdleTimeout; t = ptrType$25.nil; /* */ if (!((readIdleTimeout.$high === 0 && readIdleTimeout.$low === 0))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((readIdleTimeout.$high === 0 && readIdleTimeout.$low === 0))) { */ case 1: _r$1 = time.AfterFunc(readIdleTimeout, $methodVal(cc, "healthCheck")); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } t = _r$1; $deferred.push([$methodVal(t, "Stop"), []]); /* } */ case 2: /* while (true) { */ case 4: _r$2 = cc.fr.ReadFrame(); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; f = _tuple[0]; err = _tuple[1]; /* */ if (!(t === ptrType$25.nil)) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!(t === ptrType$25.nil)) { */ case 7: _r$3 = t.Reset(readIdleTimeout); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; /* } */ case 8: /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 10; continue; } /* */ $s = 11; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 10: $r = cc.vlogf("http2: Transport readFrame error on conn %p: (%T) %v", new sliceType([cc, err, err])); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 11: _tuple$1 = $assertType(err, http2StreamError, true); se = $clone(_tuple$1[0], http2StreamError); ok = _tuple$1[1]; /* */ if (ok) { $s = 13; continue; } /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 14; continue; } /* */ $s = 15; continue; /* if (ok) { */ case 13: _r$4 = cc.streamByID(se.StreamID, false); /* */ $s = 16; case 16: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } cs = _r$4; /* */ if (!(cs === ptrType$104.nil)) { $s = 17; continue; } /* */ $s = 18; continue; /* if (!(cs === ptrType$104.nil)) { */ case 17: $r = cs.cc.writeStreamReset(cs.ID, se.Code, err); /* */ $s = 19; case 19: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = cs.cc.forgetStreamID(cs.ID); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if ($interfaceIsEqual(se.Cause, $ifaceNil)) { se.Cause = cc.fr.errDetail; } $r = rl.endStreamError(cs, new se.constructor.elem(se)); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 18: /* continue; */ $s = 4; continue; $s = 15; continue; /* } else if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 14: $24r = err; $s = 22; case 22: return $24r; /* } */ case 15: /* */ if (http2VerboseLogs) { $s = 23; continue; } /* */ $s = 24; continue; /* if (http2VerboseLogs) { */ case 23: _r$5 = http2summarizeFrame(f); /* */ $s = 25; case 25: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg = new $String(_r$5); $r = cc.vlogf("http2: Transport received %s", new sliceType([_arg])); /* */ $s = 26; case 26: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 24: /* */ if (!gotSettings) { $s = 27; continue; } /* */ $s = 28; continue; /* if (!gotSettings) { */ case 27: _tuple$2 = $assertType(f, ptrType$78, true); ok$1 = _tuple$2[1]; /* */ if (!ok$1) { $s = 29; continue; } /* */ $s = 30; continue; /* if (!ok$1) { */ case 29: $r = cc.logf("protocol error: received %T before a SETTINGS frame", new sliceType([f])); /* */ $s = 31; case 31: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $24r$1 = new http2ConnectionError(1); $s = 32; case 32: return $24r$1; /* } */ case 30: gotSettings = true; /* } */ case 28: maybeIdle = false; _ref = f; /* */ if ($assertType(_ref, ptrType$76, true)[1]) { $s = 33; continue; } /* */ if ($assertType(_ref, ptrType$79, true)[1]) { $s = 34; continue; } /* */ if ($assertType(_ref, ptrType$82, true)[1]) { $s = 35; continue; } /* */ if ($assertType(_ref, ptrType$83, true)[1]) { $s = 36; continue; } /* */ if ($assertType(_ref, ptrType$78, true)[1]) { $s = 37; continue; } /* */ if ($assertType(_ref, ptrType$96, true)[1]) { $s = 38; continue; } /* */ if ($assertType(_ref, ptrType$80, true)[1]) { $s = 39; continue; } /* */ if ($assertType(_ref, ptrType$81, true)[1]) { $s = 40; continue; } /* */ $s = 41; continue; /* if ($assertType(_ref, ptrType$76, true)[1]) { */ case 33: f$1 = _ref.$val; _r$6 = rl.processHeaders(f$1); /* */ $s = 43; case 43: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } err = _r$6; maybeIdle = true; gotReply = true; $s = 42; continue; /* } else if ($assertType(_ref, ptrType$79, true)[1]) { */ case 34: f$2 = _ref.$val; _r$7 = rl.processData(f$2); /* */ $s = 44; case 44: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } err = _r$7; maybeIdle = true; $s = 42; continue; /* } else if ($assertType(_ref, ptrType$82, true)[1]) { */ case 35: f$3 = _ref.$val; _r$8 = rl.processGoAway(f$3); /* */ $s = 45; case 45: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } err = _r$8; maybeIdle = true; $s = 42; continue; /* } else if ($assertType(_ref, ptrType$83, true)[1]) { */ case 36: f$4 = _ref.$val; _r$9 = rl.processResetStream(f$4); /* */ $s = 46; case 46: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } err = _r$9; maybeIdle = true; $s = 42; continue; /* } else if ($assertType(_ref, ptrType$78, true)[1]) { */ case 37: f$5 = _ref.$val; _r$10 = rl.processSettings(f$5); /* */ $s = 47; case 47: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } err = _r$10; $s = 42; continue; /* } else if ($assertType(_ref, ptrType$96, true)[1]) { */ case 38: f$6 = _ref.$val; err = rl.processPushPromise(f$6); $s = 42; continue; /* } else if ($assertType(_ref, ptrType$80, true)[1]) { */ case 39: f$7 = _ref.$val; _r$11 = rl.processWindowUpdate(f$7); /* */ $s = 48; case 48: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } err = _r$11; $s = 42; continue; /* } else if ($assertType(_ref, ptrType$81, true)[1]) { */ case 40: f$8 = _ref.$val; _r$12 = rl.processPing(f$8); /* */ $s = 49; case 49: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } err = _r$12; $s = 42; continue; /* } else { */ case 41: f$9 = _ref; $r = cc.logf("Transport: unhandled response frame type %T", new sliceType([f$9])); /* */ $s = 50; case 50: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 42: /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 51; continue; } /* */ $s = 52; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 51: /* */ if (http2VerboseLogs) { $s = 53; continue; } /* */ $s = 54; continue; /* if (http2VerboseLogs) { */ case 53: _arg$1 = cc; _r$13 = http2summarizeFrame(f); /* */ $s = 55; case 55: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _arg$2 = new $String(_r$13); _arg$3 = err; $r = cc.vlogf("http2: Transport conn %p received error from processing frame %v: %v", new sliceType([_arg$1, _arg$2, _arg$3])); /* */ $s = 56; case 56: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 54: $24r$2 = err; $s = 57; case 57: return $24r$2; /* } */ case 52: /* */ if (rl.closeWhenIdle && gotReply && maybeIdle) { $s = 58; continue; } /* */ $s = 59; continue; /* if (rl.closeWhenIdle && gotReply && maybeIdle) { */ case 58: $r = cc.closeIfIdle(); /* */ $s = 60; case 60: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 59: $s = 4; continue; case 5: $s = -1; return $ifaceNil; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2clientConnReadLoop.ptr.prototype.run }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $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$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._tuple$2 = _tuple$2; $f.cc = cc; $f.cs = cs; $f.err = err; $f.f = f; $f.f$1 = f$1; $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.gotReply = gotReply; $f.gotSettings = gotSettings; $f.maybeIdle = maybeIdle; $f.ok = ok; $f.ok$1 = ok$1; $f.readIdleTimeout = readIdleTimeout; $f.rl = rl; $f.se = se; $f.t = t; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2clientConnReadLoop.prototype.run = function() { return this.$val.run(); }; http2clientConnReadLoop.ptr.prototype.processHeaders = function(f) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, $24r$5, _r$1, _r$2, _r$3, _tuple, _tuple$1, cc, cs, err, f, ok, res, rl, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; cc = $f.cc; cs = $f.cs; err = $f.err; f = $f.f; ok = $f.ok; res = $f.res; rl = $f.rl; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); rl = this; cc = rl.cc; _r$1 = cc.streamByID(f.http2HeadersFrame.http2FrameHeader.StreamID, false); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } cs = _r$1; /* */ if (cs === ptrType$104.nil) { $s = 2; continue; } /* */ $s = 3; continue; /* if (cs === ptrType$104.nil) { */ case 2: $24r = $ifaceNil; $s = 4; case 4: return $24r; /* } */ case 3: /* */ if (f.http2HeadersFrame.StreamEnded()) { $s = 5; continue; } /* */ $s = 6; continue; /* if (f.http2HeadersFrame.StreamEnded()) { */ case 5: /* */ if (!($interfaceIsEqual(cs.req.Body, $ifaceNil))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!($interfaceIsEqual(cs.req.Body, $ifaceNil))) { */ case 7: $deferred.push([$methodVal(cc, "forgetStreamID"), [f.http2HeadersFrame.http2FrameHeader.StreamID]]); $s = 9; continue; /* } else { */ case 8: $r = cc.forgetStreamID(f.http2HeadersFrame.http2FrameHeader.StreamID); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 9: /* } */ case 6: /* */ if (!cs.firstByte) { $s = 11; continue; } /* */ $s = 12; continue; /* if (!cs.firstByte) { */ case 11: /* */ if (!(cs.trace === ptrType$19.nil)) { $s = 13; continue; } /* */ $s = 14; continue; /* if (!(cs.trace === ptrType$19.nil)) { */ case 13: $r = http2traceFirstResponseByte(cs.trace); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 14: cs.firstByte = true; /* } */ case 12: /* */ if (!cs.pastHeaders) { $s = 16; continue; } /* */ $s = 17; continue; /* if (!cs.pastHeaders) { */ case 16: cs.pastHeaders = true; $s = 18; continue; /* } else { */ case 17: _r$2 = rl.processTrailers(cs, f); /* */ $s = 19; case 19: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r$1 = _r$2; $s = 20; case 20: return $24r$1; /* } */ case 18: _r$3 = rl.handleResponse(cs, f); /* */ $s = 21; case 21: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; res = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 22; continue; } /* */ $s = 23; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 22: _tuple$1 = $assertType(err, http2ConnectionError, true); ok = _tuple$1[1]; /* */ if (ok) { $s = 24; continue; } /* */ $s = 25; continue; /* if (ok) { */ case 24: $24r$2 = err; $s = 26; case 26: return $24r$2; /* } */ case 25: $r = cs.cc.writeStreamReset(f.http2HeadersFrame.http2FrameHeader.StreamID, 1, err); /* */ $s = 27; case 27: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = cc.forgetStreamID(cs.ID); /* */ $s = 28; case 28: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = $send(cs.resc, $clone(new http2resAndError.ptr(arrayType.zero(), ptrType$18.nil, err), http2resAndError)); /* */ $s = 29; case 29: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $24r$3 = $ifaceNil; $s = 30; case 30: return $24r$3; /* } */ case 23: /* */ if (res === ptrType$18.nil) { $s = 31; continue; } /* */ $s = 32; continue; /* if (res === ptrType$18.nil) { */ case 31: $24r$4 = $ifaceNil; $s = 33; case 33: return $24r$4; /* } */ case 32: cs.resTrailer = (res.$ptr_Trailer || (res.$ptr_Trailer = new ptrType$38(function() { return this.$target.Trailer; }, function($v) { this.$target.Trailer = $v; }, res))); $r = $send(cs.resc, $clone(new http2resAndError.ptr(arrayType.zero(), res, $ifaceNil), http2resAndError)); /* */ $s = 34; case 34: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $24r$5 = $ifaceNil; $s = 35; case 35: return $24r$5; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2clientConnReadLoop.ptr.prototype.processHeaders }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.cc = cc; $f.cs = cs; $f.err = err; $f.f = f; $f.ok = ok; $f.res = res; $f.rl = rl; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2clientConnReadLoop.prototype.processHeaders = function(f) { return this.$val.processHeaders(f); }; http2clientConnReadLoop.ptr.prototype.handleResponse = function(cs, f) { var _entry, _entry$1, _i, _key, _key$1, _r$1, _r$2, _r$3, _ref, _tmp, _tmp$1, _tuple, _tuple$1, _v, cl, clens, cs, err, err$1, err$2, f, fn, header, hf, isHead, key, regularFields, res, rl, status, statusCode, streamEnded, strs, t, vv, x$5, x$6, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _i = $f._i; _key = $f._key; _key$1 = $f._key$1; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _v = $f._v; cl = $f.cl; clens = $f.clens; cs = $f.cs; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; f = $f.f; fn = $f.fn; header = $f.header; hf = $f.hf; isHead = $f.isHead; key = $f.key; regularFields = $f.regularFields; res = $f.res; rl = $f.rl; status = $f.status; statusCode = $f.statusCode; streamEnded = $f.streamEnded; strs = $f.strs; t = $f.t; vv = $f.vv; x$5 = $f.x$5; x$6 = $f.x$6; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rl = this; if (f.Truncated) { $s = -1; return [ptrType$18.nil, http2errResponseHeaderListSize]; } status = f.PseudoValue("status"); if (status === "") { $s = -1; return [ptrType$18.nil, errors.New("malformed response from server: missing status pseudo header")]; } _tuple = strconv.Atoi(status); statusCode = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$18.nil, errors.New("malformed response from server: malformed non-numeric status pseudo header")]; } regularFields = f.RegularFields(); strs = $makeSlice(sliceType$2, regularFields.$length); header = (x$5 = regularFields.$length, ((x$5 < 0 || x$5 > 2147483647) ? $throwRuntimeError("makemap: size out of range") : {})); res = new Response.ptr(status + " " + StatusText(statusCode), statusCode, "HTTP/2.0", 2, 0, header, $ifaceNil, new $Int64(0, 0), sliceType$2.nil, false, false, false, ptrType$11.nil, ptrType$28.nil); _ref = regularFields; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } t = [t]; hf = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), hpack.HeaderField); _r$1 = CanonicalHeaderKey(hf.Name); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } key = _r$1; /* */ if (key === "Trailer") { $s = 4; continue; } /* */ $s = 5; continue; /* if (key === "Trailer") { */ case 4: t[0] = res.Trailer; if (t[0] === false) { t[0] = {}; res.Trailer = t[0]; } $r = http2foreachHeaderElement(hf.Value, (function(t) { return function $b(v) { var _key, _r$2, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _key = $f._key; _r$2 = $f._r$2; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$2 = CanonicalHeaderKey(v); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _key = _r$2; (t[0] || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: sliceType$2.nil }; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._key = _key; $f._r$2 = _r$2; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; })(t)); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 6; continue; /* } else { */ case 5: vv = (_entry = header[$String.keyFor(key)], _entry !== undefined ? _entry.v : sliceType$2.nil); if (vv === sliceType$2.nil && strs.$length > 0) { _tmp = $subslice(strs, 0, 1, 1); _tmp$1 = $subslice(strs, 1); vv = _tmp; strs = _tmp$1; (0 >= vv.$length ? ($throwRuntimeError("index out of range"), undefined) : vv.$array[vv.$offset + 0] = hf.Value); _key = key; (header || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: vv }; } else { _key$1 = key; (header || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key$1)] = { k: _key$1, v: $append(vv, hf.Value) }; } /* } */ case 6: _i++; $s = 1; continue; case 2: /* */ if (statusCode >= 100 && statusCode <= 199) { $s = 8; continue; } /* */ $s = 9; continue; /* if (statusCode >= 100 && statusCode <= 199) { */ case 8: cs.num1xx = cs.num1xx + (1) << 24 >>> 24; if (cs.num1xx > 5) { $s = -1; return [ptrType$18.nil, errors.New("http2: too many 1xx informational responses")]; } fn = cs.get1xxTraceFunc(); /* */ if (!(fn === $throwNilPointerError)) { $s = 10; continue; } /* */ $s = 11; continue; /* if (!(fn === $throwNilPointerError)) { */ case 10: _r$2 = fn(statusCode, (header)); /* */ $s = 12; case 12: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } err$1 = _r$2; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [ptrType$18.nil, err$1]; } /* } */ case 11: /* */ if (statusCode === 100) { $s = 13; continue; } /* */ $s = 14; continue; /* if (statusCode === 100) { */ case 13: $r = http2traceGot100Continue(cs.trace); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!(cs.on100 === $throwNilPointerError)) { $s = 16; continue; } /* */ $s = 17; continue; /* if (!(cs.on100 === $throwNilPointerError)) { */ case 16: $r = cs.on100(); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 17: /* } */ case 14: cs.pastHeaders = false; $s = -1; return [ptrType$18.nil, $ifaceNil]; /* } */ case 9: streamEnded = f.http2HeadersFrame.StreamEnded(); isHead = cs.req.Method === "HEAD"; if (!streamEnded || isHead) { res.ContentLength = new $Int64(-1, 4294967295); clens = (_entry$1 = res.Header[$String.keyFor("Content-Length")], _entry$1 !== undefined ? _entry$1.v : sliceType$2.nil); if (clens.$length === 1) { _tuple$1 = strconv.ParseUint((0 >= clens.$length ? ($throwRuntimeError("index out of range"), undefined) : clens.$array[clens.$offset + 0]), 10, 63); cl = _tuple$1[0]; err$2 = _tuple$1[1]; if ($interfaceIsEqual(err$2, $ifaceNil)) { res.ContentLength = (new $Int64(cl.$high, cl.$low)); } else { } } else if (clens.$length > 1) { } } if (streamEnded || isHead) { res.Body = http2noBody; $s = -1; return [res, $ifaceNil]; } http2pipe.copy(cs.bufPipe, new http2pipe.ptr(new sync.Mutex.ptr(0, 0), new sync.Cond.ptr(new sync.noCopy.ptr(), $ifaceNil, new sync.notifyList.ptr(0, 0, 0, 0, 0), 0, 0, $chanNil), new http2dataBuffer.ptr(sliceType$5.nil, 0, 0, 0, res.ContentLength), 0, $ifaceNil, $ifaceNil, $chanNil, $throwNilPointerError)); cs.bytesRemain = res.ContentLength; res.Body = (x$6 = new http2transportResponseBody.ptr(cs), new x$6.constructor.elem(x$6)); $go($methodVal(cs, "awaitRequestCancel"), [cs.req]); if (!(cs.requestedGzip)) { _v = false; $s = 21; continue s; } _r$3 = new Header(res.Header).Get("Content-Encoding"); /* */ $s = 22; case 22: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _v = _r$3 === "gzip"; case 21: /* */ if (_v) { $s = 19; continue; } /* */ $s = 20; continue; /* if (_v) { */ case 19: $r = new Header(res.Header).Del("Content-Encoding"); /* */ $s = 23; case 23: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = new Header(res.Header).Del("Content-Length"); /* */ $s = 24; case 24: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } res.ContentLength = new $Int64(-1, 4294967295); res.Body = new http2gzipReader.ptr(arrayType.zero(), res.Body, ptrType$33.nil, $ifaceNil); res.Uncompressed = true; /* } */ case 20: $s = -1; return [res, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: http2clientConnReadLoop.ptr.prototype.handleResponse }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._i = _i; $f._key = _key; $f._key$1 = _key$1; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._v = _v; $f.cl = cl; $f.clens = clens; $f.cs = cs; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.f = f; $f.fn = fn; $f.header = header; $f.hf = hf; $f.isHead = isHead; $f.key = key; $f.regularFields = regularFields; $f.res = res; $f.rl = rl; $f.status = status; $f.statusCode = statusCode; $f.streamEnded = streamEnded; $f.strs = strs; $f.t = t; $f.vv = vv; $f.x$5 = x$5; $f.x$6 = x$6; $f.$s = $s; $f.$r = $r; return $f; }; http2clientConnReadLoop.prototype.handleResponse = function(cs, f) { return this.$val.handleResponse(cs, f); }; http2clientConnReadLoop.ptr.prototype.processTrailers = function(cs, f) { var _entry, _i, _key, _r$1, _ref, cs, f, hf, key, rl, trailer, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _i = $f._i; _key = $f._key; _r$1 = $f._r$1; _ref = $f._ref; cs = $f.cs; f = $f.f; hf = $f.hf; key = $f.key; rl = $f.rl; trailer = $f.trailer; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rl = this; if (cs.pastTrailers) { $s = -1; return new http2ConnectionError(1); } cs.pastTrailers = true; if (!f.http2HeadersFrame.StreamEnded()) { $s = -1; return new http2ConnectionError(1); } if (f.PseudoFields().$length > 0) { $s = -1; return new http2ConnectionError(1); } trailer = {}; _ref = f.RegularFields(); _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } hf = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), hpack.HeaderField); _r$1 = CanonicalHeaderKey(hf.Name); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } key = _r$1; _key = key; (trailer || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: $append((_entry = trailer[$String.keyFor(key)], _entry !== undefined ? _entry.v : sliceType$2.nil), hf.Value) }; _i++; $s = 1; continue; case 2: cs.trailer = trailer; $r = rl.endStream(cs); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2clientConnReadLoop.ptr.prototype.processTrailers }; } $f._entry = _entry; $f._i = _i; $f._key = _key; $f._r$1 = _r$1; $f._ref = _ref; $f.cs = cs; $f.f = f; $f.hf = hf; $f.key = key; $f.rl = rl; $f.trailer = trailer; $f.$s = $s; $f.$r = $r; return $f; }; http2clientConnReadLoop.prototype.processTrailers = function(cs, f) { return this.$val.processTrailers(cs, f); }; http2transportResponseBody.ptr.prototype.Read = function(p) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, _r$1, _r$2, _r$3, _r$4, _r$5, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, b, cc, connAdd, cs, err, n, p, streamAdd, v, v$1, x$10, x$11, x$12, x$5, x$6, x$7, x$8, x$9, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; _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; _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; b = $f.b; cc = $f.cc; connAdd = $f.connAdd; cs = $f.cs; err = $f.err; n = $f.n; p = $f.p; streamAdd = $f.streamAdd; v = $f.v; v$1 = $f.v$1; x$10 = $f.x$10; x$11 = $f.x$11; x$12 = $f.x$12; 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; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); n = 0; err = $ifaceNil; b = this; cs = b.cs; cc = cs.cc; /* */ if (!($interfaceIsEqual(cs.readErr, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(cs.readErr, $ifaceNil))) { */ case 1: _tmp = 0; _tmp$1 = cs.readErr; n = _tmp; err = _tmp$1; $24r = [n, err]; $s = 3; case 3: return $24r; /* } */ case 2: _r$1 = b.cs.bufPipe.Read(p); /* */ $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; n = _tuple[0]; err = _tuple[1]; /* */ if (!((x$5 = cs.bytesRemain, (x$5.$high === -1 && x$5.$low === 4294967295)))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!((x$5 = cs.bytesRemain, (x$5.$high === -1 && x$5.$low === 4294967295)))) { */ case 5: /* */ if ((x$6 = (new $Int64(0, n)), x$7 = cs.bytesRemain, (x$6.$high > x$7.$high || (x$6.$high === x$7.$high && x$6.$low > x$7.$low)))) { $s = 7; continue; } /* */ $s = 8; continue; /* if ((x$6 = (new $Int64(0, n)), x$7 = cs.bytesRemain, (x$6.$high > x$7.$high || (x$6.$high === x$7.$high && x$6.$low > x$7.$low)))) { */ case 7: n = (((x$8 = cs.bytesRemain, x$8.$low + ((x$8.$high >> 31) * 4294967296)) >> 0)); /* */ if ($interfaceIsEqual(err, $ifaceNil)) { $s = 9; continue; } /* */ $s = 10; continue; /* if ($interfaceIsEqual(err, $ifaceNil)) { */ case 9: err = errors.New("net/http: server replied with more than declared Content-Length; truncated"); $r = cc.writeStreamReset(cs.ID, 1, err); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 10: cs.readErr = err; _tmp$2 = (((x$9 = cs.bytesRemain, x$9.$low + ((x$9.$high >> 31) * 4294967296)) >> 0)); _tmp$3 = err; n = _tmp$2; err = _tmp$3; $24r$1 = [n, err]; $s = 12; case 12: return $24r$1; /* } */ case 8: cs.bytesRemain = (x$10 = cs.bytesRemain, x$11 = (new $Int64(0, n)), new $Int64(x$10.$high - x$11.$high, x$10.$low - x$11.$low)); /* */ if ($interfaceIsEqual(err, io.EOF) && (x$12 = cs.bytesRemain, (x$12.$high > 0 || (x$12.$high === 0 && x$12.$low > 0)))) { $s = 13; continue; } /* */ $s = 14; continue; /* if ($interfaceIsEqual(err, io.EOF) && (x$12 = cs.bytesRemain, (x$12.$high > 0 || (x$12.$high === 0 && x$12.$low > 0)))) { */ case 13: err = io.ErrUnexpectedEOF; cs.readErr = err; _tmp$4 = n; _tmp$5 = err; n = _tmp$4; err = _tmp$5; $24r$2 = [n, err]; $s = 15; case 15: return $24r$2; /* } */ case 14: /* } */ case 6: /* */ if (n === 0) { $s = 16; continue; } /* */ $s = 17; continue; /* if (n === 0) { */ case 16: $24r$3 = [n, err]; $s = 18; case 18: return $24r$3; /* } */ case 17: $r = cc.mu.Lock(); /* */ $s = 19; case 19: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(cc.mu, "Unlock"), []]); _tmp$6 = 0; _tmp$7 = 0; connAdd = _tmp$6; streamAdd = _tmp$7; v = cc.inflow.available(); if (v < 536870912) { connAdd = 1073741824 - v >> 0; cc.inflow.add(connAdd); } /* */ if ($interfaceIsEqual(err, $ifaceNil)) { $s = 20; continue; } /* */ $s = 21; continue; /* if ($interfaceIsEqual(err, $ifaceNil)) { */ case 20: _r$2 = cs.bufPipe.Len(); /* */ $s = 22; case 22: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } v$1 = ((cs.inflow.available() >> 0)) + _r$2 >> 0; if (v$1 < 4190208) { streamAdd = (((4194304 - v$1 >> 0) >> 0)); cs.inflow.add(streamAdd); } /* } */ case 21: /* */ if (!((connAdd === 0)) || !((streamAdd === 0))) { $s = 23; continue; } /* */ $s = 24; continue; /* if (!((connAdd === 0)) || !((streamAdd === 0))) { */ case 23: $r = cc.wmu.Lock(); /* */ $s = 25; case 25: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(cc.wmu, "Unlock"), []]); /* */ if (!((connAdd === 0))) { $s = 26; continue; } /* */ $s = 27; continue; /* if (!((connAdd === 0))) { */ case 26: _r$3 = cc.fr.WriteWindowUpdate(0, http2mustUint31(connAdd)); /* */ $s = 28; case 28: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; /* } */ case 27: /* */ if (!((streamAdd === 0))) { $s = 29; continue; } /* */ $s = 30; continue; /* if (!((streamAdd === 0))) { */ case 29: _r$4 = cc.fr.WriteWindowUpdate(cs.ID, http2mustUint31(streamAdd)); /* */ $s = 31; case 31: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; /* } */ case 30: _r$5 = cc.bw.Flush(); /* */ $s = 32; case 32: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; /* } */ case 24: $24r$4 = [n, err]; $s = 33; case 33: return $24r$4; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [n, err]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2transportResponseBody.ptr.prototype.Read }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $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._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.b = b; $f.cc = cc; $f.connAdd = connAdd; $f.cs = cs; $f.err = err; $f.n = n; $f.p = p; $f.streamAdd = streamAdd; $f.v = v; $f.v$1 = v$1; $f.x$10 = x$10; $f.x$11 = x$11; $f.x$12 = x$12; $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.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2transportResponseBody.prototype.Read = function(p) { return this.$val.Read(p); }; http2transportResponseBody.ptr.prototype.Close = function() { var _r$1, _r$2, _r$3, _r$4, _r$5, b, cc, cs, serverSentStreamEnd, unread, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; b = $f.b; cc = $f.cc; cs = $f.cs; serverSentStreamEnd = $f.serverSentStreamEnd; unread = $f.unread; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; cs = b.cs; cc = cs.cc; _r$1 = cs.bufPipe.Err(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } serverSentStreamEnd = $interfaceIsEqual(_r$1, io.EOF); _r$2 = cs.bufPipe.Len(); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } unread = _r$2; /* */ if (unread > 0 || !serverSentStreamEnd) { $s = 3; continue; } /* */ $s = 4; continue; /* if (unread > 0 || !serverSentStreamEnd) { */ case 3: $r = cc.mu.Lock(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = cc.wmu.Lock(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!serverSentStreamEnd) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!serverSentStreamEnd) { */ case 7: _r$3 = cc.fr.WriteRSTStream(cs.ID, 8); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; cs.didReset = true; /* } */ case 8: /* */ if (unread > 0) { $s = 10; continue; } /* */ $s = 11; continue; /* if (unread > 0) { */ case 10: cc.inflow.add(((unread >> 0))); _r$4 = cc.fr.WriteWindowUpdate(0, ((unread >>> 0))); /* */ $s = 12; case 12: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; /* } */ case 11: _r$5 = cc.bw.Flush(); /* */ $s = 13; case 13: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; $r = cc.wmu.Unlock(); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = cc.mu.Unlock(); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: $r = cs.bufPipe.BreakWithError(http2errClosedResponseBody); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = cc.forgetStreamID(cs.ID); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2transportResponseBody.ptr.prototype.Close }; } $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.b = b; $f.cc = cc; $f.cs = cs; $f.serverSentStreamEnd = serverSentStreamEnd; $f.unread = unread; $f.$s = $s; $f.$r = $r; return $f; }; http2transportResponseBody.prototype.Close = function() { return this.$val.Close(); }; http2clientConnReadLoop.ptr.prototype.processData = function(f) { var _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _tuple, cc, cs, data, didReset, err, f, neverSent, pad, refund, rl, x$5, x$6, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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 = $f._tuple; cc = $f.cc; cs = $f.cs; data = $f.data; didReset = $f.didReset; err = $f.err; f = $f.f; neverSent = $f.neverSent; pad = $f.pad; refund = $f.refund; rl = $f.rl; x$5 = $f.x$5; x$6 = $f.x$6; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rl = this; cc = rl.cc; _r$1 = cc.streamByID(f.http2FrameHeader.StreamID, f.StreamEnded()); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } cs = _r$1; data = f.Data(); /* */ if (cs === ptrType$104.nil) { $s = 2; continue; } /* */ $s = 3; continue; /* if (cs === ptrType$104.nil) { */ case 2: $r = cc.mu.Lock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } neverSent = cc.nextStreamID; $r = cc.mu.Unlock(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (f.http2FrameHeader.StreamID >= neverSent) { $s = 6; continue; } /* */ $s = 7; continue; /* if (f.http2FrameHeader.StreamID >= neverSent) { */ case 6: $r = cc.logf("http2: Transport received unsolicited DATA frame; closing connection", new sliceType([])); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return new http2ConnectionError(1); /* } */ case 7: /* */ if (f.http2FrameHeader.Length > 0) { $s = 9; continue; } /* */ $s = 10; continue; /* if (f.http2FrameHeader.Length > 0) { */ case 9: $r = cc.mu.Lock(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } cc.inflow.add(((f.http2FrameHeader.Length >> 0))); $r = cc.mu.Unlock(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = cc.wmu.Lock(); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$2 = cc.fr.WriteWindowUpdate(0, (f.http2FrameHeader.Length)); /* */ $s = 14; case 14: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; _r$3 = cc.bw.Flush(); /* */ $s = 15; case 15: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $r = cc.wmu.Unlock(); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 10: $s = -1; return $ifaceNil; /* } */ case 3: /* */ if (!cs.firstByte) { $s = 17; continue; } /* */ $s = 18; continue; /* if (!cs.firstByte) { */ case 17: $r = cc.logf("protocol error: received DATA before a HEADERS frame", new sliceType([])); /* */ $s = 19; case 19: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = rl.endStreamError(cs, (x$5 = new http2StreamError.ptr(f.http2FrameHeader.StreamID, 1, $ifaceNil), new x$5.constructor.elem(x$5))); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $ifaceNil; /* } */ case 18: /* */ if (f.http2FrameHeader.Length > 0) { $s = 21; continue; } /* */ $s = 22; continue; /* if (f.http2FrameHeader.Length > 0) { */ case 21: /* */ if (cs.req.Method === "HEAD" && data.$length > 0) { $s = 23; continue; } /* */ $s = 24; continue; /* if (cs.req.Method === "HEAD" && data.$length > 0) { */ case 23: $r = cc.logf("protocol error: received DATA on a HEAD request", new sliceType([])); /* */ $s = 25; case 25: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = rl.endStreamError(cs, (x$6 = new http2StreamError.ptr(f.http2FrameHeader.StreamID, 1, $ifaceNil), new x$6.constructor.elem(x$6))); /* */ $s = 26; case 26: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $ifaceNil; /* } */ case 24: $r = cc.mu.Lock(); /* */ $s = 27; case 27: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (cs.inflow.available() >= ((f.http2FrameHeader.Length >> 0))) { $s = 28; continue; } /* */ $s = 29; continue; /* if (cs.inflow.available() >= ((f.http2FrameHeader.Length >> 0))) { */ case 28: cs.inflow.take(((f.http2FrameHeader.Length >> 0))); $s = 30; continue; /* } else { */ case 29: $r = cc.mu.Unlock(); /* */ $s = 31; case 31: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return new http2ConnectionError(3); /* } */ case 30: refund = 0; pad = ((f.http2FrameHeader.Length >> 0)) - data.$length >> 0; if (pad > 0) { refund = refund + (pad) >> 0; } didReset = cs.didReset; if (didReset) { refund = refund + (data.$length) >> 0; } /* */ if (refund > 0) { $s = 32; continue; } /* */ $s = 33; continue; /* if (refund > 0) { */ case 32: cc.inflow.add(((refund >> 0))); $r = cc.wmu.Lock(); /* */ $s = 34; case 34: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$4 = cc.fr.WriteWindowUpdate(0, ((refund >>> 0))); /* */ $s = 35; case 35: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; /* */ if (!didReset) { $s = 36; continue; } /* */ $s = 37; continue; /* if (!didReset) { */ case 36: cs.inflow.add(((refund >> 0))); _r$5 = cc.fr.WriteWindowUpdate(cs.ID, ((refund >>> 0))); /* */ $s = 38; case 38: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; /* } */ case 37: _r$6 = cc.bw.Flush(); /* */ $s = 39; case 39: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; $r = cc.wmu.Unlock(); /* */ $s = 40; case 40: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 33: $r = cc.mu.Unlock(); /* */ $s = 41; case 41: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (data.$length > 0 && !didReset) { $s = 42; continue; } /* */ $s = 43; continue; /* if (data.$length > 0 && !didReset) { */ case 42: _r$7 = cs.bufPipe.Write(data); /* */ $s = 44; case 44: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _tuple = _r$7; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 45; continue; } /* */ $s = 46; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 45: $r = rl.endStreamError(cs, err); /* */ $s = 47; case 47: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return err; /* } */ case 46: /* } */ case 43: /* } */ case 22: /* */ if (f.StreamEnded()) { $s = 48; continue; } /* */ $s = 49; continue; /* if (f.StreamEnded()) { */ case 48: $r = rl.endStream(cs); /* */ $s = 50; case 50: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 49: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2clientConnReadLoop.ptr.prototype.processData }; } $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 = _tuple; $f.cc = cc; $f.cs = cs; $f.data = data; $f.didReset = didReset; $f.err = err; $f.f = f; $f.neverSent = neverSent; $f.pad = pad; $f.refund = refund; $f.rl = rl; $f.x$5 = x$5; $f.x$6 = x$6; $f.$s = $s; $f.$r = $r; return $f; }; http2clientConnReadLoop.prototype.processData = function(f) { return this.$val.processData(f); }; http2clientConnReadLoop.ptr.prototype.endStream = function(cs) { var cs, rl, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; cs = $f.cs; rl = $f.rl; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rl = this; $r = rl.endStreamError(cs, $ifaceNil); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2clientConnReadLoop.ptr.prototype.endStream }; } $f.cs = cs; $f.rl = rl; $f.$s = $s; $f.$r = $r; return $f; }; http2clientConnReadLoop.prototype.endStream = function(cs) { return this.$val.endStream(cs); }; http2clientConnReadLoop.ptr.prototype.endStreamError = function(cs, err) { var _selection, code, cs, err, rl, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _selection = $f._selection; code = $f.code; cs = $f.cs; err = $f.err; rl = $f.rl; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rl = this; code = $throwNilPointerError; if ($interfaceIsEqual(err, $ifaceNil)) { err = io.EOF; code = $methodVal(cs, "copyTrailers"); } if (http2isConnectionCloseRequest(cs.req)) { rl.closeWhenIdle = true; } $r = cs.bufPipe.closeWithErrorAndCode(err, code); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _selection = $select([[cs.resc, new http2resAndError.ptr(arrayType.zero(), ptrType$18.nil, err)], []]); if (_selection[0] === 0) { } else if (_selection[0] === 1) { } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2clientConnReadLoop.ptr.prototype.endStreamError }; } $f._selection = _selection; $f.code = code; $f.cs = cs; $f.err = err; $f.rl = rl; $f.$s = $s; $f.$r = $r; return $f; }; http2clientConnReadLoop.prototype.endStreamError = function(cs, err) { return this.$val.endStreamError(cs, err); }; http2clientStream.ptr.prototype.copyTrailers = function() { var _entry, _i, _key, _keys, _ref, cs, k, t, vv; cs = this; _ref = cs.trailer; _i = 0; _keys = $keys(_ref); while (true) { if (!(_i < _keys.length)) { break; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; continue; } k = _entry.k; vv = _entry.v; t = cs.resTrailer; if (t.$get() === false) { t.$set({}); } _key = k; (t.$get() || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: vv }; _i++; } }; http2clientStream.prototype.copyTrailers = function() { return this.$val.copyTrailers(); }; http2clientConnReadLoop.ptr.prototype.processGoAway = function(f) { var _r$1, cc, f, rl, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; cc = $f.cc; f = $f.f; rl = $f.rl; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rl = this; cc = rl.cc; _r$1 = cc.t.connPool(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = _r$1.MarkDead(cc); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!((f.ErrCode === 0))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!((f.ErrCode === 0))) { */ case 3: $r = cc.vlogf("transport got GOAWAY with error code = %v", new sliceType([new http2ErrCode(f.ErrCode)])); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: $r = cc.setGoAway(f); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2clientConnReadLoop.ptr.prototype.processGoAway }; } $f._r$1 = _r$1; $f.cc = cc; $f.f = f; $f.rl = rl; $f.$s = $s; $f.$r = $r; return $f; }; http2clientConnReadLoop.prototype.processGoAway = function(f) { return this.$val.processGoAway(f); }; http2clientConnReadLoop.ptr.prototype.processSettings = function(f) { var $24r, $24r$1, $24r$2, $24r$3, _r$1, _r$2, _r$3, cc, err, f, rl, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; cc = $f.cc; err = $f.err; f = $f.f; rl = $f.rl; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); cc = [cc]; rl = this; cc[0] = rl.cc; $r = cc[0].mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(cc[0].mu, "Unlock"), []]); /* */ if (f.IsAck()) { $s = 2; continue; } /* */ $s = 3; continue; /* if (f.IsAck()) { */ case 2: /* */ if (cc[0].wantSettingsAck) { $s = 4; continue; } /* */ $s = 5; continue; /* if (cc[0].wantSettingsAck) { */ case 4: cc[0].wantSettingsAck = false; $24r = $ifaceNil; $s = 6; case 6: return $24r; /* } */ case 5: $24r$1 = new http2ConnectionError(1); $s = 7; case 7: return $24r$1; /* } */ case 3: _r$1 = f.ForeachSetting((function(cc) { return function $b(s) { var _1, _entry, _i, _keys, _ref, cs, delta, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _entry = $f._entry; _i = $f._i; _keys = $f._keys; _ref = $f._ref; cs = $f.cs; delta = $f.delta; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _1 = s.ID; /* */ if (_1 === (5)) { $s = 2; continue; } /* */ if (_1 === (3)) { $s = 3; continue; } /* */ if (_1 === (6)) { $s = 4; continue; } /* */ if (_1 === (4)) { $s = 5; continue; } /* */ $s = 6; continue; /* if (_1 === (5)) { */ case 2: cc[0].maxFrameSize = s.Val; $s = 7; continue; /* } else if (_1 === (3)) { */ case 3: cc[0].maxConcurrentStreams = s.Val; $s = 7; continue; /* } else if (_1 === (6)) { */ case 4: cc[0].peerMaxHeaderListSize = (new $Uint64(0, s.Val)); $s = 7; continue; /* } else if (_1 === (4)) { */ case 5: if (s.Val > 2147483647) { $s = -1; return new http2ConnectionError(3); } delta = ((s.Val >> 0)) - ((cc[0].initialWindowSize >> 0)) >> 0; _ref = cc[0].streams; _i = 0; _keys = $keys(_ref); while (true) { if (!(_i < _keys.length)) { break; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; continue; } cs = _entry.v; cs.flow.add(delta); _i++; } $r = cc[0].cond.Broadcast(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } cc[0].initialWindowSize = s.Val; $s = 7; continue; /* } else { */ case 6: $r = cc[0].vlogf("Unhandled Setting: %v", new sliceType([new s.constructor.elem(s)])); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 7: case 1: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._1 = _1; $f._entry = _entry; $f._i = _i; $f._keys = _keys; $f._ref = _ref; $f.cs = cs; $f.delta = delta; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; })(cc)); /* */ $s = 8; case 8: 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))) { $s = 9; continue; } /* */ $s = 10; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 9: $24r$2 = err; $s = 11; case 11: return $24r$2; /* } */ case 10: $r = cc[0].wmu.Lock(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(cc[0].wmu, "Unlock"), []]); _r$2 = cc[0].fr.WriteSettingsAck(); /* */ $s = 13; case 13: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; _r$3 = cc[0].bw.Flush(); /* */ $s = 14; case 14: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $24r$3 = cc[0].werr; $s = 15; case 15: return $24r$3; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2clientConnReadLoop.ptr.prototype.processSettings }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.cc = cc; $f.err = err; $f.f = f; $f.rl = rl; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2clientConnReadLoop.prototype.processSettings = function(f) { return this.$val.processSettings(f); }; http2clientConnReadLoop.ptr.prototype.processWindowUpdate = function(f) { var $24r, $24r$1, $24r$2, _r$1, cc, cs, f, fl, rl, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _r$1 = $f._r$1; cc = $f.cc; cs = $f.cs; f = $f.f; fl = $f.fl; rl = $f.rl; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); rl = this; cc = rl.cc; _r$1 = cc.streamByID(f.http2FrameHeader.StreamID, false); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } cs = _r$1; /* */ if (!((f.http2FrameHeader.StreamID === 0)) && cs === ptrType$104.nil) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!((f.http2FrameHeader.StreamID === 0)) && cs === ptrType$104.nil) { */ case 2: $24r = $ifaceNil; $s = 4; case 4: return $24r; /* } */ case 3: $r = cc.mu.Lock(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(cc.mu, "Unlock"), []]); fl = cc.flow; if (!(cs === ptrType$104.nil)) { fl = cs.flow; } /* */ if (!fl.add(((f.Increment >> 0)))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!fl.add(((f.Increment >> 0)))) { */ case 6: $24r$1 = new http2ConnectionError(3); $s = 8; case 8: return $24r$1; /* } */ case 7: $r = cc.cond.Broadcast(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $24r$2 = $ifaceNil; $s = 10; case 10: return $24r$2; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2clientConnReadLoop.ptr.prototype.processWindowUpdate }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._r$1 = _r$1; $f.cc = cc; $f.cs = cs; $f.f = f; $f.fl = fl; $f.rl = rl; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2clientConnReadLoop.prototype.processWindowUpdate = function(f) { return this.$val.processWindowUpdate(f); }; http2clientConnReadLoop.ptr.prototype.processResetStream = function(f) { var _r$1, _selection, cs, err, f, rl, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _selection = $f._selection; cs = $f.cs; err = $f.err; f = $f.f; rl = $f.rl; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rl = this; _r$1 = rl.cc.streamByID(f.http2FrameHeader.StreamID, true); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } cs = _r$1; if (cs === ptrType$104.nil) { $s = -1; return $ifaceNil; } _selection = $select([[cs.peerReset], []]); /* */ if (_selection[0] === 0) { $s = 2; continue; } /* */ if (_selection[0] === 1) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_selection[0] === 0) { */ case 2: $s = 4; continue; /* } else if (_selection[0] === 1) { */ case 3: err = $clone(http2streamError(cs.ID, f.ErrCode), http2StreamError); cs.resetErr = new err.constructor.elem(err); $close(cs.peerReset); $r = cs.bufPipe.CloseWithError(new err.constructor.elem(err)); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = cs.cc.cond.Broadcast(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2clientConnReadLoop.ptr.prototype.processResetStream }; } $f._r$1 = _r$1; $f._selection = _selection; $f.cs = cs; $f.err = err; $f.f = f; $f.rl = rl; $f.$s = $s; $f.$r = $r; return $f; }; http2clientConnReadLoop.prototype.processResetStream = function(f) { return this.$val.processResetStream(f); }; http2ClientConn.ptr.prototype.Ping = function(ctx) { var $24r, _entry, _key, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _selection, _tuple, _tuple$1, c, cc, ctx, err, err$1, err$2, found, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _entry = $f._entry; _key = $f._key; _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; _selection = $f._selection; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; c = $f.c; cc = $f.cc; ctx = $f.ctx; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; found = $f.found; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cc = this; c = new $Chan(structType, 0); p = arrayType$8.zero(); /* while (true) { */ case 1: _r$1 = rand$1.Read(new sliceType$3(p)); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $r = cc.mu.Lock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tuple$1 = (_entry = cc.pings[arrayType$8.keyFor(p)], _entry !== undefined ? [_entry.v, true] : [$chanNil, false]); found = _tuple$1[1]; /* */ if (!found) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!found) { */ case 5: _key = $clone(p, arrayType$8); (cc.pings || $throwRuntimeError("assignment to entry in nil map"))[arrayType$8.keyFor(_key)] = { k: _key, v: c }; $r = cc.mu.Unlock(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* break; */ $s = 2; continue; /* } */ case 6: $r = cc.mu.Unlock(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 1; continue; case 2: $r = cc.wmu.Lock(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$2 = cc.fr.WritePing(false, $clone(p, arrayType$8)); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } err$1 = _r$2; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 11; continue; } /* */ $s = 12; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 11: $r = cc.wmu.Unlock(); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return err$1; /* } */ case 12: _r$3 = cc.bw.Flush(); /* */ $s = 14; case 14: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } err$2 = _r$3; /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 15; continue; } /* */ $s = 16; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 15: $r = cc.wmu.Unlock(); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return err$2; /* } */ case 16: $r = cc.wmu.Unlock(); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$4 = ctx.Done(); /* */ $s = 19; case 19: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = $select([[c], [_r$4], [cc.readerDone]]); /* */ $s = 20; case 20: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _selection = _r$5; /* */ if (_selection[0] === 0) { $s = 21; continue; } /* */ if (_selection[0] === 1) { $s = 22; continue; } /* */ if (_selection[0] === 2) { $s = 23; continue; } /* */ $s = 24; continue; /* if (_selection[0] === 0) { */ case 21: $s = -1; return $ifaceNil; /* } else if (_selection[0] === 1) { */ case 22: _r$6 = ctx.Err(); /* */ $s = 25; case 25: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } $24r = _r$6; $s = 26; case 26: return $24r; /* } else if (_selection[0] === 2) { */ case 23: $s = -1; return cc.readerErr; /* } */ case 24: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2ClientConn.ptr.prototype.Ping }; } $f.$24r = $24r; $f._entry = _entry; $f._key = _key; $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._selection = _selection; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.c = c; $f.cc = cc; $f.ctx = ctx; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.found = found; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; http2ClientConn.prototype.Ping = function(ctx) { return this.$val.Ping(ctx); }; http2clientConnReadLoop.ptr.prototype.processPing = function(f) { var $24r, $24r$1, $24r$2, _entry, _r$1, _r$2, _tuple, c, cc, cc$1, err, f, ok, rl, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _entry = $f._entry; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; c = $f.c; cc = $f.cc; cc$1 = $f.cc$1; err = $f.err; f = $f.f; ok = $f.ok; rl = $f.rl; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); rl = this; /* */ if (f.IsAck()) { $s = 1; continue; } /* */ $s = 2; continue; /* if (f.IsAck()) { */ case 1: cc = rl.cc; $r = cc.mu.Lock(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(cc.mu, "Unlock"), []]); _tuple = (_entry = cc.pings[arrayType$8.keyFor(f.Data)], _entry !== undefined ? [_entry.v, true] : [$chanNil, false]); c = _tuple[0]; ok = _tuple[1]; if (ok) { $close(c); delete cc.pings[arrayType$8.keyFor(f.Data)]; } $24r = $ifaceNil; $s = 4; case 4: return $24r; /* } */ case 2: cc$1 = rl.cc; $r = cc$1.wmu.Lock(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(cc$1.wmu, "Unlock"), []]); _r$1 = cc$1.fr.WritePing(true, $clone(f.Data, arrayType$8)); /* */ $s = 6; case 6: 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))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 7: $24r$1 = err; $s = 9; case 9: return $24r$1; /* } */ case 8: _r$2 = cc$1.bw.Flush(); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r$2 = _r$2; $s = 11; case 11: return $24r$2; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2clientConnReadLoop.ptr.prototype.processPing }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._entry = _entry; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.c = c; $f.cc = cc; $f.cc$1 = cc$1; $f.err = err; $f.f = f; $f.ok = ok; $f.rl = rl; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2clientConnReadLoop.prototype.processPing = function(f) { return this.$val.processPing(f); }; http2clientConnReadLoop.ptr.prototype.processPushPromise = function(f) { var f, rl; rl = this; return new http2ConnectionError(1); }; http2clientConnReadLoop.prototype.processPushPromise = function(f) { return this.$val.processPushPromise(f); }; http2ClientConn.ptr.prototype.writeStreamReset = function(streamID, code, err) { var _r$1, _r$2, cc, code, err, streamID, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; cc = $f.cc; code = $f.code; err = $f.err; streamID = $f.streamID; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cc = this; $r = cc.wmu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = cc.fr.WriteRSTStream(streamID, code); /* */ $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$2 = cc.bw.Flush(); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; $r = cc.wmu.Unlock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2ClientConn.ptr.prototype.writeStreamReset }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f.cc = cc; $f.code = code; $f.err = err; $f.streamID = streamID; $f.$s = $s; $f.$r = $r; return $f; }; http2ClientConn.prototype.writeStreamReset = function(streamID, code, err) { return this.$val.writeStreamReset(streamID, code, err); }; http2ClientConn.ptr.prototype.logf = function(format, args) { var args, cc, format, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; args = $f.args; cc = $f.cc; format = $f.format; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cc = this; $r = cc.t.logf(format, args); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2ClientConn.ptr.prototype.logf }; } $f.args = args; $f.cc = cc; $f.format = format; $f.$s = $s; $f.$r = $r; return $f; }; http2ClientConn.prototype.logf = function(format, args) { return this.$val.logf(format, args); }; http2ClientConn.ptr.prototype.vlogf = function(format, args) { var args, cc, format, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; args = $f.args; cc = $f.cc; format = $f.format; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cc = this; $r = cc.t.vlogf(format, args); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2ClientConn.ptr.prototype.vlogf }; } $f.args = args; $f.cc = cc; $f.format = format; $f.$s = $s; $f.$r = $r; return $f; }; http2ClientConn.prototype.vlogf = function(format, args) { return this.$val.vlogf(format, args); }; http2Transport.ptr.prototype.vlogf = function(format, args) { var args, format, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; args = $f.args; format = $f.format; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; /* */ if (http2VerboseLogs) { $s = 1; continue; } /* */ $s = 2; continue; /* if (http2VerboseLogs) { */ case 1: $r = t.logf(format, args); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2Transport.ptr.prototype.vlogf }; } $f.args = args; $f.format = format; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; http2Transport.prototype.vlogf = function(format, args) { return this.$val.vlogf(format, args); }; http2Transport.ptr.prototype.logf = function(format, args) { var args, format, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; args = $f.args; format = $f.format; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; $r = log.Printf(format, args); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2Transport.ptr.prototype.logf }; } $f.args = args; $f.format = format; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; http2Transport.prototype.logf = function(format, args) { return this.$val.logf(format, args); }; http2strSliceContains = function(ss, s) { var _i, _ref, s, ss, v; _ref = ss; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (v === s) { return true; } _i++; } return false; }; http2erringRoundTripper.ptr.prototype.RoundTripErr = function() { var rt; rt = this; return rt.err; }; http2erringRoundTripper.prototype.RoundTripErr = function() { return this.$val.RoundTripErr(); }; http2erringRoundTripper.ptr.prototype.RoundTrip = function(param) { var param, rt; rt = this; return [ptrType$18.nil, rt.err]; }; http2erringRoundTripper.prototype.RoundTrip = function(param) { return this.$val.RoundTrip(param); }; http2gzipReader.ptr.prototype.Read = function(p) { var $24r, _r$1, _r$2, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, err, gz, n, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; err = $f.err; gz = $f.gz; n = $f.n; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; gz = this; if (!($interfaceIsEqual(gz.zerr, $ifaceNil))) { _tmp = 0; _tmp$1 = gz.zerr; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } /* */ if (gz.zr === ptrType$33.nil) { $s = 1; continue; } /* */ $s = 2; continue; /* if (gz.zr === ptrType$33.nil) { */ case 1: _r$1 = gzip.NewReader(gz.body); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; gz.zr = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { gz.zerr = err; _tmp$2 = 0; _tmp$3 = err; n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; } /* } */ case 2: _r$2 = gz.zr.Read(p); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; n = _tuple$1[0]; err = _tuple$1[1]; $24r = [n, err]; $s = 5; case 5: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2gzipReader.ptr.prototype.Read }; } $f.$24r = $24r; $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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.err = err; $f.gz = gz; $f.n = n; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; http2gzipReader.prototype.Read = function(p) { return this.$val.Read(p); }; http2gzipReader.ptr.prototype.Close = function() { var $24r, _r$1, gz, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; gz = $f.gz; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: gz = this; _r$1 = gz.body.Close(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2gzipReader.ptr.prototype.Close }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.gz = gz; $f.$s = $s; $f.$r = $r; return $f; }; http2gzipReader.prototype.Close = function() { return this.$val.Close(); }; http2Transport.ptr.prototype.getBodyWriterState = function(cs, body$1) { var _entry, _r$1, body$1, cs, resc, s, t, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _r$1 = $f._r$1; body$1 = $f.body$1; cs = $f.cs; resc = $f.resc; s = $f.s; t = $f.t; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: body$1 = [body$1]; cs = [cs]; resc = [resc]; s = [s]; s[0] = new http2bodyWriterState.ptr(ptrType$104.nil, ptrType$25.nil, ptrType$105.nil, $throwNilPointerError, $chanNil, new time.Duration(0, 0)); t = this; s[0].cs = cs[0]; if ($interfaceIsEqual(body$1[0], $ifaceNil)) { $s = -1; return s[0]; } resc[0] = new $Chan($error, 1); s[0].resc = resc[0]; s[0].fn = (function(body$1, cs, resc, s) { return function $b() { var _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = cs[0].cc.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } cs[0].startedWrite = true; $r = cs[0].cc.mu.Unlock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = cs[0].writeRequestBody(body$1[0], cs[0].req.Body); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = $send(resc[0], _r$1); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }; })(body$1, cs, resc, s); s[0].delay = t.expectContinueTimeout(); if ((x$5 = s[0].delay, (x$5.$high === 0 && x$5.$low === 0)) || !httpguts.HeaderValuesContainsToken((_entry = cs[0].req.Header[$String.keyFor("Expect")], _entry !== undefined ? _entry.v : sliceType$2.nil), "100-continue")) { $s = -1; return s[0]; } s[0].fnonce = new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)); _r$1 = time.AfterFunc(new time.Duration(7342547, 765657088), (function(body$1, cs, resc, s) { return function $b() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = s[0].fnonce.Do(s[0].fn); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$s = $s; $f.$r = $r; return $f; }; })(body$1, cs, resc, s)); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } s[0].timer = _r$1; $s = -1; return s[0]; /* */ } return; } if ($f === undefined) { $f = { $blk: http2Transport.ptr.prototype.getBodyWriterState }; } $f._entry = _entry; $f._r$1 = _r$1; $f.body$1 = body$1; $f.cs = cs; $f.resc = resc; $f.s = s; $f.t = t; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; http2Transport.prototype.getBodyWriterState = function(cs, body$1) { return this.$val.getBodyWriterState(cs, body$1); }; http2bodyWriterState.ptr.prototype.cancel = function() { var s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; /* */ if (!(s.timer === ptrType$25.nil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(s.timer === ptrType$25.nil)) { */ case 1: /* */ if (s.timer.Stop()) { $s = 3; continue; } /* */ $s = 4; continue; /* if (s.timer.Stop()) { */ case 3: $r = $send(s.resc, $ifaceNil); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2bodyWriterState.ptr.prototype.cancel }; } $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; http2bodyWriterState.prototype.cancel = function() { return this.$val.cancel(); }; http2bodyWriterState.ptr.prototype.on100 = function() { var s; s = this; if (s.timer === ptrType$25.nil) { return; } s.timer.Stop(); $go((function $b() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = s.fnonce.Do(s.fn); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$s = $s; $f.$r = $r; return $f; }), []); }; http2bodyWriterState.prototype.on100 = function() { return this.$val.on100(); }; http2bodyWriterState.ptr.prototype.scheduleBodyWrite = function() { var _r$1, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; /* */ if (s.timer === ptrType$25.nil) { $s = 1; continue; } /* */ $s = 2; continue; /* if (s.timer === ptrType$25.nil) { */ case 1: $go(s.fn, []); $s = -1; return; /* } */ case 2: $r = http2traceWait100Continue(s.cs.trace); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (s.timer.Stop()) { $s = 4; continue; } /* */ $s = 5; continue; /* if (s.timer.Stop()) { */ case 4: _r$1 = s.timer.Reset(s.delay); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; /* } */ case 5: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2bodyWriterState.ptr.prototype.scheduleBodyWrite }; } $f._r$1 = _r$1; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; http2bodyWriterState.prototype.scheduleBodyWrite = function() { return this.$val.scheduleBodyWrite(); }; http2isConnectionCloseRequest = function(req) { var _entry, req; return req.Close || httpguts.HeaderValuesContainsToken((_entry = req.Header[$String.keyFor("Connection")], _entry !== undefined ? _entry.v : sliceType$2.nil), "close"); }; http2registerHTTPSProtocol = function(t, rt) { var $24r, err, rt, t, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; err = $f.err; rt = $f.rt; t = $f.t; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); err = [err]; err[0] = $ifaceNil; $deferred.push([(function(err) { return function $b() { var _r$1, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = $recover(); /* */ if (!($interfaceIsEqual(e, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(e, $ifaceNil))) { */ case 1: _r$1 = fmt.Errorf("%v", new sliceType([e])); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err[0] = _r$1; /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$1 = _r$1; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; })(err), []]); $r = t.RegisterProtocol("https", new rt.constructor.elem(rt)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } err[0] = $ifaceNil; $24r = err[0]; $s = 2; case 2: return $24r; /* */ } 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: http2registerHTTPSProtocol }; } $f.$24r = $24r; $f.err = err; $f.rt = rt; $f.t = t; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2noDialH2RoundTripper.ptr.prototype.RoundTrip = function(req) { var _r$1, _tuple, err, req, res, rt, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; req = $f.req; res = $f.res; rt = $f.rt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rt = this; _r$1 = rt.http2Transport.RoundTrip(req); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; res = _tuple[0]; err = _tuple[1]; if (http2isNoCachedConnError(err)) { $s = -1; return [ptrType$18.nil, $pkg.ErrSkipAltProtocol]; } $s = -1; return [res, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: http2noDialH2RoundTripper.ptr.prototype.RoundTrip }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.req = req; $f.res = res; $f.rt = rt; $f.$s = $s; $f.$r = $r; return $f; }; http2noDialH2RoundTripper.prototype.RoundTrip = function(req) { return this.$val.RoundTrip(req); }; http2Transport.ptr.prototype.idleConnTimeout = function() { var t; t = this; if (!(t.t1 === ptrType$27.nil)) { return t.t1.IdleConnTimeout; } return new time.Duration(0, 0); }; http2Transport.prototype.idleConnTimeout = function() { return this.$val.idleConnTimeout(); }; http2traceGetConn = function(req, hostPort) { var _r$1, hostPort, req, trace, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; hostPort = $f.hostPort; req = $f.req; trace = $f.trace; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = httptrace.ContextClientTrace(req.Context()); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } trace = _r$1; if (trace === ptrType$19.nil || trace.GetConn === $throwNilPointerError) { $s = -1; return; } $r = trace.GetConn(hostPort); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2traceGetConn }; } $f._r$1 = _r$1; $f.hostPort = hostPort; $f.req = req; $f.trace = trace; $f.$s = $s; $f.$r = $r; return $f; }; http2traceGotConn = function(req, cc, reused) { var _r$1, _r$2, _r$3, cc, ci, req, reused, trace, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; cc = $f.cc; ci = $f.ci; req = $f.req; reused = $f.reused; trace = $f.trace; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = httptrace.ContextClientTrace(req.Context()); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } trace = _r$1; if (trace === ptrType$19.nil || trace.GotConn === $throwNilPointerError) { $s = -1; return; } ci = new httptrace.GotConnInfo.ptr(cc.tconn, false, false, new time.Duration(0, 0)); ci.Reused = reused; $r = cc.mu.Lock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } ci.WasIdle = ($keys(cc.streams).length === 0) && reused; /* */ if (ci.WasIdle && !$clone(cc.lastActive, time.Time).IsZero()) { $s = 3; continue; } /* */ $s = 4; continue; /* if (ci.WasIdle && !$clone(cc.lastActive, time.Time).IsZero()) { */ case 3: _r$2 = time.Now(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = $clone(_r$2, time.Time).Sub($clone(cc.lastActive, time.Time)); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } ci.IdleTime = _r$3; /* } */ case 4: $r = cc.mu.Unlock(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = trace.GotConn($clone(ci, httptrace.GotConnInfo)); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2traceGotConn }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.cc = cc; $f.ci = ci; $f.req = req; $f.reused = reused; $f.trace = trace; $f.$s = $s; $f.$r = $r; return $f; }; http2traceWroteHeaders = function(trace) { var trace, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; trace = $f.trace; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (!(trace === ptrType$19.nil) && !(trace.WroteHeaders === $throwNilPointerError)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(trace === ptrType$19.nil) && !(trace.WroteHeaders === $throwNilPointerError)) { */ case 1: $r = trace.WroteHeaders(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2traceWroteHeaders }; } $f.trace = trace; $f.$s = $s; $f.$r = $r; return $f; }; http2traceGot100Continue = function(trace) { var trace, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; trace = $f.trace; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (!(trace === ptrType$19.nil) && !(trace.Got100Continue === $throwNilPointerError)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(trace === ptrType$19.nil) && !(trace.Got100Continue === $throwNilPointerError)) { */ case 1: $r = trace.Got100Continue(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2traceGot100Continue }; } $f.trace = trace; $f.$s = $s; $f.$r = $r; return $f; }; http2traceWait100Continue = function(trace) { var trace, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; trace = $f.trace; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (!(trace === ptrType$19.nil) && !(trace.Wait100Continue === $throwNilPointerError)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(trace === ptrType$19.nil) && !(trace.Wait100Continue === $throwNilPointerError)) { */ case 1: $r = trace.Wait100Continue(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2traceWait100Continue }; } $f.trace = trace; $f.$s = $s; $f.$r = $r; return $f; }; http2traceWroteRequest = function(trace, err) { var err, trace, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; trace = $f.trace; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (!(trace === ptrType$19.nil) && !(trace.WroteRequest === $throwNilPointerError)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(trace === ptrType$19.nil) && !(trace.WroteRequest === $throwNilPointerError)) { */ case 1: $r = trace.WroteRequest(new httptrace.WroteRequestInfo.ptr(err)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2traceWroteRequest }; } $f.err = err; $f.trace = trace; $f.$s = $s; $f.$r = $r; return $f; }; http2traceFirstResponseByte = function(trace) { var trace, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; trace = $f.trace; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (!(trace === ptrType$19.nil) && !(trace.GotFirstResponseByte === $throwNilPointerError)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(trace === ptrType$19.nil) && !(trace.GotFirstResponseByte === $throwNilPointerError)) { */ case 1: $r = trace.GotFirstResponseByte(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2traceFirstResponseByte }; } $f.trace = trace; $f.$s = $s; $f.$r = $r; return $f; }; http2writeEndsStream = function(w) { var _ref, v, v$1, v$2, w; _ref = w; if ($assertType(_ref, ptrType$92, true)[1]) { v = _ref.$val; return v.endStream; } else if ($assertType(_ref, ptrType$93, true)[1]) { v$1 = _ref.$val; return v$1.endStream; } else if (_ref === $ifaceNil) { v$2 = _ref; $panic(new $String("writeEndsStream called on nil writeFramer")); } return false; }; http2flushFrameWriter.ptr.prototype.writeFrame = function(ctx) { var $24r, _r$1, ctx, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; ctx = $f.ctx; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = ctx.Flush(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2flushFrameWriter.ptr.prototype.writeFrame }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.ctx = ctx; $f.$s = $s; $f.$r = $r; return $f; }; http2flushFrameWriter.prototype.writeFrame = function(ctx) { return this.$val.writeFrame(ctx); }; http2flushFrameWriter.ptr.prototype.staysWithinBuffer = function(max) { var max; return false; }; http2flushFrameWriter.prototype.staysWithinBuffer = function(max) { return this.$val.staysWithinBuffer(max); }; http2writeSettings.prototype.staysWithinBuffer = function(max) { var max, s; s = this; return (9 + ($imul(6, s.$length)) >> 0) <= max; }; $ptrType(http2writeSettings).prototype.staysWithinBuffer = function(max) { return this.$get().staysWithinBuffer(max); }; http2writeSettings.prototype.writeFrame = function(ctx) { var $24r, _r$1, _r$2, ctx, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; ctx = $f.ctx; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; _r$1 = ctx.Framer(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = _r$1.WriteSettings(($convertSliceType(s, sliceType$23))); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2writeSettings.prototype.writeFrame }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.ctx = ctx; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(http2writeSettings).prototype.writeFrame = function(ctx) { return this.$get().writeFrame(ctx); }; http2writeGoAway.ptr.prototype.writeFrame = function(ctx) { var _r$1, _r$2, _r$3, ctx, err, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; ctx = $f.ctx; err = $f.err; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; _r$1 = ctx.Framer(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = _r$1.WriteGoAway(p.maxStreamID, p.code, sliceType$3.nil); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } err = _r$2; _r$3 = ctx.Flush(); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: http2writeGoAway.ptr.prototype.writeFrame }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.ctx = ctx; $f.err = err; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; http2writeGoAway.prototype.writeFrame = function(ctx) { return this.$val.writeFrame(ctx); }; http2writeGoAway.ptr.prototype.staysWithinBuffer = function(max) { var max; return false; }; http2writeGoAway.prototype.staysWithinBuffer = function(max) { return this.$val.staysWithinBuffer(max); }; http2writeData.ptr.prototype.String = function() { var $24r, _r$1, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: w = this; _r$1 = fmt.Sprintf("writeData(stream=%d, p=%d, endStream=%v)", new sliceType([new $Uint32(w.streamID), new $Int(w.p.$length), new $Bool(w.endStream)])); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2writeData.ptr.prototype.String }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; http2writeData.prototype.String = function() { return this.$val.String(); }; http2writeData.ptr.prototype.writeFrame = function(ctx) { var $24r, _r$1, _r$2, ctx, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; ctx = $f.ctx; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: w = this; _r$1 = ctx.Framer(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = _r$1.WriteData(w.streamID, w.endStream, w.p); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2writeData.ptr.prototype.writeFrame }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.ctx = ctx; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; http2writeData.prototype.writeFrame = function(ctx) { return this.$val.writeFrame(ctx); }; http2writeData.ptr.prototype.staysWithinBuffer = function(max) { var max, w; w = this; return (9 + w.p.$length >> 0) <= max; }; http2writeData.prototype.staysWithinBuffer = function(max) { return this.$val.staysWithinBuffer(max); }; http2handlerPanicRST.ptr.prototype.writeFrame = function(ctx) { var $24r, _r$1, _r$2, ctx, hp, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; ctx = $f.ctx; hp = $f.hp; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hp = this; _r$1 = ctx.Framer(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = _r$1.WriteRSTStream(hp.StreamID, 2); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2handlerPanicRST.ptr.prototype.writeFrame }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.ctx = ctx; $f.hp = hp; $f.$s = $s; $f.$r = $r; return $f; }; http2handlerPanicRST.prototype.writeFrame = function(ctx) { return this.$val.writeFrame(ctx); }; http2handlerPanicRST.ptr.prototype.staysWithinBuffer = function(max) { var hp, max; hp = this; return 13 <= max; }; http2handlerPanicRST.prototype.staysWithinBuffer = function(max) { return this.$val.staysWithinBuffer(max); }; http2StreamError.ptr.prototype.writeFrame = function(ctx) { var $24r, _r$1, _r$2, ctx, se, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; ctx = $f.ctx; se = $f.se; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: se = this; _r$1 = ctx.Framer(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = _r$1.WriteRSTStream(se.StreamID, se.Code); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2StreamError.ptr.prototype.writeFrame }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.ctx = ctx; $f.se = se; $f.$s = $s; $f.$r = $r; return $f; }; http2StreamError.prototype.writeFrame = function(ctx) { return this.$val.writeFrame(ctx); }; http2StreamError.ptr.prototype.staysWithinBuffer = function(max) { var max, se; se = this; return 13 <= max; }; http2StreamError.prototype.staysWithinBuffer = function(max) { return this.$val.staysWithinBuffer(max); }; http2writePingAck.ptr.prototype.writeFrame = function(ctx) { var $24r, _r$1, _r$2, ctx, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; ctx = $f.ctx; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: w = this; _r$1 = ctx.Framer(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = _r$1.WritePing(true, $clone(w.pf.Data, arrayType$8)); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2writePingAck.ptr.prototype.writeFrame }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.ctx = ctx; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; http2writePingAck.prototype.writeFrame = function(ctx) { return this.$val.writeFrame(ctx); }; http2writePingAck.ptr.prototype.staysWithinBuffer = function(max) { var max, w; w = this; return 17 <= max; }; http2writePingAck.prototype.staysWithinBuffer = function(max) { return this.$val.staysWithinBuffer(max); }; http2writeSettingsAck.ptr.prototype.writeFrame = function(ctx) { var $24r, _r$1, _r$2, ctx, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; ctx = $f.ctx; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = ctx.Framer(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = _r$1.WriteSettingsAck(); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2writeSettingsAck.ptr.prototype.writeFrame }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.ctx = ctx; $f.$s = $s; $f.$r = $r; return $f; }; http2writeSettingsAck.prototype.writeFrame = function(ctx) { return this.$val.writeFrame(ctx); }; http2writeSettingsAck.ptr.prototype.staysWithinBuffer = function(max) { var max; return 9 <= max; }; http2writeSettingsAck.prototype.staysWithinBuffer = function(max) { return this.$val.staysWithinBuffer(max); }; http2splitHeaderBlock = function(ctx, headerBlock, fn) { var _r$1, ctx, err, first, fn, frag, headerBlock, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; ctx = $f.ctx; err = $f.err; first = $f.first; fn = $f.fn; frag = $f.frag; headerBlock = $f.headerBlock; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: first = true; /* while (true) { */ case 1: /* if (!(headerBlock.$length > 0)) { break; } */ if(!(headerBlock.$length > 0)) { $s = 2; continue; } frag = headerBlock; if (frag.$length > 16384) { frag = $subslice(frag, 0, 16384); } headerBlock = $subslice(headerBlock, frag.$length); _r$1 = fn(ctx, frag, first, headerBlock.$length === 0); /* */ $s = 3; case 3: 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))) { $s = -1; return err; } first = false; $s = 1; continue; case 2: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2splitHeaderBlock }; } $f._r$1 = _r$1; $f.ctx = ctx; $f.err = err; $f.first = first; $f.fn = fn; $f.frag = frag; $f.headerBlock = headerBlock; $f.$s = $s; $f.$r = $r; return $f; }; http2encKV = function(enc, k, v) { var _r$1, enc, k, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; enc = $f.enc; k = $f.k; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (http2VerboseLogs) { $s = 1; continue; } /* */ $s = 2; continue; /* if (http2VerboseLogs) { */ case 1: $r = log.Printf("http2: server encoding header %q = %q", new sliceType([new $String(k), new $String(v)])); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: _r$1 = enc.WriteField(new hpack.HeaderField.ptr(k, v, false)); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2encKV }; } $f._r$1 = _r$1; $f.enc = enc; $f.k = k; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; http2writeResHeaders.ptr.prototype.staysWithinBuffer = function(max) { var max, w; w = this; return false; }; http2writeResHeaders.prototype.staysWithinBuffer = function(max) { return this.$val.staysWithinBuffer(max); }; http2writeResHeaders.ptr.prototype.writeFrame = function(ctx) { var $24r, _r$1, _r$2, _tuple, buf, ctx, enc, headerBlock, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; buf = $f.buf; ctx = $f.ctx; enc = $f.enc; headerBlock = $f.headerBlock; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: w = this; _r$1 = ctx.HeaderEncoder(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; enc = _tuple[0]; buf = _tuple[1]; buf.Reset(); /* */ if (!((w.httpResCode === 0))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!((w.httpResCode === 0))) { */ case 2: $r = http2encKV(enc, ":status", http2httpCodeString(w.httpResCode)); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: $r = http2encodeHeaders(enc, w.h, w.trailers); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!(w.contentType === "")) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!(w.contentType === "")) { */ case 6: $r = http2encKV(enc, "content-type", w.contentType); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 7: /* */ if (!(w.contentLength === "")) { $s = 9; continue; } /* */ $s = 10; continue; /* if (!(w.contentLength === "")) { */ case 9: $r = http2encKV(enc, "content-length", w.contentLength); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 10: /* */ if (!(w.date === "")) { $s = 12; continue; } /* */ $s = 13; continue; /* if (!(w.date === "")) { */ case 12: $r = http2encKV(enc, "date", w.date); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 13: headerBlock = buf.Bytes(); if ((headerBlock.$length === 0) && w.trailers === sliceType$2.nil) { $panic(new $String("unexpected empty hpack")); } _r$2 = http2splitHeaderBlock(ctx, headerBlock, $methodVal(w, "writeHeaderBlock")); /* */ $s = 15; case 15: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 16; case 16: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2writeResHeaders.ptr.prototype.writeFrame }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.buf = buf; $f.ctx = ctx; $f.enc = enc; $f.headerBlock = headerBlock; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; http2writeResHeaders.prototype.writeFrame = function(ctx) { return this.$val.writeFrame(ctx); }; http2writeResHeaders.ptr.prototype.writeHeaderBlock = function(ctx, frag, firstFrag, lastFrag) { var $24r, $24r$1, _r$1, _r$2, _r$3, _r$4, ctx, firstFrag, frag, lastFrag, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; ctx = $f.ctx; firstFrag = $f.firstFrag; frag = $f.frag; lastFrag = $f.lastFrag; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: w = this; /* */ if (firstFrag) { $s = 1; continue; } /* */ $s = 2; continue; /* if (firstFrag) { */ case 1: _r$1 = ctx.Framer(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = _r$1.WriteHeaders(new http2HeadersFrameParam.ptr(w.streamID, frag, w.endStream, lastFrag, 0, new http2PriorityParam.ptr(0, false, 0))); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 6; case 6: return $24r; /* } else { */ case 2: _r$3 = ctx.Framer(); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = _r$3.WriteContinuation(w.streamID, lastFrag, frag); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r$1 = _r$4; $s = 9; case 9: return $24r$1; /* } */ case 3: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2writeResHeaders.ptr.prototype.writeHeaderBlock }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.ctx = ctx; $f.firstFrag = firstFrag; $f.frag = frag; $f.lastFrag = lastFrag; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; http2writeResHeaders.prototype.writeHeaderBlock = function(ctx, frag, firstFrag, lastFrag) { return this.$val.writeHeaderBlock(ctx, frag, firstFrag, lastFrag); }; http2writePushPromise.ptr.prototype.staysWithinBuffer = function(max) { var max, w; w = this; return false; }; http2writePushPromise.prototype.staysWithinBuffer = function(max) { return this.$val.staysWithinBuffer(max); }; http2writePushPromise.ptr.prototype.writeFrame = function(ctx) { var $24r, _r$1, _r$2, _tuple, buf, ctx, enc, headerBlock, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; buf = $f.buf; ctx = $f.ctx; enc = $f.enc; headerBlock = $f.headerBlock; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: w = this; _r$1 = ctx.HeaderEncoder(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; enc = _tuple[0]; buf = _tuple[1]; buf.Reset(); $r = http2encKV(enc, ":method", w.method); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = http2encKV(enc, ":scheme", w.url.Scheme); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = http2encKV(enc, ":authority", w.url.Host); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = http2encKV(enc, ":path", w.url.RequestURI()); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = http2encodeHeaders(enc, w.h, sliceType$2.nil); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } headerBlock = buf.Bytes(); if (headerBlock.$length === 0) { $panic(new $String("unexpected empty hpack")); } _r$2 = http2splitHeaderBlock(ctx, headerBlock, $methodVal(w, "writeHeaderBlock")); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 8; case 8: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2writePushPromise.ptr.prototype.writeFrame }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.buf = buf; $f.ctx = ctx; $f.enc = enc; $f.headerBlock = headerBlock; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; http2writePushPromise.prototype.writeFrame = function(ctx) { return this.$val.writeFrame(ctx); }; http2writePushPromise.ptr.prototype.writeHeaderBlock = function(ctx, frag, firstFrag, lastFrag) { var $24r, $24r$1, _r$1, _r$2, _r$3, _r$4, ctx, firstFrag, frag, lastFrag, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; ctx = $f.ctx; firstFrag = $f.firstFrag; frag = $f.frag; lastFrag = $f.lastFrag; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: w = this; /* */ if (firstFrag) { $s = 1; continue; } /* */ $s = 2; continue; /* if (firstFrag) { */ case 1: _r$1 = ctx.Framer(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = _r$1.WritePushPromise(new http2PushPromiseParam.ptr(w.streamID, w.promisedID, frag, lastFrag, 0)); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 6; case 6: return $24r; /* } else { */ case 2: _r$3 = ctx.Framer(); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = _r$3.WriteContinuation(w.streamID, lastFrag, frag); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $24r$1 = _r$4; $s = 9; case 9: return $24r$1; /* } */ case 3: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: http2writePushPromise.ptr.prototype.writeHeaderBlock }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.ctx = ctx; $f.firstFrag = firstFrag; $f.frag = frag; $f.lastFrag = lastFrag; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; http2writePushPromise.prototype.writeHeaderBlock = function(ctx, frag, firstFrag, lastFrag) { return this.$val.writeHeaderBlock(ctx, frag, firstFrag, lastFrag); }; http2write100ContinueHeadersFrame.ptr.prototype.writeFrame = function(ctx) { var $24r, _r$1, _r$2, _r$3, _tuple, buf, ctx, enc, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; buf = $f.buf; ctx = $f.ctx; enc = $f.enc; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: w = this; _r$1 = ctx.HeaderEncoder(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; enc = _tuple[0]; buf = _tuple[1]; buf.Reset(); $r = http2encKV(enc, ":status", "100"); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$2 = ctx.Framer(); /* */ $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.WriteHeaders(new http2HeadersFrameParam.ptr(w.streamID, buf.Bytes(), false, true, 0, new http2PriorityParam.ptr(0, false, 0))); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = _r$3; $s = 5; case 5: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2write100ContinueHeadersFrame.ptr.prototype.writeFrame }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.buf = buf; $f.ctx = ctx; $f.enc = enc; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; http2write100ContinueHeadersFrame.prototype.writeFrame = function(ctx) { return this.$val.writeFrame(ctx); }; http2write100ContinueHeadersFrame.ptr.prototype.staysWithinBuffer = function(max) { var max, w; w = this; return 29 <= max; }; http2write100ContinueHeadersFrame.prototype.staysWithinBuffer = function(max) { return this.$val.staysWithinBuffer(max); }; http2writeWindowUpdate.ptr.prototype.staysWithinBuffer = function(max) { var max, wu; wu = this; return 13 <= max; }; http2writeWindowUpdate.prototype.staysWithinBuffer = function(max) { return this.$val.staysWithinBuffer(max); }; http2writeWindowUpdate.ptr.prototype.writeFrame = function(ctx) { var $24r, _r$1, _r$2, ctx, wu, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; ctx = $f.ctx; wu = $f.wu; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: wu = this; _r$1 = ctx.Framer(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = _r$1.WriteWindowUpdate(wu.streamID, wu.n); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2writeWindowUpdate.ptr.prototype.writeFrame }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.ctx = ctx; $f.wu = wu; $f.$s = $s; $f.$r = $r; return $f; }; http2writeWindowUpdate.prototype.writeFrame = function(ctx) { return this.$val.writeFrame(ctx); }; http2encodeHeaders = function(enc, h, keys) { var _entry, _i, _i$1, _r$1, _r$2, _r$3, _ref, _ref$1, _tuple, ascii$1, enc, h, isTE, k, k$1, keys, sorter, v, vv, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _i = $f._i; _i$1 = $f._i$1; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; _ref$1 = $f._ref$1; _tuple = $f._tuple; ascii$1 = $f.ascii$1; enc = $f.enc; h = $f.h; isTE = $f.isTE; k = $f.k; k$1 = $f.k$1; keys = $f.keys; sorter = $f.sorter; v = $f.v; vv = $f.vv; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); /* */ if (keys === sliceType$2.nil) { $s = 1; continue; } /* */ $s = 2; continue; /* if (keys === sliceType$2.nil) { */ case 1: _r$1 = http2sorterPool.Get(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } sorter = $assertType(_r$1, ptrType$100); $deferred.push([$methodVal(http2sorterPool, "Put"), [sorter]]); _r$2 = sorter.Keys(h); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } keys = _r$2; /* } */ case 2: _ref = keys; _i = 0; /* while (true) { */ case 5: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 6; continue; } k = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); vv = (_entry = h[$String.keyFor(k)], _entry !== undefined ? _entry.v : sliceType$2.nil); _r$3 = http2lowerHeader(k); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; k$1 = _tuple[0]; ascii$1 = _tuple[1]; if (!ascii$1) { _i++; /* continue; */ $s = 5; continue; } if (!http2validWireHeaderFieldName(k$1)) { _i++; /* continue; */ $s = 5; continue; } isTE = k$1 === "transfer-encoding"; _ref$1 = vv; _i$1 = 0; /* while (true) { */ case 8: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 9; continue; } v = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); if (!httpguts.ValidHeaderFieldValue(v)) { _i$1++; /* continue; */ $s = 8; continue; } if (isTE && !(v === "trailers")) { _i$1++; /* continue; */ $s = 8; continue; } $r = http2encKV(enc, k$1, v); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i$1++; $s = 8; continue; case 9: _i++; $s = 5; continue; case 6: $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: http2encodeHeaders }; } $f._entry = _entry; $f._i = _i; $f._i$1 = _i$1; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._ref = _ref; $f._ref$1 = _ref$1; $f._tuple = _tuple; $f.ascii$1 = ascii$1; $f.enc = enc; $f.h = h; $f.isTE = isTE; $f.k = k; $f.k$1 = k$1; $f.keys = keys; $f.sorter = sorter; $f.v = v; $f.vv = vv; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; http2FrameWriteRequest.ptr.prototype.StreamID = function() { var _tuple, ok, se, wr; wr = this; if (wr.stream === ptrType$10.nil) { _tuple = $assertType(wr.write, http2StreamError, true); se = $clone(_tuple[0], http2StreamError); ok = _tuple[1]; if (ok) { return se.StreamID; } return 0; } return wr.stream.id; }; http2FrameWriteRequest.prototype.StreamID = function() { return this.$val.StreamID(); }; http2FrameWriteRequest.ptr.prototype.isControl = function() { var wr; wr = this; return wr.stream === ptrType$10.nil; }; http2FrameWriteRequest.prototype.isControl = function() { return this.$val.isControl(); }; http2FrameWriteRequest.ptr.prototype.DataSize = function() { var _tuple, ok, wd, wr; wr = this; _tuple = $assertType(wr.write, ptrType$92, true); wd = _tuple[0]; ok = _tuple[1]; if (ok) { return wd.p.$length; } return 0; }; http2FrameWriteRequest.prototype.DataSize = function() { return this.$val.DataSize(); }; http2FrameWriteRequest.ptr.prototype.Consume = function(n) { var _tuple, allowed, consumed, empty, n, ok, rest, wd, wr; wr = this; empty = new http2FrameWriteRequest.ptr($ifaceNil, ptrType$10.nil, $chanNil); _tuple = $assertType(wr.write, ptrType$92, true); wd = _tuple[0]; ok = _tuple[1]; if (!ok || (wd.p.$length === 0)) { return [wr, empty, 1]; } allowed = wr.stream.flow.available(); if (n < allowed) { allowed = n; } if (wr.stream.sc.maxFrameSize < allowed) { allowed = wr.stream.sc.maxFrameSize; } if (allowed <= 0) { return [empty, empty, 0]; } if (wd.p.$length > ((allowed >> 0))) { wr.stream.flow.take(allowed); consumed = new http2FrameWriteRequest.ptr(new http2writeData.ptr(wd.streamID, $subslice(wd.p, 0, allowed), false), wr.stream, $chanNil); rest = new http2FrameWriteRequest.ptr(new http2writeData.ptr(wd.streamID, $subslice(wd.p, allowed), wd.endStream), wr.stream, wr.done); return [consumed, rest, 2]; } wr.stream.flow.take(((wd.p.$length >> 0))); return [wr, empty, 1]; }; http2FrameWriteRequest.prototype.Consume = function(n) { return this.$val.Consume(n); }; http2FrameWriteRequest.ptr.prototype.String = function() { var $24r, _r$1, _r$2, _r$3, _tuple, des, ok, s, wr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; des = $f.des; ok = $f.ok; s = $f.s; wr = $f.wr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: wr = this; des = ""; _tuple = $assertType(wr.write, fmt.Stringer, true); s = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 1; continue; } /* */ $s = 2; continue; /* if (ok) { */ case 1: _r$1 = s.String(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } des = _r$1; $s = 3; continue; /* } else { */ case 2: _r$2 = fmt.Sprintf("%T", new sliceType([wr.write])); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } des = _r$2; /* } */ case 3: _r$3 = fmt.Sprintf("[FrameWriteRequest stream=%d, ch=%v, writer=%v]", new sliceType([new $Uint32($clone(wr, http2FrameWriteRequest).StreamID()), new $Bool(!(wr.done === $chanNil)), new $String(des)])); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r = _r$3; $s = 7; case 7: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: http2FrameWriteRequest.ptr.prototype.String }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.des = des; $f.ok = ok; $f.s = s; $f.wr = wr; $f.$s = $s; $f.$r = $r; return $f; }; http2FrameWriteRequest.prototype.String = function() { return this.$val.String(); }; http2FrameWriteRequest.ptr.prototype.replyToWriter = function(err) { var _r$1, _selection, err, wr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _selection = $f._selection; err = $f.err; wr = $f.wr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: wr = this; if (wr.done === $chanNil) { $s = -1; return; } _selection = $select([[wr.done, err], []]); /* */ if (_selection[0] === 0) { $s = 1; continue; } /* */ if (_selection[0] === 1) { $s = 2; continue; } /* */ $s = 3; continue; /* if (_selection[0] === 0) { */ case 1: $s = 3; continue; /* } else if (_selection[0] === 1) { */ case 2: _r$1 = fmt.Sprintf("unbuffered done channel passed in for type %T", new sliceType([wr.write])); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $panic(new $String(_r$1)); /* } */ case 3: wr.write = $ifaceNil; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2FrameWriteRequest.ptr.prototype.replyToWriter }; } $f._r$1 = _r$1; $f._selection = _selection; $f.err = err; $f.wr = wr; $f.$s = $s; $f.$r = $r; return $f; }; http2FrameWriteRequest.prototype.replyToWriter = function(err) { return this.$val.replyToWriter(err); }; http2writeQueue.ptr.prototype.empty = function() { var q; q = this; return q.s.$length === 0; }; http2writeQueue.prototype.empty = function() { return this.$val.empty(); }; http2writeQueue.ptr.prototype.push = function(wr) { var q, wr; q = this; q.s = $append(q.s, wr); }; http2writeQueue.prototype.push = function(wr) { return this.$val.push(wr); }; http2writeQueue.ptr.prototype.shift = function() { var q, wr, x$5, x$6, x$7; q = this; if (q.s.$length === 0) { $panic(new $String("invalid use of queue")); } wr = $clone((x$5 = q.s, (0 >= x$5.$length ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + 0])), http2FrameWriteRequest); $copySlice(q.s, $subslice(q.s, 1)); http2FrameWriteRequest.copy((x$6 = q.s, x$7 = q.s.$length - 1 >> 0, ((x$7 < 0 || x$7 >= x$6.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$6.$array[x$6.$offset + x$7])), new http2FrameWriteRequest.ptr($ifaceNil, ptrType$10.nil, $chanNil)); q.s = $subslice(q.s, 0, (q.s.$length - 1 >> 0)); return wr; }; http2writeQueue.prototype.shift = function() { return this.$val.shift(); }; http2writeQueue.ptr.prototype.consume = function(n) { var _1, _tuple, consumed, n, numresult, q, rest, x$5, x$6; q = this; if (q.s.$length === 0) { return [new http2FrameWriteRequest.ptr($ifaceNil, ptrType$10.nil, $chanNil), false]; } _tuple = $clone((x$5 = q.s, (0 >= x$5.$length ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + 0])), http2FrameWriteRequest).Consume(n); consumed = $clone(_tuple[0], http2FrameWriteRequest); rest = $clone(_tuple[1], http2FrameWriteRequest); numresult = _tuple[2]; _1 = numresult; if (_1 === (0)) { return [new http2FrameWriteRequest.ptr($ifaceNil, ptrType$10.nil, $chanNil), false]; } else if (_1 === (1)) { q.shift(); } else if (_1 === (2)) { http2FrameWriteRequest.copy((x$6 = q.s, (0 >= x$6.$length ? ($throwRuntimeError("index out of range"), undefined) : x$6.$array[x$6.$offset + 0])), rest); } return [consumed, true]; }; http2writeQueue.prototype.consume = function(n) { return this.$val.consume(n); }; $ptrType(http2writeQueuePool).prototype.put = function(q) { var _i, _ref, i, p, q, x$5; p = this; _ref = q.s; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; http2FrameWriteRequest.copy((x$5 = q.s, ((i < 0 || i >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + i])), new http2FrameWriteRequest.ptr($ifaceNil, ptrType$10.nil, $chanNil)); _i++; } q.s = $subslice(q.s, 0, 0); p.$set($append(p.$get(), q)); }; $ptrType(http2writeQueuePool).prototype.get = function() { var ln, p, q, x$5, x$6, x$7; p = this; ln = p.$get().$length; if (ln === 0) { return new http2writeQueue.ptr(sliceType$24.nil); } x$5 = ln - 1 >> 0; q = (x$6 = p.$get(), ((x$5 < 0 || x$5 >= x$6.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$6.$array[x$6.$offset + x$5])); (x$7 = p.$get(), ((x$5 < 0 || x$5 >= x$7.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$7.$array[x$7.$offset + x$5] = ptrType$106.nil)); p.$set($subslice((p.$get()), 0, x$5)); return q; }; http2NewPriorityWriteScheduler = function(cfg) { var _key, cfg, ws; if (cfg === ptrType$61.nil) { cfg = new http2PriorityWriteSchedulerConfig.ptr(10, 10, false); } ws = new http2priorityWriteScheduler.ptr(new http2priorityNode.ptr(new http2writeQueue.ptr(sliceType$24.nil), 0, 0, 0, new $Int64(0, 0), new $Int64(0, 0), ptrType$107.nil, ptrType$107.nil, ptrType$107.nil, ptrType$107.nil), {}, 0, sliceType$25.nil, sliceType$25.nil, cfg.MaxClosedNodesInTree, cfg.MaxIdleNodesInTree, 0, cfg.ThrottleOutOfOrderWrites, sliceType$25.nil, http2writeQueuePool.nil); _key = 0; (ws.nodes || $throwRuntimeError("assignment to entry in nil map"))[$Uint32.keyFor(_key)] = { k: _key, v: ws.root }; if (cfg.ThrottleOutOfOrderWrites) { ws.writeThrottleLimit = 1024; } else { ws.writeThrottleLimit = 2147483647; } return ws; }; http2priorityNode.ptr.prototype.setParent = function(parent) { var n, parent, parent$1; n = this; if (n === parent) { $panic(new $String("setParent to self")); } if (n.parent === parent) { return; } parent$1 = n.parent; if (!(parent$1 === ptrType$107.nil)) { if (n.prev === ptrType$107.nil) { parent$1.kids = n.next; } else { n.prev.next = n.next; } if (!(n.next === ptrType$107.nil)) { n.next.prev = n.prev; } } n.parent = parent; if (parent === ptrType$107.nil) { n.next = ptrType$107.nil; n.prev = ptrType$107.nil; } else { n.next = parent.kids; n.prev = ptrType$107.nil; if (!(n.next === ptrType$107.nil)) { n.next.prev = n; } parent.kids = n; } }; http2priorityNode.prototype.setParent = function(parent) { return this.$val.setParent(parent); }; http2priorityNode.ptr.prototype.addBytes = function(b) { var b, n, x$5, x$6, x$7, x$8; n = this; n.bytes = (x$5 = n.bytes, x$6 = b, new $Int64(x$5.$high + x$6.$high, x$5.$low + x$6.$low)); while (true) { if (!(!(n === ptrType$107.nil))) { break; } n.subtreeBytes = (x$7 = n.subtreeBytes, x$8 = b, new $Int64(x$7.$high + x$8.$high, x$7.$low + x$8.$low)); n = n.parent; } }; http2priorityNode.prototype.addBytes = function(b) { return this.$val.addBytes(b); }; http2priorityNode.ptr.prototype.walkReadyInOrder = function(openParent, tmp, f) { var _r$1, _r$2, _r$3, _v, f, i, k, k$1, k$2, n, needSort, openParent, tmp, w, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _v = $f._v; f = $f.f; i = $f.i; k = $f.k; k$1 = $f.k$1; k$2 = $f.k$2; n = $f.n; needSort = $f.needSort; openParent = $f.openParent; tmp = $f.tmp; w = $f.w; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = this; if (!(!n.q.empty())) { _v = false; $s = 3; continue s; } _r$1 = f(n, openParent); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _v = _r$1; case 3: /* */ if (_v) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v) { */ case 1: $s = -1; return true; /* } */ case 2: if (n.kids === ptrType$107.nil) { $s = -1; return false; } if (!((n.id === 0))) { openParent = openParent || ((n.state === 0)); } w = n.kids.weight; needSort = false; k = n.kids.next; while (true) { if (!(!(k === ptrType$107.nil))) { break; } if (!((k.weight === w))) { needSort = true; break; } k = k.next; } /* */ if (!needSort) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!needSort) { */ case 5: k$1 = n.kids; /* while (true) { */ case 7: /* if (!(!(k$1 === ptrType$107.nil))) { break; } */ if(!(!(k$1 === ptrType$107.nil))) { $s = 8; continue; } _r$2 = k$1.walkReadyInOrder(openParent, tmp, f); /* */ $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: $s = -1; return true; /* } */ case 10: k$1 = k$1.next; $s = 7; continue; case 8: $s = -1; return false; /* } */ case 6: tmp.$set($subslice((tmp.$get()), 0, 0)); while (true) { if (!(!(n.kids === ptrType$107.nil))) { break; } tmp.$set($append(tmp.$get(), n.kids)); n.kids.setParent(ptrType$107.nil); } $r = sort.Sort(($convertSliceType(tmp.$get(), http2sortPriorityNodeSiblings))); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i = tmp.$get().$length - 1 >> 0; while (true) { if (!(i >= 0)) { break; } (x$5 = tmp.$get(), ((i < 0 || i >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + i])).setParent(n); i = i - (1) >> 0; } k$2 = n.kids; /* while (true) { */ case 13: /* if (!(!(k$2 === ptrType$107.nil))) { break; } */ if(!(!(k$2 === ptrType$107.nil))) { $s = 14; continue; } _r$3 = k$2.walkReadyInOrder(openParent, tmp, f); /* */ $s = 17; case 17: 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 (_r$3) { */ case 15: $s = -1; return true; /* } */ case 16: k$2 = k$2.next; $s = 13; continue; case 14: $s = -1; return false; /* */ } return; } if ($f === undefined) { $f = { $blk: http2priorityNode.ptr.prototype.walkReadyInOrder }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._v = _v; $f.f = f; $f.i = i; $f.k = k; $f.k$1 = k$1; $f.k$2 = k$2; $f.n = n; $f.needSort = needSort; $f.openParent = openParent; $f.tmp = tmp; $f.w = w; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; http2priorityNode.prototype.walkReadyInOrder = function(openParent, tmp, f) { return this.$val.walkReadyInOrder(openParent, tmp, f); }; http2sortPriorityNodeSiblings.prototype.Len = function() { var z; z = this; return z.$length; }; $ptrType(http2sortPriorityNodeSiblings).prototype.Len = function() { return this.$get().Len(); }; http2sortPriorityNodeSiblings.prototype.Swap = function(i, k) { var _tmp, _tmp$1, i, k, z; z = this; _tmp = ((k < 0 || k >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + k]); _tmp$1 = ((i < 0 || i >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + i]); ((i < 0 || i >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + i] = _tmp); ((k < 0 || k >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + k] = _tmp$1); }; $ptrType(http2sortPriorityNodeSiblings).prototype.Swap = function(i, k) { return this.$get().Swap(i, k); }; http2sortPriorityNodeSiblings.prototype.Less = function(i, k) { var _tmp, _tmp$1, _tmp$2, _tmp$3, bi, bk, i, k, wi, wk, z; z = this; _tmp = ((((i < 0 || i >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + i]).weight + 1 << 24 >>> 24)); _tmp$1 = ($flatten64(((i < 0 || i >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + i]).subtreeBytes)); wi = _tmp; bi = _tmp$1; _tmp$2 = ((((k < 0 || k >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + k]).weight + 1 << 24 >>> 24)); _tmp$3 = ($flatten64(((k < 0 || k >= z.$length) ? ($throwRuntimeError("index out of range"), undefined) : z.$array[z.$offset + k]).subtreeBytes)); wk = _tmp$2; bk = _tmp$3; if ((bi === 0) && (bk === 0)) { return wi >= wk; } if (bk === 0) { return false; } return bi / bk <= wi / wk; }; $ptrType(http2sortPriorityNodeSiblings).prototype.Less = function(i, k) { return this.$get().Less(i, k); }; http2priorityWriteScheduler.ptr.prototype.OpenStream = function(streamID, options) { var _entry, _entry$1, _key, _r$1, curr, n, options, parent, streamID, ws, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _key = $f._key; _r$1 = $f._r$1; curr = $f.curr; n = $f.n; options = $f.options; parent = $f.parent; streamID = $f.streamID; ws = $f.ws; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ws = this; curr = (_entry = ws.nodes[$Uint32.keyFor(streamID)], _entry !== undefined ? _entry.v : ptrType$107.nil); /* */ if (!(curr === ptrType$107.nil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(curr === ptrType$107.nil)) { */ case 1: /* */ if (!((curr.state === 2))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!((curr.state === 2))) { */ case 3: _r$1 = fmt.Sprintf("stream %d already opened", new sliceType([new $Uint32(streamID)])); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $panic(new $String(_r$1)); /* } */ case 4: curr.state = 0; $s = -1; return; /* } */ case 2: parent = (_entry$1 = ws.nodes[$Uint32.keyFor(options.PusherID)], _entry$1 !== undefined ? _entry$1.v : ptrType$107.nil); if (parent === ptrType$107.nil) { parent = ws.root; } n = new http2priorityNode.ptr($clone((ws.$ptr_queuePool || (ws.$ptr_queuePool = new ptrType$108(function() { return this.$target.queuePool; }, function($v) { this.$target.queuePool = $v; }, ws))).get(), http2writeQueue), streamID, 15, 0, new $Int64(0, 0), new $Int64(0, 0), ptrType$107.nil, ptrType$107.nil, ptrType$107.nil, ptrType$107.nil); n.setParent(parent); _key = streamID; (ws.nodes || $throwRuntimeError("assignment to entry in nil map"))[$Uint32.keyFor(_key)] = { k: _key, v: n }; if (streamID > ws.maxID) { ws.maxID = streamID; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2priorityWriteScheduler.ptr.prototype.OpenStream }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._key = _key; $f._r$1 = _r$1; $f.curr = curr; $f.n = n; $f.options = options; $f.parent = parent; $f.streamID = streamID; $f.ws = ws; $f.$s = $s; $f.$r = $r; return $f; }; http2priorityWriteScheduler.prototype.OpenStream = function(streamID, options) { return this.$val.OpenStream(streamID, options); }; http2priorityWriteScheduler.ptr.prototype.CloseStream = function(streamID) { var _entry, _entry$1, _entry$2, _r$1, _r$2, n, q, streamID, ws, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _entry$2 = $f._entry$2; _r$1 = $f._r$1; _r$2 = $f._r$2; n = $f.n; q = $f.q; streamID = $f.streamID; ws = $f.ws; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: q = [q]; ws = this; if (streamID === 0) { $panic(new $String("violation of WriteScheduler interface: cannot close stream 0")); } /* */ if ((_entry = ws.nodes[$Uint32.keyFor(streamID)], _entry !== undefined ? _entry.v : ptrType$107.nil) === ptrType$107.nil) { $s = 1; continue; } /* */ $s = 2; continue; /* if ((_entry = ws.nodes[$Uint32.keyFor(streamID)], _entry !== undefined ? _entry.v : ptrType$107.nil) === ptrType$107.nil) { */ case 1: _r$1 = fmt.Sprintf("violation of WriteScheduler interface: unknown stream %d", new sliceType([new $Uint32(streamID)])); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $panic(new $String(_r$1)); /* } */ case 2: /* */ if (!(((_entry$1 = ws.nodes[$Uint32.keyFor(streamID)], _entry$1 !== undefined ? _entry$1.v : ptrType$107.nil).state === 0))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!(((_entry$1 = ws.nodes[$Uint32.keyFor(streamID)], _entry$1 !== undefined ? _entry$1.v : ptrType$107.nil).state === 0))) { */ case 4: _r$2 = fmt.Sprintf("violation of WriteScheduler interface: stream %d already closed", new sliceType([new $Uint32(streamID)])); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $panic(new $String(_r$2)); /* } */ case 5: n = (_entry$2 = ws.nodes[$Uint32.keyFor(streamID)], _entry$2 !== undefined ? _entry$2.v : ptrType$107.nil); n.state = 1; n.addBytes((x$5 = n.bytes, new $Int64(-x$5.$high, -x$5.$low))); q[0] = $clone(n.q, http2writeQueue); (ws.$ptr_queuePool || (ws.$ptr_queuePool = new ptrType$108(function() { return this.$target.queuePool; }, function($v) { this.$target.queuePool = $v; }, ws))).put(q[0]); n.q.s = sliceType$24.nil; if (ws.maxClosedNodesInTree > 0) { ws.addClosedOrIdleNode((ws.$ptr_closedNodes || (ws.$ptr_closedNodes = new ptrType$109(function() { return this.$target.closedNodes; }, function($v) { this.$target.closedNodes = $v; }, ws))), ws.maxClosedNodesInTree, n); } else { ws.removeNode(n); } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: http2priorityWriteScheduler.ptr.prototype.CloseStream }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._entry$2 = _entry$2; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.n = n; $f.q = q; $f.streamID = streamID; $f.ws = ws; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; http2priorityWriteScheduler.prototype.CloseStream = function(streamID) { return this.$val.CloseStream(streamID); }; http2priorityWriteScheduler.ptr.prototype.AdjustStream = function(streamID, priority) { var _entry, _entry$1, _key, k, n, next, parent, priority, streamID, ws, x$5; ws = this; if (streamID === 0) { $panic(new $String("adjustPriority on root")); } n = (_entry = ws.nodes[$Uint32.keyFor(streamID)], _entry !== undefined ? _entry.v : ptrType$107.nil); if (n === ptrType$107.nil) { if (streamID <= ws.maxID || (ws.maxIdleNodesInTree === 0)) { return; } ws.maxID = streamID; n = new http2priorityNode.ptr($clone((ws.$ptr_queuePool || (ws.$ptr_queuePool = new ptrType$108(function() { return this.$target.queuePool; }, function($v) { this.$target.queuePool = $v; }, ws))).get(), http2writeQueue), streamID, 15, 2, new $Int64(0, 0), new $Int64(0, 0), ptrType$107.nil, ptrType$107.nil, ptrType$107.nil, ptrType$107.nil); n.setParent(ws.root); _key = streamID; (ws.nodes || $throwRuntimeError("assignment to entry in nil map"))[$Uint32.keyFor(_key)] = { k: _key, v: n }; ws.addClosedOrIdleNode((ws.$ptr_idleNodes || (ws.$ptr_idleNodes = new ptrType$109(function() { return this.$target.idleNodes; }, function($v) { this.$target.idleNodes = $v; }, ws))), ws.maxIdleNodesInTree, n); } parent = (_entry$1 = ws.nodes[$Uint32.keyFor(priority.StreamDep)], _entry$1 !== undefined ? _entry$1.v : ptrType$107.nil); if (parent === ptrType$107.nil) { n.setParent(ws.root); n.weight = 15; return; } if (n === parent) { return; } x$5 = parent.parent; while (true) { if (!(!(x$5 === ptrType$107.nil))) { break; } if (x$5 === n) { parent.setParent(n.parent); break; } x$5 = x$5.parent; } if (priority.Exclusive) { k = parent.kids; while (true) { if (!(!(k === ptrType$107.nil))) { break; } next = k.next; if (!(k === n)) { k.setParent(n); } k = next; } } n.setParent(parent); n.weight = priority.Weight; }; http2priorityWriteScheduler.prototype.AdjustStream = function(streamID, priority) { return this.$val.AdjustStream(streamID, priority); }; http2priorityWriteScheduler.ptr.prototype.Push = function(wr) { var _entry, id, n, wr, ws; ws = this; n = ptrType$107.nil; id = $clone(wr, http2FrameWriteRequest).StreamID(); if (id === 0) { n = ws.root; } else { n = (_entry = ws.nodes[$Uint32.keyFor(id)], _entry !== undefined ? _entry.v : ptrType$107.nil); if (n === ptrType$107.nil) { if ($clone(wr, http2FrameWriteRequest).DataSize() > 0) { $panic(new $String("add DATA on non-open stream")); } n = ws.root; } } n.q.push($clone(wr, http2FrameWriteRequest)); }; http2priorityWriteScheduler.prototype.Push = function(wr) { return this.$val.Push(wr); }; http2priorityWriteScheduler.ptr.prototype.Pop = function() { var _r$1, _tmp, _tmp$1, ok, wr, ws, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; ok = $f.ok; wr = $f.wr; ws = $f.ws; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ok = [ok]; wr = [wr]; ws = [ws]; wr[0] = new http2FrameWriteRequest.ptr($ifaceNil, ptrType$10.nil, $chanNil); ok[0] = false; ws[0] = this; _r$1 = ws[0].root.walkReadyInOrder(false, (ws[0].$ptr_tmp || (ws[0].$ptr_tmp = new ptrType$109(function() { return this.$target.tmp; }, function($v) { this.$target.tmp = $v; }, ws[0]))), (function(ok, wr, ws) { return function(n, openParent) { var _tuple, limit, n, openParent; limit = 2147483647; if (openParent) { limit = ws[0].writeThrottleLimit; } _tuple = n.q.consume(limit); http2FrameWriteRequest.copy(wr[0], _tuple[0]); ok[0] = _tuple[1]; if (!ok[0]) { return false; } n.addBytes((new $Int64(0, $clone(wr[0], http2FrameWriteRequest).DataSize()))); if (openParent) { ws[0].writeThrottleLimit = ws[0].writeThrottleLimit + (1024) >> 0; if (ws[0].writeThrottleLimit < 0) { ws[0].writeThrottleLimit = 2147483647; } } else if (ws[0].enableWriteThrottle) { ws[0].writeThrottleLimit = 1024; } return true; }; })(ok, wr, ws)); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _tmp = $clone(wr[0], http2FrameWriteRequest); _tmp$1 = ok[0]; http2FrameWriteRequest.copy(wr[0], _tmp); ok[0] = _tmp$1; $s = -1; return [wr[0], ok[0]]; /* */ } return; } if ($f === undefined) { $f = { $blk: http2priorityWriteScheduler.ptr.prototype.Pop }; } $f._r$1 = _r$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.ok = ok; $f.wr = wr; $f.ws = ws; $f.$s = $s; $f.$r = $r; return $f; }; http2priorityWriteScheduler.prototype.Pop = function() { return this.$val.Pop(); }; http2priorityWriteScheduler.ptr.prototype.addClosedOrIdleNode = function(list$1, maxSize, n) { var list$1, maxSize, n, ws, x$5, x$6; ws = this; if (maxSize === 0) { return; } if (list$1.$get().$length === maxSize) { ws.removeNode((x$5 = list$1.$get(), (0 >= x$5.$length ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + 0]))); x$6 = $subslice((list$1.$get()), 1); $copySlice(list$1.$get(), x$6); list$1.$set($subslice((list$1.$get()), 0, x$6.$length)); } list$1.$set($append(list$1.$get(), n)); }; http2priorityWriteScheduler.prototype.addClosedOrIdleNode = function(list$1, maxSize, n) { return this.$val.addClosedOrIdleNode(list$1, maxSize, n); }; http2priorityWriteScheduler.ptr.prototype.removeNode = function(n) { var k, n, ws; ws = this; k = n.kids; while (true) { if (!(!(k === ptrType$107.nil))) { break; } k.setParent(n.parent); k = k.next; } n.setParent(ptrType$107.nil); delete ws.nodes[$Uint32.keyFor(n.id)]; }; http2priorityWriteScheduler.prototype.removeNode = function(n) { return this.$val.removeNode(n); }; http2NewRandomWriteScheduler = function() { return new http2randomWriteScheduler.ptr(new http2writeQueue.ptr(sliceType$24.nil), {}, http2writeQueuePool.nil); }; http2randomWriteScheduler.ptr.prototype.OpenStream = function(streamID, options) { var options, streamID, ws; ws = this; }; http2randomWriteScheduler.prototype.OpenStream = function(streamID, options) { return this.$val.OpenStream(streamID, options); }; http2randomWriteScheduler.ptr.prototype.CloseStream = function(streamID) { var _entry, _tuple, ok, q, streamID, ws; ws = this; _tuple = (_entry = ws.sq[$Uint32.keyFor(streamID)], _entry !== undefined ? [_entry.v, true] : [ptrType$106.nil, false]); q = _tuple[0]; ok = _tuple[1]; if (!ok) { return; } delete ws.sq[$Uint32.keyFor(streamID)]; (ws.$ptr_queuePool || (ws.$ptr_queuePool = new ptrType$108(function() { return this.$target.queuePool; }, function($v) { this.$target.queuePool = $v; }, ws))).put(q); }; http2randomWriteScheduler.prototype.CloseStream = function(streamID) { return this.$val.CloseStream(streamID); }; http2randomWriteScheduler.ptr.prototype.AdjustStream = function(streamID, priority) { var priority, streamID, ws; ws = this; }; http2randomWriteScheduler.prototype.AdjustStream = function(streamID, priority) { return this.$val.AdjustStream(streamID, priority); }; http2randomWriteScheduler.ptr.prototype.Push = function(wr) { var _entry, _key, _tuple, id, ok, q, wr, ws; ws = this; id = $clone(wr, http2FrameWriteRequest).StreamID(); if (id === 0) { ws.zero.push($clone(wr, http2FrameWriteRequest)); return; } _tuple = (_entry = ws.sq[$Uint32.keyFor(id)], _entry !== undefined ? [_entry.v, true] : [ptrType$106.nil, false]); q = _tuple[0]; ok = _tuple[1]; if (!ok) { q = (ws.$ptr_queuePool || (ws.$ptr_queuePool = new ptrType$108(function() { return this.$target.queuePool; }, function($v) { this.$target.queuePool = $v; }, ws))).get(); _key = id; (ws.sq || $throwRuntimeError("assignment to entry in nil map"))[$Uint32.keyFor(_key)] = { k: _key, v: q }; } q.push($clone(wr, http2FrameWriteRequest)); }; http2randomWriteScheduler.prototype.Push = function(wr) { return this.$val.Push(wr); }; http2randomWriteScheduler.ptr.prototype.Pop = function() { var _entry, _i, _keys, _ref, _tuple, ok, q, streamID, wr, ws; ws = this; if (!ws.zero.empty()) { return [ws.zero.shift(), true]; } _ref = ws.sq; _i = 0; _keys = $keys(_ref); while (true) { if (!(_i < _keys.length)) { break; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; continue; } streamID = _entry.k; q = _entry.v; _tuple = q.consume(2147483647); wr = $clone(_tuple[0], http2FrameWriteRequest); ok = _tuple[1]; if (ok) { if (q.empty()) { delete ws.sq[$Uint32.keyFor(streamID)]; (ws.$ptr_queuePool || (ws.$ptr_queuePool = new ptrType$108(function() { return this.$target.queuePool; }, function($v) { this.$target.queuePool = $v; }, ws))).put(q); } return [wr, true]; } _i++; } return [new http2FrameWriteRequest.ptr($ifaceNil, ptrType$10.nil, $chanNil), false]; }; http2randomWriteScheduler.prototype.Pop = function() { return this.$val.Pop(); }; noTransport.ptr.prototype.RoundTrip = function(req) { var req; return [ptrType$18.nil, errors.New("net/http: neither of Fetch nor XMLHttpRequest APIs is available")]; }; noTransport.prototype.RoundTrip = function(req) { return this.$val.RoundTrip(req); }; XHRTransport.ptr.prototype.RoundTrip = function(req) { var $24r, $24r$1, $24r$2, _arg, _arg$1, _entry, _i, _i$1, _key, _keys, _r$1, _r$2, _r$3, _r$4, _ref, _ref$1, _selection, _tuple, body$1, err, err$1, errCh, key, req, resp, respCh, t, value, values, xhr, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; _arg = $f._arg; _arg$1 = $f._arg$1; _entry = $f._entry; _i = $f._i; _i$1 = $f._i$1; _key = $f._key; _keys = $f._keys; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _ref = $f._ref; _ref$1 = $f._ref$1; _selection = $f._selection; _tuple = $f._tuple; body$1 = $f.body$1; err = $f.err; err$1 = $f.err$1; errCh = $f.errCh; key = $f.key; req = $f.req; resp = $f.resp; respCh = $f.respCh; t = $f.t; value = $f.value; values = $f.values; xhr = $f.xhr; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); errCh = [errCh]; req = [req]; respCh = [respCh]; xhr = [xhr]; t = this; xhr[0] = new ($global.XMLHttpRequest)(); if (t.inflight === false) { t.inflight = $makeMap(ptrType$11.keyFor, []); } _key = req[0]; (t.inflight || $throwRuntimeError("assignment to entry in nil map"))[ptrType$11.keyFor(_key)] = { k: _key, v: xhr[0] }; $deferred.push([function(_arg, _arg$1) { delete _arg[ptrType$11.keyFor(_arg$1)]; }, [t.inflight, req[0]]]); respCh[0] = new $Chan(ptrType$18, 0); errCh[0] = new $Chan($error, 0); xhr[0].onload = $externalize((function(errCh, req, respCh, xhr) { return function $b() { var _1, _r$1, _r$2, _r$3, _r$4, _tuple, _tuple$1, body$1, contentLength, err, header, l, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; body$1 = $f.body$1; contentLength = $f.contentLength; err = $f.err; header = $f.header; l = $f.l; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = textproto.NewReader(bufio.NewReader(bytes.NewReader((new sliceType$3($stringToBytes($internalize(xhr[0].getAllResponseHeaders(), $String) + "\n")))))); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = _r$1.ReadMIMEHeader(); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; header = _tuple[0]; body$1 = $assertType($internalize(new ($global.Uint8Array)(xhr[0].response), $emptyInterface), sliceType$3); contentLength = new $Int64(-1, 4294967295); _1 = req[0].Method; /* */ if (_1 === ("HEAD")) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_1 === ("HEAD")) { */ case 4: _r$3 = new textproto.MIMEHeader(header).Get("Content-Length"); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = strconv.ParseInt(_r$3, 10, 64); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$1 = _r$4; l = _tuple$1[0]; err = _tuple$1[1]; if ($interfaceIsEqual(err, $ifaceNil)) { contentLength = l; } $s = 6; continue; /* } else { */ case 5: contentLength = (new $Int64(0, body$1.$length)); /* } */ case 6: case 3: $r = $send(respCh[0], new Response.ptr($internalize(xhr[0].status, $String) + " " + $internalize(xhr[0].statusText, $String), $parseInt(xhr[0].status) >> 0, "", 0, 0, (header), ioutil.NopCloser(bytes.NewReader(body$1)), contentLength, sliceType$2.nil, false, false, false, req[0], ptrType$28.nil)); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._1 = _1; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.body$1 = body$1; $f.contentLength = contentLength; $f.err = err; $f.header = header; $f.l = l; $f.$s = $s; $f.$r = $r; return $f; }; })(errCh, req, respCh, xhr), funcType); xhr[0].onerror = $externalize((function(errCh, req, respCh, xhr) { return function $b(e) { var e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = $send(errCh[0], errors.New("net/http: XMLHttpRequest failed")); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; })(errCh, req, respCh, xhr), funcType$3); xhr[0].onabort = $externalize((function(errCh, req, respCh, xhr) { return function $b(e) { var e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = $send(errCh[0], errors.New("net/http: request canceled")); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; })(errCh, req, respCh, xhr), funcType$3); xhr[0].open($externalize(req[0].Method, $String), $externalize(req[0].URL.String(), $String)); xhr[0].responseType = $externalize("arraybuffer", $String); _ref = req[0].Header; _i = 0; _keys = $keys(_ref); while (true) { if (!(_i < _keys.length)) { break; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; continue; } key = _entry.k; values = _entry.v; _ref$1 = values; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } value = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); xhr[0].setRequestHeader($externalize(key, $String), $externalize(value, $String)); _i$1++; } _i++; } /* */ if ($interfaceIsEqual(req[0].Body, $ifaceNil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($interfaceIsEqual(req[0].Body, $ifaceNil)) { */ case 1: xhr[0].send(); $s = 3; continue; /* } else { */ case 2: _r$1 = ioutil.ReadAll(req[0].Body); /* */ $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; body$1 = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 5: _r$2 = req[0].Body.Close(); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; $24r = [ptrType$18.nil, err]; $s = 8; case 8: return $24r; /* } */ case 6: _r$3 = req[0].Body.Close(); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; xhr[0].send($externalize(body$1, sliceType$3)); /* } */ case 3: _r$4 = $select([[respCh[0]], [errCh[0]]]); /* */ $s = 10; case 10: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _selection = _r$4; /* */ if (_selection[0] === 0) { $s = 11; continue; } /* */ if (_selection[0] === 1) { $s = 12; continue; } /* */ $s = 13; continue; /* if (_selection[0] === 0) { */ case 11: resp = _selection[1][0]; $24r$1 = [resp, $ifaceNil]; $s = 14; case 14: return $24r$1; /* } else if (_selection[0] === 1) { */ case 12: err$1 = _selection[1][0]; $24r$2 = [ptrType$18.nil, err$1]; $s = 15; case 15: return $24r$2; /* } */ case 13: $s = -1; return [ptrType$18.nil, $ifaceNil]; /* */ } return; } } catch(err) { $err = err; $s = -1; return [ptrType$18.nil, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: XHRTransport.ptr.prototype.RoundTrip }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f._arg = _arg; $f._arg$1 = _arg$1; $f._entry = _entry; $f._i = _i; $f._i$1 = _i$1; $f._key = _key; $f._keys = _keys; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._ref = _ref; $f._ref$1 = _ref$1; $f._selection = _selection; $f._tuple = _tuple; $f.body$1 = body$1; $f.err = err; $f.err$1 = err$1; $f.errCh = errCh; $f.key = key; $f.req = req; $f.resp = resp; $f.respCh = respCh; $f.t = t; $f.value = value; $f.values = values; $f.xhr = xhr; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; XHRTransport.prototype.RoundTrip = function(req) { return this.$val.RoundTrip(req); }; XHRTransport.ptr.prototype.CancelRequest = function(req) { var _entry, _tuple, ok, req, t, xhr; t = this; _tuple = (_entry = t.inflight[ptrType$11.keyFor(req)], _entry !== undefined ? [_entry.v, true] : [null, false]); xhr = _tuple[0]; ok = _tuple[1]; if (ok) { xhr.abort(); } }; XHRTransport.prototype.CancelRequest = function(req) { return this.$val.CancelRequest(req); }; streamReader.ptr.prototype.Read = function(p) { var _r$1, _selection, _tmp, _tmp$1, _tmp$2, _tmp$3, b, bCh, err, err$1, errCh, n, p, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _selection = $f._selection; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; b = $f.b; bCh = $f.bCh; err = $f.err; err$1 = $f.err$1; errCh = $f.errCh; n = $f.n; p = $f.p; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: bCh = [bCh]; errCh = [errCh]; n = 0; err = $ifaceNil; r = this; /* */ if (r.pending.$length === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (r.pending.$length === 0) { */ case 1: bCh[0] = new $Chan(sliceType$3, 0); errCh[0] = new $Chan($error, 0); r.stream.read().then($externalize((function(bCh, errCh) { return function $b(result) { var result, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; result = $f.result; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (!!(result.done)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!!(result.done)) { */ case 1: $r = $send(errCh[0], io.EOF); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 2: $r = $send(bCh[0], $assertType($internalize(result.value, $emptyInterface), sliceType$3)); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.result = result; $f.$s = $s; $f.$r = $r; return $f; }; })(bCh, errCh), funcType$3), $externalize((function(bCh, errCh) { return function $b(reason) { var reason, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; reason = $f.reason; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = $send(errCh[0], errors.New($internalize(reason.message, $String))); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.reason = reason; $f.$s = $s; $f.$r = $r; return $f; }; })(bCh, errCh), funcType$3)); _r$1 = $select([[bCh[0]], [errCh[0]]]); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _selection = _r$1; if (_selection[0] === 0) { b = _selection[1][0]; r.pending = b; } else if (_selection[0] === 1) { err$1 = _selection[1][0]; _tmp = 0; _tmp$1 = err$1; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } /* } */ case 2: n = $copySlice(p, r.pending); r.pending = $subslice(r.pending, n); _tmp$2 = n; _tmp$3 = $ifaceNil; n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: streamReader.ptr.prototype.Read }; } $f._r$1 = _r$1; $f._selection = _selection; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f.b = b; $f.bCh = bCh; $f.err = err; $f.err$1 = err$1; $f.errCh = errCh; $f.n = n; $f.p = p; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; streamReader.prototype.Read = function(p) { return this.$val.Read(p); }; streamReader.ptr.prototype.Close = function() { var r; r = this; r.stream.cancel(); return $ifaceNil; }; streamReader.prototype.Close = function() { return this.$val.Close(); }; fetchTransport.ptr.prototype.RoundTrip = function(req) { var _entry, _i, _i$1, _key, _keys, _r$1, _r$2, _r$3, _r$4, _r$5, _ref, _ref$1, _selection, _tuple, body$1, err, err$1, errCh, headers, key, opt, req, resp, respCh, respPromise, t, value, values, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _i = $f._i; _i$1 = $f._i$1; _key = $f._key; _keys = $f._keys; _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; _ref = $f._ref; _ref$1 = $f._ref$1; _selection = $f._selection; _tuple = $f._tuple; body$1 = $f.body$1; err = $f.err; err$1 = $f.err$1; errCh = $f.errCh; headers = $f.headers; key = $f.key; opt = $f.opt; req = $f.req; resp = $f.resp; respCh = $f.respCh; respPromise = $f.respPromise; t = $f.t; value = $f.value; values = $f.values; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: errCh = [errCh]; req = [req]; respCh = [respCh]; t = this; headers = new ($global.Headers)(); _ref = req[0].Header; _i = 0; _keys = $keys(_ref); while (true) { if (!(_i < _keys.length)) { break; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; continue; } key = _entry.k; values = _entry.v; _ref$1 = values; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } value = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); headers.append($externalize(key, $String), $externalize(value, $String)); _i$1++; } _i++; } opt = $makeMap($String.keyFor, [{ k: "method", v: new $String(req[0].Method) }, { k: "headers", v: new $jsObjectPtr(headers) }, { k: "credentials", v: new $String("same-origin") }]); /* */ if (!($interfaceIsEqual(req[0].Body, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(req[0].Body, $ifaceNil))) { */ case 1: _r$1 = ioutil.ReadAll(req[0].Body); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; body$1 = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 4: _r$2 = req[0].Body.Close(); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; $s = -1; return [ptrType$18.nil, err]; /* } */ case 5: _r$3 = req[0].Body.Close(); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _key = "body"; (opt || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: body$1 }; /* } */ case 2: respPromise = $global.fetch($externalize(req[0].URL.String(), $String), $externalize(opt, mapType$1)); respCh[0] = new $Chan(ptrType$18, 0); errCh[0] = new $Chan($error, 0); respPromise.then($externalize((function(errCh, req, respCh) { return function $b(result) { var _r$4, _r$5, _r$6, _r$7, _selection, _tuple$1, cl, contentLength, err$1, header, result, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _selection = $f._selection; _tuple$1 = $f._tuple$1; cl = $f.cl; contentLength = $f.contentLength; err$1 = $f.err$1; header = $f.header; result = $f.result; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: header = [header]; header[0] = $makeMap($String.keyFor, []); result.headers.forEach($externalize((function(errCh, header, req, respCh) { return function $b(value$1, key$1) { var _entry$1, _key$1, _r$4, ck, key$1, value$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry$1 = $f._entry$1; _key$1 = $f._key$1; _r$4 = $f._r$4; ck = $f.ck; key$1 = $f.key$1; value$1 = $f.value$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$4 = CanonicalHeaderKey($internalize(key$1, $String)); /* */ $s = 1; case 1: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } ck = _r$4; _key$1 = ck; (header[0] || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key$1)] = { k: _key$1, v: $append((_entry$1 = header[0][$String.keyFor(ck)], _entry$1 !== undefined ? _entry$1.v : sliceType$2.nil), $internalize(value$1, $String)) }; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._entry$1 = _entry$1; $f._key$1 = _key$1; $f._r$4 = _r$4; $f.ck = ck; $f.key$1 = key$1; $f.value$1 = value$1; $f.$s = $s; $f.$r = $r; return $f; }; })(errCh, header, req, respCh), funcType$4)); contentLength = new $Int64(-1, 4294967295); _r$4 = new Header(header[0]).Get("Content-Length"); /* */ $s = 1; case 1: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = strconv.ParseInt(_r$4, 10, 64); /* */ $s = 2; case 2: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$1 = _r$5; cl = _tuple$1[0]; err$1 = _tuple$1[1]; if ($interfaceIsEqual(err$1, $ifaceNil)) { contentLength = cl; } _r$6 = req[0].Context().Done(); /* */ $s = 3; case 3: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$7 = $select([[respCh[0], new Response.ptr($internalize(result.status, $String) + " " + StatusText($parseInt(result.status) >> 0), $parseInt(result.status) >> 0, "", 0, 0, header[0], new streamReader.ptr(sliceType$3.nil, result.body.getReader()), contentLength, sliceType$2.nil, false, false, false, req[0], ptrType$28.nil)], [_r$6]]); /* */ $s = 4; case 4: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _selection = _r$7; /* */ if (_selection[0] === 0) { $s = 5; continue; } /* */ if (_selection[0] === 1) { $s = 6; continue; } /* */ $s = 7; continue; /* if (_selection[0] === 0) { */ case 5: $s = 7; continue; /* } else if (_selection[0] === 1) { */ case 6: /* } */ case 7: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._selection = _selection; $f._tuple$1 = _tuple$1; $f.cl = cl; $f.contentLength = contentLength; $f.err$1 = err$1; $f.header = header; $f.result = result; $f.$s = $s; $f.$r = $r; return $f; }; })(errCh, req, respCh), funcType$3), $externalize((function(errCh, req, respCh) { return function $b(reason) { var _r$4, _r$5, _r$6, _selection, reason, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _selection = $f._selection; reason = $f.reason; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$4 = fmt.Errorf("net/http: fetch() failed: %s", new sliceType([new $String($internalize(reason, $String))])); /* */ $s = 1; case 1: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = req[0].Context().Done(); /* */ $s = 2; case 2: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$6 = $select([[errCh[0], _r$4], [_r$5]]); /* */ $s = 3; case 3: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _selection = _r$6; /* */ if (_selection[0] === 0) { $s = 4; continue; } /* */ if (_selection[0] === 1) { $s = 5; continue; } /* */ $s = 6; continue; /* if (_selection[0] === 0) { */ case 4: $s = 6; continue; /* } else if (_selection[0] === 1) { */ case 5: /* } */ case 6: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._selection = _selection; $f.reason = reason; $f.$s = $s; $f.$r = $r; return $f; }; })(errCh, req, respCh), funcType$3)); _r$4 = req[0].Context().Done(); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = $select([[_r$4], [respCh[0]], [errCh[0]]]); /* */ $s = 9; case 9: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _selection = _r$5; /* */ if (_selection[0] === 0) { $s = 10; continue; } /* */ if (_selection[0] === 1) { $s = 11; continue; } /* */ if (_selection[0] === 2) { $s = 12; continue; } /* */ $s = 13; continue; /* if (_selection[0] === 0) { */ case 10: $s = -1; return [ptrType$18.nil, errors.New("net/http: request canceled")]; /* } else if (_selection[0] === 1) { */ case 11: resp = _selection[1][0]; $s = -1; return [resp, $ifaceNil]; /* } else if (_selection[0] === 2) { */ case 12: err$1 = _selection[1][0]; $s = -1; return [ptrType$18.nil, err$1]; /* } */ case 13: $s = -1; return [ptrType$18.nil, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: fetchTransport.ptr.prototype.RoundTrip }; } $f._entry = _entry; $f._i = _i; $f._i$1 = _i$1; $f._key = _key; $f._keys = _keys; $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._ref = _ref; $f._ref$1 = _ref$1; $f._selection = _selection; $f._tuple = _tuple; $f.body$1 = body$1; $f.err = err; $f.err$1 = err$1; $f.errCh = errCh; $f.headers = headers; $f.key = key; $f.opt = opt; $f.req = req; $f.resp = resp; $f.respCh = respCh; $f.respPromise = respPromise; $f.t = t; $f.value = value; $f.values = values; $f.$s = $s; $f.$r = $r; return $f; }; fetchTransport.prototype.RoundTrip = function(req) { return this.$val.RoundTrip(req); }; readSetCookies = function(h) { var _1, _2, _entry, _entry$1, _i, _r$1, _r$2, _r$3, _r$4, _r$5, _ref, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, ascii$1, attr, c, cookieCount, cookies, err, err$1, exptime, h, i, isASCII, j, j$1, line, lowerAttr, lowerVal, name, ok, parts, secs, val, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _2 = $f._2; _entry = $f._entry; _entry$1 = $f._entry$1; _i = $f._i; _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; _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; _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; ascii$1 = $f.ascii$1; attr = $f.attr; c = $f.c; cookieCount = $f.cookieCount; cookies = $f.cookies; err = $f.err; err$1 = $f.err$1; exptime = $f.exptime; h = $f.h; i = $f.i; isASCII = $f.isASCII; j = $f.j; j$1 = $f.j$1; line = $f.line; lowerAttr = $f.lowerAttr; lowerVal = $f.lowerVal; name = $f.name; ok = $f.ok; parts = $f.parts; secs = $f.secs; val = $f.val; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cookieCount = (_entry = h[$String.keyFor("Set-Cookie")], _entry !== undefined ? _entry.v : sliceType$2.nil).$length; if (cookieCount === 0) { $s = -1; return new sliceType$29([]); } cookies = $makeSlice(sliceType$29, 0, cookieCount); _ref = (_entry$1 = h[$String.keyFor("Set-Cookie")], _entry$1 !== undefined ? _entry$1.v : sliceType$2.nil); _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } line = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); parts = strings.Split(textproto.TrimString(line), ";"); if ((parts.$length === 1) && (0 >= parts.$length ? ($throwRuntimeError("index out of range"), undefined) : parts.$array[parts.$offset + 0]) === "") { _i++; /* continue; */ $s = 1; continue; } (0 >= parts.$length ? ($throwRuntimeError("index out of range"), undefined) : parts.$array[parts.$offset + 0] = textproto.TrimString((0 >= parts.$length ? ($throwRuntimeError("index out of range"), undefined) : parts.$array[parts.$offset + 0]))); j = strings.Index((0 >= parts.$length ? ($throwRuntimeError("index out of range"), undefined) : parts.$array[parts.$offset + 0]), "="); if (j < 0) { _i++; /* continue; */ $s = 1; continue; } _tmp = $substring((0 >= parts.$length ? ($throwRuntimeError("index out of range"), undefined) : parts.$array[parts.$offset + 0]), 0, j); _tmp$1 = $substring((0 >= parts.$length ? ($throwRuntimeError("index out of range"), undefined) : parts.$array[parts.$offset + 0]), (j + 1 >> 0)); name = _tmp; value = _tmp$1; _r$1 = isCookieNameValid(name); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (!_r$1) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!_r$1) { */ case 3: _i++; /* continue; */ $s = 1; continue; /* } */ case 4: _tuple = parseCookieValue(value, true); value = _tuple[0]; ok = _tuple[1]; if (!ok) { _i++; /* continue; */ $s = 1; continue; } c = new Cookie.ptr(name, value, "", "", new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil), "", 0, false, false, 0, line, sliceType$2.nil); i = 1; /* while (true) { */ case 6: /* if (!(i < parts.$length)) { break; } */ if(!(i < parts.$length)) { $s = 7; continue; } ((i < 0 || i >= parts.$length) ? ($throwRuntimeError("index out of range"), undefined) : parts.$array[parts.$offset + i] = textproto.TrimString(((i < 0 || i >= parts.$length) ? ($throwRuntimeError("index out of range"), undefined) : parts.$array[parts.$offset + i]))); if (((i < 0 || i >= parts.$length) ? ($throwRuntimeError("index out of range"), undefined) : parts.$array[parts.$offset + i]).length === 0) { i = i + (1) >> 0; /* continue; */ $s = 6; continue; } _tmp$2 = ((i < 0 || i >= parts.$length) ? ($throwRuntimeError("index out of range"), undefined) : parts.$array[parts.$offset + i]); _tmp$3 = ""; attr = _tmp$2; val = _tmp$3; j$1 = strings.Index(attr, "="); if (j$1 >= 0) { _tmp$4 = $substring(attr, 0, j$1); _tmp$5 = $substring(attr, (j$1 + 1 >> 0)); attr = _tmp$4; val = _tmp$5; } _r$2 = ascii.ToLower(attr); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; lowerAttr = _tuple$1[0]; isASCII = _tuple$1[1]; if (!isASCII) { i = i + (1) >> 0; /* continue; */ $s = 6; continue; } _tuple$2 = parseCookieValue(val, false); val = _tuple$2[0]; ok = _tuple$2[1]; if (!ok) { c.Unparsed = $append(c.Unparsed, ((i < 0 || i >= parts.$length) ? ($throwRuntimeError("index out of range"), undefined) : parts.$array[parts.$offset + i])); i = i + (1) >> 0; /* continue; */ $s = 6; continue; } _1 = lowerAttr; /* */ if (_1 === ("samesite")) { $s = 10; continue; } /* */ if (_1 === ("secure")) { $s = 11; continue; } /* */ if (_1 === ("httponly")) { $s = 12; continue; } /* */ if (_1 === ("domain")) { $s = 13; continue; } /* */ if (_1 === ("max-age")) { $s = 14; continue; } /* */ if (_1 === ("expires")) { $s = 15; continue; } /* */ if (_1 === ("path")) { $s = 16; continue; } /* */ $s = 17; continue; /* if (_1 === ("samesite")) { */ case 10: _r$3 = ascii.ToLower(val); /* */ $s = 18; case 18: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$3 = _r$3; lowerVal = _tuple$3[0]; ascii$1 = _tuple$3[1]; if (!ascii$1) { c.SameSite = 1; i = i + (1) >> 0; /* continue; */ $s = 6; continue; } _2 = lowerVal; if (_2 === ("lax")) { c.SameSite = 2; } else if (_2 === ("strict")) { c.SameSite = 3; } else if (_2 === ("none")) { c.SameSite = 4; } else { c.SameSite = 1; } i = i + (1) >> 0; /* continue; */ $s = 6; continue; $s = 17; continue; /* } else if (_1 === ("secure")) { */ case 11: c.Secure = true; i = i + (1) >> 0; /* continue; */ $s = 6; continue; $s = 17; continue; /* } else if (_1 === ("httponly")) { */ case 12: c.HttpOnly = true; i = i + (1) >> 0; /* continue; */ $s = 6; continue; $s = 17; continue; /* } else if (_1 === ("domain")) { */ case 13: c.Domain = val; i = i + (1) >> 0; /* continue; */ $s = 6; continue; $s = 17; continue; /* } else if (_1 === ("max-age")) { */ case 14: _tuple$4 = strconv.Atoi(val); secs = _tuple$4[0]; err = _tuple$4[1]; if (!($interfaceIsEqual(err, $ifaceNil)) || !((secs === 0)) && (val.charCodeAt(0) === 48)) { /* break; */ $s = 9; continue; } if (secs <= 0) { secs = -1; } c.MaxAge = secs; i = i + (1) >> 0; /* continue; */ $s = 6; continue; $s = 17; continue; /* } else if (_1 === ("expires")) { */ case 15: c.RawExpires = val; _r$4 = time.Parse("Mon, 02 Jan 2006 15:04:05 MST", val); /* */ $s = 19; case 19: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$5 = _r$4; exptime = $clone(_tuple$5[0], time.Time); err$1 = _tuple$5[1]; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 20; continue; } /* */ $s = 21; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 20: _r$5 = time.Parse("Mon, 02-Jan-2006 15:04:05 MST", val); /* */ $s = 22; case 22: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$6 = _r$5; time.Time.copy(exptime, _tuple$6[0]); err$1 = _tuple$6[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { time.Time.copy(c.Expires, new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil)); /* break; */ $s = 9; continue; } /* } */ case 21: time.Time.copy(c.Expires, $clone(exptime, time.Time).UTC()); i = i + (1) >> 0; /* continue; */ $s = 6; continue; $s = 17; continue; /* } else if (_1 === ("path")) { */ case 16: c.Path = val; i = i + (1) >> 0; /* continue; */ $s = 6; continue; /* } */ case 17: case 9: c.Unparsed = $append(c.Unparsed, ((i < 0 || i >= parts.$length) ? ($throwRuntimeError("index out of range"), undefined) : parts.$array[parts.$offset + i])); i = i + (1) >> 0; $s = 6; continue; case 7: cookies = $append(cookies, c); _i++; $s = 1; continue; case 2: $s = -1; return cookies; /* */ } return; } if ($f === undefined) { $f = { $blk: readSetCookies }; } $f._1 = _1; $f._2 = _2; $f._entry = _entry; $f._entry$1 = _entry$1; $f._i = _i; $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._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._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.ascii$1 = ascii$1; $f.attr = attr; $f.c = c; $f.cookieCount = cookieCount; $f.cookies = cookies; $f.err = err; $f.err$1 = err$1; $f.exptime = exptime; $f.h = h; $f.i = i; $f.isASCII = isASCII; $f.j = j; $f.j$1 = j$1; $f.line = line; $f.lowerAttr = lowerAttr; $f.lowerVal = lowerVal; $f.name = name; $f.ok = ok; $f.parts = parts; $f.secs = secs; $f.val = val; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; Cookie.ptr.prototype.String = function() { var _1, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _v, b, buf, c, d, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _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; _v = $f._v; b = $f.b; buf = $f.buf; c = $f.c; d = $f.d; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (c === ptrType$62.nil) { _v = true; $s = 3; continue s; } _r$1 = isCookieNameValid(c.Name); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _v = !_r$1; case 3: /* */ if (_v) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v) { */ case 1: $s = -1; return ""; /* } */ case 2: b = new strings.Builder.ptr(ptrType$113.nil, sliceType$3.nil); b.Grow((((c.Name.length + c.Value.length >> 0) + c.Domain.length >> 0) + c.Path.length >> 0) + 110 >> 0); b.WriteString(c.Name); b.WriteRune(61); _r$2 = sanitizeCookieValue(c.Value); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = b.WriteString(_r$2); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; /* */ if (c.Path.length > 0) { $s = 7; continue; } /* */ $s = 8; continue; /* if (c.Path.length > 0) { */ case 7: b.WriteString("; Path="); _r$4 = sanitizeCookiePath(c.Path); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = b.WriteString(_r$4); /* */ $s = 10; case 10: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; /* } */ case 8: /* */ if (c.Domain.length > 0) { $s = 11; continue; } /* */ $s = 12; continue; /* if (c.Domain.length > 0) { */ case 11: /* */ if (validCookieDomain(c.Domain)) { $s = 13; continue; } /* */ $s = 14; continue; /* if (validCookieDomain(c.Domain)) { */ case 13: d = c.Domain; if (d.charCodeAt(0) === 46) { d = $substring(d, 1); } b.WriteString("; Domain="); b.WriteString(d); $s = 15; continue; /* } else { */ case 14: $r = log.Printf("net/http: invalid Cookie.Domain %q; dropping domain attribute", new sliceType([new $String(c.Domain)])); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 15: /* } */ case 12: buf = arrayType$3.zero(); _r$6 = validCookieExpires($clone(c.Expires, time.Time)); /* */ $s = 19; case 19: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } /* */ if (_r$6) { $s = 17; continue; } /* */ $s = 18; continue; /* if (_r$6) { */ case 17: b.WriteString("; Expires="); _r$7 = $clone($clone(c.Expires, time.Time).UTC(), time.Time).AppendFormat($subslice(new sliceType$3(buf), 0, 0), "Mon, 02 Jan 2006 15:04:05 GMT"); /* */ $s = 20; case 20: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$8 = b.Write(_r$7); /* */ $s = 21; case 21: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$8; /* } */ case 18: if (c.MaxAge > 0) { b.WriteString("; Max-Age="); b.Write(strconv.AppendInt($subslice(new sliceType$3(buf), 0, 0), (new $Int64(0, c.MaxAge)), 10)); } else if (c.MaxAge < 0) { b.WriteString("; Max-Age=0"); } if (c.HttpOnly) { b.WriteString("; HttpOnly"); } if (c.Secure) { b.WriteString("; Secure"); } _1 = c.SameSite; if (_1 === (1)) { } else if (_1 === (4)) { b.WriteString("; SameSite=None"); } else if (_1 === (2)) { b.WriteString("; SameSite=Lax"); } else if (_1 === (3)) { b.WriteString("; SameSite=Strict"); } $s = -1; return b.String(); /* */ } return; } if ($f === undefined) { $f = { $blk: Cookie.ptr.prototype.String }; } $f._1 = _1; $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._v = _v; $f.b = b; $f.buf = buf; $f.c = c; $f.d = d; $f.$s = $s; $f.$r = $r; return $f; }; Cookie.prototype.String = function() { return this.$val.String(); }; readCookies = function(h, filter) { var _entry, _i, _r$1, _ref, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, cookies, filter, h, j, line, lines, name, ok, part, splitIndex, val, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _i = $f._i; _r$1 = $f._r$1; _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; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tuple = $f._tuple; cookies = $f.cookies; filter = $f.filter; h = $f.h; j = $f.j; line = $f.line; lines = $f.lines; name = $f.name; ok = $f.ok; part = $f.part; splitIndex = $f.splitIndex; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: lines = (_entry = h[$String.keyFor("Cookie")], _entry !== undefined ? _entry.v : sliceType$2.nil); if (lines.$length === 0) { $s = -1; return new sliceType$29([]); } cookies = $makeSlice(sliceType$29, 0, (lines.$length + strings.Count((0 >= lines.$length ? ($throwRuntimeError("index out of range"), undefined) : lines.$array[lines.$offset + 0]), ";") >> 0)); _ref = lines; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } line = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); line = textproto.TrimString(line); part = ""; /* while (true) { */ case 3: /* if (!(line.length > 0)) { break; } */ if(!(line.length > 0)) { $s = 4; continue; } splitIndex = strings.Index(line, ";"); if (splitIndex > 0) { _tmp = $substring(line, 0, splitIndex); _tmp$1 = $substring(line, (splitIndex + 1 >> 0)); part = _tmp; line = _tmp$1; } else { _tmp$2 = line; _tmp$3 = ""; part = _tmp$2; line = _tmp$3; } part = textproto.TrimString(part); if (part.length === 0) { /* continue; */ $s = 3; continue; } _tmp$4 = part; _tmp$5 = ""; name = _tmp$4; val = _tmp$5; j = strings.Index(part, "="); if (j >= 0) { _tmp$6 = $substring(name, 0, j); _tmp$7 = $substring(name, (j + 1 >> 0)); name = _tmp$6; val = _tmp$7; } _r$1 = isCookieNameValid(name); /* */ $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: /* continue; */ $s = 3; continue; /* } */ case 6: if (!(filter === "") && !(filter === name)) { /* continue; */ $s = 3; continue; } _tuple = parseCookieValue(val, true); val = _tuple[0]; ok = _tuple[1]; if (!ok) { /* continue; */ $s = 3; continue; } cookies = $append(cookies, new Cookie.ptr(name, val, "", "", new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil), "", 0, false, false, 0, "", sliceType$2.nil)); $s = 3; continue; case 4: _i++; $s = 1; continue; case 2: $s = -1; return cookies; /* */ } return; } if ($f === undefined) { $f = { $blk: readCookies }; } $f._entry = _entry; $f._i = _i; $f._r$1 = _r$1; $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._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f._tuple = _tuple; $f.cookies = cookies; $f.filter = filter; $f.h = h; $f.j = j; $f.line = line; $f.lines = lines; $f.name = name; $f.ok = ok; $f.part = part; $f.splitIndex = splitIndex; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; }; validCookieDomain = function(v) { var v; if (isCookieDomainName(v)) { return true; } if (!(net.ParseIP(v) === net.IP.nil) && !strings.Contains(v, ":")) { return true; } return false; }; validCookieExpires = function(t) { var $24r, _r$1, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = $clone(t, time.Time).Year(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1 >= 1601; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: validCookieExpires }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; isCookieDomainName = function(s) { var c, i, last, ok, partlen, s; if (s.length === 0) { return false; } if (s.length > 255) { return false; } if (s.charCodeAt(0) === 46) { s = $substring(s, 1); } last = 46; ok = false; partlen = 0; i = 0; while (true) { if (!(i < s.length)) { break; } c = s.charCodeAt(i); if (97 <= c && c <= 122 || 65 <= c && c <= 90) { ok = true; partlen = partlen + (1) >> 0; } else if (48 <= c && c <= 57) { partlen = partlen + (1) >> 0; } else if ((c === 45)) { if (last === 46) { return false; } partlen = partlen + (1) >> 0; } else if ((c === 46)) { if ((last === 46) || (last === 45)) { return false; } if (partlen > 63 || (partlen === 0)) { return false; } partlen = 0; } else { return false; } last = c; i = i + (1) >> 0; } if ((last === 45) || partlen > 63) { return false; } return ok; }; sanitizeCookieName = function(n) { var $24r, _r$1, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = cookieNameSanitizer.Replace(n); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: sanitizeCookieName }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; sanitizeCookieValue = function(v) { var _r$1, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = sanitizeOrWarn("Cookie.Value", validCookieValueByte, v); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } v = _r$1; if (v.length === 0) { $s = -1; return v; } if (strings.IndexByte(v, 32) >= 0 || strings.IndexByte(v, 44) >= 0) { $s = -1; return "\"" + v + "\""; } $s = -1; return v; /* */ } return; } if ($f === undefined) { $f = { $blk: sanitizeCookieValue }; } $f._r$1 = _r$1; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; validCookieValueByte = function(b) { var b; return 32 <= b && b < 127 && !((b === 34)) && !((b === 59)) && !((b === 92)); }; sanitizeCookiePath = function(v) { var $24r, _r$1, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = sanitizeOrWarn("Cookie.Path", validCookiePathByte, v); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: sanitizeCookiePath }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; validCookiePathByte = function(b) { var b; return 32 <= b && b < 127 && !((b === 59)); }; sanitizeOrWarn = function(fieldName, valid, v) { var _r$1, _r$2, b, buf, fieldName, i, i$1, ok, v, valid, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; b = $f.b; buf = $f.buf; fieldName = $f.fieldName; i = $f.i; i$1 = $f.i$1; ok = $f.ok; v = $f.v; valid = $f.valid; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ok = true; i = 0; /* while (true) { */ case 1: /* if (!(i < v.length)) { break; } */ if(!(i < v.length)) { $s = 2; continue; } _r$1 = valid(v.charCodeAt(i)); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (_r$1) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_r$1) { */ case 3: i = i + (1) >> 0; /* continue; */ $s = 1; continue; /* } */ case 4: $r = log.Printf("net/http: invalid byte %q in %s; dropping invalid bytes", new sliceType([new $Uint8(v.charCodeAt(i)), new $String(fieldName)])); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } ok = false; /* break; */ $s = 2; continue; case 2: if (ok) { $s = -1; return v; } buf = $makeSlice(sliceType$3, 0, v.length); i$1 = 0; /* while (true) { */ case 7: /* if (!(i$1 < v.length)) { break; } */ if(!(i$1 < v.length)) { $s = 8; continue; } b = v.charCodeAt(i$1); _r$2 = valid(b); /* */ $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: buf = $append(buf, b); /* } */ case 10: i$1 = i$1 + (1) >> 0; $s = 7; continue; case 8: $s = -1; return ($bytesToString(buf)); /* */ } return; } if ($f === undefined) { $f = { $blk: sanitizeOrWarn }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f.b = b; $f.buf = buf; $f.fieldName = fieldName; $f.i = i; $f.i$1 = i$1; $f.ok = ok; $f.v = v; $f.valid = valid; $f.$s = $s; $f.$r = $r; return $f; }; parseCookieValue = function(raw, allowDoubleQuote) { var allowDoubleQuote, i, raw; if (allowDoubleQuote && raw.length > 1 && (raw.charCodeAt(0) === 34) && (raw.charCodeAt((raw.length - 1 >> 0)) === 34)) { raw = $substring(raw, 1, (raw.length - 1 >> 0)); } i = 0; while (true) { if (!(i < raw.length)) { break; } if (!validCookieValueByte(raw.charCodeAt(i))) { return ["", false]; } i = i + (1) >> 0; } return [raw, true]; }; isCookieNameValid = function(raw) { var $24r, _r$1, raw, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; raw = $f.raw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (raw === "") { $s = -1; return false; } _r$1 = strings.IndexFunc(raw, isNotToken); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1 < 0; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: isCookieNameValid }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.raw = raw; $f.$s = $s; $f.$r = $r; return $f; }; cloneURLValues = function(v) { var v; if (v === false) { return false; } return (new Header((v)).Clone()); }; cloneURL = function(u) { var u, u2; if (u === ptrType$17.nil) { return ptrType$17.nil; } u2 = new url.URL.ptr("", "", ptrType$21.nil, "", "", "", false, "", "", ""); url.URL.copy(u2, u); if (!(u.User === ptrType$21.nil)) { u2.User = new url.Userinfo.ptr("", "", false); url.Userinfo.copy(u2.User, u.User); } return u2; }; cloneMultipartForm = function(f) { var _entry, _i, _i$1, _key, _keys, _ref, _ref$1, f, f2, i, k, m, v, vv, vv2; if (f === ptrType$31.nil) { return ptrType$31.nil; } f2 = new multipart.Form.ptr((new Header((f.Value)).Clone()), false); if (!(f.File === false)) { m = {}; _ref = f.File; _i = 0; _keys = $keys(_ref); while (true) { if (!(_i < _keys.length)) { break; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; continue; } k = _entry.k; vv = _entry.v; vv2 = $makeSlice(sliceType$20, vv.$length); _ref$1 = vv; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } i = _i$1; v = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); ((i < 0 || i >= vv2.$length) ? ($throwRuntimeError("index out of range"), undefined) : vv2.$array[vv2.$offset + i] = cloneMultipartFileHeader(v)); _i$1++; } _key = k; (m || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: vv2 }; _i++; } f2.File = m; } return f2; }; cloneMultipartFileHeader = function(fh) { var fh, fh2; if (fh === ptrType$66.nil) { return ptrType$66.nil; } fh2 = new multipart.FileHeader.ptr("", false, new $Int64(0, 0), sliceType$3.nil, ""); multipart.FileHeader.copy(fh2, fh); fh2.Header = (new Header((fh.Header)).Clone()); return fh2; }; cloneOrMakeHeader = function(hdr) { var clone, hdr; clone = new Header(hdr).Clone(); if (clone === false) { clone = {}; } return clone; }; refererForURL = function(lastReq, newReq) { var auth, lastReq, newReq, referer; if (lastReq.Scheme === "https" && newReq.Scheme === "http") { return ""; } referer = lastReq.String(); if (!(lastReq.User === ptrType$21.nil)) { auth = lastReq.User.String() + "@"; referer = strings.Replace(referer, auth, "", 1); } return referer; }; Client.ptr.prototype.send = function(req, deadline) { var _i, _r$1, _r$2, _r$3, _ref, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, c, cookie, deadline, didTimeout, err, rc, req, resp, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _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; c = $f.c; cookie = $f.cookie; deadline = $f.deadline; didTimeout = $f.didTimeout; err = $f.err; rc = $f.rc; req = $f.req; resp = $f.resp; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: resp = ptrType$18.nil; didTimeout = $throwNilPointerError; err = $ifaceNil; c = this; /* */ if (!($interfaceIsEqual(c.Jar, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(c.Jar, $ifaceNil))) { */ case 1: _r$1 = c.Jar.Cookies(req.URL); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _ref = _r$1; _i = 0; /* while (true) { */ case 4: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 5; continue; } cookie = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); $r = req.AddCookie(cookie); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i++; $s = 4; continue; case 5: /* } */ case 2: _r$2 = send(req, c.transport(), $clone(deadline, time.Time)); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; resp = _tuple[0]; didTimeout = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp = ptrType$18.nil; _tmp$1 = didTimeout; _tmp$2 = err; resp = _tmp; didTimeout = _tmp$1; err = _tmp$2; $s = -1; return [resp, didTimeout, err]; } /* */ if (!($interfaceIsEqual(c.Jar, $ifaceNil))) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!($interfaceIsEqual(c.Jar, $ifaceNil))) { */ case 8: _r$3 = resp.Cookies(); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } rc = _r$3; /* */ if (rc.$length > 0) { $s = 11; continue; } /* */ $s = 12; continue; /* if (rc.$length > 0) { */ case 11: $r = c.Jar.SetCookies(req.URL, rc); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 12: /* } */ case 9: _tmp$3 = resp; _tmp$4 = $throwNilPointerError; _tmp$5 = $ifaceNil; resp = _tmp$3; didTimeout = _tmp$4; err = _tmp$5; $s = -1; return [resp, didTimeout, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Client.ptr.prototype.send }; } $f._i = _i; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $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.c = c; $f.cookie = cookie; $f.deadline = deadline; $f.didTimeout = didTimeout; $f.err = err; $f.rc = rc; $f.req = req; $f.resp = resp; $f.$s = $s; $f.$r = $r; return $f; }; Client.prototype.send = function(req, deadline) { return this.$val.send(req, deadline); }; Client.ptr.prototype.deadline = function() { var $24r, _r$1, _r$2, c, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; c = $f.c; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; /* */ if ((x$5 = c.Timeout, (x$5.$high > 0 || (x$5.$high === 0 && x$5.$low > 0)))) { $s = 1; continue; } /* */ $s = 2; continue; /* if ((x$5 = c.Timeout, (x$5.$high > 0 || (x$5.$high === 0 && x$5.$low > 0)))) { */ case 1: _r$1 = time.Now(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = $clone(_r$1, time.Time).Add(c.Timeout); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 5; case 5: return $24r; /* } */ case 2: $s = -1; return new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil); /* */ } return; } if ($f === undefined) { $f = { $blk: Client.ptr.prototype.deadline }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.c = c; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; Client.prototype.deadline = function() { return this.$val.deadline(); }; Client.ptr.prototype.transport = function() { var c; c = this; if (!($interfaceIsEqual(c.Transport, $ifaceNil))) { return c.Transport; } return $pkg.DefaultTransport; }; Client.prototype.transport = function() { return this.$val.transport(); }; send = function(ireq, rt, deadline) { var $24r, $24r$1, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _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$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _v, deadline, didTimeout, err, forkReq, ireq, ok, password, req, resp, rt, stopTimer, tlsErr, u, username, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; _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; _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$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _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 = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _v = $f._v; deadline = $f.deadline; didTimeout = $f.didTimeout; err = $f.err; forkReq = $f.forkReq; ireq = $f.ireq; ok = $f.ok; password = $f.password; req = $f.req; resp = $f.resp; rt = $f.rt; stopTimer = $f.stopTimer; tlsErr = $f.tlsErr; u = $f.u; username = $f.username; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ireq = [ireq]; req = [req]; resp = ptrType$18.nil; didTimeout = $throwNilPointerError; err = $ifaceNil; req[0] = ireq[0]; /* */ if ($interfaceIsEqual(rt, $ifaceNil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($interfaceIsEqual(rt, $ifaceNil)) { */ case 1: _r$1 = req[0].closeBody(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _tmp = ptrType$18.nil; _tmp$1 = alwaysFalse; _tmp$2 = errors.New("http: no Client.Transport or DefaultTransport"); resp = _tmp; didTimeout = _tmp$1; err = _tmp$2; $s = -1; return [resp, didTimeout, err]; /* } */ case 2: /* */ if (req[0].URL === ptrType$17.nil) { $s = 4; continue; } /* */ $s = 5; continue; /* if (req[0].URL === ptrType$17.nil) { */ case 4: _r$2 = req[0].closeBody(); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; _tmp$3 = ptrType$18.nil; _tmp$4 = alwaysFalse; _tmp$5 = errors.New("http: nil Request.URL"); resp = _tmp$3; didTimeout = _tmp$4; err = _tmp$5; $s = -1; return [resp, didTimeout, err]; /* } */ case 5: /* */ if (!(req[0].RequestURI === "")) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!(req[0].RequestURI === "")) { */ case 7: _r$3 = req[0].closeBody(); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _tmp$6 = ptrType$18.nil; _tmp$7 = alwaysFalse; _tmp$8 = errors.New("http: Request.RequestURI can't be set in client requests"); resp = _tmp$6; didTimeout = _tmp$7; err = _tmp$8; $s = -1; return [resp, didTimeout, err]; /* } */ case 8: forkReq = (function(ireq, req) { return function() { if (ireq[0] === req[0]) { req[0] = new Request.ptr("", ptrType$17.nil, "", 0, 0, false, $ifaceNil, $throwNilPointerError, new $Int64(0, 0), sliceType$2.nil, false, "", false, false, ptrType$31.nil, false, "", "", ptrType$28.nil, $chanNil, ptrType$18.nil, $ifaceNil); Request.copy(req[0], ireq[0]); } }; })(ireq, req); /* */ if (req[0].Header === false) { $s = 10; continue; } /* */ $s = 11; continue; /* if (req[0].Header === false) { */ case 10: $r = forkReq(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } req[0].Header = {}; /* } */ case 11: u = req[0].URL.User; if (!(!(u === ptrType$21.nil))) { _v = false; $s = 15; continue s; } _r$4 = new Header(req[0].Header).Get("Authorization"); /* */ $s = 16; case 16: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _v = _r$4 === ""; case 15: /* */ if (_v) { $s = 13; continue; } /* */ $s = 14; continue; /* if (_v) { */ case 13: username = u.Username(); _tuple = u.Password(); password = _tuple[0]; $r = forkReq(); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } req[0].Header = cloneOrMakeHeader(ireq[0].Header); $r = new Header(req[0].Header).Set("Authorization", "Basic " + basicAuth(username, password)); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 14: /* */ if (!$clone(deadline, time.Time).IsZero()) { $s = 19; continue; } /* */ $s = 20; continue; /* if (!$clone(deadline, time.Time).IsZero()) { */ case 19: $r = forkReq(); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 20: _r$5 = setRequestCancel(req[0], rt, $clone(deadline, time.Time)); /* */ $s = 22; case 22: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$1 = _r$5; stopTimer = _tuple$1[0]; didTimeout = _tuple$1[1]; _r$6 = rt.RoundTrip(req[0]); /* */ $s = 23; case 23: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tuple$2 = _r$6; resp = _tuple$2[0]; err = _tuple$2[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 24; continue; } /* */ $s = 25; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 24: $r = stopTimer(); /* */ $s = 26; case 26: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!(resp === ptrType$18.nil)) { $s = 27; continue; } /* */ $s = 28; continue; /* if (!(resp === ptrType$18.nil)) { */ case 27: $r = log.Printf("RoundTripper returned a response & error; ignoring response", new sliceType([])); /* */ $s = 29; case 29: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 28: _tuple$3 = $assertType(err, tls.RecordHeaderError, true); tlsErr = $clone(_tuple$3[0], tls.RecordHeaderError); ok = _tuple$3[1]; if (ok) { if (($bytesToString(new sliceType$3(tlsErr.RecordHeader))) === "HTTP/") { err = errors.New("http: server gave HTTP response to HTTPS client"); } } _tmp$9 = ptrType$18.nil; _tmp$10 = didTimeout; _tmp$11 = err; resp = _tmp$9; didTimeout = _tmp$10; err = _tmp$11; $s = -1; return [resp, didTimeout, err]; /* } */ case 25: /* */ if (resp === ptrType$18.nil) { $s = 30; continue; } /* */ $s = 31; continue; /* if (resp === ptrType$18.nil) { */ case 30: _tmp$12 = ptrType$18.nil; _tmp$13 = didTimeout; _r$7 = fmt.Errorf("http: RoundTripper implementation (%T) returned a nil *Response with a nil error", new sliceType([rt])); /* */ $s = 32; case 32: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _tmp$14 = _r$7; resp = _tmp$12; didTimeout = _tmp$13; err = _tmp$14; $24r = [resp, didTimeout, err]; $s = 33; case 33: return $24r; /* } */ case 31: /* */ if ($interfaceIsEqual(resp.Body, $ifaceNil)) { $s = 34; continue; } /* */ $s = 35; continue; /* if ($interfaceIsEqual(resp.Body, $ifaceNil)) { */ case 34: /* */ if ((x$5 = resp.ContentLength, (x$5.$high > 0 || (x$5.$high === 0 && x$5.$low > 0))) && !(req[0].Method === "HEAD")) { $s = 36; continue; } /* */ $s = 37; continue; /* if ((x$5 = resp.ContentLength, (x$5.$high > 0 || (x$5.$high === 0 && x$5.$low > 0))) && !(req[0].Method === "HEAD")) { */ case 36: _tmp$15 = ptrType$18.nil; _tmp$16 = didTimeout; _r$8 = fmt.Errorf("http: RoundTripper implementation (%T) returned a *Response with content length %d but a nil Body", new sliceType([rt, resp.ContentLength])); /* */ $s = 38; case 38: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _tmp$17 = _r$8; resp = _tmp$15; didTimeout = _tmp$16; err = _tmp$17; $24r$1 = [resp, didTimeout, err]; $s = 39; case 39: return $24r$1; /* } */ case 37: resp.Body = io.NopCloser(strings.NewReader("")); /* } */ case 35: if (!$clone(deadline, time.Time).IsZero()) { resp.Body = new cancelTimerBody.ptr(stopTimer, resp.Body, didTimeout); } _tmp$18 = resp; _tmp$19 = $throwNilPointerError; _tmp$20 = $ifaceNil; resp = _tmp$18; didTimeout = _tmp$19; err = _tmp$20; $s = -1; return [resp, didTimeout, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: send }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $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._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$3 = _tmp$3; $f._tmp$4 = _tmp$4; $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 = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._v = _v; $f.deadline = deadline; $f.didTimeout = didTimeout; $f.err = err; $f.forkReq = forkReq; $f.ireq = ireq; $f.ok = ok; $f.password = password; $f.req = req; $f.resp = resp; $f.rt = rt; $f.stopTimer = stopTimer; $f.tlsErr = tlsErr; $f.u = u; $f.username = username; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; timeBeforeContextDeadline = function(t, ctx) { var _r$1, _tuple, ctx, d, ok, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; ctx = $f.ctx; d = $f.d; ok = $f.ok; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = ctx.Deadline(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; d = $clone(_tuple[0], time.Time); ok = _tuple[1]; if (!ok) { $s = -1; return true; } $s = -1; return $clone(t, time.Time).Before($clone(d, time.Time)); /* */ } return; } if ($f === undefined) { $f = { $blk: timeBeforeContextDeadline }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.ctx = ctx; $f.d = d; $f.ok = ok; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; knownRoundTripperImpl = function(rt, req) { var $24r, _r$1, _r$2, _r$3, _ref, altRT, req, rt, t, t$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; altRT = $f.altRT; req = $f.req; rt = $f.rt; t = $f.t; t$1 = $f.t$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _ref = rt; /* */ if ($assertType(_ref, ptrType$27, true)[1]) { $s = 1; continue; } /* */ if ($assertType(_ref, ptrType$102, true)[1] || $assertType(_ref, http2noDialH2RoundTripper, true)[1]) { $s = 2; continue; } /* */ $s = 3; continue; /* if ($assertType(_ref, ptrType$27, true)[1]) { */ case 1: t = _ref.$val; _r$1 = t.alternateRoundTripper(req); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } altRT = _r$1; /* */ if (!($interfaceIsEqual(altRT, $ifaceNil))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(altRT, $ifaceNil))) { */ case 5: _r$2 = knownRoundTripperImpl(altRT, req); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $24r = _r$2; $s = 8; case 8: return $24r; /* } */ case 6: $s = -1; return true; /* } else if ($assertType(_ref, ptrType$102, true)[1] || $assertType(_ref, http2noDialH2RoundTripper, true)[1]) { */ case 2: t$1 = _ref; $s = -1; return true; /* } */ case 3: _r$3 = reflect.TypeOf(rt).String(); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } /* */ if (_r$3 === "*http2.Transport") { $s = 9; continue; } /* */ $s = 10; continue; /* if (_r$3 === "*http2.Transport") { */ case 9: $s = -1; return true; /* } */ case 10: $s = -1; return false; /* */ } return; } if ($f === undefined) { $f = { $blk: knownRoundTripperImpl }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._ref = _ref; $f.altRT = altRT; $f.req = req; $f.rt = rt; $f.t = t; $f.t$1 = t$1; $f.$s = $s; $f.$r = $r; return $f; }; setRequestCancel = function(req, rt, deadline) { var _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, _tuple$1, cancel, cancelCtx, cancelCtx$1, deadline, didTimeout, doCancel, initialReqCancel, knownTransport, oldCtx, oldCtx$1, once, req, rt, stopTimer, stopTimerCh, timedOut, timer, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; cancel = $f.cancel; cancelCtx = $f.cancelCtx; cancelCtx$1 = $f.cancelCtx$1; deadline = $f.deadline; didTimeout = $f.didTimeout; doCancel = $f.doCancel; initialReqCancel = $f.initialReqCancel; knownTransport = $f.knownTransport; oldCtx = $f.oldCtx; oldCtx$1 = $f.oldCtx$1; once = $f.once; req = $f.req; rt = $f.rt; stopTimer = $f.stopTimer; stopTimerCh = $f.stopTimerCh; timedOut = $f.timedOut; timer = $f.timer; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cancel = [cancel]; cancelCtx = [cancelCtx]; deadline = [deadline]; doCancel = [doCancel]; initialReqCancel = [initialReqCancel]; once = [once]; req = [req]; rt = [rt]; stopTimerCh = [stopTimerCh]; timedOut = [timedOut]; timer = [timer]; stopTimer = $throwNilPointerError; didTimeout = $throwNilPointerError; if ($clone(deadline[0], time.Time).IsZero()) { _tmp = nop; _tmp$1 = alwaysFalse; stopTimer = _tmp; didTimeout = _tmp$1; $s = -1; return [stopTimer, didTimeout]; } _r$1 = knownRoundTripperImpl(rt[0], req[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } knownTransport = _r$1; oldCtx = req[0].Context(); /* */ if (req[0].Cancel === $chanNil && knownTransport) { $s = 2; continue; } /* */ $s = 3; continue; /* if (req[0].Cancel === $chanNil && knownTransport) { */ case 2: _r$2 = timeBeforeContextDeadline($clone(deadline[0], time.Time), oldCtx); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } /* */ if (!_r$2) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!_r$2) { */ case 4: _tmp$2 = nop; _tmp$3 = alwaysFalse; stopTimer = _tmp$2; didTimeout = _tmp$3; $s = -1; return [stopTimer, didTimeout]; /* } */ case 5: cancelCtx$1 = $throwNilPointerError; _r$3 = context.WithDeadline(oldCtx, $clone(deadline[0], time.Time)); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; req[0].ctx = _tuple[0]; cancelCtx$1 = _tuple[1]; _tmp$4 = cancelCtx$1; _tmp$5 = (function(cancel, cancelCtx, deadline, doCancel, initialReqCancel, once, req, rt, stopTimerCh, timedOut, timer) { return function $b() { var $24r, _r$4, _r$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$4 = $f._r$4; _r$5 = $f._r$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$4 = time.Now(); /* */ $s = 1; case 1: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = $clone(_r$4, time.Time).After($clone(deadline[0], time.Time)); /* */ $s = 2; case 2: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $24r = _r$5; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$24r = $24r; $f._r$4 = _r$4; $f._r$5 = _r$5; $f.$s = $s; $f.$r = $r; return $f; }; })(cancel, cancelCtx, deadline, doCancel, initialReqCancel, once, req, rt, stopTimerCh, timedOut, timer); stopTimer = _tmp$4; didTimeout = _tmp$5; $s = -1; return [stopTimer, didTimeout]; /* } */ case 3: initialReqCancel[0] = req[0].Cancel; cancelCtx[0] = $throwNilPointerError; oldCtx$1 = req[0].Context(); _r$4 = timeBeforeContextDeadline($clone(deadline[0], time.Time), oldCtx$1); /* */ $s = 10; case 10: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } /* */ if (_r$4) { $s = 8; continue; } /* */ $s = 9; continue; /* if (_r$4) { */ case 8: _r$5 = context.WithDeadline(oldCtx$1, $clone(deadline[0], time.Time)); /* */ $s = 11; case 11: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$1 = _r$5; req[0].ctx = _tuple$1[0]; cancelCtx[0] = _tuple$1[1]; /* } */ case 9: cancel[0] = new $Chan(structType, 0); req[0].Cancel = cancel[0]; doCancel[0] = (function(cancel, cancelCtx, deadline, doCancel, initialReqCancel, once, req, rt, stopTimerCh, timedOut, timer) { return function $b() { var _tuple$2, ok, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple$2 = $f._tuple$2; ok = $f.ok; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $close(cancel[0]); _tuple$2 = $assertType(rt[0], canceler, true); v = _tuple$2[0]; ok = _tuple$2[1]; /* */ if (ok) { $s = 1; continue; } /* */ $s = 2; continue; /* if (ok) { */ case 1: $r = v.CancelRequest(req[0]); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._tuple$2 = _tuple$2; $f.ok = ok; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; })(cancel, cancelCtx, deadline, doCancel, initialReqCancel, once, req, rt, stopTimerCh, timedOut, timer); stopTimerCh[0] = new $Chan(structType, 0); once[0] = new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)); stopTimer = (function(cancel, cancelCtx, deadline, doCancel, initialReqCancel, once, req, rt, stopTimerCh, timedOut, timer) { return function $b() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = once[0].Do((function(cancel, cancelCtx, deadline, doCancel, initialReqCancel, once, req, rt, stopTimerCh, timedOut, timer) { return function $b() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $close(stopTimerCh[0]); /* */ if (!(cancelCtx[0] === $throwNilPointerError)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(cancelCtx[0] === $throwNilPointerError)) { */ case 1: $r = cancelCtx[0](); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$s = $s; $f.$r = $r; return $f; }; })(cancel, cancelCtx, deadline, doCancel, initialReqCancel, once, req, rt, stopTimerCh, timedOut, timer)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$s = $s; $f.$r = $r; return $f; }; })(cancel, cancelCtx, deadline, doCancel, initialReqCancel, once, req, rt, stopTimerCh, timedOut, timer); _r$6 = time.Until($clone(deadline[0], time.Time)); /* */ $s = 12; case 12: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$7 = time.NewTimer(_r$6); /* */ $s = 13; case 13: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } timer[0] = _r$7; timedOut[0] = 0; $go((function(cancel, cancelCtx, deadline, doCancel, initialReqCancel, once, req, rt, stopTimerCh, timedOut, timer) { return function $b() { var _r$8, _selection, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$8 = $f._r$8; _selection = $f._selection; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$8 = $select([[initialReqCancel[0]], [timer[0].C], [stopTimerCh[0]]]); /* */ $s = 1; case 1: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _selection = _r$8; /* */ if (_selection[0] === 0) { $s = 2; continue; } /* */ if (_selection[0] === 1) { $s = 3; continue; } /* */ if (_selection[0] === 2) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_selection[0] === 0) { */ case 2: $r = doCancel[0](); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } timer[0].Stop(); $s = 5; continue; /* } else if (_selection[0] === 1) { */ case 3: (timedOut.$ptr || (timedOut.$ptr = new ptrType$51(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, timedOut))).setTrue(); $r = doCancel[0](); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 5; continue; /* } else if (_selection[0] === 2) { */ case 4: timer[0].Stop(); /* } */ case 5: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$8 = _r$8; $f._selection = _selection; $f.$s = $s; $f.$r = $r; return $f; }; })(cancel, cancelCtx, deadline, doCancel, initialReqCancel, once, req, rt, stopTimerCh, timedOut, timer), []); _tmp$6 = stopTimer; _tmp$7 = $methodVal((timedOut.$ptr || (timedOut.$ptr = new ptrType$51(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, timedOut))), "isSet"); stopTimer = _tmp$6; didTimeout = _tmp$7; $s = -1; return [stopTimer, didTimeout]; /* */ } return; } if ($f === undefined) { $f = { $blk: setRequestCancel }; } $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._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.cancel = cancel; $f.cancelCtx = cancelCtx; $f.cancelCtx$1 = cancelCtx$1; $f.deadline = deadline; $f.didTimeout = didTimeout; $f.doCancel = doCancel; $f.initialReqCancel = initialReqCancel; $f.knownTransport = knownTransport; $f.oldCtx = oldCtx; $f.oldCtx$1 = oldCtx$1; $f.once = once; $f.req = req; $f.rt = rt; $f.stopTimer = stopTimer; $f.stopTimerCh = stopTimerCh; $f.timedOut = timedOut; $f.timer = timer; $f.$s = $s; $f.$r = $r; return $f; }; basicAuth = function(username, password) { var auth, password, username; auth = username + ":" + password; return base64.StdEncoding.EncodeToString((new sliceType$3($stringToBytes(auth)))); }; Get = function(url$1) { var $24r, _r$1, _tuple, err, resp, url$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; resp = $f.resp; url$1 = $f.url$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: resp = ptrType$18.nil; err = $ifaceNil; _r$1 = $pkg.DefaultClient.Get(url$1); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; resp = _tuple[0]; err = _tuple[1]; $24r = [resp, err]; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Get }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.resp = resp; $f.url$1 = url$1; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Get = Get; Client.ptr.prototype.Get = function(url$1) { var $24r, _r$1, _r$2, _tmp, _tmp$1, _tuple, _tuple$1, c, err, req, resp, url$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; c = $f.c; err = $f.err; req = $f.req; resp = $f.resp; url$1 = $f.url$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: resp = ptrType$18.nil; err = $ifaceNil; c = this; _r$1 = NewRequest("GET", url$1, $ifaceNil); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; req = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp = ptrType$18.nil; _tmp$1 = err; resp = _tmp; err = _tmp$1; $s = -1; return [resp, err]; } _r$2 = c.Do(req); /* */ $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; resp = _tuple$1[0]; err = _tuple$1[1]; $24r = [resp, err]; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Client.ptr.prototype.Get }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.c = c; $f.err = err; $f.req = req; $f.resp = resp; $f.url$1 = url$1; $f.$s = $s; $f.$r = $r; return $f; }; Client.prototype.Get = function(url$1) { return this.$val.Get(url$1); }; alwaysFalse = function() { return false; }; Client.ptr.prototype.checkRedirect = function(req, via) { var $24r, _r$1, c, fn, req, via, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; c = $f.c; fn = $f.fn; req = $f.req; via = $f.via; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; fn = c.CheckRedirect; if (fn === $throwNilPointerError) { fn = defaultCheckRedirect; } _r$1 = fn(req, via); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Client.ptr.prototype.checkRedirect }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.c = c; $f.fn = fn; $f.req = req; $f.via = via; $f.$s = $s; $f.$r = $r; return $f; }; Client.prototype.checkRedirect = function(req, via) { return this.$val.checkRedirect(req, via); }; redirectBehavior = function(reqMethod, resp, ireq) { var _1, _r$1, _tmp, _tmp$1, _tmp$2, includeBody, ireq, redirectMethod, reqMethod, resp, shouldRedirect, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; includeBody = $f.includeBody; ireq = $f.ireq; redirectMethod = $f.redirectMethod; reqMethod = $f.reqMethod; resp = $f.resp; shouldRedirect = $f.shouldRedirect; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: redirectMethod = ""; shouldRedirect = false; includeBody = false; _1 = resp.StatusCode; /* */ if ((_1 === (301)) || (_1 === (302)) || (_1 === (303))) { $s = 2; continue; } /* */ if ((_1 === (307)) || (_1 === (308))) { $s = 3; continue; } /* */ $s = 4; continue; /* if ((_1 === (301)) || (_1 === (302)) || (_1 === (303))) { */ case 2: redirectMethod = reqMethod; shouldRedirect = true; includeBody = false; if (!(reqMethod === "GET") && !(reqMethod === "HEAD")) { redirectMethod = "GET"; } $s = 4; continue; /* } else if ((_1 === (307)) || (_1 === (308))) { */ case 3: redirectMethod = reqMethod; shouldRedirect = true; includeBody = true; _r$1 = new Header(resp.Header).Get("Location"); /* */ $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: shouldRedirect = false; /* break; */ $s = 1; continue; /* } */ case 6: if (ireq.GetBody === $throwNilPointerError && !((x$5 = ireq.outgoingLength(), (x$5.$high === 0 && x$5.$low === 0)))) { shouldRedirect = false; } /* } */ case 4: case 1: _tmp = redirectMethod; _tmp$1 = shouldRedirect; _tmp$2 = includeBody; redirectMethod = _tmp; shouldRedirect = _tmp$1; includeBody = _tmp$2; $s = -1; return [redirectMethod, shouldRedirect, includeBody]; /* */ } return; } if ($f === undefined) { $f = { $blk: redirectBehavior }; } $f._1 = _1; $f._r$1 = _r$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f.includeBody = includeBody; $f.ireq = ireq; $f.redirectMethod = redirectMethod; $f.reqMethod = reqMethod; $f.resp = resp; $f.shouldRedirect = shouldRedirect; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; urlErrorOp = function(method) { var _r$1, _tuple, lowerMethod, method, ok, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _tuple = $f._tuple; lowerMethod = $f.lowerMethod; method = $f.method; ok = $f.ok; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (method === "") { $s = -1; return "Get"; } _r$1 = ascii.ToLower(method); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; lowerMethod = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return $substring(method, 0, 1) + $substring(lowerMethod, 1); } $s = -1; return method; /* */ } return; } if ($f === undefined) { $f = { $blk: urlErrorOp }; } $f._r$1 = _r$1; $f._tuple = _tuple; $f.lowerMethod = lowerMethod; $f.method = method; $f.ok = ok; $f.$s = $s; $f.$r = $r; return $f; }; Client.ptr.prototype.Do = function(req) { var $24r, _r$1, c, req, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; c = $f.c; req = $f.req; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r$1 = c.do$(req); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = _r$1; $s = 2; case 2: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Client.ptr.prototype.Do }; } $f.$24r = $24r; $f._r$1 = _r$1; $f.c = c; $f.req = req; $f.$s = $s; $f.$r = $r; return $f; }; Client.prototype.Do = function(req) { return this.$val.Do(req); }; Client.ptr.prototype.do$ = function(req) { var $24r, $24r$1, $24r$2, $24r$3, $24r$4, $24r$5, $24r$6, $24r$7, _r$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$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _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, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _v, c, copyHeaders, deadline, didTimeout, err, err$1, host, includeBody, ireq, loc, redirectMethod, ref, req, reqBodyClosed, reqs, resp, reterr, retres, shouldRedirect, u, u$1, ue, uerr, x$5, x$6, x$7, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; $24r$4 = $f.$24r$4; $24r$5 = $f.$24r$5; $24r$6 = $f.$24r$6; $24r$7 = $f.$24r$7; _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$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$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$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$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; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; _v = $f._v; c = $f.c; copyHeaders = $f.copyHeaders; deadline = $f.deadline; didTimeout = $f.didTimeout; err = $f.err; err$1 = $f.err$1; host = $f.host; includeBody = $f.includeBody; ireq = $f.ireq; loc = $f.loc; redirectMethod = $f.redirectMethod; ref = $f.ref; req = $f.req; reqBodyClosed = $f.reqBodyClosed; reqs = $f.reqs; resp = $f.resp; reterr = $f.reterr; retres = $f.retres; shouldRedirect = $f.shouldRedirect; u = $f.u; u$1 = $f.u$1; ue = $f.ue; uerr = $f.uerr; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); req = [req]; reqBodyClosed = [reqBodyClosed]; reqs = [reqs]; resp = [resp]; reterr = [reterr]; retres = [retres]; retres[0] = ptrType$18.nil; reterr[0] = $ifaceNil; c = this; /* */ if (!(testHookClientDoResult === $throwNilPointerError)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(testHookClientDoResult === $throwNilPointerError)) { */ case 1: $deferred.push([(function(req, reqBodyClosed, reqs, resp, reterr, retres) { return function $b() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = testHookClientDoResult(retres[0], reterr[0]); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$s = $s; $f.$r = $r; return $f; }; })(req, reqBodyClosed, reqs, resp, reterr, retres), []]); /* } */ case 2: /* */ if (req[0].URL === ptrType$17.nil) { $s = 3; continue; } /* */ $s = 4; continue; /* if (req[0].URL === ptrType$17.nil) { */ case 3: _r$1 = req[0].closeBody(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _tmp = ptrType$18.nil; _r$2 = urlErrorOp(req[0].Method); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tmp$1 = new url.Error.ptr(_r$2, "", errors.New("http: nil Request.URL")); retres[0] = _tmp; reterr[0] = _tmp$1; $24r = [retres[0], reterr[0]]; $s = 7; case 7: return $24r; /* } */ case 4: _r$3 = c.deadline(); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } deadline = $clone(_r$3, time.Time); reqs[0] = sliceType$30.nil; resp[0] = ptrType$18.nil; _r$4 = c.makeHeadersCopier(req[0]); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } copyHeaders = _r$4; reqBodyClosed[0] = false; redirectMethod = ""; includeBody = false; uerr = (function(req, reqBodyClosed, reqs, resp, reterr, retres) { return function $b(err) { var $24r$1, _r$5, _r$6, err, urlStr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r$1 = $f.$24r$1; _r$5 = $f._r$5; _r$6 = $f._r$6; err = $f.err; urlStr = $f.urlStr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (!reqBodyClosed[0]) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!reqBodyClosed[0]) { */ case 1: _r$5 = req[0].closeBody(); /* */ $s = 3; case 3: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; /* } */ case 2: urlStr = ""; if (!(resp[0] === ptrType$18.nil) && !(resp[0].Request === ptrType$11.nil)) { urlStr = stripPassword(resp[0].Request.URL); } else { urlStr = stripPassword(req[0].URL); } _r$6 = urlErrorOp((0 >= reqs[0].$length ? ($throwRuntimeError("index out of range"), undefined) : reqs[0].$array[reqs[0].$offset + 0]).Method); /* */ $s = 4; case 4: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } $24r$1 = new url.Error.ptr(_r$6, urlStr, err); $s = 5; case 5: return $24r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$24r$1 = $24r$1; $f._r$5 = _r$5; $f._r$6 = _r$6; $f.err = err; $f.urlStr = urlStr; $f.$s = $s; $f.$r = $r; return $f; }; })(req, reqBodyClosed, reqs, resp, reterr, retres); /* while (true) { */ case 10: /* */ if (reqs[0].$length > 0) { $s = 12; continue; } /* */ $s = 13; continue; /* if (reqs[0].$length > 0) { */ case 12: _r$5 = new Header(resp[0].Header).Get("Location"); /* */ $s = 14; case 14: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } loc = _r$5; /* */ if (loc === "") { $s = 15; continue; } /* */ $s = 16; continue; /* if (loc === "") { */ case 15: $r = resp[0].closeBody(); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp$2 = ptrType$18.nil; _r$6 = fmt.Errorf("%d response missing Location header", new sliceType([new $Int(resp[0].StatusCode)])); /* */ $s = 18; case 18: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$7 = uerr(_r$6); /* */ $s = 19; case 19: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _tmp$3 = _r$7; retres[0] = _tmp$2; reterr[0] = _tmp$3; $24r$1 = [retres[0], reterr[0]]; $s = 20; case 20: return $24r$1; /* } */ case 16: _r$8 = req[0].URL.Parse(loc); /* */ $s = 21; case 21: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _tuple = _r$8; u = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 22; continue; } /* */ $s = 23; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 22: $r = resp[0].closeBody(); /* */ $s = 24; case 24: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp$4 = ptrType$18.nil; _r$9 = fmt.Errorf("failed to parse Location header %q: %v", new sliceType([new $String(loc), err])); /* */ $s = 25; case 25: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$10 = uerr(_r$9); /* */ $s = 26; case 26: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _tmp$5 = _r$10; retres[0] = _tmp$4; reterr[0] = _tmp$5; $24r$2 = [retres[0], reterr[0]]; $s = 27; case 27: return $24r$2; /* } */ case 23: host = ""; /* */ if (!(req[0].Host === "") && !(req[0].Host === req[0].URL.Host)) { $s = 28; continue; } /* */ $s = 29; continue; /* if (!(req[0].Host === "") && !(req[0].Host === req[0].URL.Host)) { */ case 28: _r$11 = url.Parse(loc); /* */ $s = 30; case 30: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _tuple$1 = _r$11; u$1 = _tuple$1[0]; if (!(u$1 === ptrType$17.nil) && !u$1.IsAbs()) { host = req[0].Host; } /* } */ case 29: ireq = (0 >= reqs[0].$length ? ($throwRuntimeError("index out of range"), undefined) : reqs[0].$array[reqs[0].$offset + 0]); req[0] = new Request.ptr(redirectMethod, u, "", 0, 0, {}, $ifaceNil, $throwNilPointerError, new $Int64(0, 0), sliceType$2.nil, false, host, false, false, ptrType$31.nil, false, "", "", ptrType$28.nil, ireq.Cancel, resp[0], ireq.ctx); /* */ if (includeBody && !(ireq.GetBody === $throwNilPointerError)) { $s = 31; continue; } /* */ $s = 32; continue; /* if (includeBody && !(ireq.GetBody === $throwNilPointerError)) { */ case 31: _r$12 = ireq.GetBody(); /* */ $s = 33; case 33: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _tuple$2 = _r$12; req[0].Body = _tuple$2[0]; err = _tuple$2[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 34; continue; } /* */ $s = 35; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 34: $r = resp[0].closeBody(); /* */ $s = 36; case 36: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp$6 = ptrType$18.nil; _r$13 = uerr(err); /* */ $s = 37; case 37: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _tmp$7 = _r$13; retres[0] = _tmp$6; reterr[0] = _tmp$7; $24r$3 = [retres[0], reterr[0]]; $s = 38; case 38: return $24r$3; /* } */ case 35: req[0].ContentLength = ireq.ContentLength; /* } */ case 32: $r = copyHeaders(req[0]); /* */ $s = 39; case 39: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } ref = refererForURL((x$5 = reqs[0].$length - 1 >> 0, ((x$5 < 0 || x$5 >= reqs[0].$length) ? ($throwRuntimeError("index out of range"), undefined) : reqs[0].$array[reqs[0].$offset + x$5])).URL, req[0].URL); /* */ if (!(ref === "")) { $s = 40; continue; } /* */ $s = 41; continue; /* if (!(ref === "")) { */ case 40: $r = new Header(req[0].Header).Set("Referer", ref); /* */ $s = 42; case 42: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 41: _r$14 = c.checkRedirect(req[0], reqs[0]); /* */ $s = 43; case 43: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } err = _r$14; /* */ if ($interfaceIsEqual(err, $pkg.ErrUseLastResponse)) { $s = 44; continue; } /* */ $s = 45; continue; /* if ($interfaceIsEqual(err, $pkg.ErrUseLastResponse)) { */ case 44: _tmp$8 = resp[0]; _tmp$9 = $ifaceNil; retres[0] = _tmp$8; reterr[0] = _tmp$9; $24r$4 = [retres[0], reterr[0]]; $s = 46; case 46: return $24r$4; /* } */ case 45: /* */ if ((x$6 = resp[0].ContentLength, (x$6.$high === -1 && x$6.$low === 4294967295)) || (x$7 = resp[0].ContentLength, (x$7.$high < 0 || (x$7.$high === 0 && x$7.$low <= 2048)))) { $s = 47; continue; } /* */ $s = 48; continue; /* if ((x$6 = resp[0].ContentLength, (x$6.$high === -1 && x$6.$low === 4294967295)) || (x$7 = resp[0].ContentLength, (x$7.$high < 0 || (x$7.$high === 0 && x$7.$low <= 2048)))) { */ case 47: _r$15 = io.CopyN(io.Discard, resp[0].Body, new $Int64(0, 2048)); /* */ $s = 49; case 49: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _r$15; /* } */ case 48: _r$16 = resp[0].Body.Close(); /* */ $s = 50; case 50: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _r$16; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 51; continue; } /* */ $s = 52; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 51: _r$17 = uerr(err); /* */ $s = 53; case 53: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } ue = _r$17; $assertType(ue, ptrType$114).URL = loc; _tmp$10 = resp[0]; _tmp$11 = ue; retres[0] = _tmp$10; reterr[0] = _tmp$11; $24r$5 = [retres[0], reterr[0]]; $s = 54; case 54: return $24r$5; /* } */ case 52: /* } */ case 13: reqs[0] = $append(reqs[0], req[0]); err$1 = $ifaceNil; didTimeout = $throwNilPointerError; _r$18 = c.send(req[0], $clone(deadline, time.Time)); /* */ $s = 55; case 55: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } _tuple$3 = _r$18; resp[0] = _tuple$3[0]; didTimeout = _tuple$3[1]; err$1 = _tuple$3[2]; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 56; continue; } /* */ $s = 57; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 56: reqBodyClosed[0] = true; if (!(!$clone(deadline, time.Time).IsZero())) { _v = false; $s = 60; continue s; } _r$19 = didTimeout(); /* */ $s = 61; case 61: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } _v = _r$19; case 60: /* */ if (_v) { $s = 58; continue; } /* */ $s = 59; continue; /* if (_v) { */ case 58: _r$20 = err$1.Error(); /* */ $s = 62; case 62: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } err$1 = new httpError.ptr(_r$20 + " (Client.Timeout exceeded while awaiting headers)", true); /* } */ case 59: _tmp$12 = ptrType$18.nil; _r$21 = uerr(err$1); /* */ $s = 63; case 63: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } _tmp$13 = _r$21; retres[0] = _tmp$12; reterr[0] = _tmp$13; $24r$6 = [retres[0], reterr[0]]; $s = 64; case 64: return $24r$6; /* } */ case 57: shouldRedirect = false; _r$22 = redirectBehavior(req[0].Method, resp[0], (0 >= reqs[0].$length ? ($throwRuntimeError("index out of range"), undefined) : reqs[0].$array[reqs[0].$offset + 0])); /* */ $s = 65; case 65: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; } _tuple$4 = _r$22; redirectMethod = _tuple$4[0]; shouldRedirect = _tuple$4[1]; includeBody = _tuple$4[2]; /* */ if (!shouldRedirect) { $s = 66; continue; } /* */ $s = 67; continue; /* if (!shouldRedirect) { */ case 66: _tmp$14 = resp[0]; _tmp$15 = $ifaceNil; retres[0] = _tmp$14; reterr[0] = _tmp$15; $24r$7 = [retres[0], reterr[0]]; $s = 68; case 68: return $24r$7; /* } */ case 67: _r$23 = req[0].closeBody(); /* */ $s = 69; case 69: if($c) { $c = false; _r$23 = _r$23.$blk(); } if (_r$23 && _r$23.$blk !== undefined) { break s; } _r$23; $s = 10; continue; case 11: $s = -1; return [retres[0], reterr[0]]; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [retres[0], reterr[0]]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Client.ptr.prototype.do$ }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $f.$24r$4 = $24r$4; $f.$24r$5 = $24r$5; $f.$24r$6 = $24r$6; $f.$24r$7 = $24r$7; $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$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$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$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$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._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f._v = _v; $f.c = c; $f.copyHeaders = copyHeaders; $f.deadline = deadline; $f.didTimeout = didTimeout; $f.err = err; $f.err$1 = err$1; $f.host = host; $f.includeBody = includeBody; $f.ireq = ireq; $f.loc = loc; $f.redirectMethod = redirectMethod; $f.ref = ref; $f.req = req; $f.reqBodyClosed = reqBodyClosed; $f.reqs = reqs; $f.resp = resp; $f.reterr = reterr; $f.retres = retres; $f.shouldRedirect = shouldRedirect; $f.u = u; $f.u$1 = u$1; $f.ue = ue; $f.uerr = uerr; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Client.prototype.do$ = function(req) { return this.$val.do$(req); }; Client.ptr.prototype.makeHeadersCopier = function(ireq) { var _entry, _i, _key, _r$1, _r$2, _ref, _v, c, c$1, icookies, ireq, ireqhdr, preq, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _i = $f._i; _key = $f._key; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; _v = $f._v; c = $f.c; c$1 = $f.c$1; icookies = $f.icookies; ireq = $f.ireq; ireqhdr = $f.ireqhdr; preq = $f.preq; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = [c]; icookies = [icookies]; ireqhdr = [ireqhdr]; preq = [preq]; c[0] = this; ireqhdr[0] = cloneOrMakeHeader(ireq.Header); icookies[0] = false; if (!(!($interfaceIsEqual(c[0].Jar, $ifaceNil)))) { _v = false; $s = 3; continue s; } _r$1 = new Header(ireq.Header).Get("Cookie"); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _v = !(_r$1 === ""); case 3: /* */ if (_v) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v) { */ case 1: icookies[0] = {}; _r$2 = ireq.Cookies(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _ref = _r$2; _i = 0; /* while (true) { */ case 6: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 7; continue; } c$1 = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _key = c$1.Name; (icookies[0] || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: $append((_entry = icookies[0][$String.keyFor(c$1.Name)], _entry !== undefined ? _entry.v : sliceType$29.nil), c$1) }; _i++; $s = 6; continue; case 7: /* } */ case 2: preq[0] = ireq; $s = -1; return (function(c, icookies, ireqhdr, preq) { return function $b(req) { var _entry$1, _entry$2, _entry$3, _i$1, _i$2, _i$3, _i$4, _key$1, _keys, _keys$1, _r$3, _r$4, _ref$1, _ref$2, _ref$3, _ref$4, _tuple, c$2, c$3, changed, cs, k, ok, req, resp, ss, vv, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry$1 = $f._entry$1; _entry$2 = $f._entry$2; _entry$3 = $f._entry$3; _i$1 = $f._i$1; _i$2 = $f._i$2; _i$3 = $f._i$3; _i$4 = $f._i$4; _key$1 = $f._key$1; _keys = $f._keys; _keys$1 = $f._keys$1; _r$3 = $f._r$3; _r$4 = $f._r$4; _ref$1 = $f._ref$1; _ref$2 = $f._ref$2; _ref$3 = $f._ref$3; _ref$4 = $f._ref$4; _tuple = $f._tuple; c$2 = $f.c$2; c$3 = $f.c$3; changed = $f.changed; cs = $f.cs; k = $f.k; ok = $f.ok; req = $f.req; resp = $f.resp; ss = $f.ss; vv = $f.vv; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (!($interfaceIsEqual(c[0].Jar, $ifaceNil)) && !(icookies[0] === false)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(c[0].Jar, $ifaceNil)) && !(icookies[0] === false)) { */ case 1: changed = false; resp = req.Response; _r$3 = resp.Cookies(); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _ref$1 = _r$3; _i$1 = 0; /* while (true) { */ case 4: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 5; continue; } c$2 = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); _tuple = (_entry$1 = icookies[0][$String.keyFor(c$2.Name)], _entry$1 !== undefined ? [_entry$1.v, true] : [sliceType$29.nil, false]); ok = _tuple[1]; if (ok) { delete icookies[0][$String.keyFor(c$2.Name)]; changed = true; } _i$1++; $s = 4; continue; case 5: /* */ if (changed) { $s = 6; continue; } /* */ $s = 7; continue; /* if (changed) { */ case 6: $r = new Header(ireqhdr[0]).Del("Cookie"); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } ss = sliceType$2.nil; _ref$2 = icookies[0]; _i$2 = 0; _keys = $keys(_ref$2); while (true) { if (!(_i$2 < _keys.length)) { break; } _entry$2 = _ref$2[_keys[_i$2]]; if (_entry$2 === undefined) { _i$2++; continue; } cs = _entry$2.v; _ref$3 = cs; _i$3 = 0; while (true) { if (!(_i$3 < _ref$3.$length)) { break; } c$3 = ((_i$3 < 0 || _i$3 >= _ref$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$3.$array[_ref$3.$offset + _i$3]); ss = $append(ss, c$3.Name + "=" + c$3.Value); _i$3++; } _i$2++; } $r = sort.Strings(ss); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = new Header(ireqhdr[0]).Set("Cookie", strings.Join(ss, "; ")); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 7: /* } */ case 2: _ref$4 = ireqhdr[0]; _i$4 = 0; _keys$1 = $keys(_ref$4); /* while (true) { */ case 11: /* if (!(_i$4 < _keys$1.length)) { break; } */ if(!(_i$4 < _keys$1.length)) { $s = 12; continue; } _entry$3 = _ref$4[_keys$1[_i$4]]; if (_entry$3 === undefined) { _i$4++; /* continue; */ $s = 11; continue; } k = _entry$3.k; vv = _entry$3.v; _r$4 = shouldCopyHeaderOnRedirect(k, preq[0].URL, req.URL); /* */ $s = 15; case 15: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } /* */ if (_r$4) { $s = 13; continue; } /* */ $s = 14; continue; /* if (_r$4) { */ case 13: _key$1 = k; (req.Header || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key$1)] = { k: _key$1, v: vv }; /* } */ case 14: _i$4++; $s = 11; continue; case 12: preq[0] = req; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._entry$1 = _entry$1; $f._entry$2 = _entry$2; $f._entry$3 = _entry$3; $f._i$1 = _i$1; $f._i$2 = _i$2; $f._i$3 = _i$3; $f._i$4 = _i$4; $f._key$1 = _key$1; $f._keys = _keys; $f._keys$1 = _keys$1; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._ref$1 = _ref$1; $f._ref$2 = _ref$2; $f._ref$3 = _ref$3; $f._ref$4 = _ref$4; $f._tuple = _tuple; $f.c$2 = c$2; $f.c$3 = c$3; $f.changed = changed; $f.cs = cs; $f.k = k; $f.ok = ok; $f.req = req; $f.resp = resp; $f.ss = ss; $f.vv = vv; $f.$s = $s; $f.$r = $r; return $f; }; })(c, icookies, ireqhdr, preq); /* */ } return; } if ($f === undefined) { $f = { $blk: Client.ptr.prototype.makeHeadersCopier }; } $f._entry = _entry; $f._i = _i; $f._key = _key; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f._v = _v; $f.c = c; $f.c$1 = c$1; $f.icookies = icookies; $f.ireq = ireq; $f.ireqhdr = ireqhdr; $f.preq = preq; $f.$s = $s; $f.$r = $r; return $f; }; Client.prototype.makeHeadersCopier = function(ireq) { return this.$val.makeHeadersCopier(ireq); }; defaultCheckRedirect = function(req, via) { var req, via; if (via.$length >= 10) { return errors.New("stopped after 10 redirects"); } return $ifaceNil; }; Client.ptr.prototype.Post = function(url$1, contentType, body$1) { var $24r, _r$1, _r$2, _tmp, _tmp$1, _tuple, _tuple$1, body$1, c, contentType, err, req, resp, url$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; body$1 = $f.body$1; c = $f.c; contentType = $f.contentType; err = $f.err; req = $f.req; resp = $f.resp; url$1 = $f.url$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: resp = ptrType$18.nil; err = $ifaceNil; c = this; _r$1 = NewRequest("POST", url$1, body$1); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; req = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp = ptrType$18.nil; _tmp$1 = err; resp = _tmp; err = _tmp$1; $s = -1; return [resp, err]; } $r = new Header(req.Header).Set("Content-Type", contentType); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$2 = c.Do(req); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; resp = _tuple$1[0]; err = _tuple$1[1]; $24r = [resp, err]; $s = 4; case 4: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Client.ptr.prototype.Post }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.body$1 = body$1; $f.c = c; $f.contentType = contentType; $f.err = err; $f.req = req; $f.resp = resp; $f.url$1 = url$1; $f.$s = $s; $f.$r = $r; return $f; }; Client.prototype.Post = function(url$1, contentType, body$1) { return this.$val.Post(url$1, contentType, body$1); }; Client.ptr.prototype.PostForm = function(url$1, data) { var $24r, _arg, _arg$1, _r$1, _r$2, _r$3, _tuple, c, data, err, resp, url$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _arg = $f._arg; _arg$1 = $f._arg$1; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; c = $f.c; data = $f.data; err = $f.err; resp = $f.resp; url$1 = $f.url$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: resp = ptrType$18.nil; err = $ifaceNil; c = this; _arg = url$1; _r$1 = new url.Values(data).Encode(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = strings.NewReader(_r$1); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg$1 = _r$2; _r$3 = c.Post(_arg, "application/x-www-form-urlencoded", _arg$1); /* */ $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; resp = _tuple[0]; err = _tuple[1]; $24r = [resp, err]; $s = 4; case 4: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Client.ptr.prototype.PostForm }; } $f.$24r = $24r; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.c = c; $f.data = data; $f.err = err; $f.resp = resp; $f.url$1 = url$1; $f.$s = $s; $f.$r = $r; return $f; }; Client.prototype.PostForm = function(url$1, data) { return this.$val.PostForm(url$1, data); }; Client.ptr.prototype.Head = function(url$1) { var $24r, _r$1, _r$2, _tmp, _tmp$1, _tuple, _tuple$1, c, err, req, resp, url$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; c = $f.c; err = $f.err; req = $f.req; resp = $f.resp; url$1 = $f.url$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: resp = ptrType$18.nil; err = $ifaceNil; c = this; _r$1 = NewRequest("HEAD", url$1, $ifaceNil); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; req = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp = ptrType$18.nil; _tmp$1 = err; resp = _tmp; err = _tmp$1; $s = -1; return [resp, err]; } _r$2 = c.Do(req); /* */ $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; resp = _tuple$1[0]; err = _tuple$1[1]; $24r = [resp, err]; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: Client.ptr.prototype.Head }; } $f.$24r = $24r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.c = c; $f.err = err; $f.req = req; $f.resp = resp; $f.url$1 = url$1; $f.$s = $s; $f.$r = $r; return $f; }; Client.prototype.Head = function(url$1) { return this.$val.Head(url$1); }; Client.ptr.prototype.CloseIdleConnections = function() { var _tuple, c, ok, tr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; c = $f.c; ok = $f.ok; tr = $f.tr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _tuple = $assertType(c.transport(), closeIdler, true); tr = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 1; continue; } /* */ $s = 2; continue; /* if (ok) { */ case 1: $r = tr.CloseIdleConnections(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Client.ptr.prototype.CloseIdleConnections }; } $f._tuple = _tuple; $f.c = c; $f.ok = ok; $f.tr = tr; $f.$s = $s; $f.$r = $r; return $f; }; Client.prototype.CloseIdleConnections = function() { return this.$val.CloseIdleConnections(); }; cancelTimerBody.ptr.prototype.Read = function(p) { var _r$1, _r$2, _r$3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, b, err, n, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _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; b = $f.b; err = $f.err; n = $f.n; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; b = this; _r$1 = b.rc.Read(p); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err = _tuple[1]; if ($interfaceIsEqual(err, $ifaceNil)) { _tmp = n; _tmp$1 = $ifaceNil; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } $r = b.stop(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if ($interfaceIsEqual(err, io.EOF)) { _tmp$2 = n; _tmp$3 = err; n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; } _r$2 = b.reqDidTimeout(); /* */ $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) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_r$2) { */ case 3: _r$3 = err.Error(); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } err = new httpError.ptr(_r$3 + " (Client.Timeout or context cancellation while reading body)", true); /* } */ case 4: _tmp$4 = n; _tmp$5 = err; n = _tmp$4; err = _tmp$5; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: cancelTimerBody.ptr.prototype.Read }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $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.b = b; $f.err = err; $f.n = n; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; cancelTimerBody.prototype.Read = function(p) { return this.$val.Read(p); }; cancelTimerBody.ptr.prototype.Close = function() { var _r$1, b, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; b = $f.b; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; _r$1 = b.rc.Close(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err = _r$1; $r = b.stop(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: cancelTimerBody.ptr.prototype.Close }; } $f._r$1 = _r$1; $f.b = b; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; cancelTimerBody.prototype.Close = function() { return this.$val.Close(); }; shouldCopyHeaderOnRedirect = function(headerKey, initial, dest) { var _1, _r$1, _r$2, _r$3, dest, dhost, headerKey, ihost, initial, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; dest = $f.dest; dhost = $f.dhost; headerKey = $f.headerKey; ihost = $f.ihost; initial = $f.initial; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = CanonicalHeaderKey(headerKey); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _1 = _r$1; /* */ if (_1 === ("Authorization") || _1 === ("Www-Authenticate") || _1 === ("Cookie") || _1 === ("Cookie2")) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_1 === ("Authorization") || _1 === ("Www-Authenticate") || _1 === ("Cookie") || _1 === ("Cookie2")) { */ case 3: _r$2 = canonicalAddr(initial); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } ihost = _r$2; _r$3 = canonicalAddr(dest); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } dhost = _r$3; $s = -1; return isDomainOrSubdomain(dhost, ihost); /* } */ case 4: case 1: $s = -1; return true; /* */ } return; } if ($f === undefined) { $f = { $blk: shouldCopyHeaderOnRedirect }; } $f._1 = _1; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.dest = dest; $f.dhost = dhost; $f.headerKey = headerKey; $f.ihost = ihost; $f.initial = initial; $f.$s = $s; $f.$r = $r; return $f; }; isDomainOrSubdomain = function(sub, parent) { var parent, sub; if (sub === parent) { return true; } if (!strings.HasSuffix(sub, parent)) { return false; } return sub.charCodeAt(((sub.length - parent.length >> 0) - 1 >> 0)) === 46; }; stripPassword = function(u) { var _tuple, passSet, u; _tuple = u.User.Password(); passSet = _tuple[1]; if (passSet) { return strings.Replace(u.String(), u.User.String() + "@", u.User.Username() + ":***@", 1); } return u.String(); }; ptrType$27.methods = [{prop: "writeBufferSize", name: "writeBufferSize", pkg: "net/http", typ: $funcType([], [$Int], false)}, {prop: "readBufferSize", name: "readBufferSize", pkg: "net/http", typ: $funcType([], [$Int], false)}, {prop: "Clone", name: "Clone", pkg: "", typ: $funcType([], [ptrType$27], false)}, {prop: "hasCustomTLSDialer", name: "hasCustomTLSDialer", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "onceSetNextProtoDefaults", name: "onceSetNextProtoDefaults", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "useRegisteredProtocol", name: "useRegisteredProtocol", pkg: "net/http", typ: $funcType([ptrType$11], [$Bool], false)}, {prop: "alternateRoundTripper", name: "alternateRoundTripper", pkg: "net/http", typ: $funcType([ptrType$11], [RoundTripper], false)}, {prop: "roundTrip", name: "roundTrip", pkg: "net/http", typ: $funcType([ptrType$11], [ptrType$18, $error], false)}, {prop: "RegisterProtocol", name: "RegisterProtocol", pkg: "", typ: $funcType([$String, RoundTripper], [], false)}, {prop: "CloseIdleConnections", name: "CloseIdleConnections", pkg: "", typ: $funcType([], [], false)}, {prop: "CancelRequest", name: "CancelRequest", pkg: "", typ: $funcType([ptrType$11], [], false)}, {prop: "cancelRequest", name: "cancelRequest", pkg: "net/http", typ: $funcType([cancelKey, $error], [$Bool], false)}, {prop: "connectMethodForRequest", name: "connectMethodForRequest", pkg: "net/http", typ: $funcType([ptrType$115], [connectMethod, $error], false)}, {prop: "putOrCloseIdleConn", name: "putOrCloseIdleConn", pkg: "net/http", typ: $funcType([ptrType$22], [], false)}, {prop: "maxIdleConnsPerHost", name: "maxIdleConnsPerHost", pkg: "net/http", typ: $funcType([], [$Int], false)}, {prop: "tryPutIdleConn", name: "tryPutIdleConn", pkg: "net/http", typ: $funcType([ptrType$22], [$error], false)}, {prop: "queueForIdleConn", name: "queueForIdleConn", pkg: "net/http", typ: $funcType([ptrType$24], [$Bool], false)}, {prop: "removeIdleConn", name: "removeIdleConn", pkg: "net/http", typ: $funcType([ptrType$22], [$Bool], false)}, {prop: "removeIdleConnLocked", name: "removeIdleConnLocked", pkg: "net/http", typ: $funcType([ptrType$22], [$Bool], false)}, {prop: "setReqCanceler", name: "setReqCanceler", pkg: "net/http", typ: $funcType([cancelKey, funcType$5], [], false)}, {prop: "replaceReqCanceler", name: "replaceReqCanceler", pkg: "net/http", typ: $funcType([cancelKey, funcType$5], [$Bool], false)}, {prop: "dial", name: "dial", pkg: "net/http", typ: $funcType([context.Context, $String, $String], [net.Conn, $error], false)}, {prop: "customDialTLS", name: "customDialTLS", pkg: "net/http", typ: $funcType([context.Context, $String, $String], [net.Conn, $error], false)}, {prop: "getConn", name: "getConn", pkg: "net/http", typ: $funcType([ptrType$115, connectMethod], [ptrType$22, $error], false)}, {prop: "queueForDial", name: "queueForDial", pkg: "net/http", typ: $funcType([ptrType$24], [], false)}, {prop: "dialConnFor", name: "dialConnFor", pkg: "net/http", typ: $funcType([ptrType$24], [], false)}, {prop: "decConnsPerHost", name: "decConnsPerHost", pkg: "net/http", typ: $funcType([connectMethodKey], [], false)}, {prop: "dialConn", name: "dialConn", pkg: "net/http", typ: $funcType([context.Context, connectMethod], [ptrType$22, $error], false)}, {prop: "RoundTrip", name: "RoundTrip", pkg: "", typ: $funcType([ptrType$11], [ptrType$18, $error], false)}]; ptrType$115.methods = [{prop: "extraHeaders", name: "extraHeaders", pkg: "net/http", typ: $funcType([], [Header], false)}, {prop: "setError", name: "setError", pkg: "net/http", typ: $funcType([$error], [], false)}, {prop: "logf", name: "logf", pkg: "net/http", typ: $funcType([$String, sliceType], [], true)}]; ptrType$20.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}]; transportReadFromServerError.methods = [{prop: "Unwrap", name: "Unwrap", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$24.methods = [{prop: "waiting", name: "waiting", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "tryDeliver", name: "tryDeliver", pkg: "net/http", typ: $funcType([ptrType$22, $error], [$Bool], false)}, {prop: "cancel", name: "cancel", pkg: "net/http", typ: $funcType([ptrType$27, $error], [], false)}]; ptrType$116.methods = [{prop: "len", name: "len", pkg: "net/http", typ: $funcType([], [$Int], false)}, {prop: "pushBack", name: "pushBack", pkg: "net/http", typ: $funcType([ptrType$24], [], false)}, {prop: "popFront", name: "popFront", pkg: "net/http", typ: $funcType([], [ptrType$24], false)}, {prop: "peekFront", name: "peekFront", pkg: "net/http", typ: $funcType([], [ptrType$24], false)}, {prop: "cleanFront", name: "cleanFront", pkg: "net/http", typ: $funcType([], [$Bool], false)}]; persistConnWriter.methods = [{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "ReadFrom", name: "ReadFrom", pkg: "", typ: $funcType([io.Reader], [$Int64, $error], false)}]; ptrType$117.methods = [{prop: "proxyAuth", name: "proxyAuth", pkg: "net/http", typ: $funcType([], [$String], false)}, {prop: "key", name: "key", pkg: "net/http", typ: $funcType([], [connectMethodKey], false)}, {prop: "scheme", name: "scheme", pkg: "net/http", typ: $funcType([], [$String], false)}, {prop: "addr", name: "addr", pkg: "net/http", typ: $funcType([], [$String], false)}, {prop: "tlsHost", name: "tlsHost", pkg: "net/http", typ: $funcType([], [$String], false)}]; connectMethodKey.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$22.methods = [{prop: "shouldRetryRequest", name: "shouldRetryRequest", pkg: "net/http", typ: $funcType([ptrType$11, $error], [$Bool], false)}, {prop: "addTLS", name: "addTLS", pkg: "net/http", typ: $funcType([context.Context, $String, ptrType$19], [$error], false)}, {prop: "maxHeaderResponseSize", name: "maxHeaderResponseSize", pkg: "net/http", typ: $funcType([], [$Int64], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "isBroken", name: "isBroken", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "canceled", name: "canceled", pkg: "net/http", typ: $funcType([], [$error], false)}, {prop: "isReused", name: "isReused", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "gotIdleConnTrace", name: "gotIdleConnTrace", pkg: "net/http", typ: $funcType([time.Time], [httptrace.GotConnInfo], false)}, {prop: "cancelRequest", name: "cancelRequest", pkg: "net/http", typ: $funcType([$error], [], false)}, {prop: "closeConnIfStillIdle", name: "closeConnIfStillIdle", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "mapRoundTripError", name: "mapRoundTripError", pkg: "net/http", typ: $funcType([ptrType$115, $Int64, $error], [$error], false)}, {prop: "readLoop", name: "readLoop", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "readLoopPeekFailLocked", name: "readLoopPeekFailLocked", pkg: "net/http", typ: $funcType([$error], [], false)}, {prop: "readResponse", name: "readResponse", pkg: "net/http", typ: $funcType([requestAndChan, ptrType$19], [ptrType$18, $error], false)}, {prop: "waitForContinue", name: "waitForContinue", pkg: "net/http", typ: $funcType([chanType$2], [funcType$11], false)}, {prop: "writeLoop", name: "writeLoop", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "wroteRequest", name: "wroteRequest", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "roundTrip", name: "roundTrip", pkg: "net/http", typ: $funcType([ptrType$115], [ptrType$18, $error], false)}, {prop: "markReused", name: "markReused", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "close", name: "close", pkg: "net/http", typ: $funcType([$error], [], false)}, {prop: "closeLocked", name: "closeLocked", pkg: "net/http", typ: $funcType([$error], [], false)}]; ptrType$118.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}]; ptrType$119.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Temporary", name: "Temporary", pkg: "", typ: $funcType([], [$Bool], false)}]; ptrType$32.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "condfn", name: "condfn", pkg: "net/http", typ: $funcType([$error], [$error], false)}]; ptrType$120.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}]; tlsHandshakeTimeoutError.methods = [{prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Temporary", name: "Temporary", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; fakeLocker.methods = [{prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}]; ptrType$121.methods = [{prop: "add", name: "add", pkg: "net/http", typ: $funcType([ptrType$22], [], false)}, {prop: "removeOldest", name: "removeOldest", pkg: "net/http", typ: $funcType([], [ptrType$22], false)}, {prop: "remove", name: "remove", pkg: "net/http", typ: $funcType([ptrType$22], [], false)}, {prop: "len", name: "len", pkg: "net/http", typ: $funcType([], [$Int], false)}]; errorReader.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}]; ptrType$122.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}]; ptrType$35.methods = [{prop: "shouldSendChunkedRequestBody", name: "shouldSendChunkedRequestBody", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "probeRequestBody", name: "probeRequestBody", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "shouldSendContentLength", name: "shouldSendContentLength", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "writeHeader", name: "writeHeader", pkg: "net/http", typ: $funcType([io.Writer, ptrType$19], [$error], false)}, {prop: "writeBody", name: "writeBody", pkg: "net/http", typ: $funcType([io.Writer], [$error], false)}, {prop: "doBodyCopy", name: "doBodyCopy", pkg: "net/http", typ: $funcType([io.Writer, io.Reader], [$Int64, $error], false)}, {prop: "unwrapBody", name: "unwrapBody", pkg: "net/http", typ: $funcType([], [io.Reader], false)}]; ptrType$123.methods = [{prop: "protoAtLeast", name: "protoAtLeast", pkg: "net/http", typ: $funcType([$Int, $Int], [$Bool], false)}, {prop: "parseTransferEncoding", name: "parseTransferEncoding", pkg: "net/http", typ: $funcType([], [$error], false)}]; ptrType$36.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$52.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "readLocked", name: "readLocked", pkg: "net/http", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "readTrailer", name: "readTrailer", pkg: "net/http", typ: $funcType([], [$error], false)}, {prop: "unreadDataSizeLocked", name: "unreadDataSizeLocked", pkg: "net/http", typ: $funcType([], [$Int64], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "didEarlyClose", name: "didEarlyClose", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "bodyRemains", name: "bodyRemains", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "registerOnHitEOF", name: "registerOnHitEOF", pkg: "net/http", typ: $funcType([funcType], [], false)}]; bodyLocked.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}]; finishAsyncByteRead.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}]; bufioFlushWriter.methods = [{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}]; socksCommand.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; socksReply.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$42.methods = [{prop: "Network", name: "Network", pkg: "", typ: $funcType([], [$String], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$43.methods = [{prop: "BoundAddr", name: "BoundAddr", pkg: "", typ: $funcType([], [net.Addr], false)}]; ptrType$124.methods = [{prop: "connect", name: "connect", pkg: "net/http", typ: $funcType([context.Context, net.Conn, $String], [net.Addr, $error], false)}, {prop: "DialContext", name: "DialContext", pkg: "", typ: $funcType([context.Context, $String, $String], [net.Conn, $error], false)}, {prop: "DialWithConn", name: "DialWithConn", pkg: "", typ: $funcType([context.Context, net.Conn, $String, $String], [net.Addr, $error], false)}, {prop: "Dial", name: "Dial", pkg: "", typ: $funcType([$String, $String], [net.Conn, $error], false)}, {prop: "validateTarget", name: "validateTarget", pkg: "net/http", typ: $funcType([$String, $String], [$error], false)}, {prop: "pathAddrs", name: "pathAddrs", pkg: "net/http", typ: $funcType([$String], [net.Addr, net.Addr, $error], false)}]; ptrType$125.methods = [{prop: "Authenticate", name: "Authenticate", pkg: "", typ: $funcType([context.Context, io.ReadWriter, socksAuthMethod], [$error], false)}]; ptrType$126.methods = [{prop: "match", name: "match", pkg: "net/http", typ: $funcType([sliceType$3, $Int], [$String], false)}]; ptrType$127.methods = [{prop: "match", name: "match", pkg: "net/http", typ: $funcType([sliceType$3, $Int], [$String], false)}]; htmlSig.methods = [{prop: "match", name: "match", pkg: "net/http", typ: $funcType([sliceType$3, $Int], [$String], false)}]; mp4Sig.methods = [{prop: "match", name: "match", pkg: "net/http", typ: $funcType([sliceType$3, $Int], [$String], false)}]; textSig.methods = [{prop: "match", name: "match", pkg: "net/http", typ: $funcType([sliceType$3, $Int], [$String], false)}]; ptrType$53.methods = [{prop: "hijacked", name: "hijacked", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "hijackLocked", name: "hijackLocked", pkg: "net/http", typ: $funcType([], [net.Conn, ptrType$44, $error], false)}, {prop: "readRequest", name: "readRequest", pkg: "net/http", typ: $funcType([context.Context], [ptrType$49, $error], false)}, {prop: "finalFlush", name: "finalFlush", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "close", name: "close", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "closeWriteAndWait", name: "closeWriteAndWait", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "setState", name: "setState", pkg: "net/http", typ: $funcType([net.Conn, ConnState, $Bool], [], false)}, {prop: "getState", name: "getState", pkg: "net/http", typ: $funcType([], [ConnState, $Int64], false)}, {prop: "serve", name: "serve", pkg: "net/http", typ: $funcType([context.Context], [], false)}]; ptrType$128.methods = [{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "flush", name: "flush", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "close", name: "close", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "writeHeader", name: "writeHeader", pkg: "net/http", typ: $funcType([sliceType$3], [], false)}]; ptrType$49.methods = [{prop: "finalTrailers", name: "finalTrailers", pkg: "net/http", typ: $funcType([], [Header], false)}, {prop: "declareTrailer", name: "declareTrailer", pkg: "net/http", typ: $funcType([$String], [], false)}, {prop: "requestTooLarge", name: "requestTooLarge", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "needsSniff", name: "needsSniff", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "ReadFrom", name: "ReadFrom", pkg: "", typ: $funcType([io.Reader], [$Int64, $error], false)}, {prop: "Header", name: "Header", pkg: "", typ: $funcType([], [Header], false)}, {prop: "WriteHeader", name: "WriteHeader", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "bodyAllowed", name: "bodyAllowed", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([$String], [$Int, $error], false)}, {prop: "write", name: "write", pkg: "net/http", typ: $funcType([$Int, sliceType$3, $String], [$Int, $error], false)}, {prop: "finishRequest", name: "finishRequest", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "shouldReuseConnection", name: "shouldReuseConnection", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "closedRequestBodyEarly", name: "closedRequestBodyEarly", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "Flush", name: "Flush", pkg: "", typ: $funcType([], [], false)}, {prop: "sendExpectationFailed", name: "sendExpectationFailed", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "Hijack", name: "Hijack", pkg: "", typ: $funcType([], [net.Conn, ptrType$44, $error], false)}, {prop: "CloseNotify", name: "CloseNotify", pkg: "", typ: $funcType([], [chanType$9], false)}]; ptrType$51.methods = [{prop: "isSet", name: "isSet", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "setTrue", name: "setTrue", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "setFalse", name: "setFalse", pkg: "net/http", typ: $funcType([], [], false)}]; ptrType$47.methods = [{prop: "lock", name: "lock", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "unlock", name: "unlock", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "startBackgroundRead", name: "startBackgroundRead", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "backgroundRead", name: "backgroundRead", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "abortPendingRead", name: "abortPendingRead", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "setReadLimit", name: "setReadLimit", pkg: "net/http", typ: $funcType([$Int64], [], false)}, {prop: "setInfiniteReadLimit", name: "setInfiniteReadLimit", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "hitReadLimit", name: "hitReadLimit", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "handleReadError", name: "handleReadError", pkg: "net/http", typ: $funcType([$error], [], false)}, {prop: "closeNotify", name: "closeNotify", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}]; ptrType$55.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}]; extraHeader.methods = [{prop: "Write", name: "Write", pkg: "", typ: $funcType([ptrType$14], [], false)}]; statusError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; HandlerFunc.methods = [{prop: "ServeHTTP", name: "ServeHTTP", pkg: "", typ: $funcType([ResponseWriter, ptrType$11], [], false)}]; ptrType$129.methods = [{prop: "ServeHTTP", name: "ServeHTTP", pkg: "", typ: $funcType([ResponseWriter, ptrType$11], [], false)}]; ptrType$130.methods = [{prop: "match", name: "match", pkg: "net/http", typ: $funcType([$String], [Handler, $String], false)}, {prop: "redirectToPathSlash", name: "redirectToPathSlash", pkg: "net/http", typ: $funcType([$String, $String, ptrType$17], [ptrType$17, $Bool], false)}, {prop: "shouldRedirectRLocked", name: "shouldRedirectRLocked", pkg: "net/http", typ: $funcType([$String, $String], [$Bool], false)}, {prop: "Handler", name: "Handler", pkg: "", typ: $funcType([ptrType$11], [Handler, $String], false)}, {prop: "handler", name: "handler", pkg: "net/http", typ: $funcType([$String, $String], [Handler, $String], false)}, {prop: "ServeHTTP", name: "ServeHTTP", pkg: "", typ: $funcType([ResponseWriter, ptrType$11], [], false)}, {prop: "Handle", name: "Handle", pkg: "", typ: $funcType([$String, Handler], [], false)}, {prop: "HandleFunc", name: "HandleFunc", pkg: "", typ: $funcType([$String, funcType$16], [], false)}]; ptrType$46.methods = [{prop: "newConn", name: "newConn", pkg: "net/http", typ: $funcType([net.Conn], [ptrType$53], false)}, {prop: "maxHeaderBytes", name: "maxHeaderBytes", pkg: "net/http", typ: $funcType([], [$Int], false)}, {prop: "initialReadLimitSize", name: "initialReadLimitSize", pkg: "net/http", typ: $funcType([], [$Int64], false)}, {prop: "getDoneChan", name: "getDoneChan", pkg: "net/http", typ: $funcType([], [chanType$2], false)}, {prop: "getDoneChanLocked", name: "getDoneChanLocked", pkg: "net/http", typ: $funcType([], [chanType$1], false)}, {prop: "closeDoneChanLocked", name: "closeDoneChanLocked", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Shutdown", name: "Shutdown", pkg: "", typ: $funcType([context.Context], [$error], false)}, {prop: "RegisterOnShutdown", name: "RegisterOnShutdown", pkg: "", typ: $funcType([funcType], [], false)}, {prop: "numListeners", name: "numListeners", pkg: "net/http", typ: $funcType([], [$Int], false)}, {prop: "closeIdleConns", name: "closeIdleConns", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "closeListenersLocked", name: "closeListenersLocked", pkg: "net/http", typ: $funcType([], [$error], false)}, {prop: "ListenAndServe", name: "ListenAndServe", pkg: "", typ: $funcType([], [$error], false)}, {prop: "shouldConfigureHTTP2ForServe", name: "shouldConfigureHTTP2ForServe", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "Serve", name: "Serve", pkg: "", typ: $funcType([net.Listener], [$error], false)}, {prop: "ServeTLS", name: "ServeTLS", pkg: "", typ: $funcType([net.Listener, $String, $String], [$error], false)}, {prop: "trackListener", name: "trackListener", pkg: "net/http", typ: $funcType([ptrType$59, $Bool], [$Bool], false)}, {prop: "trackConn", name: "trackConn", pkg: "net/http", typ: $funcType([ptrType$53, $Bool], [], false)}, {prop: "idleTimeout", name: "idleTimeout", pkg: "net/http", typ: $funcType([], [time.Duration], false)}, {prop: "readHeaderTimeout", name: "readHeaderTimeout", pkg: "net/http", typ: $funcType([], [time.Duration], false)}, {prop: "doKeepAlives", name: "doKeepAlives", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "shuttingDown", name: "shuttingDown", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "SetKeepAlivesEnabled", name: "SetKeepAlivesEnabled", pkg: "", typ: $funcType([$Bool], [], false)}, {prop: "logf", name: "logf", pkg: "net/http", typ: $funcType([$String, sliceType], [], true)}, {prop: "ListenAndServeTLS", name: "ListenAndServeTLS", pkg: "", typ: $funcType([$String, $String], [$error], false)}, {prop: "setupHTTP2_ServeTLS", name: "setupHTTP2_ServeTLS", pkg: "net/http", typ: $funcType([], [$error], false)}, {prop: "setupHTTP2_Serve", name: "setupHTTP2_Serve", pkg: "net/http", typ: $funcType([], [$error], false)}, {prop: "onceSetNextProtoDefaults_Serve", name: "onceSetNextProtoDefaults_Serve", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "onceSetNextProtoDefaults", name: "onceSetNextProtoDefaults", pkg: "net/http", typ: $funcType([], [], false)}]; ConnState.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; serverHandler.methods = [{prop: "ServeHTTP", name: "ServeHTTP", pkg: "", typ: $funcType([ResponseWriter, ptrType$11], [], false)}]; ptrType$132.methods = [{prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "close", name: "close", pkg: "net/http", typ: $funcType([], [], false)}]; globalOptionsHandler.methods = [{prop: "ServeHTTP", name: "ServeHTTP", pkg: "", typ: $funcType([ResponseWriter, ptrType$11], [], false)}]; initALPNRequest.methods = [{prop: "BaseContext", name: "BaseContext", pkg: "", typ: $funcType([], [context.Context], false)}, {prop: "ServeHTTP", name: "ServeHTTP", pkg: "", typ: $funcType([ResponseWriter, ptrType$11], [], false)}]; ptrType$133.methods = [{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}]; checkConnErrorWriter.methods = [{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}]; ptrType$18.methods = [{prop: "Cookies", name: "Cookies", pkg: "", typ: $funcType([], [sliceType$29], false)}, {prop: "Location", name: "Location", pkg: "", typ: $funcType([], [ptrType$17, $error], false)}, {prop: "ProtoAtLeast", name: "ProtoAtLeast", pkg: "", typ: $funcType([$Int, $Int], [$Bool], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([io.Writer], [$error], false)}, {prop: "closeBody", name: "closeBody", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "bodyIsWritable", name: "bodyIsWritable", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "isProtocolSwitch", name: "isProtocolSwitch", pkg: "net/http", typ: $funcType([], [$Bool], false)}]; ptrType$134.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$11.methods = [{prop: "Context", name: "Context", pkg: "", typ: $funcType([], [context.Context], false)}, {prop: "WithContext", name: "WithContext", pkg: "", typ: $funcType([context.Context], [ptrType$11], false)}, {prop: "Clone", name: "Clone", pkg: "", typ: $funcType([context.Context], [ptrType$11], false)}, {prop: "ProtoAtLeast", name: "ProtoAtLeast", pkg: "", typ: $funcType([$Int, $Int], [$Bool], false)}, {prop: "UserAgent", name: "UserAgent", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Cookies", name: "Cookies", pkg: "", typ: $funcType([], [sliceType$29], false)}, {prop: "Cookie", name: "Cookie", pkg: "", typ: $funcType([$String], [ptrType$62, $error], false)}, {prop: "AddCookie", name: "AddCookie", pkg: "", typ: $funcType([ptrType$62], [], false)}, {prop: "Referer", name: "Referer", pkg: "", typ: $funcType([], [$String], false)}, {prop: "MultipartReader", name: "MultipartReader", pkg: "", typ: $funcType([], [ptrType$63, $error], false)}, {prop: "multipartReader", name: "multipartReader", pkg: "net/http", typ: $funcType([$Bool], [ptrType$63, $error], false)}, {prop: "isH2Upgrade", name: "isH2Upgrade", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([io.Writer], [$error], false)}, {prop: "WriteProxy", name: "WriteProxy", pkg: "", typ: $funcType([io.Writer], [$error], false)}, {prop: "write", name: "write", pkg: "net/http", typ: $funcType([io.Writer, $Bool, Header, funcType$11], [$error], false)}, {prop: "BasicAuth", name: "BasicAuth", pkg: "", typ: $funcType([], [$String, $String, $Bool], false)}, {prop: "SetBasicAuth", name: "SetBasicAuth", pkg: "", typ: $funcType([$String, $String], [], false)}, {prop: "ParseForm", name: "ParseForm", pkg: "", typ: $funcType([], [$error], false)}, {prop: "ParseMultipartForm", name: "ParseMultipartForm", pkg: "", typ: $funcType([$Int64], [$error], false)}, {prop: "FormValue", name: "FormValue", pkg: "", typ: $funcType([$String], [$String], false)}, {prop: "PostFormValue", name: "PostFormValue", pkg: "", typ: $funcType([$String], [$String], false)}, {prop: "FormFile", name: "FormFile", pkg: "", typ: $funcType([$String], [multipart.File, ptrType$66, $error], false)}, {prop: "expectsContinue", name: "expectsContinue", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "wantsHttp10KeepAlive", name: "wantsHttp10KeepAlive", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "wantsClose", name: "wantsClose", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "closeBody", name: "closeBody", pkg: "net/http", typ: $funcType([], [$error], false)}, {prop: "isReplayable", name: "isReplayable", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "outgoingLength", name: "outgoingLength", pkg: "net/http", typ: $funcType([], [$Int64], false)}, {prop: "requiresHTTP1", name: "requiresHTTP1", pkg: "net/http", typ: $funcType([], [$Bool], false)}]; ptrType$65.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}]; ptrType$135.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; noBody.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "WriteTo", name: "WriteTo", pkg: "", typ: $funcType([io.Writer], [$Int64, $error], false)}]; Header.methods = [{prop: "Add", name: "Add", pkg: "", typ: $funcType([$String, $String], [], false)}, {prop: "Set", name: "Set", pkg: "", typ: $funcType([$String, $String], [], false)}, {prop: "Get", name: "Get", pkg: "", typ: $funcType([$String], [$String], false)}, {prop: "Values", name: "Values", pkg: "", typ: $funcType([$String], [sliceType$2], false)}, {prop: "get", name: "get", pkg: "net/http", typ: $funcType([$String], [$String], false)}, {prop: "has", name: "has", pkg: "net/http", typ: $funcType([$String], [$Bool], false)}, {prop: "Del", name: "Del", pkg: "", typ: $funcType([$String], [], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([io.Writer], [$error], false)}, {prop: "write", name: "write", pkg: "net/http", typ: $funcType([io.Writer, ptrType$19], [$error], false)}, {prop: "Clone", name: "Clone", pkg: "", typ: $funcType([], [Header], false)}, {prop: "sortedKeyValues", name: "sortedKeyValues", pkg: "net/http", typ: $funcType([mapType$12], [sliceType$6, ptrType$67], false)}, {prop: "WriteSubset", name: "WriteSubset", pkg: "", typ: $funcType([io.Writer, mapType$12], [$error], false)}, {prop: "writeSubset", name: "writeSubset", pkg: "net/http", typ: $funcType([io.Writer, mapType$12, ptrType$19], [$error], false)}]; stringWriter.methods = [{prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([$String], [$Int, $error], false)}]; ptrType$67.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$9.methods = [{prop: "GetClientConn", name: "GetClientConn", pkg: "", typ: $funcType([ptrType$11, $String], [ptrType$68, $error], false)}, {prop: "shouldTraceGetConn", name: "shouldTraceGetConn", pkg: "net/http", typ: $funcType([http2clientConnIdleState], [$Bool], false)}, {prop: "getClientConn", name: "getClientConn", pkg: "net/http", typ: $funcType([ptrType$11, $String, $Bool], [ptrType$68, $error], false)}, {prop: "getStartDialLocked", name: "getStartDialLocked", pkg: "net/http", typ: $funcType([context.Context, $String], [ptrType$69], false)}, {prop: "addConnIfNeeded", name: "addConnIfNeeded", pkg: "net/http", typ: $funcType([$String, ptrType$102, ptrType$30], [$Bool, $error], false)}, {prop: "addConnLocked", name: "addConnLocked", pkg: "net/http", typ: $funcType([$String, ptrType$68], [], false)}, {prop: "MarkDead", name: "MarkDead", pkg: "", typ: $funcType([ptrType$68], [], false)}, {prop: "closeIdleConnections", name: "closeIdleConnections", pkg: "net/http", typ: $funcType([], [], false)}]; ptrType$69.methods = [{prop: "dial", name: "dial", pkg: "net/http", typ: $funcType([context.Context, $String], [], false)}]; ptrType$70.methods = [{prop: "run", name: "run", pkg: "net/http", typ: $funcType([ptrType$102, $String, ptrType$30], [], false)}]; http2noDialClientConnPool.methods = [{prop: "GetClientConn", name: "GetClientConn", pkg: "", typ: $funcType([ptrType$11, $String], [ptrType$68, $error], false)}]; ptrType$136.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "bytesFromFirstChunk", name: "bytesFromFirstChunk", pkg: "net/http", typ: $funcType([], [sliceType$3], false)}, {prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "lastChunkOrAlloc", name: "lastChunkOrAlloc", pkg: "net/http", typ: $funcType([$Int64], [sliceType$3], false)}]; http2ErrCode.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; http2ConnectionError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; http2StreamError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "writeFrame", name: "writeFrame", pkg: "net/http", typ: $funcType([http2writeContext], [$error], false)}, {prop: "staysWithinBuffer", name: "staysWithinBuffer", pkg: "net/http", typ: $funcType([$Int], [$Bool], false)}]; http2goAwayFlowError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; http2connError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; http2pseudoHeaderError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; http2duplicatePseudoHeaderError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; http2headerFieldNameError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; http2headerFieldValueError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$71.methods = [{prop: "setConnFlow", name: "setConnFlow", pkg: "net/http", typ: $funcType([ptrType$71], [], false)}, {prop: "available", name: "available", pkg: "net/http", typ: $funcType([], [$Int32], false)}, {prop: "take", name: "take", pkg: "net/http", typ: $funcType([$Int32], [], false)}, {prop: "add", name: "add", pkg: "net/http", typ: $funcType([$Int32], [$Bool], false)}]; http2FrameType.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; http2Flags.methods = [{prop: "Has", name: "Has", pkg: "", typ: $funcType([http2Flags], [$Bool], false)}]; http2FrameHeader.methods = [{prop: "Header", name: "Header", pkg: "", typ: $funcType([], [http2FrameHeader], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "writeDebug", name: "writeDebug", pkg: "net/http", typ: $funcType([ptrType$40], [], false)}]; ptrType$137.methods = [{prop: "checkValid", name: "checkValid", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "invalidate", name: "invalidate", pkg: "net/http", typ: $funcType([], [], false)}]; ptrType$72.methods = [{prop: "maxHeaderListSize", name: "maxHeaderListSize", pkg: "net/http", typ: $funcType([], [$Uint32], false)}, {prop: "startWrite", name: "startWrite", pkg: "net/http", typ: $funcType([http2FrameType, http2Flags, $Uint32], [], false)}, {prop: "endWrite", name: "endWrite", pkg: "net/http", typ: $funcType([], [$error], false)}, {prop: "logWrite", name: "logWrite", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "writeByte", name: "writeByte", pkg: "net/http", typ: $funcType([$Uint8], [], false)}, {prop: "writeBytes", name: "writeBytes", pkg: "net/http", typ: $funcType([sliceType$3], [], false)}, {prop: "writeUint16", name: "writeUint16", pkg: "net/http", typ: $funcType([$Uint16], [], false)}, {prop: "writeUint32", name: "writeUint32", pkg: "net/http", typ: $funcType([$Uint32], [], false)}, {prop: "SetReuseFrames", name: "SetReuseFrames", pkg: "", typ: $funcType([], [], false)}, {prop: "SetMaxReadFrameSize", name: "SetMaxReadFrameSize", pkg: "", typ: $funcType([$Uint32], [], false)}, {prop: "ErrorDetail", name: "ErrorDetail", pkg: "", typ: $funcType([], [$error], false)}, {prop: "ReadFrame", name: "ReadFrame", pkg: "", typ: $funcType([], [http2Frame, $error], false)}, {prop: "connError", name: "connError", pkg: "net/http", typ: $funcType([http2ErrCode, $String], [$error], false)}, {prop: "checkFrameOrder", name: "checkFrameOrder", pkg: "net/http", typ: $funcType([http2Frame], [$error], false)}, {prop: "WriteData", name: "WriteData", pkg: "", typ: $funcType([$Uint32, $Bool, sliceType$3], [$error], false)}, {prop: "WriteDataPadded", name: "WriteDataPadded", pkg: "", typ: $funcType([$Uint32, $Bool, sliceType$3, sliceType$3], [$error], false)}, {prop: "WriteSettings", name: "WriteSettings", pkg: "", typ: $funcType([sliceType$23], [$error], true)}, {prop: "WriteSettingsAck", name: "WriteSettingsAck", pkg: "", typ: $funcType([], [$error], false)}, {prop: "WritePing", name: "WritePing", pkg: "", typ: $funcType([$Bool, arrayType$8], [$error], false)}, {prop: "WriteGoAway", name: "WriteGoAway", pkg: "", typ: $funcType([$Uint32, http2ErrCode, sliceType$3], [$error], false)}, {prop: "WriteWindowUpdate", name: "WriteWindowUpdate", pkg: "", typ: $funcType([$Uint32, $Uint32], [$error], false)}, {prop: "WriteHeaders", name: "WriteHeaders", pkg: "", typ: $funcType([http2HeadersFrameParam], [$error], false)}, {prop: "WritePriority", name: "WritePriority", pkg: "", typ: $funcType([$Uint32, http2PriorityParam], [$error], false)}, {prop: "WriteRSTStream", name: "WriteRSTStream", pkg: "", typ: $funcType([$Uint32, http2ErrCode], [$error], false)}, {prop: "WriteContinuation", name: "WriteContinuation", pkg: "", typ: $funcType([$Uint32, $Bool, sliceType$3], [$error], false)}, {prop: "WritePushPromise", name: "WritePushPromise", pkg: "", typ: $funcType([http2PushPromiseParam], [$error], false)}, {prop: "WriteRawFrame", name: "WriteRawFrame", pkg: "", typ: $funcType([http2FrameType, http2Flags, $Uint32, sliceType$3], [$error], false)}, {prop: "maxHeaderStringLen", name: "maxHeaderStringLen", pkg: "net/http", typ: $funcType([], [$Int], false)}, {prop: "readMetaFrame", name: "readMetaFrame", pkg: "net/http", typ: $funcType([ptrType$75], [ptrType$76, $error], false)}]; ptrType$73.methods = [{prop: "getDataFrame", name: "getDataFrame", pkg: "net/http", typ: $funcType([], [ptrType$79], false)}]; ptrType$79.methods = [{prop: "StreamEnded", name: "StreamEnded", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Data", name: "Data", pkg: "", typ: $funcType([], [sliceType$3], false)}]; ptrType$78.methods = [{prop: "IsAck", name: "IsAck", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Value", name: "Value", pkg: "", typ: $funcType([http2SettingID], [$Uint32, $Bool], false)}, {prop: "Setting", name: "Setting", pkg: "", typ: $funcType([$Int], [http2Setting], false)}, {prop: "NumSettings", name: "NumSettings", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "HasDuplicates", name: "HasDuplicates", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "ForeachSetting", name: "ForeachSetting", pkg: "", typ: $funcType([funcType$23], [$error], false)}]; ptrType$81.methods = [{prop: "IsAck", name: "IsAck", pkg: "", typ: $funcType([], [$Bool], false)}]; ptrType$82.methods = [{prop: "DebugData", name: "DebugData", pkg: "", typ: $funcType([], [sliceType$3], false)}]; ptrType$138.methods = [{prop: "Payload", name: "Payload", pkg: "", typ: $funcType([], [sliceType$3], false)}]; ptrType$75.methods = [{prop: "HeaderBlockFragment", name: "HeaderBlockFragment", pkg: "", typ: $funcType([], [sliceType$3], false)}, {prop: "HeadersEnded", name: "HeadersEnded", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "StreamEnded", name: "StreamEnded", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "HasPriority", name: "HasPriority", pkg: "", typ: $funcType([], [$Bool], false)}]; http2PriorityParam.methods = [{prop: "IsZero", name: "IsZero", pkg: "", typ: $funcType([], [$Bool], false)}]; ptrType$77.methods = [{prop: "HeaderBlockFragment", name: "HeaderBlockFragment", pkg: "", typ: $funcType([], [sliceType$3], false)}, {prop: "HeadersEnded", name: "HeadersEnded", pkg: "", typ: $funcType([], [$Bool], false)}]; ptrType$96.methods = [{prop: "HeaderBlockFragment", name: "HeaderBlockFragment", pkg: "", typ: $funcType([], [sliceType$3], false)}, {prop: "HeadersEnded", name: "HeadersEnded", pkg: "", typ: $funcType([], [$Bool], false)}]; ptrType$76.methods = [{prop: "PseudoValue", name: "PseudoValue", pkg: "", typ: $funcType([$String], [$String], false)}, {prop: "RegularFields", name: "RegularFields", pkg: "", typ: $funcType([], [sliceType$22], false)}, {prop: "PseudoFields", name: "PseudoFields", pkg: "", typ: $funcType([], [sliceType$22], false)}, {prop: "checkPseudos", name: "checkPseudos", pkg: "net/http", typ: $funcType([], [$error], false)}]; http2goroutineLock.methods = [{prop: "check", name: "check", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "checkNotOn", name: "checkNotOn", pkg: "net/http", typ: $funcType([], [], false)}]; http2streamState.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; http2Setting.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Valid", name: "Valid", pkg: "", typ: $funcType([], [$error], false)}]; http2SettingID.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; http2gate.methods = [{prop: "Done", name: "Done", pkg: "", typ: $funcType([], [], false)}, {prop: "Wait", name: "Wait", pkg: "", typ: $funcType([], [], false)}]; http2closeWaiter.methods = [{prop: "Close", name: "Close", pkg: "", typ: $funcType([], [], false)}, {prop: "Wait", name: "Wait", pkg: "", typ: $funcType([], [], false)}]; ptrType$98.methods = [{prop: "Init", name: "Init", pkg: "", typ: $funcType([], [], false)}]; ptrType$88.methods = [{prop: "Available", name: "Available", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "Flush", name: "Flush", pkg: "", typ: $funcType([], [$error], false)}]; ptrType$139.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Temporary", name: "Temporary", pkg: "", typ: $funcType([], [$Bool], false)}]; ptrType$100.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: "Keys", name: "Keys", pkg: "", typ: $funcType([Header], [sliceType$2], false)}, {prop: "SortStrings", name: "SortStrings", pkg: "", typ: $funcType([sliceType$2], [], false)}]; ptrType$97.methods = [{prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "CloseWithError", name: "CloseWithError", pkg: "", typ: $funcType([$error], [], false)}, {prop: "BreakWithError", name: "BreakWithError", pkg: "", typ: $funcType([$error], [], false)}, {prop: "closeWithErrorAndCode", name: "closeWithErrorAndCode", pkg: "net/http", typ: $funcType([$error, funcType], [], false)}, {prop: "closeWithError", name: "closeWithError", pkg: "net/http", typ: $funcType([ptrType$85, $error, funcType], [], false)}, {prop: "closeDoneLocked", name: "closeDoneLocked", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "Err", name: "Err", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Done", name: "Done", pkg: "", typ: $funcType([], [chanType$2], false)}]; ptrType$86.methods = [{prop: "initialConnRecvWindowSize", name: "initialConnRecvWindowSize", pkg: "net/http", typ: $funcType([], [$Int32], false)}, {prop: "initialStreamRecvWindowSize", name: "initialStreamRecvWindowSize", pkg: "net/http", typ: $funcType([], [$Int32], false)}, {prop: "maxReadFrameSize", name: "maxReadFrameSize", pkg: "net/http", typ: $funcType([], [$Uint32], false)}, {prop: "maxConcurrentStreams", name: "maxConcurrentStreams", pkg: "net/http", typ: $funcType([], [$Uint32], false)}, {prop: "maxQueuedControlFrames", name: "maxQueuedControlFrames", pkg: "net/http", typ: $funcType([], [$Int], false)}, {prop: "ServeConn", name: "ServeConn", pkg: "", typ: $funcType([net.Conn, ptrType$87], [], false)}]; ptrType$60.methods = [{prop: "registerConn", name: "registerConn", pkg: "net/http", typ: $funcType([ptrType$13], [], false)}, {prop: "unregisterConn", name: "unregisterConn", pkg: "net/http", typ: $funcType([ptrType$13], [], false)}, {prop: "startGracefulShutdown", name: "startGracefulShutdown", pkg: "net/http", typ: $funcType([], [], false)}]; ptrType$87.methods = [{prop: "context", name: "context", pkg: "net/http", typ: $funcType([], [context.Context], false)}, {prop: "baseConfig", name: "baseConfig", pkg: "net/http", typ: $funcType([], [ptrType$46], false)}, {prop: "handler", name: "handler", pkg: "net/http", typ: $funcType([], [Handler], false)}]; ptrType$13.methods = [{prop: "rejectConn", name: "rejectConn", pkg: "net/http", typ: $funcType([http2ErrCode, $String], [], false)}, {prop: "maxHeaderListSize", name: "maxHeaderListSize", pkg: "net/http", typ: $funcType([], [$Uint32], false)}, {prop: "curOpenStreams", name: "curOpenStreams", pkg: "net/http", typ: $funcType([], [$Uint32], false)}, {prop: "Framer", name: "Framer", pkg: "", typ: $funcType([], [ptrType$72], false)}, {prop: "CloseConn", name: "CloseConn", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Flush", name: "Flush", pkg: "", typ: $funcType([], [$error], false)}, {prop: "HeaderEncoder", name: "HeaderEncoder", pkg: "", typ: $funcType([], [ptrType$89, ptrType$40], false)}, {prop: "state", name: "state", pkg: "net/http", typ: $funcType([$Uint32], [http2streamState, ptrType$10], false)}, {prop: "setConnState", name: "setConnState", pkg: "net/http", typ: $funcType([ConnState], [], false)}, {prop: "vlogf", name: "vlogf", pkg: "net/http", typ: $funcType([$String, sliceType], [], true)}, {prop: "logf", name: "logf", pkg: "net/http", typ: $funcType([$String, sliceType], [], true)}, {prop: "condlogf", name: "condlogf", pkg: "net/http", typ: $funcType([$error, $String, sliceType], [], true)}, {prop: "canonicalHeader", name: "canonicalHeader", pkg: "net/http", typ: $funcType([$String], [$String], false)}, {prop: "readFrames", name: "readFrames", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "writeFrameAsync", name: "writeFrameAsync", pkg: "net/http", typ: $funcType([http2FrameWriteRequest], [], false)}, {prop: "closeAllStreamsOnConnClose", name: "closeAllStreamsOnConnClose", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "stopShutdownTimer", name: "stopShutdownTimer", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "notePanic", name: "notePanic", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "serve", name: "serve", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "awaitGracefulShutdown", name: "awaitGracefulShutdown", pkg: "net/http", typ: $funcType([chanType$2, chanType$1], [], false)}, {prop: "onSettingsTimer", name: "onSettingsTimer", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "onIdleTimer", name: "onIdleTimer", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "onShutdownTimer", name: "onShutdownTimer", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "sendServeMsg", name: "sendServeMsg", pkg: "net/http", typ: $funcType([$emptyInterface], [], false)}, {prop: "readPreface", name: "readPreface", pkg: "net/http", typ: $funcType([], [$error], false)}, {prop: "writeDataFromHandler", name: "writeDataFromHandler", pkg: "net/http", typ: $funcType([ptrType$10, sliceType$3, $Bool], [$error], false)}, {prop: "writeFrameFromHandler", name: "writeFrameFromHandler", pkg: "net/http", typ: $funcType([http2FrameWriteRequest], [$error], false)}, {prop: "writeFrame", name: "writeFrame", pkg: "net/http", typ: $funcType([http2FrameWriteRequest], [], false)}, {prop: "startFrameWrite", name: "startFrameWrite", pkg: "net/http", typ: $funcType([http2FrameWriteRequest], [], false)}, {prop: "wroteFrame", name: "wroteFrame", pkg: "net/http", typ: $funcType([http2frameWriteResult], [], false)}, {prop: "scheduleFrameWrite", name: "scheduleFrameWrite", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "startGracefulShutdown", name: "startGracefulShutdown", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "startGracefulShutdownInternal", name: "startGracefulShutdownInternal", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "goAway", name: "goAway", pkg: "net/http", typ: $funcType([http2ErrCode], [], false)}, {prop: "shutDownIn", name: "shutDownIn", pkg: "net/http", typ: $funcType([time.Duration], [], false)}, {prop: "resetStream", name: "resetStream", pkg: "net/http", typ: $funcType([http2StreamError], [], false)}, {prop: "processFrameFromReader", name: "processFrameFromReader", pkg: "net/http", typ: $funcType([http2readFrameResult], [$Bool], false)}, {prop: "processFrame", name: "processFrame", pkg: "net/http", typ: $funcType([http2Frame], [$error], false)}, {prop: "processPing", name: "processPing", pkg: "net/http", typ: $funcType([ptrType$81], [$error], false)}, {prop: "processWindowUpdate", name: "processWindowUpdate", pkg: "net/http", typ: $funcType([ptrType$80], [$error], false)}, {prop: "processResetStream", name: "processResetStream", pkg: "net/http", typ: $funcType([ptrType$83], [$error], false)}, {prop: "closeStream", name: "closeStream", pkg: "net/http", typ: $funcType([ptrType$10, $error], [], false)}, {prop: "processSettings", name: "processSettings", pkg: "net/http", typ: $funcType([ptrType$78], [$error], false)}, {prop: "processSetting", name: "processSetting", pkg: "net/http", typ: $funcType([http2Setting], [$error], false)}, {prop: "processSettingInitialWindowSize", name: "processSettingInitialWindowSize", pkg: "net/http", typ: $funcType([$Uint32], [$error], false)}, {prop: "processData", name: "processData", pkg: "net/http", typ: $funcType([ptrType$79], [$error], false)}, {prop: "processGoAway", name: "processGoAway", pkg: "net/http", typ: $funcType([ptrType$82], [$error], false)}, {prop: "processHeaders", name: "processHeaders", pkg: "net/http", typ: $funcType([ptrType$76], [$error], false)}, {prop: "processPriority", name: "processPriority", pkg: "net/http", typ: $funcType([ptrType$95], [$error], false)}, {prop: "newStream", name: "newStream", pkg: "net/http", typ: $funcType([$Uint32, $Uint32, http2streamState], [ptrType$10], false)}, {prop: "newWriterAndRequest", name: "newWriterAndRequest", pkg: "net/http", typ: $funcType([ptrType$10, ptrType$76], [ptrType$16, ptrType$11, $error], false)}, {prop: "newWriterAndRequestNoBody", name: "newWriterAndRequestNoBody", pkg: "net/http", typ: $funcType([ptrType$10, http2requestParam], [ptrType$16, ptrType$11, $error], false)}, {prop: "runHandler", name: "runHandler", pkg: "net/http", typ: $funcType([ptrType$16, ptrType$11, funcType$16], [], false)}, {prop: "writeHeaders", name: "writeHeaders", pkg: "net/http", typ: $funcType([ptrType$10, ptrType$93], [$error], false)}, {prop: "write100ContinueHeaders", name: "write100ContinueHeaders", pkg: "net/http", typ: $funcType([ptrType$10], [], false)}, {prop: "noteBodyReadFromHandler", name: "noteBodyReadFromHandler", pkg: "net/http", typ: $funcType([ptrType$10, $Int, $error], [], false)}, {prop: "noteBodyRead", name: "noteBodyRead", pkg: "net/http", typ: $funcType([ptrType$10, $Int], [], false)}, {prop: "sendWindowUpdate", name: "sendWindowUpdate", pkg: "net/http", typ: $funcType([ptrType$10, $Int], [], false)}, {prop: "sendWindowUpdate32", name: "sendWindowUpdate32", pkg: "net/http", typ: $funcType([ptrType$10, $Int32], [], false)}, {prop: "startPush", name: "startPush", pkg: "net/http", typ: $funcType([ptrType$91], [], false)}]; ptrType$10.methods = [{prop: "isPushed", name: "isPushed", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "endStream", name: "endStream", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "copyTrailersToHandlerRequest", name: "copyTrailersToHandlerRequest", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "onWriteTimeout", name: "onWriteTimeout", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "processTrailerHeaders", name: "processTrailerHeaders", pkg: "net/http", typ: $funcType([ptrType$76], [$error], false)}]; ptrType$12.methods = [{prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}]; ptrType$16.methods = [{prop: "Flush", name: "Flush", pkg: "", typ: $funcType([], [], false)}, {prop: "CloseNotify", name: "CloseNotify", pkg: "", typ: $funcType([], [chanType$9], false)}, {prop: "Header", name: "Header", pkg: "", typ: $funcType([], [Header], false)}, {prop: "WriteHeader", name: "WriteHeader", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([$String], [$Int, $error], false)}, {prop: "write", name: "write", pkg: "net/http", typ: $funcType([$Int, sliceType$3, $String], [$Int, $error], false)}, {prop: "handlerDone", name: "handlerDone", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "Push", name: "Push", pkg: "", typ: $funcType([$String, ptrType$101], [$error], false)}]; ptrType$99.methods = [{prop: "hasTrailers", name: "hasTrailers", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "hasNonemptyTrailers", name: "hasNonemptyTrailers", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "declareTrailer", name: "declareTrailer", pkg: "net/http", typ: $funcType([$String], [], false)}, {prop: "writeChunk", name: "writeChunk", pkg: "net/http", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "promoteUndeclaredTrailers", name: "promoteUndeclaredTrailers", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "writeHeader", name: "writeHeader", pkg: "net/http", typ: $funcType([$Int], [], false)}]; http2chunkWriter.methods = [{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}]; ptrType$102.methods = [{prop: "dialTLSWithContext", name: "dialTLSWithContext", pkg: "net/http", typ: $funcType([context.Context, $String, $String, ptrType$4], [ptrType$30, $error], false)}, {prop: "maxHeaderListSize", name: "maxHeaderListSize", pkg: "net/http", typ: $funcType([], [$Uint32], false)}, {prop: "disableCompression", name: "disableCompression", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "pingTimeout", name: "pingTimeout", pkg: "net/http", typ: $funcType([], [time.Duration], false)}, {prop: "connPool", name: "connPool", pkg: "net/http", typ: $funcType([], [http2ClientConnPool], false)}, {prop: "initConnPool", name: "initConnPool", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "RoundTrip", name: "RoundTrip", pkg: "", typ: $funcType([ptrType$11], [ptrType$18, $error], false)}, {prop: "RoundTripOpt", name: "RoundTripOpt", pkg: "", typ: $funcType([ptrType$11, http2RoundTripOpt], [ptrType$18, $error], false)}, {prop: "CloseIdleConnections", name: "CloseIdleConnections", pkg: "", typ: $funcType([], [], false)}, {prop: "dialClientConn", name: "dialClientConn", pkg: "net/http", typ: $funcType([context.Context, $String, $Bool], [ptrType$68, $error], false)}, {prop: "newTLSConfig", name: "newTLSConfig", pkg: "net/http", typ: $funcType([$String], [ptrType$4], false)}, {prop: "dialTLS", name: "dialTLS", pkg: "net/http", typ: $funcType([context.Context], [funcType$25], false)}, {prop: "disableKeepAlives", name: "disableKeepAlives", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "expectContinueTimeout", name: "expectContinueTimeout", pkg: "net/http", typ: $funcType([], [time.Duration], false)}, {prop: "NewClientConn", name: "NewClientConn", pkg: "", typ: $funcType([net.Conn], [ptrType$68, $error], false)}, {prop: "newClientConn", name: "newClientConn", pkg: "net/http", typ: $funcType([net.Conn, $Bool], [ptrType$68, $error], false)}, {prop: "vlogf", name: "vlogf", pkg: "net/http", typ: $funcType([$String, sliceType], [], true)}, {prop: "logf", name: "logf", pkg: "net/http", typ: $funcType([$String, sliceType], [], true)}, {prop: "getBodyWriterState", name: "getBodyWriterState", pkg: "net/http", typ: $funcType([ptrType$104, io.Reader], [http2bodyWriterState], false)}, {prop: "idleConnTimeout", name: "idleConnTimeout", pkg: "net/http", typ: $funcType([], [time.Duration], false)}]; ptrType$68.methods = [{prop: "healthCheck", name: "healthCheck", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "setGoAway", name: "setGoAway", pkg: "net/http", typ: $funcType([ptrType$82], [], false)}, {prop: "CanTakeNewRequest", name: "CanTakeNewRequest", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "idleState", name: "idleState", pkg: "net/http", typ: $funcType([], [http2clientConnIdleState], false)}, {prop: "idleStateLocked", name: "idleStateLocked", pkg: "net/http", typ: $funcType([], [http2clientConnIdleState], false)}, {prop: "canTakeNewRequestLocked", name: "canTakeNewRequestLocked", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "tooIdleLocked", name: "tooIdleLocked", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "onIdleTimeout", name: "onIdleTimeout", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "closeIfIdle", name: "closeIfIdle", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "Shutdown", name: "Shutdown", pkg: "", typ: $funcType([context.Context], [$error], false)}, {prop: "sendGoAway", name: "sendGoAway", pkg: "net/http", typ: $funcType([], [$error], false)}, {prop: "closeForError", name: "closeForError", pkg: "net/http", typ: $funcType([$error], [$error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "closeForLostPing", name: "closeForLostPing", pkg: "net/http", typ: $funcType([], [$error], false)}, {prop: "frameScratchBuffer", name: "frameScratchBuffer", pkg: "net/http", typ: $funcType([], [sliceType$3], false)}, {prop: "putFrameScratchBuffer", name: "putFrameScratchBuffer", pkg: "net/http", typ: $funcType([sliceType$3], [], false)}, {prop: "responseHeaderTimeout", name: "responseHeaderTimeout", pkg: "net/http", typ: $funcType([], [time.Duration], false)}, {prop: "RoundTrip", name: "RoundTrip", pkg: "", typ: $funcType([ptrType$11], [ptrType$18, $error], false)}, {prop: "roundTrip", name: "roundTrip", pkg: "net/http", typ: $funcType([ptrType$11], [ptrType$18, $Bool, $error], false)}, {prop: "awaitOpenSlotForRequest", name: "awaitOpenSlotForRequest", pkg: "net/http", typ: $funcType([ptrType$11], [$error], false)}, {prop: "writeHeaders", name: "writeHeaders", pkg: "net/http", typ: $funcType([$Uint32, $Bool, $Int, sliceType$3], [$error], false)}, {prop: "encodeHeaders", name: "encodeHeaders", pkg: "net/http", typ: $funcType([ptrType$11, $Bool, $String, $Int64], [sliceType$3, $error], false)}, {prop: "encodeTrailers", name: "encodeTrailers", pkg: "net/http", typ: $funcType([ptrType$11], [sliceType$3, $error], false)}, {prop: "writeHeader", name: "writeHeader", pkg: "net/http", typ: $funcType([$String, $String], [], false)}, {prop: "newStream", name: "newStream", pkg: "net/http", typ: $funcType([], [ptrType$104], false)}, {prop: "forgetStreamID", name: "forgetStreamID", pkg: "net/http", typ: $funcType([$Uint32], [], false)}, {prop: "streamByID", name: "streamByID", pkg: "net/http", typ: $funcType([$Uint32, $Bool], [ptrType$104], false)}, {prop: "readLoop", name: "readLoop", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "Ping", name: "Ping", pkg: "", typ: $funcType([context.Context], [$error], false)}, {prop: "writeStreamReset", name: "writeStreamReset", pkg: "net/http", typ: $funcType([$Uint32, http2ErrCode, $error], [], false)}, {prop: "logf", name: "logf", pkg: "net/http", typ: $funcType([$String, sliceType], [], true)}, {prop: "vlogf", name: "vlogf", pkg: "net/http", typ: $funcType([$String, sliceType], [], true)}]; ptrType$104.methods = [{prop: "get1xxTraceFunc", name: "get1xxTraceFunc", pkg: "net/http", typ: $funcType([], [funcType$26], false)}, {prop: "awaitRequestCancel", name: "awaitRequestCancel", pkg: "net/http", typ: $funcType([ptrType$11], [], false)}, {prop: "cancelStream", name: "cancelStream", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "checkResetOrDone", name: "checkResetOrDone", pkg: "net/http", typ: $funcType([], [$error], false)}, {prop: "getStartedWrite", name: "getStartedWrite", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "abortRequestBodyWrite", name: "abortRequestBodyWrite", pkg: "net/http", typ: $funcType([$error], [], false)}, {prop: "writeRequestBody", name: "writeRequestBody", pkg: "net/http", typ: $funcType([io.Reader, io.Closer], [$error], false)}, {prop: "awaitFlowControl", name: "awaitFlowControl", pkg: "net/http", typ: $funcType([$Int], [$Int32, $error], false)}, {prop: "copyTrailers", name: "copyTrailers", pkg: "net/http", typ: $funcType([], [], false)}]; http2stickyErrWriter.methods = [{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}]; http2noCachedConnError.methods = [{prop: "IsHTTP2NoCachedConnError", name: "IsHTTP2NoCachedConnError", pkg: "", typ: $funcType([], [], false)}, {prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$140.methods = [{prop: "cleanup", name: "cleanup", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "run", name: "run", pkg: "net/http", typ: $funcType([], [$error], false)}, {prop: "processHeaders", name: "processHeaders", pkg: "net/http", typ: $funcType([ptrType$76], [$error], false)}, {prop: "handleResponse", name: "handleResponse", pkg: "net/http", typ: $funcType([ptrType$104, ptrType$76], [ptrType$18, $error], false)}, {prop: "processTrailers", name: "processTrailers", pkg: "net/http", typ: $funcType([ptrType$104, ptrType$76], [$error], false)}, {prop: "processData", name: "processData", pkg: "net/http", typ: $funcType([ptrType$79], [$error], false)}, {prop: "endStream", name: "endStream", pkg: "net/http", typ: $funcType([ptrType$104], [], false)}, {prop: "endStreamError", name: "endStreamError", pkg: "net/http", typ: $funcType([ptrType$104, $error], [], false)}, {prop: "processGoAway", name: "processGoAway", pkg: "net/http", typ: $funcType([ptrType$82], [$error], false)}, {prop: "processSettings", name: "processSettings", pkg: "net/http", typ: $funcType([ptrType$78], [$error], false)}, {prop: "processWindowUpdate", name: "processWindowUpdate", pkg: "net/http", typ: $funcType([ptrType$80], [$error], false)}, {prop: "processResetStream", name: "processResetStream", pkg: "net/http", typ: $funcType([ptrType$83], [$error], false)}, {prop: "processPing", name: "processPing", pkg: "net/http", typ: $funcType([ptrType$81], [$error], false)}, {prop: "processPushPromise", name: "processPushPromise", pkg: "net/http", typ: $funcType([ptrType$96], [$error], false)}]; http2GoAwayError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; http2transportResponseBody.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}]; http2erringRoundTripper.methods = [{prop: "RoundTripErr", name: "RoundTripErr", pkg: "", typ: $funcType([], [$error], false)}, {prop: "RoundTrip", name: "RoundTrip", pkg: "", typ: $funcType([ptrType$11], [ptrType$18, $error], false)}]; ptrType$141.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}]; http2bodyWriterState.methods = [{prop: "cancel", name: "cancel", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "on100", name: "on100", pkg: "net/http", typ: $funcType([], [], false)}, {prop: "scheduleBodyWrite", name: "scheduleBodyWrite", pkg: "net/http", typ: $funcType([], [], false)}]; http2noDialH2RoundTripper.methods = [{prop: "RoundTrip", name: "RoundTrip", pkg: "", typ: $funcType([ptrType$11], [ptrType$18, $error], false)}]; http2flushFrameWriter.methods = [{prop: "writeFrame", name: "writeFrame", pkg: "net/http", typ: $funcType([http2writeContext], [$error], false)}, {prop: "staysWithinBuffer", name: "staysWithinBuffer", pkg: "net/http", typ: $funcType([$Int], [$Bool], false)}]; http2writeSettings.methods = [{prop: "staysWithinBuffer", name: "staysWithinBuffer", pkg: "net/http", typ: $funcType([$Int], [$Bool], false)}, {prop: "writeFrame", name: "writeFrame", pkg: "net/http", typ: $funcType([http2writeContext], [$error], false)}]; ptrType$142.methods = [{prop: "writeFrame", name: "writeFrame", pkg: "net/http", typ: $funcType([http2writeContext], [$error], false)}, {prop: "staysWithinBuffer", name: "staysWithinBuffer", pkg: "net/http", typ: $funcType([$Int], [$Bool], false)}]; ptrType$92.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "writeFrame", name: "writeFrame", pkg: "net/http", typ: $funcType([http2writeContext], [$error], false)}, {prop: "staysWithinBuffer", name: "staysWithinBuffer", pkg: "net/http", typ: $funcType([$Int], [$Bool], false)}]; http2handlerPanicRST.methods = [{prop: "writeFrame", name: "writeFrame", pkg: "net/http", typ: $funcType([http2writeContext], [$error], false)}, {prop: "staysWithinBuffer", name: "staysWithinBuffer", pkg: "net/http", typ: $funcType([$Int], [$Bool], false)}]; http2writePingAck.methods = [{prop: "writeFrame", name: "writeFrame", pkg: "net/http", typ: $funcType([http2writeContext], [$error], false)}, {prop: "staysWithinBuffer", name: "staysWithinBuffer", pkg: "net/http", typ: $funcType([$Int], [$Bool], false)}]; http2writeSettingsAck.methods = [{prop: "writeFrame", name: "writeFrame", pkg: "net/http", typ: $funcType([http2writeContext], [$error], false)}, {prop: "staysWithinBuffer", name: "staysWithinBuffer", pkg: "net/http", typ: $funcType([$Int], [$Bool], false)}]; ptrType$93.methods = [{prop: "staysWithinBuffer", name: "staysWithinBuffer", pkg: "net/http", typ: $funcType([$Int], [$Bool], false)}, {prop: "writeFrame", name: "writeFrame", pkg: "net/http", typ: $funcType([http2writeContext], [$error], false)}, {prop: "writeHeaderBlock", name: "writeHeaderBlock", pkg: "net/http", typ: $funcType([http2writeContext, sliceType$3, $Bool, $Bool], [$error], false)}]; ptrType$94.methods = [{prop: "staysWithinBuffer", name: "staysWithinBuffer", pkg: "net/http", typ: $funcType([$Int], [$Bool], false)}, {prop: "writeFrame", name: "writeFrame", pkg: "net/http", typ: $funcType([http2writeContext], [$error], false)}, {prop: "writeHeaderBlock", name: "writeHeaderBlock", pkg: "net/http", typ: $funcType([http2writeContext, sliceType$3, $Bool, $Bool], [$error], false)}]; http2write100ContinueHeadersFrame.methods = [{prop: "writeFrame", name: "writeFrame", pkg: "net/http", typ: $funcType([http2writeContext], [$error], false)}, {prop: "staysWithinBuffer", name: "staysWithinBuffer", pkg: "net/http", typ: $funcType([$Int], [$Bool], false)}]; http2writeWindowUpdate.methods = [{prop: "staysWithinBuffer", name: "staysWithinBuffer", pkg: "net/http", typ: $funcType([$Int], [$Bool], false)}, {prop: "writeFrame", name: "writeFrame", pkg: "net/http", typ: $funcType([http2writeContext], [$error], false)}]; http2FrameWriteRequest.methods = [{prop: "StreamID", name: "StreamID", pkg: "", typ: $funcType([], [$Uint32], false)}, {prop: "isControl", name: "isControl", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "DataSize", name: "DataSize", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Consume", name: "Consume", pkg: "", typ: $funcType([$Int32], [http2FrameWriteRequest, http2FrameWriteRequest, $Int], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$143.methods = [{prop: "replyToWriter", name: "replyToWriter", pkg: "net/http", typ: $funcType([$error], [], false)}]; ptrType$106.methods = [{prop: "empty", name: "empty", pkg: "net/http", typ: $funcType([], [$Bool], false)}, {prop: "push", name: "push", pkg: "net/http", typ: $funcType([http2FrameWriteRequest], [], false)}, {prop: "shift", name: "shift", pkg: "net/http", typ: $funcType([], [http2FrameWriteRequest], false)}, {prop: "consume", name: "consume", pkg: "net/http", typ: $funcType([$Int32], [http2FrameWriteRequest, $Bool], false)}]; ptrType$108.methods = [{prop: "put", name: "put", pkg: "net/http", typ: $funcType([ptrType$106], [], false)}, {prop: "get", name: "get", pkg: "net/http", typ: $funcType([], [ptrType$106], false)}]; ptrType$107.methods = [{prop: "setParent", name: "setParent", pkg: "net/http", typ: $funcType([ptrType$107], [], false)}, {prop: "addBytes", name: "addBytes", pkg: "net/http", typ: $funcType([$Int64], [], false)}, {prop: "walkReadyInOrder", name: "walkReadyInOrder", pkg: "net/http", typ: $funcType([$Bool, ptrType$109, funcType$28], [$Bool], false)}]; http2sortPriorityNodeSiblings.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$144.methods = [{prop: "OpenStream", name: "OpenStream", pkg: "", typ: $funcType([$Uint32, http2OpenStreamOptions], [], false)}, {prop: "CloseStream", name: "CloseStream", pkg: "", typ: $funcType([$Uint32], [], false)}, {prop: "AdjustStream", name: "AdjustStream", pkg: "", typ: $funcType([$Uint32, http2PriorityParam], [], false)}, {prop: "Push", name: "Push", pkg: "", typ: $funcType([http2FrameWriteRequest], [], false)}, {prop: "Pop", name: "Pop", pkg: "", typ: $funcType([], [http2FrameWriteRequest, $Bool], false)}, {prop: "addClosedOrIdleNode", name: "addClosedOrIdleNode", pkg: "net/http", typ: $funcType([ptrType$109, $Int, ptrType$107], [], false)}, {prop: "removeNode", name: "removeNode", pkg: "net/http", typ: $funcType([ptrType$107], [], false)}]; ptrType$145.methods = [{prop: "OpenStream", name: "OpenStream", pkg: "", typ: $funcType([$Uint32, http2OpenStreamOptions], [], false)}, {prop: "CloseStream", name: "CloseStream", pkg: "", typ: $funcType([$Uint32], [], false)}, {prop: "AdjustStream", name: "AdjustStream", pkg: "", typ: $funcType([$Uint32, http2PriorityParam], [], false)}, {prop: "Push", name: "Push", pkg: "", typ: $funcType([http2FrameWriteRequest], [], false)}, {prop: "Pop", name: "Pop", pkg: "", typ: $funcType([], [http2FrameWriteRequest, $Bool], false)}]; noTransport.methods = [{prop: "RoundTrip", name: "RoundTrip", pkg: "", typ: $funcType([ptrType$11], [ptrType$18, $error], false)}]; ptrType$146.methods = [{prop: "RoundTrip", name: "RoundTrip", pkg: "", typ: $funcType([ptrType$11], [ptrType$18, $error], false)}, {prop: "CancelRequest", name: "CancelRequest", pkg: "", typ: $funcType([ptrType$11], [], false)}]; ptrType$147.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}]; ptrType$148.methods = [{prop: "RoundTrip", name: "RoundTrip", pkg: "", typ: $funcType([ptrType$11], [ptrType$18, $error], false)}]; ptrType$62.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$151.methods = [{prop: "send", name: "send", pkg: "net/http", typ: $funcType([ptrType$11, time.Time], [ptrType$18, funcType$11, $error], false)}, {prop: "deadline", name: "deadline", pkg: "net/http", typ: $funcType([], [time.Time], false)}, {prop: "transport", name: "transport", pkg: "net/http", typ: $funcType([], [RoundTripper], false)}, {prop: "Get", name: "Get", pkg: "", typ: $funcType([$String], [ptrType$18, $error], false)}, {prop: "checkRedirect", name: "checkRedirect", pkg: "net/http", typ: $funcType([ptrType$11, sliceType$30], [$error], false)}, {prop: "Do", name: "Do", pkg: "", typ: $funcType([ptrType$11], [ptrType$18, $error], false)}, {prop: "do$", name: "do", pkg: "net/http", typ: $funcType([ptrType$11], [ptrType$18, $error], false)}, {prop: "makeHeadersCopier", name: "makeHeadersCopier", pkg: "net/http", typ: $funcType([ptrType$11], [funcType$29], false)}, {prop: "Post", name: "Post", pkg: "", typ: $funcType([$String, $String, io.Reader], [ptrType$18, $error], false)}, {prop: "PostForm", name: "PostForm", pkg: "", typ: $funcType([$String, url.Values], [ptrType$18, $error], false)}, {prop: "Head", name: "Head", pkg: "", typ: $funcType([$String], [ptrType$18, $error], false)}, {prop: "CloseIdleConnections", name: "CloseIdleConnections", pkg: "", typ: $funcType([], [], false)}]; ptrType$152.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}]; Transport.init("net/http", [{prop: "idleMu", name: "idleMu", embedded: false, exported: false, typ: sync.Mutex, tag: ""}, {prop: "closeIdle", name: "closeIdle", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "idleConn", name: "idleConn", embedded: false, exported: false, typ: mapType$2, tag: ""}, {prop: "idleConnWait", name: "idleConnWait", embedded: false, exported: false, typ: mapType$3, tag: ""}, {prop: "idleLRU", name: "idleLRU", embedded: false, exported: false, typ: connLRU, tag: ""}, {prop: "reqMu", name: "reqMu", embedded: false, exported: false, typ: sync.Mutex, tag: ""}, {prop: "reqCanceler", name: "reqCanceler", embedded: false, exported: false, typ: mapType$4, tag: ""}, {prop: "altMu", name: "altMu", embedded: false, exported: false, typ: sync.Mutex, tag: ""}, {prop: "altProto", name: "altProto", embedded: false, exported: false, typ: atomic.Value, tag: ""}, {prop: "connsPerHostMu", name: "connsPerHostMu", embedded: false, exported: false, typ: sync.Mutex, tag: ""}, {prop: "connsPerHost", name: "connsPerHost", embedded: false, exported: false, typ: mapType$5, tag: ""}, {prop: "connsPerHostWait", name: "connsPerHostWait", embedded: false, exported: false, typ: mapType$3, tag: ""}, {prop: "Proxy", name: "Proxy", embedded: false, exported: true, typ: funcType$6, tag: ""}, {prop: "DialContext", name: "DialContext", embedded: false, exported: true, typ: funcType$7, tag: ""}, {prop: "Dial", name: "Dial", embedded: false, exported: true, typ: funcType$8, tag: ""}, {prop: "DialTLSContext", name: "DialTLSContext", embedded: false, exported: true, typ: funcType$7, tag: ""}, {prop: "DialTLS", name: "DialTLS", embedded: false, exported: true, typ: funcType$8, tag: ""}, {prop: "TLSClientConfig", name: "TLSClientConfig", embedded: false, exported: true, typ: ptrType$4, tag: ""}, {prop: "TLSHandshakeTimeout", name: "TLSHandshakeTimeout", embedded: false, exported: true, typ: time.Duration, tag: ""}, {prop: "DisableKeepAlives", name: "DisableKeepAlives", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "DisableCompression", name: "DisableCompression", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "MaxIdleConns", name: "MaxIdleConns", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "MaxIdleConnsPerHost", name: "MaxIdleConnsPerHost", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "MaxConnsPerHost", name: "MaxConnsPerHost", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "IdleConnTimeout", name: "IdleConnTimeout", embedded: false, exported: true, typ: time.Duration, tag: ""}, {prop: "ResponseHeaderTimeout", name: "ResponseHeaderTimeout", embedded: false, exported: true, typ: time.Duration, tag: ""}, {prop: "ExpectContinueTimeout", name: "ExpectContinueTimeout", embedded: false, exported: true, typ: time.Duration, tag: ""}, {prop: "TLSNextProto", name: "TLSNextProto", embedded: false, exported: true, typ: mapType$6, tag: ""}, {prop: "ProxyConnectHeader", name: "ProxyConnectHeader", embedded: false, exported: true, typ: Header, tag: ""}, {prop: "GetProxyConnectHeader", name: "GetProxyConnectHeader", embedded: false, exported: true, typ: funcType$10, tag: ""}, {prop: "MaxResponseHeaderBytes", name: "MaxResponseHeaderBytes", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "WriteBufferSize", name: "WriteBufferSize", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "ReadBufferSize", name: "ReadBufferSize", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "nextProtoOnce", name: "nextProtoOnce", embedded: false, exported: false, typ: sync.Once, tag: ""}, {prop: "h2transport", name: "h2transport", embedded: false, exported: false, typ: h2Transport, tag: ""}, {prop: "tlsNextProtoWasNil", name: "tlsNextProtoWasNil", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "ForceAttemptHTTP2", name: "ForceAttemptHTTP2", embedded: false, exported: true, typ: $Bool, tag: ""}]); cancelKey.init("net/http", [{prop: "req", name: "req", embedded: false, exported: false, typ: ptrType$11, tag: ""}]); h2Transport.init([{prop: "CloseIdleConnections", name: "CloseIdleConnections", pkg: "", typ: $funcType([], [], false)}]); transportRequest.init("net/http", [{prop: "Request", name: "Request", embedded: true, exported: true, typ: ptrType$11, tag: ""}, {prop: "extra", name: "extra", embedded: false, exported: false, typ: Header, tag: ""}, {prop: "trace", name: "trace", embedded: false, exported: false, typ: ptrType$19, tag: ""}, {prop: "cancelKey", name: "cancelKey", embedded: false, exported: false, typ: cancelKey, tag: ""}, {prop: "mu", name: "mu", embedded: false, exported: false, typ: sync.Mutex, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}]); readTrackingBody.init("net/http", [{prop: "ReadCloser", name: "ReadCloser", embedded: true, exported: true, typ: io.ReadCloser, tag: ""}, {prop: "didRead", name: "didRead", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "didClose", name: "didClose", embedded: false, exported: false, typ: $Bool, tag: ""}]); transportReadFromServerError.init("net/http", [{prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}]); wantConn.init("net/http", [{prop: "cm", name: "cm", embedded: false, exported: false, typ: connectMethod, tag: ""}, {prop: "key", name: "key", embedded: false, exported: false, typ: connectMethodKey, tag: ""}, {prop: "ctx", name: "ctx", embedded: false, exported: false, typ: context.Context, tag: ""}, {prop: "ready", name: "ready", embedded: false, exported: false, typ: chanType$1, tag: ""}, {prop: "beforeDial", name: "beforeDial", embedded: false, exported: false, typ: funcType, tag: ""}, {prop: "afterDial", name: "afterDial", embedded: false, exported: false, typ: funcType, tag: ""}, {prop: "mu", name: "mu", embedded: false, exported: false, typ: sync.Mutex, tag: ""}, {prop: "pc", name: "pc", embedded: false, exported: false, typ: ptrType$22, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}]); wantConnQueue.init("net/http", [{prop: "head", name: "head", embedded: false, exported: false, typ: sliceType$8, tag: ""}, {prop: "headPos", name: "headPos", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "tail", name: "tail", embedded: false, exported: false, typ: sliceType$8, tag: ""}]); erringRoundTripper.init([{prop: "RoundTripErr", name: "RoundTripErr", pkg: "", typ: $funcType([], [$error], false)}]); persistConnWriter.init("net/http", [{prop: "pc", name: "pc", embedded: false, exported: false, typ: ptrType$22, tag: ""}]); connectMethod.init("net/http", [{prop: "_$0", name: "_", embedded: false, exported: false, typ: incomparable, tag: ""}, {prop: "proxyURL", name: "proxyURL", embedded: false, exported: false, typ: ptrType$17, tag: ""}, {prop: "targetScheme", name: "targetScheme", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "targetAddr", name: "targetAddr", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "onlyH1", name: "onlyH1", embedded: false, exported: false, typ: $Bool, tag: ""}]); connectMethodKey.init("net/http", [{prop: "proxy", name: "proxy", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "scheme", name: "scheme", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "addr", name: "addr", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "onlyH1", name: "onlyH1", embedded: false, exported: false, typ: $Bool, tag: ""}]); persistConn.init("net/http", [{prop: "alt", name: "alt", embedded: false, exported: false, typ: RoundTripper, tag: ""}, {prop: "t", name: "t", embedded: false, exported: false, typ: ptrType$27, tag: ""}, {prop: "cacheKey", name: "cacheKey", embedded: false, exported: false, typ: connectMethodKey, tag: ""}, {prop: "conn", name: "conn", embedded: false, exported: false, typ: net.Conn, tag: ""}, {prop: "tlsState", name: "tlsState", embedded: false, exported: false, typ: ptrType$28, tag: ""}, {prop: "br", name: "br", embedded: false, exported: false, typ: ptrType$29, tag: ""}, {prop: "bw", name: "bw", embedded: false, exported: false, typ: ptrType$14, tag: ""}, {prop: "nwrite", name: "nwrite", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "reqch", name: "reqch", embedded: false, exported: false, typ: chanType$3, tag: ""}, {prop: "writech", name: "writech", embedded: false, exported: false, typ: chanType$4, tag: ""}, {prop: "closech", name: "closech", embedded: false, exported: false, typ: chanType$1, tag: ""}, {prop: "isProxy", name: "isProxy", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "sawEOF", name: "sawEOF", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "readLimit", name: "readLimit", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "writeErrCh", name: "writeErrCh", embedded: false, exported: false, typ: chanType, tag: ""}, {prop: "writeLoopDone", name: "writeLoopDone", embedded: false, exported: false, typ: chanType$1, tag: ""}, {prop: "idleAt", name: "idleAt", embedded: false, exported: false, typ: time.Time, tag: ""}, {prop: "idleTimer", name: "idleTimer", embedded: false, exported: false, typ: ptrType$25, tag: ""}, {prop: "mu", name: "mu", embedded: false, exported: false, typ: sync.Mutex, tag: ""}, {prop: "numExpectedResponses", name: "numExpectedResponses", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "closed", name: "closed", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "canceledErr", name: "canceledErr", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "broken", name: "broken", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "reused", name: "reused", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "mutateHeaderFunc", name: "mutateHeaderFunc", embedded: false, exported: false, typ: funcType$12, tag: ""}]); readWriteCloserBody.init("net/http", [{prop: "_$0", name: "_", embedded: false, exported: false, typ: incomparable, tag: ""}, {prop: "br", name: "br", embedded: false, exported: false, typ: ptrType$29, tag: ""}, {prop: "ReadWriteCloser", name: "ReadWriteCloser", embedded: true, exported: true, typ: io.ReadWriteCloser, tag: ""}]); nothingWrittenError.init("net/http", [{prop: "error", name: "error", embedded: true, exported: false, typ: $error, tag: ""}]); responseAndError.init("net/http", [{prop: "_$0", name: "_", embedded: false, exported: false, typ: incomparable, tag: ""}, {prop: "res", name: "res", embedded: false, exported: false, typ: ptrType$18, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}]); requestAndChan.init("net/http", [{prop: "_$0", name: "_", embedded: false, exported: false, typ: incomparable, tag: ""}, {prop: "req", name: "req", embedded: false, exported: false, typ: ptrType$11, tag: ""}, {prop: "cancelKey", name: "cancelKey", embedded: false, exported: false, typ: cancelKey, tag: ""}, {prop: "ch", name: "ch", embedded: false, exported: false, typ: chanType$5, tag: ""}, {prop: "addedGzip", name: "addedGzip", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "continueCh", name: "continueCh", embedded: false, exported: false, typ: chanType$6, tag: ""}, {prop: "callerGone", name: "callerGone", embedded: false, exported: false, typ: chanType$2, tag: ""}]); writeRequest.init("net/http", [{prop: "req", name: "req", embedded: false, exported: false, typ: ptrType$115, tag: ""}, {prop: "ch", name: "ch", embedded: false, exported: false, typ: chanType$7, tag: ""}, {prop: "continueCh", name: "continueCh", embedded: false, exported: false, typ: chanType$2, tag: ""}]); httpError.init("net/http", [{prop: "err", name: "err", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "timeout", name: "timeout", embedded: false, exported: false, typ: $Bool, tag: ""}]); tLogKey.init("", []); bodyEOFSignal.init("net/http", [{prop: "body", name: "body", embedded: false, exported: false, typ: io.ReadCloser, tag: ""}, {prop: "mu", name: "mu", embedded: false, exported: false, typ: sync.Mutex, tag: ""}, {prop: "closed", name: "closed", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "rerr", name: "rerr", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "fn", name: "fn", embedded: false, exported: false, typ: funcType$13, tag: ""}, {prop: "earlyCloseFn", name: "earlyCloseFn", embedded: false, exported: false, typ: funcType$14, tag: ""}]); gzipReader.init("net/http", [{prop: "_$0", name: "_", embedded: false, exported: false, typ: incomparable, tag: ""}, {prop: "body", name: "body", embedded: false, exported: false, typ: ptrType$32, tag: ""}, {prop: "zr", name: "zr", embedded: false, exported: false, typ: ptrType$33, tag: ""}, {prop: "zerr", name: "zerr", embedded: false, exported: false, typ: $error, tag: ""}]); tlsHandshakeTimeoutError.init("", []); fakeLocker.init("", []); connLRU.init("net/http", [{prop: "ll", name: "ll", embedded: false, exported: false, typ: ptrType$3, tag: ""}, {prop: "m", name: "m", embedded: false, exported: false, typ: mapType$7, tag: ""}]); errorReader.init("net/http", [{prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}]); byteReader.init("net/http", [{prop: "b", name: "b", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "done", name: "done", embedded: false, exported: false, typ: $Bool, tag: ""}]); transferWriter.init("net/http", [{prop: "Method", name: "Method", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Body", name: "Body", embedded: false, exported: true, typ: io.Reader, tag: ""}, {prop: "BodyCloser", name: "BodyCloser", embedded: false, exported: true, typ: io.Closer, tag: ""}, {prop: "ResponseToHEAD", name: "ResponseToHEAD", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "ContentLength", name: "ContentLength", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Close", name: "Close", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "TransferEncoding", name: "TransferEncoding", embedded: false, exported: true, typ: sliceType$2, tag: ""}, {prop: "Header", name: "Header", embedded: false, exported: true, typ: Header, tag: ""}, {prop: "Trailer", name: "Trailer", embedded: false, exported: true, typ: Header, tag: ""}, {prop: "IsResponse", name: "IsResponse", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "bodyReadError", name: "bodyReadError", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "FlushHeaders", name: "FlushHeaders", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "ByteReadCh", name: "ByteReadCh", embedded: false, exported: true, typ: chanType$8, tag: ""}]); transferReader.init("", [{prop: "Header", name: "Header", embedded: false, exported: true, typ: Header, tag: ""}, {prop: "StatusCode", name: "StatusCode", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "RequestMethod", name: "RequestMethod", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "ProtoMajor", name: "ProtoMajor", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "ProtoMinor", name: "ProtoMinor", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Body", name: "Body", embedded: false, exported: true, typ: io.ReadCloser, tag: ""}, {prop: "ContentLength", name: "ContentLength", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Chunked", name: "Chunked", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "Close", name: "Close", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "Trailer", name: "Trailer", embedded: false, exported: true, typ: Header, tag: ""}]); unsupportedTEError.init("net/http", [{prop: "err", name: "err", embedded: false, exported: false, typ: $String, tag: ""}]); body.init("net/http", [{prop: "src", name: "src", embedded: false, exported: false, typ: io.Reader, tag: ""}, {prop: "hdr", name: "hdr", embedded: false, exported: false, typ: $emptyInterface, tag: ""}, {prop: "r", name: "r", embedded: false, exported: false, typ: ptrType$29, tag: ""}, {prop: "closing", name: "closing", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "doEarlyClose", name: "doEarlyClose", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "mu", name: "mu", embedded: false, exported: false, typ: sync.Mutex, tag: ""}, {prop: "sawEOF", name: "sawEOF", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "closed", name: "closed", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "earlyClose", name: "earlyClose", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "onHitEOF", name: "onHitEOF", embedded: false, exported: false, typ: funcType, tag: ""}]); bodyLocked.init("net/http", [{prop: "b", name: "b", embedded: false, exported: false, typ: ptrType$52, tag: ""}]); finishAsyncByteRead.init("net/http", [{prop: "tw", name: "tw", embedded: false, exported: false, typ: ptrType$35, tag: ""}]); bufioFlushWriter.init("net/http", [{prop: "w", name: "w", embedded: false, exported: false, typ: io.Writer, tag: ""}]); socksAddr.init("", [{prop: "Name", name: "Name", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "IP", name: "IP", embedded: false, exported: true, typ: net.IP, tag: ""}, {prop: "Port", name: "Port", embedded: false, exported: true, typ: $Int, tag: ""}]); socksConn.init("net/http", [{prop: "Conn", name: "Conn", embedded: true, exported: true, typ: net.Conn, tag: ""}, {prop: "boundAddr", name: "boundAddr", embedded: false, exported: false, typ: net.Addr, tag: ""}]); socksDialer.init("net/http", [{prop: "cmd", name: "cmd", embedded: false, exported: false, typ: socksCommand, tag: ""}, {prop: "proxyNetwork", name: "proxyNetwork", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "proxyAddress", name: "proxyAddress", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "ProxyDial", name: "ProxyDial", embedded: false, exported: true, typ: funcType$7, tag: ""}, {prop: "AuthMethods", name: "AuthMethods", embedded: false, exported: true, typ: sliceType$12, tag: ""}, {prop: "Authenticate", name: "Authenticate", embedded: false, exported: true, typ: funcType$15, tag: ""}]); socksUsernamePassword.init("", [{prop: "Username", name: "Username", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Password", name: "Password", embedded: false, exported: true, typ: $String, tag: ""}]); sniffSig.init([{prop: "match", name: "match", pkg: "net/http", typ: $funcType([sliceType$3, $Int], [$String], false)}]); exactSig.init("net/http", [{prop: "sig", name: "sig", embedded: false, exported: false, typ: sliceType$3, tag: ""}, {prop: "ct", name: "ct", embedded: false, exported: false, typ: $String, tag: ""}]); maskedSig.init("net/http", [{prop: "mask", name: "mask", embedded: false, exported: false, typ: sliceType$3, tag: ""}, {prop: "pat", name: "pat", embedded: false, exported: false, typ: sliceType$3, tag: ""}, {prop: "skipWS", name: "skipWS", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "ct", name: "ct", embedded: false, exported: false, typ: $String, tag: ""}]); htmlSig.init($Uint8); mp4Sig.init("", []); textSig.init("", []); Handler.init([{prop: "ServeHTTP", name: "ServeHTTP", pkg: "", typ: $funcType([ResponseWriter, ptrType$11], [], false)}]); ResponseWriter.init([{prop: "Header", name: "Header", pkg: "", typ: $funcType([], [Header], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "WriteHeader", name: "WriteHeader", pkg: "", typ: $funcType([$Int], [], false)}]); conn.init("net/http", [{prop: "server", name: "server", embedded: false, exported: false, typ: ptrType$46, tag: ""}, {prop: "cancelCtx", name: "cancelCtx", embedded: false, exported: false, typ: context.CancelFunc, tag: ""}, {prop: "rwc", name: "rwc", embedded: false, exported: false, typ: net.Conn, tag: ""}, {prop: "remoteAddr", name: "remoteAddr", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "tlsState", name: "tlsState", embedded: false, exported: false, typ: ptrType$28, tag: ""}, {prop: "werr", name: "werr", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "r", name: "r", embedded: false, exported: false, typ: ptrType$47, tag: ""}, {prop: "bufr", name: "bufr", embedded: false, exported: false, typ: ptrType$29, tag: ""}, {prop: "bufw", name: "bufw", embedded: false, exported: false, typ: ptrType$14, tag: ""}, {prop: "lastMethod", name: "lastMethod", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "curReq", name: "curReq", embedded: false, exported: false, typ: atomic.Value, tag: ""}, {prop: "curState", name: "curState", embedded: false, exported: false, typ: structType$1, tag: ""}, {prop: "mu", name: "mu", embedded: false, exported: false, typ: sync.Mutex, tag: ""}, {prop: "hijackedv", name: "hijackedv", embedded: false, exported: false, typ: $Bool, tag: ""}]); chunkWriter.init("net/http", [{prop: "res", name: "res", embedded: false, exported: false, typ: ptrType$49, tag: ""}, {prop: "header", name: "header", embedded: false, exported: false, typ: Header, tag: ""}, {prop: "wroteHeader", name: "wroteHeader", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "chunking", name: "chunking", embedded: false, exported: false, typ: $Bool, tag: ""}]); response.init("net/http", [{prop: "conn", name: "conn", embedded: false, exported: false, typ: ptrType$53, tag: ""}, {prop: "req", name: "req", embedded: false, exported: false, typ: ptrType$11, tag: ""}, {prop: "reqBody", name: "reqBody", embedded: false, exported: false, typ: io.ReadCloser, tag: ""}, {prop: "cancelCtx", name: "cancelCtx", embedded: false, exported: false, typ: context.CancelFunc, tag: ""}, {prop: "wroteHeader", name: "wroteHeader", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "wroteContinue", name: "wroteContinue", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "wants10KeepAlive", name: "wants10KeepAlive", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "wantsClose", name: "wantsClose", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "canWriteContinue", name: "canWriteContinue", embedded: false, exported: false, typ: atomicBool, tag: ""}, {prop: "writeContinueMu", name: "writeContinueMu", embedded: false, exported: false, typ: sync.Mutex, tag: ""}, {prop: "w", name: "w", embedded: false, exported: false, typ: ptrType$14, tag: ""}, {prop: "cw", name: "cw", embedded: false, exported: false, typ: chunkWriter, tag: ""}, {prop: "handlerHeader", name: "handlerHeader", embedded: false, exported: false, typ: Header, tag: ""}, {prop: "calledHeader", name: "calledHeader", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "written", name: "written", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "contentLength", name: "contentLength", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "status", name: "status", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "closeAfterReply", name: "closeAfterReply", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "requestBodyLimitHit", name: "requestBodyLimitHit", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "trailers", name: "trailers", embedded: false, exported: false, typ: sliceType$2, tag: ""}, {prop: "handlerDone", name: "handlerDone", embedded: false, exported: false, typ: atomicBool, tag: ""}, {prop: "dateBuf", name: "dateBuf", embedded: false, exported: false, typ: arrayType$3, tag: ""}, {prop: "clenBuf", name: "clenBuf", embedded: false, exported: false, typ: arrayType$4, tag: ""}, {prop: "statusBuf", name: "statusBuf", embedded: false, exported: false, typ: arrayType$5, tag: ""}, {prop: "closeNotifyCh", name: "closeNotifyCh", embedded: false, exported: false, typ: chanType$10, tag: ""}, {prop: "didCloseNotify", name: "didCloseNotify", embedded: false, exported: false, typ: $Int32, tag: ""}]); writerOnly.init("", [{prop: "Writer", name: "Writer", embedded: true, exported: true, typ: io.Writer, tag: ""}]); readResult.init("net/http", [{prop: "_$0", name: "_", embedded: false, exported: false, typ: incomparable, tag: ""}, {prop: "n", name: "n", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "b", name: "b", embedded: false, exported: false, typ: $Uint8, tag: ""}]); connReader.init("net/http", [{prop: "conn", name: "conn", embedded: false, exported: false, typ: ptrType$53, tag: ""}, {prop: "mu", name: "mu", embedded: false, exported: false, typ: sync.Mutex, tag: ""}, {prop: "hasByte", name: "hasByte", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "byteBuf", name: "byteBuf", embedded: false, exported: false, typ: arrayType$2, tag: ""}, {prop: "cond", name: "cond", embedded: false, exported: false, typ: ptrType$48, tag: ""}, {prop: "inRead", name: "inRead", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "aborted", name: "aborted", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "remain", name: "remain", embedded: false, exported: false, typ: $Int64, tag: ""}]); expectContinueReader.init("net/http", [{prop: "resp", name: "resp", embedded: false, exported: false, typ: ptrType$49, tag: ""}, {prop: "readCloser", name: "readCloser", embedded: false, exported: false, typ: io.ReadCloser, tag: ""}, {prop: "closed", name: "closed", embedded: false, exported: false, typ: atomicBool, tag: ""}, {prop: "sawEOF", name: "sawEOF", embedded: false, exported: false, typ: atomicBool, tag: ""}]); extraHeader.init("net/http", [{prop: "contentType", name: "contentType", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "connection", name: "connection", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "transferEncoding", name: "transferEncoding", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "date", name: "date", embedded: false, exported: false, typ: sliceType$3, tag: ""}, {prop: "contentLength", name: "contentLength", embedded: false, exported: false, typ: sliceType$3, tag: ""}]); closeWriter.init([{prop: "CloseWrite", name: "CloseWrite", pkg: "", typ: $funcType([], [$error], false)}]); statusError.init("net/http", [{prop: "code", name: "code", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "text", name: "text", embedded: false, exported: false, typ: $String, tag: ""}]); HandlerFunc.init([ResponseWriter, ptrType$11], [], false); redirectHandler.init("net/http", [{prop: "url", name: "url", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "code", name: "code", embedded: false, exported: false, typ: $Int, tag: ""}]); ServeMux.init("net/http", [{prop: "mu", name: "mu", embedded: false, exported: false, typ: sync.RWMutex, tag: ""}, {prop: "m", name: "m", embedded: false, exported: false, typ: mapType$8, tag: ""}, {prop: "es", name: "es", embedded: false, exported: false, typ: sliceType$1, tag: ""}, {prop: "hosts", name: "hosts", embedded: false, exported: false, typ: $Bool, tag: ""}]); muxEntry.init("net/http", [{prop: "h", name: "h", embedded: false, exported: false, typ: Handler, tag: ""}, {prop: "pattern", name: "pattern", embedded: false, exported: false, typ: $String, tag: ""}]); Server.init("net/http", [{prop: "Addr", name: "Addr", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Handler", name: "Handler", embedded: false, exported: true, typ: Handler, tag: ""}, {prop: "TLSConfig", name: "TLSConfig", embedded: false, exported: true, typ: ptrType$4, tag: ""}, {prop: "ReadTimeout", name: "ReadTimeout", embedded: false, exported: true, typ: time.Duration, tag: ""}, {prop: "ReadHeaderTimeout", name: "ReadHeaderTimeout", embedded: false, exported: true, typ: time.Duration, tag: ""}, {prop: "WriteTimeout", name: "WriteTimeout", embedded: false, exported: true, typ: time.Duration, tag: ""}, {prop: "IdleTimeout", name: "IdleTimeout", embedded: false, exported: true, typ: time.Duration, tag: ""}, {prop: "MaxHeaderBytes", name: "MaxHeaderBytes", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "TLSNextProto", name: "TLSNextProto", embedded: false, exported: true, typ: mapType$9, tag: ""}, {prop: "ConnState", name: "ConnState", embedded: false, exported: true, typ: funcType$18, tag: ""}, {prop: "ErrorLog", name: "ErrorLog", embedded: false, exported: true, typ: ptrType$58, tag: ""}, {prop: "BaseContext", name: "BaseContext", embedded: false, exported: true, typ: funcType$19, tag: ""}, {prop: "ConnContext", name: "ConnContext", embedded: false, exported: true, typ: funcType$20, tag: ""}, {prop: "inShutdown", name: "inShutdown", embedded: false, exported: false, typ: atomicBool, tag: ""}, {prop: "disableKeepAlives", name: "disableKeepAlives", embedded: false, exported: false, typ: $Int32, tag: ""}, {prop: "nextProtoOnce", name: "nextProtoOnce", embedded: false, exported: false, typ: sync.Once, tag: ""}, {prop: "nextProtoErr", name: "nextProtoErr", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "mu", name: "mu", embedded: false, exported: false, typ: sync.Mutex, tag: ""}, {prop: "listeners", name: "listeners", embedded: false, exported: false, typ: mapType$10, tag: ""}, {prop: "activeConn", name: "activeConn", embedded: false, exported: false, typ: mapType$11, tag: ""}, {prop: "doneChan", name: "doneChan", embedded: false, exported: false, typ: chanType$1, tag: ""}, {prop: "onShutdown", name: "onShutdown", embedded: false, exported: false, typ: sliceType$19, tag: ""}]); serverHandler.init("net/http", [{prop: "srv", name: "srv", embedded: false, exported: false, typ: ptrType$46, tag: ""}]); onceCloseListener.init("net/http", [{prop: "Listener", name: "Listener", embedded: true, exported: true, typ: net.Listener, tag: ""}, {prop: "once", name: "once", embedded: false, exported: false, typ: sync.Once, tag: ""}, {prop: "closeErr", name: "closeErr", embedded: false, exported: false, typ: $error, tag: ""}]); globalOptionsHandler.init("", []); initALPNRequest.init("net/http", [{prop: "ctx", name: "ctx", embedded: false, exported: false, typ: context.Context, tag: ""}, {prop: "c", name: "c", embedded: false, exported: false, typ: ptrType$30, tag: ""}, {prop: "h", name: "h", embedded: false, exported: false, typ: serverHandler, tag: ""}]); loggingConn.init("net/http", [{prop: "name", name: "name", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "Conn", name: "Conn", embedded: true, exported: true, typ: net.Conn, tag: ""}]); checkConnErrorWriter.init("net/http", [{prop: "c", name: "c", embedded: false, exported: false, typ: ptrType$53, tag: ""}]); Response.init("", [{prop: "Status", name: "Status", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "StatusCode", name: "StatusCode", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Proto", name: "Proto", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "ProtoMajor", name: "ProtoMajor", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "ProtoMinor", name: "ProtoMinor", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Header", name: "Header", embedded: false, exported: true, typ: Header, tag: ""}, {prop: "Body", name: "Body", embedded: false, exported: true, typ: io.ReadCloser, tag: ""}, {prop: "ContentLength", name: "ContentLength", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "TransferEncoding", name: "TransferEncoding", embedded: false, exported: true, typ: sliceType$2, tag: ""}, {prop: "Close", name: "Close", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "Uncompressed", name: "Uncompressed", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "Trailer", name: "Trailer", embedded: false, exported: true, typ: Header, tag: ""}, {prop: "Request", name: "Request", embedded: false, exported: true, typ: ptrType$11, tag: ""}, {prop: "TLS", name: "TLS", embedded: false, exported: true, typ: ptrType$28, tag: ""}]); ProtocolError.init("", [{prop: "ErrorString", name: "ErrorString", embedded: false, exported: true, typ: $String, tag: ""}]); Request.init("net/http", [{prop: "Method", name: "Method", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "URL", name: "URL", embedded: false, exported: true, typ: ptrType$17, tag: ""}, {prop: "Proto", name: "Proto", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "ProtoMajor", name: "ProtoMajor", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "ProtoMinor", name: "ProtoMinor", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Header", name: "Header", embedded: false, exported: true, typ: Header, tag: ""}, {prop: "Body", name: "Body", embedded: false, exported: true, typ: io.ReadCloser, tag: ""}, {prop: "GetBody", name: "GetBody", embedded: false, exported: true, typ: funcType$21, tag: ""}, {prop: "ContentLength", name: "ContentLength", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "TransferEncoding", name: "TransferEncoding", embedded: false, exported: true, typ: sliceType$2, tag: ""}, {prop: "Close", name: "Close", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "Host", name: "Host", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Form", name: "Form", embedded: false, exported: true, typ: url.Values, tag: ""}, {prop: "PostForm", name: "PostForm", embedded: false, exported: true, typ: url.Values, tag: ""}, {prop: "MultipartForm", name: "MultipartForm", embedded: false, exported: true, typ: ptrType$31, tag: ""}, {prop: "Trailer", name: "Trailer", embedded: false, exported: true, typ: Header, tag: ""}, {prop: "RemoteAddr", name: "RemoteAddr", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "RequestURI", name: "RequestURI", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "TLS", name: "TLS", embedded: false, exported: true, typ: ptrType$28, tag: ""}, {prop: "Cancel", name: "Cancel", embedded: false, exported: true, typ: chanType$2, tag: ""}, {prop: "Response", name: "Response", embedded: false, exported: true, typ: ptrType$18, tag: ""}, {prop: "ctx", name: "ctx", embedded: false, exported: false, typ: context.Context, tag: ""}]); requestBodyReadError.init("net/http", [{prop: "error", name: "error", embedded: true, exported: false, typ: $error, tag: ""}]); maxBytesReader.init("net/http", [{prop: "w", name: "w", embedded: false, exported: false, typ: ResponseWriter, tag: ""}, {prop: "r", name: "r", embedded: false, exported: false, typ: io.ReadCloser, tag: ""}, {prop: "n", name: "n", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}]); CookieJar.init([{prop: "Cookies", name: "Cookies", pkg: "", typ: $funcType([ptrType$17], [sliceType$29], false)}, {prop: "SetCookies", name: "SetCookies", pkg: "", typ: $funcType([ptrType$17, sliceType$29], [], false)}]); incomparable.init(funcType, 0); contextKey.init("net/http", [{prop: "name", name: "name", embedded: false, exported: false, typ: $String, tag: ""}]); noBody.init("", []); PushOptions.init("", [{prop: "Method", name: "Method", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Header", name: "Header", embedded: false, exported: true, typ: Header, tag: ""}]); Header.init($String, sliceType$2); stringWriter.init("net/http", [{prop: "w", name: "w", embedded: false, exported: false, typ: io.Writer, tag: ""}]); keyValues.init("net/http", [{prop: "key", name: "key", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "values", name: "values", embedded: false, exported: false, typ: sliceType$2, tag: ""}]); headerSorter.init("net/http", [{prop: "kvs", name: "kvs", embedded: false, exported: false, typ: sliceType$6, tag: ""}]); http2ClientConnPool.init([{prop: "GetClientConn", name: "GetClientConn", pkg: "", typ: $funcType([ptrType$11, $String], [ptrType$68, $error], false)}, {prop: "MarkDead", name: "MarkDead", pkg: "", typ: $funcType([ptrType$68], [], false)}]); http2clientConnPoolIdleCloser.init([{prop: "GetClientConn", name: "GetClientConn", pkg: "", typ: $funcType([ptrType$11, $String], [ptrType$68, $error], false)}, {prop: "MarkDead", name: "MarkDead", pkg: "", typ: $funcType([ptrType$68], [], false)}, {prop: "closeIdleConnections", name: "closeIdleConnections", pkg: "net/http", typ: $funcType([], [], false)}]); http2clientConnPool.init("net/http", [{prop: "t", name: "t", embedded: false, exported: false, typ: ptrType$102, tag: ""}, {prop: "mu", name: "mu", embedded: false, exported: false, typ: sync.Mutex, tag: ""}, {prop: "conns", name: "conns", embedded: false, exported: false, typ: mapType$13, tag: ""}, {prop: "dialing", name: "dialing", embedded: false, exported: false, typ: mapType$14, tag: ""}, {prop: "keys", name: "keys", embedded: false, exported: false, typ: mapType$15, tag: ""}, {prop: "addConnCalls", name: "addConnCalls", embedded: false, exported: false, typ: mapType$16, tag: ""}]); http2dialCall.init("net/http", [{prop: "_$0", name: "_", embedded: false, exported: false, typ: http2incomparable, tag: ""}, {prop: "p", name: "p", embedded: false, exported: false, typ: ptrType$9, tag: ""}, {prop: "ctx", name: "ctx", embedded: false, exported: false, typ: context.Context, tag: ""}, {prop: "done", name: "done", embedded: false, exported: false, typ: chanType$1, tag: ""}, {prop: "res", name: "res", embedded: false, exported: false, typ: ptrType$68, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}]); http2addConnCall.init("net/http", [{prop: "_$0", name: "_", embedded: false, exported: false, typ: http2incomparable, tag: ""}, {prop: "p", name: "p", embedded: false, exported: false, typ: ptrType$9, tag: ""}, {prop: "done", name: "done", embedded: false, exported: false, typ: chanType$1, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}]); http2noDialClientConnPool.init("net/http", [{prop: "http2clientConnPool", name: "http2clientConnPool", embedded: true, exported: false, typ: ptrType$9, tag: ""}]); http2dataBuffer.init("net/http", [{prop: "chunks", name: "chunks", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "r", name: "r", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "w", name: "w", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "size", name: "size", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "expected", name: "expected", embedded: false, exported: false, typ: $Int64, tag: ""}]); http2StreamError.init("", [{prop: "StreamID", name: "StreamID", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Code", name: "Code", embedded: false, exported: true, typ: http2ErrCode, tag: ""}, {prop: "Cause", name: "Cause", embedded: false, exported: true, typ: $error, tag: ""}]); http2goAwayFlowError.init("", []); http2connError.init("", [{prop: "Code", name: "Code", embedded: false, exported: true, typ: http2ErrCode, tag: ""}, {prop: "Reason", name: "Reason", embedded: false, exported: true, typ: $String, tag: ""}]); http2flow.init("net/http", [{prop: "_$0", name: "_", embedded: false, exported: false, typ: http2incomparable, tag: ""}, {prop: "n", name: "n", embedded: false, exported: false, typ: $Int32, tag: ""}, {prop: "conn", name: "conn", embedded: false, exported: false, typ: ptrType$71, tag: ""}]); http2FrameHeader.init("net/http", [{prop: "valid", name: "valid", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "Type", name: "Type", embedded: false, exported: true, typ: http2FrameType, tag: ""}, {prop: "Flags", name: "Flags", embedded: false, exported: true, typ: http2Flags, tag: ""}, {prop: "Length", name: "Length", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "StreamID", name: "StreamID", embedded: false, exported: true, typ: $Uint32, tag: ""}]); http2Frame.init([{prop: "Header", name: "Header", pkg: "", typ: $funcType([], [http2FrameHeader], false)}, {prop: "invalidate", name: "invalidate", pkg: "net/http", typ: $funcType([], [], false)}]); http2Framer.init("net/http", [{prop: "r", name: "r", embedded: false, exported: false, typ: io.Reader, tag: ""}, {prop: "lastFrame", name: "lastFrame", embedded: false, exported: false, typ: http2Frame, tag: ""}, {prop: "errDetail", name: "errDetail", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "lastHeaderStream", name: "lastHeaderStream", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "maxReadSize", name: "maxReadSize", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "headerBuf", name: "headerBuf", embedded: false, exported: false, typ: arrayType$7, tag: ""}, {prop: "getReadBuf", name: "getReadBuf", embedded: false, exported: false, typ: funcType$22, tag: ""}, {prop: "readBuf", name: "readBuf", embedded: false, exported: false, typ: sliceType$3, tag: ""}, {prop: "maxWriteSize", name: "maxWriteSize", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "w", name: "w", embedded: false, exported: false, typ: io.Writer, tag: ""}, {prop: "wbuf", name: "wbuf", embedded: false, exported: false, typ: sliceType$3, tag: ""}, {prop: "AllowIllegalWrites", name: "AllowIllegalWrites", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "AllowIllegalReads", name: "AllowIllegalReads", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "ReadMetaHeaders", name: "ReadMetaHeaders", embedded: false, exported: true, typ: ptrType$74, tag: ""}, {prop: "MaxHeaderListSize", name: "MaxHeaderListSize", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "logReads", name: "logReads", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "logWrites", name: "logWrites", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "debugFramer", name: "debugFramer", embedded: false, exported: false, typ: ptrType$72, tag: ""}, {prop: "debugFramerBuf", name: "debugFramerBuf", embedded: false, exported: false, typ: ptrType$40, tag: ""}, {prop: "debugReadLoggerf", name: "debugReadLoggerf", embedded: false, exported: false, typ: funcType$1, tag: ""}, {prop: "debugWriteLoggerf", name: "debugWriteLoggerf", embedded: false, exported: false, typ: funcType$1, tag: ""}, {prop: "frameCache", name: "frameCache", embedded: false, exported: false, typ: ptrType$73, tag: ""}]); http2frameCache.init("net/http", [{prop: "dataFrame", name: "dataFrame", embedded: false, exported: false, typ: http2DataFrame, tag: ""}]); http2DataFrame.init("net/http", [{prop: "http2FrameHeader", name: "http2FrameHeader", embedded: true, exported: false, typ: http2FrameHeader, tag: ""}, {prop: "data", name: "data", embedded: false, exported: false, typ: sliceType$3, tag: ""}]); http2SettingsFrame.init("net/http", [{prop: "http2FrameHeader", name: "http2FrameHeader", embedded: true, exported: false, typ: http2FrameHeader, tag: ""}, {prop: "p", name: "p", embedded: false, exported: false, typ: sliceType$3, tag: ""}]); http2PingFrame.init("net/http", [{prop: "http2FrameHeader", name: "http2FrameHeader", embedded: true, exported: false, typ: http2FrameHeader, tag: ""}, {prop: "Data", name: "Data", embedded: false, exported: true, typ: arrayType$8, tag: ""}]); http2GoAwayFrame.init("net/http", [{prop: "http2FrameHeader", name: "http2FrameHeader", embedded: true, exported: false, typ: http2FrameHeader, tag: ""}, {prop: "LastStreamID", name: "LastStreamID", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "ErrCode", name: "ErrCode", embedded: false, exported: true, typ: http2ErrCode, tag: ""}, {prop: "debugData", name: "debugData", embedded: false, exported: false, typ: sliceType$3, tag: ""}]); http2UnknownFrame.init("net/http", [{prop: "http2FrameHeader", name: "http2FrameHeader", embedded: true, exported: false, typ: http2FrameHeader, tag: ""}, {prop: "p", name: "p", embedded: false, exported: false, typ: sliceType$3, tag: ""}]); http2WindowUpdateFrame.init("net/http", [{prop: "http2FrameHeader", name: "http2FrameHeader", embedded: true, exported: false, typ: http2FrameHeader, tag: ""}, {prop: "Increment", name: "Increment", embedded: false, exported: true, typ: $Uint32, tag: ""}]); http2HeadersFrame.init("net/http", [{prop: "http2FrameHeader", name: "http2FrameHeader", embedded: true, exported: false, typ: http2FrameHeader, tag: ""}, {prop: "Priority", name: "Priority", embedded: false, exported: true, typ: http2PriorityParam, tag: ""}, {prop: "headerFragBuf", name: "headerFragBuf", embedded: false, exported: false, typ: sliceType$3, tag: ""}]); http2HeadersFrameParam.init("", [{prop: "StreamID", name: "StreamID", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "BlockFragment", name: "BlockFragment", embedded: false, exported: true, typ: sliceType$3, tag: ""}, {prop: "EndStream", name: "EndStream", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "EndHeaders", name: "EndHeaders", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "PadLength", name: "PadLength", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Priority", name: "Priority", embedded: false, exported: true, typ: http2PriorityParam, tag: ""}]); http2PriorityFrame.init("net/http", [{prop: "http2FrameHeader", name: "http2FrameHeader", embedded: true, exported: false, typ: http2FrameHeader, tag: ""}, {prop: "http2PriorityParam", name: "http2PriorityParam", embedded: true, exported: false, typ: http2PriorityParam, tag: ""}]); http2PriorityParam.init("", [{prop: "StreamDep", name: "StreamDep", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Exclusive", name: "Exclusive", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "Weight", name: "Weight", embedded: false, exported: true, typ: $Uint8, tag: ""}]); http2RSTStreamFrame.init("net/http", [{prop: "http2FrameHeader", name: "http2FrameHeader", embedded: true, exported: false, typ: http2FrameHeader, tag: ""}, {prop: "ErrCode", name: "ErrCode", embedded: false, exported: true, typ: http2ErrCode, tag: ""}]); http2ContinuationFrame.init("net/http", [{prop: "http2FrameHeader", name: "http2FrameHeader", embedded: true, exported: false, typ: http2FrameHeader, tag: ""}, {prop: "headerFragBuf", name: "headerFragBuf", embedded: false, exported: false, typ: sliceType$3, tag: ""}]); http2PushPromiseFrame.init("net/http", [{prop: "http2FrameHeader", name: "http2FrameHeader", embedded: true, exported: false, typ: http2FrameHeader, tag: ""}, {prop: "PromiseID", name: "PromiseID", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "headerFragBuf", name: "headerFragBuf", embedded: false, exported: false, typ: sliceType$3, tag: ""}]); http2PushPromiseParam.init("", [{prop: "StreamID", name: "StreamID", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "PromiseID", name: "PromiseID", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "BlockFragment", name: "BlockFragment", embedded: false, exported: true, typ: sliceType$3, tag: ""}, {prop: "EndHeaders", name: "EndHeaders", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "PadLength", name: "PadLength", embedded: false, exported: true, typ: $Uint8, tag: ""}]); http2MetaHeadersFrame.init("net/http", [{prop: "http2HeadersFrame", name: "http2HeadersFrame", embedded: true, exported: false, typ: ptrType$75, tag: ""}, {prop: "Fields", name: "Fields", embedded: false, exported: true, typ: sliceType$22, tag: ""}, {prop: "Truncated", name: "Truncated", embedded: false, exported: true, typ: $Bool, tag: ""}]); http2Setting.init("", [{prop: "ID", name: "ID", embedded: false, exported: true, typ: http2SettingID, tag: ""}, {prop: "Val", name: "Val", embedded: false, exported: true, typ: $Uint32, tag: ""}]); http2gate.init(structType, false, false); http2closeWaiter.init(structType, false, false); http2bufferedWriter.init("net/http", [{prop: "_$0", name: "_", embedded: false, exported: false, typ: http2incomparable, tag: ""}, {prop: "w", name: "w", embedded: false, exported: false, typ: io.Writer, tag: ""}, {prop: "bw", name: "bw", embedded: false, exported: false, typ: ptrType$14, tag: ""}]); http2httpError.init("net/http", [{prop: "_$0", name: "_", embedded: false, exported: false, typ: http2incomparable, tag: ""}, {prop: "msg", name: "msg", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "timeout", name: "timeout", embedded: false, exported: false, typ: $Bool, tag: ""}]); http2connectionStater.init([{prop: "ConnectionState", name: "ConnectionState", pkg: "", typ: $funcType([], [tls.ConnectionState], false)}]); http2sorter.init("net/http", [{prop: "v", name: "v", embedded: false, exported: false, typ: sliceType$2, tag: ""}]); http2incomparable.init(funcType, 0); http2pipe.init("net/http", [{prop: "mu", name: "mu", embedded: false, exported: false, typ: sync.Mutex, tag: ""}, {prop: "c", name: "c", embedded: false, exported: false, typ: sync.Cond, tag: ""}, {prop: "b", name: "b", embedded: false, exported: false, typ: http2pipeBuffer, tag: ""}, {prop: "unread", name: "unread", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "breakErr", name: "breakErr", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "donec", name: "donec", embedded: false, exported: false, typ: chanType$1, tag: ""}, {prop: "readFn", name: "readFn", embedded: false, exported: false, typ: funcType, tag: ""}]); http2pipeBuffer.init([{prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}]); http2Server.init("net/http", [{prop: "MaxHandlers", name: "MaxHandlers", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "MaxConcurrentStreams", name: "MaxConcurrentStreams", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "MaxReadFrameSize", name: "MaxReadFrameSize", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "PermitProhibitedCipherSuites", name: "PermitProhibitedCipherSuites", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "IdleTimeout", name: "IdleTimeout", embedded: false, exported: true, typ: time.Duration, tag: ""}, {prop: "MaxUploadBufferPerConnection", name: "MaxUploadBufferPerConnection", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "MaxUploadBufferPerStream", name: "MaxUploadBufferPerStream", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "NewWriteScheduler", name: "NewWriteScheduler", embedded: false, exported: true, typ: funcType$24, tag: ""}, {prop: "state", name: "state", embedded: false, exported: false, typ: ptrType$60, tag: ""}]); http2serverInternalState.init("net/http", [{prop: "mu", name: "mu", embedded: false, exported: false, typ: sync.Mutex, tag: ""}, {prop: "activeConns", name: "activeConns", embedded: false, exported: false, typ: mapType$17, tag: ""}]); http2ServeConnOpts.init("", [{prop: "Context", name: "Context", embedded: false, exported: true, typ: context.Context, tag: ""}, {prop: "BaseConfig", name: "BaseConfig", embedded: false, exported: true, typ: ptrType$46, tag: ""}, {prop: "Handler", name: "Handler", embedded: false, exported: true, typ: Handler, tag: ""}]); http2serverConn.init("net/http", [{prop: "srv", name: "srv", embedded: false, exported: false, typ: ptrType$86, tag: ""}, {prop: "hs", name: "hs", embedded: false, exported: false, typ: ptrType$46, tag: ""}, {prop: "conn", name: "conn", embedded: false, exported: false, typ: net.Conn, tag: ""}, {prop: "bw", name: "bw", embedded: false, exported: false, typ: ptrType$88, tag: ""}, {prop: "handler", name: "handler", embedded: false, exported: false, typ: Handler, tag: ""}, {prop: "baseCtx", name: "baseCtx", embedded: false, exported: false, typ: context.Context, tag: ""}, {prop: "framer", name: "framer", embedded: false, exported: false, typ: ptrType$72, tag: ""}, {prop: "doneServing", name: "doneServing", embedded: false, exported: false, typ: chanType$1, tag: ""}, {prop: "readFrameCh", name: "readFrameCh", embedded: false, exported: false, typ: chanType$11, tag: ""}, {prop: "wantWriteFrameCh", name: "wantWriteFrameCh", embedded: false, exported: false, typ: chanType$12, tag: ""}, {prop: "wroteFrameCh", name: "wroteFrameCh", embedded: false, exported: false, typ: chanType$13, tag: ""}, {prop: "bodyReadCh", name: "bodyReadCh", embedded: false, exported: false, typ: chanType$14, tag: ""}, {prop: "serveMsgCh", name: "serveMsgCh", embedded: false, exported: false, typ: chanType$15, tag: ""}, {prop: "flow", name: "flow", embedded: false, exported: false, typ: http2flow, tag: ""}, {prop: "inflow", name: "inflow", embedded: false, exported: false, typ: http2flow, tag: ""}, {prop: "tlsState", name: "tlsState", embedded: false, exported: false, typ: ptrType$28, tag: ""}, {prop: "remoteAddrStr", name: "remoteAddrStr", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "writeSched", name: "writeSched", embedded: false, exported: false, typ: http2WriteScheduler, tag: ""}, {prop: "serveG", name: "serveG", embedded: false, exported: false, typ: http2goroutineLock, tag: ""}, {prop: "pushEnabled", name: "pushEnabled", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "sawFirstSettings", name: "sawFirstSettings", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "needToSendSettingsAck", name: "needToSendSettingsAck", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "unackedSettings", name: "unackedSettings", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "queuedControlFrames", name: "queuedControlFrames", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "clientMaxStreams", name: "clientMaxStreams", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "advMaxStreams", name: "advMaxStreams", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "curClientStreams", name: "curClientStreams", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "curPushedStreams", name: "curPushedStreams", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "maxClientStreamID", name: "maxClientStreamID", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "maxPushPromiseID", name: "maxPushPromiseID", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "streams", name: "streams", embedded: false, exported: false, typ: mapType$18, tag: ""}, {prop: "initialStreamSendWindowSize", name: "initialStreamSendWindowSize", embedded: false, exported: false, typ: $Int32, tag: ""}, {prop: "maxFrameSize", name: "maxFrameSize", embedded: false, exported: false, typ: $Int32, tag: ""}, {prop: "headerTableSize", name: "headerTableSize", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "peerMaxHeaderListSize", name: "peerMaxHeaderListSize", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "canonHeader", name: "canonHeader", embedded: false, exported: false, typ: mapType$19, tag: ""}, {prop: "writingFrame", name: "writingFrame", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "writingFrameAsync", name: "writingFrameAsync", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "needsFrameFlush", name: "needsFrameFlush", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "inGoAway", name: "inGoAway", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "inFrameScheduleLoop", name: "inFrameScheduleLoop", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "needToSendGoAway", name: "needToSendGoAway", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "goAwayCode", name: "goAwayCode", embedded: false, exported: false, typ: http2ErrCode, tag: ""}, {prop: "shutdownTimer", name: "shutdownTimer", embedded: false, exported: false, typ: ptrType$25, tag: ""}, {prop: "idleTimer", name: "idleTimer", embedded: false, exported: false, typ: ptrType$25, tag: ""}, {prop: "headerWriteBuf", name: "headerWriteBuf", embedded: false, exported: false, typ: bytes.Buffer, tag: ""}, {prop: "hpackEncoder", name: "hpackEncoder", embedded: false, exported: false, typ: ptrType$89, tag: ""}, {prop: "shutdownOnce", name: "shutdownOnce", embedded: false, exported: false, typ: sync.Once, tag: ""}]); http2stream.init("net/http", [{prop: "sc", name: "sc", embedded: false, exported: false, typ: ptrType$13, tag: ""}, {prop: "id", name: "id", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "body", name: "body", embedded: false, exported: false, typ: ptrType$97, tag: ""}, {prop: "cw", name: "cw", embedded: false, exported: false, typ: http2closeWaiter, tag: ""}, {prop: "ctx", name: "ctx", embedded: false, exported: false, typ: context.Context, tag: ""}, {prop: "cancelCtx", name: "cancelCtx", embedded: false, exported: false, typ: funcType, tag: ""}, {prop: "bodyBytes", name: "bodyBytes", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "declBodyBytes", name: "declBodyBytes", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "flow", name: "flow", embedded: false, exported: false, typ: http2flow, tag: ""}, {prop: "inflow", name: "inflow", embedded: false, exported: false, typ: http2flow, tag: ""}, {prop: "state", name: "state", embedded: false, exported: false, typ: http2streamState, tag: ""}, {prop: "resetQueued", name: "resetQueued", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "gotTrailerHeader", name: "gotTrailerHeader", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "wroteHeaders", name: "wroteHeaders", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "writeDeadline", name: "writeDeadline", embedded: false, exported: false, typ: ptrType$25, tag: ""}, {prop: "trailer", name: "trailer", embedded: false, exported: false, typ: Header, tag: ""}, {prop: "reqTrailer", name: "reqTrailer", embedded: false, exported: false, typ: Header, tag: ""}]); http2readFrameResult.init("net/http", [{prop: "f", name: "f", embedded: false, exported: false, typ: http2Frame, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "readMore", name: "readMore", embedded: false, exported: false, typ: funcType, tag: ""}]); http2frameWriteResult.init("net/http", [{prop: "_$0", name: "_", embedded: false, exported: false, typ: http2incomparable, tag: ""}, {prop: "wr", name: "wr", embedded: false, exported: false, typ: http2FrameWriteRequest, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}]); http2requestParam.init("net/http", [{prop: "method", name: "method", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "scheme", name: "scheme", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "authority", name: "authority", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "path", name: "path", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "header", name: "header", embedded: false, exported: false, typ: Header, tag: ""}]); http2bodyReadMsg.init("net/http", [{prop: "st", name: "st", embedded: false, exported: false, typ: ptrType$10, tag: ""}, {prop: "n", name: "n", embedded: false, exported: false, typ: $Int, tag: ""}]); http2requestBody.init("net/http", [{prop: "_$0", name: "_", embedded: false, exported: false, typ: http2incomparable, tag: ""}, {prop: "stream", name: "stream", embedded: false, exported: false, typ: ptrType$10, tag: ""}, {prop: "conn", name: "conn", embedded: false, exported: false, typ: ptrType$13, tag: ""}, {prop: "closed", name: "closed", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "sawEOF", name: "sawEOF", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "pipe", name: "pipe", embedded: false, exported: false, typ: ptrType$97, tag: ""}, {prop: "needsContinue", name: "needsContinue", embedded: false, exported: false, typ: $Bool, tag: ""}]); http2responseWriter.init("net/http", [{prop: "rws", name: "rws", embedded: false, exported: false, typ: ptrType$99, tag: ""}]); http2responseWriterState.init("net/http", [{prop: "stream", name: "stream", embedded: false, exported: false, typ: ptrType$10, tag: ""}, {prop: "req", name: "req", embedded: false, exported: false, typ: ptrType$11, tag: ""}, {prop: "body", name: "body", embedded: false, exported: false, typ: ptrType$12, tag: ""}, {prop: "conn", name: "conn", embedded: false, exported: false, typ: ptrType$13, tag: ""}, {prop: "bw", name: "bw", embedded: false, exported: false, typ: ptrType$14, tag: ""}, {prop: "handlerHeader", name: "handlerHeader", embedded: false, exported: false, typ: Header, tag: ""}, {prop: "snapHeader", name: "snapHeader", embedded: false, exported: false, typ: Header, tag: ""}, {prop: "trailers", name: "trailers", embedded: false, exported: false, typ: sliceType$2, tag: ""}, {prop: "status", name: "status", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "wroteHeader", name: "wroteHeader", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "sentHeader", name: "sentHeader", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "handlerDone", name: "handlerDone", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "dirty", name: "dirty", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "sentContentLen", name: "sentContentLen", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "wroteBytes", name: "wroteBytes", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "closeNotifierMu", name: "closeNotifierMu", embedded: false, exported: false, typ: sync.Mutex, tag: ""}, {prop: "closeNotifierCh", name: "closeNotifierCh", embedded: false, exported: false, typ: chanType$10, tag: ""}]); http2chunkWriter.init("net/http", [{prop: "rws", name: "rws", embedded: false, exported: false, typ: ptrType$99, tag: ""}]); http2startPushRequest.init("net/http", [{prop: "parent", name: "parent", embedded: false, exported: false, typ: ptrType$10, tag: ""}, {prop: "method", name: "method", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "url", name: "url", embedded: false, exported: false, typ: ptrType$17, tag: ""}, {prop: "header", name: "header", embedded: false, exported: false, typ: Header, tag: ""}, {prop: "done", name: "done", embedded: false, exported: false, typ: chanType, tag: ""}]); http2Transport.init("net/http", [{prop: "DialTLS", name: "DialTLS", embedded: false, exported: true, typ: funcType$25, tag: ""}, {prop: "TLSClientConfig", name: "TLSClientConfig", embedded: false, exported: true, typ: ptrType$4, tag: ""}, {prop: "ConnPool", name: "ConnPool", embedded: false, exported: true, typ: http2ClientConnPool, tag: ""}, {prop: "DisableCompression", name: "DisableCompression", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "AllowHTTP", name: "AllowHTTP", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "MaxHeaderListSize", name: "MaxHeaderListSize", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "StrictMaxConcurrentStreams", name: "StrictMaxConcurrentStreams", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "ReadIdleTimeout", name: "ReadIdleTimeout", embedded: false, exported: true, typ: time.Duration, tag: ""}, {prop: "PingTimeout", name: "PingTimeout", embedded: false, exported: true, typ: time.Duration, tag: ""}, {prop: "t1", name: "t1", embedded: false, exported: false, typ: ptrType$27, tag: ""}, {prop: "connPoolOnce", name: "connPoolOnce", embedded: false, exported: false, typ: sync.Once, tag: ""}, {prop: "connPoolOrDef", name: "connPoolOrDef", embedded: false, exported: false, typ: http2ClientConnPool, tag: ""}]); http2ClientConn.init("net/http", [{prop: "t", name: "t", embedded: false, exported: false, typ: ptrType$102, tag: ""}, {prop: "tconn", name: "tconn", embedded: false, exported: false, typ: net.Conn, tag: ""}, {prop: "tlsState", name: "tlsState", embedded: false, exported: false, typ: ptrType$28, tag: ""}, {prop: "reused", name: "reused", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "singleUse", name: "singleUse", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "readerDone", name: "readerDone", embedded: false, exported: false, typ: chanType$1, tag: ""}, {prop: "readerErr", name: "readerErr", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "idleTimeout", name: "idleTimeout", embedded: false, exported: false, typ: time.Duration, tag: ""}, {prop: "idleTimer", name: "idleTimer", embedded: false, exported: false, typ: ptrType$25, tag: ""}, {prop: "mu", name: "mu", embedded: false, exported: false, typ: sync.Mutex, tag: ""}, {prop: "cond", name: "cond", embedded: false, exported: false, typ: ptrType$48, tag: ""}, {prop: "flow", name: "flow", embedded: false, exported: false, typ: http2flow, tag: ""}, {prop: "inflow", name: "inflow", embedded: false, exported: false, typ: http2flow, tag: ""}, {prop: "closing", name: "closing", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "closed", name: "closed", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "wantSettingsAck", name: "wantSettingsAck", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "goAway", name: "goAway", embedded: false, exported: false, typ: ptrType$82, tag: ""}, {prop: "goAwayDebug", name: "goAwayDebug", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "streams", name: "streams", embedded: false, exported: false, typ: mapType$20, tag: ""}, {prop: "nextStreamID", name: "nextStreamID", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "pendingRequests", name: "pendingRequests", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "pings", name: "pings", embedded: false, exported: false, typ: mapType$21, tag: ""}, {prop: "bw", name: "bw", embedded: false, exported: false, typ: ptrType$14, tag: ""}, {prop: "br", name: "br", embedded: false, exported: false, typ: ptrType$29, tag: ""}, {prop: "fr", name: "fr", embedded: false, exported: false, typ: ptrType$72, tag: ""}, {prop: "lastActive", name: "lastActive", embedded: false, exported: false, typ: time.Time, tag: ""}, {prop: "lastIdle", name: "lastIdle", embedded: false, exported: false, typ: time.Time, tag: ""}, {prop: "maxFrameSize", name: "maxFrameSize", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "maxConcurrentStreams", name: "maxConcurrentStreams", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "peerMaxHeaderListSize", name: "peerMaxHeaderListSize", embedded: false, exported: false, typ: $Uint64, tag: ""}, {prop: "initialWindowSize", name: "initialWindowSize", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "hbuf", name: "hbuf", embedded: false, exported: false, typ: bytes.Buffer, tag: ""}, {prop: "henc", name: "henc", embedded: false, exported: false, typ: ptrType$89, tag: ""}, {prop: "freeBuf", name: "freeBuf", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "wmu", name: "wmu", embedded: false, exported: false, typ: sync.Mutex, tag: ""}, {prop: "werr", name: "werr", embedded: false, exported: false, typ: $error, tag: ""}]); http2clientStream.init("net/http", [{prop: "cc", name: "cc", embedded: false, exported: false, typ: ptrType$68, tag: ""}, {prop: "req", name: "req", embedded: false, exported: false, typ: ptrType$11, tag: ""}, {prop: "trace", name: "trace", embedded: false, exported: false, typ: ptrType$19, tag: ""}, {prop: "ID", name: "ID", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "resc", name: "resc", embedded: false, exported: false, typ: chanType$16, tag: ""}, {prop: "bufPipe", name: "bufPipe", embedded: false, exported: false, typ: http2pipe, tag: ""}, {prop: "startedWrite", name: "startedWrite", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "requestedGzip", name: "requestedGzip", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "on100", name: "on100", embedded: false, exported: false, typ: funcType, tag: ""}, {prop: "flow", name: "flow", embedded: false, exported: false, typ: http2flow, tag: ""}, {prop: "inflow", name: "inflow", embedded: false, exported: false, typ: http2flow, tag: ""}, {prop: "bytesRemain", name: "bytesRemain", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "readErr", name: "readErr", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "stopReqBody", name: "stopReqBody", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "didReset", name: "didReset", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "peerReset", name: "peerReset", embedded: false, exported: false, typ: chanType$1, tag: ""}, {prop: "resetErr", name: "resetErr", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "done", name: "done", embedded: false, exported: false, typ: chanType$1, tag: ""}, {prop: "firstByte", name: "firstByte", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "pastHeaders", name: "pastHeaders", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "pastTrailers", name: "pastTrailers", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "num1xx", name: "num1xx", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "trailer", name: "trailer", embedded: false, exported: false, typ: Header, tag: ""}, {prop: "resTrailer", name: "resTrailer", embedded: false, exported: false, typ: ptrType$38, tag: ""}]); http2stickyErrWriter.init("net/http", [{prop: "w", name: "w", embedded: false, exported: false, typ: io.Writer, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: ptrType$85, tag: ""}]); http2noCachedConnError.init("", []); http2RoundTripOpt.init("", [{prop: "OnlyCachedConn", name: "OnlyCachedConn", embedded: false, exported: true, typ: $Bool, tag: ""}]); http2clientConnIdleState.init("net/http", [{prop: "canTakeNewRequest", name: "canTakeNewRequest", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "freshConn", name: "freshConn", embedded: false, exported: false, typ: $Bool, tag: ""}]); http2resAndError.init("net/http", [{prop: "_$0", name: "_", embedded: false, exported: false, typ: http2incomparable, tag: ""}, {prop: "res", name: "res", embedded: false, exported: false, typ: ptrType$18, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}]); http2clientConnReadLoop.init("net/http", [{prop: "_$0", name: "_", embedded: false, exported: false, typ: http2incomparable, tag: ""}, {prop: "cc", name: "cc", embedded: false, exported: false, typ: ptrType$68, tag: ""}, {prop: "closeWhenIdle", name: "closeWhenIdle", embedded: false, exported: false, typ: $Bool, tag: ""}]); http2GoAwayError.init("", [{prop: "LastStreamID", name: "LastStreamID", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "ErrCode", name: "ErrCode", embedded: false, exported: true, typ: http2ErrCode, tag: ""}, {prop: "DebugData", name: "DebugData", embedded: false, exported: true, typ: $String, tag: ""}]); http2transportResponseBody.init("net/http", [{prop: "cs", name: "cs", embedded: false, exported: false, typ: ptrType$104, tag: ""}]); http2erringRoundTripper.init("net/http", [{prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}]); http2gzipReader.init("net/http", [{prop: "_$0", name: "_", embedded: false, exported: false, typ: http2incomparable, tag: ""}, {prop: "body", name: "body", embedded: false, exported: false, typ: io.ReadCloser, tag: ""}, {prop: "zr", name: "zr", embedded: false, exported: false, typ: ptrType$33, tag: ""}, {prop: "zerr", name: "zerr", embedded: false, exported: false, typ: $error, tag: ""}]); http2bodyWriterState.init("net/http", [{prop: "cs", name: "cs", embedded: false, exported: false, typ: ptrType$104, tag: ""}, {prop: "timer", name: "timer", embedded: false, exported: false, typ: ptrType$25, tag: ""}, {prop: "fnonce", name: "fnonce", embedded: false, exported: false, typ: ptrType$105, tag: ""}, {prop: "fn", name: "fn", embedded: false, exported: false, typ: funcType, tag: ""}, {prop: "resc", name: "resc", embedded: false, exported: false, typ: chanType, tag: ""}, {prop: "delay", name: "delay", embedded: false, exported: false, typ: time.Duration, tag: ""}]); http2noDialH2RoundTripper.init("net/http", [{prop: "http2Transport", name: "http2Transport", embedded: true, exported: false, typ: ptrType$102, tag: ""}]); http2writeFramer.init([{prop: "staysWithinBuffer", name: "staysWithinBuffer", pkg: "net/http", typ: $funcType([$Int], [$Bool], false)}, {prop: "writeFrame", name: "writeFrame", pkg: "net/http", typ: $funcType([http2writeContext], [$error], false)}]); http2writeContext.init([{prop: "CloseConn", name: "CloseConn", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Flush", name: "Flush", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Framer", name: "Framer", pkg: "", typ: $funcType([], [ptrType$72], false)}, {prop: "HeaderEncoder", name: "HeaderEncoder", pkg: "", typ: $funcType([], [ptrType$89, ptrType$40], false)}]); http2flushFrameWriter.init("", []); http2writeSettings.init(http2Setting); http2writeGoAway.init("net/http", [{prop: "maxStreamID", name: "maxStreamID", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "code", name: "code", embedded: false, exported: false, typ: http2ErrCode, tag: ""}]); http2writeData.init("net/http", [{prop: "streamID", name: "streamID", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "p", name: "p", embedded: false, exported: false, typ: sliceType$3, tag: ""}, {prop: "endStream", name: "endStream", embedded: false, exported: false, typ: $Bool, tag: ""}]); http2handlerPanicRST.init("", [{prop: "StreamID", name: "StreamID", embedded: false, exported: true, typ: $Uint32, tag: ""}]); http2writePingAck.init("net/http", [{prop: "pf", name: "pf", embedded: false, exported: false, typ: ptrType$81, tag: ""}]); http2writeSettingsAck.init("", []); http2writeResHeaders.init("net/http", [{prop: "streamID", name: "streamID", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "httpResCode", name: "httpResCode", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "h", name: "h", embedded: false, exported: false, typ: Header, tag: ""}, {prop: "trailers", name: "trailers", embedded: false, exported: false, typ: sliceType$2, tag: ""}, {prop: "endStream", name: "endStream", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "date", name: "date", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "contentType", name: "contentType", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "contentLength", name: "contentLength", embedded: false, exported: false, typ: $String, tag: ""}]); http2writePushPromise.init("net/http", [{prop: "streamID", name: "streamID", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "method", name: "method", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "url", name: "url", embedded: false, exported: false, typ: ptrType$17, tag: ""}, {prop: "h", name: "h", embedded: false, exported: false, typ: Header, tag: ""}, {prop: "allocatePromisedID", name: "allocatePromisedID", embedded: false, exported: false, typ: funcType$27, tag: ""}, {prop: "promisedID", name: "promisedID", embedded: false, exported: false, typ: $Uint32, tag: ""}]); http2write100ContinueHeadersFrame.init("net/http", [{prop: "streamID", name: "streamID", embedded: false, exported: false, typ: $Uint32, tag: ""}]); http2writeWindowUpdate.init("net/http", [{prop: "streamID", name: "streamID", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "n", name: "n", embedded: false, exported: false, typ: $Uint32, tag: ""}]); http2WriteScheduler.init([{prop: "AdjustStream", name: "AdjustStream", pkg: "", typ: $funcType([$Uint32, http2PriorityParam], [], false)}, {prop: "CloseStream", name: "CloseStream", pkg: "", typ: $funcType([$Uint32], [], false)}, {prop: "OpenStream", name: "OpenStream", pkg: "", typ: $funcType([$Uint32, http2OpenStreamOptions], [], false)}, {prop: "Pop", name: "Pop", pkg: "", typ: $funcType([], [http2FrameWriteRequest, $Bool], false)}, {prop: "Push", name: "Push", pkg: "", typ: $funcType([http2FrameWriteRequest], [], false)}]); http2OpenStreamOptions.init("", [{prop: "PusherID", name: "PusherID", embedded: false, exported: true, typ: $Uint32, tag: ""}]); http2FrameWriteRequest.init("net/http", [{prop: "write", name: "write", embedded: false, exported: false, typ: http2writeFramer, tag: ""}, {prop: "stream", name: "stream", embedded: false, exported: false, typ: ptrType$10, tag: ""}, {prop: "done", name: "done", embedded: false, exported: false, typ: chanType, tag: ""}]); http2writeQueue.init("net/http", [{prop: "s", name: "s", embedded: false, exported: false, typ: sliceType$24, tag: ""}]); http2writeQueuePool.init(ptrType$106); http2PriorityWriteSchedulerConfig.init("", [{prop: "MaxClosedNodesInTree", name: "MaxClosedNodesInTree", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "MaxIdleNodesInTree", name: "MaxIdleNodesInTree", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "ThrottleOutOfOrderWrites", name: "ThrottleOutOfOrderWrites", embedded: false, exported: true, typ: $Bool, tag: ""}]); http2priorityNode.init("net/http", [{prop: "q", name: "q", embedded: false, exported: false, typ: http2writeQueue, tag: ""}, {prop: "id", name: "id", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "weight", name: "weight", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "state", name: "state", embedded: false, exported: false, typ: http2priorityNodeState, tag: ""}, {prop: "bytes", name: "bytes", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "subtreeBytes", name: "subtreeBytes", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "parent", name: "parent", embedded: false, exported: false, typ: ptrType$107, tag: ""}, {prop: "kids", name: "kids", embedded: false, exported: false, typ: ptrType$107, tag: ""}, {prop: "prev", name: "prev", embedded: false, exported: false, typ: ptrType$107, tag: ""}, {prop: "next", name: "next", embedded: false, exported: false, typ: ptrType$107, tag: ""}]); http2sortPriorityNodeSiblings.init(ptrType$107); http2priorityWriteScheduler.init("net/http", [{prop: "root", name: "root", embedded: false, exported: false, typ: http2priorityNode, tag: ""}, {prop: "nodes", name: "nodes", embedded: false, exported: false, typ: mapType$22, tag: ""}, {prop: "maxID", name: "maxID", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "closedNodes", name: "closedNodes", embedded: false, exported: false, typ: sliceType$25, tag: ""}, {prop: "idleNodes", name: "idleNodes", embedded: false, exported: false, typ: sliceType$25, tag: ""}, {prop: "maxClosedNodesInTree", name: "maxClosedNodesInTree", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "maxIdleNodesInTree", name: "maxIdleNodesInTree", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "writeThrottleLimit", name: "writeThrottleLimit", embedded: false, exported: false, typ: $Int32, tag: ""}, {prop: "enableWriteThrottle", name: "enableWriteThrottle", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "tmp", name: "tmp", embedded: false, exported: false, typ: sliceType$25, tag: ""}, {prop: "queuePool", name: "queuePool", embedded: false, exported: false, typ: http2writeQueuePool, tag: ""}]); http2randomWriteScheduler.init("net/http", [{prop: "zero", name: "zero", embedded: false, exported: false, typ: http2writeQueue, tag: ""}, {prop: "sq", name: "sq", embedded: false, exported: false, typ: mapType$23, tag: ""}, {prop: "queuePool", name: "queuePool", embedded: false, exported: false, typ: http2writeQueuePool, tag: ""}]); noTransport.init("", []); XHRTransport.init("net/http", [{prop: "inflight", name: "inflight", embedded: false, exported: false, typ: mapType$24, tag: ""}]); streamReader.init("net/http", [{prop: "pending", name: "pending", embedded: false, exported: false, typ: sliceType$3, tag: ""}, {prop: "stream", name: "stream", embedded: false, exported: false, typ: ptrType$110, tag: ""}]); fetchTransport.init("", []); Cookie.init("", [{prop: "Name", name: "Name", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Value", name: "Value", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Path", name: "Path", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Domain", name: "Domain", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Expires", name: "Expires", embedded: false, exported: true, typ: time.Time, tag: ""}, {prop: "RawExpires", name: "RawExpires", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "MaxAge", name: "MaxAge", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Secure", name: "Secure", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "HttpOnly", name: "HttpOnly", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "SameSite", name: "SameSite", embedded: false, exported: true, typ: SameSite, tag: ""}, {prop: "Raw", name: "Raw", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Unparsed", name: "Unparsed", embedded: false, exported: true, typ: sliceType$2, tag: ""}]); Client.init("", [{prop: "Transport", name: "Transport", embedded: false, exported: true, typ: RoundTripper, tag: ""}, {prop: "CheckRedirect", name: "CheckRedirect", embedded: false, exported: true, typ: funcType$30, tag: ""}, {prop: "Jar", name: "Jar", embedded: false, exported: true, typ: CookieJar, tag: ""}, {prop: "Timeout", name: "Timeout", embedded: false, exported: true, typ: time.Duration, tag: ""}]); RoundTripper.init([{prop: "RoundTrip", name: "RoundTrip", pkg: "", typ: $funcType([ptrType$11], [ptrType$18, $error], false)}]); cancelTimerBody.init("net/http", [{prop: "stop", name: "stop", embedded: false, exported: false, typ: funcType, tag: ""}, {prop: "rc", name: "rc", embedded: false, exported: false, typ: io.ReadCloser, tag: ""}, {prop: "reqDidTimeout", name: "reqDidTimeout", embedded: false, exported: false, typ: funcType$11, tag: ""}]); requestTooLarger.init([{prop: "requestTooLarge", name: "requestTooLarge", pkg: "net/http", typ: $funcType([], [], false)}]); baseContexter.init([{prop: "BaseContext", name: "BaseContext", pkg: "", typ: $funcType([], [context.Context], false)}]); I.init([{prop: "doKeepAlives", name: "doKeepAlives", pkg: "net/http", typ: $funcType([], [$Bool], false)}]); canceler.init([{prop: "CancelRequest", name: "CancelRequest", pkg: "", typ: $funcType([ptrType$11], [], false)}]); closeIdler.init([{prop: "CloseIdleConnections", name: "CloseIdleConnections", pkg: "", typ: $funcType([], [], 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 = bufio.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = bytes.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = gzip.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = list.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = context.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = rand$1.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = tls.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = base64.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = binary.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = errors.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = fmt.$init(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = js.$init(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = io.$init(); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = fs.$init(); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = ioutil.$init(); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = log.$init(); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = math.$init(); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = rand.$init(); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = mime.$init(); /* */ $s = 19; case 19: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = multipart.$init(); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = net.$init(); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = httptrace.$init(); /* */ $s = 22; case 22: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = internal.$init(); /* */ $s = 23; case 23: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = ascii.$init(); /* */ $s = 24; case 24: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = textproto.$init(); /* */ $s = 25; case 25: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = url.$init(); /* */ $s = 26; case 26: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = os.$init(); /* */ $s = 27; case 27: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = path.$init(); /* */ $s = 28; case 28: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = filepath.$init(); /* */ $s = 29; case 29: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = reflect.$init(); /* */ $s = 30; case 30: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = runtime.$init(); /* */ $s = 31; case 31: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sort.$init(); /* */ $s = 32; case 32: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strconv.$init(); /* */ $s = 33; case 33: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strings.$init(); /* */ $s = 34; case 34: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sync.$init(); /* */ $s = 35; case 35: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = atomic.$init(); /* */ $s = 36; case 36: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = time.$init(); /* */ $s = 37; case 37: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = utf8.$init(); /* */ $s = 38; case 38: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = httpguts.$init(); /* */ $s = 39; case 39: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = httpproxy.$init(); /* */ $s = 40; case 40: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = hpack.$init(); /* */ $s = 41; case 41: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = idna.$init(); /* */ $s = 42; case 42: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } zeroDialer = new net.Dialer.ptr(new time.Duration(0, 0), new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil), $ifaceNil, false, new time.Duration(0, 0), new time.Duration(0, 0), ptrType$1.nil, $chanNil, $throwNilPointerError); bufioReaderPool = new sync.Pool.ptr(sliceType.nil, $throwNilPointerError); bufioWriter2kPool = new sync.Pool.ptr(sliceType.nil, $throwNilPointerError); bufioWriter4kPool = new sync.Pool.ptr(sliceType.nil, $throwNilPointerError); defaultServeMux = new ServeMux.ptr(new sync.RWMutex.ptr(new sync.Mutex.ptr(0, 0), 0, 0, 0, 0), false, sliceType$1.nil, false); testHookServerServe = $throwNilPointerError; uniqNameMu = new sync.Mutex.ptr(0, 0); textprotoReaderPool = new sync.Pool.ptr(sliceType.nil, $throwNilPointerError); omitBundledHTTP2 = false; http2commonBuildOnce = new sync.Once.ptr(0, new sync.Mutex.ptr(0, 0)); http2commonLowerHeader = false; http2commonCanonHeader = false; http2VerboseLogs = false; http2logFrameWrites = false; http2logFrameReads = false; http2inTests = false; http2testHookOnConn = $throwNilPointerError; http2testHookGetServerConn = $throwNilPointerError; http2testHookOnPanicMu = ptrType$2.nil; http2testHookOnPanic = $throwNilPointerError; http2got1xxFuncForTests = $throwNilPointerError; testHookClientDoResult = $throwNilPointerError; errCannotRewind = errors.New("net/http: cannot rewind body after connection loss"); $pkg.ErrSkipAltProtocol = errors.New("net/http: skip alternate protocol"); errKeepAlivesDisabled = errors.New("http: putIdleConn: keep alives disabled"); errConnBroken = errors.New("http: putIdleConn: connection is in bad state"); errCloseIdle = errors.New("http: putIdleConn: CloseIdleConnections was called"); errTooManyIdle = errors.New("http: putIdleConn: too many idle connections"); errTooManyIdleHost = errors.New("http: putIdleConn: too many idle connections for host"); errCloseIdleConns = errors.New("http: CloseIdleConnections called"); errReadLoopExiting = errors.New("http: persistConn.readLoop exiting"); errIdleConnTimeout = errors.New("http: idle connection timeout"); errServerClosedIdle = errors.New("http: server closed idle connection"); errCallerOwnsConn = errors.New("read loop ending; caller owns writable underlying conn"); errTimeout = new httpError.ptr("net/http: timeout awaiting response headers", true); errRequestCanceledConn = errors.New("net/http: request canceled while waiting for connection"); testHookEnterRoundTrip = nop; testHookWaitResLoop = nop; testHookRoundTripRetried = nop; testHookPrePendingDial = nop; testHookPostPendingDial = nop; testHookMu = (x = new fakeLocker.ptr(), new x.constructor.elem(x)); testHookReadLoopBeforeNextRead = nop; portMap = $makeMap($String.keyFor, [{ k: "http", v: "80" }, { k: "https", v: "443" }, { k: "socks5", v: "1080" }]); errReadOnClosedResBody = errors.New("http: read on closed response body"); suppressedHeaders304 = new sliceType$2(["Content-Type", "Content-Length", "Transfer-Encoding"]); suppressedHeadersNoBody = new sliceType$2(["Content-Length", "Transfer-Encoding"]); $pkg.ErrBodyReadAfterClose = errors.New("http: invalid Read on closed Body"); singleCRLF = (new sliceType$3($stringToBytes("\r\n"))); doubleCRLF = (new sliceType$3($stringToBytes("\r\n\r\n"))); errTrailerEOF = errors.New("http: unexpected EOF reading trailer"); nopCloserType = reflect.TypeOf(io.NopCloser($ifaceNil)); statusText = $makeMap($Int.keyFor, [{ k: 100, v: "Continue" }, { k: 101, v: "Switching Protocols" }, { k: 102, v: "Processing" }, { k: 103, v: "Early Hints" }, { k: 200, v: "OK" }, { k: 201, v: "Created" }, { k: 202, v: "Accepted" }, { k: 203, v: "Non-Authoritative Information" }, { k: 204, v: "No Content" }, { k: 205, v: "Reset Content" }, { k: 206, v: "Partial Content" }, { k: 207, v: "Multi-Status" }, { k: 208, v: "Already Reported" }, { k: 226, v: "IM Used" }, { k: 300, v: "Multiple Choices" }, { k: 301, v: "Moved Permanently" }, { k: 302, v: "Found" }, { k: 303, v: "See Other" }, { k: 304, v: "Not Modified" }, { k: 305, v: "Use Proxy" }, { k: 307, v: "Temporary Redirect" }, { k: 308, v: "Permanent Redirect" }, { k: 400, v: "Bad Request" }, { k: 401, v: "Unauthorized" }, { k: 402, v: "Payment Required" }, { k: 403, v: "Forbidden" }, { k: 404, v: "Not Found" }, { k: 405, v: "Method Not Allowed" }, { k: 406, v: "Not Acceptable" }, { k: 407, v: "Proxy Authentication Required" }, { k: 408, v: "Request Timeout" }, { k: 409, v: "Conflict" }, { k: 410, v: "Gone" }, { k: 411, v: "Length Required" }, { k: 412, v: "Precondition Failed" }, { k: 413, v: "Request Entity Too Large" }, { k: 414, v: "Request URI Too Long" }, { k: 415, v: "Unsupported Media Type" }, { k: 416, v: "Requested Range Not Satisfiable" }, { k: 417, v: "Expectation Failed" }, { k: 418, v: "I'm a teapot" }, { k: 421, v: "Misdirected Request" }, { k: 422, v: "Unprocessable Entity" }, { k: 423, v: "Locked" }, { k: 424, v: "Failed Dependency" }, { k: 425, v: "Too Early" }, { k: 426, v: "Upgrade Required" }, { k: 428, v: "Precondition Required" }, { k: 429, v: "Too Many Requests" }, { k: 431, v: "Request Header Fields Too Large" }, { k: 451, v: "Unavailable For Legal Reasons" }, { k: 500, v: "Internal Server Error" }, { k: 501, v: "Not Implemented" }, { k: 502, v: "Bad Gateway" }, { k: 503, v: "Service Unavailable" }, { k: 504, v: "Gateway Timeout" }, { k: 505, v: "HTTP Version Not Supported" }, { k: 506, v: "Variant Also Negotiates" }, { k: 507, v: "Insufficient Storage" }, { k: 508, v: "Loop Detected" }, { k: 510, v: "Not Extended" }, { k: 511, v: "Network Authentication Required" }]); socksnoDeadline = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil); socksaLongTimeAgo = $clone(time.Unix(new $Int64(0, 1), new $Int64(0, 0)), time.Time); sniffSignatures = new sliceType$4([(new htmlSig($stringToBytes("", ">", "\"", """, "'", "'"])); $pkg.DefaultServeMux = defaultServeMux; stateName = $makeMap(ConnState.keyFor, [{ k: 0, v: "new" }, { k: 1, v: "active" }, { k: 2, v: "idle" }, { k: 3, v: "hijacked" }, { k: 4, v: "closed" }]); silenceSemWarnContextKey = new contextKey.ptr("silence-semicolons"); $pkg.ErrServerClosed = errors.New("http: Server closed"); $pkg.ErrHandlerTimeout = errors.New("http: Handler timeout"); uniqNameNext = {}; respExcludeHeader = $makeMap($String.keyFor, [{ k: "Content-Length", v: true }, { k: "Transfer-Encoding", v: true }, { k: "Trailer", v: true }]); $pkg.ErrNoLocation = errors.New("http: no Location header in response"); $pkg.ErrMissingFile = errors.New("http: no such file"); $pkg.ErrNotSupported = new ProtocolError.ptr("feature not supported"); $pkg.ErrMissingBoundary = new ProtocolError.ptr("no multipart boundary param in Content-Type"); $pkg.ErrNotMultipart = new ProtocolError.ptr("request Content-Type isn't multipart/form-data"); reqWriteExcludeHeader = $makeMap($String.keyFor, [{ k: "Host", v: true }, { k: "User-Agent", v: true }, { k: "Content-Length", v: true }, { k: "Transfer-Encoding", v: true }, { k: "Trailer", v: true }]); $pkg.ErrNoCookie = errors.New("http: named cookie not present"); multipartByReader = new multipart.Form.ptr({}, {}); errMissingHost = errors.New("http: Request.Write on Request with no Host or URL set"); aLongTimeAgo = $clone(time.Unix(new $Int64(0, 1), new $Int64(0, 0)), time.Time); $pkg.NoBody = new noBody.ptr(); headerNewlineToSpace = strings.NewReplacer(new sliceType$2(["\n", " ", "\r", " "])); headerSorterPool = new sync.Pool.ptr(sliceType.nil, (function() { return new headerSorter.ptr(sliceType$6.nil); })); http2dataChunkSizeClasses = new sliceType$7([1024, 2048, 4096, 8192, 16384]); http2dataChunkPools = $toNativeArray($kindStruct, [new sync.Pool.ptr(sliceType.nil, (function() { return $makeSlice(sliceType$3, 1024); })), new sync.Pool.ptr(sliceType.nil, (function() { return $makeSlice(sliceType$3, 2048); })), new sync.Pool.ptr(sliceType.nil, (function() { return $makeSlice(sliceType$3, 4096); })), new sync.Pool.ptr(sliceType.nil, (function() { return $makeSlice(sliceType$3, 8192); })), new sync.Pool.ptr(sliceType.nil, (function() { return $makeSlice(sliceType$3, 16384); }))]); http2errReadEmpty = errors.New("read from empty dataBuffer"); http2errCodeName = $makeMap(http2ErrCode.keyFor, [{ k: 0, v: "NO_ERROR" }, { k: 1, v: "PROTOCOL_ERROR" }, { k: 2, v: "INTERNAL_ERROR" }, { k: 3, v: "FLOW_CONTROL_ERROR" }, { k: 4, v: "SETTINGS_TIMEOUT" }, { k: 5, v: "STREAM_CLOSED" }, { k: 6, v: "FRAME_SIZE_ERROR" }, { k: 7, v: "REFUSED_STREAM" }, { k: 8, v: "CANCEL" }, { k: 9, v: "COMPRESSION_ERROR" }, { k: 10, v: "CONNECT_ERROR" }, { k: 11, v: "ENHANCE_YOUR_CALM" }, { k: 12, v: "INADEQUATE_SECURITY" }, { k: 13, v: "HTTP_1_1_REQUIRED" }]); http2errMixPseudoHeaderTypes = errors.New("mix of request and response pseudo headers"); http2errPseudoAfterRegular = errors.New("pseudo header field after regular"); http2padZeros = $makeSlice(sliceType$3, 255); http2frameName = $makeMap(http2FrameType.keyFor, [{ k: 0, v: "DATA" }, { k: 1, v: "HEADERS" }, { k: 2, v: "PRIORITY" }, { k: 3, v: "RST_STREAM" }, { k: 4, v: "SETTINGS" }, { k: 5, v: "PUSH_PROMISE" }, { k: 6, v: "PING" }, { k: 7, v: "GOAWAY" }, { k: 8, v: "WINDOW_UPDATE" }, { k: 9, v: "CONTINUATION" }]); http2flagName = $makeMap(http2FrameType.keyFor, [{ k: 0, v: $makeMap(http2Flags.keyFor, [{ k: 1, v: "END_STREAM" }, { k: 8, v: "PADDED" }]) }, { k: 1, v: $makeMap(http2Flags.keyFor, [{ k: 1, v: "END_STREAM" }, { k: 4, v: "END_HEADERS" }, { k: 8, v: "PADDED" }, { k: 32, v: "PRIORITY" }]) }, { k: 4, v: $makeMap(http2Flags.keyFor, [{ k: 1, v: "ACK" }]) }, { k: 6, v: $makeMap(http2Flags.keyFor, [{ k: 1, v: "ACK" }]) }, { k: 9, v: $makeMap(http2Flags.keyFor, [{ k: 4, v: "END_HEADERS" }]) }, { k: 5, v: $makeMap(http2Flags.keyFor, [{ k: 4, v: "END_HEADERS" }, { k: 8, v: "PADDED" }]) }]); http2fhBytes = new sync.Pool.ptr(sliceType.nil, (function() { var buf, buf$24ptr; buf = $makeSlice(sliceType$3, 9); return (buf$24ptr || (buf$24ptr = new ptrType$6(function() { return buf; }, function($v) { buf = $convertSliceType($v, sliceType$3); }))); })); http2ErrFrameTooLarge = errors.New("http2: frame too large"); http2errStreamID = errors.New("invalid stream ID"); http2errDepStreamID = errors.New("invalid dependent stream ID"); http2errPadLength = errors.New("pad length too large"); http2errPadBytes = errors.New("padding bytes must all be zeros unless AllowIllegalWrites is enabled"); _r = os.Getenv("DEBUG_HTTP2_GOROUTINES"); /* */ $s = 43; case 43: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } http2DebugGoroutines = _r === "1"; http2goroutineSpace = (new sliceType$3($stringToBytes("goroutine "))); http2littleBuf = new sync.Pool.ptr(sliceType.nil, (function() { var buf, buf$24ptr; buf = $makeSlice(sliceType$3, 64); return (buf$24ptr || (buf$24ptr = new ptrType$6(function() { return buf; }, function($v) { buf = $convertSliceType($v, sliceType$3); }))); })); http2clientPreface = (new sliceType$3($stringToBytes("PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"))); http2stateName = $toNativeArray($kindString, ["Idle", "Open", "HalfClosedLocal", "HalfClosedRemote", "Closed"]); http2frameParsers = $makeMap(http2FrameType.keyFor, [{ k: 0, v: http2parseDataFrame }, { k: 1, v: http2parseHeadersFrame }, { k: 2, v: http2parsePriorityFrame }, { k: 3, v: http2parseRSTStreamFrame }, { k: 4, v: http2parseSettingsFrame }, { k: 5, v: http2parsePushPromise }, { k: 6, v: http2parsePingFrame }, { k: 7, v: http2parseGoAwayFrame }, { k: 8, v: http2parseWindowUpdateFrame }, { k: 9, v: http2parseContinuationFrame }]); http2settingName = $makeMap(http2SettingID.keyFor, [{ k: 1, v: "HEADER_TABLE_SIZE" }, { k: 2, v: "ENABLE_PUSH" }, { k: 3, v: "MAX_CONCURRENT_STREAMS" }, { k: 4, v: "INITIAL_WINDOW_SIZE" }, { k: 5, v: "MAX_FRAME_SIZE" }, { k: 6, v: "MAX_HEADER_LIST_SIZE" }]); http2bufWriterPool = new sync.Pool.ptr(sliceType.nil, (function() { return bufio.NewWriterSize($ifaceNil, 4096); })); http2errTimeout = new http2httpError.ptr(arrayType.zero(), "http2: timeout awaiting response headers", true); http2sorterPool = new sync.Pool.ptr(sliceType.nil, (function() { return new http2sorter.ptr(sliceType$2.nil); })); http2errClosedPipeWrite = errors.New("write on closed buffer"); http2errClientDisconnected = errors.New("client disconnected"); http2errClosedBody = errors.New("body closed by handler"); http2errHandlerComplete = errors.New("http2: request body closed due to handler exiting"); http2errStreamClosed = errors.New("http2: stream closed"); http2responseWriterStatePool = new sync.Pool.ptr(sliceType.nil, (function() { var rws, x$4; rws = new http2responseWriterState.ptr(ptrType$10.nil, ptrType$11.nil, ptrType$12.nil, ptrType$13.nil, ptrType$14.nil, false, false, sliceType$2.nil, 0, false, false, false, false, new $Int64(0, 0), new $Int64(0, 0), new sync.Mutex.ptr(0, 0), $chanNil); rws.bw = bufio.NewWriterSize((x$4 = new http2chunkWriter.ptr(rws), new x$4.constructor.elem(x$4)), 4096); return rws; })); http2settingsTimerMsg = $newDataPointer(0, ptrType$15); http2idleTimerMsg = $newDataPointer(0, ptrType$15); http2shutdownTimerMsg = $newDataPointer(0, ptrType$15); http2gracefulShutdownMsg = $newDataPointer(0, ptrType$15); http2errPrefaceTimeout = errors.New("timeout waiting for client preface"); http2errChanPool = new sync.Pool.ptr(sliceType.nil, (function() { return new chanType(new $Chan($error, 1)); })); http2writeDataPool = new sync.Pool.ptr(sliceType.nil, (function() { return new http2writeData.ptr(0, sliceType$3.nil, false); })); http2errHandlerPanicked = errors.New("http2: handler panicked"); http2goAwayTimeout = new time.Duration(0, 1000000000); http2ErrRecursivePush = errors.New("http2: recursive push not allowed"); http2ErrPushLimitReached = errors.New("http2: push would exceed peer's SETTINGS_MAX_CONCURRENT_STREAMS"); http2connHeaders = new sliceType$2(["Connection", "Keep-Alive", "Proxy-Connection", "Transfer-Encoding", "Upgrade"]); http2ErrNoCachedConn = (x$4 = new http2noCachedConnError.ptr(), new x$4.constructor.elem(x$4)); http2errClientConnClosed = errors.New("http2: client conn is closed"); http2errClientConnUnusable = errors.New("http2: client conn not usable"); http2errClientConnGotGoAway = errors.New("http2: Transport received Server's graceful shutdown GOAWAY"); http2shutdownEnterWaitStateHook = (function() { }); http2errRequestCanceled = errors.New("net/http: request canceled"); errRequestCanceled = http2errRequestCanceled; http2errStopReqBodyWrite = errors.New("http2: aborting request body write"); http2errStopReqBodyWriteAndCancel = errors.New("http2: canceling request"); http2errReqBodyTooLong = errors.New("http2: request body larger than specified content length"); http2errClosedResponseBody = errors.New("http2: response body closed"); http2errResponseHeaderListSize = errors.New("http2: response header list larger than advertised limit"); http2errRequestHeaderListSize = errors.New("http2: request header list larger than peer's advertised limit"); http2noBody = ioutil.NopCloser(bytes.NewReader(sliceType$3.nil)); $pkg.DefaultTransport = (function() { var x$5; if (!($global.fetch === undefined) && !($global.ReadableStream === undefined)) { return new fetchTransport.ptr(); } else if (!($global.XMLHttpRequest === undefined)) { return new XHRTransport.ptr(false); } else { return (x$5 = new noTransport.ptr(), new x$5.constructor.elem(x$5)); } })(); errSeeker = errors.New("seeker can't seek"); errNoOverlap = errors.New("invalid range: failed to overlap"); unixEpochTime = $clone(time.Unix(new $Int64(0, 0), new $Int64(0, 0)), time.Time); errMissingSeek = errors.New("io.File missing Seek method"); errMissingReadDir = errors.New("io.File directory missing ReadDir method"); cookieNameSanitizer = strings.NewReplacer(new sliceType$2(["\n", "-", "\r", "-"])); $pkg.DefaultClient = new Client.ptr($ifaceNil, $throwNilPointerError, $ifaceNil, new time.Duration(0, 0)); $pkg.ErrUseLastResponse = errors.New("net/http: use last response"); $r = init(); /* */ $s = 44; case 44: 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/StackExchange/dnscontrol/v4/docs/flattener"] = (function() { var $pkg = {}, $init, json, fmt, spflib, jquery, http, strings, gResolver, gResp, ptrType, structType, sliceType, sliceType$1, funcType, funcType$1, sliceType$2, jq, parsed, domain, resolver, main, updateDisabledChecks, renderResults, buildHTML, genRoot, genPart; json = $packages["encoding/json"]; fmt = $packages["fmt"]; spflib = $packages["github.com/StackExchange/dnscontrol/v4/pkg/spflib"]; jquery = $packages["github.com/gopherjs/jquery"]; http = $packages["net/http"]; strings = $packages["strings"]; gResolver = $pkg.gResolver = $newType(0, $kindStruct, "main.gResolver", true, "github.com/StackExchange/dnscontrol/v4/docs/flattener", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); gResp = $pkg.gResp = $newType(0, $kindStruct, "main.gResp", true, "github.com/StackExchange/dnscontrol/v4/docs/flattener", false, function(Status_, Answer_) { this.$val = this; if (arguments.length === 0) { this.Status = 0; this.Answer = sliceType.nil; return; } this.Status = Status_; this.Answer = Answer_; }); ptrType = $ptrType(spflib.SPFRecord); structType = $structType("", [{prop: "Data", name: "Data", embedded: false, exported: true, typ: $String, tag: "json:\"data\""}]); sliceType = $sliceType(structType); sliceType$1 = $sliceType($emptyInterface); funcType = $funcType([], [], false); funcType$1 = $funcType([jquery.Event], [], false); sliceType$2 = $sliceType($String); gResolver.ptr.prototype.GetSPF = function(fqdn) { var $24r, $24r$1, $24r$2, $24r$3, _i, _r, _r$1, _r$2, _r$3, _ref, _tuple, a, dat, dec, err, fqdn, g, resp, val, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; $24r$1 = $f.$24r$1; $24r$2 = $f.$24r$2; $24r$3 = $f.$24r$3; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; _tuple = $f._tuple; a = $f.a; dat = $f.dat; dec = $f.dec; err = $f.err; fqdn = $f.fqdn; g = $f.g; resp = $f.resp; val = $f.val; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred); g = this; _r = http.Get("https://dns.google.com/resolve?type=txt&name=" + fqdn); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; resp = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $24r = ["", err]; $s = 4; case 4: return $24r; /* } */ case 3: $deferred.push([$methodVal(resp.Body, "Close"), []]); dec = json.NewDecoder(resp.Body); dat = new gResp.ptr(0, sliceType.nil); _r$1 = dec.Decode(dat); /* */ $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))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 6: $24r$1 = ["", err]; $s = 8; case 8: return $24r$1; /* } */ case 7: _ref = dat.Answer; _i = 0; /* while (true) { */ case 9: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 10; continue; } a = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), structType); _r$2 = strings.Trim(a.Data, "\""); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } val = _r$2; /* */ if (strings.HasPrefix(val, "v=spf1 ")) { $s = 12; continue; } /* */ $s = 13; continue; /* if (strings.HasPrefix(val, "v=spf1 ")) { */ case 12: $24r$2 = [val, $ifaceNil]; $s = 14; case 14: return $24r$2; /* } */ case 13: _i++; $s = 9; continue; case 10: _r$3 = fmt.Errorf("No spf records found", new sliceType$1([])); /* */ $s = 15; case 15: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $24r$3 = ["", _r$3]; $s = 16; case 16: return $24r$3; /* */ } return; } } catch(err) { $err = err; $s = -1; return ["", $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: gResolver.ptr.prototype.GetSPF }; } $f.$24r = $24r; $f.$24r$1 = $24r$1; $f.$24r$2 = $24r$2; $f.$24r$3 = $24r$3; $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._tuple = _tuple; $f.a = a; $f.dat = dat; $f.dec = dec; $f.err = err; $f.fqdn = fqdn; $f.g = g; $f.resp = resp; $f.val = val; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; gResolver.prototype.GetSPF = function(fqdn) { return this.$val.GetSPF(fqdn); }; main = function() { var _r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = jq(new sliceType$1([new funcType((function $b() { var _r, _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = jq(new sliceType$1([new $String("#lookup_btn")])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = $clone(_r, jquery.JQuery).On(new sliceType$1([new $String("click"), new funcType$1((function(e) { var e; $go((function $b() { var _r$1, _r$10, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, err, text, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$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; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; err = $f.err; text = $f.text; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = jq(new sliceType$1([new $String("#domain")])); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = $clone(_r$1, jquery.JQuery).Val(); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } domain = _r$2; _r$3 = $clone(resolver, gResolver).GetSPF(domain); /* */ $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; text = _tuple[0]; err = _tuple[1]; _r$4 = fmt.Println(new sliceType$1([new $String(text)])); /* */ $s = 4; case 4: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; if (!($interfaceIsEqual(err, $ifaceNil))) { $panic(err); } _r$5 = spflib.Parse(text, new resolver.constructor.elem(resolver)); /* */ $s = 5; case 5: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$1 = _r$5; parsed = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $panic(err); } _r$6 = jq(new sliceType$1([new $String("#results")])); /* */ $s = 6; case 6: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$7 = buildHTML(parsed, domain); /* */ $s = 7; case 7: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$8 = $clone(_r$6, jquery.JQuery).SetHtml(new $String(_r$7)); /* */ $s = 8; case 8: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$8; _r$9 = jq(new sliceType$1([new $String(".cb")])); /* */ $s = 9; case 9: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$10 = $clone(_r$9, jquery.JQuery).On(new sliceType$1([new $String("change"), new funcType$1((function $b(e$1) { var e$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; e$1 = $f.e$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = updateDisabledChecks(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = renderResults(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.e$1 = e$1; $f.$s = $s; $f.$r = $r; return $f; }))])); /* */ $s = 10; case 10: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; $r = updateDisabledChecks(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = renderResults(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$1 = _r$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._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.err = err; $f.text = text; $f.$s = $s; $f.$r = $r; return $f; }), []); }))])); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r = _r; $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }))])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: main }; } $f._r = _r; $f.$s = $s; $f.$r = $r; return $f; }; updateDisabledChecks = function() { var _r, _r$1, _r$2, _r$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = jq(new sliceType$1([new $String("input:checkbox")])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = $clone(_r, jquery.JQuery).Each((function $b(i, el) { var _r$1, _r$2, _r$3, _r$4, _r$5, el, i, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _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; el = $f.el; i = $f.i; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = jq(new sliceType$1([el])); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = $clone(_r$1, jquery.JQuery).Prop("disabled"); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = fmt.Println(new sliceType$1([_r$2])); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _r$4 = jq(new sliceType$1([el])); /* */ $s = 4; case 4: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = $clone(_r$4, jquery.JQuery).SetProp(new sliceType$1([new $String("disabled"), new $Bool(false)])); /* */ $s = 5; case 5: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $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.el = el; $f.i = i; $f.$s = $s; $f.$r = $r; return $f; })); /* */ $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$2 = jq(new sliceType$1([new $String("input:checkbox:not(:checked)")])); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = $clone(_r$2, jquery.JQuery).Each((function $b(i, el) { var _r$10, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, el, i, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$10 = $f._r$10; _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; el = $f.el; i = $f.i; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$3 = jq(new sliceType$1([el])); /* */ $s = 1; case 1: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = $clone(_r$3, jquery.JQuery).Attr("id"); /* */ $s = 2; case 2: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = fmt.Println(new sliceType$1([new $String(_r$4)])); /* */ $s = 3; case 3: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; _r$6 = jq(new sliceType$1([el])); /* */ $s = 4; case 4: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$7 = $clone(_r$6, jquery.JQuery).Next(sliceType$1.nil); /* */ $s = 5; case 5: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$8 = $clone(_r$7, jquery.JQuery).Next(sliceType$1.nil); /* */ $s = 6; case 6: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$9 = $clone(_r$8, jquery.JQuery).Find(new sliceType$1([new $String("input:checkbox")])); /* */ $s = 7; case 7: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$10 = $clone(_r$9, jquery.JQuery).Each((function $b(i$1, el$1) { var _arg, _r$10, _r$11, _r$12, _r$13, _r$14, el$1, i$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _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; el$1 = $f.el$1; i$1 = $f.i$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$10 = jq(new sliceType$1([el$1])); /* */ $s = 1; case 1: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$11 = $clone(_r$10, jquery.JQuery).Attr("id"); /* */ $s = 2; case 2: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _arg = new $String(_r$11); _r$12 = fmt.Println(new sliceType$1([new $String("^^"), _arg])); /* */ $s = 3; case 3: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _r$12; _r$13 = jq(new sliceType$1([el$1])); /* */ $s = 4; case 4: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _r$14 = $clone(_r$13, jquery.JQuery).SetProp(new sliceType$1([new $String("disabled"), new $Bool(true)])); /* */ $s = 5; case 5: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _r$14; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._arg = _arg; $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.el$1 = el$1; $f.i$1 = i$1; $f.$s = $s; $f.$r = $r; return $f; })); /* */ $s = 8; case 8: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$10 = _r$10; $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.el = el; $f.i = i; $f.$s = $s; $f.$r = $r; return $f; })); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: updateDisabledChecks }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.$s = $s; $f.$r = $r; return $f; }; renderResults = function() { var _r, _r$1, _r$2, _r$3, addFlattened, content, filters, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; addFlattened = $f.addFlattened; content = $f.content; filters = $f.filters; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: content = [content]; filters = [filters]; content[0] = ""; addFlattened = (function(content, filters) { return function $b(mode, filter) { var _entry, _i, _keys, _r, _r$1, _r$2, _r$3, _ref, filter, flat, k, lookups, mode, split, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _i = $f._i; _keys = $f._keys; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; filter = $f.filter; flat = $f.flat; k = $f.k; lookups = $f.lookups; mode = $f.mode; split = $f.split; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: flat = parsed.Flatten(filter); lookups = 0; if (!(filter === "*")) { lookups = parsed.Lookups() - strings.Split(filter, ",").$length >> 0; } _r = fmt.Sprintf("\n

%s flattened (length %d, %d lookups)

%s\t\n", new sliceType$1([new $String(mode), new $Int(flat.TXT().length), new $Int(lookups), new $String(flat.TXT())])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } content[0] = content[0] + (_r); _r$1 = flat.TXTSplit("_spf%d." + domain, 0, 255); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } split = _r$1; /* */ if ($keys(split).length > 1) { $s = 3; continue; } /* */ $s = 4; continue; /* if ($keys(split).length > 1) { */ case 3: lookups = lookups + (($keys(split).length - 1 >> 0)) >> 0; _r$2 = fmt.Sprintf("

%s flattened split (%d lookups)

", new sliceType$1([new $String(mode), new $Int(lookups)])); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } content[0] = content[0] + (_r$2); _ref = split; _i = 0; _keys = $keys(_ref); /* while (true) { */ case 6: /* if (!(_i < _keys.length)) { break; } */ if(!(_i < _keys.length)) { $s = 7; continue; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; /* continue; */ $s = 6; continue; } k = _entry.k; v = _entry.v; _r$3 = fmt.Sprintf("

%s

%s", new sliceType$1([new $String(k), v])); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } content[0] = content[0] + (_r$3); _i++; $s = 6; continue; case 7: /* } */ case 4: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._entry = _entry; $f._i = _i; $f._keys = _keys; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._ref = _ref; $f.filter = filter; $f.flat = flat; $f.k = k; $f.lookups = lookups; $f.mode = mode; $f.split = split; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; })(content, filters); $r = addFlattened("Fully", "*"); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } filters[0] = new sliceType$2([]); _r = jq(new sliceType$1([new $String("input:checked")])); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = $clone(_r, jquery.JQuery).Each((function(content, filters) { return function $b(i, el) { var _r$1, _r$2, el, i, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; el = $f.el; i = $f.i; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = jq(new sliceType$1([el])); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = $clone(_r$1, jquery.JQuery).Attr("id"); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } filters[0] = $append(filters[0], _r$2); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f.el = el; $f.i = i; $f.$s = $s; $f.$r = $r; return $f; }; })(content, filters)); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; /* */ if (filters[0].$length > 0) { $s = 4; continue; } /* */ $s = 5; continue; /* if (filters[0].$length > 0) { */ case 4: $r = addFlattened("Selectively", strings.Join(filters[0], ",")); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: _r$2 = jq(new sliceType$1([new $String("#flattened")])); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = $clone(_r$2, jquery.JQuery).SetHtml(new $String(content[0])); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: renderResults }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.addFlattened = addFlattened; $f.content = content; $f.filters = filters; $f.$s = $s; $f.$r = $r; return $f; }; buildHTML = function(rec, domain$1) { var $24r, _r, _r$1, domain$1, h, rec, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _r = $f._r; _r$1 = $f._r$1; domain$1 = $f.domain$1; h = $f.h; rec = $f.rec; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: h = "

" + domain$1 + "

"; _r = fmt.Sprintf("

%d lookups

", new sliceType$1([new $Int(rec.Lookups())])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } h = h + (_r); _r$1 = genRoot(rec); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $24r = h + _r$1; $s = 3; case 3: return $24r; /* */ } return; } if ($f === undefined) { $f = { $blk: buildHTML }; } $f.$24r = $24r; $f._r = _r; $f._r$1 = _r$1; $f.domain$1 = domain$1; $f.h = h; $f.rec = rec; $f.$s = $s; $f.$r = $r; return $f; }; genRoot = function(rec) { var _i, _r, _r$1, _ref, h, p, rec, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; h = $f.h; p = $f.p; rec = $f.rec; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = fmt.Sprintf(" \n
    \n\t
  • %s
  • \n\t", new sliceType$1([new $String(rec.TXT())])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } h = _r; _ref = rec.Parts; _i = 0; /* while (true) { */ case 2: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 3; continue; } p = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r$1 = genPart(p); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } h = h + (_r$1); _i++; $s = 2; continue; case 3: h = h + ("
"); $s = -1; return h; /* */ } return; } if ($f === undefined) { $f = { $blk: genRoot }; } $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f.h = h; $f.p = p; $f.rec = rec; $f.$s = $s; $f.$r = $r; return $f; }; genPart = function(rec) { var $24r, _i, _r, _r$1, _r$2, _r$3, _ref, h, p, rec, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $24r = $f.$24r; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; h = $f.h; p = $f.p; rec = $f.rec; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (!rec.IsLookup) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!rec.IsLookup) { */ case 1: _r = fmt.Sprintf("
  • %s
  • ", new sliceType$1([new $String(rec.Text)])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 4; case 4: return $24r; /* } */ case 2: _r$1 = fmt.Sprintf("
  • \n\t\n\t", new sliceType$1([new $String(rec.IncludeDomain), new $String(rec.IncludeDomain), new $String(rec.IncludeDomain), new $String(rec.Text), new $Int((rec.IncludeRecord.Lookups() + 1 >> 0))])); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } h = _r$1; _r$2 = fmt.Sprintf("
      ", new sliceType$1([])); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } h = h + (_r$2); _ref = rec.IncludeRecord.Parts; _i = 0; /* while (true) { */ case 7: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 8; continue; } p = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r$3 = genPart(p); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } h = h + (_r$3); _i++; $s = 7; continue; case 8: h = h + ("
    "); h = h + ("
  • "); $s = -1; return h; /* */ } return; } if ($f === undefined) { $f = { $blk: genPart }; } $f.$24r = $24r; $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.h = h; $f.p = p; $f.rec = rec; $f.$s = $s; $f.$r = $r; return $f; }; gResolver.methods = [{prop: "GetSPF", name: "GetSPF", pkg: "", typ: $funcType([$String], [$String, $error], false)}]; gResolver.init("", []); gResp.init("", [{prop: "Status", name: "Status", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Answer", name: "Answer", embedded: false, exported: true, typ: sliceType, 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 = json.$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 = spflib.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = jquery.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = http.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strings.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } parsed = ptrType.nil; domain = ""; jq = jquery.NewJQuery; resolver = new gResolver.ptr(); /* */ if ($pkg === $mainPkg) { $s = 7; continue; } /* */ $s = 8; continue; /* if ($pkg === $mainPkg) { */ case 7: $r = main(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $mainFinished = true; /* } */ case 8: /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $synthesizeMethods(); $initAllLinknames(); var $mainPkg = $packages["github.com/StackExchange/dnscontrol/v4/docs/flattener"]; $packages["runtime"].$init(); $go($mainPkg.$init, []); $flushConsole(); }).call(this); //# sourceMappingURL=flattener.js.map